From ee974a59612f06589224b2456fd03e74eaf3b928 Mon Sep 17 00:00:00 2001 From: Alex <33497058+bexsoft@users.noreply.github.com> Date: Wed, 7 May 2025 15:37:20 -0600 Subject: [PATCH] Release v2.0.0 (#3526) Signed-off-by: Benjamin Perez --- CHANGELOG.md | 15 + Makefile | 6 +- web-app/build/asset-manifest.json | 176 +- web-app/build/index.html | 2 +- web-app/build/scripts/pdf.worker.min.mjs | 104146 ++++++++------- .../build/static/css/main.e60e4760.css.map | 2 +- .../build/static/js/1011.75fdf45e.chunk.js | 2 - .../static/js/1011.75fdf45e.chunk.js.map | 1 - web-app/build/static/js/12.fcd89e94.chunk.js | 2 - .../build/static/js/12.fcd89e94.chunk.js.map | 1 - .../build/static/js/1303.6fa13ab4.chunk.js | 2 - .../static/js/1303.6fa13ab4.chunk.js.map | 1 - .../build/static/js/1324.b4c459ae.chunk.js | 2 - .../static/js/1324.b4c459ae.chunk.js.map | 1 - .../build/static/js/1370.7d88b85a.chunk.js | 2 - .../static/js/1370.7d88b85a.chunk.js.map | 1 - web-app/build/static/js/144.a307e795.chunk.js | 2 - .../build/static/js/144.a307e795.chunk.js.map | 1 - web-app/build/static/js/153.0edba926.chunk.js | 2 + .../build/static/js/153.0edba926.chunk.js.map | 1 + web-app/build/static/js/182.6e133743.chunk.js | 2 - .../build/static/js/182.6e133743.chunk.js.map | 1 - .../build/static/js/2033.a048316b.chunk.js | 2 - .../static/js/2033.a048316b.chunk.js.map | 1 - .../build/static/js/2138.a8c39913.chunk.js | 2 - .../static/js/2138.a8c39913.chunk.js.map | 1 - .../build/static/js/2209.3b0ca7fa.chunk.js | 2 - .../static/js/2209.3b0ca7fa.chunk.js.map | 1 - .../build/static/js/2372.6b4933ca.chunk.js | 2 - .../static/js/2372.6b4933ca.chunk.js.map | 1 - web-app/build/static/js/24.e576918a.chunk.js | 2 - .../build/static/js/24.e576918a.chunk.js.map | 1 - .../build/static/js/2491.b81bd18c.chunk.js | 2 - .../static/js/2491.b81bd18c.chunk.js.map | 1 - web-app/build/static/js/258.1442e3bb.chunk.js | 2 + .../build/static/js/258.1442e3bb.chunk.js.map | 1 + .../build/static/js/2689.2888d029.chunk.js | 2 - .../static/js/2689.2888d029.chunk.js.map | 1 - .../build/static/js/2704.1285a8c1.chunk.js | 2 - .../static/js/2704.1285a8c1.chunk.js.map | 1 - .../build/static/js/3298.bc647bb4.chunk.js | 2 - .../static/js/3298.bc647bb4.chunk.js.map | 1 - .../build/static/js/3323.8de9a2da.chunk.js | 2 - .../static/js/3323.8de9a2da.chunk.js.map | 1 - .../build/static/js/3329.df273360.chunk.js | 2 - .../static/js/3329.df273360.chunk.js.map | 1 - .../build/static/js/3527.0fc04358.chunk.js | 2 - .../static/js/3527.0fc04358.chunk.js.map | 1 - web-app/build/static/js/368.b04989d2.chunk.js | 3 + ....txt => 368.b04989d2.chunk.js.LICENSE.txt} | 2 +- .../build/static/js/368.b04989d2.chunk.js.map | 1 + .../build/static/js/3851.ee2f94b6.chunk.js | 2 - .../static/js/3851.ee2f94b6.chunk.js.map | 1 - .../build/static/js/4172.d98e6099.chunk.js | 2 - .../static/js/4172.d98e6099.chunk.js.map | 1 - web-app/build/static/js/459.8799175b.chunk.js | 2 - .../build/static/js/459.8799175b.chunk.js.map | 1 - .../build/static/js/4676.563616b8.chunk.js | 2 - .../static/js/4676.563616b8.chunk.js.map | 1 - .../build/static/js/4705.1fa96caf.chunk.js | 2 - .../static/js/4705.1fa96caf.chunk.js.map | 1 - web-app/build/static/js/502.b83faa7c.chunk.js | 2 - .../build/static/js/502.b83faa7c.chunk.js.map | 1 - .../build/static/js/5067.2702d94c.chunk.js | 3 - .../static/js/5067.2702d94c.chunk.js.map | 1 - .../build/static/js/5079.a17a3c13.chunk.js | 2 - .../static/js/5079.a17a3c13.chunk.js.map | 1 - .../build/static/js/5128.a4f856c7.chunk.js | 2 - .../static/js/5128.a4f856c7.chunk.js.map | 1 - .../build/static/js/5153.a670aac5.chunk.js | 2 - .../static/js/5153.a670aac5.chunk.js.map | 1 - .../build/static/js/5200.12ba336c.chunk.js | 2 - .../static/js/5200.12ba336c.chunk.js.map | 1 - .../build/static/js/5301.79001158.chunk.js | 2 - .../static/js/5301.79001158.chunk.js.map | 1 - .../build/static/js/5311.33b9cf56.chunk.js | 2 - .../static/js/5311.33b9cf56.chunk.js.map | 1 - .../build/static/js/5699.7bb3293b.chunk.js | 2 - .../static/js/5699.7bb3293b.chunk.js.map | 1 - .../build/static/js/5711.6f5b125a.chunk.js | 2 - .../static/js/5711.6f5b125a.chunk.js.map | 1 - .../build/static/js/5809.a7e08101.chunk.js | 2 - .../static/js/5809.a7e08101.chunk.js.map | 1 - .../build/static/js/5851.9e5683a6.chunk.js | 2 - .../static/js/5851.9e5683a6.chunk.js.map | 1 - .../build/static/js/5872.deed6239.chunk.js | 2 - .../static/js/5872.deed6239.chunk.js.map | 1 - .../build/static/js/5941.59ff87cc.chunk.js | 2 - .../static/js/5941.59ff87cc.chunk.js.map | 1 - web-app/build/static/js/6.304df09b.chunk.js | 2 + .../build/static/js/6.304df09b.chunk.js.map | 1 + .../build/static/js/6065.740f3e17.chunk.js | 2 - .../static/js/6065.740f3e17.chunk.js.map | 1 - .../build/static/js/6108.84010ebc.chunk.js | 2 - .../static/js/6108.84010ebc.chunk.js.map | 1 - web-app/build/static/js/614.29e0d9dd.chunk.js | 2 - .../build/static/js/614.29e0d9dd.chunk.js.map | 1 - .../build/static/js/6140.ff277d79.chunk.js | 2 - .../static/js/6140.ff277d79.chunk.js.map | 1 - .../build/static/js/6164.89e6e237.chunk.js | 2 - .../static/js/6164.89e6e237.chunk.js.map | 1 - .../build/static/js/6654.bfc29bf7.chunk.js | 2 - .../static/js/6654.bfc29bf7.chunk.js.map | 1 - .../build/static/js/6799.c970e1e8.chunk.js | 2 - .../static/js/6799.c970e1e8.chunk.js.map | 1 - .../build/static/js/6925.c3c29d15.chunk.js | 2 - .../static/js/6925.c3c29d15.chunk.js.map | 1 - web-app/build/static/js/704.08d49eab.chunk.js | 2 + .../build/static/js/704.08d49eab.chunk.js.map | 1 + .../build/static/js/7041.58cb8aa5.chunk.js | 2 - .../static/js/7041.58cb8aa5.chunk.js.map | 1 - .../build/static/js/7052.e339a487.chunk.js | 2 - .../static/js/7052.e339a487.chunk.js.map | 1 - .../build/static/js/7264.272579ce.chunk.js | 2 - .../static/js/7264.272579ce.chunk.js.map | 1 - .../build/static/js/7435.279d39d5.chunk.js | 2 - .../static/js/7435.279d39d5.chunk.js.map | 1 - .../build/static/js/7485.bf57295d.chunk.js | 2 - .../static/js/7485.bf57295d.chunk.js.map | 1 - .../build/static/js/7515.3c5e861f.chunk.js | 2 - .../static/js/7515.3c5e861f.chunk.js.map | 1 - web-app/build/static/js/755.3e336243.chunk.js | 2 - .../build/static/js/755.3e336243.chunk.js.map | 1 - web-app/build/static/js/755.769f8547.chunk.js | 2 + .../build/static/js/755.769f8547.chunk.js.map | 1 + .../build/static/js/7601.74b87c2f.chunk.js | 2 - .../static/js/7601.74b87c2f.chunk.js.map | 1 - .../build/static/js/7643.d3ef8c65.chunk.js | 2 - .../static/js/7643.d3ef8c65.chunk.js.map | 1 - .../build/static/js/7659.9554f8f3.chunk.js | 2 - .../static/js/7659.9554f8f3.chunk.js.map | 1 - web-app/build/static/js/774.6415c182.chunk.js | 2 + .../build/static/js/774.6415c182.chunk.js.map | 1 + .../build/static/js/7774.a3ae398a.chunk.js | 2 - .../static/js/7774.a3ae398a.chunk.js.map | 1 - .../build/static/js/7880.5e820de1.chunk.js | 2 - .../static/js/7880.5e820de1.chunk.js.map | 1 - .../build/static/js/8010.f3d6885a.chunk.js | 2 - .../static/js/8010.f3d6885a.chunk.js.map | 1 - .../build/static/js/8017.9cff1006.chunk.js | 2 - .../static/js/8017.9cff1006.chunk.js.map | 1 - .../build/static/js/8104.047c0527.chunk.js | 3 - .../js/8104.047c0527.chunk.js.LICENSE.txt | 153 - .../static/js/8104.047c0527.chunk.js.map | 1 - .../build/static/js/8152.51d0ef4b.chunk.js | 2 - .../static/js/8152.51d0ef4b.chunk.js.map | 1 - .../build/static/js/8642.6ba87ff0.chunk.js | 2 - .../static/js/8642.6ba87ff0.chunk.js.map | 1 - web-app/build/static/js/868.84f9ff08.chunk.js | 3 + .../js/868.84f9ff08.chunk.js.LICENSE.txt | 6 + .../build/static/js/868.84f9ff08.chunk.js.map | 1 + .../build/static/js/8715.08b2d38b.chunk.js | 2 - .../static/js/8715.08b2d38b.chunk.js.map | 1 - .../build/static/js/8769.731be02d.chunk.js | 2 - .../static/js/8769.731be02d.chunk.js.map | 1 - .../build/static/js/8789.02b80e81.chunk.js | 2 - .../static/js/8789.02b80e81.chunk.js.map | 1 - web-app/build/static/js/88.435ad87d.chunk.js | 2 + .../build/static/js/88.435ad87d.chunk.js.map | 1 + .../build/static/js/8823.bc273dec.chunk.js | 2 - .../static/js/8823.bc273dec.chunk.js.map | 1 - .../build/static/js/8963.d2703f60.chunk.js | 2 - .../static/js/8963.d2703f60.chunk.js.map | 1 - .../build/static/js/9269.80d85085.chunk.js | 2 - .../static/js/9269.80d85085.chunk.js.map | 1 - .../build/static/js/9361.f4bfeb22.chunk.js | 2 - .../static/js/9361.f4bfeb22.chunk.js.map | 1 - web-app/build/static/js/941.97a59715.chunk.js | 2 + .../build/static/js/941.97a59715.chunk.js.map | 1 + web-app/build/static/js/960.8c1c0677.chunk.js | 2 - .../build/static/js/960.8c1c0677.chunk.js.map | 1 - .../build/static/js/9619.7478aab8.chunk.js | 2 - .../static/js/9619.7478aab8.chunk.js.map | 1 - .../build/static/js/9714.cf260d8c.chunk.js | 2 - .../static/js/9714.cf260d8c.chunk.js.map | 1 - web-app/build/static/js/985.46ebf89c.chunk.js | 2 - .../build/static/js/985.46ebf89c.chunk.js.map | 1 - .../build/static/js/9965.bf313381.chunk.js | 2 - .../static/js/9965.bf313381.chunk.js.map | 1 - web-app/build/static/js/main.45669c2e.js | 3 - web-app/build/static/js/main.45669c2e.js.map | 1 - web-app/build/static/js/main.758e24eb.js | 323 + ...CENSE.txt => main.758e24eb.js.LICENSE.txt} | 15 +- web-app/build/static/js/main.758e24eb.js.map | 1 + web-app/package.json | 1 + web-app/yarn.lock | 375 +- 186 files changed, 59043 insertions(+), 46443 deletions(-) delete mode 100644 web-app/build/static/js/1011.75fdf45e.chunk.js delete mode 100644 web-app/build/static/js/1011.75fdf45e.chunk.js.map delete mode 100644 web-app/build/static/js/12.fcd89e94.chunk.js delete mode 100644 web-app/build/static/js/12.fcd89e94.chunk.js.map delete mode 100644 web-app/build/static/js/1303.6fa13ab4.chunk.js delete mode 100644 web-app/build/static/js/1303.6fa13ab4.chunk.js.map delete mode 100644 web-app/build/static/js/1324.b4c459ae.chunk.js delete mode 100644 web-app/build/static/js/1324.b4c459ae.chunk.js.map delete mode 100644 web-app/build/static/js/1370.7d88b85a.chunk.js delete mode 100644 web-app/build/static/js/1370.7d88b85a.chunk.js.map delete mode 100644 web-app/build/static/js/144.a307e795.chunk.js delete mode 100644 web-app/build/static/js/144.a307e795.chunk.js.map create mode 100644 web-app/build/static/js/153.0edba926.chunk.js create mode 100644 web-app/build/static/js/153.0edba926.chunk.js.map delete mode 100644 web-app/build/static/js/182.6e133743.chunk.js delete mode 100644 web-app/build/static/js/182.6e133743.chunk.js.map delete mode 100644 web-app/build/static/js/2033.a048316b.chunk.js delete mode 100644 web-app/build/static/js/2033.a048316b.chunk.js.map delete mode 100644 web-app/build/static/js/2138.a8c39913.chunk.js delete mode 100644 web-app/build/static/js/2138.a8c39913.chunk.js.map delete mode 100644 web-app/build/static/js/2209.3b0ca7fa.chunk.js delete mode 100644 web-app/build/static/js/2209.3b0ca7fa.chunk.js.map delete mode 100644 web-app/build/static/js/2372.6b4933ca.chunk.js delete mode 100644 web-app/build/static/js/2372.6b4933ca.chunk.js.map delete mode 100644 web-app/build/static/js/24.e576918a.chunk.js delete mode 100644 web-app/build/static/js/24.e576918a.chunk.js.map delete mode 100644 web-app/build/static/js/2491.b81bd18c.chunk.js delete mode 100644 web-app/build/static/js/2491.b81bd18c.chunk.js.map create mode 100644 web-app/build/static/js/258.1442e3bb.chunk.js create mode 100644 web-app/build/static/js/258.1442e3bb.chunk.js.map delete mode 100644 web-app/build/static/js/2689.2888d029.chunk.js delete mode 100644 web-app/build/static/js/2689.2888d029.chunk.js.map delete mode 100644 web-app/build/static/js/2704.1285a8c1.chunk.js delete mode 100644 web-app/build/static/js/2704.1285a8c1.chunk.js.map delete mode 100644 web-app/build/static/js/3298.bc647bb4.chunk.js delete mode 100644 web-app/build/static/js/3298.bc647bb4.chunk.js.map delete mode 100644 web-app/build/static/js/3323.8de9a2da.chunk.js delete mode 100644 web-app/build/static/js/3323.8de9a2da.chunk.js.map delete mode 100644 web-app/build/static/js/3329.df273360.chunk.js delete mode 100644 web-app/build/static/js/3329.df273360.chunk.js.map delete mode 100644 web-app/build/static/js/3527.0fc04358.chunk.js delete mode 100644 web-app/build/static/js/3527.0fc04358.chunk.js.map create mode 100644 web-app/build/static/js/368.b04989d2.chunk.js rename web-app/build/static/js/{5067.2702d94c.chunk.js.LICENSE.txt => 368.b04989d2.chunk.js.LICENSE.txt} (95%) create mode 100644 web-app/build/static/js/368.b04989d2.chunk.js.map delete mode 100644 web-app/build/static/js/3851.ee2f94b6.chunk.js delete mode 100644 web-app/build/static/js/3851.ee2f94b6.chunk.js.map delete mode 100644 web-app/build/static/js/4172.d98e6099.chunk.js delete mode 100644 web-app/build/static/js/4172.d98e6099.chunk.js.map delete mode 100644 web-app/build/static/js/459.8799175b.chunk.js delete mode 100644 web-app/build/static/js/459.8799175b.chunk.js.map delete mode 100644 web-app/build/static/js/4676.563616b8.chunk.js delete mode 100644 web-app/build/static/js/4676.563616b8.chunk.js.map delete mode 100644 web-app/build/static/js/4705.1fa96caf.chunk.js delete mode 100644 web-app/build/static/js/4705.1fa96caf.chunk.js.map delete mode 100644 web-app/build/static/js/502.b83faa7c.chunk.js delete mode 100644 web-app/build/static/js/502.b83faa7c.chunk.js.map delete mode 100644 web-app/build/static/js/5067.2702d94c.chunk.js delete mode 100644 web-app/build/static/js/5067.2702d94c.chunk.js.map delete mode 100644 web-app/build/static/js/5079.a17a3c13.chunk.js delete mode 100644 web-app/build/static/js/5079.a17a3c13.chunk.js.map delete mode 100644 web-app/build/static/js/5128.a4f856c7.chunk.js delete mode 100644 web-app/build/static/js/5128.a4f856c7.chunk.js.map delete mode 100644 web-app/build/static/js/5153.a670aac5.chunk.js delete mode 100644 web-app/build/static/js/5153.a670aac5.chunk.js.map delete mode 100644 web-app/build/static/js/5200.12ba336c.chunk.js delete mode 100644 web-app/build/static/js/5200.12ba336c.chunk.js.map delete mode 100644 web-app/build/static/js/5301.79001158.chunk.js delete mode 100644 web-app/build/static/js/5301.79001158.chunk.js.map delete mode 100644 web-app/build/static/js/5311.33b9cf56.chunk.js delete mode 100644 web-app/build/static/js/5311.33b9cf56.chunk.js.map delete mode 100644 web-app/build/static/js/5699.7bb3293b.chunk.js delete mode 100644 web-app/build/static/js/5699.7bb3293b.chunk.js.map delete mode 100644 web-app/build/static/js/5711.6f5b125a.chunk.js delete mode 100644 web-app/build/static/js/5711.6f5b125a.chunk.js.map delete mode 100644 web-app/build/static/js/5809.a7e08101.chunk.js delete mode 100644 web-app/build/static/js/5809.a7e08101.chunk.js.map delete mode 100644 web-app/build/static/js/5851.9e5683a6.chunk.js delete mode 100644 web-app/build/static/js/5851.9e5683a6.chunk.js.map delete mode 100644 web-app/build/static/js/5872.deed6239.chunk.js delete mode 100644 web-app/build/static/js/5872.deed6239.chunk.js.map delete mode 100644 web-app/build/static/js/5941.59ff87cc.chunk.js delete mode 100644 web-app/build/static/js/5941.59ff87cc.chunk.js.map create mode 100644 web-app/build/static/js/6.304df09b.chunk.js create mode 100644 web-app/build/static/js/6.304df09b.chunk.js.map delete mode 100644 web-app/build/static/js/6065.740f3e17.chunk.js delete mode 100644 web-app/build/static/js/6065.740f3e17.chunk.js.map delete mode 100644 web-app/build/static/js/6108.84010ebc.chunk.js delete mode 100644 web-app/build/static/js/6108.84010ebc.chunk.js.map delete mode 100644 web-app/build/static/js/614.29e0d9dd.chunk.js delete mode 100644 web-app/build/static/js/614.29e0d9dd.chunk.js.map delete mode 100644 web-app/build/static/js/6140.ff277d79.chunk.js delete mode 100644 web-app/build/static/js/6140.ff277d79.chunk.js.map delete mode 100644 web-app/build/static/js/6164.89e6e237.chunk.js delete mode 100644 web-app/build/static/js/6164.89e6e237.chunk.js.map delete mode 100644 web-app/build/static/js/6654.bfc29bf7.chunk.js delete mode 100644 web-app/build/static/js/6654.bfc29bf7.chunk.js.map delete mode 100644 web-app/build/static/js/6799.c970e1e8.chunk.js delete mode 100644 web-app/build/static/js/6799.c970e1e8.chunk.js.map delete mode 100644 web-app/build/static/js/6925.c3c29d15.chunk.js delete mode 100644 web-app/build/static/js/6925.c3c29d15.chunk.js.map create mode 100644 web-app/build/static/js/704.08d49eab.chunk.js create mode 100644 web-app/build/static/js/704.08d49eab.chunk.js.map delete mode 100644 web-app/build/static/js/7041.58cb8aa5.chunk.js delete mode 100644 web-app/build/static/js/7041.58cb8aa5.chunk.js.map delete mode 100644 web-app/build/static/js/7052.e339a487.chunk.js delete mode 100644 web-app/build/static/js/7052.e339a487.chunk.js.map delete mode 100644 web-app/build/static/js/7264.272579ce.chunk.js delete mode 100644 web-app/build/static/js/7264.272579ce.chunk.js.map delete mode 100644 web-app/build/static/js/7435.279d39d5.chunk.js delete mode 100644 web-app/build/static/js/7435.279d39d5.chunk.js.map delete mode 100644 web-app/build/static/js/7485.bf57295d.chunk.js delete mode 100644 web-app/build/static/js/7485.bf57295d.chunk.js.map delete mode 100644 web-app/build/static/js/7515.3c5e861f.chunk.js delete mode 100644 web-app/build/static/js/7515.3c5e861f.chunk.js.map delete mode 100644 web-app/build/static/js/755.3e336243.chunk.js delete mode 100644 web-app/build/static/js/755.3e336243.chunk.js.map create mode 100644 web-app/build/static/js/755.769f8547.chunk.js create mode 100644 web-app/build/static/js/755.769f8547.chunk.js.map delete mode 100644 web-app/build/static/js/7601.74b87c2f.chunk.js delete mode 100644 web-app/build/static/js/7601.74b87c2f.chunk.js.map delete mode 100644 web-app/build/static/js/7643.d3ef8c65.chunk.js delete mode 100644 web-app/build/static/js/7643.d3ef8c65.chunk.js.map delete mode 100644 web-app/build/static/js/7659.9554f8f3.chunk.js delete mode 100644 web-app/build/static/js/7659.9554f8f3.chunk.js.map create mode 100644 web-app/build/static/js/774.6415c182.chunk.js create mode 100644 web-app/build/static/js/774.6415c182.chunk.js.map delete mode 100644 web-app/build/static/js/7774.a3ae398a.chunk.js delete mode 100644 web-app/build/static/js/7774.a3ae398a.chunk.js.map delete mode 100644 web-app/build/static/js/7880.5e820de1.chunk.js delete mode 100644 web-app/build/static/js/7880.5e820de1.chunk.js.map delete mode 100644 web-app/build/static/js/8010.f3d6885a.chunk.js delete mode 100644 web-app/build/static/js/8010.f3d6885a.chunk.js.map delete mode 100644 web-app/build/static/js/8017.9cff1006.chunk.js delete mode 100644 web-app/build/static/js/8017.9cff1006.chunk.js.map delete mode 100644 web-app/build/static/js/8104.047c0527.chunk.js delete mode 100644 web-app/build/static/js/8104.047c0527.chunk.js.LICENSE.txt delete mode 100644 web-app/build/static/js/8104.047c0527.chunk.js.map delete mode 100644 web-app/build/static/js/8152.51d0ef4b.chunk.js delete mode 100644 web-app/build/static/js/8152.51d0ef4b.chunk.js.map delete mode 100644 web-app/build/static/js/8642.6ba87ff0.chunk.js delete mode 100644 web-app/build/static/js/8642.6ba87ff0.chunk.js.map create mode 100644 web-app/build/static/js/868.84f9ff08.chunk.js create mode 100644 web-app/build/static/js/868.84f9ff08.chunk.js.LICENSE.txt create mode 100644 web-app/build/static/js/868.84f9ff08.chunk.js.map delete mode 100644 web-app/build/static/js/8715.08b2d38b.chunk.js delete mode 100644 web-app/build/static/js/8715.08b2d38b.chunk.js.map delete mode 100644 web-app/build/static/js/8769.731be02d.chunk.js delete mode 100644 web-app/build/static/js/8769.731be02d.chunk.js.map delete mode 100644 web-app/build/static/js/8789.02b80e81.chunk.js delete mode 100644 web-app/build/static/js/8789.02b80e81.chunk.js.map create mode 100644 web-app/build/static/js/88.435ad87d.chunk.js create mode 100644 web-app/build/static/js/88.435ad87d.chunk.js.map delete mode 100644 web-app/build/static/js/8823.bc273dec.chunk.js delete mode 100644 web-app/build/static/js/8823.bc273dec.chunk.js.map delete mode 100644 web-app/build/static/js/8963.d2703f60.chunk.js delete mode 100644 web-app/build/static/js/8963.d2703f60.chunk.js.map delete mode 100644 web-app/build/static/js/9269.80d85085.chunk.js delete mode 100644 web-app/build/static/js/9269.80d85085.chunk.js.map delete mode 100644 web-app/build/static/js/9361.f4bfeb22.chunk.js delete mode 100644 web-app/build/static/js/9361.f4bfeb22.chunk.js.map create mode 100644 web-app/build/static/js/941.97a59715.chunk.js create mode 100644 web-app/build/static/js/941.97a59715.chunk.js.map delete mode 100644 web-app/build/static/js/960.8c1c0677.chunk.js delete mode 100644 web-app/build/static/js/960.8c1c0677.chunk.js.map delete mode 100644 web-app/build/static/js/9619.7478aab8.chunk.js delete mode 100644 web-app/build/static/js/9619.7478aab8.chunk.js.map delete mode 100644 web-app/build/static/js/9714.cf260d8c.chunk.js delete mode 100644 web-app/build/static/js/9714.cf260d8c.chunk.js.map delete mode 100644 web-app/build/static/js/985.46ebf89c.chunk.js delete mode 100644 web-app/build/static/js/985.46ebf89c.chunk.js.map delete mode 100644 web-app/build/static/js/9965.bf313381.chunk.js delete mode 100644 web-app/build/static/js/9965.bf313381.chunk.js.map delete mode 100644 web-app/build/static/js/main.45669c2e.js delete mode 100644 web-app/build/static/js/main.45669c2e.js.map create mode 100644 web-app/build/static/js/main.758e24eb.js rename web-app/build/static/js/{main.45669c2e.js.LICENSE.txt => main.758e24eb.js.LICENSE.txt} (90%) create mode 100644 web-app/build/static/js/main.758e24eb.js.map diff --git a/CHANGELOG.md b/CHANGELOG.md index 074606537..56a90d66f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## Release v2.0.0 + +Community version is going back to be an object browser only. + +Bug Fix: + +- Fixed Dependencies vulnerabilities + +Deprecations: + +- Deprecated support of accounts & policies management, this can be managed by using mc admin commands. Please refer to the [MinIO Console User Management page](https://min.io/docs/minio/kubernetes/upstream/administration/identity-access-management/minio-user-management.html#id1) for more information. +- Deprecated support of bucket management, this can be managed by using mc commands. Please refer to the [MinIO Client](https://min.io/docs/minio/linux/reference/minio-mc.html) for more information. +- Deprecated support of configuration management, this can be managed by using mc admin config commands. Please refer to the [MinIO Client](https://min.io/docs/minio/linux/reference/minio-mc.html) for more information. + + ## Release v1.7.6 Bug Fix: diff --git a/Makefile b/Makefile index 6fdf88ff2..1a7828f4c 100644 --- a/Makefile +++ b/Makefile @@ -57,10 +57,14 @@ clean-swagger: swagger-console: @echo "Generating swagger server code from yaml" @swagger generate server -A console --main-package=management --server-package=api --exclude-main -P models.Principal -f ./swagger.yml -r NOTICE + @echo "Ensure basic install" + @(cd web-app; yarn; cd ..) @echo "Generating typescript api" - @npx swagger-typescript-api -p ./swagger.yml -o ./web-app/src/api -n consoleApi.ts --custom-config generator.config.js + @make swagger-typescript-api path="../swagger.yml" output="./src/api" name="consoleApi.ts" @git restore api/server.go +swagger-typescript-api: + @(cd web-app; yarn swagger-typescript-api -p $(path) -o $(output) -n $(name) --custom-config ../generator.config.js; cd ..) assets: @(if [ -f "${NVM_DIR}/nvm.sh" ]; then \. "${NVM_DIR}/nvm.sh" && nvm install && nvm use && npm install -g yarn ; fi &&\ diff --git a/web-app/build/asset-manifest.json b/web-app/build/asset-manifest.json index ae660734b..fcf8b6e94 100644 --- a/web-app/build/asset-manifest.json +++ b/web-app/build/asset-manifest.json @@ -1,82 +1,17 @@ { "files": { "main.css": "./static/css/main.e60e4760.css", - "main.js": "./static/js/main.45669c2e.js", - "static/js/5301.79001158.chunk.js": "./static/js/5301.79001158.chunk.js", - "static/js/9361.f4bfeb22.chunk.js": "./static/js/9361.f4bfeb22.chunk.js", - "static/js/5711.6f5b125a.chunk.js": "./static/js/5711.6f5b125a.chunk.js", - "static/js/8769.731be02d.chunk.js": "./static/js/8769.731be02d.chunk.js", - "static/js/2033.a048316b.chunk.js": "./static/js/2033.a048316b.chunk.js", - "static/js/6164.89e6e237.chunk.js": "./static/js/6164.89e6e237.chunk.js", - "static/js/2372.6b4933ca.chunk.js": "./static/js/2372.6b4933ca.chunk.js", - "static/js/1324.b4c459ae.chunk.js": "./static/js/1324.b4c459ae.chunk.js", - "static/js/5872.deed6239.chunk.js": "./static/js/5872.deed6239.chunk.js", - "static/js/755.3e336243.chunk.js": "./static/js/755.3e336243.chunk.js", - "static/js/8715.08b2d38b.chunk.js": "./static/js/8715.08b2d38b.chunk.js", - "static/js/7880.5e820de1.chunk.js": "./static/js/7880.5e820de1.chunk.js", - "static/js/2209.3b0ca7fa.chunk.js": "./static/js/2209.3b0ca7fa.chunk.js", - "static/js/7435.279d39d5.chunk.js": "./static/js/7435.279d39d5.chunk.js", - "static/js/2491.b81bd18c.chunk.js": "./static/js/2491.b81bd18c.chunk.js", - "static/js/9269.80d85085.chunk.js": "./static/js/9269.80d85085.chunk.js", - "static/js/6925.c3c29d15.chunk.js": "./static/js/6925.c3c29d15.chunk.js", - "static/js/3527.0fc04358.chunk.js": "./static/js/3527.0fc04358.chunk.js", - "static/js/8789.02b80e81.chunk.js": "./static/js/8789.02b80e81.chunk.js", - "static/js/7485.bf57295d.chunk.js": "./static/js/7485.bf57295d.chunk.js", - "static/js/7041.58cb8aa5.chunk.js": "./static/js/7041.58cb8aa5.chunk.js", - "static/js/2138.a8c39913.chunk.js": "./static/js/2138.a8c39913.chunk.js", - "static/js/5699.7bb3293b.chunk.js": "./static/js/5699.7bb3293b.chunk.js", - "static/js/5153.a670aac5.chunk.js": "./static/js/5153.a670aac5.chunk.js", - "static/js/7052.e339a487.chunk.js": "./static/js/7052.e339a487.chunk.js", - "static/js/144.a307e795.chunk.js": "./static/js/144.a307e795.chunk.js", - "static/js/7601.74b87c2f.chunk.js": "./static/js/7601.74b87c2f.chunk.js", - "static/js/182.6e133743.chunk.js": "./static/js/182.6e133743.chunk.js", - "static/js/8017.9cff1006.chunk.js": "./static/js/8017.9cff1006.chunk.js", - "static/js/3323.8de9a2da.chunk.js": "./static/js/3323.8de9a2da.chunk.js", - "static/js/5128.a4f856c7.chunk.js": "./static/js/5128.a4f856c7.chunk.js", - "static/js/6140.ff277d79.chunk.js": "./static/js/6140.ff277d79.chunk.js", - "static/js/3298.bc647bb4.chunk.js": "./static/js/3298.bc647bb4.chunk.js", - "static/js/7643.d3ef8c65.chunk.js": "./static/js/7643.d3ef8c65.chunk.js", - "static/js/9619.7478aab8.chunk.js": "./static/js/9619.7478aab8.chunk.js", - "static/js/985.46ebf89c.chunk.js": "./static/js/985.46ebf89c.chunk.js", - "static/js/1370.7d88b85a.chunk.js": "./static/js/1370.7d88b85a.chunk.js", - "static/js/8823.bc273dec.chunk.js": "./static/js/8823.bc273dec.chunk.js", - "static/js/24.e576918a.chunk.js": "./static/js/24.e576918a.chunk.js", - "static/js/5851.9e5683a6.chunk.js": "./static/js/5851.9e5683a6.chunk.js", - "static/js/4705.1fa96caf.chunk.js": "./static/js/4705.1fa96caf.chunk.js", - "static/js/8963.d2703f60.chunk.js": "./static/js/8963.d2703f60.chunk.js", - "static/js/960.8c1c0677.chunk.js": "./static/js/960.8c1c0677.chunk.js", - "static/js/8642.6ba87ff0.chunk.js": "./static/js/8642.6ba87ff0.chunk.js", - "static/js/3329.df273360.chunk.js": "./static/js/3329.df273360.chunk.js", - "static/js/5941.59ff87cc.chunk.js": "./static/js/5941.59ff87cc.chunk.js", - "static/js/2704.1285a8c1.chunk.js": "./static/js/2704.1285a8c1.chunk.js", - "static/js/7774.a3ae398a.chunk.js": "./static/js/7774.a3ae398a.chunk.js", - "static/js/3851.ee2f94b6.chunk.js": "./static/js/3851.ee2f94b6.chunk.js", - "static/js/9965.bf313381.chunk.js": "./static/js/9965.bf313381.chunk.js", - "static/js/6065.740f3e17.chunk.js": "./static/js/6065.740f3e17.chunk.js", - "static/js/12.fcd89e94.chunk.js": "./static/js/12.fcd89e94.chunk.js", - "static/js/8010.f3d6885a.chunk.js": "./static/js/8010.f3d6885a.chunk.js", - "static/js/2689.2888d029.chunk.js": "./static/js/2689.2888d029.chunk.js", - "static/js/4676.563616b8.chunk.js": "./static/js/4676.563616b8.chunk.js", - "static/js/614.29e0d9dd.chunk.js": "./static/js/614.29e0d9dd.chunk.js", - "static/js/502.b83faa7c.chunk.js": "./static/js/502.b83faa7c.chunk.js", - "static/js/6799.c970e1e8.chunk.js": "./static/js/6799.c970e1e8.chunk.js", - "static/js/7659.9554f8f3.chunk.js": "./static/js/7659.9554f8f3.chunk.js", - "static/js/7515.3c5e861f.chunk.js": "./static/js/7515.3c5e861f.chunk.js", - "static/js/6654.bfc29bf7.chunk.js": "./static/js/6654.bfc29bf7.chunk.js", - "static/js/5311.33b9cf56.chunk.js": "./static/js/5311.33b9cf56.chunk.js", - "static/js/5809.a7e08101.chunk.js": "./static/js/5809.a7e08101.chunk.js", - "static/js/7264.272579ce.chunk.js": "./static/js/7264.272579ce.chunk.js", - "static/js/4172.d98e6099.chunk.js": "./static/js/4172.d98e6099.chunk.js", - "static/js/6108.84010ebc.chunk.js": "./static/js/6108.84010ebc.chunk.js", - "static/js/9714.cf260d8c.chunk.js": "./static/js/9714.cf260d8c.chunk.js", - "static/js/459.8799175b.chunk.js": "./static/js/459.8799175b.chunk.js", - "static/js/8152.51d0ef4b.chunk.js": "./static/js/8152.51d0ef4b.chunk.js", - "static/js/1303.6fa13ab4.chunk.js": "./static/js/1303.6fa13ab4.chunk.js", - "static/js/5079.a17a3c13.chunk.js": "./static/js/5079.a17a3c13.chunk.js", - "static/js/5200.12ba336c.chunk.js": "./static/js/5200.12ba336c.chunk.js", - "static/js/5067.2702d94c.chunk.js": "./static/js/5067.2702d94c.chunk.js", - "static/js/8104.047c0527.chunk.js": "./static/js/8104.047c0527.chunk.js", - "static/js/1011.75fdf45e.chunk.js": "./static/js/1011.75fdf45e.chunk.js", + "main.js": "./static/js/main.758e24eb.js", + "static/js/6.304df09b.chunk.js": "./static/js/6.304df09b.chunk.js", + "static/js/258.1442e3bb.chunk.js": "./static/js/258.1442e3bb.chunk.js", + "static/js/755.769f8547.chunk.js": "./static/js/755.769f8547.chunk.js", + "static/js/153.0edba926.chunk.js": "./static/js/153.0edba926.chunk.js", + "static/js/88.435ad87d.chunk.js": "./static/js/88.435ad87d.chunk.js", + "static/js/941.97a59715.chunk.js": "./static/js/941.97a59715.chunk.js", + "static/js/704.08d49eab.chunk.js": "./static/js/704.08d49eab.chunk.js", + "static/js/774.6415c182.chunk.js": "./static/js/774.6415c182.chunk.js", + "static/js/868.84f9ff08.chunk.js": "./static/js/868.84f9ff08.chunk.js", + "static/js/368.b04989d2.chunk.js": "./static/js/368.b04989d2.chunk.js", "static/media/videoBG.mp4": "./static/media/videoBG.17363418b3c2246a0e27.mp4", "static/media/loginAnimationPoster.png": "./static/media/loginAnimationPoster.9aa924bfe619e71d5d29.png", "static/media/Inter-BoldItalic.woff": "./static/media/Inter-BoldItalic.b376885042f6c961a541.woff", @@ -100,85 +35,20 @@ "static/media/placeholderimage.png": "./static/media/placeholderimage.077ea48bd1ef1f4a883f.png", "index.html": "./index.html", "main.e60e4760.css.map": "./static/css/main.e60e4760.css.map", - "main.45669c2e.js.map": "./static/js/main.45669c2e.js.map", - "5301.79001158.chunk.js.map": "./static/js/5301.79001158.chunk.js.map", - "9361.f4bfeb22.chunk.js.map": "./static/js/9361.f4bfeb22.chunk.js.map", - "5711.6f5b125a.chunk.js.map": "./static/js/5711.6f5b125a.chunk.js.map", - "8769.731be02d.chunk.js.map": "./static/js/8769.731be02d.chunk.js.map", - "2033.a048316b.chunk.js.map": "./static/js/2033.a048316b.chunk.js.map", - "6164.89e6e237.chunk.js.map": "./static/js/6164.89e6e237.chunk.js.map", - "2372.6b4933ca.chunk.js.map": "./static/js/2372.6b4933ca.chunk.js.map", - "1324.b4c459ae.chunk.js.map": "./static/js/1324.b4c459ae.chunk.js.map", - "5872.deed6239.chunk.js.map": "./static/js/5872.deed6239.chunk.js.map", - "755.3e336243.chunk.js.map": "./static/js/755.3e336243.chunk.js.map", - "8715.08b2d38b.chunk.js.map": "./static/js/8715.08b2d38b.chunk.js.map", - "7880.5e820de1.chunk.js.map": "./static/js/7880.5e820de1.chunk.js.map", - "2209.3b0ca7fa.chunk.js.map": "./static/js/2209.3b0ca7fa.chunk.js.map", - "7435.279d39d5.chunk.js.map": "./static/js/7435.279d39d5.chunk.js.map", - "2491.b81bd18c.chunk.js.map": "./static/js/2491.b81bd18c.chunk.js.map", - "9269.80d85085.chunk.js.map": "./static/js/9269.80d85085.chunk.js.map", - "6925.c3c29d15.chunk.js.map": "./static/js/6925.c3c29d15.chunk.js.map", - "3527.0fc04358.chunk.js.map": "./static/js/3527.0fc04358.chunk.js.map", - "8789.02b80e81.chunk.js.map": "./static/js/8789.02b80e81.chunk.js.map", - "7485.bf57295d.chunk.js.map": "./static/js/7485.bf57295d.chunk.js.map", - "7041.58cb8aa5.chunk.js.map": "./static/js/7041.58cb8aa5.chunk.js.map", - "2138.a8c39913.chunk.js.map": "./static/js/2138.a8c39913.chunk.js.map", - "5699.7bb3293b.chunk.js.map": "./static/js/5699.7bb3293b.chunk.js.map", - "5153.a670aac5.chunk.js.map": "./static/js/5153.a670aac5.chunk.js.map", - "7052.e339a487.chunk.js.map": "./static/js/7052.e339a487.chunk.js.map", - "144.a307e795.chunk.js.map": "./static/js/144.a307e795.chunk.js.map", - "7601.74b87c2f.chunk.js.map": "./static/js/7601.74b87c2f.chunk.js.map", - "182.6e133743.chunk.js.map": "./static/js/182.6e133743.chunk.js.map", - "8017.9cff1006.chunk.js.map": "./static/js/8017.9cff1006.chunk.js.map", - "3323.8de9a2da.chunk.js.map": "./static/js/3323.8de9a2da.chunk.js.map", - "5128.a4f856c7.chunk.js.map": "./static/js/5128.a4f856c7.chunk.js.map", - "6140.ff277d79.chunk.js.map": "./static/js/6140.ff277d79.chunk.js.map", - "3298.bc647bb4.chunk.js.map": "./static/js/3298.bc647bb4.chunk.js.map", - "7643.d3ef8c65.chunk.js.map": "./static/js/7643.d3ef8c65.chunk.js.map", - "9619.7478aab8.chunk.js.map": "./static/js/9619.7478aab8.chunk.js.map", - "985.46ebf89c.chunk.js.map": "./static/js/985.46ebf89c.chunk.js.map", - "1370.7d88b85a.chunk.js.map": "./static/js/1370.7d88b85a.chunk.js.map", - "8823.bc273dec.chunk.js.map": "./static/js/8823.bc273dec.chunk.js.map", - "24.e576918a.chunk.js.map": "./static/js/24.e576918a.chunk.js.map", - "5851.9e5683a6.chunk.js.map": "./static/js/5851.9e5683a6.chunk.js.map", - "4705.1fa96caf.chunk.js.map": "./static/js/4705.1fa96caf.chunk.js.map", - "8963.d2703f60.chunk.js.map": "./static/js/8963.d2703f60.chunk.js.map", - "960.8c1c0677.chunk.js.map": "./static/js/960.8c1c0677.chunk.js.map", - "8642.6ba87ff0.chunk.js.map": "./static/js/8642.6ba87ff0.chunk.js.map", - "3329.df273360.chunk.js.map": "./static/js/3329.df273360.chunk.js.map", - "5941.59ff87cc.chunk.js.map": "./static/js/5941.59ff87cc.chunk.js.map", - "2704.1285a8c1.chunk.js.map": "./static/js/2704.1285a8c1.chunk.js.map", - "7774.a3ae398a.chunk.js.map": "./static/js/7774.a3ae398a.chunk.js.map", - "3851.ee2f94b6.chunk.js.map": "./static/js/3851.ee2f94b6.chunk.js.map", - "9965.bf313381.chunk.js.map": "./static/js/9965.bf313381.chunk.js.map", - "6065.740f3e17.chunk.js.map": "./static/js/6065.740f3e17.chunk.js.map", - "12.fcd89e94.chunk.js.map": "./static/js/12.fcd89e94.chunk.js.map", - "8010.f3d6885a.chunk.js.map": "./static/js/8010.f3d6885a.chunk.js.map", - "2689.2888d029.chunk.js.map": "./static/js/2689.2888d029.chunk.js.map", - "4676.563616b8.chunk.js.map": "./static/js/4676.563616b8.chunk.js.map", - "614.29e0d9dd.chunk.js.map": "./static/js/614.29e0d9dd.chunk.js.map", - "502.b83faa7c.chunk.js.map": "./static/js/502.b83faa7c.chunk.js.map", - "6799.c970e1e8.chunk.js.map": "./static/js/6799.c970e1e8.chunk.js.map", - "7659.9554f8f3.chunk.js.map": "./static/js/7659.9554f8f3.chunk.js.map", - "7515.3c5e861f.chunk.js.map": "./static/js/7515.3c5e861f.chunk.js.map", - "6654.bfc29bf7.chunk.js.map": "./static/js/6654.bfc29bf7.chunk.js.map", - "5311.33b9cf56.chunk.js.map": "./static/js/5311.33b9cf56.chunk.js.map", - "5809.a7e08101.chunk.js.map": "./static/js/5809.a7e08101.chunk.js.map", - "7264.272579ce.chunk.js.map": "./static/js/7264.272579ce.chunk.js.map", - "4172.d98e6099.chunk.js.map": "./static/js/4172.d98e6099.chunk.js.map", - "6108.84010ebc.chunk.js.map": "./static/js/6108.84010ebc.chunk.js.map", - "9714.cf260d8c.chunk.js.map": "./static/js/9714.cf260d8c.chunk.js.map", - "459.8799175b.chunk.js.map": "./static/js/459.8799175b.chunk.js.map", - "8152.51d0ef4b.chunk.js.map": "./static/js/8152.51d0ef4b.chunk.js.map", - "1303.6fa13ab4.chunk.js.map": "./static/js/1303.6fa13ab4.chunk.js.map", - "5079.a17a3c13.chunk.js.map": "./static/js/5079.a17a3c13.chunk.js.map", - "5200.12ba336c.chunk.js.map": "./static/js/5200.12ba336c.chunk.js.map", - "5067.2702d94c.chunk.js.map": "./static/js/5067.2702d94c.chunk.js.map", - "8104.047c0527.chunk.js.map": "./static/js/8104.047c0527.chunk.js.map", - "1011.75fdf45e.chunk.js.map": "./static/js/1011.75fdf45e.chunk.js.map" + "main.758e24eb.js.map": "./static/js/main.758e24eb.js.map", + "6.304df09b.chunk.js.map": "./static/js/6.304df09b.chunk.js.map", + "258.1442e3bb.chunk.js.map": "./static/js/258.1442e3bb.chunk.js.map", + "755.769f8547.chunk.js.map": "./static/js/755.769f8547.chunk.js.map", + "153.0edba926.chunk.js.map": "./static/js/153.0edba926.chunk.js.map", + "88.435ad87d.chunk.js.map": "./static/js/88.435ad87d.chunk.js.map", + "941.97a59715.chunk.js.map": "./static/js/941.97a59715.chunk.js.map", + "704.08d49eab.chunk.js.map": "./static/js/704.08d49eab.chunk.js.map", + "774.6415c182.chunk.js.map": "./static/js/774.6415c182.chunk.js.map", + "868.84f9ff08.chunk.js.map": "./static/js/868.84f9ff08.chunk.js.map", + "368.b04989d2.chunk.js.map": "./static/js/368.b04989d2.chunk.js.map" }, "entrypoints": [ "static/css/main.e60e4760.css", - "static/js/main.45669c2e.js" + "static/js/main.758e24eb.js" ] } \ No newline at end of file diff --git a/web-app/build/index.html b/web-app/build/index.html index d6e759d26..ab5d6163f 100644 --- a/web-app/build/index.html +++ b/web-app/build/index.html @@ -1 +1 @@ -MinIO Console
\ No newline at end of file +MinIO Console
\ No newline at end of file diff --git a/web-app/build/scripts/pdf.worker.min.mjs b/web-app/build/scripts/pdf.worker.min.mjs index 3a7a2d245..6c32a59d7 100644 --- a/web-app/build/scripts/pdf.worker.min.mjs +++ b/web-app/build/scripts/pdf.worker.min.mjs @@ -2,7 +2,7 @@ * @licstart The following is the entire license notice for the * JavaScript code in this page * - * Copyright 2023 Mozilla Foundation + * Copyright 2024 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,390 +18,540 @@ * * @licend The above is the entire license notice for the * JavaScript code in this page - */ var e = { - d: (t, i) => { - for (var a in i) - e.o(i, a) && - !e.o(t, a) && - Object.defineProperty(t, a, { enumerable: !0, get: i[a] }); - }, - o: (e, t) => Object.prototype.hasOwnProperty.call(e, t), - }, - __webpack_exports__ = (globalThis.pdfjsWorker = {}); -e.d(__webpack_exports__, { WorkerMessageHandler: () => WorkerMessageHandler }); -const t = !( - "object" != typeof process || - process + "" != "[object process]" || - process.versions.nw || - (process.versions.electron && process.type && "browser" !== process.type) - ), - i = [1, 0, 0, 1, 0, 0], - a = [0.001, 0, 0, 0.001, 0, 0], - s = 1.35, - r = 0.35, - n = 0.25925925925925924, - g = 1, - o = 2, - c = 4, - C = 8, - h = 16, - l = 64, - Q = 256, - E = "pdfjs_internal_editor_", - u = 3, - d = 9, - f = 13, - p = 15, - m = { - PRINT: 4, - MODIFY_CONTENTS: 8, - COPY: 16, - MODIFY_ANNOTATIONS: 32, - FILL_INTERACTIVE_FORMS: 256, - COPY_FOR_ACCESSIBILITY: 512, - ASSEMBLE: 1024, - PRINT_HIGH_QUALITY: 2048, - }, - y = 0, - w = 4, - D = 1, - b = 2, - F = 3, - S = 1, - k = 2, - R = 3, - N = 4, - G = 5, - x = 6, - U = 7, - M = 8, - L = 9, - H = 10, - J = 11, - Y = 12, - v = 13, - K = 14, - T = 15, - q = 16, - O = 17, - W = 20, - j = "Group", - X = "R", - Z = 1, - V = 2, - z = 4, - _ = 16, - $ = 32, - AA = 128, - eA = 512, - tA = 1, - iA = 2, - aA = 4096, - sA = 8192, - rA = 32768, - nA = 65536, - gA = 131072, - oA = 1048576, - IA = 2097152, - cA = 8388608, - CA = 16777216, - hA = 1, - BA = 2, - lA = 3, - QA = 4, - EA = 5, - uA = { - E: "Mouse Enter", - X: "Mouse Exit", - D: "Mouse Down", - U: "Mouse Up", - Fo: "Focus", - Bl: "Blur", - PO: "PageOpen", - PC: "PageClose", - PV: "PageVisible", - PI: "PageInvisible", - K: "Keystroke", - F: "Format", - V: "Validate", - C: "Calculate", - }, - dA = { - WC: "WillClose", - WS: "WillSave", - DS: "DidSave", - WP: "WillPrint", - DP: "DidPrint", - }, - fA = { O: "PageOpen", C: "PageClose" }, - pA = { ERRORS: 0, WARNINGS: 1, INFOS: 5 }, - mA = { NONE: 0, BINARY: 1 }, - yA = 1, - wA = 2, - DA = 3, - bA = 4, - FA = 5, - SA = 6, - kA = 7, - RA = 8, - NA = 9, - GA = 10, - xA = 11, - UA = 12, - MA = 13, - LA = 14, - HA = 15, - JA = 16, - YA = 17, - vA = 18, - KA = 19, - TA = 20, - qA = 21, - OA = 22, - PA = 23, - WA = 24, - jA = 25, - XA = 26, - ZA = 27, - VA = 28, - zA = 29, - _A = 30, - $A = 31, - Ae = 32, - ee = 33, - te = 34, - ie = 35, - ae = 36, - se = 37, - re = 38, - ne = 39, - ge = 40, - oe = 41, - Ie = 42, - ce = 43, - Ce = 44, - he = 45, - Be = 46, - le = 47, - Qe = 48, - Ee = 49, - ue = 50, - de = 51, - fe = 52, - pe = 53, - me = 54, - ye = 55, - we = 56, - De = 57, - be = 58, - Fe = 59, - Se = 60, - ke = 61, - Re = 62, - Ne = 63, - Ge = 64, - xe = 65, - Ue = 66, - Me = 67, - Le = 68, - He = 69, - Je = 70, - Ye = 71, - ve = 72, - Ke = 73, - Te = 74, - qe = 75, - Oe = 76, - Pe = 77, - We = 80, - je = 81, - Xe = 83, - Ze = 84, - Ve = 85, - ze = 86, - _e = 87, - $e = 88, - At = 89, - et = 90, - tt = 91, - it = 1, - at = 2; -let st = pA.WARNINGS; -function getVerbosityLevel() { - return st; -} -function info(e) { - st >= pA.INFOS && console.log(`Info: ${e}`); -} -function warn(e) { - st >= pA.WARNINGS && console.log(`Warning: ${e}`); -} -function unreachable(e) { - throw new Error(e); -} -function assert(e, t) { - e || unreachable(t); -} -function createValidAbsoluteUrl(e, t = null, i = null) { - if (!e) return null; - try { - if (i && "string" == typeof e) { - if (i.addDefaultProtocol && e.startsWith("www.")) { - const t = e.match(/\./g); - t?.length >= 2 && (e = `http://${e}`); + */ + +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { + /******/ // define getter functions for harmony exports + /******/ __webpack_require__.d = (exports, definition) => { + /******/ for (var key in definition) { + /******/ if ( + __webpack_require__.o(definition, key) && + !__webpack_require__.o(exports, key) + ) { + /******/ Object.defineProperty(exports, key, { + enumerable: true, + get: definition[key], + }); + /******/ } - if (i.tryConvertEncoding) - try { - e = stringToUTF8String(e); - } catch {} + /******/ } - const a = t ? new URL(e, t) : new URL(e); - if ( - (function _isValidProtocol(e) { - switch (e?.protocol) { - case "http:": - case "https:": - case "ftp:": - case "mailto:": - case "tel:": - return !0; - default: - return !1; + /******/ + }; + /******/ +})(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { + /******/ __webpack_require__.o = (obj, prop) => + Object.prototype.hasOwnProperty.call(obj, prop); + /******/ +})(); +/******/ +/************************************************************************/ +var __webpack_exports__ = (globalThis.pdfjsWorker = {}); + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + WorkerMessageHandler: () => /* reexport */ WorkerMessageHandler, +}); // ./src/shared/util.js + +const isNodeJS = + typeof process === "object" && + process + "" === "[object process]" && + !process.versions.nw && + !(process.versions.electron && process.type && process.type !== "browser"); +const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; +const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; +const MAX_IMAGE_SIZE_TO_CACHE = 10e6; +const LINE_FACTOR = 1.35; +const LINE_DESCENT_FACTOR = 0.35; +const BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR; +const RenderingIntentFlag = { + ANY: 0x01, + DISPLAY: 0x02, + PRINT: 0x04, + SAVE: 0x08, + ANNOTATIONS_FORMS: 0x10, + ANNOTATIONS_STORAGE: 0x20, + ANNOTATIONS_DISABLE: 0x40, + IS_EDITING: 0x80, + OPLIST: 0x100, +}; +const AnnotationMode = { + DISABLE: 0, + ENABLE: 1, + ENABLE_FORMS: 2, + ENABLE_STORAGE: 3, +}; +const AnnotationEditorPrefix = "pdfjs_internal_editor_"; +const AnnotationEditorType = { + DISABLE: -1, + NONE: 0, + FREETEXT: 3, + HIGHLIGHT: 9, + STAMP: 13, + INK: 15, +}; +const AnnotationEditorParamsType = { + RESIZE: 1, + CREATE: 2, + FREETEXT_SIZE: 11, + FREETEXT_COLOR: 12, + FREETEXT_OPACITY: 13, + INK_COLOR: 21, + INK_THICKNESS: 22, + INK_OPACITY: 23, + HIGHLIGHT_COLOR: 31, + HIGHLIGHT_DEFAULT_COLOR: 32, + HIGHLIGHT_THICKNESS: 33, + HIGHLIGHT_FREE: 34, + HIGHLIGHT_SHOW_ALL: 35, +}; +const PermissionFlag = { + PRINT: 0x04, + MODIFY_CONTENTS: 0x08, + COPY: 0x10, + MODIFY_ANNOTATIONS: 0x20, + FILL_INTERACTIVE_FORMS: 0x100, + COPY_FOR_ACCESSIBILITY: 0x200, + ASSEMBLE: 0x400, + PRINT_HIGH_QUALITY: 0x800, +}; +const TextRenderingMode = { + FILL: 0, + STROKE: 1, + FILL_STROKE: 2, + INVISIBLE: 3, + FILL_ADD_TO_PATH: 4, + STROKE_ADD_TO_PATH: 5, + FILL_STROKE_ADD_TO_PATH: 6, + ADD_TO_PATH: 7, + FILL_STROKE_MASK: 3, + ADD_TO_PATH_FLAG: 4, +}; +const ImageKind = { + GRAYSCALE_1BPP: 1, + RGB_24BPP: 2, + RGBA_32BPP: 3, +}; +const AnnotationType = { + TEXT: 1, + LINK: 2, + FREETEXT: 3, + LINE: 4, + SQUARE: 5, + CIRCLE: 6, + POLYGON: 7, + POLYLINE: 8, + HIGHLIGHT: 9, + UNDERLINE: 10, + SQUIGGLY: 11, + STRIKEOUT: 12, + STAMP: 13, + CARET: 14, + INK: 15, + POPUP: 16, + FILEATTACHMENT: 17, + SOUND: 18, + MOVIE: 19, + WIDGET: 20, + SCREEN: 21, + PRINTERMARK: 22, + TRAPNET: 23, + WATERMARK: 24, + THREED: 25, + REDACT: 26, +}; +const AnnotationReplyType = { + GROUP: "Group", + REPLY: "R", +}; +const AnnotationFlag = { + INVISIBLE: 0x01, + HIDDEN: 0x02, + PRINT: 0x04, + NOZOOM: 0x08, + NOROTATE: 0x10, + NOVIEW: 0x20, + READONLY: 0x40, + LOCKED: 0x80, + TOGGLENOVIEW: 0x100, + LOCKEDCONTENTS: 0x200, +}; +const AnnotationFieldFlag = { + READONLY: 0x0000001, + REQUIRED: 0x0000002, + NOEXPORT: 0x0000004, + MULTILINE: 0x0001000, + PASSWORD: 0x0002000, + NOTOGGLETOOFF: 0x0004000, + RADIO: 0x0008000, + PUSHBUTTON: 0x0010000, + COMBO: 0x0020000, + EDIT: 0x0040000, + SORT: 0x0080000, + FILESELECT: 0x0100000, + MULTISELECT: 0x0200000, + DONOTSPELLCHECK: 0x0400000, + DONOTSCROLL: 0x0800000, + COMB: 0x1000000, + RICHTEXT: 0x2000000, + RADIOSINUNISON: 0x2000000, + COMMITONSELCHANGE: 0x4000000, +}; +const AnnotationBorderStyleType = { + SOLID: 1, + DASHED: 2, + BEVELED: 3, + INSET: 4, + UNDERLINE: 5, +}; +const AnnotationActionEventType = { + E: "Mouse Enter", + X: "Mouse Exit", + D: "Mouse Down", + U: "Mouse Up", + Fo: "Focus", + Bl: "Blur", + PO: "PageOpen", + PC: "PageClose", + PV: "PageVisible", + PI: "PageInvisible", + K: "Keystroke", + F: "Format", + V: "Validate", + C: "Calculate", +}; +const DocumentActionEventType = { + WC: "WillClose", + WS: "WillSave", + DS: "DidSave", + WP: "WillPrint", + DP: "DidPrint", +}; +const PageActionEventType = { + O: "PageOpen", + C: "PageClose", +}; +const VerbosityLevel = { + ERRORS: 0, + WARNINGS: 1, + INFOS: 5, +}; +const OPS = { + dependency: 1, + setLineWidth: 2, + setLineCap: 3, + setLineJoin: 4, + setMiterLimit: 5, + setDash: 6, + setRenderingIntent: 7, + setFlatness: 8, + setGState: 9, + save: 10, + restore: 11, + transform: 12, + moveTo: 13, + lineTo: 14, + curveTo: 15, + curveTo2: 16, + curveTo3: 17, + closePath: 18, + rectangle: 19, + stroke: 20, + closeStroke: 21, + fill: 22, + eoFill: 23, + fillStroke: 24, + eoFillStroke: 25, + closeFillStroke: 26, + closeEOFillStroke: 27, + endPath: 28, + clip: 29, + eoClip: 30, + beginText: 31, + endText: 32, + setCharSpacing: 33, + setWordSpacing: 34, + setHScale: 35, + setLeading: 36, + setFont: 37, + setTextRenderingMode: 38, + setTextRise: 39, + moveText: 40, + setLeadingMoveText: 41, + setTextMatrix: 42, + nextLine: 43, + showText: 44, + showSpacedText: 45, + nextLineShowText: 46, + nextLineSetSpacingShowText: 47, + setCharWidth: 48, + setCharWidthAndBounds: 49, + setStrokeColorSpace: 50, + setFillColorSpace: 51, + setStrokeColor: 52, + setStrokeColorN: 53, + setFillColor: 54, + setFillColorN: 55, + setStrokeGray: 56, + setFillGray: 57, + setStrokeRGBColor: 58, + setFillRGBColor: 59, + setStrokeCMYKColor: 60, + setFillCMYKColor: 61, + shadingFill: 62, + beginInlineImage: 63, + beginImageData: 64, + endInlineImage: 65, + paintXObject: 66, + markPoint: 67, + markPointProps: 68, + beginMarkedContent: 69, + beginMarkedContentProps: 70, + endMarkedContent: 71, + beginCompat: 72, + endCompat: 73, + paintFormXObjectBegin: 74, + paintFormXObjectEnd: 75, + beginGroup: 76, + endGroup: 77, + beginAnnotation: 80, + endAnnotation: 81, + paintImageMaskXObject: 83, + paintImageMaskXObjectGroup: 84, + paintImageXObject: 85, + paintInlineImageXObject: 86, + paintInlineImageXObjectGroup: 87, + paintImageXObjectRepeat: 88, + paintImageMaskXObjectRepeat: 89, + paintSolidColorImageMask: 90, + constructPath: 91, + setStrokeTransparent: 92, + setFillTransparent: 93, +}; +const PasswordResponses = { + NEED_PASSWORD: 1, + INCORRECT_PASSWORD: 2, +}; +let verbosity = VerbosityLevel.WARNINGS; +function setVerbosityLevel(level) { + if (Number.isInteger(level)) { + verbosity = level; + } +} +function getVerbosityLevel() { + return verbosity; +} +function info(msg) { + if (verbosity >= VerbosityLevel.INFOS) { + console.log(`Info: ${msg}`); + } +} +function warn(msg) { + if (verbosity >= VerbosityLevel.WARNINGS) { + console.log(`Warning: ${msg}`); + } +} +function unreachable(msg) { + throw new Error(msg); +} +function assert(cond, msg) { + if (!cond) { + unreachable(msg); + } +} +function _isValidProtocol(url) { + switch (url?.protocol) { + case "http:": + case "https:": + case "ftp:": + case "mailto:": + case "tel:": + return true; + default: + return false; + } +} +function createValidAbsoluteUrl(url, baseUrl = null, options = null) { + if (!url) { + return null; + } + try { + if (options && typeof url === "string") { + if (options.addDefaultProtocol && url.startsWith("www.")) { + const dots = url.match(/\./g); + if (dots?.length >= 2) { + url = `http://${url}`; } - })(a) - ) - return a; + } + if (options.tryConvertEncoding) { + try { + url = stringToUTF8String(url); + } catch {} + } + } + const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url); + if (_isValidProtocol(absoluteUrl)) { + return absoluteUrl; + } } catch {} return null; } -function shadow(e, t, i, a = !1) { - Object.defineProperty(e, t, { - value: i, - enumerable: !a, - configurable: !0, - writable: !1, +function shadow(obj, prop, value, nonSerializable = false) { + Object.defineProperty(obj, prop, { + value, + enumerable: !nonSerializable, + configurable: true, + writable: false, }); - return i; + return value; } -const rt = (function BaseExceptionClosure() { - function BaseException(e, t) { - this.constructor === BaseException && - unreachable("Cannot initialize BaseException."); - this.message = e; - this.name = t; +const BaseException = (function BaseExceptionClosure() { + function BaseException(message, name) { + this.message = message; + this.name = name; } BaseException.prototype = new Error(); BaseException.constructor = BaseException; return BaseException; })(); -class PasswordException extends rt { - constructor(e, t) { - super(e, "PasswordException"); - this.code = t; +class PasswordException extends BaseException { + constructor(msg, code) { + super(msg, "PasswordException"); + this.code = code; } } -class UnknownErrorException extends rt { - constructor(e, t) { - super(e, "UnknownErrorException"); - this.details = t; +class UnknownErrorException extends BaseException { + constructor(msg, details) { + super(msg, "UnknownErrorException"); + this.details = details; } } -class InvalidPDFException extends rt { - constructor(e) { - super(e, "InvalidPDFException"); +class InvalidPDFException extends BaseException { + constructor(msg) { + super(msg, "InvalidPDFException"); } } -class MissingPDFException extends rt { - constructor(e) { - super(e, "MissingPDFException"); +class MissingPDFException extends BaseException { + constructor(msg) { + super(msg, "MissingPDFException"); } } -class UnexpectedResponseException extends rt { - constructor(e, t) { - super(e, "UnexpectedResponseException"); - this.status = t; +class UnexpectedResponseException extends BaseException { + constructor(msg, status) { + super(msg, "UnexpectedResponseException"); + this.status = status; } } -class FormatError extends rt { - constructor(e) { - super(e, "FormatError"); +class FormatError extends BaseException { + constructor(msg) { + super(msg, "FormatError"); } } -class AbortException extends rt { - constructor(e) { - super(e, "AbortException"); +class AbortException extends BaseException { + constructor(msg) { + super(msg, "AbortException"); } } -function bytesToString(e) { - ("object" == typeof e && void 0 !== e?.length) || +function bytesToString(bytes) { + if (typeof bytes !== "object" || bytes?.length === undefined) { unreachable("Invalid argument for bytesToString"); - const t = e.length, - i = 8192; - if (t < i) return String.fromCharCode.apply(null, e); - const a = []; - for (let s = 0; s < t; s += i) { - const r = Math.min(s + i, t), - n = e.subarray(s, r); - a.push(String.fromCharCode.apply(null, n)); } - return a.join(""); + const length = bytes.length; + const MAX_ARGUMENT_COUNT = 8192; + if (length < MAX_ARGUMENT_COUNT) { + return String.fromCharCode.apply(null, bytes); + } + const strBuf = []; + for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) { + const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); + const chunk = bytes.subarray(i, chunkEnd); + strBuf.push(String.fromCharCode.apply(null, chunk)); + } + return strBuf.join(""); } -function stringToBytes(e) { - "string" != typeof e && unreachable("Invalid argument for stringToBytes"); - const t = e.length, - i = new Uint8Array(t); - for (let a = 0; a < t; ++a) i[a] = 255 & e.charCodeAt(a); - return i; +function stringToBytes(str) { + if (typeof str !== "string") { + unreachable("Invalid argument for stringToBytes"); + } + const length = str.length; + const bytes = new Uint8Array(length); + for (let i = 0; i < length; ++i) { + bytes[i] = str.charCodeAt(i) & 0xff; + } + return bytes; } -function string32(e) { +function string32(value) { return String.fromCharCode( - (e >> 24) & 255, - (e >> 16) & 255, - (e >> 8) & 255, - 255 & e, + (value >> 24) & 0xff, + (value >> 16) & 0xff, + (value >> 8) & 0xff, + value & 0xff, ); } -function objectSize(e) { - return Object.keys(e).length; +function objectSize(obj) { + return Object.keys(obj).length; +} +function objectFromMap(map) { + const obj = Object.create(null); + for (const [key, value] of map) { + obj[key] = value; + } + return obj; +} +function isLittleEndian() { + const buffer8 = new Uint8Array(4); + buffer8[0] = 1; + const view32 = new Uint32Array(buffer8.buffer, 0, 1); + return view32[0] === 1; +} +function isEvalSupported() { + try { + new Function(""); + return true; + } catch { + return false; + } } class FeatureTest { static get isLittleEndian() { - return shadow( - this, - "isLittleEndian", - (function isLittleEndian() { - const e = new Uint8Array(4); - e[0] = 1; - return 1 === new Uint32Array(e.buffer, 0, 1)[0]; - })(), - ); + return shadow(this, "isLittleEndian", isLittleEndian()); } static get isEvalSupported() { - return shadow( - this, - "isEvalSupported", - (function isEvalSupported() { - try { - new Function(""); - return !0; - } catch { - return !1; - } - })(), - ); + return shadow(this, "isEvalSupported", isEvalSupported()); } static get isOffscreenCanvasSupported() { return shadow( this, "isOffscreenCanvasSupported", - "undefined" != typeof OffscreenCanvas, + typeof OffscreenCanvas !== "undefined", ); } static get platform() { - return "undefined" != typeof navigator && - "string" == typeof navigator?.platform - ? shadow(this, "platform", { isMac: navigator.platform.includes("Mac") }) - : shadow(this, "platform", { isMac: !1 }); + if ( + typeof navigator !== "undefined" && + typeof navigator?.platform === "string" + ) { + return shadow(this, "platform", { + isMac: navigator.platform.includes("Mac"), + isWindows: navigator.platform.includes("Win"), + isFirefox: + typeof navigator?.userAgent === "string" && + navigator.userAgent.includes("Firefox"), + }); + } + return shadow(this, "platform", { + isMac: false, + isWindows: false, + isFirefox: false, + }); } static get isCSSRoundSupported() { return shadow( @@ -411,346 +561,496 @@ class FeatureTest { ); } } -const nt = Array.from(Array(256).keys(), (e) => - e.toString(16).padStart(2, "0"), +const hexNumbers = Array.from(Array(256).keys(), (n) => + n.toString(16).padStart(2, "0"), ); class Util { - static makeHexColor(e, t, i) { - return `#${nt[e]}${nt[t]}${nt[i]}`; + static makeHexColor(r, g, b) { + return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`; } - static scaleMinMax(e, t) { - let i; - if (e[0]) { - if (e[0] < 0) { - i = t[0]; - t[0] = t[2]; - t[2] = i; + static scaleMinMax(transform, minMax) { + let temp; + if (transform[0]) { + if (transform[0] < 0) { + temp = minMax[0]; + minMax[0] = minMax[2]; + minMax[2] = temp; } - t[0] *= e[0]; - t[2] *= e[0]; - if (e[3] < 0) { - i = t[1]; - t[1] = t[3]; - t[3] = i; + minMax[0] *= transform[0]; + minMax[2] *= transform[0]; + if (transform[3] < 0) { + temp = minMax[1]; + minMax[1] = minMax[3]; + minMax[3] = temp; } - t[1] *= e[3]; - t[3] *= e[3]; + minMax[1] *= transform[3]; + minMax[3] *= transform[3]; } else { - i = t[0]; - t[0] = t[1]; - t[1] = i; - i = t[2]; - t[2] = t[3]; - t[3] = i; - if (e[1] < 0) { - i = t[1]; - t[1] = t[3]; - t[3] = i; + temp = minMax[0]; + minMax[0] = minMax[1]; + minMax[1] = temp; + temp = minMax[2]; + minMax[2] = minMax[3]; + minMax[3] = temp; + if (transform[1] < 0) { + temp = minMax[1]; + minMax[1] = minMax[3]; + minMax[3] = temp; } - t[1] *= e[1]; - t[3] *= e[1]; - if (e[2] < 0) { - i = t[0]; - t[0] = t[2]; - t[2] = i; + minMax[1] *= transform[1]; + minMax[3] *= transform[1]; + if (transform[2] < 0) { + temp = minMax[0]; + minMax[0] = minMax[2]; + minMax[2] = temp; } - t[0] *= e[2]; - t[2] *= e[2]; + minMax[0] *= transform[2]; + minMax[2] *= transform[2]; } - t[0] += e[4]; - t[1] += e[5]; - t[2] += e[4]; - t[3] += e[5]; + minMax[0] += transform[4]; + minMax[1] += transform[5]; + minMax[2] += transform[4]; + minMax[3] += transform[5]; } - static transform(e, t) { + static transform(m1, m2) { return [ - e[0] * t[0] + e[2] * t[1], - e[1] * t[0] + e[3] * t[1], - e[0] * t[2] + e[2] * t[3], - e[1] * t[2] + e[3] * t[3], - e[0] * t[4] + e[2] * t[5] + e[4], - e[1] * t[4] + e[3] * t[5] + e[5], + m1[0] * m2[0] + m1[2] * m2[1], + m1[1] * m2[0] + m1[3] * m2[1], + m1[0] * m2[2] + m1[2] * m2[3], + m1[1] * m2[2] + m1[3] * m2[3], + m1[0] * m2[4] + m1[2] * m2[5] + m1[4], + m1[1] * m2[4] + m1[3] * m2[5] + m1[5], ]; } - static applyTransform(e, t) { - return [e[0] * t[0] + e[1] * t[2] + t[4], e[0] * t[1] + e[1] * t[3] + t[5]]; + static applyTransform(p, m) { + const xt = p[0] * m[0] + p[1] * m[2] + m[4]; + const yt = p[0] * m[1] + p[1] * m[3] + m[5]; + return [xt, yt]; } - static applyInverseTransform(e, t) { - const i = t[0] * t[3] - t[1] * t[2]; + static applyInverseTransform(p, m) { + const d = m[0] * m[3] - m[1] * m[2]; + const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; + const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; + return [xt, yt]; + } + static getAxialAlignedBoundingBox(r, m) { + const p1 = this.applyTransform(r, m); + const p2 = this.applyTransform(r.slice(2, 4), m); + const p3 = this.applyTransform([r[0], r[3]], m); + const p4 = this.applyTransform([r[2], r[1]], m); return [ - (e[0] * t[3] - e[1] * t[2] + t[2] * t[5] - t[4] * t[3]) / i, - (-e[0] * t[1] + e[1] * t[0] + t[4] * t[1] - t[5] * t[0]) / i, + Math.min(p1[0], p2[0], p3[0], p4[0]), + Math.min(p1[1], p2[1], p3[1], p4[1]), + Math.max(p1[0], p2[0], p3[0], p4[0]), + Math.max(p1[1], p2[1], p3[1], p4[1]), ]; } - static getAxialAlignedBoundingBox(e, t) { - const i = this.applyTransform(e, t), - a = this.applyTransform(e.slice(2, 4), t), - s = this.applyTransform([e[0], e[3]], t), - r = this.applyTransform([e[2], e[1]], t); + static inverseTransform(m) { + const d = m[0] * m[3] - m[1] * m[2]; return [ - Math.min(i[0], a[0], s[0], r[0]), - Math.min(i[1], a[1], s[1], r[1]), - Math.max(i[0], a[0], s[0], r[0]), - Math.max(i[1], a[1], s[1], r[1]), + m[3] / d, + -m[1] / d, + -m[2] / d, + m[0] / d, + (m[2] * m[5] - m[4] * m[3]) / d, + (m[4] * m[1] - m[5] * m[0]) / d, ]; } - static inverseTransform(e) { - const t = e[0] * e[3] - e[1] * e[2]; - return [ - e[3] / t, - -e[1] / t, - -e[2] / t, - e[0] / t, - (e[2] * e[5] - e[4] * e[3]) / t, - (e[4] * e[1] - e[5] * e[0]) / t, - ]; + static singularValueDecompose2dScale(m) { + const transpose = [m[0], m[2], m[1], m[3]]; + const a = m[0] * transpose[0] + m[1] * transpose[2]; + const b = m[0] * transpose[1] + m[1] * transpose[3]; + const c = m[2] * transpose[0] + m[3] * transpose[2]; + const d = m[2] * transpose[1] + m[3] * transpose[3]; + const first = (a + d) / 2; + const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2; + const sx = first + second || 1; + const sy = first - second || 1; + return [Math.sqrt(sx), Math.sqrt(sy)]; } - static singularValueDecompose2dScale(e) { - const t = [e[0], e[2], e[1], e[3]], - i = e[0] * t[0] + e[1] * t[2], - a = e[0] * t[1] + e[1] * t[3], - s = e[2] * t[0] + e[3] * t[2], - r = e[2] * t[1] + e[3] * t[3], - n = (i + r) / 2, - g = Math.sqrt((i + r) ** 2 - 4 * (i * r - s * a)) / 2, - o = n + g || 1, - c = n - g || 1; - return [Math.sqrt(o), Math.sqrt(c)]; - } - static normalizeRect(e) { - const t = e.slice(0); - if (e[0] > e[2]) { - t[0] = e[2]; - t[2] = e[0]; + static normalizeRect(rect) { + const r = rect.slice(0); + if (rect[0] > rect[2]) { + r[0] = rect[2]; + r[2] = rect[0]; } - if (e[1] > e[3]) { - t[1] = e[3]; - t[3] = e[1]; + if (rect[1] > rect[3]) { + r[1] = rect[3]; + r[3] = rect[1]; } - return t; + return r; } - static intersect(e, t) { - const i = Math.max(Math.min(e[0], e[2]), Math.min(t[0], t[2])), - a = Math.min(Math.max(e[0], e[2]), Math.max(t[0], t[2])); - if (i > a) return null; - const s = Math.max(Math.min(e[1], e[3]), Math.min(t[1], t[3])), - r = Math.min(Math.max(e[1], e[3]), Math.max(t[1], t[3])); - return s > r ? null : [i, s, a, r]; + static intersect(rect1, rect2) { + const xLow = Math.max( + Math.min(rect1[0], rect1[2]), + Math.min(rect2[0], rect2[2]), + ); + const xHigh = Math.min( + Math.max(rect1[0], rect1[2]), + Math.max(rect2[0], rect2[2]), + ); + if (xLow > xHigh) { + return null; + } + const yLow = Math.max( + Math.min(rect1[1], rect1[3]), + Math.min(rect2[1], rect2[3]), + ); + const yHigh = Math.min( + Math.max(rect1[1], rect1[3]), + Math.max(rect2[1], rect2[3]), + ); + if (yLow > yHigh) { + return null; + } + return [xLow, yLow, xHigh, yHigh]; } - static #A(e, t, i, a, s, r, n, g, o, c) { - if (o <= 0 || o >= 1) return; - const C = 1 - o, - h = o * o, - l = h * o, - Q = C * (C * (C * e + 3 * o * t) + 3 * h * i) + l * a, - E = C * (C * (C * s + 3 * o * r) + 3 * h * n) + l * g; - c[0] = Math.min(c[0], Q); - c[1] = Math.min(c[1], E); - c[2] = Math.max(c[2], Q); - c[3] = Math.max(c[3], E); - } - static #e(e, t, i, a, s, r, n, g, o, c, C, h) { - if (Math.abs(o) < 1e-12) { - Math.abs(c) >= 1e-12 && this.#A(e, t, i, a, s, r, n, g, -C / c, h); + static #getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, t, minMax) { + if (t <= 0 || t >= 1) { return; } - const l = c ** 2 - 4 * C * o; - if (l < 0) return; - const Q = Math.sqrt(l), - E = 2 * o; - this.#A(e, t, i, a, s, r, n, g, (-c + Q) / E, h); - this.#A(e, t, i, a, s, r, n, g, (-c - Q) / E, h); + const mt = 1 - t; + const tt = t * t; + const ttt = tt * t; + const x = mt * (mt * (mt * x0 + 3 * t * x1) + 3 * tt * x2) + ttt * x3; + const y = mt * (mt * (mt * y0 + 3 * t * y1) + 3 * tt * y2) + ttt * y3; + minMax[0] = Math.min(minMax[0], x); + minMax[1] = Math.min(minMax[1], y); + minMax[2] = Math.max(minMax[2], x); + minMax[3] = Math.max(minMax[3], y); } - static bezierBoundingBox(e, t, i, a, s, r, n, g, o) { - if (o) { - o[0] = Math.min(o[0], e, n); - o[1] = Math.min(o[1], t, g); - o[2] = Math.max(o[2], e, n); - o[3] = Math.max(o[3], t, g); - } else o = [Math.min(e, n), Math.min(t, g), Math.max(e, n), Math.max(t, g)]; - this.#e( - e, - i, - s, - n, - t, - a, - r, - g, - 3 * (3 * (i - s) - e + n), - 6 * (e - 2 * i + s), - 3 * (i - e), - o, + static #getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, a, b, c, minMax) { + if (Math.abs(a) < 1e-12) { + if (Math.abs(b) >= 1e-12) { + this.#getExtremumOnCurve( + x0, + x1, + x2, + x3, + y0, + y1, + y2, + y3, + -c / b, + minMax, + ); + } + return; + } + const delta = b ** 2 - 4 * c * a; + if (delta < 0) { + return; + } + const sqrtDelta = Math.sqrt(delta); + const a2 = 2 * a; + this.#getExtremumOnCurve( + x0, + x1, + x2, + x3, + y0, + y1, + y2, + y3, + (-b + sqrtDelta) / a2, + minMax, ); - this.#e( - e, - i, - s, - n, - t, - a, - r, - g, - 3 * (3 * (a - r) - t + g), - 6 * (t - 2 * a + r), - 3 * (a - t), - o, + this.#getExtremumOnCurve( + x0, + x1, + x2, + x3, + y0, + y1, + y2, + y3, + (-b - sqrtDelta) / a2, + minMax, ); - return o; + } + static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax) { + if (minMax) { + minMax[0] = Math.min(minMax[0], x0, x3); + minMax[1] = Math.min(minMax[1], y0, y3); + minMax[2] = Math.max(minMax[2], x0, x3); + minMax[3] = Math.max(minMax[3], y0, y3); + } else { + minMax = [ + Math.min(x0, x3), + Math.min(y0, y3), + Math.max(x0, x3), + Math.max(y0, y3), + ]; + } + this.#getExtremum( + x0, + x1, + x2, + x3, + y0, + y1, + y2, + y3, + 3 * (-x0 + 3 * (x1 - x2) + x3), + 6 * (x0 - 2 * x1 + x2), + 3 * (x1 - x0), + minMax, + ); + this.#getExtremum( + x0, + x1, + x2, + x3, + y0, + y1, + y2, + y3, + 3 * (-y0 + 3 * (y1 - y2) + y3), + 6 * (y0 - 2 * y1 + y2), + 3 * (y1 - y0), + minMax, + ); + return minMax; } } -const gt = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 728, - 711, 710, 729, 733, 731, 730, 732, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +const PDFStringTranslateTable = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8, + 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 8226, 8224, 8225, 8230, 8212, 8211, 402, 8260, 8249, 8250, 8722, - 8240, 8222, 8220, 8221, 8216, 8217, 8218, 8482, 64257, 64258, 321, 338, 352, - 376, 381, 305, 322, 339, 353, 382, 0, 8364, + 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, + 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018, + 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d, + 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac, ]; -function stringToPDFString(e) { - if (e[0] >= "ï") { - let t; - if ("þ" === e[0] && "ÿ" === e[1]) { - t = "utf-16be"; - e.length % 2 == 1 && (e = e.slice(0, -1)); - } else if ("ÿ" === e[0] && "þ" === e[1]) { - t = "utf-16le"; - e.length % 2 == 1 && (e = e.slice(0, -1)); - } else "ï" === e[0] && "»" === e[1] && "¿" === e[2] && (t = "utf-8"); - if (t) - try { - const i = new TextDecoder(t, { fatal: !0 }), - a = stringToBytes(e), - s = i.decode(a); - return s.includes("") ? s.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g, "") : s; - } catch (e) { - warn(`stringToPDFString: "${e}".`); +function stringToPDFString(str) { + if (str[0] >= "\xEF") { + let encoding; + if (str[0] === "\xFE" && str[1] === "\xFF") { + encoding = "utf-16be"; + if (str.length % 2 === 1) { + str = str.slice(0, -1); } + } else if (str[0] === "\xFF" && str[1] === "\xFE") { + encoding = "utf-16le"; + if (str.length % 2 === 1) { + str = str.slice(0, -1); + } + } else if (str[0] === "\xEF" && str[1] === "\xBB" && str[2] === "\xBF") { + encoding = "utf-8"; + } + if (encoding) { + try { + const decoder = new TextDecoder(encoding, { + fatal: true, + }); + const buffer = stringToBytes(str); + const decoded = decoder.decode(buffer); + if (!decoded.includes("\x1b")) { + return decoded; + } + return decoded.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g, ""); + } catch (ex) { + warn(`stringToPDFString: "${ex}".`); + } + } } - const t = []; - for (let i = 0, a = e.length; i < a; i++) { - const s = e.charCodeAt(i); - if (27 === s) { - for (; ++i < a && 27 !== e.charCodeAt(i); ); + const strBuf = []; + for (let i = 0, ii = str.length; i < ii; i++) { + const charCode = str.charCodeAt(i); + if (charCode === 0x1b) { + while (++i < ii && str.charCodeAt(i) !== 0x1b) {} continue; } - const r = gt[s]; - t.push(r ? String.fromCharCode(r) : e.charAt(i)); + const code = PDFStringTranslateTable[charCode]; + strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); } - return t.join(""); + return strBuf.join(""); } -function stringToUTF8String(e) { - return decodeURIComponent(escape(e)); +function stringToUTF8String(str) { + return decodeURIComponent(escape(str)); } -function utf8StringToString(e) { - return unescape(encodeURIComponent(e)); +function utf8StringToString(str) { + return unescape(encodeURIComponent(str)); } -function isArrayEqual(e, t) { - if (e.length !== t.length) return !1; - for (let i = 0, a = e.length; i < a; i++) if (e[i] !== t[i]) return !1; - return !0; +function isArrayEqual(arr1, arr2) { + if (arr1.length !== arr2.length) { + return false; + } + for (let i = 0, ii = arr1.length; i < ii; i++) { + if (arr1[i] !== arr2[i]) { + return false; + } + } + return true; } -function getModificationDate(e = new Date()) { - return [ - e.getUTCFullYear().toString(), - (e.getUTCMonth() + 1).toString().padStart(2, "0"), - e.getUTCDate().toString().padStart(2, "0"), - e.getUTCHours().toString().padStart(2, "0"), - e.getUTCMinutes().toString().padStart(2, "0"), - e.getUTCSeconds().toString().padStart(2, "0"), - ].join(""); +function getModificationDate(date = new Date()) { + const buffer = [ + date.getUTCFullYear().toString(), + (date.getUTCMonth() + 1).toString().padStart(2, "0"), + date.getUTCDate().toString().padStart(2, "0"), + date.getUTCHours().toString().padStart(2, "0"), + date.getUTCMinutes().toString().padStart(2, "0"), + date.getUTCSeconds().toString().padStart(2, "0"), + ]; + return buffer.join(""); +} +let NormalizeRegex = null; +let NormalizationMap = null; +function normalizeUnicode(str) { + if (!NormalizeRegex) { + NormalizeRegex = + /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu; + NormalizationMap = new Map([["ſt", "ſt"]]); + } + return str.replaceAll(NormalizeRegex, (_, p1, p2) => + p1 ? p1.normalize("NFKC") : NormalizationMap.get(p2), + ); +} +function getUuid() { + if ( + typeof crypto !== "undefined" && + typeof crypto?.randomUUID === "function" + ) { + return crypto.randomUUID(); + } + const buf = new Uint8Array(32); + if ( + typeof crypto !== "undefined" && + typeof crypto?.getRandomValues === "function" + ) { + crypto.getRandomValues(buf); + } else { + for (let i = 0; i < 32; i++) { + buf[i] = Math.floor(Math.random() * 255); + } + } + return bytesToString(buf); +} +const AnnotationPrefix = "pdfjs_internal_id_"; +const FontRenderOps = { + BEZIER_CURVE_TO: 0, + MOVE_TO: 1, + LINE_TO: 2, + QUADRATIC_CURVE_TO: 3, + RESTORE: 4, + SAVE: 5, + SCALE: 6, + TRANSFORM: 7, + TRANSLATE: 8, +}; +function toHexUtil(arr) { + if (Uint8Array.prototype.toHex) { + return arr.toHex(); + } + return Array.from(arr, (num) => hexNumbers[num]).join(""); +} +function toBase64Util(arr) { + if (Uint8Array.prototype.toBase64) { + return arr.toBase64(); + } + return btoa(bytesToString(arr)); +} +function fromBase64Util(str) { + if (Uint8Array.fromBase64) { + return Uint8Array.fromBase64(str); + } + return stringToBytes(atob(str)); +} // ./src/core/primitives.js + +const CIRCULAR_REF = Symbol("CIRCULAR_REF"); +const EOF = Symbol("EOF"); +let CmdCache = Object.create(null); +let NameCache = Object.create(null); +let RefCache = Object.create(null); +function clearPrimitiveCaches() { + CmdCache = Object.create(null); + NameCache = Object.create(null); + RefCache = Object.create(null); } -let ot = null, - It = null; -const ct = 0, - Ct = 1, - ht = 2, - Bt = 3, - lt = 4, - Qt = 5, - Et = 6, - ut = 7, - dt = 8, - ft = Symbol("CIRCULAR_REF"), - pt = Symbol("EOF"); -let mt = Object.create(null), - yt = Object.create(null), - wt = Object.create(null); class Name { - constructor(e) { - this.name = e; + constructor(name) { + this.name = name; } - static get(e) { - return (yt[e] ||= new Name(e)); + static get(name) { + return (NameCache[name] ||= new Name(name)); } } class Cmd { - constructor(e) { - this.cmd = e; + constructor(cmd) { + this.cmd = cmd; } - static get(e) { - return (mt[e] ||= new Cmd(e)); + static get(cmd) { + return (CmdCache[cmd] ||= new Cmd(cmd)); } } -const Dt = function nonSerializableClosure() { - return Dt; +const nonSerializable = function nonSerializableClosure() { + return nonSerializable; }; class Dict { - constructor(e = null) { + constructor(xref = null) { this._map = Object.create(null); - this.xref = e; + this.xref = xref; this.objId = null; - this.suppressEncryption = !1; - this.__nonSerializable__ = Dt; + this.suppressEncryption = false; + this.__nonSerializable__ = nonSerializable; } - assignXref(e) { - this.xref = e; + assignXref(newXref) { + this.xref = newXref; } get size() { return Object.keys(this._map).length; } - get(e, t, i) { - let a = this._map[e]; - if (void 0 === a && void 0 !== t) { - a = this._map[t]; - void 0 === a && void 0 !== i && (a = this._map[i]); + get(key1, key2, key3) { + let value = this._map[key1]; + if (value === undefined && key2 !== undefined) { + value = this._map[key2]; + if (value === undefined && key3 !== undefined) { + value = this._map[key3]; + } } - return a instanceof Ref && this.xref - ? this.xref.fetch(a, this.suppressEncryption) - : a; + if (value instanceof Ref && this.xref) { + return this.xref.fetch(value, this.suppressEncryption); + } + return value; } - async getAsync(e, t, i) { - let a = this._map[e]; - if (void 0 === a && void 0 !== t) { - a = this._map[t]; - void 0 === a && void 0 !== i && (a = this._map[i]); + async getAsync(key1, key2, key3) { + let value = this._map[key1]; + if (value === undefined && key2 !== undefined) { + value = this._map[key2]; + if (value === undefined && key3 !== undefined) { + value = this._map[key3]; + } } - return a instanceof Ref && this.xref - ? this.xref.fetchAsync(a, this.suppressEncryption) - : a; + if (value instanceof Ref && this.xref) { + return this.xref.fetchAsync(value, this.suppressEncryption); + } + return value; } - getArray(e, t, i) { - let a = this._map[e]; - if (void 0 === a && void 0 !== t) { - a = this._map[t]; - void 0 === a && void 0 !== i && (a = this._map[i]); + getArray(key1, key2, key3) { + let value = this._map[key1]; + if (value === undefined && key2 !== undefined) { + value = this._map[key2]; + if (value === undefined && key3 !== undefined) { + value = this._map[key3]; + } } - a instanceof Ref && - this.xref && - (a = this.xref.fetch(a, this.suppressEncryption)); - if (Array.isArray(a)) { - a = a.slice(); - for (let e = 0, t = a.length; e < t; e++) - a[e] instanceof Ref && - this.xref && - (a[e] = this.xref.fetch(a[e], this.suppressEncryption)); + if (value instanceof Ref && this.xref) { + value = this.xref.fetch(value, this.suppressEncryption); } - return a; + if (Array.isArray(value)) { + value = value.slice(); + for (let i = 0, ii = value.length; i < ii; i++) { + if (value[i] instanceof Ref && this.xref) { + value[i] = this.xref.fetch(value[i], this.suppressEncryption); + } + } + } + return value; } - getRaw(e) { - return this._map[e]; + getRaw(key) { + return this._map[key]; } getKeys() { return Object.keys(this._map); @@ -758,88 +1058,115 @@ class Dict { getRawValues() { return Object.values(this._map); } - set(e, t) { - this._map[e] = t; + set(key, value) { + this._map[key] = value; } - has(e) { - return void 0 !== this._map[e]; + has(key) { + return this._map[key] !== undefined; } - forEach(e) { - for (const t in this._map) e(t, this.get(t)); + forEach(callback) { + for (const key in this._map) { + callback(key, this.get(key)); + } } static get empty() { - const e = new Dict(null); - e.set = (e, t) => { + const emptyDict = new Dict(null); + emptyDict.set = (key, value) => { unreachable("Should not call `set` on the empty dictionary."); }; - return shadow(this, "empty", e); + return shadow(this, "empty", emptyDict); } - static merge({ xref: e, dictArray: t, mergeSubDicts: i = !1 }) { - const a = new Dict(e), - s = new Map(); - for (const e of t) - if (e instanceof Dict) - for (const [t, a] of Object.entries(e._map)) { - let e = s.get(t); - if (void 0 === e) { - e = []; - s.set(t, e); - } else if (!(i && a instanceof Dict)) continue; - e.push(a); - } - for (const [t, i] of s) { - if (1 === i.length || !(i[0] instanceof Dict)) { - a._map[t] = i[0]; + static merge({ xref, dictArray, mergeSubDicts = false }) { + const mergedDict = new Dict(xref), + properties = new Map(); + for (const dict of dictArray) { + if (!(dict instanceof Dict)) { continue; } - const s = new Dict(e); - for (const e of i) - for (const [t, i] of Object.entries(e._map)) - void 0 === s._map[t] && (s._map[t] = i); - s.size > 0 && (a._map[t] = s); + for (const [key, value] of Object.entries(dict._map)) { + let property = properties.get(key); + if (property === undefined) { + property = []; + properties.set(key, property); + } else if (!mergeSubDicts || !(value instanceof Dict)) { + continue; + } + property.push(value); + } } - s.clear(); - return a.size > 0 ? a : Dict.empty; + for (const [name, values] of properties) { + if (values.length === 1 || !(values[0] instanceof Dict)) { + mergedDict._map[name] = values[0]; + continue; + } + const subDict = new Dict(xref); + for (const dict of values) { + for (const [key, value] of Object.entries(dict._map)) { + if (subDict._map[key] === undefined) { + subDict._map[key] = value; + } + } + } + if (subDict.size > 0) { + mergedDict._map[name] = subDict; + } + } + properties.clear(); + return mergedDict.size > 0 ? mergedDict : Dict.empty; } clone() { - const e = new Dict(this.xref); - for (const t of this.getKeys()) e.set(t, this.getRaw(t)); - return e; + const dict = new Dict(this.xref); + for (const key of this.getKeys()) { + dict.set(key, this.getRaw(key)); + } + return dict; + } + delete(key) { + delete this._map[key]; } } class Ref { - constructor(e, t) { - this.num = e; - this.gen = t; + constructor(num, gen) { + this.num = num; + this.gen = gen; } toString() { - return 0 === this.gen ? `${this.num}R` : `${this.num}R${this.gen}`; + if (this.gen === 0) { + return `${this.num}R`; + } + return `${this.num}R${this.gen}`; } - static fromString(e) { - const t = wt[e]; - if (t) return t; - const i = /^(\d+)R(\d*)$/.exec(e); - return i && "0" !== i[1] - ? (wt[e] = new Ref(parseInt(i[1]), i[2] ? parseInt(i[2]) : 0)) - : null; + static fromString(str) { + const ref = RefCache[str]; + if (ref) { + return ref; + } + const m = /^(\d+)R(\d*)$/.exec(str); + if (!m || m[1] === "0") { + return null; + } + return (RefCache[str] = new Ref( + parseInt(m[1]), + !m[2] ? 0 : parseInt(m[2]), + )); } - static get(e, t) { - const i = 0 === t ? `${e}R` : `${e}R${t}`; - return (wt[i] ||= new Ref(e, t)); + static get(num, gen) { + const key = gen === 0 ? `${num}R` : `${num}R${gen}`; + return (RefCache[key] ||= new Ref(num, gen)); } } class RefSet { - constructor(e = null) { - this._set = new Set(e?._set); + constructor(parent = null) { + this._set = new Set(parent?._set); } - has(e) { - return this._set.has(e.toString()); + has(ref) { + return this._set.has(ref.toString()); } - put(e) { - this._set.add(e.toString()); + put(ref) { + this._set.add(ref.toString()); } - remove(e) { - this._set.delete(e.toString()); + remove(ref) { + this._set.delete(ref.toString()); } [Symbol.iterator]() { return this._set.values(); @@ -855,17 +1182,17 @@ class RefSetCache { get size() { return this._map.size; } - get(e) { - return this._map.get(e.toString()); + get(ref) { + return this._map.get(ref.toString()); } - has(e) { - return this._map.has(e.toString()); + has(ref) { + return this._map.has(ref.toString()); } - put(e, t) { - this._map.set(e.toString(), t); + put(ref, obj) { + this._map.set(ref.toString(), obj); } - putAlias(e, t) { - this._map.set(e.toString(), this.get(t)); + putAlias(ref, aliasRef) { + this._map.set(ref.toString(), this.get(aliasRef)); } [Symbol.iterator]() { return this._map.values(); @@ -874,26 +1201,27 @@ class RefSetCache { this._map.clear(); } *items() { - for (const [e, t] of this._map) yield [Ref.fromString(e), t]; + for (const [ref, value] of this._map) { + yield [Ref.fromString(ref), value]; + } } } -function isName(e, t) { - return e instanceof Name && (void 0 === t || e.name === t); +function isName(v, name) { + return v instanceof Name && (name === undefined || v.name === name); } -function isCmd(e, t) { - return e instanceof Cmd && (void 0 === t || e.cmd === t); +function isCmd(v, cmd) { + return v instanceof Cmd && (cmd === undefined || v.cmd === cmd); } -function isDict(e, t) { - return e instanceof Dict && (void 0 === t || isName(e.get("Type"), t)); -} -function isRefsEqual(e, t) { - return e.num === t.num && e.gen === t.gen; +function isDict(v, type) { + return ( + v instanceof Dict && (type === undefined || isName(v.get("Type"), type)) + ); } +function isRefsEqual(v1, v2) { + return v1.num === v2.num && v1.gen === v2.gen; +} // ./src/core/base_stream.js + class BaseStream { - constructor() { - this.constructor === BaseStream && - unreachable("Cannot initialize BaseStream."); - } get length() { unreachable("Abstract getter `length` accessed"); } @@ -901,57 +1229,64 @@ class BaseStream { unreachable("Abstract getter `isEmpty` accessed"); } get isDataLoaded() { - return shadow(this, "isDataLoaded", !0); + return shadow(this, "isDataLoaded", true); } getByte() { unreachable("Abstract method `getByte` called"); } - getBytes(e) { + getBytes(length) { unreachable("Abstract method `getBytes` called"); } - async getImageData(e, t) { - return this.getBytes(e, t); + async getImageData(length, decoderOptions) { + return this.getBytes(length, decoderOptions); } async asyncGetBytes() { unreachable("Abstract method `asyncGetBytes` called"); } get isAsync() { - return !1; + return false; } get canAsyncDecodeImageFromBuffer() { - return !1; + return false; + } + async getTransferableImage() { + return null; } peekByte() { - const e = this.getByte(); - -1 !== e && this.pos--; - return e; + const peekedByte = this.getByte(); + if (peekedByte !== -1) { + this.pos--; + } + return peekedByte; } - peekBytes(e) { - const t = this.getBytes(e); - this.pos -= t.length; - return t; + peekBytes(length) { + const bytes = this.getBytes(length); + this.pos -= bytes.length; + return bytes; } getUint16() { - const e = this.getByte(), - t = this.getByte(); - return -1 === e || -1 === t ? -1 : (e << 8) + t; + const b0 = this.getByte(); + const b1 = this.getByte(); + if (b0 === -1 || b1 === -1) { + return -1; + } + return (b0 << 8) + b1; } getInt32() { - return ( - (this.getByte() << 24) + - (this.getByte() << 16) + - (this.getByte() << 8) + - this.getByte() - ); + const b0 = this.getByte(); + const b1 = this.getByte(); + const b2 = this.getByte(); + const b3 = this.getByte(); + return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; } - getByteRange(e, t) { + getByteRange(begin, end) { unreachable("Abstract method `getByteRange` called"); } - getString(e) { - return bytesToString(this.getBytes(e)); + getString(length) { + return bytesToString(this.getBytes(length)); } - skip(e) { - this.pos += e || 1; + skip(n) { + this.pos += n || 1; } reset() { unreachable("Abstract method `reset` called"); @@ -959,82 +1294,93 @@ class BaseStream { moveStart() { unreachable("Abstract method `moveStart` called"); } - makeSubStream(e, t, i = null) { + makeSubStream(start, length, dict = null) { unreachable("Abstract method `makeSubStream` called"); } getBaseStreams() { return null; } -} -const bt = /^[1-9]\.\d$/; -function getLookupTableFactory(e) { - let t; +} // ./src/core/core_utils.js + +const PDF_VERSION_REGEXP = /^[1-9]\.\d$/; +function getLookupTableFactory(initializer) { + let lookup; return function () { - if (e) { - t = Object.create(null); - e(t); - e = null; + if (initializer) { + lookup = Object.create(null); + initializer(lookup); + initializer = null; } - return t; + return lookup; }; } -class MissingDataException extends rt { - constructor(e, t) { - super(`Missing data [${e}, ${t})`, "MissingDataException"); - this.begin = e; - this.end = t; +class MissingDataException extends BaseException { + constructor(begin, end) { + super(`Missing data [${begin}, ${end})`, "MissingDataException"); + this.begin = begin; + this.end = end; } } -class ParserEOFException extends rt { - constructor(e) { - super(e, "ParserEOFException"); +class ParserEOFException extends BaseException { + constructor(msg) { + super(msg, "ParserEOFException"); } } -class XRefEntryException extends rt { - constructor(e) { - super(e, "XRefEntryException"); +class XRefEntryException extends BaseException { + constructor(msg) { + super(msg, "XRefEntryException"); } } -class XRefParseException extends rt { - constructor(e) { - super(e, "XRefParseException"); +class XRefParseException extends BaseException { + constructor(msg) { + super(msg, "XRefParseException"); } } -function arrayBuffersToBytes(e) { - const t = e.length; - if (0 === t) return new Uint8Array(0); - if (1 === t) return new Uint8Array(e[0]); - let i = 0; - for (let a = 0; a < t; a++) i += e[a].byteLength; - const a = new Uint8Array(i); - let s = 0; - for (let i = 0; i < t; i++) { - const t = new Uint8Array(e[i]); - a.set(t, s); - s += t.byteLength; +function arrayBuffersToBytes(arr) { + const length = arr.length; + if (length === 0) { + return new Uint8Array(0); } - return a; + if (length === 1) { + return new Uint8Array(arr[0]); + } + let dataLength = 0; + for (let i = 0; i < length; i++) { + dataLength += arr[i].byteLength; + } + const data = new Uint8Array(dataLength); + let pos = 0; + for (let i = 0; i < length; i++) { + const item = new Uint8Array(arr[i]); + data.set(item, pos); + pos += item.byteLength; + } + return data; } function getInheritableProperty({ - dict: e, - key: t, - getArray: i = !1, - stopWhenFound: a = !0, + dict, + key, + getArray = false, + stopWhenFound = true, }) { - let s; - const r = new RefSet(); - for (; e instanceof Dict && (!e.objId || !r.has(e.objId)); ) { - e.objId && r.put(e.objId); - const n = i ? e.getArray(t) : e.get(t); - if (void 0 !== n) { - if (a) return n; - (s ||= []).push(n); + let values; + const visited = new RefSet(); + while (dict instanceof Dict && !(dict.objId && visited.has(dict.objId))) { + if (dict.objId) { + visited.put(dict.objId); } - e = e.get("Parent"); + const value = getArray ? dict.getArray(key) : dict.get(key); + if (value !== undefined) { + if (stopWhenFound) { + return value; + } + (values ||= []).push(value); + } + dict = dict.get("Parent"); } - return s; + return values; } -const Ft = [ +const ROMAN_NUMBER_MAP = [ "", "C", "CC", @@ -1066,326 +1412,465 @@ const Ft = [ "VIII", "IX", ]; -function toRomanNumerals(e, t = !1) { +function toRomanNumerals(number, lowerCase = false) { assert( - Number.isInteger(e) && e > 0, + Number.isInteger(number) && number > 0, "The number should be a positive integer.", ); - const i = []; - let a; - for (; e >= 1e3; ) { - e -= 1e3; - i.push("M"); + const romanBuf = []; + let pos; + while (number >= 1000) { + number -= 1000; + romanBuf.push("M"); } - a = (e / 100) | 0; - e %= 100; - i.push(Ft[a]); - a = (e / 10) | 0; - e %= 10; - i.push(Ft[10 + a]); - i.push(Ft[20 + e]); - const s = i.join(""); - return t ? s.toLowerCase() : s; + pos = (number / 100) | 0; + number %= 100; + romanBuf.push(ROMAN_NUMBER_MAP[pos]); + pos = (number / 10) | 0; + number %= 10; + romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]); + romanBuf.push(ROMAN_NUMBER_MAP[20 + number]); + const romanStr = romanBuf.join(""); + return lowerCase ? romanStr.toLowerCase() : romanStr; } -function log2(e) { - return e <= 0 ? 0 : Math.ceil(Math.log2(e)); +function log2(x) { + if (x <= 0) { + return 0; + } + return Math.ceil(Math.log2(x)); } -function readInt8(e, t) { - return (e[t] << 24) >> 24; +function readInt8(data, offset) { + return (data[offset] << 24) >> 24; } -function readUint16(e, t) { - return (e[t] << 8) | e[t + 1]; +function readUint16(data, offset) { + return (data[offset] << 8) | data[offset + 1]; } -function readUint32(e, t) { - return ((e[t] << 24) | (e[t + 1] << 16) | (e[t + 2] << 8) | e[t + 3]) >>> 0; -} -function isWhiteSpace(e) { - return 32 === e || 9 === e || 13 === e || 10 === e; -} -function isNumberArray(e, t) { +function readUint32(data, offset) { return ( - Array.isArray(e) && - (null === t || e.length === t) && - e.every((e) => "number" == typeof e) + ((data[offset] << 24) | + (data[offset + 1] << 16) | + (data[offset + 2] << 8) | + data[offset + 3]) >>> + 0 ); } -function lookupMatrix(e, t) { - return isNumberArray(e, 6) ? e : t; +function isWhiteSpace(ch) { + return ch === 0x20 || ch === 0x09 || ch === 0x0d || ch === 0x0a; } -function lookupRect(e, t) { - return isNumberArray(e, 4) ? e : t; +function isBooleanArray(arr, len) { + return ( + Array.isArray(arr) && + (len === null || arr.length === len) && + arr.every((x) => typeof x === "boolean") + ); } -function lookupNormalRect(e, t) { - return isNumberArray(e, 4) ? Util.normalizeRect(e) : t; +function isNumberArray(arr, len) { + if (Array.isArray(arr)) { + return ( + (len === null || arr.length === len) && + arr.every((x) => typeof x === "number") + ); + } + return ( + ArrayBuffer.isView(arr) && + (arr.length === 0 || typeof arr[0] === "number") && + (len === null || arr.length === len) + ); } -function parseXFAPath(e) { - const t = /(.+)\[(\d+)\]$/; - return e.split(".").map((e) => { - const i = e.match(t); - return i ? { name: i[1], pos: parseInt(i[2], 10) } : { name: e, pos: 0 }; +function lookupMatrix(arr, fallback) { + return isNumberArray(arr, 6) ? arr : fallback; +} +function lookupRect(arr, fallback) { + return isNumberArray(arr, 4) ? arr : fallback; +} +function lookupNormalRect(arr, fallback) { + return isNumberArray(arr, 4) ? Util.normalizeRect(arr) : fallback; +} +function parseXFAPath(path) { + const positionPattern = /(.+)\[(\d+)\]$/; + return path.split(".").map((component) => { + const m = component.match(positionPattern); + if (m) { + return { + name: m[1], + pos: parseInt(m[2], 10), + }; + } + return { + name: component, + pos: 0, + }; }); } -function escapePDFName(e) { - const t = []; - let i = 0; - for (let a = 0, s = e.length; a < s; a++) { - const s = e.charCodeAt(a); +function escapePDFName(str) { + const buffer = []; + let start = 0; + for (let i = 0, ii = str.length; i < ii; i++) { + const char = str.charCodeAt(i); if ( - s < 33 || - s > 126 || - 35 === s || - 40 === s || - 41 === s || - 60 === s || - 62 === s || - 91 === s || - 93 === s || - 123 === s || - 125 === s || - 47 === s || - 37 === s + char < 0x21 || + char > 0x7e || + char === 0x23 || + char === 0x28 || + char === 0x29 || + char === 0x3c || + char === 0x3e || + char === 0x5b || + char === 0x5d || + char === 0x7b || + char === 0x7d || + char === 0x2f || + char === 0x25 ) { - i < a && t.push(e.substring(i, a)); - t.push(`#${s.toString(16)}`); - i = a + 1; + if (start < i) { + buffer.push(str.substring(start, i)); + } + buffer.push(`#${char.toString(16)}`); + start = i + 1; } } - if (0 === t.length) return e; - i < e.length && t.push(e.substring(i, e.length)); - return t.join(""); -} -function escapeString(e) { - return e.replaceAll(/([()\\\n\r])/g, (e) => - "\n" === e ? "\\n" : "\r" === e ? "\\r" : `\\${e}`, - ); -} -function _collectJS(e, t, i, a) { - if (!e) return; - let s = null; - if (e instanceof Ref) { - if (a.has(e)) return; - s = e; - a.put(s); - e = t.fetch(e); + if (buffer.length === 0) { + return str; } - if (Array.isArray(e)) for (const s of e) _collectJS(s, t, i, a); - else if (e instanceof Dict) { - if (isName(e.get("S"), "JavaScript")) { - const t = e.get("JS"); - let a; - t instanceof BaseStream - ? (a = t.getString()) - : "string" == typeof t && (a = t); - a &&= stringToPDFString(a).replaceAll("\0", ""); - a && i.push(a); + if (start < str.length) { + buffer.push(str.substring(start, str.length)); + } + return buffer.join(""); +} +function escapeString(str) { + return str.replaceAll(/([()\\\n\r])/g, (match) => { + if (match === "\n") { + return "\\n"; + } else if (match === "\r") { + return "\\r"; } - _collectJS(e.getRaw("Next"), t, i, a); - } - s && a.remove(s); + return `\\${match}`; + }); } -function collectActions(e, t, i) { - const a = Object.create(null), - s = getInheritableProperty({ dict: t, key: "AA", stopWhenFound: !1 }); - if (s) - for (let t = s.length - 1; t >= 0; t--) { - const r = s[t]; - if (r instanceof Dict) - for (const t of r.getKeys()) { - const s = i[t]; - if (!s) continue; - const n = []; - _collectJS(r.getRaw(t), e, n, new RefSet()); - n.length > 0 && (a[s] = n); +function _collectJS(entry, xref, list, parents) { + if (!entry) { + return; + } + let parent = null; + if (entry instanceof Ref) { + if (parents.has(entry)) { + return; + } + parent = entry; + parents.put(parent); + entry = xref.fetch(entry); + } + if (Array.isArray(entry)) { + for (const element of entry) { + _collectJS(element, xref, list, parents); + } + } else if (entry instanceof Dict) { + if (isName(entry.get("S"), "JavaScript")) { + const js = entry.get("JS"); + let code; + if (js instanceof BaseStream) { + code = js.getString(); + } else if (typeof js === "string") { + code = js; + } + code &&= stringToPDFString(code).replaceAll("\x00", ""); + if (code) { + list.push(code); + } + } + _collectJS(entry.getRaw("Next"), xref, list, parents); + } + if (parent) { + parents.remove(parent); + } +} +function collectActions(xref, dict, eventType) { + const actions = Object.create(null); + const additionalActionsDicts = getInheritableProperty({ + dict, + key: "AA", + stopWhenFound: false, + }); + if (additionalActionsDicts) { + for (let i = additionalActionsDicts.length - 1; i >= 0; i--) { + const additionalActions = additionalActionsDicts[i]; + if (!(additionalActions instanceof Dict)) { + continue; + } + for (const key of additionalActions.getKeys()) { + const action = eventType[key]; + if (!action) { + continue; } + const actionDict = additionalActions.getRaw(key); + const parents = new RefSet(); + const list = []; + _collectJS(actionDict, xref, list, parents); + if (list.length > 0) { + actions[action] = list; + } + } } - if (t.has("A")) { - const i = []; - _collectJS(t.get("A"), e, i, new RefSet()); - i.length > 0 && (a.Action = i); } - return objectSize(a) > 0 ? a : null; + if (dict.has("A")) { + const actionDict = dict.get("A"); + const parents = new RefSet(); + const list = []; + _collectJS(actionDict, xref, list, parents); + if (list.length > 0) { + actions.Action = list; + } + } + return objectSize(actions) > 0 ? actions : null; } -const St = { 60: "<", 62: ">", 38: "&", 34: """, 39: "'" }; -function* codePointIter(e) { - for (let t = 0, i = e.length; t < i; t++) { - const i = e.codePointAt(t); - i > 55295 && (i < 57344 || i > 65533) && t++; - yield i; +const XMLEntities = { + 0x3c: "<", + 0x3e: ">", + 0x26: "&", + 0x22: """, + 0x27: "'", +}; +function* codePointIter(str) { + for (let i = 0, ii = str.length; i < ii; i++) { + const char = str.codePointAt(i); + if (char > 0xd7ff && (char < 0xe000 || char > 0xfffd)) { + i++; + } + yield char; } } -function encodeToXmlString(e) { - const t = []; - let i = 0; - for (let a = 0, s = e.length; a < s; a++) { - const s = e.codePointAt(a); - if (32 <= s && s <= 126) { - const r = St[s]; - if (r) { - i < a && t.push(e.substring(i, a)); - t.push(r); - i = a + 1; +function encodeToXmlString(str) { + const buffer = []; + let start = 0; + for (let i = 0, ii = str.length; i < ii; i++) { + const char = str.codePointAt(i); + if (0x20 <= char && char <= 0x7e) { + const entity = XMLEntities[char]; + if (entity) { + if (start < i) { + buffer.push(str.substring(start, i)); + } + buffer.push(entity); + start = i + 1; } } else { - i < a && t.push(e.substring(i, a)); - t.push(`&#x${s.toString(16).toUpperCase()};`); - s > 55295 && (s < 57344 || s > 65533) && a++; - i = a + 1; + if (start < i) { + buffer.push(str.substring(start, i)); + } + buffer.push(`&#x${char.toString(16).toUpperCase()};`); + if (char > 0xd7ff && (char < 0xe000 || char > 0xfffd)) { + i++; + } + start = i + 1; } } - if (0 === t.length) return e; - i < e.length && t.push(e.substring(i, e.length)); - return t.join(""); + if (buffer.length === 0) { + return str; + } + if (start < str.length) { + buffer.push(str.substring(start, str.length)); + } + return buffer.join(""); } -function validateFontName(e, t = !1) { - const i = /^("|').*("|')$/.exec(e); - if (i && i[1] === i[2]) { - if (new RegExp(`[^\\\\]${i[1]}`).test(e.slice(1, -1))) { - t && warn(`FontFamily contains unescaped ${i[1]}: ${e}.`); - return !1; - } - } else - for (const i of e.split(/[ \t]+/)) - if (/^(\d|(-(\d|-)))/.test(i) || !/^[\w-\\]+$/.test(i)) { - t && warn(`FontFamily contains invalid : ${e}.`); - return !1; +function validateFontName(fontFamily, mustWarn = false) { + const m = /^("|').*("|')$/.exec(fontFamily); + if (m && m[1] === m[2]) { + const re = new RegExp(`[^\\\\]${m[1]}`); + if (re.test(fontFamily.slice(1, -1))) { + if (mustWarn) { + warn(`FontFamily contains unescaped ${m[1]}: ${fontFamily}.`); } - return !0; + return false; + } + } else { + for (const ident of fontFamily.split(/[ \t]+/)) { + if (/^(\d|(-(\d|-)))/.test(ident) || !/^[\w-\\]+$/.test(ident)) { + if (mustWarn) { + warn(`FontFamily contains invalid : ${fontFamily}.`); + } + return false; + } + } + } + return true; } -function validateCSSFont(e) { - const t = new Set([ - "100", - "200", - "300", - "400", - "500", - "600", - "700", - "800", - "900", - "1000", - "normal", - "bold", - "bolder", - "lighter", - ]), - { fontFamily: i, fontWeight: a, italicAngle: s } = e; - if (!validateFontName(i, !0)) return !1; - const r = a ? a.toString() : ""; - e.fontWeight = t.has(r) ? r : "400"; - const n = parseFloat(s); - e.italicAngle = isNaN(n) || n < -90 || n > 90 ? "14" : s.toString(); - return !0; +function validateCSSFont(cssFontInfo) { + const DEFAULT_CSS_FONT_OBLIQUE = "14"; + const DEFAULT_CSS_FONT_WEIGHT = "400"; + const CSS_FONT_WEIGHT_VALUES = new Set([ + "100", + "200", + "300", + "400", + "500", + "600", + "700", + "800", + "900", + "1000", + "normal", + "bold", + "bolder", + "lighter", + ]); + const { fontFamily, fontWeight, italicAngle } = cssFontInfo; + if (!validateFontName(fontFamily, true)) { + return false; + } + const weight = fontWeight ? fontWeight.toString() : ""; + cssFontInfo.fontWeight = CSS_FONT_WEIGHT_VALUES.has(weight) + ? weight + : DEFAULT_CSS_FONT_WEIGHT; + const angle = parseFloat(italicAngle); + cssFontInfo.italicAngle = + isNaN(angle) || angle < -90 || angle > 90 + ? DEFAULT_CSS_FONT_OBLIQUE + : italicAngle.toString(); + return true; } -function recoverJsURL(e) { - const t = new RegExp( +function recoverJsURL(str) { + const URL_OPEN_METHODS = ["app.launchURL", "window.open", "xfa.host.gotoURL"]; + const regex = new RegExp( "^\\s*(" + - ["app.launchURL", "window.open", "xfa.host.gotoURL"] - .join("|") - .replaceAll(".", "\\.") + + URL_OPEN_METHODS.join("|").replaceAll(".", "\\.") + ")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))", "i", - ).exec(e); - if (t?.[2]) { - const e = t[2]; - let i = !1; - "true" === t[3] && "app.launchURL" === t[1] && (i = !0); - return { url: e, newWindow: i }; + ); + const jsUrl = regex.exec(str); + if (jsUrl?.[2]) { + const url = jsUrl[2]; + let newWindow = false; + if (jsUrl[3] === "true" && jsUrl[1] === "app.launchURL") { + newWindow = true; + } + return { + url, + newWindow, + }; } return null; } -function numberToString(e) { - if (Number.isInteger(e)) return e.toString(); - const t = Math.round(100 * e); - return t % 100 == 0 - ? (t / 100).toString() - : t % 10 == 0 - ? e.toFixed(1) - : e.toFixed(2); -} -function getNewAnnotationsMap(e) { - if (!e) return null; - const t = new Map(); - for (const [i, a] of e) { - if (!i.startsWith(E)) continue; - let e = t.get(a.pageIndex); - if (!e) { - e = []; - t.set(a.pageIndex, e); - } - e.push(a); +function numberToString(value) { + if (Number.isInteger(value)) { + return value.toString(); } - return t.size > 0 ? t : null; + const roundedValue = Math.round(value * 100); + if (roundedValue % 100 === 0) { + return (roundedValue / 100).toString(); + } + if (roundedValue % 10 === 0) { + return value.toFixed(1); + } + return value.toFixed(2); } -function isAscii(e) { - return /^[\x00-\x7F]*$/.test(e); +function getNewAnnotationsMap(annotationStorage) { + if (!annotationStorage) { + return null; + } + const newAnnotationsByPage = new Map(); + for (const [key, value] of annotationStorage) { + if (!key.startsWith(AnnotationEditorPrefix)) { + continue; + } + let annotations = newAnnotationsByPage.get(value.pageIndex); + if (!annotations) { + annotations = []; + newAnnotationsByPage.set(value.pageIndex, annotations); + } + annotations.push(value); + } + return newAnnotationsByPage.size > 0 ? newAnnotationsByPage : null; } -function stringToUTF16HexString(e) { - const t = []; - for (let i = 0, a = e.length; i < a; i++) { - const a = e.charCodeAt(i); - t.push( - ((a >> 8) & 255).toString(16).padStart(2, "0"), - (255 & a).toString(16).padStart(2, "0"), +function stringToAsciiOrUTF16BE(str) { + return isAscii(str) ? str : stringToUTF16String(str, true); +} +function isAscii(str) { + return /^[\x00-\x7F]*$/.test(str); +} +function stringToUTF16HexString(str) { + const buf = []; + for (let i = 0, ii = str.length; i < ii; i++) { + const char = str.charCodeAt(i); + buf.push(hexNumbers[(char >> 8) & 0xff], hexNumbers[char & 0xff]); + } + return buf.join(""); +} +function stringToUTF16String(str, bigEndian = false) { + const buf = []; + if (bigEndian) { + buf.push("\xFE\xFF"); + } + for (let i = 0, ii = str.length; i < ii; i++) { + const char = str.charCodeAt(i); + buf.push( + String.fromCharCode((char >> 8) & 0xff), + String.fromCharCode(char & 0xff), ); } - return t.join(""); + return buf.join(""); } -function stringToUTF16String(e, t = !1) { - const i = []; - t && i.push("þÿ"); - for (let t = 0, a = e.length; t < a; t++) { - const a = e.charCodeAt(t); - i.push(String.fromCharCode((a >> 8) & 255), String.fromCharCode(255 & a)); - } - return i.join(""); -} -function getRotationMatrix(e, t, i) { - switch (e) { +function getRotationMatrix(rotation, width, height) { + switch (rotation) { case 90: - return [0, 1, -1, 0, t, 0]; + return [0, 1, -1, 0, width, 0]; case 180: - return [-1, 0, 0, -1, t, i]; + return [-1, 0, 0, -1, width, height]; case 270: - return [0, -1, 1, 0, 0, i]; + return [0, -1, 1, 0, 0, height]; default: throw new Error("Invalid rotation"); } } -function getSizeInBytes(e) { - return Math.ceil(Math.ceil(Math.log2(1 + e)) / 8); -} +function getSizeInBytes(x) { + return Math.ceil(Math.ceil(Math.log2(1 + x)) / 8); +} // ./src/core/stream.js + class Stream extends BaseStream { - constructor(e, t, i, a) { + constructor(arrayBuffer, start, length, dict) { super(); - this.bytes = e instanceof Uint8Array ? e : new Uint8Array(e); - this.start = t || 0; + this.bytes = + arrayBuffer instanceof Uint8Array + ? arrayBuffer + : new Uint8Array(arrayBuffer); + this.start = start || 0; this.pos = this.start; - this.end = t + i || this.bytes.length; - this.dict = a; + this.end = start + length || this.bytes.length; + this.dict = dict; } get length() { return this.end - this.start; } get isEmpty() { - return 0 === this.length; + return this.length === 0; } getByte() { - return this.pos >= this.end ? -1 : this.bytes[this.pos++]; + if (this.pos >= this.end) { + return -1; + } + return this.bytes[this.pos++]; } - getBytes(e) { - const t = this.bytes, - i = this.pos, - a = this.end; - if (!e) return t.subarray(i, a); - let s = i + e; - s > a && (s = a); - this.pos = s; - return t.subarray(i, s); + getBytes(length) { + const bytes = this.bytes; + const pos = this.pos; + const strEnd = this.end; + if (!length) { + return bytes.subarray(pos, strEnd); + } + let end = pos + length; + if (end > strEnd) { + end = strEnd; + } + this.pos = end; + return bytes.subarray(pos, end); } - getByteRange(e, t) { - e < 0 && (e = 0); - t > this.end && (t = this.end); - return this.bytes.subarray(e, t); + getByteRange(begin, end) { + if (begin < 0) { + begin = 0; + } + if (end > this.end) { + end = this.end; + } + return this.bytes.subarray(begin, end); } reset() { this.pos = this.start; @@ -1393,35 +1878,39 @@ class Stream extends BaseStream { moveStart() { this.start = this.pos; } - makeSubStream(e, t, i = null) { - return new Stream(this.bytes.buffer, e, t, i); + makeSubStream(start, length, dict = null) { + return new Stream(this.bytes.buffer, start, length, dict); } } class StringStream extends Stream { - constructor(e) { - super(stringToBytes(e)); + constructor(str) { + super(stringToBytes(str)); } } class NullStream extends Stream { constructor() { super(new Uint8Array(0)); } -} +} // ./src/core/chunked_stream.js + class ChunkedStream extends Stream { - constructor(e, t, i) { - super(new Uint8Array(e), 0, e, null); - this.chunkSize = t; + constructor(length, chunkSize, manager) { + super(new Uint8Array(length), 0, length, null); + this.chunkSize = chunkSize; this._loadedChunks = new Set(); - this.numChunks = Math.ceil(e / t); - this.manager = i; + this.numChunks = Math.ceil(length / chunkSize); + this.manager = manager; this.progressiveDataLength = 0; this.lastSuccessfulEnsureByteChunk = -1; } getMissingChunks() { - const e = []; - for (let t = 0, i = this.numChunks; t < i; ++t) - this._loadedChunks.has(t) || e.push(t); - return e; + const chunks = []; + for (let chunk = 0, n = this.numChunks; chunk < n; ++chunk) { + if (!this._loadedChunks.has(chunk)) { + chunks.push(chunk); + } + } + return chunks; } get numChunksLoaded() { return this._loadedChunks.size; @@ -1429,468 +1918,686 @@ class ChunkedStream extends Stream { get isDataLoaded() { return this.numChunksLoaded === this.numChunks; } - onReceiveData(e, t) { - const i = this.chunkSize; - if (e % i != 0) throw new Error(`Bad begin offset: ${e}`); - const a = e + t.byteLength; - if (a % i != 0 && a !== this.bytes.length) - throw new Error(`Bad end offset: ${a}`); - this.bytes.set(new Uint8Array(t), e); - const s = Math.floor(e / i), - r = Math.floor((a - 1) / i) + 1; - for (let e = s; e < r; ++e) this._loadedChunks.add(e); - } - onReceiveProgressiveData(e) { - let t = this.progressiveDataLength; - const i = Math.floor(t / this.chunkSize); - this.bytes.set(new Uint8Array(e), t); - t += e.byteLength; - this.progressiveDataLength = t; - const a = t >= this.end ? this.numChunks : Math.floor(t / this.chunkSize); - for (let e = i; e < a; ++e) this._loadedChunks.add(e); - } - ensureByte(e) { - if (e < this.progressiveDataLength) return; - const t = Math.floor(e / this.chunkSize); - if (!(t > this.numChunks) && t !== this.lastSuccessfulEnsureByteChunk) { - if (!this._loadedChunks.has(t)) throw new MissingDataException(e, e + 1); - this.lastSuccessfulEnsureByteChunk = t; + onReceiveData(begin, chunk) { + const chunkSize = this.chunkSize; + if (begin % chunkSize !== 0) { + throw new Error(`Bad begin offset: ${begin}`); + } + const end = begin + chunk.byteLength; + if (end % chunkSize !== 0 && end !== this.bytes.length) { + throw new Error(`Bad end offset: ${end}`); + } + this.bytes.set(new Uint8Array(chunk), begin); + const beginChunk = Math.floor(begin / chunkSize); + const endChunk = Math.floor((end - 1) / chunkSize) + 1; + for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { + this._loadedChunks.add(curChunk); } } - ensureRange(e, t) { - if (e >= t) return; - if (t <= this.progressiveDataLength) return; - const i = Math.floor(e / this.chunkSize); - if (i > this.numChunks) return; - const a = Math.min( - Math.floor((t - 1) / this.chunkSize) + 1, + onReceiveProgressiveData(data) { + let position = this.progressiveDataLength; + const beginChunk = Math.floor(position / this.chunkSize); + this.bytes.set(new Uint8Array(data), position); + position += data.byteLength; + this.progressiveDataLength = position; + const endChunk = + position >= this.end + ? this.numChunks + : Math.floor(position / this.chunkSize); + for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { + this._loadedChunks.add(curChunk); + } + } + ensureByte(pos) { + if (pos < this.progressiveDataLength) { + return; + } + const chunk = Math.floor(pos / this.chunkSize); + if (chunk > this.numChunks) { + return; + } + if (chunk === this.lastSuccessfulEnsureByteChunk) { + return; + } + if (!this._loadedChunks.has(chunk)) { + throw new MissingDataException(pos, pos + 1); + } + this.lastSuccessfulEnsureByteChunk = chunk; + } + ensureRange(begin, end) { + if (begin >= end) { + return; + } + if (end <= this.progressiveDataLength) { + return; + } + const beginChunk = Math.floor(begin / this.chunkSize); + if (beginChunk > this.numChunks) { + return; + } + const endChunk = Math.min( + Math.floor((end - 1) / this.chunkSize) + 1, this.numChunks, ); - for (let s = i; s < a; ++s) - if (!this._loadedChunks.has(s)) throw new MissingDataException(e, t); + for (let chunk = beginChunk; chunk < endChunk; ++chunk) { + if (!this._loadedChunks.has(chunk)) { + throw new MissingDataException(begin, end); + } + } } - nextEmptyChunk(e) { - const t = this.numChunks; - for (let i = 0; i < t; ++i) { - const a = (e + i) % t; - if (!this._loadedChunks.has(a)) return a; + nextEmptyChunk(beginChunk) { + const numChunks = this.numChunks; + for (let i = 0; i < numChunks; ++i) { + const chunk = (beginChunk + i) % numChunks; + if (!this._loadedChunks.has(chunk)) { + return chunk; + } } return null; } - hasChunk(e) { - return this._loadedChunks.has(e); + hasChunk(chunk) { + return this._loadedChunks.has(chunk); } getByte() { - const e = this.pos; - if (e >= this.end) return -1; - e >= this.progressiveDataLength && this.ensureByte(e); + const pos = this.pos; + if (pos >= this.end) { + return -1; + } + if (pos >= this.progressiveDataLength) { + this.ensureByte(pos); + } return this.bytes[this.pos++]; } - getBytes(e) { - const t = this.bytes, - i = this.pos, - a = this.end; - if (!e) { - a > this.progressiveDataLength && this.ensureRange(i, a); - return t.subarray(i, a); + getBytes(length) { + const bytes = this.bytes; + const pos = this.pos; + const strEnd = this.end; + if (!length) { + if (strEnd > this.progressiveDataLength) { + this.ensureRange(pos, strEnd); + } + return bytes.subarray(pos, strEnd); } - let s = i + e; - s > a && (s = a); - s > this.progressiveDataLength && this.ensureRange(i, s); - this.pos = s; - return t.subarray(i, s); + let end = pos + length; + if (end > strEnd) { + end = strEnd; + } + if (end > this.progressiveDataLength) { + this.ensureRange(pos, end); + } + this.pos = end; + return bytes.subarray(pos, end); } - getByteRange(e, t) { - e < 0 && (e = 0); - t > this.end && (t = this.end); - t > this.progressiveDataLength && this.ensureRange(e, t); - return this.bytes.subarray(e, t); + getByteRange(begin, end) { + if (begin < 0) { + begin = 0; + } + if (end > this.end) { + end = this.end; + } + if (end > this.progressiveDataLength) { + this.ensureRange(begin, end); + } + return this.bytes.subarray(begin, end); } - makeSubStream(e, t, i = null) { - t - ? e + t > this.progressiveDataLength && this.ensureRange(e, e + t) - : e >= this.progressiveDataLength && this.ensureByte(e); + makeSubStream(start, length, dict = null) { + if (length) { + if (start + length > this.progressiveDataLength) { + this.ensureRange(start, start + length); + } + } else if (start >= this.progressiveDataLength) { + this.ensureByte(start); + } function ChunkedStreamSubstream() {} ChunkedStreamSubstream.prototype = Object.create(this); ChunkedStreamSubstream.prototype.getMissingChunks = function () { - const e = this.chunkSize, - t = Math.floor(this.start / e), - i = Math.floor((this.end - 1) / e) + 1, - a = []; - for (let e = t; e < i; ++e) this._loadedChunks.has(e) || a.push(e); - return a; + const chunkSize = this.chunkSize; + const beginChunk = Math.floor(this.start / chunkSize); + const endChunk = Math.floor((this.end - 1) / chunkSize) + 1; + const missingChunks = []; + for (let chunk = beginChunk; chunk < endChunk; ++chunk) { + if (!this._loadedChunks.has(chunk)) { + missingChunks.push(chunk); + } + } + return missingChunks; }; Object.defineProperty(ChunkedStreamSubstream.prototype, "isDataLoaded", { get() { - return ( - this.numChunksLoaded === this.numChunks || - 0 === this.getMissingChunks().length - ); + if (this.numChunksLoaded === this.numChunks) { + return true; + } + return this.getMissingChunks().length === 0; }, - configurable: !0, + configurable: true, }); - const a = new ChunkedStreamSubstream(); - a.pos = a.start = e; - a.end = e + t || this.end; - a.dict = i; - return a; + const subStream = new ChunkedStreamSubstream(); + subStream.pos = subStream.start = start; + subStream.end = start + length || this.end; + subStream.dict = dict; + return subStream; } getBaseStreams() { return [this]; } } class ChunkedStreamManager { - constructor(e, t) { - this.length = t.length; - this.chunkSize = t.rangeChunkSize; + constructor(pdfNetworkStream, args) { + this.length = args.length; + this.chunkSize = args.rangeChunkSize; this.stream = new ChunkedStream(this.length, this.chunkSize, this); - this.pdfNetworkStream = e; - this.disableAutoFetch = t.disableAutoFetch; - this.msgHandler = t.msgHandler; + this.pdfNetworkStream = pdfNetworkStream; + this.disableAutoFetch = args.disableAutoFetch; + this.msgHandler = args.msgHandler; this.currRequestId = 0; this._chunksNeededByRequest = new Map(); this._requestsByChunk = new Map(); this._promisesByRequest = new Map(); this.progressiveDataLength = 0; - this.aborted = !1; + this.aborted = false; this._loadedStreamCapability = Promise.withResolvers(); } - sendRequest(e, t) { - const i = this.pdfNetworkStream.getRangeReader(e, t); - i.isStreamingSupported || (i.onProgress = this.onProgress.bind(this)); - let a = [], - s = 0; - return new Promise((e, t) => { - const readChunk = ({ value: r, done: n }) => { + sendRequest(begin, end) { + const rangeReader = this.pdfNetworkStream.getRangeReader(begin, end); + if (!rangeReader.isStreamingSupported) { + rangeReader.onProgress = this.onProgress.bind(this); + } + let chunks = [], + loaded = 0; + return new Promise((resolve, reject) => { + const readChunk = ({ value, done }) => { try { - if (n) { - const t = arrayBuffersToBytes(a); - a = null; - e(t); + if (done) { + const chunkData = arrayBuffersToBytes(chunks); + chunks = null; + resolve(chunkData); return; } - s += r.byteLength; - i.isStreamingSupported && this.onProgress({ loaded: s }); - a.push(r); - i.read().then(readChunk, t); + loaded += value.byteLength; + if (rangeReader.isStreamingSupported) { + this.onProgress({ + loaded, + }); + } + chunks.push(value); + rangeReader.read().then(readChunk, reject); } catch (e) { - t(e); + reject(e); } }; - i.read().then(readChunk, t); - }).then((t) => { - this.aborted || this.onReceiveData({ chunk: t, begin: e }); + rangeReader.read().then(readChunk, reject); + }).then((data) => { + if (this.aborted) { + return; + } + this.onReceiveData({ + chunk: data, + begin, + }); }); } - requestAllChunks(e = !1) { - if (!e) { - const e = this.stream.getMissingChunks(); - this._requestChunks(e); + requestAllChunks(noFetch = false) { + if (!noFetch) { + const missingChunks = this.stream.getMissingChunks(); + this._requestChunks(missingChunks); } return this._loadedStreamCapability.promise; } - _requestChunks(e) { - const t = this.currRequestId++, - i = new Set(); - this._chunksNeededByRequest.set(t, i); - for (const t of e) this.stream.hasChunk(t) || i.add(t); - if (0 === i.size) return Promise.resolve(); - const a = Promise.withResolvers(); - this._promisesByRequest.set(t, a); - const s = []; - for (const e of i) { - let i = this._requestsByChunk.get(e); - if (!i) { - i = []; - this._requestsByChunk.set(e, i); - s.push(e); - } - i.push(t); - } - if (s.length > 0) { - const e = this.groupChunks(s); - for (const t of e) { - const e = t.beginChunk * this.chunkSize, - i = Math.min(t.endChunk * this.chunkSize, this.length); - this.sendRequest(e, i).catch(a.reject); + _requestChunks(chunks) { + const requestId = this.currRequestId++; + const chunksNeeded = new Set(); + this._chunksNeededByRequest.set(requestId, chunksNeeded); + for (const chunk of chunks) { + if (!this.stream.hasChunk(chunk)) { + chunksNeeded.add(chunk); } } - return a.promise.catch((e) => { - if (!this.aborted) throw e; + if (chunksNeeded.size === 0) { + return Promise.resolve(); + } + const capability = Promise.withResolvers(); + this._promisesByRequest.set(requestId, capability); + const chunksToRequest = []; + for (const chunk of chunksNeeded) { + let requestIds = this._requestsByChunk.get(chunk); + if (!requestIds) { + requestIds = []; + this._requestsByChunk.set(chunk, requestIds); + chunksToRequest.push(chunk); + } + requestIds.push(requestId); + } + if (chunksToRequest.length > 0) { + const groupedChunksToRequest = this.groupChunks(chunksToRequest); + for (const groupedChunk of groupedChunksToRequest) { + const begin = groupedChunk.beginChunk * this.chunkSize; + const end = Math.min( + groupedChunk.endChunk * this.chunkSize, + this.length, + ); + this.sendRequest(begin, end).catch(capability.reject); + } + } + return capability.promise.catch((reason) => { + if (this.aborted) { + return; + } + throw reason; }); } getStream() { return this.stream; } - requestRange(e, t) { - t = Math.min(t, this.length); - const i = this.getBeginChunk(e), - a = this.getEndChunk(t), - s = []; - for (let e = i; e < a; ++e) s.push(e); - return this._requestChunks(s); - } - requestRanges(e = []) { - const t = []; - for (const i of e) { - const e = this.getBeginChunk(i.begin), - a = this.getEndChunk(i.end); - for (let i = e; i < a; ++i) t.includes(i) || t.push(i); + requestRange(begin, end) { + end = Math.min(end, this.length); + const beginChunk = this.getBeginChunk(begin); + const endChunk = this.getEndChunk(end); + const chunks = []; + for (let chunk = beginChunk; chunk < endChunk; ++chunk) { + chunks.push(chunk); } - t.sort(function (e, t) { - return e - t; - }); - return this._requestChunks(t); + return this._requestChunks(chunks); } - groupChunks(e) { - const t = []; - let i = -1, - a = -1; - for (let s = 0, r = e.length; s < r; ++s) { - const r = e[s]; - i < 0 && (i = r); - if (a >= 0 && a + 1 !== r) { - t.push({ beginChunk: i, endChunk: a + 1 }); - i = r; - } - s + 1 === e.length && t.push({ beginChunk: i, endChunk: r + 1 }); - a = r; - } - return t; - } - onProgress(e) { - this.msgHandler.send("DocProgress", { - loaded: this.stream.numChunksLoaded * this.chunkSize + e.loaded, - total: this.length, - }); - } - onReceiveData(e) { - const t = e.chunk, - i = void 0 === e.begin, - a = i ? this.progressiveDataLength : e.begin, - s = a + t.byteLength, - r = Math.floor(a / this.chunkSize), - n = - s < this.length - ? Math.floor(s / this.chunkSize) - : Math.ceil(s / this.chunkSize); - if (i) { - this.stream.onReceiveProgressiveData(t); - this.progressiveDataLength = s; - } else this.stream.onReceiveData(a, t); - this.stream.isDataLoaded && - this._loadedStreamCapability.resolve(this.stream); - const g = []; - for (let e = r; e < n; ++e) { - const t = this._requestsByChunk.get(e); - if (t) { - this._requestsByChunk.delete(e); - for (const i of t) { - const t = this._chunksNeededByRequest.get(i); - t.has(e) && t.delete(e); - t.size > 0 || g.push(i); + requestRanges(ranges = []) { + const chunksToRequest = []; + for (const range of ranges) { + const beginChunk = this.getBeginChunk(range.begin); + const endChunk = this.getEndChunk(range.end); + for (let chunk = beginChunk; chunk < endChunk; ++chunk) { + if (!chunksToRequest.includes(chunk)) { + chunksToRequest.push(chunk); } } } - if (!this.disableAutoFetch && 0 === this._requestsByChunk.size) { - let e; - if (1 === this.stream.numChunksLoaded) { - const t = this.stream.numChunks - 1; - this.stream.hasChunk(t) || (e = t); - } else e = this.stream.nextEmptyChunk(n); - Number.isInteger(e) && this._requestChunks([e]); + chunksToRequest.sort(function (a, b) { + return a - b; + }); + return this._requestChunks(chunksToRequest); + } + groupChunks(chunks) { + const groupedChunks = []; + let beginChunk = -1; + let prevChunk = -1; + for (let i = 0, ii = chunks.length; i < ii; ++i) { + const chunk = chunks[i]; + if (beginChunk < 0) { + beginChunk = chunk; + } + if (prevChunk >= 0 && prevChunk + 1 !== chunk) { + groupedChunks.push({ + beginChunk, + endChunk: prevChunk + 1, + }); + beginChunk = chunk; + } + if (i + 1 === chunks.length) { + groupedChunks.push({ + beginChunk, + endChunk: chunk + 1, + }); + } + prevChunk = chunk; } - for (const e of g) { - const t = this._promisesByRequest.get(e); - this._promisesByRequest.delete(e); - t.resolve(); + return groupedChunks; + } + onProgress(args) { + this.msgHandler.send("DocProgress", { + loaded: this.stream.numChunksLoaded * this.chunkSize + args.loaded, + total: this.length, + }); + } + onReceiveData(args) { + const chunk = args.chunk; + const isProgressive = args.begin === undefined; + const begin = isProgressive ? this.progressiveDataLength : args.begin; + const end = begin + chunk.byteLength; + const beginChunk = Math.floor(begin / this.chunkSize); + const endChunk = + end < this.length + ? Math.floor(end / this.chunkSize) + : Math.ceil(end / this.chunkSize); + if (isProgressive) { + this.stream.onReceiveProgressiveData(chunk); + this.progressiveDataLength = end; + } else { + this.stream.onReceiveData(begin, chunk); + } + if (this.stream.isDataLoaded) { + this._loadedStreamCapability.resolve(this.stream); + } + const loadedRequests = []; + for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { + const requestIds = this._requestsByChunk.get(curChunk); + if (!requestIds) { + continue; + } + this._requestsByChunk.delete(curChunk); + for (const requestId of requestIds) { + const chunksNeeded = this._chunksNeededByRequest.get(requestId); + if (chunksNeeded.has(curChunk)) { + chunksNeeded.delete(curChunk); + } + if (chunksNeeded.size > 0) { + continue; + } + loadedRequests.push(requestId); + } + } + if (!this.disableAutoFetch && this._requestsByChunk.size === 0) { + let nextEmptyChunk; + if (this.stream.numChunksLoaded === 1) { + const lastChunk = this.stream.numChunks - 1; + if (!this.stream.hasChunk(lastChunk)) { + nextEmptyChunk = lastChunk; + } + } else { + nextEmptyChunk = this.stream.nextEmptyChunk(endChunk); + } + if (Number.isInteger(nextEmptyChunk)) { + this._requestChunks([nextEmptyChunk]); + } + } + for (const requestId of loadedRequests) { + const capability = this._promisesByRequest.get(requestId); + this._promisesByRequest.delete(requestId); + capability.resolve(); } this.msgHandler.send("DocProgress", { loaded: this.stream.numChunksLoaded * this.chunkSize, total: this.length, }); } - onError(e) { - this._loadedStreamCapability.reject(e); + onError(err) { + this._loadedStreamCapability.reject(err); } - getBeginChunk(e) { - return Math.floor(e / this.chunkSize); + getBeginChunk(begin) { + return Math.floor(begin / this.chunkSize); } - getEndChunk(e) { - return Math.floor((e - 1) / this.chunkSize) + 1; + getEndChunk(end) { + return Math.floor((end - 1) / this.chunkSize) + 1; } - abort(e) { - this.aborted = !0; - this.pdfNetworkStream?.cancelAllRequests(e); - for (const t of this._promisesByRequest.values()) t.reject(e); + abort(reason) { + this.aborted = true; + this.pdfNetworkStream?.cancelAllRequests(reason); + for (const capability of this._promisesByRequest.values()) { + capability.reject(reason); + } + } +} // ./src/core/colorspace.js + +function resizeRgbImage(src, dest, w1, h1, w2, h2, alpha01) { + const COMPONENTS = 3; + alpha01 = alpha01 !== 1 ? 0 : alpha01; + const xRatio = w1 / w2; + const yRatio = h1 / h2; + let newIndex = 0, + oldIndex; + const xScaled = new Uint16Array(w2); + const w1Scanline = w1 * COMPONENTS; + for (let i = 0; i < w2; i++) { + xScaled[i] = Math.floor(i * xRatio) * COMPONENTS; + } + for (let i = 0; i < h2; i++) { + const py = Math.floor(i * yRatio) * w1Scanline; + for (let j = 0; j < w2; j++) { + oldIndex = py + xScaled[j]; + dest[newIndex++] = src[oldIndex++]; + dest[newIndex++] = src[oldIndex++]; + dest[newIndex++] = src[oldIndex++]; + newIndex += alpha01; + } + } +} +function resizeRgbaImage(src, dest, w1, h1, w2, h2, alpha01) { + const xRatio = w1 / w2; + const yRatio = h1 / h2; + let newIndex = 0; + const xScaled = new Uint16Array(w2); + if (alpha01 === 1) { + for (let i = 0; i < w2; i++) { + xScaled[i] = Math.floor(i * xRatio); + } + const src32 = new Uint32Array(src.buffer); + const dest32 = new Uint32Array(dest.buffer); + const rgbMask = FeatureTest.isLittleEndian ? 0x00ffffff : 0xffffff00; + for (let i = 0; i < h2; i++) { + const buf = src32.subarray(Math.floor(i * yRatio) * w1); + for (let j = 0; j < w2; j++) { + dest32[newIndex++] |= buf[xScaled[j]] & rgbMask; + } + } + } else { + const COMPONENTS = 4; + const w1Scanline = w1 * COMPONENTS; + for (let i = 0; i < w2; i++) { + xScaled[i] = Math.floor(i * xRatio) * COMPONENTS; + } + for (let i = 0; i < h2; i++) { + const buf = src.subarray(Math.floor(i * yRatio) * w1Scanline); + for (let j = 0; j < w2; j++) { + const oldIndex = xScaled[j]; + dest[newIndex++] = buf[oldIndex]; + dest[newIndex++] = buf[oldIndex + 1]; + dest[newIndex++] = buf[oldIndex + 2]; + } + } + } +} +function copyRgbaImage(src, dest, alpha01) { + if (alpha01 === 1) { + const src32 = new Uint32Array(src.buffer); + const dest32 = new Uint32Array(dest.buffer); + const rgbMask = FeatureTest.isLittleEndian ? 0x00ffffff : 0xffffff00; + for (let i = 0, ii = src32.length; i < ii; i++) { + dest32[i] |= src32[i] & rgbMask; + } + } else { + let j = 0; + for (let i = 0, ii = src.length; i < ii; i += 4) { + dest[j++] = src[i]; + dest[j++] = src[i + 1]; + dest[j++] = src[i + 2]; + } } } class ColorSpace { - constructor(e, t) { - this.constructor === ColorSpace && - unreachable("Cannot initialize ColorSpace."); - this.name = e; - this.numComps = t; + constructor(name, numComps) { + this.name = name; + this.numComps = numComps; } - getRgb(e, t) { - const i = new Uint8ClampedArray(3); - this.getRgbItem(e, t, i, 0); - return i; + getRgb(src, srcOffset) { + const rgb = new Uint8ClampedArray(3); + this.getRgbItem(src, srcOffset, rgb, 0); + return rgb; } - getRgbItem(e, t, i, a) { + getRgbItem(src, srcOffset, dest, destOffset) { unreachable("Should not call ColorSpace.getRgbItem"); } - getRgbBuffer(e, t, i, a, s, r, n) { + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { unreachable("Should not call ColorSpace.getRgbBuffer"); } - getOutputLength(e, t) { + getOutputLength(inputLength, alpha01) { unreachable("Should not call ColorSpace.getOutputLength"); } - isPassthrough(e) { - return !1; + isPassthrough(bits) { + return false; } - isDefaultDecode(e, t) { - return ColorSpace.isDefaultDecode(e, this.numComps); + isDefaultDecode(decodeMap, bpc) { + return ColorSpace.isDefaultDecode(decodeMap, this.numComps); } - fillRgb(e, t, i, a, s, r, n, g, o) { - const c = t * i; - let C = null; - const h = 1 << n, - l = i !== s || t !== a; - if (this.isPassthrough(n)) C = g; - else if ( - 1 === this.numComps && - c > h && - "DeviceGray" !== this.name && - "DeviceRGB" !== this.name + fillRgb( + dest, + originalWidth, + originalHeight, + width, + height, + actualHeight, + bpc, + comps, + alpha01, + ) { + const count = originalWidth * originalHeight; + let rgbBuf = null; + const numComponentColors = 1 << bpc; + const needsResizing = originalHeight !== height || originalWidth !== width; + if (this.isPassthrough(bpc)) { + rgbBuf = comps; + } else if ( + this.numComps === 1 && + count > numComponentColors && + this.name !== "DeviceGray" && + this.name !== "DeviceRGB" ) { - const t = n <= 8 ? new Uint8Array(h) : new Uint16Array(h); - for (let e = 0; e < h; e++) t[e] = e; - const i = new Uint8ClampedArray(3 * h); - this.getRgbBuffer(t, 0, h, i, 0, n, 0); - if (l) { - C = new Uint8Array(3 * c); - let e = 0; - for (let t = 0; t < c; ++t) { - const a = 3 * g[t]; - C[e++] = i[a]; - C[e++] = i[a + 1]; - C[e++] = i[a + 2]; + const allColors = + bpc <= 8 + ? new Uint8Array(numComponentColors) + : new Uint16Array(numComponentColors); + for (let i = 0; i < numComponentColors; i++) { + allColors[i] = i; + } + const colorMap = new Uint8ClampedArray(numComponentColors * 3); + this.getRgbBuffer(allColors, 0, numComponentColors, colorMap, 0, bpc, 0); + if (!needsResizing) { + let destPos = 0; + for (let i = 0; i < count; ++i) { + const key = comps[i] * 3; + dest[destPos++] = colorMap[key]; + dest[destPos++] = colorMap[key + 1]; + dest[destPos++] = colorMap[key + 2]; + destPos += alpha01; } } else { - let t = 0; - for (let a = 0; a < c; ++a) { - const s = 3 * g[a]; - e[t++] = i[s]; - e[t++] = i[s + 1]; - e[t++] = i[s + 2]; - t += o; + rgbBuf = new Uint8Array(count * 3); + let rgbPos = 0; + for (let i = 0; i < count; ++i) { + const key = comps[i] * 3; + rgbBuf[rgbPos++] = colorMap[key]; + rgbBuf[rgbPos++] = colorMap[key + 1]; + rgbBuf[rgbPos++] = colorMap[key + 2]; } } - } else if (l) { - C = new Uint8ClampedArray(3 * c); - this.getRgbBuffer(g, 0, c, C, 0, n, 0); - } else this.getRgbBuffer(g, 0, a * r, e, 0, n, o); - if (C) - if (l) - !(function resizeRgbImage(e, t, i, a, s, r, n) { - n = 1 !== n ? 0 : n; - const g = i / s, - o = a / r; - let c, - C = 0; - const h = new Uint16Array(s), - l = 3 * i; - for (let e = 0; e < s; e++) h[e] = 3 * Math.floor(e * g); - for (let i = 0; i < r; i++) { - const a = Math.floor(i * o) * l; - for (let i = 0; i < s; i++) { - c = a + h[i]; - t[C++] = e[c++]; - t[C++] = e[c++]; - t[C++] = e[c++]; - C += n; - } - } - })(C, e, t, i, a, s, o); - else { - let t = 0, - i = 0; - for (let s = 0, n = a * r; s < n; s++) { - e[t++] = C[i++]; - e[t++] = C[i++]; - e[t++] = C[i++]; - t += o; + } else if (!needsResizing) { + this.getRgbBuffer(comps, 0, width * actualHeight, dest, 0, bpc, alpha01); + } else { + rgbBuf = new Uint8ClampedArray(count * 3); + this.getRgbBuffer(comps, 0, count, rgbBuf, 0, bpc, 0); + } + if (rgbBuf) { + if (needsResizing) { + resizeRgbImage( + rgbBuf, + dest, + originalWidth, + originalHeight, + width, + height, + alpha01, + ); + } else { + let destPos = 0, + rgbPos = 0; + for (let i = 0, ii = width * actualHeight; i < ii; i++) { + dest[destPos++] = rgbBuf[rgbPos++]; + dest[destPos++] = rgbBuf[rgbPos++]; + dest[destPos++] = rgbBuf[rgbPos++]; + destPos += alpha01; } } + } } get usesZeroToOneRange() { - return shadow(this, "usesZeroToOneRange", !0); + return shadow(this, "usesZeroToOneRange", true); } - static _cache(e, t, i, a) { - if (!i) + static _cache(cacheKey, xref, localColorSpaceCache, parsedColorSpace) { + if (!localColorSpaceCache) { throw new Error( 'ColorSpace._cache - expected "localColorSpaceCache" argument.', ); - if (!a) + } + if (!parsedColorSpace) { throw new Error( 'ColorSpace._cache - expected "parsedColorSpace" argument.', ); - let s, r; - if (e instanceof Ref) { - r = e; - e = t.fetch(e); } - e instanceof Name && (s = e.name); - (s || r) && i.set(s, r, a); + let csName, csRef; + if (cacheKey instanceof Ref) { + csRef = cacheKey; + cacheKey = xref.fetch(cacheKey); + } + if (cacheKey instanceof Name) { + csName = cacheKey.name; + } + if (csName || csRef) { + localColorSpaceCache.set(csName, csRef, parsedColorSpace); + } } - static getCached(e, t, i) { - if (!i) + static getCached(cacheKey, xref, localColorSpaceCache) { + if (!localColorSpaceCache) { throw new Error( 'ColorSpace.getCached - expected "localColorSpaceCache" argument.', ); - if (e instanceof Ref) { - const a = i.getByRef(e); - if (a) return a; + } + if (cacheKey instanceof Ref) { + const localColorSpace = localColorSpaceCache.getByRef(cacheKey); + if (localColorSpace) { + return localColorSpace; + } try { - e = t.fetch(e); - } catch (e) { - if (e instanceof MissingDataException) throw e; + cacheKey = xref.fetch(cacheKey); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } } } - if (e instanceof Name) { - const t = i.getByName(e.name); - if (t) return t; + if (cacheKey instanceof Name) { + const localColorSpace = localColorSpaceCache.getByName(cacheKey.name); + if (localColorSpace) { + return localColorSpace; + } } return null; } static async parseAsync({ - cs: e, - xref: t, - resources: i = null, - pdfFunctionFactory: a, - localColorSpaceCache: s, + cs, + xref, + resources = null, + pdfFunctionFactory, + localColorSpaceCache, }) { - const r = this._parse(e, t, i, a); - this._cache(e, t, s, r); - return r; + const parsedColorSpace = this._parse( + cs, + xref, + resources, + pdfFunctionFactory, + ); + this._cache(cs, xref, localColorSpaceCache, parsedColorSpace); + return parsedColorSpace; } static parse({ - cs: e, - xref: t, - resources: i = null, - pdfFunctionFactory: a, - localColorSpaceCache: s, + cs, + xref, + resources = null, + pdfFunctionFactory, + localColorSpaceCache, }) { - const r = this.getCached(e, t, s); - if (r) return r; - const n = this._parse(e, t, i, a); - this._cache(e, t, s, n); - return n; + const cachedColorSpace = this.getCached(cs, xref, localColorSpaceCache); + if (cachedColorSpace) { + return cachedColorSpace; + } + const parsedColorSpace = this._parse( + cs, + xref, + resources, + pdfFunctionFactory, + ); + this._cache(cs, xref, localColorSpaceCache, parsedColorSpace); + return parsedColorSpace; } - static _parse(e, t, i = null, a) { - if ((e = t.fetchIfRef(e)) instanceof Name) - switch (e.name) { + static _parse(cs, xref, resources = null, pdfFunctionFactory) { + cs = xref.fetchIfRef(cs); + if (cs instanceof Name) { + switch (cs.name) { case "G": case "DeviceGray": return this.singletons.gray; @@ -1905,23 +2612,32 @@ class ColorSpace { case "Pattern": return new PatternCS(null); default: - if (i instanceof Dict) { - const s = i.get("ColorSpace"); - if (s instanceof Dict) { - const r = s.get(e.name); - if (r) { - if (r instanceof Name) return this._parse(r, t, i, a); - e = r; + if (resources instanceof Dict) { + const colorSpaces = resources.get("ColorSpace"); + if (colorSpaces instanceof Dict) { + const resourcesCS = colorSpaces.get(cs.name); + if (resourcesCS) { + if (resourcesCS instanceof Name) { + return this._parse( + resourcesCS, + xref, + resources, + pdfFunctionFactory, + ); + } + cs = resourcesCS; break; } } } - throw new FormatError(`Unrecognized ColorSpace: ${e.name}`); + warn(`Unrecognized ColorSpace: ${cs.name}`); + return this.singletons.gray; } - if (Array.isArray(e)) { - const s = t.fetchIfRef(e[0]).name; - let r, n, g, o, c, C; - switch (s) { + } + if (Array.isArray(cs)) { + const mode = xref.fetchIfRef(cs[0]).name; + let params, numComps, baseCS, whitePoint, blackPoint, gamma; + switch (mode) { case "G": case "DeviceGray": return this.singletons.gray; @@ -1932,69 +2648,85 @@ class ColorSpace { case "DeviceCMYK": return this.singletons.cmyk; case "CalGray": - r = t.fetchIfRef(e[1]); - o = r.getArray("WhitePoint"); - c = r.getArray("BlackPoint"); - C = r.get("Gamma"); - return new CalGrayCS(o, c, C); + params = xref.fetchIfRef(cs[1]); + whitePoint = params.getArray("WhitePoint"); + blackPoint = params.getArray("BlackPoint"); + gamma = params.get("Gamma"); + return new CalGrayCS(whitePoint, blackPoint, gamma); case "CalRGB": - r = t.fetchIfRef(e[1]); - o = r.getArray("WhitePoint"); - c = r.getArray("BlackPoint"); - C = r.getArray("Gamma"); - const h = r.getArray("Matrix"); - return new CalRGBCS(o, c, C, h); + params = xref.fetchIfRef(cs[1]); + whitePoint = params.getArray("WhitePoint"); + blackPoint = params.getArray("BlackPoint"); + gamma = params.getArray("Gamma"); + const matrix = params.getArray("Matrix"); + return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); case "ICCBased": - const l = t.fetchIfRef(e[1]).dict; - n = l.get("N"); - const Q = l.get("Alternate"); - if (Q) { - const e = this._parse(Q, t, i, a); - if (e.numComps === n) return e; + const stream = xref.fetchIfRef(cs[1]); + const dict = stream.dict; + numComps = dict.get("N"); + const alt = dict.get("Alternate"); + if (alt) { + const altCS = this._parse(alt, xref, resources, pdfFunctionFactory); + if (altCS.numComps === numComps) { + return altCS; + } warn("ICCBased color space: Ignoring incorrect /Alternate entry."); } - if (1 === n) return this.singletons.gray; - if (3 === n) return this.singletons.rgb; - if (4 === n) return this.singletons.cmyk; + if (numComps === 1) { + return this.singletons.gray; + } else if (numComps === 3) { + return this.singletons.rgb; + } else if (numComps === 4) { + return this.singletons.cmyk; + } break; case "Pattern": - g = e[1] || null; - g && (g = this._parse(g, t, i, a)); - return new PatternCS(g); + baseCS = cs[1] || null; + if (baseCS) { + baseCS = this._parse(baseCS, xref, resources, pdfFunctionFactory); + } + return new PatternCS(baseCS); case "I": case "Indexed": - g = this._parse(e[1], t, i, a); - const E = t.fetchIfRef(e[2]) + 1, - u = t.fetchIfRef(e[3]); - return new IndexedCS(g, E, u); + baseCS = this._parse(cs[1], xref, resources, pdfFunctionFactory); + const hiVal = Math.max(0, Math.min(xref.fetchIfRef(cs[2]), 255)); + const lookup = xref.fetchIfRef(cs[3]); + return new IndexedCS(baseCS, hiVal, lookup); case "Separation": case "DeviceN": - const d = t.fetchIfRef(e[1]); - n = Array.isArray(d) ? d.length : 1; - g = this._parse(e[2], t, i, a); - const f = a.create(e[3]); - return new AlternateCS(n, g, f); + const name = xref.fetchIfRef(cs[1]); + numComps = Array.isArray(name) ? name.length : 1; + baseCS = this._parse(cs[2], xref, resources, pdfFunctionFactory); + const tintFn = pdfFunctionFactory.create(cs[3]); + return new AlternateCS(numComps, baseCS, tintFn); case "Lab": - r = t.fetchIfRef(e[1]); - o = r.getArray("WhitePoint"); - c = r.getArray("BlackPoint"); - const p = r.getArray("Range"); - return new LabCS(o, c, p); + params = xref.fetchIfRef(cs[1]); + whitePoint = params.getArray("WhitePoint"); + blackPoint = params.getArray("BlackPoint"); + const range = params.getArray("Range"); + return new LabCS(whitePoint, blackPoint, range); default: - throw new FormatError(`Unimplemented ColorSpace object: ${s}`); + warn(`Unimplemented ColorSpace object: ${mode}`); + return this.singletons.gray; } } - throw new FormatError(`Unrecognized ColorSpace object: ${e}`); + warn(`Unrecognized ColorSpace object: ${cs}`); + return this.singletons.gray; } - static isDefaultDecode(e, t) { - if (!Array.isArray(e)) return !0; - if (2 * t !== e.length) { - warn("The decode map is not the correct length"); - return !0; + static isDefaultDecode(decode, numComps) { + if (!Array.isArray(decode)) { + return true; } - for (let t = 0, i = e.length; t < i; t += 2) - if (0 !== e[t] || 1 !== e[t + 1]) return !1; - return !0; + if (numComps * 2 !== decode.length) { + warn("The decode map is not the correct length"); + return true; + } + for (let i = 0, ii = decode.length; i < ii; i += 2) { + if (decode[i] !== 0 || decode[i + 1] !== 1) { + return false; + } + } + return true; } static get singletons() { return shadow(this, "singletons", { @@ -2014,267 +2746,309 @@ class ColorSpace { } } class AlternateCS extends ColorSpace { - constructor(e, t, i) { - super("Alternate", e); - this.base = t; - this.tintFn = i; - this.tmpBuf = new Float32Array(t.numComps); + constructor(numComps, base, tintFn) { + super("Alternate", numComps); + this.base = base; + this.tintFn = tintFn; + this.tmpBuf = new Float32Array(base.numComps); } - getRgbItem(e, t, i, a) { - const s = this.tmpBuf; - this.tintFn(e, t, s, 0); - this.base.getRgbItem(s, 0, i, a); + getRgbItem(src, srcOffset, dest, destOffset) { + const tmpBuf = this.tmpBuf; + this.tintFn(src, srcOffset, tmpBuf, 0); + this.base.getRgbItem(tmpBuf, 0, dest, destOffset); } - getRgbBuffer(e, t, i, a, s, r, n) { - const g = this.tintFn, - o = this.base, - c = 1 / ((1 << r) - 1), - C = o.numComps, - h = o.usesZeroToOneRange, - l = (o.isPassthrough(8) || !h) && 0 === n; - let Q = l ? s : 0; - const E = l ? a : new Uint8ClampedArray(C * i), - u = this.numComps, - d = new Float32Array(u), - f = new Float32Array(C); - let p, m; - for (p = 0; p < i; p++) { - for (m = 0; m < u; m++) d[m] = e[t++] * c; - g(d, 0, f, 0); - if (h) for (m = 0; m < C; m++) E[Q++] = 255 * f[m]; - else { - o.getRgbItem(f, 0, E, Q); - Q += C; + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const tintFn = this.tintFn; + const base = this.base; + const scale = 1 / ((1 << bits) - 1); + const baseNumComps = base.numComps; + const usesZeroToOneRange = base.usesZeroToOneRange; + const isPassthrough = + (base.isPassthrough(8) || !usesZeroToOneRange) && alpha01 === 0; + let pos = isPassthrough ? destOffset : 0; + const baseBuf = isPassthrough + ? dest + : new Uint8ClampedArray(baseNumComps * count); + const numComps = this.numComps; + const scaled = new Float32Array(numComps); + const tinted = new Float32Array(baseNumComps); + let i, j; + for (i = 0; i < count; i++) { + for (j = 0; j < numComps; j++) { + scaled[j] = src[srcOffset++] * scale; + } + tintFn(scaled, 0, tinted, 0); + if (usesZeroToOneRange) { + for (j = 0; j < baseNumComps; j++) { + baseBuf[pos++] = tinted[j] * 255; + } + } else { + base.getRgbItem(tinted, 0, baseBuf, pos); + pos += baseNumComps; } } - l || o.getRgbBuffer(E, 0, i, a, s, 8, n); + if (!isPassthrough) { + base.getRgbBuffer(baseBuf, 0, count, dest, destOffset, 8, alpha01); + } } - getOutputLength(e, t) { + getOutputLength(inputLength, alpha01) { return this.base.getOutputLength( - (e * this.base.numComps) / this.numComps, - t, + (inputLength * this.base.numComps) / this.numComps, + alpha01, ); } } class PatternCS extends ColorSpace { - constructor(e) { + constructor(baseCS) { super("Pattern", null); - this.base = e; + this.base = baseCS; } - isDefaultDecode(e, t) { + isDefaultDecode(decodeMap, bpc) { unreachable("Should not call PatternCS.isDefaultDecode"); } } class IndexedCS extends ColorSpace { - constructor(e, t, i) { + constructor(base, highVal, lookup) { super("Indexed", 1); - this.base = e; - this.highVal = t; - const a = e.numComps * t; - this.lookup = new Uint8Array(a); - if (i instanceof BaseStream) { - const e = i.getBytes(a); - this.lookup.set(e); + this.base = base; + const length = base.numComps * (highVal + 1); + this.lookup = new Uint8Array(length); + if (lookup instanceof BaseStream) { + const bytes = lookup.getBytes(length); + this.lookup.set(bytes); + } else if (typeof lookup === "string") { + for (let i = 0; i < length; ++i) { + this.lookup[i] = lookup.charCodeAt(i) & 0xff; + } } else { - if ("string" != typeof i) - throw new FormatError(`IndexedCS - unrecognized lookup table: ${i}`); - for (let e = 0; e < a; ++e) this.lookup[e] = 255 & i.charCodeAt(e); + throw new FormatError(`IndexedCS - unrecognized lookup table: ${lookup}`); } } - getRgbItem(e, t, i, a) { - const s = this.base.numComps, - r = e[t] * s; - this.base.getRgbBuffer(this.lookup, r, 1, i, a, 8, 0); + getRgbItem(src, srcOffset, dest, destOffset) { + const numComps = this.base.numComps; + const start = src[srcOffset] * numComps; + this.base.getRgbBuffer(this.lookup, start, 1, dest, destOffset, 8, 0); } - getRgbBuffer(e, t, i, a, s, r, n) { - const g = this.base, - o = g.numComps, - c = g.getOutputLength(o, n), - C = this.lookup; - for (let r = 0; r < i; ++r) { - const i = e[t++] * o; - g.getRgbBuffer(C, i, 1, a, s, 8, n); - s += c; + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const base = this.base; + const numComps = base.numComps; + const outputDelta = base.getOutputLength(numComps, alpha01); + const lookup = this.lookup; + for (let i = 0; i < count; ++i) { + const lookupPos = src[srcOffset++] * numComps; + base.getRgbBuffer(lookup, lookupPos, 1, dest, destOffset, 8, alpha01); + destOffset += outputDelta; } } - getOutputLength(e, t) { - return this.base.getOutputLength(e * this.base.numComps, t); + getOutputLength(inputLength, alpha01) { + return this.base.getOutputLength(inputLength * this.base.numComps, alpha01); } - isDefaultDecode(e, t) { - if (!Array.isArray(e)) return !0; - if (2 !== e.length) { + isDefaultDecode(decodeMap, bpc) { + if (!Array.isArray(decodeMap)) { + return true; + } + if (decodeMap.length !== 2) { warn("Decode map length is not correct"); - return !0; + return true; } - if (!Number.isInteger(t) || t < 1) { + if (!Number.isInteger(bpc) || bpc < 1) { warn("Bits per component is not correct"); - return !0; + return true; } - return 0 === e[0] && e[1] === (1 << t) - 1; + return decodeMap[0] === 0 && decodeMap[1] === (1 << bpc) - 1; } } class DeviceGrayCS extends ColorSpace { constructor() { super("DeviceGray", 1); } - getRgbItem(e, t, i, a) { - const s = 255 * e[t]; - i[a] = i[a + 1] = i[a + 2] = s; + getRgbItem(src, srcOffset, dest, destOffset) { + const c = src[srcOffset] * 255; + dest[destOffset] = dest[destOffset + 1] = dest[destOffset + 2] = c; } - getRgbBuffer(e, t, i, a, s, r, n) { - const g = 255 / ((1 << r) - 1); - let o = t, - c = s; - for (let t = 0; t < i; ++t) { - const t = g * e[o++]; - a[c++] = t; - a[c++] = t; - a[c++] = t; - c += n; + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const scale = 255 / ((1 << bits) - 1); + let j = srcOffset, + q = destOffset; + for (let i = 0; i < count; ++i) { + const c = scale * src[j++]; + dest[q++] = c; + dest[q++] = c; + dest[q++] = c; + q += alpha01; } } - getOutputLength(e, t) { - return e * (3 + t); + getOutputLength(inputLength, alpha01) { + return inputLength * (3 + alpha01); } } class DeviceRgbCS extends ColorSpace { constructor() { super("DeviceRGB", 3); } - getRgbItem(e, t, i, a) { - i[a] = 255 * e[t]; - i[a + 1] = 255 * e[t + 1]; - i[a + 2] = 255 * e[t + 2]; + getRgbItem(src, srcOffset, dest, destOffset) { + dest[destOffset] = src[srcOffset] * 255; + dest[destOffset + 1] = src[srcOffset + 1] * 255; + dest[destOffset + 2] = src[srcOffset + 2] * 255; } - getRgbBuffer(e, t, i, a, s, r, n) { - if (8 === r && 0 === n) { - a.set(e.subarray(t, t + 3 * i), s); + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + if (bits === 8 && alpha01 === 0) { + dest.set(src.subarray(srcOffset, srcOffset + count * 3), destOffset); return; } - const g = 255 / ((1 << r) - 1); - let o = t, - c = s; - for (let t = 0; t < i; ++t) { - a[c++] = g * e[o++]; - a[c++] = g * e[o++]; - a[c++] = g * e[o++]; - c += n; + const scale = 255 / ((1 << bits) - 1); + let j = srcOffset, + q = destOffset; + for (let i = 0; i < count; ++i) { + dest[q++] = scale * src[j++]; + dest[q++] = scale * src[j++]; + dest[q++] = scale * src[j++]; + q += alpha01; } } - getOutputLength(e, t) { - return ((e * (3 + t)) / 3) | 0; + getOutputLength(inputLength, alpha01) { + return ((inputLength * (3 + alpha01)) / 3) | 0; } - isPassthrough(e) { - return 8 === e; + isPassthrough(bits) { + return bits === 8; } } class DeviceRgbaCS extends ColorSpace { constructor() { super("DeviceRGBA", 4); } - getOutputLength(e, t) { - return 4 * e; + getOutputLength(inputLength, _alpha01) { + return inputLength * 4; } - isPassthrough(e) { - return 8 === e; + isPassthrough(bits) { + return bits === 8; + } + fillRgb( + dest, + originalWidth, + originalHeight, + width, + height, + actualHeight, + bpc, + comps, + alpha01, + ) { + if (originalHeight !== height || originalWidth !== width) { + resizeRgbaImage( + comps, + dest, + originalWidth, + originalHeight, + width, + height, + alpha01, + ); + } else { + copyRgbaImage(comps, dest, alpha01); + } } } class DeviceCmykCS extends ColorSpace { constructor() { super("DeviceCMYK", 4); } - #t(e, t, i, a, s) { - const r = e[t] * i, - n = e[t + 1] * i, - g = e[t + 2] * i, - o = e[t + 3] * i; - a[s] = + #toRgb(src, srcOffset, srcScale, dest, destOffset) { + const c = src[srcOffset] * srcScale; + const m = src[srcOffset + 1] * srcScale; + const y = src[srcOffset + 2] * srcScale; + const k = src[srcOffset + 3] * srcScale; + dest[destOffset] = 255 + - r * - (-4.387332384609988 * r + - 54.48615194189176 * n + - 18.82290502165302 * g + - 212.25662451639585 * o - - 285.2331026137004) + - n * - (1.7149763477362134 * n - - 5.6096736904047315 * g + - -17.873870861415444 * o - + c * + (-4.387332384609988 * c + + 54.48615194189176 * m + + 18.82290502165302 * y + + 212.25662451639585 * k + + -285.2331026137004) + + m * + (1.7149763477362134 * m - + 5.6096736904047315 * y + + -17.873870861415444 * k - 5.497006427196366) + - g * - (-2.5217340131683033 * g - 21.248923337353073 * o + 17.5119270841813) + - o * (-21.86122147463605 * o - 189.48180835922747); - a[s + 1] = + y * + (-2.5217340131683033 * y - 21.248923337353073 * k + 17.5119270841813) + + k * (-21.86122147463605 * k - 189.48180835922747); + dest[destOffset + 1] = 255 + - r * - (8.841041422036149 * r + - 60.118027045597366 * n + - 6.871425592049007 * g + - 31.159100130055922 * o - - 79.2970844816548) + - n * - (-15.310361306967817 * n + - 17.575251261109482 * g + - 131.35250912493976 * o - + c * + (8.841041422036149 * c + + 60.118027045597366 * m + + 6.871425592049007 * y + + 31.159100130055922 * k + + -79.2970844816548) + + m * + (-15.310361306967817 * m + + 17.575251261109482 * y + + 131.35250912493976 * k - 190.9453302588951) + - g * (4.444339102852739 * g + 9.8632861493405 * o - 24.86741582555878) + - o * (-20.737325471181034 * o - 187.80453709719578); - a[s + 2] = + y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) + + k * (-20.737325471181034 * k - 187.80453709719578); + dest[destOffset + 2] = 255 + - r * - (0.8842522430003296 * r + - 8.078677503112928 * n + - 30.89978309703729 * g - - 0.23883238689178934 * o - - 14.183576799673286) + - n * - (10.49593273432072 * n + - 63.02378494754052 * g + - 50.606957656360734 * o - + c * + (0.8842522430003296 * c + + 8.078677503112928 * m + + 30.89978309703729 * y - + 0.23883238689178934 * k + + -14.183576799673286) + + m * + (10.49593273432072 * m + + 63.02378494754052 * y + + 50.606957656360734 * k - 112.23884253719248) + - g * - (0.03296041114873217 * g + - 115.60384449646641 * o - - 193.58209356861505) + - o * (-22.33816807309886 * o - 180.12613974708367); + y * + (0.03296041114873217 * y + + 115.60384449646641 * k + + -193.58209356861505) + + k * (-22.33816807309886 * k - 180.12613974708367); } - getRgbItem(e, t, i, a) { - this.#t(e, t, 1, i, a); + getRgbItem(src, srcOffset, dest, destOffset) { + this.#toRgb(src, srcOffset, 1, dest, destOffset); } - getRgbBuffer(e, t, i, a, s, r, n) { - const g = 1 / ((1 << r) - 1); - for (let r = 0; r < i; r++) { - this.#t(e, t, g, a, s); - t += 4; - s += 3 + n; + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const scale = 1 / ((1 << bits) - 1); + for (let i = 0; i < count; i++) { + this.#toRgb(src, srcOffset, scale, dest, destOffset); + srcOffset += 4; + destOffset += 3 + alpha01; } } - getOutputLength(e, t) { - return ((e / 4) * (3 + t)) | 0; + getOutputLength(inputLength, alpha01) { + return ((inputLength / 4) * (3 + alpha01)) | 0; } } class CalGrayCS extends ColorSpace { - constructor(e, t, i) { + constructor(whitePoint, blackPoint, gamma) { super("CalGray", 1); - if (!e) + if (!whitePoint) { throw new FormatError( "WhitePoint missing - required for color space CalGray", ); - [this.XW, this.YW, this.ZW] = e; - [this.XB, this.YB, this.ZB] = t || [0, 0, 0]; - this.G = i || 1; - if (this.XW < 0 || this.ZW < 0 || 1 !== this.YW) + } + [this.XW, this.YW, this.ZW] = whitePoint; + [this.XB, this.YB, this.ZB] = blackPoint || [0, 0, 0]; + this.G = gamma || 1; + if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { throw new FormatError( `Invalid WhitePoint components for ${this.name}, no fallback available`, ); + } if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { info(`Invalid BlackPoint for ${this.name}, falling back to default.`); this.XB = this.YB = this.ZB = 0; } - (0 === this.XB && 0 === this.YB && 0 === this.ZB) || + if (this.XB !== 0 || this.YB !== 0 || this.ZB !== 0) { warn( - `${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ZB: ${this.ZB}, only default values are supported.`, + `${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ` + + `ZB: ${this.ZB}, only default values are supported.`, ); + } if (this.G < 1) { info( `Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`, @@ -2282,55 +3056,57 @@ class CalGrayCS extends ColorSpace { this.G = 1; } } - #t(e, t, i, a, s) { - const r = (e[t] * s) ** this.G, - n = this.YW * r, - g = Math.max(295.8 * n ** 0.3333333333333333 - 40.8, 0); - i[a] = g; - i[a + 1] = g; - i[a + 2] = g; + #toRgb(src, srcOffset, dest, destOffset, scale) { + const A = src[srcOffset] * scale; + const AG = A ** this.G; + const L = this.YW * AG; + const val = Math.max(295.8 * L ** 0.3333333333333333 - 40.8, 0); + dest[destOffset] = val; + dest[destOffset + 1] = val; + dest[destOffset + 2] = val; } - getRgbItem(e, t, i, a) { - this.#t(e, t, i, a, 1); + getRgbItem(src, srcOffset, dest, destOffset) { + this.#toRgb(src, srcOffset, dest, destOffset, 1); } - getRgbBuffer(e, t, i, a, s, r, n) { - const g = 1 / ((1 << r) - 1); - for (let r = 0; r < i; ++r) { - this.#t(e, t, a, s, g); - t += 1; - s += 3 + n; + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const scale = 1 / ((1 << bits) - 1); + for (let i = 0; i < count; ++i) { + this.#toRgb(src, srcOffset, dest, destOffset, scale); + srcOffset += 1; + destOffset += 3 + alpha01; } } - getOutputLength(e, t) { - return e * (3 + t); + getOutputLength(inputLength, alpha01) { + return inputLength * (3 + alpha01); } } class CalRGBCS extends ColorSpace { - static #i = new Float32Array([ + static #BRADFORD_SCALE_MATRIX = new Float32Array([ 0.8951, 0.2664, -0.1614, -0.7502, 1.7135, 0.0367, 0.0389, -0.0685, 1.0296, ]); - static #a = new Float32Array([ + static #BRADFORD_SCALE_INVERSE_MATRIX = new Float32Array([ 0.9869929, -0.1470543, 0.1599627, 0.4323053, 0.5183603, 0.0492912, -0.0085287, 0.0400428, 0.9684867, ]); - static #s = new Float32Array([ + static #SRGB_D65_XYZ_TO_RGB_MATRIX = new Float32Array([ 3.2404542, -1.5371385, -0.4985314, -0.969266, 1.8760108, 0.041556, 0.0556434, -0.2040259, 1.0572252, ]); - static #r = new Float32Array([1, 1, 1]); - static #n = new Float32Array(3); - static #g = new Float32Array(3); - static #o = new Float32Array(3); - static #I = (24 / 116) ** 3 / 8; - constructor(e, t, i, a) { + static #FLAT_WHITEPOINT_MATRIX = new Float32Array([1, 1, 1]); + static #tempNormalizeMatrix = new Float32Array(3); + static #tempConvertMatrix1 = new Float32Array(3); + static #tempConvertMatrix2 = new Float32Array(3); + static #DECODE_L_CONSTANT = ((8 + 16) / 116) ** 3 / 8.0; + constructor(whitePoint, blackPoint, gamma, matrix) { super("CalRGB", 3); - if (!e) + if (!whitePoint) { throw new FormatError( "WhitePoint missing - required for color space CalRGB", ); - const [s, r, n] = (this.whitePoint = e), - [g, o, c] = (this.blackPoint = t || new Float32Array(3)); - [this.GR, this.GG, this.GB] = i || new Float32Array([1, 1, 1]); + } + const [XW, YW, ZW] = (this.whitePoint = whitePoint); + const [XB, YB, ZB] = (this.blackPoint = blackPoint || new Float32Array(3)); + [this.GR, this.GG, this.GB] = gamma || new Float32Array([1, 1, 1]); [ this.MXA, this.MYA, @@ -2341,149 +3117,185 @@ class CalRGBCS extends ColorSpace { this.MXC, this.MYC, this.MZC, - ] = a || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]); - if (s < 0 || n < 0 || 1 !== r) + ] = matrix || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]); + if (XW < 0 || ZW < 0 || YW !== 1) { throw new FormatError( `Invalid WhitePoint components for ${this.name}, no fallback available`, ); - if (g < 0 || o < 0 || c < 0) { + } + if (XB < 0 || YB < 0 || ZB < 0) { info( - `Invalid BlackPoint for ${this.name} [${g}, ${o}, ${c}], falling back to default.`, + `Invalid BlackPoint for ${this.name} [${XB}, ${YB}, ${ZB}], ` + + "falling back to default.", ); this.blackPoint = new Float32Array(3); } if (this.GR < 0 || this.GG < 0 || this.GB < 0) { info( - `Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`, + `Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ` + + `${this.name}, falling back to default.`, ); this.GR = this.GG = this.GB = 1; } } - #c(e, t, i) { - i[0] = e[0] * t[0] + e[1] * t[1] + e[2] * t[2]; - i[1] = e[3] * t[0] + e[4] * t[1] + e[5] * t[2]; - i[2] = e[6] * t[0] + e[7] * t[1] + e[8] * t[2]; + #matrixProduct(a, b, result) { + result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2]; + result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2]; } - #C(e, t, i) { - i[0] = (1 * t[0]) / e[0]; - i[1] = (1 * t[1]) / e[1]; - i[2] = (1 * t[2]) / e[2]; + #toFlat(sourceWhitePoint, LMS, result) { + result[0] = (LMS[0] * 1) / sourceWhitePoint[0]; + result[1] = (LMS[1] * 1) / sourceWhitePoint[1]; + result[2] = (LMS[2] * 1) / sourceWhitePoint[2]; } - #h(e, t, i) { - i[0] = (0.95047 * t[0]) / e[0]; - i[1] = (1 * t[1]) / e[1]; - i[2] = (1.08883 * t[2]) / e[2]; + #toD65(sourceWhitePoint, LMS, result) { + const D65X = 0.95047; + const D65Y = 1; + const D65Z = 1.08883; + result[0] = (LMS[0] * D65X) / sourceWhitePoint[0]; + result[1] = (LMS[1] * D65Y) / sourceWhitePoint[1]; + result[2] = (LMS[2] * D65Z) / sourceWhitePoint[2]; } - #B(e) { - return e <= 0.0031308 - ? this.#l(0, 1, 12.92 * e) - : e >= 0.99554525 - ? 1 - : this.#l(0, 1, 1.055 * e ** (1 / 2.4) - 0.055); + #sRGBTransferFunction(color) { + if (color <= 0.0031308) { + return this.#adjustToRange(0, 1, 12.92 * color); + } + if (color >= 0.99554525) { + return 1; + } + return this.#adjustToRange(0, 1, (1 + 0.055) * color ** (1 / 2.4) - 0.055); } - #l(e, t, i) { - return Math.max(e, Math.min(t, i)); + #adjustToRange(min, max, value) { + return Math.max(min, Math.min(max, value)); } - #Q(e) { - return e < 0 - ? -this.#Q(-e) - : e > 8 - ? ((e + 16) / 116) ** 3 - : e * CalRGBCS.#I; + #decodeL(L) { + if (L < 0) { + return -this.#decodeL(-L); + } + if (L > 8.0) { + return ((L + 16) / 116) ** 3; + } + return L * CalRGBCS.#DECODE_L_CONSTANT; } - #E(e, t, i) { - if (0 === e[0] && 0 === e[1] && 0 === e[2]) { - i[0] = t[0]; - i[1] = t[1]; - i[2] = t[2]; + #compensateBlackPoint(sourceBlackPoint, XYZ_Flat, result) { + if ( + sourceBlackPoint[0] === 0 && + sourceBlackPoint[1] === 0 && + sourceBlackPoint[2] === 0 + ) { + result[0] = XYZ_Flat[0]; + result[1] = XYZ_Flat[1]; + result[2] = XYZ_Flat[2]; return; } - const a = this.#Q(0), - s = (1 - a) / (1 - this.#Q(e[0])), - r = 1 - s, - n = (1 - a) / (1 - this.#Q(e[1])), - g = 1 - n, - o = (1 - a) / (1 - this.#Q(e[2])), - c = 1 - o; - i[0] = t[0] * s + r; - i[1] = t[1] * n + g; - i[2] = t[2] * o + c; + const zeroDecodeL = this.#decodeL(0); + const X_DST = zeroDecodeL; + const X_SRC = this.#decodeL(sourceBlackPoint[0]); + const Y_DST = zeroDecodeL; + const Y_SRC = this.#decodeL(sourceBlackPoint[1]); + const Z_DST = zeroDecodeL; + const Z_SRC = this.#decodeL(sourceBlackPoint[2]); + const X_Scale = (1 - X_DST) / (1 - X_SRC); + const X_Offset = 1 - X_Scale; + const Y_Scale = (1 - Y_DST) / (1 - Y_SRC); + const Y_Offset = 1 - Y_Scale; + const Z_Scale = (1 - Z_DST) / (1 - Z_SRC); + const Z_Offset = 1 - Z_Scale; + result[0] = XYZ_Flat[0] * X_Scale + X_Offset; + result[1] = XYZ_Flat[1] * Y_Scale + Y_Offset; + result[2] = XYZ_Flat[2] * Z_Scale + Z_Offset; } - #u(e, t, i) { - if (1 === e[0] && 1 === e[2]) { - i[0] = t[0]; - i[1] = t[1]; - i[2] = t[2]; + #normalizeWhitePointToFlat(sourceWhitePoint, XYZ_In, result) { + if (sourceWhitePoint[0] === 1 && sourceWhitePoint[2] === 1) { + result[0] = XYZ_In[0]; + result[1] = XYZ_In[1]; + result[2] = XYZ_In[2]; return; } - const a = i; - this.#c(CalRGBCS.#i, t, a); - const s = CalRGBCS.#n; - this.#C(e, a, s); - this.#c(CalRGBCS.#a, s, i); + const LMS = result; + this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_MATRIX, XYZ_In, LMS); + const LMS_Flat = CalRGBCS.#tempNormalizeMatrix; + this.#toFlat(sourceWhitePoint, LMS, LMS_Flat); + this.#matrixProduct( + CalRGBCS.#BRADFORD_SCALE_INVERSE_MATRIX, + LMS_Flat, + result, + ); } - #d(e, t, i) { - const a = i; - this.#c(CalRGBCS.#i, t, a); - const s = CalRGBCS.#n; - this.#h(e, a, s); - this.#c(CalRGBCS.#a, s, i); + #normalizeWhitePointToD65(sourceWhitePoint, XYZ_In, result) { + const LMS = result; + this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_MATRIX, XYZ_In, LMS); + const LMS_D65 = CalRGBCS.#tempNormalizeMatrix; + this.#toD65(sourceWhitePoint, LMS, LMS_D65); + this.#matrixProduct( + CalRGBCS.#BRADFORD_SCALE_INVERSE_MATRIX, + LMS_D65, + result, + ); } - #t(e, t, i, a, s) { - const r = this.#l(0, 1, e[t] * s), - n = this.#l(0, 1, e[t + 1] * s), - g = this.#l(0, 1, e[t + 2] * s), - o = 1 === r ? 1 : r ** this.GR, - c = 1 === n ? 1 : n ** this.GG, - C = 1 === g ? 1 : g ** this.GB, - h = this.MXA * o + this.MXB * c + this.MXC * C, - l = this.MYA * o + this.MYB * c + this.MYC * C, - Q = this.MZA * o + this.MZB * c + this.MZC * C, - E = CalRGBCS.#g; - E[0] = h; - E[1] = l; - E[2] = Q; - const u = CalRGBCS.#o; - this.#u(this.whitePoint, E, u); - const d = CalRGBCS.#g; - this.#E(this.blackPoint, u, d); - const f = CalRGBCS.#o; - this.#d(CalRGBCS.#r, d, f); - const p = CalRGBCS.#g; - this.#c(CalRGBCS.#s, f, p); - i[a] = 255 * this.#B(p[0]); - i[a + 1] = 255 * this.#B(p[1]); - i[a + 2] = 255 * this.#B(p[2]); + #toRgb(src, srcOffset, dest, destOffset, scale) { + const A = this.#adjustToRange(0, 1, src[srcOffset] * scale); + const B = this.#adjustToRange(0, 1, src[srcOffset + 1] * scale); + const C = this.#adjustToRange(0, 1, src[srcOffset + 2] * scale); + const AGR = A === 1 ? 1 : A ** this.GR; + const BGG = B === 1 ? 1 : B ** this.GG; + const CGB = C === 1 ? 1 : C ** this.GB; + const X = this.MXA * AGR + this.MXB * BGG + this.MXC * CGB; + const Y = this.MYA * AGR + this.MYB * BGG + this.MYC * CGB; + const Z = this.MZA * AGR + this.MZB * BGG + this.MZC * CGB; + const XYZ = CalRGBCS.#tempConvertMatrix1; + XYZ[0] = X; + XYZ[1] = Y; + XYZ[2] = Z; + const XYZ_Flat = CalRGBCS.#tempConvertMatrix2; + this.#normalizeWhitePointToFlat(this.whitePoint, XYZ, XYZ_Flat); + const XYZ_Black = CalRGBCS.#tempConvertMatrix1; + this.#compensateBlackPoint(this.blackPoint, XYZ_Flat, XYZ_Black); + const XYZ_D65 = CalRGBCS.#tempConvertMatrix2; + this.#normalizeWhitePointToD65( + CalRGBCS.#FLAT_WHITEPOINT_MATRIX, + XYZ_Black, + XYZ_D65, + ); + const SRGB = CalRGBCS.#tempConvertMatrix1; + this.#matrixProduct(CalRGBCS.#SRGB_D65_XYZ_TO_RGB_MATRIX, XYZ_D65, SRGB); + dest[destOffset] = this.#sRGBTransferFunction(SRGB[0]) * 255; + dest[destOffset + 1] = this.#sRGBTransferFunction(SRGB[1]) * 255; + dest[destOffset + 2] = this.#sRGBTransferFunction(SRGB[2]) * 255; } - getRgbItem(e, t, i, a) { - this.#t(e, t, i, a, 1); + getRgbItem(src, srcOffset, dest, destOffset) { + this.#toRgb(src, srcOffset, dest, destOffset, 1); } - getRgbBuffer(e, t, i, a, s, r, n) { - const g = 1 / ((1 << r) - 1); - for (let r = 0; r < i; ++r) { - this.#t(e, t, a, s, g); - t += 3; - s += 3 + n; + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const scale = 1 / ((1 << bits) - 1); + for (let i = 0; i < count; ++i) { + this.#toRgb(src, srcOffset, dest, destOffset, scale); + srcOffset += 3; + destOffset += 3 + alpha01; } } - getOutputLength(e, t) { - return ((e * (3 + t)) / 3) | 0; + getOutputLength(inputLength, alpha01) { + return ((inputLength * (3 + alpha01)) / 3) | 0; } } class LabCS extends ColorSpace { - constructor(e, t, i) { + constructor(whitePoint, blackPoint, range) { super("Lab", 3); - if (!e) + if (!whitePoint) { throw new FormatError( "WhitePoint missing - required for color space Lab", ); - [this.XW, this.YW, this.ZW] = e; - [this.amin, this.amax, this.bmin, this.bmax] = i || [-100, 100, -100, 100]; - [this.XB, this.YB, this.ZB] = t || [0, 0, 0]; - if (this.XW < 0 || this.ZW < 0 || 1 !== this.YW) + } + [this.XW, this.YW, this.ZW] = whitePoint; + [this.amin, this.amax, this.bmin, this.bmax] = range || [ + -100, 100, -100, 100, + ]; + [this.XB, this.YB, this.ZB] = blackPoint || [0, 0, 0]; + if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { throw new FormatError( "Invalid WhitePoint components, no fallback available", ); + } if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { info("Invalid BlackPoint, falling back to default"); this.XB = this.YB = this.ZB = 0; @@ -2496,1578 +3308,1707 @@ class LabCS extends ColorSpace { this.bmax = 100; } } - #f(e) { - return e >= 6 / 29 ? e ** 3 : (108 / 841) * (e - 4 / 29); + #fn_g(x) { + return x >= 6 / 29 ? x ** 3 : (108 / 841) * (x - 4 / 29); } - #p(e, t, i, a) { - return i + (e * (a - i)) / t; + #decode(value, high1, low2, high2) { + return low2 + (value * (high2 - low2)) / high1; } - #t(e, t, i, a, s) { - let r = e[t], - n = e[t + 1], - g = e[t + 2]; - if (!1 !== i) { - r = this.#p(r, i, 0, 100); - n = this.#p(n, i, this.amin, this.amax); - g = this.#p(g, i, this.bmin, this.bmax); + #toRgb(src, srcOffset, maxVal, dest, destOffset) { + let Ls = src[srcOffset]; + let as = src[srcOffset + 1]; + let bs = src[srcOffset + 2]; + if (maxVal !== false) { + Ls = this.#decode(Ls, maxVal, 0, 100); + as = this.#decode(as, maxVal, this.amin, this.amax); + bs = this.#decode(bs, maxVal, this.bmin, this.bmax); } - n > this.amax ? (n = this.amax) : n < this.amin && (n = this.amin); - g > this.bmax ? (g = this.bmax) : g < this.bmin && (g = this.bmin); - const o = (r + 16) / 116, - c = o + n / 500, - C = o - g / 200, - h = this.XW * this.#f(c), - l = this.YW * this.#f(o), - Q = this.ZW * this.#f(C); - let E, u, d; + if (as > this.amax) { + as = this.amax; + } else if (as < this.amin) { + as = this.amin; + } + if (bs > this.bmax) { + bs = this.bmax; + } else if (bs < this.bmin) { + bs = this.bmin; + } + const M = (Ls + 16) / 116; + const L = M + as / 500; + const N = M - bs / 200; + const X = this.XW * this.#fn_g(L); + const Y = this.YW * this.#fn_g(M); + const Z = this.ZW * this.#fn_g(N); + let r, g, b; if (this.ZW < 1) { - E = 3.1339 * h + -1.617 * l + -0.4906 * Q; - u = -0.9785 * h + 1.916 * l + 0.0333 * Q; - d = 0.072 * h + -0.229 * l + 1.4057 * Q; + r = X * 3.1339 + Y * -1.617 + Z * -0.4906; + g = X * -0.9785 + Y * 1.916 + Z * 0.0333; + b = X * 0.072 + Y * -0.229 + Z * 1.4057; } else { - E = 3.2406 * h + -1.5372 * l + -0.4986 * Q; - u = -0.9689 * h + 1.8758 * l + 0.0415 * Q; - d = 0.0557 * h + -0.204 * l + 1.057 * Q; + r = X * 3.2406 + Y * -1.5372 + Z * -0.4986; + g = X * -0.9689 + Y * 1.8758 + Z * 0.0415; + b = X * 0.0557 + Y * -0.204 + Z * 1.057; } - a[s] = 255 * Math.sqrt(E); - a[s + 1] = 255 * Math.sqrt(u); - a[s + 2] = 255 * Math.sqrt(d); + dest[destOffset] = Math.sqrt(r) * 255; + dest[destOffset + 1] = Math.sqrt(g) * 255; + dest[destOffset + 2] = Math.sqrt(b) * 255; } - getRgbItem(e, t, i, a) { - this.#t(e, t, !1, i, a); + getRgbItem(src, srcOffset, dest, destOffset) { + this.#toRgb(src, srcOffset, false, dest, destOffset); } - getRgbBuffer(e, t, i, a, s, r, n) { - const g = (1 << r) - 1; - for (let r = 0; r < i; r++) { - this.#t(e, t, g, a, s); - t += 3; - s += 3 + n; + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const maxVal = (1 << bits) - 1; + for (let i = 0; i < count; i++) { + this.#toRgb(src, srcOffset, maxVal, dest, destOffset); + srcOffset += 3; + destOffset += 3 + alpha01; } } - getOutputLength(e, t) { - return ((e * (3 + t)) / 3) | 0; + getOutputLength(inputLength, alpha01) { + return ((inputLength * (3 + alpha01)) / 3) | 0; } - isDefaultDecode(e, t) { - return !0; + isDefaultDecode(decodeMap, bpc) { + return true; } get usesZeroToOneRange() { - return shadow(this, "usesZeroToOneRange", !1); + return shadow(this, "usesZeroToOneRange", false); + } +} // ./src/core/binary_cmap.js + +function hexToInt(a, size) { + let n = 0; + for (let i = 0; i <= size; i++) { + n = (n << 8) | a[i]; + } + return n >>> 0; +} +function hexToStr(a, size) { + if (size === 1) { + return String.fromCharCode(a[0], a[1]); + } + if (size === 3) { + return String.fromCharCode(a[0], a[1], a[2], a[3]); + } + return String.fromCharCode(...a.subarray(0, size + 1)); +} +function addHex(a, b, size) { + let c = 0; + for (let i = size; i >= 0; i--) { + c += a[i] + b[i]; + a[i] = c & 255; + c >>= 8; } } -function hexToInt(e, t) { - let i = 0; - for (let a = 0; a <= t; a++) i = (i << 8) | e[a]; - return i >>> 0; -} -function hexToStr(e, t) { - return 1 === t - ? String.fromCharCode(e[0], e[1]) - : 3 === t - ? String.fromCharCode(e[0], e[1], e[2], e[3]) - : String.fromCharCode(...e.subarray(0, t + 1)); -} -function addHex(e, t, i) { - let a = 0; - for (let s = i; s >= 0; s--) { - a += e[s] + t[s]; - e[s] = 255 & a; - a >>= 8; +function incHex(a, size) { + let c = 1; + for (let i = size; i >= 0 && c > 0; i--) { + c += a[i]; + a[i] = c & 255; + c >>= 8; } } -function incHex(e, t) { - let i = 1; - for (let a = t; a >= 0 && i > 0; a--) { - i += e[a]; - e[a] = 255 & i; - i >>= 8; - } -} -const kt = 16; +const MAX_NUM_SIZE = 16; +const MAX_ENCODED_NUM_SIZE = 19; class BinaryCMapStream { - constructor(e) { - this.buffer = e; + constructor(data) { + this.buffer = data; this.pos = 0; - this.end = e.length; - this.tmpBuf = new Uint8Array(19); + this.end = data.length; + this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE); } readByte() { - return this.pos >= this.end ? -1 : this.buffer[this.pos++]; + if (this.pos >= this.end) { + return -1; + } + return this.buffer[this.pos++]; } readNumber() { - let e, - t = 0; + let n = 0; + let last; do { - const i = this.readByte(); - if (i < 0) throw new FormatError("unexpected EOF in bcmap"); - e = !(128 & i); - t = (t << 7) | (127 & i); - } while (!e); - return t; + const b = this.readByte(); + if (b < 0) { + throw new FormatError("unexpected EOF in bcmap"); + } + last = !(b & 0x80); + n = (n << 7) | (b & 0x7f); + } while (!last); + return n; } readSigned() { - const e = this.readNumber(); - return 1 & e ? ~(e >>> 1) : e >>> 1; + const n = this.readNumber(); + return n & 1 ? ~(n >>> 1) : n >>> 1; } - readHex(e, t) { - e.set(this.buffer.subarray(this.pos, this.pos + t + 1)); - this.pos += t + 1; + readHex(num, size) { + num.set(this.buffer.subarray(this.pos, this.pos + size + 1)); + this.pos += size + 1; } - readHexNumber(e, t) { - let i; - const a = this.tmpBuf; - let s = 0; + readHexNumber(num, size) { + let last; + const stack = this.tmpBuf; + let sp = 0; do { - const e = this.readByte(); - if (e < 0) throw new FormatError("unexpected EOF in bcmap"); - i = !(128 & e); - a[s++] = 127 & e; - } while (!i); - let r = t, - n = 0, - g = 0; - for (; r >= 0; ) { - for (; g < 8 && a.length > 0; ) { - n |= a[--s] << g; - g += 7; + const b = this.readByte(); + if (b < 0) { + throw new FormatError("unexpected EOF in bcmap"); } - e[r] = 255 & n; - r--; - n >>= 8; - g -= 8; + last = !(b & 0x80); + stack[sp++] = b & 0x7f; + } while (!last); + let i = size, + buffer = 0, + bufferSize = 0; + while (i >= 0) { + while (bufferSize < 8 && stack.length > 0) { + buffer |= stack[--sp] << bufferSize; + bufferSize += 7; + } + num[i] = buffer & 255; + i--; + buffer >>= 8; + bufferSize -= 8; } } - readHexSigned(e, t) { - this.readHexNumber(e, t); - const i = 1 & e[t] ? 255 : 0; - let a = 0; - for (let s = 0; s <= t; s++) { - a = ((1 & a) << 8) | e[s]; - e[s] = (a >> 1) ^ i; + readHexSigned(num, size) { + this.readHexNumber(num, size); + const sign = num[size] & 1 ? 255 : 0; + let c = 0; + for (let i = 0; i <= size; i++) { + c = ((c & 1) << 8) | num[i]; + num[i] = (c >> 1) ^ sign; } } readString() { - const e = this.readNumber(), - t = new Array(e); - for (let i = 0; i < e; i++) t[i] = this.readNumber(); - return String.fromCharCode(...t); + const len = this.readNumber(), + buf = new Array(len); + for (let i = 0; i < len; i++) { + buf[i] = this.readNumber(); + } + return String.fromCharCode(...buf); } } class BinaryCMapReader { - async process(e, t, i) { - const a = new BinaryCMapStream(e), - s = a.readByte(); - t.vertical = !!(1 & s); - let r = null; - const n = new Uint8Array(kt), - g = new Uint8Array(kt), - o = new Uint8Array(kt), - c = new Uint8Array(kt), - C = new Uint8Array(kt); - let h, l; - for (; (l = a.readByte()) >= 0; ) { - const e = l >> 5; - if (7 === e) { - switch (31 & l) { + async process(data, cMap, extend) { + const stream = new BinaryCMapStream(data); + const header = stream.readByte(); + cMap.vertical = !!(header & 1); + let useCMap = null; + const start = new Uint8Array(MAX_NUM_SIZE); + const end = new Uint8Array(MAX_NUM_SIZE); + const char = new Uint8Array(MAX_NUM_SIZE); + const charCode = new Uint8Array(MAX_NUM_SIZE); + const tmp = new Uint8Array(MAX_NUM_SIZE); + let code; + let b; + while ((b = stream.readByte()) >= 0) { + const type = b >> 5; + if (type === 7) { + switch (b & 0x1f) { case 0: - a.readString(); + stream.readString(); break; case 1: - r = a.readString(); + useCMap = stream.readString(); + break; } continue; } - const i = !!(16 & l), - s = 15 & l; - if (s + 1 > kt) + const sequence = !!(b & 0x10); + const dataSize = b & 15; + if (dataSize + 1 > MAX_NUM_SIZE) { throw new Error("BinaryCMapReader.process: Invalid dataSize."); - const Q = 1, - E = a.readNumber(); - switch (e) { + } + const ucs2DataSize = 1; + const subitemsCount = stream.readNumber(); + switch (type) { case 0: - a.readHex(n, s); - a.readHexNumber(g, s); - addHex(g, n, s); - t.addCodespaceRange(s + 1, hexToInt(n, s), hexToInt(g, s)); - for (let e = 1; e < E; e++) { - incHex(g, s); - a.readHexNumber(n, s); - addHex(n, g, s); - a.readHexNumber(g, s); - addHex(g, n, s); - t.addCodespaceRange(s + 1, hexToInt(n, s), hexToInt(g, s)); + stream.readHex(start, dataSize); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + cMap.addCodespaceRange( + dataSize + 1, + hexToInt(start, dataSize), + hexToInt(end, dataSize), + ); + for (let i = 1; i < subitemsCount; i++) { + incHex(end, dataSize); + stream.readHexNumber(start, dataSize); + addHex(start, end, dataSize); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + cMap.addCodespaceRange( + dataSize + 1, + hexToInt(start, dataSize), + hexToInt(end, dataSize), + ); } break; case 1: - a.readHex(n, s); - a.readHexNumber(g, s); - addHex(g, n, s); - a.readNumber(); - for (let e = 1; e < E; e++) { - incHex(g, s); - a.readHexNumber(n, s); - addHex(n, g, s); - a.readHexNumber(g, s); - addHex(g, n, s); - a.readNumber(); + stream.readHex(start, dataSize); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + stream.readNumber(); + for (let i = 1; i < subitemsCount; i++) { + incHex(end, dataSize); + stream.readHexNumber(start, dataSize); + addHex(start, end, dataSize); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + stream.readNumber(); } break; case 2: - a.readHex(o, s); - h = a.readNumber(); - t.mapOne(hexToInt(o, s), h); - for (let e = 1; e < E; e++) { - incHex(o, s); - if (!i) { - a.readHexNumber(C, s); - addHex(o, C, s); + stream.readHex(char, dataSize); + code = stream.readNumber(); + cMap.mapOne(hexToInt(char, dataSize), code); + for (let i = 1; i < subitemsCount; i++) { + incHex(char, dataSize); + if (!sequence) { + stream.readHexNumber(tmp, dataSize); + addHex(char, tmp, dataSize); } - h = a.readSigned() + (h + 1); - t.mapOne(hexToInt(o, s), h); + code = stream.readSigned() + (code + 1); + cMap.mapOne(hexToInt(char, dataSize), code); } break; case 3: - a.readHex(n, s); - a.readHexNumber(g, s); - addHex(g, n, s); - h = a.readNumber(); - t.mapCidRange(hexToInt(n, s), hexToInt(g, s), h); - for (let e = 1; e < E; e++) { - incHex(g, s); - if (i) n.set(g); - else { - a.readHexNumber(n, s); - addHex(n, g, s); + stream.readHex(start, dataSize); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + code = stream.readNumber(); + cMap.mapCidRange( + hexToInt(start, dataSize), + hexToInt(end, dataSize), + code, + ); + for (let i = 1; i < subitemsCount; i++) { + incHex(end, dataSize); + if (!sequence) { + stream.readHexNumber(start, dataSize); + addHex(start, end, dataSize); + } else { + start.set(end); } - a.readHexNumber(g, s); - addHex(g, n, s); - h = a.readNumber(); - t.mapCidRange(hexToInt(n, s), hexToInt(g, s), h); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + code = stream.readNumber(); + cMap.mapCidRange( + hexToInt(start, dataSize), + hexToInt(end, dataSize), + code, + ); } break; case 4: - a.readHex(o, Q); - a.readHex(c, s); - t.mapOne(hexToInt(o, Q), hexToStr(c, s)); - for (let e = 1; e < E; e++) { - incHex(o, Q); - if (!i) { - a.readHexNumber(C, Q); - addHex(o, C, Q); + stream.readHex(char, ucs2DataSize); + stream.readHex(charCode, dataSize); + cMap.mapOne( + hexToInt(char, ucs2DataSize), + hexToStr(charCode, dataSize), + ); + for (let i = 1; i < subitemsCount; i++) { + incHex(char, ucs2DataSize); + if (!sequence) { + stream.readHexNumber(tmp, ucs2DataSize); + addHex(char, tmp, ucs2DataSize); } - incHex(c, s); - a.readHexSigned(C, s); - addHex(c, C, s); - t.mapOne(hexToInt(o, Q), hexToStr(c, s)); + incHex(charCode, dataSize); + stream.readHexSigned(tmp, dataSize); + addHex(charCode, tmp, dataSize); + cMap.mapOne( + hexToInt(char, ucs2DataSize), + hexToStr(charCode, dataSize), + ); } break; case 5: - a.readHex(n, Q); - a.readHexNumber(g, Q); - addHex(g, n, Q); - a.readHex(c, s); - t.mapBfRange(hexToInt(n, Q), hexToInt(g, Q), hexToStr(c, s)); - for (let e = 1; e < E; e++) { - incHex(g, Q); - if (i) n.set(g); - else { - a.readHexNumber(n, Q); - addHex(n, g, Q); + stream.readHex(start, ucs2DataSize); + stream.readHexNumber(end, ucs2DataSize); + addHex(end, start, ucs2DataSize); + stream.readHex(charCode, dataSize); + cMap.mapBfRange( + hexToInt(start, ucs2DataSize), + hexToInt(end, ucs2DataSize), + hexToStr(charCode, dataSize), + ); + for (let i = 1; i < subitemsCount; i++) { + incHex(end, ucs2DataSize); + if (!sequence) { + stream.readHexNumber(start, ucs2DataSize); + addHex(start, end, ucs2DataSize); + } else { + start.set(end); } - a.readHexNumber(g, Q); - addHex(g, n, Q); - a.readHex(c, s); - t.mapBfRange(hexToInt(n, Q), hexToInt(g, Q), hexToStr(c, s)); + stream.readHexNumber(end, ucs2DataSize); + addHex(end, start, ucs2DataSize); + stream.readHex(charCode, dataSize); + cMap.mapBfRange( + hexToInt(start, ucs2DataSize), + hexToInt(end, ucs2DataSize), + hexToStr(charCode, dataSize), + ); } break; default: - throw new Error(`BinaryCMapReader.process - unknown type: ${e}`); + throw new Error(`BinaryCMapReader.process - unknown type: ${type}`); } } - return r ? i(r) : t; + if (useCMap) { + return extend(useCMap); + } + return cMap; } -} -const Rt = new Uint8Array(0); +} // ./src/core/decode_stream.js + +const emptyBuffer = new Uint8Array(0); class DecodeStream extends BaseStream { - constructor(e) { + constructor(maybeMinBufferLength) { super(); - this._rawMinBufferLength = e || 0; + this._rawMinBufferLength = maybeMinBufferLength || 0; this.pos = 0; this.bufferLength = 0; - this.eof = !1; - this.buffer = Rt; + this.eof = false; + this.buffer = emptyBuffer; this.minBufferLength = 512; - if (e) for (; this.minBufferLength < e; ) this.minBufferLength *= 2; + if (maybeMinBufferLength) { + while (this.minBufferLength < maybeMinBufferLength) { + this.minBufferLength *= 2; + } + } } get isEmpty() { - for (; !this.eof && 0 === this.bufferLength; ) this.readBlock(); - return 0 === this.bufferLength; + while (!this.eof && this.bufferLength === 0) { + this.readBlock(); + } + return this.bufferLength === 0; } - ensureBuffer(e) { - const t = this.buffer; - if (e <= t.byteLength) return t; - let i = this.minBufferLength; - for (; i < e; ) i *= 2; - const a = new Uint8Array(i); - a.set(t); - return (this.buffer = a); + ensureBuffer(requested) { + const buffer = this.buffer; + if (requested <= buffer.byteLength) { + return buffer; + } + let size = this.minBufferLength; + while (size < requested) { + size *= 2; + } + const buffer2 = new Uint8Array(size); + buffer2.set(buffer); + return (this.buffer = buffer2); } getByte() { - const e = this.pos; - for (; this.bufferLength <= e; ) { - if (this.eof) return -1; + const pos = this.pos; + while (this.bufferLength <= pos) { + if (this.eof) { + return -1; + } this.readBlock(); } return this.buffer[this.pos++]; } - getBytes(e, t = null) { - const i = this.pos; - let a; - if (e) { - this.ensureBuffer(i + e); - a = i + e; - for (; !this.eof && this.bufferLength < a; ) this.readBlock(t); - const s = this.bufferLength; - a > s && (a = s); + getBytes(length, decoderOptions = null) { + const pos = this.pos; + let end; + if (length) { + this.ensureBuffer(pos + length); + end = pos + length; + while (!this.eof && this.bufferLength < end) { + this.readBlock(decoderOptions); + } + const bufEnd = this.bufferLength; + if (end > bufEnd) { + end = bufEnd; + } } else { - for (; !this.eof; ) this.readBlock(t); - a = this.bufferLength; + while (!this.eof) { + this.readBlock(decoderOptions); + } + end = this.bufferLength; } - this.pos = a; - return this.buffer.subarray(i, a); + this.pos = end; + return this.buffer.subarray(pos, end); } - async getImageData(e, t = null) { - if (!this.canAsyncDecodeImageFromBuffer) return this.getBytes(e, t); - const i = await this.stream.asyncGetBytes(); - return this.decodeImage(i, t); + async getImageData(length, decoderOptions = null) { + if (!this.canAsyncDecodeImageFromBuffer) { + return this.getBytes(length, decoderOptions); + } + const data = await this.stream.asyncGetBytes(); + return this.decodeImage(data, decoderOptions); } reset() { this.pos = 0; } - makeSubStream(e, t, i = null) { - if (void 0 === t) for (; !this.eof; ) this.readBlock(); - else { - const i = e + t; - for (; this.bufferLength <= i && !this.eof; ) this.readBlock(); + makeSubStream(start, length, dict = null) { + if (length === undefined) { + while (!this.eof) { + this.readBlock(); + } + } else { + const end = start + length; + while (this.bufferLength <= end && !this.eof) { + this.readBlock(); + } } - return new Stream(this.buffer, e, t, i); + return new Stream(this.buffer, start, length, dict); } getBaseStreams() { return this.str ? this.str.getBaseStreams() : null; } } class StreamsSequenceStream extends DecodeStream { - constructor(e, t = null) { - let i = 0; - for (const t of e) - i += t instanceof DecodeStream ? t._rawMinBufferLength : t.length; - super(i); - this.streams = e; - this._onError = t; + constructor(streams, onError = null) { + streams = streams.filter((s) => s instanceof BaseStream); + let maybeLength = 0; + for (const stream of streams) { + maybeLength += + stream instanceof DecodeStream + ? stream._rawMinBufferLength + : stream.length; + } + super(maybeLength); + this.streams = streams; + this._onError = onError; } readBlock() { - const e = this.streams; - if (0 === e.length) { - this.eof = !0; + const streams = this.streams; + if (streams.length === 0) { + this.eof = true; return; } - const t = e.shift(); - let i; + const stream = streams.shift(); + let chunk; try { - i = t.getBytes(); - } catch (e) { + chunk = stream.getBytes(); + } catch (reason) { if (this._onError) { - this._onError(e, t.dict?.objId); + this._onError(reason, stream.dict?.objId); return; } - throw e; + throw reason; } - const a = this.bufferLength, - s = a + i.length; - this.ensureBuffer(s).set(i, a); - this.bufferLength = s; + const bufferLength = this.bufferLength; + const newLength = bufferLength + chunk.length; + const buffer = this.ensureBuffer(newLength); + buffer.set(chunk, bufferLength); + this.bufferLength = newLength; } getBaseStreams() { - const e = []; - for (const t of this.streams) { - const i = t.getBaseStreams(); - i && e.push(...i); + const baseStreamsBuf = []; + for (const stream of this.streams) { + const baseStreams = stream.getBaseStreams(); + if (baseStreams) { + baseStreamsBuf.push(...baseStreams); + } } - return e.length > 0 ? e : null; + return baseStreamsBuf.length > 0 ? baseStreamsBuf : null; } -} +} // ./src/core/ascii_85_stream.js + class Ascii85Stream extends DecodeStream { - constructor(e, t) { - t && (t *= 0.8); - super(t); - this.str = e; - this.dict = e.dict; + constructor(str, maybeLength) { + if (maybeLength) { + maybeLength *= 0.8; + } + super(maybeLength); + this.str = str; + this.dict = str.dict; this.input = new Uint8Array(5); } readBlock() { - const e = this.str; - let t = e.getByte(); - for (; isWhiteSpace(t); ) t = e.getByte(); - if (-1 === t || 126 === t) { - this.eof = !0; + const TILDA_CHAR = 0x7e; + const Z_LOWER_CHAR = 0x7a; + const EOF = -1; + const str = this.str; + let c = str.getByte(); + while (isWhiteSpace(c)) { + c = str.getByte(); + } + if (c === EOF || c === TILDA_CHAR) { + this.eof = true; return; } - const i = this.bufferLength; - let a, s; - if (122 === t) { - a = this.ensureBuffer(i + 4); - for (s = 0; s < 4; ++s) a[i + s] = 0; + const bufferLength = this.bufferLength; + let buffer, i; + if (c === Z_LOWER_CHAR) { + buffer = this.ensureBuffer(bufferLength + 4); + for (i = 0; i < 4; ++i) { + buffer[bufferLength + i] = 0; + } this.bufferLength += 4; } else { - const r = this.input; - r[0] = t; - for (s = 1; s < 5; ++s) { - t = e.getByte(); - for (; isWhiteSpace(t); ) t = e.getByte(); - r[s] = t; - if (-1 === t || 126 === t) break; + const input = this.input; + input[0] = c; + for (i = 1; i < 5; ++i) { + c = str.getByte(); + while (isWhiteSpace(c)) { + c = str.getByte(); + } + input[i] = c; + if (c === EOF || c === TILDA_CHAR) { + break; + } } - a = this.ensureBuffer(i + s - 1); - this.bufferLength += s - 1; - if (s < 5) { - for (; s < 5; ++s) r[s] = 117; - this.eof = !0; + buffer = this.ensureBuffer(bufferLength + i - 1); + this.bufferLength += i - 1; + if (i < 5) { + for (; i < 5; ++i) { + input[i] = 0x21 + 84; + } + this.eof = true; } - let n = 0; - for (s = 0; s < 5; ++s) n = 85 * n + (r[s] - 33); - for (s = 3; s >= 0; --s) { - a[i + s] = 255 & n; - n >>= 8; + let t = 0; + for (i = 0; i < 5; ++i) { + t = t * 85 + (input[i] - 0x21); + } + for (i = 3; i >= 0; --i) { + buffer[bufferLength + i] = t & 0xff; + t >>= 8; } } } -} +} // ./src/core/ascii_hex_stream.js + class AsciiHexStream extends DecodeStream { - constructor(e, t) { - t && (t *= 0.5); - super(t); - this.str = e; - this.dict = e.dict; + constructor(str, maybeLength) { + if (maybeLength) { + maybeLength *= 0.5; + } + super(maybeLength); + this.str = str; + this.dict = str.dict; this.firstDigit = -1; } readBlock() { - const e = this.str.getBytes(8e3); - if (!e.length) { - this.eof = !0; + const UPSTREAM_BLOCK_SIZE = 8000; + const bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE); + if (!bytes.length) { + this.eof = true; return; } - const t = (e.length + 1) >> 1, - i = this.ensureBuffer(this.bufferLength + t); - let a = this.bufferLength, - s = this.firstDigit; - for (const t of e) { - let e; - if (t >= 48 && t <= 57) e = 15 & t; - else { - if (!((t >= 65 && t <= 70) || (t >= 97 && t <= 102))) { - if (62 === t) { - this.eof = !0; - break; - } - continue; - } - e = 9 + (15 & t); + const maxDecodeLength = (bytes.length + 1) >> 1; + const buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength); + let bufferLength = this.bufferLength; + let firstDigit = this.firstDigit; + for (const ch of bytes) { + let digit; + if (ch >= 0x30 && ch <= 0x39) { + digit = ch & 0x0f; + } else if ((ch >= 0x41 && ch <= 0x46) || (ch >= 0x61 && ch <= 0x66)) { + digit = (ch & 0x0f) + 9; + } else if (ch === 0x3e) { + this.eof = true; + break; + } else { + continue; } - if (s < 0) s = e; - else { - i[a++] = (s << 4) | e; - s = -1; + if (firstDigit < 0) { + firstDigit = digit; + } else { + buffer[bufferLength++] = (firstDigit << 4) | digit; + firstDigit = -1; } } - if (s >= 0 && this.eof) { - i[a++] = s << 4; - s = -1; + if (firstDigit >= 0 && this.eof) { + buffer[bufferLength++] = firstDigit << 4; + firstDigit = -1; } - this.firstDigit = s; - this.bufferLength = a; + this.firstDigit = firstDigit; + this.bufferLength = bufferLength; } -} -const Nt = -1, - Gt = [ - [-1, -1], - [-1, -1], - [7, 8], - [7, 7], - [6, 6], - [6, 6], - [6, 5], - [6, 5], - [4, 0], - [4, 0], - [4, 0], - [4, 0], - [4, 0], - [4, 0], - [4, 0], - [4, 0], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 3], - [3, 3], - [3, 3], - [3, 3], - [3, 3], - [3, 3], - [3, 3], - [3, 3], - [3, 3], - [3, 3], - [3, 3], - [3, 3], - [3, 3], - [3, 3], - [3, 3], - [3, 3], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - [1, 2], - ], - xt = [ - [-1, -1], - [12, -2], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [11, 1792], - [11, 1792], - [12, 1984], - [12, 2048], - [12, 2112], - [12, 2176], - [12, 2240], - [12, 2304], - [11, 1856], - [11, 1856], - [11, 1920], - [11, 1920], - [12, 2368], - [12, 2432], - [12, 2496], - [12, 2560], - ], - Ut = [ - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [8, 29], - [8, 29], - [8, 30], - [8, 30], - [8, 45], - [8, 45], - [8, 46], - [8, 46], - [7, 22], - [7, 22], - [7, 22], - [7, 22], - [7, 23], - [7, 23], - [7, 23], - [7, 23], - [8, 47], - [8, 47], - [8, 48], - [8, 48], - [6, 13], - [6, 13], - [6, 13], - [6, 13], - [6, 13], - [6, 13], - [6, 13], - [6, 13], - [7, 20], - [7, 20], - [7, 20], - [7, 20], - [8, 33], - [8, 33], - [8, 34], - [8, 34], - [8, 35], - [8, 35], - [8, 36], - [8, 36], - [8, 37], - [8, 37], - [8, 38], - [8, 38], - [7, 19], - [7, 19], - [7, 19], - [7, 19], - [8, 31], - [8, 31], - [8, 32], - [8, 32], - [6, 1], - [6, 1], - [6, 1], - [6, 1], - [6, 1], - [6, 1], - [6, 1], - [6, 1], - [6, 12], - [6, 12], - [6, 12], - [6, 12], - [6, 12], - [6, 12], - [6, 12], - [6, 12], - [8, 53], - [8, 53], - [8, 54], - [8, 54], - [7, 26], - [7, 26], - [7, 26], - [7, 26], - [8, 39], - [8, 39], - [8, 40], - [8, 40], - [8, 41], - [8, 41], - [8, 42], - [8, 42], - [8, 43], - [8, 43], - [8, 44], - [8, 44], - [7, 21], - [7, 21], - [7, 21], - [7, 21], - [7, 28], - [7, 28], - [7, 28], - [7, 28], - [8, 61], - [8, 61], - [8, 62], - [8, 62], - [8, 63], - [8, 63], - [8, 0], - [8, 0], - [8, 320], - [8, 320], - [8, 384], - [8, 384], - [5, 10], - [5, 10], - [5, 10], - [5, 10], - [5, 10], - [5, 10], - [5, 10], - [5, 10], - [5, 10], - [5, 10], - [5, 10], - [5, 10], - [5, 10], - [5, 10], - [5, 10], - [5, 10], - [5, 11], - [5, 11], - [5, 11], - [5, 11], - [5, 11], - [5, 11], - [5, 11], - [5, 11], - [5, 11], - [5, 11], - [5, 11], - [5, 11], - [5, 11], - [5, 11], - [5, 11], - [5, 11], - [7, 27], - [7, 27], - [7, 27], - [7, 27], - [8, 59], - [8, 59], - [8, 60], - [8, 60], - [9, 1472], - [9, 1536], - [9, 1600], - [9, 1728], - [7, 18], - [7, 18], - [7, 18], - [7, 18], - [7, 24], - [7, 24], - [7, 24], - [7, 24], - [8, 49], - [8, 49], - [8, 50], - [8, 50], - [8, 51], - [8, 51], - [8, 52], - [8, 52], - [7, 25], - [7, 25], - [7, 25], - [7, 25], - [8, 55], - [8, 55], - [8, 56], - [8, 56], - [8, 57], - [8, 57], - [8, 58], - [8, 58], - [6, 192], - [6, 192], - [6, 192], - [6, 192], - [6, 192], - [6, 192], - [6, 192], - [6, 192], - [6, 1664], - [6, 1664], - [6, 1664], - [6, 1664], - [6, 1664], - [6, 1664], - [6, 1664], - [6, 1664], - [8, 448], - [8, 448], - [8, 512], - [8, 512], - [9, 704], - [9, 768], - [8, 640], - [8, 640], - [8, 576], - [8, 576], - [9, 832], - [9, 896], - [9, 960], - [9, 1024], - [9, 1088], - [9, 1152], - [9, 1216], - [9, 1280], - [9, 1344], - [9, 1408], - [7, 256], - [7, 256], - [7, 256], - [7, 256], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 2], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [4, 3], - [5, 128], - [5, 128], - [5, 128], - [5, 128], - [5, 128], - [5, 128], - [5, 128], - [5, 128], - [5, 128], - [5, 128], - [5, 128], - [5, 128], - [5, 128], - [5, 128], - [5, 128], - [5, 128], - [5, 8], - [5, 8], - [5, 8], - [5, 8], - [5, 8], - [5, 8], - [5, 8], - [5, 8], - [5, 8], - [5, 8], - [5, 8], - [5, 8], - [5, 8], - [5, 8], - [5, 8], - [5, 8], - [5, 9], - [5, 9], - [5, 9], - [5, 9], - [5, 9], - [5, 9], - [5, 9], - [5, 9], - [5, 9], - [5, 9], - [5, 9], - [5, 9], - [5, 9], - [5, 9], - [5, 9], - [5, 9], - [6, 16], - [6, 16], - [6, 16], - [6, 16], - [6, 16], - [6, 16], - [6, 16], - [6, 16], - [6, 17], - [6, 17], - [6, 17], - [6, 17], - [6, 17], - [6, 17], - [6, 17], - [6, 17], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 4], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [6, 14], - [6, 14], - [6, 14], - [6, 14], - [6, 14], - [6, 14], - [6, 14], - [6, 14], - [6, 15], - [6, 15], - [6, 15], - [6, 15], - [6, 15], - [6, 15], - [6, 15], - [6, 15], - [5, 64], - [5, 64], - [5, 64], - [5, 64], - [5, 64], - [5, 64], - [5, 64], - [5, 64], - [5, 64], - [5, 64], - [5, 64], - [5, 64], - [5, 64], - [5, 64], - [5, 64], - [5, 64], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - [4, 7], - ], - Mt = [ - [-1, -1], - [-1, -1], - [12, -2], - [12, -2], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [11, 1792], - [11, 1792], - [11, 1792], - [11, 1792], - [12, 1984], - [12, 1984], - [12, 2048], - [12, 2048], - [12, 2112], - [12, 2112], - [12, 2176], - [12, 2176], - [12, 2240], - [12, 2240], - [12, 2304], - [12, 2304], - [11, 1856], - [11, 1856], - [11, 1856], - [11, 1856], - [11, 1920], - [11, 1920], - [11, 1920], - [11, 1920], - [12, 2368], - [12, 2368], - [12, 2432], - [12, 2432], - [12, 2496], - [12, 2496], - [12, 2560], - [12, 2560], - [10, 18], - [10, 18], - [10, 18], - [10, 18], - [10, 18], - [10, 18], - [10, 18], - [10, 18], - [12, 52], - [12, 52], - [13, 640], - [13, 704], - [13, 768], - [13, 832], - [12, 55], - [12, 55], - [12, 56], - [12, 56], - [13, 1280], - [13, 1344], - [13, 1408], - [13, 1472], - [12, 59], - [12, 59], - [12, 60], - [12, 60], - [13, 1536], - [13, 1600], - [11, 24], - [11, 24], - [11, 24], - [11, 24], - [11, 25], - [11, 25], - [11, 25], - [11, 25], - [13, 1664], - [13, 1728], - [12, 320], - [12, 320], - [12, 384], - [12, 384], - [12, 448], - [12, 448], - [13, 512], - [13, 576], - [12, 53], - [12, 53], - [12, 54], - [12, 54], - [13, 896], - [13, 960], - [13, 1024], - [13, 1088], - [13, 1152], - [13, 1216], - [10, 64], - [10, 64], - [10, 64], - [10, 64], - [10, 64], - [10, 64], - [10, 64], - [10, 64], - ], - Lt = [ - [8, 13], - [8, 13], - [8, 13], - [8, 13], - [8, 13], - [8, 13], - [8, 13], - [8, 13], - [8, 13], - [8, 13], - [8, 13], - [8, 13], - [8, 13], - [8, 13], - [8, 13], - [8, 13], - [11, 23], - [11, 23], - [12, 50], - [12, 51], - [12, 44], - [12, 45], - [12, 46], - [12, 47], - [12, 57], - [12, 58], - [12, 61], - [12, 256], - [10, 16], - [10, 16], - [10, 16], - [10, 16], - [10, 17], - [10, 17], - [10, 17], - [10, 17], - [12, 48], - [12, 49], - [12, 62], - [12, 63], - [12, 30], - [12, 31], - [12, 32], - [12, 33], - [12, 40], - [12, 41], - [11, 22], - [11, 22], - [8, 14], - [8, 14], - [8, 14], - [8, 14], - [8, 14], - [8, 14], - [8, 14], - [8, 14], - [8, 14], - [8, 14], - [8, 14], - [8, 14], - [8, 14], - [8, 14], - [8, 14], - [8, 14], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 10], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [7, 11], - [9, 15], - [9, 15], - [9, 15], - [9, 15], - [9, 15], - [9, 15], - [9, 15], - [9, 15], - [12, 128], - [12, 192], - [12, 26], - [12, 27], - [12, 28], - [12, 29], - [11, 19], - [11, 19], - [11, 20], - [11, 20], - [12, 34], - [12, 35], - [12, 36], - [12, 37], - [12, 38], - [12, 39], - [11, 21], - [11, 21], - [12, 42], - [12, 43], - [10, 0], - [10, 0], - [10, 0], - [10, 0], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - [7, 12], - ], - Ht = [ - [-1, -1], - [-1, -1], - [-1, -1], - [-1, -1], - [6, 9], - [6, 8], - [5, 7], - [5, 7], - [4, 6], - [4, 6], - [4, 6], - [4, 6], - [4, 5], - [4, 5], - [4, 5], - [4, 5], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 1], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [3, 4], - [2, 3], - [2, 3], - [2, 3], - [2, 3], - [2, 3], - [2, 3], - [2, 3], - [2, 3], - [2, 3], - [2, 3], - [2, 3], - [2, 3], - [2, 3], - [2, 3], - [2, 3], - [2, 3], - [2, 2], - [2, 2], - [2, 2], - [2, 2], - [2, 2], - [2, 2], - [2, 2], - [2, 2], - [2, 2], - [2, 2], - [2, 2], - [2, 2], - [2, 2], - [2, 2], - [2, 2], - [2, 2], - ]; +} // ./src/core/ccitt.js + +const ccittEOL = -2; +const ccittEOF = -1; +const twoDimPass = 0; +const twoDimHoriz = 1; +const twoDimVert0 = 2; +const twoDimVertR1 = 3; +const twoDimVertL1 = 4; +const twoDimVertR2 = 5; +const twoDimVertL2 = 6; +const twoDimVertR3 = 7; +const twoDimVertL3 = 8; +const twoDimTable = [ + [-1, -1], + [-1, -1], + [7, twoDimVertL3], + [7, twoDimVertR3], + [6, twoDimVertL2], + [6, twoDimVertL2], + [6, twoDimVertR2], + [6, twoDimVertR2], + [4, twoDimPass], + [4, twoDimPass], + [4, twoDimPass], + [4, twoDimPass], + [4, twoDimPass], + [4, twoDimPass], + [4, twoDimPass], + [4, twoDimPass], + [3, twoDimHoriz], + [3, twoDimHoriz], + [3, twoDimHoriz], + [3, twoDimHoriz], + [3, twoDimHoriz], + [3, twoDimHoriz], + [3, twoDimHoriz], + [3, twoDimHoriz], + [3, twoDimHoriz], + [3, twoDimHoriz], + [3, twoDimHoriz], + [3, twoDimHoriz], + [3, twoDimHoriz], + [3, twoDimHoriz], + [3, twoDimHoriz], + [3, twoDimHoriz], + [3, twoDimVertL1], + [3, twoDimVertL1], + [3, twoDimVertL1], + [3, twoDimVertL1], + [3, twoDimVertL1], + [3, twoDimVertL1], + [3, twoDimVertL1], + [3, twoDimVertL1], + [3, twoDimVertL1], + [3, twoDimVertL1], + [3, twoDimVertL1], + [3, twoDimVertL1], + [3, twoDimVertL1], + [3, twoDimVertL1], + [3, twoDimVertL1], + [3, twoDimVertL1], + [3, twoDimVertR1], + [3, twoDimVertR1], + [3, twoDimVertR1], + [3, twoDimVertR1], + [3, twoDimVertR1], + [3, twoDimVertR1], + [3, twoDimVertR1], + [3, twoDimVertR1], + [3, twoDimVertR1], + [3, twoDimVertR1], + [3, twoDimVertR1], + [3, twoDimVertR1], + [3, twoDimVertR1], + [3, twoDimVertR1], + [3, twoDimVertR1], + [3, twoDimVertR1], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], + [1, twoDimVert0], +]; +const whiteTable1 = [ + [-1, -1], + [12, ccittEOL], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [11, 1792], + [11, 1792], + [12, 1984], + [12, 2048], + [12, 2112], + [12, 2176], + [12, 2240], + [12, 2304], + [11, 1856], + [11, 1856], + [11, 1920], + [11, 1920], + [12, 2368], + [12, 2432], + [12, 2496], + [12, 2560], +]; +const whiteTable2 = [ + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [8, 29], + [8, 29], + [8, 30], + [8, 30], + [8, 45], + [8, 45], + [8, 46], + [8, 46], + [7, 22], + [7, 22], + [7, 22], + [7, 22], + [7, 23], + [7, 23], + [7, 23], + [7, 23], + [8, 47], + [8, 47], + [8, 48], + [8, 48], + [6, 13], + [6, 13], + [6, 13], + [6, 13], + [6, 13], + [6, 13], + [6, 13], + [6, 13], + [7, 20], + [7, 20], + [7, 20], + [7, 20], + [8, 33], + [8, 33], + [8, 34], + [8, 34], + [8, 35], + [8, 35], + [8, 36], + [8, 36], + [8, 37], + [8, 37], + [8, 38], + [8, 38], + [7, 19], + [7, 19], + [7, 19], + [7, 19], + [8, 31], + [8, 31], + [8, 32], + [8, 32], + [6, 1], + [6, 1], + [6, 1], + [6, 1], + [6, 1], + [6, 1], + [6, 1], + [6, 1], + [6, 12], + [6, 12], + [6, 12], + [6, 12], + [6, 12], + [6, 12], + [6, 12], + [6, 12], + [8, 53], + [8, 53], + [8, 54], + [8, 54], + [7, 26], + [7, 26], + [7, 26], + [7, 26], + [8, 39], + [8, 39], + [8, 40], + [8, 40], + [8, 41], + [8, 41], + [8, 42], + [8, 42], + [8, 43], + [8, 43], + [8, 44], + [8, 44], + [7, 21], + [7, 21], + [7, 21], + [7, 21], + [7, 28], + [7, 28], + [7, 28], + [7, 28], + [8, 61], + [8, 61], + [8, 62], + [8, 62], + [8, 63], + [8, 63], + [8, 0], + [8, 0], + [8, 320], + [8, 320], + [8, 384], + [8, 384], + [5, 10], + [5, 10], + [5, 10], + [5, 10], + [5, 10], + [5, 10], + [5, 10], + [5, 10], + [5, 10], + [5, 10], + [5, 10], + [5, 10], + [5, 10], + [5, 10], + [5, 10], + [5, 10], + [5, 11], + [5, 11], + [5, 11], + [5, 11], + [5, 11], + [5, 11], + [5, 11], + [5, 11], + [5, 11], + [5, 11], + [5, 11], + [5, 11], + [5, 11], + [5, 11], + [5, 11], + [5, 11], + [7, 27], + [7, 27], + [7, 27], + [7, 27], + [8, 59], + [8, 59], + [8, 60], + [8, 60], + [9, 1472], + [9, 1536], + [9, 1600], + [9, 1728], + [7, 18], + [7, 18], + [7, 18], + [7, 18], + [7, 24], + [7, 24], + [7, 24], + [7, 24], + [8, 49], + [8, 49], + [8, 50], + [8, 50], + [8, 51], + [8, 51], + [8, 52], + [8, 52], + [7, 25], + [7, 25], + [7, 25], + [7, 25], + [8, 55], + [8, 55], + [8, 56], + [8, 56], + [8, 57], + [8, 57], + [8, 58], + [8, 58], + [6, 192], + [6, 192], + [6, 192], + [6, 192], + [6, 192], + [6, 192], + [6, 192], + [6, 192], + [6, 1664], + [6, 1664], + [6, 1664], + [6, 1664], + [6, 1664], + [6, 1664], + [6, 1664], + [6, 1664], + [8, 448], + [8, 448], + [8, 512], + [8, 512], + [9, 704], + [9, 768], + [8, 640], + [8, 640], + [8, 576], + [8, 576], + [9, 832], + [9, 896], + [9, 960], + [9, 1024], + [9, 1088], + [9, 1152], + [9, 1216], + [9, 1280], + [9, 1344], + [9, 1408], + [7, 256], + [7, 256], + [7, 256], + [7, 256], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 2], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [4, 3], + [5, 128], + [5, 128], + [5, 128], + [5, 128], + [5, 128], + [5, 128], + [5, 128], + [5, 128], + [5, 128], + [5, 128], + [5, 128], + [5, 128], + [5, 128], + [5, 128], + [5, 128], + [5, 128], + [5, 8], + [5, 8], + [5, 8], + [5, 8], + [5, 8], + [5, 8], + [5, 8], + [5, 8], + [5, 8], + [5, 8], + [5, 8], + [5, 8], + [5, 8], + [5, 8], + [5, 8], + [5, 8], + [5, 9], + [5, 9], + [5, 9], + [5, 9], + [5, 9], + [5, 9], + [5, 9], + [5, 9], + [5, 9], + [5, 9], + [5, 9], + [5, 9], + [5, 9], + [5, 9], + [5, 9], + [5, 9], + [6, 16], + [6, 16], + [6, 16], + [6, 16], + [6, 16], + [6, 16], + [6, 16], + [6, 16], + [6, 17], + [6, 17], + [6, 17], + [6, 17], + [6, 17], + [6, 17], + [6, 17], + [6, 17], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 4], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [6, 14], + [6, 14], + [6, 14], + [6, 14], + [6, 14], + [6, 14], + [6, 14], + [6, 14], + [6, 15], + [6, 15], + [6, 15], + [6, 15], + [6, 15], + [6, 15], + [6, 15], + [6, 15], + [5, 64], + [5, 64], + [5, 64], + [5, 64], + [5, 64], + [5, 64], + [5, 64], + [5, 64], + [5, 64], + [5, 64], + [5, 64], + [5, 64], + [5, 64], + [5, 64], + [5, 64], + [5, 64], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], + [4, 7], +]; +const blackTable1 = [ + [-1, -1], + [-1, -1], + [12, ccittEOL], + [12, ccittEOL], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [11, 1792], + [11, 1792], + [11, 1792], + [11, 1792], + [12, 1984], + [12, 1984], + [12, 2048], + [12, 2048], + [12, 2112], + [12, 2112], + [12, 2176], + [12, 2176], + [12, 2240], + [12, 2240], + [12, 2304], + [12, 2304], + [11, 1856], + [11, 1856], + [11, 1856], + [11, 1856], + [11, 1920], + [11, 1920], + [11, 1920], + [11, 1920], + [12, 2368], + [12, 2368], + [12, 2432], + [12, 2432], + [12, 2496], + [12, 2496], + [12, 2560], + [12, 2560], + [10, 18], + [10, 18], + [10, 18], + [10, 18], + [10, 18], + [10, 18], + [10, 18], + [10, 18], + [12, 52], + [12, 52], + [13, 640], + [13, 704], + [13, 768], + [13, 832], + [12, 55], + [12, 55], + [12, 56], + [12, 56], + [13, 1280], + [13, 1344], + [13, 1408], + [13, 1472], + [12, 59], + [12, 59], + [12, 60], + [12, 60], + [13, 1536], + [13, 1600], + [11, 24], + [11, 24], + [11, 24], + [11, 24], + [11, 25], + [11, 25], + [11, 25], + [11, 25], + [13, 1664], + [13, 1728], + [12, 320], + [12, 320], + [12, 384], + [12, 384], + [12, 448], + [12, 448], + [13, 512], + [13, 576], + [12, 53], + [12, 53], + [12, 54], + [12, 54], + [13, 896], + [13, 960], + [13, 1024], + [13, 1088], + [13, 1152], + [13, 1216], + [10, 64], + [10, 64], + [10, 64], + [10, 64], + [10, 64], + [10, 64], + [10, 64], + [10, 64], +]; +const blackTable2 = [ + [8, 13], + [8, 13], + [8, 13], + [8, 13], + [8, 13], + [8, 13], + [8, 13], + [8, 13], + [8, 13], + [8, 13], + [8, 13], + [8, 13], + [8, 13], + [8, 13], + [8, 13], + [8, 13], + [11, 23], + [11, 23], + [12, 50], + [12, 51], + [12, 44], + [12, 45], + [12, 46], + [12, 47], + [12, 57], + [12, 58], + [12, 61], + [12, 256], + [10, 16], + [10, 16], + [10, 16], + [10, 16], + [10, 17], + [10, 17], + [10, 17], + [10, 17], + [12, 48], + [12, 49], + [12, 62], + [12, 63], + [12, 30], + [12, 31], + [12, 32], + [12, 33], + [12, 40], + [12, 41], + [11, 22], + [11, 22], + [8, 14], + [8, 14], + [8, 14], + [8, 14], + [8, 14], + [8, 14], + [8, 14], + [8, 14], + [8, 14], + [8, 14], + [8, 14], + [8, 14], + [8, 14], + [8, 14], + [8, 14], + [8, 14], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 10], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [7, 11], + [9, 15], + [9, 15], + [9, 15], + [9, 15], + [9, 15], + [9, 15], + [9, 15], + [9, 15], + [12, 128], + [12, 192], + [12, 26], + [12, 27], + [12, 28], + [12, 29], + [11, 19], + [11, 19], + [11, 20], + [11, 20], + [12, 34], + [12, 35], + [12, 36], + [12, 37], + [12, 38], + [12, 39], + [11, 21], + [11, 21], + [12, 42], + [12, 43], + [10, 0], + [10, 0], + [10, 0], + [10, 0], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], + [7, 12], +]; +const blackTable3 = [ + [-1, -1], + [-1, -1], + [-1, -1], + [-1, -1], + [6, 9], + [6, 8], + [5, 7], + [5, 7], + [4, 6], + [4, 6], + [4, 6], + [4, 6], + [4, 5], + [4, 5], + [4, 5], + [4, 5], + [3, 1], + [3, 1], + [3, 1], + [3, 1], + [3, 1], + [3, 1], + [3, 1], + [3, 1], + [3, 4], + [3, 4], + [3, 4], + [3, 4], + [3, 4], + [3, 4], + [3, 4], + [3, 4], + [2, 3], + [2, 3], + [2, 3], + [2, 3], + [2, 3], + [2, 3], + [2, 3], + [2, 3], + [2, 3], + [2, 3], + [2, 3], + [2, 3], + [2, 3], + [2, 3], + [2, 3], + [2, 3], + [2, 2], + [2, 2], + [2, 2], + [2, 2], + [2, 2], + [2, 2], + [2, 2], + [2, 2], + [2, 2], + [2, 2], + [2, 2], + [2, 2], + [2, 2], + [2, 2], + [2, 2], + [2, 2], +]; class CCITTFaxDecoder { - constructor(e, t = {}) { - if (!e || "function" != typeof e.next) + constructor(source, options = {}) { + if (!source || typeof source.next !== "function") { throw new Error('CCITTFaxDecoder - invalid "source" parameter.'); - this.source = e; - this.eof = !1; - this.encoding = t.K || 0; - this.eoline = t.EndOfLine || !1; - this.byteAlign = t.EncodedByteAlign || !1; - this.columns = t.Columns || 1728; - this.rows = t.Rows || 0; - this.eoblock = t.EndOfBlock ?? !0; - this.black = t.BlackIs1 || !1; + } + this.source = source; + this.eof = false; + this.encoding = options.K || 0; + this.eoline = options.EndOfLine || false; + this.byteAlign = options.EncodedByteAlign || false; + this.columns = options.Columns || 1728; + this.rows = options.Rows || 0; + this.eoblock = options.EndOfBlock ?? true; + this.black = options.BlackIs1 || false; this.codingLine = new Uint32Array(this.columns + 1); this.refLine = new Uint32Array(this.columns + 2); this.codingLine[0] = this.columns; @@ -4077,4838 +5018,6509 @@ class CCITTFaxDecoder { this.inputBits = 0; this.inputBuf = 0; this.outputBits = 0; - this.rowsDone = !1; - let i; - for (; 0 === (i = this._lookBits(12)); ) this._eatBits(1); - 1 === i && this._eatBits(12); + this.rowsDone = false; + let code1; + while ((code1 = this._lookBits(12)) === 0) { + this._eatBits(1); + } + if (code1 === 1) { + this._eatBits(12); + } if (this.encoding > 0) { this.nextLine2D = !this._lookBits(1); this._eatBits(1); } } readNextChar() { - if (this.eof) return -1; - const e = this.refLine, - t = this.codingLine, - i = this.columns; - let a, s, r, n, g; - if (0 === this.outputBits) { - this.rowsDone && (this.eof = !0); - if (this.eof) return -1; - this.err = !1; - let r, g, o; + if (this.eof) { + return -1; + } + const refLine = this.refLine; + const codingLine = this.codingLine; + const columns = this.columns; + let refPos, blackPixels, bits, i; + if (this.outputBits === 0) { + if (this.rowsDone) { + this.eof = true; + } + if (this.eof) { + return -1; + } + this.err = false; + let code1, code2, code3; if (this.nextLine2D) { - for (n = 0; t[n] < i; ++n) e[n] = t[n]; - e[n++] = i; - e[n] = i; - t[0] = 0; + for (i = 0; codingLine[i] < columns; ++i) { + refLine[i] = codingLine[i]; + } + refLine[i++] = columns; + refLine[i] = columns; + codingLine[0] = 0; this.codingPos = 0; - a = 0; - s = 0; - for (; t[this.codingPos] < i; ) { - r = this._getTwoDimCode(); - switch (r) { - case 0: - this._addPixels(e[a + 1], s); - e[a + 1] < i && (a += 2); + refPos = 0; + blackPixels = 0; + while (codingLine[this.codingPos] < columns) { + code1 = this._getTwoDimCode(); + switch (code1) { + case twoDimPass: + this._addPixels(refLine[refPos + 1], blackPixels); + if (refLine[refPos + 1] < columns) { + refPos += 2; + } break; - case 1: - r = g = 0; - if (s) { + case twoDimHoriz: + code1 = code2 = 0; + if (blackPixels) { do { - r += o = this._getBlackCode(); - } while (o >= 64); + code1 += code3 = this._getBlackCode(); + } while (code3 >= 64); do { - g += o = this._getWhiteCode(); - } while (o >= 64); + code2 += code3 = this._getWhiteCode(); + } while (code3 >= 64); } else { do { - r += o = this._getWhiteCode(); - } while (o >= 64); + code1 += code3 = this._getWhiteCode(); + } while (code3 >= 64); do { - g += o = this._getBlackCode(); - } while (o >= 64); + code2 += code3 = this._getBlackCode(); + } while (code3 >= 64); } - this._addPixels(t[this.codingPos] + r, s); - t[this.codingPos] < i && - this._addPixels(t[this.codingPos] + g, 1 ^ s); - for (; e[a] <= t[this.codingPos] && e[a] < i; ) a += 2; - break; - case 7: - this._addPixels(e[a] + 3, s); - s ^= 1; - if (t[this.codingPos] < i) { - ++a; - for (; e[a] <= t[this.codingPos] && e[a] < i; ) a += 2; + this._addPixels(codingLine[this.codingPos] + code1, blackPixels); + if (codingLine[this.codingPos] < columns) { + this._addPixels( + codingLine[this.codingPos] + code2, + blackPixels ^ 1, + ); + } + while ( + refLine[refPos] <= codingLine[this.codingPos] && + refLine[refPos] < columns + ) { + refPos += 2; } break; - case 5: - this._addPixels(e[a] + 2, s); - s ^= 1; - if (t[this.codingPos] < i) { - ++a; - for (; e[a] <= t[this.codingPos] && e[a] < i; ) a += 2; + case twoDimVertR3: + this._addPixels(refLine[refPos] + 3, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + ++refPos; + while ( + refLine[refPos] <= codingLine[this.codingPos] && + refLine[refPos] < columns + ) { + refPos += 2; + } } break; - case 3: - this._addPixels(e[a] + 1, s); - s ^= 1; - if (t[this.codingPos] < i) { - ++a; - for (; e[a] <= t[this.codingPos] && e[a] < i; ) a += 2; + case twoDimVertR2: + this._addPixels(refLine[refPos] + 2, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + ++refPos; + while ( + refLine[refPos] <= codingLine[this.codingPos] && + refLine[refPos] < columns + ) { + refPos += 2; + } } break; - case 2: - this._addPixels(e[a], s); - s ^= 1; - if (t[this.codingPos] < i) { - ++a; - for (; e[a] <= t[this.codingPos] && e[a] < i; ) a += 2; + case twoDimVertR1: + this._addPixels(refLine[refPos] + 1, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + ++refPos; + while ( + refLine[refPos] <= codingLine[this.codingPos] && + refLine[refPos] < columns + ) { + refPos += 2; + } } break; - case 8: - this._addPixelsNeg(e[a] - 3, s); - s ^= 1; - if (t[this.codingPos] < i) { - a > 0 ? --a : ++a; - for (; e[a] <= t[this.codingPos] && e[a] < i; ) a += 2; + case twoDimVert0: + this._addPixels(refLine[refPos], blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + ++refPos; + while ( + refLine[refPos] <= codingLine[this.codingPos] && + refLine[refPos] < columns + ) { + refPos += 2; + } } break; - case 6: - this._addPixelsNeg(e[a] - 2, s); - s ^= 1; - if (t[this.codingPos] < i) { - a > 0 ? --a : ++a; - for (; e[a] <= t[this.codingPos] && e[a] < i; ) a += 2; + case twoDimVertL3: + this._addPixelsNeg(refLine[refPos] - 3, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + if (refPos > 0) { + --refPos; + } else { + ++refPos; + } + while ( + refLine[refPos] <= codingLine[this.codingPos] && + refLine[refPos] < columns + ) { + refPos += 2; + } } break; - case 4: - this._addPixelsNeg(e[a] - 1, s); - s ^= 1; - if (t[this.codingPos] < i) { - a > 0 ? --a : ++a; - for (; e[a] <= t[this.codingPos] && e[a] < i; ) a += 2; + case twoDimVertL2: + this._addPixelsNeg(refLine[refPos] - 2, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + if (refPos > 0) { + --refPos; + } else { + ++refPos; + } + while ( + refLine[refPos] <= codingLine[this.codingPos] && + refLine[refPos] < columns + ) { + refPos += 2; + } } break; - case Nt: - this._addPixels(i, 0); - this.eof = !0; + case twoDimVertL1: + this._addPixelsNeg(refLine[refPos] - 1, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + if (refPos > 0) { + --refPos; + } else { + ++refPos; + } + while ( + refLine[refPos] <= codingLine[this.codingPos] && + refLine[refPos] < columns + ) { + refPos += 2; + } + } + break; + case ccittEOF: + this._addPixels(columns, 0); + this.eof = true; break; default: info("bad 2d code"); - this._addPixels(i, 0); - this.err = !0; + this._addPixels(columns, 0); + this.err = true; } } } else { - t[0] = 0; + codingLine[0] = 0; this.codingPos = 0; - s = 0; - for (; t[this.codingPos] < i; ) { - r = 0; - if (s) + blackPixels = 0; + while (codingLine[this.codingPos] < columns) { + code1 = 0; + if (blackPixels) { do { - r += o = this._getBlackCode(); - } while (o >= 64); - else + code1 += code3 = this._getBlackCode(); + } while (code3 >= 64); + } else { do { - r += o = this._getWhiteCode(); - } while (o >= 64); - this._addPixels(t[this.codingPos] + r, s); - s ^= 1; + code1 += code3 = this._getWhiteCode(); + } while (code3 >= 64); + } + this._addPixels(codingLine[this.codingPos] + code1, blackPixels); + blackPixels ^= 1; } } - let c = !1; - this.byteAlign && (this.inputBits &= -8); - if (this.eoblock || this.row !== this.rows - 1) { - r = this._lookBits(12); - if (this.eoline) - for (; r !== Nt && 1 !== r; ) { + let gotEOL = false; + if (this.byteAlign) { + this.inputBits &= ~7; + } + if (!this.eoblock && this.row === this.rows - 1) { + this.rowsDone = true; + } else { + code1 = this._lookBits(12); + if (this.eoline) { + while (code1 !== ccittEOF && code1 !== 1) { this._eatBits(1); - r = this._lookBits(12); + code1 = this._lookBits(12); } - else - for (; 0 === r; ) { + } else { + while (code1 === 0) { this._eatBits(1); - r = this._lookBits(12); + code1 = this._lookBits(12); } - if (1 === r) { + } + if (code1 === 1) { this._eatBits(12); - c = !0; - } else r === Nt && (this.eof = !0); - } else this.rowsDone = !0; + gotEOL = true; + } else if (code1 === ccittEOF) { + this.eof = true; + } + } if (!this.eof && this.encoding > 0 && !this.rowsDone) { this.nextLine2D = !this._lookBits(1); this._eatBits(1); } - if (this.eoblock && c && this.byteAlign) { - r = this._lookBits(12); - if (1 === r) { + if (this.eoblock && gotEOL && this.byteAlign) { + code1 = this._lookBits(12); + if (code1 === 1) { this._eatBits(12); if (this.encoding > 0) { this._lookBits(1); this._eatBits(1); } - if (this.encoding >= 0) - for (n = 0; n < 4; ++n) { - r = this._lookBits(12); - 1 !== r && info("bad rtc code: " + r); + if (this.encoding >= 0) { + for (i = 0; i < 4; ++i) { + code1 = this._lookBits(12); + if (code1 !== 1) { + info("bad rtc code: " + code1); + } this._eatBits(12); if (this.encoding > 0) { this._lookBits(1); this._eatBits(1); } } - this.eof = !0; + } + this.eof = true; } } else if (this.err && this.eoline) { - for (;;) { - r = this._lookBits(13); - if (r === Nt) { - this.eof = !0; + while (true) { + code1 = this._lookBits(13); + if (code1 === ccittEOF) { + this.eof = true; return -1; } - if (r >> 1 == 1) break; + if (code1 >> 1 === 1) { + break; + } this._eatBits(1); } this._eatBits(12); if (this.encoding > 0) { this._eatBits(1); - this.nextLine2D = !(1 & r); + this.nextLine2D = !(code1 & 1); } } this.outputBits = - t[0] > 0 ? t[(this.codingPos = 0)] : t[(this.codingPos = 1)]; + codingLine[0] > 0 + ? codingLine[(this.codingPos = 0)] + : codingLine[(this.codingPos = 1)]; this.row++; } + let c; if (this.outputBits >= 8) { - g = 1 & this.codingPos ? 0 : 255; + c = this.codingPos & 1 ? 0 : 0xff; this.outputBits -= 8; - if (0 === this.outputBits && t[this.codingPos] < i) { + if (this.outputBits === 0 && codingLine[this.codingPos] < columns) { this.codingPos++; - this.outputBits = t[this.codingPos] - t[this.codingPos - 1]; + this.outputBits = + codingLine[this.codingPos] - codingLine[this.codingPos - 1]; } } else { - r = 8; - g = 0; + bits = 8; + c = 0; do { - if ("number" != typeof this.outputBits) + if (typeof this.outputBits !== "number") { throw new FormatError( 'Invalid /CCITTFaxDecode data, "outputBits" must be a number.', ); - if (this.outputBits > r) { - g <<= r; - 1 & this.codingPos || (g |= 255 >> (8 - r)); - this.outputBits -= r; - r = 0; + } + if (this.outputBits > bits) { + c <<= bits; + if (!(this.codingPos & 1)) { + c |= 0xff >> (8 - bits); + } + this.outputBits -= bits; + bits = 0; } else { - g <<= this.outputBits; - 1 & this.codingPos || (g |= 255 >> (8 - this.outputBits)); - r -= this.outputBits; + c <<= this.outputBits; + if (!(this.codingPos & 1)) { + c |= 0xff >> (8 - this.outputBits); + } + bits -= this.outputBits; this.outputBits = 0; - if (t[this.codingPos] < i) { + if (codingLine[this.codingPos] < columns) { this.codingPos++; - this.outputBits = t[this.codingPos] - t[this.codingPos - 1]; - } else if (r > 0) { - g <<= r; - r = 0; + this.outputBits = + codingLine[this.codingPos] - codingLine[this.codingPos - 1]; + } else if (bits > 0) { + c <<= bits; + bits = 0; } } - } while (r); + } while (bits); } - this.black && (g ^= 255); - return g; - } - _addPixels(e, t) { - const i = this.codingLine; - let a = this.codingPos; - if (e > i[a]) { - if (e > this.columns) { - info("row is wrong length"); - this.err = !0; - e = this.columns; - } - (1 & a) ^ t && ++a; - i[a] = e; + if (this.black) { + c ^= 0xff; } - this.codingPos = a; + return c; } - _addPixelsNeg(e, t) { - const i = this.codingLine; - let a = this.codingPos; - if (e > i[a]) { - if (e > this.columns) { + _addPixels(a1, blackPixels) { + const codingLine = this.codingLine; + let codingPos = this.codingPos; + if (a1 > codingLine[codingPos]) { + if (a1 > this.columns) { info("row is wrong length"); - this.err = !0; - e = this.columns; + this.err = true; + a1 = this.columns; } - (1 & a) ^ t && ++a; - i[a] = e; - } else if (e < i[a]) { - if (e < 0) { + if ((codingPos & 1) ^ blackPixels) { + ++codingPos; + } + codingLine[codingPos] = a1; + } + this.codingPos = codingPos; + } + _addPixelsNeg(a1, blackPixels) { + const codingLine = this.codingLine; + let codingPos = this.codingPos; + if (a1 > codingLine[codingPos]) { + if (a1 > this.columns) { + info("row is wrong length"); + this.err = true; + a1 = this.columns; + } + if ((codingPos & 1) ^ blackPixels) { + ++codingPos; + } + codingLine[codingPos] = a1; + } else if (a1 < codingLine[codingPos]) { + if (a1 < 0) { info("invalid code"); - this.err = !0; - e = 0; + this.err = true; + a1 = 0; } - for (; a > 0 && e < i[a - 1]; ) --a; - i[a] = e; + while (codingPos > 0 && a1 < codingLine[codingPos - 1]) { + --codingPos; + } + codingLine[codingPos] = a1; } - this.codingPos = a; + this.codingPos = codingPos; } - _findTableCode(e, t, i, a) { - const s = a || 0; - for (let a = e; a <= t; ++a) { - let e = this._lookBits(a); - if (e === Nt) return [!0, 1, !1]; - a < t && (e <<= t - a); - if (!s || e >= s) { - const t = i[e - s]; - if (t[0] === a) { - this._eatBits(a); - return [!0, t[1], !0]; + _findTableCode(start, end, table, limit) { + const limitValue = limit || 0; + for (let i = start; i <= end; ++i) { + let code = this._lookBits(i); + if (code === ccittEOF) { + return [true, 1, false]; + } + if (i < end) { + code <<= end - i; + } + if (!limitValue || code >= limitValue) { + const p = table[code - limitValue]; + if (p[0] === i) { + this._eatBits(i); + return [true, p[1], true]; } } } - return [!1, 0, !1]; + return [false, 0, false]; } _getTwoDimCode() { - let e, - t = 0; + let code = 0; + let p; if (this.eoblock) { - t = this._lookBits(7); - e = Gt[t]; - if (e?.[0] > 0) { - this._eatBits(e[0]); - return e[1]; + code = this._lookBits(7); + p = twoDimTable[code]; + if (p?.[0] > 0) { + this._eatBits(p[0]); + return p[1]; } } else { - const e = this._findTableCode(1, 7, Gt); - if (e[0] && e[2]) return e[1]; + const result = this._findTableCode(1, 7, twoDimTable); + if (result[0] && result[2]) { + return result[1]; + } } info("Bad two dim code"); - return Nt; + return ccittEOF; } _getWhiteCode() { - let e, - t = 0; + let code = 0; + let p; if (this.eoblock) { - t = this._lookBits(12); - if (t === Nt) return 1; - e = t >> 5 == 0 ? xt[t] : Ut[t >> 3]; - if (e[0] > 0) { - this._eatBits(e[0]); - return e[1]; + code = this._lookBits(12); + if (code === ccittEOF) { + return 1; + } + p = code >> 5 === 0 ? whiteTable1[code] : whiteTable2[code >> 3]; + if (p[0] > 0) { + this._eatBits(p[0]); + return p[1]; } } else { - let e = this._findTableCode(1, 9, Ut); - if (e[0]) return e[1]; - e = this._findTableCode(11, 12, xt); - if (e[0]) return e[1]; + let result = this._findTableCode(1, 9, whiteTable2); + if (result[0]) { + return result[1]; + } + result = this._findTableCode(11, 12, whiteTable1); + if (result[0]) { + return result[1]; + } } info("bad white code"); this._eatBits(1); return 1; } _getBlackCode() { - let e, t; + let code, p; if (this.eoblock) { - e = this._lookBits(13); - if (e === Nt) return 1; - t = - e >> 7 == 0 - ? Mt[e] - : e >> 9 == 0 && e >> 7 != 0 - ? Lt[(e >> 1) - 64] - : Ht[e >> 7]; - if (t[0] > 0) { - this._eatBits(t[0]); - return t[1]; + code = this._lookBits(13); + if (code === ccittEOF) { + return 1; + } + if (code >> 7 === 0) { + p = blackTable1[code]; + } else if (code >> 9 === 0 && code >> 7 !== 0) { + p = blackTable2[(code >> 1) - 64]; + } else { + p = blackTable3[code >> 7]; + } + if (p[0] > 0) { + this._eatBits(p[0]); + return p[1]; } } else { - let e = this._findTableCode(2, 6, Ht); - if (e[0]) return e[1]; - e = this._findTableCode(7, 12, Lt, 64); - if (e[0]) return e[1]; - e = this._findTableCode(10, 13, Mt); - if (e[0]) return e[1]; + let result = this._findTableCode(2, 6, blackTable3); + if (result[0]) { + return result[1]; + } + result = this._findTableCode(7, 12, blackTable2, 64); + if (result[0]) { + return result[1]; + } + result = this._findTableCode(10, 13, blackTable1); + if (result[0]) { + return result[1]; + } } info("bad black code"); this._eatBits(1); return 1; } - _lookBits(e) { - let t; - for (; this.inputBits < e; ) { - if (-1 === (t = this.source.next())) - return 0 === this.inputBits - ? Nt - : (this.inputBuf << (e - this.inputBits)) & (65535 >> (16 - e)); - this.inputBuf = (this.inputBuf << 8) | t; + _lookBits(n) { + let c; + while (this.inputBits < n) { + if ((c = this.source.next()) === -1) { + if (this.inputBits === 0) { + return ccittEOF; + } + return (this.inputBuf << (n - this.inputBits)) & (0xffff >> (16 - n)); + } + this.inputBuf = (this.inputBuf << 8) | c; this.inputBits += 8; } - return (this.inputBuf >> (this.inputBits - e)) & (65535 >> (16 - e)); + return (this.inputBuf >> (this.inputBits - n)) & (0xffff >> (16 - n)); } - _eatBits(e) { - (this.inputBits -= e) < 0 && (this.inputBits = 0); + _eatBits(n) { + if ((this.inputBits -= n) < 0) { + this.inputBits = 0; + } } -} +} // ./src/core/ccitt_stream.js + class CCITTFaxStream extends DecodeStream { - constructor(e, t, i) { - super(t); - this.str = e; - this.dict = e.dict; - i instanceof Dict || (i = Dict.empty); - const a = { next: () => e.getByte() }; - this.ccittFaxDecoder = new CCITTFaxDecoder(a, { - K: i.get("K"), - EndOfLine: i.get("EndOfLine"), - EncodedByteAlign: i.get("EncodedByteAlign"), - Columns: i.get("Columns"), - Rows: i.get("Rows"), - EndOfBlock: i.get("EndOfBlock"), - BlackIs1: i.get("BlackIs1"), + constructor(str, maybeLength, params) { + super(maybeLength); + this.str = str; + this.dict = str.dict; + if (!(params instanceof Dict)) { + params = Dict.empty; + } + const source = { + next() { + return str.getByte(); + }, + }; + this.ccittFaxDecoder = new CCITTFaxDecoder(source, { + K: params.get("K"), + EndOfLine: params.get("EndOfLine"), + EncodedByteAlign: params.get("EncodedByteAlign"), + Columns: params.get("Columns"), + Rows: params.get("Rows"), + EndOfBlock: params.get("EndOfBlock"), + BlackIs1: params.get("BlackIs1"), }); } readBlock() { - for (; !this.eof; ) { - const e = this.ccittFaxDecoder.readNextChar(); - if (-1 === e) { - this.eof = !0; + while (!this.eof) { + const c = this.ccittFaxDecoder.readNextChar(); + if (c === -1) { + this.eof = true; return; } this.ensureBuffer(this.bufferLength + 1); - this.buffer[this.bufferLength++] = e; + this.buffer[this.bufferLength++] = c; } } -} -const Jt = new Int32Array([ - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15, +} // ./src/core/flate_stream.js + +const codeLenCodeMap = new Int32Array([ + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15, +]); +const lengthDecode = new Int32Array([ + 0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a, + 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f, + 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073, + 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102, +]); +const distDecode = new Int32Array([ + 0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d, + 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1, + 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01, + 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001, +]); +const fixedLitCodeTab = [ + new Int32Array([ + 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0, + 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0, + 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0, + 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0, + 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8, + 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8, + 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8, + 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8, + 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4, + 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4, + 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4, + 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4, + 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc, + 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec, + 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc, + 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc, + 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2, + 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2, + 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2, + 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2, + 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca, + 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea, + 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da, + 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa, + 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6, + 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6, + 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6, + 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6, + 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce, + 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee, + 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de, + 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe, + 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1, + 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1, + 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1, + 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1, + 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9, + 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9, + 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9, + 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9, + 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5, + 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5, + 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5, + 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5, + 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd, + 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed, + 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd, + 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd, + 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3, + 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3, + 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3, + 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3, + 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb, + 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb, + 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db, + 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb, + 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7, + 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7, + 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7, + 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b, 0x900f7, + 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf, + 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef, + 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df, + 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff, ]), - Yt = new Int32Array([ - 3, 4, 5, 6, 7, 8, 9, 10, 65547, 65549, 65551, 65553, 131091, 131095, 131099, - 131103, 196643, 196651, 196659, 196667, 262211, 262227, 262243, 262259, - 327811, 327843, 327875, 327907, 258, 258, 258, + 9, +]; +const fixedDistCodeTab = [ + new Int32Array([ + 0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c, + 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000, + 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d, + 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000, ]), - vt = new Int32Array([ - 1, 2, 3, 4, 65541, 65543, 131081, 131085, 196625, 196633, 262177, 262193, - 327745, 327777, 393345, 393409, 459009, 459137, 524801, 525057, 590849, - 591361, 657409, 658433, 724993, 727041, 794625, 798721, 868353, 876545, - ]), - Kt = [ - new Int32Array([ - 459008, 524368, 524304, 524568, 459024, 524400, 524336, 590016, 459016, - 524384, 524320, 589984, 524288, 524416, 524352, 590048, 459012, 524376, - 524312, 589968, 459028, 524408, 524344, 590032, 459020, 524392, 524328, - 59e4, 524296, 524424, 524360, 590064, 459010, 524372, 524308, 524572, - 459026, 524404, 524340, 590024, 459018, 524388, 524324, 589992, 524292, - 524420, 524356, 590056, 459014, 524380, 524316, 589976, 459030, 524412, - 524348, 590040, 459022, 524396, 524332, 590008, 524300, 524428, 524364, - 590072, 459009, 524370, 524306, 524570, 459025, 524402, 524338, 590020, - 459017, 524386, 524322, 589988, 524290, 524418, 524354, 590052, 459013, - 524378, 524314, 589972, 459029, 524410, 524346, 590036, 459021, 524394, - 524330, 590004, 524298, 524426, 524362, 590068, 459011, 524374, 524310, - 524574, 459027, 524406, 524342, 590028, 459019, 524390, 524326, 589996, - 524294, 524422, 524358, 590060, 459015, 524382, 524318, 589980, 459031, - 524414, 524350, 590044, 459023, 524398, 524334, 590012, 524302, 524430, - 524366, 590076, 459008, 524369, 524305, 524569, 459024, 524401, 524337, - 590018, 459016, 524385, 524321, 589986, 524289, 524417, 524353, 590050, - 459012, 524377, 524313, 589970, 459028, 524409, 524345, 590034, 459020, - 524393, 524329, 590002, 524297, 524425, 524361, 590066, 459010, 524373, - 524309, 524573, 459026, 524405, 524341, 590026, 459018, 524389, 524325, - 589994, 524293, 524421, 524357, 590058, 459014, 524381, 524317, 589978, - 459030, 524413, 524349, 590042, 459022, 524397, 524333, 590010, 524301, - 524429, 524365, 590074, 459009, 524371, 524307, 524571, 459025, 524403, - 524339, 590022, 459017, 524387, 524323, 589990, 524291, 524419, 524355, - 590054, 459013, 524379, 524315, 589974, 459029, 524411, 524347, 590038, - 459021, 524395, 524331, 590006, 524299, 524427, 524363, 590070, 459011, - 524375, 524311, 524575, 459027, 524407, 524343, 590030, 459019, 524391, - 524327, 589998, 524295, 524423, 524359, 590062, 459015, 524383, 524319, - 589982, 459031, 524415, 524351, 590046, 459023, 524399, 524335, 590014, - 524303, 524431, 524367, 590078, 459008, 524368, 524304, 524568, 459024, - 524400, 524336, 590017, 459016, 524384, 524320, 589985, 524288, 524416, - 524352, 590049, 459012, 524376, 524312, 589969, 459028, 524408, 524344, - 590033, 459020, 524392, 524328, 590001, 524296, 524424, 524360, 590065, - 459010, 524372, 524308, 524572, 459026, 524404, 524340, 590025, 459018, - 524388, 524324, 589993, 524292, 524420, 524356, 590057, 459014, 524380, - 524316, 589977, 459030, 524412, 524348, 590041, 459022, 524396, 524332, - 590009, 524300, 524428, 524364, 590073, 459009, 524370, 524306, 524570, - 459025, 524402, 524338, 590021, 459017, 524386, 524322, 589989, 524290, - 524418, 524354, 590053, 459013, 524378, 524314, 589973, 459029, 524410, - 524346, 590037, 459021, 524394, 524330, 590005, 524298, 524426, 524362, - 590069, 459011, 524374, 524310, 524574, 459027, 524406, 524342, 590029, - 459019, 524390, 524326, 589997, 524294, 524422, 524358, 590061, 459015, - 524382, 524318, 589981, 459031, 524414, 524350, 590045, 459023, 524398, - 524334, 590013, 524302, 524430, 524366, 590077, 459008, 524369, 524305, - 524569, 459024, 524401, 524337, 590019, 459016, 524385, 524321, 589987, - 524289, 524417, 524353, 590051, 459012, 524377, 524313, 589971, 459028, - 524409, 524345, 590035, 459020, 524393, 524329, 590003, 524297, 524425, - 524361, 590067, 459010, 524373, 524309, 524573, 459026, 524405, 524341, - 590027, 459018, 524389, 524325, 589995, 524293, 524421, 524357, 590059, - 459014, 524381, 524317, 589979, 459030, 524413, 524349, 590043, 459022, - 524397, 524333, 590011, 524301, 524429, 524365, 590075, 459009, 524371, - 524307, 524571, 459025, 524403, 524339, 590023, 459017, 524387, 524323, - 589991, 524291, 524419, 524355, 590055, 459013, 524379, 524315, 589975, - 459029, 524411, 524347, 590039, 459021, 524395, 524331, 590007, 524299, - 524427, 524363, 590071, 459011, 524375, 524311, 524575, 459027, 524407, - 524343, 590031, 459019, 524391, 524327, 589999, 524295, 524423, 524359, - 590063, 459015, 524383, 524319, 589983, 459031, 524415, 524351, 590047, - 459023, 524399, 524335, 590015, 524303, 524431, 524367, 590079, - ]), - 9, - ], - Tt = [ - new Int32Array([ - 327680, 327696, 327688, 327704, 327684, 327700, 327692, 327708, 327682, - 327698, 327690, 327706, 327686, 327702, 327694, 0, 327681, 327697, 327689, - 327705, 327685, 327701, 327693, 327709, 327683, 327699, 327691, 327707, - 327687, 327703, 327695, 0, - ]), - 5, - ]; + 5, +]; class FlateStream extends DecodeStream { - constructor(e, t) { - super(t); - this.str = e; - this.dict = e.dict; - const i = e.getByte(), - a = e.getByte(); - if (-1 === i || -1 === a) - throw new FormatError(`Invalid header in flate stream: ${i}, ${a}`); - if (8 != (15 & i)) + constructor(str, maybeLength) { + super(maybeLength); + this.str = str; + this.dict = str.dict; + const cmf = str.getByte(); + const flg = str.getByte(); + if (cmf === -1 || flg === -1) { + throw new FormatError(`Invalid header in flate stream: ${cmf}, ${flg}`); + } + if ((cmf & 0x0f) !== 0x08) { throw new FormatError( - `Unknown compression method in flate stream: ${i}, ${a}`, + `Unknown compression method in flate stream: ${cmf}, ${flg}`, ); - if (((i << 8) + a) % 31 != 0) - throw new FormatError(`Bad FCHECK in flate stream: ${i}, ${a}`); - if (32 & a) - throw new FormatError(`FDICT bit set in flate stream: ${i}, ${a}`); + } + if (((cmf << 8) + flg) % 31 !== 0) { + throw new FormatError(`Bad FCHECK in flate stream: ${cmf}, ${flg}`); + } + if (flg & 0x20) { + throw new FormatError(`FDICT bit set in flate stream: ${cmf}, ${flg}`); + } this.codeSize = 0; this.codeBuf = 0; } - async getImageData(e, t) { - const i = await this.asyncGetBytes(); - return i?.subarray(0, e) || this.getBytes(e); + async getImageData(length, _decoderOptions) { + const data = await this.asyncGetBytes(); + return data?.subarray(0, length) || this.getBytes(length); } async asyncGetBytes() { this.str.reset(); - const e = this.str.getBytes(); + const bytes = this.str.getBytes(); try { - const { readable: t, writable: i } = new DecompressionStream("deflate"), - a = i.getWriter(); - a.write(e); - a.close(); - const s = []; - let r = 0; - for await (const e of t) { - s.push(e); - r += e.byteLength; + const { readable, writable } = new DecompressionStream("deflate"); + const writer = writable.getWriter(); + await writer.ready; + writer + .write(bytes) + .then(async () => { + await writer.ready; + await writer.close(); + }) + .catch(() => {}); + const chunks = []; + let totalLength = 0; + for await (const chunk of readable) { + chunks.push(chunk); + totalLength += chunk.byteLength; } - const n = new Uint8Array(r); - let g = 0; - for (const e of s) { - n.set(e, g); - g += e.byteLength; + const data = new Uint8Array(totalLength); + let offset = 0; + for (const chunk of chunks) { + data.set(chunk, offset); + offset += chunk.byteLength; } - return n; + return data; } catch { - this.str = new Stream(e, 2, e.length, this.str.dict); + this.str = new Stream(bytes, 2, bytes.length, this.str.dict); this.reset(); return null; } } get isAsync() { - return !0; + return true; } - getBits(e) { - const t = this.str; - let i, - a = this.codeSize, - s = this.codeBuf; - for (; a < e; ) { - if (-1 === (i = t.getByte())) + getBits(bits) { + const str = this.str; + let codeSize = this.codeSize; + let codeBuf = this.codeBuf; + let b; + while (codeSize < bits) { + if ((b = str.getByte()) === -1) { throw new FormatError("Bad encoding in flate stream"); - s |= i << a; - a += 8; + } + codeBuf |= b << codeSize; + codeSize += 8; } - i = s & ((1 << e) - 1); - this.codeBuf = s >> e; - this.codeSize = a -= e; - return i; + b = codeBuf & ((1 << bits) - 1); + this.codeBuf = codeBuf >> bits; + this.codeSize = codeSize -= bits; + return b; } - getCode(e) { - const t = this.str, - i = e[0], - a = e[1]; - let s, - r = this.codeSize, - n = this.codeBuf; - for (; r < a && -1 !== (s = t.getByte()); ) { - n |= s << r; - r += 8; + getCode(table) { + const str = this.str; + const codes = table[0]; + const maxLen = table[1]; + let codeSize = this.codeSize; + let codeBuf = this.codeBuf; + let b; + while (codeSize < maxLen) { + if ((b = str.getByte()) === -1) { + break; + } + codeBuf |= b << codeSize; + codeSize += 8; } - const g = i[n & ((1 << a) - 1)], - o = g >> 16, - c = 65535 & g; - if (o < 1 || r < o) throw new FormatError("Bad encoding in flate stream"); - this.codeBuf = n >> o; - this.codeSize = r - o; - return c; + const code = codes[codeBuf & ((1 << maxLen) - 1)]; + const codeLen = code >> 16; + const codeVal = code & 0xffff; + if (codeLen < 1 || codeSize < codeLen) { + throw new FormatError("Bad encoding in flate stream"); + } + this.codeBuf = codeBuf >> codeLen; + this.codeSize = codeSize - codeLen; + return codeVal; } - generateHuffmanTable(e) { - const t = e.length; - let i, - a = 0; - for (i = 0; i < t; ++i) e[i] > a && (a = e[i]); - const s = 1 << a, - r = new Int32Array(s); - for (let n = 1, g = 0, o = 2; n <= a; ++n, g <<= 1, o <<= 1) - for (let a = 0; a < t; ++a) - if (e[a] === n) { - let e = 0, - t = g; - for (i = 0; i < n; ++i) { - e = (e << 1) | (1 & t); + generateHuffmanTable(lengths) { + const n = lengths.length; + let maxLen = 0; + let i; + for (i = 0; i < n; ++i) { + if (lengths[i] > maxLen) { + maxLen = lengths[i]; + } + } + const size = 1 << maxLen; + const codes = new Int32Array(size); + for ( + let len = 1, code = 0, skip = 2; + len <= maxLen; + ++len, code <<= 1, skip <<= 1 + ) { + for (let val = 0; val < n; ++val) { + if (lengths[val] === len) { + let code2 = 0; + let t = code; + for (i = 0; i < len; ++i) { + code2 = (code2 << 1) | (t & 1); t >>= 1; } - for (i = e; i < s; i += o) r[i] = (n << 16) | a; - ++g; + for (i = code2; i < size; i += skip) { + codes[i] = (len << 16) | val; + } + ++code; } - return [r, a]; + } + } + return [codes, maxLen]; } - #m(e) { - info(e); - this.eof = !0; + #endsStreamOnError(err) { + info(err); + this.eof = true; } readBlock() { - let e, t, i; - const a = this.str; + let buffer, hdr, len; + const str = this.str; try { - t = this.getBits(3); - } catch (e) { - this.#m(e.message); + hdr = this.getBits(3); + } catch (ex) { + this.#endsStreamOnError(ex.message); return; } - 1 & t && (this.eof = !0); - t >>= 1; - if (0 === t) { - let t; - if (-1 === (t = a.getByte())) { - this.#m("Bad block header in flate stream"); + if (hdr & 1) { + this.eof = true; + } + hdr >>= 1; + if (hdr === 0) { + let b; + if ((b = str.getByte()) === -1) { + this.#endsStreamOnError("Bad block header in flate stream"); return; } - let i = t; - if (-1 === (t = a.getByte())) { - this.#m("Bad block header in flate stream"); + let blockLen = b; + if ((b = str.getByte()) === -1) { + this.#endsStreamOnError("Bad block header in flate stream"); return; } - i |= t << 8; - if (-1 === (t = a.getByte())) { - this.#m("Bad block header in flate stream"); + blockLen |= b << 8; + if ((b = str.getByte()) === -1) { + this.#endsStreamOnError("Bad block header in flate stream"); return; } - let s = t; - if (-1 === (t = a.getByte())) { - this.#m("Bad block header in flate stream"); + let check = b; + if ((b = str.getByte()) === -1) { + this.#endsStreamOnError("Bad block header in flate stream"); return; } - s |= t << 8; - if (s !== (65535 & ~i) && (0 !== i || 0 !== s)) + check |= b << 8; + if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) { throw new FormatError("Bad uncompressed block length in flate stream"); + } this.codeBuf = 0; this.codeSize = 0; - const r = this.bufferLength, - n = r + i; - e = this.ensureBuffer(n); - this.bufferLength = n; - if (0 === i) -1 === a.peekByte() && (this.eof = !0); - else { - const t = a.getBytes(i); - e.set(t, r); - t.length < i && (this.eof = !0); + const bufferLength = this.bufferLength, + end = bufferLength + blockLen; + buffer = this.ensureBuffer(end); + this.bufferLength = end; + if (blockLen === 0) { + if (str.peekByte() === -1) { + this.eof = true; + } + } else { + const block = str.getBytes(blockLen); + buffer.set(block, bufferLength); + if (block.length < blockLen) { + this.eof = true; + } } return; } - let s, r; - if (1 === t) { - s = Kt; - r = Tt; - } else { - if (2 !== t) throw new FormatError("Unknown block type in flate stream"); - { - const e = this.getBits(5) + 257, - t = this.getBits(5) + 1, - a = this.getBits(4) + 4, - n = new Uint8Array(Jt.length); - let g; - for (g = 0; g < a; ++g) n[Jt[g]] = this.getBits(3); - const o = this.generateHuffmanTable(n); - i = 0; - g = 0; - const c = e + t, - C = new Uint8Array(c); - let h, l, Q; - for (; g < c; ) { - const e = this.getCode(o); - if (16 === e) { - h = 2; - l = 3; - Q = i; - } else if (17 === e) { - h = 3; - l = 3; - Q = i = 0; - } else { - if (18 !== e) { - C[g++] = i = e; - continue; - } - h = 7; - l = 11; - Q = i = 0; - } - let t = this.getBits(h) + l; - for (; t-- > 0; ) C[g++] = Q; - } - s = this.generateHuffmanTable(C.subarray(0, e)); - r = this.generateHuffmanTable(C.subarray(e, c)); + let litCodeTable; + let distCodeTable; + if (hdr === 1) { + litCodeTable = fixedLitCodeTab; + distCodeTable = fixedDistCodeTab; + } else if (hdr === 2) { + const numLitCodes = this.getBits(5) + 257; + const numDistCodes = this.getBits(5) + 1; + const numCodeLenCodes = this.getBits(4) + 4; + const codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length); + let i; + for (i = 0; i < numCodeLenCodes; ++i) { + codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3); } - } - e = this.buffer; - let n = e ? e.length : 0, - g = this.bufferLength; - for (;;) { - let t = this.getCode(s); - if (t < 256) { - if (g + 1 >= n) { - e = this.ensureBuffer(g + 1); - n = e.length; + const codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths); + len = 0; + i = 0; + const codes = numLitCodes + numDistCodes; + const codeLengths = new Uint8Array(codes); + let bitsLength, bitsOffset, what; + while (i < codes) { + const code = this.getCode(codeLenCodeTab); + if (code === 16) { + bitsLength = 2; + bitsOffset = 3; + what = len; + } else if (code === 17) { + bitsLength = 3; + bitsOffset = 3; + what = len = 0; + } else if (code === 18) { + bitsLength = 7; + bitsOffset = 11; + what = len = 0; + } else { + codeLengths[i++] = len = code; + continue; } - e[g++] = t; + let repeatLength = this.getBits(bitsLength) + bitsOffset; + while (repeatLength-- > 0) { + codeLengths[i++] = what; + } + } + litCodeTable = this.generateHuffmanTable( + codeLengths.subarray(0, numLitCodes), + ); + distCodeTable = this.generateHuffmanTable( + codeLengths.subarray(numLitCodes, codes), + ); + } else { + throw new FormatError("Unknown block type in flate stream"); + } + buffer = this.buffer; + let limit = buffer ? buffer.length : 0; + let pos = this.bufferLength; + while (true) { + let code1 = this.getCode(litCodeTable); + if (code1 < 256) { + if (pos + 1 >= limit) { + buffer = this.ensureBuffer(pos + 1); + limit = buffer.length; + } + buffer[pos++] = code1; continue; } - if (256 === t) { - this.bufferLength = g; + if (code1 === 256) { + this.bufferLength = pos; return; } - t -= 257; - t = Yt[t]; - let a = t >> 16; - a > 0 && (a = this.getBits(a)); - i = (65535 & t) + a; - t = this.getCode(r); - t = vt[t]; - a = t >> 16; - a > 0 && (a = this.getBits(a)); - const o = (65535 & t) + a; - if (g + i >= n) { - e = this.ensureBuffer(g + i); - n = e.length; + code1 -= 257; + code1 = lengthDecode[code1]; + let code2 = code1 >> 16; + if (code2 > 0) { + code2 = this.getBits(code2); + } + len = (code1 & 0xffff) + code2; + code1 = this.getCode(distCodeTable); + code1 = distDecode[code1]; + code2 = code1 >> 16; + if (code2 > 0) { + code2 = this.getBits(code2); + } + const dist = (code1 & 0xffff) + code2; + if (pos + len >= limit) { + buffer = this.ensureBuffer(pos + len); + limit = buffer.length; + } + for (let k = 0; k < len; ++k, ++pos) { + buffer[pos] = buffer[pos - dist]; } - for (let t = 0; t < i; ++t, ++g) e[g] = e[g - o]; } } -} -const qt = [ - { qe: 22017, nmps: 1, nlps: 1, switchFlag: 1 }, - { qe: 13313, nmps: 2, nlps: 6, switchFlag: 0 }, - { qe: 6145, nmps: 3, nlps: 9, switchFlag: 0 }, - { qe: 2753, nmps: 4, nlps: 12, switchFlag: 0 }, - { qe: 1313, nmps: 5, nlps: 29, switchFlag: 0 }, - { qe: 545, nmps: 38, nlps: 33, switchFlag: 0 }, - { qe: 22017, nmps: 7, nlps: 6, switchFlag: 1 }, - { qe: 21505, nmps: 8, nlps: 14, switchFlag: 0 }, - { qe: 18433, nmps: 9, nlps: 14, switchFlag: 0 }, - { qe: 14337, nmps: 10, nlps: 14, switchFlag: 0 }, - { qe: 12289, nmps: 11, nlps: 17, switchFlag: 0 }, - { qe: 9217, nmps: 12, nlps: 18, switchFlag: 0 }, - { qe: 7169, nmps: 13, nlps: 20, switchFlag: 0 }, - { qe: 5633, nmps: 29, nlps: 21, switchFlag: 0 }, - { qe: 22017, nmps: 15, nlps: 14, switchFlag: 1 }, - { qe: 21505, nmps: 16, nlps: 14, switchFlag: 0 }, - { qe: 20737, nmps: 17, nlps: 15, switchFlag: 0 }, - { qe: 18433, nmps: 18, nlps: 16, switchFlag: 0 }, - { qe: 14337, nmps: 19, nlps: 17, switchFlag: 0 }, - { qe: 13313, nmps: 20, nlps: 18, switchFlag: 0 }, - { qe: 12289, nmps: 21, nlps: 19, switchFlag: 0 }, - { qe: 10241, nmps: 22, nlps: 19, switchFlag: 0 }, - { qe: 9217, nmps: 23, nlps: 20, switchFlag: 0 }, - { qe: 8705, nmps: 24, nlps: 21, switchFlag: 0 }, - { qe: 7169, nmps: 25, nlps: 22, switchFlag: 0 }, - { qe: 6145, nmps: 26, nlps: 23, switchFlag: 0 }, - { qe: 5633, nmps: 27, nlps: 24, switchFlag: 0 }, - { qe: 5121, nmps: 28, nlps: 25, switchFlag: 0 }, - { qe: 4609, nmps: 29, nlps: 26, switchFlag: 0 }, - { qe: 4353, nmps: 30, nlps: 27, switchFlag: 0 }, - { qe: 2753, nmps: 31, nlps: 28, switchFlag: 0 }, - { qe: 2497, nmps: 32, nlps: 29, switchFlag: 0 }, - { qe: 2209, nmps: 33, nlps: 30, switchFlag: 0 }, - { qe: 1313, nmps: 34, nlps: 31, switchFlag: 0 }, - { qe: 1089, nmps: 35, nlps: 32, switchFlag: 0 }, - { qe: 673, nmps: 36, nlps: 33, switchFlag: 0 }, - { qe: 545, nmps: 37, nlps: 34, switchFlag: 0 }, - { qe: 321, nmps: 38, nlps: 35, switchFlag: 0 }, - { qe: 273, nmps: 39, nlps: 36, switchFlag: 0 }, - { qe: 133, nmps: 40, nlps: 37, switchFlag: 0 }, - { qe: 73, nmps: 41, nlps: 38, switchFlag: 0 }, - { qe: 37, nmps: 42, nlps: 39, switchFlag: 0 }, - { qe: 21, nmps: 43, nlps: 40, switchFlag: 0 }, - { qe: 9, nmps: 44, nlps: 41, switchFlag: 0 }, - { qe: 5, nmps: 45, nlps: 42, switchFlag: 0 }, - { qe: 1, nmps: 45, nlps: 43, switchFlag: 0 }, - { qe: 22017, nmps: 46, nlps: 46, switchFlag: 0 }, +} // ./src/core/arithmetic_decoder.js + +const QeTable = [ + { + qe: 0x5601, + nmps: 1, + nlps: 1, + switchFlag: 1, + }, + { + qe: 0x3401, + nmps: 2, + nlps: 6, + switchFlag: 0, + }, + { + qe: 0x1801, + nmps: 3, + nlps: 9, + switchFlag: 0, + }, + { + qe: 0x0ac1, + nmps: 4, + nlps: 12, + switchFlag: 0, + }, + { + qe: 0x0521, + nmps: 5, + nlps: 29, + switchFlag: 0, + }, + { + qe: 0x0221, + nmps: 38, + nlps: 33, + switchFlag: 0, + }, + { + qe: 0x5601, + nmps: 7, + nlps: 6, + switchFlag: 1, + }, + { + qe: 0x5401, + nmps: 8, + nlps: 14, + switchFlag: 0, + }, + { + qe: 0x4801, + nmps: 9, + nlps: 14, + switchFlag: 0, + }, + { + qe: 0x3801, + nmps: 10, + nlps: 14, + switchFlag: 0, + }, + { + qe: 0x3001, + nmps: 11, + nlps: 17, + switchFlag: 0, + }, + { + qe: 0x2401, + nmps: 12, + nlps: 18, + switchFlag: 0, + }, + { + qe: 0x1c01, + nmps: 13, + nlps: 20, + switchFlag: 0, + }, + { + qe: 0x1601, + nmps: 29, + nlps: 21, + switchFlag: 0, + }, + { + qe: 0x5601, + nmps: 15, + nlps: 14, + switchFlag: 1, + }, + { + qe: 0x5401, + nmps: 16, + nlps: 14, + switchFlag: 0, + }, + { + qe: 0x5101, + nmps: 17, + nlps: 15, + switchFlag: 0, + }, + { + qe: 0x4801, + nmps: 18, + nlps: 16, + switchFlag: 0, + }, + { + qe: 0x3801, + nmps: 19, + nlps: 17, + switchFlag: 0, + }, + { + qe: 0x3401, + nmps: 20, + nlps: 18, + switchFlag: 0, + }, + { + qe: 0x3001, + nmps: 21, + nlps: 19, + switchFlag: 0, + }, + { + qe: 0x2801, + nmps: 22, + nlps: 19, + switchFlag: 0, + }, + { + qe: 0x2401, + nmps: 23, + nlps: 20, + switchFlag: 0, + }, + { + qe: 0x2201, + nmps: 24, + nlps: 21, + switchFlag: 0, + }, + { + qe: 0x1c01, + nmps: 25, + nlps: 22, + switchFlag: 0, + }, + { + qe: 0x1801, + nmps: 26, + nlps: 23, + switchFlag: 0, + }, + { + qe: 0x1601, + nmps: 27, + nlps: 24, + switchFlag: 0, + }, + { + qe: 0x1401, + nmps: 28, + nlps: 25, + switchFlag: 0, + }, + { + qe: 0x1201, + nmps: 29, + nlps: 26, + switchFlag: 0, + }, + { + qe: 0x1101, + nmps: 30, + nlps: 27, + switchFlag: 0, + }, + { + qe: 0x0ac1, + nmps: 31, + nlps: 28, + switchFlag: 0, + }, + { + qe: 0x09c1, + nmps: 32, + nlps: 29, + switchFlag: 0, + }, + { + qe: 0x08a1, + nmps: 33, + nlps: 30, + switchFlag: 0, + }, + { + qe: 0x0521, + nmps: 34, + nlps: 31, + switchFlag: 0, + }, + { + qe: 0x0441, + nmps: 35, + nlps: 32, + switchFlag: 0, + }, + { + qe: 0x02a1, + nmps: 36, + nlps: 33, + switchFlag: 0, + }, + { + qe: 0x0221, + nmps: 37, + nlps: 34, + switchFlag: 0, + }, + { + qe: 0x0141, + nmps: 38, + nlps: 35, + switchFlag: 0, + }, + { + qe: 0x0111, + nmps: 39, + nlps: 36, + switchFlag: 0, + }, + { + qe: 0x0085, + nmps: 40, + nlps: 37, + switchFlag: 0, + }, + { + qe: 0x0049, + nmps: 41, + nlps: 38, + switchFlag: 0, + }, + { + qe: 0x0025, + nmps: 42, + nlps: 39, + switchFlag: 0, + }, + { + qe: 0x0015, + nmps: 43, + nlps: 40, + switchFlag: 0, + }, + { + qe: 0x0009, + nmps: 44, + nlps: 41, + switchFlag: 0, + }, + { + qe: 0x0005, + nmps: 45, + nlps: 42, + switchFlag: 0, + }, + { + qe: 0x0001, + nmps: 45, + nlps: 43, + switchFlag: 0, + }, + { + qe: 0x5601, + nmps: 46, + nlps: 46, + switchFlag: 0, + }, ]; class ArithmeticDecoder { - constructor(e, t, i) { - this.data = e; - this.bp = t; - this.dataEnd = i; - this.chigh = e[t]; + constructor(data, start, end) { + this.data = data; + this.bp = start; + this.dataEnd = end; + this.chigh = data[start]; this.clow = 0; this.byteIn(); - this.chigh = ((this.chigh << 7) & 65535) | ((this.clow >> 9) & 127); - this.clow = (this.clow << 7) & 65535; + this.chigh = ((this.chigh << 7) & 0xffff) | ((this.clow >> 9) & 0x7f); + this.clow = (this.clow << 7) & 0xffff; this.ct -= 7; - this.a = 32768; + this.a = 0x8000; } byteIn() { - const e = this.data; - let t = this.bp; - if (255 === e[t]) - if (e[t + 1] > 143) { - this.clow += 65280; + const data = this.data; + let bp = this.bp; + if (data[bp] === 0xff) { + if (data[bp + 1] > 0x8f) { + this.clow += 0xff00; this.ct = 8; } else { - t++; - this.clow += e[t] << 9; + bp++; + this.clow += data[bp] << 9; this.ct = 7; - this.bp = t; + this.bp = bp; } - else { - t++; - this.clow += t < this.dataEnd ? e[t] << 8 : 65280; + } else { + bp++; + this.clow += bp < this.dataEnd ? data[bp] << 8 : 0xff00; this.ct = 8; - this.bp = t; + this.bp = bp; } - if (this.clow > 65535) { + if (this.clow > 0xffff) { this.chigh += this.clow >> 16; - this.clow &= 65535; + this.clow &= 0xffff; } } - readBit(e, t) { - let i = e[t] >> 1, - a = 1 & e[t]; - const s = qt[i], - r = s.qe; - let n, - g = this.a - r; - if (this.chigh < r) - if (g < r) { - g = r; - n = a; - i = s.nmps; + readBit(contexts, pos) { + let cx_index = contexts[pos] >> 1, + cx_mps = contexts[pos] & 1; + const qeTableIcx = QeTable[cx_index]; + const qeIcx = qeTableIcx.qe; + let d; + let a = this.a - qeIcx; + if (this.chigh < qeIcx) { + if (a < qeIcx) { + a = qeIcx; + d = cx_mps; + cx_index = qeTableIcx.nmps; } else { - g = r; - n = 1 ^ a; - 1 === s.switchFlag && (a = n); - i = s.nlps; + a = qeIcx; + d = 1 ^ cx_mps; + if (qeTableIcx.switchFlag === 1) { + cx_mps = d; + } + cx_index = qeTableIcx.nlps; } - else { - this.chigh -= r; - if (0 != (32768 & g)) { - this.a = g; - return a; + } else { + this.chigh -= qeIcx; + if ((a & 0x8000) !== 0) { + this.a = a; + return cx_mps; } - if (g < r) { - n = 1 ^ a; - 1 === s.switchFlag && (a = n); - i = s.nlps; + if (a < qeIcx) { + d = 1 ^ cx_mps; + if (qeTableIcx.switchFlag === 1) { + cx_mps = d; + } + cx_index = qeTableIcx.nlps; } else { - n = a; - i = s.nmps; + d = cx_mps; + cx_index = qeTableIcx.nmps; } } do { - 0 === this.ct && this.byteIn(); - g <<= 1; - this.chigh = ((this.chigh << 1) & 65535) | ((this.clow >> 15) & 1); - this.clow = (this.clow << 1) & 65535; + if (this.ct === 0) { + this.byteIn(); + } + a <<= 1; + this.chigh = ((this.chigh << 1) & 0xffff) | ((this.clow >> 15) & 1); + this.clow = (this.clow << 1) & 0xffff; this.ct--; - } while (0 == (32768 & g)); - this.a = g; - e[t] = (i << 1) | a; - return n; + } while ((a & 0x8000) === 0); + this.a = a; + contexts[pos] = (cx_index << 1) | cx_mps; + return d; } -} -class Jbig2Error extends rt { - constructor(e) { - super(e, "Jbig2Error"); +} // ./src/core/jbig2.js + +class Jbig2Error extends BaseException { + constructor(msg) { + super(msg, "Jbig2Error"); } } class ContextCache { - getContexts(e) { - return e in this ? this[e] : (this[e] = new Int8Array(65536)); + getContexts(id) { + if (id in this) { + return this[id]; + } + return (this[id] = new Int8Array(1 << 16)); } } class DecodingContext { - constructor(e, t, i) { - this.data = e; - this.start = t; - this.end = i; + constructor(data, start, end) { + this.data = data; + this.start = start; + this.end = end; } get decoder() { - return shadow( - this, - "decoder", - new ArithmeticDecoder(this.data, this.start, this.end), - ); + const decoder = new ArithmeticDecoder(this.data, this.start, this.end); + return shadow(this, "decoder", decoder); } get contextCache() { - return shadow(this, "contextCache", new ContextCache()); + const cache = new ContextCache(); + return shadow(this, "contextCache", cache); } } -const Ot = 2 ** 31 - 1, - Pt = -(2 ** 31); -function decodeInteger(e, t, i) { - const a = e.getContexts(t); - let s = 1; - function readBits(e) { - let t = 0; - for (let r = 0; r < e; r++) { - const e = i.readBit(a, s); - s = s < 256 ? (s << 1) | e : (511 & ((s << 1) | e)) | 256; - t = (t << 1) | e; +const MAX_INT_32 = 2 ** 31 - 1; +const MIN_INT_32 = -(2 ** 31); +function decodeInteger(contextCache, procedure, decoder) { + const contexts = contextCache.getContexts(procedure); + let prev = 1; + function readBits(length) { + let v = 0; + for (let i = 0; i < length; i++) { + const bit = decoder.readBit(contexts, prev); + prev = prev < 256 ? (prev << 1) | bit : (((prev << 1) | bit) & 511) | 256; + v = (v << 1) | bit; } - return t >>> 0; + return v >>> 0; } - const r = readBits(1), - n = readBits(1) + const sign = readBits(1); + const value = readBits(1) + ? readBits(1) ? readBits(1) ? readBits(1) ? readBits(1) - ? readBits(1) - ? readBits(32) + 4436 - : readBits(12) + 340 - : readBits(8) + 84 - : readBits(6) + 20 - : readBits(4) + 4 - : readBits(2); - let g; - 0 === r ? (g = n) : n > 0 && (g = -n); - return g >= Pt && g <= Ot ? g : null; -} -function decodeIAID(e, t, i) { - const a = e.getContexts("IAID"); - let s = 1; - for (let e = 0; e < i; e++) { - s = (s << 1) | t.readBit(a, s); + ? readBits(32) + 4436 + : readBits(12) + 340 + : readBits(8) + 84 + : readBits(6) + 20 + : readBits(4) + 4 + : readBits(2); + let signedValue; + if (sign === 0) { + signedValue = value; + } else if (value > 0) { + signedValue = -value; } - return i < 31 ? s & ((1 << i) - 1) : 2147483647 & s; + if (signedValue >= MIN_INT_32 && signedValue <= MAX_INT_32) { + return signedValue; + } + return null; } -const Wt = [ - "SymbolDictionary", - null, - null, - null, - "IntermediateTextRegion", - null, - "ImmediateTextRegion", - "ImmediateLosslessTextRegion", - null, - null, - null, - null, - null, - null, - null, - null, - "PatternDictionary", - null, - null, - null, - "IntermediateHalftoneRegion", - null, - "ImmediateHalftoneRegion", - "ImmediateLosslessHalftoneRegion", - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - "IntermediateGenericRegion", - null, - "ImmediateGenericRegion", - "ImmediateLosslessGenericRegion", - "IntermediateGenericRefinementRegion", - null, - "ImmediateGenericRefinementRegion", - "ImmediateLosslessGenericRefinementRegion", - null, - null, - null, - null, - "PageInformation", - "EndOfPage", - "EndOfStripe", - "EndOfFile", - "Profiles", - "Tables", - null, - null, - null, - null, - null, - null, - null, - null, - "Extension", - ], - jt = [ - [ - { x: -1, y: -2 }, - { x: 0, y: -2 }, - { x: 1, y: -2 }, - { x: -2, y: -1 }, - { x: -1, y: -1 }, - { x: 0, y: -1 }, - { x: 1, y: -1 }, - { x: 2, y: -1 }, - { x: -4, y: 0 }, - { x: -3, y: 0 }, - { x: -2, y: 0 }, - { x: -1, y: 0 }, - ], - [ - { x: -1, y: -2 }, - { x: 0, y: -2 }, - { x: 1, y: -2 }, - { x: 2, y: -2 }, - { x: -2, y: -1 }, - { x: -1, y: -1 }, - { x: 0, y: -1 }, - { x: 1, y: -1 }, - { x: 2, y: -1 }, - { x: -3, y: 0 }, - { x: -2, y: 0 }, - { x: -1, y: 0 }, - ], - [ - { x: -1, y: -2 }, - { x: 0, y: -2 }, - { x: 1, y: -2 }, - { x: -2, y: -1 }, - { x: -1, y: -1 }, - { x: 0, y: -1 }, - { x: 1, y: -1 }, - { x: -2, y: 0 }, - { x: -1, y: 0 }, - ], - [ - { x: -3, y: -1 }, - { x: -2, y: -1 }, - { x: -1, y: -1 }, - { x: 0, y: -1 }, - { x: 1, y: -1 }, - { x: -4, y: 0 }, - { x: -3, y: 0 }, - { x: -2, y: 0 }, - { x: -1, y: 0 }, - ], - ], - Xt = [ +function decodeIAID(contextCache, decoder, codeLength) { + const contexts = contextCache.getContexts("IAID"); + let prev = 1; + for (let i = 0; i < codeLength; i++) { + const bit = decoder.readBit(contexts, prev); + prev = (prev << 1) | bit; + } + if (codeLength < 31) { + return prev & ((1 << codeLength) - 1); + } + return prev & 0x7fffffff; +} +const SegmentTypes = [ + "SymbolDictionary", + null, + null, + null, + "IntermediateTextRegion", + null, + "ImmediateTextRegion", + "ImmediateLosslessTextRegion", + null, + null, + null, + null, + null, + null, + null, + null, + "PatternDictionary", + null, + null, + null, + "IntermediateHalftoneRegion", + null, + "ImmediateHalftoneRegion", + "ImmediateLosslessHalftoneRegion", + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + "IntermediateGenericRegion", + null, + "ImmediateGenericRegion", + "ImmediateLosslessGenericRegion", + "IntermediateGenericRefinementRegion", + null, + "ImmediateGenericRefinementRegion", + "ImmediateLosslessGenericRefinementRegion", + null, + null, + null, + null, + "PageInformation", + "EndOfPage", + "EndOfStripe", + "EndOfFile", + "Profiles", + "Tables", + null, + null, + null, + null, + null, + null, + null, + null, + "Extension", +]; +const CodingTemplates = [ + [ { - coding: [ - { x: 0, y: -1 }, - { x: 1, y: -1 }, - { x: -1, y: 0 }, - ], - reference: [ - { x: 0, y: -1 }, - { x: 1, y: -1 }, - { x: -1, y: 0 }, - { x: 0, y: 0 }, - { x: 1, y: 0 }, - { x: -1, y: 1 }, - { x: 0, y: 1 }, - { x: 1, y: 1 }, - ], + x: -1, + y: -2, }, { - coding: [ - { x: -1, y: -1 }, - { x: 0, y: -1 }, - { x: 1, y: -1 }, - { x: -1, y: 0 }, - ], - reference: [ - { x: 0, y: -1 }, - { x: -1, y: 0 }, - { x: 0, y: 0 }, - { x: 1, y: 0 }, - { x: 0, y: 1 }, - { x: 1, y: 1 }, - ], + x: 0, + y: -2, + }, + { + x: 1, + y: -2, + }, + { + x: -2, + y: -1, + }, + { + x: -1, + y: -1, + }, + { + x: 0, + y: -1, + }, + { + x: 1, + y: -1, + }, + { + x: 2, + y: -1, + }, + { + x: -4, + y: 0, + }, + { + x: -3, + y: 0, + }, + { + x: -2, + y: 0, + }, + { + x: -1, + y: 0, }, ], - Zt = [39717, 1941, 229, 405], - Vt = [32, 8]; -function decodeBitmap(e, t, i, a, s, r, n, g) { - if (e) { - return decodeMMRBitmap(new Reader(g.data, g.start, g.end), t, i, !1); + [ + { + x: -1, + y: -2, + }, + { + x: 0, + y: -2, + }, + { + x: 1, + y: -2, + }, + { + x: 2, + y: -2, + }, + { + x: -2, + y: -1, + }, + { + x: -1, + y: -1, + }, + { + x: 0, + y: -1, + }, + { + x: 1, + y: -1, + }, + { + x: 2, + y: -1, + }, + { + x: -3, + y: 0, + }, + { + x: -2, + y: 0, + }, + { + x: -1, + y: 0, + }, + ], + [ + { + x: -1, + y: -2, + }, + { + x: 0, + y: -2, + }, + { + x: 1, + y: -2, + }, + { + x: -2, + y: -1, + }, + { + x: -1, + y: -1, + }, + { + x: 0, + y: -1, + }, + { + x: 1, + y: -1, + }, + { + x: -2, + y: 0, + }, + { + x: -1, + y: 0, + }, + ], + [ + { + x: -3, + y: -1, + }, + { + x: -2, + y: -1, + }, + { + x: -1, + y: -1, + }, + { + x: 0, + y: -1, + }, + { + x: 1, + y: -1, + }, + { + x: -4, + y: 0, + }, + { + x: -3, + y: 0, + }, + { + x: -2, + y: 0, + }, + { + x: -1, + y: 0, + }, + ], +]; +const RefinementTemplates = [ + { + coding: [ + { + x: 0, + y: -1, + }, + { + x: 1, + y: -1, + }, + { + x: -1, + y: 0, + }, + ], + reference: [ + { + x: 0, + y: -1, + }, + { + x: 1, + y: -1, + }, + { + x: -1, + y: 0, + }, + { + x: 0, + y: 0, + }, + { + x: 1, + y: 0, + }, + { + x: -1, + y: 1, + }, + { + x: 0, + y: 1, + }, + { + x: 1, + y: 1, + }, + ], + }, + { + coding: [ + { + x: -1, + y: -1, + }, + { + x: 0, + y: -1, + }, + { + x: 1, + y: -1, + }, + { + x: -1, + y: 0, + }, + ], + reference: [ + { + x: 0, + y: -1, + }, + { + x: -1, + y: 0, + }, + { + x: 0, + y: 0, + }, + { + x: 1, + y: 0, + }, + { + x: 0, + y: 1, + }, + { + x: 1, + y: 1, + }, + ], + }, +]; +const ReusedContexts = [0x9b25, 0x0795, 0x00e5, 0x0195]; +const RefinementReusedContexts = [0x0020, 0x0008]; +function decodeBitmapTemplate0(width, height, decodingContext) { + const decoder = decodingContext.decoder; + const contexts = decodingContext.contextCache.getContexts("GB"); + const bitmap = []; + let contextLabel, i, j, pixel, row, row1, row2; + const OLD_PIXEL_MASK = 0x7bf7; + for (i = 0; i < height; i++) { + row = bitmap[i] = new Uint8Array(width); + row1 = i < 1 ? row : bitmap[i - 1]; + row2 = i < 2 ? row : bitmap[i - 2]; + contextLabel = + (row2[0] << 13) | + (row2[1] << 12) | + (row2[2] << 11) | + (row1[0] << 7) | + (row1[1] << 6) | + (row1[2] << 5) | + (row1[3] << 4); + for (j = 0; j < width; j++) { + row[j] = pixel = decoder.readBit(contexts, contextLabel); + contextLabel = + ((contextLabel & OLD_PIXEL_MASK) << 1) | + (j + 3 < width ? row2[j + 3] << 11 : 0) | + (j + 4 < width ? row1[j + 4] << 4 : 0) | + pixel; + } + } + return bitmap; +} +function decodeBitmap( + mmr, + width, + height, + templateIndex, + prediction, + skip, + at, + decodingContext, +) { + if (mmr) { + const input = new Reader( + decodingContext.data, + decodingContext.start, + decodingContext.end, + ); + return decodeMMRBitmap(input, width, height, false); } if ( - 0 === a && - !r && - !s && - 4 === n.length && - 3 === n[0].x && - -1 === n[0].y && - -3 === n[1].x && - -1 === n[1].y && - 2 === n[2].x && - -2 === n[2].y && - -2 === n[3].x && - -2 === n[3].y - ) - return (function decodeBitmapTemplate0(e, t, i) { - const a = i.decoder, - s = i.contextCache.getContexts("GB"), - r = []; - let n, g, o, c, C, h, l; - for (g = 0; g < t; g++) { - C = r[g] = new Uint8Array(e); - h = g < 1 ? C : r[g - 1]; - l = g < 2 ? C : r[g - 2]; - n = - (l[0] << 13) | - (l[1] << 12) | - (l[2] << 11) | - (h[0] << 7) | - (h[1] << 6) | - (h[2] << 5) | - (h[3] << 4); - for (o = 0; o < e; o++) { - C[o] = c = a.readBit(s, n); - n = - ((31735 & n) << 1) | - (o + 3 < e ? l[o + 3] << 11 : 0) | - (o + 4 < e ? h[o + 4] << 4 : 0) | - c; - } - } - return r; - })(t, i, g); - const o = !!r, - c = jt[a].concat(n); - c.sort(function (e, t) { - return e.y - t.y || e.x - t.x; + templateIndex === 0 && + !skip && + !prediction && + at.length === 4 && + at[0].x === 3 && + at[0].y === -1 && + at[1].x === -3 && + at[1].y === -1 && + at[2].x === 2 && + at[2].y === -2 && + at[3].x === -2 && + at[3].y === -2 + ) { + return decodeBitmapTemplate0(width, height, decodingContext); + } + const useskip = !!skip; + const template = CodingTemplates[templateIndex].concat(at); + template.sort(function (a, b) { + return a.y - b.y || a.x - b.x; }); - const C = c.length, - h = new Int8Array(C), - l = new Int8Array(C), - Q = []; - let E, - u, - d = 0, - f = 0, - p = 0, - m = 0; - for (u = 0; u < C; u++) { - h[u] = c[u].x; - l[u] = c[u].y; - f = Math.min(f, c[u].x); - p = Math.max(p, c[u].x); - m = Math.min(m, c[u].y); - u < C - 1 && c[u].y === c[u + 1].y && c[u].x === c[u + 1].x - 1 - ? (d |= 1 << (C - 1 - u)) - : Q.push(u); + const templateLength = template.length; + const templateX = new Int8Array(templateLength); + const templateY = new Int8Array(templateLength); + const changingTemplateEntries = []; + let reuseMask = 0, + minX = 0, + maxX = 0, + minY = 0; + let c, k; + for (k = 0; k < templateLength; k++) { + templateX[k] = template[k].x; + templateY[k] = template[k].y; + minX = Math.min(minX, template[k].x); + maxX = Math.max(maxX, template[k].x); + minY = Math.min(minY, template[k].y); + if ( + k < templateLength - 1 && + template[k].y === template[k + 1].y && + template[k].x === template[k + 1].x - 1 + ) { + reuseMask |= 1 << (templateLength - 1 - k); + } else { + changingTemplateEntries.push(k); + } } - const y = Q.length, - w = new Int8Array(y), - D = new Int8Array(y), - b = new Uint16Array(y); - for (E = 0; E < y; E++) { - u = Q[E]; - w[E] = c[u].x; - D[E] = c[u].y; - b[E] = 1 << (C - 1 - u); + const changingEntriesLength = changingTemplateEntries.length; + const changingTemplateX = new Int8Array(changingEntriesLength); + const changingTemplateY = new Int8Array(changingEntriesLength); + const changingTemplateBit = new Uint16Array(changingEntriesLength); + for (c = 0; c < changingEntriesLength; c++) { + k = changingTemplateEntries[c]; + changingTemplateX[c] = template[k].x; + changingTemplateY[c] = template[k].y; + changingTemplateBit[c] = 1 << (templateLength - 1 - k); } - const F = -f, - S = -m, - k = t - p, - R = Zt[a]; - let N = new Uint8Array(t); - const G = [], - x = g.decoder, - U = g.contextCache.getContexts("GB"); - let M, - L, - H, - J, - Y, - v = 0, - K = 0; - for (let e = 0; e < i; e++) { - if (s) { - v ^= x.readBit(U, R); - if (v) { - G.push(N); + const sbb_left = -minX; + const sbb_top = -minY; + const sbb_right = width - maxX; + const pseudoPixelContext = ReusedContexts[templateIndex]; + let row = new Uint8Array(width); + const bitmap = []; + const decoder = decodingContext.decoder; + const contexts = decodingContext.contextCache.getContexts("GB"); + let ltp = 0, + j, + i0, + j0, + contextLabel = 0, + bit, + shift; + for (let i = 0; i < height; i++) { + if (prediction) { + const sltp = decoder.readBit(contexts, pseudoPixelContext); + ltp ^= sltp; + if (ltp) { + bitmap.push(row); continue; } } - N = new Uint8Array(N); - G.push(N); - for (M = 0; M < t; M++) { - if (o && r[e][M]) { - N[M] = 0; + row = new Uint8Array(row); + bitmap.push(row); + for (j = 0; j < width; j++) { + if (useskip && skip[i][j]) { + row[j] = 0; continue; } - if (M >= F && M < k && e >= S) { - K = (K << 1) & d; - for (u = 0; u < y; u++) { - L = e + D[u]; - H = M + w[u]; - J = G[L][H]; - if (J) { - J = b[u]; - K |= J; + if (j >= sbb_left && j < sbb_right && i >= sbb_top) { + contextLabel = (contextLabel << 1) & reuseMask; + for (k = 0; k < changingEntriesLength; k++) { + i0 = i + changingTemplateY[k]; + j0 = j + changingTemplateX[k]; + bit = bitmap[i0][j0]; + if (bit) { + bit = changingTemplateBit[k]; + contextLabel |= bit; } } } else { - K = 0; - Y = C - 1; - for (u = 0; u < C; u++, Y--) { - H = M + h[u]; - if (H >= 0 && H < t) { - L = e + l[u]; - if (L >= 0) { - J = G[L][H]; - J && (K |= J << Y); + contextLabel = 0; + shift = templateLength - 1; + for (k = 0; k < templateLength; k++, shift--) { + j0 = j + templateX[k]; + if (j0 >= 0 && j0 < width) { + i0 = i + templateY[k]; + if (i0 >= 0) { + bit = bitmap[i0][j0]; + if (bit) { + contextLabel |= bit << shift; + } } } } } - const i = x.readBit(U, K); - N[M] = i; + const pixel = decoder.readBit(contexts, contextLabel); + row[j] = pixel; } } - return G; + return bitmap; } -function decodeRefinement(e, t, i, a, s, r, n, g, o) { - let c = Xt[i].coding; - 0 === i && (c = c.concat([g[0]])); - const C = c.length, - h = new Int32Array(C), - l = new Int32Array(C); - let Q; - for (Q = 0; Q < C; Q++) { - h[Q] = c[Q].x; - l[Q] = c[Q].y; +function decodeRefinement( + width, + height, + templateIndex, + referenceBitmap, + offsetX, + offsetY, + prediction, + at, + decodingContext, +) { + let codingTemplate = RefinementTemplates[templateIndex].coding; + if (templateIndex === 0) { + codingTemplate = codingTemplate.concat([at[0]]); } - let E = Xt[i].reference; - 0 === i && (E = E.concat([g[1]])); - const u = E.length, - d = new Int32Array(u), - f = new Int32Array(u); - for (Q = 0; Q < u; Q++) { - d[Q] = E[Q].x; - f[Q] = E[Q].y; + const codingTemplateLength = codingTemplate.length; + const codingTemplateX = new Int32Array(codingTemplateLength); + const codingTemplateY = new Int32Array(codingTemplateLength); + let k; + for (k = 0; k < codingTemplateLength; k++) { + codingTemplateX[k] = codingTemplate[k].x; + codingTemplateY[k] = codingTemplate[k].y; } - const p = a[0].length, - m = a.length, - y = Vt[i], - w = [], - D = o.decoder, - b = o.contextCache.getContexts("GR"); - let F = 0; - for (let i = 0; i < t; i++) { - if (n) { - F ^= D.readBit(b, y); - if (F) throw new Jbig2Error("prediction is not supported"); + let referenceTemplate = RefinementTemplates[templateIndex].reference; + if (templateIndex === 0) { + referenceTemplate = referenceTemplate.concat([at[1]]); + } + const referenceTemplateLength = referenceTemplate.length; + const referenceTemplateX = new Int32Array(referenceTemplateLength); + const referenceTemplateY = new Int32Array(referenceTemplateLength); + for (k = 0; k < referenceTemplateLength; k++) { + referenceTemplateX[k] = referenceTemplate[k].x; + referenceTemplateY[k] = referenceTemplate[k].y; + } + const referenceWidth = referenceBitmap[0].length; + const referenceHeight = referenceBitmap.length; + const pseudoPixelContext = RefinementReusedContexts[templateIndex]; + const bitmap = []; + const decoder = decodingContext.decoder; + const contexts = decodingContext.contextCache.getContexts("GR"); + let ltp = 0; + for (let i = 0; i < height; i++) { + if (prediction) { + const sltp = decoder.readBit(contexts, pseudoPixelContext); + ltp ^= sltp; + if (ltp) { + throw new Jbig2Error("prediction is not supported"); + } } - const t = new Uint8Array(e); - w.push(t); - for (let n = 0; n < e; n++) { - let g, - o, - c = 0; - for (Q = 0; Q < C; Q++) { - g = i + l[Q]; - o = n + h[Q]; - g < 0 || o < 0 || o >= e ? (c <<= 1) : (c = (c << 1) | w[g][o]); + const row = new Uint8Array(width); + bitmap.push(row); + for (let j = 0; j < width; j++) { + let i0, j0; + let contextLabel = 0; + for (k = 0; k < codingTemplateLength; k++) { + i0 = i + codingTemplateY[k]; + j0 = j + codingTemplateX[k]; + if (i0 < 0 || j0 < 0 || j0 >= width) { + contextLabel <<= 1; + } else { + contextLabel = (contextLabel << 1) | bitmap[i0][j0]; + } } - for (Q = 0; Q < u; Q++) { - g = i + f[Q] - r; - o = n + d[Q] - s; - g < 0 || g >= m || o < 0 || o >= p - ? (c <<= 1) - : (c = (c << 1) | a[g][o]); + for (k = 0; k < referenceTemplateLength; k++) { + i0 = i + referenceTemplateY[k] - offsetY; + j0 = j + referenceTemplateX[k] - offsetX; + if (i0 < 0 || i0 >= referenceHeight || j0 < 0 || j0 >= referenceWidth) { + contextLabel <<= 1; + } else { + contextLabel = (contextLabel << 1) | referenceBitmap[i0][j0]; + } } - const E = D.readBit(b, c); - t[n] = E; + const pixel = decoder.readBit(contexts, contextLabel); + row[j] = pixel; } } - return w; + return bitmap; +} +function decodeSymbolDictionary( + huffman, + refinement, + symbols, + numberOfNewSymbols, + numberOfExportedSymbols, + huffmanTables, + templateIndex, + at, + refinementTemplateIndex, + refinementAt, + decodingContext, + huffmanInput, +) { + if (huffman && refinement) { + throw new Jbig2Error("symbol refinement with Huffman is not supported"); + } + const newSymbols = []; + let currentHeight = 0; + let symbolCodeLength = log2(symbols.length + numberOfNewSymbols); + const decoder = decodingContext.decoder; + const contextCache = decodingContext.contextCache; + let tableB1, symbolWidths; + if (huffman) { + tableB1 = getStandardTable(1); + symbolWidths = []; + symbolCodeLength = Math.max(symbolCodeLength, 1); + } + while (newSymbols.length < numberOfNewSymbols) { + const deltaHeight = huffman + ? huffmanTables.tableDeltaHeight.decode(huffmanInput) + : decodeInteger(contextCache, "IADH", decoder); + currentHeight += deltaHeight; + let currentWidth = 0, + totalWidth = 0; + const firstSymbol = huffman ? symbolWidths.length : 0; + while (true) { + const deltaWidth = huffman + ? huffmanTables.tableDeltaWidth.decode(huffmanInput) + : decodeInteger(contextCache, "IADW", decoder); + if (deltaWidth === null) { + break; + } + currentWidth += deltaWidth; + totalWidth += currentWidth; + let bitmap; + if (refinement) { + const numberOfInstances = decodeInteger(contextCache, "IAAI", decoder); + if (numberOfInstances > 1) { + bitmap = decodeTextRegion( + huffman, + refinement, + currentWidth, + currentHeight, + 0, + numberOfInstances, + 1, + symbols.concat(newSymbols), + symbolCodeLength, + 0, + 0, + 1, + 0, + huffmanTables, + refinementTemplateIndex, + refinementAt, + decodingContext, + 0, + huffmanInput, + ); + } else { + const symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); + const rdx = decodeInteger(contextCache, "IARDX", decoder); + const rdy = decodeInteger(contextCache, "IARDY", decoder); + const symbol = + symbolId < symbols.length + ? symbols[symbolId] + : newSymbols[symbolId - symbols.length]; + bitmap = decodeRefinement( + currentWidth, + currentHeight, + refinementTemplateIndex, + symbol, + rdx, + rdy, + false, + refinementAt, + decodingContext, + ); + } + newSymbols.push(bitmap); + } else if (huffman) { + symbolWidths.push(currentWidth); + } else { + bitmap = decodeBitmap( + false, + currentWidth, + currentHeight, + templateIndex, + false, + null, + at, + decodingContext, + ); + newSymbols.push(bitmap); + } + } + if (huffman && !refinement) { + const bitmapSize = huffmanTables.tableBitmapSize.decode(huffmanInput); + huffmanInput.byteAlign(); + let collectiveBitmap; + if (bitmapSize === 0) { + collectiveBitmap = readUncompressedBitmap( + huffmanInput, + totalWidth, + currentHeight, + ); + } else { + const originalEnd = huffmanInput.end; + const bitmapEnd = huffmanInput.position + bitmapSize; + huffmanInput.end = bitmapEnd; + collectiveBitmap = decodeMMRBitmap( + huffmanInput, + totalWidth, + currentHeight, + false, + ); + huffmanInput.end = originalEnd; + huffmanInput.position = bitmapEnd; + } + const numberOfSymbolsDecoded = symbolWidths.length; + if (firstSymbol === numberOfSymbolsDecoded - 1) { + newSymbols.push(collectiveBitmap); + } else { + let i, + y, + xMin = 0, + xMax, + bitmapWidth, + symbolBitmap; + for (i = firstSymbol; i < numberOfSymbolsDecoded; i++) { + bitmapWidth = symbolWidths[i]; + xMax = xMin + bitmapWidth; + symbolBitmap = []; + for (y = 0; y < currentHeight; y++) { + symbolBitmap.push(collectiveBitmap[y].subarray(xMin, xMax)); + } + newSymbols.push(symbolBitmap); + xMin = xMax; + } + } + } + } + const exportedSymbols = [], + flags = []; + let currentFlag = false, + i, + ii; + const totalSymbolsLength = symbols.length + numberOfNewSymbols; + while (flags.length < totalSymbolsLength) { + let runLength = huffman + ? tableB1.decode(huffmanInput) + : decodeInteger(contextCache, "IAEX", decoder); + while (runLength--) { + flags.push(currentFlag); + } + currentFlag = !currentFlag; + } + for (i = 0, ii = symbols.length; i < ii; i++) { + if (flags[i]) { + exportedSymbols.push(symbols[i]); + } + } + for (let j = 0; j < numberOfNewSymbols; i++, j++) { + if (flags[i]) { + exportedSymbols.push(newSymbols[j]); + } + } + return exportedSymbols; } function decodeTextRegion( - e, - t, - i, - a, - s, - r, - n, - g, - o, - c, - C, - h, - l, - Q, - E, - u, - d, - f, - p, + huffman, + refinement, + width, + height, + defaultPixelValue, + numberOfSymbolInstances, + stripSize, + inputSymbols, + symbolCodeLength, + transposed, + dsOffset, + referenceCorner, + combinationOperator, + huffmanTables, + refinementTemplateIndex, + refinementAt, + decodingContext, + logStripSize, + huffmanInput, ) { - if (e && t) throw new Jbig2Error("refinement with Huffman is not supported"); - const m = []; - let y, w; - for (y = 0; y < a; y++) { - w = new Uint8Array(i); - if (s) for (let e = 0; e < i; e++) w[e] = s; - m.push(w); + if (huffman && refinement) { + throw new Jbig2Error("refinement with Huffman is not supported"); } - const D = d.decoder, - b = d.contextCache; - let F = e ? -Q.tableDeltaT.decode(p) : -decodeInteger(b, "IADT", D), - S = 0; - y = 0; - for (; y < r; ) { - F += e ? Q.tableDeltaT.decode(p) : decodeInteger(b, "IADT", D); - S += e ? Q.tableFirstS.decode(p) : decodeInteger(b, "IAFS", D); - let a = S; - for (;;) { - let s = 0; - n > 1 && (s = e ? p.readBits(f) : decodeInteger(b, "IAIT", D)); - const r = n * F + s, - S = e ? Q.symbolIDTable.decode(p) : decodeIAID(b, D, o), - k = t && (e ? p.readBit() : decodeInteger(b, "IARI", D)); - let R = g[S], - N = R[0].length, - G = R.length; - if (k) { - const e = decodeInteger(b, "IARDW", D), - t = decodeInteger(b, "IARDH", D); - N += e; - G += t; - R = decodeRefinement( - N, - G, - E, - R, - (e >> 1) + decodeInteger(b, "IARDX", D), - (t >> 1) + decodeInteger(b, "IARDY", D), - !1, - u, - d, + const bitmap = []; + let i, row; + for (i = 0; i < height; i++) { + row = new Uint8Array(width); + if (defaultPixelValue) { + for (let j = 0; j < width; j++) { + row[j] = defaultPixelValue; + } + } + bitmap.push(row); + } + const decoder = decodingContext.decoder; + const contextCache = decodingContext.contextCache; + let stripT = huffman + ? -huffmanTables.tableDeltaT.decode(huffmanInput) + : -decodeInteger(contextCache, "IADT", decoder); + let firstS = 0; + i = 0; + while (i < numberOfSymbolInstances) { + const deltaT = huffman + ? huffmanTables.tableDeltaT.decode(huffmanInput) + : decodeInteger(contextCache, "IADT", decoder); + stripT += deltaT; + const deltaFirstS = huffman + ? huffmanTables.tableFirstS.decode(huffmanInput) + : decodeInteger(contextCache, "IAFS", decoder); + firstS += deltaFirstS; + let currentS = firstS; + do { + let currentT = 0; + if (stripSize > 1) { + currentT = huffman + ? huffmanInput.readBits(logStripSize) + : decodeInteger(contextCache, "IAIT", decoder); + } + const t = stripSize * stripT + currentT; + const symbolId = huffman + ? huffmanTables.symbolIDTable.decode(huffmanInput) + : decodeIAID(contextCache, decoder, symbolCodeLength); + const applyRefinement = + refinement && + (huffman + ? huffmanInput.readBit() + : decodeInteger(contextCache, "IARI", decoder)); + let symbolBitmap = inputSymbols[symbolId]; + let symbolWidth = symbolBitmap[0].length; + let symbolHeight = symbolBitmap.length; + if (applyRefinement) { + const rdw = decodeInteger(contextCache, "IARDW", decoder); + const rdh = decodeInteger(contextCache, "IARDH", decoder); + const rdx = decodeInteger(contextCache, "IARDX", decoder); + const rdy = decodeInteger(contextCache, "IARDY", decoder); + symbolWidth += rdw; + symbolHeight += rdh; + symbolBitmap = decodeRefinement( + symbolWidth, + symbolHeight, + refinementTemplateIndex, + symbolBitmap, + (rdw >> 1) + rdx, + (rdh >> 1) + rdy, + false, + refinementAt, + decodingContext, ); } - let x = 0; - c - ? 1 & h - ? (x = G - 1) - : (a += G - 1) - : h > 1 - ? (a += N - 1) - : (x = N - 1); - const U = r - (1 & h ? 0 : G - 1), - M = a - (2 & h ? N - 1 : 0); - let L, H, J; - if (c) - for (L = 0; L < G; L++) { - w = m[M + L]; - if (!w) continue; - J = R[L]; - const e = Math.min(i - U, N); - switch (l) { + let increment = 0; + if (!transposed) { + if (referenceCorner > 1) { + currentS += symbolWidth - 1; + } else { + increment = symbolWidth - 1; + } + } else if (!(referenceCorner & 1)) { + currentS += symbolHeight - 1; + } else { + increment = symbolHeight - 1; + } + const offsetT = t - (referenceCorner & 1 ? 0 : symbolHeight - 1); + const offsetS = currentS - (referenceCorner & 2 ? symbolWidth - 1 : 0); + let s2, t2, symbolRow; + if (transposed) { + for (s2 = 0; s2 < symbolHeight; s2++) { + row = bitmap[offsetS + s2]; + if (!row) { + continue; + } + symbolRow = symbolBitmap[s2]; + const maxWidth = Math.min(width - offsetT, symbolWidth); + switch (combinationOperator) { case 0: - for (H = 0; H < e; H++) w[U + H] |= J[H]; + for (t2 = 0; t2 < maxWidth; t2++) { + row[offsetT + t2] |= symbolRow[t2]; + } break; case 2: - for (H = 0; H < e; H++) w[U + H] ^= J[H]; + for (t2 = 0; t2 < maxWidth; t2++) { + row[offsetT + t2] ^= symbolRow[t2]; + } break; default: - throw new Jbig2Error(`operator ${l} is not supported`); + throw new Jbig2Error( + `operator ${combinationOperator} is not supported`, + ); } } - else - for (H = 0; H < G; H++) { - w = m[U + H]; - if (w) { - J = R[H]; - switch (l) { - case 0: - for (L = 0; L < N; L++) w[M + L] |= J[L]; - break; - case 2: - for (L = 0; L < N; L++) w[M + L] ^= J[L]; - break; - default: - throw new Jbig2Error(`operator ${l} is not supported`); + } else { + for (t2 = 0; t2 < symbolHeight; t2++) { + row = bitmap[offsetT + t2]; + if (!row) { + continue; + } + symbolRow = symbolBitmap[t2]; + switch (combinationOperator) { + case 0: + for (s2 = 0; s2 < symbolWidth; s2++) { + row[offsetS + s2] |= symbolRow[s2]; + } + break; + case 2: + for (s2 = 0; s2 < symbolWidth; s2++) { + row[offsetS + s2] ^= symbolRow[s2]; + } + break; + default: + throw new Jbig2Error( + `operator ${combinationOperator} is not supported`, + ); + } + } + } + i++; + const deltaS = huffman + ? huffmanTables.tableDeltaS.decode(huffmanInput) + : decodeInteger(contextCache, "IADS", decoder); + if (deltaS === null) { + break; + } + currentS += increment + deltaS + dsOffset; + } while (true); + } + return bitmap; +} +function decodePatternDictionary( + mmr, + patternWidth, + patternHeight, + maxPatternIndex, + template, + decodingContext, +) { + const at = []; + if (!mmr) { + at.push({ + x: -patternWidth, + y: 0, + }); + if (template === 0) { + at.push( + { + x: -3, + y: -1, + }, + { + x: 2, + y: -2, + }, + { + x: -2, + y: -2, + }, + ); + } + } + const collectiveWidth = (maxPatternIndex + 1) * patternWidth; + const collectiveBitmap = decodeBitmap( + mmr, + collectiveWidth, + patternHeight, + template, + false, + null, + at, + decodingContext, + ); + const patterns = []; + for (let i = 0; i <= maxPatternIndex; i++) { + const patternBitmap = []; + const xMin = patternWidth * i; + const xMax = xMin + patternWidth; + for (let y = 0; y < patternHeight; y++) { + patternBitmap.push(collectiveBitmap[y].subarray(xMin, xMax)); + } + patterns.push(patternBitmap); + } + return patterns; +} +function decodeHalftoneRegion( + mmr, + patterns, + template, + regionWidth, + regionHeight, + defaultPixelValue, + enableSkip, + combinationOperator, + gridWidth, + gridHeight, + gridOffsetX, + gridOffsetY, + gridVectorX, + gridVectorY, + decodingContext, +) { + const skip = null; + if (enableSkip) { + throw new Jbig2Error("skip is not supported"); + } + if (combinationOperator !== 0) { + throw new Jbig2Error( + `operator "${combinationOperator}" is not supported in halftone region`, + ); + } + const regionBitmap = []; + let i, j, row; + for (i = 0; i < regionHeight; i++) { + row = new Uint8Array(regionWidth); + if (defaultPixelValue) { + for (j = 0; j < regionWidth; j++) { + row[j] = defaultPixelValue; + } + } + regionBitmap.push(row); + } + const numberOfPatterns = patterns.length; + const pattern0 = patterns[0]; + const patternWidth = pattern0[0].length, + patternHeight = pattern0.length; + const bitsPerValue = log2(numberOfPatterns); + const at = []; + if (!mmr) { + at.push({ + x: template <= 1 ? 3 : 2, + y: -1, + }); + if (template === 0) { + at.push( + { + x: -3, + y: -1, + }, + { + x: 2, + y: -2, + }, + { + x: -2, + y: -2, + }, + ); + } + } + const grayScaleBitPlanes = []; + let mmrInput, bitmap; + if (mmr) { + mmrInput = new Reader( + decodingContext.data, + decodingContext.start, + decodingContext.end, + ); + } + for (i = bitsPerValue - 1; i >= 0; i--) { + if (mmr) { + bitmap = decodeMMRBitmap(mmrInput, gridWidth, gridHeight, true); + } else { + bitmap = decodeBitmap( + false, + gridWidth, + gridHeight, + template, + false, + skip, + at, + decodingContext, + ); + } + grayScaleBitPlanes[i] = bitmap; + } + let mg, ng, bit, patternIndex, patternBitmap, x, y, patternRow, regionRow; + for (mg = 0; mg < gridHeight; mg++) { + for (ng = 0; ng < gridWidth; ng++) { + bit = 0; + patternIndex = 0; + for (j = bitsPerValue - 1; j >= 0; j--) { + bit ^= grayScaleBitPlanes[j][mg][ng]; + patternIndex |= bit << j; + } + patternBitmap = patterns[patternIndex]; + x = (gridOffsetX + mg * gridVectorY + ng * gridVectorX) >> 8; + y = (gridOffsetY + mg * gridVectorX - ng * gridVectorY) >> 8; + if ( + x >= 0 && + x + patternWidth <= regionWidth && + y >= 0 && + y + patternHeight <= regionHeight + ) { + for (i = 0; i < patternHeight; i++) { + regionRow = regionBitmap[y + i]; + patternRow = patternBitmap[i]; + for (j = 0; j < patternWidth; j++) { + regionRow[x + j] |= patternRow[j]; + } + } + } else { + let regionX, regionY; + for (i = 0; i < patternHeight; i++) { + regionY = y + i; + if (regionY < 0 || regionY >= regionHeight) { + continue; + } + regionRow = regionBitmap[regionY]; + patternRow = patternBitmap[i]; + for (j = 0; j < patternWidth; j++) { + regionX = x + j; + if (regionX >= 0 && regionX < regionWidth) { + regionRow[regionX] |= patternRow[j]; } } } - y++; - const Y = e ? Q.tableDeltaS.decode(p) : decodeInteger(b, "IADS", D); - if (null === Y) break; - a += x + Y + C; + } } } - return m; + return regionBitmap; } -function readSegmentHeader(e, t) { - const i = {}; - i.number = readUint32(e, t); - const a = e[t + 4], - s = 63 & a; - if (!Wt[s]) throw new Jbig2Error("invalid segment type: " + s); - i.type = s; - i.typeName = Wt[s]; - i.deferredNonRetain = !!(128 & a); - const r = !!(64 & a), - n = e[t + 5]; - let g = (n >> 5) & 7; - const o = [31 & n]; - let c = t + 6; - if (7 === n) { - g = 536870911 & readUint32(e, c - 1); - c += 3; - let t = (g + 7) >> 3; - o[0] = e[c++]; - for (; --t > 0; ) o.push(e[c++]); - } else if (5 === n || 6 === n) - throw new Jbig2Error("invalid referred-to flags"); - i.retainBits = o; - let C = 4; - i.number <= 256 ? (C = 1) : i.number <= 65536 && (C = 2); - const h = []; - let l, Q; - for (l = 0; l < g; l++) { - let t; - t = 1 === C ? e[c] : 2 === C ? readUint16(e, c) : readUint32(e, c); - h.push(t); - c += C; +function readSegmentHeader(data, start) { + const segmentHeader = {}; + segmentHeader.number = readUint32(data, start); + const flags = data[start + 4]; + const segmentType = flags & 0x3f; + if (!SegmentTypes[segmentType]) { + throw new Jbig2Error("invalid segment type: " + segmentType); } - i.referredTo = h; - if (r) { - i.pageAssociation = readUint32(e, c); - c += 4; - } else i.pageAssociation = e[c++]; - i.length = readUint32(e, c); - c += 4; - if (4294967295 === i.length) { - if (38 !== s) throw new Jbig2Error("invalid unknown segment length"); - { - const t = readRegionSegmentInformation(e, c), - a = !!(1 & e[c + zt]), - s = 6, - r = new Uint8Array(s); - if (!a) { - r[0] = 255; - r[1] = 172; + segmentHeader.type = segmentType; + segmentHeader.typeName = SegmentTypes[segmentType]; + segmentHeader.deferredNonRetain = !!(flags & 0x80); + const pageAssociationFieldSize = !!(flags & 0x40); + const referredFlags = data[start + 5]; + let referredToCount = (referredFlags >> 5) & 7; + const retainBits = [referredFlags & 31]; + let position = start + 6; + if (referredFlags === 7) { + referredToCount = readUint32(data, position - 1) & 0x1fffffff; + position += 3; + let bytes = (referredToCount + 7) >> 3; + retainBits[0] = data[position++]; + while (--bytes > 0) { + retainBits.push(data[position++]); + } + } else if (referredFlags === 5 || referredFlags === 6) { + throw new Jbig2Error("invalid referred-to flags"); + } + segmentHeader.retainBits = retainBits; + let referredToSegmentNumberSize = 4; + if (segmentHeader.number <= 256) { + referredToSegmentNumberSize = 1; + } else if (segmentHeader.number <= 65536) { + referredToSegmentNumberSize = 2; + } + const referredTo = []; + let i, ii; + for (i = 0; i < referredToCount; i++) { + let number; + if (referredToSegmentNumberSize === 1) { + number = data[position]; + } else if (referredToSegmentNumberSize === 2) { + number = readUint16(data, position); + } else { + number = readUint32(data, position); + } + referredTo.push(number); + position += referredToSegmentNumberSize; + } + segmentHeader.referredTo = referredTo; + if (!pageAssociationFieldSize) { + segmentHeader.pageAssociation = data[position++]; + } else { + segmentHeader.pageAssociation = readUint32(data, position); + position += 4; + } + segmentHeader.length = readUint32(data, position); + position += 4; + if (segmentHeader.length === 0xffffffff) { + if (segmentType === 38) { + const genericRegionInfo = readRegionSegmentInformation(data, position); + const genericRegionSegmentFlags = + data[position + RegionSegmentInformationFieldLength]; + const genericRegionMmr = !!(genericRegionSegmentFlags & 1); + const searchPatternLength = 6; + const searchPattern = new Uint8Array(searchPatternLength); + if (!genericRegionMmr) { + searchPattern[0] = 0xff; + searchPattern[1] = 0xac; } - r[2] = (t.height >>> 24) & 255; - r[3] = (t.height >> 16) & 255; - r[4] = (t.height >> 8) & 255; - r[5] = 255 & t.height; - for (l = c, Q = e.length; l < Q; l++) { - let t = 0; - for (; t < s && r[t] === e[l + t]; ) t++; - if (t === s) { - i.length = l + s; + searchPattern[2] = (genericRegionInfo.height >>> 24) & 0xff; + searchPattern[3] = (genericRegionInfo.height >> 16) & 0xff; + searchPattern[4] = (genericRegionInfo.height >> 8) & 0xff; + searchPattern[5] = genericRegionInfo.height & 0xff; + for (i = position, ii = data.length; i < ii; i++) { + let j = 0; + while (j < searchPatternLength && searchPattern[j] === data[i + j]) { + j++; + } + if (j === searchPatternLength) { + segmentHeader.length = i + searchPatternLength; break; } } - if (4294967295 === i.length) + if (segmentHeader.length === 0xffffffff) { throw new Jbig2Error("segment end was not found"); + } + } else { + throw new Jbig2Error("invalid unknown segment length"); } } - i.headerEnd = c; - return i; + segmentHeader.headerEnd = position; + return segmentHeader; } -function readSegments(e, t, i, a) { - const s = []; - let r = i; - for (; r < a; ) { - const i = readSegmentHeader(t, r); - r = i.headerEnd; - const a = { header: i, data: t }; - if (!e.randomAccess) { - a.start = r; - r += i.length; - a.end = r; +function readSegments(header, data, start, end) { + const segments = []; + let position = start; + while (position < end) { + const segmentHeader = readSegmentHeader(data, position); + position = segmentHeader.headerEnd; + const segment = { + header: segmentHeader, + data, + }; + if (!header.randomAccess) { + segment.start = position; + position += segmentHeader.length; + segment.end = position; + } + segments.push(segment); + if (segmentHeader.type === 51) { + break; } - s.push(a); - if (51 === i.type) break; } - if (e.randomAccess) - for (let e = 0, t = s.length; e < t; e++) { - s[e].start = r; - r += s[e].header.length; - s[e].end = r; + if (header.randomAccess) { + for (let i = 0, ii = segments.length; i < ii; i++) { + segments[i].start = position; + position += segments[i].header.length; + segments[i].end = position; } - return s; + } + return segments; } -function readRegionSegmentInformation(e, t) { +function readRegionSegmentInformation(data, start) { return { - width: readUint32(e, t), - height: readUint32(e, t + 4), - x: readUint32(e, t + 8), - y: readUint32(e, t + 12), - combinationOperator: 7 & e[t + 16], + width: readUint32(data, start), + height: readUint32(data, start + 4), + x: readUint32(data, start + 8), + y: readUint32(data, start + 12), + combinationOperator: data[start + 16] & 7, }; } -const zt = 17; -function processSegment(e, t) { - const i = e.header, - a = e.data, - s = e.end; - let r, - n, - g, - o, - c = e.start; - switch (i.type) { +const RegionSegmentInformationFieldLength = 17; +function processSegment(segment, visitor) { + const header = segment.header; + const data = segment.data, + end = segment.end; + let position = segment.start; + let args, at, i, atLength; + switch (header.type) { case 0: - const e = {}, - t = readUint16(a, c); - e.huffman = !!(1 & t); - e.refinement = !!(2 & t); - e.huffmanDHSelector = (t >> 2) & 3; - e.huffmanDWSelector = (t >> 4) & 3; - e.bitmapSizeSelector = (t >> 6) & 1; - e.aggregationInstancesSelector = (t >> 7) & 1; - e.bitmapCodingContextUsed = !!(256 & t); - e.bitmapCodingContextRetained = !!(512 & t); - e.template = (t >> 10) & 3; - e.refinementTemplate = (t >> 12) & 1; - c += 2; - if (!e.huffman) { - o = 0 === e.template ? 4 : 1; - n = []; - for (g = 0; g < o; g++) { - n.push({ x: readInt8(a, c), y: readInt8(a, c + 1) }); - c += 2; + const dictionary = {}; + const dictionaryFlags = readUint16(data, position); + dictionary.huffman = !!(dictionaryFlags & 1); + dictionary.refinement = !!(dictionaryFlags & 2); + dictionary.huffmanDHSelector = (dictionaryFlags >> 2) & 3; + dictionary.huffmanDWSelector = (dictionaryFlags >> 4) & 3; + dictionary.bitmapSizeSelector = (dictionaryFlags >> 6) & 1; + dictionary.aggregationInstancesSelector = (dictionaryFlags >> 7) & 1; + dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256); + dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512); + dictionary.template = (dictionaryFlags >> 10) & 3; + dictionary.refinementTemplate = (dictionaryFlags >> 12) & 1; + position += 2; + if (!dictionary.huffman) { + atLength = dictionary.template === 0 ? 4 : 1; + at = []; + for (i = 0; i < atLength; i++) { + at.push({ + x: readInt8(data, position), + y: readInt8(data, position + 1), + }); + position += 2; } - e.at = n; + dictionary.at = at; } - if (e.refinement && !e.refinementTemplate) { - n = []; - for (g = 0; g < 2; g++) { - n.push({ x: readInt8(a, c), y: readInt8(a, c + 1) }); - c += 2; + if (dictionary.refinement && !dictionary.refinementTemplate) { + at = []; + for (i = 0; i < 2; i++) { + at.push({ + x: readInt8(data, position), + y: readInt8(data, position + 1), + }); + position += 2; } - e.refinementAt = n; + dictionary.refinementAt = at; } - e.numberOfExportedSymbols = readUint32(a, c); - c += 4; - e.numberOfNewSymbols = readUint32(a, c); - c += 4; - r = [e, i.number, i.referredTo, a, c, s]; + dictionary.numberOfExportedSymbols = readUint32(data, position); + position += 4; + dictionary.numberOfNewSymbols = readUint32(data, position); + position += 4; + args = [ + dictionary, + header.number, + header.referredTo, + data, + position, + end, + ]; break; case 6: case 7: - const C = {}; - C.info = readRegionSegmentInformation(a, c); - c += zt; - const h = readUint16(a, c); - c += 2; - C.huffman = !!(1 & h); - C.refinement = !!(2 & h); - C.logStripSize = (h >> 2) & 3; - C.stripSize = 1 << C.logStripSize; - C.referenceCorner = (h >> 4) & 3; - C.transposed = !!(64 & h); - C.combinationOperator = (h >> 7) & 3; - C.defaultPixelValue = (h >> 9) & 1; - C.dsOffset = (h << 17) >> 27; - C.refinementTemplate = (h >> 15) & 1; - if (C.huffman) { - const e = readUint16(a, c); - c += 2; - C.huffmanFS = 3 & e; - C.huffmanDS = (e >> 2) & 3; - C.huffmanDT = (e >> 4) & 3; - C.huffmanRefinementDW = (e >> 6) & 3; - C.huffmanRefinementDH = (e >> 8) & 3; - C.huffmanRefinementDX = (e >> 10) & 3; - C.huffmanRefinementDY = (e >> 12) & 3; - C.huffmanRefinementSizeSelector = !!(16384 & e); + const textRegion = {}; + textRegion.info = readRegionSegmentInformation(data, position); + position += RegionSegmentInformationFieldLength; + const textRegionSegmentFlags = readUint16(data, position); + position += 2; + textRegion.huffman = !!(textRegionSegmentFlags & 1); + textRegion.refinement = !!(textRegionSegmentFlags & 2); + textRegion.logStripSize = (textRegionSegmentFlags >> 2) & 3; + textRegion.stripSize = 1 << textRegion.logStripSize; + textRegion.referenceCorner = (textRegionSegmentFlags >> 4) & 3; + textRegion.transposed = !!(textRegionSegmentFlags & 64); + textRegion.combinationOperator = (textRegionSegmentFlags >> 7) & 3; + textRegion.defaultPixelValue = (textRegionSegmentFlags >> 9) & 1; + textRegion.dsOffset = (textRegionSegmentFlags << 17) >> 27; + textRegion.refinementTemplate = (textRegionSegmentFlags >> 15) & 1; + if (textRegion.huffman) { + const textRegionHuffmanFlags = readUint16(data, position); + position += 2; + textRegion.huffmanFS = textRegionHuffmanFlags & 3; + textRegion.huffmanDS = (textRegionHuffmanFlags >> 2) & 3; + textRegion.huffmanDT = (textRegionHuffmanFlags >> 4) & 3; + textRegion.huffmanRefinementDW = (textRegionHuffmanFlags >> 6) & 3; + textRegion.huffmanRefinementDH = (textRegionHuffmanFlags >> 8) & 3; + textRegion.huffmanRefinementDX = (textRegionHuffmanFlags >> 10) & 3; + textRegion.huffmanRefinementDY = (textRegionHuffmanFlags >> 12) & 3; + textRegion.huffmanRefinementSizeSelector = !!( + textRegionHuffmanFlags & 0x4000 + ); } - if (C.refinement && !C.refinementTemplate) { - n = []; - for (g = 0; g < 2; g++) { - n.push({ x: readInt8(a, c), y: readInt8(a, c + 1) }); - c += 2; + if (textRegion.refinement && !textRegion.refinementTemplate) { + at = []; + for (i = 0; i < 2; i++) { + at.push({ + x: readInt8(data, position), + y: readInt8(data, position + 1), + }); + position += 2; } - C.refinementAt = n; + textRegion.refinementAt = at; } - C.numberOfSymbolInstances = readUint32(a, c); - c += 4; - r = [C, i.referredTo, a, c, s]; + textRegion.numberOfSymbolInstances = readUint32(data, position); + position += 4; + args = [textRegion, header.referredTo, data, position, end]; break; case 16: - const l = {}, - Q = a[c++]; - l.mmr = !!(1 & Q); - l.template = (Q >> 1) & 3; - l.patternWidth = a[c++]; - l.patternHeight = a[c++]; - l.maxPatternIndex = readUint32(a, c); - c += 4; - r = [l, i.number, a, c, s]; + const patternDictionary = {}; + const patternDictionaryFlags = data[position++]; + patternDictionary.mmr = !!(patternDictionaryFlags & 1); + patternDictionary.template = (patternDictionaryFlags >> 1) & 3; + patternDictionary.patternWidth = data[position++]; + patternDictionary.patternHeight = data[position++]; + patternDictionary.maxPatternIndex = readUint32(data, position); + position += 4; + args = [patternDictionary, header.number, data, position, end]; break; case 22: case 23: - const E = {}; - E.info = readRegionSegmentInformation(a, c); - c += zt; - const u = a[c++]; - E.mmr = !!(1 & u); - E.template = (u >> 1) & 3; - E.enableSkip = !!(8 & u); - E.combinationOperator = (u >> 4) & 7; - E.defaultPixelValue = (u >> 7) & 1; - E.gridWidth = readUint32(a, c); - c += 4; - E.gridHeight = readUint32(a, c); - c += 4; - E.gridOffsetX = 4294967295 & readUint32(a, c); - c += 4; - E.gridOffsetY = 4294967295 & readUint32(a, c); - c += 4; - E.gridVectorX = readUint16(a, c); - c += 2; - E.gridVectorY = readUint16(a, c); - c += 2; - r = [E, i.referredTo, a, c, s]; + const halftoneRegion = {}; + halftoneRegion.info = readRegionSegmentInformation(data, position); + position += RegionSegmentInformationFieldLength; + const halftoneRegionFlags = data[position++]; + halftoneRegion.mmr = !!(halftoneRegionFlags & 1); + halftoneRegion.template = (halftoneRegionFlags >> 1) & 3; + halftoneRegion.enableSkip = !!(halftoneRegionFlags & 8); + halftoneRegion.combinationOperator = (halftoneRegionFlags >> 4) & 7; + halftoneRegion.defaultPixelValue = (halftoneRegionFlags >> 7) & 1; + halftoneRegion.gridWidth = readUint32(data, position); + position += 4; + halftoneRegion.gridHeight = readUint32(data, position); + position += 4; + halftoneRegion.gridOffsetX = readUint32(data, position) & 0xffffffff; + position += 4; + halftoneRegion.gridOffsetY = readUint32(data, position) & 0xffffffff; + position += 4; + halftoneRegion.gridVectorX = readUint16(data, position); + position += 2; + halftoneRegion.gridVectorY = readUint16(data, position); + position += 2; + args = [halftoneRegion, header.referredTo, data, position, end]; break; case 38: case 39: - const d = {}; - d.info = readRegionSegmentInformation(a, c); - c += zt; - const f = a[c++]; - d.mmr = !!(1 & f); - d.template = (f >> 1) & 3; - d.prediction = !!(8 & f); - if (!d.mmr) { - o = 0 === d.template ? 4 : 1; - n = []; - for (g = 0; g < o; g++) { - n.push({ x: readInt8(a, c), y: readInt8(a, c + 1) }); - c += 2; + const genericRegion = {}; + genericRegion.info = readRegionSegmentInformation(data, position); + position += RegionSegmentInformationFieldLength; + const genericRegionSegmentFlags = data[position++]; + genericRegion.mmr = !!(genericRegionSegmentFlags & 1); + genericRegion.template = (genericRegionSegmentFlags >> 1) & 3; + genericRegion.prediction = !!(genericRegionSegmentFlags & 8); + if (!genericRegion.mmr) { + atLength = genericRegion.template === 0 ? 4 : 1; + at = []; + for (i = 0; i < atLength; i++) { + at.push({ + x: readInt8(data, position), + y: readInt8(data, position + 1), + }); + position += 2; } - d.at = n; + genericRegion.at = at; } - r = [d, a, c, s]; + args = [genericRegion, data, position, end]; break; case 48: - const p = { - width: readUint32(a, c), - height: readUint32(a, c + 4), - resolutionX: readUint32(a, c + 8), - resolutionY: readUint32(a, c + 12), + const pageInfo = { + width: readUint32(data, position), + height: readUint32(data, position + 4), + resolutionX: readUint32(data, position + 8), + resolutionY: readUint32(data, position + 12), }; - 4294967295 === p.height && delete p.height; - const m = a[c + 16]; - readUint16(a, c + 17); - p.lossless = !!(1 & m); - p.refinement = !!(2 & m); - p.defaultPixelValue = (m >> 2) & 1; - p.combinationOperator = (m >> 3) & 3; - p.requiresBuffer = !!(32 & m); - p.combinationOperatorOverride = !!(64 & m); - r = [p]; + if (pageInfo.height === 0xffffffff) { + delete pageInfo.height; + } + const pageSegmentFlags = data[position + 16]; + readUint16(data, position + 17); + pageInfo.lossless = !!(pageSegmentFlags & 1); + pageInfo.refinement = !!(pageSegmentFlags & 2); + pageInfo.defaultPixelValue = (pageSegmentFlags >> 2) & 1; + pageInfo.combinationOperator = (pageSegmentFlags >> 3) & 3; + pageInfo.requiresBuffer = !!(pageSegmentFlags & 32); + pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64); + args = [pageInfo]; break; case 49: + break; case 50: + break; case 51: - case 62: break; case 53: - r = [i.number, a, c, s]; + args = [header.number, data, position, end]; + break; + case 62: break; default: throw new Jbig2Error( - `segment type ${i.typeName}(${i.type}) is not implemented`, + `segment type ${header.typeName}(${header.type}) is not implemented`, ); } - const C = "on" + i.typeName; - C in t && t[C].apply(t, r); + const callbackName = "on" + header.typeName; + if (callbackName in visitor) { + visitor[callbackName].apply(visitor, args); + } } -function processSegments(e, t) { - for (let i = 0, a = e.length; i < a; i++) processSegment(e[i], t); +function processSegments(segments, visitor) { + for (let i = 0, ii = segments.length; i < ii; i++) { + processSegment(segments[i], visitor); + } +} +function parseJbig2Chunks(chunks) { + const visitor = new SimpleSegmentVisitor(); + for (let i = 0, ii = chunks.length; i < ii; i++) { + const chunk = chunks[i]; + const segments = readSegments({}, chunk.data, chunk.start, chunk.end); + processSegments(segments, visitor); + } + return visitor.buffer; +} +function parseJbig2(data) { + throw new Error("Not implemented: parseJbig2"); } class SimpleSegmentVisitor { - onPageInformation(e) { - this.currentPageInfo = e; - const t = (e.width + 7) >> 3, - i = new Uint8ClampedArray(t * e.height); - e.defaultPixelValue && i.fill(255); - this.buffer = i; + onPageInformation(info) { + this.currentPageInfo = info; + const rowSize = (info.width + 7) >> 3; + const buffer = new Uint8ClampedArray(rowSize * info.height); + if (info.defaultPixelValue) { + buffer.fill(0xff); + } + this.buffer = buffer; } - drawBitmap(e, t) { - const i = this.currentPageInfo, - a = e.width, - s = e.height, - r = (i.width + 7) >> 3, - n = i.combinationOperatorOverride - ? e.combinationOperator - : i.combinationOperator, - g = this.buffer, - o = 128 >> (7 & e.x); - let c, - C, - h, - l, - Q = e.y * r + (e.x >> 3); - switch (n) { + drawBitmap(regionInfo, bitmap) { + const pageInfo = this.currentPageInfo; + const width = regionInfo.width, + height = regionInfo.height; + const rowSize = (pageInfo.width + 7) >> 3; + const combinationOperator = pageInfo.combinationOperatorOverride + ? regionInfo.combinationOperator + : pageInfo.combinationOperator; + const buffer = this.buffer; + const mask0 = 128 >> (regionInfo.x & 7); + let offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3); + let i, j, mask, offset; + switch (combinationOperator) { case 0: - for (c = 0; c < s; c++) { - h = o; - l = Q; - for (C = 0; C < a; C++) { - t[c][C] && (g[l] |= h); - h >>= 1; - if (!h) { - h = 128; - l++; + for (i = 0; i < height; i++) { + mask = mask0; + offset = offset0; + for (j = 0; j < width; j++) { + if (bitmap[i][j]) { + buffer[offset] |= mask; + } + mask >>= 1; + if (!mask) { + mask = 128; + offset++; } } - Q += r; + offset0 += rowSize; } break; case 2: - for (c = 0; c < s; c++) { - h = o; - l = Q; - for (C = 0; C < a; C++) { - t[c][C] && (g[l] ^= h); - h >>= 1; - if (!h) { - h = 128; - l++; + for (i = 0; i < height; i++) { + mask = mask0; + offset = offset0; + for (j = 0; j < width; j++) { + if (bitmap[i][j]) { + buffer[offset] ^= mask; + } + mask >>= 1; + if (!mask) { + mask = 128; + offset++; } } - Q += r; + offset0 += rowSize; } break; default: - throw new Jbig2Error(`operator ${n} is not supported`); + throw new Jbig2Error( + `operator ${combinationOperator} is not supported`, + ); } } - onImmediateGenericRegion(e, t, i, a) { - const s = e.info, - r = new DecodingContext(t, i, a), - n = decodeBitmap( - e.mmr, - s.width, - s.height, - e.template, - e.prediction, - null, - e.at, - r, - ); - this.drawBitmap(s, n); + onImmediateGenericRegion(region, data, start, end) { + const regionInfo = region.info; + const decodingContext = new DecodingContext(data, start, end); + const bitmap = decodeBitmap( + region.mmr, + regionInfo.width, + regionInfo.height, + region.template, + region.prediction, + null, + region.at, + decodingContext, + ); + this.drawBitmap(regionInfo, bitmap); } onImmediateLosslessGenericRegion() { this.onImmediateGenericRegion(...arguments); } - onSymbolDictionary(e, t, i, a, s, r) { - let n, g; - if (e.huffman) { - n = (function getSymbolDictionaryHuffmanTables(e, t, i) { - let a, - s, - r, - n, - g = 0; - switch (e.huffmanDHSelector) { - case 0: - case 1: - a = getStandardTable(e.huffmanDHSelector + 4); - break; - case 3: - a = getCustomHuffmanTable(g, t, i); - g++; - break; - default: - throw new Jbig2Error("invalid Huffman DH selector"); - } - switch (e.huffmanDWSelector) { - case 0: - case 1: - s = getStandardTable(e.huffmanDWSelector + 2); - break; - case 3: - s = getCustomHuffmanTable(g, t, i); - g++; - break; - default: - throw new Jbig2Error("invalid Huffman DW selector"); - } - if (e.bitmapSizeSelector) { - r = getCustomHuffmanTable(g, t, i); - g++; - } else r = getStandardTable(1); - n = e.aggregationInstancesSelector - ? getCustomHuffmanTable(g, t, i) - : getStandardTable(1); - return { - tableDeltaHeight: a, - tableDeltaWidth: s, - tableBitmapSize: r, - tableAggregateInstances: n, - }; - })(e, i, this.customTables); - g = new Reader(a, s, r); + onSymbolDictionary( + dictionary, + currentSegment, + referredSegments, + data, + start, + end, + ) { + let huffmanTables, huffmanInput; + if (dictionary.huffman) { + huffmanTables = getSymbolDictionaryHuffmanTables( + dictionary, + referredSegments, + this.customTables, + ); + huffmanInput = new Reader(data, start, end); } - let o = this.symbols; - o || (this.symbols = o = {}); - const c = []; - for (const e of i) { - const t = o[e]; - t && c.push(...t); + let symbols = this.symbols; + if (!symbols) { + this.symbols = symbols = {}; } - const C = new DecodingContext(a, s, r); - o[t] = (function decodeSymbolDictionary( - e, - t, - i, - a, - s, - r, - n, - g, - o, - c, - C, - h, - ) { - if (e && t) - throw new Jbig2Error("symbol refinement with Huffman is not supported"); - const l = []; - let Q = 0, - E = log2(i.length + a); - const u = C.decoder, - d = C.contextCache; - let f, p; - if (e) { - f = getStandardTable(1); - p = []; - E = Math.max(E, 1); + const inputSymbols = []; + for (const referredSegment of referredSegments) { + const referredSymbols = symbols[referredSegment]; + if (referredSymbols) { + inputSymbols.push(...referredSymbols); } - for (; l.length < a; ) { - Q += e ? r.tableDeltaHeight.decode(h) : decodeInteger(d, "IADH", u); - let a = 0, - s = 0; - const f = e ? p.length : 0; - for (;;) { - const f = e - ? r.tableDeltaWidth.decode(h) - : decodeInteger(d, "IADW", u); - if (null === f) break; - a += f; - s += a; - let m; - if (t) { - const s = decodeInteger(d, "IAAI", u); - if (s > 1) - m = decodeTextRegion( - e, - t, - a, - Q, - 0, - s, - 1, - i.concat(l), - E, - 0, - 0, - 1, - 0, - r, - o, - c, - C, - 0, - h, - ); - else { - const e = decodeIAID(d, u, E), - t = decodeInteger(d, "IARDX", u), - s = decodeInteger(d, "IARDY", u); - m = decodeRefinement( - a, - Q, - o, - e < i.length ? i[e] : l[e - i.length], - t, - s, - !1, - c, - C, - ); - } - l.push(m); - } else if (e) p.push(a); - else { - m = decodeBitmap(!1, a, Q, n, !1, null, g, C); - l.push(m); - } - } - if (e && !t) { - const e = r.tableBitmapSize.decode(h); - h.byteAlign(); - let t; - if (0 === e) t = readUncompressedBitmap(h, s, Q); - else { - const i = h.end, - a = h.position + e; - h.end = a; - t = decodeMMRBitmap(h, s, Q, !1); - h.end = i; - h.position = a; - } - const i = p.length; - if (f === i - 1) l.push(t); - else { - let e, - a, - s, - r, - n, - g = 0; - for (e = f; e < i; e++) { - r = p[e]; - s = g + r; - n = []; - for (a = 0; a < Q; a++) n.push(t[a].subarray(g, s)); - l.push(n); - g = s; - } - } - } - } - const m = [], - y = []; - let w, - D, - b = !1; - const F = i.length + a; - for (; y.length < F; ) { - let t = e ? f.decode(h) : decodeInteger(d, "IAEX", u); - for (; t--; ) y.push(b); - b = !b; - } - for (w = 0, D = i.length; w < D; w++) y[w] && m.push(i[w]); - for (let e = 0; e < a; w++, e++) y[w] && m.push(l[e]); - return m; - })( - e.huffman, - e.refinement, - c, - e.numberOfNewSymbols, - e.numberOfExportedSymbols, - n, - e.template, - e.at, - e.refinementTemplate, - e.refinementAt, - C, - g, + } + const decodingContext = new DecodingContext(data, start, end); + symbols[currentSegment] = decodeSymbolDictionary( + dictionary.huffman, + dictionary.refinement, + inputSymbols, + dictionary.numberOfNewSymbols, + dictionary.numberOfExportedSymbols, + huffmanTables, + dictionary.template, + dictionary.at, + dictionary.refinementTemplate, + dictionary.refinementAt, + decodingContext, + huffmanInput, ); } - onImmediateTextRegion(e, t, i, a, s) { - const r = e.info; - let n, g; - const o = this.symbols, - c = []; - for (const e of t) { - const t = o[e]; - t && c.push(...t); + onImmediateTextRegion(region, referredSegments, data, start, end) { + const regionInfo = region.info; + let huffmanTables, huffmanInput; + const symbols = this.symbols; + const inputSymbols = []; + for (const referredSegment of referredSegments) { + const referredSymbols = symbols[referredSegment]; + if (referredSymbols) { + inputSymbols.push(...referredSymbols); + } } - const C = log2(c.length); - if (e.huffman) { - g = new Reader(i, a, s); - n = (function getTextRegionHuffmanTables(e, t, i, a, s) { - const r = []; - for (let e = 0; e <= 34; e++) { - const t = s.readBits(4); - r.push(new HuffmanLine([e, t, 0, 0])); - } - const n = new HuffmanTable(r, !1); - r.length = 0; - for (let e = 0; e < a; ) { - const t = n.decode(s); - if (t >= 32) { - let i, a, n; - switch (t) { - case 32: - if (0 === e) - throw new Jbig2Error("no previous value in symbol ID table"); - a = s.readBits(2) + 3; - i = r[e - 1].prefixLength; - break; - case 33: - a = s.readBits(3) + 3; - i = 0; - break; - case 34: - a = s.readBits(7) + 11; - i = 0; - break; - default: - throw new Jbig2Error("invalid code length in symbol ID table"); - } - for (n = 0; n < a; n++) { - r.push(new HuffmanLine([e, i, 0, 0])); - e++; - } - } else { - r.push(new HuffmanLine([e, t, 0, 0])); - e++; - } - } - s.byteAlign(); - const g = new HuffmanTable(r, !1); - let o, - c, - C, - h = 0; - switch (e.huffmanFS) { - case 0: - case 1: - o = getStandardTable(e.huffmanFS + 6); - break; - case 3: - o = getCustomHuffmanTable(h, t, i); - h++; - break; - default: - throw new Jbig2Error("invalid Huffman FS selector"); - } - switch (e.huffmanDS) { - case 0: - case 1: - case 2: - c = getStandardTable(e.huffmanDS + 8); - break; - case 3: - c = getCustomHuffmanTable(h, t, i); - h++; - break; - default: - throw new Jbig2Error("invalid Huffman DS selector"); - } - switch (e.huffmanDT) { - case 0: - case 1: - case 2: - C = getStandardTable(e.huffmanDT + 11); - break; - case 3: - C = getCustomHuffmanTable(h, t, i); - h++; - break; - default: - throw new Jbig2Error("invalid Huffman DT selector"); - } - if (e.refinement) - throw new Jbig2Error("refinement with Huffman is not supported"); - return { - symbolIDTable: g, - tableFirstS: o, - tableDeltaS: c, - tableDeltaT: C, - }; - })(e, t, this.customTables, c.length, g); - } - const h = new DecodingContext(i, a, s), - l = decodeTextRegion( - e.huffman, - e.refinement, - r.width, - r.height, - e.defaultPixelValue, - e.numberOfSymbolInstances, - e.stripSize, - c, - C, - e.transposed, - e.dsOffset, - e.referenceCorner, - e.combinationOperator, - n, - e.refinementTemplate, - e.refinementAt, - h, - e.logStripSize, - g, + const symbolCodeLength = log2(inputSymbols.length); + if (region.huffman) { + huffmanInput = new Reader(data, start, end); + huffmanTables = getTextRegionHuffmanTables( + region, + referredSegments, + this.customTables, + inputSymbols.length, + huffmanInput, ); - this.drawBitmap(r, l); + } + const decodingContext = new DecodingContext(data, start, end); + const bitmap = decodeTextRegion( + region.huffman, + region.refinement, + regionInfo.width, + regionInfo.height, + region.defaultPixelValue, + region.numberOfSymbolInstances, + region.stripSize, + inputSymbols, + symbolCodeLength, + region.transposed, + region.dsOffset, + region.referenceCorner, + region.combinationOperator, + huffmanTables, + region.refinementTemplate, + region.refinementAt, + decodingContext, + region.logStripSize, + huffmanInput, + ); + this.drawBitmap(regionInfo, bitmap); } onImmediateLosslessTextRegion() { this.onImmediateTextRegion(...arguments); } - onPatternDictionary(e, t, i, a, s) { - let r = this.patterns; - r || (this.patterns = r = {}); - const n = new DecodingContext(i, a, s); - r[t] = (function decodePatternDictionary(e, t, i, a, s, r) { - const n = []; - if (!e) { - n.push({ x: -t, y: 0 }); - 0 === s && n.push({ x: -3, y: -1 }, { x: 2, y: -2 }, { x: -2, y: -2 }); - } - const g = decodeBitmap(e, (a + 1) * t, i, s, !1, null, n, r), - o = []; - for (let e = 0; e <= a; e++) { - const a = [], - s = t * e, - r = s + t; - for (let e = 0; e < i; e++) a.push(g[e].subarray(s, r)); - o.push(a); - } - return o; - })( - e.mmr, - e.patternWidth, - e.patternHeight, - e.maxPatternIndex, - e.template, - n, + onPatternDictionary(dictionary, currentSegment, data, start, end) { + let patterns = this.patterns; + if (!patterns) { + this.patterns = patterns = {}; + } + const decodingContext = new DecodingContext(data, start, end); + patterns[currentSegment] = decodePatternDictionary( + dictionary.mmr, + dictionary.patternWidth, + dictionary.patternHeight, + dictionary.maxPatternIndex, + dictionary.template, + decodingContext, ); } - onImmediateHalftoneRegion(e, t, i, a, s) { - const r = this.patterns[t[0]], - n = e.info, - g = new DecodingContext(i, a, s), - o = (function decodeHalftoneRegion( - e, - t, - i, - a, - s, - r, - n, - g, - o, - c, - C, - h, - l, - Q, - E, - ) { - if (n) throw new Jbig2Error("skip is not supported"); - if (0 !== g) - throw new Jbig2Error( - `operator "${g}" is not supported in halftone region`, - ); - const u = []; - let d, f, p; - for (d = 0; d < s; d++) { - p = new Uint8Array(a); - if (r) for (f = 0; f < a; f++) p[f] = r; - u.push(p); - } - const m = t.length, - y = t[0], - w = y[0].length, - D = y.length, - b = log2(m), - F = []; - if (!e) { - F.push({ x: i <= 1 ? 3 : 2, y: -1 }); - 0 === i && - F.push({ x: -3, y: -1 }, { x: 2, y: -2 }, { x: -2, y: -2 }); - } - const S = []; - let k, R, N, G, x, U, M, L, H, J, Y; - e && (k = new Reader(E.data, E.start, E.end)); - for (d = b - 1; d >= 0; d--) { - R = e - ? decodeMMRBitmap(k, o, c, !0) - : decodeBitmap(!1, o, c, i, !1, null, F, E); - S[d] = R; - } - for (N = 0; N < c; N++) - for (G = 0; G < o; G++) { - x = 0; - U = 0; - for (f = b - 1; f >= 0; f--) { - x ^= S[f][N][G]; - U |= x << f; - } - M = t[U]; - L = (C + N * Q + G * l) >> 8; - H = (h + N * l - G * Q) >> 8; - if (L >= 0 && L + w <= a && H >= 0 && H + D <= s) - for (d = 0; d < D; d++) { - Y = u[H + d]; - J = M[d]; - for (f = 0; f < w; f++) Y[L + f] |= J[f]; - } - else { - let e, t; - for (d = 0; d < D; d++) { - t = H + d; - if (!(t < 0 || t >= s)) { - Y = u[t]; - J = M[d]; - for (f = 0; f < w; f++) { - e = L + f; - e >= 0 && e < a && (Y[e] |= J[f]); - } - } - } - } - } - return u; - })( - e.mmr, - r, - e.template, - n.width, - n.height, - e.defaultPixelValue, - e.enableSkip, - e.combinationOperator, - e.gridWidth, - e.gridHeight, - e.gridOffsetX, - e.gridOffsetY, - e.gridVectorX, - e.gridVectorY, - g, - ); - this.drawBitmap(n, o); + onImmediateHalftoneRegion(region, referredSegments, data, start, end) { + const patterns = this.patterns[referredSegments[0]]; + const regionInfo = region.info; + const decodingContext = new DecodingContext(data, start, end); + const bitmap = decodeHalftoneRegion( + region.mmr, + patterns, + region.template, + regionInfo.width, + regionInfo.height, + region.defaultPixelValue, + region.enableSkip, + region.combinationOperator, + region.gridWidth, + region.gridHeight, + region.gridOffsetX, + region.gridOffsetY, + region.gridVectorX, + region.gridVectorY, + decodingContext, + ); + this.drawBitmap(regionInfo, bitmap); } onImmediateLosslessHalftoneRegion() { this.onImmediateHalftoneRegion(...arguments); } - onTables(e, t, i, a) { - let s = this.customTables; - s || (this.customTables = s = {}); - s[e] = (function decodeTablesSegment(e, t, i) { - const a = e[t], - s = 4294967295 & readUint32(e, t + 1), - r = 4294967295 & readUint32(e, t + 5), - n = new Reader(e, t + 9, i), - g = 1 + ((a >> 1) & 7), - o = 1 + ((a >> 4) & 7), - c = []; - let C, - h, - l = s; - do { - C = n.readBits(g); - h = n.readBits(o); - c.push(new HuffmanLine([l, C, h, 0])); - l += 1 << h; - } while (l < r); - C = n.readBits(g); - c.push(new HuffmanLine([s - 1, C, 32, 0, "lower"])); - C = n.readBits(g); - c.push(new HuffmanLine([r, C, 32, 0])); - if (1 & a) { - C = n.readBits(g); - c.push(new HuffmanLine([C, 0])); - } - return new HuffmanTable(c, !1); - })(t, i, a); + onTables(currentSegment, data, start, end) { + let customTables = this.customTables; + if (!customTables) { + this.customTables = customTables = {}; + } + customTables[currentSegment] = decodeTablesSegment(data, start, end); } } class HuffmanLine { - constructor(e) { - if (2 === e.length) { - this.isOOB = !0; + constructor(lineData) { + if (lineData.length === 2) { + this.isOOB = true; this.rangeLow = 0; - this.prefixLength = e[0]; + this.prefixLength = lineData[0]; this.rangeLength = 0; - this.prefixCode = e[1]; - this.isLowerRange = !1; + this.prefixCode = lineData[1]; + this.isLowerRange = false; } else { - this.isOOB = !1; - this.rangeLow = e[0]; - this.prefixLength = e[1]; - this.rangeLength = e[2]; - this.prefixCode = e[3]; - this.isLowerRange = "lower" === e[4]; + this.isOOB = false; + this.rangeLow = lineData[0]; + this.prefixLength = lineData[1]; + this.rangeLength = lineData[2]; + this.prefixCode = lineData[3]; + this.isLowerRange = lineData[4] === "lower"; } } } class HuffmanTreeNode { - constructor(e) { + constructor(line) { this.children = []; - if (e) { - this.isLeaf = !0; - this.rangeLength = e.rangeLength; - this.rangeLow = e.rangeLow; - this.isLowerRange = e.isLowerRange; - this.isOOB = e.isOOB; - } else this.isLeaf = !1; - } - buildTree(e, t) { - const i = (e.prefixCode >> t) & 1; - if (t <= 0) this.children[i] = new HuffmanTreeNode(e); - else { - let a = this.children[i]; - a || (this.children[i] = a = new HuffmanTreeNode(null)); - a.buildTree(e, t - 1); + if (line) { + this.isLeaf = true; + this.rangeLength = line.rangeLength; + this.rangeLow = line.rangeLow; + this.isLowerRange = line.isLowerRange; + this.isOOB = line.isOOB; + } else { + this.isLeaf = false; } } - decodeNode(e) { + buildTree(line, shift) { + const bit = (line.prefixCode >> shift) & 1; + if (shift <= 0) { + this.children[bit] = new HuffmanTreeNode(line); + } else { + let node = this.children[bit]; + if (!node) { + this.children[bit] = node = new HuffmanTreeNode(null); + } + node.buildTree(line, shift - 1); + } + } + decodeNode(reader) { if (this.isLeaf) { - if (this.isOOB) return null; - const t = e.readBits(this.rangeLength); - return this.rangeLow + (this.isLowerRange ? -t : t); + if (this.isOOB) { + return null; + } + const htOffset = reader.readBits(this.rangeLength); + return this.rangeLow + (this.isLowerRange ? -htOffset : htOffset); } - const t = this.children[e.readBit()]; - if (!t) throw new Jbig2Error("invalid Huffman data"); - return t.decodeNode(e); + const node = this.children[reader.readBit()]; + if (!node) { + throw new Jbig2Error("invalid Huffman data"); + } + return node.decodeNode(reader); } } class HuffmanTable { - constructor(e, t) { - t || this.assignPrefixCodes(e); + constructor(lines, prefixCodesDone) { + if (!prefixCodesDone) { + this.assignPrefixCodes(lines); + } this.rootNode = new HuffmanTreeNode(null); - for (let t = 0, i = e.length; t < i; t++) { - const i = e[t]; - i.prefixLength > 0 && this.rootNode.buildTree(i, i.prefixLength - 1); + for (let i = 0, ii = lines.length; i < ii; i++) { + const line = lines[i]; + if (line.prefixLength > 0) { + this.rootNode.buildTree(line, line.prefixLength - 1); + } } } - decode(e) { - return this.rootNode.decodeNode(e); + decode(reader) { + return this.rootNode.decodeNode(reader); } - assignPrefixCodes(e) { - const t = e.length; - let i = 0; - for (let a = 0; a < t; a++) i = Math.max(i, e[a].prefixLength); - const a = new Uint32Array(i + 1); - for (let i = 0; i < t; i++) a[e[i].prefixLength]++; - let s, - r, - n, - g = 1, - o = 0; - a[0] = 0; - for (; g <= i; ) { - o = (o + a[g - 1]) << 1; - s = o; - r = 0; - for (; r < t; ) { - n = e[r]; - if (n.prefixLength === g) { - n.prefixCode = s; - s++; + assignPrefixCodes(lines) { + const linesLength = lines.length; + let prefixLengthMax = 0; + for (let i = 0; i < linesLength; i++) { + prefixLengthMax = Math.max(prefixLengthMax, lines[i].prefixLength); + } + const histogram = new Uint32Array(prefixLengthMax + 1); + for (let i = 0; i < linesLength; i++) { + histogram[lines[i].prefixLength]++; + } + let currentLength = 1, + firstCode = 0, + currentCode, + currentTemp, + line; + histogram[0] = 0; + while (currentLength <= prefixLengthMax) { + firstCode = (firstCode + histogram[currentLength - 1]) << 1; + currentCode = firstCode; + currentTemp = 0; + while (currentTemp < linesLength) { + line = lines[currentTemp]; + if (line.prefixLength === currentLength) { + line.prefixCode = currentCode; + currentCode++; } - r++; + currentTemp++; } - g++; + currentLength++; } } } -const _t = {}; -function getStandardTable(e) { - let t, - i = _t[e]; - if (i) return i; - switch (e) { +function decodeTablesSegment(data, start, end) { + const flags = data[start]; + const lowestValue = readUint32(data, start + 1) & 0xffffffff; + const highestValue = readUint32(data, start + 5) & 0xffffffff; + const reader = new Reader(data, start + 9, end); + const prefixSizeBits = ((flags >> 1) & 7) + 1; + const rangeSizeBits = ((flags >> 4) & 7) + 1; + const lines = []; + let prefixLength, + rangeLength, + currentRangeLow = lowestValue; + do { + prefixLength = reader.readBits(prefixSizeBits); + rangeLength = reader.readBits(rangeSizeBits); + lines.push( + new HuffmanLine([currentRangeLow, prefixLength, rangeLength, 0]), + ); + currentRangeLow += 1 << rangeLength; + } while (currentRangeLow < highestValue); + prefixLength = reader.readBits(prefixSizeBits); + lines.push(new HuffmanLine([lowestValue - 1, prefixLength, 32, 0, "lower"])); + prefixLength = reader.readBits(prefixSizeBits); + lines.push(new HuffmanLine([highestValue, prefixLength, 32, 0])); + if (flags & 1) { + prefixLength = reader.readBits(prefixSizeBits); + lines.push(new HuffmanLine([prefixLength, 0])); + } + return new HuffmanTable(lines, false); +} +const standardTablesCache = {}; +function getStandardTable(number) { + let table = standardTablesCache[number]; + if (table) { + return table; + } + let lines; + switch (number) { case 1: - t = [ - [0, 1, 4, 0], - [16, 2, 8, 2], - [272, 3, 16, 6], - [65808, 3, 32, 7], + lines = [ + [0, 1, 4, 0x0], + [16, 2, 8, 0x2], + [272, 3, 16, 0x6], + [65808, 3, 32, 0x7], ]; break; case 2: - t = [ - [0, 1, 0, 0], - [1, 2, 0, 2], - [2, 3, 0, 6], - [3, 4, 3, 14], - [11, 5, 6, 30], - [75, 6, 32, 62], - [6, 63], + lines = [ + [0, 1, 0, 0x0], + [1, 2, 0, 0x2], + [2, 3, 0, 0x6], + [3, 4, 3, 0xe], + [11, 5, 6, 0x1e], + [75, 6, 32, 0x3e], + [6, 0x3f], ]; break; case 3: - t = [ - [-256, 8, 8, 254], - [0, 1, 0, 0], - [1, 2, 0, 2], - [2, 3, 0, 6], - [3, 4, 3, 14], - [11, 5, 6, 30], - [-257, 8, 32, 255, "lower"], - [75, 7, 32, 126], - [6, 62], + lines = [ + [-256, 8, 8, 0xfe], + [0, 1, 0, 0x0], + [1, 2, 0, 0x2], + [2, 3, 0, 0x6], + [3, 4, 3, 0xe], + [11, 5, 6, 0x1e], + [-257, 8, 32, 0xff, "lower"], + [75, 7, 32, 0x7e], + [6, 0x3e], ]; break; case 4: - t = [ - [1, 1, 0, 0], - [2, 2, 0, 2], - [3, 3, 0, 6], - [4, 4, 3, 14], - [12, 5, 6, 30], - [76, 5, 32, 31], + lines = [ + [1, 1, 0, 0x0], + [2, 2, 0, 0x2], + [3, 3, 0, 0x6], + [4, 4, 3, 0xe], + [12, 5, 6, 0x1e], + [76, 5, 32, 0x1f], ]; break; case 5: - t = [ - [-255, 7, 8, 126], - [1, 1, 0, 0], - [2, 2, 0, 2], - [3, 3, 0, 6], - [4, 4, 3, 14], - [12, 5, 6, 30], - [-256, 7, 32, 127, "lower"], - [76, 6, 32, 62], + lines = [ + [-255, 7, 8, 0x7e], + [1, 1, 0, 0x0], + [2, 2, 0, 0x2], + [3, 3, 0, 0x6], + [4, 4, 3, 0xe], + [12, 5, 6, 0x1e], + [-256, 7, 32, 0x7f, "lower"], + [76, 6, 32, 0x3e], ]; break; case 6: - t = [ - [-2048, 5, 10, 28], - [-1024, 4, 9, 8], - [-512, 4, 8, 9], - [-256, 4, 7, 10], - [-128, 5, 6, 29], - [-64, 5, 5, 30], - [-32, 4, 5, 11], - [0, 2, 7, 0], - [128, 3, 7, 2], - [256, 3, 8, 3], - [512, 4, 9, 12], - [1024, 4, 10, 13], - [-2049, 6, 32, 62, "lower"], - [2048, 6, 32, 63], + lines = [ + [-2048, 5, 10, 0x1c], + [-1024, 4, 9, 0x8], + [-512, 4, 8, 0x9], + [-256, 4, 7, 0xa], + [-128, 5, 6, 0x1d], + [-64, 5, 5, 0x1e], + [-32, 4, 5, 0xb], + [0, 2, 7, 0x0], + [128, 3, 7, 0x2], + [256, 3, 8, 0x3], + [512, 4, 9, 0xc], + [1024, 4, 10, 0xd], + [-2049, 6, 32, 0x3e, "lower"], + [2048, 6, 32, 0x3f], ]; break; case 7: - t = [ - [-1024, 4, 9, 8], - [-512, 3, 8, 0], - [-256, 4, 7, 9], - [-128, 5, 6, 26], - [-64, 5, 5, 27], - [-32, 4, 5, 10], - [0, 4, 5, 11], - [32, 5, 5, 28], - [64, 5, 6, 29], - [128, 4, 7, 12], - [256, 3, 8, 1], - [512, 3, 9, 2], - [1024, 3, 10, 3], - [-1025, 5, 32, 30, "lower"], - [2048, 5, 32, 31], + lines = [ + [-1024, 4, 9, 0x8], + [-512, 3, 8, 0x0], + [-256, 4, 7, 0x9], + [-128, 5, 6, 0x1a], + [-64, 5, 5, 0x1b], + [-32, 4, 5, 0xa], + [0, 4, 5, 0xb], + [32, 5, 5, 0x1c], + [64, 5, 6, 0x1d], + [128, 4, 7, 0xc], + [256, 3, 8, 0x1], + [512, 3, 9, 0x2], + [1024, 3, 10, 0x3], + [-1025, 5, 32, 0x1e, "lower"], + [2048, 5, 32, 0x1f], ]; break; case 8: - t = [ - [-15, 8, 3, 252], - [-7, 9, 1, 508], - [-5, 8, 1, 253], - [-3, 9, 0, 509], - [-2, 7, 0, 124], - [-1, 4, 0, 10], - [0, 2, 1, 0], - [2, 5, 0, 26], - [3, 6, 0, 58], - [4, 3, 4, 4], - [20, 6, 1, 59], - [22, 4, 4, 11], - [38, 4, 5, 12], - [70, 5, 6, 27], - [134, 5, 7, 28], - [262, 6, 7, 60], - [390, 7, 8, 125], - [646, 6, 10, 61], - [-16, 9, 32, 510, "lower"], - [1670, 9, 32, 511], - [2, 1], + lines = [ + [-15, 8, 3, 0xfc], + [-7, 9, 1, 0x1fc], + [-5, 8, 1, 0xfd], + [-3, 9, 0, 0x1fd], + [-2, 7, 0, 0x7c], + [-1, 4, 0, 0xa], + [0, 2, 1, 0x0], + [2, 5, 0, 0x1a], + [3, 6, 0, 0x3a], + [4, 3, 4, 0x4], + [20, 6, 1, 0x3b], + [22, 4, 4, 0xb], + [38, 4, 5, 0xc], + [70, 5, 6, 0x1b], + [134, 5, 7, 0x1c], + [262, 6, 7, 0x3c], + [390, 7, 8, 0x7d], + [646, 6, 10, 0x3d], + [-16, 9, 32, 0x1fe, "lower"], + [1670, 9, 32, 0x1ff], + [2, 0x1], ]; break; case 9: - t = [ - [-31, 8, 4, 252], - [-15, 9, 2, 508], - [-11, 8, 2, 253], - [-7, 9, 1, 509], - [-5, 7, 1, 124], - [-3, 4, 1, 10], - [-1, 3, 1, 2], - [1, 3, 1, 3], - [3, 5, 1, 26], - [5, 6, 1, 58], - [7, 3, 5, 4], - [39, 6, 2, 59], - [43, 4, 5, 11], - [75, 4, 6, 12], - [139, 5, 7, 27], - [267, 5, 8, 28], - [523, 6, 8, 60], - [779, 7, 9, 125], - [1291, 6, 11, 61], - [-32, 9, 32, 510, "lower"], - [3339, 9, 32, 511], - [2, 0], + lines = [ + [-31, 8, 4, 0xfc], + [-15, 9, 2, 0x1fc], + [-11, 8, 2, 0xfd], + [-7, 9, 1, 0x1fd], + [-5, 7, 1, 0x7c], + [-3, 4, 1, 0xa], + [-1, 3, 1, 0x2], + [1, 3, 1, 0x3], + [3, 5, 1, 0x1a], + [5, 6, 1, 0x3a], + [7, 3, 5, 0x4], + [39, 6, 2, 0x3b], + [43, 4, 5, 0xb], + [75, 4, 6, 0xc], + [139, 5, 7, 0x1b], + [267, 5, 8, 0x1c], + [523, 6, 8, 0x3c], + [779, 7, 9, 0x7d], + [1291, 6, 11, 0x3d], + [-32, 9, 32, 0x1fe, "lower"], + [3339, 9, 32, 0x1ff], + [2, 0x0], ]; break; case 10: - t = [ - [-21, 7, 4, 122], - [-5, 8, 0, 252], - [-4, 7, 0, 123], - [-3, 5, 0, 24], - [-2, 2, 2, 0], - [2, 5, 0, 25], - [3, 6, 0, 54], - [4, 7, 0, 124], - [5, 8, 0, 253], - [6, 2, 6, 1], - [70, 5, 5, 26], - [102, 6, 5, 55], - [134, 6, 6, 56], - [198, 6, 7, 57], - [326, 6, 8, 58], - [582, 6, 9, 59], - [1094, 6, 10, 60], - [2118, 7, 11, 125], - [-22, 8, 32, 254, "lower"], - [4166, 8, 32, 255], - [2, 2], + lines = [ + [-21, 7, 4, 0x7a], + [-5, 8, 0, 0xfc], + [-4, 7, 0, 0x7b], + [-3, 5, 0, 0x18], + [-2, 2, 2, 0x0], + [2, 5, 0, 0x19], + [3, 6, 0, 0x36], + [4, 7, 0, 0x7c], + [5, 8, 0, 0xfd], + [6, 2, 6, 0x1], + [70, 5, 5, 0x1a], + [102, 6, 5, 0x37], + [134, 6, 6, 0x38], + [198, 6, 7, 0x39], + [326, 6, 8, 0x3a], + [582, 6, 9, 0x3b], + [1094, 6, 10, 0x3c], + [2118, 7, 11, 0x7d], + [-22, 8, 32, 0xfe, "lower"], + [4166, 8, 32, 0xff], + [2, 0x2], ]; break; case 11: - t = [ - [1, 1, 0, 0], - [2, 2, 1, 2], - [4, 4, 0, 12], - [5, 4, 1, 13], - [7, 5, 1, 28], - [9, 5, 2, 29], - [13, 6, 2, 60], - [17, 7, 2, 122], - [21, 7, 3, 123], - [29, 7, 4, 124], - [45, 7, 5, 125], - [77, 7, 6, 126], - [141, 7, 32, 127], + lines = [ + [1, 1, 0, 0x0], + [2, 2, 1, 0x2], + [4, 4, 0, 0xc], + [5, 4, 1, 0xd], + [7, 5, 1, 0x1c], + [9, 5, 2, 0x1d], + [13, 6, 2, 0x3c], + [17, 7, 2, 0x7a], + [21, 7, 3, 0x7b], + [29, 7, 4, 0x7c], + [45, 7, 5, 0x7d], + [77, 7, 6, 0x7e], + [141, 7, 32, 0x7f], ]; break; case 12: - t = [ - [1, 1, 0, 0], - [2, 2, 0, 2], - [3, 3, 1, 6], - [5, 5, 0, 28], - [6, 5, 1, 29], - [8, 6, 1, 60], - [10, 7, 0, 122], - [11, 7, 1, 123], - [13, 7, 2, 124], - [17, 7, 3, 125], - [25, 7, 4, 126], - [41, 8, 5, 254], - [73, 8, 32, 255], + lines = [ + [1, 1, 0, 0x0], + [2, 2, 0, 0x2], + [3, 3, 1, 0x6], + [5, 5, 0, 0x1c], + [6, 5, 1, 0x1d], + [8, 6, 1, 0x3c], + [10, 7, 0, 0x7a], + [11, 7, 1, 0x7b], + [13, 7, 2, 0x7c], + [17, 7, 3, 0x7d], + [25, 7, 4, 0x7e], + [41, 8, 5, 0xfe], + [73, 8, 32, 0xff], ]; break; case 13: - t = [ - [1, 1, 0, 0], - [2, 3, 0, 4], - [3, 4, 0, 12], - [4, 5, 0, 28], - [5, 4, 1, 13], - [7, 3, 3, 5], - [15, 6, 1, 58], - [17, 6, 2, 59], - [21, 6, 3, 60], - [29, 6, 4, 61], - [45, 6, 5, 62], - [77, 7, 6, 126], - [141, 7, 32, 127], + lines = [ + [1, 1, 0, 0x0], + [2, 3, 0, 0x4], + [3, 4, 0, 0xc], + [4, 5, 0, 0x1c], + [5, 4, 1, 0xd], + [7, 3, 3, 0x5], + [15, 6, 1, 0x3a], + [17, 6, 2, 0x3b], + [21, 6, 3, 0x3c], + [29, 6, 4, 0x3d], + [45, 6, 5, 0x3e], + [77, 7, 6, 0x7e], + [141, 7, 32, 0x7f], ]; break; case 14: - t = [ - [-2, 3, 0, 4], - [-1, 3, 0, 5], - [0, 1, 0, 0], - [1, 3, 0, 6], - [2, 3, 0, 7], + lines = [ + [-2, 3, 0, 0x4], + [-1, 3, 0, 0x5], + [0, 1, 0, 0x0], + [1, 3, 0, 0x6], + [2, 3, 0, 0x7], ]; break; case 15: - t = [ - [-24, 7, 4, 124], - [-8, 6, 2, 60], - [-4, 5, 1, 28], - [-2, 4, 0, 12], - [-1, 3, 0, 4], - [0, 1, 0, 0], - [1, 3, 0, 5], - [2, 4, 0, 13], - [3, 5, 1, 29], - [5, 6, 2, 61], - [9, 7, 4, 125], - [-25, 7, 32, 126, "lower"], - [25, 7, 32, 127], + lines = [ + [-24, 7, 4, 0x7c], + [-8, 6, 2, 0x3c], + [-4, 5, 1, 0x1c], + [-2, 4, 0, 0xc], + [-1, 3, 0, 0x4], + [0, 1, 0, 0x0], + [1, 3, 0, 0x5], + [2, 4, 0, 0xd], + [3, 5, 1, 0x1d], + [5, 6, 2, 0x3d], + [9, 7, 4, 0x7d], + [-25, 7, 32, 0x7e, "lower"], + [25, 7, 32, 0x7f], ]; break; default: - throw new Jbig2Error(`standard table B.${e} does not exist`); + throw new Jbig2Error(`standard table B.${number} does not exist`); } - for (let e = 0, i = t.length; e < i; e++) t[e] = new HuffmanLine(t[e]); - i = new HuffmanTable(t, !0); - _t[e] = i; - return i; + for (let i = 0, ii = lines.length; i < ii; i++) { + lines[i] = new HuffmanLine(lines[i]); + } + table = new HuffmanTable(lines, true); + standardTablesCache[number] = table; + return table; } class Reader { - constructor(e, t, i) { - this.data = e; - this.start = t; - this.end = i; - this.position = t; + constructor(data, start, end) { + this.data = data; + this.start = start; + this.end = end; + this.position = start; this.shift = -1; this.currentByte = 0; } readBit() { if (this.shift < 0) { - if (this.position >= this.end) + if (this.position >= this.end) { throw new Jbig2Error("end of data while reading bit"); + } this.currentByte = this.data[this.position++]; this.shift = 7; } - const e = (this.currentByte >> this.shift) & 1; + const bit = (this.currentByte >> this.shift) & 1; this.shift--; - return e; + return bit; } - readBits(e) { - let t, - i = 0; - for (t = e - 1; t >= 0; t--) i |= this.readBit() << t; - return i; + readBits(numBits) { + let result = 0, + i; + for (i = numBits - 1; i >= 0; i--) { + result |= this.readBit() << i; + } + return result; } byteAlign() { this.shift = -1; } next() { - return this.position >= this.end ? -1 : this.data[this.position++]; + if (this.position >= this.end) { + return -1; + } + return this.data[this.position++]; } } -function getCustomHuffmanTable(e, t, i) { - let a = 0; - for (let s = 0, r = t.length; s < r; s++) { - const r = i[t[s]]; - if (r) { - if (e === a) return r; - a++; +function getCustomHuffmanTable(index, referredTo, customTables) { + let currentIndex = 0; + for (let i = 0, ii = referredTo.length; i < ii; i++) { + const table = customTables[referredTo[i]]; + if (table) { + if (index === currentIndex) { + return table; + } + currentIndex++; } } throw new Jbig2Error("can't find custom Huffman table"); } -function readUncompressedBitmap(e, t, i) { - const a = []; - for (let s = 0; s < i; s++) { - const i = new Uint8Array(t); - a.push(i); - for (let a = 0; a < t; a++) i[a] = e.readBit(); - e.byteAlign(); +function getTextRegionHuffmanTables( + textRegion, + referredTo, + customTables, + numberOfSymbols, + reader, +) { + const codes = []; + for (let i = 0; i <= 34; i++) { + const codeLength = reader.readBits(4); + codes.push(new HuffmanLine([i, codeLength, 0, 0])); } - return a; -} -function decodeMMRBitmap(e, t, i, a) { - const s = new CCITTFaxDecoder(e, { - K: -1, - Columns: t, - Rows: i, - BlackIs1: !0, - EndOfBlock: a, - }), - r = []; - let n, - g = !1; - for (let e = 0; e < i; e++) { - const e = new Uint8Array(t); - r.push(e); - let i = -1; - for (let a = 0; a < t; a++) { - if (i < 0) { - n = s.readNextChar(); - if (-1 === n) { - n = 0; - g = !0; - } - i = 7; + const runCodesTable = new HuffmanTable(codes, false); + codes.length = 0; + for (let i = 0; i < numberOfSymbols; ) { + const codeLength = runCodesTable.decode(reader); + if (codeLength >= 32) { + let repeatedLength, numberOfRepeats, j; + switch (codeLength) { + case 32: + if (i === 0) { + throw new Jbig2Error("no previous value in symbol ID table"); + } + numberOfRepeats = reader.readBits(2) + 3; + repeatedLength = codes[i - 1].prefixLength; + break; + case 33: + numberOfRepeats = reader.readBits(3) + 3; + repeatedLength = 0; + break; + case 34: + numberOfRepeats = reader.readBits(7) + 11; + repeatedLength = 0; + break; + default: + throw new Jbig2Error("invalid code length in symbol ID table"); } - e[a] = (n >> i) & 1; - i--; + for (j = 0; j < numberOfRepeats; j++) { + codes.push(new HuffmanLine([i, repeatedLength, 0, 0])); + i++; + } + } else { + codes.push(new HuffmanLine([i, codeLength, 0, 0])); + i++; } } - if (a && !g) { - const e = 5; - for (let t = 0; t < e && -1 !== s.readNextChar(); t++); + reader.byteAlign(); + const symbolIDTable = new HuffmanTable(codes, false); + let customIndex = 0, + tableFirstS, + tableDeltaS, + tableDeltaT; + switch (textRegion.huffmanFS) { + case 0: + case 1: + tableFirstS = getStandardTable(textRegion.huffmanFS + 6); + break; + case 3: + tableFirstS = getCustomHuffmanTable( + customIndex, + referredTo, + customTables, + ); + customIndex++; + break; + default: + throw new Jbig2Error("invalid Huffman FS selector"); } - return r; + switch (textRegion.huffmanDS) { + case 0: + case 1: + case 2: + tableDeltaS = getStandardTable(textRegion.huffmanDS + 8); + break; + case 3: + tableDeltaS = getCustomHuffmanTable( + customIndex, + referredTo, + customTables, + ); + customIndex++; + break; + default: + throw new Jbig2Error("invalid Huffman DS selector"); + } + switch (textRegion.huffmanDT) { + case 0: + case 1: + case 2: + tableDeltaT = getStandardTable(textRegion.huffmanDT + 11); + break; + case 3: + tableDeltaT = getCustomHuffmanTable( + customIndex, + referredTo, + customTables, + ); + customIndex++; + break; + default: + throw new Jbig2Error("invalid Huffman DT selector"); + } + if (textRegion.refinement) { + throw new Jbig2Error("refinement with Huffman is not supported"); + } + return { + symbolIDTable, + tableFirstS, + tableDeltaS, + tableDeltaT, + }; +} +function getSymbolDictionaryHuffmanTables( + dictionary, + referredTo, + customTables, +) { + let customIndex = 0, + tableDeltaHeight, + tableDeltaWidth; + switch (dictionary.huffmanDHSelector) { + case 0: + case 1: + tableDeltaHeight = getStandardTable(dictionary.huffmanDHSelector + 4); + break; + case 3: + tableDeltaHeight = getCustomHuffmanTable( + customIndex, + referredTo, + customTables, + ); + customIndex++; + break; + default: + throw new Jbig2Error("invalid Huffman DH selector"); + } + switch (dictionary.huffmanDWSelector) { + case 0: + case 1: + tableDeltaWidth = getStandardTable(dictionary.huffmanDWSelector + 2); + break; + case 3: + tableDeltaWidth = getCustomHuffmanTable( + customIndex, + referredTo, + customTables, + ); + customIndex++; + break; + default: + throw new Jbig2Error("invalid Huffman DW selector"); + } + let tableBitmapSize, tableAggregateInstances; + if (dictionary.bitmapSizeSelector) { + tableBitmapSize = getCustomHuffmanTable( + customIndex, + referredTo, + customTables, + ); + customIndex++; + } else { + tableBitmapSize = getStandardTable(1); + } + if (dictionary.aggregationInstancesSelector) { + tableAggregateInstances = getCustomHuffmanTable( + customIndex, + referredTo, + customTables, + ); + } else { + tableAggregateInstances = getStandardTable(1); + } + return { + tableDeltaHeight, + tableDeltaWidth, + tableBitmapSize, + tableAggregateInstances, + }; +} +function readUncompressedBitmap(reader, width, height) { + const bitmap = []; + for (let y = 0; y < height; y++) { + const row = new Uint8Array(width); + bitmap.push(row); + for (let x = 0; x < width; x++) { + row[x] = reader.readBit(); + } + reader.byteAlign(); + } + return bitmap; +} +function decodeMMRBitmap(input, width, height, endOfBlock) { + const params = { + K: -1, + Columns: width, + Rows: height, + BlackIs1: true, + EndOfBlock: endOfBlock, + }; + const decoder = new CCITTFaxDecoder(input, params); + const bitmap = []; + let currentByte, + eof = false; + for (let y = 0; y < height; y++) { + const row = new Uint8Array(width); + bitmap.push(row); + let shift = -1; + for (let x = 0; x < width; x++) { + if (shift < 0) { + currentByte = decoder.readNextChar(); + if (currentByte === -1) { + currentByte = 0; + eof = true; + } + shift = 7; + } + row[x] = (currentByte >> shift) & 1; + shift--; + } + } + if (endOfBlock && !eof) { + const lookForEOFLimit = 5; + for (let i = 0; i < lookForEOFLimit; i++) { + if (decoder.readNextChar() === -1) { + break; + } + } + } + return bitmap; } class Jbig2Image { - parseChunks(e) { - return (function parseJbig2Chunks(e) { - const t = new SimpleSegmentVisitor(); - for (let i = 0, a = e.length; i < a; i++) { - const a = e[i]; - processSegments(readSegments({}, a.data, a.start, a.end), t); - } - return t.buffer; - })(e); + parseChunks(chunks) { + return parseJbig2Chunks(chunks); } - parse(e) { + parse(data) { throw new Error("Not implemented: Jbig2Image.parse"); } -} +} // ./src/core/jbig2_stream.js + class Jbig2Stream extends DecodeStream { - constructor(e, t, i) { - super(t); - this.stream = e; - this.dict = e.dict; - this.maybeLength = t; - this.params = i; + constructor(stream, maybeLength, params) { + super(maybeLength); + this.stream = stream; + this.dict = stream.dict; + this.maybeLength = maybeLength; + this.params = params; } get bytes() { return shadow(this, "bytes", this.stream.getBytes(this.maybeLength)); } - ensureBuffer(e) {} + ensureBuffer(requested) {} readBlock() { this.decodeImage(); } - decodeImage(e) { - if (this.eof) return this.buffer; - e ||= this.bytes; - const t = new Jbig2Image(), - i = []; + decodeImage(bytes) { + if (this.eof) { + return this.buffer; + } + bytes ||= this.bytes; + const jbig2Image = new Jbig2Image(); + const chunks = []; if (this.params instanceof Dict) { - const e = this.params.get("JBIG2Globals"); - if (e instanceof BaseStream) { - const t = e.getBytes(); - i.push({ data: t, start: 0, end: t.length }); + const globalsStream = this.params.get("JBIG2Globals"); + if (globalsStream instanceof BaseStream) { + const globals = globalsStream.getBytes(); + chunks.push({ + data: globals, + start: 0, + end: globals.length, + }); } } - i.push({ data: e, start: 0, end: e.length }); - const a = t.parseChunks(i), - s = a.length; - for (let e = 0; e < s; e++) a[e] ^= 255; - this.buffer = a; - this.bufferLength = s; - this.eof = !0; + chunks.push({ + data: bytes, + start: 0, + end: bytes.length, + }); + const data = jbig2Image.parseChunks(chunks); + const dataLength = data.length; + for (let i = 0; i < dataLength; i++) { + data[i] ^= 0xff; + } + this.buffer = data; + this.bufferLength = dataLength; + this.eof = true; return this.buffer; } get canAsyncDecodeImageFromBuffer() { return this.stream.isAsync; } -} -function convertToRGBA(e) { - switch (e.kind) { - case D: - return convertBlackAndWhiteToRGBA(e); - case b: - return (function convertRGBToRGBA({ - src: e, - srcPos: t = 0, - dest: i, - destPos: a = 0, - width: s, - height: r, - }) { - let n = 0; - const g = e.length >> 2, - o = new Uint32Array(e.buffer, t, g); - if (FeatureTest.isLittleEndian) { - for (; n < g - 2; n += 3, a += 4) { - const e = o[n], - t = o[n + 1], - s = o[n + 2]; - i[a] = 4278190080 | e; - i[a + 1] = (e >>> 24) | (t << 8) | 4278190080; - i[a + 2] = (t >>> 16) | (s << 16) | 4278190080; - i[a + 3] = (s >>> 8) | 4278190080; - } - for (let t = 4 * n, s = e.length; t < s; t += 3) - i[a++] = e[t] | (e[t + 1] << 8) | (e[t + 2] << 16) | 4278190080; - } else { - for (; n < g - 2; n += 3, a += 4) { - const e = o[n], - t = o[n + 1], - s = o[n + 2]; - i[a] = 255 | e; - i[a + 1] = (e << 24) | (t >>> 8) | 255; - i[a + 2] = (t << 16) | (s >>> 16) | 255; - i[a + 3] = (s << 8) | 255; - } - for (let t = 4 * n, s = e.length; t < s; t += 3) - i[a++] = (e[t] << 24) | (e[t + 1] << 16) | (e[t + 2] << 8) | 255; - } - return { srcPos: t, destPos: a }; - })(e); +} // ./src/shared/image_utils.js + +function convertToRGBA(params) { + switch (params.kind) { + case ImageKind.GRAYSCALE_1BPP: + return convertBlackAndWhiteToRGBA(params); + case ImageKind.RGB_24BPP: + return convertRGBToRGBA(params); } return null; } function convertBlackAndWhiteToRGBA({ - src: e, - srcPos: t = 0, - dest: i, - width: a, - height: s, - nonBlackColor: r = 4294967295, - inverseDecode: n = !1, + src, + srcPos = 0, + dest, + width, + height, + nonBlackColor = 0xffffffff, + inverseDecode = false, }) { - const g = FeatureTest.isLittleEndian ? 4278190080 : 255, - [o, c] = n ? [r, g] : [g, r], - C = a >> 3, - h = 7 & a, - l = e.length; - i = new Uint32Array(i.buffer); - let Q = 0; - for (let a = 0; a < s; a++) { - for (const a = t + C; t < a; t++) { - const a = t < l ? e[t] : 255; - i[Q++] = 128 & a ? c : o; - i[Q++] = 64 & a ? c : o; - i[Q++] = 32 & a ? c : o; - i[Q++] = 16 & a ? c : o; - i[Q++] = 8 & a ? c : o; - i[Q++] = 4 & a ? c : o; - i[Q++] = 2 & a ? c : o; - i[Q++] = 1 & a ? c : o; + const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff; + const [zeroMapping, oneMapping] = inverseDecode + ? [nonBlackColor, black] + : [black, nonBlackColor]; + const widthInSource = width >> 3; + const widthRemainder = width & 7; + const srcLength = src.length; + dest = new Uint32Array(dest.buffer); + let destPos = 0; + for (let i = 0; i < height; i++) { + for (const max = srcPos + widthInSource; srcPos < max; srcPos++) { + const elem = srcPos < srcLength ? src[srcPos] : 255; + dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping; + } + if (widthRemainder === 0) { + continue; + } + const elem = srcPos < srcLength ? src[srcPos++] : 255; + for (let j = 0; j < widthRemainder; j++) { + dest[destPos++] = elem & (1 << (7 - j)) ? oneMapping : zeroMapping; } - if (0 === h) continue; - const a = t < l ? e[t++] : 255; - for (let e = 0; e < h; e++) i[Q++] = a & (1 << (7 - e)) ? c : o; } - return { srcPos: t, destPos: Q }; + return { + srcPos, + destPos, + }; } -class JpegError extends rt { - constructor(e) { - super(e, "JpegError"); +function convertRGBToRGBA({ + src, + srcPos = 0, + dest, + destPos = 0, + width, + height, +}) { + let i = 0; + const len32 = src.length >> 2; + const src32 = new Uint32Array(src.buffer, srcPos, len32); + if (FeatureTest.isLittleEndian) { + for (; i < len32 - 2; i += 3, destPos += 4) { + const s1 = src32[i]; + const s2 = src32[i + 1]; + const s3 = src32[i + 2]; + dest[destPos] = s1 | 0xff000000; + dest[destPos + 1] = (s1 >>> 24) | (s2 << 8) | 0xff000000; + dest[destPos + 2] = (s2 >>> 16) | (s3 << 16) | 0xff000000; + dest[destPos + 3] = (s3 >>> 8) | 0xff000000; + } + for (let j = i * 4, jj = src.length; j < jj; j += 3) { + dest[destPos++] = + src[j] | (src[j + 1] << 8) | (src[j + 2] << 16) | 0xff000000; + } + } else { + for (; i < len32 - 2; i += 3, destPos += 4) { + const s1 = src32[i]; + const s2 = src32[i + 1]; + const s3 = src32[i + 2]; + dest[destPos] = s1 | 0xff; + dest[destPos + 1] = (s1 << 24) | (s2 >>> 8) | 0xff; + dest[destPos + 2] = (s2 << 16) | (s3 >>> 16) | 0xff; + dest[destPos + 3] = (s3 << 8) | 0xff; + } + for (let j = i * 4, jj = src.length; j < jj; j += 3) { + dest[destPos++] = + (src[j] << 24) | (src[j + 1] << 16) | (src[j + 2] << 8) | 0xff; + } + } + return { + srcPos, + destPos, + }; +} +function grayToRGBA(src, dest) { + if (FeatureTest.isLittleEndian) { + for (let i = 0, ii = src.length; i < ii; i++) { + dest[i] = (src[i] * 0x10101) | 0xff000000; + } + } else { + for (let i = 0, ii = src.length; i < ii; i++) { + dest[i] = (src[i] * 0x1010100) | 0x000000ff; + } + } +} // ./src/core/jpg.js + +class JpegError extends BaseException { + constructor(msg) { + super(msg, "JpegError"); } } -class DNLMarkerError extends rt { - constructor(e, t) { - super(e, "DNLMarkerError"); - this.scanLines = t; +class DNLMarkerError extends BaseException { + constructor(message, scanLines) { + super(message, "DNLMarkerError"); + this.scanLines = scanLines; } } -class EOIMarkerError extends rt { - constructor(e) { - super(e, "EOIMarkerError"); +class EOIMarkerError extends BaseException { + constructor(msg) { + super(msg, "EOIMarkerError"); } } -const $t = new Uint8Array([ - 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, - 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, - 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, - 54, 47, 55, 62, 63, - ]), - Ai = 4017, - ei = 799, - ti = 3406, - ii = 2276, - ai = 1567, - si = 3784, - ri = 5793, - ni = 2896; -function buildHuffmanTable(e, t) { - let i, - a, - s = 0, - r = 16; - for (; r > 0 && !e[r - 1]; ) r--; - const n = [{ children: [], index: 0 }]; - let g, - o = n[0]; - for (i = 0; i < r; i++) { - for (a = 0; a < e[i]; a++) { - o = n.pop(); - o.children[o.index] = t[s]; - for (; o.index > 0; ) o = n.pop(); - o.index++; - n.push(o); - for (; n.length <= i; ) { - n.push((g = { children: [], index: 0 })); - o.children[o.index] = g.children; - o = g; +const dctZigZag = new Uint8Array([ + 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, + 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, + 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, + 47, 55, 62, 63, +]); +const dctCos1 = 4017; +const dctSin1 = 799; +const dctCos3 = 3406; +const dctSin3 = 2276; +const dctCos6 = 1567; +const dctSin6 = 3784; +const dctSqrt2 = 5793; +const dctSqrt1d2 = 2896; +function buildHuffmanTable(codeLengths, values) { + let k = 0, + i, + j, + length = 16; + while (length > 0 && !codeLengths[length - 1]) { + length--; + } + const code = [ + { + children: [], + index: 0, + }, + ]; + let p = code[0], + q; + for (i = 0; i < length; i++) { + for (j = 0; j < codeLengths[i]; j++) { + p = code.pop(); + p.children[p.index] = values[k]; + while (p.index > 0) { + p = code.pop(); } - s++; + p.index++; + code.push(p); + while (code.length <= i) { + code.push( + (q = { + children: [], + index: 0, + }), + ); + p.children[p.index] = q.children; + p = q; + } + k++; } - if (i + 1 < r) { - n.push((g = { children: [], index: 0 })); - o.children[o.index] = g.children; - o = g; + if (i + 1 < length) { + code.push( + (q = { + children: [], + index: 0, + }), + ); + p.children[p.index] = q.children; + p = q; } } - return n[0].children; + return code[0].children; } -function getBlockBufferOffset(e, t, i) { - return 64 * ((e.blocksPerLine + 1) * t + i); +function getBlockBufferOffset(component, row, col) { + return 64 * ((component.blocksPerLine + 1) * row + col); } -function decodeScan(e, t, i, a, s, r, n, g, o, c = !1) { - const C = i.mcusPerLine, - h = i.progressive, - l = t; - let Q = 0, - E = 0; +function decodeScan( + data, + offset, + frame, + components, + resetInterval, + spectralStart, + spectralEnd, + successivePrev, + successive, + parseDNLMarker = false, +) { + const mcusPerLine = frame.mcusPerLine; + const progressive = frame.progressive; + const startOffset = offset; + let bitsData = 0, + bitsCount = 0; function readBit() { - if (E > 0) { - E--; - return (Q >> E) & 1; + if (bitsCount > 0) { + bitsCount--; + return (bitsData >> bitsCount) & 1; } - Q = e[t++]; - if (255 === Q) { - const a = e[t++]; - if (a) { - if (220 === a && c) { - const a = readUint16(e, (t += 2)); - t += 2; - if (a > 0 && a !== i.scanLines) + bitsData = data[offset++]; + if (bitsData === 0xff) { + const nextByte = data[offset++]; + if (nextByte) { + if (nextByte === 0xdc && parseDNLMarker) { + offset += 2; + const scanLines = readUint16(data, offset); + offset += 2; + if (scanLines > 0 && scanLines !== frame.scanLines) { throw new DNLMarkerError( "Found DNL marker (0xFFDC) while parsing scan data", - a, + scanLines, ); - } else if (217 === a) { - if (c) { - const e = p * (8 === i.precision ? 8 : 0); - if (e > 0 && Math.round(i.scanLines / e) >= 5) + } + } else if (nextByte === 0xd9) { + if (parseDNLMarker) { + const maybeScanLines = blockRow * (frame.precision === 8 ? 8 : 0); + if ( + maybeScanLines > 0 && + Math.round(frame.scanLines / maybeScanLines) >= 5 + ) { throw new DNLMarkerError( - "Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter", - e, + "Found EOI marker (0xFFD9) while parsing scan data, " + + "possibly caused by incorrect `scanLines` parameter", + maybeScanLines, ); + } } throw new EOIMarkerError( "Found EOI marker (0xFFD9) while parsing scan data", ); } - throw new JpegError(`unexpected marker ${((Q << 8) | a).toString(16)}`); + throw new JpegError( + `unexpected marker ${((bitsData << 8) | nextByte).toString(16)}`, + ); } } - E = 7; - return Q >>> 7; + bitsCount = 7; + return bitsData >>> 7; } - function decodeHuffman(e) { - let t = e; - for (;;) { - t = t[readBit()]; - switch (typeof t) { + function decodeHuffman(tree) { + let node = tree; + while (true) { + node = node[readBit()]; + switch (typeof node) { case "number": - return t; + return node; case "object": continue; } throw new JpegError("invalid huffman sequence"); } } - function receive(e) { - let t = 0; - for (; e > 0; ) { - t = (t << 1) | readBit(); - e--; + function receive(length) { + let n = 0; + while (length > 0) { + n = (n << 1) | readBit(); + length--; } - return t; + return n; } - function receiveAndExtend(e) { - if (1 === e) return 1 === readBit() ? 1 : -1; - const t = receive(e); - return t >= 1 << (e - 1) ? t : t + (-1 << e) + 1; - } - let u = 0; - let d, - f = 0; - let p = 0; - function decodeMcu(e, t, i, a, s) { - const r = i % C; - p = ((i / C) | 0) * e.v + a; - const n = r * e.h + s; - t(e, getBlockBufferOffset(e, p, n)); - } - function decodeBlock(e, t, i) { - p = (i / e.blocksPerLine) | 0; - const a = i % e.blocksPerLine; - t(e, getBlockBufferOffset(e, p, a)); - } - const m = a.length; - let y, w, D, b, F, S; - S = h - ? 0 === r - ? 0 === g - ? function decodeDCFirst(e, t) { - const i = decodeHuffman(e.huffmanTableDC), - a = 0 === i ? 0 : receiveAndExtend(i) << o; - e.blockData[t] = e.pred += a; - } - : function decodeDCSuccessive(e, t) { - e.blockData[t] |= readBit() << o; - } - : 0 === g - ? function decodeACFirst(e, t) { - if (u > 0) { - u--; - return; - } - let i = r; - const a = n; - for (; i <= a; ) { - const a = decodeHuffman(e.huffmanTableAC), - s = 15 & a, - r = a >> 4; - if (0 === s) { - if (r < 15) { - u = receive(r) + (1 << r) - 1; - break; - } - i += 16; - continue; - } - i += r; - const n = $t[i]; - e.blockData[t + n] = receiveAndExtend(s) * (1 << o); - i++; - } - } - : function decodeACSuccessive(e, t) { - let i = r; - const a = n; - let s, - g, - c = 0; - for (; i <= a; ) { - const a = t + $t[i], - r = e.blockData[a] < 0 ? -1 : 1; - switch (f) { - case 0: - g = decodeHuffman(e.huffmanTableAC); - s = 15 & g; - c = g >> 4; - if (0 === s) - if (c < 15) { - u = receive(c) + (1 << c); - f = 4; - } else { - c = 16; - f = 1; - } - else { - if (1 !== s) throw new JpegError("invalid ACn encoding"); - d = receiveAndExtend(s); - f = c ? 2 : 3; - } - continue; - case 1: - case 2: - if (e.blockData[a]) e.blockData[a] += r * (readBit() << o); - else { - c--; - 0 === c && (f = 2 === f ? 3 : 0); - } - break; - case 3: - if (e.blockData[a]) e.blockData[a] += r * (readBit() << o); - else { - e.blockData[a] = d << o; - f = 0; - } - break; - case 4: - e.blockData[a] && (e.blockData[a] += r * (readBit() << o)); - } - i++; - } - if (4 === f) { - u--; - 0 === u && (f = 0); - } - } - : function decodeBaseline(e, t) { - const i = decodeHuffman(e.huffmanTableDC), - a = 0 === i ? 0 : receiveAndExtend(i); - e.blockData[t] = e.pred += a; - let s = 1; - for (; s < 64; ) { - const i = decodeHuffman(e.huffmanTableAC), - a = 15 & i, - r = i >> 4; - if (0 === a) { - if (r < 15) break; - s += 16; - continue; - } - s += r; - const n = $t[s]; - e.blockData[t + n] = receiveAndExtend(a); - s++; - } - }; - let k, - R = 0; - const N = - 1 === m ? a[0].blocksPerLine * a[0].blocksPerColumn : C * i.mcusPerColumn; - let G, x; - for (; R <= N; ) { - const i = s ? Math.min(N - R, s) : N; - if (i > 0) { - for (w = 0; w < m; w++) a[w].pred = 0; - u = 0; - if (1 === m) { - y = a[0]; - for (F = 0; F < i; F++) { - decodeBlock(y, S, R); - R++; - } - } else - for (F = 0; F < i; F++) { - for (w = 0; w < m; w++) { - y = a[w]; - G = y.h; - x = y.v; - for (D = 0; D < x; D++) - for (b = 0; b < G; b++) decodeMcu(y, S, R, D, b); - } - R++; - } + function receiveAndExtend(length) { + if (length === 1) { + return readBit() === 1 ? 1 : -1; } - E = 0; - k = findNextFileMarker(e, t); - if (!k) break; - if (k.invalid) { + const n = receive(length); + if (n >= 1 << (length - 1)) { + return n; + } + return n + (-1 << length) + 1; + } + function decodeBaseline(component, blockOffset) { + const t = decodeHuffman(component.huffmanTableDC); + const diff = t === 0 ? 0 : receiveAndExtend(t); + component.blockData[blockOffset] = component.pred += diff; + let k = 1; + while (k < 64) { + const rs = decodeHuffman(component.huffmanTableAC); + const s = rs & 15, + r = rs >> 4; + if (s === 0) { + if (r < 15) { + break; + } + k += 16; + continue; + } + k += r; + const z = dctZigZag[k]; + component.blockData[blockOffset + z] = receiveAndExtend(s); + k++; + } + } + function decodeDCFirst(component, blockOffset) { + const t = decodeHuffman(component.huffmanTableDC); + const diff = t === 0 ? 0 : receiveAndExtend(t) << successive; + component.blockData[blockOffset] = component.pred += diff; + } + function decodeDCSuccessive(component, blockOffset) { + component.blockData[blockOffset] |= readBit() << successive; + } + let eobrun = 0; + function decodeACFirst(component, blockOffset) { + if (eobrun > 0) { + eobrun--; + return; + } + let k = spectralStart; + const e = spectralEnd; + while (k <= e) { + const rs = decodeHuffman(component.huffmanTableAC); + const s = rs & 15, + r = rs >> 4; + if (s === 0) { + if (r < 15) { + eobrun = receive(r) + (1 << r) - 1; + break; + } + k += 16; + continue; + } + k += r; + const z = dctZigZag[k]; + component.blockData[blockOffset + z] = + receiveAndExtend(s) * (1 << successive); + k++; + } + } + let successiveACState = 0, + successiveACNextValue; + function decodeACSuccessive(component, blockOffset) { + let k = spectralStart; + const e = spectralEnd; + let r = 0; + let s; + let rs; + while (k <= e) { + const offsetZ = blockOffset + dctZigZag[k]; + const sign = component.blockData[offsetZ] < 0 ? -1 : 1; + switch (successiveACState) { + case 0: + rs = decodeHuffman(component.huffmanTableAC); + s = rs & 15; + r = rs >> 4; + if (s === 0) { + if (r < 15) { + eobrun = receive(r) + (1 << r); + successiveACState = 4; + } else { + r = 16; + successiveACState = 1; + } + } else { + if (s !== 1) { + throw new JpegError("invalid ACn encoding"); + } + successiveACNextValue = receiveAndExtend(s); + successiveACState = r ? 2 : 3; + } + continue; + case 1: + case 2: + if (component.blockData[offsetZ]) { + component.blockData[offsetZ] += sign * (readBit() << successive); + } else { + r--; + if (r === 0) { + successiveACState = successiveACState === 2 ? 3 : 0; + } + } + break; + case 3: + if (component.blockData[offsetZ]) { + component.blockData[offsetZ] += sign * (readBit() << successive); + } else { + component.blockData[offsetZ] = successiveACNextValue << successive; + successiveACState = 0; + } + break; + case 4: + if (component.blockData[offsetZ]) { + component.blockData[offsetZ] += sign * (readBit() << successive); + } + break; + } + k++; + } + if (successiveACState === 4) { + eobrun--; + if (eobrun === 0) { + successiveACState = 0; + } + } + } + let blockRow = 0; + function decodeMcu(component, decode, mcu, row, col) { + const mcuRow = (mcu / mcusPerLine) | 0; + const mcuCol = mcu % mcusPerLine; + blockRow = mcuRow * component.v + row; + const blockCol = mcuCol * component.h + col; + const blockOffset = getBlockBufferOffset(component, blockRow, blockCol); + decode(component, blockOffset); + } + function decodeBlock(component, decode, mcu) { + blockRow = (mcu / component.blocksPerLine) | 0; + const blockCol = mcu % component.blocksPerLine; + const blockOffset = getBlockBufferOffset(component, blockRow, blockCol); + decode(component, blockOffset); + } + const componentsLength = components.length; + let component, i, j, k, n; + let decodeFn; + if (progressive) { + if (spectralStart === 0) { + decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive; + } else { + decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive; + } + } else { + decodeFn = decodeBaseline; + } + let mcu = 0, + fileMarker; + const mcuExpected = + componentsLength === 1 + ? components[0].blocksPerLine * components[0].blocksPerColumn + : mcusPerLine * frame.mcusPerColumn; + let h, v; + while (mcu <= mcuExpected) { + const mcuToRead = resetInterval + ? Math.min(mcuExpected - mcu, resetInterval) + : mcuExpected; + if (mcuToRead > 0) { + for (i = 0; i < componentsLength; i++) { + components[i].pred = 0; + } + eobrun = 0; + if (componentsLength === 1) { + component = components[0]; + for (n = 0; n < mcuToRead; n++) { + decodeBlock(component, decodeFn, mcu); + mcu++; + } + } else { + for (n = 0; n < mcuToRead; n++) { + for (i = 0; i < componentsLength; i++) { + component = components[i]; + h = component.h; + v = component.v; + for (j = 0; j < v; j++) { + for (k = 0; k < h; k++) { + decodeMcu(component, decodeFn, mcu, j, k); + } + } + } + mcu++; + } + } + } + bitsCount = 0; + fileMarker = findNextFileMarker(data, offset); + if (!fileMarker) { + break; + } + if (fileMarker.invalid) { + const partialMsg = mcuToRead > 0 ? "unexpected" : "excessive"; warn( - `decodeScan - ${i > 0 ? "unexpected" : "excessive"} MCU data, current marker is: ${k.invalid}`, + `decodeScan - ${partialMsg} MCU data, current marker is: ${fileMarker.invalid}`, ); - t = k.offset; + offset = fileMarker.offset; } - if (!(k.marker >= 65488 && k.marker <= 65495)) break; - t += 2; - } - return t - l; -} -function quantizeAndInverse(e, t, i) { - const a = e.quantizationTable, - s = e.blockData; - let r, n, g, o, c, C, h, l, Q, E, u, d, f, p, m, y, w; - if (!a) throw new JpegError("missing required Quantization Table."); - for (let e = 0; e < 64; e += 8) { - Q = s[t + e]; - E = s[t + e + 1]; - u = s[t + e + 2]; - d = s[t + e + 3]; - f = s[t + e + 4]; - p = s[t + e + 5]; - m = s[t + e + 6]; - y = s[t + e + 7]; - Q *= a[e]; - if (0 != (E | u | d | f | p | m | y)) { - E *= a[e + 1]; - u *= a[e + 2]; - d *= a[e + 3]; - f *= a[e + 4]; - p *= a[e + 5]; - m *= a[e + 6]; - y *= a[e + 7]; - r = (ri * Q + 128) >> 8; - n = (ri * f + 128) >> 8; - g = u; - o = m; - c = (ni * (E - y) + 128) >> 8; - l = (ni * (E + y) + 128) >> 8; - C = d << 4; - h = p << 4; - r = (r + n + 1) >> 1; - n = r - n; - w = (g * si + o * ai + 128) >> 8; - g = (g * ai - o * si + 128) >> 8; - o = w; - c = (c + h + 1) >> 1; - h = c - h; - l = (l + C + 1) >> 1; - C = l - C; - r = (r + o + 1) >> 1; - o = r - o; - n = (n + g + 1) >> 1; - g = n - g; - w = (c * ii + l * ti + 2048) >> 12; - c = (c * ti - l * ii + 2048) >> 12; - l = w; - w = (C * ei + h * Ai + 2048) >> 12; - C = (C * Ai - h * ei + 2048) >> 12; - h = w; - i[e] = r + l; - i[e + 7] = r - l; - i[e + 1] = n + h; - i[e + 6] = n - h; - i[e + 2] = g + C; - i[e + 5] = g - C; - i[e + 3] = o + c; - i[e + 4] = o - c; + if (fileMarker.marker >= 0xffd0 && fileMarker.marker <= 0xffd7) { + offset += 2; } else { - w = (ri * Q + 512) >> 10; - i[e] = w; - i[e + 1] = w; - i[e + 2] = w; - i[e + 3] = w; - i[e + 4] = w; - i[e + 5] = w; - i[e + 6] = w; - i[e + 7] = w; + break; } } - for (let e = 0; e < 8; ++e) { - Q = i[e]; - E = i[e + 8]; - u = i[e + 16]; - d = i[e + 24]; - f = i[e + 32]; - p = i[e + 40]; - m = i[e + 48]; - y = i[e + 56]; - if (0 != (E | u | d | f | p | m | y)) { - r = (ri * Q + 2048) >> 12; - n = (ri * f + 2048) >> 12; - g = u; - o = m; - c = (ni * (E - y) + 2048) >> 12; - l = (ni * (E + y) + 2048) >> 12; - C = d; - h = p; - r = 4112 + ((r + n + 1) >> 1); - n = r - n; - w = (g * si + o * ai + 2048) >> 12; - g = (g * ai - o * si + 2048) >> 12; - o = w; - c = (c + h + 1) >> 1; - h = c - h; - l = (l + C + 1) >> 1; - C = l - C; - r = (r + o + 1) >> 1; - o = r - o; - n = (n + g + 1) >> 1; - g = n - g; - w = (c * ii + l * ti + 2048) >> 12; - c = (c * ti - l * ii + 2048) >> 12; - l = w; - w = (C * ei + h * Ai + 2048) >> 12; - C = (C * Ai - h * ei + 2048) >> 12; - h = w; - Q = r + l; - y = r - l; - E = n + h; - m = n - h; - u = g + C; - p = g - C; - d = o + c; - f = o - c; - Q < 16 ? (Q = 0) : Q >= 4080 ? (Q = 255) : (Q >>= 4); - E < 16 ? (E = 0) : E >= 4080 ? (E = 255) : (E >>= 4); - u < 16 ? (u = 0) : u >= 4080 ? (u = 255) : (u >>= 4); - d < 16 ? (d = 0) : d >= 4080 ? (d = 255) : (d >>= 4); - f < 16 ? (f = 0) : f >= 4080 ? (f = 255) : (f >>= 4); - p < 16 ? (p = 0) : p >= 4080 ? (p = 255) : (p >>= 4); - m < 16 ? (m = 0) : m >= 4080 ? (m = 255) : (m >>= 4); - y < 16 ? (y = 0) : y >= 4080 ? (y = 255) : (y >>= 4); - s[t + e] = Q; - s[t + e + 8] = E; - s[t + e + 16] = u; - s[t + e + 24] = d; - s[t + e + 32] = f; - s[t + e + 40] = p; - s[t + e + 48] = m; - s[t + e + 56] = y; + return offset - startOffset; +} +function quantizeAndInverse(component, blockBufferOffset, p) { + const qt = component.quantizationTable, + blockData = component.blockData; + let v0, v1, v2, v3, v4, v5, v6, v7; + let p0, p1, p2, p3, p4, p5, p6, p7; + let t; + if (!qt) { + throw new JpegError("missing required Quantization Table."); + } + for (let row = 0; row < 64; row += 8) { + p0 = blockData[blockBufferOffset + row]; + p1 = blockData[blockBufferOffset + row + 1]; + p2 = blockData[blockBufferOffset + row + 2]; + p3 = blockData[blockBufferOffset + row + 3]; + p4 = blockData[blockBufferOffset + row + 4]; + p5 = blockData[blockBufferOffset + row + 5]; + p6 = blockData[blockBufferOffset + row + 6]; + p7 = blockData[blockBufferOffset + row + 7]; + p0 *= qt[row]; + if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { + t = (dctSqrt2 * p0 + 512) >> 10; + p[row] = t; + p[row + 1] = t; + p[row + 2] = t; + p[row + 3] = t; + p[row + 4] = t; + p[row + 5] = t; + p[row + 6] = t; + p[row + 7] = t; + continue; + } + p1 *= qt[row + 1]; + p2 *= qt[row + 2]; + p3 *= qt[row + 3]; + p4 *= qt[row + 4]; + p5 *= qt[row + 5]; + p6 *= qt[row + 6]; + p7 *= qt[row + 7]; + v0 = (dctSqrt2 * p0 + 128) >> 8; + v1 = (dctSqrt2 * p4 + 128) >> 8; + v2 = p2; + v3 = p6; + v4 = (dctSqrt1d2 * (p1 - p7) + 128) >> 8; + v7 = (dctSqrt1d2 * (p1 + p7) + 128) >> 8; + v5 = p3 << 4; + v6 = p5 << 4; + v0 = (v0 + v1 + 1) >> 1; + v1 = v0 - v1; + t = (v2 * dctSin6 + v3 * dctCos6 + 128) >> 8; + v2 = (v2 * dctCos6 - v3 * dctSin6 + 128) >> 8; + v3 = t; + v4 = (v4 + v6 + 1) >> 1; + v6 = v4 - v6; + v7 = (v7 + v5 + 1) >> 1; + v5 = v7 - v5; + v0 = (v0 + v3 + 1) >> 1; + v3 = v0 - v3; + v1 = (v1 + v2 + 1) >> 1; + v2 = v1 - v2; + t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12; + v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12; + v7 = t; + t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12; + v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12; + v6 = t; + p[row] = v0 + v7; + p[row + 7] = v0 - v7; + p[row + 1] = v1 + v6; + p[row + 6] = v1 - v6; + p[row + 2] = v2 + v5; + p[row + 5] = v2 - v5; + p[row + 3] = v3 + v4; + p[row + 4] = v3 - v4; + } + for (let col = 0; col < 8; ++col) { + p0 = p[col]; + p1 = p[col + 8]; + p2 = p[col + 16]; + p3 = p[col + 24]; + p4 = p[col + 32]; + p5 = p[col + 40]; + p6 = p[col + 48]; + p7 = p[col + 56]; + if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { + t = (dctSqrt2 * p0 + 8192) >> 14; + if (t < -2040) { + t = 0; + } else if (t >= 2024) { + t = 255; + } else { + t = (t + 2056) >> 4; + } + blockData[blockBufferOffset + col] = t; + blockData[blockBufferOffset + col + 8] = t; + blockData[blockBufferOffset + col + 16] = t; + blockData[blockBufferOffset + col + 24] = t; + blockData[blockBufferOffset + col + 32] = t; + blockData[blockBufferOffset + col + 40] = t; + blockData[blockBufferOffset + col + 48] = t; + blockData[blockBufferOffset + col + 56] = t; + continue; + } + v0 = (dctSqrt2 * p0 + 2048) >> 12; + v1 = (dctSqrt2 * p4 + 2048) >> 12; + v2 = p2; + v3 = p6; + v4 = (dctSqrt1d2 * (p1 - p7) + 2048) >> 12; + v7 = (dctSqrt1d2 * (p1 + p7) + 2048) >> 12; + v5 = p3; + v6 = p5; + v0 = ((v0 + v1 + 1) >> 1) + 4112; + v1 = v0 - v1; + t = (v2 * dctSin6 + v3 * dctCos6 + 2048) >> 12; + v2 = (v2 * dctCos6 - v3 * dctSin6 + 2048) >> 12; + v3 = t; + v4 = (v4 + v6 + 1) >> 1; + v6 = v4 - v6; + v7 = (v7 + v5 + 1) >> 1; + v5 = v7 - v5; + v0 = (v0 + v3 + 1) >> 1; + v3 = v0 - v3; + v1 = (v1 + v2 + 1) >> 1; + v2 = v1 - v2; + t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12; + v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12; + v7 = t; + t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12; + v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12; + v6 = t; + p0 = v0 + v7; + p7 = v0 - v7; + p1 = v1 + v6; + p6 = v1 - v6; + p2 = v2 + v5; + p5 = v2 - v5; + p3 = v3 + v4; + p4 = v3 - v4; + if (p0 < 16) { + p0 = 0; + } else if (p0 >= 4080) { + p0 = 255; } else { - w = (ri * Q + 8192) >> 14; - w = w < -2040 ? 0 : w >= 2024 ? 255 : (w + 2056) >> 4; - s[t + e] = w; - s[t + e + 8] = w; - s[t + e + 16] = w; - s[t + e + 24] = w; - s[t + e + 32] = w; - s[t + e + 40] = w; - s[t + e + 48] = w; - s[t + e + 56] = w; + p0 >>= 4; } + if (p1 < 16) { + p1 = 0; + } else if (p1 >= 4080) { + p1 = 255; + } else { + p1 >>= 4; + } + if (p2 < 16) { + p2 = 0; + } else if (p2 >= 4080) { + p2 = 255; + } else { + p2 >>= 4; + } + if (p3 < 16) { + p3 = 0; + } else if (p3 >= 4080) { + p3 = 255; + } else { + p3 >>= 4; + } + if (p4 < 16) { + p4 = 0; + } else if (p4 >= 4080) { + p4 = 255; + } else { + p4 >>= 4; + } + if (p5 < 16) { + p5 = 0; + } else if (p5 >= 4080) { + p5 = 255; + } else { + p5 >>= 4; + } + if (p6 < 16) { + p6 = 0; + } else if (p6 >= 4080) { + p6 = 255; + } else { + p6 >>= 4; + } + if (p7 < 16) { + p7 = 0; + } else if (p7 >= 4080) { + p7 = 255; + } else { + p7 >>= 4; + } + blockData[blockBufferOffset + col] = p0; + blockData[blockBufferOffset + col + 8] = p1; + blockData[blockBufferOffset + col + 16] = p2; + blockData[blockBufferOffset + col + 24] = p3; + blockData[blockBufferOffset + col + 32] = p4; + blockData[blockBufferOffset + col + 40] = p5; + blockData[blockBufferOffset + col + 48] = p6; + blockData[blockBufferOffset + col + 56] = p7; } } -function buildComponentData(e, t) { - const i = t.blocksPerLine, - a = t.blocksPerColumn, - s = new Int16Array(64); - for (let e = 0; e < a; e++) - for (let a = 0; a < i; a++) { - quantizeAndInverse(t, getBlockBufferOffset(t, e, a), s); +function buildComponentData(frame, component) { + const blocksPerLine = component.blocksPerLine; + const blocksPerColumn = component.blocksPerColumn; + const computationBuffer = new Int16Array(64); + for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) { + for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) { + const offset = getBlockBufferOffset(component, blockRow, blockCol); + quantizeAndInverse(component, offset, computationBuffer); } - return t.blockData; -} -function findNextFileMarker(e, t, i = t) { - const a = e.length - 1; - let s = i < t ? i : t; - if (t >= a) return null; - const r = readUint16(e, t); - if (r >= 65472 && r <= 65534) return { invalid: null, marker: r, offset: t }; - let n = readUint16(e, s); - for (; !(n >= 65472 && n <= 65534); ) { - if (++s >= a) return null; - n = readUint16(e, s); } - return { invalid: r.toString(16), marker: n, offset: s }; + return component.blockData; +} +function findNextFileMarker(data, currentPos, startPos = currentPos) { + const maxPos = data.length - 1; + let newPos = startPos < currentPos ? startPos : currentPos; + if (currentPos >= maxPos) { + return null; + } + const currentMarker = readUint16(data, currentPos); + if (currentMarker >= 0xffc0 && currentMarker <= 0xfffe) { + return { + invalid: null, + marker: currentMarker, + offset: currentPos, + }; + } + let newMarker = readUint16(data, newPos); + while (!(newMarker >= 0xffc0 && newMarker <= 0xfffe)) { + if (++newPos >= maxPos) { + return null; + } + newMarker = readUint16(data, newPos); + } + return { + invalid: currentMarker.toString(16), + marker: newMarker, + offset: newPos, + }; +} +function prepareComponents(frame) { + const mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH); + const mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV); + for (const component of frame.components) { + const blocksPerLine = Math.ceil( + (Math.ceil(frame.samplesPerLine / 8) * component.h) / frame.maxH, + ); + const blocksPerColumn = Math.ceil( + (Math.ceil(frame.scanLines / 8) * component.v) / frame.maxV, + ); + const blocksPerLineForMcu = mcusPerLine * component.h; + const blocksPerColumnForMcu = mcusPerColumn * component.v; + const blocksBufferSize = + 64 * blocksPerColumnForMcu * (blocksPerLineForMcu + 1); + component.blockData = new Int16Array(blocksBufferSize); + component.blocksPerLine = blocksPerLine; + component.blocksPerColumn = blocksPerColumn; + } + frame.mcusPerLine = mcusPerLine; + frame.mcusPerColumn = mcusPerColumn; +} +function readDataBlock(data, offset) { + const length = readUint16(data, offset); + offset += 2; + let endOffset = offset + length - 2; + const fileMarker = findNextFileMarker(data, endOffset, offset); + if (fileMarker?.invalid) { + warn( + "readDataBlock - incorrect length, current marker is: " + + fileMarker.invalid, + ); + endOffset = fileMarker.offset; + } + const array = data.subarray(offset, endOffset); + offset += array.length; + return { + appData: array, + newOffset: offset, + }; +} +function skipData(data, offset) { + const length = readUint16(data, offset); + offset += 2; + const endOffset = offset + length - 2; + const fileMarker = findNextFileMarker(data, endOffset, offset); + if (fileMarker?.invalid) { + return fileMarker.offset; + } + return endOffset; } class JpegImage { - constructor({ decodeTransform: e = null, colorTransform: t = -1 } = {}) { - this._decodeTransform = e; - this._colorTransform = t; + constructor({ decodeTransform = null, colorTransform = -1 } = {}) { + this._decodeTransform = decodeTransform; + this._colorTransform = colorTransform; } - parse(e, { dnlScanLines: t = null } = {}) { - function readDataBlock() { - const t = readUint16(e, s); - s += 2; - let i = s + t - 2; - const a = findNextFileMarker(e, i, s); - if (a?.invalid) { - warn( - "readDataBlock - incorrect length, current marker is: " + a.invalid, - ); - i = a.offset; - } - const r = e.subarray(s, i); - s += r.length; - return r; + static canUseImageDecoder(data, colorTransform = -1) { + let offset = 0; + let numComponents = null; + let fileMarker = readUint16(data, offset); + offset += 2; + if (fileMarker !== 0xffd8) { + throw new JpegError("SOI not found"); } - function prepareComponents(e) { - const t = Math.ceil(e.samplesPerLine / 8 / e.maxH), - i = Math.ceil(e.scanLines / 8 / e.maxV); - for (const a of e.components) { - const s = Math.ceil((Math.ceil(e.samplesPerLine / 8) * a.h) / e.maxH), - r = Math.ceil((Math.ceil(e.scanLines / 8) * a.v) / e.maxV), - n = t * a.h, - g = 64 * (i * a.v) * (n + 1); - a.blockData = new Int16Array(g); - a.blocksPerLine = s; - a.blocksPerColumn = r; - } - e.mcusPerLine = t; - e.mcusPerColumn = i; - } - let i, - a, - s = 0, - r = null, - n = null, - g = 0; - const o = [], - c = [], - C = []; - let h = readUint16(e, s); - s += 2; - if (65496 !== h) throw new JpegError("SOI not found"); - h = readUint16(e, s); - s += 2; - A: for (; 65497 !== h; ) { - let l, Q, E; - switch (h) { - case 65504: - case 65505: - case 65506: - case 65507: - case 65508: - case 65509: - case 65510: - case 65511: - case 65512: - case 65513: - case 65514: - case 65515: - case 65516: - case 65517: - case 65518: - case 65519: - case 65534: - const u = readDataBlock(); - 65504 === h && - 74 === u[0] && - 70 === u[1] && - 73 === u[2] && - 70 === u[3] && - 0 === u[4] && - (r = { - version: { major: u[5], minor: u[6] }, - densityUnits: u[7], - xDensity: (u[8] << 8) | u[9], - yDensity: (u[10] << 8) | u[11], - thumbWidth: u[12], - thumbHeight: u[13], - thumbData: u.subarray(14, 14 + 3 * u[12] * u[13]), - }); - 65518 === h && - 65 === u[0] && - 100 === u[1] && - 111 === u[2] && - 98 === u[3] && - 101 === u[4] && - (n = { - version: (u[5] << 8) | u[6], - flags0: (u[7] << 8) | u[8], - flags1: (u[9] << 8) | u[10], - transformCode: u[11], - }); - break; - case 65499: - const d = readUint16(e, s); - s += 2; - const f = d + s - 2; - let p; - for (; s < f; ) { - const t = e[s++], - i = new Uint16Array(64); - if (t >> 4 == 0) - for (Q = 0; Q < 64; Q++) { - p = $t[Q]; - i[p] = e[s++]; - } - else { - if (t >> 4 != 1) throw new JpegError("DQT - invalid table spec"); - for (Q = 0; Q < 64; Q++) { - p = $t[Q]; - i[p] = readUint16(e, s); - s += 2; - } - } - o[15 & t] = i; + fileMarker = readUint16(data, offset); + offset += 2; + markerLoop: while (fileMarker !== 0xffd9) { + switch (fileMarker) { + case 0xffc0: + case 0xffc1: + case 0xffc2: + numComponents = data[offset + (2 + 1 + 2 + 2)]; + break markerLoop; + case 0xffff: + if (data[offset] !== 0xff) { + offset--; } break; - case 65472: - case 65473: - case 65474: - if (i) throw new JpegError("Only single frame JPEGs supported"); - s += 2; - i = {}; - i.extended = 65473 === h; - i.progressive = 65474 === h; - i.precision = e[s++]; - const m = readUint16(e, s); - s += 2; - i.scanLines = t || m; - i.samplesPerLine = readUint16(e, s); - s += 2; - i.components = []; - i.componentIds = {}; - const y = e[s++]; - let w = 0, - D = 0; - for (l = 0; l < y; l++) { - const t = e[s], - a = e[s + 1] >> 4, - r = 15 & e[s + 1]; - w < a && (w = a); - D < r && (D = r); - const n = e[s + 2]; - E = i.components.push({ - h: a, - v: r, - quantizationId: n, + } + offset = skipData(data, offset); + fileMarker = readUint16(data, offset); + offset += 2; + } + if (numComponents === 4) { + return false; + } + if (numComponents === 3 && colorTransform === 0) { + return false; + } + return true; + } + parse(data, { dnlScanLines = null } = {}) { + let offset = 0; + let jfif = null; + let adobe = null; + let frame, resetInterval; + let numSOSMarkers = 0; + const quantizationTables = []; + const huffmanTablesAC = [], + huffmanTablesDC = []; + let fileMarker = readUint16(data, offset); + offset += 2; + if (fileMarker !== 0xffd8) { + throw new JpegError("SOI not found"); + } + fileMarker = readUint16(data, offset); + offset += 2; + markerLoop: while (fileMarker !== 0xffd9) { + let i, j, l; + switch (fileMarker) { + case 0xffe0: + case 0xffe1: + case 0xffe2: + case 0xffe3: + case 0xffe4: + case 0xffe5: + case 0xffe6: + case 0xffe7: + case 0xffe8: + case 0xffe9: + case 0xffea: + case 0xffeb: + case 0xffec: + case 0xffed: + case 0xffee: + case 0xffef: + case 0xfffe: + const { appData, newOffset } = readDataBlock(data, offset); + offset = newOffset; + if (fileMarker === 0xffe0) { + if ( + appData[0] === 0x4a && + appData[1] === 0x46 && + appData[2] === 0x49 && + appData[3] === 0x46 && + appData[4] === 0 + ) { + jfif = { + version: { + major: appData[5], + minor: appData[6], + }, + densityUnits: appData[7], + xDensity: (appData[8] << 8) | appData[9], + yDensity: (appData[10] << 8) | appData[11], + thumbWidth: appData[12], + thumbHeight: appData[13], + thumbData: appData.subarray( + 14, + 14 + 3 * appData[12] * appData[13], + ), + }; + } + } + if (fileMarker === 0xffee) { + if ( + appData[0] === 0x41 && + appData[1] === 0x64 && + appData[2] === 0x6f && + appData[3] === 0x62 && + appData[4] === 0x65 + ) { + adobe = { + version: (appData[5] << 8) | appData[6], + flags0: (appData[7] << 8) | appData[8], + flags1: (appData[9] << 8) | appData[10], + transformCode: appData[11], + }; + } + } + break; + case 0xffdb: + const quantizationTablesLength = readUint16(data, offset); + offset += 2; + const quantizationTablesEnd = quantizationTablesLength + offset - 2; + let z; + while (offset < quantizationTablesEnd) { + const quantizationTableSpec = data[offset++]; + const tableData = new Uint16Array(64); + if (quantizationTableSpec >> 4 === 0) { + for (j = 0; j < 64; j++) { + z = dctZigZag[j]; + tableData[z] = data[offset++]; + } + } else if (quantizationTableSpec >> 4 === 1) { + for (j = 0; j < 64; j++) { + z = dctZigZag[j]; + tableData[z] = readUint16(data, offset); + offset += 2; + } + } else { + throw new JpegError("DQT - invalid table spec"); + } + quantizationTables[quantizationTableSpec & 15] = tableData; + } + break; + case 0xffc0: + case 0xffc1: + case 0xffc2: + if (frame) { + throw new JpegError("Only single frame JPEGs supported"); + } + offset += 2; + frame = {}; + frame.extended = fileMarker === 0xffc1; + frame.progressive = fileMarker === 0xffc2; + frame.precision = data[offset++]; + const sofScanLines = readUint16(data, offset); + offset += 2; + frame.scanLines = dnlScanLines || sofScanLines; + frame.samplesPerLine = readUint16(data, offset); + offset += 2; + frame.components = []; + frame.componentIds = {}; + const componentsCount = data[offset++]; + let maxH = 0, + maxV = 0; + for (i = 0; i < componentsCount; i++) { + const componentId = data[offset]; + const h = data[offset + 1] >> 4; + const v = data[offset + 1] & 15; + if (maxH < h) { + maxH = h; + } + if (maxV < v) { + maxV = v; + } + const qId = data[offset + 2]; + l = frame.components.push({ + h, + v, + quantizationId: qId, quantizationTable: null, }); - i.componentIds[t] = E - 1; - s += 3; + frame.componentIds[componentId] = l - 1; + offset += 3; } - i.maxH = w; - i.maxV = D; - prepareComponents(i); + frame.maxH = maxH; + frame.maxV = maxV; + prepareComponents(frame); break; - case 65476: - const b = readUint16(e, s); - s += 2; - for (l = 2; l < b; ) { - const t = e[s++], - i = new Uint8Array(16); - let a = 0; - for (Q = 0; Q < 16; Q++, s++) a += i[Q] = e[s]; - const r = new Uint8Array(a); - for (Q = 0; Q < a; Q++, s++) r[Q] = e[s]; - l += 17 + a; - (t >> 4 == 0 ? C : c)[15 & t] = buildHuffmanTable(i, r); + case 0xffc4: + const huffmanLength = readUint16(data, offset); + offset += 2; + for (i = 2; i < huffmanLength; ) { + const huffmanTableSpec = data[offset++]; + const codeLengths = new Uint8Array(16); + let codeLengthSum = 0; + for (j = 0; j < 16; j++, offset++) { + codeLengthSum += codeLengths[j] = data[offset]; + } + const huffmanValues = new Uint8Array(codeLengthSum); + for (j = 0; j < codeLengthSum; j++, offset++) { + huffmanValues[j] = data[offset]; + } + i += 17 + codeLengthSum; + (huffmanTableSpec >> 4 === 0 ? huffmanTablesDC : huffmanTablesAC)[ + huffmanTableSpec & 15 + ] = buildHuffmanTable(codeLengths, huffmanValues); } break; - case 65501: - s += 2; - a = readUint16(e, s); - s += 2; + case 0xffdd: + offset += 2; + resetInterval = readUint16(data, offset); + offset += 2; break; - case 65498: - const F = 1 == ++g && !t; - s += 2; - const S = e[s++], - k = []; - for (l = 0; l < S; l++) { - const t = e[s++], - a = i.componentIds[t], - r = i.components[a]; - r.index = t; - const n = e[s++]; - r.huffmanTableDC = C[n >> 4]; - r.huffmanTableAC = c[15 & n]; - k.push(r); + case 0xffda: + const parseDNLMarker = ++numSOSMarkers === 1 && !dnlScanLines; + offset += 2; + const selectorsCount = data[offset++], + components = []; + for (i = 0; i < selectorsCount; i++) { + const index = data[offset++]; + const componentIndex = frame.componentIds[index]; + const component = frame.components[componentIndex]; + component.index = index; + const tableSpec = data[offset++]; + component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4]; + component.huffmanTableAC = huffmanTablesAC[tableSpec & 15]; + components.push(component); } - const R = e[s++], - N = e[s++], - G = e[s++]; + const spectralStart = data[offset++], + spectralEnd = data[offset++], + successiveApproximation = data[offset++]; try { - const t = decodeScan(e, s, i, k, a, R, N, G >> 4, 15 & G, F); - s += t; - } catch (t) { - if (t instanceof DNLMarkerError) { - warn(`${t.message} -- attempting to re-parse the JPEG image.`); - return this.parse(e, { dnlScanLines: t.scanLines }); + const processed = decodeScan( + data, + offset, + frame, + components, + resetInterval, + spectralStart, + spectralEnd, + successiveApproximation >> 4, + successiveApproximation & 15, + parseDNLMarker, + ); + offset += processed; + } catch (ex) { + if (ex instanceof DNLMarkerError) { + warn(`${ex.message} -- attempting to re-parse the JPEG image.`); + return this.parse(data, { + dnlScanLines: ex.scanLines, + }); + } else if (ex instanceof EOIMarkerError) { + warn(`${ex.message} -- ignoring the rest of the image data.`); + break markerLoop; } - if (t instanceof EOIMarkerError) { - warn(`${t.message} -- ignoring the rest of the image data.`); - break A; - } - throw t; + throw ex; } break; - case 65500: - s += 4; + case 0xffdc: + offset += 4; break; - case 65535: - 255 !== e[s] && s--; + case 0xffff: + if (data[offset] !== 0xff) { + offset--; + } break; default: - const x = findNextFileMarker(e, s - 2, s - 3); - if (x?.invalid) { + const nextFileMarker = findNextFileMarker( + data, + offset - 2, + offset - 3, + ); + if (nextFileMarker?.invalid) { warn( "JpegImage.parse - unexpected data, current marker is: " + - x.invalid, + nextFileMarker.invalid, ); - s = x.offset; + offset = nextFileMarker.offset; break; } - if (!x || s >= e.length - 1) { + if (!nextFileMarker || offset >= data.length - 1) { warn( - "JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).", + "JpegImage.parse - reached the end of the image data " + + "without finding an EOI marker (0xFFD9).", ); - break A; + break markerLoop; } throw new JpegError( - "JpegImage.parse - unknown marker: " + h.toString(16), + "JpegImage.parse - unknown marker: " + fileMarker.toString(16), ); } - h = readUint16(e, s); - s += 2; + fileMarker = readUint16(data, offset); + offset += 2; } - if (!i) throw new JpegError("JpegImage.parse - no frame data found."); - this.width = i.samplesPerLine; - this.height = i.scanLines; - this.jfif = r; - this.adobe = n; + if (!frame) { + throw new JpegError("JpegImage.parse - no frame data found."); + } + this.width = frame.samplesPerLine; + this.height = frame.scanLines; + this.jfif = jfif; + this.adobe = adobe; this.components = []; - for (const e of i.components) { - const t = o[e.quantizationId]; - t && (e.quantizationTable = t); + for (const component of frame.components) { + const quantizationTable = quantizationTables[component.quantizationId]; + if (quantizationTable) { + component.quantizationTable = quantizationTable; + } this.components.push({ - index: e.index, - output: buildComponentData(0, e), - scaleX: e.h / i.maxH, - scaleY: e.v / i.maxV, - blocksPerLine: e.blocksPerLine, - blocksPerColumn: e.blocksPerColumn, + index: component.index, + output: buildComponentData(frame, component), + scaleX: component.h / frame.maxH, + scaleY: component.v / frame.maxV, + blocksPerLine: component.blocksPerLine, + blocksPerColumn: component.blocksPerColumn, }); } this.numComponents = this.components.length; + return undefined; } - _getLinearizedBlockData(e, t, i = !1) { - const a = this.width / e, - s = this.height / t; - let r, - n, - g, - o, - c, - C, - h, - l, - Q, - E, - u, - d = 0; - const f = this.components.length, - p = e * t * f, - m = new Uint8ClampedArray(p), - y = new Uint32Array(e), - w = 4294967288; - let D; - for (h = 0; h < f; h++) { - r = this.components[h]; - n = r.scaleX * a; - g = r.scaleY * s; - d = h; - u = r.output; - o = (r.blocksPerLine + 1) << 3; - if (n !== D) { - for (c = 0; c < e; c++) { - l = 0 | (c * n); - y[c] = ((l & w) << 3) | (7 & l); + _getLinearizedBlockData(width, height, isSourcePDF = false) { + const scaleX = this.width / width, + scaleY = this.height / height; + let component, componentScaleX, componentScaleY, blocksPerScanline; + let x, y, i, j, k; + let index; + let offset = 0; + let output; + const numComponents = this.components.length; + const dataLength = width * height * numComponents; + const data = new Uint8ClampedArray(dataLength); + const xScaleBlockOffset = new Uint32Array(width); + const mask3LSB = 0xfffffff8; + let lastComponentScaleX; + for (i = 0; i < numComponents; i++) { + component = this.components[i]; + componentScaleX = component.scaleX * scaleX; + componentScaleY = component.scaleY * scaleY; + offset = i; + output = component.output; + blocksPerScanline = (component.blocksPerLine + 1) << 3; + if (componentScaleX !== lastComponentScaleX) { + for (x = 0; x < width; x++) { + j = 0 | (x * componentScaleX); + xScaleBlockOffset[x] = ((j & mask3LSB) << 3) | (j & 7); } - D = n; + lastComponentScaleX = componentScaleX; } - for (C = 0; C < t; C++) { - l = 0 | (C * g); - E = (o * (l & w)) | ((7 & l) << 3); - for (c = 0; c < e; c++) { - m[d] = u[E + y[c]]; - d += f; + for (y = 0; y < height; y++) { + j = 0 | (y * componentScaleY); + index = (blocksPerScanline * (j & mask3LSB)) | ((j & 7) << 3); + for (x = 0; x < width; x++) { + data[offset] = output[index + xScaleBlockOffset[x]]; + offset += numComponents; } } } - let b = this._decodeTransform; - i || - 4 !== f || - b || - (b = new Int32Array([-256, 255, -256, 255, -256, 255, -256, 255])); - if (b) - for (h = 0; h < p; ) - for (l = 0, Q = 0; l < f; l++, h++, Q += 2) - m[h] = ((m[h] * b[Q]) >> 8) + b[Q + 1]; - return m; + let transform = this._decodeTransform; + if (!isSourcePDF && numComponents === 4 && !transform) { + transform = new Int32Array([-256, 255, -256, 255, -256, 255, -256, 255]); + } + if (transform) { + for (i = 0; i < dataLength; ) { + for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) { + data[i] = ((data[i] * transform[k]) >> 8) + transform[k + 1]; + } + } + } + return data; } get _isColorConversionNeeded() { - return this.adobe - ? !!this.adobe.transformCode - : 3 === this.numComponents - ? 0 !== this._colorTransform && - (82 !== this.components[0].index || - 71 !== this.components[1].index || - 66 !== this.components[2].index) - : 1 === this._colorTransform; - } - _convertYccToRgb(e) { - let t, i, a; - for (let s = 0, r = e.length; s < r; s += 3) { - t = e[s]; - i = e[s + 1]; - a = e[s + 2]; - e[s] = t - 179.456 + 1.402 * a; - e[s + 1] = t + 135.459 - 0.344 * i - 0.714 * a; - e[s + 2] = t - 226.816 + 1.772 * i; + if (this.adobe) { + return !!this.adobe.transformCode; } - return e; - } - _convertYccToRgba(e, t) { - for (let i = 0, a = 0, s = e.length; i < s; i += 3, a += 4) { - const s = e[i], - r = e[i + 1], - n = e[i + 2]; - t[a] = s - 179.456 + 1.402 * n; - t[a + 1] = s + 135.459 - 0.344 * r - 0.714 * n; - t[a + 2] = s - 226.816 + 1.772 * r; - t[a + 3] = 255; + if (this.numComponents === 3) { + if (this._colorTransform === 0) { + return false; + } else if ( + this.components[0].index === 0x52 && + this.components[1].index === 0x47 && + this.components[2].index === 0x42 + ) { + return false; + } + return true; } - return t; + if (this._colorTransform === 1) { + return true; + } + return false; } - _convertYcckToRgb(e) { - let t, - i, - a, - s, - r = 0; - for (let n = 0, g = e.length; n < g; n += 4) { - t = e[n]; - i = e[n + 1]; - a = e[n + 2]; - s = e[n + 3]; - e[r++] = - i * - (-660635669420364e-19 * i + - 0.000437130475926232 * a - - 54080610064599e-18 * t + - 0.00048449797120281 * s - - 0.154362151871126) - - 122.67195406894 + - a * - (-0.000957964378445773 * a + - 0.000817076911346625 * t - - 0.00477271405408747 * s + + _convertYccToRgb(data) { + let Y, Cb, Cr; + for (let i = 0, length = data.length; i < length; i += 3) { + Y = data[i]; + Cb = data[i + 1]; + Cr = data[i + 2]; + data[i] = Y - 179.456 + 1.402 * Cr; + data[i + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr; + data[i + 2] = Y - 226.816 + 1.772 * Cb; + } + return data; + } + _convertYccToRgba(data, out) { + for (let i = 0, j = 0, length = data.length; i < length; i += 3, j += 4) { + const Y = data[i]; + const Cb = data[i + 1]; + const Cr = data[i + 2]; + out[j] = Y - 179.456 + 1.402 * Cr; + out[j + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr; + out[j + 2] = Y - 226.816 + 1.772 * Cb; + out[j + 3] = 255; + } + return out; + } + _convertYcckToRgb(data) { + let Y, Cb, Cr, k; + let offset = 0; + for (let i = 0, length = data.length; i < length; i += 4) { + Y = data[i]; + Cb = data[i + 1]; + Cr = data[i + 2]; + k = data[i + 3]; + data[offset++] = + -122.67195406894 + + Cb * + (-6.60635669420364e-5 * Cb + + 0.000437130475926232 * Cr - + 5.4080610064599e-5 * Y + + 0.00048449797120281 * k - + 0.154362151871126) + + Cr * + (-0.000957964378445773 * Cr + + 0.000817076911346625 * Y - + 0.00477271405408747 * k + 1.53380253221734) + - t * - (0.000961250184130688 * t - - 0.00266257332283933 * s + + Y * + (0.000961250184130688 * Y - + 0.00266257332283933 * k + 0.48357088451265) + - s * (-0.000336197177618394 * s + 0.484791561490776); - e[r++] = + k * (-0.000336197177618394 * k + 0.484791561490776); + data[offset++] = 107.268039397724 + - i * - (219927104525741e-19 * i - - 0.000640992018297945 * a + - 0.000659397001245577 * t + - 0.000426105652938837 * s - + Cb * + (2.19927104525741e-5 * Cb - + 0.000640992018297945 * Cr + + 0.000659397001245577 * Y + + 0.000426105652938837 * k - 0.176491792462875) + - a * - (-0.000778269941513683 * a + - 0.00130872261408275 * t + - 0.000770482631801132 * s - + Cr * + (-0.000778269941513683 * Cr + + 0.00130872261408275 * Y + + 0.000770482631801132 * k - 0.151051492775562) + - t * - (0.00126935368114843 * t - - 0.00265090189010898 * s + + Y * + (0.00126935368114843 * Y - + 0.00265090189010898 * k + 0.25802910206845) + - s * (-0.000318913117588328 * s - 0.213742400323665); - e[r++] = - i * - (-0.000570115196973677 * i - - 263409051004589e-19 * a + - 0.0020741088115012 * t - - 0.00288260236853442 * s + - 0.814272968359295) - - 20.810012546947 + - a * - (-153496057440975e-19 * a - - 0.000132689043961446 * t + - 0.000560833691242812 * s - + k * (-0.000318913117588328 * k - 0.213742400323665); + data[offset++] = + -20.810012546947 + + Cb * + (-0.000570115196973677 * Cb - + 2.63409051004589e-5 * Cr + + 0.0020741088115012 * Y - + 0.00288260236853442 * k + + 0.814272968359295) + + Cr * + (-1.53496057440975e-5 * Cr - + 0.000132689043961446 * Y + + 0.000560833691242812 * k - 0.195152027534049) + - t * - (0.00174418132927582 * t - - 0.00255243321439347 * s + + Y * + (0.00174418132927582 * Y - + 0.00255243321439347 * k + 0.116935020465145) + - s * (-0.000343531996510555 * s + 0.24165260232407); + k * (-0.000343531996510555 * k + 0.24165260232407); } - return e.subarray(0, r); + return data.subarray(0, offset); } - _convertYcckToRgba(e) { - for (let t = 0, i = e.length; t < i; t += 4) { - const i = e[t], - a = e[t + 1], - s = e[t + 2], - r = e[t + 3]; - e[t] = - a * - (-660635669420364e-19 * a + - 0.000437130475926232 * s - - 54080610064599e-18 * i + - 0.00048449797120281 * r - - 0.154362151871126) - - 122.67195406894 + - s * - (-0.000957964378445773 * s + - 0.000817076911346625 * i - - 0.00477271405408747 * r + + _convertYcckToRgba(data) { + for (let i = 0, length = data.length; i < length; i += 4) { + const Y = data[i]; + const Cb = data[i + 1]; + const Cr = data[i + 2]; + const k = data[i + 3]; + data[i] = + -122.67195406894 + + Cb * + (-6.60635669420364e-5 * Cb + + 0.000437130475926232 * Cr - + 5.4080610064599e-5 * Y + + 0.00048449797120281 * k - + 0.154362151871126) + + Cr * + (-0.000957964378445773 * Cr + + 0.000817076911346625 * Y - + 0.00477271405408747 * k + 1.53380253221734) + - i * - (0.000961250184130688 * i - - 0.00266257332283933 * r + + Y * + (0.000961250184130688 * Y - + 0.00266257332283933 * k + 0.48357088451265) + - r * (-0.000336197177618394 * r + 0.484791561490776); - e[t + 1] = + k * (-0.000336197177618394 * k + 0.484791561490776); + data[i + 1] = 107.268039397724 + - a * - (219927104525741e-19 * a - - 0.000640992018297945 * s + - 0.000659397001245577 * i + - 0.000426105652938837 * r - + Cb * + (2.19927104525741e-5 * Cb - + 0.000640992018297945 * Cr + + 0.000659397001245577 * Y + + 0.000426105652938837 * k - 0.176491792462875) + - s * - (-0.000778269941513683 * s + - 0.00130872261408275 * i + - 0.000770482631801132 * r - + Cr * + (-0.000778269941513683 * Cr + + 0.00130872261408275 * Y + + 0.000770482631801132 * k - 0.151051492775562) + - i * - (0.00126935368114843 * i - - 0.00265090189010898 * r + + Y * + (0.00126935368114843 * Y - + 0.00265090189010898 * k + 0.25802910206845) + - r * (-0.000318913117588328 * r - 0.213742400323665); - e[t + 2] = - a * - (-0.000570115196973677 * a - - 263409051004589e-19 * s + - 0.0020741088115012 * i - - 0.00288260236853442 * r + - 0.814272968359295) - - 20.810012546947 + - s * - (-153496057440975e-19 * s - - 0.000132689043961446 * i + - 0.000560833691242812 * r - + k * (-0.000318913117588328 * k - 0.213742400323665); + data[i + 2] = + -20.810012546947 + + Cb * + (-0.000570115196973677 * Cb - + 2.63409051004589e-5 * Cr + + 0.0020741088115012 * Y - + 0.00288260236853442 * k + + 0.814272968359295) + + Cr * + (-1.53496057440975e-5 * Cr - + 0.000132689043961446 * Y + + 0.000560833691242812 * k - 0.195152027534049) + - i * - (0.00174418132927582 * i - - 0.00255243321439347 * r + + Y * + (0.00174418132927582 * Y - + 0.00255243321439347 * k + 0.116935020465145) + - r * (-0.000343531996510555 * r + 0.24165260232407); - e[t + 3] = 255; + k * (-0.000343531996510555 * k + 0.24165260232407); + data[i + 3] = 255; } - return e; + return data; } - _convertYcckToCmyk(e) { - let t, i, a; - for (let s = 0, r = e.length; s < r; s += 4) { - t = e[s]; - i = e[s + 1]; - a = e[s + 2]; - e[s] = 434.456 - t - 1.402 * a; - e[s + 1] = 119.541 - t + 0.344 * i + 0.714 * a; - e[s + 2] = 481.816 - t - 1.772 * i; + _convertYcckToCmyk(data) { + let Y, Cb, Cr; + for (let i = 0, length = data.length; i < length; i += 4) { + Y = data[i]; + Cb = data[i + 1]; + Cr = data[i + 2]; + data[i] = 434.456 - Y - 1.402 * Cr; + data[i + 1] = 119.541 - Y + 0.344 * Cb + 0.714 * Cr; + data[i + 2] = 481.816 - Y - 1.772 * Cb; } - return e; + return data; } - _convertCmykToRgb(e) { - let t, - i, - a, - s, - r = 0; - for (let n = 0, g = e.length; n < g; n += 4) { - t = e[n]; - i = e[n + 1]; - a = e[n + 2]; - s = e[n + 3]; - e[r++] = + _convertCmykToRgb(data) { + let c, m, y, k; + let offset = 0; + for (let i = 0, length = data.length; i < length; i += 4) { + c = data[i]; + m = data[i + 1]; + y = data[i + 2]; + k = data[i + 3]; + data[offset++] = 255 + - t * - (-6747147073602441e-20 * t + - 0.0008379262121013727 * i + - 0.0002894718188643294 * a + - 0.003264231057537806 * s - + c * + (-0.00006747147073602441 * c + + 0.0008379262121013727 * m + + 0.0002894718188643294 * y + + 0.003264231057537806 * k - 1.1185611867203937) + - i * - (26374107616089405e-21 * i - - 8626949158638572e-20 * a - - 0.0002748769067499491 * s - + m * + (0.000026374107616089405 * m - + 0.00008626949158638572 * y - + 0.0002748769067499491 * k - 0.02155688794978967) + - a * - (-3878099212869363e-20 * a - - 0.0003267808279485286 * s + + y * + (-0.00003878099212869363 * y - + 0.0003267808279485286 * k + 0.0686742238595345) - - s * (0.0003361971776183937 * s + 0.7430659151342254); - e[r++] = + k * (0.0003361971776183937 * k + 0.7430659151342254); + data[offset++] = 255 + - t * - (0.00013596372813588848 * t + - 0.000924537132573585 * i + - 0.00010567359618683593 * a + - 0.0004791864687436512 * s - + c * + (0.00013596372813588848 * c + + 0.000924537132573585 * m + + 0.00010567359618683593 * y + + 0.0004791864687436512 * k - 0.3109689587515875) + - i * - (-0.00023545346108370344 * i + - 0.0002702845253534714 * a + - 0.0020200308977307156 * s - + m * + (-0.00023545346108370344 * m + + 0.0002702845253534714 * y + + 0.0020200308977307156 * k - 0.7488052167015494) + - a * - (6834815998235662e-20 * a + - 0.00015168452363460973 * s - + y * + (0.00006834815998235662 * y + + 0.00015168452363460973 * k - 0.09751927774728933) - - s * (0.0003189131175883281 * s + 0.7364883807733168); - e[r++] = + k * (0.0003189131175883281 * k + 0.7364883807733168); + data[offset++] = 255 + - t * - (13598650411385307e-21 * t + - 0.00012423956175490851 * i + - 0.0004751985097583589 * a - - 36729317476630422e-22 * s - + c * + (0.000013598650411385307 * c + + 0.00012423956175490851 * m + + 0.0004751985097583589 * y - + 0.0000036729317476630422 * k - 0.05562186980264034) + - i * - (0.00016141380598724676 * i + - 0.0009692239130725186 * a + - 0.0007782692450036253 * s - + m * + (0.00016141380598724676 * m + + 0.0009692239130725186 * y + + 0.0007782692450036253 * k - 0.44015232367526463) + - a * - (5.068882914068769e-7 * a + - 0.0017778369011375071 * s - + y * + (5.068882914068769e-7 * y + + 0.0017778369011375071 * k - 0.7591454649749609) - - s * (0.0003435319965105553 * s + 0.7063770186160144); + k * (0.0003435319965105553 * k + 0.7063770186160144); } - return e.subarray(0, r); + return data.subarray(0, offset); } - _convertCmykToRgba(e) { - for (let t = 0, i = e.length; t < i; t += 4) { - const i = e[t], - a = e[t + 1], - s = e[t + 2], - r = e[t + 3]; - e[t] = + _convertCmykToRgba(data) { + for (let i = 0, length = data.length; i < length; i += 4) { + const c = data[i]; + const m = data[i + 1]; + const y = data[i + 2]; + const k = data[i + 3]; + data[i] = 255 + - i * - (-6747147073602441e-20 * i + - 0.0008379262121013727 * a + - 0.0002894718188643294 * s + - 0.003264231057537806 * r - + c * + (-0.00006747147073602441 * c + + 0.0008379262121013727 * m + + 0.0002894718188643294 * y + + 0.003264231057537806 * k - 1.1185611867203937) + - a * - (26374107616089405e-21 * a - - 8626949158638572e-20 * s - - 0.0002748769067499491 * r - + m * + (0.000026374107616089405 * m - + 0.00008626949158638572 * y - + 0.0002748769067499491 * k - 0.02155688794978967) + - s * - (-3878099212869363e-20 * s - - 0.0003267808279485286 * r + + y * + (-0.00003878099212869363 * y - + 0.0003267808279485286 * k + 0.0686742238595345) - - r * (0.0003361971776183937 * r + 0.7430659151342254); - e[t + 1] = + k * (0.0003361971776183937 * k + 0.7430659151342254); + data[i + 1] = 255 + - i * - (0.00013596372813588848 * i + - 0.000924537132573585 * a + - 0.00010567359618683593 * s + - 0.0004791864687436512 * r - + c * + (0.00013596372813588848 * c + + 0.000924537132573585 * m + + 0.00010567359618683593 * y + + 0.0004791864687436512 * k - 0.3109689587515875) + - a * - (-0.00023545346108370344 * a + - 0.0002702845253534714 * s + - 0.0020200308977307156 * r - + m * + (-0.00023545346108370344 * m + + 0.0002702845253534714 * y + + 0.0020200308977307156 * k - 0.7488052167015494) + - s * - (6834815998235662e-20 * s + - 0.00015168452363460973 * r - + y * + (0.00006834815998235662 * y + + 0.00015168452363460973 * k - 0.09751927774728933) - - r * (0.0003189131175883281 * r + 0.7364883807733168); - e[t + 2] = + k * (0.0003189131175883281 * k + 0.7364883807733168); + data[i + 2] = 255 + - i * - (13598650411385307e-21 * i + - 0.00012423956175490851 * a + - 0.0004751985097583589 * s - - 36729317476630422e-22 * r - + c * + (0.000013598650411385307 * c + + 0.00012423956175490851 * m + + 0.0004751985097583589 * y - + 0.0000036729317476630422 * k - 0.05562186980264034) + - a * - (0.00016141380598724676 * a + - 0.0009692239130725186 * s + - 0.0007782692450036253 * r - + m * + (0.00016141380598724676 * m + + 0.0009692239130725186 * y + + 0.0007782692450036253 * k - 0.44015232367526463) + - s * - (5.068882914068769e-7 * s + - 0.0017778369011375071 * r - + y * + (5.068882914068769e-7 * y + + 0.0017778369011375071 * k - 0.7591454649749609) - - r * (0.0003435319965105553 * r + 0.7063770186160144); - e[t + 3] = 255; + k * (0.0003435319965105553 * k + 0.7063770186160144); + data[i + 3] = 255; } - return e; + return data; } getData({ - width: e, - height: t, - forceRGBA: i = !1, - forceRGB: a = !1, - isSourcePDF: s = !1, + width, + height, + forceRGBA = false, + forceRGB = false, + isSourcePDF = false, }) { - if (this.numComponents > 4) throw new JpegError("Unsupported color mode"); - const r = this._getLinearizedBlockData(e, t, s); - if (1 === this.numComponents && (i || a)) { - const e = r.length * (i ? 4 : 3), - t = new Uint8ClampedArray(e); - let a = 0; - if (i) - !(function grayToRGBA(e, t) { - if (FeatureTest.isLittleEndian) - for (let i = 0, a = e.length; i < a; i++) - t[i] = (65793 * e[i]) | 4278190080; - else - for (let i = 0, a = e.length; i < a; i++) - t[i] = (16843008 * e[i]) | 255; - })(r, new Uint32Array(t.buffer)); - else - for (const e of r) { - t[a++] = e; - t[a++] = e; - t[a++] = e; + if (this.numComponents > 4) { + throw new JpegError("Unsupported color mode"); + } + const data = this._getLinearizedBlockData(width, height, isSourcePDF); + if (this.numComponents === 1 && (forceRGBA || forceRGB)) { + const len = data.length * (forceRGBA ? 4 : 3); + const rgbaData = new Uint8ClampedArray(len); + let offset = 0; + if (forceRGBA) { + grayToRGBA(data, new Uint32Array(rgbaData.buffer)); + } else { + for (const grayColor of data) { + rgbaData[offset++] = grayColor; + rgbaData[offset++] = grayColor; + rgbaData[offset++] = grayColor; } - return t; - } - if (3 === this.numComponents && this._isColorConversionNeeded) { - if (i) { - const e = new Uint8ClampedArray((r.length / 3) * 4); - return this._convertYccToRgba(r, e); } - return this._convertYccToRgb(r); + return rgbaData; + } else if (this.numComponents === 3 && this._isColorConversionNeeded) { + if (forceRGBA) { + const rgbaData = new Uint8ClampedArray((data.length / 3) * 4); + return this._convertYccToRgba(data, rgbaData); + } + return this._convertYccToRgb(data); + } else if (this.numComponents === 4) { + if (this._isColorConversionNeeded) { + if (forceRGBA) { + return this._convertYcckToRgba(data); + } + if (forceRGB) { + return this._convertYcckToRgb(data); + } + return this._convertYcckToCmyk(data); + } else if (forceRGBA) { + return this._convertCmykToRgba(data); + } else if (forceRGB) { + return this._convertCmykToRgb(data); + } } - if (4 === this.numComponents) { - if (this._isColorConversionNeeded) - return i - ? this._convertYcckToRgba(r) - : a - ? this._convertYcckToRgb(r) - : this._convertYcckToCmyk(r); - if (i) return this._convertCmykToRgba(r); - if (a) return this._convertCmykToRgb(r); - } - return r; + return data; } -} +} // ./src/core/jpeg_stream.js + class JpegStream extends DecodeStream { - constructor(e, t, i) { - super(t); - this.stream = e; - this.dict = e.dict; - this.maybeLength = t; - this.params = i; + constructor(stream, maybeLength, params) { + super(maybeLength); + this.stream = stream; + this.dict = stream.dict; + this.maybeLength = maybeLength; + this.params = params; + } + static get canUseImageDecoder() { + return shadow( + this, + "canUseImageDecoder", + typeof ImageDecoder === "undefined" + ? Promise.resolve(false) + : ImageDecoder.isTypeSupported("image/jpeg"), + ); } get bytes() { return shadow(this, "bytes", this.stream.getBytes(this.maybeLength)); } - ensureBuffer(e) {} + ensureBuffer(requested) {} readBlock() { this.decodeImage(); } - decodeImage(e) { - if (this.eof) return this.buffer; - e ||= this.bytes; - for (let t = 0, i = e.length - 1; t < i; t++) - if (255 === e[t] && 216 === e[t + 1]) { - t > 0 && (e = e.subarray(t)); - break; + get jpegOptions() { + const jpegOptions = { + decodeTransform: undefined, + colorTransform: undefined, + }; + const decodeArr = this.dict.getArray("D", "Decode"); + if ((this.forceRGBA || this.forceRGB) && Array.isArray(decodeArr)) { + const bitsPerComponent = this.dict.get("BPC", "BitsPerComponent") || 8; + const decodeArrLength = decodeArr.length; + const transform = new Int32Array(decodeArrLength); + let transformNeeded = false; + const maxValue = (1 << bitsPerComponent) - 1; + for (let i = 0; i < decodeArrLength; i += 2) { + transform[i] = ((decodeArr[i + 1] - decodeArr[i]) * 256) | 0; + transform[i + 1] = (decodeArr[i] * maxValue) | 0; + if (transform[i] !== 256 || transform[i + 1] !== 0) { + transformNeeded = true; + } } - const t = { decodeTransform: void 0, colorTransform: void 0 }, - i = this.dict.getArray("D", "Decode"); - if ((this.forceRGBA || this.forceRGB) && Array.isArray(i)) { - const e = this.dict.get("BPC", "BitsPerComponent") || 8, - a = i.length, - s = new Int32Array(a); - let r = !1; - const n = (1 << e) - 1; - for (let e = 0; e < a; e += 2) { - s[e] = (256 * (i[e + 1] - i[e])) | 0; - s[e + 1] = (i[e] * n) | 0; - (256 === s[e] && 0 === s[e + 1]) || (r = !0); + if (transformNeeded) { + jpegOptions.decodeTransform = transform; } - r && (t.decodeTransform = s); } if (this.params instanceof Dict) { - const e = this.params.get("ColorTransform"); - Number.isInteger(e) && (t.colorTransform = e); + const colorTransform = this.params.get("ColorTransform"); + if (Number.isInteger(colorTransform)) { + jpegOptions.colorTransform = colorTransform; + } } - const a = new JpegImage(t); - a.parse(e); - const s = a.getData({ + return shadow(this, "jpegOptions", jpegOptions); + } + #skipUselessBytes(data) { + for (let i = 0, ii = data.length - 1; i < ii; i++) { + if (data[i] === 0xff && data[i + 1] === 0xd8) { + if (i > 0) { + data = data.subarray(i); + } + break; + } + } + return data; + } + decodeImage(bytes) { + if (this.eof) { + return this.buffer; + } + bytes = this.#skipUselessBytes(bytes || this.bytes); + const jpegImage = new JpegImage(this.jpegOptions); + jpegImage.parse(bytes); + const data = jpegImage.getData({ width: this.drawWidth, height: this.drawHeight, forceRGBA: this.forceRGBA, forceRGB: this.forceRGB, - isSourcePDF: !0, + isSourcePDF: true, }); - this.buffer = s; - this.bufferLength = s.length; - this.eof = !0; + this.buffer = data; + this.bufferLength = data.length; + this.eof = true; return this.buffer; } get canAsyncDecodeImageFromBuffer() { return this.stream.isAsync; } -} -var gi, - oi = - ((gi = - "undefined" != typeof document ? document.currentScript?.src : void 0), - function (e = {}) { - var t, - i, - a = e; - new Promise((e, a) => { - t = e; - i = a; + async getTransferableImage() { + if (!(await JpegStream.canUseImageDecoder)) { + return null; + } + const jpegOptions = this.jpegOptions; + if (jpegOptions.decodeTransform) { + return null; + } + let decoder; + try { + const bytes = + (this.canAsyncDecodeImageFromBuffer && + (await this.stream.asyncGetBytes())) || + this.bytes; + if (!bytes) { + return null; + } + const data = this.#skipUselessBytes(bytes); + if (!JpegImage.canUseImageDecoder(data, jpegOptions.colorTransform)) { + return null; + } + decoder = new ImageDecoder({ + data, + type: "image/jpeg", + preferAnimation: false, }); - a.decode = function ( - e, - { - numComponents: t = 4, - isIndexedColormap: i = !1, - smaskInData: s = !1, - }, - ) { - const r = e.length, - n = a._malloc(r); - a.HEAPU8.set(e, n); - const g = a._jp2_decode(n, r, t > 0 ? t : 0, !!i, !!s); - a._free(n); - if (g) { - const { errorMessages: e } = a; - if (e) { - delete a.errorMessages; - return e; - } - return "Unknown error"; - } - const { imageData: o } = a; - a.imageData = null; - return o; - }; - var s, - r = Object.assign({}, a), - n = "./this.program", - g = ""; - "undefined" != typeof document && - document.currentScript && - (g = document.currentScript.src); - gi && (g = gi); - g = g.startsWith("blob:") - ? "" - : g.substr(0, g.replace(/[?#].*/, "").lastIndexOf("/") + 1); - var o, - c, - C, - h, - l, - Q = a.print || console.log.bind(console), - E = a.printErr || console.error.bind(console); - Object.assign(a, r); - r = null; - a.arguments && a.arguments; - a.thisProgram && (n = a.thisProgram); - a.quit && a.quit; - a.wasmBinary && (o = a.wasmBinary); - function tryParseAsDataURI(e) { - if (isDataURI(e)) - return (function intArrayFromBase64(e) { - for ( - var t = atob(e), i = new Uint8Array(t.length), a = 0; - a < t.length; - ++a - ) - i[a] = t.charCodeAt(a); - return i; - })(e.slice(D.length)); - } - function updateMemoryViews() { - var e = c.buffer; - a.HEAP8 = C = new Int8Array(e); - a.HEAP16 = new Int16Array(e); - a.HEAPU8 = h = new Uint8Array(e); - a.HEAPU16 = new Uint16Array(e); - a.HEAP32 = new Int32Array(e); - a.HEAPU32 = l = new Uint32Array(e); - a.HEAPF32 = new Float32Array(e); - a.HEAPF64 = new Float64Array(e); - } - var u, - d = [], - f = [], - p = [], - m = 0, - y = null, - w = null, - D = "data:application/octet-stream;base64,", - isDataURI = (e) => e.startsWith(D); - function instantiateSync(e, t) { - var i, - a = (function getBinarySync(e) { - if (e == u && o) return new Uint8Array(o); - var t = tryParseAsDataURI(e); - if (t) return t; - if (s) return s(e); - throw 'sync fetching of the wasm failed: you can preload it to Module["wasmBinary"] manually, or emcc.py will do that for you when generating HTML (but not JS)'; - })(e); - i = new WebAssembly.Module(a); - return [new WebAssembly.Instance(i, t), i]; - } - var callRuntimeCallbacks = (e) => { - for (; e.length > 0; ) e.shift()(a); - }; - a.noExitRuntime; - var b, - growMemory = (e) => { - var t = (e - c.buffer.byteLength + 65535) / 65536; - try { - c.grow(t); - updateMemoryViews(); - return 1; - } catch (e) {} - }, - F = {}, - getEnvStrings = () => { - if (!getEnvStrings.strings) { - var e = { - USER: "web_user", - LOGNAME: "web_user", - PATH: "/", - PWD: "/", - HOME: "/home/web_user", - LANG: - ( - ("object" == typeof navigator && - navigator.languages && - navigator.languages[0]) || - "C" - ).replace("-", "_") + ".UTF-8", - _: n || "./this.program", - }; - for (var t in F) void 0 === F[t] ? delete e[t] : (e[t] = F[t]); - var i = []; - for (var t in e) i.push(`${t}=${e[t]}`); - getEnvStrings.strings = i; - } - return getEnvStrings.strings; - }, - S = [null, [], []], - k = - "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0, - UTF8ArrayToString = (e, t, i) => { - for (var a = t + i, s = t; e[s] && !(s >= a); ) ++s; - if (s - t > 16 && e.buffer && k) return k.decode(e.subarray(t, s)); - for (var r = ""; t < s; ) { - var n = e[t++]; - if (128 & n) { - var g = 63 & e[t++]; - if (192 != (224 & n)) { - var o = 63 & e[t++]; - if ( - (n = - 224 == (240 & n) - ? ((15 & n) << 12) | (g << 6) | o - : ((7 & n) << 18) | - (g << 12) | - (o << 6) | - (63 & e[t++])) < 65536 - ) - r += String.fromCharCode(n); - else { - var c = n - 65536; - r += String.fromCharCode( - 55296 | (c >> 10), - 56320 | (1023 & c), - ); - } - } else r += String.fromCharCode(((31 & n) << 6) | g); - } else r += String.fromCharCode(n); - } - return r; - }, - printChar = (e, t) => { - var i = S[e]; - if (0 === t || 10 === t) { - (1 === e ? Q : E)(UTF8ArrayToString(i, 0)); - i.length = 0; - } else i.push(t); - }, - UTF8ToString = (e, t) => (e ? UTF8ArrayToString(h, e, t) : ""), - R = { - c: (e, t, i) => h.copyWithin(e, t, t + i), - g: function _copy_pixels_1(e, t) { - e >>= 2; - const i = (a.imageData = new Uint8ClampedArray(t)), - s = a.HEAP32.subarray(e, e + t); - i.set(s); - }, - f: function _copy_pixels_3(e, t, i, s) { - e >>= 2; - t >>= 2; - i >>= 2; - const r = (a.imageData = new Uint8ClampedArray(3 * s)), - n = a.HEAP32.subarray(e, e + s), - g = a.HEAP32.subarray(t, t + s), - o = a.HEAP32.subarray(i, i + s); - for (let e = 0; e < s; e++) { - r[3 * e] = n[e]; - r[3 * e + 1] = g[e]; - r[3 * e + 2] = o[e]; - } - }, - e: function _copy_pixels_4(e, t, i, s, r) { - e >>= 2; - t >>= 2; - i >>= 2; - s >>= 2; - const n = (a.imageData = new Uint8ClampedArray(4 * r)), - g = a.HEAP32.subarray(e, e + r), - o = a.HEAP32.subarray(t, t + r), - c = a.HEAP32.subarray(i, i + r), - C = a.HEAP32.subarray(s, s + r); - for (let e = 0; e < r; e++) { - n[4 * e] = g[e]; - n[4 * e + 1] = o[e]; - n[4 * e + 2] = c[e]; - n[4 * e + 3] = C[e]; - } - }, - k: (e) => { - var t = h.length, - i = 2147483648; - if ((e >>>= 0) > i) return !1; - for (var a, s, r = 1; r <= 4; r *= 2) { - var n = t * (1 + 0.2 / r); - n = Math.min(n, e + 100663296); - var g = Math.min( - i, - (a = Math.max(e, n)) + (((s = 65536) - (a % s)) % s), - ); - if (growMemory(g)) return !0; - } - return !1; - }, - l: (e, t) => { - var i = 0; - getEnvStrings().forEach((a, s) => { - var r = t + i; - l[(e + 4 * s) >> 2] = r; - ((e, t) => { - for (var i = 0; i < e.length; ++i) C[t++] = e.charCodeAt(i); - C[t] = 0; - })(a, r); - i += a.length + 1; - }); - return 0; - }, - m: (e, t) => { - var i = getEnvStrings(); - l[e >> 2] = i.length; - var a = 0; - i.forEach((e) => (a += e.length + 1)); - l[t >> 2] = a; - return 0; - }, - n: (e) => 52, - j: function _fd_seek(e, t, i, a, s) { - return 70; - }, - b: (e, t, i, a) => { - for (var s = 0, r = 0; r < i; r++) { - var n = l[t >> 2], - g = l[(t + 4) >> 2]; - t += 8; - for (var o = 0; o < g; o++) printChar(e, h[n + o]); - s += g; - } - l[a >> 2] = s; - return 0; - }, - o: function _gray_to_rgba(e, t) { - e >>= 2; - const i = (a.imageData = new Uint8ClampedArray(4 * t)), - s = a.HEAP32.subarray(e, e + t); - for (let e = 0; e < t; e++) { - i[4 * e] = i[4 * e + 1] = i[4 * e + 2] = s[e]; - i[4 * e + 3] = 255; - } - }, - i: function _graya_to_rgba(e, t, i) { - e >>= 2; - t >>= 2; - const s = (a.imageData = new Uint8ClampedArray(4 * i)), - r = a.HEAP32.subarray(e, e + i), - n = a.HEAP32.subarray(t, t + i); - for (let e = 0; e < i; e++) { - s[4 * e] = s[4 * e + 1] = s[4 * e + 2] = r[e]; - s[4 * e + 3] = n[e]; - } - }, - d: function _jsPrintWarning(e) { - const t = UTF8ToString(e); - (a.warn || console.warn)(`OpenJPEG: ${t}`); - }, - h: function _rgb_to_rgba(e, t, i, s) { - e >>= 2; - t >>= 2; - i >>= 2; - const r = (a.imageData = new Uint8ClampedArray(4 * s)), - n = a.HEAP32.subarray(e, e + s), - g = a.HEAP32.subarray(t, t + s), - o = a.HEAP32.subarray(i, i + s); - for (let e = 0; e < s; e++) { - r[4 * e] = n[e]; - r[4 * e + 1] = g[e]; - r[4 * e + 2] = o[e]; - r[4 * e + 3] = 255; - } - }, - a: function _storeErrorMessage(e) { - const t = UTF8ToString(e); - a.errorMessages - ? (a.errorMessages += "\n" + t) - : (a.errorMessages = t); - }, - }, - N = (function createWasm() { - var e = (function getWasmImports() { - return { a: R }; - })(); - function receiveInstance(e, t) { - N = e.exports; - c = N.p; - updateMemoryViews(); - !(function addOnInit(e) { - f.unshift(e); - })(N.q); - !(function removeRunDependency(e) { - m--; - a.monitorRunDependencies?.(m); - if (0 == m) { - if (null !== y) { - clearInterval(y); - y = null; - } - if (w) { - var t = w; - w = null; - t(); - } - } - })(); - return N; - } - !(function addRunDependency(e) { - m++; - a.monitorRunDependencies?.(m); - })(); - if (a.instantiateWasm) - try { - return a.instantiateWasm(e, receiveInstance); - } catch (e) { - E(`Module.instantiateWasm callback failed with error: ${e}`); - i(e); - } - u || - (u = - "data:application/octet-stream;base64,AGFzbQEAAAABzgEaYAN/f38Bf2AEf39/fwF/YAF/AGACf38AYAF/AX9gA39/fwBgAn9/AX9gBH9/f38AYAN/fn8BfmAFf39/f38Bf2ACfn8Bf2ACfn8BfmAFf39/f38AYAN/fn8Bf2AAAX9gB39/f39/f38Bf2AJf39/f39/f39/AX9gC39/f39/f39/f39/AX9gBn9/f39/fwF/YAZ/fH9/f38Bf2AIf39/f39/f38AYAh/f39/f39/fwF/YAAAYAZ/f39/f38AYAd/f39/f39/AGACfH8BfAJbDwFhAWEAAgFhAWIAAQFhAWMABQFhAWQAAgFhAWUADAFhAWYABwFhAWcAAwFhAWgABwFhAWkABQFhAWoACQFhAWsABAFhAWwABgFhAW0ABgFhAW4ABAFhAW8AAwPAAb4BBwIFAAYEAAUGBAUBBAwFFAYCAgICAAYQEQQCChICBQIEBwQCDgICDQYCFQMHAAAEAwEWCQkDAAkGAQQEBQUODwEBAwADBgIQBBcYAgcGAwcHAQECAAQZBAYHBA8MAAQCAgIABgAGAQEBAQEBAQEAAAAAAAYDAgICAwMDAwMAAxMIBA4EAAgDAwkECAoLCAAAAQEBAQEBAQENAQAEBAUJDwESEQEAAAYDAwEFBQUFBQUFBQELAQEBAQEBAQEBCgQFAXABbm4FBwEBggKAgAIGCAF/AUGQ2QULBxsGAXACAAFxAEEBcgCYAQFzABABdAEAAXUAlwEJvQEBAEEBC21RzAHCAXNzNqcBnAGZAYsBigGJAYgBhwGGAYUBhAFSgQGAAX9+fXx7enl4d3Z1ywHKAckByAHHAcYBQMUBxAFAQMMBwQHAAb8BvgG9AbwBuwG6AbkBswGoAaYBpQGkAaMBogGhAaABnwGeAZ0BmwGaAUlKTFJIgwFTOFCCA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EGoiBCAFRw0ACyACIAVGDQELAkAgAkEDcSIGRQRAIAUhBAwBC0EAIQAgBSEEA0AgA0EBayIDIAEtAAA6AAAgBEEBaiEEIAFBAWohASAAQQFqIgAgBkcNAAsLIAUgAmtBfEsNAANAIANBAWsgAS0AADoAACADQQJrIAEtAAE6AAAgA0EDayABLQACOgAAIANBBGsiAyABLQADOgAAIAFBBGohASAEQQRqIgQgAkcNAAsLC4AEAQN/IAJBgARPBEAgACABIAIQAiAADwsgACACaiEDAkAgACABc0EDcUUEQAJAIABBA3FFBEAgACECDAELIAJFBEAgACECDAELIAAhAgNAIAIgAS0AADoAACABQQFqIQEgAkEBaiICQQNxRQ0BIAIgA0kNAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgACADQQRrIgRLBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAswAQF/AkAgAEUNACABRQ0AQQggACABbCIBECUiAARAIABBACABEBUaCyAAIQILIAILEQAgAEUEQEEADwtBCCAAECUL8gICAn8BfgJAIAJFDQAgACABOgAAIAAgAmoiA0EBayABOgAAIAJBA0kNACAAIAE6AAIgACABOgABIANBA2sgAToAACADQQJrIAE6AAAgAkEHSQ0AIAAgAToAAyADQQR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yAvKAIAICAoAgBBAXRBAmpBAnVrNgIAICMgIygCACAfKAIAQQF0QQJqQQJ1azYCACBDKAIAIgcLIQEgPSA9KAIAIAEgB2pBAmpBAnVrNgIAIBUhBiAQIgEiByAPSARAA0AgFCABQQV0aiIHIAf9AAIAIDYgBkEFdGr9AAIAIAf9AAIQ/a4B/QwCAAAAAgAAAAIAAAACAAAA/a4BQQL9rAH9sQH9CwIAIAEiBkEBaiIBIA9HDQALIA8hBwsgByAbTg0AA0AgB0EDdCEBIAcgLEghBgJAIAdBAEwEQCA2KAIAIQogB0EATgRAIBQgAUECdCIBaiIyIDIoAgAgCiABIDZqIEUgBhsoAgBqQQJqQQJ1azYCACABICRqIgogCigCACAgKAIAIAEgIGogPCAGGygCAGpBAmpBAnVrNgIAIAEgKmoiCiAKKAIAIB8oAgAgASAfaiA6IAYbKAIAakECakECdWs2AgAgQygCACABIENqICYgBhsoAgBqQQJqIQYgASApaiEBDAILIBQgAUECdCIBaiIGIAYoAgAgCkEBdEECakECdWs2AgAgASAkaiIGIAYoAgAgFCgCFEEBdEECakECdWs2AgAgASAqaiIGIAYoAgAgFCgCGEEBdEECakECdWs2AgAgASApaiEBIBQoAhxBAXRBAmohBgwBCyAUIAcgLCAGG0EDdEEEa0ECdCIKaigCACEyIAZFBEAgFCABQQJ0IgFqIgYgBigCACAyIEUoAgBqQQJqQQJ1azYCACABICRqIgYgBigCACAKICRqKAIAIDwoAgBqQQJqQQJ1azYCACABICpqIgYgBigCACAKICpqKAIAIDooAgBqQQJqQQJ1azYCACABIClqIQEgCiApaigCACAmKAIAakECaiEGDAELIBQgAUECdCIBaiIGIAYoAgAgMiAGKAIQakECakECdWs2AgAgASAkaiIGIAYoAgAgCiAkaigCACAGKAIQakECakECdWs2AgAgASAqaiIGIAYoAgAgCiAqaigCACAGKAIQakECakECdWs2AgAgCiApaigCACABIClqIgEoAhBqQQJqIQYLIAEgASgCACAGQQJ1azYCACAHQQFqIgcgG0cNAAsLIA4gHE4NACAMIA4iASIHSgRAA0AgFCABQQV0aiIHIAf9AAIgIAf9AAIA/a4BQQH9rAEgB/0AAhD9rgH9CwIQIAFBAWoiASAMRw0ACyAMIQcLIAcgHE4NAANAIEMgB0EDdCIBQQJ0aiIyAn8gB0EASARAIBQoAgAhBiAHQX9HBEAgNiABQQJ0IgFqIgogCigCACAGajYCACABICBqIgYgBigCACAkKAIAajYCACABIB9qIgEgASgCACAqKAIAajYCACApKAIADAILIDYgAUECdCIBaiIKIAooAgAgVygCACAGakEBdWo2AgAgASAgaiIGIAYoAgAgVigCACAkKAIAakEBdWo2AgAgASAfaiIBIAEoAgAgVSgCACAqKAIAakEBdWo2AgAgVCgCACApKAIAakEBdQwBCyABID4gByASSBshBiASIAdBAWoiZkwEQCA2IAFBAnQiCmoiASABKAIAIGsoAgAgFCAGQQJ0aiIBKAIAakEBdWo2AgAgCiAgaiIGIAYoAgAgaigCACABKAIEakEBdWo2AgAgCiAfaiIGIAYoAgAgaSgCACABKAIIakEBdWo2AgAgaCgCACABKAIMakEBdQwBCyA2IAFBAnQiCmoiASABKAIAIBQgZkEFdGoiASgCACAUIAZBAnRqIgYoAgBqQQF1ajYCACAKICBqImYgZigCACABKAIEIAYoAgRqQQF1ajYCACAKIB9qIgogCigCACABKAIIIAYoAghqQQF1ajYCACABKAIMIAYoAgxqQQF1CyAyKAIAajYCACAHQQFqIgcgHEcNAAsLIDkgFiBdIBggSCBeQQFBBEEAECYNAAsLDAILIBQQEEEBIQcLIDkgNUEQaygCACIBIF8oAgAiBmsgNUEMaygCACBgKAIAIgprIDVBCGsoAgAiCCAGayA1QQRrKAIAIAprIAkoAjRBASAIIAFrEB4gORAjDAMLIDkQIyAUEBBBACEHDAILIDkQI0EAIQcMAQtBACEHIA4QICAPEBALICVBIGokACAHDQEMBQsgASEIQQAhDv0MAAAAAAAAAAAAAAAAAAAAACGAASMAQUBqIhwkAAJAAn8CQCAZKAJABEAgCSgCHCIVIAkoAhhBmAFsaiIBQZgBaygCACEaIAFBk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hQgACAAKAIYQQFqNgIYIAAoAhwiAUUNACABKAIAQQA2AgggACABKAIENgIcIAAgACgCIEEBazYCICABEBALC/oCAQR/AkAgAEUNACAAKAKsKCIBBEAgACgCqCgiAgRAQQAhAQNAIAAoAqwoIAFBA3RqKAIAIgMEQCADEBAgACgCqCghAgsgAUEBaiIBIAJJDQALIAAoAqwoIQELIABBADYCqCggARAQIABBADYCrCgLIAAoArQoIgEEQCABEBAgAEEANgK0KAsgACgC0CsiAQRAIAEQECAAQQA2AtArCyAAKALsKyIBBEAgARAQIABBADYC7CsLIAAoAugrIgEEQCABEBAgAEEANgLoKwsgACgC/CsiAQRAIAEQECAAQQA2AoQsIABCADcC/CsLIAAoAvArIgEEQCAAKAL0KyIDBH9BACECA0AgASgCDCIEBEAgBBAQIAFBADYCDCAAKAL0KyEDCyABQRRqIQEgAkEBaiICIANJDQALIAAoAvArBSABCxAQIABBADYC8CsLIAAoAuQrIgEEQCABEBAgAEEANgLkKwsgACgC3CsiAUUNACABEBAgAEIANwLcKwsLyAcCEX8BfiAAKAIQIghBIE8EQCAAKQMIpw8LAkAgACgCFCIDQQROBEAgACgCACICQQNrKAIAIQEgACADQQRrIgM2AhQgACACQQRrNgIADAELIANBAEwEQAwBCyADQQFxIQ0gACgCACECAkAgA0EBRgRAQRghBAwBCyADQf7///8HcSEJQRghBANAIAAgAkEBayIGNgIAIAItAAAhDCAAIAJBAmsiAjYCACAAIANBAWs2AhQgBi0AACEGIAAgA0ECayIDNgIUIAwgBHQgAXIgBiAEQQhrdHIhASAEQRBrIQQgBUECaiIFIAlHDQALCyANBEAgACACQQFrNgIAIAItAAAhDiAAIANBAWs2AhQgDiAEdCABciEBC0EAIQMLIAAoAhghAiAAIAFB/wFxIglBjwFLNgIYIABBB0EIIAFBgICA+AdxQYCAgPgHRhtBCCACGyICQQhBB0EIIAFBgID8A3FBgID8A0YbIAFB/////3hNG2oiBEEIQQdBCCABQYD+AXFBgP4BRhsgAUEQdkH/AXEiBUGPAU0ba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QN0aigCACIDBEAgAxAQIAAoAnAhAgsgAUEBaiIBIAJJDQALIAAoAnQhAQsgAEEANgJwIAEQECAAQQA2AnQLIAAoAogBEBAgAEEANgJ4IABBADYCiAEgACgCZBAQIABBADYCZCAALQC8AUECcUUEQCAAKAKoARAQCyAAQdAAakEAQfAAEBUaIAAoAsABEDIgAEEANgLAASAAKALEARAyIABBADYCwAEgACgCyAEiAQRAIAEoAhwiAgRAIAIQECABQQA2AhwLIAEoAigiAgRAIAEoAiQEQANAIAIgBUEobCIDaigCJCIEBEAgBBAQIAEoAigiAiADakEANgIkCyACIANqKAIQIgQEQCAEEBAgASgCKCICIANqQQA2AhALIAIgA2ooAhgiBARAIAQQECABKAIoIgIgA2pBADYCGAsgBUEBaiIFIAEoAiRJDQALCyACEBAgAUEANgIoCyABEBALIABBADYCyAEgACgCSBAhIABBADYCSCAAKAJMECEgAEEANgJMIAAoAtQBIgMEQAJAIAMoAghFDQAgAygCDARAIANBADYCKANAIAMoAhhBAEoNAAsLIANBATYCECADKAIAEBAgAygCHCICRQ0AA0AgAigCBCEBIAIQECADIAE2AhwgASICDQALCyADKAIkIgIEQCACKAIEIgVBAEoEQEEAIQEDQCACKAIAIAFBDGxqIgQoAggiBgRAIAQoAgQgBhECACACKAIEIQULIAFBAWoiASAFSA0ACwsgAigCABAQIAIQEAsgAxAQCyAAQQA2AtQBIAAQEAsL5gMCCH8EfiAAKAIUKAIAKAIUIAFBzABsaiIJKAIMIgggACgCGCgCGCABQTRsaiIKNQIEIhBCAX0iEiAANQI8fCAQgKciCyAIIAtJGyEMIAkoAggiCCAKNQIAIhFCAX0iEyAANQI4fCARgKciCiAIIApJGyEKIAkoAgQiCCASIAA1AjR8IBCApyILIAggC0sbIQsgCSgCACIIIBMgADUCMHwgEYCnIg0gCCANSxshDUEAIQggACgCICgC0CsgAUG4CGxqKAIUIQ4CQCAJKAIUQQAgAmtBfyACG2oiAkUEQCAKIQAgDSEIIAshAQwBCyADQQFxIAJBAWsiD3Qi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A09xRQRAIAAgAUE/cUGAAXI6AAIgACABQQx2QeABcjoAACAAIAFBBnZBP3FBgAFyOgABQQMMAwsgAUGAgARrQf//P00EQCAAIAFBP3FBgAFyOgADIAAgAUESdkHwAXI6AAAgACABQQZ2QT9xQYABcjoAAiAAIAFBDHZBP3FBgAFyOgABQQQMAwsLQZTHAUEZNgIAQX8MAQsgACABOgAAQQELC7wCAAJAAkACQAJAAkACQAJAAkACQAJAAkAgAUEJaw4SAAgJCggJAQIDBAoJCgoICQUGBwsgAiACKAIAIgFBBGo2AgAgACABKAIANgIADwsgAiACKAIAIgFBBGo2AgAgACABMgEANwMADwsgAiACKAIAIgFBBGo2AgAgACABMwEANwMADwsgAiACKAIAIgFBBGo2AgAgACABMAAANwMADwsgAiACKAIAIgFBBGo2AgAgACABMQAANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKwMAOQMADwsgACACIAMRAwALDwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC3MBBn8gACgCACIDLAAAQTBrIgFBCUsEQEEADwsDQEF/IQQgAkHMmbPmAE0EQEF/IAEgAkEKbCIFaiABIAVB/////wdzSxshBAsgACADQQFqIgU2AgAgAywAASEGIAQhAiAFIQMgBkEwayIBQQpJDQALIAILtBQCFX8BfiMAQUBqIggkACAIIAE2AjwgCEEnaiEWIAhBKGohEQJAAkACQAJAA0BBACEHA0AgASENIAcgDkH/////B3NKDQIgByAOaiEOAkACQAJAAkAgASIHLQAAIgsEQANAAkACQCALQf8BcSIBRQRAIAchAQwBCyABQSVHDQEgByELA0AgCy0AAUElRwRAIAshAQwCCyAHQQFqIQcgCy0AAiEZIAtBAmoiASELIBlBJUYNAAsLIAcgDWsiByAOQf////8HcyIXSg0JIAAEQCAAIA0gBxAZCyAHDQcgCCABNgI8IAFBAWohB0F/IRACQCABLAABQTBrIglBCUsNACABLQAC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IARCBIYgA0I8iIRCgICAgICAgASEIQJC/w8MAQtC/w8gCkH+hwFLDQAaQgBBgPgAQYH4ACAFUCIBGyIAIAprIglB8ABKDQAaIAMhAiAEIARCgICAgICAwACEIAEbIgYhBAJAQYABIAlrIgFBwABxBEAgAyABQUBqrYYhBEIAIQIMAQsgAUUNACAEIAGtIgWGIAJBwAAgAWutiIQhBCACIAWGIQILIAggAjcDECAIIAQ3AxgCQCAJQcAAcQRAIAYgCUFAaq2IIQNCACEGDAELIAlFDQAgBkHAACAJa62GIAMgCa0iAoiEIQMgBiACiCEGCyAIIAM3AwAgCCAGNwMIIAgpAwhCBIYgCCkDACICQjyIhCEDAkAgACAKRyAIKQMQIAgpAxiEQgBSca0gAkL//////////w+DhCICQoGAgICAgICACFoEQCADQgF8IQMMAQsgAkKAgICAgICAgAhSDQAgA0IBgyADfCEDCyADQoCAgICAgIAIhSADIANC/////////wdWIgAbIQIgAK0LIQMgCEEgaiQAIAsgB0KAgICAgICAgIB/gyADQjSGhCAChL85AwALhhgDE38BfAN+IwBBsARrIgwkACAMQQA2AiwCQCABvSIaQgBTBEBBASERQboIIRMgAZoiAb0hGgwBCyAEQYAQcQRAQQEhEUG9CCETDAELQcAIQbsIIARBAXEiERshEyARRSEVCwJAIBpCgICAgICAgPj/AINCgICAgICAgPj/AFEEQCAAQSAgAiARQQNqIgMgBEH//3txEBwgACATIBEQGSAAQZIJQfYKIAVBIHEiBRtB+wlB+gogBRsgASABYhtBAxAZIABBICACIAMgBEGAwABzEBwgAyACIAIgA0gbIQoMAQsgDEEQaiESAkACfwJAIAEgDEEsahBlIgEgAaAiAUQAAAAAAAAAAGIEQCAMIAwoAiwiBkEBazYCLCAFQSByIg5B4QBHDQEMAwsgBUEgciIOQeEARg0CIAwoAiwhCUEGIAMgA0EASBsMAQsgDCAGQR1rIgk2AiwgAUQAAAAAAACwQaIhAUEGIAMgA0EASBsLIQsgDEEwakGgAkEAIAlBAE4baiINIQcDQCAHAn8gAUQAAAAAAAD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EBIABBBGohACAEQQFqIgQgAkcNAAsLIANBEGokAAtLAQJ/IwBBEGsiAyQAIAIEQANAIAAgA0EMakECEBEgASADKAIMNgIAIAFBBGohASAAQQJqIQAgBEEBaiIEIAJHDQALCyADQRBqJAALSgECfyMAQRBrIgMkACACBEADQCAAIANBCGoQRCABIAMrAwi2OAIAIAFBBGohASAAQQhqIQAgBEEBaiIEIAJHDQALCyADQRBqJAALaAECfyMAQRBrIgMkACACBEADQCADIAAtAAA6AA8gAyAALQABOgAOIAMgAC0AAjoADSADIAAtAAM6AAwgASADKgIMOAIAIAFBBGohASAAQQRqIQAgBEEBaiIEIAJHDQALCyADQRBqJAALTAECfyMAQRBrIgMkACACBEADQCAAIANBDGpBBBARIAEgAygCDLM4AgAgAUEEaiEBIABBBGohACAEQQFqIgQgAkcNAAsLIANBEGokAAtMAQJ/IwBBEGsiAyQAIAIEQANAIAAgA0EMakECEBEgASADKAIMszgCACABQQRqIQEgAEECaiEAIARBAWoiBCACRw0ACwsgA0EQaiQAC6oIAg1/AXsjAEEQayIIJAACfyAAKAIIQRBGBEAgACgCnAEgACgCzAFBjCxsagwBCyAAKAIMCyEJAkAgAkUEQCADQQFB8B9BABAPDAELIAAoAkghBkEBIQQgASAIQQhqQQEQESAIKAIIIgVBAk8EQCADQQJBxsgAQQAQDwwBCyACIAVBAWpHBEBBACEEIANBAkHwH0EAEA8MAQsCQCAGKAIQIgNFDQAgCSgC0CshBCADQQhPBEAgA0F4cSEGQQAhAgNAIARBADYCvEMgBEEANgKEOyAEQQA2AswyIARBADYClCogBEEANgLcISAEQQA2AqQZIARBADYC7BAgBEEANgK0CCAEQcDDAGohBCACQQhqIgIgBkcNAAsLIANBB3EiA0UNAEEAIQIDQCAEQQA2ArQIIARBuAhqIQQgAkEBaiICIANHDQALCyAJKALoKyICBH8gAhAQIAlBADYC6CsgCCgCCAUgBQtFBEBBASEEDAELA0AgAUEBaiIBIAhBDGpBARARAkAgCSgCgCxFDQAgCSgC/CsiAygCACA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AAICBQajYAAABweXRmNwAAAGgycGo4AEHAwAELMnJkaGk5AAAAcmxvYzoAAABjY3BiOwAAAHJsY3A8AAAAcGFtYz0AAABmZWRjPgAAAPhiAEGAwQELQRkACwAZGRkAAAAABQAAAAAAAAkAAAAACwAAAAAAAAAAGQAKChkZGQMKBwABAAkLGAAACQYLAAALAAYZAAAAGRkZAEHRwQELIQ4AAAAAAAAAABkACw0ZGRkADQAAAgAJDgAAAAkADgAADgBBi8IBCwEMAEGXwgELFRMAAAAAEwAAAAAJDAAAAAAADAAADABBxcIBCwEQAEHRwgELFQ8AAAAEDwAAAAAJEAAAAAAAEAAAEABB/8IBCwESAEGLwwELHhEAAAAAEQAAAAAJEgAAAAAAEgAAEgAAGgAAABoaGgBBwsMBCw4aAAAAGhoaAAAAAAAACQBB88MBCwEUAEH/wwELFRcAAAAAFwAAAAAJFAAAAAAAFAAAFABBrcQBCwEWAEG5xAELJxUAAAAAFQAAAAAJFgAAAAAAFgAAFgAAMDEyMzQ1Njc4OUFCQ0RFRgBB4MQBCwmQbAEAAAAAAAUAQfTEAQsBaQBBjMUBCwpqAAAAawAAAHhoAEGkxQELAQIAQbTFAQsI//////////8AQfjFAQsBBQBBhMYBCwFsAEGcxgELDmoAAABtAAAAiGgAAAAEAEG0xgELAQEAQcTGAQsF/////wo="); - return receiveInstance(instantiateSync(u, e)[0]); - })(); - N.q, (a._malloc = N.r), (a._free = N.s), (a._jp2_decode = N.u); - w = function runCaller() { - b || run(); - b || (w = runCaller); - }; - function run() { - if (!(m > 0)) { - !(function preRun() { - if (a.preRun) { - "function" == typeof a.preRun && (a.preRun = [a.preRun]); - for (; a.preRun.length; ) (e = a.preRun.shift()), d.unshift(e); - } - var e; - callRuntimeCallbacks(d); - })(); - if (!(m > 0)) - if (a.setStatus) { - a.setStatus("Running..."); - setTimeout(function () { - setTimeout(function () { - a.setStatus(""); - }, 1); - doRun(); - }, 1); - } else doRun(); - } - function doRun() { - if (!b) { - b = !0; - a.calledRun = !0; - !(function initRuntime() { - callRuntimeCallbacks(f); - })(); - t(a); - a.onRuntimeInitialized && a.onRuntimeInitialized(); - !(function postRun() { - if (a.postRun) { - "function" == typeof a.postRun && (a.postRun = [a.postRun]); - for (; a.postRun.length; ) - (e = a.postRun.shift()), p.unshift(e); - } - var e; - callRuntimeCallbacks(p); - })(); - } - } - } - if (a.preInit) { - "function" == typeof a.preInit && (a.preInit = [a.preInit]); - for (; a.preInit.length > 0; ) a.preInit.pop()(); - } - run(); - return a; + return (await decoder.decode()).image; + } catch (reason) { + warn(`getTransferableImage - failed: "${reason}".`); + return null; + } finally { + decoder?.close(); + } + } +} // ./external/openjpeg/openjpeg.js + +var OpenJPEG = (() => { + var _scriptName = + typeof document != "undefined" ? document.currentScript?.src : undefined; + return function (moduleArg = {}) { + var moduleRtn; + var Module = moduleArg; + var readyPromiseResolve, readyPromiseReject; + var readyPromise = new Promise((resolve, reject) => { + readyPromiseResolve = resolve; + readyPromiseReject = reject; }); -const Ii = oi; -class JpxError extends rt { - constructor(e) { - super(e, "JpxError"); + var ENVIRONMENT_IS_WEB = true; + var ENVIRONMENT_IS_WORKER = false; + Module.decode = function ( + bytes, + { numComponents = 4, isIndexedColormap = false, smaskInData = false }, + ) { + const size = bytes.length; + const ptr = Module._malloc(size); + Module.HEAPU8.set(bytes, ptr); + const ret = Module._jp2_decode( + ptr, + size, + numComponents > 0 ? numComponents : 0, + !!isIndexedColormap, + !!smaskInData, + ); + Module._free(ptr); + if (ret) { + const { errorMessages: errorMessages } = Module; + if (errorMessages) { + delete Module.errorMessages; + return errorMessages; + } + return "Unknown error"; + } + const { imageData: imageData } = Module; + Module.imageData = null; + return imageData; + }; + var moduleOverrides = Object.assign({}, Module); + var arguments_ = []; + var thisProgram = "./this.program"; + var quit_ = (status, toThrow) => { + throw toThrow; + }; + var scriptDirectory = ""; + var read_, readAsync, readBinary; + if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = self.location.href; + } else if (typeof document != "undefined" && document.currentScript) { + scriptDirectory = document.currentScript.src; + } + if (_scriptName) { + scriptDirectory = _scriptName; + } + if (scriptDirectory.startsWith("blob:")) { + scriptDirectory = ""; + } else { + scriptDirectory = scriptDirectory.substr( + 0, + scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1, + ); + } + read_ = (url) => { + var xhr = new XMLHttpRequest(); + xhr.open("GET", url, false); + xhr.send(null); + return xhr.responseText; + }; + if (ENVIRONMENT_IS_WORKER) { + readBinary = (url) => { + var xhr = new XMLHttpRequest(); + xhr.open("GET", url, false); + xhr.responseType = "arraybuffer"; + xhr.send(null); + return new Uint8Array(xhr.response); + }; + } + readAsync = (url, onload, onerror) => { + fetch(url, { + credentials: "same-origin", + }) + .then((response) => { + if (response.ok) { + return response.arrayBuffer(); + } + return Promise.reject( + new Error(response.status + " : " + response.url), + ); + }) + .then(onload, onerror); + }; + } else { + } + var out = Module["print"] || console.log.bind(console); + var err = Module["printErr"] || console.error.bind(console); + Object.assign(Module, moduleOverrides); + moduleOverrides = null; + if (Module["arguments"]) arguments_ = Module["arguments"]; + if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; + if (Module["quit"]) quit_ = Module["quit"]; + var wasmBinary; + if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; + function intArrayFromBase64(s) { + var decoded = atob(s); + var bytes = new Uint8Array(decoded.length); + for (var i = 0; i < decoded.length; ++i) { + bytes[i] = decoded.charCodeAt(i); + } + return bytes; + } + function tryParseAsDataURI(filename) { + if (!isDataURI(filename)) { + return; + } + return intArrayFromBase64(filename.slice(dataURIPrefix.length)); + } + var wasmMemory; + var ABORT = false; + var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; + function updateMemoryViews() { + var b = wasmMemory.buffer; + Module["HEAP8"] = HEAP8 = new Int8Array(b); + Module["HEAP16"] = HEAP16 = new Int16Array(b); + Module["HEAPU8"] = HEAPU8 = new Uint8Array(b); + Module["HEAPU16"] = HEAPU16 = new Uint16Array(b); + Module["HEAP32"] = HEAP32 = new Int32Array(b); + Module["HEAPU32"] = HEAPU32 = new Uint32Array(b); + Module["HEAPF32"] = HEAPF32 = new Float32Array(b); + Module["HEAPF64"] = HEAPF64 = new Float64Array(b); + } + var __ATPRERUN__ = []; + var __ATINIT__ = []; + var __ATPOSTRUN__ = []; + var runtimeInitialized = false; + function preRun() { + if (Module["preRun"]) { + if (typeof Module["preRun"] == "function") + Module["preRun"] = [Module["preRun"]]; + while (Module["preRun"].length) { + addOnPreRun(Module["preRun"].shift()); + } + } + callRuntimeCallbacks(__ATPRERUN__); + } + function initRuntime() { + runtimeInitialized = true; + callRuntimeCallbacks(__ATINIT__); + } + function postRun() { + if (Module["postRun"]) { + if (typeof Module["postRun"] == "function") + Module["postRun"] = [Module["postRun"]]; + while (Module["postRun"].length) { + addOnPostRun(Module["postRun"].shift()); + } + } + callRuntimeCallbacks(__ATPOSTRUN__); + } + function addOnPreRun(cb) { + __ATPRERUN__.unshift(cb); + } + function addOnInit(cb) { + __ATINIT__.unshift(cb); + } + function addOnPostRun(cb) { + __ATPOSTRUN__.unshift(cb); + } + var runDependencies = 0; + var runDependencyWatcher = null; + var dependenciesFulfilled = null; + function addRunDependency(id) { + runDependencies++; + Module["monitorRunDependencies"]?.(runDependencies); + } + function removeRunDependency(id) { + runDependencies--; + Module["monitorRunDependencies"]?.(runDependencies); + if (runDependencies == 0) { + if (runDependencyWatcher !== null) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + } + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback(); + } + } + } + var dataURIPrefix = "data:application/octet-stream;base64,"; + var isDataURI = (filename) => filename.startsWith(dataURIPrefix); + function findWasmBinary() { + var f = + "data:application/octet-stream;base64,AGFzbQEAAAABzgEaYAN/f38Bf2AEf39/fwF/YAF/AGACf38AYAF/AX9gA39/fwBgAn9/AX9gBH9/f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JBgARPBEAgACABIAIQAiAADwsgACACaiEDAkAgACABc0EDcUUEQAJAIABBA3FFBEAgACECDAELIAJFBEAgACECDAELIAAhAgNAIAIgAS0AADoAACABQQFqIQEgAkEBaiICQQNxRQ0BIAIgA0kNAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgACADQQRrIgRLBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAswAQF/AkAgAEUNACABRQ0AQQggACABbCIBECUiAARAIABBACABEBUaCyAAIQILIAILEQAgAEUEQEEADwtBCCAAECUL8gICAn8BfgJAIAJFDQAgACABOgAAIAAgAmoiA0EBayABOgAAIAJBA0kNACAAIAE6AAIgACABOgABIANBA2sgAToAACADQQJrIAE6AAAgAkEHSQ0AIAAgAToAAyADQQRrIAE6AAAgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBBGsgATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQQhrIAE2AgAgAkEMayABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkEQayABNgIAIAJBFGsgATYCACACQRhrIAE2AgAgAkEcayABNgIAIAQgA0EEc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A9HDQALIA8hBwsgByAbTg0AA0AgB0EDdCEBIAcgLEghBgJAIAdBAEwEQCA2KAIAIQogB0EATgRAIBQgAUECdCIBaiIyIDIoAgAgCiABIDZqIEUgBhsoAgBqQQJqQQJ1azYCACABICRqIgogCigCACAgKAIAIAEgIGogPCAGGygCAGpBAmpBAnVrNgIAIAEgKmoiCiAKKAIAIB8oAgAgASAfaiA6IAYbKAIAakECakECdWs2AgAgQygCACABIENqICYgBhsoAgBqQQJqIQYgASApaiEBDAILIBQgAUECdCIBaiIGIAYoAgAgCkEBdEECakECdWs2AgAgASAkaiIGIAYoAgAgFCgCFEEBdEECakECdWs2AgAgASAqaiIGIAYoAgAgFCgCGEEBdEECakECdWs2AgAgASApaiEBIBQoAhxBAXRBAmohBgwBCyAUIAcgLCAGG0EDdEEEa0ECdCIKaigCACEyIAZFBEAgFCABQQJ0IgFqIgYgBigCACAyIEUoAgBqQQJqQQJ1azYCACABICRqIgYgBigCACAKICRqKAIAIDwoAgBqQQJqQQJ1azYCACABICpqIgYgBigCACAKICpqKAIAIDooAgBqQQJqQQJ1azYCACABIClqIQEgCiApaigCACAmKAIAakECaiEGDAELIBQgAUECdCIBaiIGIAYoAgAgMiAGKAIQakECakECdWs2AgAgASAkaiIGIAYoAgAgCiAkaigCACAGKAIQakECakECdWs2AgAgASAqaiIGIAYoAgAgCiAqaigCACAGKAIQakECakECdWs2AgAgCiApaigCACABIClqIgEoAhBqQQJqIQYLIAEgASgCACAGQQJ1azYCACAHQQFqIgcgG0cNAAsLIA4gHE4NACAMIA4iASIHSgRAA0AgFCABQQV0aiIHIAf9AAIgIAf9AAIA/a4BQQH9rAEgB/0AAhD9rgH9CwIQIAFBAWoiASAMRw0ACyAMIQcLIAcgHE4NAANAIEMgB0EDdCIBQQJ0aiIyAn8gB0EASARAIBQoAgAhBiAHQX9HBEAgNiABQQJ0IgFqIgogCigCACAGajYCACABICBqIgYgBigCACAkKAIAajYCACABIB9qIgEgASgCACAqKAIAajYCACApKAIAD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AkAgAUEJaw4SAAgJCggJAQIDBAoJCgoICQUGBwsgAiACKAIAIgFBBGo2AgAgACABKAIANgIADwsgAiACKAIAIgFBBGo2AgAgACABMgEANwMADwsgAiACKAIAIgFBBGo2AgAgACABMwEANwMADwsgAiACKAIAIgFBBGo2AgAgACABMAAANwMADwsgAiACKAIAIgFBBGo2AgAgACABMQAANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKwMAOQMADwsgACACIAMRAwALDwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC3MBBn8gACgCACIDLAAAQTBrIgFBCUsEQEEADwsDQEF/IQQgAkHMmbPmAE0EQEF/IAEgAkEKbCIFaiABIAVB/////wdzSxshBAsgACADQQFqIgU2AgAgAywAASEGIAQhAiAFIQMgBkEwayIBQQpJDQALIAILtBQCFX8BfiMAQUBqIggkACAIIAE2AjwgCEEnaiEWIAhBKGohEQJAAkACQAJAA0BBACEHA0AgASENIAcgDkH/////B3NKDQIgByAOaiEOAkACQAJAAkAgASIHLQAAIgsEQANAAkACQCALQf8BcSIBRQRAIAchAQwBCyABQSVHDQEgByELA0AgCy0AAUElRwRAIAshAQwCCyAHQQFqIQcgCy0AAiEZIAtBAmoiASELIBlBJUYNAAsLIAcgDWsiByAOQf////8HcyIXSg0JIAAEQCAAIA0gBxAZCyAHDQcgCCABNgI8IAFBAWohB0F/IRACQCABLAABQTBrIglBCUsNACABLQACQSRHDQAgAUEDaiEHQQEhEiAJIRALIAggBzYCPEEAIQwCQCAHLAAAIgtBIGsiAUEfSwRAIAchCQwBCyAHIQlBASABdCIBQYnRBHFFDQADQCAIIAdBAWoiCTYCPCABIAxyIQwgBywAASILQSBrIgFBIE8NASAJIQdBASABdCIBQYnRBHENAAsLAkAgC0EqRgRAAn8CQCAJLAABQTBrIgFBCUsNACAJLQACQSRHDQACfyAARQRAIAQgAUEC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AwBCyAGEBBBAAshDCADQfAAaiQAIAwL5gEBBn8gACgCCEE1IAIQJARAAkAgACgCCCIGKAIAIQMgBigCCCEFAkACQAJ/AkAgAwRAQQEhBCADQQFxIQcgA0EBRw0BQQAMAgsgBkEANgIADAILIANBfnEhAwNAAn9BACAERQ0AGkEAIAAgASACIAUoAgARAABFDQAaIAAgASACIAUoAgQRAABBAEcLIQQgBUEIaiEFIAhBAmoiCCADRw0ACyAERQshAyAHBEAgAw0CIAAgASACIAUoAgARAABBAEchBAsgBkEANgIAIARFDQILIAAoAgAaQQEPCyAGQQA2AgALC0EACwoAIAAoAgAaQQALFAAgACgCACIABEAgACABNgK4AQsLIQAgACgCACABEFMgAEEAOgB8IAAgASgCuEBBAXE2AoABCzIAIAJFBEBBAA8LIAAoAgAgASACIAMQSEUEQCADQQFBqS9BABAPQQAPCyAAIAIgAxBxC2kCAn8BfCMAQRBrIgMkACACBEADQCAAIANBCGoQRCABAn8gAysDCCIFmUQAAAAAAADgQWMEQCAFqgwBC0GAgICAeAs2AgAgAUEEaiEBIABBCGohACAEQQFqIgQgAkcNAAsLIANBEGokAAuEAQICfwF9IwBBEGsiAyQAIAIEQANAIAMgAC0AADoADyADIAAtAAE6AA4gAyAALQACOgANIAMgAC0AAzoADCABAn8gAyoCDCIFi0MAAABPXQRAIAWoDAELQYCAgIB4CzYCACABQQRqIQEgAEEEaiEAIARBAWoiBCACRw0ACwsgA0EQaiQAC0sBAn8jAEEQayIDJAAgAgRAA0AgACADQQxqQQQQESABIAMoAgw2AgAgAUEEaiEBIABBBGohACAEQQFqIgQgAkcNAAsLIANBEGokAAtLAQJ/IwBBEGsiAyQAIAIEQANAIAAgA0EMakECEBEgASADKAIMNgIAIAFBBGohASAAQQJqIQAgBEEBaiIEIAJHDQALCyADQRBqJAALSgECfyMAQRBrIgMkACACBEADQCAAIANBCGoQRCABIAMrAwi2OAIAIAFBBGohASAAQQhqIQAgBEEBaiIEIAJHDQALCyADQRBqJAALaAECfyMAQRBr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AAkADgAADgBBi8IBCwEMAEGXwgELFRMAAAAAEwAAAAAJDAAAAAAADAAADABBxcIBCwEQAEHRwgELFQ8AAAAEDwAAAAAJEAAAAAAAEAAAEABB/8IBCwESAEGLwwELHhEAAAAAEQAAAAAJEgAAAAAAEgAAEgAAGgAAABoaGgBBwsMBCw4aAAAAGhoaAAAAAAAACQBB88MBCwEUAEH/wwELFRcAAAAAFwAAAAAJFAAAAAAAFAAAFABBrcQBCwEWAEG5xAELJxUAAAAAFQAAAAAJFgAAAAAAFgAAFgAAMDEyMzQ1Njc4OUFCQ0RFRgBB4MQBCwmQbAEAAAAAAAUAQfTEAQsBaQBBjMUBCwpqAAAAawAAAHhoAEGkxQELAQIAQbTFAQsI//////////8AQfjFAQsBBQBBhMYBCwFsAEGcxgELDmoAAABtAAAAiGgAAAAEAEG0xgELAQEAQcTGAQsF/////wo="; + return f; + } + var wasmBinaryFile; + function getBinarySync(file) { + if (file == wasmBinaryFile && wasmBinary) { + return new Uint8Array(wasmBinary); + } + var binary = tryParseAsDataURI(file); + if (binary) { + return binary; + } + if (readBinary) { + return readBinary(file); + } + throw 'sync fetching of the wasm failed: you can preload it to Module["wasmBinary"] manually, or emcc.py will do that for you when generating HTML (but not JS)'; + } + function instantiateSync(file, info) { + var module; + var binary = getBinarySync(file); + module = new WebAssembly.Module(binary); + var instance = new WebAssembly.Instance(module, info); + return [instance, module]; + } + function getWasmImports() { + return { + a: wasmImports, + }; + } + function createWasm() { + var info = getWasmImports(); + function receiveInstance(instance, module) { + wasmExports = instance.exports; + wasmMemory = wasmExports["p"]; + updateMemoryViews(); + addOnInit(wasmExports["q"]); + removeRunDependency("wasm-instantiate"); + return wasmExports; + } + addRunDependency("wasm-instantiate"); + if (Module["instantiateWasm"]) { + try { + return Module["instantiateWasm"](info, receiveInstance); + } catch (e) { + err(`Module.instantiateWasm callback failed with error: ${e}`); + readyPromiseReject(e); + } + } + if (!wasmBinaryFile) wasmBinaryFile = findWasmBinary(); + var result = instantiateSync(wasmBinaryFile, info); + return receiveInstance(result[0]); + } + var callRuntimeCallbacks = (callbacks) => { + while (callbacks.length > 0) { + callbacks.shift()(Module); + } + }; + var noExitRuntime = Module["noExitRuntime"] || true; + var __emscripten_memcpy_js = (dest, src, num) => + HEAPU8.copyWithin(dest, src, src + num); + function _copy_pixels_1(compG_ptr, nb_pixels) { + compG_ptr >>= 2; + const imageData = (Module.imageData = new Uint8ClampedArray(nb_pixels)); + const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); + imageData.set(compG); + } + function _copy_pixels_3(compR_ptr, compG_ptr, compB_ptr, nb_pixels) { + compR_ptr >>= 2; + compG_ptr >>= 2; + compB_ptr >>= 2; + const imageData = (Module.imageData = new Uint8ClampedArray( + nb_pixels * 3, + )); + const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr + nb_pixels); + const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); + const compB = Module.HEAP32.subarray(compB_ptr, compB_ptr + nb_pixels); + for (let i = 0; i < nb_pixels; i++) { + imageData[3 * i] = compR[i]; + imageData[3 * i + 1] = compG[i]; + imageData[3 * i + 2] = compB[i]; + } + } + function _copy_pixels_4( + compR_ptr, + compG_ptr, + compB_ptr, + compA_ptr, + nb_pixels, + ) { + compR_ptr >>= 2; + compG_ptr >>= 2; + compB_ptr >>= 2; + compA_ptr >>= 2; + const imageData = (Module.imageData = new Uint8ClampedArray( + nb_pixels * 4, + )); + const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr + nb_pixels); + const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); + const compB = Module.HEAP32.subarray(compB_ptr, compB_ptr + nb_pixels); + const compA = Module.HEAP32.subarray(compA_ptr, compA_ptr + nb_pixels); + for (let i = 0; i < nb_pixels; i++) { + imageData[4 * i] = compR[i]; + imageData[4 * i + 1] = compG[i]; + imageData[4 * i + 2] = compB[i]; + imageData[4 * i + 3] = compA[i]; + } + } + var getHeapMax = () => 2147483648; + var growMemory = (size) => { + var b = wasmMemory.buffer; + var pages = (size - b.byteLength + 65535) / 65536; + try { + wasmMemory.grow(pages); + updateMemoryViews(); + return 1; + } catch (e) {} + }; + var _emscripten_resize_heap = (requestedSize) => { + var oldSize = HEAPU8.length; + requestedSize >>>= 0; + var maxHeapSize = getHeapMax(); + if (requestedSize > maxHeapSize) { + return false; + } + var alignUp = (x, multiple) => + x + ((multiple - (x % multiple)) % multiple); + for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { + var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); + overGrownHeapSize = Math.min( + overGrownHeapSize, + requestedSize + 100663296, + ); + var newSize = Math.min( + maxHeapSize, + alignUp(Math.max(requestedSize, overGrownHeapSize), 65536), + ); + var replacement = growMemory(newSize); + if (replacement) { + return true; + } + } + return false; + }; + var ENV = {}; + var getExecutableName = () => thisProgram || "./this.program"; + var getEnvStrings = () => { + if (!getEnvStrings.strings) { + var lang = + ( + (typeof navigator == "object" && + navigator.languages && + navigator.languages[0]) || + "C" + ).replace("-", "_") + ".UTF-8"; + var env = { + USER: "web_user", + LOGNAME: "web_user", + PATH: "/", + PWD: "/", + HOME: "/home/web_user", + LANG: lang, + _: getExecutableName(), + }; + for (var x in ENV) { + if (ENV[x] === undefined) delete env[x]; + else env[x] = ENV[x]; + } + var strings = []; + for (var x in env) { + strings.push(`${x}=${env[x]}`); + } + getEnvStrings.strings = strings; + } + return getEnvStrings.strings; + }; + var stringToAscii = (str, buffer) => { + for (var i = 0; i < str.length; ++i) { + HEAP8[buffer++] = str.charCodeAt(i); + } + HEAP8[buffer] = 0; + }; + var _environ_get = (__environ, environ_buf) => { + var bufSize = 0; + getEnvStrings().forEach((string, i) => { + var ptr = environ_buf + bufSize; + HEAPU32[(__environ + i * 4) >> 2] = ptr; + stringToAscii(string, ptr); + bufSize += string.length + 1; + }); + return 0; + }; + var _environ_sizes_get = (penviron_count, penviron_buf_size) => { + var strings = getEnvStrings(); + HEAPU32[penviron_count >> 2] = strings.length; + var bufSize = 0; + strings.forEach((string) => (bufSize += string.length + 1)); + HEAPU32[penviron_buf_size >> 2] = bufSize; + return 0; + }; + var _fd_close = (fd) => 52; + var convertI32PairToI53Checked = (lo, hi) => + (hi + 2097152) >>> 0 < 4194305 - !!lo + ? (lo >>> 0) + hi * 4294967296 + : NaN; + function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { + var offset = convertI32PairToI53Checked(offset_low, offset_high); + return 70; + } + var printCharBuffers = [null, [], []]; + var UTF8Decoder = + typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : undefined; + var UTF8ArrayToString = (heapOrArray, idx, maxBytesToRead) => { + var endIdx = idx + maxBytesToRead; + var endPtr = idx; + while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr; + if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) { + return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr)); + } + var str = ""; + while (idx < endPtr) { + var u0 = heapOrArray[idx++]; + if (!(u0 & 128)) { + str += String.fromCharCode(u0); + continue; + } + var u1 = heapOrArray[idx++] & 63; + if ((u0 & 224) == 192) { + str += String.fromCharCode(((u0 & 31) << 6) | u1); + continue; + } + var u2 = heapOrArray[idx++] & 63; + if ((u0 & 240) == 224) { + u0 = ((u0 & 15) << 12) | (u1 << 6) | u2; + } else { + u0 = + ((u0 & 7) << 18) | + (u1 << 12) | + (u2 << 6) | + (heapOrArray[idx++] & 63); + } + if (u0 < 65536) { + str += String.fromCharCode(u0); + } else { + var ch = u0 - 65536; + str += String.fromCharCode(55296 | (ch >> 10), 56320 | (ch & 1023)); + } + } + return str; + }; + var printChar = (stream, curr) => { + var buffer = printCharBuffers[stream]; + if (curr === 0 || curr === 10) { + (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); + buffer.length = 0; + } else { + buffer.push(curr); + } + }; + var UTF8ToString = (ptr, maxBytesToRead) => + ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ""; + var _fd_write = (fd, iov, iovcnt, pnum) => { + var num = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAPU32[iov >> 2]; + var len = HEAPU32[(iov + 4) >> 2]; + iov += 8; + for (var j = 0; j < len; j++) { + printChar(fd, HEAPU8[ptr + j]); + } + num += len; + } + HEAPU32[pnum >> 2] = num; + return 0; + }; + function _gray_to_rgba(compG_ptr, nb_pixels) { + compG_ptr >>= 2; + const imageData = (Module.imageData = new Uint8ClampedArray( + nb_pixels * 4, + )); + const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); + for (let i = 0; i < nb_pixels; i++) { + imageData[4 * i] = + imageData[4 * i + 1] = + imageData[4 * i + 2] = + compG[i]; + imageData[4 * i + 3] = 255; + } + } + function _graya_to_rgba(compG_ptr, compA_ptr, nb_pixels) { + compG_ptr >>= 2; + compA_ptr >>= 2; + const imageData = (Module.imageData = new Uint8ClampedArray( + nb_pixels * 4, + )); + const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); + const compA = Module.HEAP32.subarray(compA_ptr, compA_ptr + nb_pixels); + for (let i = 0; i < nb_pixels; i++) { + imageData[4 * i] = + imageData[4 * i + 1] = + imageData[4 * i + 2] = + compG[i]; + imageData[4 * i + 3] = compA[i]; + } + } + function _jsPrintWarning(message_ptr) { + const message = UTF8ToString(message_ptr); + (Module.warn || console.warn)(`OpenJPEG: ${message}`); + } + function _rgb_to_rgba(compR_ptr, compG_ptr, compB_ptr, nb_pixels) { + compR_ptr >>= 2; + compG_ptr >>= 2; + compB_ptr >>= 2; + const imageData = (Module.imageData = new Uint8ClampedArray( + nb_pixels * 4, + )); + const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr + nb_pixels); + const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); + const compB = Module.HEAP32.subarray(compB_ptr, compB_ptr + nb_pixels); + for (let i = 0; i < nb_pixels; i++) { + imageData[4 * i] = compR[i]; + imageData[4 * i + 1] = compG[i]; + imageData[4 * i + 2] = compB[i]; + imageData[4 * i + 3] = 255; + } + } + function _storeErrorMessage(message_ptr) { + const message = UTF8ToString(message_ptr); + if (!Module.errorMessages) { + Module.errorMessages = message; + } else { + Module.errorMessages += "\n" + message; + } + } + var wasmImports = { + c: __emscripten_memcpy_js, + g: _copy_pixels_1, + f: _copy_pixels_3, + e: _copy_pixels_4, + k: _emscripten_resize_heap, + l: _environ_get, + m: _environ_sizes_get, + n: _fd_close, + j: _fd_seek, + b: _fd_write, + o: _gray_to_rgba, + i: _graya_to_rgba, + d: _jsPrintWarning, + h: _rgb_to_rgba, + a: _storeErrorMessage, + }; + var wasmExports = createWasm(); + var ___wasm_call_ctors = wasmExports["q"]; + var _malloc = (Module["_malloc"] = wasmExports["r"]); + var _free = (Module["_free"] = wasmExports["s"]); + var _jp2_decode = (Module["_jp2_decode"] = wasmExports["u"]); + var calledRun; + dependenciesFulfilled = function runCaller() { + if (!calledRun) run(); + if (!calledRun) dependenciesFulfilled = runCaller; + }; + function run() { + if (runDependencies > 0) { + return; + } + preRun(); + if (runDependencies > 0) { + return; + } + function doRun() { + if (calledRun) return; + calledRun = true; + Module["calledRun"] = true; + if (ABORT) return; + initRuntime(); + readyPromiseResolve(Module); + if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); + postRun(); + } + if (Module["setStatus"]) { + Module["setStatus"]("Running..."); + setTimeout(function () { + setTimeout(function () { + Module["setStatus"](""); + }, 1); + doRun(); + }, 1); + } else { + doRun(); + } + } + if (Module["preInit"]) { + if (typeof Module["preInit"] == "function") + Module["preInit"] = [Module["preInit"]]; + while (Module["preInit"].length > 0) { + Module["preInit"].pop()(); + } + } + run(); + moduleRtn = Module; + return moduleRtn; + }; +})(); +/* harmony default export */ const openjpeg = OpenJPEG; // ./src/core/jpx.js +class JpxError extends BaseException { + constructor(msg) { + super(msg, "JpxError"); } } class JpxImage { - static #y = null; - static decode(e, t) { - t ||= {}; - this.#y ||= Ii({ warn }); - const i = this.#y.decode(e, t); - if ("string" == typeof i) throw new JpxError(i); - return i; + static #module = null; + static decode(data, decoderOptions) { + decoderOptions ||= {}; + this.#module ||= openjpeg({ + warn: warn, + }); + const imageData = this.#module.decode(data, decoderOptions); + if (typeof imageData === "string") { + throw new JpxError(imageData); + } + return imageData; } static cleanup() { - this.#y = null; + this.#module = null; } - static parseImageProperties(e) { - let t = e.getByte(); - for (; t >= 0; ) { - const i = t; - t = e.getByte(); - if (65361 === ((i << 8) | t)) { - e.skip(4); - const t = e.getInt32() >>> 0, - i = e.getInt32() >>> 0, - a = e.getInt32() >>> 0, - s = e.getInt32() >>> 0; - e.skip(16); + static parseImageProperties(stream) { + let newByte = stream.getByte(); + while (newByte >= 0) { + const oldByte = newByte; + newByte = stream.getByte(); + const code = (oldByte << 8) | newByte; + if (code === 0xff51) { + stream.skip(4); + const Xsiz = stream.getInt32() >>> 0; + const Ysiz = stream.getInt32() >>> 0; + const XOsiz = stream.getInt32() >>> 0; + const YOsiz = stream.getInt32() >>> 0; + stream.skip(16); + const Csiz = stream.getUint16(); return { - width: t - a, - height: i - s, + width: Xsiz - XOsiz, + height: Ysiz - YOsiz, bitsPerComponent: 8, - componentsCount: e.getUint16(), + componentsCount: Csiz, }; } } throw new JpxError("No size marker found in JPX stream"); } -} +} // ./src/core/jpx_stream.js + class JpxStream extends DecodeStream { - constructor(e, t, i) { - super(t); - this.stream = e; - this.dict = e.dict; - this.maybeLength = t; - this.params = i; + constructor(stream, maybeLength, params) { + super(maybeLength); + this.stream = stream; + this.dict = stream.dict; + this.maybeLength = maybeLength; + this.params = params; } get bytes() { return shadow(this, "bytes", this.stream.getBytes(this.maybeLength)); } - ensureBuffer(e) {} - readBlock(e) { - this.decodeImage(null, e); + ensureBuffer(requested) {} + readBlock(decoderOptions) { + this.decodeImage(null, decoderOptions); } - decodeImage(e, t) { - if (this.eof) return this.buffer; - e ||= this.bytes; - this.buffer = JpxImage.decode(e, t); + decodeImage(bytes, decoderOptions) { + if (this.eof) { + return this.buffer; + } + bytes ||= this.bytes; + this.buffer = JpxImage.decode(bytes, decoderOptions); this.bufferLength = this.buffer.length; - this.eof = !0; + this.eof = true; return this.buffer; } get canAsyncDecodeImageFromBuffer() { return this.stream.isAsync; } -} +} // ./src/core/lzw_stream.js + class LZWStream extends DecodeStream { - constructor(e, t, i) { - super(t); - this.str = e; - this.dict = e.dict; + constructor(str, maybeLength, earlyChange) { + super(maybeLength); + this.str = str; + this.dict = str.dict; this.cachedData = 0; this.bitsCached = 0; - const a = 4096, - s = { - earlyChange: i, - codeLength: 9, - nextCode: 258, - dictionaryValues: new Uint8Array(a), - dictionaryLengths: new Uint16Array(a), - dictionaryPrevCodes: new Uint16Array(a), - currentSequence: new Uint8Array(a), - currentSequenceLength: 0, - }; - for (let e = 0; e < 256; ++e) { - s.dictionaryValues[e] = e; - s.dictionaryLengths[e] = 1; + const maxLzwDictionarySize = 4096; + const lzwState = { + earlyChange, + codeLength: 9, + nextCode: 258, + dictionaryValues: new Uint8Array(maxLzwDictionarySize), + dictionaryLengths: new Uint16Array(maxLzwDictionarySize), + dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize), + currentSequence: new Uint8Array(maxLzwDictionarySize), + currentSequenceLength: 0, + }; + for (let i = 0; i < 256; ++i) { + lzwState.dictionaryValues[i] = i; + lzwState.dictionaryLengths[i] = 1; } - this.lzwState = s; + this.lzwState = lzwState; } - readBits(e) { - let t = this.bitsCached, - i = this.cachedData; - for (; t < e; ) { - const e = this.str.getByte(); - if (-1 === e) { - this.eof = !0; + readBits(n) { + let bitsCached = this.bitsCached; + let cachedData = this.cachedData; + while (bitsCached < n) { + const c = this.str.getByte(); + if (c === -1) { + this.eof = true; return null; } - i = (i << 8) | e; - t += 8; + cachedData = (cachedData << 8) | c; + bitsCached += 8; } - this.bitsCached = t -= e; - this.cachedData = i; + this.bitsCached = bitsCached -= n; + this.cachedData = cachedData; this.lastCode = null; - return (i >>> t) & ((1 << e) - 1); + return (cachedData >>> bitsCached) & ((1 << n) - 1); } readBlock() { - let e, - t, - i, - a = 1024; - const s = this.lzwState; - if (!s) return; - const r = s.earlyChange; - let n = s.nextCode; - const g = s.dictionaryValues, - o = s.dictionaryLengths, - c = s.dictionaryPrevCodes; - let C = s.codeLength, - h = s.prevCode; - const l = s.currentSequence; - let Q = s.currentSequenceLength, - E = 0, - u = this.bufferLength, - d = this.ensureBuffer(this.bufferLength + a); - for (e = 0; e < 512; e++) { - const e = this.readBits(C), - s = Q > 0; - if (e < 256) { - l[0] = e; - Q = 1; - } else { - if (!(e >= 258)) { - if (256 === e) { - C = 9; - n = 258; - Q = 0; - continue; - } - this.eof = !0; - delete this.lzwState; - break; - } - if (e < n) { - Q = o[e]; - for (t = Q - 1, i = e; t >= 0; t--) { - l[t] = g[i]; - i = c[i]; - } - } else l[Q++] = l[0]; - } - if (s) { - c[n] = h; - o[n] = o[h] + 1; - g[n] = l[0]; - n++; - C = - (n + r) & (n + r - 1) - ? C - : 0 | Math.min(Math.log(n + r) / 0.6931471805599453 + 1, 12); - } - h = e; - E += Q; - if (a < E) { - do { - a += 512; - } while (a < E); - d = this.ensureBuffer(this.bufferLength + a); - } - for (t = 0; t < Q; t++) d[u++] = l[t]; + const blockSize = 512, + decodedSizeDelta = blockSize; + let estimatedDecodedSize = blockSize * 2; + let i, j, q; + const lzwState = this.lzwState; + if (!lzwState) { + return; } - s.nextCode = n; - s.codeLength = C; - s.prevCode = h; - s.currentSequenceLength = Q; - this.bufferLength = u; + const earlyChange = lzwState.earlyChange; + let nextCode = lzwState.nextCode; + const dictionaryValues = lzwState.dictionaryValues; + const dictionaryLengths = lzwState.dictionaryLengths; + const dictionaryPrevCodes = lzwState.dictionaryPrevCodes; + let codeLength = lzwState.codeLength; + let prevCode = lzwState.prevCode; + const currentSequence = lzwState.currentSequence; + let currentSequenceLength = lzwState.currentSequenceLength; + let decodedLength = 0; + let currentBufferLength = this.bufferLength; + let buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); + for (i = 0; i < blockSize; i++) { + const code = this.readBits(codeLength); + const hasPrev = currentSequenceLength > 0; + if (code < 256) { + currentSequence[0] = code; + currentSequenceLength = 1; + } else if (code >= 258) { + if (code < nextCode) { + currentSequenceLength = dictionaryLengths[code]; + for (j = currentSequenceLength - 1, q = code; j >= 0; j--) { + currentSequence[j] = dictionaryValues[q]; + q = dictionaryPrevCodes[q]; + } + } else { + currentSequence[currentSequenceLength++] = currentSequence[0]; + } + } else if (code === 256) { + codeLength = 9; + nextCode = 258; + currentSequenceLength = 0; + continue; + } else { + this.eof = true; + delete this.lzwState; + break; + } + if (hasPrev) { + dictionaryPrevCodes[nextCode] = prevCode; + dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1; + dictionaryValues[nextCode] = currentSequence[0]; + nextCode++; + codeLength = + (nextCode + earlyChange) & (nextCode + earlyChange - 1) + ? codeLength + : Math.min( + Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, + 12, + ) | 0; + } + prevCode = code; + decodedLength += currentSequenceLength; + if (estimatedDecodedSize < decodedLength) { + do { + estimatedDecodedSize += decodedSizeDelta; + } while (estimatedDecodedSize < decodedLength); + buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); + } + for (j = 0; j < currentSequenceLength; j++) { + buffer[currentBufferLength++] = currentSequence[j]; + } + } + lzwState.nextCode = nextCode; + lzwState.codeLength = codeLength; + lzwState.prevCode = prevCode; + lzwState.currentSequenceLength = currentSequenceLength; + this.bufferLength = currentBufferLength; } -} +} // ./src/core/predictor_stream.js + class PredictorStream extends DecodeStream { - constructor(e, t, i) { - super(t); - if (!(i instanceof Dict)) return e; - const a = (this.predictor = i.get("Predictor") || 1); - if (a <= 1) return e; - if (2 !== a && (a < 10 || a > 15)) - throw new FormatError(`Unsupported predictor: ${a}`); - this.readBlock = 2 === a ? this.readBlockTiff : this.readBlockPng; - this.str = e; - this.dict = e.dict; - const s = (this.colors = i.get("Colors") || 1), - r = (this.bits = i.get("BPC", "BitsPerComponent") || 8), - n = (this.columns = i.get("Columns") || 1); - this.pixBytes = (s * r + 7) >> 3; - this.rowBytes = (n * s * r + 7) >> 3; + constructor(str, maybeLength, params) { + super(maybeLength); + if (!(params instanceof Dict)) { + return str; + } + const predictor = (this.predictor = params.get("Predictor") || 1); + if (predictor <= 1) { + return str; + } + if (predictor !== 2 && (predictor < 10 || predictor > 15)) { + throw new FormatError(`Unsupported predictor: ${predictor}`); + } + this.readBlock = predictor === 2 ? this.readBlockTiff : this.readBlockPng; + this.str = str; + this.dict = str.dict; + const colors = (this.colors = params.get("Colors") || 1); + const bits = (this.bits = params.get("BPC", "BitsPerComponent") || 8); + const columns = (this.columns = params.get("Columns") || 1); + this.pixBytes = (colors * bits + 7) >> 3; + this.rowBytes = (columns * colors * bits + 7) >> 3; return this; } readBlockTiff() { - const e = this.rowBytes, - t = this.bufferLength, - i = this.ensureBuffer(t + e), - a = this.bits, - s = this.colors, - r = this.str.getBytes(e); - this.eof = !r.length; - if (this.eof) return; - let n, - g = 0, - o = 0, - c = 0, - C = 0, - h = t; - if (1 === a && 1 === s) - for (n = 0; n < e; ++n) { - let e = r[n] ^ g; - e ^= e >> 1; - e ^= e >> 2; - e ^= e >> 4; - g = (1 & e) << 7; - i[h++] = e; + const rowBytes = this.rowBytes; + const bufferLength = this.bufferLength; + const buffer = this.ensureBuffer(bufferLength + rowBytes); + const bits = this.bits; + const colors = this.colors; + const rawBytes = this.str.getBytes(rowBytes); + this.eof = !rawBytes.length; + if (this.eof) { + return; + } + let inbuf = 0, + outbuf = 0; + let inbits = 0, + outbits = 0; + let pos = bufferLength; + let i; + if (bits === 1 && colors === 1) { + for (i = 0; i < rowBytes; ++i) { + let c = rawBytes[i] ^ inbuf; + c ^= c >> 1; + c ^= c >> 2; + c ^= c >> 4; + inbuf = (c & 1) << 7; + buffer[pos++] = c; } - else if (8 === a) { - for (n = 0; n < s; ++n) i[h++] = r[n]; - for (; n < e; ++n) { - i[h] = i[h - s] + r[n]; - h++; + } else if (bits === 8) { + for (i = 0; i < colors; ++i) { + buffer[pos++] = rawBytes[i]; } - } else if (16 === a) { - const t = 2 * s; - for (n = 0; n < t; ++n) i[h++] = r[n]; - for (; n < e; n += 2) { - const e = - ((255 & r[n]) << 8) + - (255 & r[n + 1]) + - ((255 & i[h - t]) << 8) + - (255 & i[h - t + 1]); - i[h++] = (e >> 8) & 255; - i[h++] = 255 & e; + for (; i < rowBytes; ++i) { + buffer[pos] = buffer[pos - colors] + rawBytes[i]; + pos++; + } + } else if (bits === 16) { + const bytesPerPixel = colors * 2; + for (i = 0; i < bytesPerPixel; ++i) { + buffer[pos++] = rawBytes[i]; + } + for (; i < rowBytes; i += 2) { + const sum = + ((rawBytes[i] & 0xff) << 8) + + (rawBytes[i + 1] & 0xff) + + ((buffer[pos - bytesPerPixel] & 0xff) << 8) + + (buffer[pos - bytesPerPixel + 1] & 0xff); + buffer[pos++] = (sum >> 8) & 0xff; + buffer[pos++] = sum & 0xff; } } else { - const e = new Uint8Array(s + 1), - h = (1 << a) - 1; - let l = 0, - Q = t; - const E = this.columns; - for (n = 0; n < E; ++n) - for (let t = 0; t < s; ++t) { - if (c < a) { - g = (g << 8) | (255 & r[l++]); - c += 8; + const compArray = new Uint8Array(colors + 1); + const bitMask = (1 << bits) - 1; + let j = 0, + k = bufferLength; + const columns = this.columns; + for (i = 0; i < columns; ++i) { + for (let kk = 0; kk < colors; ++kk) { + if (inbits < bits) { + inbuf = (inbuf << 8) | (rawBytes[j++] & 0xff); + inbits += 8; } - e[t] = (e[t] + (g >> (c - a))) & h; - c -= a; - o = (o << a) | e[t]; - C += a; - if (C >= 8) { - i[Q++] = (o >> (C - 8)) & 255; - C -= 8; + compArray[kk] = + (compArray[kk] + (inbuf >> (inbits - bits))) & bitMask; + inbits -= bits; + outbuf = (outbuf << bits) | compArray[kk]; + outbits += bits; + if (outbits >= 8) { + buffer[k++] = (outbuf >> (outbits - 8)) & 0xff; + outbits -= 8; } } - C > 0 && (i[Q++] = (o << (8 - C)) + (g & ((1 << (8 - C)) - 1))); + } + if (outbits > 0) { + buffer[k++] = + (outbuf << (8 - outbits)) + (inbuf & ((1 << (8 - outbits)) - 1)); + } } - this.bufferLength += e; + this.bufferLength += rowBytes; } readBlockPng() { - const e = this.rowBytes, - t = this.pixBytes, - i = this.str.getByte(), - a = this.str.getBytes(e); - this.eof = !a.length; - if (this.eof) return; - const s = this.bufferLength, - r = this.ensureBuffer(s + e); - let n = r.subarray(s - e, s); - 0 === n.length && (n = new Uint8Array(e)); - let g, - o, - c, - C = s; - switch (i) { + const rowBytes = this.rowBytes; + const pixBytes = this.pixBytes; + const predictor = this.str.getByte(); + const rawBytes = this.str.getBytes(rowBytes); + this.eof = !rawBytes.length; + if (this.eof) { + return; + } + const bufferLength = this.bufferLength; + const buffer = this.ensureBuffer(bufferLength + rowBytes); + let prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength); + if (prevRow.length === 0) { + prevRow = new Uint8Array(rowBytes); + } + let i, + j = bufferLength, + up, + c; + switch (predictor) { case 0: - for (g = 0; g < e; ++g) r[C++] = a[g]; + for (i = 0; i < rowBytes; ++i) { + buffer[j++] = rawBytes[i]; + } break; case 1: - for (g = 0; g < t; ++g) r[C++] = a[g]; - for (; g < e; ++g) { - r[C] = (r[C - t] + a[g]) & 255; - C++; + for (i = 0; i < pixBytes; ++i) { + buffer[j++] = rawBytes[i]; + } + for (; i < rowBytes; ++i) { + buffer[j] = (buffer[j - pixBytes] + rawBytes[i]) & 0xff; + j++; } break; case 2: - for (g = 0; g < e; ++g) r[C++] = (n[g] + a[g]) & 255; + for (i = 0; i < rowBytes; ++i) { + buffer[j++] = (prevRow[i] + rawBytes[i]) & 0xff; + } break; case 3: - for (g = 0; g < t; ++g) r[C++] = (n[g] >> 1) + a[g]; - for (; g < e; ++g) { - r[C] = (((n[g] + r[C - t]) >> 1) + a[g]) & 255; - C++; + for (i = 0; i < pixBytes; ++i) { + buffer[j++] = (prevRow[i] >> 1) + rawBytes[i]; + } + for (; i < rowBytes; ++i) { + buffer[j] = + (((prevRow[i] + buffer[j - pixBytes]) >> 1) + rawBytes[i]) & 0xff; + j++; } break; case 4: - for (g = 0; g < t; ++g) { - o = n[g]; - c = a[g]; - r[C++] = o + c; + for (i = 0; i < pixBytes; ++i) { + up = prevRow[i]; + c = rawBytes[i]; + buffer[j++] = up + c; } - for (; g < e; ++g) { - o = n[g]; - const e = n[g - t], - i = r[C - t], - s = i + o - e; - let h = s - i; - h < 0 && (h = -h); - let l = s - o; - l < 0 && (l = -l); - let Q = s - e; - Q < 0 && (Q = -Q); - c = a[g]; - r[C++] = h <= l && h <= Q ? i + c : l <= Q ? o + c : e + c; + for (; i < rowBytes; ++i) { + up = prevRow[i]; + const upLeft = prevRow[i - pixBytes]; + const left = buffer[j - pixBytes]; + const p = left + up - upLeft; + let pa = p - left; + if (pa < 0) { + pa = -pa; + } + let pb = p - up; + if (pb < 0) { + pb = -pb; + } + let pc = p - upLeft; + if (pc < 0) { + pc = -pc; + } + c = rawBytes[i]; + if (pa <= pb && pa <= pc) { + buffer[j++] = left + c; + } else if (pb <= pc) { + buffer[j++] = up + c; + } else { + buffer[j++] = upLeft + c; + } } break; default: - throw new FormatError(`Unsupported predictor: ${i}`); + throw new FormatError(`Unsupported predictor: ${predictor}`); } - this.bufferLength += e; + this.bufferLength += rowBytes; } -} +} // ./src/core/run_length_stream.js + class RunLengthStream extends DecodeStream { - constructor(e, t) { - super(t); - this.str = e; - this.dict = e.dict; + constructor(str, maybeLength) { + super(maybeLength); + this.str = str; + this.dict = str.dict; } readBlock() { - const e = this.str.getBytes(2); - if (!e || e.length < 2 || 128 === e[0]) { - this.eof = !0; + const repeatHeader = this.str.getBytes(2); + if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) { + this.eof = true; return; } - let t, - i = this.bufferLength, - a = e[0]; - if (a < 128) { - t = this.ensureBuffer(i + a + 1); - t[i++] = e[1]; - if (a > 0) { - const e = this.str.getBytes(a); - t.set(e, i); - i += a; + let buffer; + let bufferLength = this.bufferLength; + let n = repeatHeader[0]; + if (n < 128) { + buffer = this.ensureBuffer(bufferLength + n + 1); + buffer[bufferLength++] = repeatHeader[1]; + if (n > 0) { + const source = this.str.getBytes(n); + buffer.set(source, bufferLength); + bufferLength += n; } } else { - a = 257 - a; - const s = e[1]; - t = this.ensureBuffer(i + a + 1); - for (let e = 0; e < a; e++) t[i++] = s; + n = 257 - n; + const b = repeatHeader[1]; + buffer = this.ensureBuffer(bufferLength + n + 1); + for (let i = 0; i < n; i++) { + buffer[bufferLength++] = b; + } } - this.bufferLength = i; + this.bufferLength = bufferLength; } +} // ./src/core/parser.js + +const MAX_LENGTH_TO_CACHE = 1000; +function getInlineImageCacheKey(bytes) { + const strBuf = [], + ii = bytes.length; + let i = 0; + while (i < ii - 1) { + strBuf.push((bytes[i++] << 8) | bytes[i++]); + } + if (i < ii) { + strBuf.push(bytes[i]); + } + return ii + "_" + String.fromCharCode.apply(null, strBuf); } class Parser { - constructor({ - lexer: e, - xref: t, - allowStreams: i = !1, - recoveryMode: a = !1, - }) { - this.lexer = e; - this.xref = t; - this.allowStreams = i; - this.recoveryMode = a; + constructor({ lexer, xref, allowStreams = false, recoveryMode = false }) { + this.lexer = lexer; + this.xref = xref; + this.allowStreams = allowStreams; + this.recoveryMode = recoveryMode; this.imageCache = Object.create(null); this._imageId = 0; this.refill(); @@ -8918,7 +11530,7 @@ class Parser { this.buf2 = this.lexer.getObj(); } shift() { - if (this.buf2 instanceof Cmd && "ID" === this.buf2.cmd) { + if (this.buf2 instanceof Cmd && this.buf2.cmd === "ID") { this.buf1 = this.buf2; this.buf2 = null; } else { @@ -8929,483 +11541,600 @@ class Parser { tryShift() { try { this.shift(); - return !0; + return true; } catch (e) { - if (e instanceof MissingDataException) throw e; - return !1; + if (e instanceof MissingDataException) { + throw e; + } + return false; } } - getObj(e = null) { - const t = this.buf1; + getObj(cipherTransform = null) { + const buf1 = this.buf1; this.shift(); - if (t instanceof Cmd) - switch (t.cmd) { + if (buf1 instanceof Cmd) { + switch (buf1.cmd) { case "BI": - return this.makeInlineImage(e); + return this.makeInlineImage(cipherTransform); case "[": - const i = []; - for (; !isCmd(this.buf1, "]") && this.buf1 !== pt; ) - i.push(this.getObj(e)); - if (this.buf1 === pt) { - if (this.recoveryMode) return i; + const array = []; + while (!isCmd(this.buf1, "]") && this.buf1 !== EOF) { + array.push(this.getObj(cipherTransform)); + } + if (this.buf1 === EOF) { + if (this.recoveryMode) { + return array; + } throw new ParserEOFException("End of file inside array."); } this.shift(); - return i; + return array; case "<<": - const a = new Dict(this.xref); - for (; !isCmd(this.buf1, ">>") && this.buf1 !== pt; ) { + const dict = new Dict(this.xref); + while (!isCmd(this.buf1, ">>") && this.buf1 !== EOF) { if (!(this.buf1 instanceof Name)) { info("Malformed dictionary: key must be a name object"); this.shift(); continue; } - const t = this.buf1.name; + const key = this.buf1.name; this.shift(); - if (this.buf1 === pt) break; - a.set(t, this.getObj(e)); - } - if (this.buf1 === pt) { - if (this.recoveryMode) return a; - throw new ParserEOFException("End of file inside dictionary."); - } - if (isCmd(this.buf2, "stream")) - return this.allowStreams ? this.makeStream(a, e) : a; - this.shift(); - return a; - default: - return t; - } - if (Number.isInteger(t)) { - if (Number.isInteger(this.buf1) && isCmd(this.buf2, "R")) { - const e = Ref.get(t, this.buf1); - this.shift(); - this.shift(); - return e; - } - return t; - } - return "string" == typeof t && e ? e.decryptString(t) : t; - } - findDefaultInlineStreamEnd(e) { - const { knownCommands: t } = this.lexer, - i = e.pos; - let a, - s, - r = 0; - for (; -1 !== (a = e.getByte()); ) - if (0 === r) r = 69 === a ? 1 : 0; - else if (1 === r) r = 73 === a ? 2 : 0; - else if (32 === a || 10 === a || 13 === a) { - s = e.pos; - const i = e.peekBytes(15), - n = i.length; - if (0 === n) break; - for (let e = 0; e < n; e++) { - a = i[e]; - if ( - (0 !== a || 0 === i[e + 1]) && - 10 !== a && - 13 !== a && - (a < 32 || a > 127) - ) { - r = 0; - break; - } - } - if (2 !== r) continue; - if (!t) { - warn( - "findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.", - ); - continue; - } - const g = new Lexer(new Stream(i.slice()), t); - g._hexStringWarn = () => {}; - let o = 0; - for (;;) { - const e = g.getObj(); - if (e === pt) { - r = 0; - break; - } - if (e instanceof Cmd) { - const i = t[e.cmd]; - if (!i) { - r = 0; + if (this.buf1 === EOF) { break; } - if (i.variableArgs ? o <= i.numArgs : o === i.numArgs) break; - o = 0; - } else o++; + dict.set(key, this.getObj(cipherTransform)); + } + if (this.buf1 === EOF) { + if (this.recoveryMode) { + return dict; + } + throw new ParserEOFException("End of file inside dictionary."); + } + if (isCmd(this.buf2, "stream")) { + return this.allowStreams + ? this.makeStream(dict, cipherTransform) + : dict; + } + this.shift(); + return dict; + default: + return buf1; + } + } + if (Number.isInteger(buf1)) { + if (Number.isInteger(this.buf1) && isCmd(this.buf2, "R")) { + const ref = Ref.get(buf1, this.buf1); + this.shift(); + this.shift(); + return ref; + } + return buf1; + } + if (typeof buf1 === "string") { + if (cipherTransform) { + return cipherTransform.decryptString(buf1); + } + return buf1; + } + return buf1; + } + findDefaultInlineStreamEnd(stream) { + const E = 0x45, + I = 0x49, + SPACE = 0x20, + LF = 0xa, + CR = 0xd, + NUL = 0x0; + const { knownCommands } = this.lexer, + startPos = stream.pos, + n = 15; + let state = 0, + ch, + maybeEIPos; + while ((ch = stream.getByte()) !== -1) { + if (state === 0) { + state = ch === E ? 1 : 0; + } else if (state === 1) { + state = ch === I ? 2 : 0; + } else { + if (ch === SPACE || ch === LF || ch === CR) { + maybeEIPos = stream.pos; + const followingBytes = stream.peekBytes(n); + const ii = followingBytes.length; + if (ii === 0) { + break; + } + for (let i = 0; i < ii; i++) { + ch = followingBytes[i]; + if (ch === NUL && followingBytes[i + 1] !== NUL) { + continue; + } + if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7f)) { + state = 0; + break; + } + } + if (state !== 2) { + continue; + } + if (!knownCommands) { + warn( + "findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.", + ); + continue; + } + const tmpLexer = new Lexer( + new Stream(followingBytes.slice()), + knownCommands, + ); + tmpLexer._hexStringWarn = () => {}; + let numArgs = 0; + while (true) { + const nextObj = tmpLexer.getObj(); + if (nextObj === EOF) { + state = 0; + break; + } + if (nextObj instanceof Cmd) { + const knownCommand = knownCommands[nextObj.cmd]; + if (!knownCommand) { + state = 0; + break; + } else if ( + knownCommand.variableArgs + ? numArgs <= knownCommand.numArgs + : numArgs === knownCommand.numArgs + ) { + break; + } + numArgs = 0; + continue; + } + numArgs++; + } + if (state === 2) { + break; + } + } else { + state = 0; } - if (2 === r) break; - } else r = 0; - if (-1 === a) { + } + } + if (ch === -1) { warn( - "findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker", + "findDefaultInlineStreamEnd: " + + "Reached the end of the stream without finding a valid EI marker", ); - if (s) { + if (maybeEIPos) { warn('... trying to recover by using the last "EI" occurrence.'); - e.skip(-(e.pos - s)); + stream.skip(-(stream.pos - maybeEIPos)); } } - let n = 4; - e.skip(-n); - a = e.peekByte(); - e.skip(n); - isWhiteSpace(a) || n--; - return e.pos - n - i; + let endOffset = 4; + stream.skip(-endOffset); + ch = stream.peekByte(); + stream.skip(endOffset); + if (!isWhiteSpace(ch)) { + endOffset--; + } + return stream.pos - endOffset - startPos; } - findDCTDecodeInlineStreamEnd(e) { - const t = e.pos; - let i, - a, - s = !1; - for (; -1 !== (i = e.getByte()); ) - if (255 === i) { - switch (e.getByte()) { - case 0: - break; - case 255: - e.skip(-1); - break; - case 217: - s = !0; - break; - case 192: - case 193: - case 194: - case 195: - case 197: - case 198: - case 199: - case 201: - case 202: - case 203: - case 205: - case 206: - case 207: - case 196: - case 204: - case 218: - case 219: - case 220: - case 221: - case 222: - case 223: - case 224: - case 225: - case 226: - case 227: - case 228: - case 229: - case 230: - case 231: - case 232: - case 233: - case 234: - case 235: - case 236: - case 237: - case 238: - case 239: - case 254: - a = e.getUint16(); - a > 2 ? e.skip(a - 2) : e.skip(-2); - } - if (s) break; + findDCTDecodeInlineStreamEnd(stream) { + const startPos = stream.pos; + let foundEOI = false, + b, + markerLength; + while ((b = stream.getByte()) !== -1) { + if (b !== 0xff) { + continue; } - const r = e.pos - t; - if (-1 === i) { + switch (stream.getByte()) { + case 0x00: + break; + case 0xff: + stream.skip(-1); + break; + case 0xd9: + foundEOI = true; + break; + case 0xc0: + case 0xc1: + case 0xc2: + case 0xc3: + case 0xc5: + case 0xc6: + case 0xc7: + case 0xc9: + case 0xca: + case 0xcb: + case 0xcd: + case 0xce: + case 0xcf: + case 0xc4: + case 0xcc: + case 0xda: + case 0xdb: + case 0xdc: + case 0xdd: + case 0xde: + case 0xdf: + case 0xe0: + case 0xe1: + case 0xe2: + case 0xe3: + case 0xe4: + case 0xe5: + case 0xe6: + case 0xe7: + case 0xe8: + case 0xe9: + case 0xea: + case 0xeb: + case 0xec: + case 0xed: + case 0xee: + case 0xef: + case 0xfe: + markerLength = stream.getUint16(); + if (markerLength > 2) { + stream.skip(markerLength - 2); + } else { + stream.skip(-2); + } + break; + } + if (foundEOI) { + break; + } + } + const length = stream.pos - startPos; + if (b === -1) { warn( - "Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead.", + "Inline DCTDecode image stream: " + + "EOI marker not found, searching for /EI/ instead.", ); - e.skip(-r); - return this.findDefaultInlineStreamEnd(e); + stream.skip(-length); + return this.findDefaultInlineStreamEnd(stream); } - this.inlineStreamSkipEI(e); - return r; + this.inlineStreamSkipEI(stream); + return length; } - findASCII85DecodeInlineStreamEnd(e) { - const t = e.pos; - let i; - for (; -1 !== (i = e.getByte()); ) - if (126 === i) { - const t = e.pos; - i = e.peekByte(); - for (; isWhiteSpace(i); ) { - e.skip(); - i = e.peekByte(); + findASCII85DecodeInlineStreamEnd(stream) { + const TILDE = 0x7e, + GT = 0x3e; + const startPos = stream.pos; + let ch; + while ((ch = stream.getByte()) !== -1) { + if (ch === TILDE) { + const tildePos = stream.pos; + ch = stream.peekByte(); + while (isWhiteSpace(ch)) { + stream.skip(); + ch = stream.peekByte(); } - if (62 === i) { - e.skip(); + if (ch === GT) { + stream.skip(); break; } - if (e.pos > t) { - const t = e.peekBytes(2); - if (69 === t[0] && 73 === t[1]) break; + if (stream.pos > tildePos) { + const maybeEI = stream.peekBytes(2); + if (maybeEI[0] === 0x45 && maybeEI[1] === 0x49) { + break; + } } } - const a = e.pos - t; - if (-1 === i) { - warn( - "Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead.", - ); - e.skip(-a); - return this.findDefaultInlineStreamEnd(e); } - this.inlineStreamSkipEI(e); - return a; - } - findASCIIHexDecodeInlineStreamEnd(e) { - const t = e.pos; - let i; - for (; -1 !== (i = e.getByte()) && 62 !== i; ); - const a = e.pos - t; - if (-1 === i) { + const length = stream.pos - startPos; + if (ch === -1) { warn( - "Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead.", + "Inline ASCII85Decode image stream: " + + "EOD marker not found, searching for /EI/ instead.", ); - e.skip(-a); - return this.findDefaultInlineStreamEnd(e); + stream.skip(-length); + return this.findDefaultInlineStreamEnd(stream); } - this.inlineStreamSkipEI(e); - return a; + this.inlineStreamSkipEI(stream); + return length; } - inlineStreamSkipEI(e) { - let t, - i = 0; - for (; -1 !== (t = e.getByte()); ) - if (0 === i) i = 69 === t ? 1 : 0; - else if (1 === i) i = 73 === t ? 2 : 0; - else if (2 === i) break; + findASCIIHexDecodeInlineStreamEnd(stream) { + const GT = 0x3e; + const startPos = stream.pos; + let ch; + while ((ch = stream.getByte()) !== -1) { + if (ch === GT) { + break; + } + } + const length = stream.pos - startPos; + if (ch === -1) { + warn( + "Inline ASCIIHexDecode image stream: " + + "EOD marker not found, searching for /EI/ instead.", + ); + stream.skip(-length); + return this.findDefaultInlineStreamEnd(stream); + } + this.inlineStreamSkipEI(stream); + return length; } - makeInlineImage(e) { - const t = this.lexer, - i = t.stream, - a = Object.create(null); - let s; - for (; !isCmd(this.buf1, "ID") && this.buf1 !== pt; ) { - if (!(this.buf1 instanceof Name)) + inlineStreamSkipEI(stream) { + const E = 0x45, + I = 0x49; + let state = 0, + ch; + while ((ch = stream.getByte()) !== -1) { + if (state === 0) { + state = ch === E ? 1 : 0; + } else if (state === 1) { + state = ch === I ? 2 : 0; + } else if (state === 2) { + break; + } + } + } + makeInlineImage(cipherTransform) { + const lexer = this.lexer; + const stream = lexer.stream; + const dictMap = Object.create(null); + let dictLength; + while (!isCmd(this.buf1, "ID") && this.buf1 !== EOF) { + if (!(this.buf1 instanceof Name)) { throw new FormatError("Dictionary key must be a name object"); - const t = this.buf1.name; + } + const key = this.buf1.name; this.shift(); - if (this.buf1 === pt) break; - a[t] = this.getObj(e); + if (this.buf1 === EOF) { + break; + } + dictMap[key] = this.getObj(cipherTransform); } - -1 !== t.beginInlineImagePos && (s = i.pos - t.beginInlineImagePos); - const r = this.xref.fetchIfRef(a.F || a.Filter); - let n; - if (r instanceof Name) n = r.name; - else if (Array.isArray(r)) { - const e = this.xref.fetchIfRef(r[0]); - e instanceof Name && (n = e.name); + if (lexer.beginInlineImagePos !== -1) { + dictLength = stream.pos - lexer.beginInlineImagePos; } - const g = i.pos; - let o, c; - switch (n) { + const filter = this.xref.fetchIfRef(dictMap.F || dictMap.Filter); + let filterName; + if (filter instanceof Name) { + filterName = filter.name; + } else if (Array.isArray(filter)) { + const filterZero = this.xref.fetchIfRef(filter[0]); + if (filterZero instanceof Name) { + filterName = filterZero.name; + } + } + const startPos = stream.pos; + let length; + switch (filterName) { case "DCT": case "DCTDecode": - o = this.findDCTDecodeInlineStreamEnd(i); + length = this.findDCTDecodeInlineStreamEnd(stream); break; case "A85": case "ASCII85Decode": - o = this.findASCII85DecodeInlineStreamEnd(i); + length = this.findASCII85DecodeInlineStreamEnd(stream); break; case "AHx": case "ASCIIHexDecode": - o = this.findASCIIHexDecodeInlineStreamEnd(i); + length = this.findASCIIHexDecodeInlineStreamEnd(stream); break; default: - o = this.findDefaultInlineStreamEnd(i); + length = this.findDefaultInlineStreamEnd(stream); } - if (o < 1e3 && s > 0) { - const e = i.pos; - i.pos = t.beginInlineImagePos; - c = (function getInlineImageCacheKey(e) { - const t = [], - i = e.length; - let a = 0; - for (; a < i - 1; ) t.push((e[a++] << 8) | e[a++]); - a < i && t.push(e[a]); - return i + "_" + String.fromCharCode.apply(null, t); - })(i.getBytes(s + o)); - i.pos = e; - const a = this.imageCache[c]; - if (void 0 !== a) { + let cacheKey; + if (length < MAX_LENGTH_TO_CACHE && dictLength > 0) { + const initialStreamPos = stream.pos; + stream.pos = lexer.beginInlineImagePos; + cacheKey = getInlineImageCacheKey(stream.getBytes(dictLength + length)); + stream.pos = initialStreamPos; + const cacheEntry = this.imageCache[cacheKey]; + if (cacheEntry !== undefined) { this.buf2 = Cmd.get("EI"); this.shift(); - a.reset(); - return a; + cacheEntry.reset(); + return cacheEntry; } } - const C = new Dict(this.xref); - for (const e in a) C.set(e, a[e]); - let h = i.makeSubStream(g, o, C); - e && (h = e.createStream(h, o)); - h = this.filter(h, C, o); - h.dict = C; - if (void 0 !== c) { - h.cacheKey = "inline_img_" + ++this._imageId; - this.imageCache[c] = h; + const dict = new Dict(this.xref); + for (const key in dictMap) { + dict.set(key, dictMap[key]); + } + let imageStream = stream.makeSubStream(startPos, length, dict); + if (cipherTransform) { + imageStream = cipherTransform.createStream(imageStream, length); + } + imageStream = this.filter(imageStream, dict, length); + imageStream.dict = dict; + if (cacheKey !== undefined) { + imageStream.cacheKey = `inline_img_${++this._imageId}`; + this.imageCache[cacheKey] = imageStream; } this.buf2 = Cmd.get("EI"); this.shift(); - return h; + return imageStream; } - #w(e) { - const { stream: t } = this.lexer; - t.pos = e; - const i = new Uint8Array([101, 110, 100]), - a = i.length, - s = [ - new Uint8Array([115, 116, 114, 101, 97, 109]), - new Uint8Array([115, 116, 101, 97, 109]), - new Uint8Array([115, 116, 114, 101, 97]), - ], - r = 9 - a; - for (; t.pos < t.end; ) { - const n = t.peekBytes(2048), - g = n.length - 9; - if (g <= 0) break; - let o = 0; - for (; o < g; ) { - let g = 0; - for (; g < a && n[o + g] === i[g]; ) g++; - if (g >= a) { - let a = !1; - for (const e of s) { - const t = e.length; - let s = 0; - for (; s < t && n[o + g + s] === e[s]; ) s++; - if (s >= r) { - a = !0; + #findStreamLength(startPos) { + const { stream } = this.lexer; + stream.pos = startPos; + const SCAN_BLOCK_LENGTH = 2048; + const signatureLength = "endstream".length; + const END_SIGNATURE = new Uint8Array([0x65, 0x6e, 0x64]); + const endLength = END_SIGNATURE.length; + const PARTIAL_SIGNATURE = [ + new Uint8Array([0x73, 0x74, 0x72, 0x65, 0x61, 0x6d]), + new Uint8Array([0x73, 0x74, 0x65, 0x61, 0x6d]), + new Uint8Array([0x73, 0x74, 0x72, 0x65, 0x61]), + ]; + const normalLength = signatureLength - endLength; + while (stream.pos < stream.end) { + const scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH); + const scanLength = scanBytes.length - signatureLength; + if (scanLength <= 0) { + break; + } + let pos = 0; + while (pos < scanLength) { + let j = 0; + while (j < endLength && scanBytes[pos + j] === END_SIGNATURE[j]) { + j++; + } + if (j >= endLength) { + let found = false; + for (const part of PARTIAL_SIGNATURE) { + const partLen = part.length; + let k = 0; + while (k < partLen && scanBytes[pos + j + k] === part[k]) { + k++; + } + if (k >= normalLength) { + found = true; break; } - if (s >= t) { - if (isWhiteSpace(n[o + g + s])) { + if (k >= partLen) { + const lastByte = scanBytes[pos + j + k]; + if (isWhiteSpace(lastByte)) { info( - `Found "${bytesToString([...i, ...e])}" when searching for endstream command.`, + `Found "${bytesToString([...END_SIGNATURE, ...part])}" when ` + + "searching for endstream command.", ); - a = !0; + found = true; } break; } } - if (a) { - t.pos += o; - return t.pos - e; + if (found) { + stream.pos += pos; + return stream.pos - startPos; } } - o++; + pos++; } - t.pos += g; + stream.pos += scanLength; } return -1; } - makeStream(e, t) { - const i = this.lexer; - let a = i.stream; - i.skipToNextLine(); - const s = a.pos - 1; - let r = e.get("Length"); - if (!Number.isInteger(r)) { - info(`Bad length "${r && r.toString()}" in stream.`); - r = 0; + makeStream(dict, cipherTransform) { + const lexer = this.lexer; + let stream = lexer.stream; + lexer.skipToNextLine(); + const startPos = stream.pos - 1; + let length = dict.get("Length"); + if (!Number.isInteger(length)) { + info(`Bad length "${length && length.toString()}" in stream.`); + length = 0; } - a.pos = s + r; - i.nextChar(); - if (this.tryShift() && isCmd(this.buf2, "endstream")) this.shift(); - else { - r = this.#w(s); - if (r < 0) throw new FormatError("Missing endstream command."); - i.nextChar(); + stream.pos = startPos + length; + lexer.nextChar(); + if (this.tryShift() && isCmd(this.buf2, "endstream")) { + this.shift(); + } else { + length = this.#findStreamLength(startPos); + if (length < 0) { + throw new FormatError("Missing endstream command."); + } + lexer.nextChar(); this.shift(); this.shift(); } this.shift(); - a = a.makeSubStream(s, r, e); - t && (a = t.createStream(a, r)); - a = this.filter(a, e, r); - a.dict = e; - return a; - } - filter(e, t, i) { - let a = t.get("F", "Filter"), - s = t.get("DP", "DecodeParms"); - if (a instanceof Name) { - Array.isArray(s) && - warn("/DecodeParms should not be an Array, when /Filter is a Name."); - return this.makeFilter(e, a.name, i, s); + stream = stream.makeSubStream(startPos, length, dict); + if (cipherTransform) { + stream = cipherTransform.createStream(stream, length); } - let r = i; - if (Array.isArray(a)) { - const t = a, - i = s; - for (let n = 0, g = t.length; n < g; ++n) { - a = this.xref.fetchIfRef(t[n]); - if (!(a instanceof Name)) - throw new FormatError(`Bad filter name "${a}"`); - s = null; - Array.isArray(i) && n in i && (s = this.xref.fetchIfRef(i[n])); - e = this.makeFilter(e, a.name, r, s); - r = null; + stream = this.filter(stream, dict, length); + stream.dict = dict; + return stream; + } + filter(stream, dict, length) { + let filter = dict.get("F", "Filter"); + let params = dict.get("DP", "DecodeParms"); + if (filter instanceof Name) { + if (Array.isArray(params)) { + warn("/DecodeParms should not be an Array, when /Filter is a Name."); + } + return this.makeFilter(stream, filter.name, length, params); + } + let maybeLength = length; + if (Array.isArray(filter)) { + const filterArray = filter; + const paramsArray = params; + for (let i = 0, ii = filterArray.length; i < ii; ++i) { + filter = this.xref.fetchIfRef(filterArray[i]); + if (!(filter instanceof Name)) { + throw new FormatError(`Bad filter name "${filter}"`); + } + params = null; + if (Array.isArray(paramsArray) && i in paramsArray) { + params = this.xref.fetchIfRef(paramsArray[i]); + } + stream = this.makeFilter(stream, filter.name, maybeLength, params); + maybeLength = null; } } - return e; + return stream; } - makeFilter(e, t, i, a) { - if (0 === i) { - warn(`Empty "${t}" stream.`); + makeFilter(stream, name, maybeLength, params) { + if (maybeLength === 0) { + warn(`Empty "${name}" stream.`); return new NullStream(); } try { - switch (t) { + switch (name) { case "Fl": case "FlateDecode": - return a - ? new PredictorStream(new FlateStream(e, i), i, a) - : new FlateStream(e, i); + if (params) { + return new PredictorStream( + new FlateStream(stream, maybeLength), + maybeLength, + params, + ); + } + return new FlateStream(stream, maybeLength); case "LZW": case "LZWDecode": - let t = 1; - if (a) { - a.has("EarlyChange") && (t = a.get("EarlyChange")); - return new PredictorStream(new LZWStream(e, i, t), i, a); + let earlyChange = 1; + if (params) { + if (params.has("EarlyChange")) { + earlyChange = params.get("EarlyChange"); + } + return new PredictorStream( + new LZWStream(stream, maybeLength, earlyChange), + maybeLength, + params, + ); } - return new LZWStream(e, i, t); + return new LZWStream(stream, maybeLength, earlyChange); case "DCT": case "DCTDecode": - return new JpegStream(e, i, a); + return new JpegStream(stream, maybeLength, params); case "JPX": case "JPXDecode": - return new JpxStream(e, i, a); + return new JpxStream(stream, maybeLength, params); case "A85": case "ASCII85Decode": - return new Ascii85Stream(e, i); + return new Ascii85Stream(stream, maybeLength); case "AHx": case "ASCIIHexDecode": - return new AsciiHexStream(e, i); + return new AsciiHexStream(stream, maybeLength); case "CCF": case "CCITTFaxDecode": - return new CCITTFaxStream(e, i, a); + return new CCITTFaxStream(stream, maybeLength, params); case "RL": case "RunLengthDecode": - return new RunLengthStream(e, i); + return new RunLengthStream(stream, maybeLength); case "JBIG2Decode": - return new Jbig2Stream(e, i, a); + return new Jbig2Stream(stream, maybeLength, params); } - warn(`Filter "${t}" is not supported.`); - return e; - } catch (e) { - if (e instanceof MissingDataException) throw e; - warn(`Invalid stream: "${e}"`); + warn(`Filter "${name}" is not supported.`); + return stream; + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`Invalid stream: "${ex}"`); return new NullStream(); } } } -const ci = [ +const specialChars = [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -9417,19 +12146,21 @@ const ci = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ]; -function toHexDigit(e) { - return e >= 48 && e <= 57 - ? 15 & e - : (e >= 65 && e <= 70) || (e >= 97 && e <= 102) - ? 9 + (15 & e) - : -1; +function toHexDigit(ch) { + if (ch >= 0x30 && ch <= 0x39) { + return ch & 0x0f; + } + if ((ch >= 0x41 && ch <= 0x46) || (ch >= 0x61 && ch <= 0x66)) { + return (ch & 0x0f) + 9; + } + return -1; } class Lexer { - constructor(e, t = null) { - this.stream = e; + constructor(stream, knownCommands = null) { + this.stream = stream; this.nextChar(); this.strBuf = []; - this.knownCommands = t; + this.knownCommands = knownCommands; this._hexStringNumWarn = 0; this.beginInlineImagePos = -1; } @@ -9440,651 +12171,747 @@ class Lexer { return this.stream.peekByte(); } getNumber() { - let e = this.currentChar, - t = !1, - i = 0, - a = 1; - if (45 === e) { - a = -1; - e = this.nextChar(); - 45 === e && (e = this.nextChar()); - } else 43 === e && (e = this.nextChar()); - if (10 === e || 13 === e) - do { - e = this.nextChar(); - } while (10 === e || 13 === e); - if (46 === e) { - i = 10; - e = this.nextChar(); + let ch = this.currentChar; + let eNotation = false; + let divideBy = 0; + let sign = 1; + if (ch === 0x2d) { + sign = -1; + ch = this.nextChar(); + if (ch === 0x2d) { + ch = this.nextChar(); + } + } else if (ch === 0x2b) { + ch = this.nextChar(); } - if (e < 48 || e > 57) { - const t = `Invalid number: ${String.fromCharCode(e)} (charCode ${e})`; - if (isWhiteSpace(e) || -1 === e) { - info(`Lexer.getNumber - "${t}".`); + if (ch === 0x0a || ch === 0x0d) { + do { + ch = this.nextChar(); + } while (ch === 0x0a || ch === 0x0d); + } + if (ch === 0x2e) { + divideBy = 10; + ch = this.nextChar(); + } + if (ch < 0x30 || ch > 0x39) { + const msg = `Invalid number: ${String.fromCharCode(ch)} (charCode ${ch})`; + if (isWhiteSpace(ch) || ch === -1) { + info(`Lexer.getNumber - "${msg}".`); return 0; } - throw new FormatError(t); + throw new FormatError(msg); } - let s = e - 48, - r = 0, - n = 1; - for (; (e = this.nextChar()) >= 0; ) - if (e >= 48 && e <= 57) { - const a = e - 48; - if (t) r = 10 * r + a; - else { - 0 !== i && (i *= 10); - s = 10 * s + a; + let baseValue = ch - 0x30; + let powerValue = 0; + let powerValueSign = 1; + while ((ch = this.nextChar()) >= 0) { + if (ch >= 0x30 && ch <= 0x39) { + const currentDigit = ch - 0x30; + if (eNotation) { + powerValue = powerValue * 10 + currentDigit; + } else { + if (divideBy !== 0) { + divideBy *= 10; + } + baseValue = baseValue * 10 + currentDigit; } - } else if (46 === e) { - if (0 !== i) break; - i = 1; - } else if (45 === e) + } else if (ch === 0x2e) { + if (divideBy === 0) { + divideBy = 1; + } else { + break; + } + } else if (ch === 0x2d) { warn("Badly formatted number: minus sign in the middle"); - else { - if (69 !== e && 101 !== e) break; - e = this.peekChar(); - if (43 === e || 45 === e) { - n = 45 === e ? -1 : 1; + } else if (ch === 0x45 || ch === 0x65) { + ch = this.peekChar(); + if (ch === 0x2b || ch === 0x2d) { + powerValueSign = ch === 0x2d ? -1 : 1; this.nextChar(); - } else if (e < 48 || e > 57) break; - t = !0; + } else if (ch < 0x30 || ch > 0x39) { + break; + } + eNotation = true; + } else { + break; } - 0 !== i && (s /= i); - t && (s *= 10 ** (n * r)); - return a * s; + } + if (divideBy !== 0) { + baseValue /= divideBy; + } + if (eNotation) { + baseValue *= 10 ** (powerValueSign * powerValue); + } + return sign * baseValue; } getString() { - let e = 1, - t = !1; - const i = this.strBuf; - i.length = 0; - let a = this.nextChar(); - for (;;) { - let s = !1; - switch (0 | a) { + let numParen = 1; + let done = false; + const strBuf = this.strBuf; + strBuf.length = 0; + let ch = this.nextChar(); + while (true) { + let charBuffered = false; + switch (ch | 0) { case -1: warn("Unterminated string"); - t = !0; + done = true; break; - case 40: - ++e; - i.push("("); + case 0x28: + ++numParen; + strBuf.push("("); break; - case 41: - if (0 == --e) { + case 0x29: + if (--numParen === 0) { this.nextChar(); - t = !0; - } else i.push(")"); + done = true; + } else { + strBuf.push(")"); + } break; - case 92: - a = this.nextChar(); - switch (a) { + case 0x5c: + ch = this.nextChar(); + switch (ch) { case -1: warn("Unterminated string"); - t = !0; + done = true; break; - case 110: - i.push("\n"); + case 0x6e: + strBuf.push("\n"); break; - case 114: - i.push("\r"); + case 0x72: + strBuf.push("\r"); break; - case 116: - i.push("\t"); + case 0x74: + strBuf.push("\t"); break; - case 98: - i.push("\b"); + case 0x62: + strBuf.push("\b"); break; - case 102: - i.push("\f"); + case 0x66: + strBuf.push("\f"); break; - case 92: - case 40: - case 41: - i.push(String.fromCharCode(a)); + case 0x5c: + case 0x28: + case 0x29: + strBuf.push(String.fromCharCode(ch)); break; - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - let e = 15 & a; - a = this.nextChar(); - s = !0; - if (a >= 48 && a <= 55) { - e = (e << 3) + (15 & a); - a = this.nextChar(); - if (a >= 48 && a <= 55) { - s = !1; - e = (e << 3) + (15 & a); + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + let x = ch & 0x0f; + ch = this.nextChar(); + charBuffered = true; + if (ch >= 0x30 && ch <= 0x37) { + x = (x << 3) + (ch & 0x0f); + ch = this.nextChar(); + if (ch >= 0x30 && ch <= 0x37) { + charBuffered = false; + x = (x << 3) + (ch & 0x0f); } } - i.push(String.fromCharCode(e)); + strBuf.push(String.fromCharCode(x)); break; - case 13: - 10 === this.peekChar() && this.nextChar(); + case 0x0d: + if (this.peekChar() === 0x0a) { + this.nextChar(); + } break; - case 10: + case 0x0a: break; default: - i.push(String.fromCharCode(a)); + strBuf.push(String.fromCharCode(ch)); + break; } break; default: - i.push(String.fromCharCode(a)); + strBuf.push(String.fromCharCode(ch)); + break; + } + if (done) { + break; + } + if (!charBuffered) { + ch = this.nextChar(); } - if (t) break; - s || (a = this.nextChar()); } - return i.join(""); + return strBuf.join(""); } getName() { - let e, t; - const i = this.strBuf; - i.length = 0; - for (; (e = this.nextChar()) >= 0 && !ci[e]; ) - if (35 === e) { - e = this.nextChar(); - if (ci[e]) { + let ch, previousCh; + const strBuf = this.strBuf; + strBuf.length = 0; + while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { + if (ch === 0x23) { + ch = this.nextChar(); + if (specialChars[ch]) { warn( - "Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number.", + "Lexer_getName: " + + "NUMBER SIGN (#) should be followed by a hexadecimal number.", ); - i.push("#"); + strBuf.push("#"); break; } - const a = toHexDigit(e); - if (-1 !== a) { - t = e; - e = this.nextChar(); - const s = toHexDigit(e); - if (-1 === s) { + const x = toHexDigit(ch); + if (x !== -1) { + previousCh = ch; + ch = this.nextChar(); + const x2 = toHexDigit(ch); + if (x2 === -1) { warn( - `Lexer_getName: Illegal digit (${String.fromCharCode(e)}) in hexadecimal number.`, + `Lexer_getName: Illegal digit (${String.fromCharCode(ch)}) ` + + "in hexadecimal number.", ); - i.push("#", String.fromCharCode(t)); - if (ci[e]) break; - i.push(String.fromCharCode(e)); + strBuf.push("#", String.fromCharCode(previousCh)); + if (specialChars[ch]) { + break; + } + strBuf.push(String.fromCharCode(ch)); continue; } - i.push(String.fromCharCode((a << 4) | s)); - } else i.push("#", String.fromCharCode(e)); - } else i.push(String.fromCharCode(e)); - i.length > 127 && - warn(`Name token is longer than allowed by the spec: ${i.length}`); - return Name.get(i.join("")); + strBuf.push(String.fromCharCode((x << 4) | x2)); + } else { + strBuf.push("#", String.fromCharCode(ch)); + } + } else { + strBuf.push(String.fromCharCode(ch)); + } + } + if (strBuf.length > 127) { + warn(`Name token is longer than allowed by the spec: ${strBuf.length}`); + } + return Name.get(strBuf.join("")); } - _hexStringWarn(e) { - 5 != this._hexStringNumWarn++ - ? this._hexStringNumWarn > 5 || - warn(`getHexString - ignoring invalid character: ${e}`) - : warn("getHexString - ignoring additional invalid characters."); + _hexStringWarn(ch) { + const MAX_HEX_STRING_NUM_WARN = 5; + if (this._hexStringNumWarn++ === MAX_HEX_STRING_NUM_WARN) { + warn("getHexString - ignoring additional invalid characters."); + return; + } + if (this._hexStringNumWarn > MAX_HEX_STRING_NUM_WARN) { + return; + } + warn(`getHexString - ignoring invalid character: ${ch}`); } getHexString() { - const e = this.strBuf; - e.length = 0; - let t, - i, - a = this.currentChar, - s = !0; + const strBuf = this.strBuf; + strBuf.length = 0; + let ch = this.currentChar; + let firstDigit = -1, + digit = -1; this._hexStringNumWarn = 0; - for (;;) { - if (a < 0) { + while (true) { + if (ch < 0) { warn("Unterminated hex string"); break; - } - if (62 === a) { + } else if (ch === 0x3e) { this.nextChar(); break; - } - if (1 !== ci[a]) { - if (s) { - t = toHexDigit(a); - if (-1 === t) { - this._hexStringWarn(a); - a = this.nextChar(); - continue; - } + } else if (specialChars[ch] === 1) { + ch = this.nextChar(); + continue; + } else { + digit = toHexDigit(ch); + if (digit === -1) { + this._hexStringWarn(ch); + } else if (firstDigit === -1) { + firstDigit = digit; } else { - i = toHexDigit(a); - if (-1 === i) { - this._hexStringWarn(a); - a = this.nextChar(); - continue; - } - e.push(String.fromCharCode((t << 4) | i)); + strBuf.push(String.fromCharCode((firstDigit << 4) | digit)); + firstDigit = -1; } - s = !s; - a = this.nextChar(); - } else a = this.nextChar(); + ch = this.nextChar(); + } } - return e.join(""); + if (firstDigit !== -1) { + strBuf.push(String.fromCharCode(firstDigit << 4)); + } + return strBuf.join(""); } getObj() { - let e = !1, - t = this.currentChar; - for (;;) { - if (t < 0) return pt; - if (e) (10 !== t && 13 !== t) || (e = !1); - else if (37 === t) e = !0; - else if (1 !== ci[t]) break; - t = this.nextChar(); + let comment = false; + let ch = this.currentChar; + while (true) { + if (ch < 0) { + return EOF; + } + if (comment) { + if (ch === 0x0a || ch === 0x0d) { + comment = false; + } + } else if (ch === 0x25) { + comment = true; + } else if (specialChars[ch] !== 1) { + break; + } + ch = this.nextChar(); } - switch (0 | t) { - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - case 43: - case 45: - case 46: + switch (ch | 0) { + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x2b: + case 0x2d: + case 0x2e: return this.getNumber(); - case 40: + case 0x28: return this.getString(); - case 47: + case 0x2f: return this.getName(); - case 91: + case 0x5b: this.nextChar(); return Cmd.get("["); - case 93: + case 0x5d: this.nextChar(); return Cmd.get("]"); - case 60: - t = this.nextChar(); - if (60 === t) { + case 0x3c: + ch = this.nextChar(); + if (ch === 0x3c) { this.nextChar(); return Cmd.get("<<"); } return this.getHexString(); - case 62: - t = this.nextChar(); - if (62 === t) { + case 0x3e: + ch = this.nextChar(); + if (ch === 0x3e) { this.nextChar(); return Cmd.get(">>"); } return Cmd.get(">"); - case 123: + case 0x7b: this.nextChar(); return Cmd.get("{"); - case 125: + case 0x7d: this.nextChar(); return Cmd.get("}"); - case 41: + case 0x29: this.nextChar(); - throw new FormatError(`Illegal character: ${t}`); + throw new FormatError(`Illegal character: ${ch}`); } - let i = String.fromCharCode(t); - if (t < 32 || t > 127) { - const e = this.peekChar(); - if (e >= 32 && e <= 127) { + let str = String.fromCharCode(ch); + if (ch < 0x20 || ch > 0x7f) { + const nextCh = this.peekChar(); + if (nextCh >= 0x20 && nextCh <= 0x7f) { this.nextChar(); - return Cmd.get(i); + return Cmd.get(str); } } - const a = this.knownCommands; - let s = void 0 !== a?.[i]; - for (; (t = this.nextChar()) >= 0 && !ci[t]; ) { - const e = i + String.fromCharCode(t); - if (s && void 0 === a[e]) break; - if (128 === i.length) - throw new FormatError(`Command token too long: ${i.length}`); - i = e; - s = void 0 !== a?.[i]; + const knownCommands = this.knownCommands; + let knownCommandFound = knownCommands?.[str] !== undefined; + while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { + const possibleCommand = str + String.fromCharCode(ch); + if (knownCommandFound && knownCommands[possibleCommand] === undefined) { + break; + } + if (str.length === 128) { + throw new FormatError(`Command token too long: ${str.length}`); + } + str = possibleCommand; + knownCommandFound = knownCommands?.[str] !== undefined; } - if ("true" === i) return !0; - if ("false" === i) return !1; - if ("null" === i) return null; - "BI" === i && (this.beginInlineImagePos = this.stream.pos); - return Cmd.get(i); + if (str === "true") { + return true; + } + if (str === "false") { + return false; + } + if (str === "null") { + return null; + } + if (str === "BI") { + this.beginInlineImagePos = this.stream.pos; + } + return Cmd.get(str); } skipToNextLine() { - let e = this.currentChar; - for (; e >= 0; ) { - if (13 === e) { - e = this.nextChar(); - 10 === e && this.nextChar(); + let ch = this.currentChar; + while (ch >= 0) { + if (ch === 0x0d) { + ch = this.nextChar(); + if (ch === 0x0a) { + this.nextChar(); + } break; - } - if (10 === e) { + } else if (ch === 0x0a) { this.nextChar(); break; } - e = this.nextChar(); + ch = this.nextChar(); } } } class Linearization { - static create(e) { - function getInt(e, t, i = !1) { - const a = e.get(t); - if (Number.isInteger(a) && (i ? a >= 0 : a > 0)) return a; + static create(stream) { + function getInt(linDict, name, allowZeroValue = false) { + const obj = linDict.get(name); + if (Number.isInteger(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) { + return obj; + } throw new Error( - `The "${t}" parameter in the linearization dictionary is invalid.`, + `The "${name}" parameter in the linearization ` + + "dictionary is invalid.", ); } - const t = new Parser({ lexer: new Lexer(e), xref: null }), - i = t.getObj(), - a = t.getObj(), - s = t.getObj(), - r = t.getObj(); - let n, g; + function getHints(linDict) { + const hints = linDict.get("H"); + let hintsLength; + if ( + Array.isArray(hints) && + ((hintsLength = hints.length) === 2 || hintsLength === 4) + ) { + for (let index = 0; index < hintsLength; index++) { + const hint = hints[index]; + if (!(Number.isInteger(hint) && hint > 0)) { + throw new Error( + `Hint (${index}) in the linearization dictionary is invalid.`, + ); + } + } + return hints; + } + throw new Error("Hint array in the linearization dictionary is invalid."); + } + const parser = new Parser({ + lexer: new Lexer(stream), + xref: null, + }); + const obj1 = parser.getObj(); + const obj2 = parser.getObj(); + const obj3 = parser.getObj(); + const linDict = parser.getObj(); + let obj, length; if ( !( - Number.isInteger(i) && - Number.isInteger(a) && - isCmd(s, "obj") && - r instanceof Dict && - "number" == typeof (n = r.get("Linearized")) && - n > 0 + Number.isInteger(obj1) && + Number.isInteger(obj2) && + isCmd(obj3, "obj") && + linDict instanceof Dict && + typeof (obj = linDict.get("Linearized")) === "number" && + obj > 0 ) - ) + ) { return null; - if ((g = getInt(r, "L")) !== e.length) + } else if ((length = getInt(linDict, "L")) !== stream.length) { throw new Error( - 'The "L" parameter in the linearization dictionary does not equal the stream length.', + 'The "L" parameter in the linearization dictionary ' + + "does not equal the stream length.", ); + } return { - length: g, - hints: (function getHints(e) { - const t = e.get("H"); - let i; - if (Array.isArray(t) && (2 === (i = t.length) || 4 === i)) { - for (let e = 0; e < i; e++) { - const i = t[e]; - if (!(Number.isInteger(i) && i > 0)) - throw new Error( - `Hint (${e}) in the linearization dictionary is invalid.`, - ); - } - return t; - } - throw new Error( - "Hint array in the linearization dictionary is invalid.", - ); - })(r), - objectNumberFirst: getInt(r, "O"), - endFirst: getInt(r, "E"), - numPages: getInt(r, "N"), - mainXRefEntriesOffset: getInt(r, "T"), - pageFirst: r.has("P") ? getInt(r, "P", !0) : 0, + length, + hints: getHints(linDict), + objectNumberFirst: getInt(linDict, "O"), + endFirst: getInt(linDict, "E"), + numPages: getInt(linDict, "N"), + mainXRefEntriesOffset: getInt(linDict, "T"), + pageFirst: linDict.has("P") ? getInt(linDict, "P", true) : 0, }; } -} -const Ci = [ - "Adobe-GB1-UCS2", - "Adobe-CNS1-UCS2", - "Adobe-Japan1-UCS2", - "Adobe-Korea1-UCS2", - "78-EUC-H", - "78-EUC-V", - "78-H", - "78-RKSJ-H", - "78-RKSJ-V", - "78-V", - "78ms-RKSJ-H", - "78ms-RKSJ-V", - "83pv-RKSJ-H", - "90ms-RKSJ-H", - "90ms-RKSJ-V", - "90msp-RKSJ-H", - "90msp-RKSJ-V", - "90pv-RKSJ-H", - "90pv-RKSJ-V", - "Add-H", - "Add-RKSJ-H", - "Add-RKSJ-V", - "Add-V", - "Adobe-CNS1-0", - "Adobe-CNS1-1", - "Adobe-CNS1-2", - "Adobe-CNS1-3", - "Adobe-CNS1-4", - "Adobe-CNS1-5", - "Adobe-CNS1-6", - "Adobe-GB1-0", - "Adobe-GB1-1", - "Adobe-GB1-2", - "Adobe-GB1-3", - "Adobe-GB1-4", - "Adobe-GB1-5", - "Adobe-Japan1-0", - "Adobe-Japan1-1", - "Adobe-Japan1-2", - "Adobe-Japan1-3", - "Adobe-Japan1-4", - "Adobe-Japan1-5", - "Adobe-Japan1-6", - "Adobe-Korea1-0", - "Adobe-Korea1-1", - "Adobe-Korea1-2", - "B5-H", - "B5-V", - "B5pc-H", - "B5pc-V", - "CNS-EUC-H", - "CNS-EUC-V", - "CNS1-H", - "CNS1-V", - "CNS2-H", - "CNS2-V", - "ETHK-B5-H", - "ETHK-B5-V", - "ETen-B5-H", - "ETen-B5-V", - "ETenms-B5-H", - "ETenms-B5-V", - "EUC-H", - "EUC-V", - "Ext-H", - "Ext-RKSJ-H", - "Ext-RKSJ-V", - "Ext-V", - "GB-EUC-H", - "GB-EUC-V", - "GB-H", - "GB-V", - "GBK-EUC-H", - "GBK-EUC-V", - "GBK2K-H", - "GBK2K-V", - "GBKp-EUC-H", - "GBKp-EUC-V", - "GBT-EUC-H", - "GBT-EUC-V", - "GBT-H", - "GBT-V", - "GBTpc-EUC-H", - "GBTpc-EUC-V", - "GBpc-EUC-H", - "GBpc-EUC-V", - "H", - "HKdla-B5-H", - "HKdla-B5-V", - "HKdlb-B5-H", - "HKdlb-B5-V", - "HKgccs-B5-H", - "HKgccs-B5-V", - "HKm314-B5-H", - "HKm314-B5-V", - "HKm471-B5-H", - "HKm471-B5-V", - "HKscs-B5-H", - "HKscs-B5-V", - "Hankaku", - "Hiragana", - "KSC-EUC-H", - "KSC-EUC-V", - "KSC-H", - "KSC-Johab-H", - "KSC-Johab-V", - "KSC-V", - "KSCms-UHC-H", - "KSCms-UHC-HW-H", - "KSCms-UHC-HW-V", - "KSCms-UHC-V", - "KSCpc-EUC-H", - "KSCpc-EUC-V", - "Katakana", - "NWP-H", - "NWP-V", - "RKSJ-H", - "RKSJ-V", - "Roman", - "UniCNS-UCS2-H", - "UniCNS-UCS2-V", - "UniCNS-UTF16-H", - "UniCNS-UTF16-V", - "UniCNS-UTF32-H", - "UniCNS-UTF32-V", - "UniCNS-UTF8-H", - "UniCNS-UTF8-V", - "UniGB-UCS2-H", - "UniGB-UCS2-V", - "UniGB-UTF16-H", - "UniGB-UTF16-V", - "UniGB-UTF32-H", - "UniGB-UTF32-V", - "UniGB-UTF8-H", - "UniGB-UTF8-V", - "UniJIS-UCS2-H", - "UniJIS-UCS2-HW-H", - "UniJIS-UCS2-HW-V", - "UniJIS-UCS2-V", - "UniJIS-UTF16-H", - "UniJIS-UTF16-V", - "UniJIS-UTF32-H", - "UniJIS-UTF32-V", - "UniJIS-UTF8-H", - "UniJIS-UTF8-V", - "UniJIS2004-UTF16-H", - "UniJIS2004-UTF16-V", - "UniJIS2004-UTF32-H", - "UniJIS2004-UTF32-V", - "UniJIS2004-UTF8-H", - "UniJIS2004-UTF8-V", - "UniJISPro-UCS2-HW-V", - "UniJISPro-UCS2-V", - "UniJISPro-UTF8-V", - "UniJISX0213-UTF32-H", - "UniJISX0213-UTF32-V", - "UniJISX02132004-UTF32-H", - "UniJISX02132004-UTF32-V", - "UniKS-UCS2-H", - "UniKS-UCS2-V", - "UniKS-UTF16-H", - "UniKS-UTF16-V", - "UniKS-UTF32-H", - "UniKS-UTF32-V", - "UniKS-UTF8-H", - "UniKS-UTF8-V", - "V", - "WP-Symbol", - ], - hi = 2 ** 24 - 1; +} // ./src/core/cmap.js + +const BUILT_IN_CMAPS = [ + "Adobe-GB1-UCS2", + "Adobe-CNS1-UCS2", + "Adobe-Japan1-UCS2", + "Adobe-Korea1-UCS2", + "78-EUC-H", + "78-EUC-V", + "78-H", + "78-RKSJ-H", + "78-RKSJ-V", + "78-V", + "78ms-RKSJ-H", + "78ms-RKSJ-V", + "83pv-RKSJ-H", + "90ms-RKSJ-H", + "90ms-RKSJ-V", + "90msp-RKSJ-H", + "90msp-RKSJ-V", + "90pv-RKSJ-H", + "90pv-RKSJ-V", + "Add-H", + "Add-RKSJ-H", + "Add-RKSJ-V", + "Add-V", + "Adobe-CNS1-0", + "Adobe-CNS1-1", + "Adobe-CNS1-2", + "Adobe-CNS1-3", + "Adobe-CNS1-4", + "Adobe-CNS1-5", + "Adobe-CNS1-6", + "Adobe-GB1-0", + "Adobe-GB1-1", + "Adobe-GB1-2", + "Adobe-GB1-3", + "Adobe-GB1-4", + "Adobe-GB1-5", + "Adobe-Japan1-0", + "Adobe-Japan1-1", + "Adobe-Japan1-2", + "Adobe-Japan1-3", + "Adobe-Japan1-4", + "Adobe-Japan1-5", + "Adobe-Japan1-6", + "Adobe-Korea1-0", + "Adobe-Korea1-1", + "Adobe-Korea1-2", + "B5-H", + "B5-V", + "B5pc-H", + "B5pc-V", + "CNS-EUC-H", + "CNS-EUC-V", + "CNS1-H", + "CNS1-V", + "CNS2-H", + "CNS2-V", + "ETHK-B5-H", + "ETHK-B5-V", + "ETen-B5-H", + "ETen-B5-V", + "ETenms-B5-H", + "ETenms-B5-V", + "EUC-H", + "EUC-V", + "Ext-H", + "Ext-RKSJ-H", + "Ext-RKSJ-V", + "Ext-V", + "GB-EUC-H", + "GB-EUC-V", + "GB-H", + "GB-V", + "GBK-EUC-H", + "GBK-EUC-V", + "GBK2K-H", + "GBK2K-V", + "GBKp-EUC-H", + "GBKp-EUC-V", + "GBT-EUC-H", + "GBT-EUC-V", + "GBT-H", + "GBT-V", + "GBTpc-EUC-H", + "GBTpc-EUC-V", + "GBpc-EUC-H", + "GBpc-EUC-V", + "H", + "HKdla-B5-H", + "HKdla-B5-V", + "HKdlb-B5-H", + "HKdlb-B5-V", + "HKgccs-B5-H", + "HKgccs-B5-V", + "HKm314-B5-H", + "HKm314-B5-V", + "HKm471-B5-H", + "HKm471-B5-V", + "HKscs-B5-H", + "HKscs-B5-V", + "Hankaku", + "Hiragana", + "KSC-EUC-H", + "KSC-EUC-V", + "KSC-H", + "KSC-Johab-H", + "KSC-Johab-V", + "KSC-V", + "KSCms-UHC-H", + "KSCms-UHC-HW-H", + "KSCms-UHC-HW-V", + "KSCms-UHC-V", + "KSCpc-EUC-H", + "KSCpc-EUC-V", + "Katakana", + "NWP-H", + "NWP-V", + "RKSJ-H", + "RKSJ-V", + "Roman", + "UniCNS-UCS2-H", + "UniCNS-UCS2-V", + "UniCNS-UTF16-H", + "UniCNS-UTF16-V", + "UniCNS-UTF32-H", + "UniCNS-UTF32-V", + "UniCNS-UTF8-H", + "UniCNS-UTF8-V", + "UniGB-UCS2-H", + "UniGB-UCS2-V", + "UniGB-UTF16-H", + "UniGB-UTF16-V", + "UniGB-UTF32-H", + "UniGB-UTF32-V", + "UniGB-UTF8-H", + "UniGB-UTF8-V", + "UniJIS-UCS2-H", + "UniJIS-UCS2-HW-H", + "UniJIS-UCS2-HW-V", + "UniJIS-UCS2-V", + "UniJIS-UTF16-H", + "UniJIS-UTF16-V", + "UniJIS-UTF32-H", + "UniJIS-UTF32-V", + "UniJIS-UTF8-H", + "UniJIS-UTF8-V", + "UniJIS2004-UTF16-H", + "UniJIS2004-UTF16-V", + "UniJIS2004-UTF32-H", + "UniJIS2004-UTF32-V", + "UniJIS2004-UTF8-H", + "UniJIS2004-UTF8-V", + "UniJISPro-UCS2-HW-V", + "UniJISPro-UCS2-V", + "UniJISPro-UTF8-V", + "UniJISX0213-UTF32-H", + "UniJISX0213-UTF32-V", + "UniJISX02132004-UTF32-H", + "UniJISX02132004-UTF32-V", + "UniKS-UCS2-H", + "UniKS-UCS2-V", + "UniKS-UTF16-H", + "UniKS-UTF16-V", + "UniKS-UTF32-H", + "UniKS-UTF32-V", + "UniKS-UTF8-H", + "UniKS-UTF8-V", + "V", + "WP-Symbol", +]; +const MAX_MAP_RANGE = 2 ** 24 - 1; class CMap { - constructor(e = !1) { + constructor(builtInCMap = false) { this.codespaceRanges = [[], [], [], []]; this.numCodespaceRanges = 0; this._map = []; this.name = ""; - this.vertical = !1; + this.vertical = false; this.useCMap = null; - this.builtInCMap = e; + this.builtInCMap = builtInCMap; } - addCodespaceRange(e, t, i) { - this.codespaceRanges[e - 1].push(t, i); + addCodespaceRange(n, low, high) { + this.codespaceRanges[n - 1].push(low, high); this.numCodespaceRanges++; } - mapCidRange(e, t, i) { - if (t - e > hi) + mapCidRange(low, high, dstLow) { + if (high - low > MAX_MAP_RANGE) { throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE."); - for (; e <= t; ) this._map[e++] = i++; + } + while (low <= high) { + this._map[low++] = dstLow++; + } } - mapBfRange(e, t, i) { - if (t - e > hi) + mapBfRange(low, high, dstLow) { + if (high - low > MAX_MAP_RANGE) { throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE."); - const a = i.length - 1; - for (; e <= t; ) { - this._map[e++] = i; - const t = i.charCodeAt(a) + 1; - t > 255 - ? (i = - i.substring(0, a - 1) + - String.fromCharCode(i.charCodeAt(a - 1) + 1) + - "\0") - : (i = i.substring(0, a) + String.fromCharCode(t)); + } + const lastByte = dstLow.length - 1; + while (low <= high) { + this._map[low++] = dstLow; + const nextCharCode = dstLow.charCodeAt(lastByte) + 1; + if (nextCharCode > 0xff) { + dstLow = + dstLow.substring(0, lastByte - 1) + + String.fromCharCode(dstLow.charCodeAt(lastByte - 1) + 1) + + "\x00"; + continue; + } + dstLow = + dstLow.substring(0, lastByte) + String.fromCharCode(nextCharCode); } } - mapBfRangeToArray(e, t, i) { - if (t - e > hi) + mapBfRangeToArray(low, high, array) { + if (high - low > MAX_MAP_RANGE) { throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE."); - const a = i.length; - let s = 0; - for (; e <= t && s < a; ) { - this._map[e] = i[s++]; - ++e; + } + const ii = array.length; + let i = 0; + while (low <= high && i < ii) { + this._map[low] = array[i++]; + ++low; } } - mapOne(e, t) { - this._map[e] = t; + mapOne(src, dst) { + this._map[src] = dst; } - lookup(e) { - return this._map[e]; + lookup(code) { + return this._map[code]; } - contains(e) { - return void 0 !== this._map[e]; + contains(code) { + return this._map[code] !== undefined; } - forEach(e) { - const t = this._map, - i = t.length; - if (i <= 65536) for (let a = 0; a < i; a++) void 0 !== t[a] && e(a, t[a]); - else for (const i in t) e(i, t[i]); + forEach(callback) { + const map = this._map; + const length = map.length; + if (length <= 0x10000) { + for (let i = 0; i < length; i++) { + if (map[i] !== undefined) { + callback(i, map[i]); + } + } + } else { + for (const i in map) { + callback(i, map[i]); + } + } } - charCodeOf(e) { - const t = this._map; - if (t.length <= 65536) return t.indexOf(e); - for (const i in t) if (t[i] === e) return 0 | i; + charCodeOf(value) { + const map = this._map; + if (map.length <= 0x10000) { + return map.indexOf(value); + } + for (const charCode in map) { + if (map[charCode] === value) { + return charCode | 0; + } + } return -1; } getMap() { return this._map; } - readCharCode(e, t, i) { - let a = 0; - const s = this.codespaceRanges; - for (let r = 0, n = s.length; r < n; r++) { - a = ((a << 8) | e.charCodeAt(t + r)) >>> 0; - const n = s[r]; - for (let e = 0, t = n.length; e < t; ) { - const t = n[e++], - s = n[e++]; - if (a >= t && a <= s) { - i.charcode = a; - i.length = r + 1; + readCharCode(str, offset, out) { + let c = 0; + const codespaceRanges = this.codespaceRanges; + for (let n = 0, nn = codespaceRanges.length; n < nn; n++) { + c = ((c << 8) | str.charCodeAt(offset + n)) >>> 0; + const codespaceRange = codespaceRanges[n]; + for (let k = 0, kk = codespaceRange.length; k < kk; ) { + const low = codespaceRange[k++]; + const high = codespaceRange[k++]; + if (c >= low && c <= high) { + out.charcode = c; + out.length = n + 1; return; } } } - i.charcode = 0; - i.length = 1; + out.charcode = 0; + out.length = 1; } - getCharCodeLength(e) { - const t = this.codespaceRanges; - for (let i = 0, a = t.length; i < a; i++) { - const a = t[i]; - for (let t = 0, s = a.length; t < s; ) { - const s = a[t++], - r = a[t++]; - if (e >= s && e <= r) return i + 1; + getCharCodeLength(charCode) { + const codespaceRanges = this.codespaceRanges; + for (let n = 0, nn = codespaceRanges.length; n < nn; n++) { + const codespaceRange = codespaceRanges[n]; + for (let k = 0, kk = codespaceRange.length; k < kk; ) { + const low = codespaceRange[k++]; + const high = codespaceRange[k++]; + if (charCode >= low && charCode <= high) { + return n + 1; + } } } return 1; @@ -10093,3620 +12920,4003 @@ class CMap { return this._map.length; } get isIdentityCMap() { - if ("Identity-H" !== this.name && "Identity-V" !== this.name) return !1; - if (65536 !== this._map.length) return !1; - for (let e = 0; e < 65536; e++) if (this._map[e] !== e) return !1; - return !0; + if (!(this.name === "Identity-H" || this.name === "Identity-V")) { + return false; + } + if (this._map.length !== 0x10000) { + return false; + } + for (let i = 0; i < 0x10000; i++) { + if (this._map[i] !== i) { + return false; + } + } + return true; } } class IdentityCMap extends CMap { - constructor(e, t) { + constructor(vertical, n) { super(); - this.vertical = e; - this.addCodespaceRange(t, 0, 65535); + this.vertical = vertical; + this.addCodespaceRange(n, 0, 0xffff); } - mapCidRange(e, t, i) { + mapCidRange(low, high, dstLow) { unreachable("should not call mapCidRange"); } - mapBfRange(e, t, i) { + mapBfRange(low, high, dstLow) { unreachable("should not call mapBfRange"); } - mapBfRangeToArray(e, t, i) { + mapBfRangeToArray(low, high, array) { unreachable("should not call mapBfRangeToArray"); } - mapOne(e, t) { + mapOne(src, dst) { unreachable("should not call mapCidOne"); } - lookup(e) { - return Number.isInteger(e) && e <= 65535 ? e : void 0; + lookup(code) { + return Number.isInteger(code) && code <= 0xffff ? code : undefined; } - contains(e) { - return Number.isInteger(e) && e <= 65535; + contains(code) { + return Number.isInteger(code) && code <= 0xffff; } - forEach(e) { - for (let t = 0; t <= 65535; t++) e(t, t); + forEach(callback) { + for (let i = 0; i <= 0xffff; i++) { + callback(i, i); + } } - charCodeOf(e) { - return Number.isInteger(e) && e <= 65535 ? e : -1; + charCodeOf(value) { + return Number.isInteger(value) && value <= 0xffff ? value : -1; } getMap() { - const e = new Array(65536); - for (let t = 0; t <= 65535; t++) e[t] = t; - return e; + const map = new Array(0x10000); + for (let i = 0; i <= 0xffff; i++) { + map[i] = i; + } + return map; } get length() { - return 65536; + return 0x10000; } get isIdentityCMap() { unreachable("should not access .isIdentityCMap"); } } -function strToInt(e) { - let t = 0; - for (let i = 0; i < e.length; i++) t = (t << 8) | e.charCodeAt(i); - return t >>> 0; +function strToInt(str) { + let a = 0; + for (let i = 0; i < str.length; i++) { + a = (a << 8) | str.charCodeAt(i); + } + return a >>> 0; } -function expectString(e) { - if ("string" != typeof e) +function expectString(obj) { + if (typeof obj !== "string") { throw new FormatError("Malformed CMap: expected string."); -} -function expectInt(e) { - if (!Number.isInteger(e)) - throw new FormatError("Malformed CMap: expected int."); -} -function parseBfChar(e, t) { - for (;;) { - let i = t.getObj(); - if (i === pt) break; - if (isCmd(i, "endbfchar")) return; - expectString(i); - const a = strToInt(i); - i = t.getObj(); - expectString(i); - const s = i; - e.mapOne(a, s); } } -function parseBfRange(e, t) { - for (;;) { - let i = t.getObj(); - if (i === pt) break; - if (isCmd(i, "endbfrange")) return; - expectString(i); - const a = strToInt(i); - i = t.getObj(); - expectString(i); - const s = strToInt(i); - i = t.getObj(); - if (Number.isInteger(i) || "string" == typeof i) { - const t = Number.isInteger(i) ? String.fromCharCode(i) : i; - e.mapBfRange(a, s, t); - } else { - if (!isCmd(i, "[")) break; - { - i = t.getObj(); - const r = []; - for (; !isCmd(i, "]") && i !== pt; ) { - r.push(i); - i = t.getObj(); - } - e.mapBfRangeToArray(a, s, r); +function expectInt(obj) { + if (!Number.isInteger(obj)) { + throw new FormatError("Malformed CMap: expected int."); + } +} +function parseBfChar(cMap, lexer) { + while (true) { + let obj = lexer.getObj(); + if (obj === EOF) { + break; + } + if (isCmd(obj, "endbfchar")) { + return; + } + expectString(obj); + const src = strToInt(obj); + obj = lexer.getObj(); + expectString(obj); + const dst = obj; + cMap.mapOne(src, dst); + } +} +function parseBfRange(cMap, lexer) { + while (true) { + let obj = lexer.getObj(); + if (obj === EOF) { + break; + } + if (isCmd(obj, "endbfrange")) { + return; + } + expectString(obj); + const low = strToInt(obj); + obj = lexer.getObj(); + expectString(obj); + const high = strToInt(obj); + obj = lexer.getObj(); + if (Number.isInteger(obj) || typeof obj === "string") { + const dstLow = Number.isInteger(obj) ? String.fromCharCode(obj) : obj; + cMap.mapBfRange(low, high, dstLow); + } else if (isCmd(obj, "[")) { + obj = lexer.getObj(); + const array = []; + while (!isCmd(obj, "]") && obj !== EOF) { + array.push(obj); + obj = lexer.getObj(); } + cMap.mapBfRangeToArray(low, high, array); + } else { + break; } } throw new FormatError("Invalid bf range."); } -function parseCidChar(e, t) { - for (;;) { - let i = t.getObj(); - if (i === pt) break; - if (isCmd(i, "endcidchar")) return; - expectString(i); - const a = strToInt(i); - i = t.getObj(); - expectInt(i); - const s = i; - e.mapOne(a, s); +function parseCidChar(cMap, lexer) { + while (true) { + let obj = lexer.getObj(); + if (obj === EOF) { + break; + } + if (isCmd(obj, "endcidchar")) { + return; + } + expectString(obj); + const src = strToInt(obj); + obj = lexer.getObj(); + expectInt(obj); + const dst = obj; + cMap.mapOne(src, dst); } } -function parseCidRange(e, t) { - for (;;) { - let i = t.getObj(); - if (i === pt) break; - if (isCmd(i, "endcidrange")) return; - expectString(i); - const a = strToInt(i); - i = t.getObj(); - expectString(i); - const s = strToInt(i); - i = t.getObj(); - expectInt(i); - const r = i; - e.mapCidRange(a, s, r); +function parseCidRange(cMap, lexer) { + while (true) { + let obj = lexer.getObj(); + if (obj === EOF) { + break; + } + if (isCmd(obj, "endcidrange")) { + return; + } + expectString(obj); + const low = strToInt(obj); + obj = lexer.getObj(); + expectString(obj); + const high = strToInt(obj); + obj = lexer.getObj(); + expectInt(obj); + const dstLow = obj; + cMap.mapCidRange(low, high, dstLow); } } -function parseCodespaceRange(e, t) { - for (;;) { - let i = t.getObj(); - if (i === pt) break; - if (isCmd(i, "endcodespacerange")) return; - if ("string" != typeof i) break; - const a = strToInt(i); - i = t.getObj(); - if ("string" != typeof i) break; - const s = strToInt(i); - e.addCodespaceRange(i.length, a, s); +function parseCodespaceRange(cMap, lexer) { + while (true) { + let obj = lexer.getObj(); + if (obj === EOF) { + break; + } + if (isCmd(obj, "endcodespacerange")) { + return; + } + if (typeof obj !== "string") { + break; + } + const low = strToInt(obj); + obj = lexer.getObj(); + if (typeof obj !== "string") { + break; + } + const high = strToInt(obj); + cMap.addCodespaceRange(obj.length, low, high); } throw new FormatError("Invalid codespace range."); } -function parseWMode(e, t) { - const i = t.getObj(); - Number.isInteger(i) && (e.vertical = !!i); +function parseWMode(cMap, lexer) { + const obj = lexer.getObj(); + if (Number.isInteger(obj)) { + cMap.vertical = !!obj; + } } -function parseCMapName(e, t) { - const i = t.getObj(); - i instanceof Name && (e.name = i.name); +function parseCMapName(cMap, lexer) { + const obj = lexer.getObj(); + if (obj instanceof Name) { + cMap.name = obj.name; + } } -async function parseCMap(e, t, i, a) { - let s, r; - A: for (;;) +async function parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap) { + let previous, embeddedUseCMap; + objLoop: while (true) { try { - const i = t.getObj(); - if (i === pt) break; - if (i instanceof Name) { - "WMode" === i.name - ? parseWMode(e, t) - : "CMapName" === i.name && parseCMapName(e, t); - s = i; - } else if (i instanceof Cmd) - switch (i.cmd) { + const obj = lexer.getObj(); + if (obj === EOF) { + break; + } else if (obj instanceof Name) { + if (obj.name === "WMode") { + parseWMode(cMap, lexer); + } else if (obj.name === "CMapName") { + parseCMapName(cMap, lexer); + } + previous = obj; + } else if (obj instanceof Cmd) { + switch (obj.cmd) { case "endcmap": - break A; + break objLoop; case "usecmap": - s instanceof Name && (r = s.name); + if (previous instanceof Name) { + embeddedUseCMap = previous.name; + } break; case "begincodespacerange": - parseCodespaceRange(e, t); + parseCodespaceRange(cMap, lexer); break; case "beginbfchar": - parseBfChar(e, t); + parseBfChar(cMap, lexer); break; case "begincidchar": - parseCidChar(e, t); + parseCidChar(cMap, lexer); break; case "beginbfrange": - parseBfRange(e, t); + parseBfRange(cMap, lexer); break; case "begincidrange": - parseCidRange(e, t); + parseCidRange(cMap, lexer); + break; } - } catch (e) { - if (e instanceof MissingDataException) throw e; - warn("Invalid cMap data: " + e); + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Invalid cMap data: " + ex); continue; } - !a && r && (a = r); - return a ? extendCMap(e, i, a) : e; -} -async function extendCMap(e, t, i) { - e.useCMap = await createBuiltInCMap(i, t); - if (0 === e.numCodespaceRanges) { - const t = e.useCMap.codespaceRanges; - for (let i = 0; i < t.length; i++) e.codespaceRanges[i] = t[i].slice(); - e.numCodespaceRanges = e.useCMap.numCodespaceRanges; } - e.useCMap.forEach(function (t, i) { - e.contains(t) || e.mapOne(t, e.useCMap.lookup(t)); + if (!useCMap && embeddedUseCMap) { + useCMap = embeddedUseCMap; + } + if (useCMap) { + return extendCMap(cMap, fetchBuiltInCMap, useCMap); + } + return cMap; +} +async function extendCMap(cMap, fetchBuiltInCMap, useCMap) { + cMap.useCMap = await createBuiltInCMap(useCMap, fetchBuiltInCMap); + if (cMap.numCodespaceRanges === 0) { + const useCodespaceRanges = cMap.useCMap.codespaceRanges; + for (let i = 0; i < useCodespaceRanges.length; i++) { + cMap.codespaceRanges[i] = useCodespaceRanges[i].slice(); + } + cMap.numCodespaceRanges = cMap.useCMap.numCodespaceRanges; + } + cMap.useCMap.forEach(function (key, value) { + if (!cMap.contains(key)) { + cMap.mapOne(key, cMap.useCMap.lookup(key)); + } }); - return e; + return cMap; } -async function createBuiltInCMap(e, t) { - if ("Identity-H" === e) return new IdentityCMap(!1, 2); - if ("Identity-V" === e) return new IdentityCMap(!0, 2); - if (!Ci.includes(e)) throw new Error("Unknown CMap name: " + e); - if (!t) throw new Error("Built-in CMap parameters are not provided."); - const { cMapData: i, compressionType: a } = await t(e), - s = new CMap(!0); - if (a === mA.BINARY) - return new BinaryCMapReader().process(i, s, (e) => extendCMap(s, t, e)); - if (a === mA.NONE) { - const e = new Lexer(new Stream(i)); - return parseCMap(s, e, t, null); +async function createBuiltInCMap(name, fetchBuiltInCMap) { + if (name === "Identity-H") { + return new IdentityCMap(false, 2); + } else if (name === "Identity-V") { + return new IdentityCMap(true, 2); } - throw new Error(`Invalid CMap "compressionType" value: ${a}`); + if (!BUILT_IN_CMAPS.includes(name)) { + throw new Error("Unknown CMap name: " + name); + } + if (!fetchBuiltInCMap) { + throw new Error("Built-in CMap parameters are not provided."); + } + const { cMapData, isCompressed } = await fetchBuiltInCMap(name); + const cMap = new CMap(true); + if (isCompressed) { + return new BinaryCMapReader().process(cMapData, cMap, (useCMap) => + extendCMap(cMap, fetchBuiltInCMap, useCMap), + ); + } + const lexer = new Lexer(new Stream(cMapData)); + return parseCMap(cMap, lexer, fetchBuiltInCMap, null); } class CMapFactory { - static async create({ encoding: e, fetchBuiltInCMap: t, useCMap: i }) { - if (e instanceof Name) return createBuiltInCMap(e.name, t); - if (e instanceof BaseStream) { - const a = await parseCMap(new CMap(), new Lexer(e), t, i); - return a.isIdentityCMap ? createBuiltInCMap(a.name, t) : a; + static async create({ encoding, fetchBuiltInCMap, useCMap }) { + if (encoding instanceof Name) { + return createBuiltInCMap(encoding.name, fetchBuiltInCMap); + } else if (encoding instanceof BaseStream) { + const parsedCMap = await parseCMap( + new CMap(), + new Lexer(encoding), + fetchBuiltInCMap, + useCMap, + ); + if (parsedCMap.isIdentityCMap) { + return createBuiltInCMap(parsedCMap.name, fetchBuiltInCMap); + } + return parsedCMap; } throw new Error("Encoding required."); } -} -const Bi = [ - ".notdef", - "space", - "exclam", - "quotedbl", - "numbersign", - "dollar", - "percent", - "ampersand", - "quoteright", - "parenleft", - "parenright", - "asterisk", - "plus", - "comma", - "hyphen", - "period", - "slash", - "zero", - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "colon", - "semicolon", - "less", - "equal", - "greater", - "question", - "at", - "A", - "B", - "C", - "D", - "E", - "F", - "G", - "H", - "I", - "J", - "K", - "L", - "M", - "N", - "O", - "P", - "Q", - "R", - "S", - "T", - "U", - "V", - "W", - "X", - "Y", - "Z", - "bracketleft", - "backslash", - "bracketright", - "asciicircum", - "underscore", - "quoteleft", - "a", - "b", - "c", - "d", - "e", - "f", - "g", - "h", - "i", - "j", - "k", - "l", - "m", - "n", - "o", - "p", - "q", - "r", - "s", - "t", - "u", - "v", - "w", - "x", - "y", - "z", - "braceleft", - "bar", - "braceright", - "asciitilde", - "exclamdown", - "cent", - "sterling", - "fraction", - "yen", - "florin", - "section", - "currency", - "quotesingle", - "quotedblleft", - "guillemotleft", - "guilsinglleft", - "guilsinglright", - "fi", - "fl", - "endash", - "dagger", - "daggerdbl", - "periodcentered", - "paragraph", - "bullet", - "quotesinglbase", - "quotedblbase", - "quotedblright", - "guillemotright", - "ellipsis", - "perthousand", - "questiondown", - "grave", - "acute", - "circumflex", - "tilde", - "macron", - "breve", - "dotaccent", - "dieresis", - "ring", - "cedilla", - "hungarumlaut", - "ogonek", - "caron", - "emdash", - "AE", - "ordfeminine", - "Lslash", - "Oslash", - "OE", - "ordmasculine", - "ae", - "dotlessi", - "lslash", - "oslash", - "oe", - "germandbls", - "onesuperior", - "logicalnot", - "mu", - "trademark", - "Eth", - "onehalf", - "plusminus", - "Thorn", - "onequarter", - "divide", - "brokenbar", - "degree", - "thorn", - "threequarters", - "twosuperior", - "registered", - "minus", - "eth", - "multiply", - "threesuperior", - "copyright", - "Aacute", - "Acircumflex", - "Adieresis", - "Agrave", - "Aring", - "Atilde", - "Ccedilla", - "Eacute", - "Ecircumflex", - "Edieresis", - "Egrave", - "Iacute", - "Icircumflex", - "Idieresis", - "Igrave", - "Ntilde", - "Oacute", - "Ocircumflex", - "Odieresis", - "Ograve", - "Otilde", - "Scaron", - "Uacute", - "Ucircumflex", - "Udieresis", - "Ugrave", - "Yacute", - "Ydieresis", - "Zcaron", - "aacute", - "acircumflex", - "adieresis", - "agrave", - "aring", - "atilde", - "ccedilla", - "eacute", - "ecircumflex", - "edieresis", - "egrave", - "iacute", - "icircumflex", - "idieresis", - "igrave", - "ntilde", - "oacute", - "ocircumflex", - "odieresis", - "ograve", - "otilde", - "scaron", - "uacute", - "ucircumflex", - "udieresis", - "ugrave", - "yacute", - "ydieresis", - "zcaron", - ], - li = [ - ".notdef", - "space", - "exclamsmall", - "Hungarumlautsmall", - "dollaroldstyle", - "dollarsuperior", - "ampersandsmall", - "Acutesmall", - "parenleftsuperior", - "parenrightsuperior", - "twodotenleader", - "onedotenleader", - "comma", - "hyphen", - "period", - "fraction", - "zerooldstyle", - "oneoldstyle", - "twooldstyle", - "threeoldstyle", - "fouroldstyle", - "fiveoldstyle", - "sixoldstyle", - "sevenoldstyle", - "eightoldstyle", - "nineoldstyle", - "colon", - "semicolon", - "commasuperior", - "threequartersemdash", - "periodsuperior", - "questionsmall", - "asuperior", - "bsuperior", - "centsuperior", - "dsuperior", - "esuperior", - "isuperior", - "lsuperior", - "msuperior", - "nsuperior", - "osuperior", - "rsuperior", - "ssuperior", - "tsuperior", - "ff", - "fi", - "fl", - "ffi", - "ffl", - "parenleftinferior", - "parenrightinferior", - "Circumflexsmall", - "hyphensuperior", - "Gravesmall", - "Asmall", - "Bsmall", - "Csmall", - "Dsmall", - "Esmall", - "Fsmall", - "Gsmall", - "Hsmall", - "Ismall", - "Jsmall", - "Ksmall", - "Lsmall", - "Msmall", - "Nsmall", - "Osmall", - "Psmall", - "Qsmall", - "Rsmall", - "Ssmall", - "Tsmall", - "Usmall", - "Vsmall", - "Wsmall", - "Xsmall", - "Ysmall", - "Zsmall", - "colonmonetary", - "onefitted", - "rupiah", - "Tildesmall", - "exclamdownsmall", - "centoldstyle", - "Lslashsmall", - "Scaronsmall", - "Zcaronsmall", - "Dieresissmall", - "Brevesmall", - "Caronsmall", - "Dotaccentsmall", - "Macronsmall", - "figuredash", - "hypheninferior", - "Ogoneksmall", - "Ringsmall", - "Cedillasmall", - "onequarter", - "onehalf", - "threequarters", - "questiondownsmall", - "oneeighth", - "threeeighths", - "fiveeighths", - "seveneighths", - "onethird", - "twothirds", - "zerosuperior", - "onesuperior", - "twosuperior", - "threesuperior", - "foursuperior", - "fivesuperior", - "sixsuperior", - "sevensuperior", - "eightsuperior", - "ninesuperior", - "zeroinferior", - "oneinferior", - "twoinferior", - "threeinferior", - "fourinferior", - "fiveinferior", - "sixinferior", - "seveninferior", - "eightinferior", - "nineinferior", - "centinferior", - "dollarinferior", - "periodinferior", - "commainferior", - "Agravesmall", - "Aacutesmall", - "Acircumflexsmall", - "Atildesmall", - "Adieresissmall", - "Aringsmall", - "AEsmall", - "Ccedillasmall", - "Egravesmall", - "Eacutesmall", - "Ecircumflexsmall", - "Edieresissmall", - "Igravesmall", - "Iacutesmall", - "Icircumflexsmall", - "Idieresissmall", - "Ethsmall", - "Ntildesmall", - "Ogravesmall", - "Oacutesmall", - "Ocircumflexsmall", - "Otildesmall", - "Odieresissmall", - "OEsmall", - "Oslashsmall", - "Ugravesmall", - "Uacutesmall", - "Ucircumflexsmall", - "Udieresissmall", - "Yacutesmall", - "Thornsmall", - "Ydieresissmall", - ], - Qi = [ - ".notdef", - "space", - "dollaroldstyle", - "dollarsuperior", - "parenleftsuperior", - "parenrightsuperior", - "twodotenleader", - "onedotenleader", - "comma", - "hyphen", - "period", - "fraction", - "zerooldstyle", - "oneoldstyle", - "twooldstyle", - "threeoldstyle", - "fouroldstyle", - "fiveoldstyle", - "sixoldstyle", - "sevenoldstyle", - "eightoldstyle", - "nineoldstyle", - "colon", - "semicolon", - "commasuperior", - "threequartersemdash", - "periodsuperior", - "asuperior", - "bsuperior", - "centsuperior", - "dsuperior", - "esuperior", - "isuperior", - "lsuperior", - "msuperior", - "nsuperior", - "osuperior", - "rsuperior", - "ssuperior", - "tsuperior", - "ff", - "fi", - "fl", - "ffi", - "ffl", - "parenleftinferior", - "parenrightinferior", - "hyphensuperior", - "colonmonetary", - "onefitted", - "rupiah", - "centoldstyle", - "figuredash", - "hypheninferior", - "onequarter", - "onehalf", - "threequarters", - "oneeighth", - "threeeighths", - "fiveeighths", - "seveneighths", - "onethird", - "twothirds", - "zerosuperior", - "onesuperior", - "twosuperior", - "threesuperior", - "foursuperior", - "fivesuperior", - "sixsuperior", - "sevensuperior", - "eightsuperior", - "ninesuperior", - "zeroinferior", - "oneinferior", - "twoinferior", - "threeinferior", - "fourinferior", - "fiveinferior", - "sixinferior", - "seveninferior", - "eightinferior", - "nineinferior", - "centinferior", - "dollarinferior", - "periodinferior", - "commainferior", - ], - Ei = [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "space", - "exclamsmall", - "Hungarumlautsmall", - "", - "dollaroldstyle", - "dollarsuperior", - "ampersandsmall", - "Acutesmall", - "parenleftsuperior", - "parenrightsuperior", - "twodotenleader", - "onedotenleader", - "comma", - "hyphen", - "period", - "fraction", - "zerooldstyle", - "oneoldstyle", - "twooldstyle", - "threeoldstyle", - "fouroldstyle", - "fiveoldstyle", - "sixoldstyle", - "sevenoldstyle", - "eightoldstyle", - "nineoldstyle", - "colon", - "semicolon", - "commasuperior", - "threequartersemdash", - "periodsuperior", - "questionsmall", - "", - "asuperior", - "bsuperior", - "centsuperior", - "dsuperior", - "esuperior", - "", - "", - "", - "isuperior", - "", - "", - "lsuperior", - "msuperior", - "nsuperior", - "osuperior", - "", - "", - "rsuperior", - "ssuperior", - "tsuperior", - "", - "ff", - "fi", - "fl", - "ffi", - "ffl", - "parenleftinferior", - "", - "parenrightinferior", - "Circumflexsmall", - "hyphensuperior", - "Gravesmall", - "Asmall", - "Bsmall", - "Csmall", - "Dsmall", - "Esmall", - "Fsmall", - "Gsmall", - "Hsmall", - "Ismall", - "Jsmall", - "Ksmall", - "Lsmall", - "Msmall", - "Nsmall", - "Osmall", - "Psmall", - "Qsmall", - "Rsmall", - "Ssmall", - "Tsmall", - "Usmall", - "Vsmall", - "Wsmall", - "Xsmall", - "Ysmall", - "Zsmall", - "colonmonetary", - "onefitted", - "rupiah", - "Tildesmall", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "exclamdownsmall", - "centoldstyle", - "Lslashsmall", - "", - "", - "Scaronsmall", - "Zcaronsmall", - "Dieresissmall", - "Brevesmall", - "Caronsmall", - "", - "Dotaccentsmall", - "", - "", - "Macronsmall", - "", - "", - "figuredash", - "hypheninferior", - "", - "", - "Ogoneksmall", - "Ringsmall", - "Cedillasmall", - "", - "", - "", - "onequarter", - "onehalf", - "threequarters", - "questiondownsmall", - "oneeighth", - "threeeighths", - "fiveeighths", - "seveneighths", - "onethird", - "twothirds", - "", - "", - "zerosuperior", - "onesuperior", - "twosuperior", - "threesuperior", - "foursuperior", - "fivesuperior", - "sixsuperior", - "sevensuperior", - "eightsuperior", - "ninesuperior", - "zeroinferior", - "oneinferior", - "twoinferior", - "threeinferior", - "fourinferior", - "fiveinferior", - "sixinferior", - "seveninferior", - "eightinferior", - "nineinferior", - "centinferior", - "dollarinferior", - "periodinferior", - "commainferior", - "Agravesmall", - "Aacutesmall", - "Acircumflexsmall", - "Atildesmall", - "Adieresissmall", - "Aringsmall", - "AEsmall", - "Ccedillasmall", - "Egravesmall", - "Eacutesmall", - "Ecircumflexsmall", - "Edieresissmall", - "Igravesmall", - "Iacutesmall", - "Icircumflexsmall", - "Idieresissmall", - "Ethsmall", - "Ntildesmall", - "Ogravesmall", - "Oacutesmall", - "Ocircumflexsmall", - "Otildesmall", - "Odieresissmall", - "OEsmall", - "Oslashsmall", - "Ugravesmall", - "Uacutesmall", - "Ucircumflexsmall", - "Udieresissmall", - "Yacutesmall", - "Thornsmall", - "Ydieresissmall", - ], - ui = [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "space", - "exclamsmall", - "Hungarumlautsmall", - "centoldstyle", - "dollaroldstyle", - "dollarsuperior", - "ampersandsmall", - "Acutesmall", - "parenleftsuperior", - "parenrightsuperior", - "twodotenleader", - "onedotenleader", - "comma", - "hyphen", - "period", - "fraction", - "zerooldstyle", - "oneoldstyle", - "twooldstyle", - "threeoldstyle", - "fouroldstyle", - "fiveoldstyle", - "sixoldstyle", - "sevenoldstyle", - "eightoldstyle", - "nineoldstyle", - "colon", - "semicolon", - "", - "threequartersemdash", - "", - "questionsmall", - "", - "", - "", - "", - "Ethsmall", - "", - "", - "onequarter", - "onehalf", - "threequarters", - "oneeighth", - "threeeighths", - "fiveeighths", - "seveneighths", - "onethird", - "twothirds", - "", - "", - "", - "", - "", - "", - "ff", - "fi", - "fl", - "ffi", - "ffl", - "parenleftinferior", - "", - "parenrightinferior", - "Circumflexsmall", - "hypheninferior", - "Gravesmall", - "Asmall", - "Bsmall", - "Csmall", - "Dsmall", - "Esmall", - "Fsmall", - "Gsmall", - "Hsmall", - "Ismall", - "Jsmall", - "Ksmall", - "Lsmall", - "Msmall", - "Nsmall", - "Osmall", - "Psmall", - "Qsmall", - "Rsmall", - "Ssmall", - "Tsmall", - "Usmall", - "Vsmall", - "Wsmall", - "Xsmall", - "Ysmall", - "Zsmall", - "colonmonetary", - "onefitted", - "rupiah", - "Tildesmall", - "", - "", - "asuperior", - "centsuperior", - "", - "", - "", - "", - "Aacutesmall", - "Agravesmall", - "Acircumflexsmall", - "Adieresissmall", - "Atildesmall", - "Aringsmall", - "Ccedillasmall", - "Eacutesmall", - "Egravesmall", - "Ecircumflexsmall", - "Edieresissmall", - "Iacutesmall", - "Igravesmall", - "Icircumflexsmall", - "Idieresissmall", - "Ntildesmall", - "Oacutesmall", - "Ogravesmall", - "Ocircumflexsmall", - "Odieresissmall", - "Otildesmall", - "Uacutesmall", - "Ugravesmall", - "Ucircumflexsmall", - "Udieresissmall", - "", - "eightsuperior", - "fourinferior", - "threeinferior", - "sixinferior", - "eightinferior", - "seveninferior", - "Scaronsmall", - "", - "centinferior", - "twoinferior", - "", - "Dieresissmall", - "", - "Caronsmall", - "osuperior", - "fiveinferior", - "", - "commainferior", - "periodinferior", - "Yacutesmall", - "", - "dollarinferior", - "", - "", - "Thornsmall", - "", - "nineinferior", - "zeroinferior", - "Zcaronsmall", - "AEsmall", - "Oslashsmall", - "questiondownsmall", - "oneinferior", - "Lslashsmall", - "", - "", - "", - "", - "", - "", - "Cedillasmall", - "", - "", - "", - "", - "", - "OEsmall", - "figuredash", - "hyphensuperior", - "", - "", - "", - "", - "exclamdownsmall", - "", - "Ydieresissmall", - "", - "onesuperior", - "twosuperior", - "threesuperior", - "foursuperior", - "fivesuperior", - "sixsuperior", - "sevensuperior", - "ninesuperior", - "zerosuperior", - "", - "esuperior", - "rsuperior", - "tsuperior", - "", - "", - "isuperior", - "ssuperior", - "dsuperior", - "", - "", - "", - "", - "", - "lsuperior", - "Ogoneksmall", - "Brevesmall", - "Macronsmall", - "bsuperior", - "nsuperior", - "msuperior", - "commasuperior", - "periodsuperior", - "Dotaccentsmall", - "Ringsmall", - "", - "", - "", - "", - ], - di = [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "space", - "exclam", - "quotedbl", - "numbersign", - "dollar", - "percent", - "ampersand", - "quotesingle", - "parenleft", - "parenright", - "asterisk", - "plus", - "comma", - "hyphen", - "period", - "slash", - "zero", - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "colon", - "semicolon", - "less", - "equal", - "greater", - "question", - "at", - "A", - "B", - "C", - "D", - "E", - "F", - "G", - "H", - "I", - "J", - "K", - "L", - "M", - "N", - "O", - "P", - "Q", - "R", - "S", - "T", - "U", - "V", - "W", - "X", - "Y", - "Z", - "bracketleft", - "backslash", - "bracketright", - "asciicircum", - "underscore", - "grave", - "a", - "b", - "c", - "d", - "e", - "f", - "g", - "h", - "i", - "j", - "k", - "l", - "m", - "n", - "o", - "p", - "q", - "r", - "s", - "t", - "u", - "v", - "w", - "x", - "y", - "z", - "braceleft", - "bar", - "braceright", - "asciitilde", - "", - "Adieresis", - "Aring", - "Ccedilla", - "Eacute", - "Ntilde", - "Odieresis", - "Udieresis", - "aacute", - "agrave", - "acircumflex", - "adieresis", - "atilde", - "aring", - "ccedilla", - "eacute", - "egrave", - "ecircumflex", - "edieresis", - "iacute", - "igrave", - "icircumflex", - "idieresis", - "ntilde", - "oacute", - "ograve", - "ocircumflex", - "odieresis", - "otilde", - "uacute", - "ugrave", - "ucircumflex", - "udieresis", - "dagger", - "degree", - "cent", - "sterling", - "section", - "bullet", - "paragraph", - "germandbls", - "registered", - "copyright", - "trademark", - "acute", - "dieresis", - "notequal", - "AE", - "Oslash", - "infinity", - "plusminus", - "lessequal", - "greaterequal", - "yen", - "mu", - "partialdiff", - "summation", - "product", - "pi", - "integral", - "ordfeminine", - "ordmasculine", - "Omega", - "ae", - "oslash", - "questiondown", - "exclamdown", - "logicalnot", - "radical", - "florin", - "approxequal", - "Delta", - "guillemotleft", - "guillemotright", - "ellipsis", - "space", - "Agrave", - "Atilde", - "Otilde", - "OE", - "oe", - "endash", - "emdash", - "quotedblleft", - "quotedblright", - "quoteleft", - "quoteright", - "divide", - "lozenge", - "ydieresis", - "Ydieresis", - "fraction", - "currency", - "guilsinglleft", - "guilsinglright", - "fi", - "fl", - "daggerdbl", - "periodcentered", - "quotesinglbase", - "quotedblbase", - "perthousand", - "Acircumflex", - "Ecircumflex", - "Aacute", - "Edieresis", - "Egrave", - "Iacute", - "Icircumflex", - "Idieresis", - "Igrave", - "Oacute", - "Ocircumflex", - "apple", - "Ograve", - "Uacute", - "Ucircumflex", - "Ugrave", - "dotlessi", - "circumflex", - "tilde", - "macron", - "breve", - "dotaccent", - "ring", - "cedilla", - "hungarumlaut", - "ogonek", - "caron", - ], - fi = [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "space", - "exclam", - "quotedbl", - "numbersign", - "dollar", - "percent", - "ampersand", - "quoteright", - "parenleft", - "parenright", - "asterisk", - "plus", - "comma", - "hyphen", - "period", - "slash", - "zero", - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "colon", - "semicolon", - "less", - "equal", - "greater", - "question", - "at", - "A", - "B", - "C", - "D", - "E", - "F", - "G", - "H", - "I", - "J", - "K", - "L", - "M", - "N", - "O", - "P", - "Q", - "R", - "S", - "T", - "U", - "V", - "W", - "X", - "Y", - "Z", - "bracketleft", - "backslash", - "bracketright", - "asciicircum", - "underscore", - "quoteleft", - "a", - "b", - "c", - "d", - "e", - "f", - "g", - "h", - "i", - "j", - "k", - "l", - "m", - "n", - "o", - "p", - "q", - "r", - "s", - "t", - "u", - "v", - "w", - "x", - "y", - "z", - "braceleft", - "bar", - "braceright", - "asciitilde", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "exclamdown", - "cent", - "sterling", - "fraction", - "yen", - "florin", - "section", - "currency", - "quotesingle", - "quotedblleft", - "guillemotleft", - "guilsinglleft", - "guilsinglright", - "fi", - "fl", - "", - "endash", - "dagger", - "daggerdbl", - "periodcentered", - "", - "paragraph", - "bullet", - "quotesinglbase", - "quotedblbase", - "quotedblright", - "guillemotright", - "ellipsis", - "perthousand", - "", - "questiondown", - "", - "grave", - "acute", - "circumflex", - "tilde", - "macron", - "breve", - "dotaccent", - "dieresis", - "", - "ring", - "cedilla", - "", - "hungarumlaut", - "ogonek", - "caron", - "emdash", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "AE", - "", - "ordfeminine", - "", - "", - "", - "", - "Lslash", - "Oslash", - "OE", - "ordmasculine", - "", - "", - "", - "", - "", - "ae", - "", - "", - "", - "dotlessi", - "", - "", - "lslash", - "oslash", - "oe", - "germandbls", - "", - "", - "", - "", - ], - pi = [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "space", - "exclam", - "quotedbl", - "numbersign", - "dollar", - "percent", - "ampersand", - "quotesingle", - "parenleft", - "parenright", - "asterisk", - "plus", - "comma", - "hyphen", - "period", - "slash", - "zero", - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "colon", - "semicolon", - "less", - "equal", - "greater", - "question", - "at", - "A", - "B", - "C", - "D", - "E", - "F", - "G", - "H", - "I", - "J", - "K", - "L", - "M", - "N", - "O", - "P", - "Q", - "R", - "S", - "T", - "U", - "V", - "W", - "X", - "Y", - "Z", - "bracketleft", - "backslash", - "bracketright", - "asciicircum", - "underscore", - "grave", - "a", - "b", - "c", - "d", - "e", - "f", - "g", - "h", - "i", - "j", - "k", - "l", - "m", - "n", - "o", - "p", - "q", - "r", - "s", - "t", - "u", - "v", - "w", - "x", - "y", - "z", - "braceleft", - "bar", - "braceright", - "asciitilde", - "bullet", - "Euro", - "bullet", - "quotesinglbase", - "florin", - "quotedblbase", - "ellipsis", - "dagger", - "daggerdbl", - "circumflex", - "perthousand", - "Scaron", - "guilsinglleft", - "OE", - "bullet", - "Zcaron", - "bullet", - "bullet", - "quoteleft", - "quoteright", - "quotedblleft", - "quotedblright", - "bullet", - "endash", - "emdash", - "tilde", - "trademark", - "scaron", - "guilsinglright", - "oe", - "bullet", - "zcaron", - "Ydieresis", - "space", - "exclamdown", - "cent", - "sterling", - "currency", - "yen", - "brokenbar", - "section", - "dieresis", - "copyright", - "ordfeminine", - "guillemotleft", - "logicalnot", - "hyphen", - "registered", - "macron", - "degree", - "plusminus", - "twosuperior", - "threesuperior", - "acute", - "mu", - "paragraph", - "periodcentered", - "cedilla", - "onesuperior", - "ordmasculine", - "guillemotright", - "onequarter", - "onehalf", - "threequarters", - "questiondown", - "Agrave", - "Aacute", - "Acircumflex", - "Atilde", - "Adieresis", - "Aring", - "AE", - "Ccedilla", - "Egrave", - "Eacute", - "Ecircumflex", - "Edieresis", - "Igrave", - "Iacute", - "Icircumflex", - "Idieresis", - "Eth", - "Ntilde", - "Ograve", - "Oacute", - "Ocircumflex", - "Otilde", - "Odieresis", - "multiply", - "Oslash", - "Ugrave", - "Uacute", - "Ucircumflex", - "Udieresis", - "Yacute", - "Thorn", - "germandbls", - "agrave", - "aacute", - "acircumflex", - "atilde", - "adieresis", - "aring", - "ae", - "ccedilla", - "egrave", - "eacute", - "ecircumflex", - "edieresis", - "igrave", - "iacute", - "icircumflex", - "idieresis", - "eth", - "ntilde", - "ograve", - "oacute", - "ocircumflex", - "otilde", - "odieresis", - "divide", - "oslash", - "ugrave", - "uacute", - "ucircumflex", - "udieresis", - "yacute", - "thorn", - "ydieresis", - ], - mi = [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "space", - "exclam", - "universal", - "numbersign", - "existential", - "percent", - "ampersand", - "suchthat", - "parenleft", - "parenright", - "asteriskmath", - "plus", - "comma", - "minus", - "period", - "slash", - "zero", - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "colon", - "semicolon", - "less", - "equal", - "greater", - "question", - "congruent", - "Alpha", - "Beta", - "Chi", - "Delta", - "Epsilon", - "Phi", - "Gamma", - "Eta", - "Iota", - "theta1", - "Kappa", - "Lambda", - "Mu", - "Nu", - "Omicron", - "Pi", - "Theta", - "Rho", - "Sigma", - "Tau", - "Upsilon", - "sigma1", - "Omega", - "Xi", - "Psi", - "Zeta", - "bracketleft", - "therefore", - "bracketright", - "perpendicular", - "underscore", - "radicalex", - "alpha", - "beta", - "chi", - "delta", - "epsilon", - "phi", - "gamma", - "eta", - "iota", - "phi1", - "kappa", - "lambda", - "mu", - "nu", - "omicron", - "pi", - "theta", - "rho", - "sigma", - "tau", - "upsilon", - "omega1", - "omega", - "xi", - "psi", - "zeta", - "braceleft", - "bar", - "braceright", - "similar", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "Euro", - "Upsilon1", - "minute", - "lessequal", - "fraction", - "infinity", - "florin", - "club", - "diamond", - "heart", - "spade", - "arrowboth", - "arrowleft", - "arrowup", - "arrowright", - "arrowdown", - "degree", - "plusminus", - "second", - "greaterequal", - "multiply", - "proportional", - "partialdiff", - "bullet", - "divide", - "notequal", - "equivalence", - "approxequal", - "ellipsis", - "arrowvertex", - "arrowhorizex", - "carriagereturn", - "aleph", - "Ifraktur", - "Rfraktur", - "weierstrass", - "circlemultiply", - "circleplus", - "emptyset", - "intersection", - "union", - "propersuperset", - "reflexsuperset", - "notsubset", - "propersubset", - "reflexsubset", - "element", - "notelement", - "angle", - "gradient", - "registerserif", - "copyrightserif", - "trademarkserif", - "product", - "radical", - "dotmath", - "logicalnot", - "logicaland", - "logicalor", - "arrowdblboth", - "arrowdblleft", - "arrowdblup", - "arrowdblright", - "arrowdbldown", - "lozenge", - "angleleft", - "registersans", - "copyrightsans", - "trademarksans", - "summation", - "parenlefttp", - "parenleftex", - "parenleftbt", - "bracketlefttp", - "bracketleftex", - "bracketleftbt", - "bracelefttp", - "braceleftmid", - "braceleftbt", - "braceex", - "", - "angleright", - "integral", - "integraltp", - "integralex", - "integralbt", - "parenrighttp", - "parenrightex", - "parenrightbt", - "bracketrighttp", - "bracketrightex", - "bracketrightbt", - "bracerighttp", - "bracerightmid", - "bracerightbt", - "", - ], - yi = [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "space", - "a1", - "a2", - "a202", - "a3", - "a4", - "a5", - "a119", - "a118", - "a117", - "a11", - "a12", - "a13", - "a14", - "a15", - "a16", - "a105", - "a17", - "a18", - "a19", - "a20", - "a21", - "a22", - "a23", - "a24", - "a25", - "a26", - "a27", - "a28", - "a6", - "a7", - "a8", - "a9", - "a10", - "a29", - "a30", - "a31", - "a32", - "a33", - "a34", - "a35", - "a36", - "a37", - "a38", - "a39", - "a40", - "a41", - "a42", - "a43", - "a44", - "a45", - "a46", - "a47", - "a48", - "a49", - "a50", - "a51", - "a52", - "a53", - "a54", - "a55", - "a56", - "a57", - "a58", - "a59", - "a60", - "a61", - "a62", - "a63", - "a64", - "a65", - "a66", - "a67", - "a68", - "a69", - "a70", - "a71", - "a72", - "a73", - "a74", - "a203", - "a75", - "a204", - "a76", - "a77", - "a78", - "a79", - "a81", - "a82", - "a83", - "a84", - "a97", - "a98", - "a99", - "a100", - "", - "a89", - "a90", - "a93", - "a94", - "a91", - "a92", - "a205", - "a85", - "a206", - "a86", - "a87", - "a88", - "a95", - "a96", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "a101", - "a102", - "a103", - "a104", - "a106", - "a107", - "a108", - "a112", - "a111", - "a110", - "a109", - "a120", - "a121", - "a122", - "a123", - "a124", - "a125", - "a126", - "a127", - "a128", - "a129", - "a130", - "a131", - "a132", - "a133", - "a134", - "a135", - "a136", - "a137", - "a138", - "a139", - "a140", - "a141", - "a142", - "a143", - "a144", - "a145", - "a146", - "a147", - "a148", - "a149", - "a150", - "a151", - "a152", - "a153", - "a154", - "a155", - "a156", - "a157", - "a158", - "a159", - "a160", - "a161", - "a163", - "a164", - "a196", - "a165", - "a192", - "a166", - "a167", - "a168", - "a169", - "a170", - "a171", - "a172", - "a173", - "a162", - "a174", - "a175", - "a176", - "a177", - "a178", - "a179", - "a193", - "a180", - "a199", - "a181", - "a200", - "a182", - "", - "a201", - "a183", - "a184", - "a197", - "a185", - "a194", - "a198", - "a186", - "a195", - "a187", - "a188", - "a189", - "a190", - "a191", - "", - ]; -function getEncoding(e) { - switch (e) { +} // ./src/core/charsets.js + +const ISOAdobeCharset = [ + ".notdef", + "space", + "exclam", + "quotedbl", + "numbersign", + "dollar", + "percent", + "ampersand", + "quoteright", + "parenleft", + "parenright", + "asterisk", + "plus", + "comma", + "hyphen", + "period", + "slash", + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "colon", + "semicolon", + "less", + "equal", + "greater", + "question", + "at", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "bracketleft", + "backslash", + "bracketright", + "asciicircum", + "underscore", + "quoteleft", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "braceleft", + "bar", + "braceright", + "asciitilde", + "exclamdown", + "cent", + "sterling", + "fraction", + "yen", + "florin", + "section", + "currency", + "quotesingle", + "quotedblleft", + "guillemotleft", + "guilsinglleft", + "guilsinglright", + "fi", + "fl", + "endash", + "dagger", + "daggerdbl", + "periodcentered", + "paragraph", + "bullet", + "quotesinglbase", + "quotedblbase", + "quotedblright", + "guillemotright", + "ellipsis", + "perthousand", + "questiondown", + "grave", + "acute", + "circumflex", + "tilde", + "macron", + "breve", + "dotaccent", + "dieresis", + "ring", + "cedilla", + "hungarumlaut", + "ogonek", + "caron", + "emdash", + "AE", + "ordfeminine", + "Lslash", + "Oslash", + "OE", + "ordmasculine", + "ae", + "dotlessi", + "lslash", + "oslash", + "oe", + "germandbls", + "onesuperior", + "logicalnot", + "mu", + "trademark", + "Eth", + "onehalf", + "plusminus", + "Thorn", + "onequarter", + "divide", + "brokenbar", + "degree", + "thorn", + "threequarters", + "twosuperior", + "registered", + "minus", + "eth", + "multiply", + "threesuperior", + "copyright", + "Aacute", + "Acircumflex", + "Adieresis", + "Agrave", + "Aring", + "Atilde", + "Ccedilla", + "Eacute", + "Ecircumflex", + "Edieresis", + "Egrave", + "Iacute", + "Icircumflex", + "Idieresis", + "Igrave", + "Ntilde", + "Oacute", + "Ocircumflex", + "Odieresis", + "Ograve", + "Otilde", + "Scaron", + "Uacute", + "Ucircumflex", + "Udieresis", + "Ugrave", + "Yacute", + "Ydieresis", + "Zcaron", + "aacute", + "acircumflex", + "adieresis", + "agrave", + "aring", + "atilde", + "ccedilla", + "eacute", + "ecircumflex", + "edieresis", + "egrave", + "iacute", + "icircumflex", + "idieresis", + "igrave", + "ntilde", + "oacute", + "ocircumflex", + "odieresis", + "ograve", + "otilde", + "scaron", + "uacute", + "ucircumflex", + "udieresis", + "ugrave", + "yacute", + "ydieresis", + "zcaron", +]; +const ExpertCharset = [ + ".notdef", + "space", + "exclamsmall", + "Hungarumlautsmall", + "dollaroldstyle", + "dollarsuperior", + "ampersandsmall", + "Acutesmall", + "parenleftsuperior", + "parenrightsuperior", + "twodotenleader", + "onedotenleader", + "comma", + "hyphen", + "period", + "fraction", + "zerooldstyle", + "oneoldstyle", + "twooldstyle", + "threeoldstyle", + "fouroldstyle", + "fiveoldstyle", + "sixoldstyle", + "sevenoldstyle", + "eightoldstyle", + "nineoldstyle", + "colon", + "semicolon", + "commasuperior", + "threequartersemdash", + "periodsuperior", + "questionsmall", + "asuperior", + "bsuperior", + "centsuperior", + "dsuperior", + "esuperior", + "isuperior", + "lsuperior", + "msuperior", + "nsuperior", + "osuperior", + "rsuperior", + "ssuperior", + "tsuperior", + "ff", + "fi", + "fl", + "ffi", + "ffl", + "parenleftinferior", + "parenrightinferior", + "Circumflexsmall", + "hyphensuperior", + "Gravesmall", + "Asmall", + "Bsmall", + "Csmall", + "Dsmall", + "Esmall", + "Fsmall", + "Gsmall", + "Hsmall", + "Ismall", + "Jsmall", + "Ksmall", + "Lsmall", + "Msmall", + "Nsmall", + "Osmall", + "Psmall", + "Qsmall", + "Rsmall", + "Ssmall", + "Tsmall", + "Usmall", + "Vsmall", + "Wsmall", + "Xsmall", + "Ysmall", + "Zsmall", + "colonmonetary", + "onefitted", + "rupiah", + "Tildesmall", + "exclamdownsmall", + "centoldstyle", + "Lslashsmall", + "Scaronsmall", + "Zcaronsmall", + "Dieresissmall", + "Brevesmall", + "Caronsmall", + "Dotaccentsmall", + "Macronsmall", + "figuredash", + "hypheninferior", + "Ogoneksmall", + "Ringsmall", + "Cedillasmall", + "onequarter", + "onehalf", + "threequarters", + "questiondownsmall", + "oneeighth", + "threeeighths", + "fiveeighths", + "seveneighths", + "onethird", + "twothirds", + "zerosuperior", + "onesuperior", + "twosuperior", + "threesuperior", + "foursuperior", + "fivesuperior", + "sixsuperior", + "sevensuperior", + "eightsuperior", + "ninesuperior", + "zeroinferior", + "oneinferior", + "twoinferior", + "threeinferior", + "fourinferior", + "fiveinferior", + "sixinferior", + "seveninferior", + "eightinferior", + "nineinferior", + "centinferior", + "dollarinferior", + "periodinferior", + "commainferior", + "Agravesmall", + "Aacutesmall", + "Acircumflexsmall", + "Atildesmall", + "Adieresissmall", + "Aringsmall", + "AEsmall", + "Ccedillasmall", + "Egravesmall", + "Eacutesmall", + "Ecircumflexsmall", + "Edieresissmall", + "Igravesmall", + "Iacutesmall", + "Icircumflexsmall", + "Idieresissmall", + "Ethsmall", + "Ntildesmall", + "Ogravesmall", + "Oacutesmall", + "Ocircumflexsmall", + "Otildesmall", + "Odieresissmall", + "OEsmall", + "Oslashsmall", + "Ugravesmall", + "Uacutesmall", + "Ucircumflexsmall", + "Udieresissmall", + "Yacutesmall", + "Thornsmall", + "Ydieresissmall", +]; +const ExpertSubsetCharset = [ + ".notdef", + "space", + "dollaroldstyle", + "dollarsuperior", + "parenleftsuperior", + "parenrightsuperior", + "twodotenleader", + "onedotenleader", + "comma", + "hyphen", + "period", + "fraction", + "zerooldstyle", + "oneoldstyle", + "twooldstyle", + "threeoldstyle", + "fouroldstyle", + "fiveoldstyle", + "sixoldstyle", + "sevenoldstyle", + "eightoldstyle", + "nineoldstyle", + "colon", + "semicolon", + "commasuperior", + "threequartersemdash", + "periodsuperior", + "asuperior", + "bsuperior", + "centsuperior", + "dsuperior", + "esuperior", + "isuperior", + "lsuperior", + "msuperior", + "nsuperior", + "osuperior", + "rsuperior", + "ssuperior", + "tsuperior", + "ff", + "fi", + "fl", + "ffi", + "ffl", + "parenleftinferior", + "parenrightinferior", + "hyphensuperior", + "colonmonetary", + "onefitted", + "rupiah", + "centoldstyle", + "figuredash", + "hypheninferior", + "onequarter", + "onehalf", + "threequarters", + "oneeighth", + "threeeighths", + "fiveeighths", + "seveneighths", + "onethird", + "twothirds", + "zerosuperior", + "onesuperior", + "twosuperior", + "threesuperior", + "foursuperior", + "fivesuperior", + "sixsuperior", + "sevensuperior", + "eightsuperior", + "ninesuperior", + "zeroinferior", + "oneinferior", + "twoinferior", + "threeinferior", + "fourinferior", + "fiveinferior", + "sixinferior", + "seveninferior", + "eightinferior", + "nineinferior", + "centinferior", + "dollarinferior", + "periodinferior", + "commainferior", +]; // ./src/core/encodings.js + +const ExpertEncoding = [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "space", + "exclamsmall", + "Hungarumlautsmall", + "", + "dollaroldstyle", + "dollarsuperior", + "ampersandsmall", + "Acutesmall", + "parenleftsuperior", + "parenrightsuperior", + "twodotenleader", + "onedotenleader", + "comma", + "hyphen", + "period", + "fraction", + "zerooldstyle", + "oneoldstyle", + "twooldstyle", + "threeoldstyle", + "fouroldstyle", + "fiveoldstyle", + "sixoldstyle", + "sevenoldstyle", + "eightoldstyle", + "nineoldstyle", + "colon", + "semicolon", + "commasuperior", + "threequartersemdash", + "periodsuperior", + "questionsmall", + "", + "asuperior", + "bsuperior", + "centsuperior", + "dsuperior", + "esuperior", + "", + "", + "", + "isuperior", + "", + "", + "lsuperior", + "msuperior", + "nsuperior", + "osuperior", + "", + "", + "rsuperior", + "ssuperior", + "tsuperior", + "", + "ff", + "fi", + "fl", + "ffi", + "ffl", + "parenleftinferior", + "", + "parenrightinferior", + "Circumflexsmall", + "hyphensuperior", + "Gravesmall", + "Asmall", + "Bsmall", + "Csmall", + "Dsmall", + "Esmall", + "Fsmall", + "Gsmall", + "Hsmall", + "Ismall", + "Jsmall", + "Ksmall", + "Lsmall", + "Msmall", + "Nsmall", + "Osmall", + "Psmall", + "Qsmall", + "Rsmall", + "Ssmall", + "Tsmall", + "Usmall", + "Vsmall", + "Wsmall", + "Xsmall", + "Ysmall", + "Zsmall", + "colonmonetary", + "onefitted", + "rupiah", + "Tildesmall", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "exclamdownsmall", + "centoldstyle", + "Lslashsmall", + "", + "", + "Scaronsmall", + "Zcaronsmall", + "Dieresissmall", + "Brevesmall", + "Caronsmall", + "", + "Dotaccentsmall", + "", + "", + "Macronsmall", + "", + "", + "figuredash", + "hypheninferior", + "", + "", + "Ogoneksmall", + "Ringsmall", + "Cedillasmall", + "", + "", + "", + "onequarter", + "onehalf", + "threequarters", + "questiondownsmall", + "oneeighth", + "threeeighths", + "fiveeighths", + "seveneighths", + "onethird", + "twothirds", + "", + "", + "zerosuperior", + "onesuperior", + "twosuperior", + "threesuperior", + "foursuperior", + "fivesuperior", + "sixsuperior", + "sevensuperior", + "eightsuperior", + "ninesuperior", + "zeroinferior", + "oneinferior", + "twoinferior", + "threeinferior", + "fourinferior", + "fiveinferior", + "sixinferior", + "seveninferior", + "eightinferior", + "nineinferior", + "centinferior", + "dollarinferior", + "periodinferior", + "commainferior", + "Agravesmall", + "Aacutesmall", + "Acircumflexsmall", + "Atildesmall", + "Adieresissmall", + "Aringsmall", + "AEsmall", + "Ccedillasmall", + "Egravesmall", + "Eacutesmall", + "Ecircumflexsmall", + "Edieresissmall", + "Igravesmall", + "Iacutesmall", + "Icircumflexsmall", + "Idieresissmall", + "Ethsmall", + "Ntildesmall", + "Ogravesmall", + "Oacutesmall", + "Ocircumflexsmall", + "Otildesmall", + "Odieresissmall", + "OEsmall", + "Oslashsmall", + "Ugravesmall", + "Uacutesmall", + "Ucircumflexsmall", + "Udieresissmall", + "Yacutesmall", + "Thornsmall", + "Ydieresissmall", +]; +const MacExpertEncoding = [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "space", + "exclamsmall", + "Hungarumlautsmall", + "centoldstyle", + "dollaroldstyle", + "dollarsuperior", + "ampersandsmall", + "Acutesmall", + "parenleftsuperior", + "parenrightsuperior", + "twodotenleader", + "onedotenleader", + "comma", + "hyphen", + "period", + "fraction", + "zerooldstyle", + "oneoldstyle", + "twooldstyle", + "threeoldstyle", + "fouroldstyle", + "fiveoldstyle", + "sixoldstyle", + "sevenoldstyle", + "eightoldstyle", + "nineoldstyle", + "colon", + "semicolon", + "", + "threequartersemdash", + "", + "questionsmall", + "", + "", + "", + "", + "Ethsmall", + "", + "", + "onequarter", + "onehalf", + "threequarters", + "oneeighth", + "threeeighths", + "fiveeighths", + "seveneighths", + "onethird", + "twothirds", + "", + "", + "", + "", + "", + "", + "ff", + "fi", + "fl", + "ffi", + "ffl", + "parenleftinferior", + "", + "parenrightinferior", + "Circumflexsmall", + "hypheninferior", + "Gravesmall", + "Asmall", + "Bsmall", + "Csmall", + "Dsmall", + "Esmall", + "Fsmall", + "Gsmall", + "Hsmall", + "Ismall", + "Jsmall", + "Ksmall", + "Lsmall", + "Msmall", + "Nsmall", + "Osmall", + "Psmall", + "Qsmall", + "Rsmall", + "Ssmall", + "Tsmall", + "Usmall", + "Vsmall", + "Wsmall", + "Xsmall", + "Ysmall", + "Zsmall", + "colonmonetary", + "onefitted", + "rupiah", + "Tildesmall", + "", + "", + "asuperior", + "centsuperior", + "", + "", + "", + "", + "Aacutesmall", + "Agravesmall", + "Acircumflexsmall", + "Adieresissmall", + "Atildesmall", + "Aringsmall", + "Ccedillasmall", + "Eacutesmall", + "Egravesmall", + "Ecircumflexsmall", + "Edieresissmall", + "Iacutesmall", + "Igravesmall", + "Icircumflexsmall", + "Idieresissmall", + "Ntildesmall", + "Oacutesmall", + "Ogravesmall", + "Ocircumflexsmall", + "Odieresissmall", + "Otildesmall", + "Uacutesmall", + "Ugravesmall", + "Ucircumflexsmall", + "Udieresissmall", + "", + "eightsuperior", + "fourinferior", + "threeinferior", + "sixinferior", + "eightinferior", + "seveninferior", + "Scaronsmall", + "", + "centinferior", + "twoinferior", + "", + "Dieresissmall", + "", + "Caronsmall", + "osuperior", + "fiveinferior", + "", + "commainferior", + "periodinferior", + "Yacutesmall", + "", + "dollarinferior", + "", + "", + "Thornsmall", + "", + "nineinferior", + "zeroinferior", + "Zcaronsmall", + "AEsmall", + "Oslashsmall", + "questiondownsmall", + "oneinferior", + "Lslashsmall", + "", + "", + "", + "", + "", + "", + "Cedillasmall", + "", + "", + "", + "", + "", + "OEsmall", + "figuredash", + "hyphensuperior", + "", + "", + "", + "", + "exclamdownsmall", + "", + "Ydieresissmall", + "", + "onesuperior", + "twosuperior", + "threesuperior", + "foursuperior", + "fivesuperior", + "sixsuperior", + "sevensuperior", + "ninesuperior", + "zerosuperior", + "", + "esuperior", + "rsuperior", + "tsuperior", + "", + "", + "isuperior", + "ssuperior", + "dsuperior", + "", + "", + "", + "", + "", + "lsuperior", + "Ogoneksmall", + "Brevesmall", + "Macronsmall", + "bsuperior", + "nsuperior", + "msuperior", + "commasuperior", + "periodsuperior", + "Dotaccentsmall", + "Ringsmall", + "", + "", + "", + "", +]; +const MacRomanEncoding = [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "space", + "exclam", + "quotedbl", + "numbersign", + "dollar", + "percent", + "ampersand", + "quotesingle", + "parenleft", + "parenright", + "asterisk", + "plus", + "comma", + "hyphen", + "period", + "slash", + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "colon", + "semicolon", + "less", + "equal", + "greater", + "question", + "at", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "bracketleft", + "backslash", + "bracketright", + "asciicircum", + "underscore", + "grave", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "braceleft", + "bar", + "braceright", + "asciitilde", + "", + "Adieresis", + "Aring", + "Ccedilla", + "Eacute", + "Ntilde", + "Odieresis", + "Udieresis", + "aacute", + "agrave", + "acircumflex", + "adieresis", + "atilde", + "aring", + "ccedilla", + "eacute", + "egrave", + "ecircumflex", + "edieresis", + "iacute", + "igrave", + "icircumflex", + "idieresis", + "ntilde", + "oacute", + "ograve", + "ocircumflex", + "odieresis", + "otilde", + "uacute", + "ugrave", + "ucircumflex", + "udieresis", + "dagger", + "degree", + "cent", + "sterling", + "section", + "bullet", + "paragraph", + "germandbls", + "registered", + "copyright", + "trademark", + "acute", + "dieresis", + "notequal", + "AE", + "Oslash", + "infinity", + "plusminus", + "lessequal", + "greaterequal", + "yen", + "mu", + "partialdiff", + "summation", + "product", + "pi", + "integral", + "ordfeminine", + "ordmasculine", + "Omega", + "ae", + "oslash", + "questiondown", + "exclamdown", + "logicalnot", + "radical", + "florin", + "approxequal", + "Delta", + "guillemotleft", + "guillemotright", + "ellipsis", + "space", + "Agrave", + "Atilde", + "Otilde", + "OE", + "oe", + "endash", + "emdash", + "quotedblleft", + "quotedblright", + "quoteleft", + "quoteright", + "divide", + "lozenge", + "ydieresis", + "Ydieresis", + "fraction", + "currency", + "guilsinglleft", + "guilsinglright", + "fi", + "fl", + "daggerdbl", + "periodcentered", + "quotesinglbase", + "quotedblbase", + "perthousand", + "Acircumflex", + "Ecircumflex", + "Aacute", + "Edieresis", + "Egrave", + "Iacute", + "Icircumflex", + "Idieresis", + "Igrave", + "Oacute", + "Ocircumflex", + "apple", + "Ograve", + "Uacute", + "Ucircumflex", + "Ugrave", + "dotlessi", + "circumflex", + "tilde", + "macron", + "breve", + "dotaccent", + "ring", + "cedilla", + "hungarumlaut", + "ogonek", + "caron", +]; +const StandardEncoding = [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "space", + "exclam", + "quotedbl", + "numbersign", + "dollar", + "percent", + "ampersand", + "quoteright", + "parenleft", + "parenright", + "asterisk", + "plus", + "comma", + "hyphen", + "period", + "slash", + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "colon", + "semicolon", + "less", + "equal", + "greater", + "question", + "at", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "bracketleft", + "backslash", + "bracketright", + "asciicircum", + "underscore", + "quoteleft", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "braceleft", + "bar", + "braceright", + "asciitilde", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "exclamdown", + "cent", + "sterling", + "fraction", + "yen", + "florin", + "section", + "currency", + "quotesingle", + "quotedblleft", + "guillemotleft", + "guilsinglleft", + "guilsinglright", + "fi", + "fl", + "", + "endash", + "dagger", + "daggerdbl", + "periodcentered", + "", + "paragraph", + "bullet", + "quotesinglbase", + "quotedblbase", + "quotedblright", + "guillemotright", + "ellipsis", + "perthousand", + "", + "questiondown", + "", + "grave", + "acute", + "circumflex", + "tilde", + "macron", + "breve", + "dotaccent", + "dieresis", + "", + "ring", + "cedilla", + "", + "hungarumlaut", + "ogonek", + "caron", + "emdash", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "AE", + "", + "ordfeminine", + "", + "", + "", + "", + "Lslash", + "Oslash", + "OE", + "ordmasculine", + "", + "", + "", + "", + "", + "ae", + "", + "", + "", + "dotlessi", + "", + "", + "lslash", + "oslash", + "oe", + "germandbls", + "", + "", + "", + "", +]; +const WinAnsiEncoding = [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "space", + "exclam", + "quotedbl", + "numbersign", + "dollar", + "percent", + "ampersand", + "quotesingle", + "parenleft", + "parenright", + "asterisk", + "plus", + "comma", + "hyphen", + "period", + "slash", + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "colon", + "semicolon", + "less", + "equal", + "greater", + "question", + "at", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "bracketleft", + "backslash", + "bracketright", + "asciicircum", + "underscore", + "grave", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "braceleft", + "bar", + "braceright", + "asciitilde", + "bullet", + "Euro", + "bullet", + "quotesinglbase", + "florin", + "quotedblbase", + "ellipsis", + "dagger", + "daggerdbl", + "circumflex", + "perthousand", + "Scaron", + "guilsinglleft", + "OE", + "bullet", + "Zcaron", + "bullet", + "bullet", + "quoteleft", + "quoteright", + "quotedblleft", + "quotedblright", + "bullet", + "endash", + "emdash", + "tilde", + "trademark", + "scaron", + "guilsinglright", + "oe", + "bullet", + "zcaron", + "Ydieresis", + "space", + "exclamdown", + "cent", + "sterling", + "currency", + "yen", + "brokenbar", + "section", + "dieresis", + "copyright", + "ordfeminine", + "guillemotleft", + "logicalnot", + "hyphen", + "registered", + "macron", + "degree", + "plusminus", + "twosuperior", + "threesuperior", + "acute", + "mu", + "paragraph", + "periodcentered", + "cedilla", + "onesuperior", + "ordmasculine", + "guillemotright", + "onequarter", + "onehalf", + "threequarters", + "questiondown", + "Agrave", + "Aacute", + "Acircumflex", + "Atilde", + "Adieresis", + "Aring", + "AE", + "Ccedilla", + "Egrave", + "Eacute", + "Ecircumflex", + "Edieresis", + "Igrave", + "Iacute", + "Icircumflex", + "Idieresis", + "Eth", + "Ntilde", + "Ograve", + "Oacute", + "Ocircumflex", + "Otilde", + "Odieresis", + "multiply", + "Oslash", + "Ugrave", + "Uacute", + "Ucircumflex", + "Udieresis", + "Yacute", + "Thorn", + "germandbls", + "agrave", + "aacute", + "acircumflex", + "atilde", + "adieresis", + "aring", + "ae", + "ccedilla", + "egrave", + "eacute", + "ecircumflex", + "edieresis", + "igrave", + "iacute", + "icircumflex", + "idieresis", + "eth", + "ntilde", + "ograve", + "oacute", + "ocircumflex", + "otilde", + "odieresis", + "divide", + "oslash", + "ugrave", + "uacute", + "ucircumflex", + "udieresis", + "yacute", + "thorn", + "ydieresis", +]; +const SymbolSetEncoding = [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "space", + "exclam", + "universal", + "numbersign", + "existential", + "percent", + "ampersand", + "suchthat", + "parenleft", + "parenright", + "asteriskmath", + "plus", + "comma", + "minus", + "period", + "slash", + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "colon", + "semicolon", + "less", + "equal", + "greater", + "question", + "congruent", + "Alpha", + "Beta", + "Chi", + "Delta", + "Epsilon", + "Phi", + "Gamma", + "Eta", + "Iota", + "theta1", + "Kappa", + "Lambda", + "Mu", + "Nu", + "Omicron", + "Pi", + "Theta", + "Rho", + "Sigma", + "Tau", + "Upsilon", + "sigma1", + "Omega", + "Xi", + "Psi", + "Zeta", + "bracketleft", + "therefore", + "bracketright", + "perpendicular", + "underscore", + "radicalex", + "alpha", + "beta", + "chi", + "delta", + "epsilon", + "phi", + "gamma", + "eta", + "iota", + "phi1", + "kappa", + "lambda", + "mu", + "nu", + "omicron", + "pi", + "theta", + "rho", + "sigma", + "tau", + "upsilon", + "omega1", + "omega", + "xi", + "psi", + "zeta", + "braceleft", + "bar", + "braceright", + "similar", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "Euro", + "Upsilon1", + "minute", + "lessequal", + "fraction", + "infinity", + "florin", + "club", + "diamond", + "heart", + "spade", + "arrowboth", + "arrowleft", + "arrowup", + "arrowright", + "arrowdown", + "degree", + "plusminus", + "second", + "greaterequal", + "multiply", + "proportional", + "partialdiff", + "bullet", + "divide", + "notequal", + "equivalence", + "approxequal", + "ellipsis", + "arrowvertex", + "arrowhorizex", + "carriagereturn", + "aleph", + "Ifraktur", + "Rfraktur", + "weierstrass", + "circlemultiply", + "circleplus", + "emptyset", + "intersection", + "union", + "propersuperset", + "reflexsuperset", + "notsubset", + "propersubset", + "reflexsubset", + "element", + "notelement", + "angle", + "gradient", + "registerserif", + "copyrightserif", + "trademarkserif", + "product", + "radical", + "dotmath", + "logicalnot", + "logicaland", + "logicalor", + "arrowdblboth", + "arrowdblleft", + "arrowdblup", + "arrowdblright", + "arrowdbldown", + "lozenge", + "angleleft", + "registersans", + "copyrightsans", + "trademarksans", + "summation", + "parenlefttp", + "parenleftex", + "parenleftbt", + "bracketlefttp", + "bracketleftex", + "bracketleftbt", + "bracelefttp", + "braceleftmid", + "braceleftbt", + "braceex", + "", + "angleright", + "integral", + "integraltp", + "integralex", + "integralbt", + "parenrighttp", + "parenrightex", + "parenrightbt", + "bracketrighttp", + "bracketrightex", + "bracketrightbt", + "bracerighttp", + "bracerightmid", + "bracerightbt", + "", +]; +const ZapfDingbatsEncoding = [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "space", + "a1", + "a2", + "a202", + "a3", + "a4", + "a5", + "a119", + "a118", + "a117", + "a11", + "a12", + "a13", + "a14", + "a15", + "a16", + "a105", + "a17", + "a18", + "a19", + "a20", + "a21", + "a22", + "a23", + "a24", + "a25", + "a26", + "a27", + "a28", + "a6", + "a7", + "a8", + "a9", + "a10", + "a29", + "a30", + "a31", + "a32", + "a33", + "a34", + "a35", + "a36", + "a37", + "a38", + "a39", + "a40", + "a41", + "a42", + "a43", + "a44", + "a45", + "a46", + "a47", + "a48", + "a49", + "a50", + "a51", + "a52", + "a53", + "a54", + "a55", + "a56", + "a57", + "a58", + "a59", + "a60", + "a61", + "a62", + "a63", + "a64", + "a65", + "a66", + "a67", + "a68", + "a69", + "a70", + "a71", + "a72", + "a73", + "a74", + "a203", + "a75", + "a204", + "a76", + "a77", + "a78", + "a79", + "a81", + "a82", + "a83", + "a84", + "a97", + "a98", + "a99", + "a100", + "", + "a89", + "a90", + "a93", + "a94", + "a91", + "a92", + "a205", + "a85", + "a206", + "a86", + "a87", + "a88", + "a95", + "a96", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "a101", + "a102", + "a103", + "a104", + "a106", + "a107", + "a108", + "a112", + "a111", + "a110", + "a109", + "a120", + "a121", + "a122", + "a123", + "a124", + "a125", + "a126", + "a127", + "a128", + "a129", + "a130", + "a131", + "a132", + "a133", + "a134", + "a135", + "a136", + "a137", + "a138", + "a139", + "a140", + "a141", + "a142", + "a143", + "a144", + "a145", + "a146", + "a147", + "a148", + "a149", + "a150", + "a151", + "a152", + "a153", + "a154", + "a155", + "a156", + "a157", + "a158", + "a159", + "a160", + "a161", + "a163", + "a164", + "a196", + "a165", + "a192", + "a166", + "a167", + "a168", + "a169", + "a170", + "a171", + "a172", + "a173", + "a162", + "a174", + "a175", + "a176", + "a177", + "a178", + "a179", + "a193", + "a180", + "a199", + "a181", + "a200", + "a182", + "", + "a201", + "a183", + "a184", + "a197", + "a185", + "a194", + "a198", + "a186", + "a195", + "a187", + "a188", + "a189", + "a190", + "a191", + "", +]; +function getEncoding(encodingName) { + switch (encodingName) { case "WinAnsiEncoding": - return pi; + return WinAnsiEncoding; case "StandardEncoding": - return fi; + return StandardEncoding; case "MacRomanEncoding": - return di; + return MacRomanEncoding; case "SymbolSetEncoding": - return mi; + return SymbolSetEncoding; case "ZapfDingbatsEncoding": - return yi; + return ZapfDingbatsEncoding; case "ExpertEncoding": - return Ei; + return ExpertEncoding; case "MacExpertEncoding": - return ui; + return MacExpertEncoding; default: return null; } -} -const wi = [ - ".notdef", - "space", - "exclam", - "quotedbl", - "numbersign", - "dollar", - "percent", - "ampersand", - "quoteright", - "parenleft", - "parenright", - "asterisk", - "plus", - "comma", - "hyphen", - "period", - "slash", - "zero", - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "colon", - "semicolon", - "less", - "equal", - "greater", - "question", - "at", - "A", - "B", - "C", - "D", - "E", - "F", - "G", - "H", - "I", - "J", - "K", - "L", - "M", - "N", - "O", - "P", - "Q", - "R", - "S", - "T", - "U", - "V", - "W", - "X", - "Y", - "Z", - "bracketleft", - "backslash", - "bracketright", - "asciicircum", - "underscore", - "quoteleft", - "a", - "b", - "c", - "d", - "e", - "f", - "g", - "h", - "i", - "j", - "k", - "l", - "m", - "n", - "o", - "p", - "q", - "r", - "s", - "t", - "u", - "v", - "w", - "x", - "y", - "z", - "braceleft", - "bar", - "braceright", - "asciitilde", - "exclamdown", - "cent", - "sterling", - "fraction", - "yen", - "florin", - "section", - "currency", - "quotesingle", - "quotedblleft", - "guillemotleft", - "guilsinglleft", - "guilsinglright", - "fi", - "fl", - "endash", - "dagger", - "daggerdbl", - "periodcentered", - "paragraph", - "bullet", - "quotesinglbase", - "quotedblbase", - "quotedblright", - "guillemotright", - "ellipsis", - "perthousand", - "questiondown", - "grave", - "acute", - "circumflex", - "tilde", - "macron", - "breve", - "dotaccent", - "dieresis", - "ring", - "cedilla", - "hungarumlaut", - "ogonek", - "caron", - "emdash", - "AE", - "ordfeminine", - "Lslash", - "Oslash", - "OE", - "ordmasculine", - "ae", - "dotlessi", - "lslash", - "oslash", - "oe", - "germandbls", - "onesuperior", - "logicalnot", - "mu", - "trademark", - "Eth", - "onehalf", - "plusminus", - "Thorn", - "onequarter", - "divide", - "brokenbar", - "degree", - "thorn", - "threequarters", - "twosuperior", - "registered", - "minus", - "eth", - "multiply", - "threesuperior", - "copyright", - "Aacute", - "Acircumflex", - "Adieresis", - "Agrave", - "Aring", - "Atilde", - "Ccedilla", - "Eacute", - "Ecircumflex", - "Edieresis", - "Egrave", - "Iacute", - "Icircumflex", - "Idieresis", - "Igrave", - "Ntilde", - "Oacute", - "Ocircumflex", - "Odieresis", - "Ograve", - "Otilde", - "Scaron", - "Uacute", - "Ucircumflex", - "Udieresis", - "Ugrave", - "Yacute", - "Ydieresis", - "Zcaron", - "aacute", - "acircumflex", - "adieresis", - "agrave", - "aring", - "atilde", - "ccedilla", - "eacute", - "ecircumflex", - "edieresis", - "egrave", - "iacute", - "icircumflex", - "idieresis", - "igrave", - "ntilde", - "oacute", - "ocircumflex", - "odieresis", - "ograve", - "otilde", - "scaron", - "uacute", - "ucircumflex", - "udieresis", - "ugrave", - "yacute", - "ydieresis", - "zcaron", - "exclamsmall", - "Hungarumlautsmall", - "dollaroldstyle", - "dollarsuperior", - "ampersandsmall", - "Acutesmall", - "parenleftsuperior", - "parenrightsuperior", - "twodotenleader", - "onedotenleader", - "zerooldstyle", - "oneoldstyle", - "twooldstyle", - "threeoldstyle", - "fouroldstyle", - "fiveoldstyle", - "sixoldstyle", - "sevenoldstyle", - "eightoldstyle", - "nineoldstyle", - "commasuperior", - "threequartersemdash", - "periodsuperior", - "questionsmall", - "asuperior", - "bsuperior", - "centsuperior", - "dsuperior", - "esuperior", - "isuperior", - "lsuperior", - "msuperior", - "nsuperior", - "osuperior", - "rsuperior", - "ssuperior", - "tsuperior", - "ff", - "ffi", - "ffl", - "parenleftinferior", - "parenrightinferior", - "Circumflexsmall", - "hyphensuperior", - "Gravesmall", - "Asmall", - "Bsmall", - "Csmall", - "Dsmall", - "Esmall", - "Fsmall", - "Gsmall", - "Hsmall", - "Ismall", - "Jsmall", - "Ksmall", - "Lsmall", - "Msmall", - "Nsmall", - "Osmall", - "Psmall", - "Qsmall", - "Rsmall", - "Ssmall", - "Tsmall", - "Usmall", - "Vsmall", - "Wsmall", - "Xsmall", - "Ysmall", - "Zsmall", - "colonmonetary", - "onefitted", - "rupiah", - "Tildesmall", - "exclamdownsmall", - "centoldstyle", - "Lslashsmall", - "Scaronsmall", - "Zcaronsmall", - "Dieresissmall", - "Brevesmall", - "Caronsmall", - "Dotaccentsmall", - "Macronsmall", - "figuredash", - "hypheninferior", - "Ogoneksmall", - "Ringsmall", - "Cedillasmall", - "questiondownsmall", - "oneeighth", - "threeeighths", - "fiveeighths", - "seveneighths", - "onethird", - "twothirds", - "zerosuperior", - "foursuperior", - "fivesuperior", - "sixsuperior", - "sevensuperior", - "eightsuperior", - "ninesuperior", - "zeroinferior", - "oneinferior", - "twoinferior", - "threeinferior", - "fourinferior", - "fiveinferior", - "sixinferior", - "seveninferior", - "eightinferior", - "nineinferior", - "centinferior", - "dollarinferior", - "periodinferior", - "commainferior", - "Agravesmall", - "Aacutesmall", - "Acircumflexsmall", - "Atildesmall", - "Adieresissmall", - "Aringsmall", - "AEsmall", - "Ccedillasmall", - "Egravesmall", - "Eacutesmall", - "Ecircumflexsmall", - "Edieresissmall", - "Igravesmall", - "Iacutesmall", - "Icircumflexsmall", - "Idieresissmall", - "Ethsmall", - "Ntildesmall", - "Ogravesmall", - "Oacutesmall", - "Ocircumflexsmall", - "Otildesmall", - "Odieresissmall", - "OEsmall", - "Oslashsmall", - "Ugravesmall", - "Uacutesmall", - "Ucircumflexsmall", - "Udieresissmall", - "Yacutesmall", - "Thornsmall", - "Ydieresissmall", - "001.000", - "001.001", - "001.002", - "001.003", - "Black", - "Bold", - "Book", - "Light", - "Medium", - "Regular", - "Roman", - "Semibold", - ], - Di = 391, - bi = [ - null, - { id: "hstem", min: 2, stackClearing: !0, stem: !0 }, - null, - { id: "vstem", min: 2, stackClearing: !0, stem: !0 }, - { id: "vmoveto", min: 1, stackClearing: !0 }, - { id: "rlineto", min: 2, resetStack: !0 }, - { id: "hlineto", min: 1, resetStack: !0 }, - { id: "vlineto", min: 1, resetStack: !0 }, - { id: "rrcurveto", min: 6, resetStack: !0 }, - null, - { id: "callsubr", min: 1, undefStack: !0 }, - { id: "return", min: 0, undefStack: !0 }, - null, - null, - { id: "endchar", min: 0, stackClearing: !0 }, - null, - null, - null, - { id: "hstemhm", min: 2, stackClearing: !0, stem: !0 }, - { id: "hintmask", min: 0, stackClearing: !0 }, - { id: "cntrmask", min: 0, stackClearing: !0 }, - { id: "rmoveto", min: 2, stackClearing: !0 }, - { id: "hmoveto", min: 1, stackClearing: !0 }, - { id: "vstemhm", min: 2, stackClearing: !0, stem: !0 }, - { id: "rcurveline", min: 8, resetStack: !0 }, - { id: "rlinecurve", min: 8, resetStack: !0 }, - { id: "vvcurveto", min: 4, resetStack: !0 }, - { id: "hhcurveto", min: 4, resetStack: !0 }, - null, - { id: "callgsubr", min: 1, undefStack: !0 }, - { id: "vhcurveto", min: 4, resetStack: !0 }, - { id: "hvcurveto", min: 4, resetStack: !0 }, - ], - Fi = [ - null, - null, - null, - { id: "and", min: 2, stackDelta: -1 }, - { id: "or", min: 2, stackDelta: -1 }, - { id: "not", min: 1, stackDelta: 0 }, - null, - null, - null, - { id: "abs", min: 1, stackDelta: 0 }, - { - id: "add", - min: 2, - stackDelta: -1, - stackFn(e, t) { - e[t - 2] = e[t - 2] + e[t - 1]; - }, +} // ./src/core/cff_parser.js + +const MAX_SUBR_NESTING = 10; +const CFFStandardStrings = [ + ".notdef", + "space", + "exclam", + "quotedbl", + "numbersign", + "dollar", + "percent", + "ampersand", + "quoteright", + "parenleft", + "parenright", + "asterisk", + "plus", + "comma", + "hyphen", + "period", + "slash", + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "colon", + "semicolon", + "less", + "equal", + "greater", + "question", + "at", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "bracketleft", + "backslash", + "bracketright", + "asciicircum", + "underscore", + "quoteleft", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "braceleft", + "bar", + "braceright", + "asciitilde", + "exclamdown", + "cent", + "sterling", + "fraction", + "yen", + "florin", + "section", + "currency", + "quotesingle", + "quotedblleft", + "guillemotleft", + "guilsinglleft", + "guilsinglright", + "fi", + "fl", + "endash", + "dagger", + "daggerdbl", + "periodcentered", + "paragraph", + "bullet", + "quotesinglbase", + "quotedblbase", + "quotedblright", + "guillemotright", + "ellipsis", + "perthousand", + "questiondown", + "grave", + "acute", + "circumflex", + "tilde", + "macron", + "breve", + "dotaccent", + "dieresis", + "ring", + "cedilla", + "hungarumlaut", + "ogonek", + "caron", + "emdash", + "AE", + "ordfeminine", + "Lslash", + "Oslash", + "OE", + "ordmasculine", + "ae", + "dotlessi", + "lslash", + "oslash", + "oe", + "germandbls", + "onesuperior", + "logicalnot", + "mu", + "trademark", + "Eth", + "onehalf", + "plusminus", + "Thorn", + "onequarter", + "divide", + "brokenbar", + "degree", + "thorn", + "threequarters", + "twosuperior", + "registered", + "minus", + "eth", + "multiply", + "threesuperior", + "copyright", + "Aacute", + "Acircumflex", + "Adieresis", + "Agrave", + "Aring", + "Atilde", + "Ccedilla", + "Eacute", + "Ecircumflex", + "Edieresis", + "Egrave", + "Iacute", + "Icircumflex", + "Idieresis", + "Igrave", + "Ntilde", + "Oacute", + "Ocircumflex", + "Odieresis", + "Ograve", + "Otilde", + "Scaron", + "Uacute", + "Ucircumflex", + "Udieresis", + "Ugrave", + "Yacute", + "Ydieresis", + "Zcaron", + "aacute", + "acircumflex", + "adieresis", + "agrave", + "aring", + "atilde", + "ccedilla", + "eacute", + "ecircumflex", + "edieresis", + "egrave", + "iacute", + "icircumflex", + "idieresis", + "igrave", + "ntilde", + "oacute", + "ocircumflex", + "odieresis", + "ograve", + "otilde", + "scaron", + "uacute", + "ucircumflex", + "udieresis", + "ugrave", + "yacute", + "ydieresis", + "zcaron", + "exclamsmall", + "Hungarumlautsmall", + "dollaroldstyle", + "dollarsuperior", + "ampersandsmall", + "Acutesmall", + "parenleftsuperior", + "parenrightsuperior", + "twodotenleader", + "onedotenleader", + "zerooldstyle", + "oneoldstyle", + "twooldstyle", + "threeoldstyle", + "fouroldstyle", + "fiveoldstyle", + "sixoldstyle", + "sevenoldstyle", + "eightoldstyle", + "nineoldstyle", + "commasuperior", + "threequartersemdash", + "periodsuperior", + "questionsmall", + "asuperior", + "bsuperior", + "centsuperior", + "dsuperior", + "esuperior", + "isuperior", + "lsuperior", + "msuperior", + "nsuperior", + "osuperior", + "rsuperior", + "ssuperior", + "tsuperior", + "ff", + "ffi", + "ffl", + "parenleftinferior", + "parenrightinferior", + "Circumflexsmall", + "hyphensuperior", + "Gravesmall", + "Asmall", + "Bsmall", + "Csmall", + "Dsmall", + "Esmall", + "Fsmall", + "Gsmall", + "Hsmall", + "Ismall", + "Jsmall", + "Ksmall", + "Lsmall", + "Msmall", + "Nsmall", + "Osmall", + "Psmall", + "Qsmall", + "Rsmall", + "Ssmall", + "Tsmall", + "Usmall", + "Vsmall", + "Wsmall", + "Xsmall", + "Ysmall", + "Zsmall", + "colonmonetary", + "onefitted", + "rupiah", + "Tildesmall", + "exclamdownsmall", + "centoldstyle", + "Lslashsmall", + "Scaronsmall", + "Zcaronsmall", + "Dieresissmall", + "Brevesmall", + "Caronsmall", + "Dotaccentsmall", + "Macronsmall", + "figuredash", + "hypheninferior", + "Ogoneksmall", + "Ringsmall", + "Cedillasmall", + "questiondownsmall", + "oneeighth", + "threeeighths", + "fiveeighths", + "seveneighths", + "onethird", + "twothirds", + "zerosuperior", + "foursuperior", + "fivesuperior", + "sixsuperior", + "sevensuperior", + "eightsuperior", + "ninesuperior", + "zeroinferior", + "oneinferior", + "twoinferior", + "threeinferior", + "fourinferior", + "fiveinferior", + "sixinferior", + "seveninferior", + "eightinferior", + "nineinferior", + "centinferior", + "dollarinferior", + "periodinferior", + "commainferior", + "Agravesmall", + "Aacutesmall", + "Acircumflexsmall", + "Atildesmall", + "Adieresissmall", + "Aringsmall", + "AEsmall", + "Ccedillasmall", + "Egravesmall", + "Eacutesmall", + "Ecircumflexsmall", + "Edieresissmall", + "Igravesmall", + "Iacutesmall", + "Icircumflexsmall", + "Idieresissmall", + "Ethsmall", + "Ntildesmall", + "Ogravesmall", + "Oacutesmall", + "Ocircumflexsmall", + "Otildesmall", + "Odieresissmall", + "OEsmall", + "Oslashsmall", + "Ugravesmall", + "Uacutesmall", + "Ucircumflexsmall", + "Udieresissmall", + "Yacutesmall", + "Thornsmall", + "Ydieresissmall", + "001.000", + "001.001", + "001.002", + "001.003", + "Black", + "Bold", + "Book", + "Light", + "Medium", + "Regular", + "Roman", + "Semibold", +]; +const NUM_STANDARD_CFF_STRINGS = 391; +const CharstringValidationData = [ + null, + { + id: "hstem", + min: 2, + stackClearing: true, + stem: true, + }, + null, + { + id: "vstem", + min: 2, + stackClearing: true, + stem: true, + }, + { + id: "vmoveto", + min: 1, + stackClearing: true, + }, + { + id: "rlineto", + min: 2, + resetStack: true, + }, + { + id: "hlineto", + min: 1, + resetStack: true, + }, + { + id: "vlineto", + min: 1, + resetStack: true, + }, + { + id: "rrcurveto", + min: 6, + resetStack: true, + }, + null, + { + id: "callsubr", + min: 1, + undefStack: true, + }, + { + id: "return", + min: 0, + undefStack: true, + }, + null, + null, + { + id: "endchar", + min: 0, + stackClearing: true, + }, + null, + null, + null, + { + id: "hstemhm", + min: 2, + stackClearing: true, + stem: true, + }, + { + id: "hintmask", + min: 0, + stackClearing: true, + }, + { + id: "cntrmask", + min: 0, + stackClearing: true, + }, + { + id: "rmoveto", + min: 2, + stackClearing: true, + }, + { + id: "hmoveto", + min: 1, + stackClearing: true, + }, + { + id: "vstemhm", + min: 2, + stackClearing: true, + stem: true, + }, + { + id: "rcurveline", + min: 8, + resetStack: true, + }, + { + id: "rlinecurve", + min: 8, + resetStack: true, + }, + { + id: "vvcurveto", + min: 4, + resetStack: true, + }, + { + id: "hhcurveto", + min: 4, + resetStack: true, + }, + null, + { + id: "callgsubr", + min: 1, + undefStack: true, + }, + { + id: "vhcurveto", + min: 4, + resetStack: true, + }, + { + id: "hvcurveto", + min: 4, + resetStack: true, + }, +]; +const CharstringValidationData12 = [ + null, + null, + null, + { + id: "and", + min: 2, + stackDelta: -1, + }, + { + id: "or", + min: 2, + stackDelta: -1, + }, + { + id: "not", + min: 1, + stackDelta: 0, + }, + null, + null, + null, + { + id: "abs", + min: 1, + stackDelta: 0, + }, + { + id: "add", + min: 2, + stackDelta: -1, + stackFn(stack, index) { + stack[index - 2] = stack[index - 2] + stack[index - 1]; }, - { - id: "sub", - min: 2, - stackDelta: -1, - stackFn(e, t) { - e[t - 2] = e[t - 2] - e[t - 1]; - }, + }, + { + id: "sub", + min: 2, + stackDelta: -1, + stackFn(stack, index) { + stack[index - 2] = stack[index - 2] - stack[index - 1]; }, - { - id: "div", - min: 2, - stackDelta: -1, - stackFn(e, t) { - e[t - 2] = e[t - 2] / e[t - 1]; - }, + }, + { + id: "div", + min: 2, + stackDelta: -1, + stackFn(stack, index) { + stack[index - 2] = stack[index - 2] / stack[index - 1]; }, - null, - { - id: "neg", - min: 1, - stackDelta: 0, - stackFn(e, t) { - e[t - 1] = -e[t - 1]; - }, + }, + null, + { + id: "neg", + min: 1, + stackDelta: 0, + stackFn(stack, index) { + stack[index - 1] = -stack[index - 1]; }, - { id: "eq", min: 2, stackDelta: -1 }, - null, - null, - { id: "drop", min: 1, stackDelta: -1 }, - null, - { id: "put", min: 2, stackDelta: -2 }, - { id: "get", min: 1, stackDelta: 0 }, - { id: "ifelse", min: 4, stackDelta: -3 }, - { id: "random", min: 0, stackDelta: 1 }, - { - id: "mul", - min: 2, - stackDelta: -1, - stackFn(e, t) { - e[t - 2] = e[t - 2] * e[t - 1]; - }, + }, + { + id: "eq", + min: 2, + stackDelta: -1, + }, + null, + null, + { + id: "drop", + min: 1, + stackDelta: -1, + }, + null, + { + id: "put", + min: 2, + stackDelta: -2, + }, + { + id: "get", + min: 1, + stackDelta: 0, + }, + { + id: "ifelse", + min: 4, + stackDelta: -3, + }, + { + id: "random", + min: 0, + stackDelta: 1, + }, + { + id: "mul", + min: 2, + stackDelta: -1, + stackFn(stack, index) { + stack[index - 2] = stack[index - 2] * stack[index - 1]; }, - null, - { id: "sqrt", min: 1, stackDelta: 0 }, - { id: "dup", min: 1, stackDelta: 1 }, - { id: "exch", min: 2, stackDelta: 0 }, - { id: "index", min: 2, stackDelta: 0 }, - { id: "roll", min: 3, stackDelta: -2 }, - null, - null, - null, - { id: "hflex", min: 7, resetStack: !0 }, - { id: "flex", min: 13, resetStack: !0 }, - { id: "hflex1", min: 9, resetStack: !0 }, - { id: "flex1", min: 11, resetStack: !0 }, - ]; + }, + null, + { + id: "sqrt", + min: 1, + stackDelta: 0, + }, + { + id: "dup", + min: 1, + stackDelta: 1, + }, + { + id: "exch", + min: 2, + stackDelta: 0, + }, + { + id: "index", + min: 2, + stackDelta: 0, + }, + { + id: "roll", + min: 3, + stackDelta: -2, + }, + null, + null, + null, + { + id: "hflex", + min: 7, + resetStack: true, + }, + { + id: "flex", + min: 13, + resetStack: true, + }, + { + id: "hflex1", + min: 9, + resetStack: true, + }, + { + id: "flex1", + min: 11, + resetStack: true, + }, +]; class CFFParser { - constructor(e, t, i) { - this.bytes = e.getBytes(); - this.properties = t; - this.seacAnalysisEnabled = !!i; + constructor(file, properties, seacAnalysisEnabled) { + this.bytes = file.getBytes(); + this.properties = properties; + this.seacAnalysisEnabled = !!seacAnalysisEnabled; } parse() { - const e = this.properties, - t = new CFF(); - this.cff = t; - const i = this.parseHeader(), - a = this.parseIndex(i.endPos), - s = this.parseIndex(a.endPos), - r = this.parseIndex(s.endPos), - n = this.parseIndex(r.endPos), - g = this.parseDict(s.obj.get(0)), - o = this.createDict(CFFTopDict, g, t.strings); - t.header = i.obj; - t.names = this.parseNameIndex(a.obj); - t.strings = this.parseStringIndex(r.obj); - t.topDict = o; - t.globalSubrIndex = n.obj; - this.parsePrivateDict(t.topDict); - t.isCIDFont = o.hasName("ROS"); - const c = o.getByName("CharStrings"), - C = this.parseIndex(c).obj, - h = o.getByName("FontMatrix"); - h && (e.fontMatrix = h); - const l = o.getByName("FontBBox"); - if (l) { - e.ascent = Math.max(l[3], l[1]); - e.descent = Math.min(l[1], l[3]); - e.ascentScaled = !0; + const properties = this.properties; + const cff = new CFF(); + this.cff = cff; + const header = this.parseHeader(); + const nameIndex = this.parseIndex(header.endPos); + const topDictIndex = this.parseIndex(nameIndex.endPos); + const stringIndex = this.parseIndex(topDictIndex.endPos); + const globalSubrIndex = this.parseIndex(stringIndex.endPos); + const topDictParsed = this.parseDict(topDictIndex.obj.get(0)); + const topDict = this.createDict(CFFTopDict, topDictParsed, cff.strings); + cff.header = header.obj; + cff.names = this.parseNameIndex(nameIndex.obj); + cff.strings = this.parseStringIndex(stringIndex.obj); + cff.topDict = topDict; + cff.globalSubrIndex = globalSubrIndex.obj; + this.parsePrivateDict(cff.topDict); + cff.isCIDFont = topDict.hasName("ROS"); + const charStringOffset = topDict.getByName("CharStrings"); + const charStringIndex = this.parseIndex(charStringOffset).obj; + const fontMatrix = topDict.getByName("FontMatrix"); + if (fontMatrix) { + properties.fontMatrix = fontMatrix; } - let Q, E; - if (t.isCIDFont) { - const e = this.parseIndex(o.getByName("FDArray")).obj; - for (let i = 0, a = e.count; i < a; ++i) { - const a = e.get(i), - s = this.createDict(CFFTopDict, this.parseDict(a), t.strings); - this.parsePrivateDict(s); - t.fdArray.push(s); + const fontBBox = topDict.getByName("FontBBox"); + if (fontBBox) { + properties.ascent = Math.max(fontBBox[3], fontBBox[1]); + properties.descent = Math.min(fontBBox[1], fontBBox[3]); + properties.ascentScaled = true; + } + let charset, encoding; + if (cff.isCIDFont) { + const fdArrayIndex = this.parseIndex(topDict.getByName("FDArray")).obj; + for (let i = 0, ii = fdArrayIndex.count; i < ii; ++i) { + const dictRaw = fdArrayIndex.get(i); + const fontDict = this.createDict( + CFFTopDict, + this.parseDict(dictRaw), + cff.strings, + ); + this.parsePrivateDict(fontDict); + cff.fdArray.push(fontDict); } - E = null; - Q = this.parseCharsets(o.getByName("charset"), C.count, t.strings, !0); - t.fdSelect = this.parseFDSelect(o.getByName("FDSelect"), C.count); + encoding = null; + charset = this.parseCharsets( + topDict.getByName("charset"), + charStringIndex.count, + cff.strings, + true, + ); + cff.fdSelect = this.parseFDSelect( + topDict.getByName("FDSelect"), + charStringIndex.count, + ); } else { - Q = this.parseCharsets(o.getByName("charset"), C.count, t.strings, !1); - E = this.parseEncoding(o.getByName("Encoding"), e, t.strings, Q.charset); + charset = this.parseCharsets( + topDict.getByName("charset"), + charStringIndex.count, + cff.strings, + false, + ); + encoding = this.parseEncoding( + topDict.getByName("Encoding"), + properties, + cff.strings, + charset.charset, + ); } - t.charset = Q; - t.encoding = E; - const u = this.parseCharStrings({ - charStrings: C, - localSubrIndex: o.privateDict.subrsIndex, - globalSubrIndex: n.obj, - fdSelect: t.fdSelect, - fdArray: t.fdArray, - privateDict: o.privateDict, + cff.charset = charset; + cff.encoding = encoding; + const charStringsAndSeacs = this.parseCharStrings({ + charStrings: charStringIndex, + localSubrIndex: topDict.privateDict.subrsIndex, + globalSubrIndex: globalSubrIndex.obj, + fdSelect: cff.fdSelect, + fdArray: cff.fdArray, + privateDict: topDict.privateDict, }); - t.charStrings = u.charStrings; - t.seacs = u.seacs; - t.widths = u.widths; - return t; + cff.charStrings = charStringsAndSeacs.charStrings; + cff.seacs = charStringsAndSeacs.seacs; + cff.widths = charStringsAndSeacs.widths; + return cff; } parseHeader() { - let e = this.bytes; - const t = e.length; - let i = 0; - for (; i < t && 1 !== e[i]; ) ++i; - if (i >= t) throw new FormatError("Invalid CFF header"); - if (0 !== i) { - info("cff data is shifted"); - e = e.subarray(i); - this.bytes = e; + let bytes = this.bytes; + const bytesLength = bytes.length; + let offset = 0; + while (offset < bytesLength && bytes[offset] !== 1) { + ++offset; } - const a = e[0], - s = e[1], - r = e[2], - n = e[3]; - return { obj: new CFFHeader(a, s, r, n), endPos: r }; + if (offset >= bytesLength) { + throw new FormatError("Invalid CFF header"); + } + if (offset !== 0) { + info("cff data is shifted"); + bytes = bytes.subarray(offset); + this.bytes = bytes; + } + const major = bytes[0]; + const minor = bytes[1]; + const hdrSize = bytes[2]; + const offSize = bytes[3]; + const header = new CFFHeader(major, minor, hdrSize, offSize); + return { + obj: header, + endPos: hdrSize, + }; } - parseDict(e) { - let t = 0; + parseDict(dict) { + let pos = 0; function parseOperand() { - let i = e[t++]; - if (30 === i) - return (function parseFloatOperand() { - let i = ""; - const a = 15, - s = [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - ".", - "E", - "E-", - null, - "-", - ], - r = e.length; - for (; t < r; ) { - const r = e[t++], - n = r >> 4, - g = 15 & r; - if (n === a) break; - i += s[n]; - if (g === a) break; - i += s[g]; - } - return parseFloat(i); - })(); - if (28 === i) { - i = e[t++]; - i = ((i << 24) | (e[t++] << 16)) >> 16; - return i; + let value = dict[pos++]; + if (value === 30) { + return parseFloatOperand(); + } else if (value === 28) { + value = dict[pos++]; + value = ((value << 24) | (dict[pos++] << 16)) >> 16; + return value; + } else if (value === 29) { + value = dict[pos++]; + value = (value << 8) | dict[pos++]; + value = (value << 8) | dict[pos++]; + value = (value << 8) | dict[pos++]; + return value; + } else if (value >= 32 && value <= 246) { + return value - 139; + } else if (value >= 247 && value <= 250) { + return (value - 247) * 256 + dict[pos++] + 108; + } else if (value >= 251 && value <= 254) { + return -((value - 251) * 256) - dict[pos++] - 108; } - if (29 === i) { - i = e[t++]; - i = (i << 8) | e[t++]; - i = (i << 8) | e[t++]; - i = (i << 8) | e[t++]; - return i; - } - if (i >= 32 && i <= 246) return i - 139; - if (i >= 247 && i <= 250) return 256 * (i - 247) + e[t++] + 108; - if (i >= 251 && i <= 254) return -256 * (i - 251) - e[t++] - 108; - warn('CFFParser_parseDict: "' + i + '" is a reserved command.'); + warn('CFFParser_parseDict: "' + value + '" is a reserved command.'); return NaN; } - let i = []; - const a = []; - t = 0; - const s = e.length; - for (; t < s; ) { - let s = e[t]; - if (s <= 21) { - 12 === s && (s = (s << 8) | e[++t]); - a.push([s, i]); - i = []; - ++t; - } else i.push(parseOperand()); - } - return a; - } - parseIndex(e) { - const t = new CFFIndex(), - i = this.bytes, - a = (i[e++] << 8) | i[e++], - s = []; - let r, - n, - g = e; - if (0 !== a) { - const t = i[e++], - o = e + (a + 1) * t - 1; - for (r = 0, n = a + 1; r < n; ++r) { - let a = 0; - for (let s = 0; s < t; ++s) { - a <<= 8; - a += i[e++]; + function parseFloatOperand() { + let str = ""; + const eof = 15; + const lookup = [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + ".", + "E", + "E-", + null, + "-", + ]; + const length = dict.length; + while (pos < length) { + const b = dict[pos++]; + const b1 = b >> 4; + const b2 = b & 15; + if (b1 === eof) { + break; } - s.push(o + a); + str += lookup[b1]; + if (b2 === eof) { + break; + } + str += lookup[b2]; } - g = s[a]; + return parseFloat(str); } - for (r = 0, n = s.length - 1; r < n; ++r) { - const e = s[r], - a = s[r + 1]; - t.add(i.subarray(e, a)); - } - return { obj: t, endPos: g }; - } - parseNameIndex(e) { - const t = []; - for (let i = 0, a = e.count; i < a; ++i) { - const a = e.get(i); - t.push(bytesToString(a)); - } - return t; - } - parseStringIndex(e) { - const t = new CFFStrings(); - for (let i = 0, a = e.count; i < a; ++i) { - const a = e.get(i); - t.add(bytesToString(a)); - } - return t; - } - createDict(e, t, i) { - const a = new e(i); - for (const [e, i] of t) a.setByKey(e, i); - return a; - } - parseCharString(e, t, i, a) { - if (!t || e.callDepth > 10) return !1; - let s = e.stackSize; - const r = e.stack; - let n = t.length; - for (let g = 0; g < n; ) { - const o = t[g++]; - let c = null; - if (12 === o) { - const e = t[g++]; - if (0 === e) { - t[g - 2] = 139; - t[g - 1] = 22; - s = 0; - } else c = Fi[e]; - } else if (28 === o) { - r[s] = ((t[g] << 24) | (t[g + 1] << 16)) >> 16; - g += 2; - s++; - } else if (14 === o) { - if (s >= 4) { - s -= 4; - if (this.seacAnalysisEnabled) { - e.seac = r.slice(s, s + 4); - return !1; - } + let operands = []; + const entries = []; + pos = 0; + const end = dict.length; + while (pos < end) { + let b = dict[pos]; + if (b <= 21) { + if (b === 12) { + b = (b << 8) | dict[++pos]; } - c = bi[o]; - } else if (o >= 32 && o <= 246) { - r[s] = o - 139; - s++; - } else if (o >= 247 && o <= 254) { - r[s] = - o < 251 - ? ((o - 247) << 8) + t[g] + 108 - : -((o - 251) << 8) - t[g] - 108; - g++; - s++; - } else if (255 === o) { - r[s] = - ((t[g] << 24) | (t[g + 1] << 16) | (t[g + 2] << 8) | t[g + 3]) / - 65536; - g += 4; - s++; - } else if (19 === o || 20 === o) { - e.hints += s >> 1; - if (0 === e.hints) { - t.copyWithin(g - 1, g, -1); - g -= 1; - n -= 1; - continue; - } - g += (e.hints + 7) >> 3; - s %= 2; - c = bi[o]; + entries.push([b, operands]); + operands = []; + ++pos; } else { - if (10 === o || 29 === o) { - const t = 10 === o ? i : a; - if (!t) { - c = bi[o]; - warn("Missing subrsIndex for " + c.id); - return !1; + operands.push(parseOperand()); + } + } + return entries; + } + parseIndex(pos) { + const cffIndex = new CFFIndex(); + const bytes = this.bytes; + const count = (bytes[pos++] << 8) | bytes[pos++]; + const offsets = []; + let end = pos; + let i, ii; + if (count !== 0) { + const offsetSize = bytes[pos++]; + const startPos = pos + (count + 1) * offsetSize - 1; + for (i = 0, ii = count + 1; i < ii; ++i) { + let offset = 0; + for (let j = 0; j < offsetSize; ++j) { + offset <<= 8; + offset += bytes[pos++]; + } + offsets.push(startPos + offset); + } + end = offsets[count]; + } + for (i = 0, ii = offsets.length - 1; i < ii; ++i) { + const offsetStart = offsets[i]; + const offsetEnd = offsets[i + 1]; + cffIndex.add(bytes.subarray(offsetStart, offsetEnd)); + } + return { + obj: cffIndex, + endPos: end, + }; + } + parseNameIndex(index) { + const names = []; + for (let i = 0, ii = index.count; i < ii; ++i) { + const name = index.get(i); + names.push(bytesToString(name)); + } + return names; + } + parseStringIndex(index) { + const strings = new CFFStrings(); + for (let i = 0, ii = index.count; i < ii; ++i) { + const data = index.get(i); + strings.add(bytesToString(data)); + } + return strings; + } + createDict(Type, dict, strings) { + const cffDict = new Type(strings); + for (const [key, value] of dict) { + cffDict.setByKey(key, value); + } + return cffDict; + } + parseCharString(state, data, localSubrIndex, globalSubrIndex) { + if (!data || state.callDepth > MAX_SUBR_NESTING) { + return false; + } + let stackSize = state.stackSize; + const stack = state.stack; + let length = data.length; + for (let j = 0; j < length; ) { + const value = data[j++]; + let validationCommand = null; + if (value === 12) { + const q = data[j++]; + if (q === 0) { + data[j - 2] = 139; + data[j - 1] = 22; + stackSize = 0; + } else { + validationCommand = CharstringValidationData12[q]; + } + } else if (value === 28) { + stack[stackSize] = ((data[j] << 24) | (data[j + 1] << 16)) >> 16; + j += 2; + stackSize++; + } else if (value === 14) { + if (stackSize >= 4) { + stackSize -= 4; + if (this.seacAnalysisEnabled) { + state.seac = stack.slice(stackSize, stackSize + 4); + return false; } - let n = 32768; - t.count < 1240 ? (n = 107) : t.count < 33900 && (n = 1131); - const g = r[--s] + n; - if (g < 0 || g >= t.count || isNaN(g)) { - c = bi[o]; - warn("Out of bounds subrIndex for " + c.id); - return !1; - } - e.stackSize = s; - e.callDepth++; - if (!this.parseCharString(e, t.get(g), i, a)) return !1; - e.callDepth--; - s = e.stackSize; + } + validationCommand = CharstringValidationData[value]; + } else if (value >= 32 && value <= 246) { + stack[stackSize] = value - 139; + stackSize++; + } else if (value >= 247 && value <= 254) { + stack[stackSize] = + value < 251 + ? ((value - 247) << 8) + data[j] + 108 + : -((value - 251) << 8) - data[j] - 108; + j++; + stackSize++; + } else if (value === 255) { + stack[stackSize] = + ((data[j] << 24) | + (data[j + 1] << 16) | + (data[j + 2] << 8) | + data[j + 3]) / + 65536; + j += 4; + stackSize++; + } else if (value === 19 || value === 20) { + state.hints += stackSize >> 1; + if (state.hints === 0) { + data.copyWithin(j - 1, j, -1); + j -= 1; + length -= 1; continue; } - if (11 === o) { - e.stackSize = s; - return !0; + j += (state.hints + 7) >> 3; + stackSize %= 2; + validationCommand = CharstringValidationData[value]; + } else if (value === 10 || value === 29) { + const subrsIndex = value === 10 ? localSubrIndex : globalSubrIndex; + if (!subrsIndex) { + validationCommand = CharstringValidationData[value]; + warn("Missing subrsIndex for " + validationCommand.id); + return false; } - if (0 === o && g === t.length) { - t[g - 1] = 14; - c = bi[14]; - } else { - if (9 === o) { - t.copyWithin(g - 1, g, -1); - g -= 1; - n -= 1; - continue; - } - c = bi[o]; + let bias = 32768; + if (subrsIndex.count < 1240) { + bias = 107; + } else if (subrsIndex.count < 33900) { + bias = 1131; } + const subrNumber = stack[--stackSize] + bias; + if ( + subrNumber < 0 || + subrNumber >= subrsIndex.count || + isNaN(subrNumber) + ) { + validationCommand = CharstringValidationData[value]; + warn("Out of bounds subrIndex for " + validationCommand.id); + return false; + } + state.stackSize = stackSize; + state.callDepth++; + const valid = this.parseCharString( + state, + subrsIndex.get(subrNumber), + localSubrIndex, + globalSubrIndex, + ); + if (!valid) { + return false; + } + state.callDepth--; + stackSize = state.stackSize; + continue; + } else if (value === 11) { + state.stackSize = stackSize; + return true; + } else if (value === 0 && j === data.length) { + data[j - 1] = 14; + validationCommand = CharstringValidationData[14]; + } else if (value === 9) { + data.copyWithin(j - 1, j, -1); + j -= 1; + length -= 1; + continue; + } else { + validationCommand = CharstringValidationData[value]; } - if (c) { - if (c.stem) { - e.hints += s >> 1; - if (3 === o || 23 === o) e.hasVStems = !0; - else if (e.hasVStems && (1 === o || 18 === o)) { + if (validationCommand) { + if (validationCommand.stem) { + state.hints += stackSize >> 1; + if (value === 3 || value === 23) { + state.hasVStems = true; + } else if (state.hasVStems && (value === 1 || value === 18)) { warn("CFF stem hints are in wrong order"); - t[g - 1] = 1 === o ? 3 : 23; + data[j - 1] = value === 1 ? 3 : 23; } } - if ("min" in c && !e.undefStack && s < c.min) { - warn( - "Not enough parameters for " + - c.id + - "; actual: " + - s + - ", expected: " + - c.min, - ); - if (0 === s) { - t[g - 1] = 14; - return !0; + if ("min" in validationCommand) { + if (!state.undefStack && stackSize < validationCommand.min) { + warn( + "Not enough parameters for " + + validationCommand.id + + "; actual: " + + stackSize + + ", expected: " + + validationCommand.min, + ); + if (stackSize === 0) { + data[j - 1] = 14; + return true; + } + return false; } - return !1; } - if (e.firstStackClearing && c.stackClearing) { - e.firstStackClearing = !1; - s -= c.min; - s >= 2 && c.stem - ? (s %= 2) - : s > 1 && - warn("Found too many parameters for stack-clearing command"); - s > 0 && (e.width = r[s - 1]); + if (state.firstStackClearing && validationCommand.stackClearing) { + state.firstStackClearing = false; + stackSize -= validationCommand.min; + if (stackSize >= 2 && validationCommand.stem) { + stackSize %= 2; + } else if (stackSize > 1) { + warn("Found too many parameters for stack-clearing command"); + } + if (stackSize > 0) { + state.width = stack[stackSize - 1]; + } } - if ("stackDelta" in c) { - "stackFn" in c && c.stackFn(r, s); - s += c.stackDelta; - } else if (c.stackClearing) s = 0; - else if (c.resetStack) { - s = 0; - e.undefStack = !1; - } else if (c.undefStack) { - s = 0; - e.undefStack = !0; - e.firstStackClearing = !1; + if ("stackDelta" in validationCommand) { + if ("stackFn" in validationCommand) { + validationCommand.stackFn(stack, stackSize); + } + stackSize += validationCommand.stackDelta; + } else if (validationCommand.stackClearing) { + stackSize = 0; + } else if (validationCommand.resetStack) { + stackSize = 0; + state.undefStack = false; + } else if (validationCommand.undefStack) { + stackSize = 0; + state.undefStack = true; + state.firstStackClearing = false; } } } - n < t.length && t.fill(14, n); - e.stackSize = s; - return !0; + if (length < data.length) { + data.fill(14, length); + } + state.stackSize = stackSize; + return true; } parseCharStrings({ - charStrings: e, - localSubrIndex: t, - globalSubrIndex: i, - fdSelect: a, - fdArray: s, - privateDict: r, + charStrings, + localSubrIndex, + globalSubrIndex, + fdSelect, + fdArray, + privateDict, }) { - const n = [], - g = [], - o = e.count; - for (let c = 0; c < o; c++) { - const o = e.get(c), - C = { - callDepth: 0, - stackSize: 0, - stack: [], - undefStack: !0, - hints: 0, - firstStackClearing: !0, - seac: null, - width: null, - hasVStems: !1, - }; - let h = !0, - l = null, - Q = r; - if (a && s.length) { - const e = a.getFDIndex(c); - if (-1 === e) { + const seacs = []; + const widths = []; + const count = charStrings.count; + for (let i = 0; i < count; i++) { + const charstring = charStrings.get(i); + const state = { + callDepth: 0, + stackSize: 0, + stack: [], + undefStack: true, + hints: 0, + firstStackClearing: true, + seac: null, + width: null, + hasVStems: false, + }; + let valid = true; + let localSubrToUse = null; + let privateDictToUse = privateDict; + if (fdSelect && fdArray.length) { + const fdIndex = fdSelect.getFDIndex(i); + if (fdIndex === -1) { warn("Glyph index is not in fd select."); - h = !1; + valid = false; } - if (e >= s.length) { + if (fdIndex >= fdArray.length) { warn("Invalid fd index for glyph index."); - h = !1; + valid = false; } - if (h) { - Q = s[e].privateDict; - l = Q.subrsIndex; + if (valid) { + privateDictToUse = fdArray[fdIndex].privateDict; + localSubrToUse = privateDictToUse.subrsIndex; } - } else t && (l = t); - h && (h = this.parseCharString(C, o, l, i)); - if (null !== C.width) { - const e = Q.getByName("nominalWidthX"); - g[c] = e + C.width; - } else { - const e = Q.getByName("defaultWidthX"); - g[c] = e; + } else if (localSubrIndex) { + localSubrToUse = localSubrIndex; + } + if (valid) { + valid = this.parseCharString( + state, + charstring, + localSubrToUse, + globalSubrIndex, + ); + } + if (state.width !== null) { + const nominalWidth = privateDictToUse.getByName("nominalWidthX"); + widths[i] = nominalWidth + state.width; + } else { + const defaultWidth = privateDictToUse.getByName("defaultWidthX"); + widths[i] = defaultWidth; + } + if (state.seac !== null) { + seacs[i] = state.seac; + } + if (!valid) { + charStrings.set(i, new Uint8Array([14])); } - null !== C.seac && (n[c] = C.seac); - h || e.set(c, new Uint8Array([14])); } - return { charStrings: e, seacs: n, widths: g }; + return { + charStrings, + seacs, + widths, + }; } - emptyPrivateDictionary(e) { - const t = this.createDict(CFFPrivateDict, [], e.strings); - e.setByKey(18, [0, 0]); - e.privateDict = t; + emptyPrivateDictionary(parentDict) { + const privateDict = this.createDict(CFFPrivateDict, [], parentDict.strings); + parentDict.setByKey(18, [0, 0]); + parentDict.privateDict = privateDict; } - parsePrivateDict(e) { - if (!e.hasName("Private")) { - this.emptyPrivateDictionary(e); + parsePrivateDict(parentDict) { + if (!parentDict.hasName("Private")) { + this.emptyPrivateDictionary(parentDict); return; } - const t = e.getByName("Private"); - if (!Array.isArray(t) || 2 !== t.length) { - e.removeByName("Private"); + const privateOffset = parentDict.getByName("Private"); + if (!Array.isArray(privateOffset) || privateOffset.length !== 2) { + parentDict.removeByName("Private"); return; } - const i = t[0], - a = t[1]; - if (0 === i || a >= this.bytes.length) { - this.emptyPrivateDictionary(e); + const size = privateOffset[0]; + const offset = privateOffset[1]; + if (size === 0 || offset >= this.bytes.length) { + this.emptyPrivateDictionary(parentDict); return; } - const s = a + i, - r = this.bytes.subarray(a, s), - n = this.parseDict(r), - g = this.createDict(CFFPrivateDict, n, e.strings); - e.privateDict = g; - 0 === g.getByName("ExpansionFactor") && - g.setByName("ExpansionFactor", 0.06); - if (!g.getByName("Subrs")) return; - const o = g.getByName("Subrs"), - c = a + o; - if (0 === o || c >= this.bytes.length) { - this.emptyPrivateDictionary(e); + const privateDictEnd = offset + size; + const dictData = this.bytes.subarray(offset, privateDictEnd); + const dict = this.parseDict(dictData); + const privateDict = this.createDict( + CFFPrivateDict, + dict, + parentDict.strings, + ); + parentDict.privateDict = privateDict; + if (privateDict.getByName("ExpansionFactor") === 0) { + privateDict.setByName("ExpansionFactor", 0.06); + } + if (!privateDict.getByName("Subrs")) { return; } - const C = this.parseIndex(c); - g.subrsIndex = C.obj; + const subrsOffset = privateDict.getByName("Subrs"); + const relativeOffset = offset + subrsOffset; + if (subrsOffset === 0 || relativeOffset >= this.bytes.length) { + this.emptyPrivateDictionary(parentDict); + return; + } + const subrsIndex = this.parseIndex(relativeOffset); + privateDict.subrsIndex = subrsIndex.obj; } - parseCharsets(e, t, i, a) { - if (0 === e) return new CFFCharset(!0, Ri.ISO_ADOBE, Bi); - if (1 === e) return new CFFCharset(!0, Ri.EXPERT, li); - if (2 === e) return new CFFCharset(!0, Ri.EXPERT_SUBSET, Qi); - const s = this.bytes, - r = e, - n = s[e++], - g = [a ? 0 : ".notdef"]; - let o, c, C; - t -= 1; - switch (n) { + parseCharsets(pos, length, strings, cid) { + if (pos === 0) { + return new CFFCharset( + true, + CFFCharsetPredefinedTypes.ISO_ADOBE, + ISOAdobeCharset, + ); + } else if (pos === 1) { + return new CFFCharset( + true, + CFFCharsetPredefinedTypes.EXPERT, + ExpertCharset, + ); + } else if (pos === 2) { + return new CFFCharset( + true, + CFFCharsetPredefinedTypes.EXPERT_SUBSET, + ExpertSubsetCharset, + ); + } + const bytes = this.bytes; + const start = pos; + const format = bytes[pos++]; + const charset = [cid ? 0 : ".notdef"]; + let id, count, i; + length -= 1; + switch (format) { case 0: - for (C = 0; C < t; C++) { - o = (s[e++] << 8) | s[e++]; - g.push(a ? o : i.get(o)); + for (i = 0; i < length; i++) { + id = (bytes[pos++] << 8) | bytes[pos++]; + charset.push(cid ? id : strings.get(id)); } break; case 1: - for (; g.length <= t; ) { - o = (s[e++] << 8) | s[e++]; - c = s[e++]; - for (C = 0; C <= c; C++) g.push(a ? o++ : i.get(o++)); + while (charset.length <= length) { + id = (bytes[pos++] << 8) | bytes[pos++]; + count = bytes[pos++]; + for (i = 0; i <= count; i++) { + charset.push(cid ? id++ : strings.get(id++)); + } } break; case 2: - for (; g.length <= t; ) { - o = (s[e++] << 8) | s[e++]; - c = (s[e++] << 8) | s[e++]; - for (C = 0; C <= c; C++) g.push(a ? o++ : i.get(o++)); + while (charset.length <= length) { + id = (bytes[pos++] << 8) | bytes[pos++]; + count = (bytes[pos++] << 8) | bytes[pos++]; + for (i = 0; i <= count; i++) { + charset.push(cid ? id++ : strings.get(id++)); + } } break; default: throw new FormatError("Unknown charset format"); } - const h = e, - l = s.subarray(r, h); - return new CFFCharset(!1, n, g, l); + const end = pos; + const raw = bytes.subarray(start, end); + return new CFFCharset(false, format, charset, raw); } - parseEncoding(e, t, i, a) { - const s = Object.create(null), - r = this.bytes; - let n, - g, - o, - c = !1, - C = null; - if (0 === e || 1 === e) { - c = !0; - n = e; - const t = e ? Ei : fi; - for (g = 0, o = a.length; g < o; g++) { - const e = t.indexOf(a[g]); - -1 !== e && (s[e] = g); + parseEncoding(pos, properties, strings, charset) { + const encoding = Object.create(null); + const bytes = this.bytes; + let predefined = false; + let format, i, ii; + let raw = null; + function readSupplement() { + const supplementsCount = bytes[pos++]; + for (i = 0; i < supplementsCount; i++) { + const code = bytes[pos++]; + const sid = (bytes[pos++] << 8) + (bytes[pos++] & 0xff); + encoding[code] = charset.indexOf(strings.get(sid)); + } + } + if (pos === 0 || pos === 1) { + predefined = true; + format = pos; + const baseEncoding = pos ? ExpertEncoding : StandardEncoding; + for (i = 0, ii = charset.length; i < ii; i++) { + const index = baseEncoding.indexOf(charset[i]); + if (index !== -1) { + encoding[index] = i; + } } } else { - const t = e; - n = r[e++]; - switch (127 & n) { + const dataStart = pos; + format = bytes[pos++]; + switch (format & 0x7f) { case 0: - const t = r[e++]; - for (g = 1; g <= t; g++) s[r[e++]] = g; + const glyphsCount = bytes[pos++]; + for (i = 1; i <= glyphsCount; i++) { + encoding[bytes[pos++]] = i; + } break; case 1: - const i = r[e++]; - let a = 1; - for (g = 0; g < i; g++) { - const t = r[e++], - i = r[e++]; - for (let e = t; e <= t + i; e++) s[e] = a++; + const rangesCount = bytes[pos++]; + let gid = 1; + for (i = 0; i < rangesCount; i++) { + const start = bytes[pos++]; + const left = bytes[pos++]; + for (let j = start; j <= start + left; j++) { + encoding[j] = gid++; + } } break; default: - throw new FormatError(`Unknown encoding format: ${n} in CFF`); + throw new FormatError(`Unknown encoding format: ${format} in CFF`); } - const o = e; - if (128 & n) { - r[t] &= 127; - !(function readSupplement() { - const t = r[e++]; - for (g = 0; g < t; g++) { - const t = r[e++], - n = (r[e++] << 8) + (255 & r[e++]); - s[t] = a.indexOf(i.get(n)); - } - })(); + const dataEnd = pos; + if (format & 0x80) { + bytes[dataStart] &= 0x7f; + readSupplement(); } - C = r.subarray(t, o); + raw = bytes.subarray(dataStart, dataEnd); } - n &= 127; - return new CFFEncoding(c, n, s, C); + format &= 0x7f; + return new CFFEncoding(predefined, format, encoding, raw); } - parseFDSelect(e, t) { - const i = this.bytes, - a = i[e++], - s = []; - let r; - switch (a) { + parseFDSelect(pos, length) { + const bytes = this.bytes; + const format = bytes[pos++]; + const fdSelect = []; + let i; + switch (format) { case 0: - for (r = 0; r < t; ++r) { - const t = i[e++]; - s.push(t); + for (i = 0; i < length; ++i) { + const id = bytes[pos++]; + fdSelect.push(id); } break; case 3: - const n = (i[e++] << 8) | i[e++]; - for (r = 0; r < n; ++r) { - let t = (i[e++] << 8) | i[e++]; - if (0 === r && 0 !== t) { + const rangesCount = (bytes[pos++] << 8) | bytes[pos++]; + for (i = 0; i < rangesCount; ++i) { + let first = (bytes[pos++] << 8) | bytes[pos++]; + if (i === 0 && first !== 0) { warn( - "parseFDSelect: The first range must have a first GID of 0 -- trying to recover.", + "parseFDSelect: The first range must have a first GID of 0" + + " -- trying to recover.", ); - t = 0; + first = 0; + } + const fdIndex = bytes[pos++]; + const next = (bytes[pos] << 8) | bytes[pos + 1]; + for (let j = first; j < next; ++j) { + fdSelect.push(fdIndex); } - const a = i[e++], - n = (i[e] << 8) | i[e + 1]; - for (let e = t; e < n; ++e) s.push(a); } - e += 2; + pos += 2; break; default: - throw new FormatError(`parseFDSelect: Unknown format "${a}".`); + throw new FormatError(`parseFDSelect: Unknown format "${format}".`); } - if (s.length !== t) + if (fdSelect.length !== length) { throw new FormatError("parseFDSelect: Invalid font data."); - return new CFFFDSelect(a, s); + } + return new CFFFDSelect(format, fdSelect); } } class CFF { @@ -13721,49 +16931,61 @@ class CFF { this.charStrings = null; this.fdArray = []; this.fdSelect = null; - this.isCIDFont = !1; + this.isCIDFont = false; } duplicateFirstGlyph() { if (this.charStrings.count >= 65535) { warn("Not enough space in charstrings to duplicate first glyph."); return; } - const e = this.charStrings.get(0); - this.charStrings.add(e); - this.isCIDFont && this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]); + const glyphZero = this.charStrings.get(0); + this.charStrings.add(glyphZero); + if (this.isCIDFont) { + this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]); + } } - hasGlyphId(e) { - if (e < 0 || e >= this.charStrings.count) return !1; - return this.charStrings.get(e).length > 0; + hasGlyphId(id) { + if (id < 0 || id >= this.charStrings.count) { + return false; + } + const glyph = this.charStrings.get(id); + return glyph.length > 0; } } class CFFHeader { - constructor(e, t, i, a) { - this.major = e; - this.minor = t; - this.hdrSize = i; - this.offSize = a; + constructor(major, minor, hdrSize, offSize) { + this.major = major; + this.minor = minor; + this.hdrSize = hdrSize; + this.offSize = offSize; } } class CFFStrings { constructor() { this.strings = []; } - get(e) { - return e >= 0 && e <= 390 - ? wi[e] - : e - Di <= this.strings.length - ? this.strings[e - Di] - : wi[0]; + get(index) { + if (index >= 0 && index <= NUM_STANDARD_CFF_STRINGS - 1) { + return CFFStandardStrings[index]; + } + if (index - NUM_STANDARD_CFF_STRINGS <= this.strings.length) { + return this.strings[index - NUM_STANDARD_CFF_STRINGS]; + } + return CFFStandardStrings[0]; } - getSID(e) { - let t = wi.indexOf(e); - if (-1 !== t) return t; - t = this.strings.indexOf(e); - return -1 !== t ? t + Di : -1; + getSID(str) { + let index = CFFStandardStrings.indexOf(str); + if (index !== -1) { + return index; + } + index = this.strings.indexOf(str); + if (index !== -1) { + return index + NUM_STANDARD_CFF_STRINGS; + } + return -1; } - add(e) { - this.strings.push(e); + add(value) { + this.strings.push(value); } get count() { return this.strings.length; @@ -13774,64 +16996,76 @@ class CFFIndex { this.objects = []; this.length = 0; } - add(e) { - this.length += e.length; - this.objects.push(e); + add(data) { + this.length += data.length; + this.objects.push(data); } - set(e, t) { - this.length += t.length - this.objects[e].length; - this.objects[e] = t; + set(index, data) { + this.length += data.length - this.objects[index].length; + this.objects[index] = data; } - get(e) { - return this.objects[e]; + get(index) { + return this.objects[index]; } get count() { return this.objects.length; } } class CFFDict { - constructor(e, t) { - this.keyToNameMap = e.keyToNameMap; - this.nameToKeyMap = e.nameToKeyMap; - this.defaults = e.defaults; - this.types = e.types; - this.opcodes = e.opcodes; - this.order = e.order; - this.strings = t; + constructor(tables, strings) { + this.keyToNameMap = tables.keyToNameMap; + this.nameToKeyMap = tables.nameToKeyMap; + this.defaults = tables.defaults; + this.types = tables.types; + this.opcodes = tables.opcodes; + this.order = tables.order; + this.strings = strings; this.values = Object.create(null); } - setByKey(e, t) { - if (!(e in this.keyToNameMap)) return !1; - if (0 === t.length) return !0; - for (const i of t) - if (isNaN(i)) { - warn(`Invalid CFFDict value: "${t}" for key "${e}".`); - return !0; + setByKey(key, value) { + if (!(key in this.keyToNameMap)) { + return false; + } + if (value.length === 0) { + return true; + } + for (const val of value) { + if (isNaN(val)) { + warn(`Invalid CFFDict value: "${value}" for key "${key}".`); + return true; } - const i = this.types[e]; - ("num" !== i && "sid" !== i && "offset" !== i) || (t = t[0]); - this.values[e] = t; - return !0; + } + const type = this.types[key]; + if (type === "num" || type === "sid" || type === "offset") { + value = value[0]; + } + this.values[key] = value; + return true; } - setByName(e, t) { - if (!(e in this.nameToKeyMap)) - throw new FormatError(`Invalid dictionary name "${e}"`); - this.values[this.nameToKeyMap[e]] = t; + setByName(name, value) { + if (!(name in this.nameToKeyMap)) { + throw new FormatError(`Invalid dictionary name "${name}"`); + } + this.values[this.nameToKeyMap[name]] = value; } - hasName(e) { - return this.nameToKeyMap[e] in this.values; + hasName(name) { + return this.nameToKeyMap[name] in this.values; } - getByName(e) { - if (!(e in this.nameToKeyMap)) - throw new FormatError(`Invalid dictionary name ${e}"`); - const t = this.nameToKeyMap[e]; - return t in this.values ? this.values[t] : this.defaults[t]; + getByName(name) { + if (!(name in this.nameToKeyMap)) { + throw new FormatError(`Invalid dictionary name ${name}"`); + } + const key = this.nameToKeyMap[name]; + if (!(key in this.values)) { + return this.defaults[key]; + } + return this.values[key]; } - removeByName(e) { - delete this.values[this.nameToKeyMap[e]]; + removeByName(name) { + delete this.values[this.nameToKeyMap[name]]; } - static createTables(e) { - const t = { + static createTables(layout) { + const tables = { keyToNameMap: {}, nameToKeyMap: {}, defaults: {}, @@ -13839,19 +17073,21 @@ class CFFDict { opcodes: {}, order: [], }; - for (const i of e) { - const e = Array.isArray(i[0]) ? (i[0][0] << 8) + i[0][1] : i[0]; - t.keyToNameMap[e] = i[1]; - t.nameToKeyMap[i[1]] = e; - t.types[e] = i[2]; - t.defaults[e] = i[3]; - t.opcodes[e] = Array.isArray(i[0]) ? i[0] : [i[0]]; - t.order.push(e); + for (const entry of layout) { + const key = Array.isArray(entry[0]) + ? (entry[0][0] << 8) + entry[0][1] + : entry[0]; + tables.keyToNameMap[key] = entry[1]; + tables.nameToKeyMap[entry[1]] = key; + tables.types[key] = entry[2]; + tables.defaults[key] = entry[3]; + tables.opcodes[key] = Array.isArray(entry[0]) ? entry[0] : [entry[0]]; + tables.order.push(key); } - return t; + return tables; } } -const Si = [ +const CFFTopDictLayout = [ [[12, 30], "ROS", ["sid", "sid", "num"], null], [[12, 20], "SyntheticBase", "num", null], [0, "version", "sid", null], @@ -13894,14 +17130,14 @@ const Si = [ ]; class CFFTopDict extends CFFDict { static get tables() { - return shadow(this, "tables", this.createTables(Si)); + return shadow(this, "tables", this.createTables(CFFTopDictLayout)); } - constructor(e) { - super(CFFTopDict.tables, e); + constructor(strings) { + super(CFFTopDict.tables, strings); this.privateDict = null; } } -const ki = [ +const CFFPrivateDictLayout = [ [6, "BlueValues", "delta", null], [7, "OtherBlues", "delta", null], [8, "FamilyBlues", "delta", null], @@ -13923,153 +17159,189 @@ const ki = [ ]; class CFFPrivateDict extends CFFDict { static get tables() { - return shadow(this, "tables", this.createTables(ki)); + return shadow(this, "tables", this.createTables(CFFPrivateDictLayout)); } - constructor(e) { - super(CFFPrivateDict.tables, e); + constructor(strings) { + super(CFFPrivateDict.tables, strings); this.subrsIndex = null; } } -const Ri = { ISO_ADOBE: 0, EXPERT: 1, EXPERT_SUBSET: 2 }; +const CFFCharsetPredefinedTypes = { + ISO_ADOBE: 0, + EXPERT: 1, + EXPERT_SUBSET: 2, +}; class CFFCharset { - constructor(e, t, i, a) { - this.predefined = e; - this.format = t; - this.charset = i; - this.raw = a; + constructor(predefined, format, charset, raw) { + this.predefined = predefined; + this.format = format; + this.charset = charset; + this.raw = raw; } } class CFFEncoding { - constructor(e, t, i, a) { - this.predefined = e; - this.format = t; - this.encoding = i; - this.raw = a; + constructor(predefined, format, encoding, raw) { + this.predefined = predefined; + this.format = format; + this.encoding = encoding; + this.raw = raw; } } class CFFFDSelect { - constructor(e, t) { - this.format = e; - this.fdSelect = t; + constructor(format, fdSelect) { + this.format = format; + this.fdSelect = fdSelect; } - getFDIndex(e) { - return e < 0 || e >= this.fdSelect.length ? -1 : this.fdSelect[e]; + getFDIndex(glyphIndex) { + if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) { + return -1; + } + return this.fdSelect[glyphIndex]; } } class CFFOffsetTracker { constructor() { this.offsets = Object.create(null); } - isTracking(e) { - return e in this.offsets; + isTracking(key) { + return key in this.offsets; } - track(e, t) { - if (e in this.offsets) - throw new FormatError(`Already tracking location of ${e}`); - this.offsets[e] = t; + track(key, location) { + if (key in this.offsets) { + throw new FormatError(`Already tracking location of ${key}`); + } + this.offsets[key] = location; } - offset(e) { - for (const t in this.offsets) this.offsets[t] += e; + offset(value) { + for (const key in this.offsets) { + this.offsets[key] += value; + } } - setEntryLocation(e, t, i) { - if (!(e in this.offsets)) - throw new FormatError(`Not tracking location of ${e}`); - const a = i.data, - s = this.offsets[e]; - for (let e = 0, i = t.length; e < i; ++e) { - const i = 5 * e + s, - r = i + 1, - n = i + 2, - g = i + 3, - o = i + 4; - if (29 !== a[i] || 0 !== a[r] || 0 !== a[n] || 0 !== a[g] || 0 !== a[o]) + setEntryLocation(key, values, output) { + if (!(key in this.offsets)) { + throw new FormatError(`Not tracking location of ${key}`); + } + const data = output.data; + const dataOffset = this.offsets[key]; + const size = 5; + for (let i = 0, ii = values.length; i < ii; ++i) { + const offset0 = i * size + dataOffset; + const offset1 = offset0 + 1; + const offset2 = offset0 + 2; + const offset3 = offset0 + 3; + const offset4 = offset0 + 4; + if ( + data[offset0] !== 0x1d || + data[offset1] !== 0 || + data[offset2] !== 0 || + data[offset3] !== 0 || + data[offset4] !== 0 + ) { throw new FormatError("writing to an offset that is not empty"); - const c = t[e]; - a[i] = 29; - a[r] = (c >> 24) & 255; - a[n] = (c >> 16) & 255; - a[g] = (c >> 8) & 255; - a[o] = 255 & c; + } + const value = values[i]; + data[offset0] = 0x1d; + data[offset1] = (value >> 24) & 0xff; + data[offset2] = (value >> 16) & 0xff; + data[offset3] = (value >> 8) & 0xff; + data[offset4] = value & 0xff; } } } class CFFCompiler { - constructor(e) { - this.cff = e; + constructor(cff) { + this.cff = cff; } compile() { - const e = this.cff, - t = { - data: [], - length: 0, - add(e) { - try { - this.data.push(...e); - } catch { - this.data = this.data.concat(e); - } - this.length = this.data.length; - }, + const cff = this.cff; + const output = { + data: [], + length: 0, + add(data) { + try { + this.data.push(...data); + } catch { + this.data = this.data.concat(data); + } + this.length = this.data.length; }, - i = this.compileHeader(e.header); - t.add(i); - const a = this.compileNameIndex(e.names); - t.add(a); - if (e.isCIDFont && e.topDict.hasName("FontMatrix")) { - const t = e.topDict.getByName("FontMatrix"); - e.topDict.removeByName("FontMatrix"); - for (const i of e.fdArray) { - let e = t.slice(0); - i.hasName("FontMatrix") && - (e = Util.transform(e, i.getByName("FontMatrix"))); - i.setByName("FontMatrix", e); + }; + const header = this.compileHeader(cff.header); + output.add(header); + const nameIndex = this.compileNameIndex(cff.names); + output.add(nameIndex); + if (cff.isCIDFont) { + if (cff.topDict.hasName("FontMatrix")) { + const base = cff.topDict.getByName("FontMatrix"); + cff.topDict.removeByName("FontMatrix"); + for (const subDict of cff.fdArray) { + let matrix = base.slice(0); + if (subDict.hasName("FontMatrix")) { + matrix = Util.transform(matrix, subDict.getByName("FontMatrix")); + } + subDict.setByName("FontMatrix", matrix); + } } } - const s = e.topDict.getByName("XUID"); - s?.length > 16 && e.topDict.removeByName("XUID"); - e.topDict.setByName("charset", 0); - let r = this.compileTopDicts([e.topDict], t.length, e.isCIDFont); - t.add(r.output); - const n = r.trackers[0], - g = this.compileStringIndex(e.strings.strings); - t.add(g); - const o = this.compileIndex(e.globalSubrIndex); - t.add(o); - if (e.encoding && e.topDict.hasName("Encoding")) - if (e.encoding.predefined) - n.setEntryLocation("Encoding", [e.encoding.format], t); - else { - const i = this.compileEncoding(e.encoding); - n.setEntryLocation("Encoding", [t.length], t); - t.add(i); - } - const c = this.compileCharset( - e.charset, - e.charStrings.count, - e.strings, - e.isCIDFont, + const xuid = cff.topDict.getByName("XUID"); + if (xuid?.length > 16) { + cff.topDict.removeByName("XUID"); + } + cff.topDict.setByName("charset", 0); + let compiled = this.compileTopDicts( + [cff.topDict], + output.length, + cff.isCIDFont, ); - n.setEntryLocation("charset", [t.length], t); - t.add(c); - const C = this.compileCharStrings(e.charStrings); - n.setEntryLocation("CharStrings", [t.length], t); - t.add(C); - if (e.isCIDFont) { - n.setEntryLocation("FDSelect", [t.length], t); - const i = this.compileFDSelect(e.fdSelect); - t.add(i); - r = this.compileTopDicts(e.fdArray, t.length, !0); - n.setEntryLocation("FDArray", [t.length], t); - t.add(r.output); - const a = r.trackers; - this.compilePrivateDicts(e.fdArray, a, t); + output.add(compiled.output); + const topDictTracker = compiled.trackers[0]; + const stringIndex = this.compileStringIndex(cff.strings.strings); + output.add(stringIndex); + const globalSubrIndex = this.compileIndex(cff.globalSubrIndex); + output.add(globalSubrIndex); + if (cff.encoding && cff.topDict.hasName("Encoding")) { + if (cff.encoding.predefined) { + topDictTracker.setEntryLocation( + "Encoding", + [cff.encoding.format], + output, + ); + } else { + const encoding = this.compileEncoding(cff.encoding); + topDictTracker.setEntryLocation("Encoding", [output.length], output); + output.add(encoding); + } } - this.compilePrivateDicts([e.topDict], [n], t); - t.add([0]); - return t.data; + const charset = this.compileCharset( + cff.charset, + cff.charStrings.count, + cff.strings, + cff.isCIDFont, + ); + topDictTracker.setEntryLocation("charset", [output.length], output); + output.add(charset); + const charStrings = this.compileCharStrings(cff.charStrings); + topDictTracker.setEntryLocation("CharStrings", [output.length], output); + output.add(charStrings); + if (cff.isCIDFont) { + topDictTracker.setEntryLocation("FDSelect", [output.length], output); + const fdSelect = this.compileFDSelect(cff.fdSelect); + output.add(fdSelect); + compiled = this.compileTopDicts(cff.fdArray, output.length, true); + topDictTracker.setEntryLocation("FDArray", [output.length], output); + output.add(compiled.output); + const fontDictTrackers = compiled.trackers; + this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); + } + this.compilePrivateDicts([cff.topDict], [topDictTracker], output); + output.add([0]); + return output.data; } - encodeNumber(e) { - return Number.isInteger(e) ? this.encodeInteger(e) : this.encodeFloat(e); + encodeNumber(value) { + if (Number.isInteger(value)) { + return this.encodeInteger(value); + } + return this.encodeFloat(value); } static get EncodeFloatRegExp() { return shadow( @@ -14078,6216 +17350,6430 @@ class CFFCompiler { /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/, ); } - encodeFloat(e) { - let t = e.toString(); - const i = CFFCompiler.EncodeFloatRegExp.exec(t); - if (i) { - const a = parseFloat("1e" + ((i[2] ? +i[2] : 0) + i[1].length)); - t = (Math.round(e * a) / a).toString(); + encodeFloat(num) { + let value = num.toString(); + const m = CFFCompiler.EncodeFloatRegExp.exec(value); + if (m) { + const epsilon = parseFloat("1e" + ((m[2] ? +m[2] : 0) + m[1].length)); + value = (Math.round(num * epsilon) / epsilon).toString(); } - let a, - s, - r = ""; - for (a = 0, s = t.length; a < s; ++a) { - const e = t[a]; - r += - "e" === e - ? "-" === t[++a] - ? "c" - : "b" - : "." === e - ? "a" - : "-" === e - ? "e" - : e; - } - r += 1 & r.length ? "f" : "ff"; - const n = [30]; - for (a = 0, s = r.length; a < s; a += 2) - n.push(parseInt(r.substring(a, a + 2), 16)); - return n; - } - encodeInteger(e) { - let t; - t = - e >= -107 && e <= 107 - ? [e + 139] - : e >= 108 && e <= 1131 - ? [247 + ((e -= 108) >> 8), 255 & e] - : e >= -1131 && e <= -108 - ? [251 + ((e = -e - 108) >> 8), 255 & e] - : e >= -32768 && e <= 32767 - ? [28, (e >> 8) & 255, 255 & e] - : [29, (e >> 24) & 255, (e >> 16) & 255, (e >> 8) & 255, 255 & e]; - return t; - } - compileHeader(e) { - return [e.major, e.minor, 4, e.offSize]; - } - compileNameIndex(e) { - const t = new CFFIndex(); - for (const i of e) { - const e = Math.min(i.length, 127); - let a = new Array(e); - for (let t = 0; t < e; t++) { - let e = i[t]; - (e < "!" || - e > "~" || - "[" === e || - "]" === e || - "(" === e || - ")" === e || - "{" === e || - "}" === e || - "<" === e || - ">" === e || - "/" === e || - "%" === e) && - (e = "_"); - a[t] = e; - } - a = a.join(""); - "" === a && (a = "Bad_Font_Name"); - t.add(stringToBytes(a)); - } - return this.compileIndex(t); - } - compileTopDicts(e, t, i) { - const a = []; - let s = new CFFIndex(); - for (const r of e) { - if (i) { - r.removeByName("CIDFontVersion"); - r.removeByName("CIDFontRevision"); - r.removeByName("CIDFontType"); - r.removeByName("CIDCount"); - r.removeByName("UIDBase"); - } - const e = new CFFOffsetTracker(), - n = this.compileDict(r, e); - a.push(e); - s.add(n); - e.offset(t); - } - s = this.compileIndex(s, a); - return { trackers: a, output: s }; - } - compilePrivateDicts(e, t, i) { - for (let a = 0, s = e.length; a < s; ++a) { - const s = e[a], - r = s.privateDict; - if (!r || !s.hasName("Private")) - throw new FormatError("There must be a private dictionary."); - const n = new CFFOffsetTracker(), - g = this.compileDict(r, n); - let o = i.length; - n.offset(o); - g.length || (o = 0); - t[a].setEntryLocation("Private", [g.length, o], i); - i.add(g); - if (r.subrsIndex && r.hasName("Subrs")) { - const e = this.compileIndex(r.subrsIndex); - n.setEntryLocation("Subrs", [g.length], i); - i.add(e); + let nibbles = ""; + let i, ii; + for (i = 0, ii = value.length; i < ii; ++i) { + const a = value[i]; + if (a === "e") { + nibbles += value[++i] === "-" ? "c" : "b"; + } else if (a === ".") { + nibbles += "a"; + } else if (a === "-") { + nibbles += "e"; + } else { + nibbles += a; } } + nibbles += nibbles.length & 1 ? "f" : "ff"; + const out = [30]; + for (i = 0, ii = nibbles.length; i < ii; i += 2) { + out.push(parseInt(nibbles.substring(i, i + 2), 16)); + } + return out; } - compileDict(e, t) { - const i = []; - for (const a of e.order) { - if (!(a in e.values)) continue; - let s = e.values[a], - r = e.types[a]; - Array.isArray(r) || (r = [r]); - Array.isArray(s) || (s = [s]); - if (0 !== s.length) { - for (let n = 0, g = r.length; n < g; ++n) { - const g = r[n], - o = s[n]; - switch (g) { - case "num": - case "sid": - i.push(...this.encodeNumber(o)); - break; - case "offset": - const r = e.keyToNameMap[a]; - t.isTracking(r) || t.track(r, i.length); - i.push(29, 0, 0, 0, 0); - break; - case "array": - case "delta": - i.push(...this.encodeNumber(o)); - for (let e = 1, t = s.length; e < t; ++e) - i.push(...this.encodeNumber(s[e])); - break; - default: - throw new FormatError(`Unknown data type of ${g}`); - } + encodeInteger(value) { + let code; + if (value >= -107 && value <= 107) { + code = [value + 139]; + } else if (value >= 108 && value <= 1131) { + value -= 108; + code = [(value >> 8) + 247, value & 0xff]; + } else if (value >= -1131 && value <= -108) { + value = -value - 108; + code = [(value >> 8) + 251, value & 0xff]; + } else if (value >= -32768 && value <= 32767) { + code = [0x1c, (value >> 8) & 0xff, value & 0xff]; + } else { + code = [ + 0x1d, + (value >> 24) & 0xff, + (value >> 16) & 0xff, + (value >> 8) & 0xff, + value & 0xff, + ]; + } + return code; + } + compileHeader(header) { + return [header.major, header.minor, 4, header.offSize]; + } + compileNameIndex(names) { + const nameIndex = new CFFIndex(); + for (const name of names) { + const length = Math.min(name.length, 127); + let sanitizedName = new Array(length); + for (let j = 0; j < length; j++) { + let char = name[j]; + if ( + char < "!" || + char > "~" || + char === "[" || + char === "]" || + char === "(" || + char === ")" || + char === "{" || + char === "}" || + char === "<" || + char === ">" || + char === "/" || + char === "%" + ) { + char = "_"; } - i.push(...e.opcodes[a]); + sanitizedName[j] = char; + } + sanitizedName = sanitizedName.join(""); + if (sanitizedName === "") { + sanitizedName = "Bad_Font_Name"; + } + nameIndex.add(stringToBytes(sanitizedName)); + } + return this.compileIndex(nameIndex); + } + compileTopDicts(dicts, length, removeCidKeys) { + const fontDictTrackers = []; + let fdArrayIndex = new CFFIndex(); + for (const fontDict of dicts) { + if (removeCidKeys) { + fontDict.removeByName("CIDFontVersion"); + fontDict.removeByName("CIDFontRevision"); + fontDict.removeByName("CIDFontType"); + fontDict.removeByName("CIDCount"); + fontDict.removeByName("UIDBase"); + } + const fontDictTracker = new CFFOffsetTracker(); + const fontDictData = this.compileDict(fontDict, fontDictTracker); + fontDictTrackers.push(fontDictTracker); + fdArrayIndex.add(fontDictData); + fontDictTracker.offset(length); + } + fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); + return { + trackers: fontDictTrackers, + output: fdArrayIndex, + }; + } + compilePrivateDicts(dicts, trackers, output) { + for (let i = 0, ii = dicts.length; i < ii; ++i) { + const fontDict = dicts[i]; + const privateDict = fontDict.privateDict; + if (!privateDict || !fontDict.hasName("Private")) { + throw new FormatError("There must be a private dictionary."); + } + const privateDictTracker = new CFFOffsetTracker(); + const privateDictData = this.compileDict(privateDict, privateDictTracker); + let outputLength = output.length; + privateDictTracker.offset(outputLength); + if (!privateDictData.length) { + outputLength = 0; + } + trackers[i].setEntryLocation( + "Private", + [privateDictData.length, outputLength], + output, + ); + output.add(privateDictData); + if (privateDict.subrsIndex && privateDict.hasName("Subrs")) { + const subrs = this.compileIndex(privateDict.subrsIndex); + privateDictTracker.setEntryLocation( + "Subrs", + [privateDictData.length], + output, + ); + output.add(subrs); } } - return i; } - compileStringIndex(e) { - const t = new CFFIndex(); - for (const i of e) t.add(stringToBytes(i)); - return this.compileIndex(t); - } - compileCharStrings(e) { - const t = new CFFIndex(); - for (let i = 0; i < e.count; i++) { - const a = e.get(i); - 0 !== a.length ? t.add(a) : t.add(new Uint8Array([139, 14])); + compileDict(dict, offsetTracker) { + const out = []; + for (const key of dict.order) { + if (!(key in dict.values)) { + continue; + } + let values = dict.values[key]; + let types = dict.types[key]; + if (!Array.isArray(types)) { + types = [types]; + } + if (!Array.isArray(values)) { + values = [values]; + } + if (values.length === 0) { + continue; + } + for (let j = 0, jj = types.length; j < jj; ++j) { + const type = types[j]; + const value = values[j]; + switch (type) { + case "num": + case "sid": + out.push(...this.encodeNumber(value)); + break; + case "offset": + const name = dict.keyToNameMap[key]; + if (!offsetTracker.isTracking(name)) { + offsetTracker.track(name, out.length); + } + out.push(0x1d, 0, 0, 0, 0); + break; + case "array": + case "delta": + out.push(...this.encodeNumber(value)); + for (let k = 1, kk = values.length; k < kk; ++k) { + out.push(...this.encodeNumber(values[k])); + } + break; + default: + throw new FormatError(`Unknown data type of ${type}`); + } + } + out.push(...dict.opcodes[key]); } - return this.compileIndex(t); + return out; } - compileCharset(e, t, i, a) { - let s; - const r = t - 1; - if (a) s = new Uint8Array([2, 0, 0, (r >> 8) & 255, 255 & r]); - else { - s = new Uint8Array(1 + 2 * r); - s[0] = 0; - let t = 0; - const a = e.charset.length; - let n = !1; - for (let r = 1; r < s.length; r += 2) { - let g = 0; - if (t < a) { - const a = e.charset[t++]; - g = i.getSID(a); - if (-1 === g) { - g = 0; - if (!n) { - n = !0; - warn(`Couldn't find ${a} in CFF strings`); + compileStringIndex(strings) { + const stringIndex = new CFFIndex(); + for (const string of strings) { + stringIndex.add(stringToBytes(string)); + } + return this.compileIndex(stringIndex); + } + compileCharStrings(charStrings) { + const charStringsIndex = new CFFIndex(); + for (let i = 0; i < charStrings.count; i++) { + const glyph = charStrings.get(i); + if (glyph.length === 0) { + charStringsIndex.add(new Uint8Array([0x8b, 0x0e])); + continue; + } + charStringsIndex.add(glyph); + } + return this.compileIndex(charStringsIndex); + } + compileCharset(charset, numGlyphs, strings, isCIDFont) { + let out; + const numGlyphsLessNotDef = numGlyphs - 1; + if (isCIDFont) { + out = new Uint8Array([ + 2, + 0, + 0, + (numGlyphsLessNotDef >> 8) & 0xff, + numGlyphsLessNotDef & 0xff, + ]); + } else { + const length = 1 + numGlyphsLessNotDef * 2; + out = new Uint8Array(length); + out[0] = 0; + let charsetIndex = 0; + const numCharsets = charset.charset.length; + let warned = false; + for (let i = 1; i < out.length; i += 2) { + let sid = 0; + if (charsetIndex < numCharsets) { + const name = charset.charset[charsetIndex++]; + sid = strings.getSID(name); + if (sid === -1) { + sid = 0; + if (!warned) { + warned = true; + warn(`Couldn't find ${name} in CFF strings`); } } } - s[r] = (g >> 8) & 255; - s[r + 1] = 255 & g; + out[i] = (sid >> 8) & 0xff; + out[i + 1] = sid & 0xff; } } - return this.compileTypedArray(s); + return this.compileTypedArray(out); } - compileEncoding(e) { - return this.compileTypedArray(e.raw); + compileEncoding(encoding) { + return this.compileTypedArray(encoding.raw); } - compileFDSelect(e) { - const t = e.format; - let i, a; - switch (t) { + compileFDSelect(fdSelect) { + const format = fdSelect.format; + let out, i; + switch (format) { case 0: - i = new Uint8Array(1 + e.fdSelect.length); - i[0] = t; - for (a = 0; a < e.fdSelect.length; a++) i[a + 1] = e.fdSelect[a]; + out = new Uint8Array(1 + fdSelect.fdSelect.length); + out[0] = format; + for (i = 0; i < fdSelect.fdSelect.length; i++) { + out[i + 1] = fdSelect.fdSelect[i]; + } break; case 3: - const s = 0; - let r = e.fdSelect[0]; - const n = [t, 0, 0, (s >> 8) & 255, 255 & s, r]; - for (a = 1; a < e.fdSelect.length; a++) { - const t = e.fdSelect[a]; - if (t !== r) { - n.push((a >> 8) & 255, 255 & a, t); - r = t; + const start = 0; + let lastFD = fdSelect.fdSelect[0]; + const ranges = [ + format, + 0, + 0, + (start >> 8) & 0xff, + start & 0xff, + lastFD, + ]; + for (i = 1; i < fdSelect.fdSelect.length; i++) { + const currentFD = fdSelect.fdSelect[i]; + if (currentFD !== lastFD) { + ranges.push((i >> 8) & 0xff, i & 0xff, currentFD); + lastFD = currentFD; } } - const g = (n.length - 3) / 3; - n[1] = (g >> 8) & 255; - n[2] = 255 & g; - n.push((a >> 8) & 255, 255 & a); - i = new Uint8Array(n); + const numRanges = (ranges.length - 3) / 3; + ranges[1] = (numRanges >> 8) & 0xff; + ranges[2] = numRanges & 0xff; + ranges.push((i >> 8) & 0xff, i & 0xff); + out = new Uint8Array(ranges); + break; } - return this.compileTypedArray(i); + return this.compileTypedArray(out); } - compileTypedArray(e) { - return Array.from(e); + compileTypedArray(data) { + return Array.from(data); } - compileIndex(e, t = []) { - const i = e.objects, - a = i.length; - if (0 === a) return [0, 0]; - const s = [(a >> 8) & 255, 255 & a]; - let r, - n, - g = 1; - for (r = 0; r < a; ++r) g += i[r].length; - n = g < 256 ? 1 : g < 65536 ? 2 : g < 16777216 ? 3 : 4; - s.push(n); - let o = 1; - for (r = 0; r < a + 1; r++) { - 1 === n - ? s.push(255 & o) - : 2 === n - ? s.push((o >> 8) & 255, 255 & o) - : 3 === n - ? s.push((o >> 16) & 255, (o >> 8) & 255, 255 & o) - : s.push( - (o >>> 24) & 255, - (o >> 16) & 255, - (o >> 8) & 255, - 255 & o, - ); - i[r] && (o += i[r].length); + compileIndex(index, trackers = []) { + const objects = index.objects; + const count = objects.length; + if (count === 0) { + return [0, 0]; } - for (r = 0; r < a; r++) { - t[r] && t[r].offset(s.length); - s.push(...i[r]); + const data = [(count >> 8) & 0xff, count & 0xff]; + let lastOffset = 1, + i; + for (i = 0; i < count; ++i) { + lastOffset += objects[i].length; } - return s; - } -} -const Ni = getLookupTableFactory(function (e) { - e.A = 65; - e.AE = 198; - e.AEacute = 508; - e.AEmacron = 482; - e.AEsmall = 63462; - e.Aacute = 193; - e.Aacutesmall = 63457; - e.Abreve = 258; - e.Abreveacute = 7854; - e.Abrevecyrillic = 1232; - e.Abrevedotbelow = 7862; - e.Abrevegrave = 7856; - e.Abrevehookabove = 7858; - e.Abrevetilde = 7860; - e.Acaron = 461; - e.Acircle = 9398; - e.Acircumflex = 194; - e.Acircumflexacute = 7844; - e.Acircumflexdotbelow = 7852; - e.Acircumflexgrave = 7846; - e.Acircumflexhookabove = 7848; - e.Acircumflexsmall = 63458; - e.Acircumflextilde = 7850; - e.Acute = 63177; - e.Acutesmall = 63412; - e.Acyrillic = 1040; - e.Adblgrave = 512; - e.Adieresis = 196; - e.Adieresiscyrillic = 1234; - e.Adieresismacron = 478; - e.Adieresissmall = 63460; - e.Adotbelow = 7840; - e.Adotmacron = 480; - e.Agrave = 192; - e.Agravesmall = 63456; - e.Ahookabove = 7842; - e.Aiecyrillic = 1236; - e.Ainvertedbreve = 514; - e.Alpha = 913; - e.Alphatonos = 902; - e.Amacron = 256; - e.Amonospace = 65313; - e.Aogonek = 260; - e.Aring = 197; - e.Aringacute = 506; - e.Aringbelow = 7680; - e.Aringsmall = 63461; - e.Asmall = 63329; - e.Atilde = 195; - e.Atildesmall = 63459; - e.Aybarmenian = 1329; - e.B = 66; - e.Bcircle = 9399; - e.Bdotaccent = 7682; - e.Bdotbelow = 7684; - e.Becyrillic = 1041; - e.Benarmenian = 1330; - e.Beta = 914; - e.Bhook = 385; - e.Blinebelow = 7686; - e.Bmonospace = 65314; - e.Brevesmall = 63220; - e.Bsmall = 63330; - e.Btopbar = 386; - e.C = 67; - e.Caarmenian = 1342; - e.Cacute = 262; - e.Caron = 63178; - e.Caronsmall = 63221; - e.Ccaron = 268; - e.Ccedilla = 199; - e.Ccedillaacute = 7688; - e.Ccedillasmall = 63463; - e.Ccircle = 9400; - e.Ccircumflex = 264; - e.Cdot = 266; - e.Cdotaccent = 266; - e.Cedillasmall = 63416; - e.Chaarmenian = 1353; - e.Cheabkhasiancyrillic = 1212; - e.Checyrillic = 1063; - e.Chedescenderabkhasiancyrillic = 1214; - e.Chedescendercyrillic = 1206; - e.Chedieresiscyrillic = 1268; - e.Cheharmenian = 1347; - e.Chekhakassiancyrillic = 1227; - e.Cheverticalstrokecyrillic = 1208; - e.Chi = 935; - e.Chook = 391; - e.Circumflexsmall = 63222; - e.Cmonospace = 65315; - e.Coarmenian = 1361; - e.Csmall = 63331; - e.D = 68; - e.DZ = 497; - e.DZcaron = 452; - e.Daarmenian = 1332; - e.Dafrican = 393; - e.Dcaron = 270; - e.Dcedilla = 7696; - e.Dcircle = 9401; - e.Dcircumflexbelow = 7698; - e.Dcroat = 272; - e.Ddotaccent = 7690; - e.Ddotbelow = 7692; - e.Decyrillic = 1044; - e.Deicoptic = 1006; - e.Delta = 8710; - e.Deltagreek = 916; - e.Dhook = 394; - e.Dieresis = 63179; - e.DieresisAcute = 63180; - e.DieresisGrave = 63181; - e.Dieresissmall = 63400; - e.Digammagreek = 988; - e.Djecyrillic = 1026; - e.Dlinebelow = 7694; - e.Dmonospace = 65316; - e.Dotaccentsmall = 63223; - e.Dslash = 272; - e.Dsmall = 63332; - e.Dtopbar = 395; - e.Dz = 498; - e.Dzcaron = 453; - e.Dzeabkhasiancyrillic = 1248; - e.Dzecyrillic = 1029; - e.Dzhecyrillic = 1039; - e.E = 69; - e.Eacute = 201; - e.Eacutesmall = 63465; - e.Ebreve = 276; - e.Ecaron = 282; - e.Ecedillabreve = 7708; - e.Echarmenian = 1333; - e.Ecircle = 9402; - e.Ecircumflex = 202; - e.Ecircumflexacute = 7870; - e.Ecircumflexbelow = 7704; - e.Ecircumflexdotbelow = 7878; - e.Ecircumflexgrave = 7872; - e.Ecircumflexhookabove = 7874; - e.Ecircumflexsmall = 63466; - e.Ecircumflextilde = 7876; - e.Ecyrillic = 1028; - e.Edblgrave = 516; - e.Edieresis = 203; - e.Edieresissmall = 63467; - e.Edot = 278; - e.Edotaccent = 278; - e.Edotbelow = 7864; - e.Efcyrillic = 1060; - e.Egrave = 200; - e.Egravesmall = 63464; - e.Eharmenian = 1335; - e.Ehookabove = 7866; - e.Eightroman = 8551; - e.Einvertedbreve = 518; - e.Eiotifiedcyrillic = 1124; - e.Elcyrillic = 1051; - e.Elevenroman = 8554; - e.Emacron = 274; - e.Emacronacute = 7702; - e.Emacrongrave = 7700; - e.Emcyrillic = 1052; - e.Emonospace = 65317; - e.Encyrillic = 1053; - e.Endescendercyrillic = 1186; - e.Eng = 330; - e.Enghecyrillic = 1188; - e.Enhookcyrillic = 1223; - e.Eogonek = 280; - e.Eopen = 400; - e.Epsilon = 917; - e.Epsilontonos = 904; - e.Ercyrillic = 1056; - e.Ereversed = 398; - e.Ereversedcyrillic = 1069; - e.Escyrillic = 1057; - e.Esdescendercyrillic = 1194; - e.Esh = 425; - e.Esmall = 63333; - e.Eta = 919; - e.Etarmenian = 1336; - e.Etatonos = 905; - e.Eth = 208; - e.Ethsmall = 63472; - e.Etilde = 7868; - e.Etildebelow = 7706; - e.Euro = 8364; - e.Ezh = 439; - e.Ezhcaron = 494; - e.Ezhreversed = 440; - e.F = 70; - e.Fcircle = 9403; - e.Fdotaccent = 7710; - e.Feharmenian = 1366; - e.Feicoptic = 996; - e.Fhook = 401; - e.Fitacyrillic = 1138; - e.Fiveroman = 8548; - e.Fmonospace = 65318; - e.Fourroman = 8547; - e.Fsmall = 63334; - e.G = 71; - e.GBsquare = 13191; - e.Gacute = 500; - e.Gamma = 915; - e.Gammaafrican = 404; - e.Gangiacoptic = 1002; - e.Gbreve = 286; - e.Gcaron = 486; - e.Gcedilla = 290; - e.Gcircle = 9404; - e.Gcircumflex = 284; - e.Gcommaaccent = 290; - e.Gdot = 288; - e.Gdotaccent = 288; - e.Gecyrillic = 1043; - e.Ghadarmenian = 1346; - e.Ghemiddlehookcyrillic = 1172; - e.Ghestrokecyrillic = 1170; - e.Gheupturncyrillic = 1168; - e.Ghook = 403; - e.Gimarmenian = 1331; - e.Gjecyrillic = 1027; - e.Gmacron = 7712; - e.Gmonospace = 65319; - e.Grave = 63182; - e.Gravesmall = 63328; - e.Gsmall = 63335; - e.Gsmallhook = 667; - e.Gstroke = 484; - e.H = 72; - e.H18533 = 9679; - e.H18543 = 9642; - e.H18551 = 9643; - e.H22073 = 9633; - e.HPsquare = 13259; - e.Haabkhasiancyrillic = 1192; - e.Hadescendercyrillic = 1202; - e.Hardsigncyrillic = 1066; - e.Hbar = 294; - e.Hbrevebelow = 7722; - e.Hcedilla = 7720; - e.Hcircle = 9405; - e.Hcircumflex = 292; - e.Hdieresis = 7718; - e.Hdotaccent = 7714; - e.Hdotbelow = 7716; - e.Hmonospace = 65320; - e.Hoarmenian = 1344; - e.Horicoptic = 1e3; - e.Hsmall = 63336; - e.Hungarumlaut = 63183; - e.Hungarumlautsmall = 63224; - e.Hzsquare = 13200; - e.I = 73; - e.IAcyrillic = 1071; - e.IJ = 306; - e.IUcyrillic = 1070; - e.Iacute = 205; - e.Iacutesmall = 63469; - e.Ibreve = 300; - e.Icaron = 463; - e.Icircle = 9406; - e.Icircumflex = 206; - e.Icircumflexsmall = 63470; - e.Icyrillic = 1030; - e.Idblgrave = 520; - e.Idieresis = 207; - e.Idieresisacute = 7726; - e.Idieresiscyrillic = 1252; - e.Idieresissmall = 63471; - e.Idot = 304; - e.Idotaccent = 304; - e.Idotbelow = 7882; - e.Iebrevecyrillic = 1238; - e.Iecyrillic = 1045; - e.Ifraktur = 8465; - e.Igrave = 204; - e.Igravesmall = 63468; - e.Ihookabove = 7880; - e.Iicyrillic = 1048; - e.Iinvertedbreve = 522; - e.Iishortcyrillic = 1049; - e.Imacron = 298; - e.Imacroncyrillic = 1250; - e.Imonospace = 65321; - e.Iniarmenian = 1339; - e.Iocyrillic = 1025; - e.Iogonek = 302; - e.Iota = 921; - e.Iotaafrican = 406; - e.Iotadieresis = 938; - e.Iotatonos = 906; - e.Ismall = 63337; - e.Istroke = 407; - e.Itilde = 296; - e.Itildebelow = 7724; - e.Izhitsacyrillic = 1140; - e.Izhitsadblgravecyrillic = 1142; - e.J = 74; - e.Jaarmenian = 1345; - e.Jcircle = 9407; - e.Jcircumflex = 308; - e.Jecyrillic = 1032; - e.Jheharmenian = 1355; - e.Jmonospace = 65322; - e.Jsmall = 63338; - e.K = 75; - e.KBsquare = 13189; - e.KKsquare = 13261; - e.Kabashkircyrillic = 1184; - e.Kacute = 7728; - e.Kacyrillic = 1050; - e.Kadescendercyrillic = 1178; - e.Kahookcyrillic = 1219; - e.Kappa = 922; - e.Kastrokecyrillic = 1182; - e.Kaverticalstrokecyrillic = 1180; - e.Kcaron = 488; - e.Kcedilla = 310; - e.Kcircle = 9408; - e.Kcommaaccent = 310; - e.Kdotbelow = 7730; - e.Keharmenian = 1364; - e.Kenarmenian = 1343; - e.Khacyrillic = 1061; - e.Kheicoptic = 998; - e.Khook = 408; - e.Kjecyrillic = 1036; - e.Klinebelow = 7732; - e.Kmonospace = 65323; - e.Koppacyrillic = 1152; - e.Koppagreek = 990; - e.Ksicyrillic = 1134; - e.Ksmall = 63339; - e.L = 76; - e.LJ = 455; - e.LL = 63167; - e.Lacute = 313; - e.Lambda = 923; - e.Lcaron = 317; - e.Lcedilla = 315; - e.Lcircle = 9409; - e.Lcircumflexbelow = 7740; - e.Lcommaaccent = 315; - e.Ldot = 319; - e.Ldotaccent = 319; - e.Ldotbelow = 7734; - e.Ldotbelowmacron = 7736; - e.Liwnarmenian = 1340; - e.Lj = 456; - e.Ljecyrillic = 1033; - e.Llinebelow = 7738; - e.Lmonospace = 65324; - e.Lslash = 321; - e.Lslashsmall = 63225; - e.Lsmall = 63340; - e.M = 77; - e.MBsquare = 13190; - e.Macron = 63184; - e.Macronsmall = 63407; - e.Macute = 7742; - e.Mcircle = 9410; - e.Mdotaccent = 7744; - e.Mdotbelow = 7746; - e.Menarmenian = 1348; - e.Mmonospace = 65325; - e.Msmall = 63341; - e.Mturned = 412; - e.Mu = 924; - e.N = 78; - e.NJ = 458; - e.Nacute = 323; - e.Ncaron = 327; - e.Ncedilla = 325; - e.Ncircle = 9411; - e.Ncircumflexbelow = 7754; - e.Ncommaaccent = 325; - e.Ndotaccent = 7748; - e.Ndotbelow = 7750; - e.Nhookleft = 413; - e.Nineroman = 8552; - e.Nj = 459; - e.Njecyrillic = 1034; - e.Nlinebelow = 7752; - e.Nmonospace = 65326; - e.Nowarmenian = 1350; - e.Nsmall = 63342; - e.Ntilde = 209; - e.Ntildesmall = 63473; - e.Nu = 925; - e.O = 79; - e.OE = 338; - e.OEsmall = 63226; - e.Oacute = 211; - e.Oacutesmall = 63475; - e.Obarredcyrillic = 1256; - e.Obarreddieresiscyrillic = 1258; - e.Obreve = 334; - e.Ocaron = 465; - e.Ocenteredtilde = 415; - e.Ocircle = 9412; - e.Ocircumflex = 212; - e.Ocircumflexacute = 7888; - e.Ocircumflexdotbelow = 7896; - e.Ocircumflexgrave = 7890; - e.Ocircumflexhookabove = 7892; - e.Ocircumflexsmall = 63476; - e.Ocircumflextilde = 7894; - e.Ocyrillic = 1054; - e.Odblacute = 336; - e.Odblgrave = 524; - e.Odieresis = 214; - e.Odieresiscyrillic = 1254; - e.Odieresissmall = 63478; - e.Odotbelow = 7884; - e.Ogoneksmall = 63227; - e.Ograve = 210; - e.Ogravesmall = 63474; - e.Oharmenian = 1365; - e.Ohm = 8486; - e.Ohookabove = 7886; - e.Ohorn = 416; - e.Ohornacute = 7898; - e.Ohorndotbelow = 7906; - e.Ohorngrave = 7900; - e.Ohornhookabove = 7902; - e.Ohorntilde = 7904; - e.Ohungarumlaut = 336; - e.Oi = 418; - e.Oinvertedbreve = 526; - e.Omacron = 332; - e.Omacronacute = 7762; - e.Omacrongrave = 7760; - e.Omega = 8486; - e.Omegacyrillic = 1120; - e.Omegagreek = 937; - e.Omegaroundcyrillic = 1146; - e.Omegatitlocyrillic = 1148; - e.Omegatonos = 911; - e.Omicron = 927; - e.Omicrontonos = 908; - e.Omonospace = 65327; - e.Oneroman = 8544; - e.Oogonek = 490; - e.Oogonekmacron = 492; - e.Oopen = 390; - e.Oslash = 216; - e.Oslashacute = 510; - e.Oslashsmall = 63480; - e.Osmall = 63343; - e.Ostrokeacute = 510; - e.Otcyrillic = 1150; - e.Otilde = 213; - e.Otildeacute = 7756; - e.Otildedieresis = 7758; - e.Otildesmall = 63477; - e.P = 80; - e.Pacute = 7764; - e.Pcircle = 9413; - e.Pdotaccent = 7766; - e.Pecyrillic = 1055; - e.Peharmenian = 1354; - e.Pemiddlehookcyrillic = 1190; - e.Phi = 934; - e.Phook = 420; - e.Pi = 928; - e.Piwrarmenian = 1363; - e.Pmonospace = 65328; - e.Psi = 936; - e.Psicyrillic = 1136; - e.Psmall = 63344; - e.Q = 81; - e.Qcircle = 9414; - e.Qmonospace = 65329; - e.Qsmall = 63345; - e.R = 82; - e.Raarmenian = 1356; - e.Racute = 340; - e.Rcaron = 344; - e.Rcedilla = 342; - e.Rcircle = 9415; - e.Rcommaaccent = 342; - e.Rdblgrave = 528; - e.Rdotaccent = 7768; - e.Rdotbelow = 7770; - e.Rdotbelowmacron = 7772; - e.Reharmenian = 1360; - e.Rfraktur = 8476; - e.Rho = 929; - e.Ringsmall = 63228; - e.Rinvertedbreve = 530; - e.Rlinebelow = 7774; - e.Rmonospace = 65330; - e.Rsmall = 63346; - e.Rsmallinverted = 641; - e.Rsmallinvertedsuperior = 694; - e.S = 83; - e.SF010000 = 9484; - e.SF020000 = 9492; - e.SF030000 = 9488; - e.SF040000 = 9496; - e.SF050000 = 9532; - e.SF060000 = 9516; - e.SF070000 = 9524; - e.SF080000 = 9500; - e.SF090000 = 9508; - e.SF100000 = 9472; - e.SF110000 = 9474; - e.SF190000 = 9569; - e.SF200000 = 9570; - e.SF210000 = 9558; - e.SF220000 = 9557; - e.SF230000 = 9571; - e.SF240000 = 9553; - e.SF250000 = 9559; - e.SF260000 = 9565; - e.SF270000 = 9564; - e.SF280000 = 9563; - e.SF360000 = 9566; - e.SF370000 = 9567; - e.SF380000 = 9562; - e.SF390000 = 9556; - e.SF400000 = 9577; - e.SF410000 = 9574; - e.SF420000 = 9568; - e.SF430000 = 9552; - e.SF440000 = 9580; - e.SF450000 = 9575; - e.SF460000 = 9576; - e.SF470000 = 9572; - e.SF480000 = 9573; - e.SF490000 = 9561; - e.SF500000 = 9560; - e.SF510000 = 9554; - e.SF520000 = 9555; - e.SF530000 = 9579; - e.SF540000 = 9578; - e.Sacute = 346; - e.Sacutedotaccent = 7780; - e.Sampigreek = 992; - e.Scaron = 352; - e.Scarondotaccent = 7782; - e.Scaronsmall = 63229; - e.Scedilla = 350; - e.Schwa = 399; - e.Schwacyrillic = 1240; - e.Schwadieresiscyrillic = 1242; - e.Scircle = 9416; - e.Scircumflex = 348; - e.Scommaaccent = 536; - e.Sdotaccent = 7776; - e.Sdotbelow = 7778; - e.Sdotbelowdotaccent = 7784; - e.Seharmenian = 1357; - e.Sevenroman = 8550; - e.Shaarmenian = 1351; - e.Shacyrillic = 1064; - e.Shchacyrillic = 1065; - e.Sheicoptic = 994; - e.Shhacyrillic = 1210; - e.Shimacoptic = 1004; - e.Sigma = 931; - e.Sixroman = 8549; - e.Smonospace = 65331; - e.Softsigncyrillic = 1068; - e.Ssmall = 63347; - e.Stigmagreek = 986; - e.T = 84; - e.Tau = 932; - e.Tbar = 358; - e.Tcaron = 356; - e.Tcedilla = 354; - e.Tcircle = 9417; - e.Tcircumflexbelow = 7792; - e.Tcommaaccent = 354; - e.Tdotaccent = 7786; - e.Tdotbelow = 7788; - e.Tecyrillic = 1058; - e.Tedescendercyrillic = 1196; - e.Tenroman = 8553; - e.Tetsecyrillic = 1204; - e.Theta = 920; - e.Thook = 428; - e.Thorn = 222; - e.Thornsmall = 63486; - e.Threeroman = 8546; - e.Tildesmall = 63230; - e.Tiwnarmenian = 1359; - e.Tlinebelow = 7790; - e.Tmonospace = 65332; - e.Toarmenian = 1337; - e.Tonefive = 444; - e.Tonesix = 388; - e.Tonetwo = 423; - e.Tretroflexhook = 430; - e.Tsecyrillic = 1062; - e.Tshecyrillic = 1035; - e.Tsmall = 63348; - e.Twelveroman = 8555; - e.Tworoman = 8545; - e.U = 85; - e.Uacute = 218; - e.Uacutesmall = 63482; - e.Ubreve = 364; - e.Ucaron = 467; - e.Ucircle = 9418; - e.Ucircumflex = 219; - e.Ucircumflexbelow = 7798; - e.Ucircumflexsmall = 63483; - e.Ucyrillic = 1059; - e.Udblacute = 368; - e.Udblgrave = 532; - e.Udieresis = 220; - e.Udieresisacute = 471; - e.Udieresisbelow = 7794; - e.Udieresiscaron = 473; - e.Udieresiscyrillic = 1264; - e.Udieresisgrave = 475; - e.Udieresismacron = 469; - e.Udieresissmall = 63484; - e.Udotbelow = 7908; - e.Ugrave = 217; - e.Ugravesmall = 63481; - e.Uhookabove = 7910; - e.Uhorn = 431; - e.Uhornacute = 7912; - e.Uhorndotbelow = 7920; - e.Uhorngrave = 7914; - e.Uhornhookabove = 7916; - e.Uhorntilde = 7918; - e.Uhungarumlaut = 368; - e.Uhungarumlautcyrillic = 1266; - e.Uinvertedbreve = 534; - e.Ukcyrillic = 1144; - e.Umacron = 362; - e.Umacroncyrillic = 1262; - e.Umacrondieresis = 7802; - e.Umonospace = 65333; - e.Uogonek = 370; - e.Upsilon = 933; - e.Upsilon1 = 978; - e.Upsilonacutehooksymbolgreek = 979; - e.Upsilonafrican = 433; - e.Upsilondieresis = 939; - e.Upsilondieresishooksymbolgreek = 980; - e.Upsilonhooksymbol = 978; - e.Upsilontonos = 910; - e.Uring = 366; - e.Ushortcyrillic = 1038; - e.Usmall = 63349; - e.Ustraightcyrillic = 1198; - e.Ustraightstrokecyrillic = 1200; - e.Utilde = 360; - e.Utildeacute = 7800; - e.Utildebelow = 7796; - e.V = 86; - e.Vcircle = 9419; - e.Vdotbelow = 7806; - e.Vecyrillic = 1042; - e.Vewarmenian = 1358; - e.Vhook = 434; - e.Vmonospace = 65334; - e.Voarmenian = 1352; - e.Vsmall = 63350; - e.Vtilde = 7804; - e.W = 87; - e.Wacute = 7810; - e.Wcircle = 9420; - e.Wcircumflex = 372; - e.Wdieresis = 7812; - e.Wdotaccent = 7814; - e.Wdotbelow = 7816; - e.Wgrave = 7808; - e.Wmonospace = 65335; - e.Wsmall = 63351; - e.X = 88; - e.Xcircle = 9421; - e.Xdieresis = 7820; - e.Xdotaccent = 7818; - e.Xeharmenian = 1341; - e.Xi = 926; - e.Xmonospace = 65336; - e.Xsmall = 63352; - e.Y = 89; - e.Yacute = 221; - e.Yacutesmall = 63485; - e.Yatcyrillic = 1122; - e.Ycircle = 9422; - e.Ycircumflex = 374; - e.Ydieresis = 376; - e.Ydieresissmall = 63487; - e.Ydotaccent = 7822; - e.Ydotbelow = 7924; - e.Yericyrillic = 1067; - e.Yerudieresiscyrillic = 1272; - e.Ygrave = 7922; - e.Yhook = 435; - e.Yhookabove = 7926; - e.Yiarmenian = 1349; - e.Yicyrillic = 1031; - e.Yiwnarmenian = 1362; - e.Ymonospace = 65337; - e.Ysmall = 63353; - e.Ytilde = 7928; - e.Yusbigcyrillic = 1130; - e.Yusbigiotifiedcyrillic = 1132; - e.Yuslittlecyrillic = 1126; - e.Yuslittleiotifiedcyrillic = 1128; - e.Z = 90; - e.Zaarmenian = 1334; - e.Zacute = 377; - e.Zcaron = 381; - e.Zcaronsmall = 63231; - e.Zcircle = 9423; - e.Zcircumflex = 7824; - e.Zdot = 379; - e.Zdotaccent = 379; - e.Zdotbelow = 7826; - e.Zecyrillic = 1047; - e.Zedescendercyrillic = 1176; - e.Zedieresiscyrillic = 1246; - e.Zeta = 918; - e.Zhearmenian = 1338; - e.Zhebrevecyrillic = 1217; - e.Zhecyrillic = 1046; - e.Zhedescendercyrillic = 1174; - e.Zhedieresiscyrillic = 1244; - e.Zlinebelow = 7828; - e.Zmonospace = 65338; - e.Zsmall = 63354; - e.Zstroke = 437; - e.a = 97; - e.aabengali = 2438; - e.aacute = 225; - e.aadeva = 2310; - e.aagujarati = 2694; - e.aagurmukhi = 2566; - e.aamatragurmukhi = 2622; - e.aarusquare = 13059; - e.aavowelsignbengali = 2494; - e.aavowelsigndeva = 2366; - e.aavowelsigngujarati = 2750; - e.abbreviationmarkarmenian = 1375; - e.abbreviationsigndeva = 2416; - e.abengali = 2437; - e.abopomofo = 12570; - e.abreve = 259; - e.abreveacute = 7855; - e.abrevecyrillic = 1233; - e.abrevedotbelow = 7863; - e.abrevegrave = 7857; - e.abrevehookabove = 7859; - e.abrevetilde = 7861; - e.acaron = 462; - e.acircle = 9424; - e.acircumflex = 226; - e.acircumflexacute = 7845; - e.acircumflexdotbelow = 7853; - e.acircumflexgrave = 7847; - e.acircumflexhookabove = 7849; - e.acircumflextilde = 7851; - e.acute = 180; - e.acutebelowcmb = 791; - e.acutecmb = 769; - e.acutecomb = 769; - e.acutedeva = 2388; - e.acutelowmod = 719; - e.acutetonecmb = 833; - e.acyrillic = 1072; - e.adblgrave = 513; - e.addakgurmukhi = 2673; - e.adeva = 2309; - e.adieresis = 228; - e.adieresiscyrillic = 1235; - e.adieresismacron = 479; - e.adotbelow = 7841; - e.adotmacron = 481; - e.ae = 230; - e.aeacute = 509; - e.aekorean = 12624; - e.aemacron = 483; - e.afii00208 = 8213; - e.afii08941 = 8356; - e.afii10017 = 1040; - e.afii10018 = 1041; - e.afii10019 = 1042; - e.afii10020 = 1043; - e.afii10021 = 1044; - e.afii10022 = 1045; - e.afii10023 = 1025; - e.afii10024 = 1046; - e.afii10025 = 1047; - e.afii10026 = 1048; - e.afii10027 = 1049; - e.afii10028 = 1050; - e.afii10029 = 1051; - e.afii10030 = 1052; - e.afii10031 = 1053; - e.afii10032 = 1054; - e.afii10033 = 1055; - e.afii10034 = 1056; - e.afii10035 = 1057; - e.afii10036 = 1058; - e.afii10037 = 1059; - e.afii10038 = 1060; - e.afii10039 = 1061; - e.afii10040 = 1062; - e.afii10041 = 1063; - e.afii10042 = 1064; - e.afii10043 = 1065; - e.afii10044 = 1066; - e.afii10045 = 1067; - e.afii10046 = 1068; - e.afii10047 = 1069; - e.afii10048 = 1070; - e.afii10049 = 1071; - e.afii10050 = 1168; - e.afii10051 = 1026; - e.afii10052 = 1027; - e.afii10053 = 1028; - e.afii10054 = 1029; - e.afii10055 = 1030; - e.afii10056 = 1031; - e.afii10057 = 1032; - e.afii10058 = 1033; - e.afii10059 = 1034; - e.afii10060 = 1035; - e.afii10061 = 1036; - e.afii10062 = 1038; - e.afii10063 = 63172; - e.afii10064 = 63173; - e.afii10065 = 1072; - e.afii10066 = 1073; - e.afii10067 = 1074; - e.afii10068 = 1075; - e.afii10069 = 1076; - e.afii10070 = 1077; - e.afii10071 = 1105; - e.afii10072 = 1078; - e.afii10073 = 1079; - e.afii10074 = 1080; - e.afii10075 = 1081; - e.afii10076 = 1082; - e.afii10077 = 1083; - e.afii10078 = 1084; - e.afii10079 = 1085; - e.afii10080 = 1086; - e.afii10081 = 1087; - e.afii10082 = 1088; - e.afii10083 = 1089; - e.afii10084 = 1090; - e.afii10085 = 1091; - e.afii10086 = 1092; - e.afii10087 = 1093; - e.afii10088 = 1094; - e.afii10089 = 1095; - e.afii10090 = 1096; - e.afii10091 = 1097; - e.afii10092 = 1098; - e.afii10093 = 1099; - e.afii10094 = 1100; - e.afii10095 = 1101; - e.afii10096 = 1102; - e.afii10097 = 1103; - e.afii10098 = 1169; - e.afii10099 = 1106; - e.afii10100 = 1107; - e.afii10101 = 1108; - e.afii10102 = 1109; - e.afii10103 = 1110; - e.afii10104 = 1111; - e.afii10105 = 1112; - e.afii10106 = 1113; - e.afii10107 = 1114; - e.afii10108 = 1115; - e.afii10109 = 1116; - e.afii10110 = 1118; - e.afii10145 = 1039; - e.afii10146 = 1122; - e.afii10147 = 1138; - e.afii10148 = 1140; - e.afii10192 = 63174; - e.afii10193 = 1119; - e.afii10194 = 1123; - e.afii10195 = 1139; - e.afii10196 = 1141; - e.afii10831 = 63175; - e.afii10832 = 63176; - e.afii10846 = 1241; - e.afii299 = 8206; - e.afii300 = 8207; - e.afii301 = 8205; - e.afii57381 = 1642; - e.afii57388 = 1548; - e.afii57392 = 1632; - e.afii57393 = 1633; - e.afii57394 = 1634; - e.afii57395 = 1635; - e.afii57396 = 1636; - e.afii57397 = 1637; - e.afii57398 = 1638; - e.afii57399 = 1639; - e.afii57400 = 1640; - e.afii57401 = 1641; - e.afii57403 = 1563; - e.afii57407 = 1567; - e.afii57409 = 1569; - e.afii57410 = 1570; - e.afii57411 = 1571; - e.afii57412 = 1572; - e.afii57413 = 1573; - e.afii57414 = 1574; - e.afii57415 = 1575; - e.afii57416 = 1576; - e.afii57417 = 1577; - e.afii57418 = 1578; - e.afii57419 = 1579; - e.afii57420 = 1580; - e.afii57421 = 1581; - e.afii57422 = 1582; - e.afii57423 = 1583; - e.afii57424 = 1584; - e.afii57425 = 1585; - e.afii57426 = 1586; - e.afii57427 = 1587; - e.afii57428 = 1588; - e.afii57429 = 1589; - e.afii57430 = 1590; - e.afii57431 = 1591; - e.afii57432 = 1592; - e.afii57433 = 1593; - e.afii57434 = 1594; - e.afii57440 = 1600; - e.afii57441 = 1601; - e.afii57442 = 1602; - e.afii57443 = 1603; - e.afii57444 = 1604; - e.afii57445 = 1605; - e.afii57446 = 1606; - e.afii57448 = 1608; - e.afii57449 = 1609; - e.afii57450 = 1610; - e.afii57451 = 1611; - e.afii57452 = 1612; - e.afii57453 = 1613; - e.afii57454 = 1614; - e.afii57455 = 1615; - e.afii57456 = 1616; - e.afii57457 = 1617; - e.afii57458 = 1618; - e.afii57470 = 1607; - e.afii57505 = 1700; - e.afii57506 = 1662; - e.afii57507 = 1670; - e.afii57508 = 1688; - e.afii57509 = 1711; - e.afii57511 = 1657; - e.afii57512 = 1672; - e.afii57513 = 1681; - e.afii57514 = 1722; - e.afii57519 = 1746; - e.afii57534 = 1749; - e.afii57636 = 8362; - e.afii57645 = 1470; - e.afii57658 = 1475; - e.afii57664 = 1488; - e.afii57665 = 1489; - e.afii57666 = 1490; - e.afii57667 = 1491; - e.afii57668 = 1492; - e.afii57669 = 1493; - e.afii57670 = 1494; - e.afii57671 = 1495; - e.afii57672 = 1496; - e.afii57673 = 1497; - e.afii57674 = 1498; - e.afii57675 = 1499; - e.afii57676 = 1500; - e.afii57677 = 1501; - e.afii57678 = 1502; - e.afii57679 = 1503; - e.afii57680 = 1504; - e.afii57681 = 1505; - e.afii57682 = 1506; - e.afii57683 = 1507; - e.afii57684 = 1508; - e.afii57685 = 1509; - e.afii57686 = 1510; - e.afii57687 = 1511; - e.afii57688 = 1512; - e.afii57689 = 1513; - e.afii57690 = 1514; - e.afii57694 = 64298; - e.afii57695 = 64299; - e.afii57700 = 64331; - e.afii57705 = 64287; - e.afii57716 = 1520; - e.afii57717 = 1521; - e.afii57718 = 1522; - e.afii57723 = 64309; - e.afii57793 = 1460; - e.afii57794 = 1461; - e.afii57795 = 1462; - e.afii57796 = 1467; - e.afii57797 = 1464; - e.afii57798 = 1463; - e.afii57799 = 1456; - e.afii57800 = 1458; - e.afii57801 = 1457; - e.afii57802 = 1459; - e.afii57803 = 1474; - e.afii57804 = 1473; - e.afii57806 = 1465; - e.afii57807 = 1468; - e.afii57839 = 1469; - e.afii57841 = 1471; - e.afii57842 = 1472; - e.afii57929 = 700; - e.afii61248 = 8453; - e.afii61289 = 8467; - e.afii61352 = 8470; - e.afii61573 = 8236; - e.afii61574 = 8237; - e.afii61575 = 8238; - e.afii61664 = 8204; - e.afii63167 = 1645; - e.afii64937 = 701; - e.agrave = 224; - e.agujarati = 2693; - e.agurmukhi = 2565; - e.ahiragana = 12354; - e.ahookabove = 7843; - e.aibengali = 2448; - e.aibopomofo = 12574; - e.aideva = 2320; - e.aiecyrillic = 1237; - e.aigujarati = 2704; - e.aigurmukhi = 2576; - e.aimatragurmukhi = 2632; - e.ainarabic = 1593; - e.ainfinalarabic = 65226; - e.aininitialarabic = 65227; - e.ainmedialarabic = 65228; - e.ainvertedbreve = 515; - e.aivowelsignbengali = 2504; - e.aivowelsigndeva = 2376; - e.aivowelsigngujarati = 2760; - e.akatakana = 12450; - e.akatakanahalfwidth = 65393; - e.akorean = 12623; - e.alef = 1488; - e.alefarabic = 1575; - e.alefdageshhebrew = 64304; - e.aleffinalarabic = 65166; - e.alefhamzaabovearabic = 1571; - e.alefhamzaabovefinalarabic = 65156; - e.alefhamzabelowarabic = 1573; - e.alefhamzabelowfinalarabic = 65160; - e.alefhebrew = 1488; - e.aleflamedhebrew = 64335; - e.alefmaddaabovearabic = 1570; - e.alefmaddaabovefinalarabic = 65154; - e.alefmaksuraarabic = 1609; - e.alefmaksurafinalarabic = 65264; - e.alefmaksurainitialarabic = 65267; - e.alefmaksuramedialarabic = 65268; - e.alefpatahhebrew = 64302; - e.alefqamatshebrew = 64303; - e.aleph = 8501; - e.allequal = 8780; - e.alpha = 945; - e.alphatonos = 940; - e.amacron = 257; - e.amonospace = 65345; - e.ampersand = 38; - e.ampersandmonospace = 65286; - e.ampersandsmall = 63270; - e.amsquare = 13250; - e.anbopomofo = 12578; - e.angbopomofo = 12580; - e.angbracketleft = 12296; - e.angbracketright = 12297; - e.angkhankhuthai = 3674; - e.angle = 8736; - e.anglebracketleft = 12296; - e.anglebracketleftvertical = 65087; - e.anglebracketright = 12297; - e.anglebracketrightvertical = 65088; - e.angleleft = 9001; - e.angleright = 9002; - e.angstrom = 8491; - e.anoteleia = 903; - e.anudattadeva = 2386; - e.anusvarabengali = 2434; - e.anusvaradeva = 2306; - e.anusvaragujarati = 2690; - e.aogonek = 261; - e.apaatosquare = 13056; - e.aparen = 9372; - e.apostrophearmenian = 1370; - e.apostrophemod = 700; - e.apple = 63743; - e.approaches = 8784; - e.approxequal = 8776; - e.approxequalorimage = 8786; - e.approximatelyequal = 8773; - e.araeaekorean = 12686; - e.araeakorean = 12685; - e.arc = 8978; - e.arighthalfring = 7834; - e.aring = 229; - e.aringacute = 507; - e.aringbelow = 7681; - e.arrowboth = 8596; - e.arrowdashdown = 8675; - e.arrowdashleft = 8672; - e.arrowdashright = 8674; - e.arrowdashup = 8673; - e.arrowdblboth = 8660; - e.arrowdbldown = 8659; - e.arrowdblleft = 8656; - e.arrowdblright = 8658; - e.arrowdblup = 8657; - e.arrowdown = 8595; - e.arrowdownleft = 8601; - e.arrowdownright = 8600; - e.arrowdownwhite = 8681; - e.arrowheaddownmod = 709; - e.arrowheadleftmod = 706; - e.arrowheadrightmod = 707; - e.arrowheadupmod = 708; - e.arrowhorizex = 63719; - e.arrowleft = 8592; - e.arrowleftdbl = 8656; - e.arrowleftdblstroke = 8653; - e.arrowleftoverright = 8646; - e.arrowleftwhite = 8678; - e.arrowright = 8594; - e.arrowrightdblstroke = 8655; - e.arrowrightheavy = 10142; - e.arrowrightoverleft = 8644; - e.arrowrightwhite = 8680; - e.arrowtableft = 8676; - e.arrowtabright = 8677; - e.arrowup = 8593; - e.arrowupdn = 8597; - e.arrowupdnbse = 8616; - e.arrowupdownbase = 8616; - e.arrowupleft = 8598; - e.arrowupleftofdown = 8645; - e.arrowupright = 8599; - e.arrowupwhite = 8679; - e.arrowvertex = 63718; - e.asciicircum = 94; - e.asciicircummonospace = 65342; - e.asciitilde = 126; - e.asciitildemonospace = 65374; - e.ascript = 593; - e.ascriptturned = 594; - e.asmallhiragana = 12353; - e.asmallkatakana = 12449; - e.asmallkatakanahalfwidth = 65383; - e.asterisk = 42; - e.asteriskaltonearabic = 1645; - e.asteriskarabic = 1645; - e.asteriskmath = 8727; - e.asteriskmonospace = 65290; - e.asterisksmall = 65121; - e.asterism = 8258; - e.asuperior = 63209; - e.asymptoticallyequal = 8771; - e.at = 64; - e.atilde = 227; - e.atmonospace = 65312; - e.atsmall = 65131; - e.aturned = 592; - e.aubengali = 2452; - e.aubopomofo = 12576; - e.audeva = 2324; - e.augujarati = 2708; - e.augurmukhi = 2580; - e.aulengthmarkbengali = 2519; - e.aumatragurmukhi = 2636; - e.auvowelsignbengali = 2508; - e.auvowelsigndeva = 2380; - e.auvowelsigngujarati = 2764; - e.avagrahadeva = 2365; - e.aybarmenian = 1377; - e.ayin = 1506; - e.ayinaltonehebrew = 64288; - e.ayinhebrew = 1506; - e.b = 98; - e.babengali = 2476; - e.backslash = 92; - e.backslashmonospace = 65340; - e.badeva = 2348; - e.bagujarati = 2732; - e.bagurmukhi = 2604; - e.bahiragana = 12400; - e.bahtthai = 3647; - e.bakatakana = 12496; - e.bar = 124; - e.barmonospace = 65372; - e.bbopomofo = 12549; - e.bcircle = 9425; - e.bdotaccent = 7683; - e.bdotbelow = 7685; - e.beamedsixteenthnotes = 9836; - e.because = 8757; - e.becyrillic = 1073; - e.beharabic = 1576; - e.behfinalarabic = 65168; - e.behinitialarabic = 65169; - e.behiragana = 12409; - e.behmedialarabic = 65170; - e.behmeeminitialarabic = 64671; - e.behmeemisolatedarabic = 64520; - e.behnoonfinalarabic = 64621; - e.bekatakana = 12505; - e.benarmenian = 1378; - e.bet = 1489; - e.beta = 946; - e.betasymbolgreek = 976; - e.betdagesh = 64305; - e.betdageshhebrew = 64305; - e.bethebrew = 1489; - e.betrafehebrew = 64332; - e.bhabengali = 2477; - e.bhadeva = 2349; - e.bhagujarati = 2733; - e.bhagurmukhi = 2605; - e.bhook = 595; - e.bihiragana = 12403; - e.bikatakana = 12499; - e.bilabialclick = 664; - e.bindigurmukhi = 2562; - e.birusquare = 13105; - e.blackcircle = 9679; - e.blackdiamond = 9670; - e.blackdownpointingtriangle = 9660; - e.blackleftpointingpointer = 9668; - e.blackleftpointingtriangle = 9664; - e.blacklenticularbracketleft = 12304; - e.blacklenticularbracketleftvertical = 65083; - e.blacklenticularbracketright = 12305; - e.blacklenticularbracketrightvertical = 65084; - e.blacklowerlefttriangle = 9699; - e.blacklowerrighttriangle = 9698; - e.blackrectangle = 9644; - e.blackrightpointingpointer = 9658; - e.blackrightpointingtriangle = 9654; - e.blacksmallsquare = 9642; - e.blacksmilingface = 9787; - e.blacksquare = 9632; - e.blackstar = 9733; - e.blackupperlefttriangle = 9700; - e.blackupperrighttriangle = 9701; - e.blackuppointingsmalltriangle = 9652; - e.blackuppointingtriangle = 9650; - e.blank = 9251; - e.blinebelow = 7687; - e.block = 9608; - e.bmonospace = 65346; - e.bobaimaithai = 3610; - e.bohiragana = 12412; - e.bokatakana = 12508; - e.bparen = 9373; - e.bqsquare = 13251; - e.braceex = 63732; - e.braceleft = 123; - e.braceleftbt = 63731; - e.braceleftmid = 63730; - e.braceleftmonospace = 65371; - e.braceleftsmall = 65115; - e.bracelefttp = 63729; - e.braceleftvertical = 65079; - e.braceright = 125; - e.bracerightbt = 63742; - e.bracerightmid = 63741; - e.bracerightmonospace = 65373; - e.bracerightsmall = 65116; - e.bracerighttp = 63740; - e.bracerightvertical = 65080; - e.bracketleft = 91; - e.bracketleftbt = 63728; - e.bracketleftex = 63727; - e.bracketleftmonospace = 65339; - e.bracketlefttp = 63726; - e.bracketright = 93; - e.bracketrightbt = 63739; - e.bracketrightex = 63738; - e.bracketrightmonospace = 65341; - e.bracketrighttp = 63737; - e.breve = 728; - e.brevebelowcmb = 814; - e.brevecmb = 774; - e.breveinvertedbelowcmb = 815; - e.breveinvertedcmb = 785; - e.breveinverteddoublecmb = 865; - e.bridgebelowcmb = 810; - e.bridgeinvertedbelowcmb = 826; - e.brokenbar = 166; - e.bstroke = 384; - e.bsuperior = 63210; - e.btopbar = 387; - e.buhiragana = 12406; - e.bukatakana = 12502; - e.bullet = 8226; - e.bulletinverse = 9688; - e.bulletoperator = 8729; - e.bullseye = 9678; - e.c = 99; - e.caarmenian = 1390; - e.cabengali = 2458; - e.cacute = 263; - e.cadeva = 2330; - e.cagujarati = 2714; - e.cagurmukhi = 2586; - e.calsquare = 13192; - e.candrabindubengali = 2433; - e.candrabinducmb = 784; - e.candrabindudeva = 2305; - e.candrabindugujarati = 2689; - e.capslock = 8682; - e.careof = 8453; - e.caron = 711; - e.caronbelowcmb = 812; - e.caroncmb = 780; - e.carriagereturn = 8629; - e.cbopomofo = 12568; - e.ccaron = 269; - e.ccedilla = 231; - e.ccedillaacute = 7689; - e.ccircle = 9426; - e.ccircumflex = 265; - e.ccurl = 597; - e.cdot = 267; - e.cdotaccent = 267; - e.cdsquare = 13253; - e.cedilla = 184; - e.cedillacmb = 807; - e.cent = 162; - e.centigrade = 8451; - e.centinferior = 63199; - e.centmonospace = 65504; - e.centoldstyle = 63394; - e.centsuperior = 63200; - e.chaarmenian = 1401; - e.chabengali = 2459; - e.chadeva = 2331; - e.chagujarati = 2715; - e.chagurmukhi = 2587; - e.chbopomofo = 12564; - e.cheabkhasiancyrillic = 1213; - e.checkmark = 10003; - e.checyrillic = 1095; - e.chedescenderabkhasiancyrillic = 1215; - e.chedescendercyrillic = 1207; - e.chedieresiscyrillic = 1269; - e.cheharmenian = 1395; - e.chekhakassiancyrillic = 1228; - e.cheverticalstrokecyrillic = 1209; - e.chi = 967; - e.chieuchacirclekorean = 12919; - e.chieuchaparenkorean = 12823; - e.chieuchcirclekorean = 12905; - e.chieuchkorean = 12618; - e.chieuchparenkorean = 12809; - e.chochangthai = 3594; - e.chochanthai = 3592; - e.chochingthai = 3593; - e.chochoethai = 3596; - e.chook = 392; - e.cieucacirclekorean = 12918; - e.cieucaparenkorean = 12822; - e.cieuccirclekorean = 12904; - e.cieuckorean = 12616; - e.cieucparenkorean = 12808; - e.cieucuparenkorean = 12828; - e.circle = 9675; - e.circlecopyrt = 169; - e.circlemultiply = 8855; - e.circleot = 8857; - e.circleplus = 8853; - e.circlepostalmark = 12342; - e.circlewithlefthalfblack = 9680; - e.circlewithrighthalfblack = 9681; - e.circumflex = 710; - e.circumflexbelowcmb = 813; - e.circumflexcmb = 770; - e.clear = 8999; - e.clickalveolar = 450; - e.clickdental = 448; - e.clicklateral = 449; - e.clickretroflex = 451; - e.club = 9827; - e.clubsuitblack = 9827; - e.clubsuitwhite = 9831; - e.cmcubedsquare = 13220; - e.cmonospace = 65347; - e.cmsquaredsquare = 13216; - e.coarmenian = 1409; - e.colon = 58; - e.colonmonetary = 8353; - e.colonmonospace = 65306; - e.colonsign = 8353; - e.colonsmall = 65109; - e.colontriangularhalfmod = 721; - e.colontriangularmod = 720; - e.comma = 44; - e.commaabovecmb = 787; - e.commaaboverightcmb = 789; - e.commaaccent = 63171; - e.commaarabic = 1548; - e.commaarmenian = 1373; - e.commainferior = 63201; - e.commamonospace = 65292; - e.commareversedabovecmb = 788; - e.commareversedmod = 701; - e.commasmall = 65104; - e.commasuperior = 63202; - e.commaturnedabovecmb = 786; - e.commaturnedmod = 699; - e.compass = 9788; - e.congruent = 8773; - e.contourintegral = 8750; - e.control = 8963; - e.controlACK = 6; - e.controlBEL = 7; - e.controlBS = 8; - e.controlCAN = 24; - e.controlCR = 13; - e.controlDC1 = 17; - e.controlDC2 = 18; - e.controlDC3 = 19; - e.controlDC4 = 20; - e.controlDEL = 127; - e.controlDLE = 16; - e.controlEM = 25; - e.controlENQ = 5; - e.controlEOT = 4; - e.controlESC = 27; - e.controlETB = 23; - e.controlETX = 3; - e.controlFF = 12; - e.controlFS = 28; - e.controlGS = 29; - e.controlHT = 9; - e.controlLF = 10; - e.controlNAK = 21; - e.controlNULL = 0; - e.controlRS = 30; - e.controlSI = 15; - e.controlSO = 14; - e.controlSOT = 2; - e.controlSTX = 1; - e.controlSUB = 26; - e.controlSYN = 22; - e.controlUS = 31; - e.controlVT = 11; - e.copyright = 169; - e.copyrightsans = 63721; - e.copyrightserif = 63193; - e.cornerbracketleft = 12300; - e.cornerbracketlefthalfwidth = 65378; - e.cornerbracketleftvertical = 65089; - e.cornerbracketright = 12301; - e.cornerbracketrighthalfwidth = 65379; - e.cornerbracketrightvertical = 65090; - e.corporationsquare = 13183; - e.cosquare = 13255; - e.coverkgsquare = 13254; - e.cparen = 9374; - e.cruzeiro = 8354; - e.cstretched = 663; - e.curlyand = 8911; - e.curlyor = 8910; - e.currency = 164; - e.cyrBreve = 63185; - e.cyrFlex = 63186; - e.cyrbreve = 63188; - e.cyrflex = 63189; - e.d = 100; - e.daarmenian = 1380; - e.dabengali = 2470; - e.dadarabic = 1590; - e.dadeva = 2342; - e.dadfinalarabic = 65214; - e.dadinitialarabic = 65215; - e.dadmedialarabic = 65216; - e.dagesh = 1468; - e.dageshhebrew = 1468; - e.dagger = 8224; - e.daggerdbl = 8225; - e.dagujarati = 2726; - e.dagurmukhi = 2598; - e.dahiragana = 12384; - e.dakatakana = 12480; - e.dalarabic = 1583; - e.dalet = 1491; - e.daletdagesh = 64307; - e.daletdageshhebrew = 64307; - e.dalethebrew = 1491; - e.dalfinalarabic = 65194; - e.dammaarabic = 1615; - e.dammalowarabic = 1615; - e.dammatanaltonearabic = 1612; - e.dammatanarabic = 1612; - e.danda = 2404; - e.dargahebrew = 1447; - e.dargalefthebrew = 1447; - e.dasiapneumatacyrilliccmb = 1157; - e.dblGrave = 63187; - e.dblanglebracketleft = 12298; - e.dblanglebracketleftvertical = 65085; - e.dblanglebracketright = 12299; - e.dblanglebracketrightvertical = 65086; - e.dblarchinvertedbelowcmb = 811; - e.dblarrowleft = 8660; - e.dblarrowright = 8658; - e.dbldanda = 2405; - e.dblgrave = 63190; - e.dblgravecmb = 783; - e.dblintegral = 8748; - e.dbllowline = 8215; - e.dbllowlinecmb = 819; - e.dbloverlinecmb = 831; - e.dblprimemod = 698; - e.dblverticalbar = 8214; - e.dblverticallineabovecmb = 782; - e.dbopomofo = 12553; - e.dbsquare = 13256; - e.dcaron = 271; - e.dcedilla = 7697; - e.dcircle = 9427; - e.dcircumflexbelow = 7699; - e.dcroat = 273; - e.ddabengali = 2465; - e.ddadeva = 2337; - e.ddagujarati = 2721; - e.ddagurmukhi = 2593; - e.ddalarabic = 1672; - e.ddalfinalarabic = 64393; - e.dddhadeva = 2396; - e.ddhabengali = 2466; - e.ddhadeva = 2338; - e.ddhagujarati = 2722; - e.ddhagurmukhi = 2594; - e.ddotaccent = 7691; - e.ddotbelow = 7693; - e.decimalseparatorarabic = 1643; - e.decimalseparatorpersian = 1643; - e.decyrillic = 1076; - e.degree = 176; - e.dehihebrew = 1453; - e.dehiragana = 12391; - e.deicoptic = 1007; - e.dekatakana = 12487; - e.deleteleft = 9003; - e.deleteright = 8998; - e.delta = 948; - e.deltaturned = 397; - e.denominatorminusonenumeratorbengali = 2552; - e.dezh = 676; - e.dhabengali = 2471; - e.dhadeva = 2343; - e.dhagujarati = 2727; - e.dhagurmukhi = 2599; - e.dhook = 599; - e.dialytikatonos = 901; - e.dialytikatonoscmb = 836; - e.diamond = 9830; - e.diamondsuitwhite = 9826; - e.dieresis = 168; - e.dieresisacute = 63191; - e.dieresisbelowcmb = 804; - e.dieresiscmb = 776; - e.dieresisgrave = 63192; - e.dieresistonos = 901; - e.dihiragana = 12386; - e.dikatakana = 12482; - e.dittomark = 12291; - e.divide = 247; - e.divides = 8739; - e.divisionslash = 8725; - e.djecyrillic = 1106; - e.dkshade = 9619; - e.dlinebelow = 7695; - e.dlsquare = 13207; - e.dmacron = 273; - e.dmonospace = 65348; - e.dnblock = 9604; - e.dochadathai = 3598; - e.dodekthai = 3604; - e.dohiragana = 12393; - e.dokatakana = 12489; - e.dollar = 36; - e.dollarinferior = 63203; - e.dollarmonospace = 65284; - e.dollaroldstyle = 63268; - e.dollarsmall = 65129; - e.dollarsuperior = 63204; - e.dong = 8363; - e.dorusquare = 13094; - e.dotaccent = 729; - e.dotaccentcmb = 775; - e.dotbelowcmb = 803; - e.dotbelowcomb = 803; - e.dotkatakana = 12539; - e.dotlessi = 305; - e.dotlessj = 63166; - e.dotlessjstrokehook = 644; - e.dotmath = 8901; - e.dottedcircle = 9676; - e.doubleyodpatah = 64287; - e.doubleyodpatahhebrew = 64287; - e.downtackbelowcmb = 798; - e.downtackmod = 725; - e.dparen = 9375; - e.dsuperior = 63211; - e.dtail = 598; - e.dtopbar = 396; - e.duhiragana = 12389; - e.dukatakana = 12485; - e.dz = 499; - e.dzaltone = 675; - e.dzcaron = 454; - e.dzcurl = 677; - e.dzeabkhasiancyrillic = 1249; - e.dzecyrillic = 1109; - e.dzhecyrillic = 1119; - e.e = 101; - e.eacute = 233; - e.earth = 9793; - e.ebengali = 2447; - e.ebopomofo = 12572; - e.ebreve = 277; - e.ecandradeva = 2317; - e.ecandragujarati = 2701; - e.ecandravowelsigndeva = 2373; - e.ecandravowelsigngujarati = 2757; - e.ecaron = 283; - e.ecedillabreve = 7709; - e.echarmenian = 1381; - e.echyiwnarmenian = 1415; - e.ecircle = 9428; - e.ecircumflex = 234; - e.ecircumflexacute = 7871; - e.ecircumflexbelow = 7705; - e.ecircumflexdotbelow = 7879; - e.ecircumflexgrave = 7873; - e.ecircumflexhookabove = 7875; - e.ecircumflextilde = 7877; - e.ecyrillic = 1108; - e.edblgrave = 517; - e.edeva = 2319; - e.edieresis = 235; - e.edot = 279; - e.edotaccent = 279; - e.edotbelow = 7865; - e.eegurmukhi = 2575; - e.eematragurmukhi = 2631; - e.efcyrillic = 1092; - e.egrave = 232; - e.egujarati = 2703; - e.eharmenian = 1383; - e.ehbopomofo = 12573; - e.ehiragana = 12360; - e.ehookabove = 7867; - e.eibopomofo = 12575; - e.eight = 56; - e.eightarabic = 1640; - e.eightbengali = 2542; - e.eightcircle = 9319; - e.eightcircleinversesansserif = 10129; - e.eightdeva = 2414; - e.eighteencircle = 9329; - e.eighteenparen = 9349; - e.eighteenperiod = 9369; - e.eightgujarati = 2798; - e.eightgurmukhi = 2670; - e.eighthackarabic = 1640; - e.eighthangzhou = 12328; - e.eighthnotebeamed = 9835; - e.eightideographicparen = 12839; - e.eightinferior = 8328; - e.eightmonospace = 65304; - e.eightoldstyle = 63288; - e.eightparen = 9339; - e.eightperiod = 9359; - e.eightpersian = 1784; - e.eightroman = 8567; - e.eightsuperior = 8312; - e.eightthai = 3672; - e.einvertedbreve = 519; - e.eiotifiedcyrillic = 1125; - e.ekatakana = 12456; - e.ekatakanahalfwidth = 65396; - e.ekonkargurmukhi = 2676; - e.ekorean = 12628; - e.elcyrillic = 1083; - e.element = 8712; - e.elevencircle = 9322; - e.elevenparen = 9342; - e.elevenperiod = 9362; - e.elevenroman = 8570; - e.ellipsis = 8230; - e.ellipsisvertical = 8942; - e.emacron = 275; - e.emacronacute = 7703; - e.emacrongrave = 7701; - e.emcyrillic = 1084; - e.emdash = 8212; - e.emdashvertical = 65073; - e.emonospace = 65349; - e.emphasismarkarmenian = 1371; - e.emptyset = 8709; - e.enbopomofo = 12579; - e.encyrillic = 1085; - e.endash = 8211; - e.endashvertical = 65074; - e.endescendercyrillic = 1187; - e.eng = 331; - e.engbopomofo = 12581; - e.enghecyrillic = 1189; - e.enhookcyrillic = 1224; - e.enspace = 8194; - e.eogonek = 281; - e.eokorean = 12627; - e.eopen = 603; - e.eopenclosed = 666; - e.eopenreversed = 604; - e.eopenreversedclosed = 606; - e.eopenreversedhook = 605; - e.eparen = 9376; - e.epsilon = 949; - e.epsilontonos = 941; - e.equal = 61; - e.equalmonospace = 65309; - e.equalsmall = 65126; - e.equalsuperior = 8316; - e.equivalence = 8801; - e.erbopomofo = 12582; - e.ercyrillic = 1088; - e.ereversed = 600; - e.ereversedcyrillic = 1101; - e.escyrillic = 1089; - e.esdescendercyrillic = 1195; - e.esh = 643; - e.eshcurl = 646; - e.eshortdeva = 2318; - e.eshortvowelsigndeva = 2374; - e.eshreversedloop = 426; - e.eshsquatreversed = 645; - e.esmallhiragana = 12359; - e.esmallkatakana = 12455; - e.esmallkatakanahalfwidth = 65386; - e.estimated = 8494; - e.esuperior = 63212; - e.eta = 951; - e.etarmenian = 1384; - e.etatonos = 942; - e.eth = 240; - e.etilde = 7869; - e.etildebelow = 7707; - e.etnahtafoukhhebrew = 1425; - e.etnahtafoukhlefthebrew = 1425; - e.etnahtahebrew = 1425; - e.etnahtalefthebrew = 1425; - e.eturned = 477; - e.eukorean = 12641; - e.euro = 8364; - e.evowelsignbengali = 2503; - e.evowelsigndeva = 2375; - e.evowelsigngujarati = 2759; - e.exclam = 33; - e.exclamarmenian = 1372; - e.exclamdbl = 8252; - e.exclamdown = 161; - e.exclamdownsmall = 63393; - e.exclammonospace = 65281; - e.exclamsmall = 63265; - e.existential = 8707; - e.ezh = 658; - e.ezhcaron = 495; - e.ezhcurl = 659; - e.ezhreversed = 441; - e.ezhtail = 442; - e.f = 102; - e.fadeva = 2398; - e.fagurmukhi = 2654; - e.fahrenheit = 8457; - e.fathaarabic = 1614; - e.fathalowarabic = 1614; - e.fathatanarabic = 1611; - e.fbopomofo = 12552; - e.fcircle = 9429; - e.fdotaccent = 7711; - e.feharabic = 1601; - e.feharmenian = 1414; - e.fehfinalarabic = 65234; - e.fehinitialarabic = 65235; - e.fehmedialarabic = 65236; - e.feicoptic = 997; - e.female = 9792; - e.ff = 64256; - e.f_f = 64256; - e.ffi = 64259; - e.f_f_i = 64259; - e.ffl = 64260; - e.f_f_l = 64260; - e.fi = 64257; - e.f_i = 64257; - e.fifteencircle = 9326; - e.fifteenparen = 9346; - e.fifteenperiod = 9366; - e.figuredash = 8210; - e.filledbox = 9632; - e.filledrect = 9644; - e.finalkaf = 1498; - e.finalkafdagesh = 64314; - e.finalkafdageshhebrew = 64314; - e.finalkafhebrew = 1498; - e.finalmem = 1501; - e.finalmemhebrew = 1501; - e.finalnun = 1503; - e.finalnunhebrew = 1503; - e.finalpe = 1507; - e.finalpehebrew = 1507; - e.finaltsadi = 1509; - e.finaltsadihebrew = 1509; - e.firsttonechinese = 713; - e.fisheye = 9673; - e.fitacyrillic = 1139; - e.five = 53; - e.fivearabic = 1637; - e.fivebengali = 2539; - e.fivecircle = 9316; - e.fivecircleinversesansserif = 10126; - e.fivedeva = 2411; - e.fiveeighths = 8541; - e.fivegujarati = 2795; - e.fivegurmukhi = 2667; - e.fivehackarabic = 1637; - e.fivehangzhou = 12325; - e.fiveideographicparen = 12836; - e.fiveinferior = 8325; - e.fivemonospace = 65301; - e.fiveoldstyle = 63285; - e.fiveparen = 9336; - e.fiveperiod = 9356; - e.fivepersian = 1781; - e.fiveroman = 8564; - e.fivesuperior = 8309; - e.fivethai = 3669; - e.fl = 64258; - e.f_l = 64258; - e.florin = 402; - e.fmonospace = 65350; - e.fmsquare = 13209; - e.fofanthai = 3615; - e.fofathai = 3613; - e.fongmanthai = 3663; - e.forall = 8704; - e.four = 52; - e.fourarabic = 1636; - e.fourbengali = 2538; - e.fourcircle = 9315; - e.fourcircleinversesansserif = 10125; - e.fourdeva = 2410; - e.fourgujarati = 2794; - e.fourgurmukhi = 2666; - e.fourhackarabic = 1636; - e.fourhangzhou = 12324; - e.fourideographicparen = 12835; - e.fourinferior = 8324; - e.fourmonospace = 65300; - e.fournumeratorbengali = 2551; - e.fouroldstyle = 63284; - e.fourparen = 9335; - e.fourperiod = 9355; - e.fourpersian = 1780; - e.fourroman = 8563; - e.foursuperior = 8308; - e.fourteencircle = 9325; - e.fourteenparen = 9345; - e.fourteenperiod = 9365; - e.fourthai = 3668; - e.fourthtonechinese = 715; - e.fparen = 9377; - e.fraction = 8260; - e.franc = 8355; - e.g = 103; - e.gabengali = 2455; - e.gacute = 501; - e.gadeva = 2327; - e.gafarabic = 1711; - e.gaffinalarabic = 64403; - e.gafinitialarabic = 64404; - e.gafmedialarabic = 64405; - e.gagujarati = 2711; - e.gagurmukhi = 2583; - e.gahiragana = 12364; - e.gakatakana = 12460; - e.gamma = 947; - e.gammalatinsmall = 611; - e.gammasuperior = 736; - e.gangiacoptic = 1003; - e.gbopomofo = 12557; - e.gbreve = 287; - e.gcaron = 487; - e.gcedilla = 291; - e.gcircle = 9430; - e.gcircumflex = 285; - e.gcommaaccent = 291; - e.gdot = 289; - e.gdotaccent = 289; - e.gecyrillic = 1075; - e.gehiragana = 12370; - e.gekatakana = 12466; - e.geometricallyequal = 8785; - e.gereshaccenthebrew = 1436; - e.gereshhebrew = 1523; - e.gereshmuqdamhebrew = 1437; - e.germandbls = 223; - e.gershayimaccenthebrew = 1438; - e.gershayimhebrew = 1524; - e.getamark = 12307; - e.ghabengali = 2456; - e.ghadarmenian = 1394; - e.ghadeva = 2328; - e.ghagujarati = 2712; - e.ghagurmukhi = 2584; - e.ghainarabic = 1594; - e.ghainfinalarabic = 65230; - e.ghaininitialarabic = 65231; - e.ghainmedialarabic = 65232; - e.ghemiddlehookcyrillic = 1173; - e.ghestrokecyrillic = 1171; - e.gheupturncyrillic = 1169; - e.ghhadeva = 2394; - e.ghhagurmukhi = 2650; - e.ghook = 608; - e.ghzsquare = 13203; - e.gihiragana = 12366; - e.gikatakana = 12462; - e.gimarmenian = 1379; - e.gimel = 1490; - e.gimeldagesh = 64306; - e.gimeldageshhebrew = 64306; - e.gimelhebrew = 1490; - e.gjecyrillic = 1107; - e.glottalinvertedstroke = 446; - e.glottalstop = 660; - e.glottalstopinverted = 662; - e.glottalstopmod = 704; - e.glottalstopreversed = 661; - e.glottalstopreversedmod = 705; - e.glottalstopreversedsuperior = 740; - e.glottalstopstroke = 673; - e.glottalstopstrokereversed = 674; - e.gmacron = 7713; - e.gmonospace = 65351; - e.gohiragana = 12372; - e.gokatakana = 12468; - e.gparen = 9378; - e.gpasquare = 13228; - e.gradient = 8711; - e.grave = 96; - e.gravebelowcmb = 790; - e.gravecmb = 768; - e.gravecomb = 768; - e.gravedeva = 2387; - e.gravelowmod = 718; - e.gravemonospace = 65344; - e.gravetonecmb = 832; - e.greater = 62; - e.greaterequal = 8805; - e.greaterequalorless = 8923; - e.greatermonospace = 65310; - e.greaterorequivalent = 8819; - e.greaterorless = 8823; - e.greateroverequal = 8807; - e.greatersmall = 65125; - e.gscript = 609; - e.gstroke = 485; - e.guhiragana = 12368; - e.guillemotleft = 171; - e.guillemotright = 187; - e.guilsinglleft = 8249; - e.guilsinglright = 8250; - e.gukatakana = 12464; - e.guramusquare = 13080; - e.gysquare = 13257; - e.h = 104; - e.haabkhasiancyrillic = 1193; - e.haaltonearabic = 1729; - e.habengali = 2489; - e.hadescendercyrillic = 1203; - e.hadeva = 2361; - e.hagujarati = 2745; - e.hagurmukhi = 2617; - e.haharabic = 1581; - e.hahfinalarabic = 65186; - e.hahinitialarabic = 65187; - e.hahiragana = 12399; - e.hahmedialarabic = 65188; - e.haitusquare = 13098; - e.hakatakana = 12495; - e.hakatakanahalfwidth = 65418; - e.halantgurmukhi = 2637; - e.hamzaarabic = 1569; - e.hamzalowarabic = 1569; - e.hangulfiller = 12644; - e.hardsigncyrillic = 1098; - e.harpoonleftbarbup = 8636; - e.harpoonrightbarbup = 8640; - e.hasquare = 13258; - e.hatafpatah = 1458; - e.hatafpatah16 = 1458; - e.hatafpatah23 = 1458; - e.hatafpatah2f = 1458; - e.hatafpatahhebrew = 1458; - e.hatafpatahnarrowhebrew = 1458; - e.hatafpatahquarterhebrew = 1458; - e.hatafpatahwidehebrew = 1458; - e.hatafqamats = 1459; - e.hatafqamats1b = 1459; - e.hatafqamats28 = 1459; - e.hatafqamats34 = 1459; - e.hatafqamatshebrew = 1459; - e.hatafqamatsnarrowhebrew = 1459; - e.hatafqamatsquarterhebrew = 1459; - e.hatafqamatswidehebrew = 1459; - e.hatafsegol = 1457; - e.hatafsegol17 = 1457; - e.hatafsegol24 = 1457; - e.hatafsegol30 = 1457; - e.hatafsegolhebrew = 1457; - e.hatafsegolnarrowhebrew = 1457; - e.hatafsegolquarterhebrew = 1457; - e.hatafsegolwidehebrew = 1457; - e.hbar = 295; - e.hbopomofo = 12559; - e.hbrevebelow = 7723; - e.hcedilla = 7721; - e.hcircle = 9431; - e.hcircumflex = 293; - e.hdieresis = 7719; - e.hdotaccent = 7715; - e.hdotbelow = 7717; - e.he = 1492; - e.heart = 9829; - e.heartsuitblack = 9829; - e.heartsuitwhite = 9825; - e.hedagesh = 64308; - e.hedageshhebrew = 64308; - e.hehaltonearabic = 1729; - e.heharabic = 1607; - e.hehebrew = 1492; - e.hehfinalaltonearabic = 64423; - e.hehfinalalttwoarabic = 65258; - e.hehfinalarabic = 65258; - e.hehhamzaabovefinalarabic = 64421; - e.hehhamzaaboveisolatedarabic = 64420; - e.hehinitialaltonearabic = 64424; - e.hehinitialarabic = 65259; - e.hehiragana = 12408; - e.hehmedialaltonearabic = 64425; - e.hehmedialarabic = 65260; - e.heiseierasquare = 13179; - e.hekatakana = 12504; - e.hekatakanahalfwidth = 65421; - e.hekutaarusquare = 13110; - e.henghook = 615; - e.herutusquare = 13113; - e.het = 1495; - e.hethebrew = 1495; - e.hhook = 614; - e.hhooksuperior = 689; - e.hieuhacirclekorean = 12923; - e.hieuhaparenkorean = 12827; - e.hieuhcirclekorean = 12909; - e.hieuhkorean = 12622; - e.hieuhparenkorean = 12813; - e.hihiragana = 12402; - e.hikatakana = 12498; - e.hikatakanahalfwidth = 65419; - e.hiriq = 1460; - e.hiriq14 = 1460; - e.hiriq21 = 1460; - e.hiriq2d = 1460; - e.hiriqhebrew = 1460; - e.hiriqnarrowhebrew = 1460; - e.hiriqquarterhebrew = 1460; - e.hiriqwidehebrew = 1460; - e.hlinebelow = 7830; - e.hmonospace = 65352; - e.hoarmenian = 1392; - e.hohipthai = 3627; - e.hohiragana = 12411; - e.hokatakana = 12507; - e.hokatakanahalfwidth = 65422; - e.holam = 1465; - e.holam19 = 1465; - e.holam26 = 1465; - e.holam32 = 1465; - e.holamhebrew = 1465; - e.holamnarrowhebrew = 1465; - e.holamquarterhebrew = 1465; - e.holamwidehebrew = 1465; - e.honokhukthai = 3630; - e.hookabovecomb = 777; - e.hookcmb = 777; - e.hookpalatalizedbelowcmb = 801; - e.hookretroflexbelowcmb = 802; - e.hoonsquare = 13122; - e.horicoptic = 1001; - e.horizontalbar = 8213; - e.horncmb = 795; - e.hotsprings = 9832; - e.house = 8962; - e.hparen = 9379; - e.hsuperior = 688; - e.hturned = 613; - e.huhiragana = 12405; - e.huiitosquare = 13107; - e.hukatakana = 12501; - e.hukatakanahalfwidth = 65420; - e.hungarumlaut = 733; - e.hungarumlautcmb = 779; - e.hv = 405; - e.hyphen = 45; - e.hypheninferior = 63205; - e.hyphenmonospace = 65293; - e.hyphensmall = 65123; - e.hyphensuperior = 63206; - e.hyphentwo = 8208; - e.i = 105; - e.iacute = 237; - e.iacyrillic = 1103; - e.ibengali = 2439; - e.ibopomofo = 12583; - e.ibreve = 301; - e.icaron = 464; - e.icircle = 9432; - e.icircumflex = 238; - e.icyrillic = 1110; - e.idblgrave = 521; - e.ideographearthcircle = 12943; - e.ideographfirecircle = 12939; - e.ideographicallianceparen = 12863; - e.ideographiccallparen = 12858; - e.ideographiccentrecircle = 12965; - e.ideographicclose = 12294; - e.ideographiccomma = 12289; - e.ideographiccommaleft = 65380; - e.ideographiccongratulationparen = 12855; - e.ideographiccorrectcircle = 12963; - e.ideographicearthparen = 12847; - e.ideographicenterpriseparen = 12861; - e.ideographicexcellentcircle = 12957; - e.ideographicfestivalparen = 12864; - e.ideographicfinancialcircle = 12950; - e.ideographicfinancialparen = 12854; - e.ideographicfireparen = 12843; - e.ideographichaveparen = 12850; - e.ideographichighcircle = 12964; - e.ideographiciterationmark = 12293; - e.ideographiclaborcircle = 12952; - e.ideographiclaborparen = 12856; - e.ideographicleftcircle = 12967; - e.ideographiclowcircle = 12966; - e.ideographicmedicinecircle = 12969; - e.ideographicmetalparen = 12846; - e.ideographicmoonparen = 12842; - e.ideographicnameparen = 12852; - e.ideographicperiod = 12290; - e.ideographicprintcircle = 12958; - e.ideographicreachparen = 12867; - e.ideographicrepresentparen = 12857; - e.ideographicresourceparen = 12862; - e.ideographicrightcircle = 12968; - e.ideographicsecretcircle = 12953; - e.ideographicselfparen = 12866; - e.ideographicsocietyparen = 12851; - e.ideographicspace = 12288; - e.ideographicspecialparen = 12853; - e.ideographicstockparen = 12849; - e.ideographicstudyparen = 12859; - e.ideographicsunparen = 12848; - e.ideographicsuperviseparen = 12860; - e.ideographicwaterparen = 12844; - e.ideographicwoodparen = 12845; - e.ideographiczero = 12295; - e.ideographmetalcircle = 12942; - e.ideographmooncircle = 12938; - e.ideographnamecircle = 12948; - e.ideographsuncircle = 12944; - e.ideographwatercircle = 12940; - e.ideographwoodcircle = 12941; - e.ideva = 2311; - e.idieresis = 239; - e.idieresisacute = 7727; - e.idieresiscyrillic = 1253; - e.idotbelow = 7883; - e.iebrevecyrillic = 1239; - e.iecyrillic = 1077; - e.ieungacirclekorean = 12917; - e.ieungaparenkorean = 12821; - e.ieungcirclekorean = 12903; - e.ieungkorean = 12615; - e.ieungparenkorean = 12807; - e.igrave = 236; - e.igujarati = 2695; - e.igurmukhi = 2567; - e.ihiragana = 12356; - e.ihookabove = 7881; - e.iibengali = 2440; - e.iicyrillic = 1080; - e.iideva = 2312; - e.iigujarati = 2696; - e.iigurmukhi = 2568; - e.iimatragurmukhi = 2624; - e.iinvertedbreve = 523; - e.iishortcyrillic = 1081; - e.iivowelsignbengali = 2496; - e.iivowelsigndeva = 2368; - e.iivowelsigngujarati = 2752; - e.ij = 307; - e.ikatakana = 12452; - e.ikatakanahalfwidth = 65394; - e.ikorean = 12643; - e.ilde = 732; - e.iluyhebrew = 1452; - e.imacron = 299; - e.imacroncyrillic = 1251; - e.imageorapproximatelyequal = 8787; - e.imatragurmukhi = 2623; - e.imonospace = 65353; - e.increment = 8710; - e.infinity = 8734; - e.iniarmenian = 1387; - e.integral = 8747; - e.integralbottom = 8993; - e.integralbt = 8993; - e.integralex = 63733; - e.integraltop = 8992; - e.integraltp = 8992; - e.intersection = 8745; - e.intisquare = 13061; - e.invbullet = 9688; - e.invcircle = 9689; - e.invsmileface = 9787; - e.iocyrillic = 1105; - e.iogonek = 303; - e.iota = 953; - e.iotadieresis = 970; - e.iotadieresistonos = 912; - e.iotalatin = 617; - e.iotatonos = 943; - e.iparen = 9380; - e.irigurmukhi = 2674; - e.ismallhiragana = 12355; - e.ismallkatakana = 12451; - e.ismallkatakanahalfwidth = 65384; - e.issharbengali = 2554; - e.istroke = 616; - e.isuperior = 63213; - e.iterationhiragana = 12445; - e.iterationkatakana = 12541; - e.itilde = 297; - e.itildebelow = 7725; - e.iubopomofo = 12585; - e.iucyrillic = 1102; - e.ivowelsignbengali = 2495; - e.ivowelsigndeva = 2367; - e.ivowelsigngujarati = 2751; - e.izhitsacyrillic = 1141; - e.izhitsadblgravecyrillic = 1143; - e.j = 106; - e.jaarmenian = 1393; - e.jabengali = 2460; - e.jadeva = 2332; - e.jagujarati = 2716; - e.jagurmukhi = 2588; - e.jbopomofo = 12560; - e.jcaron = 496; - e.jcircle = 9433; - e.jcircumflex = 309; - e.jcrossedtail = 669; - e.jdotlessstroke = 607; - e.jecyrillic = 1112; - e.jeemarabic = 1580; - e.jeemfinalarabic = 65182; - e.jeeminitialarabic = 65183; - e.jeemmedialarabic = 65184; - e.jeharabic = 1688; - e.jehfinalarabic = 64395; - e.jhabengali = 2461; - e.jhadeva = 2333; - e.jhagujarati = 2717; - e.jhagurmukhi = 2589; - e.jheharmenian = 1403; - e.jis = 12292; - e.jmonospace = 65354; - e.jparen = 9381; - e.jsuperior = 690; - e.k = 107; - e.kabashkircyrillic = 1185; - e.kabengali = 2453; - e.kacute = 7729; - e.kacyrillic = 1082; - e.kadescendercyrillic = 1179; - e.kadeva = 2325; - e.kaf = 1499; - e.kafarabic = 1603; - e.kafdagesh = 64315; - e.kafdageshhebrew = 64315; - e.kaffinalarabic = 65242; - e.kafhebrew = 1499; - e.kafinitialarabic = 65243; - e.kafmedialarabic = 65244; - e.kafrafehebrew = 64333; - e.kagujarati = 2709; - e.kagurmukhi = 2581; - e.kahiragana = 12363; - e.kahookcyrillic = 1220; - e.kakatakana = 12459; - e.kakatakanahalfwidth = 65398; - e.kappa = 954; - e.kappasymbolgreek = 1008; - e.kapyeounmieumkorean = 12657; - e.kapyeounphieuphkorean = 12676; - e.kapyeounpieupkorean = 12664; - e.kapyeounssangpieupkorean = 12665; - e.karoriisquare = 13069; - e.kashidaautoarabic = 1600; - e.kashidaautonosidebearingarabic = 1600; - e.kasmallkatakana = 12533; - e.kasquare = 13188; - e.kasraarabic = 1616; - e.kasratanarabic = 1613; - e.kastrokecyrillic = 1183; - e.katahiraprolongmarkhalfwidth = 65392; - e.kaverticalstrokecyrillic = 1181; - e.kbopomofo = 12558; - e.kcalsquare = 13193; - e.kcaron = 489; - e.kcedilla = 311; - e.kcircle = 9434; - e.kcommaaccent = 311; - e.kdotbelow = 7731; - e.keharmenian = 1412; - e.kehiragana = 12369; - e.kekatakana = 12465; - e.kekatakanahalfwidth = 65401; - e.kenarmenian = 1391; - e.kesmallkatakana = 12534; - e.kgreenlandic = 312; - e.khabengali = 2454; - e.khacyrillic = 1093; - e.khadeva = 2326; - e.khagujarati = 2710; - e.khagurmukhi = 2582; - e.khaharabic = 1582; - e.khahfinalarabic = 65190; - e.khahinitialarabic = 65191; - e.khahmedialarabic = 65192; - e.kheicoptic = 999; - e.khhadeva = 2393; - e.khhagurmukhi = 2649; - e.khieukhacirclekorean = 12920; - e.khieukhaparenkorean = 12824; - e.khieukhcirclekorean = 12906; - e.khieukhkorean = 12619; - e.khieukhparenkorean = 12810; - e.khokhaithai = 3586; - e.khokhonthai = 3589; - e.khokhuatthai = 3587; - e.khokhwaithai = 3588; - e.khomutthai = 3675; - e.khook = 409; - e.khorakhangthai = 3590; - e.khzsquare = 13201; - e.kihiragana = 12365; - e.kikatakana = 12461; - e.kikatakanahalfwidth = 65399; - e.kiroguramusquare = 13077; - e.kiromeetorusquare = 13078; - e.kirosquare = 13076; - e.kiyeokacirclekorean = 12910; - e.kiyeokaparenkorean = 12814; - e.kiyeokcirclekorean = 12896; - e.kiyeokkorean = 12593; - e.kiyeokparenkorean = 12800; - e.kiyeoksioskorean = 12595; - e.kjecyrillic = 1116; - e.klinebelow = 7733; - e.klsquare = 13208; - e.kmcubedsquare = 13222; - e.kmonospace = 65355; - e.kmsquaredsquare = 13218; - e.kohiragana = 12371; - e.kohmsquare = 13248; - e.kokaithai = 3585; - e.kokatakana = 12467; - e.kokatakanahalfwidth = 65402; - e.kooposquare = 13086; - e.koppacyrillic = 1153; - e.koreanstandardsymbol = 12927; - e.koroniscmb = 835; - e.kparen = 9382; - e.kpasquare = 13226; - e.ksicyrillic = 1135; - e.ktsquare = 13263; - e.kturned = 670; - e.kuhiragana = 12367; - e.kukatakana = 12463; - e.kukatakanahalfwidth = 65400; - e.kvsquare = 13240; - e.kwsquare = 13246; - e.l = 108; - e.labengali = 2482; - e.lacute = 314; - e.ladeva = 2354; - e.lagujarati = 2738; - e.lagurmukhi = 2610; - e.lakkhangyaothai = 3653; - e.lamaleffinalarabic = 65276; - e.lamalefhamzaabovefinalarabic = 65272; - e.lamalefhamzaaboveisolatedarabic = 65271; - e.lamalefhamzabelowfinalarabic = 65274; - e.lamalefhamzabelowisolatedarabic = 65273; - e.lamalefisolatedarabic = 65275; - e.lamalefmaddaabovefinalarabic = 65270; - e.lamalefmaddaaboveisolatedarabic = 65269; - e.lamarabic = 1604; - e.lambda = 955; - e.lambdastroke = 411; - e.lamed = 1500; - e.lameddagesh = 64316; - e.lameddageshhebrew = 64316; - e.lamedhebrew = 1500; - e.lamfinalarabic = 65246; - e.lamhahinitialarabic = 64714; - e.laminitialarabic = 65247; - e.lamjeeminitialarabic = 64713; - e.lamkhahinitialarabic = 64715; - e.lamlamhehisolatedarabic = 65010; - e.lammedialarabic = 65248; - e.lammeemhahinitialarabic = 64904; - e.lammeeminitialarabic = 64716; - e.largecircle = 9711; - e.lbar = 410; - e.lbelt = 620; - e.lbopomofo = 12556; - e.lcaron = 318; - e.lcedilla = 316; - e.lcircle = 9435; - e.lcircumflexbelow = 7741; - e.lcommaaccent = 316; - e.ldot = 320; - e.ldotaccent = 320; - e.ldotbelow = 7735; - e.ldotbelowmacron = 7737; - e.leftangleabovecmb = 794; - e.lefttackbelowcmb = 792; - e.less = 60; - e.lessequal = 8804; - e.lessequalorgreater = 8922; - e.lessmonospace = 65308; - e.lessorequivalent = 8818; - e.lessorgreater = 8822; - e.lessoverequal = 8806; - e.lesssmall = 65124; - e.lezh = 622; - e.lfblock = 9612; - e.lhookretroflex = 621; - e.lira = 8356; - e.liwnarmenian = 1388; - e.lj = 457; - e.ljecyrillic = 1113; - e.ll = 63168; - e.lladeva = 2355; - e.llagujarati = 2739; - e.llinebelow = 7739; - e.llladeva = 2356; - e.llvocalicbengali = 2529; - e.llvocalicdeva = 2401; - e.llvocalicvowelsignbengali = 2531; - e.llvocalicvowelsigndeva = 2403; - e.lmiddletilde = 619; - e.lmonospace = 65356; - e.lmsquare = 13264; - e.lochulathai = 3628; - e.logicaland = 8743; - e.logicalnot = 172; - e.logicalnotreversed = 8976; - e.logicalor = 8744; - e.lolingthai = 3621; - e.longs = 383; - e.lowlinecenterline = 65102; - e.lowlinecmb = 818; - e.lowlinedashed = 65101; - e.lozenge = 9674; - e.lparen = 9383; - e.lslash = 322; - e.lsquare = 8467; - e.lsuperior = 63214; - e.ltshade = 9617; - e.luthai = 3622; - e.lvocalicbengali = 2444; - e.lvocalicdeva = 2316; - e.lvocalicvowelsignbengali = 2530; - e.lvocalicvowelsigndeva = 2402; - e.lxsquare = 13267; - e.m = 109; - e.mabengali = 2478; - e.macron = 175; - e.macronbelowcmb = 817; - e.macroncmb = 772; - e.macronlowmod = 717; - e.macronmonospace = 65507; - e.macute = 7743; - e.madeva = 2350; - e.magujarati = 2734; - e.magurmukhi = 2606; - e.mahapakhhebrew = 1444; - e.mahapakhlefthebrew = 1444; - e.mahiragana = 12414; - e.maichattawalowleftthai = 63637; - e.maichattawalowrightthai = 63636; - e.maichattawathai = 3659; - e.maichattawaupperleftthai = 63635; - e.maieklowleftthai = 63628; - e.maieklowrightthai = 63627; - e.maiekthai = 3656; - e.maiekupperleftthai = 63626; - e.maihanakatleftthai = 63620; - e.maihanakatthai = 3633; - e.maitaikhuleftthai = 63625; - e.maitaikhuthai = 3655; - e.maitholowleftthai = 63631; - e.maitholowrightthai = 63630; - e.maithothai = 3657; - e.maithoupperleftthai = 63629; - e.maitrilowleftthai = 63634; - e.maitrilowrightthai = 63633; - e.maitrithai = 3658; - e.maitriupperleftthai = 63632; - e.maiyamokthai = 3654; - e.makatakana = 12510; - e.makatakanahalfwidth = 65423; - e.male = 9794; - e.mansyonsquare = 13127; - e.maqafhebrew = 1470; - e.mars = 9794; - e.masoracirclehebrew = 1455; - e.masquare = 13187; - e.mbopomofo = 12551; - e.mbsquare = 13268; - e.mcircle = 9436; - e.mcubedsquare = 13221; - e.mdotaccent = 7745; - e.mdotbelow = 7747; - e.meemarabic = 1605; - e.meemfinalarabic = 65250; - e.meeminitialarabic = 65251; - e.meemmedialarabic = 65252; - e.meemmeeminitialarabic = 64721; - e.meemmeemisolatedarabic = 64584; - e.meetorusquare = 13133; - e.mehiragana = 12417; - e.meizierasquare = 13182; - e.mekatakana = 12513; - e.mekatakanahalfwidth = 65426; - e.mem = 1502; - e.memdagesh = 64318; - e.memdageshhebrew = 64318; - e.memhebrew = 1502; - e.menarmenian = 1396; - e.merkhahebrew = 1445; - e.merkhakefulahebrew = 1446; - e.merkhakefulalefthebrew = 1446; - e.merkhalefthebrew = 1445; - e.mhook = 625; - e.mhzsquare = 13202; - e.middledotkatakanahalfwidth = 65381; - e.middot = 183; - e.mieumacirclekorean = 12914; - e.mieumaparenkorean = 12818; - e.mieumcirclekorean = 12900; - e.mieumkorean = 12609; - e.mieumpansioskorean = 12656; - e.mieumparenkorean = 12804; - e.mieumpieupkorean = 12654; - e.mieumsioskorean = 12655; - e.mihiragana = 12415; - e.mikatakana = 12511; - e.mikatakanahalfwidth = 65424; - e.minus = 8722; - e.minusbelowcmb = 800; - e.minuscircle = 8854; - e.minusmod = 727; - e.minusplus = 8723; - e.minute = 8242; - e.miribaarusquare = 13130; - e.mirisquare = 13129; - e.mlonglegturned = 624; - e.mlsquare = 13206; - e.mmcubedsquare = 13219; - e.mmonospace = 65357; - e.mmsquaredsquare = 13215; - e.mohiragana = 12418; - e.mohmsquare = 13249; - e.mokatakana = 12514; - e.mokatakanahalfwidth = 65427; - e.molsquare = 13270; - e.momathai = 3617; - e.moverssquare = 13223; - e.moverssquaredsquare = 13224; - e.mparen = 9384; - e.mpasquare = 13227; - e.mssquare = 13235; - e.msuperior = 63215; - e.mturned = 623; - e.mu = 181; - e.mu1 = 181; - e.muasquare = 13186; - e.muchgreater = 8811; - e.muchless = 8810; - e.mufsquare = 13196; - e.mugreek = 956; - e.mugsquare = 13197; - e.muhiragana = 12416; - e.mukatakana = 12512; - e.mukatakanahalfwidth = 65425; - e.mulsquare = 13205; - e.multiply = 215; - e.mumsquare = 13211; - e.munahhebrew = 1443; - e.munahlefthebrew = 1443; - e.musicalnote = 9834; - e.musicalnotedbl = 9835; - e.musicflatsign = 9837; - e.musicsharpsign = 9839; - e.mussquare = 13234; - e.muvsquare = 13238; - e.muwsquare = 13244; - e.mvmegasquare = 13241; - e.mvsquare = 13239; - e.mwmegasquare = 13247; - e.mwsquare = 13245; - e.n = 110; - e.nabengali = 2472; - e.nabla = 8711; - e.nacute = 324; - e.nadeva = 2344; - e.nagujarati = 2728; - e.nagurmukhi = 2600; - e.nahiragana = 12394; - e.nakatakana = 12490; - e.nakatakanahalfwidth = 65413; - e.napostrophe = 329; - e.nasquare = 13185; - e.nbopomofo = 12555; - e.nbspace = 160; - e.ncaron = 328; - e.ncedilla = 326; - e.ncircle = 9437; - e.ncircumflexbelow = 7755; - e.ncommaaccent = 326; - e.ndotaccent = 7749; - e.ndotbelow = 7751; - e.nehiragana = 12397; - e.nekatakana = 12493; - e.nekatakanahalfwidth = 65416; - e.newsheqelsign = 8362; - e.nfsquare = 13195; - e.ngabengali = 2457; - e.ngadeva = 2329; - e.ngagujarati = 2713; - e.ngagurmukhi = 2585; - e.ngonguthai = 3591; - e.nhiragana = 12435; - e.nhookleft = 626; - e.nhookretroflex = 627; - e.nieunacirclekorean = 12911; - e.nieunaparenkorean = 12815; - e.nieuncieuckorean = 12597; - e.nieuncirclekorean = 12897; - e.nieunhieuhkorean = 12598; - e.nieunkorean = 12596; - e.nieunpansioskorean = 12648; - e.nieunparenkorean = 12801; - e.nieunsioskorean = 12647; - e.nieuntikeutkorean = 12646; - e.nihiragana = 12395; - e.nikatakana = 12491; - e.nikatakanahalfwidth = 65414; - e.nikhahitleftthai = 63641; - e.nikhahitthai = 3661; - e.nine = 57; - e.ninearabic = 1641; - e.ninebengali = 2543; - e.ninecircle = 9320; - e.ninecircleinversesansserif = 10130; - e.ninedeva = 2415; - e.ninegujarati = 2799; - e.ninegurmukhi = 2671; - e.ninehackarabic = 1641; - e.ninehangzhou = 12329; - e.nineideographicparen = 12840; - e.nineinferior = 8329; - e.ninemonospace = 65305; - e.nineoldstyle = 63289; - e.nineparen = 9340; - e.nineperiod = 9360; - e.ninepersian = 1785; - e.nineroman = 8568; - e.ninesuperior = 8313; - e.nineteencircle = 9330; - e.nineteenparen = 9350; - e.nineteenperiod = 9370; - e.ninethai = 3673; - e.nj = 460; - e.njecyrillic = 1114; - e.nkatakana = 12531; - e.nkatakanahalfwidth = 65437; - e.nlegrightlong = 414; - e.nlinebelow = 7753; - e.nmonospace = 65358; - e.nmsquare = 13210; - e.nnabengali = 2467; - e.nnadeva = 2339; - e.nnagujarati = 2723; - e.nnagurmukhi = 2595; - e.nnnadeva = 2345; - e.nohiragana = 12398; - e.nokatakana = 12494; - e.nokatakanahalfwidth = 65417; - e.nonbreakingspace = 160; - e.nonenthai = 3603; - e.nonuthai = 3609; - e.noonarabic = 1606; - e.noonfinalarabic = 65254; - e.noonghunnaarabic = 1722; - e.noonghunnafinalarabic = 64415; - e.nooninitialarabic = 65255; - e.noonjeeminitialarabic = 64722; - e.noonjeemisolatedarabic = 64587; - e.noonmedialarabic = 65256; - e.noonmeeminitialarabic = 64725; - e.noonmeemisolatedarabic = 64590; - e.noonnoonfinalarabic = 64653; - e.notcontains = 8716; - e.notelement = 8713; - e.notelementof = 8713; - e.notequal = 8800; - e.notgreater = 8815; - e.notgreaternorequal = 8817; - e.notgreaternorless = 8825; - e.notidentical = 8802; - e.notless = 8814; - e.notlessnorequal = 8816; - e.notparallel = 8742; - e.notprecedes = 8832; - e.notsubset = 8836; - e.notsucceeds = 8833; - e.notsuperset = 8837; - e.nowarmenian = 1398; - e.nparen = 9385; - e.nssquare = 13233; - e.nsuperior = 8319; - e.ntilde = 241; - e.nu = 957; - e.nuhiragana = 12396; - e.nukatakana = 12492; - e.nukatakanahalfwidth = 65415; - e.nuktabengali = 2492; - e.nuktadeva = 2364; - e.nuktagujarati = 2748; - e.nuktagurmukhi = 2620; - e.numbersign = 35; - e.numbersignmonospace = 65283; - e.numbersignsmall = 65119; - e.numeralsigngreek = 884; - e.numeralsignlowergreek = 885; - e.numero = 8470; - e.nun = 1504; - e.nundagesh = 64320; - e.nundageshhebrew = 64320; - e.nunhebrew = 1504; - e.nvsquare = 13237; - e.nwsquare = 13243; - e.nyabengali = 2462; - e.nyadeva = 2334; - e.nyagujarati = 2718; - e.nyagurmukhi = 2590; - e.o = 111; - e.oacute = 243; - e.oangthai = 3629; - e.obarred = 629; - e.obarredcyrillic = 1257; - e.obarreddieresiscyrillic = 1259; - e.obengali = 2451; - e.obopomofo = 12571; - e.obreve = 335; - e.ocandradeva = 2321; - e.ocandragujarati = 2705; - e.ocandravowelsigndeva = 2377; - e.ocandravowelsigngujarati = 2761; - e.ocaron = 466; - e.ocircle = 9438; - e.ocircumflex = 244; - e.ocircumflexacute = 7889; - e.ocircumflexdotbelow = 7897; - e.ocircumflexgrave = 7891; - e.ocircumflexhookabove = 7893; - e.ocircumflextilde = 7895; - e.ocyrillic = 1086; - e.odblacute = 337; - e.odblgrave = 525; - e.odeva = 2323; - e.odieresis = 246; - e.odieresiscyrillic = 1255; - e.odotbelow = 7885; - e.oe = 339; - e.oekorean = 12634; - e.ogonek = 731; - e.ogonekcmb = 808; - e.ograve = 242; - e.ogujarati = 2707; - e.oharmenian = 1413; - e.ohiragana = 12362; - e.ohookabove = 7887; - e.ohorn = 417; - e.ohornacute = 7899; - e.ohorndotbelow = 7907; - e.ohorngrave = 7901; - e.ohornhookabove = 7903; - e.ohorntilde = 7905; - e.ohungarumlaut = 337; - e.oi = 419; - e.oinvertedbreve = 527; - e.okatakana = 12458; - e.okatakanahalfwidth = 65397; - e.okorean = 12631; - e.olehebrew = 1451; - e.omacron = 333; - e.omacronacute = 7763; - e.omacrongrave = 7761; - e.omdeva = 2384; - e.omega = 969; - e.omega1 = 982; - e.omegacyrillic = 1121; - e.omegalatinclosed = 631; - e.omegaroundcyrillic = 1147; - e.omegatitlocyrillic = 1149; - e.omegatonos = 974; - e.omgujarati = 2768; - e.omicron = 959; - e.omicrontonos = 972; - e.omonospace = 65359; - e.one = 49; - e.onearabic = 1633; - e.onebengali = 2535; - e.onecircle = 9312; - e.onecircleinversesansserif = 10122; - e.onedeva = 2407; - e.onedotenleader = 8228; - e.oneeighth = 8539; - e.onefitted = 63196; - e.onegujarati = 2791; - e.onegurmukhi = 2663; - e.onehackarabic = 1633; - e.onehalf = 189; - e.onehangzhou = 12321; - e.oneideographicparen = 12832; - e.oneinferior = 8321; - e.onemonospace = 65297; - e.onenumeratorbengali = 2548; - e.oneoldstyle = 63281; - e.oneparen = 9332; - e.oneperiod = 9352; - e.onepersian = 1777; - e.onequarter = 188; - e.oneroman = 8560; - e.onesuperior = 185; - e.onethai = 3665; - e.onethird = 8531; - e.oogonek = 491; - e.oogonekmacron = 493; - e.oogurmukhi = 2579; - e.oomatragurmukhi = 2635; - e.oopen = 596; - e.oparen = 9386; - e.openbullet = 9702; - e.option = 8997; - e.ordfeminine = 170; - e.ordmasculine = 186; - e.orthogonal = 8735; - e.oshortdeva = 2322; - e.oshortvowelsigndeva = 2378; - e.oslash = 248; - e.oslashacute = 511; - e.osmallhiragana = 12361; - e.osmallkatakana = 12457; - e.osmallkatakanahalfwidth = 65387; - e.ostrokeacute = 511; - e.osuperior = 63216; - e.otcyrillic = 1151; - e.otilde = 245; - e.otildeacute = 7757; - e.otildedieresis = 7759; - e.oubopomofo = 12577; - e.overline = 8254; - e.overlinecenterline = 65098; - e.overlinecmb = 773; - e.overlinedashed = 65097; - e.overlinedblwavy = 65100; - e.overlinewavy = 65099; - e.overscore = 175; - e.ovowelsignbengali = 2507; - e.ovowelsigndeva = 2379; - e.ovowelsigngujarati = 2763; - e.p = 112; - e.paampssquare = 13184; - e.paasentosquare = 13099; - e.pabengali = 2474; - e.pacute = 7765; - e.padeva = 2346; - e.pagedown = 8671; - e.pageup = 8670; - e.pagujarati = 2730; - e.pagurmukhi = 2602; - e.pahiragana = 12401; - e.paiyannoithai = 3631; - e.pakatakana = 12497; - e.palatalizationcyrilliccmb = 1156; - e.palochkacyrillic = 1216; - e.pansioskorean = 12671; - e.paragraph = 182; - e.parallel = 8741; - e.parenleft = 40; - e.parenleftaltonearabic = 64830; - e.parenleftbt = 63725; - e.parenleftex = 63724; - e.parenleftinferior = 8333; - e.parenleftmonospace = 65288; - e.parenleftsmall = 65113; - e.parenleftsuperior = 8317; - e.parenlefttp = 63723; - e.parenleftvertical = 65077; - e.parenright = 41; - e.parenrightaltonearabic = 64831; - e.parenrightbt = 63736; - e.parenrightex = 63735; - e.parenrightinferior = 8334; - e.parenrightmonospace = 65289; - e.parenrightsmall = 65114; - e.parenrightsuperior = 8318; - e.parenrighttp = 63734; - e.parenrightvertical = 65078; - e.partialdiff = 8706; - e.paseqhebrew = 1472; - e.pashtahebrew = 1433; - e.pasquare = 13225; - e.patah = 1463; - e.patah11 = 1463; - e.patah1d = 1463; - e.patah2a = 1463; - e.patahhebrew = 1463; - e.patahnarrowhebrew = 1463; - e.patahquarterhebrew = 1463; - e.patahwidehebrew = 1463; - e.pazerhebrew = 1441; - e.pbopomofo = 12550; - e.pcircle = 9439; - e.pdotaccent = 7767; - e.pe = 1508; - e.pecyrillic = 1087; - e.pedagesh = 64324; - e.pedageshhebrew = 64324; - e.peezisquare = 13115; - e.pefinaldageshhebrew = 64323; - e.peharabic = 1662; - e.peharmenian = 1402; - e.pehebrew = 1508; - e.pehfinalarabic = 64343; - e.pehinitialarabic = 64344; - e.pehiragana = 12410; - e.pehmedialarabic = 64345; - e.pekatakana = 12506; - e.pemiddlehookcyrillic = 1191; - e.perafehebrew = 64334; - e.percent = 37; - e.percentarabic = 1642; - e.percentmonospace = 65285; - e.percentsmall = 65130; - e.period = 46; - e.periodarmenian = 1417; - e.periodcentered = 183; - e.periodhalfwidth = 65377; - e.periodinferior = 63207; - e.periodmonospace = 65294; - e.periodsmall = 65106; - e.periodsuperior = 63208; - e.perispomenigreekcmb = 834; - e.perpendicular = 8869; - e.perthousand = 8240; - e.peseta = 8359; - e.pfsquare = 13194; - e.phabengali = 2475; - e.phadeva = 2347; - e.phagujarati = 2731; - e.phagurmukhi = 2603; - e.phi = 966; - e.phi1 = 981; - e.phieuphacirclekorean = 12922; - e.phieuphaparenkorean = 12826; - e.phieuphcirclekorean = 12908; - e.phieuphkorean = 12621; - e.phieuphparenkorean = 12812; - e.philatin = 632; - e.phinthuthai = 3642; - e.phisymbolgreek = 981; - e.phook = 421; - e.phophanthai = 3614; - e.phophungthai = 3612; - e.phosamphaothai = 3616; - e.pi = 960; - e.pieupacirclekorean = 12915; - e.pieupaparenkorean = 12819; - e.pieupcieuckorean = 12662; - e.pieupcirclekorean = 12901; - e.pieupkiyeokkorean = 12658; - e.pieupkorean = 12610; - e.pieupparenkorean = 12805; - e.pieupsioskiyeokkorean = 12660; - e.pieupsioskorean = 12612; - e.pieupsiostikeutkorean = 12661; - e.pieupthieuthkorean = 12663; - e.pieuptikeutkorean = 12659; - e.pihiragana = 12404; - e.pikatakana = 12500; - e.pisymbolgreek = 982; - e.piwrarmenian = 1411; - e.planckover2pi = 8463; - e.planckover2pi1 = 8463; - e.plus = 43; - e.plusbelowcmb = 799; - e.pluscircle = 8853; - e.plusminus = 177; - e.plusmod = 726; - e.plusmonospace = 65291; - e.plussmall = 65122; - e.plussuperior = 8314; - e.pmonospace = 65360; - e.pmsquare = 13272; - e.pohiragana = 12413; - e.pointingindexdownwhite = 9759; - e.pointingindexleftwhite = 9756; - e.pointingindexrightwhite = 9758; - e.pointingindexupwhite = 9757; - e.pokatakana = 12509; - e.poplathai = 3611; - e.postalmark = 12306; - e.postalmarkface = 12320; - e.pparen = 9387; - e.precedes = 8826; - e.prescription = 8478; - e.primemod = 697; - e.primereversed = 8245; - e.product = 8719; - e.projective = 8965; - e.prolongedkana = 12540; - e.propellor = 8984; - e.propersubset = 8834; - e.propersuperset = 8835; - e.proportion = 8759; - e.proportional = 8733; - e.psi = 968; - e.psicyrillic = 1137; - e.psilipneumatacyrilliccmb = 1158; - e.pssquare = 13232; - e.puhiragana = 12407; - e.pukatakana = 12503; - e.pvsquare = 13236; - e.pwsquare = 13242; - e.q = 113; - e.qadeva = 2392; - e.qadmahebrew = 1448; - e.qafarabic = 1602; - e.qaffinalarabic = 65238; - e.qafinitialarabic = 65239; - e.qafmedialarabic = 65240; - e.qamats = 1464; - e.qamats10 = 1464; - e.qamats1a = 1464; - e.qamats1c = 1464; - e.qamats27 = 1464; - e.qamats29 = 1464; - e.qamats33 = 1464; - e.qamatsde = 1464; - e.qamatshebrew = 1464; - e.qamatsnarrowhebrew = 1464; - e.qamatsqatanhebrew = 1464; - e.qamatsqatannarrowhebrew = 1464; - e.qamatsqatanquarterhebrew = 1464; - e.qamatsqatanwidehebrew = 1464; - e.qamatsquarterhebrew = 1464; - e.qamatswidehebrew = 1464; - e.qarneyparahebrew = 1439; - e.qbopomofo = 12561; - e.qcircle = 9440; - e.qhook = 672; - e.qmonospace = 65361; - e.qof = 1511; - e.qofdagesh = 64327; - e.qofdageshhebrew = 64327; - e.qofhebrew = 1511; - e.qparen = 9388; - e.quarternote = 9833; - e.qubuts = 1467; - e.qubuts18 = 1467; - e.qubuts25 = 1467; - e.qubuts31 = 1467; - e.qubutshebrew = 1467; - e.qubutsnarrowhebrew = 1467; - e.qubutsquarterhebrew = 1467; - e.qubutswidehebrew = 1467; - e.question = 63; - e.questionarabic = 1567; - e.questionarmenian = 1374; - e.questiondown = 191; - e.questiondownsmall = 63423; - e.questiongreek = 894; - e.questionmonospace = 65311; - e.questionsmall = 63295; - e.quotedbl = 34; - e.quotedblbase = 8222; - e.quotedblleft = 8220; - e.quotedblmonospace = 65282; - e.quotedblprime = 12318; - e.quotedblprimereversed = 12317; - e.quotedblright = 8221; - e.quoteleft = 8216; - e.quoteleftreversed = 8219; - e.quotereversed = 8219; - e.quoteright = 8217; - e.quoterightn = 329; - e.quotesinglbase = 8218; - e.quotesingle = 39; - e.quotesinglemonospace = 65287; - e.r = 114; - e.raarmenian = 1404; - e.rabengali = 2480; - e.racute = 341; - e.radeva = 2352; - e.radical = 8730; - e.radicalex = 63717; - e.radoverssquare = 13230; - e.radoverssquaredsquare = 13231; - e.radsquare = 13229; - e.rafe = 1471; - e.rafehebrew = 1471; - e.ragujarati = 2736; - e.ragurmukhi = 2608; - e.rahiragana = 12425; - e.rakatakana = 12521; - e.rakatakanahalfwidth = 65431; - e.ralowerdiagonalbengali = 2545; - e.ramiddlediagonalbengali = 2544; - e.ramshorn = 612; - e.ratio = 8758; - e.rbopomofo = 12566; - e.rcaron = 345; - e.rcedilla = 343; - e.rcircle = 9441; - e.rcommaaccent = 343; - e.rdblgrave = 529; - e.rdotaccent = 7769; - e.rdotbelow = 7771; - e.rdotbelowmacron = 7773; - e.referencemark = 8251; - e.reflexsubset = 8838; - e.reflexsuperset = 8839; - e.registered = 174; - e.registersans = 63720; - e.registerserif = 63194; - e.reharabic = 1585; - e.reharmenian = 1408; - e.rehfinalarabic = 65198; - e.rehiragana = 12428; - e.rekatakana = 12524; - e.rekatakanahalfwidth = 65434; - e.resh = 1512; - e.reshdageshhebrew = 64328; - e.reshhebrew = 1512; - e.reversedtilde = 8765; - e.reviahebrew = 1431; - e.reviamugrashhebrew = 1431; - e.revlogicalnot = 8976; - e.rfishhook = 638; - e.rfishhookreversed = 639; - e.rhabengali = 2525; - e.rhadeva = 2397; - e.rho = 961; - e.rhook = 637; - e.rhookturned = 635; - e.rhookturnedsuperior = 693; - e.rhosymbolgreek = 1009; - e.rhotichookmod = 734; - e.rieulacirclekorean = 12913; - e.rieulaparenkorean = 12817; - e.rieulcirclekorean = 12899; - e.rieulhieuhkorean = 12608; - e.rieulkiyeokkorean = 12602; - e.rieulkiyeoksioskorean = 12649; - e.rieulkorean = 12601; - e.rieulmieumkorean = 12603; - e.rieulpansioskorean = 12652; - e.rieulparenkorean = 12803; - e.rieulphieuphkorean = 12607; - e.rieulpieupkorean = 12604; - e.rieulpieupsioskorean = 12651; - e.rieulsioskorean = 12605; - e.rieulthieuthkorean = 12606; - e.rieultikeutkorean = 12650; - e.rieulyeorinhieuhkorean = 12653; - e.rightangle = 8735; - e.righttackbelowcmb = 793; - e.righttriangle = 8895; - e.rihiragana = 12426; - e.rikatakana = 12522; - e.rikatakanahalfwidth = 65432; - e.ring = 730; - e.ringbelowcmb = 805; - e.ringcmb = 778; - e.ringhalfleft = 703; - e.ringhalfleftarmenian = 1369; - e.ringhalfleftbelowcmb = 796; - e.ringhalfleftcentered = 723; - e.ringhalfright = 702; - e.ringhalfrightbelowcmb = 825; - e.ringhalfrightcentered = 722; - e.rinvertedbreve = 531; - e.rittorusquare = 13137; - e.rlinebelow = 7775; - e.rlongleg = 636; - e.rlonglegturned = 634; - e.rmonospace = 65362; - e.rohiragana = 12429; - e.rokatakana = 12525; - e.rokatakanahalfwidth = 65435; - e.roruathai = 3619; - e.rparen = 9389; - e.rrabengali = 2524; - e.rradeva = 2353; - e.rragurmukhi = 2652; - e.rreharabic = 1681; - e.rrehfinalarabic = 64397; - e.rrvocalicbengali = 2528; - e.rrvocalicdeva = 2400; - e.rrvocalicgujarati = 2784; - e.rrvocalicvowelsignbengali = 2500; - e.rrvocalicvowelsigndeva = 2372; - e.rrvocalicvowelsigngujarati = 2756; - e.rsuperior = 63217; - e.rtblock = 9616; - e.rturned = 633; - e.rturnedsuperior = 692; - e.ruhiragana = 12427; - e.rukatakana = 12523; - e.rukatakanahalfwidth = 65433; - e.rupeemarkbengali = 2546; - e.rupeesignbengali = 2547; - e.rupiah = 63197; - e.ruthai = 3620; - e.rvocalicbengali = 2443; - e.rvocalicdeva = 2315; - e.rvocalicgujarati = 2699; - e.rvocalicvowelsignbengali = 2499; - e.rvocalicvowelsigndeva = 2371; - e.rvocalicvowelsigngujarati = 2755; - e.s = 115; - e.sabengali = 2488; - e.sacute = 347; - e.sacutedotaccent = 7781; - e.sadarabic = 1589; - e.sadeva = 2360; - e.sadfinalarabic = 65210; - e.sadinitialarabic = 65211; - e.sadmedialarabic = 65212; - e.sagujarati = 2744; - e.sagurmukhi = 2616; - e.sahiragana = 12373; - e.sakatakana = 12469; - e.sakatakanahalfwidth = 65403; - e.sallallahoualayhewasallamarabic = 65018; - e.samekh = 1505; - e.samekhdagesh = 64321; - e.samekhdageshhebrew = 64321; - e.samekhhebrew = 1505; - e.saraaathai = 3634; - e.saraaethai = 3649; - e.saraaimaimalaithai = 3652; - e.saraaimaimuanthai = 3651; - e.saraamthai = 3635; - e.saraathai = 3632; - e.saraethai = 3648; - e.saraiileftthai = 63622; - e.saraiithai = 3637; - e.saraileftthai = 63621; - e.saraithai = 3636; - e.saraothai = 3650; - e.saraueeleftthai = 63624; - e.saraueethai = 3639; - e.saraueleftthai = 63623; - e.sarauethai = 3638; - e.sarauthai = 3640; - e.sarauuthai = 3641; - e.sbopomofo = 12569; - e.scaron = 353; - e.scarondotaccent = 7783; - e.scedilla = 351; - e.schwa = 601; - e.schwacyrillic = 1241; - e.schwadieresiscyrillic = 1243; - e.schwahook = 602; - e.scircle = 9442; - e.scircumflex = 349; - e.scommaaccent = 537; - e.sdotaccent = 7777; - e.sdotbelow = 7779; - e.sdotbelowdotaccent = 7785; - e.seagullbelowcmb = 828; - e.second = 8243; - e.secondtonechinese = 714; - e.section = 167; - e.seenarabic = 1587; - e.seenfinalarabic = 65202; - e.seeninitialarabic = 65203; - e.seenmedialarabic = 65204; - e.segol = 1462; - e.segol13 = 1462; - e.segol1f = 1462; - e.segol2c = 1462; - e.segolhebrew = 1462; - e.segolnarrowhebrew = 1462; - e.segolquarterhebrew = 1462; - e.segoltahebrew = 1426; - e.segolwidehebrew = 1462; - e.seharmenian = 1405; - e.sehiragana = 12379; - e.sekatakana = 12475; - e.sekatakanahalfwidth = 65406; - e.semicolon = 59; - e.semicolonarabic = 1563; - e.semicolonmonospace = 65307; - e.semicolonsmall = 65108; - e.semivoicedmarkkana = 12444; - e.semivoicedmarkkanahalfwidth = 65439; - e.sentisquare = 13090; - e.sentosquare = 13091; - e.seven = 55; - e.sevenarabic = 1639; - e.sevenbengali = 2541; - e.sevencircle = 9318; - e.sevencircleinversesansserif = 10128; - e.sevendeva = 2413; - e.seveneighths = 8542; - e.sevengujarati = 2797; - e.sevengurmukhi = 2669; - e.sevenhackarabic = 1639; - e.sevenhangzhou = 12327; - e.sevenideographicparen = 12838; - e.seveninferior = 8327; - e.sevenmonospace = 65303; - e.sevenoldstyle = 63287; - e.sevenparen = 9338; - e.sevenperiod = 9358; - e.sevenpersian = 1783; - e.sevenroman = 8566; - e.sevensuperior = 8311; - e.seventeencircle = 9328; - e.seventeenparen = 9348; - e.seventeenperiod = 9368; - e.seventhai = 3671; - e.sfthyphen = 173; - e.shaarmenian = 1399; - e.shabengali = 2486; - e.shacyrillic = 1096; - e.shaddaarabic = 1617; - e.shaddadammaarabic = 64609; - e.shaddadammatanarabic = 64606; - e.shaddafathaarabic = 64608; - e.shaddakasraarabic = 64610; - e.shaddakasratanarabic = 64607; - e.shade = 9618; - e.shadedark = 9619; - e.shadelight = 9617; - e.shademedium = 9618; - e.shadeva = 2358; - e.shagujarati = 2742; - e.shagurmukhi = 2614; - e.shalshelethebrew = 1427; - e.shbopomofo = 12565; - e.shchacyrillic = 1097; - e.sheenarabic = 1588; - e.sheenfinalarabic = 65206; - e.sheeninitialarabic = 65207; - e.sheenmedialarabic = 65208; - e.sheicoptic = 995; - e.sheqel = 8362; - e.sheqelhebrew = 8362; - e.sheva = 1456; - e.sheva115 = 1456; - e.sheva15 = 1456; - e.sheva22 = 1456; - e.sheva2e = 1456; - e.shevahebrew = 1456; - e.shevanarrowhebrew = 1456; - e.shevaquarterhebrew = 1456; - e.shevawidehebrew = 1456; - e.shhacyrillic = 1211; - e.shimacoptic = 1005; - e.shin = 1513; - e.shindagesh = 64329; - e.shindageshhebrew = 64329; - e.shindageshshindot = 64300; - e.shindageshshindothebrew = 64300; - e.shindageshsindot = 64301; - e.shindageshsindothebrew = 64301; - e.shindothebrew = 1473; - e.shinhebrew = 1513; - e.shinshindot = 64298; - e.shinshindothebrew = 64298; - e.shinsindot = 64299; - e.shinsindothebrew = 64299; - e.shook = 642; - e.sigma = 963; - e.sigma1 = 962; - e.sigmafinal = 962; - e.sigmalunatesymbolgreek = 1010; - e.sihiragana = 12375; - e.sikatakana = 12471; - e.sikatakanahalfwidth = 65404; - e.siluqhebrew = 1469; - e.siluqlefthebrew = 1469; - e.similar = 8764; - e.sindothebrew = 1474; - e.siosacirclekorean = 12916; - e.siosaparenkorean = 12820; - e.sioscieuckorean = 12670; - e.sioscirclekorean = 12902; - e.sioskiyeokkorean = 12666; - e.sioskorean = 12613; - e.siosnieunkorean = 12667; - e.siosparenkorean = 12806; - e.siospieupkorean = 12669; - e.siostikeutkorean = 12668; - e.six = 54; - e.sixarabic = 1638; - e.sixbengali = 2540; - e.sixcircle = 9317; - e.sixcircleinversesansserif = 10127; - e.sixdeva = 2412; - e.sixgujarati = 2796; - e.sixgurmukhi = 2668; - e.sixhackarabic = 1638; - e.sixhangzhou = 12326; - e.sixideographicparen = 12837; - e.sixinferior = 8326; - e.sixmonospace = 65302; - e.sixoldstyle = 63286; - e.sixparen = 9337; - e.sixperiod = 9357; - e.sixpersian = 1782; - e.sixroman = 8565; - e.sixsuperior = 8310; - e.sixteencircle = 9327; - e.sixteencurrencydenominatorbengali = 2553; - e.sixteenparen = 9347; - e.sixteenperiod = 9367; - e.sixthai = 3670; - e.slash = 47; - e.slashmonospace = 65295; - e.slong = 383; - e.slongdotaccent = 7835; - e.smileface = 9786; - e.smonospace = 65363; - e.sofpasuqhebrew = 1475; - e.softhyphen = 173; - e.softsigncyrillic = 1100; - e.sohiragana = 12381; - e.sokatakana = 12477; - e.sokatakanahalfwidth = 65407; - e.soliduslongoverlaycmb = 824; - e.solidusshortoverlaycmb = 823; - e.sorusithai = 3625; - e.sosalathai = 3624; - e.sosothai = 3595; - e.sosuathai = 3626; - e.space = 32; - e.spacehackarabic = 32; - e.spade = 9824; - e.spadesuitblack = 9824; - e.spadesuitwhite = 9828; - e.sparen = 9390; - e.squarebelowcmb = 827; - e.squarecc = 13252; - e.squarecm = 13213; - e.squarediagonalcrosshatchfill = 9641; - e.squarehorizontalfill = 9636; - e.squarekg = 13199; - e.squarekm = 13214; - e.squarekmcapital = 13262; - e.squareln = 13265; - e.squarelog = 13266; - e.squaremg = 13198; - e.squaremil = 13269; - e.squaremm = 13212; - e.squaremsquared = 13217; - e.squareorthogonalcrosshatchfill = 9638; - e.squareupperlefttolowerrightfill = 9639; - e.squareupperrighttolowerleftfill = 9640; - e.squareverticalfill = 9637; - e.squarewhitewithsmallblack = 9635; - e.srsquare = 13275; - e.ssabengali = 2487; - e.ssadeva = 2359; - e.ssagujarati = 2743; - e.ssangcieuckorean = 12617; - e.ssanghieuhkorean = 12677; - e.ssangieungkorean = 12672; - e.ssangkiyeokkorean = 12594; - e.ssangnieunkorean = 12645; - e.ssangpieupkorean = 12611; - e.ssangsioskorean = 12614; - e.ssangtikeutkorean = 12600; - e.ssuperior = 63218; - e.sterling = 163; - e.sterlingmonospace = 65505; - e.strokelongoverlaycmb = 822; - e.strokeshortoverlaycmb = 821; - e.subset = 8834; - e.subsetnotequal = 8842; - e.subsetorequal = 8838; - e.succeeds = 8827; - e.suchthat = 8715; - e.suhiragana = 12377; - e.sukatakana = 12473; - e.sukatakanahalfwidth = 65405; - e.sukunarabic = 1618; - e.summation = 8721; - e.sun = 9788; - e.superset = 8835; - e.supersetnotequal = 8843; - e.supersetorequal = 8839; - e.svsquare = 13276; - e.syouwaerasquare = 13180; - e.t = 116; - e.tabengali = 2468; - e.tackdown = 8868; - e.tackleft = 8867; - e.tadeva = 2340; - e.tagujarati = 2724; - e.tagurmukhi = 2596; - e.taharabic = 1591; - e.tahfinalarabic = 65218; - e.tahinitialarabic = 65219; - e.tahiragana = 12383; - e.tahmedialarabic = 65220; - e.taisyouerasquare = 13181; - e.takatakana = 12479; - e.takatakanahalfwidth = 65408; - e.tatweelarabic = 1600; - e.tau = 964; - e.tav = 1514; - e.tavdages = 64330; - e.tavdagesh = 64330; - e.tavdageshhebrew = 64330; - e.tavhebrew = 1514; - e.tbar = 359; - e.tbopomofo = 12554; - e.tcaron = 357; - e.tccurl = 680; - e.tcedilla = 355; - e.tcheharabic = 1670; - e.tchehfinalarabic = 64379; - e.tchehinitialarabic = 64380; - e.tchehmedialarabic = 64381; - e.tcircle = 9443; - e.tcircumflexbelow = 7793; - e.tcommaaccent = 355; - e.tdieresis = 7831; - e.tdotaccent = 7787; - e.tdotbelow = 7789; - e.tecyrillic = 1090; - e.tedescendercyrillic = 1197; - e.teharabic = 1578; - e.tehfinalarabic = 65174; - e.tehhahinitialarabic = 64674; - e.tehhahisolatedarabic = 64524; - e.tehinitialarabic = 65175; - e.tehiragana = 12390; - e.tehjeeminitialarabic = 64673; - e.tehjeemisolatedarabic = 64523; - e.tehmarbutaarabic = 1577; - e.tehmarbutafinalarabic = 65172; - e.tehmedialarabic = 65176; - e.tehmeeminitialarabic = 64676; - e.tehmeemisolatedarabic = 64526; - e.tehnoonfinalarabic = 64627; - e.tekatakana = 12486; - e.tekatakanahalfwidth = 65411; - e.telephone = 8481; - e.telephoneblack = 9742; - e.telishagedolahebrew = 1440; - e.telishaqetanahebrew = 1449; - e.tencircle = 9321; - e.tenideographicparen = 12841; - e.tenparen = 9341; - e.tenperiod = 9361; - e.tenroman = 8569; - e.tesh = 679; - e.tet = 1496; - e.tetdagesh = 64312; - e.tetdageshhebrew = 64312; - e.tethebrew = 1496; - e.tetsecyrillic = 1205; - e.tevirhebrew = 1435; - e.tevirlefthebrew = 1435; - e.thabengali = 2469; - e.thadeva = 2341; - e.thagujarati = 2725; - e.thagurmukhi = 2597; - e.thalarabic = 1584; - e.thalfinalarabic = 65196; - e.thanthakhatlowleftthai = 63640; - e.thanthakhatlowrightthai = 63639; - e.thanthakhatthai = 3660; - e.thanthakhatupperleftthai = 63638; - e.theharabic = 1579; - e.thehfinalarabic = 65178; - e.thehinitialarabic = 65179; - e.thehmedialarabic = 65180; - e.thereexists = 8707; - e.therefore = 8756; - e.theta = 952; - e.theta1 = 977; - e.thetasymbolgreek = 977; - e.thieuthacirclekorean = 12921; - e.thieuthaparenkorean = 12825; - e.thieuthcirclekorean = 12907; - e.thieuthkorean = 12620; - e.thieuthparenkorean = 12811; - e.thirteencircle = 9324; - e.thirteenparen = 9344; - e.thirteenperiod = 9364; - e.thonangmonthothai = 3601; - e.thook = 429; - e.thophuthaothai = 3602; - e.thorn = 254; - e.thothahanthai = 3607; - e.thothanthai = 3600; - e.thothongthai = 3608; - e.thothungthai = 3606; - e.thousandcyrillic = 1154; - e.thousandsseparatorarabic = 1644; - e.thousandsseparatorpersian = 1644; - e.three = 51; - e.threearabic = 1635; - e.threebengali = 2537; - e.threecircle = 9314; - e.threecircleinversesansserif = 10124; - e.threedeva = 2409; - e.threeeighths = 8540; - e.threegujarati = 2793; - e.threegurmukhi = 2665; - e.threehackarabic = 1635; - e.threehangzhou = 12323; - e.threeideographicparen = 12834; - e.threeinferior = 8323; - e.threemonospace = 65299; - e.threenumeratorbengali = 2550; - e.threeoldstyle = 63283; - e.threeparen = 9334; - e.threeperiod = 9354; - e.threepersian = 1779; - e.threequarters = 190; - e.threequartersemdash = 63198; - e.threeroman = 8562; - e.threesuperior = 179; - e.threethai = 3667; - e.thzsquare = 13204; - e.tihiragana = 12385; - e.tikatakana = 12481; - e.tikatakanahalfwidth = 65409; - e.tikeutacirclekorean = 12912; - e.tikeutaparenkorean = 12816; - e.tikeutcirclekorean = 12898; - e.tikeutkorean = 12599; - e.tikeutparenkorean = 12802; - e.tilde = 732; - e.tildebelowcmb = 816; - e.tildecmb = 771; - e.tildecomb = 771; - e.tildedoublecmb = 864; - e.tildeoperator = 8764; - e.tildeoverlaycmb = 820; - e.tildeverticalcmb = 830; - e.timescircle = 8855; - e.tipehahebrew = 1430; - e.tipehalefthebrew = 1430; - e.tippigurmukhi = 2672; - e.titlocyrilliccmb = 1155; - e.tiwnarmenian = 1407; - e.tlinebelow = 7791; - e.tmonospace = 65364; - e.toarmenian = 1385; - e.tohiragana = 12392; - e.tokatakana = 12488; - e.tokatakanahalfwidth = 65412; - e.tonebarextrahighmod = 741; - e.tonebarextralowmod = 745; - e.tonebarhighmod = 742; - e.tonebarlowmod = 744; - e.tonebarmidmod = 743; - e.tonefive = 445; - e.tonesix = 389; - e.tonetwo = 424; - e.tonos = 900; - e.tonsquare = 13095; - e.topatakthai = 3599; - e.tortoiseshellbracketleft = 12308; - e.tortoiseshellbracketleftsmall = 65117; - e.tortoiseshellbracketleftvertical = 65081; - e.tortoiseshellbracketright = 12309; - e.tortoiseshellbracketrightsmall = 65118; - e.tortoiseshellbracketrightvertical = 65082; - e.totaothai = 3605; - e.tpalatalhook = 427; - e.tparen = 9391; - e.trademark = 8482; - e.trademarksans = 63722; - e.trademarkserif = 63195; - e.tretroflexhook = 648; - e.triagdn = 9660; - e.triaglf = 9668; - e.triagrt = 9658; - e.triagup = 9650; - e.ts = 678; - e.tsadi = 1510; - e.tsadidagesh = 64326; - e.tsadidageshhebrew = 64326; - e.tsadihebrew = 1510; - e.tsecyrillic = 1094; - e.tsere = 1461; - e.tsere12 = 1461; - e.tsere1e = 1461; - e.tsere2b = 1461; - e.tserehebrew = 1461; - e.tserenarrowhebrew = 1461; - e.tserequarterhebrew = 1461; - e.tserewidehebrew = 1461; - e.tshecyrillic = 1115; - e.tsuperior = 63219; - e.ttabengali = 2463; - e.ttadeva = 2335; - e.ttagujarati = 2719; - e.ttagurmukhi = 2591; - e.tteharabic = 1657; - e.ttehfinalarabic = 64359; - e.ttehinitialarabic = 64360; - e.ttehmedialarabic = 64361; - e.tthabengali = 2464; - e.tthadeva = 2336; - e.tthagujarati = 2720; - e.tthagurmukhi = 2592; - e.tturned = 647; - e.tuhiragana = 12388; - e.tukatakana = 12484; - e.tukatakanahalfwidth = 65410; - e.tusmallhiragana = 12387; - e.tusmallkatakana = 12483; - e.tusmallkatakanahalfwidth = 65391; - e.twelvecircle = 9323; - e.twelveparen = 9343; - e.twelveperiod = 9363; - e.twelveroman = 8571; - e.twentycircle = 9331; - e.twentyhangzhou = 21316; - e.twentyparen = 9351; - e.twentyperiod = 9371; - e.two = 50; - e.twoarabic = 1634; - e.twobengali = 2536; - e.twocircle = 9313; - e.twocircleinversesansserif = 10123; - e.twodeva = 2408; - e.twodotenleader = 8229; - e.twodotleader = 8229; - e.twodotleadervertical = 65072; - e.twogujarati = 2792; - e.twogurmukhi = 2664; - e.twohackarabic = 1634; - e.twohangzhou = 12322; - e.twoideographicparen = 12833; - e.twoinferior = 8322; - e.twomonospace = 65298; - e.twonumeratorbengali = 2549; - e.twooldstyle = 63282; - e.twoparen = 9333; - e.twoperiod = 9353; - e.twopersian = 1778; - e.tworoman = 8561; - e.twostroke = 443; - e.twosuperior = 178; - e.twothai = 3666; - e.twothirds = 8532; - e.u = 117; - e.uacute = 250; - e.ubar = 649; - e.ubengali = 2441; - e.ubopomofo = 12584; - e.ubreve = 365; - e.ucaron = 468; - e.ucircle = 9444; - e.ucircumflex = 251; - e.ucircumflexbelow = 7799; - e.ucyrillic = 1091; - e.udattadeva = 2385; - e.udblacute = 369; - e.udblgrave = 533; - e.udeva = 2313; - e.udieresis = 252; - e.udieresisacute = 472; - e.udieresisbelow = 7795; - e.udieresiscaron = 474; - e.udieresiscyrillic = 1265; - e.udieresisgrave = 476; - e.udieresismacron = 470; - e.udotbelow = 7909; - e.ugrave = 249; - e.ugujarati = 2697; - e.ugurmukhi = 2569; - e.uhiragana = 12358; - e.uhookabove = 7911; - e.uhorn = 432; - e.uhornacute = 7913; - e.uhorndotbelow = 7921; - e.uhorngrave = 7915; - e.uhornhookabove = 7917; - e.uhorntilde = 7919; - e.uhungarumlaut = 369; - e.uhungarumlautcyrillic = 1267; - e.uinvertedbreve = 535; - e.ukatakana = 12454; - e.ukatakanahalfwidth = 65395; - e.ukcyrillic = 1145; - e.ukorean = 12636; - e.umacron = 363; - e.umacroncyrillic = 1263; - e.umacrondieresis = 7803; - e.umatragurmukhi = 2625; - e.umonospace = 65365; - e.underscore = 95; - e.underscoredbl = 8215; - e.underscoremonospace = 65343; - e.underscorevertical = 65075; - e.underscorewavy = 65103; - e.union = 8746; - e.universal = 8704; - e.uogonek = 371; - e.uparen = 9392; - e.upblock = 9600; - e.upperdothebrew = 1476; - e.upsilon = 965; - e.upsilondieresis = 971; - e.upsilondieresistonos = 944; - e.upsilonlatin = 650; - e.upsilontonos = 973; - e.uptackbelowcmb = 797; - e.uptackmod = 724; - e.uragurmukhi = 2675; - e.uring = 367; - e.ushortcyrillic = 1118; - e.usmallhiragana = 12357; - e.usmallkatakana = 12453; - e.usmallkatakanahalfwidth = 65385; - e.ustraightcyrillic = 1199; - e.ustraightstrokecyrillic = 1201; - e.utilde = 361; - e.utildeacute = 7801; - e.utildebelow = 7797; - e.uubengali = 2442; - e.uudeva = 2314; - e.uugujarati = 2698; - e.uugurmukhi = 2570; - e.uumatragurmukhi = 2626; - e.uuvowelsignbengali = 2498; - e.uuvowelsigndeva = 2370; - e.uuvowelsigngujarati = 2754; - e.uvowelsignbengali = 2497; - e.uvowelsigndeva = 2369; - e.uvowelsigngujarati = 2753; - e.v = 118; - e.vadeva = 2357; - e.vagujarati = 2741; - e.vagurmukhi = 2613; - e.vakatakana = 12535; - e.vav = 1493; - e.vavdagesh = 64309; - e.vavdagesh65 = 64309; - e.vavdageshhebrew = 64309; - e.vavhebrew = 1493; - e.vavholam = 64331; - e.vavholamhebrew = 64331; - e.vavvavhebrew = 1520; - e.vavyodhebrew = 1521; - e.vcircle = 9445; - e.vdotbelow = 7807; - e.vecyrillic = 1074; - e.veharabic = 1700; - e.vehfinalarabic = 64363; - e.vehinitialarabic = 64364; - e.vehmedialarabic = 64365; - e.vekatakana = 12537; - e.venus = 9792; - e.verticalbar = 124; - e.verticallineabovecmb = 781; - e.verticallinebelowcmb = 809; - e.verticallinelowmod = 716; - e.verticallinemod = 712; - e.vewarmenian = 1406; - e.vhook = 651; - e.vikatakana = 12536; - e.viramabengali = 2509; - e.viramadeva = 2381; - e.viramagujarati = 2765; - e.visargabengali = 2435; - e.visargadeva = 2307; - e.visargagujarati = 2691; - e.vmonospace = 65366; - e.voarmenian = 1400; - e.voicediterationhiragana = 12446; - e.voicediterationkatakana = 12542; - e.voicedmarkkana = 12443; - e.voicedmarkkanahalfwidth = 65438; - e.vokatakana = 12538; - e.vparen = 9393; - e.vtilde = 7805; - e.vturned = 652; - e.vuhiragana = 12436; - e.vukatakana = 12532; - e.w = 119; - e.wacute = 7811; - e.waekorean = 12633; - e.wahiragana = 12431; - e.wakatakana = 12527; - e.wakatakanahalfwidth = 65436; - e.wakorean = 12632; - e.wasmallhiragana = 12430; - e.wasmallkatakana = 12526; - e.wattosquare = 13143; - e.wavedash = 12316; - e.wavyunderscorevertical = 65076; - e.wawarabic = 1608; - e.wawfinalarabic = 65262; - e.wawhamzaabovearabic = 1572; - e.wawhamzaabovefinalarabic = 65158; - e.wbsquare = 13277; - e.wcircle = 9446; - e.wcircumflex = 373; - e.wdieresis = 7813; - e.wdotaccent = 7815; - e.wdotbelow = 7817; - e.wehiragana = 12433; - e.weierstrass = 8472; - e.wekatakana = 12529; - e.wekorean = 12638; - e.weokorean = 12637; - e.wgrave = 7809; - e.whitebullet = 9702; - e.whitecircle = 9675; - e.whitecircleinverse = 9689; - e.whitecornerbracketleft = 12302; - e.whitecornerbracketleftvertical = 65091; - e.whitecornerbracketright = 12303; - e.whitecornerbracketrightvertical = 65092; - e.whitediamond = 9671; - e.whitediamondcontainingblacksmalldiamond = 9672; - e.whitedownpointingsmalltriangle = 9663; - e.whitedownpointingtriangle = 9661; - e.whiteleftpointingsmalltriangle = 9667; - e.whiteleftpointingtriangle = 9665; - e.whitelenticularbracketleft = 12310; - e.whitelenticularbracketright = 12311; - e.whiterightpointingsmalltriangle = 9657; - e.whiterightpointingtriangle = 9655; - e.whitesmallsquare = 9643; - e.whitesmilingface = 9786; - e.whitesquare = 9633; - e.whitestar = 9734; - e.whitetelephone = 9743; - e.whitetortoiseshellbracketleft = 12312; - e.whitetortoiseshellbracketright = 12313; - e.whiteuppointingsmalltriangle = 9653; - e.whiteuppointingtriangle = 9651; - e.wihiragana = 12432; - e.wikatakana = 12528; - e.wikorean = 12639; - e.wmonospace = 65367; - e.wohiragana = 12434; - e.wokatakana = 12530; - e.wokatakanahalfwidth = 65382; - e.won = 8361; - e.wonmonospace = 65510; - e.wowaenthai = 3623; - e.wparen = 9394; - e.wring = 7832; - e.wsuperior = 695; - e.wturned = 653; - e.wynn = 447; - e.x = 120; - e.xabovecmb = 829; - e.xbopomofo = 12562; - e.xcircle = 9447; - e.xdieresis = 7821; - e.xdotaccent = 7819; - e.xeharmenian = 1389; - e.xi = 958; - e.xmonospace = 65368; - e.xparen = 9395; - e.xsuperior = 739; - e.y = 121; - e.yaadosquare = 13134; - e.yabengali = 2479; - e.yacute = 253; - e.yadeva = 2351; - e.yaekorean = 12626; - e.yagujarati = 2735; - e.yagurmukhi = 2607; - e.yahiragana = 12420; - e.yakatakana = 12516; - e.yakatakanahalfwidth = 65428; - e.yakorean = 12625; - e.yamakkanthai = 3662; - e.yasmallhiragana = 12419; - e.yasmallkatakana = 12515; - e.yasmallkatakanahalfwidth = 65388; - e.yatcyrillic = 1123; - e.ycircle = 9448; - e.ycircumflex = 375; - e.ydieresis = 255; - e.ydotaccent = 7823; - e.ydotbelow = 7925; - e.yeharabic = 1610; - e.yehbarreearabic = 1746; - e.yehbarreefinalarabic = 64431; - e.yehfinalarabic = 65266; - e.yehhamzaabovearabic = 1574; - e.yehhamzaabovefinalarabic = 65162; - e.yehhamzaaboveinitialarabic = 65163; - e.yehhamzaabovemedialarabic = 65164; - e.yehinitialarabic = 65267; - e.yehmedialarabic = 65268; - e.yehmeeminitialarabic = 64733; - e.yehmeemisolatedarabic = 64600; - e.yehnoonfinalarabic = 64660; - e.yehthreedotsbelowarabic = 1745; - e.yekorean = 12630; - e.yen = 165; - e.yenmonospace = 65509; - e.yeokorean = 12629; - e.yeorinhieuhkorean = 12678; - e.yerahbenyomohebrew = 1450; - e.yerahbenyomolefthebrew = 1450; - e.yericyrillic = 1099; - e.yerudieresiscyrillic = 1273; - e.yesieungkorean = 12673; - e.yesieungpansioskorean = 12675; - e.yesieungsioskorean = 12674; - e.yetivhebrew = 1434; - e.ygrave = 7923; - e.yhook = 436; - e.yhookabove = 7927; - e.yiarmenian = 1397; - e.yicyrillic = 1111; - e.yikorean = 12642; - e.yinyang = 9775; - e.yiwnarmenian = 1410; - e.ymonospace = 65369; - e.yod = 1497; - e.yoddagesh = 64313; - e.yoddageshhebrew = 64313; - e.yodhebrew = 1497; - e.yodyodhebrew = 1522; - e.yodyodpatahhebrew = 64287; - e.yohiragana = 12424; - e.yoikorean = 12681; - e.yokatakana = 12520; - e.yokatakanahalfwidth = 65430; - e.yokorean = 12635; - e.yosmallhiragana = 12423; - e.yosmallkatakana = 12519; - e.yosmallkatakanahalfwidth = 65390; - e.yotgreek = 1011; - e.yoyaekorean = 12680; - e.yoyakorean = 12679; - e.yoyakthai = 3618; - e.yoyingthai = 3597; - e.yparen = 9396; - e.ypogegrammeni = 890; - e.ypogegrammenigreekcmb = 837; - e.yr = 422; - e.yring = 7833; - e.ysuperior = 696; - e.ytilde = 7929; - e.yturned = 654; - e.yuhiragana = 12422; - e.yuikorean = 12684; - e.yukatakana = 12518; - e.yukatakanahalfwidth = 65429; - e.yukorean = 12640; - e.yusbigcyrillic = 1131; - e.yusbigiotifiedcyrillic = 1133; - e.yuslittlecyrillic = 1127; - e.yuslittleiotifiedcyrillic = 1129; - e.yusmallhiragana = 12421; - e.yusmallkatakana = 12517; - e.yusmallkatakanahalfwidth = 65389; - e.yuyekorean = 12683; - e.yuyeokorean = 12682; - e.yyabengali = 2527; - e.yyadeva = 2399; - e.z = 122; - e.zaarmenian = 1382; - e.zacute = 378; - e.zadeva = 2395; - e.zagurmukhi = 2651; - e.zaharabic = 1592; - e.zahfinalarabic = 65222; - e.zahinitialarabic = 65223; - e.zahiragana = 12374; - e.zahmedialarabic = 65224; - e.zainarabic = 1586; - e.zainfinalarabic = 65200; - e.zakatakana = 12470; - e.zaqefgadolhebrew = 1429; - e.zaqefqatanhebrew = 1428; - e.zarqahebrew = 1432; - e.zayin = 1494; - e.zayindagesh = 64310; - e.zayindageshhebrew = 64310; - e.zayinhebrew = 1494; - e.zbopomofo = 12567; - e.zcaron = 382; - e.zcircle = 9449; - e.zcircumflex = 7825; - e.zcurl = 657; - e.zdot = 380; - e.zdotaccent = 380; - e.zdotbelow = 7827; - e.zecyrillic = 1079; - e.zedescendercyrillic = 1177; - e.zedieresiscyrillic = 1247; - e.zehiragana = 12380; - e.zekatakana = 12476; - e.zero = 48; - e.zeroarabic = 1632; - e.zerobengali = 2534; - e.zerodeva = 2406; - e.zerogujarati = 2790; - e.zerogurmukhi = 2662; - e.zerohackarabic = 1632; - e.zeroinferior = 8320; - e.zeromonospace = 65296; - e.zerooldstyle = 63280; - e.zeropersian = 1776; - e.zerosuperior = 8304; - e.zerothai = 3664; - e.zerowidthjoiner = 65279; - e.zerowidthnonjoiner = 8204; - e.zerowidthspace = 8203; - e.zeta = 950; - e.zhbopomofo = 12563; - e.zhearmenian = 1386; - e.zhebrevecyrillic = 1218; - e.zhecyrillic = 1078; - e.zhedescendercyrillic = 1175; - e.zhedieresiscyrillic = 1245; - e.zihiragana = 12376; - e.zikatakana = 12472; - e.zinorhebrew = 1454; - e.zlinebelow = 7829; - e.zmonospace = 65370; - e.zohiragana = 12382; - e.zokatakana = 12478; - e.zparen = 9397; - e.zretroflexhook = 656; - e.zstroke = 438; - e.zuhiragana = 12378; - e.zukatakana = 12474; - e[".notdef"] = 0; - e.angbracketleftbig = 9001; - e.angbracketleftBig = 9001; - e.angbracketleftbigg = 9001; - e.angbracketleftBigg = 9001; - e.angbracketrightBig = 9002; - e.angbracketrightbig = 9002; - e.angbracketrightBigg = 9002; - e.angbracketrightbigg = 9002; - e.arrowhookleft = 8618; - e.arrowhookright = 8617; - e.arrowlefttophalf = 8636; - e.arrowleftbothalf = 8637; - e.arrownortheast = 8599; - e.arrownorthwest = 8598; - e.arrowrighttophalf = 8640; - e.arrowrightbothalf = 8641; - e.arrowsoutheast = 8600; - e.arrowsouthwest = 8601; - e.backslashbig = 8726; - e.backslashBig = 8726; - e.backslashBigg = 8726; - e.backslashbigg = 8726; - e.bardbl = 8214; - e.bracehtipdownleft = 65079; - e.bracehtipdownright = 65079; - e.bracehtipupleft = 65080; - e.bracehtipupright = 65080; - e.braceleftBig = 123; - e.braceleftbig = 123; - e.braceleftbigg = 123; - e.braceleftBigg = 123; - e.bracerightBig = 125; - e.bracerightbig = 125; - e.bracerightbigg = 125; - e.bracerightBigg = 125; - e.bracketleftbig = 91; - e.bracketleftBig = 91; - e.bracketleftbigg = 91; - e.bracketleftBigg = 91; - e.bracketrightBig = 93; - e.bracketrightbig = 93; - e.bracketrightbigg = 93; - e.bracketrightBigg = 93; - e.ceilingleftbig = 8968; - e.ceilingleftBig = 8968; - e.ceilingleftBigg = 8968; - e.ceilingleftbigg = 8968; - e.ceilingrightbig = 8969; - e.ceilingrightBig = 8969; - e.ceilingrightbigg = 8969; - e.ceilingrightBigg = 8969; - e.circledotdisplay = 8857; - e.circledottext = 8857; - e.circlemultiplydisplay = 8855; - e.circlemultiplytext = 8855; - e.circleplusdisplay = 8853; - e.circleplustext = 8853; - e.contintegraldisplay = 8750; - e.contintegraltext = 8750; - e.coproductdisplay = 8720; - e.coproducttext = 8720; - e.floorleftBig = 8970; - e.floorleftbig = 8970; - e.floorleftbigg = 8970; - e.floorleftBigg = 8970; - e.floorrightbig = 8971; - e.floorrightBig = 8971; - e.floorrightBigg = 8971; - e.floorrightbigg = 8971; - e.hatwide = 770; - e.hatwider = 770; - e.hatwidest = 770; - e.intercal = 7488; - e.integraldisplay = 8747; - e.integraltext = 8747; - e.intersectiondisplay = 8898; - e.intersectiontext = 8898; - e.logicalanddisplay = 8743; - e.logicalandtext = 8743; - e.logicalordisplay = 8744; - e.logicalortext = 8744; - e.parenleftBig = 40; - e.parenleftbig = 40; - e.parenleftBigg = 40; - e.parenleftbigg = 40; - e.parenrightBig = 41; - e.parenrightbig = 41; - e.parenrightBigg = 41; - e.parenrightbigg = 41; - e.prime = 8242; - e.productdisplay = 8719; - e.producttext = 8719; - e.radicalbig = 8730; - e.radicalBig = 8730; - e.radicalBigg = 8730; - e.radicalbigg = 8730; - e.radicalbt = 8730; - e.radicaltp = 8730; - e.radicalvertex = 8730; - e.slashbig = 47; - e.slashBig = 47; - e.slashBigg = 47; - e.slashbigg = 47; - e.summationdisplay = 8721; - e.summationtext = 8721; - e.tildewide = 732; - e.tildewider = 732; - e.tildewidest = 732; - e.uniondisplay = 8899; - e.unionmultidisplay = 8846; - e.unionmultitext = 8846; - e.unionsqdisplay = 8852; - e.unionsqtext = 8852; - e.uniontext = 8899; - e.vextenddouble = 8741; - e.vextendsingle = 8739; - }), - Gi = getLookupTableFactory(function (e) { - e.space = 32; - e.a1 = 9985; - e.a2 = 9986; - e.a202 = 9987; - e.a3 = 9988; - e.a4 = 9742; - e.a5 = 9990; - e.a119 = 9991; - e.a118 = 9992; - e.a117 = 9993; - e.a11 = 9755; - e.a12 = 9758; - e.a13 = 9996; - e.a14 = 9997; - e.a15 = 9998; - e.a16 = 9999; - e.a105 = 1e4; - e.a17 = 10001; - e.a18 = 10002; - e.a19 = 10003; - e.a20 = 10004; - e.a21 = 10005; - e.a22 = 10006; - e.a23 = 10007; - e.a24 = 10008; - e.a25 = 10009; - e.a26 = 10010; - e.a27 = 10011; - e.a28 = 10012; - e.a6 = 10013; - e.a7 = 10014; - e.a8 = 10015; - e.a9 = 10016; - e.a10 = 10017; - e.a29 = 10018; - e.a30 = 10019; - e.a31 = 10020; - e.a32 = 10021; - e.a33 = 10022; - e.a34 = 10023; - e.a35 = 9733; - e.a36 = 10025; - e.a37 = 10026; - e.a38 = 10027; - e.a39 = 10028; - e.a40 = 10029; - e.a41 = 10030; - e.a42 = 10031; - e.a43 = 10032; - e.a44 = 10033; - e.a45 = 10034; - e.a46 = 10035; - e.a47 = 10036; - e.a48 = 10037; - e.a49 = 10038; - e.a50 = 10039; - e.a51 = 10040; - e.a52 = 10041; - e.a53 = 10042; - e.a54 = 10043; - e.a55 = 10044; - e.a56 = 10045; - e.a57 = 10046; - e.a58 = 10047; - e.a59 = 10048; - e.a60 = 10049; - e.a61 = 10050; - e.a62 = 10051; - e.a63 = 10052; - e.a64 = 10053; - e.a65 = 10054; - e.a66 = 10055; - e.a67 = 10056; - e.a68 = 10057; - e.a69 = 10058; - e.a70 = 10059; - e.a71 = 9679; - e.a72 = 10061; - e.a73 = 9632; - e.a74 = 10063; - e.a203 = 10064; - e.a75 = 10065; - e.a204 = 10066; - e.a76 = 9650; - e.a77 = 9660; - e.a78 = 9670; - e.a79 = 10070; - e.a81 = 9687; - e.a82 = 10072; - e.a83 = 10073; - e.a84 = 10074; - e.a97 = 10075; - e.a98 = 10076; - e.a99 = 10077; - e.a100 = 10078; - e.a101 = 10081; - e.a102 = 10082; - e.a103 = 10083; - e.a104 = 10084; - e.a106 = 10085; - e.a107 = 10086; - e.a108 = 10087; - e.a112 = 9827; - e.a111 = 9830; - e.a110 = 9829; - e.a109 = 9824; - e.a120 = 9312; - e.a121 = 9313; - e.a122 = 9314; - e.a123 = 9315; - e.a124 = 9316; - e.a125 = 9317; - e.a126 = 9318; - e.a127 = 9319; - e.a128 = 9320; - e.a129 = 9321; - e.a130 = 10102; - e.a131 = 10103; - e.a132 = 10104; - e.a133 = 10105; - e.a134 = 10106; - e.a135 = 10107; - e.a136 = 10108; - e.a137 = 10109; - e.a138 = 10110; - e.a139 = 10111; - e.a140 = 10112; - e.a141 = 10113; - e.a142 = 10114; - e.a143 = 10115; - e.a144 = 10116; - e.a145 = 10117; - e.a146 = 10118; - e.a147 = 10119; - e.a148 = 10120; - e.a149 = 10121; - e.a150 = 10122; - e.a151 = 10123; - e.a152 = 10124; - e.a153 = 10125; - e.a154 = 10126; - e.a155 = 10127; - e.a156 = 10128; - e.a157 = 10129; - e.a158 = 10130; - e.a159 = 10131; - e.a160 = 10132; - e.a161 = 8594; - e.a163 = 8596; - e.a164 = 8597; - e.a196 = 10136; - e.a165 = 10137; - e.a192 = 10138; - e.a166 = 10139; - e.a167 = 10140; - e.a168 = 10141; - e.a169 = 10142; - e.a170 = 10143; - e.a171 = 10144; - e.a172 = 10145; - e.a173 = 10146; - e.a162 = 10147; - e.a174 = 10148; - e.a175 = 10149; - e.a176 = 10150; - e.a177 = 10151; - e.a178 = 10152; - e.a179 = 10153; - e.a193 = 10154; - e.a180 = 10155; - e.a199 = 10156; - e.a181 = 10157; - e.a200 = 10158; - e.a182 = 10159; - e.a201 = 10161; - e.a183 = 10162; - e.a184 = 10163; - e.a197 = 10164; - e.a185 = 10165; - e.a194 = 10166; - e.a198 = 10167; - e.a186 = 10168; - e.a195 = 10169; - e.a187 = 10170; - e.a188 = 10171; - e.a189 = 10172; - e.a190 = 10173; - e.a191 = 10174; - e.a89 = 10088; - e.a90 = 10089; - e.a93 = 10090; - e.a94 = 10091; - e.a91 = 10092; - e.a92 = 10093; - e.a205 = 10094; - e.a85 = 10095; - e.a206 = 10096; - e.a86 = 10097; - e.a87 = 10098; - e.a88 = 10099; - e.a95 = 10100; - e.a96 = 10101; - e[".notdef"] = 0; - }), - xi = getLookupTableFactory(function (e) { - e[63721] = 169; - e[63193] = 169; - e[63720] = 174; - e[63194] = 174; - e[63722] = 8482; - e[63195] = 8482; - e[63729] = 9127; - e[63730] = 9128; - e[63731] = 9129; - e[63740] = 9131; - e[63741] = 9132; - e[63742] = 9133; - e[63726] = 9121; - e[63727] = 9122; - e[63728] = 9123; - e[63737] = 9124; - e[63738] = 9125; - e[63739] = 9126; - e[63723] = 9115; - e[63724] = 9116; - e[63725] = 9117; - e[63734] = 9118; - e[63735] = 9119; - e[63736] = 9120; - }); -function getUnicodeForGlyph(e, t) { - let i = t[e]; - if (void 0 !== i) return i; - if (!e) return -1; - if ("u" === e[0]) { - const t = e.length; - let a; - if (7 === t && "n" === e[1] && "i" === e[2]) a = e.substring(3); - else { - if (!(t >= 5 && t <= 7)) return -1; - a = e.substring(1); + let offsetSize; + if (lastOffset < 0x100) { + offsetSize = 1; + } else if (lastOffset < 0x10000) { + offsetSize = 2; + } else if (lastOffset < 0x1000000) { + offsetSize = 3; + } else { + offsetSize = 4; } - if (a === a.toUpperCase()) { - i = parseInt(a, 16); - if (i >= 0) return i; - } - } - return -1; -} -const Mi = [ - [0, 127], - [128, 255], - [256, 383], - [384, 591], - [592, 687, 7424, 7551, 7552, 7615], - [688, 767, 42752, 42783], - [768, 879, 7616, 7679], - [880, 1023], - [11392, 11519], - [1024, 1279, 1280, 1327, 11744, 11775, 42560, 42655], - [1328, 1423], - [1424, 1535], - [42240, 42559], - [1536, 1791, 1872, 1919], - [1984, 2047], - [2304, 2431], - [2432, 2559], - [2560, 2687], - [2688, 2815], - [2816, 2943], - [2944, 3071], - [3072, 3199], - [3200, 3327], - [3328, 3455], - [3584, 3711], - [3712, 3839], - [4256, 4351, 11520, 11567], - [6912, 7039], - [4352, 4607], - [7680, 7935, 11360, 11391, 42784, 43007], - [7936, 8191], - [8192, 8303, 11776, 11903], - [8304, 8351], - [8352, 8399], - [8400, 8447], - [8448, 8527], - [8528, 8591], - [8592, 8703, 10224, 10239, 10496, 10623, 11008, 11263], - [8704, 8959, 10752, 11007, 10176, 10223, 10624, 10751], - [8960, 9215], - [9216, 9279], - [9280, 9311], - [9312, 9471], - [9472, 9599], - [9600, 9631], - [9632, 9727], - [9728, 9983], - [9984, 10175], - [12288, 12351], - [12352, 12447], - [12448, 12543, 12784, 12799], - [12544, 12591, 12704, 12735], - [12592, 12687], - [43072, 43135], - [12800, 13055], - [13056, 13311], - [44032, 55215], - [55296, 57343], - [67840, 67871], - [ - 19968, 40959, 11904, 12031, 12032, 12255, 12272, 12287, 13312, 19903, - 131072, 173791, 12688, 12703, - ], - [57344, 63743], - [12736, 12783, 63744, 64255, 194560, 195103], - [64256, 64335], - [64336, 65023], - [65056, 65071], - [65040, 65055], - [65104, 65135], - [65136, 65279], - [65280, 65519], - [65520, 65535], - [3840, 4095], - [1792, 1871], - [1920, 1983], - [3456, 3583], - [4096, 4255], - [4608, 4991, 4992, 5023, 11648, 11743], - [5024, 5119], - [5120, 5759], - [5760, 5791], - [5792, 5887], - [6016, 6143], - [6144, 6319], - [10240, 10495], - [40960, 42127], - [5888, 5919, 5920, 5951, 5952, 5983, 5984, 6015], - [66304, 66351], - [66352, 66383], - [66560, 66639], - [118784, 119039, 119040, 119295, 119296, 119375], - [119808, 120831], - [1044480, 1048573], - [65024, 65039, 917760, 917999], - [917504, 917631], - [6400, 6479], - [6480, 6527], - [6528, 6623], - [6656, 6687], - [11264, 11359], - [11568, 11647], - [19904, 19967], - [43008, 43055], - [65536, 65663, 65664, 65791, 65792, 65855], - [65856, 65935], - [66432, 66463], - [66464, 66527], - [66640, 66687], - [66688, 66735], - [67584, 67647], - [68096, 68191], - [119552, 119647], - [73728, 74751, 74752, 74879], - [119648, 119679], - [7040, 7103], - [7168, 7247], - [7248, 7295], - [43136, 43231], - [43264, 43311], - [43312, 43359], - [43520, 43615], - [65936, 65999], - [66e3, 66047], - [66208, 66271, 66176, 66207, 67872, 67903], - [127024, 127135, 126976, 127023], -]; -function getUnicodeRangeFor(e, t = -1) { - if (-1 !== t) { - const i = Mi[t]; - for (let a = 0, s = i.length; a < s; a += 2) - if (e >= i[a] && e <= i[a + 1]) return t; - } - for (let t = 0, i = Mi.length; t < i; t++) { - const i = Mi[t]; - for (let a = 0, s = i.length; a < s; a += 2) - if (e >= i[a] && e <= i[a + 1]) return t; - } - return -1; -} -const Hi = new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$", "u"), - Ji = new Map(); -const Yi = !0, - vi = 1, - Ki = 2, - Ti = 4, - qi = 32, - Oi = [ - ".notdef", - ".null", - "nonmarkingreturn", - "space", - "exclam", - "quotedbl", - "numbersign", - "dollar", - "percent", - "ampersand", - "quotesingle", - "parenleft", - "parenright", - "asterisk", - "plus", - "comma", - "hyphen", - "period", - "slash", - "zero", - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "colon", - "semicolon", - "less", - "equal", - "greater", - "question", - "at", - "A", - "B", - "C", - "D", - "E", - "F", - "G", - "H", - "I", - "J", - "K", - "L", - "M", - "N", - "O", - "P", - "Q", - "R", - "S", - "T", - "U", - "V", - "W", - "X", - "Y", - "Z", - "bracketleft", - "backslash", - "bracketright", - "asciicircum", - "underscore", - "grave", - "a", - "b", - "c", - "d", - "e", - "f", - "g", - "h", - "i", - "j", - "k", - "l", - "m", - "n", - "o", - "p", - "q", - "r", - "s", - "t", - "u", - "v", - "w", - "x", - "y", - "z", - "braceleft", - "bar", - "braceright", - "asciitilde", - "Adieresis", - "Aring", - "Ccedilla", - "Eacute", - "Ntilde", - "Odieresis", - "Udieresis", - "aacute", - "agrave", - "acircumflex", - "adieresis", - "atilde", - "aring", - "ccedilla", - "eacute", - "egrave", - "ecircumflex", - "edieresis", - "iacute", - "igrave", - "icircumflex", - "idieresis", - "ntilde", - "oacute", - "ograve", - "ocircumflex", - "odieresis", - "otilde", - "uacute", - "ugrave", - "ucircumflex", - "udieresis", - "dagger", - "degree", - "cent", - "sterling", - "section", - "bullet", - "paragraph", - "germandbls", - "registered", - "copyright", - "trademark", - "acute", - "dieresis", - "notequal", - "AE", - "Oslash", - "infinity", - "plusminus", - "lessequal", - "greaterequal", - "yen", - "mu", - "partialdiff", - "summation", - "product", - "pi", - "integral", - "ordfeminine", - "ordmasculine", - "Omega", - "ae", - "oslash", - "questiondown", - "exclamdown", - "logicalnot", - "radical", - "florin", - "approxequal", - "Delta", - "guillemotleft", - "guillemotright", - "ellipsis", - "nonbreakingspace", - "Agrave", - "Atilde", - "Otilde", - "OE", - "oe", - "endash", - "emdash", - "quotedblleft", - "quotedblright", - "quoteleft", - "quoteright", - "divide", - "lozenge", - "ydieresis", - "Ydieresis", - "fraction", - "currency", - "guilsinglleft", - "guilsinglright", - "fi", - "fl", - "daggerdbl", - "periodcentered", - "quotesinglbase", - "quotedblbase", - "perthousand", - "Acircumflex", - "Ecircumflex", - "Aacute", - "Edieresis", - "Egrave", - "Iacute", - "Icircumflex", - "Idieresis", - "Igrave", - "Oacute", - "Ocircumflex", - "apple", - "Ograve", - "Uacute", - "Ucircumflex", - "Ugrave", - "dotlessi", - "circumflex", - "tilde", - "macron", - "breve", - "dotaccent", - "ring", - "cedilla", - "hungarumlaut", - "ogonek", - "caron", - "Lslash", - "lslash", - "Scaron", - "scaron", - "Zcaron", - "zcaron", - "brokenbar", - "Eth", - "eth", - "Yacute", - "yacute", - "Thorn", - "thorn", - "minus", - "multiply", - "onesuperior", - "twosuperior", - "threesuperior", - "onehalf", - "onequarter", - "threequarters", - "franc", - "Gbreve", - "gbreve", - "Idotaccent", - "Scedilla", - "scedilla", - "Cacute", - "cacute", - "Ccaron", - "ccaron", - "dcroat", - ]; -function recoverGlyphName(e, t) { - if (void 0 !== t[e]) return e; - const i = getUnicodeForGlyph(e, t); - if (-1 !== i) for (const e in t) if (t[e] === i) return e; - info("Unable to recover a standard glyph name for: " + e); - return e; -} -function type1FontGlyphMapping(e, t, i) { - const a = Object.create(null); - let s, r, n; - const g = !!(e.flags & Ti); - if (e.isInternalFont) { - n = t; - for (r = 0; r < n.length; r++) { - s = i.indexOf(n[r]); - a[r] = s >= 0 ? s : 0; - } - } else if (e.baseEncodingName) { - n = getEncoding(e.baseEncodingName); - for (r = 0; r < n.length; r++) { - s = i.indexOf(n[r]); - a[r] = s >= 0 ? s : 0; - } - } else if (g) for (r in t) a[r] = t[r]; - else { - n = fi; - for (r = 0; r < n.length; r++) { - s = i.indexOf(n[r]); - a[r] = s >= 0 ? s : 0; - } - } - const o = e.differences; - let c; - if (o) - for (r in o) { - const e = o[r]; - s = i.indexOf(e); - if (-1 === s) { - c || (c = Ni()); - const t = recoverGlyphName(e, c); - t !== e && (s = i.indexOf(t)); + data.push(offsetSize); + let relativeOffset = 1; + for (i = 0; i < count + 1; i++) { + if (offsetSize === 1) { + data.push(relativeOffset & 0xff); + } else if (offsetSize === 2) { + data.push((relativeOffset >> 8) & 0xff, relativeOffset & 0xff); + } else if (offsetSize === 3) { + data.push( + (relativeOffset >> 16) & 0xff, + (relativeOffset >> 8) & 0xff, + relativeOffset & 0xff, + ); + } else { + data.push( + (relativeOffset >>> 24) & 0xff, + (relativeOffset >> 16) & 0xff, + (relativeOffset >> 8) & 0xff, + relativeOffset & 0xff, + ); + } + if (objects[i]) { + relativeOffset += objects[i].length; } - a[r] = s >= 0 ? s : 0; } - return a; + for (i = 0; i < count; i++) { + if (trackers[i]) { + trackers[i].offset(data.length); + } + data.push(...objects[i]); + } + return data; + } +} // ./src/core/glyphlist.js + +const getGlyphsUnicode = getLookupTableFactory(function (t) { + t.A = 0x0041; + t.AE = 0x00c6; + t.AEacute = 0x01fc; + t.AEmacron = 0x01e2; + t.AEsmall = 0xf7e6; + t.Aacute = 0x00c1; + t.Aacutesmall = 0xf7e1; + t.Abreve = 0x0102; + t.Abreveacute = 0x1eae; + t.Abrevecyrillic = 0x04d0; + t.Abrevedotbelow = 0x1eb6; + t.Abrevegrave = 0x1eb0; + t.Abrevehookabove = 0x1eb2; + t.Abrevetilde = 0x1eb4; + t.Acaron = 0x01cd; + t.Acircle = 0x24b6; + t.Acircumflex = 0x00c2; + t.Acircumflexacute = 0x1ea4; + t.Acircumflexdotbelow = 0x1eac; + t.Acircumflexgrave = 0x1ea6; + t.Acircumflexhookabove = 0x1ea8; + t.Acircumflexsmall = 0xf7e2; + t.Acircumflextilde = 0x1eaa; + t.Acute = 0xf6c9; + t.Acutesmall = 0xf7b4; + t.Acyrillic = 0x0410; + t.Adblgrave = 0x0200; + t.Adieresis = 0x00c4; + t.Adieresiscyrillic = 0x04d2; + t.Adieresismacron = 0x01de; + t.Adieresissmall = 0xf7e4; + t.Adotbelow = 0x1ea0; + t.Adotmacron = 0x01e0; + t.Agrave = 0x00c0; + t.Agravesmall = 0xf7e0; + t.Ahookabove = 0x1ea2; + t.Aiecyrillic = 0x04d4; + t.Ainvertedbreve = 0x0202; + t.Alpha = 0x0391; + t.Alphatonos = 0x0386; + t.Amacron = 0x0100; + t.Amonospace = 0xff21; + t.Aogonek = 0x0104; + t.Aring = 0x00c5; + t.Aringacute = 0x01fa; + t.Aringbelow = 0x1e00; + t.Aringsmall = 0xf7e5; + t.Asmall = 0xf761; + t.Atilde = 0x00c3; + t.Atildesmall = 0xf7e3; + t.Aybarmenian = 0x0531; + t.B = 0x0042; + t.Bcircle = 0x24b7; + t.Bdotaccent = 0x1e02; + t.Bdotbelow = 0x1e04; + t.Becyrillic = 0x0411; + t.Benarmenian = 0x0532; + t.Beta = 0x0392; + t.Bhook = 0x0181; + t.Blinebelow = 0x1e06; + t.Bmonospace = 0xff22; + t.Brevesmall = 0xf6f4; + t.Bsmall = 0xf762; + t.Btopbar = 0x0182; + t.C = 0x0043; + t.Caarmenian = 0x053e; + t.Cacute = 0x0106; + t.Caron = 0xf6ca; + t.Caronsmall = 0xf6f5; + t.Ccaron = 0x010c; + t.Ccedilla = 0x00c7; + t.Ccedillaacute = 0x1e08; + t.Ccedillasmall = 0xf7e7; + t.Ccircle = 0x24b8; + t.Ccircumflex = 0x0108; + t.Cdot = 0x010a; + t.Cdotaccent = 0x010a; + t.Cedillasmall = 0xf7b8; + t.Chaarmenian = 0x0549; + t.Cheabkhasiancyrillic = 0x04bc; + t.Checyrillic = 0x0427; + t.Chedescenderabkhasiancyrillic = 0x04be; + t.Chedescendercyrillic = 0x04b6; + t.Chedieresiscyrillic = 0x04f4; + t.Cheharmenian = 0x0543; + t.Chekhakassiancyrillic = 0x04cb; + t.Cheverticalstrokecyrillic = 0x04b8; + t.Chi = 0x03a7; + t.Chook = 0x0187; + t.Circumflexsmall = 0xf6f6; + t.Cmonospace = 0xff23; + t.Coarmenian = 0x0551; + t.Csmall = 0xf763; + t.D = 0x0044; + t.DZ = 0x01f1; + t.DZcaron = 0x01c4; + t.Daarmenian = 0x0534; + t.Dafrican = 0x0189; + t.Dcaron = 0x010e; + t.Dcedilla = 0x1e10; + t.Dcircle = 0x24b9; + t.Dcircumflexbelow = 0x1e12; + t.Dcroat = 0x0110; + t.Ddotaccent = 0x1e0a; + t.Ddotbelow = 0x1e0c; + t.Decyrillic = 0x0414; + t.Deicoptic = 0x03ee; + t.Delta = 0x2206; + t.Deltagreek = 0x0394; + t.Dhook = 0x018a; + t.Dieresis = 0xf6cb; + t.DieresisAcute = 0xf6cc; + t.DieresisGrave = 0xf6cd; + t.Dieresissmall = 0xf7a8; + t.Digammagreek = 0x03dc; + t.Djecyrillic = 0x0402; + t.Dlinebelow = 0x1e0e; + t.Dmonospace = 0xff24; + t.Dotaccentsmall = 0xf6f7; + t.Dslash = 0x0110; + t.Dsmall = 0xf764; + t.Dtopbar = 0x018b; + t.Dz = 0x01f2; + t.Dzcaron = 0x01c5; + t.Dzeabkhasiancyrillic = 0x04e0; + t.Dzecyrillic = 0x0405; + t.Dzhecyrillic = 0x040f; + t.E = 0x0045; + t.Eacute = 0x00c9; + t.Eacutesmall = 0xf7e9; + t.Ebreve = 0x0114; + t.Ecaron = 0x011a; + t.Ecedillabreve = 0x1e1c; + t.Echarmenian = 0x0535; + t.Ecircle = 0x24ba; + t.Ecircumflex = 0x00ca; + t.Ecircumflexacute = 0x1ebe; + t.Ecircumflexbelow = 0x1e18; + t.Ecircumflexdotbelow = 0x1ec6; + t.Ecircumflexgrave = 0x1ec0; + t.Ecircumflexhookabove = 0x1ec2; + t.Ecircumflexsmall = 0xf7ea; + t.Ecircumflextilde = 0x1ec4; + t.Ecyrillic = 0x0404; + t.Edblgrave = 0x0204; + t.Edieresis = 0x00cb; + t.Edieresissmall = 0xf7eb; + t.Edot = 0x0116; + t.Edotaccent = 0x0116; + t.Edotbelow = 0x1eb8; + t.Efcyrillic = 0x0424; + t.Egrave = 0x00c8; + t.Egravesmall = 0xf7e8; + t.Eharmenian = 0x0537; + t.Ehookabove = 0x1eba; + t.Eightroman = 0x2167; + t.Einvertedbreve = 0x0206; + t.Eiotifiedcyrillic = 0x0464; + t.Elcyrillic = 0x041b; + t.Elevenroman = 0x216a; + t.Emacron = 0x0112; + t.Emacronacute = 0x1e16; + t.Emacrongrave = 0x1e14; + t.Emcyrillic = 0x041c; + t.Emonospace = 0xff25; + t.Encyrillic = 0x041d; + t.Endescendercyrillic = 0x04a2; + t.Eng = 0x014a; + t.Enghecyrillic = 0x04a4; + t.Enhookcyrillic = 0x04c7; + t.Eogonek = 0x0118; + t.Eopen = 0x0190; + t.Epsilon = 0x0395; + t.Epsilontonos = 0x0388; + t.Ercyrillic = 0x0420; + t.Ereversed = 0x018e; + t.Ereversedcyrillic = 0x042d; + t.Escyrillic = 0x0421; + t.Esdescendercyrillic = 0x04aa; + t.Esh = 0x01a9; + t.Esmall = 0xf765; + t.Eta = 0x0397; + t.Etarmenian = 0x0538; + t.Etatonos = 0x0389; + t.Eth = 0x00d0; + t.Ethsmall = 0xf7f0; + t.Etilde = 0x1ebc; + t.Etildebelow = 0x1e1a; + t.Euro = 0x20ac; + t.Ezh = 0x01b7; + t.Ezhcaron = 0x01ee; + t.Ezhreversed = 0x01b8; + t.F = 0x0046; + t.Fcircle = 0x24bb; + t.Fdotaccent = 0x1e1e; + t.Feharmenian = 0x0556; + t.Feicoptic = 0x03e4; + t.Fhook = 0x0191; + t.Fitacyrillic = 0x0472; + t.Fiveroman = 0x2164; + t.Fmonospace = 0xff26; + t.Fourroman = 0x2163; + t.Fsmall = 0xf766; + t.G = 0x0047; + t.GBsquare = 0x3387; + t.Gacute = 0x01f4; + t.Gamma = 0x0393; + t.Gammaafrican = 0x0194; + t.Gangiacoptic = 0x03ea; + t.Gbreve = 0x011e; + t.Gcaron = 0x01e6; + t.Gcedilla = 0x0122; + t.Gcircle = 0x24bc; + t.Gcircumflex = 0x011c; + t.Gcommaaccent = 0x0122; + t.Gdot = 0x0120; + t.Gdotaccent = 0x0120; + t.Gecyrillic = 0x0413; + t.Ghadarmenian = 0x0542; + t.Ghemiddlehookcyrillic = 0x0494; + t.Ghestrokecyrillic = 0x0492; + t.Gheupturncyrillic = 0x0490; + t.Ghook = 0x0193; + t.Gimarmenian = 0x0533; + t.Gjecyrillic = 0x0403; + t.Gmacron = 0x1e20; + t.Gmonospace = 0xff27; + t.Grave = 0xf6ce; + t.Gravesmall = 0xf760; + t.Gsmall = 0xf767; + t.Gsmallhook = 0x029b; + t.Gstroke = 0x01e4; + t.H = 0x0048; + t.H18533 = 0x25cf; + t.H18543 = 0x25aa; + t.H18551 = 0x25ab; + t.H22073 = 0x25a1; + t.HPsquare = 0x33cb; + t.Haabkhasiancyrillic = 0x04a8; + t.Hadescendercyrillic = 0x04b2; + t.Hardsigncyrillic = 0x042a; + t.Hbar = 0x0126; + t.Hbrevebelow = 0x1e2a; + t.Hcedilla = 0x1e28; + t.Hcircle = 0x24bd; + t.Hcircumflex = 0x0124; + t.Hdieresis = 0x1e26; + t.Hdotaccent = 0x1e22; + t.Hdotbelow = 0x1e24; + t.Hmonospace = 0xff28; + t.Hoarmenian = 0x0540; + t.Horicoptic = 0x03e8; + t.Hsmall = 0xf768; + t.Hungarumlaut = 0xf6cf; + t.Hungarumlautsmall = 0xf6f8; + t.Hzsquare = 0x3390; + t.I = 0x0049; + t.IAcyrillic = 0x042f; + t.IJ = 0x0132; + t.IUcyrillic = 0x042e; + t.Iacute = 0x00cd; + t.Iacutesmall = 0xf7ed; + t.Ibreve = 0x012c; + t.Icaron = 0x01cf; + t.Icircle = 0x24be; + t.Icircumflex = 0x00ce; + t.Icircumflexsmall = 0xf7ee; + t.Icyrillic = 0x0406; + t.Idblgrave = 0x0208; + t.Idieresis = 0x00cf; + t.Idieresisacute = 0x1e2e; + t.Idieresiscyrillic = 0x04e4; + t.Idieresissmall = 0xf7ef; + t.Idot = 0x0130; + t.Idotaccent = 0x0130; + t.Idotbelow = 0x1eca; + t.Iebrevecyrillic = 0x04d6; + t.Iecyrillic = 0x0415; + t.Ifraktur = 0x2111; + t.Igrave = 0x00cc; + t.Igravesmall = 0xf7ec; + t.Ihookabove = 0x1ec8; + t.Iicyrillic = 0x0418; + t.Iinvertedbreve = 0x020a; + t.Iishortcyrillic = 0x0419; + t.Imacron = 0x012a; + t.Imacroncyrillic = 0x04e2; + t.Imonospace = 0xff29; + t.Iniarmenian = 0x053b; + t.Iocyrillic = 0x0401; + t.Iogonek = 0x012e; + t.Iota = 0x0399; + t.Iotaafrican = 0x0196; + t.Iotadieresis = 0x03aa; + t.Iotatonos = 0x038a; + t.Ismall = 0xf769; + t.Istroke = 0x0197; + t.Itilde = 0x0128; + t.Itildebelow = 0x1e2c; + t.Izhitsacyrillic = 0x0474; + t.Izhitsadblgravecyrillic = 0x0476; + t.J = 0x004a; + t.Jaarmenian = 0x0541; + t.Jcircle = 0x24bf; + t.Jcircumflex = 0x0134; + t.Jecyrillic = 0x0408; + t.Jheharmenian = 0x054b; + t.Jmonospace = 0xff2a; + t.Jsmall = 0xf76a; + t.K = 0x004b; + t.KBsquare = 0x3385; + t.KKsquare = 0x33cd; + t.Kabashkircyrillic = 0x04a0; + t.Kacute = 0x1e30; + t.Kacyrillic = 0x041a; + t.Kadescendercyrillic = 0x049a; + t.Kahookcyrillic = 0x04c3; + t.Kappa = 0x039a; + t.Kastrokecyrillic = 0x049e; + t.Kaverticalstrokecyrillic = 0x049c; + t.Kcaron = 0x01e8; + t.Kcedilla = 0x0136; + t.Kcircle = 0x24c0; + t.Kcommaaccent = 0x0136; + t.Kdotbelow = 0x1e32; + t.Keharmenian = 0x0554; + t.Kenarmenian = 0x053f; + t.Khacyrillic = 0x0425; + t.Kheicoptic = 0x03e6; + t.Khook = 0x0198; + t.Kjecyrillic = 0x040c; + t.Klinebelow = 0x1e34; + t.Kmonospace = 0xff2b; + t.Koppacyrillic = 0x0480; + t.Koppagreek = 0x03de; + t.Ksicyrillic = 0x046e; + t.Ksmall = 0xf76b; + t.L = 0x004c; + t.LJ = 0x01c7; + t.LL = 0xf6bf; + t.Lacute = 0x0139; + t.Lambda = 0x039b; + t.Lcaron = 0x013d; + t.Lcedilla = 0x013b; + t.Lcircle = 0x24c1; + t.Lcircumflexbelow = 0x1e3c; + t.Lcommaaccent = 0x013b; + t.Ldot = 0x013f; + t.Ldotaccent = 0x013f; + t.Ldotbelow = 0x1e36; + t.Ldotbelowmacron = 0x1e38; + t.Liwnarmenian = 0x053c; + t.Lj = 0x01c8; + t.Ljecyrillic = 0x0409; + t.Llinebelow = 0x1e3a; + t.Lmonospace = 0xff2c; + t.Lslash = 0x0141; + t.Lslashsmall = 0xf6f9; + t.Lsmall = 0xf76c; + t.M = 0x004d; + t.MBsquare = 0x3386; + t.Macron = 0xf6d0; + t.Macronsmall = 0xf7af; + t.Macute = 0x1e3e; + t.Mcircle = 0x24c2; + t.Mdotaccent = 0x1e40; + t.Mdotbelow = 0x1e42; + t.Menarmenian = 0x0544; + t.Mmonospace = 0xff2d; + t.Msmall = 0xf76d; + t.Mturned = 0x019c; + t.Mu = 0x039c; + t.N = 0x004e; + t.NJ = 0x01ca; + t.Nacute = 0x0143; + t.Ncaron = 0x0147; + t.Ncedilla = 0x0145; + t.Ncircle = 0x24c3; + t.Ncircumflexbelow = 0x1e4a; + t.Ncommaaccent = 0x0145; + t.Ndotaccent = 0x1e44; + t.Ndotbelow = 0x1e46; + t.Nhookleft = 0x019d; + t.Nineroman = 0x2168; + t.Nj = 0x01cb; + t.Njecyrillic = 0x040a; + t.Nlinebelow = 0x1e48; + t.Nmonospace = 0xff2e; + t.Nowarmenian = 0x0546; + t.Nsmall = 0xf76e; + t.Ntilde = 0x00d1; + t.Ntildesmall = 0xf7f1; + t.Nu = 0x039d; + t.O = 0x004f; + t.OE = 0x0152; + t.OEsmall = 0xf6fa; + t.Oacute = 0x00d3; + t.Oacutesmall = 0xf7f3; + t.Obarredcyrillic = 0x04e8; + t.Obarreddieresiscyrillic = 0x04ea; + t.Obreve = 0x014e; + t.Ocaron = 0x01d1; + t.Ocenteredtilde = 0x019f; + t.Ocircle = 0x24c4; + t.Ocircumflex = 0x00d4; + t.Ocircumflexacute = 0x1ed0; + t.Ocircumflexdotbelow = 0x1ed8; + t.Ocircumflexgrave = 0x1ed2; + t.Ocircumflexhookabove = 0x1ed4; + t.Ocircumflexsmall = 0xf7f4; + t.Ocircumflextilde = 0x1ed6; + t.Ocyrillic = 0x041e; + t.Odblacute = 0x0150; + t.Odblgrave = 0x020c; + t.Odieresis = 0x00d6; + t.Odieresiscyrillic = 0x04e6; + t.Odieresissmall = 0xf7f6; + t.Odotbelow = 0x1ecc; + t.Ogoneksmall = 0xf6fb; + t.Ograve = 0x00d2; + t.Ogravesmall = 0xf7f2; + t.Oharmenian = 0x0555; + t.Ohm = 0x2126; + t.Ohookabove = 0x1ece; + t.Ohorn = 0x01a0; + t.Ohornacute = 0x1eda; + t.Ohorndotbelow = 0x1ee2; + t.Ohorngrave = 0x1edc; + t.Ohornhookabove = 0x1ede; + t.Ohorntilde = 0x1ee0; + t.Ohungarumlaut = 0x0150; + t.Oi = 0x01a2; + t.Oinvertedbreve = 0x020e; + t.Omacron = 0x014c; + t.Omacronacute = 0x1e52; + t.Omacrongrave = 0x1e50; + t.Omega = 0x2126; + t.Omegacyrillic = 0x0460; + t.Omegagreek = 0x03a9; + t.Omegaroundcyrillic = 0x047a; + t.Omegatitlocyrillic = 0x047c; + t.Omegatonos = 0x038f; + t.Omicron = 0x039f; + t.Omicrontonos = 0x038c; + t.Omonospace = 0xff2f; + t.Oneroman = 0x2160; + t.Oogonek = 0x01ea; + t.Oogonekmacron = 0x01ec; + t.Oopen = 0x0186; + t.Oslash = 0x00d8; + t.Oslashacute = 0x01fe; + t.Oslashsmall = 0xf7f8; + t.Osmall = 0xf76f; + t.Ostrokeacute = 0x01fe; + t.Otcyrillic = 0x047e; + t.Otilde = 0x00d5; + t.Otildeacute = 0x1e4c; + t.Otildedieresis = 0x1e4e; + t.Otildesmall = 0xf7f5; + t.P = 0x0050; + t.Pacute = 0x1e54; + t.Pcircle = 0x24c5; + t.Pdotaccent = 0x1e56; + t.Pecyrillic = 0x041f; + t.Peharmenian = 0x054a; + t.Pemiddlehookcyrillic = 0x04a6; + t.Phi = 0x03a6; + t.Phook = 0x01a4; + t.Pi = 0x03a0; + t.Piwrarmenian = 0x0553; + t.Pmonospace = 0xff30; + t.Psi = 0x03a8; + t.Psicyrillic = 0x0470; + t.Psmall = 0xf770; + t.Q = 0x0051; + t.Qcircle = 0x24c6; + t.Qmonospace = 0xff31; + t.Qsmall = 0xf771; + t.R = 0x0052; + t.Raarmenian = 0x054c; + t.Racute = 0x0154; + t.Rcaron = 0x0158; + t.Rcedilla = 0x0156; + t.Rcircle = 0x24c7; + t.Rcommaaccent = 0x0156; + t.Rdblgrave = 0x0210; + t.Rdotaccent = 0x1e58; + t.Rdotbelow = 0x1e5a; + t.Rdotbelowmacron = 0x1e5c; + t.Reharmenian = 0x0550; + t.Rfraktur = 0x211c; + t.Rho = 0x03a1; + t.Ringsmall = 0xf6fc; + t.Rinvertedbreve = 0x0212; + t.Rlinebelow = 0x1e5e; + t.Rmonospace = 0xff32; + t.Rsmall = 0xf772; + t.Rsmallinverted = 0x0281; + t.Rsmallinvertedsuperior = 0x02b6; + t.S = 0x0053; + t.SF010000 = 0x250c; + t.SF020000 = 0x2514; + t.SF030000 = 0x2510; + t.SF040000 = 0x2518; + t.SF050000 = 0x253c; + t.SF060000 = 0x252c; + t.SF070000 = 0x2534; + t.SF080000 = 0x251c; + t.SF090000 = 0x2524; + t.SF100000 = 0x2500; + t.SF110000 = 0x2502; + t.SF190000 = 0x2561; + t.SF200000 = 0x2562; + t.SF210000 = 0x2556; + t.SF220000 = 0x2555; + t.SF230000 = 0x2563; + t.SF240000 = 0x2551; + t.SF250000 = 0x2557; + t.SF260000 = 0x255d; + t.SF270000 = 0x255c; + t.SF280000 = 0x255b; + t.SF360000 = 0x255e; + t.SF370000 = 0x255f; + t.SF380000 = 0x255a; + t.SF390000 = 0x2554; + t.SF400000 = 0x2569; + t.SF410000 = 0x2566; + t.SF420000 = 0x2560; + t.SF430000 = 0x2550; + t.SF440000 = 0x256c; + t.SF450000 = 0x2567; + t.SF460000 = 0x2568; + t.SF470000 = 0x2564; + t.SF480000 = 0x2565; + t.SF490000 = 0x2559; + t.SF500000 = 0x2558; + t.SF510000 = 0x2552; + t.SF520000 = 0x2553; + t.SF530000 = 0x256b; + t.SF540000 = 0x256a; + t.Sacute = 0x015a; + t.Sacutedotaccent = 0x1e64; + t.Sampigreek = 0x03e0; + t.Scaron = 0x0160; + t.Scarondotaccent = 0x1e66; + t.Scaronsmall = 0xf6fd; + t.Scedilla = 0x015e; + t.Schwa = 0x018f; + t.Schwacyrillic = 0x04d8; + t.Schwadieresiscyrillic = 0x04da; + t.Scircle = 0x24c8; + t.Scircumflex = 0x015c; + t.Scommaaccent = 0x0218; + t.Sdotaccent = 0x1e60; + t.Sdotbelow = 0x1e62; + t.Sdotbelowdotaccent = 0x1e68; + t.Seharmenian = 0x054d; + t.Sevenroman = 0x2166; + t.Shaarmenian = 0x0547; + t.Shacyrillic = 0x0428; + t.Shchacyrillic = 0x0429; + t.Sheicoptic = 0x03e2; + t.Shhacyrillic = 0x04ba; + t.Shimacoptic = 0x03ec; + t.Sigma = 0x03a3; + t.Sixroman = 0x2165; + t.Smonospace = 0xff33; + t.Softsigncyrillic = 0x042c; + t.Ssmall = 0xf773; + t.Stigmagreek = 0x03da; + t.T = 0x0054; + t.Tau = 0x03a4; + t.Tbar = 0x0166; + t.Tcaron = 0x0164; + t.Tcedilla = 0x0162; + t.Tcircle = 0x24c9; + t.Tcircumflexbelow = 0x1e70; + t.Tcommaaccent = 0x0162; + t.Tdotaccent = 0x1e6a; + t.Tdotbelow = 0x1e6c; + t.Tecyrillic = 0x0422; + t.Tedescendercyrillic = 0x04ac; + t.Tenroman = 0x2169; + t.Tetsecyrillic = 0x04b4; + t.Theta = 0x0398; + t.Thook = 0x01ac; + t.Thorn = 0x00de; + t.Thornsmall = 0xf7fe; + t.Threeroman = 0x2162; + t.Tildesmall = 0xf6fe; + t.Tiwnarmenian = 0x054f; + t.Tlinebelow = 0x1e6e; + t.Tmonospace = 0xff34; + t.Toarmenian = 0x0539; + t.Tonefive = 0x01bc; + t.Tonesix = 0x0184; + t.Tonetwo = 0x01a7; + t.Tretroflexhook = 0x01ae; + t.Tsecyrillic = 0x0426; + t.Tshecyrillic = 0x040b; + t.Tsmall = 0xf774; + t.Twelveroman = 0x216b; + t.Tworoman = 0x2161; + t.U = 0x0055; + t.Uacute = 0x00da; + t.Uacutesmall = 0xf7fa; + t.Ubreve = 0x016c; + t.Ucaron = 0x01d3; + t.Ucircle = 0x24ca; + t.Ucircumflex = 0x00db; + t.Ucircumflexbelow = 0x1e76; + t.Ucircumflexsmall = 0xf7fb; + t.Ucyrillic = 0x0423; + t.Udblacute = 0x0170; + t.Udblgrave = 0x0214; + t.Udieresis = 0x00dc; + t.Udieresisacute = 0x01d7; + t.Udieresisbelow = 0x1e72; + t.Udieresiscaron = 0x01d9; + t.Udieresiscyrillic = 0x04f0; + t.Udieresisgrave = 0x01db; + t.Udieresismacron = 0x01d5; + t.Udieresissmall = 0xf7fc; + t.Udotbelow = 0x1ee4; + t.Ugrave = 0x00d9; + t.Ugravesmall = 0xf7f9; + t.Uhookabove = 0x1ee6; + t.Uhorn = 0x01af; + t.Uhornacute = 0x1ee8; + t.Uhorndotbelow = 0x1ef0; + t.Uhorngrave = 0x1eea; + t.Uhornhookabove = 0x1eec; + t.Uhorntilde = 0x1eee; + t.Uhungarumlaut = 0x0170; + t.Uhungarumlautcyrillic = 0x04f2; + t.Uinvertedbreve = 0x0216; + t.Ukcyrillic = 0x0478; + t.Umacron = 0x016a; + t.Umacroncyrillic = 0x04ee; + t.Umacrondieresis = 0x1e7a; + t.Umonospace = 0xff35; + t.Uogonek = 0x0172; + t.Upsilon = 0x03a5; + t.Upsilon1 = 0x03d2; + t.Upsilonacutehooksymbolgreek = 0x03d3; + t.Upsilonafrican = 0x01b1; + t.Upsilondieresis = 0x03ab; + t.Upsilondieresishooksymbolgreek = 0x03d4; + t.Upsilonhooksymbol = 0x03d2; + t.Upsilontonos = 0x038e; + t.Uring = 0x016e; + t.Ushortcyrillic = 0x040e; + t.Usmall = 0xf775; + t.Ustraightcyrillic = 0x04ae; + t.Ustraightstrokecyrillic = 0x04b0; + t.Utilde = 0x0168; + t.Utildeacute = 0x1e78; + t.Utildebelow = 0x1e74; + t.V = 0x0056; + t.Vcircle = 0x24cb; + t.Vdotbelow = 0x1e7e; + t.Vecyrillic = 0x0412; + t.Vewarmenian = 0x054e; + t.Vhook = 0x01b2; + t.Vmonospace = 0xff36; + t.Voarmenian = 0x0548; + t.Vsmall = 0xf776; + t.Vtilde = 0x1e7c; + t.W = 0x0057; + t.Wacute = 0x1e82; + t.Wcircle = 0x24cc; + t.Wcircumflex = 0x0174; + t.Wdieresis = 0x1e84; + t.Wdotaccent = 0x1e86; + t.Wdotbelow = 0x1e88; + t.Wgrave = 0x1e80; + t.Wmonospace = 0xff37; + t.Wsmall = 0xf777; + t.X = 0x0058; + t.Xcircle = 0x24cd; + t.Xdieresis = 0x1e8c; + t.Xdotaccent = 0x1e8a; + t.Xeharmenian = 0x053d; + t.Xi = 0x039e; + t.Xmonospace = 0xff38; + t.Xsmall = 0xf778; + t.Y = 0x0059; + t.Yacute = 0x00dd; + t.Yacutesmall = 0xf7fd; + t.Yatcyrillic = 0x0462; + t.Ycircle = 0x24ce; + t.Ycircumflex = 0x0176; + t.Ydieresis = 0x0178; + t.Ydieresissmall = 0xf7ff; + t.Ydotaccent = 0x1e8e; + t.Ydotbelow = 0x1ef4; + t.Yericyrillic = 0x042b; + t.Yerudieresiscyrillic = 0x04f8; + t.Ygrave = 0x1ef2; + t.Yhook = 0x01b3; + t.Yhookabove = 0x1ef6; + t.Yiarmenian = 0x0545; + t.Yicyrillic = 0x0407; + t.Yiwnarmenian = 0x0552; + t.Ymonospace = 0xff39; + t.Ysmall = 0xf779; + t.Ytilde = 0x1ef8; + t.Yusbigcyrillic = 0x046a; + t.Yusbigiotifiedcyrillic = 0x046c; + t.Yuslittlecyrillic = 0x0466; + t.Yuslittleiotifiedcyrillic = 0x0468; + t.Z = 0x005a; + t.Zaarmenian = 0x0536; + t.Zacute = 0x0179; + t.Zcaron = 0x017d; + t.Zcaronsmall = 0xf6ff; + t.Zcircle = 0x24cf; + t.Zcircumflex = 0x1e90; + t.Zdot = 0x017b; + t.Zdotaccent = 0x017b; + t.Zdotbelow = 0x1e92; + t.Zecyrillic = 0x0417; + t.Zedescendercyrillic = 0x0498; + t.Zedieresiscyrillic = 0x04de; + t.Zeta = 0x0396; + t.Zhearmenian = 0x053a; + t.Zhebrevecyrillic = 0x04c1; + t.Zhecyrillic = 0x0416; + t.Zhedescendercyrillic = 0x0496; + t.Zhedieresiscyrillic = 0x04dc; + t.Zlinebelow = 0x1e94; + t.Zmonospace = 0xff3a; + t.Zsmall = 0xf77a; + t.Zstroke = 0x01b5; + t.a = 0x0061; + t.aabengali = 0x0986; + t.aacute = 0x00e1; + t.aadeva = 0x0906; + t.aagujarati = 0x0a86; + t.aagurmukhi = 0x0a06; + t.aamatragurmukhi = 0x0a3e; + t.aarusquare = 0x3303; + t.aavowelsignbengali = 0x09be; + t.aavowelsigndeva = 0x093e; + t.aavowelsigngujarati = 0x0abe; + t.abbreviationmarkarmenian = 0x055f; + t.abbreviationsigndeva = 0x0970; + t.abengali = 0x0985; + t.abopomofo = 0x311a; + t.abreve = 0x0103; + t.abreveacute = 0x1eaf; + t.abrevecyrillic = 0x04d1; + t.abrevedotbelow = 0x1eb7; + t.abrevegrave = 0x1eb1; + t.abrevehookabove = 0x1eb3; + t.abrevetilde = 0x1eb5; + t.acaron = 0x01ce; + t.acircle = 0x24d0; + t.acircumflex = 0x00e2; + t.acircumflexacute = 0x1ea5; + t.acircumflexdotbelow = 0x1ead; + t.acircumflexgrave = 0x1ea7; + t.acircumflexhookabove = 0x1ea9; + t.acircumflextilde = 0x1eab; + t.acute = 0x00b4; + t.acutebelowcmb = 0x0317; + t.acutecmb = 0x0301; + t.acutecomb = 0x0301; + t.acutedeva = 0x0954; + t.acutelowmod = 0x02cf; + t.acutetonecmb = 0x0341; + t.acyrillic = 0x0430; + t.adblgrave = 0x0201; + t.addakgurmukhi = 0x0a71; + t.adeva = 0x0905; + t.adieresis = 0x00e4; + t.adieresiscyrillic = 0x04d3; + t.adieresismacron = 0x01df; + t.adotbelow = 0x1ea1; + t.adotmacron = 0x01e1; + t.ae = 0x00e6; + t.aeacute = 0x01fd; + t.aekorean = 0x3150; + t.aemacron = 0x01e3; + t.afii00208 = 0x2015; + t.afii08941 = 0x20a4; + t.afii10017 = 0x0410; + t.afii10018 = 0x0411; + t.afii10019 = 0x0412; + t.afii10020 = 0x0413; + t.afii10021 = 0x0414; + t.afii10022 = 0x0415; + t.afii10023 = 0x0401; + t.afii10024 = 0x0416; + t.afii10025 = 0x0417; + t.afii10026 = 0x0418; + t.afii10027 = 0x0419; + t.afii10028 = 0x041a; + t.afii10029 = 0x041b; + t.afii10030 = 0x041c; + t.afii10031 = 0x041d; + t.afii10032 = 0x041e; + t.afii10033 = 0x041f; + t.afii10034 = 0x0420; + t.afii10035 = 0x0421; + t.afii10036 = 0x0422; + t.afii10037 = 0x0423; + t.afii10038 = 0x0424; + t.afii10039 = 0x0425; + t.afii10040 = 0x0426; + t.afii10041 = 0x0427; + t.afii10042 = 0x0428; + t.afii10043 = 0x0429; + t.afii10044 = 0x042a; + t.afii10045 = 0x042b; + t.afii10046 = 0x042c; + t.afii10047 = 0x042d; + t.afii10048 = 0x042e; + t.afii10049 = 0x042f; + t.afii10050 = 0x0490; + t.afii10051 = 0x0402; + t.afii10052 = 0x0403; + t.afii10053 = 0x0404; + t.afii10054 = 0x0405; + t.afii10055 = 0x0406; + t.afii10056 = 0x0407; + t.afii10057 = 0x0408; + t.afii10058 = 0x0409; + t.afii10059 = 0x040a; + t.afii10060 = 0x040b; + t.afii10061 = 0x040c; + t.afii10062 = 0x040e; + t.afii10063 = 0xf6c4; + t.afii10064 = 0xf6c5; + t.afii10065 = 0x0430; + t.afii10066 = 0x0431; + t.afii10067 = 0x0432; + t.afii10068 = 0x0433; + t.afii10069 = 0x0434; + t.afii10070 = 0x0435; + t.afii10071 = 0x0451; + t.afii10072 = 0x0436; + t.afii10073 = 0x0437; + t.afii10074 = 0x0438; + t.afii10075 = 0x0439; + t.afii10076 = 0x043a; + t.afii10077 = 0x043b; + t.afii10078 = 0x043c; + t.afii10079 = 0x043d; + t.afii10080 = 0x043e; + t.afii10081 = 0x043f; + t.afii10082 = 0x0440; + t.afii10083 = 0x0441; + t.afii10084 = 0x0442; + t.afii10085 = 0x0443; + t.afii10086 = 0x0444; + t.afii10087 = 0x0445; + t.afii10088 = 0x0446; + t.afii10089 = 0x0447; + t.afii10090 = 0x0448; + t.afii10091 = 0x0449; + t.afii10092 = 0x044a; + t.afii10093 = 0x044b; + t.afii10094 = 0x044c; + t.afii10095 = 0x044d; + t.afii10096 = 0x044e; + t.afii10097 = 0x044f; + t.afii10098 = 0x0491; + t.afii10099 = 0x0452; + t.afii10100 = 0x0453; + t.afii10101 = 0x0454; + t.afii10102 = 0x0455; + t.afii10103 = 0x0456; + t.afii10104 = 0x0457; + t.afii10105 = 0x0458; + t.afii10106 = 0x0459; + t.afii10107 = 0x045a; + t.afii10108 = 0x045b; + t.afii10109 = 0x045c; + t.afii10110 = 0x045e; + t.afii10145 = 0x040f; + t.afii10146 = 0x0462; + t.afii10147 = 0x0472; + t.afii10148 = 0x0474; + t.afii10192 = 0xf6c6; + t.afii10193 = 0x045f; + t.afii10194 = 0x0463; + t.afii10195 = 0x0473; + t.afii10196 = 0x0475; + t.afii10831 = 0xf6c7; + t.afii10832 = 0xf6c8; + t.afii10846 = 0x04d9; + t.afii299 = 0x200e; + t.afii300 = 0x200f; + t.afii301 = 0x200d; + t.afii57381 = 0x066a; + t.afii57388 = 0x060c; + t.afii57392 = 0x0660; + t.afii57393 = 0x0661; + t.afii57394 = 0x0662; + t.afii57395 = 0x0663; + t.afii57396 = 0x0664; + t.afii57397 = 0x0665; + t.afii57398 = 0x0666; + t.afii57399 = 0x0667; + t.afii57400 = 0x0668; + t.afii57401 = 0x0669; + t.afii57403 = 0x061b; + t.afii57407 = 0x061f; + t.afii57409 = 0x0621; + t.afii57410 = 0x0622; + t.afii57411 = 0x0623; + t.afii57412 = 0x0624; + t.afii57413 = 0x0625; + t.afii57414 = 0x0626; + t.afii57415 = 0x0627; + t.afii57416 = 0x0628; + t.afii57417 = 0x0629; + t.afii57418 = 0x062a; + t.afii57419 = 0x062b; + t.afii57420 = 0x062c; + t.afii57421 = 0x062d; + t.afii57422 = 0x062e; + t.afii57423 = 0x062f; + t.afii57424 = 0x0630; + t.afii57425 = 0x0631; + t.afii57426 = 0x0632; + t.afii57427 = 0x0633; + t.afii57428 = 0x0634; + t.afii57429 = 0x0635; + t.afii57430 = 0x0636; + t.afii57431 = 0x0637; + t.afii57432 = 0x0638; + t.afii57433 = 0x0639; + t.afii57434 = 0x063a; + t.afii57440 = 0x0640; + t.afii57441 = 0x0641; + t.afii57442 = 0x0642; + t.afii57443 = 0x0643; + t.afii57444 = 0x0644; + t.afii57445 = 0x0645; + t.afii57446 = 0x0646; + t.afii57448 = 0x0648; + t.afii57449 = 0x0649; + t.afii57450 = 0x064a; + t.afii57451 = 0x064b; + t.afii57452 = 0x064c; + t.afii57453 = 0x064d; + t.afii57454 = 0x064e; + t.afii57455 = 0x064f; + t.afii57456 = 0x0650; + t.afii57457 = 0x0651; + t.afii57458 = 0x0652; + t.afii57470 = 0x0647; + t.afii57505 = 0x06a4; + t.afii57506 = 0x067e; + t.afii57507 = 0x0686; + t.afii57508 = 0x0698; + t.afii57509 = 0x06af; + t.afii57511 = 0x0679; + t.afii57512 = 0x0688; + t.afii57513 = 0x0691; + t.afii57514 = 0x06ba; + t.afii57519 = 0x06d2; + t.afii57534 = 0x06d5; + t.afii57636 = 0x20aa; + t.afii57645 = 0x05be; + t.afii57658 = 0x05c3; + t.afii57664 = 0x05d0; + t.afii57665 = 0x05d1; + t.afii57666 = 0x05d2; + t.afii57667 = 0x05d3; + t.afii57668 = 0x05d4; + t.afii57669 = 0x05d5; + t.afii57670 = 0x05d6; + t.afii57671 = 0x05d7; + t.afii57672 = 0x05d8; + t.afii57673 = 0x05d9; + t.afii57674 = 0x05da; + t.afii57675 = 0x05db; + t.afii57676 = 0x05dc; + t.afii57677 = 0x05dd; + t.afii57678 = 0x05de; + t.afii57679 = 0x05df; + t.afii57680 = 0x05e0; + t.afii57681 = 0x05e1; + t.afii57682 = 0x05e2; + t.afii57683 = 0x05e3; + t.afii57684 = 0x05e4; + t.afii57685 = 0x05e5; + t.afii57686 = 0x05e6; + t.afii57687 = 0x05e7; + t.afii57688 = 0x05e8; + t.afii57689 = 0x05e9; + t.afii57690 = 0x05ea; + t.afii57694 = 0xfb2a; + t.afii57695 = 0xfb2b; + t.afii57700 = 0xfb4b; + t.afii57705 = 0xfb1f; + t.afii57716 = 0x05f0; + t.afii57717 = 0x05f1; + t.afii57718 = 0x05f2; + t.afii57723 = 0xfb35; + t.afii57793 = 0x05b4; + t.afii57794 = 0x05b5; + t.afii57795 = 0x05b6; + t.afii57796 = 0x05bb; + t.afii57797 = 0x05b8; + t.afii57798 = 0x05b7; + t.afii57799 = 0x05b0; + t.afii57800 = 0x05b2; + t.afii57801 = 0x05b1; + t.afii57802 = 0x05b3; + t.afii57803 = 0x05c2; + t.afii57804 = 0x05c1; + t.afii57806 = 0x05b9; + t.afii57807 = 0x05bc; + t.afii57839 = 0x05bd; + t.afii57841 = 0x05bf; + t.afii57842 = 0x05c0; + t.afii57929 = 0x02bc; + t.afii61248 = 0x2105; + t.afii61289 = 0x2113; + t.afii61352 = 0x2116; + t.afii61573 = 0x202c; + t.afii61574 = 0x202d; + t.afii61575 = 0x202e; + t.afii61664 = 0x200c; + t.afii63167 = 0x066d; + t.afii64937 = 0x02bd; + t.agrave = 0x00e0; + t.agujarati = 0x0a85; + t.agurmukhi = 0x0a05; + t.ahiragana = 0x3042; + t.ahookabove = 0x1ea3; + t.aibengali = 0x0990; + t.aibopomofo = 0x311e; + t.aideva = 0x0910; + t.aiecyrillic = 0x04d5; + t.aigujarati = 0x0a90; + t.aigurmukhi = 0x0a10; + t.aimatragurmukhi = 0x0a48; + t.ainarabic = 0x0639; + t.ainfinalarabic = 0xfeca; + t.aininitialarabic = 0xfecb; + t.ainmedialarabic = 0xfecc; + t.ainvertedbreve = 0x0203; + t.aivowelsignbengali = 0x09c8; + t.aivowelsigndeva = 0x0948; + t.aivowelsigngujarati = 0x0ac8; + t.akatakana = 0x30a2; + t.akatakanahalfwidth = 0xff71; + t.akorean = 0x314f; + t.alef = 0x05d0; + t.alefarabic = 0x0627; + t.alefdageshhebrew = 0xfb30; + t.aleffinalarabic = 0xfe8e; + t.alefhamzaabovearabic = 0x0623; + t.alefhamzaabovefinalarabic = 0xfe84; + t.alefhamzabelowarabic = 0x0625; + t.alefhamzabelowfinalarabic = 0xfe88; + t.alefhebrew = 0x05d0; + t.aleflamedhebrew = 0xfb4f; + t.alefmaddaabovearabic = 0x0622; + t.alefmaddaabovefinalarabic = 0xfe82; + t.alefmaksuraarabic = 0x0649; + t.alefmaksurafinalarabic = 0xfef0; + t.alefmaksurainitialarabic = 0xfef3; + t.alefmaksuramedialarabic = 0xfef4; + t.alefpatahhebrew = 0xfb2e; + t.alefqamatshebrew = 0xfb2f; + t.aleph = 0x2135; + t.allequal = 0x224c; + t.alpha = 0x03b1; + t.alphatonos = 0x03ac; + t.amacron = 0x0101; + t.amonospace = 0xff41; + t.ampersand = 0x0026; + t.ampersandmonospace = 0xff06; + t.ampersandsmall = 0xf726; + t.amsquare = 0x33c2; + t.anbopomofo = 0x3122; + t.angbopomofo = 0x3124; + t.angbracketleft = 0x3008; + t.angbracketright = 0x3009; + t.angkhankhuthai = 0x0e5a; + t.angle = 0x2220; + t.anglebracketleft = 0x3008; + t.anglebracketleftvertical = 0xfe3f; + t.anglebracketright = 0x3009; + t.anglebracketrightvertical = 0xfe40; + t.angleleft = 0x2329; + t.angleright = 0x232a; + t.angstrom = 0x212b; + t.anoteleia = 0x0387; + t.anudattadeva = 0x0952; + t.anusvarabengali = 0x0982; + t.anusvaradeva = 0x0902; + t.anusvaragujarati = 0x0a82; + t.aogonek = 0x0105; + t.apaatosquare = 0x3300; + t.aparen = 0x249c; + t.apostrophearmenian = 0x055a; + t.apostrophemod = 0x02bc; + t.apple = 0xf8ff; + t.approaches = 0x2250; + t.approxequal = 0x2248; + t.approxequalorimage = 0x2252; + t.approximatelyequal = 0x2245; + t.araeaekorean = 0x318e; + t.araeakorean = 0x318d; + t.arc = 0x2312; + t.arighthalfring = 0x1e9a; + t.aring = 0x00e5; + t.aringacute = 0x01fb; + t.aringbelow = 0x1e01; + t.arrowboth = 0x2194; + t.arrowdashdown = 0x21e3; + t.arrowdashleft = 0x21e0; + t.arrowdashright = 0x21e2; + t.arrowdashup = 0x21e1; + t.arrowdblboth = 0x21d4; + t.arrowdbldown = 0x21d3; + t.arrowdblleft = 0x21d0; + t.arrowdblright = 0x21d2; + t.arrowdblup = 0x21d1; + t.arrowdown = 0x2193; + t.arrowdownleft = 0x2199; + t.arrowdownright = 0x2198; + t.arrowdownwhite = 0x21e9; + t.arrowheaddownmod = 0x02c5; + t.arrowheadleftmod = 0x02c2; + t.arrowheadrightmod = 0x02c3; + t.arrowheadupmod = 0x02c4; + t.arrowhorizex = 0xf8e7; + t.arrowleft = 0x2190; + t.arrowleftdbl = 0x21d0; + t.arrowleftdblstroke = 0x21cd; + t.arrowleftoverright = 0x21c6; + t.arrowleftwhite = 0x21e6; + t.arrowright = 0x2192; + t.arrowrightdblstroke = 0x21cf; + t.arrowrightheavy = 0x279e; + t.arrowrightoverleft = 0x21c4; + t.arrowrightwhite = 0x21e8; + t.arrowtableft = 0x21e4; + t.arrowtabright = 0x21e5; + t.arrowup = 0x2191; + t.arrowupdn = 0x2195; + t.arrowupdnbse = 0x21a8; + t.arrowupdownbase = 0x21a8; + t.arrowupleft = 0x2196; + t.arrowupleftofdown = 0x21c5; + t.arrowupright = 0x2197; + t.arrowupwhite = 0x21e7; + t.arrowvertex = 0xf8e6; + t.asciicircum = 0x005e; + t.asciicircummonospace = 0xff3e; + t.asciitilde = 0x007e; + t.asciitildemonospace = 0xff5e; + t.ascript = 0x0251; + t.ascriptturned = 0x0252; + t.asmallhiragana = 0x3041; + t.asmallkatakana = 0x30a1; + t.asmallkatakanahalfwidth = 0xff67; + t.asterisk = 0x002a; + t.asteriskaltonearabic = 0x066d; + t.asteriskarabic = 0x066d; + t.asteriskmath = 0x2217; + t.asteriskmonospace = 0xff0a; + t.asterisksmall = 0xfe61; + t.asterism = 0x2042; + t.asuperior = 0xf6e9; + t.asymptoticallyequal = 0x2243; + t.at = 0x0040; + t.atilde = 0x00e3; + t.atmonospace = 0xff20; + t.atsmall = 0xfe6b; + t.aturned = 0x0250; + t.aubengali = 0x0994; + t.aubopomofo = 0x3120; + t.audeva = 0x0914; + t.augujarati = 0x0a94; + t.augurmukhi = 0x0a14; + t.aulengthmarkbengali = 0x09d7; + t.aumatragurmukhi = 0x0a4c; + t.auvowelsignbengali = 0x09cc; + t.auvowelsigndeva = 0x094c; + t.auvowelsigngujarati = 0x0acc; + t.avagrahadeva = 0x093d; + t.aybarmenian = 0x0561; + t.ayin = 0x05e2; + t.ayinaltonehebrew = 0xfb20; + t.ayinhebrew = 0x05e2; + t.b = 0x0062; + t.babengali = 0x09ac; + t.backslash = 0x005c; + t.backslashmonospace = 0xff3c; + t.badeva = 0x092c; + t.bagujarati = 0x0aac; + t.bagurmukhi = 0x0a2c; + t.bahiragana = 0x3070; + t.bahtthai = 0x0e3f; + t.bakatakana = 0x30d0; + t.bar = 0x007c; + t.barmonospace = 0xff5c; + t.bbopomofo = 0x3105; + t.bcircle = 0x24d1; + t.bdotaccent = 0x1e03; + t.bdotbelow = 0x1e05; + t.beamedsixteenthnotes = 0x266c; + t.because = 0x2235; + t.becyrillic = 0x0431; + t.beharabic = 0x0628; + t.behfinalarabic = 0xfe90; + t.behinitialarabic = 0xfe91; + t.behiragana = 0x3079; + t.behmedialarabic = 0xfe92; + t.behmeeminitialarabic = 0xfc9f; + t.behmeemisolatedarabic = 0xfc08; + t.behnoonfinalarabic = 0xfc6d; + t.bekatakana = 0x30d9; + t.benarmenian = 0x0562; + t.bet = 0x05d1; + t.beta = 0x03b2; + t.betasymbolgreek = 0x03d0; + t.betdagesh = 0xfb31; + t.betdageshhebrew = 0xfb31; + t.bethebrew = 0x05d1; + t.betrafehebrew = 0xfb4c; + t.bhabengali = 0x09ad; + t.bhadeva = 0x092d; + t.bhagujarati = 0x0aad; + t.bhagurmukhi = 0x0a2d; + t.bhook = 0x0253; + t.bihiragana = 0x3073; + t.bikatakana = 0x30d3; + t.bilabialclick = 0x0298; + t.bindigurmukhi = 0x0a02; + t.birusquare = 0x3331; + t.blackcircle = 0x25cf; + t.blackdiamond = 0x25c6; + t.blackdownpointingtriangle = 0x25bc; + t.blackleftpointingpointer = 0x25c4; + t.blackleftpointingtriangle = 0x25c0; + t.blacklenticularbracketleft = 0x3010; + t.blacklenticularbracketleftvertical = 0xfe3b; + t.blacklenticularbracketright = 0x3011; + t.blacklenticularbracketrightvertical = 0xfe3c; + t.blacklowerlefttriangle = 0x25e3; + t.blacklowerrighttriangle = 0x25e2; + t.blackrectangle = 0x25ac; + t.blackrightpointingpointer = 0x25ba; + t.blackrightpointingtriangle = 0x25b6; + t.blacksmallsquare = 0x25aa; + t.blacksmilingface = 0x263b; + t.blacksquare = 0x25a0; + t.blackstar = 0x2605; + t.blackupperlefttriangle = 0x25e4; + t.blackupperrighttriangle = 0x25e5; + t.blackuppointingsmalltriangle = 0x25b4; + t.blackuppointingtriangle = 0x25b2; + t.blank = 0x2423; + t.blinebelow = 0x1e07; + t.block = 0x2588; + t.bmonospace = 0xff42; + t.bobaimaithai = 0x0e1a; + t.bohiragana = 0x307c; + t.bokatakana = 0x30dc; + t.bparen = 0x249d; + t.bqsquare = 0x33c3; + t.braceex = 0xf8f4; + t.braceleft = 0x007b; + t.braceleftbt = 0xf8f3; + t.braceleftmid = 0xf8f2; + t.braceleftmonospace = 0xff5b; + t.braceleftsmall = 0xfe5b; + t.bracelefttp = 0xf8f1; + t.braceleftvertical = 0xfe37; + t.braceright = 0x007d; + t.bracerightbt = 0xf8fe; + t.bracerightmid = 0xf8fd; + t.bracerightmonospace = 0xff5d; + t.bracerightsmall = 0xfe5c; + t.bracerighttp = 0xf8fc; + t.bracerightvertical = 0xfe38; + t.bracketleft = 0x005b; + t.bracketleftbt = 0xf8f0; + t.bracketleftex = 0xf8ef; + t.bracketleftmonospace = 0xff3b; + t.bracketlefttp = 0xf8ee; + t.bracketright = 0x005d; + t.bracketrightbt = 0xf8fb; + t.bracketrightex = 0xf8fa; + t.bracketrightmonospace = 0xff3d; + t.bracketrighttp = 0xf8f9; + t.breve = 0x02d8; + t.brevebelowcmb = 0x032e; + t.brevecmb = 0x0306; + t.breveinvertedbelowcmb = 0x032f; + t.breveinvertedcmb = 0x0311; + t.breveinverteddoublecmb = 0x0361; + t.bridgebelowcmb = 0x032a; + t.bridgeinvertedbelowcmb = 0x033a; + t.brokenbar = 0x00a6; + t.bstroke = 0x0180; + t.bsuperior = 0xf6ea; + t.btopbar = 0x0183; + t.buhiragana = 0x3076; + t.bukatakana = 0x30d6; + t.bullet = 0x2022; + t.bulletinverse = 0x25d8; + t.bulletoperator = 0x2219; + t.bullseye = 0x25ce; + t.c = 0x0063; + t.caarmenian = 0x056e; + t.cabengali = 0x099a; + t.cacute = 0x0107; + t.cadeva = 0x091a; + t.cagujarati = 0x0a9a; + t.cagurmukhi = 0x0a1a; + t.calsquare = 0x3388; + t.candrabindubengali = 0x0981; + t.candrabinducmb = 0x0310; + t.candrabindudeva = 0x0901; + t.candrabindugujarati = 0x0a81; + t.capslock = 0x21ea; + t.careof = 0x2105; + t.caron = 0x02c7; + t.caronbelowcmb = 0x032c; + t.caroncmb = 0x030c; + t.carriagereturn = 0x21b5; + t.cbopomofo = 0x3118; + t.ccaron = 0x010d; + t.ccedilla = 0x00e7; + t.ccedillaacute = 0x1e09; + t.ccircle = 0x24d2; + t.ccircumflex = 0x0109; + t.ccurl = 0x0255; + t.cdot = 0x010b; + t.cdotaccent = 0x010b; + t.cdsquare = 0x33c5; + t.cedilla = 0x00b8; + t.cedillacmb = 0x0327; + t.cent = 0x00a2; + t.centigrade = 0x2103; + t.centinferior = 0xf6df; + t.centmonospace = 0xffe0; + t.centoldstyle = 0xf7a2; + t.centsuperior = 0xf6e0; + t.chaarmenian = 0x0579; + t.chabengali = 0x099b; + t.chadeva = 0x091b; + t.chagujarati = 0x0a9b; + t.chagurmukhi = 0x0a1b; + t.chbopomofo = 0x3114; + t.cheabkhasiancyrillic = 0x04bd; + t.checkmark = 0x2713; + t.checyrillic = 0x0447; + t.chedescenderabkhasiancyrillic = 0x04bf; + t.chedescendercyrillic = 0x04b7; + t.chedieresiscyrillic = 0x04f5; + t.cheharmenian = 0x0573; + t.chekhakassiancyrillic = 0x04cc; + t.cheverticalstrokecyrillic = 0x04b9; + t.chi = 0x03c7; + t.chieuchacirclekorean = 0x3277; + t.chieuchaparenkorean = 0x3217; + t.chieuchcirclekorean = 0x3269; + t.chieuchkorean = 0x314a; + t.chieuchparenkorean = 0x3209; + t.chochangthai = 0x0e0a; + t.chochanthai = 0x0e08; + t.chochingthai = 0x0e09; + t.chochoethai = 0x0e0c; + t.chook = 0x0188; + t.cieucacirclekorean = 0x3276; + t.cieucaparenkorean = 0x3216; + t.cieuccirclekorean = 0x3268; + t.cieuckorean = 0x3148; + t.cieucparenkorean = 0x3208; + t.cieucuparenkorean = 0x321c; + t.circle = 0x25cb; + t.circlecopyrt = 0x00a9; + t.circlemultiply = 0x2297; + t.circleot = 0x2299; + t.circleplus = 0x2295; + t.circlepostalmark = 0x3036; + t.circlewithlefthalfblack = 0x25d0; + t.circlewithrighthalfblack = 0x25d1; + t.circumflex = 0x02c6; + t.circumflexbelowcmb = 0x032d; + t.circumflexcmb = 0x0302; + t.clear = 0x2327; + t.clickalveolar = 0x01c2; + t.clickdental = 0x01c0; + t.clicklateral = 0x01c1; + t.clickretroflex = 0x01c3; + t.club = 0x2663; + t.clubsuitblack = 0x2663; + t.clubsuitwhite = 0x2667; + t.cmcubedsquare = 0x33a4; + t.cmonospace = 0xff43; + t.cmsquaredsquare = 0x33a0; + t.coarmenian = 0x0581; + t.colon = 0x003a; + t.colonmonetary = 0x20a1; + t.colonmonospace = 0xff1a; + t.colonsign = 0x20a1; + t.colonsmall = 0xfe55; + t.colontriangularhalfmod = 0x02d1; + t.colontriangularmod = 0x02d0; + t.comma = 0x002c; + t.commaabovecmb = 0x0313; + t.commaaboverightcmb = 0x0315; + t.commaaccent = 0xf6c3; + t.commaarabic = 0x060c; + t.commaarmenian = 0x055d; + t.commainferior = 0xf6e1; + t.commamonospace = 0xff0c; + t.commareversedabovecmb = 0x0314; + t.commareversedmod = 0x02bd; + t.commasmall = 0xfe50; + t.commasuperior = 0xf6e2; + t.commaturnedabovecmb = 0x0312; + t.commaturnedmod = 0x02bb; + t.compass = 0x263c; + t.congruent = 0x2245; + t.contourintegral = 0x222e; + t.control = 0x2303; + t.controlACK = 0x0006; + t.controlBEL = 0x0007; + t.controlBS = 0x0008; + t.controlCAN = 0x0018; + t.controlCR = 0x000d; + t.controlDC1 = 0x0011; + t.controlDC2 = 0x0012; + t.controlDC3 = 0x0013; + t.controlDC4 = 0x0014; + t.controlDEL = 0x007f; + t.controlDLE = 0x0010; + t.controlEM = 0x0019; + t.controlENQ = 0x0005; + t.controlEOT = 0x0004; + t.controlESC = 0x001b; + t.controlETB = 0x0017; + t.controlETX = 0x0003; + t.controlFF = 0x000c; + t.controlFS = 0x001c; + t.controlGS = 0x001d; + t.controlHT = 0x0009; + t.controlLF = 0x000a; + t.controlNAK = 0x0015; + t.controlNULL = 0x0000; + t.controlRS = 0x001e; + t.controlSI = 0x000f; + t.controlSO = 0x000e; + t.controlSOT = 0x0002; + t.controlSTX = 0x0001; + t.controlSUB = 0x001a; + t.controlSYN = 0x0016; + t.controlUS = 0x001f; + t.controlVT = 0x000b; + t.copyright = 0x00a9; + t.copyrightsans = 0xf8e9; + t.copyrightserif = 0xf6d9; + t.cornerbracketleft = 0x300c; + t.cornerbracketlefthalfwidth = 0xff62; + t.cornerbracketleftvertical = 0xfe41; + t.cornerbracketright = 0x300d; + t.cornerbracketrighthalfwidth = 0xff63; + t.cornerbracketrightvertical = 0xfe42; + t.corporationsquare = 0x337f; + t.cosquare = 0x33c7; + t.coverkgsquare = 0x33c6; + t.cparen = 0x249e; + t.cruzeiro = 0x20a2; + t.cstretched = 0x0297; + t.curlyand = 0x22cf; + t.curlyor = 0x22ce; + t.currency = 0x00a4; + t.cyrBreve = 0xf6d1; + t.cyrFlex = 0xf6d2; + t.cyrbreve = 0xf6d4; + t.cyrflex = 0xf6d5; + t.d = 0x0064; + t.daarmenian = 0x0564; + t.dabengali = 0x09a6; + t.dadarabic = 0x0636; + t.dadeva = 0x0926; + t.dadfinalarabic = 0xfebe; + t.dadinitialarabic = 0xfebf; + t.dadmedialarabic = 0xfec0; + t.dagesh = 0x05bc; + t.dageshhebrew = 0x05bc; + t.dagger = 0x2020; + t.daggerdbl = 0x2021; + t.dagujarati = 0x0aa6; + t.dagurmukhi = 0x0a26; + t.dahiragana = 0x3060; + t.dakatakana = 0x30c0; + t.dalarabic = 0x062f; + t.dalet = 0x05d3; + t.daletdagesh = 0xfb33; + t.daletdageshhebrew = 0xfb33; + t.dalethebrew = 0x05d3; + t.dalfinalarabic = 0xfeaa; + t.dammaarabic = 0x064f; + t.dammalowarabic = 0x064f; + t.dammatanaltonearabic = 0x064c; + t.dammatanarabic = 0x064c; + t.danda = 0x0964; + t.dargahebrew = 0x05a7; + t.dargalefthebrew = 0x05a7; + t.dasiapneumatacyrilliccmb = 0x0485; + t.dblGrave = 0xf6d3; + t.dblanglebracketleft = 0x300a; + t.dblanglebracketleftvertical = 0xfe3d; + t.dblanglebracketright = 0x300b; + t.dblanglebracketrightvertical = 0xfe3e; + t.dblarchinvertedbelowcmb = 0x032b; + t.dblarrowleft = 0x21d4; + t.dblarrowright = 0x21d2; + t.dbldanda = 0x0965; + t.dblgrave = 0xf6d6; + t.dblgravecmb = 0x030f; + t.dblintegral = 0x222c; + t.dbllowline = 0x2017; + t.dbllowlinecmb = 0x0333; + t.dbloverlinecmb = 0x033f; + t.dblprimemod = 0x02ba; + t.dblverticalbar = 0x2016; + t.dblverticallineabovecmb = 0x030e; + t.dbopomofo = 0x3109; + t.dbsquare = 0x33c8; + t.dcaron = 0x010f; + t.dcedilla = 0x1e11; + t.dcircle = 0x24d3; + t.dcircumflexbelow = 0x1e13; + t.dcroat = 0x0111; + t.ddabengali = 0x09a1; + t.ddadeva = 0x0921; + t.ddagujarati = 0x0aa1; + t.ddagurmukhi = 0x0a21; + t.ddalarabic = 0x0688; + t.ddalfinalarabic = 0xfb89; + t.dddhadeva = 0x095c; + t.ddhabengali = 0x09a2; + t.ddhadeva = 0x0922; + t.ddhagujarati = 0x0aa2; + t.ddhagurmukhi = 0x0a22; + t.ddotaccent = 0x1e0b; + t.ddotbelow = 0x1e0d; + t.decimalseparatorarabic = 0x066b; + t.decimalseparatorpersian = 0x066b; + t.decyrillic = 0x0434; + t.degree = 0x00b0; + t.dehihebrew = 0x05ad; + t.dehiragana = 0x3067; + t.deicoptic = 0x03ef; + t.dekatakana = 0x30c7; + t.deleteleft = 0x232b; + t.deleteright = 0x2326; + t.delta = 0x03b4; + t.deltaturned = 0x018d; + t.denominatorminusonenumeratorbengali = 0x09f8; + t.dezh = 0x02a4; + t.dhabengali = 0x09a7; + t.dhadeva = 0x0927; + t.dhagujarati = 0x0aa7; + t.dhagurmukhi = 0x0a27; + t.dhook = 0x0257; + t.dialytikatonos = 0x0385; + t.dialytikatonoscmb = 0x0344; + t.diamond = 0x2666; + t.diamondsuitwhite = 0x2662; + t.dieresis = 0x00a8; + t.dieresisacute = 0xf6d7; + t.dieresisbelowcmb = 0x0324; + t.dieresiscmb = 0x0308; + t.dieresisgrave = 0xf6d8; + t.dieresistonos = 0x0385; + t.dihiragana = 0x3062; + t.dikatakana = 0x30c2; + t.dittomark = 0x3003; + t.divide = 0x00f7; + t.divides = 0x2223; + t.divisionslash = 0x2215; + t.djecyrillic = 0x0452; + t.dkshade = 0x2593; + t.dlinebelow = 0x1e0f; + t.dlsquare = 0x3397; + t.dmacron = 0x0111; + t.dmonospace = 0xff44; + t.dnblock = 0x2584; + t.dochadathai = 0x0e0e; + t.dodekthai = 0x0e14; + t.dohiragana = 0x3069; + t.dokatakana = 0x30c9; + t.dollar = 0x0024; + t.dollarinferior = 0xf6e3; + t.dollarmonospace = 0xff04; + t.dollaroldstyle = 0xf724; + t.dollarsmall = 0xfe69; + t.dollarsuperior = 0xf6e4; + t.dong = 0x20ab; + t.dorusquare = 0x3326; + t.dotaccent = 0x02d9; + t.dotaccentcmb = 0x0307; + t.dotbelowcmb = 0x0323; + t.dotbelowcomb = 0x0323; + t.dotkatakana = 0x30fb; + t.dotlessi = 0x0131; + t.dotlessj = 0xf6be; + t.dotlessjstrokehook = 0x0284; + t.dotmath = 0x22c5; + t.dottedcircle = 0x25cc; + t.doubleyodpatah = 0xfb1f; + t.doubleyodpatahhebrew = 0xfb1f; + t.downtackbelowcmb = 0x031e; + t.downtackmod = 0x02d5; + t.dparen = 0x249f; + t.dsuperior = 0xf6eb; + t.dtail = 0x0256; + t.dtopbar = 0x018c; + t.duhiragana = 0x3065; + t.dukatakana = 0x30c5; + t.dz = 0x01f3; + t.dzaltone = 0x02a3; + t.dzcaron = 0x01c6; + t.dzcurl = 0x02a5; + t.dzeabkhasiancyrillic = 0x04e1; + t.dzecyrillic = 0x0455; + t.dzhecyrillic = 0x045f; + t.e = 0x0065; + t.eacute = 0x00e9; + t.earth = 0x2641; + t.ebengali = 0x098f; + t.ebopomofo = 0x311c; + t.ebreve = 0x0115; + t.ecandradeva = 0x090d; + t.ecandragujarati = 0x0a8d; + t.ecandravowelsigndeva = 0x0945; + t.ecandravowelsigngujarati = 0x0ac5; + t.ecaron = 0x011b; + t.ecedillabreve = 0x1e1d; + t.echarmenian = 0x0565; + t.echyiwnarmenian = 0x0587; + t.ecircle = 0x24d4; + t.ecircumflex = 0x00ea; + t.ecircumflexacute = 0x1ebf; + t.ecircumflexbelow = 0x1e19; + t.ecircumflexdotbelow = 0x1ec7; + t.ecircumflexgrave = 0x1ec1; + t.ecircumflexhookabove = 0x1ec3; + t.ecircumflextilde = 0x1ec5; + t.ecyrillic = 0x0454; + t.edblgrave = 0x0205; + t.edeva = 0x090f; + t.edieresis = 0x00eb; + t.edot = 0x0117; + t.edotaccent = 0x0117; + t.edotbelow = 0x1eb9; + t.eegurmukhi = 0x0a0f; + t.eematragurmukhi = 0x0a47; + t.efcyrillic = 0x0444; + t.egrave = 0x00e8; + t.egujarati = 0x0a8f; + t.eharmenian = 0x0567; + t.ehbopomofo = 0x311d; + t.ehiragana = 0x3048; + t.ehookabove = 0x1ebb; + t.eibopomofo = 0x311f; + t.eight = 0x0038; + t.eightarabic = 0x0668; + t.eightbengali = 0x09ee; + t.eightcircle = 0x2467; + t.eightcircleinversesansserif = 0x2791; + t.eightdeva = 0x096e; + t.eighteencircle = 0x2471; + t.eighteenparen = 0x2485; + t.eighteenperiod = 0x2499; + t.eightgujarati = 0x0aee; + t.eightgurmukhi = 0x0a6e; + t.eighthackarabic = 0x0668; + t.eighthangzhou = 0x3028; + t.eighthnotebeamed = 0x266b; + t.eightideographicparen = 0x3227; + t.eightinferior = 0x2088; + t.eightmonospace = 0xff18; + t.eightoldstyle = 0xf738; + t.eightparen = 0x247b; + t.eightperiod = 0x248f; + t.eightpersian = 0x06f8; + t.eightroman = 0x2177; + t.eightsuperior = 0x2078; + t.eightthai = 0x0e58; + t.einvertedbreve = 0x0207; + t.eiotifiedcyrillic = 0x0465; + t.ekatakana = 0x30a8; + t.ekatakanahalfwidth = 0xff74; + t.ekonkargurmukhi = 0x0a74; + t.ekorean = 0x3154; + t.elcyrillic = 0x043b; + t.element = 0x2208; + t.elevencircle = 0x246a; + t.elevenparen = 0x247e; + t.elevenperiod = 0x2492; + t.elevenroman = 0x217a; + t.ellipsis = 0x2026; + t.ellipsisvertical = 0x22ee; + t.emacron = 0x0113; + t.emacronacute = 0x1e17; + t.emacrongrave = 0x1e15; + t.emcyrillic = 0x043c; + t.emdash = 0x2014; + t.emdashvertical = 0xfe31; + t.emonospace = 0xff45; + t.emphasismarkarmenian = 0x055b; + t.emptyset = 0x2205; + t.enbopomofo = 0x3123; + t.encyrillic = 0x043d; + t.endash = 0x2013; + t.endashvertical = 0xfe32; + t.endescendercyrillic = 0x04a3; + t.eng = 0x014b; + t.engbopomofo = 0x3125; + t.enghecyrillic = 0x04a5; + t.enhookcyrillic = 0x04c8; + t.enspace = 0x2002; + t.eogonek = 0x0119; + t.eokorean = 0x3153; + t.eopen = 0x025b; + t.eopenclosed = 0x029a; + t.eopenreversed = 0x025c; + t.eopenreversedclosed = 0x025e; + t.eopenreversedhook = 0x025d; + t.eparen = 0x24a0; + t.epsilon = 0x03b5; + t.epsilontonos = 0x03ad; + t.equal = 0x003d; + t.equalmonospace = 0xff1d; + t.equalsmall = 0xfe66; + t.equalsuperior = 0x207c; + t.equivalence = 0x2261; + t.erbopomofo = 0x3126; + t.ercyrillic = 0x0440; + t.ereversed = 0x0258; + t.ereversedcyrillic = 0x044d; + t.escyrillic = 0x0441; + t.esdescendercyrillic = 0x04ab; + t.esh = 0x0283; + t.eshcurl = 0x0286; + t.eshortdeva = 0x090e; + t.eshortvowelsigndeva = 0x0946; + t.eshreversedloop = 0x01aa; + t.eshsquatreversed = 0x0285; + t.esmallhiragana = 0x3047; + t.esmallkatakana = 0x30a7; + t.esmallkatakanahalfwidth = 0xff6a; + t.estimated = 0x212e; + t.esuperior = 0xf6ec; + t.eta = 0x03b7; + t.etarmenian = 0x0568; + t.etatonos = 0x03ae; + t.eth = 0x00f0; + t.etilde = 0x1ebd; + t.etildebelow = 0x1e1b; + t.etnahtafoukhhebrew = 0x0591; + t.etnahtafoukhlefthebrew = 0x0591; + t.etnahtahebrew = 0x0591; + t.etnahtalefthebrew = 0x0591; + t.eturned = 0x01dd; + t.eukorean = 0x3161; + t.euro = 0x20ac; + t.evowelsignbengali = 0x09c7; + t.evowelsigndeva = 0x0947; + t.evowelsigngujarati = 0x0ac7; + t.exclam = 0x0021; + t.exclamarmenian = 0x055c; + t.exclamdbl = 0x203c; + t.exclamdown = 0x00a1; + t.exclamdownsmall = 0xf7a1; + t.exclammonospace = 0xff01; + t.exclamsmall = 0xf721; + t.existential = 0x2203; + t.ezh = 0x0292; + t.ezhcaron = 0x01ef; + t.ezhcurl = 0x0293; + t.ezhreversed = 0x01b9; + t.ezhtail = 0x01ba; + t.f = 0x0066; + t.fadeva = 0x095e; + t.fagurmukhi = 0x0a5e; + t.fahrenheit = 0x2109; + t.fathaarabic = 0x064e; + t.fathalowarabic = 0x064e; + t.fathatanarabic = 0x064b; + t.fbopomofo = 0x3108; + t.fcircle = 0x24d5; + t.fdotaccent = 0x1e1f; + t.feharabic = 0x0641; + t.feharmenian = 0x0586; + t.fehfinalarabic = 0xfed2; + t.fehinitialarabic = 0xfed3; + t.fehmedialarabic = 0xfed4; + t.feicoptic = 0x03e5; + t.female = 0x2640; + t.ff = 0xfb00; + t.f_f = 0xfb00; + t.ffi = 0xfb03; + t.f_f_i = 0xfb03; + t.ffl = 0xfb04; + t.f_f_l = 0xfb04; + t.fi = 0xfb01; + t.f_i = 0xfb01; + t.fifteencircle = 0x246e; + t.fifteenparen = 0x2482; + t.fifteenperiod = 0x2496; + t.figuredash = 0x2012; + t.filledbox = 0x25a0; + t.filledrect = 0x25ac; + t.finalkaf = 0x05da; + t.finalkafdagesh = 0xfb3a; + t.finalkafdageshhebrew = 0xfb3a; + t.finalkafhebrew = 0x05da; + t.finalmem = 0x05dd; + t.finalmemhebrew = 0x05dd; + t.finalnun = 0x05df; + t.finalnunhebrew = 0x05df; + t.finalpe = 0x05e3; + t.finalpehebrew = 0x05e3; + t.finaltsadi = 0x05e5; + t.finaltsadihebrew = 0x05e5; + t.firsttonechinese = 0x02c9; + t.fisheye = 0x25c9; + t.fitacyrillic = 0x0473; + t.five = 0x0035; + t.fivearabic = 0x0665; + t.fivebengali = 0x09eb; + t.fivecircle = 0x2464; + t.fivecircleinversesansserif = 0x278e; + t.fivedeva = 0x096b; + t.fiveeighths = 0x215d; + t.fivegujarati = 0x0aeb; + t.fivegurmukhi = 0x0a6b; + t.fivehackarabic = 0x0665; + t.fivehangzhou = 0x3025; + t.fiveideographicparen = 0x3224; + t.fiveinferior = 0x2085; + t.fivemonospace = 0xff15; + t.fiveoldstyle = 0xf735; + t.fiveparen = 0x2478; + t.fiveperiod = 0x248c; + t.fivepersian = 0x06f5; + t.fiveroman = 0x2174; + t.fivesuperior = 0x2075; + t.fivethai = 0x0e55; + t.fl = 0xfb02; + t.f_l = 0xfb02; + t.florin = 0x0192; + t.fmonospace = 0xff46; + t.fmsquare = 0x3399; + t.fofanthai = 0x0e1f; + t.fofathai = 0x0e1d; + t.fongmanthai = 0x0e4f; + t.forall = 0x2200; + t.four = 0x0034; + t.fourarabic = 0x0664; + t.fourbengali = 0x09ea; + t.fourcircle = 0x2463; + t.fourcircleinversesansserif = 0x278d; + t.fourdeva = 0x096a; + t.fourgujarati = 0x0aea; + t.fourgurmukhi = 0x0a6a; + t.fourhackarabic = 0x0664; + t.fourhangzhou = 0x3024; + t.fourideographicparen = 0x3223; + t.fourinferior = 0x2084; + t.fourmonospace = 0xff14; + t.fournumeratorbengali = 0x09f7; + t.fouroldstyle = 0xf734; + t.fourparen = 0x2477; + t.fourperiod = 0x248b; + t.fourpersian = 0x06f4; + t.fourroman = 0x2173; + t.foursuperior = 0x2074; + t.fourteencircle = 0x246d; + t.fourteenparen = 0x2481; + t.fourteenperiod = 0x2495; + t.fourthai = 0x0e54; + t.fourthtonechinese = 0x02cb; + t.fparen = 0x24a1; + t.fraction = 0x2044; + t.franc = 0x20a3; + t.g = 0x0067; + t.gabengali = 0x0997; + t.gacute = 0x01f5; + t.gadeva = 0x0917; + t.gafarabic = 0x06af; + t.gaffinalarabic = 0xfb93; + t.gafinitialarabic = 0xfb94; + t.gafmedialarabic = 0xfb95; + t.gagujarati = 0x0a97; + t.gagurmukhi = 0x0a17; + t.gahiragana = 0x304c; + t.gakatakana = 0x30ac; + t.gamma = 0x03b3; + t.gammalatinsmall = 0x0263; + t.gammasuperior = 0x02e0; + t.gangiacoptic = 0x03eb; + t.gbopomofo = 0x310d; + t.gbreve = 0x011f; + t.gcaron = 0x01e7; + t.gcedilla = 0x0123; + t.gcircle = 0x24d6; + t.gcircumflex = 0x011d; + t.gcommaaccent = 0x0123; + t.gdot = 0x0121; + t.gdotaccent = 0x0121; + t.gecyrillic = 0x0433; + t.gehiragana = 0x3052; + t.gekatakana = 0x30b2; + t.geometricallyequal = 0x2251; + t.gereshaccenthebrew = 0x059c; + t.gereshhebrew = 0x05f3; + t.gereshmuqdamhebrew = 0x059d; + t.germandbls = 0x00df; + t.gershayimaccenthebrew = 0x059e; + t.gershayimhebrew = 0x05f4; + t.getamark = 0x3013; + t.ghabengali = 0x0998; + t.ghadarmenian = 0x0572; + t.ghadeva = 0x0918; + t.ghagujarati = 0x0a98; + t.ghagurmukhi = 0x0a18; + t.ghainarabic = 0x063a; + t.ghainfinalarabic = 0xfece; + t.ghaininitialarabic = 0xfecf; + t.ghainmedialarabic = 0xfed0; + t.ghemiddlehookcyrillic = 0x0495; + t.ghestrokecyrillic = 0x0493; + t.gheupturncyrillic = 0x0491; + t.ghhadeva = 0x095a; + t.ghhagurmukhi = 0x0a5a; + t.ghook = 0x0260; + t.ghzsquare = 0x3393; + t.gihiragana = 0x304e; + t.gikatakana = 0x30ae; + t.gimarmenian = 0x0563; + t.gimel = 0x05d2; + t.gimeldagesh = 0xfb32; + t.gimeldageshhebrew = 0xfb32; + t.gimelhebrew = 0x05d2; + t.gjecyrillic = 0x0453; + t.glottalinvertedstroke = 0x01be; + t.glottalstop = 0x0294; + t.glottalstopinverted = 0x0296; + t.glottalstopmod = 0x02c0; + t.glottalstopreversed = 0x0295; + t.glottalstopreversedmod = 0x02c1; + t.glottalstopreversedsuperior = 0x02e4; + t.glottalstopstroke = 0x02a1; + t.glottalstopstrokereversed = 0x02a2; + t.gmacron = 0x1e21; + t.gmonospace = 0xff47; + t.gohiragana = 0x3054; + t.gokatakana = 0x30b4; + t.gparen = 0x24a2; + t.gpasquare = 0x33ac; + t.gradient = 0x2207; + t.grave = 0x0060; + t.gravebelowcmb = 0x0316; + t.gravecmb = 0x0300; + t.gravecomb = 0x0300; + t.gravedeva = 0x0953; + t.gravelowmod = 0x02ce; + t.gravemonospace = 0xff40; + t.gravetonecmb = 0x0340; + t.greater = 0x003e; + t.greaterequal = 0x2265; + t.greaterequalorless = 0x22db; + t.greatermonospace = 0xff1e; + t.greaterorequivalent = 0x2273; + t.greaterorless = 0x2277; + t.greateroverequal = 0x2267; + t.greatersmall = 0xfe65; + t.gscript = 0x0261; + t.gstroke = 0x01e5; + t.guhiragana = 0x3050; + t.guillemotleft = 0x00ab; + t.guillemotright = 0x00bb; + t.guilsinglleft = 0x2039; + t.guilsinglright = 0x203a; + t.gukatakana = 0x30b0; + t.guramusquare = 0x3318; + t.gysquare = 0x33c9; + t.h = 0x0068; + t.haabkhasiancyrillic = 0x04a9; + t.haaltonearabic = 0x06c1; + t.habengali = 0x09b9; + t.hadescendercyrillic = 0x04b3; + t.hadeva = 0x0939; + t.hagujarati = 0x0ab9; + t.hagurmukhi = 0x0a39; + t.haharabic = 0x062d; + t.hahfinalarabic = 0xfea2; + t.hahinitialarabic = 0xfea3; + t.hahiragana = 0x306f; + t.hahmedialarabic = 0xfea4; + t.haitusquare = 0x332a; + t.hakatakana = 0x30cf; + t.hakatakanahalfwidth = 0xff8a; + t.halantgurmukhi = 0x0a4d; + t.hamzaarabic = 0x0621; + t.hamzalowarabic = 0x0621; + t.hangulfiller = 0x3164; + t.hardsigncyrillic = 0x044a; + t.harpoonleftbarbup = 0x21bc; + t.harpoonrightbarbup = 0x21c0; + t.hasquare = 0x33ca; + t.hatafpatah = 0x05b2; + t.hatafpatah16 = 0x05b2; + t.hatafpatah23 = 0x05b2; + t.hatafpatah2f = 0x05b2; + t.hatafpatahhebrew = 0x05b2; + t.hatafpatahnarrowhebrew = 0x05b2; + t.hatafpatahquarterhebrew = 0x05b2; + t.hatafpatahwidehebrew = 0x05b2; + t.hatafqamats = 0x05b3; + t.hatafqamats1b = 0x05b3; + t.hatafqamats28 = 0x05b3; + t.hatafqamats34 = 0x05b3; + t.hatafqamatshebrew = 0x05b3; + t.hatafqamatsnarrowhebrew = 0x05b3; + t.hatafqamatsquarterhebrew = 0x05b3; + t.hatafqamatswidehebrew = 0x05b3; + t.hatafsegol = 0x05b1; + t.hatafsegol17 = 0x05b1; + t.hatafsegol24 = 0x05b1; + t.hatafsegol30 = 0x05b1; + t.hatafsegolhebrew = 0x05b1; + t.hatafsegolnarrowhebrew = 0x05b1; + t.hatafsegolquarterhebrew = 0x05b1; + t.hatafsegolwidehebrew = 0x05b1; + t.hbar = 0x0127; + t.hbopomofo = 0x310f; + t.hbrevebelow = 0x1e2b; + t.hcedilla = 0x1e29; + t.hcircle = 0x24d7; + t.hcircumflex = 0x0125; + t.hdieresis = 0x1e27; + t.hdotaccent = 0x1e23; + t.hdotbelow = 0x1e25; + t.he = 0x05d4; + t.heart = 0x2665; + t.heartsuitblack = 0x2665; + t.heartsuitwhite = 0x2661; + t.hedagesh = 0xfb34; + t.hedageshhebrew = 0xfb34; + t.hehaltonearabic = 0x06c1; + t.heharabic = 0x0647; + t.hehebrew = 0x05d4; + t.hehfinalaltonearabic = 0xfba7; + t.hehfinalalttwoarabic = 0xfeea; + t.hehfinalarabic = 0xfeea; + t.hehhamzaabovefinalarabic = 0xfba5; + t.hehhamzaaboveisolatedarabic = 0xfba4; + t.hehinitialaltonearabic = 0xfba8; + t.hehinitialarabic = 0xfeeb; + t.hehiragana = 0x3078; + t.hehmedialaltonearabic = 0xfba9; + t.hehmedialarabic = 0xfeec; + t.heiseierasquare = 0x337b; + t.hekatakana = 0x30d8; + t.hekatakanahalfwidth = 0xff8d; + t.hekutaarusquare = 0x3336; + t.henghook = 0x0267; + t.herutusquare = 0x3339; + t.het = 0x05d7; + t.hethebrew = 0x05d7; + t.hhook = 0x0266; + t.hhooksuperior = 0x02b1; + t.hieuhacirclekorean = 0x327b; + t.hieuhaparenkorean = 0x321b; + t.hieuhcirclekorean = 0x326d; + t.hieuhkorean = 0x314e; + t.hieuhparenkorean = 0x320d; + t.hihiragana = 0x3072; + t.hikatakana = 0x30d2; + t.hikatakanahalfwidth = 0xff8b; + t.hiriq = 0x05b4; + t.hiriq14 = 0x05b4; + t.hiriq21 = 0x05b4; + t.hiriq2d = 0x05b4; + t.hiriqhebrew = 0x05b4; + t.hiriqnarrowhebrew = 0x05b4; + t.hiriqquarterhebrew = 0x05b4; + t.hiriqwidehebrew = 0x05b4; + t.hlinebelow = 0x1e96; + t.hmonospace = 0xff48; + t.hoarmenian = 0x0570; + t.hohipthai = 0x0e2b; + t.hohiragana = 0x307b; + t.hokatakana = 0x30db; + t.hokatakanahalfwidth = 0xff8e; + t.holam = 0x05b9; + t.holam19 = 0x05b9; + t.holam26 = 0x05b9; + t.holam32 = 0x05b9; + t.holamhebrew = 0x05b9; + t.holamnarrowhebrew = 0x05b9; + t.holamquarterhebrew = 0x05b9; + t.holamwidehebrew = 0x05b9; + t.honokhukthai = 0x0e2e; + t.hookabovecomb = 0x0309; + t.hookcmb = 0x0309; + t.hookpalatalizedbelowcmb = 0x0321; + t.hookretroflexbelowcmb = 0x0322; + t.hoonsquare = 0x3342; + t.horicoptic = 0x03e9; + t.horizontalbar = 0x2015; + t.horncmb = 0x031b; + t.hotsprings = 0x2668; + t.house = 0x2302; + t.hparen = 0x24a3; + t.hsuperior = 0x02b0; + t.hturned = 0x0265; + t.huhiragana = 0x3075; + t.huiitosquare = 0x3333; + t.hukatakana = 0x30d5; + t.hukatakanahalfwidth = 0xff8c; + t.hungarumlaut = 0x02dd; + t.hungarumlautcmb = 0x030b; + t.hv = 0x0195; + t.hyphen = 0x002d; + t.hypheninferior = 0xf6e5; + t.hyphenmonospace = 0xff0d; + t.hyphensmall = 0xfe63; + t.hyphensuperior = 0xf6e6; + t.hyphentwo = 0x2010; + t.i = 0x0069; + t.iacute = 0x00ed; + t.iacyrillic = 0x044f; + t.ibengali = 0x0987; + t.ibopomofo = 0x3127; + t.ibreve = 0x012d; + t.icaron = 0x01d0; + t.icircle = 0x24d8; + t.icircumflex = 0x00ee; + t.icyrillic = 0x0456; + t.idblgrave = 0x0209; + t.ideographearthcircle = 0x328f; + t.ideographfirecircle = 0x328b; + t.ideographicallianceparen = 0x323f; + t.ideographiccallparen = 0x323a; + t.ideographiccentrecircle = 0x32a5; + t.ideographicclose = 0x3006; + t.ideographiccomma = 0x3001; + t.ideographiccommaleft = 0xff64; + t.ideographiccongratulationparen = 0x3237; + t.ideographiccorrectcircle = 0x32a3; + t.ideographicearthparen = 0x322f; + t.ideographicenterpriseparen = 0x323d; + t.ideographicexcellentcircle = 0x329d; + t.ideographicfestivalparen = 0x3240; + t.ideographicfinancialcircle = 0x3296; + t.ideographicfinancialparen = 0x3236; + t.ideographicfireparen = 0x322b; + t.ideographichaveparen = 0x3232; + t.ideographichighcircle = 0x32a4; + t.ideographiciterationmark = 0x3005; + t.ideographiclaborcircle = 0x3298; + t.ideographiclaborparen = 0x3238; + t.ideographicleftcircle = 0x32a7; + t.ideographiclowcircle = 0x32a6; + t.ideographicmedicinecircle = 0x32a9; + t.ideographicmetalparen = 0x322e; + t.ideographicmoonparen = 0x322a; + t.ideographicnameparen = 0x3234; + t.ideographicperiod = 0x3002; + t.ideographicprintcircle = 0x329e; + t.ideographicreachparen = 0x3243; + t.ideographicrepresentparen = 0x3239; + t.ideographicresourceparen = 0x323e; + t.ideographicrightcircle = 0x32a8; + t.ideographicsecretcircle = 0x3299; + t.ideographicselfparen = 0x3242; + t.ideographicsocietyparen = 0x3233; + t.ideographicspace = 0x3000; + t.ideographicspecialparen = 0x3235; + t.ideographicstockparen = 0x3231; + t.ideographicstudyparen = 0x323b; + t.ideographicsunparen = 0x3230; + t.ideographicsuperviseparen = 0x323c; + t.ideographicwaterparen = 0x322c; + t.ideographicwoodparen = 0x322d; + t.ideographiczero = 0x3007; + t.ideographmetalcircle = 0x328e; + t.ideographmooncircle = 0x328a; + t.ideographnamecircle = 0x3294; + t.ideographsuncircle = 0x3290; + t.ideographwatercircle = 0x328c; + t.ideographwoodcircle = 0x328d; + t.ideva = 0x0907; + t.idieresis = 0x00ef; + t.idieresisacute = 0x1e2f; + t.idieresiscyrillic = 0x04e5; + t.idotbelow = 0x1ecb; + t.iebrevecyrillic = 0x04d7; + t.iecyrillic = 0x0435; + t.ieungacirclekorean = 0x3275; + t.ieungaparenkorean = 0x3215; + t.ieungcirclekorean = 0x3267; + t.ieungkorean = 0x3147; + t.ieungparenkorean = 0x3207; + t.igrave = 0x00ec; + t.igujarati = 0x0a87; + t.igurmukhi = 0x0a07; + t.ihiragana = 0x3044; + t.ihookabove = 0x1ec9; + t.iibengali = 0x0988; + t.iicyrillic = 0x0438; + t.iideva = 0x0908; + t.iigujarati = 0x0a88; + t.iigurmukhi = 0x0a08; + t.iimatragurmukhi = 0x0a40; + t.iinvertedbreve = 0x020b; + t.iishortcyrillic = 0x0439; + t.iivowelsignbengali = 0x09c0; + t.iivowelsigndeva = 0x0940; + t.iivowelsigngujarati = 0x0ac0; + t.ij = 0x0133; + t.ikatakana = 0x30a4; + t.ikatakanahalfwidth = 0xff72; + t.ikorean = 0x3163; + t.ilde = 0x02dc; + t.iluyhebrew = 0x05ac; + t.imacron = 0x012b; + t.imacroncyrillic = 0x04e3; + t.imageorapproximatelyequal = 0x2253; + t.imatragurmukhi = 0x0a3f; + t.imonospace = 0xff49; + t.increment = 0x2206; + t.infinity = 0x221e; + t.iniarmenian = 0x056b; + t.integral = 0x222b; + t.integralbottom = 0x2321; + t.integralbt = 0x2321; + t.integralex = 0xf8f5; + t.integraltop = 0x2320; + t.integraltp = 0x2320; + t.intersection = 0x2229; + t.intisquare = 0x3305; + t.invbullet = 0x25d8; + t.invcircle = 0x25d9; + t.invsmileface = 0x263b; + t.iocyrillic = 0x0451; + t.iogonek = 0x012f; + t.iota = 0x03b9; + t.iotadieresis = 0x03ca; + t.iotadieresistonos = 0x0390; + t.iotalatin = 0x0269; + t.iotatonos = 0x03af; + t.iparen = 0x24a4; + t.irigurmukhi = 0x0a72; + t.ismallhiragana = 0x3043; + t.ismallkatakana = 0x30a3; + t.ismallkatakanahalfwidth = 0xff68; + t.issharbengali = 0x09fa; + t.istroke = 0x0268; + t.isuperior = 0xf6ed; + t.iterationhiragana = 0x309d; + t.iterationkatakana = 0x30fd; + t.itilde = 0x0129; + t.itildebelow = 0x1e2d; + t.iubopomofo = 0x3129; + t.iucyrillic = 0x044e; + t.ivowelsignbengali = 0x09bf; + t.ivowelsigndeva = 0x093f; + t.ivowelsigngujarati = 0x0abf; + t.izhitsacyrillic = 0x0475; + t.izhitsadblgravecyrillic = 0x0477; + t.j = 0x006a; + t.jaarmenian = 0x0571; + t.jabengali = 0x099c; + t.jadeva = 0x091c; + t.jagujarati = 0x0a9c; + t.jagurmukhi = 0x0a1c; + t.jbopomofo = 0x3110; + t.jcaron = 0x01f0; + t.jcircle = 0x24d9; + t.jcircumflex = 0x0135; + t.jcrossedtail = 0x029d; + t.jdotlessstroke = 0x025f; + t.jecyrillic = 0x0458; + t.jeemarabic = 0x062c; + t.jeemfinalarabic = 0xfe9e; + t.jeeminitialarabic = 0xfe9f; + t.jeemmedialarabic = 0xfea0; + t.jeharabic = 0x0698; + t.jehfinalarabic = 0xfb8b; + t.jhabengali = 0x099d; + t.jhadeva = 0x091d; + t.jhagujarati = 0x0a9d; + t.jhagurmukhi = 0x0a1d; + t.jheharmenian = 0x057b; + t.jis = 0x3004; + t.jmonospace = 0xff4a; + t.jparen = 0x24a5; + t.jsuperior = 0x02b2; + t.k = 0x006b; + t.kabashkircyrillic = 0x04a1; + t.kabengali = 0x0995; + t.kacute = 0x1e31; + t.kacyrillic = 0x043a; + t.kadescendercyrillic = 0x049b; + t.kadeva = 0x0915; + t.kaf = 0x05db; + t.kafarabic = 0x0643; + t.kafdagesh = 0xfb3b; + t.kafdageshhebrew = 0xfb3b; + t.kaffinalarabic = 0xfeda; + t.kafhebrew = 0x05db; + t.kafinitialarabic = 0xfedb; + t.kafmedialarabic = 0xfedc; + t.kafrafehebrew = 0xfb4d; + t.kagujarati = 0x0a95; + t.kagurmukhi = 0x0a15; + t.kahiragana = 0x304b; + t.kahookcyrillic = 0x04c4; + t.kakatakana = 0x30ab; + t.kakatakanahalfwidth = 0xff76; + t.kappa = 0x03ba; + t.kappasymbolgreek = 0x03f0; + t.kapyeounmieumkorean = 0x3171; + t.kapyeounphieuphkorean = 0x3184; + t.kapyeounpieupkorean = 0x3178; + t.kapyeounssangpieupkorean = 0x3179; + t.karoriisquare = 0x330d; + t.kashidaautoarabic = 0x0640; + t.kashidaautonosidebearingarabic = 0x0640; + t.kasmallkatakana = 0x30f5; + t.kasquare = 0x3384; + t.kasraarabic = 0x0650; + t.kasratanarabic = 0x064d; + t.kastrokecyrillic = 0x049f; + t.katahiraprolongmarkhalfwidth = 0xff70; + t.kaverticalstrokecyrillic = 0x049d; + t.kbopomofo = 0x310e; + t.kcalsquare = 0x3389; + t.kcaron = 0x01e9; + t.kcedilla = 0x0137; + t.kcircle = 0x24da; + t.kcommaaccent = 0x0137; + t.kdotbelow = 0x1e33; + t.keharmenian = 0x0584; + t.kehiragana = 0x3051; + t.kekatakana = 0x30b1; + t.kekatakanahalfwidth = 0xff79; + t.kenarmenian = 0x056f; + t.kesmallkatakana = 0x30f6; + t.kgreenlandic = 0x0138; + t.khabengali = 0x0996; + t.khacyrillic = 0x0445; + t.khadeva = 0x0916; + t.khagujarati = 0x0a96; + t.khagurmukhi = 0x0a16; + t.khaharabic = 0x062e; + t.khahfinalarabic = 0xfea6; + t.khahinitialarabic = 0xfea7; + t.khahmedialarabic = 0xfea8; + t.kheicoptic = 0x03e7; + t.khhadeva = 0x0959; + t.khhagurmukhi = 0x0a59; + t.khieukhacirclekorean = 0x3278; + t.khieukhaparenkorean = 0x3218; + t.khieukhcirclekorean = 0x326a; + t.khieukhkorean = 0x314b; + t.khieukhparenkorean = 0x320a; + t.khokhaithai = 0x0e02; + t.khokhonthai = 0x0e05; + t.khokhuatthai = 0x0e03; + t.khokhwaithai = 0x0e04; + t.khomutthai = 0x0e5b; + t.khook = 0x0199; + t.khorakhangthai = 0x0e06; + t.khzsquare = 0x3391; + t.kihiragana = 0x304d; + t.kikatakana = 0x30ad; + t.kikatakanahalfwidth = 0xff77; + t.kiroguramusquare = 0x3315; + t.kiromeetorusquare = 0x3316; + t.kirosquare = 0x3314; + t.kiyeokacirclekorean = 0x326e; + t.kiyeokaparenkorean = 0x320e; + t.kiyeokcirclekorean = 0x3260; + t.kiyeokkorean = 0x3131; + t.kiyeokparenkorean = 0x3200; + t.kiyeoksioskorean = 0x3133; + t.kjecyrillic = 0x045c; + t.klinebelow = 0x1e35; + t.klsquare = 0x3398; + t.kmcubedsquare = 0x33a6; + t.kmonospace = 0xff4b; + t.kmsquaredsquare = 0x33a2; + t.kohiragana = 0x3053; + t.kohmsquare = 0x33c0; + t.kokaithai = 0x0e01; + t.kokatakana = 0x30b3; + t.kokatakanahalfwidth = 0xff7a; + t.kooposquare = 0x331e; + t.koppacyrillic = 0x0481; + t.koreanstandardsymbol = 0x327f; + t.koroniscmb = 0x0343; + t.kparen = 0x24a6; + t.kpasquare = 0x33aa; + t.ksicyrillic = 0x046f; + t.ktsquare = 0x33cf; + t.kturned = 0x029e; + t.kuhiragana = 0x304f; + t.kukatakana = 0x30af; + t.kukatakanahalfwidth = 0xff78; + t.kvsquare = 0x33b8; + t.kwsquare = 0x33be; + t.l = 0x006c; + t.labengali = 0x09b2; + t.lacute = 0x013a; + t.ladeva = 0x0932; + t.lagujarati = 0x0ab2; + t.lagurmukhi = 0x0a32; + t.lakkhangyaothai = 0x0e45; + t.lamaleffinalarabic = 0xfefc; + t.lamalefhamzaabovefinalarabic = 0xfef8; + t.lamalefhamzaaboveisolatedarabic = 0xfef7; + t.lamalefhamzabelowfinalarabic = 0xfefa; + t.lamalefhamzabelowisolatedarabic = 0xfef9; + t.lamalefisolatedarabic = 0xfefb; + t.lamalefmaddaabovefinalarabic = 0xfef6; + t.lamalefmaddaaboveisolatedarabic = 0xfef5; + t.lamarabic = 0x0644; + t.lambda = 0x03bb; + t.lambdastroke = 0x019b; + t.lamed = 0x05dc; + t.lameddagesh = 0xfb3c; + t.lameddageshhebrew = 0xfb3c; + t.lamedhebrew = 0x05dc; + t.lamfinalarabic = 0xfede; + t.lamhahinitialarabic = 0xfcca; + t.laminitialarabic = 0xfedf; + t.lamjeeminitialarabic = 0xfcc9; + t.lamkhahinitialarabic = 0xfccb; + t.lamlamhehisolatedarabic = 0xfdf2; + t.lammedialarabic = 0xfee0; + t.lammeemhahinitialarabic = 0xfd88; + t.lammeeminitialarabic = 0xfccc; + t.largecircle = 0x25ef; + t.lbar = 0x019a; + t.lbelt = 0x026c; + t.lbopomofo = 0x310c; + t.lcaron = 0x013e; + t.lcedilla = 0x013c; + t.lcircle = 0x24db; + t.lcircumflexbelow = 0x1e3d; + t.lcommaaccent = 0x013c; + t.ldot = 0x0140; + t.ldotaccent = 0x0140; + t.ldotbelow = 0x1e37; + t.ldotbelowmacron = 0x1e39; + t.leftangleabovecmb = 0x031a; + t.lefttackbelowcmb = 0x0318; + t.less = 0x003c; + t.lessequal = 0x2264; + t.lessequalorgreater = 0x22da; + t.lessmonospace = 0xff1c; + t.lessorequivalent = 0x2272; + t.lessorgreater = 0x2276; + t.lessoverequal = 0x2266; + t.lesssmall = 0xfe64; + t.lezh = 0x026e; + t.lfblock = 0x258c; + t.lhookretroflex = 0x026d; + t.lira = 0x20a4; + t.liwnarmenian = 0x056c; + t.lj = 0x01c9; + t.ljecyrillic = 0x0459; + t.ll = 0xf6c0; + t.lladeva = 0x0933; + t.llagujarati = 0x0ab3; + t.llinebelow = 0x1e3b; + t.llladeva = 0x0934; + t.llvocalicbengali = 0x09e1; + t.llvocalicdeva = 0x0961; + t.llvocalicvowelsignbengali = 0x09e3; + t.llvocalicvowelsigndeva = 0x0963; + t.lmiddletilde = 0x026b; + t.lmonospace = 0xff4c; + t.lmsquare = 0x33d0; + t.lochulathai = 0x0e2c; + t.logicaland = 0x2227; + t.logicalnot = 0x00ac; + t.logicalnotreversed = 0x2310; + t.logicalor = 0x2228; + t.lolingthai = 0x0e25; + t.longs = 0x017f; + t.lowlinecenterline = 0xfe4e; + t.lowlinecmb = 0x0332; + t.lowlinedashed = 0xfe4d; + t.lozenge = 0x25ca; + t.lparen = 0x24a7; + t.lslash = 0x0142; + t.lsquare = 0x2113; + t.lsuperior = 0xf6ee; + t.ltshade = 0x2591; + t.luthai = 0x0e26; + t.lvocalicbengali = 0x098c; + t.lvocalicdeva = 0x090c; + t.lvocalicvowelsignbengali = 0x09e2; + t.lvocalicvowelsigndeva = 0x0962; + t.lxsquare = 0x33d3; + t.m = 0x006d; + t.mabengali = 0x09ae; + t.macron = 0x00af; + t.macronbelowcmb = 0x0331; + t.macroncmb = 0x0304; + t.macronlowmod = 0x02cd; + t.macronmonospace = 0xffe3; + t.macute = 0x1e3f; + t.madeva = 0x092e; + t.magujarati = 0x0aae; + t.magurmukhi = 0x0a2e; + t.mahapakhhebrew = 0x05a4; + t.mahapakhlefthebrew = 0x05a4; + t.mahiragana = 0x307e; + t.maichattawalowleftthai = 0xf895; + t.maichattawalowrightthai = 0xf894; + t.maichattawathai = 0x0e4b; + t.maichattawaupperleftthai = 0xf893; + t.maieklowleftthai = 0xf88c; + t.maieklowrightthai = 0xf88b; + t.maiekthai = 0x0e48; + t.maiekupperleftthai = 0xf88a; + t.maihanakatleftthai = 0xf884; + t.maihanakatthai = 0x0e31; + t.maitaikhuleftthai = 0xf889; + t.maitaikhuthai = 0x0e47; + t.maitholowleftthai = 0xf88f; + t.maitholowrightthai = 0xf88e; + t.maithothai = 0x0e49; + t.maithoupperleftthai = 0xf88d; + t.maitrilowleftthai = 0xf892; + t.maitrilowrightthai = 0xf891; + t.maitrithai = 0x0e4a; + t.maitriupperleftthai = 0xf890; + t.maiyamokthai = 0x0e46; + t.makatakana = 0x30de; + t.makatakanahalfwidth = 0xff8f; + t.male = 0x2642; + t.mansyonsquare = 0x3347; + t.maqafhebrew = 0x05be; + t.mars = 0x2642; + t.masoracirclehebrew = 0x05af; + t.masquare = 0x3383; + t.mbopomofo = 0x3107; + t.mbsquare = 0x33d4; + t.mcircle = 0x24dc; + t.mcubedsquare = 0x33a5; + t.mdotaccent = 0x1e41; + t.mdotbelow = 0x1e43; + t.meemarabic = 0x0645; + t.meemfinalarabic = 0xfee2; + t.meeminitialarabic = 0xfee3; + t.meemmedialarabic = 0xfee4; + t.meemmeeminitialarabic = 0xfcd1; + t.meemmeemisolatedarabic = 0xfc48; + t.meetorusquare = 0x334d; + t.mehiragana = 0x3081; + t.meizierasquare = 0x337e; + t.mekatakana = 0x30e1; + t.mekatakanahalfwidth = 0xff92; + t.mem = 0x05de; + t.memdagesh = 0xfb3e; + t.memdageshhebrew = 0xfb3e; + t.memhebrew = 0x05de; + t.menarmenian = 0x0574; + t.merkhahebrew = 0x05a5; + t.merkhakefulahebrew = 0x05a6; + t.merkhakefulalefthebrew = 0x05a6; + t.merkhalefthebrew = 0x05a5; + t.mhook = 0x0271; + t.mhzsquare = 0x3392; + t.middledotkatakanahalfwidth = 0xff65; + t.middot = 0x00b7; + t.mieumacirclekorean = 0x3272; + t.mieumaparenkorean = 0x3212; + t.mieumcirclekorean = 0x3264; + t.mieumkorean = 0x3141; + t.mieumpansioskorean = 0x3170; + t.mieumparenkorean = 0x3204; + t.mieumpieupkorean = 0x316e; + t.mieumsioskorean = 0x316f; + t.mihiragana = 0x307f; + t.mikatakana = 0x30df; + t.mikatakanahalfwidth = 0xff90; + t.minus = 0x2212; + t.minusbelowcmb = 0x0320; + t.minuscircle = 0x2296; + t.minusmod = 0x02d7; + t.minusplus = 0x2213; + t.minute = 0x2032; + t.miribaarusquare = 0x334a; + t.mirisquare = 0x3349; + t.mlonglegturned = 0x0270; + t.mlsquare = 0x3396; + t.mmcubedsquare = 0x33a3; + t.mmonospace = 0xff4d; + t.mmsquaredsquare = 0x339f; + t.mohiragana = 0x3082; + t.mohmsquare = 0x33c1; + t.mokatakana = 0x30e2; + t.mokatakanahalfwidth = 0xff93; + t.molsquare = 0x33d6; + t.momathai = 0x0e21; + t.moverssquare = 0x33a7; + t.moverssquaredsquare = 0x33a8; + t.mparen = 0x24a8; + t.mpasquare = 0x33ab; + t.mssquare = 0x33b3; + t.msuperior = 0xf6ef; + t.mturned = 0x026f; + t.mu = 0x00b5; + t.mu1 = 0x00b5; + t.muasquare = 0x3382; + t.muchgreater = 0x226b; + t.muchless = 0x226a; + t.mufsquare = 0x338c; + t.mugreek = 0x03bc; + t.mugsquare = 0x338d; + t.muhiragana = 0x3080; + t.mukatakana = 0x30e0; + t.mukatakanahalfwidth = 0xff91; + t.mulsquare = 0x3395; + t.multiply = 0x00d7; + t.mumsquare = 0x339b; + t.munahhebrew = 0x05a3; + t.munahlefthebrew = 0x05a3; + t.musicalnote = 0x266a; + t.musicalnotedbl = 0x266b; + t.musicflatsign = 0x266d; + t.musicsharpsign = 0x266f; + t.mussquare = 0x33b2; + t.muvsquare = 0x33b6; + t.muwsquare = 0x33bc; + t.mvmegasquare = 0x33b9; + t.mvsquare = 0x33b7; + t.mwmegasquare = 0x33bf; + t.mwsquare = 0x33bd; + t.n = 0x006e; + t.nabengali = 0x09a8; + t.nabla = 0x2207; + t.nacute = 0x0144; + t.nadeva = 0x0928; + t.nagujarati = 0x0aa8; + t.nagurmukhi = 0x0a28; + t.nahiragana = 0x306a; + t.nakatakana = 0x30ca; + t.nakatakanahalfwidth = 0xff85; + t.napostrophe = 0x0149; + t.nasquare = 0x3381; + t.nbopomofo = 0x310b; + t.nbspace = 0x00a0; + t.ncaron = 0x0148; + t.ncedilla = 0x0146; + t.ncircle = 0x24dd; + t.ncircumflexbelow = 0x1e4b; + t.ncommaaccent = 0x0146; + t.ndotaccent = 0x1e45; + t.ndotbelow = 0x1e47; + t.nehiragana = 0x306d; + t.nekatakana = 0x30cd; + t.nekatakanahalfwidth = 0xff88; + t.newsheqelsign = 0x20aa; + t.nfsquare = 0x338b; + t.ngabengali = 0x0999; + t.ngadeva = 0x0919; + t.ngagujarati = 0x0a99; + t.ngagurmukhi = 0x0a19; + t.ngonguthai = 0x0e07; + t.nhiragana = 0x3093; + t.nhookleft = 0x0272; + t.nhookretroflex = 0x0273; + t.nieunacirclekorean = 0x326f; + t.nieunaparenkorean = 0x320f; + t.nieuncieuckorean = 0x3135; + t.nieuncirclekorean = 0x3261; + t.nieunhieuhkorean = 0x3136; + t.nieunkorean = 0x3134; + t.nieunpansioskorean = 0x3168; + t.nieunparenkorean = 0x3201; + t.nieunsioskorean = 0x3167; + t.nieuntikeutkorean = 0x3166; + t.nihiragana = 0x306b; + t.nikatakana = 0x30cb; + t.nikatakanahalfwidth = 0xff86; + t.nikhahitleftthai = 0xf899; + t.nikhahitthai = 0x0e4d; + t.nine = 0x0039; + t.ninearabic = 0x0669; + t.ninebengali = 0x09ef; + t.ninecircle = 0x2468; + t.ninecircleinversesansserif = 0x2792; + t.ninedeva = 0x096f; + t.ninegujarati = 0x0aef; + t.ninegurmukhi = 0x0a6f; + t.ninehackarabic = 0x0669; + t.ninehangzhou = 0x3029; + t.nineideographicparen = 0x3228; + t.nineinferior = 0x2089; + t.ninemonospace = 0xff19; + t.nineoldstyle = 0xf739; + t.nineparen = 0x247c; + t.nineperiod = 0x2490; + t.ninepersian = 0x06f9; + t.nineroman = 0x2178; + t.ninesuperior = 0x2079; + t.nineteencircle = 0x2472; + t.nineteenparen = 0x2486; + t.nineteenperiod = 0x249a; + t.ninethai = 0x0e59; + t.nj = 0x01cc; + t.njecyrillic = 0x045a; + t.nkatakana = 0x30f3; + t.nkatakanahalfwidth = 0xff9d; + t.nlegrightlong = 0x019e; + t.nlinebelow = 0x1e49; + t.nmonospace = 0xff4e; + t.nmsquare = 0x339a; + t.nnabengali = 0x09a3; + t.nnadeva = 0x0923; + t.nnagujarati = 0x0aa3; + t.nnagurmukhi = 0x0a23; + t.nnnadeva = 0x0929; + t.nohiragana = 0x306e; + t.nokatakana = 0x30ce; + t.nokatakanahalfwidth = 0xff89; + t.nonbreakingspace = 0x00a0; + t.nonenthai = 0x0e13; + t.nonuthai = 0x0e19; + t.noonarabic = 0x0646; + t.noonfinalarabic = 0xfee6; + t.noonghunnaarabic = 0x06ba; + t.noonghunnafinalarabic = 0xfb9f; + t.nooninitialarabic = 0xfee7; + t.noonjeeminitialarabic = 0xfcd2; + t.noonjeemisolatedarabic = 0xfc4b; + t.noonmedialarabic = 0xfee8; + t.noonmeeminitialarabic = 0xfcd5; + t.noonmeemisolatedarabic = 0xfc4e; + t.noonnoonfinalarabic = 0xfc8d; + t.notcontains = 0x220c; + t.notelement = 0x2209; + t.notelementof = 0x2209; + t.notequal = 0x2260; + t.notgreater = 0x226f; + t.notgreaternorequal = 0x2271; + t.notgreaternorless = 0x2279; + t.notidentical = 0x2262; + t.notless = 0x226e; + t.notlessnorequal = 0x2270; + t.notparallel = 0x2226; + t.notprecedes = 0x2280; + t.notsubset = 0x2284; + t.notsucceeds = 0x2281; + t.notsuperset = 0x2285; + t.nowarmenian = 0x0576; + t.nparen = 0x24a9; + t.nssquare = 0x33b1; + t.nsuperior = 0x207f; + t.ntilde = 0x00f1; + t.nu = 0x03bd; + t.nuhiragana = 0x306c; + t.nukatakana = 0x30cc; + t.nukatakanahalfwidth = 0xff87; + t.nuktabengali = 0x09bc; + t.nuktadeva = 0x093c; + t.nuktagujarati = 0x0abc; + t.nuktagurmukhi = 0x0a3c; + t.numbersign = 0x0023; + t.numbersignmonospace = 0xff03; + t.numbersignsmall = 0xfe5f; + t.numeralsigngreek = 0x0374; + t.numeralsignlowergreek = 0x0375; + t.numero = 0x2116; + t.nun = 0x05e0; + t.nundagesh = 0xfb40; + t.nundageshhebrew = 0xfb40; + t.nunhebrew = 0x05e0; + t.nvsquare = 0x33b5; + t.nwsquare = 0x33bb; + t.nyabengali = 0x099e; + t.nyadeva = 0x091e; + t.nyagujarati = 0x0a9e; + t.nyagurmukhi = 0x0a1e; + t.o = 0x006f; + t.oacute = 0x00f3; + t.oangthai = 0x0e2d; + t.obarred = 0x0275; + t.obarredcyrillic = 0x04e9; + t.obarreddieresiscyrillic = 0x04eb; + t.obengali = 0x0993; + t.obopomofo = 0x311b; + t.obreve = 0x014f; + t.ocandradeva = 0x0911; + t.ocandragujarati = 0x0a91; + t.ocandravowelsigndeva = 0x0949; + t.ocandravowelsigngujarati = 0x0ac9; + t.ocaron = 0x01d2; + t.ocircle = 0x24de; + t.ocircumflex = 0x00f4; + t.ocircumflexacute = 0x1ed1; + t.ocircumflexdotbelow = 0x1ed9; + t.ocircumflexgrave = 0x1ed3; + t.ocircumflexhookabove = 0x1ed5; + t.ocircumflextilde = 0x1ed7; + t.ocyrillic = 0x043e; + t.odblacute = 0x0151; + t.odblgrave = 0x020d; + t.odeva = 0x0913; + t.odieresis = 0x00f6; + t.odieresiscyrillic = 0x04e7; + t.odotbelow = 0x1ecd; + t.oe = 0x0153; + t.oekorean = 0x315a; + t.ogonek = 0x02db; + t.ogonekcmb = 0x0328; + t.ograve = 0x00f2; + t.ogujarati = 0x0a93; + t.oharmenian = 0x0585; + t.ohiragana = 0x304a; + t.ohookabove = 0x1ecf; + t.ohorn = 0x01a1; + t.ohornacute = 0x1edb; + t.ohorndotbelow = 0x1ee3; + t.ohorngrave = 0x1edd; + t.ohornhookabove = 0x1edf; + t.ohorntilde = 0x1ee1; + t.ohungarumlaut = 0x0151; + t.oi = 0x01a3; + t.oinvertedbreve = 0x020f; + t.okatakana = 0x30aa; + t.okatakanahalfwidth = 0xff75; + t.okorean = 0x3157; + t.olehebrew = 0x05ab; + t.omacron = 0x014d; + t.omacronacute = 0x1e53; + t.omacrongrave = 0x1e51; + t.omdeva = 0x0950; + t.omega = 0x03c9; + t.omega1 = 0x03d6; + t.omegacyrillic = 0x0461; + t.omegalatinclosed = 0x0277; + t.omegaroundcyrillic = 0x047b; + t.omegatitlocyrillic = 0x047d; + t.omegatonos = 0x03ce; + t.omgujarati = 0x0ad0; + t.omicron = 0x03bf; + t.omicrontonos = 0x03cc; + t.omonospace = 0xff4f; + t.one = 0x0031; + t.onearabic = 0x0661; + t.onebengali = 0x09e7; + t.onecircle = 0x2460; + t.onecircleinversesansserif = 0x278a; + t.onedeva = 0x0967; + t.onedotenleader = 0x2024; + t.oneeighth = 0x215b; + t.onefitted = 0xf6dc; + t.onegujarati = 0x0ae7; + t.onegurmukhi = 0x0a67; + t.onehackarabic = 0x0661; + t.onehalf = 0x00bd; + t.onehangzhou = 0x3021; + t.oneideographicparen = 0x3220; + t.oneinferior = 0x2081; + t.onemonospace = 0xff11; + t.onenumeratorbengali = 0x09f4; + t.oneoldstyle = 0xf731; + t.oneparen = 0x2474; + t.oneperiod = 0x2488; + t.onepersian = 0x06f1; + t.onequarter = 0x00bc; + t.oneroman = 0x2170; + t.onesuperior = 0x00b9; + t.onethai = 0x0e51; + t.onethird = 0x2153; + t.oogonek = 0x01eb; + t.oogonekmacron = 0x01ed; + t.oogurmukhi = 0x0a13; + t.oomatragurmukhi = 0x0a4b; + t.oopen = 0x0254; + t.oparen = 0x24aa; + t.openbullet = 0x25e6; + t.option = 0x2325; + t.ordfeminine = 0x00aa; + t.ordmasculine = 0x00ba; + t.orthogonal = 0x221f; + t.oshortdeva = 0x0912; + t.oshortvowelsigndeva = 0x094a; + t.oslash = 0x00f8; + t.oslashacute = 0x01ff; + t.osmallhiragana = 0x3049; + t.osmallkatakana = 0x30a9; + t.osmallkatakanahalfwidth = 0xff6b; + t.ostrokeacute = 0x01ff; + t.osuperior = 0xf6f0; + t.otcyrillic = 0x047f; + t.otilde = 0x00f5; + t.otildeacute = 0x1e4d; + t.otildedieresis = 0x1e4f; + t.oubopomofo = 0x3121; + t.overline = 0x203e; + t.overlinecenterline = 0xfe4a; + t.overlinecmb = 0x0305; + t.overlinedashed = 0xfe49; + t.overlinedblwavy = 0xfe4c; + t.overlinewavy = 0xfe4b; + t.overscore = 0x00af; + t.ovowelsignbengali = 0x09cb; + t.ovowelsigndeva = 0x094b; + t.ovowelsigngujarati = 0x0acb; + t.p = 0x0070; + t.paampssquare = 0x3380; + t.paasentosquare = 0x332b; + t.pabengali = 0x09aa; + t.pacute = 0x1e55; + t.padeva = 0x092a; + t.pagedown = 0x21df; + t.pageup = 0x21de; + t.pagujarati = 0x0aaa; + t.pagurmukhi = 0x0a2a; + t.pahiragana = 0x3071; + t.paiyannoithai = 0x0e2f; + t.pakatakana = 0x30d1; + t.palatalizationcyrilliccmb = 0x0484; + t.palochkacyrillic = 0x04c0; + t.pansioskorean = 0x317f; + t.paragraph = 0x00b6; + t.parallel = 0x2225; + t.parenleft = 0x0028; + t.parenleftaltonearabic = 0xfd3e; + t.parenleftbt = 0xf8ed; + t.parenleftex = 0xf8ec; + t.parenleftinferior = 0x208d; + t.parenleftmonospace = 0xff08; + t.parenleftsmall = 0xfe59; + t.parenleftsuperior = 0x207d; + t.parenlefttp = 0xf8eb; + t.parenleftvertical = 0xfe35; + t.parenright = 0x0029; + t.parenrightaltonearabic = 0xfd3f; + t.parenrightbt = 0xf8f8; + t.parenrightex = 0xf8f7; + t.parenrightinferior = 0x208e; + t.parenrightmonospace = 0xff09; + t.parenrightsmall = 0xfe5a; + t.parenrightsuperior = 0x207e; + t.parenrighttp = 0xf8f6; + t.parenrightvertical = 0xfe36; + t.partialdiff = 0x2202; + t.paseqhebrew = 0x05c0; + t.pashtahebrew = 0x0599; + t.pasquare = 0x33a9; + t.patah = 0x05b7; + t.patah11 = 0x05b7; + t.patah1d = 0x05b7; + t.patah2a = 0x05b7; + t.patahhebrew = 0x05b7; + t.patahnarrowhebrew = 0x05b7; + t.patahquarterhebrew = 0x05b7; + t.patahwidehebrew = 0x05b7; + t.pazerhebrew = 0x05a1; + t.pbopomofo = 0x3106; + t.pcircle = 0x24df; + t.pdotaccent = 0x1e57; + t.pe = 0x05e4; + t.pecyrillic = 0x043f; + t.pedagesh = 0xfb44; + t.pedageshhebrew = 0xfb44; + t.peezisquare = 0x333b; + t.pefinaldageshhebrew = 0xfb43; + t.peharabic = 0x067e; + t.peharmenian = 0x057a; + t.pehebrew = 0x05e4; + t.pehfinalarabic = 0xfb57; + t.pehinitialarabic = 0xfb58; + t.pehiragana = 0x307a; + t.pehmedialarabic = 0xfb59; + t.pekatakana = 0x30da; + t.pemiddlehookcyrillic = 0x04a7; + t.perafehebrew = 0xfb4e; + t.percent = 0x0025; + t.percentarabic = 0x066a; + t.percentmonospace = 0xff05; + t.percentsmall = 0xfe6a; + t.period = 0x002e; + t.periodarmenian = 0x0589; + t.periodcentered = 0x00b7; + t.periodhalfwidth = 0xff61; + t.periodinferior = 0xf6e7; + t.periodmonospace = 0xff0e; + t.periodsmall = 0xfe52; + t.periodsuperior = 0xf6e8; + t.perispomenigreekcmb = 0x0342; + t.perpendicular = 0x22a5; + t.perthousand = 0x2030; + t.peseta = 0x20a7; + t.pfsquare = 0x338a; + t.phabengali = 0x09ab; + t.phadeva = 0x092b; + t.phagujarati = 0x0aab; + t.phagurmukhi = 0x0a2b; + t.phi = 0x03c6; + t.phi1 = 0x03d5; + t.phieuphacirclekorean = 0x327a; + t.phieuphaparenkorean = 0x321a; + t.phieuphcirclekorean = 0x326c; + t.phieuphkorean = 0x314d; + t.phieuphparenkorean = 0x320c; + t.philatin = 0x0278; + t.phinthuthai = 0x0e3a; + t.phisymbolgreek = 0x03d5; + t.phook = 0x01a5; + t.phophanthai = 0x0e1e; + t.phophungthai = 0x0e1c; + t.phosamphaothai = 0x0e20; + t.pi = 0x03c0; + t.pieupacirclekorean = 0x3273; + t.pieupaparenkorean = 0x3213; + t.pieupcieuckorean = 0x3176; + t.pieupcirclekorean = 0x3265; + t.pieupkiyeokkorean = 0x3172; + t.pieupkorean = 0x3142; + t.pieupparenkorean = 0x3205; + t.pieupsioskiyeokkorean = 0x3174; + t.pieupsioskorean = 0x3144; + t.pieupsiostikeutkorean = 0x3175; + t.pieupthieuthkorean = 0x3177; + t.pieuptikeutkorean = 0x3173; + t.pihiragana = 0x3074; + t.pikatakana = 0x30d4; + t.pisymbolgreek = 0x03d6; + t.piwrarmenian = 0x0583; + t.planckover2pi = 0x210f; + t.planckover2pi1 = 0x210f; + t.plus = 0x002b; + t.plusbelowcmb = 0x031f; + t.pluscircle = 0x2295; + t.plusminus = 0x00b1; + t.plusmod = 0x02d6; + t.plusmonospace = 0xff0b; + t.plussmall = 0xfe62; + t.plussuperior = 0x207a; + t.pmonospace = 0xff50; + t.pmsquare = 0x33d8; + t.pohiragana = 0x307d; + t.pointingindexdownwhite = 0x261f; + t.pointingindexleftwhite = 0x261c; + t.pointingindexrightwhite = 0x261e; + t.pointingindexupwhite = 0x261d; + t.pokatakana = 0x30dd; + t.poplathai = 0x0e1b; + t.postalmark = 0x3012; + t.postalmarkface = 0x3020; + t.pparen = 0x24ab; + t.precedes = 0x227a; + t.prescription = 0x211e; + t.primemod = 0x02b9; + t.primereversed = 0x2035; + t.product = 0x220f; + t.projective = 0x2305; + t.prolongedkana = 0x30fc; + t.propellor = 0x2318; + t.propersubset = 0x2282; + t.propersuperset = 0x2283; + t.proportion = 0x2237; + t.proportional = 0x221d; + t.psi = 0x03c8; + t.psicyrillic = 0x0471; + t.psilipneumatacyrilliccmb = 0x0486; + t.pssquare = 0x33b0; + t.puhiragana = 0x3077; + t.pukatakana = 0x30d7; + t.pvsquare = 0x33b4; + t.pwsquare = 0x33ba; + t.q = 0x0071; + t.qadeva = 0x0958; + t.qadmahebrew = 0x05a8; + t.qafarabic = 0x0642; + t.qaffinalarabic = 0xfed6; + t.qafinitialarabic = 0xfed7; + t.qafmedialarabic = 0xfed8; + t.qamats = 0x05b8; + t.qamats10 = 0x05b8; + t.qamats1a = 0x05b8; + t.qamats1c = 0x05b8; + t.qamats27 = 0x05b8; + t.qamats29 = 0x05b8; + t.qamats33 = 0x05b8; + t.qamatsde = 0x05b8; + t.qamatshebrew = 0x05b8; + t.qamatsnarrowhebrew = 0x05b8; + t.qamatsqatanhebrew = 0x05b8; + t.qamatsqatannarrowhebrew = 0x05b8; + t.qamatsqatanquarterhebrew = 0x05b8; + t.qamatsqatanwidehebrew = 0x05b8; + t.qamatsquarterhebrew = 0x05b8; + t.qamatswidehebrew = 0x05b8; + t.qarneyparahebrew = 0x059f; + t.qbopomofo = 0x3111; + t.qcircle = 0x24e0; + t.qhook = 0x02a0; + t.qmonospace = 0xff51; + t.qof = 0x05e7; + t.qofdagesh = 0xfb47; + t.qofdageshhebrew = 0xfb47; + t.qofhebrew = 0x05e7; + t.qparen = 0x24ac; + t.quarternote = 0x2669; + t.qubuts = 0x05bb; + t.qubuts18 = 0x05bb; + t.qubuts25 = 0x05bb; + t.qubuts31 = 0x05bb; + t.qubutshebrew = 0x05bb; + t.qubutsnarrowhebrew = 0x05bb; + t.qubutsquarterhebrew = 0x05bb; + t.qubutswidehebrew = 0x05bb; + t.question = 0x003f; + t.questionarabic = 0x061f; + t.questionarmenian = 0x055e; + t.questiondown = 0x00bf; + t.questiondownsmall = 0xf7bf; + t.questiongreek = 0x037e; + t.questionmonospace = 0xff1f; + t.questionsmall = 0xf73f; + t.quotedbl = 0x0022; + t.quotedblbase = 0x201e; + t.quotedblleft = 0x201c; + t.quotedblmonospace = 0xff02; + t.quotedblprime = 0x301e; + t.quotedblprimereversed = 0x301d; + t.quotedblright = 0x201d; + t.quoteleft = 0x2018; + t.quoteleftreversed = 0x201b; + t.quotereversed = 0x201b; + t.quoteright = 0x2019; + t.quoterightn = 0x0149; + t.quotesinglbase = 0x201a; + t.quotesingle = 0x0027; + t.quotesinglemonospace = 0xff07; + t.r = 0x0072; + t.raarmenian = 0x057c; + t.rabengali = 0x09b0; + t.racute = 0x0155; + t.radeva = 0x0930; + t.radical = 0x221a; + t.radicalex = 0xf8e5; + t.radoverssquare = 0x33ae; + t.radoverssquaredsquare = 0x33af; + t.radsquare = 0x33ad; + t.rafe = 0x05bf; + t.rafehebrew = 0x05bf; + t.ragujarati = 0x0ab0; + t.ragurmukhi = 0x0a30; + t.rahiragana = 0x3089; + t.rakatakana = 0x30e9; + t.rakatakanahalfwidth = 0xff97; + t.ralowerdiagonalbengali = 0x09f1; + t.ramiddlediagonalbengali = 0x09f0; + t.ramshorn = 0x0264; + t.ratio = 0x2236; + t.rbopomofo = 0x3116; + t.rcaron = 0x0159; + t.rcedilla = 0x0157; + t.rcircle = 0x24e1; + t.rcommaaccent = 0x0157; + t.rdblgrave = 0x0211; + t.rdotaccent = 0x1e59; + t.rdotbelow = 0x1e5b; + t.rdotbelowmacron = 0x1e5d; + t.referencemark = 0x203b; + t.reflexsubset = 0x2286; + t.reflexsuperset = 0x2287; + t.registered = 0x00ae; + t.registersans = 0xf8e8; + t.registerserif = 0xf6da; + t.reharabic = 0x0631; + t.reharmenian = 0x0580; + t.rehfinalarabic = 0xfeae; + t.rehiragana = 0x308c; + t.rekatakana = 0x30ec; + t.rekatakanahalfwidth = 0xff9a; + t.resh = 0x05e8; + t.reshdageshhebrew = 0xfb48; + t.reshhebrew = 0x05e8; + t.reversedtilde = 0x223d; + t.reviahebrew = 0x0597; + t.reviamugrashhebrew = 0x0597; + t.revlogicalnot = 0x2310; + t.rfishhook = 0x027e; + t.rfishhookreversed = 0x027f; + t.rhabengali = 0x09dd; + t.rhadeva = 0x095d; + t.rho = 0x03c1; + t.rhook = 0x027d; + t.rhookturned = 0x027b; + t.rhookturnedsuperior = 0x02b5; + t.rhosymbolgreek = 0x03f1; + t.rhotichookmod = 0x02de; + t.rieulacirclekorean = 0x3271; + t.rieulaparenkorean = 0x3211; + t.rieulcirclekorean = 0x3263; + t.rieulhieuhkorean = 0x3140; + t.rieulkiyeokkorean = 0x313a; + t.rieulkiyeoksioskorean = 0x3169; + t.rieulkorean = 0x3139; + t.rieulmieumkorean = 0x313b; + t.rieulpansioskorean = 0x316c; + t.rieulparenkorean = 0x3203; + t.rieulphieuphkorean = 0x313f; + t.rieulpieupkorean = 0x313c; + t.rieulpieupsioskorean = 0x316b; + t.rieulsioskorean = 0x313d; + t.rieulthieuthkorean = 0x313e; + t.rieultikeutkorean = 0x316a; + t.rieulyeorinhieuhkorean = 0x316d; + t.rightangle = 0x221f; + t.righttackbelowcmb = 0x0319; + t.righttriangle = 0x22bf; + t.rihiragana = 0x308a; + t.rikatakana = 0x30ea; + t.rikatakanahalfwidth = 0xff98; + t.ring = 0x02da; + t.ringbelowcmb = 0x0325; + t.ringcmb = 0x030a; + t.ringhalfleft = 0x02bf; + t.ringhalfleftarmenian = 0x0559; + t.ringhalfleftbelowcmb = 0x031c; + t.ringhalfleftcentered = 0x02d3; + t.ringhalfright = 0x02be; + t.ringhalfrightbelowcmb = 0x0339; + t.ringhalfrightcentered = 0x02d2; + t.rinvertedbreve = 0x0213; + t.rittorusquare = 0x3351; + t.rlinebelow = 0x1e5f; + t.rlongleg = 0x027c; + t.rlonglegturned = 0x027a; + t.rmonospace = 0xff52; + t.rohiragana = 0x308d; + t.rokatakana = 0x30ed; + t.rokatakanahalfwidth = 0xff9b; + t.roruathai = 0x0e23; + t.rparen = 0x24ad; + t.rrabengali = 0x09dc; + t.rradeva = 0x0931; + t.rragurmukhi = 0x0a5c; + t.rreharabic = 0x0691; + t.rrehfinalarabic = 0xfb8d; + t.rrvocalicbengali = 0x09e0; + t.rrvocalicdeva = 0x0960; + t.rrvocalicgujarati = 0x0ae0; + t.rrvocalicvowelsignbengali = 0x09c4; + t.rrvocalicvowelsigndeva = 0x0944; + t.rrvocalicvowelsigngujarati = 0x0ac4; + t.rsuperior = 0xf6f1; + t.rtblock = 0x2590; + t.rturned = 0x0279; + t.rturnedsuperior = 0x02b4; + t.ruhiragana = 0x308b; + t.rukatakana = 0x30eb; + t.rukatakanahalfwidth = 0xff99; + t.rupeemarkbengali = 0x09f2; + t.rupeesignbengali = 0x09f3; + t.rupiah = 0xf6dd; + t.ruthai = 0x0e24; + t.rvocalicbengali = 0x098b; + t.rvocalicdeva = 0x090b; + t.rvocalicgujarati = 0x0a8b; + t.rvocalicvowelsignbengali = 0x09c3; + t.rvocalicvowelsigndeva = 0x0943; + t.rvocalicvowelsigngujarati = 0x0ac3; + t.s = 0x0073; + t.sabengali = 0x09b8; + t.sacute = 0x015b; + t.sacutedotaccent = 0x1e65; + t.sadarabic = 0x0635; + t.sadeva = 0x0938; + t.sadfinalarabic = 0xfeba; + t.sadinitialarabic = 0xfebb; + t.sadmedialarabic = 0xfebc; + t.sagujarati = 0x0ab8; + t.sagurmukhi = 0x0a38; + t.sahiragana = 0x3055; + t.sakatakana = 0x30b5; + t.sakatakanahalfwidth = 0xff7b; + t.sallallahoualayhewasallamarabic = 0xfdfa; + t.samekh = 0x05e1; + t.samekhdagesh = 0xfb41; + t.samekhdageshhebrew = 0xfb41; + t.samekhhebrew = 0x05e1; + t.saraaathai = 0x0e32; + t.saraaethai = 0x0e41; + t.saraaimaimalaithai = 0x0e44; + t.saraaimaimuanthai = 0x0e43; + t.saraamthai = 0x0e33; + t.saraathai = 0x0e30; + t.saraethai = 0x0e40; + t.saraiileftthai = 0xf886; + t.saraiithai = 0x0e35; + t.saraileftthai = 0xf885; + t.saraithai = 0x0e34; + t.saraothai = 0x0e42; + t.saraueeleftthai = 0xf888; + t.saraueethai = 0x0e37; + t.saraueleftthai = 0xf887; + t.sarauethai = 0x0e36; + t.sarauthai = 0x0e38; + t.sarauuthai = 0x0e39; + t.sbopomofo = 0x3119; + t.scaron = 0x0161; + t.scarondotaccent = 0x1e67; + t.scedilla = 0x015f; + t.schwa = 0x0259; + t.schwacyrillic = 0x04d9; + t.schwadieresiscyrillic = 0x04db; + t.schwahook = 0x025a; + t.scircle = 0x24e2; + t.scircumflex = 0x015d; + t.scommaaccent = 0x0219; + t.sdotaccent = 0x1e61; + t.sdotbelow = 0x1e63; + t.sdotbelowdotaccent = 0x1e69; + t.seagullbelowcmb = 0x033c; + t.second = 0x2033; + t.secondtonechinese = 0x02ca; + t.section = 0x00a7; + t.seenarabic = 0x0633; + t.seenfinalarabic = 0xfeb2; + t.seeninitialarabic = 0xfeb3; + t.seenmedialarabic = 0xfeb4; + t.segol = 0x05b6; + t.segol13 = 0x05b6; + t.segol1f = 0x05b6; + t.segol2c = 0x05b6; + t.segolhebrew = 0x05b6; + t.segolnarrowhebrew = 0x05b6; + t.segolquarterhebrew = 0x05b6; + t.segoltahebrew = 0x0592; + t.segolwidehebrew = 0x05b6; + t.seharmenian = 0x057d; + t.sehiragana = 0x305b; + t.sekatakana = 0x30bb; + t.sekatakanahalfwidth = 0xff7e; + t.semicolon = 0x003b; + t.semicolonarabic = 0x061b; + t.semicolonmonospace = 0xff1b; + t.semicolonsmall = 0xfe54; + t.semivoicedmarkkana = 0x309c; + t.semivoicedmarkkanahalfwidth = 0xff9f; + t.sentisquare = 0x3322; + t.sentosquare = 0x3323; + t.seven = 0x0037; + t.sevenarabic = 0x0667; + t.sevenbengali = 0x09ed; + t.sevencircle = 0x2466; + t.sevencircleinversesansserif = 0x2790; + t.sevendeva = 0x096d; + t.seveneighths = 0x215e; + t.sevengujarati = 0x0aed; + t.sevengurmukhi = 0x0a6d; + t.sevenhackarabic = 0x0667; + t.sevenhangzhou = 0x3027; + t.sevenideographicparen = 0x3226; + t.seveninferior = 0x2087; + t.sevenmonospace = 0xff17; + t.sevenoldstyle = 0xf737; + t.sevenparen = 0x247a; + t.sevenperiod = 0x248e; + t.sevenpersian = 0x06f7; + t.sevenroman = 0x2176; + t.sevensuperior = 0x2077; + t.seventeencircle = 0x2470; + t.seventeenparen = 0x2484; + t.seventeenperiod = 0x2498; + t.seventhai = 0x0e57; + t.sfthyphen = 0x00ad; + t.shaarmenian = 0x0577; + t.shabengali = 0x09b6; + t.shacyrillic = 0x0448; + t.shaddaarabic = 0x0651; + t.shaddadammaarabic = 0xfc61; + t.shaddadammatanarabic = 0xfc5e; + t.shaddafathaarabic = 0xfc60; + t.shaddakasraarabic = 0xfc62; + t.shaddakasratanarabic = 0xfc5f; + t.shade = 0x2592; + t.shadedark = 0x2593; + t.shadelight = 0x2591; + t.shademedium = 0x2592; + t.shadeva = 0x0936; + t.shagujarati = 0x0ab6; + t.shagurmukhi = 0x0a36; + t.shalshelethebrew = 0x0593; + t.shbopomofo = 0x3115; + t.shchacyrillic = 0x0449; + t.sheenarabic = 0x0634; + t.sheenfinalarabic = 0xfeb6; + t.sheeninitialarabic = 0xfeb7; + t.sheenmedialarabic = 0xfeb8; + t.sheicoptic = 0x03e3; + t.sheqel = 0x20aa; + t.sheqelhebrew = 0x20aa; + t.sheva = 0x05b0; + t.sheva115 = 0x05b0; + t.sheva15 = 0x05b0; + t.sheva22 = 0x05b0; + t.sheva2e = 0x05b0; + t.shevahebrew = 0x05b0; + t.shevanarrowhebrew = 0x05b0; + t.shevaquarterhebrew = 0x05b0; + t.shevawidehebrew = 0x05b0; + t.shhacyrillic = 0x04bb; + t.shimacoptic = 0x03ed; + t.shin = 0x05e9; + t.shindagesh = 0xfb49; + t.shindageshhebrew = 0xfb49; + t.shindageshshindot = 0xfb2c; + t.shindageshshindothebrew = 0xfb2c; + t.shindageshsindot = 0xfb2d; + t.shindageshsindothebrew = 0xfb2d; + t.shindothebrew = 0x05c1; + t.shinhebrew = 0x05e9; + t.shinshindot = 0xfb2a; + t.shinshindothebrew = 0xfb2a; + t.shinsindot = 0xfb2b; + t.shinsindothebrew = 0xfb2b; + t.shook = 0x0282; + t.sigma = 0x03c3; + t.sigma1 = 0x03c2; + t.sigmafinal = 0x03c2; + t.sigmalunatesymbolgreek = 0x03f2; + t.sihiragana = 0x3057; + t.sikatakana = 0x30b7; + t.sikatakanahalfwidth = 0xff7c; + t.siluqhebrew = 0x05bd; + t.siluqlefthebrew = 0x05bd; + t.similar = 0x223c; + t.sindothebrew = 0x05c2; + t.siosacirclekorean = 0x3274; + t.siosaparenkorean = 0x3214; + t.sioscieuckorean = 0x317e; + t.sioscirclekorean = 0x3266; + t.sioskiyeokkorean = 0x317a; + t.sioskorean = 0x3145; + t.siosnieunkorean = 0x317b; + t.siosparenkorean = 0x3206; + t.siospieupkorean = 0x317d; + t.siostikeutkorean = 0x317c; + t.six = 0x0036; + t.sixarabic = 0x0666; + t.sixbengali = 0x09ec; + t.sixcircle = 0x2465; + t.sixcircleinversesansserif = 0x278f; + t.sixdeva = 0x096c; + t.sixgujarati = 0x0aec; + t.sixgurmukhi = 0x0a6c; + t.sixhackarabic = 0x0666; + t.sixhangzhou = 0x3026; + t.sixideographicparen = 0x3225; + t.sixinferior = 0x2086; + t.sixmonospace = 0xff16; + t.sixoldstyle = 0xf736; + t.sixparen = 0x2479; + t.sixperiod = 0x248d; + t.sixpersian = 0x06f6; + t.sixroman = 0x2175; + t.sixsuperior = 0x2076; + t.sixteencircle = 0x246f; + t.sixteencurrencydenominatorbengali = 0x09f9; + t.sixteenparen = 0x2483; + t.sixteenperiod = 0x2497; + t.sixthai = 0x0e56; + t.slash = 0x002f; + t.slashmonospace = 0xff0f; + t.slong = 0x017f; + t.slongdotaccent = 0x1e9b; + t.smileface = 0x263a; + t.smonospace = 0xff53; + t.sofpasuqhebrew = 0x05c3; + t.softhyphen = 0x00ad; + t.softsigncyrillic = 0x044c; + t.sohiragana = 0x305d; + t.sokatakana = 0x30bd; + t.sokatakanahalfwidth = 0xff7f; + t.soliduslongoverlaycmb = 0x0338; + t.solidusshortoverlaycmb = 0x0337; + t.sorusithai = 0x0e29; + t.sosalathai = 0x0e28; + t.sosothai = 0x0e0b; + t.sosuathai = 0x0e2a; + t.space = 0x0020; + t.spacehackarabic = 0x0020; + t.spade = 0x2660; + t.spadesuitblack = 0x2660; + t.spadesuitwhite = 0x2664; + t.sparen = 0x24ae; + t.squarebelowcmb = 0x033b; + t.squarecc = 0x33c4; + t.squarecm = 0x339d; + t.squarediagonalcrosshatchfill = 0x25a9; + t.squarehorizontalfill = 0x25a4; + t.squarekg = 0x338f; + t.squarekm = 0x339e; + t.squarekmcapital = 0x33ce; + t.squareln = 0x33d1; + t.squarelog = 0x33d2; + t.squaremg = 0x338e; + t.squaremil = 0x33d5; + t.squaremm = 0x339c; + t.squaremsquared = 0x33a1; + t.squareorthogonalcrosshatchfill = 0x25a6; + t.squareupperlefttolowerrightfill = 0x25a7; + t.squareupperrighttolowerleftfill = 0x25a8; + t.squareverticalfill = 0x25a5; + t.squarewhitewithsmallblack = 0x25a3; + t.srsquare = 0x33db; + t.ssabengali = 0x09b7; + t.ssadeva = 0x0937; + t.ssagujarati = 0x0ab7; + t.ssangcieuckorean = 0x3149; + t.ssanghieuhkorean = 0x3185; + t.ssangieungkorean = 0x3180; + t.ssangkiyeokkorean = 0x3132; + t.ssangnieunkorean = 0x3165; + t.ssangpieupkorean = 0x3143; + t.ssangsioskorean = 0x3146; + t.ssangtikeutkorean = 0x3138; + t.ssuperior = 0xf6f2; + t.sterling = 0x00a3; + t.sterlingmonospace = 0xffe1; + t.strokelongoverlaycmb = 0x0336; + t.strokeshortoverlaycmb = 0x0335; + t.subset = 0x2282; + t.subsetnotequal = 0x228a; + t.subsetorequal = 0x2286; + t.succeeds = 0x227b; + t.suchthat = 0x220b; + t.suhiragana = 0x3059; + t.sukatakana = 0x30b9; + t.sukatakanahalfwidth = 0xff7d; + t.sukunarabic = 0x0652; + t.summation = 0x2211; + t.sun = 0x263c; + t.superset = 0x2283; + t.supersetnotequal = 0x228b; + t.supersetorequal = 0x2287; + t.svsquare = 0x33dc; + t.syouwaerasquare = 0x337c; + t.t = 0x0074; + t.tabengali = 0x09a4; + t.tackdown = 0x22a4; + t.tackleft = 0x22a3; + t.tadeva = 0x0924; + t.tagujarati = 0x0aa4; + t.tagurmukhi = 0x0a24; + t.taharabic = 0x0637; + t.tahfinalarabic = 0xfec2; + t.tahinitialarabic = 0xfec3; + t.tahiragana = 0x305f; + t.tahmedialarabic = 0xfec4; + t.taisyouerasquare = 0x337d; + t.takatakana = 0x30bf; + t.takatakanahalfwidth = 0xff80; + t.tatweelarabic = 0x0640; + t.tau = 0x03c4; + t.tav = 0x05ea; + t.tavdages = 0xfb4a; + t.tavdagesh = 0xfb4a; + t.tavdageshhebrew = 0xfb4a; + t.tavhebrew = 0x05ea; + t.tbar = 0x0167; + t.tbopomofo = 0x310a; + t.tcaron = 0x0165; + t.tccurl = 0x02a8; + t.tcedilla = 0x0163; + t.tcheharabic = 0x0686; + t.tchehfinalarabic = 0xfb7b; + t.tchehinitialarabic = 0xfb7c; + t.tchehmedialarabic = 0xfb7d; + t.tcircle = 0x24e3; + t.tcircumflexbelow = 0x1e71; + t.tcommaaccent = 0x0163; + t.tdieresis = 0x1e97; + t.tdotaccent = 0x1e6b; + t.tdotbelow = 0x1e6d; + t.tecyrillic = 0x0442; + t.tedescendercyrillic = 0x04ad; + t.teharabic = 0x062a; + t.tehfinalarabic = 0xfe96; + t.tehhahinitialarabic = 0xfca2; + t.tehhahisolatedarabic = 0xfc0c; + t.tehinitialarabic = 0xfe97; + t.tehiragana = 0x3066; + t.tehjeeminitialarabic = 0xfca1; + t.tehjeemisolatedarabic = 0xfc0b; + t.tehmarbutaarabic = 0x0629; + t.tehmarbutafinalarabic = 0xfe94; + t.tehmedialarabic = 0xfe98; + t.tehmeeminitialarabic = 0xfca4; + t.tehmeemisolatedarabic = 0xfc0e; + t.tehnoonfinalarabic = 0xfc73; + t.tekatakana = 0x30c6; + t.tekatakanahalfwidth = 0xff83; + t.telephone = 0x2121; + t.telephoneblack = 0x260e; + t.telishagedolahebrew = 0x05a0; + t.telishaqetanahebrew = 0x05a9; + t.tencircle = 0x2469; + t.tenideographicparen = 0x3229; + t.tenparen = 0x247d; + t.tenperiod = 0x2491; + t.tenroman = 0x2179; + t.tesh = 0x02a7; + t.tet = 0x05d8; + t.tetdagesh = 0xfb38; + t.tetdageshhebrew = 0xfb38; + t.tethebrew = 0x05d8; + t.tetsecyrillic = 0x04b5; + t.tevirhebrew = 0x059b; + t.tevirlefthebrew = 0x059b; + t.thabengali = 0x09a5; + t.thadeva = 0x0925; + t.thagujarati = 0x0aa5; + t.thagurmukhi = 0x0a25; + t.thalarabic = 0x0630; + t.thalfinalarabic = 0xfeac; + t.thanthakhatlowleftthai = 0xf898; + t.thanthakhatlowrightthai = 0xf897; + t.thanthakhatthai = 0x0e4c; + t.thanthakhatupperleftthai = 0xf896; + t.theharabic = 0x062b; + t.thehfinalarabic = 0xfe9a; + t.thehinitialarabic = 0xfe9b; + t.thehmedialarabic = 0xfe9c; + t.thereexists = 0x2203; + t.therefore = 0x2234; + t.theta = 0x03b8; + t.theta1 = 0x03d1; + t.thetasymbolgreek = 0x03d1; + t.thieuthacirclekorean = 0x3279; + t.thieuthaparenkorean = 0x3219; + t.thieuthcirclekorean = 0x326b; + t.thieuthkorean = 0x314c; + t.thieuthparenkorean = 0x320b; + t.thirteencircle = 0x246c; + t.thirteenparen = 0x2480; + t.thirteenperiod = 0x2494; + t.thonangmonthothai = 0x0e11; + t.thook = 0x01ad; + t.thophuthaothai = 0x0e12; + t.thorn = 0x00fe; + t.thothahanthai = 0x0e17; + t.thothanthai = 0x0e10; + t.thothongthai = 0x0e18; + t.thothungthai = 0x0e16; + t.thousandcyrillic = 0x0482; + t.thousandsseparatorarabic = 0x066c; + t.thousandsseparatorpersian = 0x066c; + t.three = 0x0033; + t.threearabic = 0x0663; + t.threebengali = 0x09e9; + t.threecircle = 0x2462; + t.threecircleinversesansserif = 0x278c; + t.threedeva = 0x0969; + t.threeeighths = 0x215c; + t.threegujarati = 0x0ae9; + t.threegurmukhi = 0x0a69; + t.threehackarabic = 0x0663; + t.threehangzhou = 0x3023; + t.threeideographicparen = 0x3222; + t.threeinferior = 0x2083; + t.threemonospace = 0xff13; + t.threenumeratorbengali = 0x09f6; + t.threeoldstyle = 0xf733; + t.threeparen = 0x2476; + t.threeperiod = 0x248a; + t.threepersian = 0x06f3; + t.threequarters = 0x00be; + t.threequartersemdash = 0xf6de; + t.threeroman = 0x2172; + t.threesuperior = 0x00b3; + t.threethai = 0x0e53; + t.thzsquare = 0x3394; + t.tihiragana = 0x3061; + t.tikatakana = 0x30c1; + t.tikatakanahalfwidth = 0xff81; + t.tikeutacirclekorean = 0x3270; + t.tikeutaparenkorean = 0x3210; + t.tikeutcirclekorean = 0x3262; + t.tikeutkorean = 0x3137; + t.tikeutparenkorean = 0x3202; + t.tilde = 0x02dc; + t.tildebelowcmb = 0x0330; + t.tildecmb = 0x0303; + t.tildecomb = 0x0303; + t.tildedoublecmb = 0x0360; + t.tildeoperator = 0x223c; + t.tildeoverlaycmb = 0x0334; + t.tildeverticalcmb = 0x033e; + t.timescircle = 0x2297; + t.tipehahebrew = 0x0596; + t.tipehalefthebrew = 0x0596; + t.tippigurmukhi = 0x0a70; + t.titlocyrilliccmb = 0x0483; + t.tiwnarmenian = 0x057f; + t.tlinebelow = 0x1e6f; + t.tmonospace = 0xff54; + t.toarmenian = 0x0569; + t.tohiragana = 0x3068; + t.tokatakana = 0x30c8; + t.tokatakanahalfwidth = 0xff84; + t.tonebarextrahighmod = 0x02e5; + t.tonebarextralowmod = 0x02e9; + t.tonebarhighmod = 0x02e6; + t.tonebarlowmod = 0x02e8; + t.tonebarmidmod = 0x02e7; + t.tonefive = 0x01bd; + t.tonesix = 0x0185; + t.tonetwo = 0x01a8; + t.tonos = 0x0384; + t.tonsquare = 0x3327; + t.topatakthai = 0x0e0f; + t.tortoiseshellbracketleft = 0x3014; + t.tortoiseshellbracketleftsmall = 0xfe5d; + t.tortoiseshellbracketleftvertical = 0xfe39; + t.tortoiseshellbracketright = 0x3015; + t.tortoiseshellbracketrightsmall = 0xfe5e; + t.tortoiseshellbracketrightvertical = 0xfe3a; + t.totaothai = 0x0e15; + t.tpalatalhook = 0x01ab; + t.tparen = 0x24af; + t.trademark = 0x2122; + t.trademarksans = 0xf8ea; + t.trademarkserif = 0xf6db; + t.tretroflexhook = 0x0288; + t.triagdn = 0x25bc; + t.triaglf = 0x25c4; + t.triagrt = 0x25ba; + t.triagup = 0x25b2; + t.ts = 0x02a6; + t.tsadi = 0x05e6; + t.tsadidagesh = 0xfb46; + t.tsadidageshhebrew = 0xfb46; + t.tsadihebrew = 0x05e6; + t.tsecyrillic = 0x0446; + t.tsere = 0x05b5; + t.tsere12 = 0x05b5; + t.tsere1e = 0x05b5; + t.tsere2b = 0x05b5; + t.tserehebrew = 0x05b5; + t.tserenarrowhebrew = 0x05b5; + t.tserequarterhebrew = 0x05b5; + t.tserewidehebrew = 0x05b5; + t.tshecyrillic = 0x045b; + t.tsuperior = 0xf6f3; + t.ttabengali = 0x099f; + t.ttadeva = 0x091f; + t.ttagujarati = 0x0a9f; + t.ttagurmukhi = 0x0a1f; + t.tteharabic = 0x0679; + t.ttehfinalarabic = 0xfb67; + t.ttehinitialarabic = 0xfb68; + t.ttehmedialarabic = 0xfb69; + t.tthabengali = 0x09a0; + t.tthadeva = 0x0920; + t.tthagujarati = 0x0aa0; + t.tthagurmukhi = 0x0a20; + t.tturned = 0x0287; + t.tuhiragana = 0x3064; + t.tukatakana = 0x30c4; + t.tukatakanahalfwidth = 0xff82; + t.tusmallhiragana = 0x3063; + t.tusmallkatakana = 0x30c3; + t.tusmallkatakanahalfwidth = 0xff6f; + t.twelvecircle = 0x246b; + t.twelveparen = 0x247f; + t.twelveperiod = 0x2493; + t.twelveroman = 0x217b; + t.twentycircle = 0x2473; + t.twentyhangzhou = 0x5344; + t.twentyparen = 0x2487; + t.twentyperiod = 0x249b; + t.two = 0x0032; + t.twoarabic = 0x0662; + t.twobengali = 0x09e8; + t.twocircle = 0x2461; + t.twocircleinversesansserif = 0x278b; + t.twodeva = 0x0968; + t.twodotenleader = 0x2025; + t.twodotleader = 0x2025; + t.twodotleadervertical = 0xfe30; + t.twogujarati = 0x0ae8; + t.twogurmukhi = 0x0a68; + t.twohackarabic = 0x0662; + t.twohangzhou = 0x3022; + t.twoideographicparen = 0x3221; + t.twoinferior = 0x2082; + t.twomonospace = 0xff12; + t.twonumeratorbengali = 0x09f5; + t.twooldstyle = 0xf732; + t.twoparen = 0x2475; + t.twoperiod = 0x2489; + t.twopersian = 0x06f2; + t.tworoman = 0x2171; + t.twostroke = 0x01bb; + t.twosuperior = 0x00b2; + t.twothai = 0x0e52; + t.twothirds = 0x2154; + t.u = 0x0075; + t.uacute = 0x00fa; + t.ubar = 0x0289; + t.ubengali = 0x0989; + t.ubopomofo = 0x3128; + t.ubreve = 0x016d; + t.ucaron = 0x01d4; + t.ucircle = 0x24e4; + t.ucircumflex = 0x00fb; + t.ucircumflexbelow = 0x1e77; + t.ucyrillic = 0x0443; + t.udattadeva = 0x0951; + t.udblacute = 0x0171; + t.udblgrave = 0x0215; + t.udeva = 0x0909; + t.udieresis = 0x00fc; + t.udieresisacute = 0x01d8; + t.udieresisbelow = 0x1e73; + t.udieresiscaron = 0x01da; + t.udieresiscyrillic = 0x04f1; + t.udieresisgrave = 0x01dc; + t.udieresismacron = 0x01d6; + t.udotbelow = 0x1ee5; + t.ugrave = 0x00f9; + t.ugujarati = 0x0a89; + t.ugurmukhi = 0x0a09; + t.uhiragana = 0x3046; + t.uhookabove = 0x1ee7; + t.uhorn = 0x01b0; + t.uhornacute = 0x1ee9; + t.uhorndotbelow = 0x1ef1; + t.uhorngrave = 0x1eeb; + t.uhornhookabove = 0x1eed; + t.uhorntilde = 0x1eef; + t.uhungarumlaut = 0x0171; + t.uhungarumlautcyrillic = 0x04f3; + t.uinvertedbreve = 0x0217; + t.ukatakana = 0x30a6; + t.ukatakanahalfwidth = 0xff73; + t.ukcyrillic = 0x0479; + t.ukorean = 0x315c; + t.umacron = 0x016b; + t.umacroncyrillic = 0x04ef; + t.umacrondieresis = 0x1e7b; + t.umatragurmukhi = 0x0a41; + t.umonospace = 0xff55; + t.underscore = 0x005f; + t.underscoredbl = 0x2017; + t.underscoremonospace = 0xff3f; + t.underscorevertical = 0xfe33; + t.underscorewavy = 0xfe4f; + t.union = 0x222a; + t.universal = 0x2200; + t.uogonek = 0x0173; + t.uparen = 0x24b0; + t.upblock = 0x2580; + t.upperdothebrew = 0x05c4; + t.upsilon = 0x03c5; + t.upsilondieresis = 0x03cb; + t.upsilondieresistonos = 0x03b0; + t.upsilonlatin = 0x028a; + t.upsilontonos = 0x03cd; + t.uptackbelowcmb = 0x031d; + t.uptackmod = 0x02d4; + t.uragurmukhi = 0x0a73; + t.uring = 0x016f; + t.ushortcyrillic = 0x045e; + t.usmallhiragana = 0x3045; + t.usmallkatakana = 0x30a5; + t.usmallkatakanahalfwidth = 0xff69; + t.ustraightcyrillic = 0x04af; + t.ustraightstrokecyrillic = 0x04b1; + t.utilde = 0x0169; + t.utildeacute = 0x1e79; + t.utildebelow = 0x1e75; + t.uubengali = 0x098a; + t.uudeva = 0x090a; + t.uugujarati = 0x0a8a; + t.uugurmukhi = 0x0a0a; + t.uumatragurmukhi = 0x0a42; + t.uuvowelsignbengali = 0x09c2; + t.uuvowelsigndeva = 0x0942; + t.uuvowelsigngujarati = 0x0ac2; + t.uvowelsignbengali = 0x09c1; + t.uvowelsigndeva = 0x0941; + t.uvowelsigngujarati = 0x0ac1; + t.v = 0x0076; + t.vadeva = 0x0935; + t.vagujarati = 0x0ab5; + t.vagurmukhi = 0x0a35; + t.vakatakana = 0x30f7; + t.vav = 0x05d5; + t.vavdagesh = 0xfb35; + t.vavdagesh65 = 0xfb35; + t.vavdageshhebrew = 0xfb35; + t.vavhebrew = 0x05d5; + t.vavholam = 0xfb4b; + t.vavholamhebrew = 0xfb4b; + t.vavvavhebrew = 0x05f0; + t.vavyodhebrew = 0x05f1; + t.vcircle = 0x24e5; + t.vdotbelow = 0x1e7f; + t.vecyrillic = 0x0432; + t.veharabic = 0x06a4; + t.vehfinalarabic = 0xfb6b; + t.vehinitialarabic = 0xfb6c; + t.vehmedialarabic = 0xfb6d; + t.vekatakana = 0x30f9; + t.venus = 0x2640; + t.verticalbar = 0x007c; + t.verticallineabovecmb = 0x030d; + t.verticallinebelowcmb = 0x0329; + t.verticallinelowmod = 0x02cc; + t.verticallinemod = 0x02c8; + t.vewarmenian = 0x057e; + t.vhook = 0x028b; + t.vikatakana = 0x30f8; + t.viramabengali = 0x09cd; + t.viramadeva = 0x094d; + t.viramagujarati = 0x0acd; + t.visargabengali = 0x0983; + t.visargadeva = 0x0903; + t.visargagujarati = 0x0a83; + t.vmonospace = 0xff56; + t.voarmenian = 0x0578; + t.voicediterationhiragana = 0x309e; + t.voicediterationkatakana = 0x30fe; + t.voicedmarkkana = 0x309b; + t.voicedmarkkanahalfwidth = 0xff9e; + t.vokatakana = 0x30fa; + t.vparen = 0x24b1; + t.vtilde = 0x1e7d; + t.vturned = 0x028c; + t.vuhiragana = 0x3094; + t.vukatakana = 0x30f4; + t.w = 0x0077; + t.wacute = 0x1e83; + t.waekorean = 0x3159; + t.wahiragana = 0x308f; + t.wakatakana = 0x30ef; + t.wakatakanahalfwidth = 0xff9c; + t.wakorean = 0x3158; + t.wasmallhiragana = 0x308e; + t.wasmallkatakana = 0x30ee; + t.wattosquare = 0x3357; + t.wavedash = 0x301c; + t.wavyunderscorevertical = 0xfe34; + t.wawarabic = 0x0648; + t.wawfinalarabic = 0xfeee; + t.wawhamzaabovearabic = 0x0624; + t.wawhamzaabovefinalarabic = 0xfe86; + t.wbsquare = 0x33dd; + t.wcircle = 0x24e6; + t.wcircumflex = 0x0175; + t.wdieresis = 0x1e85; + t.wdotaccent = 0x1e87; + t.wdotbelow = 0x1e89; + t.wehiragana = 0x3091; + t.weierstrass = 0x2118; + t.wekatakana = 0x30f1; + t.wekorean = 0x315e; + t.weokorean = 0x315d; + t.wgrave = 0x1e81; + t.whitebullet = 0x25e6; + t.whitecircle = 0x25cb; + t.whitecircleinverse = 0x25d9; + t.whitecornerbracketleft = 0x300e; + t.whitecornerbracketleftvertical = 0xfe43; + t.whitecornerbracketright = 0x300f; + t.whitecornerbracketrightvertical = 0xfe44; + t.whitediamond = 0x25c7; + t.whitediamondcontainingblacksmalldiamond = 0x25c8; + t.whitedownpointingsmalltriangle = 0x25bf; + t.whitedownpointingtriangle = 0x25bd; + t.whiteleftpointingsmalltriangle = 0x25c3; + t.whiteleftpointingtriangle = 0x25c1; + t.whitelenticularbracketleft = 0x3016; + t.whitelenticularbracketright = 0x3017; + t.whiterightpointingsmalltriangle = 0x25b9; + t.whiterightpointingtriangle = 0x25b7; + t.whitesmallsquare = 0x25ab; + t.whitesmilingface = 0x263a; + t.whitesquare = 0x25a1; + t.whitestar = 0x2606; + t.whitetelephone = 0x260f; + t.whitetortoiseshellbracketleft = 0x3018; + t.whitetortoiseshellbracketright = 0x3019; + t.whiteuppointingsmalltriangle = 0x25b5; + t.whiteuppointingtriangle = 0x25b3; + t.wihiragana = 0x3090; + t.wikatakana = 0x30f0; + t.wikorean = 0x315f; + t.wmonospace = 0xff57; + t.wohiragana = 0x3092; + t.wokatakana = 0x30f2; + t.wokatakanahalfwidth = 0xff66; + t.won = 0x20a9; + t.wonmonospace = 0xffe6; + t.wowaenthai = 0x0e27; + t.wparen = 0x24b2; + t.wring = 0x1e98; + t.wsuperior = 0x02b7; + t.wturned = 0x028d; + t.wynn = 0x01bf; + t.x = 0x0078; + t.xabovecmb = 0x033d; + t.xbopomofo = 0x3112; + t.xcircle = 0x24e7; + t.xdieresis = 0x1e8d; + t.xdotaccent = 0x1e8b; + t.xeharmenian = 0x056d; + t.xi = 0x03be; + t.xmonospace = 0xff58; + t.xparen = 0x24b3; + t.xsuperior = 0x02e3; + t.y = 0x0079; + t.yaadosquare = 0x334e; + t.yabengali = 0x09af; + t.yacute = 0x00fd; + t.yadeva = 0x092f; + t.yaekorean = 0x3152; + t.yagujarati = 0x0aaf; + t.yagurmukhi = 0x0a2f; + t.yahiragana = 0x3084; + t.yakatakana = 0x30e4; + t.yakatakanahalfwidth = 0xff94; + t.yakorean = 0x3151; + t.yamakkanthai = 0x0e4e; + t.yasmallhiragana = 0x3083; + t.yasmallkatakana = 0x30e3; + t.yasmallkatakanahalfwidth = 0xff6c; + t.yatcyrillic = 0x0463; + t.ycircle = 0x24e8; + t.ycircumflex = 0x0177; + t.ydieresis = 0x00ff; + t.ydotaccent = 0x1e8f; + t.ydotbelow = 0x1ef5; + t.yeharabic = 0x064a; + t.yehbarreearabic = 0x06d2; + t.yehbarreefinalarabic = 0xfbaf; + t.yehfinalarabic = 0xfef2; + t.yehhamzaabovearabic = 0x0626; + t.yehhamzaabovefinalarabic = 0xfe8a; + t.yehhamzaaboveinitialarabic = 0xfe8b; + t.yehhamzaabovemedialarabic = 0xfe8c; + t.yehinitialarabic = 0xfef3; + t.yehmedialarabic = 0xfef4; + t.yehmeeminitialarabic = 0xfcdd; + t.yehmeemisolatedarabic = 0xfc58; + t.yehnoonfinalarabic = 0xfc94; + t.yehthreedotsbelowarabic = 0x06d1; + t.yekorean = 0x3156; + t.yen = 0x00a5; + t.yenmonospace = 0xffe5; + t.yeokorean = 0x3155; + t.yeorinhieuhkorean = 0x3186; + t.yerahbenyomohebrew = 0x05aa; + t.yerahbenyomolefthebrew = 0x05aa; + t.yericyrillic = 0x044b; + t.yerudieresiscyrillic = 0x04f9; + t.yesieungkorean = 0x3181; + t.yesieungpansioskorean = 0x3183; + t.yesieungsioskorean = 0x3182; + t.yetivhebrew = 0x059a; + t.ygrave = 0x1ef3; + t.yhook = 0x01b4; + t.yhookabove = 0x1ef7; + t.yiarmenian = 0x0575; + t.yicyrillic = 0x0457; + t.yikorean = 0x3162; + t.yinyang = 0x262f; + t.yiwnarmenian = 0x0582; + t.ymonospace = 0xff59; + t.yod = 0x05d9; + t.yoddagesh = 0xfb39; + t.yoddageshhebrew = 0xfb39; + t.yodhebrew = 0x05d9; + t.yodyodhebrew = 0x05f2; + t.yodyodpatahhebrew = 0xfb1f; + t.yohiragana = 0x3088; + t.yoikorean = 0x3189; + t.yokatakana = 0x30e8; + t.yokatakanahalfwidth = 0xff96; + t.yokorean = 0x315b; + t.yosmallhiragana = 0x3087; + t.yosmallkatakana = 0x30e7; + t.yosmallkatakanahalfwidth = 0xff6e; + t.yotgreek = 0x03f3; + t.yoyaekorean = 0x3188; + t.yoyakorean = 0x3187; + t.yoyakthai = 0x0e22; + t.yoyingthai = 0x0e0d; + t.yparen = 0x24b4; + t.ypogegrammeni = 0x037a; + t.ypogegrammenigreekcmb = 0x0345; + t.yr = 0x01a6; + t.yring = 0x1e99; + t.ysuperior = 0x02b8; + t.ytilde = 0x1ef9; + t.yturned = 0x028e; + t.yuhiragana = 0x3086; + t.yuikorean = 0x318c; + t.yukatakana = 0x30e6; + t.yukatakanahalfwidth = 0xff95; + t.yukorean = 0x3160; + t.yusbigcyrillic = 0x046b; + t.yusbigiotifiedcyrillic = 0x046d; + t.yuslittlecyrillic = 0x0467; + t.yuslittleiotifiedcyrillic = 0x0469; + t.yusmallhiragana = 0x3085; + t.yusmallkatakana = 0x30e5; + t.yusmallkatakanahalfwidth = 0xff6d; + t.yuyekorean = 0x318b; + t.yuyeokorean = 0x318a; + t.yyabengali = 0x09df; + t.yyadeva = 0x095f; + t.z = 0x007a; + t.zaarmenian = 0x0566; + t.zacute = 0x017a; + t.zadeva = 0x095b; + t.zagurmukhi = 0x0a5b; + t.zaharabic = 0x0638; + t.zahfinalarabic = 0xfec6; + t.zahinitialarabic = 0xfec7; + t.zahiragana = 0x3056; + t.zahmedialarabic = 0xfec8; + t.zainarabic = 0x0632; + t.zainfinalarabic = 0xfeb0; + t.zakatakana = 0x30b6; + t.zaqefgadolhebrew = 0x0595; + t.zaqefqatanhebrew = 0x0594; + t.zarqahebrew = 0x0598; + t.zayin = 0x05d6; + t.zayindagesh = 0xfb36; + t.zayindageshhebrew = 0xfb36; + t.zayinhebrew = 0x05d6; + t.zbopomofo = 0x3117; + t.zcaron = 0x017e; + t.zcircle = 0x24e9; + t.zcircumflex = 0x1e91; + t.zcurl = 0x0291; + t.zdot = 0x017c; + t.zdotaccent = 0x017c; + t.zdotbelow = 0x1e93; + t.zecyrillic = 0x0437; + t.zedescendercyrillic = 0x0499; + t.zedieresiscyrillic = 0x04df; + t.zehiragana = 0x305c; + t.zekatakana = 0x30bc; + t.zero = 0x0030; + t.zeroarabic = 0x0660; + t.zerobengali = 0x09e6; + t.zerodeva = 0x0966; + t.zerogujarati = 0x0ae6; + t.zerogurmukhi = 0x0a66; + t.zerohackarabic = 0x0660; + t.zeroinferior = 0x2080; + t.zeromonospace = 0xff10; + t.zerooldstyle = 0xf730; + t.zeropersian = 0x06f0; + t.zerosuperior = 0x2070; + t.zerothai = 0x0e50; + t.zerowidthjoiner = 0xfeff; + t.zerowidthnonjoiner = 0x200c; + t.zerowidthspace = 0x200b; + t.zeta = 0x03b6; + t.zhbopomofo = 0x3113; + t.zhearmenian = 0x056a; + t.zhebrevecyrillic = 0x04c2; + t.zhecyrillic = 0x0436; + t.zhedescendercyrillic = 0x0497; + t.zhedieresiscyrillic = 0x04dd; + t.zihiragana = 0x3058; + t.zikatakana = 0x30b8; + t.zinorhebrew = 0x05ae; + t.zlinebelow = 0x1e95; + t.zmonospace = 0xff5a; + t.zohiragana = 0x305e; + t.zokatakana = 0x30be; + t.zparen = 0x24b5; + t.zretroflexhook = 0x0290; + t.zstroke = 0x01b6; + t.zuhiragana = 0x305a; + t.zukatakana = 0x30ba; + t[".notdef"] = 0x0000; + t.angbracketleftbig = 0x2329; + t.angbracketleftBig = 0x2329; + t.angbracketleftbigg = 0x2329; + t.angbracketleftBigg = 0x2329; + t.angbracketrightBig = 0x232a; + t.angbracketrightbig = 0x232a; + t.angbracketrightBigg = 0x232a; + t.angbracketrightbigg = 0x232a; + t.arrowhookleft = 0x21aa; + t.arrowhookright = 0x21a9; + t.arrowlefttophalf = 0x21bc; + t.arrowleftbothalf = 0x21bd; + t.arrownortheast = 0x2197; + t.arrownorthwest = 0x2196; + t.arrowrighttophalf = 0x21c0; + t.arrowrightbothalf = 0x21c1; + t.arrowsoutheast = 0x2198; + t.arrowsouthwest = 0x2199; + t.backslashbig = 0x2216; + t.backslashBig = 0x2216; + t.backslashBigg = 0x2216; + t.backslashbigg = 0x2216; + t.bardbl = 0x2016; + t.bracehtipdownleft = 0xfe37; + t.bracehtipdownright = 0xfe37; + t.bracehtipupleft = 0xfe38; + t.bracehtipupright = 0xfe38; + t.braceleftBig = 0x007b; + t.braceleftbig = 0x007b; + t.braceleftbigg = 0x007b; + t.braceleftBigg = 0x007b; + t.bracerightBig = 0x007d; + t.bracerightbig = 0x007d; + t.bracerightbigg = 0x007d; + t.bracerightBigg = 0x007d; + t.bracketleftbig = 0x005b; + t.bracketleftBig = 0x005b; + t.bracketleftbigg = 0x005b; + t.bracketleftBigg = 0x005b; + t.bracketrightBig = 0x005d; + t.bracketrightbig = 0x005d; + t.bracketrightbigg = 0x005d; + t.bracketrightBigg = 0x005d; + t.ceilingleftbig = 0x2308; + t.ceilingleftBig = 0x2308; + t.ceilingleftBigg = 0x2308; + t.ceilingleftbigg = 0x2308; + t.ceilingrightbig = 0x2309; + t.ceilingrightBig = 0x2309; + t.ceilingrightbigg = 0x2309; + t.ceilingrightBigg = 0x2309; + t.circledotdisplay = 0x2299; + t.circledottext = 0x2299; + t.circlemultiplydisplay = 0x2297; + t.circlemultiplytext = 0x2297; + t.circleplusdisplay = 0x2295; + t.circleplustext = 0x2295; + t.contintegraldisplay = 0x222e; + t.contintegraltext = 0x222e; + t.coproductdisplay = 0x2210; + t.coproducttext = 0x2210; + t.floorleftBig = 0x230a; + t.floorleftbig = 0x230a; + t.floorleftbigg = 0x230a; + t.floorleftBigg = 0x230a; + t.floorrightbig = 0x230b; + t.floorrightBig = 0x230b; + t.floorrightBigg = 0x230b; + t.floorrightbigg = 0x230b; + t.hatwide = 0x0302; + t.hatwider = 0x0302; + t.hatwidest = 0x0302; + t.intercal = 0x1d40; + t.integraldisplay = 0x222b; + t.integraltext = 0x222b; + t.intersectiondisplay = 0x22c2; + t.intersectiontext = 0x22c2; + t.logicalanddisplay = 0x2227; + t.logicalandtext = 0x2227; + t.logicalordisplay = 0x2228; + t.logicalortext = 0x2228; + t.parenleftBig = 0x0028; + t.parenleftbig = 0x0028; + t.parenleftBigg = 0x0028; + t.parenleftbigg = 0x0028; + t.parenrightBig = 0x0029; + t.parenrightbig = 0x0029; + t.parenrightBigg = 0x0029; + t.parenrightbigg = 0x0029; + t.prime = 0x2032; + t.productdisplay = 0x220f; + t.producttext = 0x220f; + t.radicalbig = 0x221a; + t.radicalBig = 0x221a; + t.radicalBigg = 0x221a; + t.radicalbigg = 0x221a; + t.radicalbt = 0x221a; + t.radicaltp = 0x221a; + t.radicalvertex = 0x221a; + t.slashbig = 0x002f; + t.slashBig = 0x002f; + t.slashBigg = 0x002f; + t.slashbigg = 0x002f; + t.summationdisplay = 0x2211; + t.summationtext = 0x2211; + t.tildewide = 0x02dc; + t.tildewider = 0x02dc; + t.tildewidest = 0x02dc; + t.uniondisplay = 0x22c3; + t.unionmultidisplay = 0x228e; + t.unionmultitext = 0x228e; + t.unionsqdisplay = 0x2294; + t.unionsqtext = 0x2294; + t.uniontext = 0x22c3; + t.vextenddouble = 0x2225; + t.vextendsingle = 0x2223; +}); +const getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) { + t.space = 0x0020; + t.a1 = 0x2701; + t.a2 = 0x2702; + t.a202 = 0x2703; + t.a3 = 0x2704; + t.a4 = 0x260e; + t.a5 = 0x2706; + t.a119 = 0x2707; + t.a118 = 0x2708; + t.a117 = 0x2709; + t.a11 = 0x261b; + t.a12 = 0x261e; + t.a13 = 0x270c; + t.a14 = 0x270d; + t.a15 = 0x270e; + t.a16 = 0x270f; + t.a105 = 0x2710; + t.a17 = 0x2711; + t.a18 = 0x2712; + t.a19 = 0x2713; + t.a20 = 0x2714; + t.a21 = 0x2715; + t.a22 = 0x2716; + t.a23 = 0x2717; + t.a24 = 0x2718; + t.a25 = 0x2719; + t.a26 = 0x271a; + t.a27 = 0x271b; + t.a28 = 0x271c; + t.a6 = 0x271d; + t.a7 = 0x271e; + t.a8 = 0x271f; + t.a9 = 0x2720; + t.a10 = 0x2721; + t.a29 = 0x2722; + t.a30 = 0x2723; + t.a31 = 0x2724; + t.a32 = 0x2725; + t.a33 = 0x2726; + t.a34 = 0x2727; + t.a35 = 0x2605; + t.a36 = 0x2729; + t.a37 = 0x272a; + t.a38 = 0x272b; + t.a39 = 0x272c; + t.a40 = 0x272d; + t.a41 = 0x272e; + t.a42 = 0x272f; + t.a43 = 0x2730; + t.a44 = 0x2731; + t.a45 = 0x2732; + t.a46 = 0x2733; + t.a47 = 0x2734; + t.a48 = 0x2735; + t.a49 = 0x2736; + t.a50 = 0x2737; + t.a51 = 0x2738; + t.a52 = 0x2739; + t.a53 = 0x273a; + t.a54 = 0x273b; + t.a55 = 0x273c; + t.a56 = 0x273d; + t.a57 = 0x273e; + t.a58 = 0x273f; + t.a59 = 0x2740; + t.a60 = 0x2741; + t.a61 = 0x2742; + t.a62 = 0x2743; + t.a63 = 0x2744; + t.a64 = 0x2745; + t.a65 = 0x2746; + t.a66 = 0x2747; + t.a67 = 0x2748; + t.a68 = 0x2749; + t.a69 = 0x274a; + t.a70 = 0x274b; + t.a71 = 0x25cf; + t.a72 = 0x274d; + t.a73 = 0x25a0; + t.a74 = 0x274f; + t.a203 = 0x2750; + t.a75 = 0x2751; + t.a204 = 0x2752; + t.a76 = 0x25b2; + t.a77 = 0x25bc; + t.a78 = 0x25c6; + t.a79 = 0x2756; + t.a81 = 0x25d7; + t.a82 = 0x2758; + t.a83 = 0x2759; + t.a84 = 0x275a; + t.a97 = 0x275b; + t.a98 = 0x275c; + t.a99 = 0x275d; + t.a100 = 0x275e; + t.a101 = 0x2761; + t.a102 = 0x2762; + t.a103 = 0x2763; + t.a104 = 0x2764; + t.a106 = 0x2765; + t.a107 = 0x2766; + t.a108 = 0x2767; + t.a112 = 0x2663; + t.a111 = 0x2666; + t.a110 = 0x2665; + t.a109 = 0x2660; + t.a120 = 0x2460; + t.a121 = 0x2461; + t.a122 = 0x2462; + t.a123 = 0x2463; + t.a124 = 0x2464; + t.a125 = 0x2465; + t.a126 = 0x2466; + t.a127 = 0x2467; + t.a128 = 0x2468; + t.a129 = 0x2469; + t.a130 = 0x2776; + t.a131 = 0x2777; + t.a132 = 0x2778; + t.a133 = 0x2779; + t.a134 = 0x277a; + t.a135 = 0x277b; + t.a136 = 0x277c; + t.a137 = 0x277d; + t.a138 = 0x277e; + t.a139 = 0x277f; + t.a140 = 0x2780; + t.a141 = 0x2781; + t.a142 = 0x2782; + t.a143 = 0x2783; + t.a144 = 0x2784; + t.a145 = 0x2785; + t.a146 = 0x2786; + t.a147 = 0x2787; + t.a148 = 0x2788; + t.a149 = 0x2789; + t.a150 = 0x278a; + t.a151 = 0x278b; + t.a152 = 0x278c; + t.a153 = 0x278d; + t.a154 = 0x278e; + t.a155 = 0x278f; + t.a156 = 0x2790; + t.a157 = 0x2791; + t.a158 = 0x2792; + t.a159 = 0x2793; + t.a160 = 0x2794; + t.a161 = 0x2192; + t.a163 = 0x2194; + t.a164 = 0x2195; + t.a196 = 0x2798; + t.a165 = 0x2799; + t.a192 = 0x279a; + t.a166 = 0x279b; + t.a167 = 0x279c; + t.a168 = 0x279d; + t.a169 = 0x279e; + t.a170 = 0x279f; + t.a171 = 0x27a0; + t.a172 = 0x27a1; + t.a173 = 0x27a2; + t.a162 = 0x27a3; + t.a174 = 0x27a4; + t.a175 = 0x27a5; + t.a176 = 0x27a6; + t.a177 = 0x27a7; + t.a178 = 0x27a8; + t.a179 = 0x27a9; + t.a193 = 0x27aa; + t.a180 = 0x27ab; + t.a199 = 0x27ac; + t.a181 = 0x27ad; + t.a200 = 0x27ae; + t.a182 = 0x27af; + t.a201 = 0x27b1; + t.a183 = 0x27b2; + t.a184 = 0x27b3; + t.a197 = 0x27b4; + t.a185 = 0x27b5; + t.a194 = 0x27b6; + t.a198 = 0x27b7; + t.a186 = 0x27b8; + t.a195 = 0x27b9; + t.a187 = 0x27ba; + t.a188 = 0x27bb; + t.a189 = 0x27bc; + t.a190 = 0x27bd; + t.a191 = 0x27be; + t.a89 = 0x2768; + t.a90 = 0x2769; + t.a93 = 0x276a; + t.a94 = 0x276b; + t.a91 = 0x276c; + t.a92 = 0x276d; + t.a205 = 0x276e; + t.a85 = 0x276f; + t.a206 = 0x2770; + t.a86 = 0x2771; + t.a87 = 0x2772; + t.a88 = 0x2773; + t.a95 = 0x2774; + t.a96 = 0x2775; + t[".notdef"] = 0x0000; +}); // ./src/core/unicode.js + +const getSpecialPUASymbols = getLookupTableFactory(function (t) { + t[63721] = 0x00a9; + t[63193] = 0x00a9; + t[63720] = 0x00ae; + t[63194] = 0x00ae; + t[63722] = 0x2122; + t[63195] = 0x2122; + t[63729] = 0x23a7; + t[63730] = 0x23a8; + t[63731] = 0x23a9; + t[63740] = 0x23ab; + t[63741] = 0x23ac; + t[63742] = 0x23ad; + t[63726] = 0x23a1; + t[63727] = 0x23a2; + t[63728] = 0x23a3; + t[63737] = 0x23a4; + t[63738] = 0x23a5; + t[63739] = 0x23a6; + t[63723] = 0x239b; + t[63724] = 0x239c; + t[63725] = 0x239d; + t[63734] = 0x239e; + t[63735] = 0x239f; + t[63736] = 0x23a0; +}); +function mapSpecialUnicodeValues(code) { + if (code >= 0xfff0 && code <= 0xffff) { + return 0; + } else if (code >= 0xf600 && code <= 0xf8ff) { + return getSpecialPUASymbols()[code] || code; + } else if (code === 0x00ad) { + return 0x002d; + } + return code; } -function normalizeFontName(e) { - return e.replaceAll(/[,_]/g, "-").replaceAll(/\s/g, ""); +function getUnicodeForGlyph(name, glyphsUnicodeMap) { + let unicode = glyphsUnicodeMap[name]; + if (unicode !== undefined) { + return unicode; + } + if (!name) { + return -1; + } + if (name[0] === "u") { + const nameLen = name.length; + let hexStr; + if (nameLen === 7 && name[1] === "n" && name[2] === "i") { + hexStr = name.substring(3); + } else if (nameLen >= 5 && nameLen <= 7) { + hexStr = name.substring(1); + } else { + return -1; + } + if (hexStr === hexStr.toUpperCase()) { + unicode = parseInt(hexStr, 16); + if (unicode >= 0) { + return unicode; + } + } + } + return -1; } -const Pi = getLookupTableFactory(function (e) { - e["Times-Roman"] = "Times-Roman"; - e.Helvetica = "Helvetica"; - e.Courier = "Courier"; - e.Symbol = "Symbol"; - e["Times-Bold"] = "Times-Bold"; - e["Helvetica-Bold"] = "Helvetica-Bold"; - e["Courier-Bold"] = "Courier-Bold"; - e.ZapfDingbats = "ZapfDingbats"; - e["Times-Italic"] = "Times-Italic"; - e["Helvetica-Oblique"] = "Helvetica-Oblique"; - e["Courier-Oblique"] = "Courier-Oblique"; - e["Times-BoldItalic"] = "Times-BoldItalic"; - e["Helvetica-BoldOblique"] = "Helvetica-BoldOblique"; - e["Courier-BoldOblique"] = "Courier-BoldOblique"; - e.ArialNarrow = "Helvetica"; - e["ArialNarrow-Bold"] = "Helvetica-Bold"; - e["ArialNarrow-BoldItalic"] = "Helvetica-BoldOblique"; - e["ArialNarrow-Italic"] = "Helvetica-Oblique"; - e.ArialBlack = "Helvetica"; - e["ArialBlack-Bold"] = "Helvetica-Bold"; - e["ArialBlack-BoldItalic"] = "Helvetica-BoldOblique"; - e["ArialBlack-Italic"] = "Helvetica-Oblique"; - e["Arial-Black"] = "Helvetica"; - e["Arial-Black-Bold"] = "Helvetica-Bold"; - e["Arial-Black-BoldItalic"] = "Helvetica-BoldOblique"; - e["Arial-Black-Italic"] = "Helvetica-Oblique"; - e.Arial = "Helvetica"; - e["Arial-Bold"] = "Helvetica-Bold"; - e["Arial-BoldItalic"] = "Helvetica-BoldOblique"; - e["Arial-Italic"] = "Helvetica-Oblique"; - e.ArialMT = "Helvetica"; - e["Arial-BoldItalicMT"] = "Helvetica-BoldOblique"; - e["Arial-BoldMT"] = "Helvetica-Bold"; - e["Arial-ItalicMT"] = "Helvetica-Oblique"; - e["Arial-BoldItalicMT-BoldItalic"] = "Helvetica-BoldOblique"; - e["Arial-BoldMT-Bold"] = "Helvetica-Bold"; - e["Arial-ItalicMT-Italic"] = "Helvetica-Oblique"; - e.ArialUnicodeMS = "Helvetica"; - e["ArialUnicodeMS-Bold"] = "Helvetica-Bold"; - e["ArialUnicodeMS-BoldItalic"] = "Helvetica-BoldOblique"; - e["ArialUnicodeMS-Italic"] = "Helvetica-Oblique"; - e["Courier-BoldItalic"] = "Courier-BoldOblique"; - e["Courier-Italic"] = "Courier-Oblique"; - e.CourierNew = "Courier"; - e["CourierNew-Bold"] = "Courier-Bold"; - e["CourierNew-BoldItalic"] = "Courier-BoldOblique"; - e["CourierNew-Italic"] = "Courier-Oblique"; - e["CourierNewPS-BoldItalicMT"] = "Courier-BoldOblique"; - e["CourierNewPS-BoldMT"] = "Courier-Bold"; - e["CourierNewPS-ItalicMT"] = "Courier-Oblique"; - e.CourierNewPSMT = "Courier"; - e["Helvetica-BoldItalic"] = "Helvetica-BoldOblique"; - e["Helvetica-Italic"] = "Helvetica-Oblique"; - e["Symbol-Bold"] = "Symbol"; - e["Symbol-BoldItalic"] = "Symbol"; - e["Symbol-Italic"] = "Symbol"; - e.TimesNewRoman = "Times-Roman"; - e["TimesNewRoman-Bold"] = "Times-Bold"; - e["TimesNewRoman-BoldItalic"] = "Times-BoldItalic"; - e["TimesNewRoman-Italic"] = "Times-Italic"; - e.TimesNewRomanPS = "Times-Roman"; - e["TimesNewRomanPS-Bold"] = "Times-Bold"; - e["TimesNewRomanPS-BoldItalic"] = "Times-BoldItalic"; - e["TimesNewRomanPS-BoldItalicMT"] = "Times-BoldItalic"; - e["TimesNewRomanPS-BoldMT"] = "Times-Bold"; - e["TimesNewRomanPS-Italic"] = "Times-Italic"; - e["TimesNewRomanPS-ItalicMT"] = "Times-Italic"; - e.TimesNewRomanPSMT = "Times-Roman"; - e["TimesNewRomanPSMT-Bold"] = "Times-Bold"; - e["TimesNewRomanPSMT-BoldItalic"] = "Times-BoldItalic"; - e["TimesNewRomanPSMT-Italic"] = "Times-Italic"; - }), - Wi = getLookupTableFactory(function (e) { - e.Courier = "FoxitFixed.pfb"; - e["Courier-Bold"] = "FoxitFixedBold.pfb"; - e["Courier-BoldOblique"] = "FoxitFixedBoldItalic.pfb"; - e["Courier-Oblique"] = "FoxitFixedItalic.pfb"; - e.Helvetica = "LiberationSans-Regular.ttf"; - e["Helvetica-Bold"] = "LiberationSans-Bold.ttf"; - e["Helvetica-BoldOblique"] = "LiberationSans-BoldItalic.ttf"; - e["Helvetica-Oblique"] = "LiberationSans-Italic.ttf"; - e["Times-Roman"] = "FoxitSerif.pfb"; - e["Times-Bold"] = "FoxitSerifBold.pfb"; - e["Times-BoldItalic"] = "FoxitSerifBoldItalic.pfb"; - e["Times-Italic"] = "FoxitSerifItalic.pfb"; - e.Symbol = "FoxitSymbol.pfb"; - e.ZapfDingbats = "FoxitDingbats.pfb"; - e["LiberationSans-Regular"] = "LiberationSans-Regular.ttf"; - e["LiberationSans-Bold"] = "LiberationSans-Bold.ttf"; - e["LiberationSans-Italic"] = "LiberationSans-Italic.ttf"; - e["LiberationSans-BoldItalic"] = "LiberationSans-BoldItalic.ttf"; - }), - ji = getLookupTableFactory(function (e) { - e.Calibri = "Helvetica"; - e["Calibri-Bold"] = "Helvetica-Bold"; - e["Calibri-BoldItalic"] = "Helvetica-BoldOblique"; - e["Calibri-Italic"] = "Helvetica-Oblique"; - e.CenturyGothic = "Helvetica"; - e["CenturyGothic-Bold"] = "Helvetica-Bold"; - e["CenturyGothic-BoldItalic"] = "Helvetica-BoldOblique"; - e["CenturyGothic-Italic"] = "Helvetica-Oblique"; - e.ComicSansMS = "Comic Sans MS"; - e["ComicSansMS-Bold"] = "Comic Sans MS-Bold"; - e["ComicSansMS-BoldItalic"] = "Comic Sans MS-BoldItalic"; - e["ComicSansMS-Italic"] = "Comic Sans MS-Italic"; - e.Impact = "Helvetica"; - e["ItcSymbol-Bold"] = "Helvetica-Bold"; - e["ItcSymbol-BoldItalic"] = "Helvetica-BoldOblique"; - e["ItcSymbol-Book"] = "Helvetica"; - e["ItcSymbol-BookItalic"] = "Helvetica-Oblique"; - e["ItcSymbol-Medium"] = "Helvetica"; - e["ItcSymbol-MediumItalic"] = "Helvetica-Oblique"; - e.LucidaConsole = "Courier"; - e["LucidaConsole-Bold"] = "Courier-Bold"; - e["LucidaConsole-BoldItalic"] = "Courier-BoldOblique"; - e["LucidaConsole-Italic"] = "Courier-Oblique"; - e["LucidaSans-Demi"] = "Helvetica-Bold"; - e["MS-Gothic"] = "MS Gothic"; - e["MS-Gothic-Bold"] = "MS Gothic-Bold"; - e["MS-Gothic-BoldItalic"] = "MS Gothic-BoldItalic"; - e["MS-Gothic-Italic"] = "MS Gothic-Italic"; - e["MS-Mincho"] = "MS Mincho"; - e["MS-Mincho-Bold"] = "MS Mincho-Bold"; - e["MS-Mincho-BoldItalic"] = "MS Mincho-BoldItalic"; - e["MS-Mincho-Italic"] = "MS Mincho-Italic"; - e["MS-PGothic"] = "MS PGothic"; - e["MS-PGothic-Bold"] = "MS PGothic-Bold"; - e["MS-PGothic-BoldItalic"] = "MS PGothic-BoldItalic"; - e["MS-PGothic-Italic"] = "MS PGothic-Italic"; - e["MS-PMincho"] = "MS PMincho"; - e["MS-PMincho-Bold"] = "MS PMincho-Bold"; - e["MS-PMincho-BoldItalic"] = "MS PMincho-BoldItalic"; - e["MS-PMincho-Italic"] = "MS PMincho-Italic"; - e.NuptialScript = "Times-Italic"; - e.SegoeUISymbol = "Helvetica"; - }), - Xi = getLookupTableFactory(function (e) { - e["Adobe Jenson"] = !0; - e["Adobe Text"] = !0; - e.Albertus = !0; - e.Aldus = !0; - e.Alexandria = !0; - e.Algerian = !0; - e["American Typewriter"] = !0; - e.Antiqua = !0; - e.Apex = !0; - e.Arno = !0; - e.Aster = !0; - e.Aurora = !0; - e.Baskerville = !0; - e.Bell = !0; - e.Bembo = !0; - e["Bembo Schoolbook"] = !0; - e.Benguiat = !0; - e["Berkeley Old Style"] = !0; - e["Bernhard Modern"] = !0; - e["Berthold City"] = !0; - e.Bodoni = !0; - e["Bauer Bodoni"] = !0; - e["Book Antiqua"] = !0; - e.Bookman = !0; - e["Bordeaux Roman"] = !0; - e["Californian FB"] = !0; - e.Calisto = !0; - e.Calvert = !0; - e.Capitals = !0; - e.Cambria = !0; - e.Cartier = !0; - e.Caslon = !0; - e.Catull = !0; - e.Centaur = !0; - e["Century Old Style"] = !0; - e["Century Schoolbook"] = !0; - e.Chaparral = !0; - e["Charis SIL"] = !0; - e.Cheltenham = !0; - e["Cholla Slab"] = !0; - e.Clarendon = !0; - e.Clearface = !0; - e.Cochin = !0; - e.Colonna = !0; - e["Computer Modern"] = !0; - e["Concrete Roman"] = !0; - e.Constantia = !0; - e["Cooper Black"] = !0; - e.Corona = !0; - e.Ecotype = !0; - e.Egyptienne = !0; - e.Elephant = !0; - e.Excelsior = !0; - e.Fairfield = !0; - e["FF Scala"] = !0; - e.Folkard = !0; - e.Footlight = !0; - e.FreeSerif = !0; - e["Friz Quadrata"] = !0; - e.Garamond = !0; - e.Gentium = !0; - e.Georgia = !0; - e.Gloucester = !0; - e["Goudy Old Style"] = !0; - e["Goudy Schoolbook"] = !0; - e["Goudy Pro Font"] = !0; - e.Granjon = !0; - e["Guardian Egyptian"] = !0; - e.Heather = !0; - e.Hercules = !0; - e["High Tower Text"] = !0; - e.Hiroshige = !0; - e["Hoefler Text"] = !0; - e["Humana Serif"] = !0; - e.Imprint = !0; - e["Ionic No. 5"] = !0; - e.Janson = !0; - e.Joanna = !0; - e.Korinna = !0; - e.Lexicon = !0; - e.LiberationSerif = !0; - e["Liberation Serif"] = !0; - e["Linux Libertine"] = !0; - e.Literaturnaya = !0; - e.Lucida = !0; - e["Lucida Bright"] = !0; - e.Melior = !0; - e.Memphis = !0; - e.Miller = !0; - e.Minion = !0; - e.Modern = !0; - e["Mona Lisa"] = !0; - e["Mrs Eaves"] = !0; - e["MS Serif"] = !0; - e["Museo Slab"] = !0; - e["New York"] = !0; - e["Nimbus Roman"] = !0; - e["NPS Rawlinson Roadway"] = !0; - e.NuptialScript = !0; - e.Palatino = !0; - e.Perpetua = !0; - e.Plantin = !0; - e["Plantin Schoolbook"] = !0; - e.Playbill = !0; - e["Poor Richard"] = !0; - e["Rawlinson Roadway"] = !0; - e.Renault = !0; - e.Requiem = !0; - e.Rockwell = !0; - e.Roman = !0; - e["Rotis Serif"] = !0; - e.Sabon = !0; - e.Scala = !0; - e.Seagull = !0; - e.Sistina = !0; - e.Souvenir = !0; - e.STIX = !0; - e["Stone Informal"] = !0; - e["Stone Serif"] = !0; - e.Sylfaen = !0; - e.Times = !0; - e.Trajan = !0; - e["Trinité"] = !0; - e["Trump Mediaeval"] = !0; - e.Utopia = !0; - e["Vale Type"] = !0; - e["Bitstream Vera"] = !0; - e["Vera Serif"] = !0; - e.Versailles = !0; - e.Wanted = !0; - e.Weiss = !0; - e["Wide Latin"] = !0; - e.Windsor = !0; - e.XITS = !0; - }), - Zi = getLookupTableFactory(function (e) { - e.Dingbats = !0; - e.Symbol = !0; - e.ZapfDingbats = !0; - e.Wingdings = !0; - e["Wingdings-Bold"] = !0; - e["Wingdings-Regular"] = !0; - }), - Vi = getLookupTableFactory(function (e) { - e[2] = 10; - e[3] = 32; - e[4] = 33; - e[5] = 34; - e[6] = 35; - e[7] = 36; - e[8] = 37; - e[9] = 38; - e[10] = 39; - e[11] = 40; - e[12] = 41; - e[13] = 42; - e[14] = 43; - e[15] = 44; - e[16] = 45; - e[17] = 46; - e[18] = 47; - e[19] = 48; - e[20] = 49; - e[21] = 50; - e[22] = 51; - e[23] = 52; - e[24] = 53; - e[25] = 54; - e[26] = 55; - e[27] = 56; - e[28] = 57; - e[29] = 58; - e[30] = 894; - e[31] = 60; - e[32] = 61; - e[33] = 62; - e[34] = 63; - e[35] = 64; - e[36] = 65; - e[37] = 66; - e[38] = 67; - e[39] = 68; - e[40] = 69; - e[41] = 70; - e[42] = 71; - e[43] = 72; - e[44] = 73; - e[45] = 74; - e[46] = 75; - e[47] = 76; - e[48] = 77; - e[49] = 78; - e[50] = 79; - e[51] = 80; - e[52] = 81; - e[53] = 82; - e[54] = 83; - e[55] = 84; - e[56] = 85; - e[57] = 86; - e[58] = 87; - e[59] = 88; - e[60] = 89; - e[61] = 90; - e[62] = 91; - e[63] = 92; - e[64] = 93; - e[65] = 94; - e[66] = 95; - e[67] = 96; - e[68] = 97; - e[69] = 98; - e[70] = 99; - e[71] = 100; - e[72] = 101; - e[73] = 102; - e[74] = 103; - e[75] = 104; - e[76] = 105; - e[77] = 106; - e[78] = 107; - e[79] = 108; - e[80] = 109; - e[81] = 110; - e[82] = 111; - e[83] = 112; - e[84] = 113; - e[85] = 114; - e[86] = 115; - e[87] = 116; - e[88] = 117; - e[89] = 118; - e[90] = 119; - e[91] = 120; - e[92] = 121; - e[93] = 122; - e[94] = 123; - e[95] = 124; - e[96] = 125; - e[97] = 126; - e[98] = 196; - e[99] = 197; - e[100] = 199; - e[101] = 201; - e[102] = 209; - e[103] = 214; - e[104] = 220; - e[105] = 225; - e[106] = 224; - e[107] = 226; - e[108] = 228; - e[109] = 227; - e[110] = 229; - e[111] = 231; - e[112] = 233; - e[113] = 232; - e[114] = 234; - e[115] = 235; - e[116] = 237; - e[117] = 236; - e[118] = 238; - e[119] = 239; - e[120] = 241; - e[121] = 243; - e[122] = 242; - e[123] = 244; - e[124] = 246; - e[125] = 245; - e[126] = 250; - e[127] = 249; - e[128] = 251; - e[129] = 252; - e[130] = 8224; - e[131] = 176; - e[132] = 162; - e[133] = 163; - e[134] = 167; - e[135] = 8226; - e[136] = 182; - e[137] = 223; - e[138] = 174; - e[139] = 169; - e[140] = 8482; - e[141] = 180; - e[142] = 168; - e[143] = 8800; - e[144] = 198; - e[145] = 216; - e[146] = 8734; - e[147] = 177; - e[148] = 8804; - e[149] = 8805; - e[150] = 165; - e[151] = 181; - e[152] = 8706; - e[153] = 8721; - e[154] = 8719; - e[156] = 8747; - e[157] = 170; - e[158] = 186; - e[159] = 8486; - e[160] = 230; - e[161] = 248; - e[162] = 191; - e[163] = 161; - e[164] = 172; - e[165] = 8730; - e[166] = 402; - e[167] = 8776; - e[168] = 8710; - e[169] = 171; - e[170] = 187; - e[171] = 8230; - e[179] = 8220; - e[180] = 8221; - e[181] = 8216; - e[182] = 8217; - e[200] = 193; - e[203] = 205; - e[207] = 211; - e[210] = 218; - e[223] = 711; - e[224] = 321; - e[225] = 322; - e[226] = 352; - e[227] = 353; - e[228] = 381; - e[229] = 382; - e[233] = 221; - e[234] = 253; - e[252] = 263; - e[253] = 268; - e[254] = 269; - e[258] = 258; - e[260] = 260; - e[261] = 261; - e[265] = 280; - e[266] = 281; - e[267] = 282; - e[268] = 283; - e[269] = 313; - e[275] = 323; - e[276] = 324; - e[278] = 328; - e[283] = 344; - e[284] = 345; - e[285] = 346; - e[286] = 347; - e[292] = 367; - e[295] = 377; - e[296] = 378; - e[298] = 380; - e[305] = 963; - e[306] = 964; - e[307] = 966; - e[308] = 8215; - e[309] = 8252; - e[310] = 8319; - e[311] = 8359; - e[312] = 8592; - e[313] = 8593; - e[337] = 9552; - e[493] = 1039; - e[494] = 1040; - e[672] = 1488; - e[673] = 1489; - e[674] = 1490; - e[675] = 1491; - e[676] = 1492; - e[677] = 1493; - e[678] = 1494; - e[679] = 1495; - e[680] = 1496; - e[681] = 1497; - e[682] = 1498; - e[683] = 1499; - e[684] = 1500; - e[685] = 1501; - e[686] = 1502; - e[687] = 1503; - e[688] = 1504; - e[689] = 1505; - e[690] = 1506; - e[691] = 1507; - e[692] = 1508; - e[693] = 1509; - e[694] = 1510; - e[695] = 1511; - e[696] = 1512; - e[697] = 1513; - e[698] = 1514; - e[705] = 1524; - e[706] = 8362; - e[710] = 64288; - e[711] = 64298; - e[759] = 1617; - e[761] = 1776; - e[763] = 1778; - e[775] = 1652; - e[777] = 1764; - e[778] = 1780; - e[779] = 1781; - e[780] = 1782; - e[782] = 771; - e[783] = 64726; - e[786] = 8363; - e[788] = 8532; - e[790] = 768; - e[791] = 769; - e[792] = 768; - e[795] = 803; - e[797] = 64336; - e[798] = 64337; - e[799] = 64342; - e[800] = 64343; - e[801] = 64344; - e[802] = 64345; - e[803] = 64362; - e[804] = 64363; - e[805] = 64364; - e[2424] = 7821; - e[2425] = 7822; - e[2426] = 7823; - e[2427] = 7824; - e[2428] = 7825; - e[2429] = 7826; - e[2430] = 7827; - e[2433] = 7682; - e[2678] = 8045; - e[2679] = 8046; - e[2830] = 1552; - e[2838] = 686; - e[2840] = 751; - e[2842] = 753; - e[2843] = 754; - e[2844] = 755; - e[2846] = 757; - e[2856] = 767; - e[2857] = 848; - e[2858] = 849; - e[2862] = 853; - e[2863] = 854; - e[2864] = 855; - e[2865] = 861; - e[2866] = 862; - e[2906] = 7460; - e[2908] = 7462; - e[2909] = 7463; - e[2910] = 7464; - e[2912] = 7466; - e[2913] = 7467; - e[2914] = 7468; - e[2916] = 7470; - e[2917] = 7471; - e[2918] = 7472; - e[2920] = 7474; - e[2921] = 7475; - e[2922] = 7476; - e[2924] = 7478; - e[2925] = 7479; - e[2926] = 7480; - e[2928] = 7482; - e[2929] = 7483; - e[2930] = 7484; - e[2932] = 7486; - e[2933] = 7487; - e[2934] = 7488; - e[2936] = 7490; - e[2937] = 7491; - e[2938] = 7492; - e[2940] = 7494; - e[2941] = 7495; - e[2942] = 7496; - e[2944] = 7498; - e[2946] = 7500; - e[2948] = 7502; - e[2950] = 7504; - e[2951] = 7505; - e[2952] = 7506; - e[2954] = 7508; - e[2955] = 7509; - e[2956] = 7510; - e[2958] = 7512; - e[2959] = 7513; - e[2960] = 7514; - e[2962] = 7516; - e[2963] = 7517; - e[2964] = 7518; - e[2966] = 7520; - e[2967] = 7521; - e[2968] = 7522; - e[2970] = 7524; - e[2971] = 7525; - e[2972] = 7526; - e[2974] = 7528; - e[2975] = 7529; - e[2976] = 7530; - e[2978] = 1537; - e[2979] = 1538; - e[2980] = 1539; - e[2982] = 1549; - e[2983] = 1551; - e[2984] = 1552; - e[2986] = 1554; - e[2987] = 1555; - e[2988] = 1556; - e[2990] = 1623; - e[2991] = 1624; - e[2995] = 1775; - e[2999] = 1791; - e[3002] = 64290; - e[3003] = 64291; - e[3004] = 64292; - e[3006] = 64294; - e[3007] = 64295; - e[3008] = 64296; - e[3011] = 1900; - e[3014] = 8223; - e[3015] = 8244; - e[3017] = 7532; - e[3018] = 7533; - e[3019] = 7534; - e[3075] = 7590; - e[3076] = 7591; - e[3079] = 7594; - e[3080] = 7595; - e[3083] = 7598; - e[3084] = 7599; - e[3087] = 7602; - e[3088] = 7603; - e[3091] = 7606; - e[3092] = 7607; - e[3095] = 7610; - e[3096] = 7611; - e[3099] = 7614; - e[3100] = 7615; - e[3103] = 7618; - e[3104] = 7619; - e[3107] = 8337; - e[3108] = 8338; - e[3116] = 1884; - e[3119] = 1885; - e[3120] = 1885; - e[3123] = 1886; - e[3124] = 1886; - e[3127] = 1887; - e[3128] = 1887; - e[3131] = 1888; - e[3132] = 1888; - e[3135] = 1889; - e[3136] = 1889; - e[3139] = 1890; - e[3140] = 1890; - e[3143] = 1891; - e[3144] = 1891; - e[3147] = 1892; - e[3148] = 1892; - e[3153] = 580; - e[3154] = 581; - e[3157] = 584; - e[3158] = 585; - e[3161] = 588; - e[3162] = 589; - e[3165] = 891; - e[3166] = 892; - e[3169] = 1274; - e[3170] = 1275; - e[3173] = 1278; - e[3174] = 1279; - e[3181] = 7622; - e[3182] = 7623; - e[3282] = 11799; - e[3316] = 578; - e[3379] = 42785; - e[3393] = 1159; - e[3416] = 8377; - }), - zi = getLookupTableFactory(function (e) { - e[227] = 322; - e[264] = 261; - e[291] = 346; - }), - _i = getLookupTableFactory(function (e) { - e[1] = 32; - e[4] = 65; - e[5] = 192; - e[6] = 193; - e[9] = 196; - e[17] = 66; - e[18] = 67; - e[21] = 268; - e[24] = 68; - e[28] = 69; - e[29] = 200; - e[30] = 201; - e[32] = 282; - e[38] = 70; - e[39] = 71; - e[44] = 72; - e[47] = 73; - e[48] = 204; - e[49] = 205; - e[58] = 74; - e[60] = 75; - e[62] = 76; - e[68] = 77; - e[69] = 78; - e[75] = 79; - e[76] = 210; - e[80] = 214; - e[87] = 80; - e[89] = 81; - e[90] = 82; - e[92] = 344; - e[94] = 83; - e[97] = 352; - e[100] = 84; - e[104] = 85; - e[109] = 220; - e[115] = 86; - e[116] = 87; - e[121] = 88; - e[122] = 89; - e[124] = 221; - e[127] = 90; - e[129] = 381; - e[258] = 97; - e[259] = 224; - e[260] = 225; - e[263] = 228; - e[268] = 261; - e[271] = 98; - e[272] = 99; - e[273] = 263; - e[275] = 269; - e[282] = 100; - e[286] = 101; - e[287] = 232; - e[288] = 233; - e[290] = 283; - e[295] = 281; - e[296] = 102; - e[336] = 103; - e[346] = 104; - e[349] = 105; - e[350] = 236; - e[351] = 237; - e[361] = 106; - e[364] = 107; - e[367] = 108; - e[371] = 322; - e[373] = 109; - e[374] = 110; - e[381] = 111; - e[382] = 242; - e[383] = 243; - e[386] = 246; - e[393] = 112; - e[395] = 113; - e[396] = 114; - e[398] = 345; - e[400] = 115; - e[401] = 347; - e[403] = 353; - e[410] = 116; - e[437] = 117; - e[442] = 252; - e[448] = 118; - e[449] = 119; - e[454] = 120; - e[455] = 121; - e[457] = 253; - e[460] = 122; - e[462] = 382; - e[463] = 380; - e[853] = 44; - e[855] = 58; - e[856] = 46; - e[876] = 47; - e[878] = 45; - e[882] = 45; - e[894] = 40; - e[895] = 41; - e[896] = 91; - e[897] = 93; - e[923] = 64; - e[1004] = 48; - e[1005] = 49; - e[1006] = 50; - e[1007] = 51; - e[1008] = 52; - e[1009] = 53; - e[1010] = 54; - e[1011] = 55; - e[1012] = 56; - e[1013] = 57; - e[1081] = 37; - e[1085] = 43; - e[1086] = 45; - }); -function getStandardFontName(e) { - const t = normalizeFontName(e); - return Pi()[t]; +const UnicodeRanges = [ + [0x0000, 0x007f], + [0x0080, 0x00ff], + [0x0100, 0x017f], + [0x0180, 0x024f], + [0x0250, 0x02af, 0x1d00, 0x1d7f, 0x1d80, 0x1dbf], + [0x02b0, 0x02ff, 0xa700, 0xa71f], + [0x0300, 0x036f, 0x1dc0, 0x1dff], + [0x0370, 0x03ff], + [0x2c80, 0x2cff], + [0x0400, 0x04ff, 0x0500, 0x052f, 0x2de0, 0x2dff, 0xa640, 0xa69f], + [0x0530, 0x058f], + [0x0590, 0x05ff], + [0xa500, 0xa63f], + [0x0600, 0x06ff, 0x0750, 0x077f], + [0x07c0, 0x07ff], + [0x0900, 0x097f], + [0x0980, 0x09ff], + [0x0a00, 0x0a7f], + [0x0a80, 0x0aff], + [0x0b00, 0x0b7f], + [0x0b80, 0x0bff], + [0x0c00, 0x0c7f], + [0x0c80, 0x0cff], + [0x0d00, 0x0d7f], + [0x0e00, 0x0e7f], + [0x0e80, 0x0eff], + [0x10a0, 0x10ff, 0x2d00, 0x2d2f], + [0x1b00, 0x1b7f], + [0x1100, 0x11ff], + [0x1e00, 0x1eff, 0x2c60, 0x2c7f, 0xa720, 0xa7ff], + [0x1f00, 0x1fff], + [0x2000, 0x206f, 0x2e00, 0x2e7f], + [0x2070, 0x209f], + [0x20a0, 0x20cf], + [0x20d0, 0x20ff], + [0x2100, 0x214f], + [0x2150, 0x218f], + [0x2190, 0x21ff, 0x27f0, 0x27ff, 0x2900, 0x297f, 0x2b00, 0x2bff], + [0x2200, 0x22ff, 0x2a00, 0x2aff, 0x27c0, 0x27ef, 0x2980, 0x29ff], + [0x2300, 0x23ff], + [0x2400, 0x243f], + [0x2440, 0x245f], + [0x2460, 0x24ff], + [0x2500, 0x257f], + [0x2580, 0x259f], + [0x25a0, 0x25ff], + [0x2600, 0x26ff], + [0x2700, 0x27bf], + [0x3000, 0x303f], + [0x3040, 0x309f], + [0x30a0, 0x30ff, 0x31f0, 0x31ff], + [0x3100, 0x312f, 0x31a0, 0x31bf], + [0x3130, 0x318f], + [0xa840, 0xa87f], + [0x3200, 0x32ff], + [0x3300, 0x33ff], + [0xac00, 0xd7af], + [0xd800, 0xdfff], + [0x10900, 0x1091f], + [ + 0x4e00, 0x9fff, 0x2e80, 0x2eff, 0x2f00, 0x2fdf, 0x2ff0, 0x2fff, 0x3400, + 0x4dbf, 0x20000, 0x2a6df, 0x3190, 0x319f, + ], + [0xe000, 0xf8ff], + [0x31c0, 0x31ef, 0xf900, 0xfaff, 0x2f800, 0x2fa1f], + [0xfb00, 0xfb4f], + [0xfb50, 0xfdff], + [0xfe20, 0xfe2f], + [0xfe10, 0xfe1f], + [0xfe50, 0xfe6f], + [0xfe70, 0xfeff], + [0xff00, 0xffef], + [0xfff0, 0xffff], + [0x0f00, 0x0fff], + [0x0700, 0x074f], + [0x0780, 0x07bf], + [0x0d80, 0x0dff], + [0x1000, 0x109f], + [0x1200, 0x137f, 0x1380, 0x139f, 0x2d80, 0x2ddf], + [0x13a0, 0x13ff], + [0x1400, 0x167f], + [0x1680, 0x169f], + [0x16a0, 0x16ff], + [0x1780, 0x17ff], + [0x1800, 0x18af], + [0x2800, 0x28ff], + [0xa000, 0xa48f], + [0x1700, 0x171f, 0x1720, 0x173f, 0x1740, 0x175f, 0x1760, 0x177f], + [0x10300, 0x1032f], + [0x10330, 0x1034f], + [0x10400, 0x1044f], + [0x1d000, 0x1d0ff, 0x1d100, 0x1d1ff, 0x1d200, 0x1d24f], + [0x1d400, 0x1d7ff], + [0xff000, 0xffffd], + [0xfe00, 0xfe0f, 0xe0100, 0xe01ef], + [0xe0000, 0xe007f], + [0x1900, 0x194f], + [0x1950, 0x197f], + [0x1980, 0x19df], + [0x1a00, 0x1a1f], + [0x2c00, 0x2c5f], + [0x2d30, 0x2d7f], + [0x4dc0, 0x4dff], + [0xa800, 0xa82f], + [0x10000, 0x1007f, 0x10080, 0x100ff, 0x10100, 0x1013f], + [0x10140, 0x1018f], + [0x10380, 0x1039f], + [0x103a0, 0x103df], + [0x10450, 0x1047f], + [0x10480, 0x104af], + [0x10800, 0x1083f], + [0x10a00, 0x10a5f], + [0x1d300, 0x1d35f], + [0x12000, 0x123ff, 0x12400, 0x1247f], + [0x1d360, 0x1d37f], + [0x1b80, 0x1bbf], + [0x1c00, 0x1c4f], + [0x1c50, 0x1c7f], + [0xa880, 0xa8df], + [0xa900, 0xa92f], + [0xa930, 0xa95f], + [0xaa00, 0xaa5f], + [0x10190, 0x101cf], + [0x101d0, 0x101ff], + [0x102a0, 0x102df, 0x10280, 0x1029f, 0x10920, 0x1093f], + [0x1f030, 0x1f09f, 0x1f000, 0x1f02f], +]; +function getUnicodeRangeFor(value, lastPosition = -1) { + if (lastPosition !== -1) { + const range = UnicodeRanges[lastPosition]; + for (let i = 0, ii = range.length; i < ii; i += 2) { + if (value >= range[i] && value <= range[i + 1]) { + return lastPosition; + } + } + } + for (let i = 0, ii = UnicodeRanges.length; i < ii; i++) { + const range = UnicodeRanges[i]; + for (let j = 0, jj = range.length; j < jj; j += 2) { + if (value >= range[j] && value <= range[j + 1]) { + return i; + } + } + } + return -1; } -function isKnownFontName(e) { - const t = normalizeFontName(e); - return !!(Pi()[t] || ji()[t] || Xi()[t] || Zi()[t]); +const SpecialCharRegExp = new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$", "u"); +const CategoryCache = new Map(); +function getCharUnicodeCategory(char) { + const cachedCategory = CategoryCache.get(char); + if (cachedCategory) { + return cachedCategory; + } + const groups = char.match(SpecialCharRegExp); + const category = { + isWhitespace: !!groups?.[1], + isZeroWidthDiacritic: !!groups?.[2], + isInvisibleFormatMark: !!groups?.[3], + }; + CategoryCache.set(char, category); + return category; } +function clearUnicodeCaches() { + CategoryCache.clear(); +} // ./src/core/fonts_utils.js + +const SEAC_ANALYSIS_ENABLED = true; +const FontFlags = { + FixedPitch: 1, + Serif: 2, + Symbolic: 4, + Script: 8, + Nonsymbolic: 32, + Italic: 64, + AllCap: 65536, + SmallCap: 131072, + ForceBold: 262144, +}; +const MacStandardGlyphOrdering = [ + ".notdef", + ".null", + "nonmarkingreturn", + "space", + "exclam", + "quotedbl", + "numbersign", + "dollar", + "percent", + "ampersand", + "quotesingle", + "parenleft", + "parenright", + "asterisk", + "plus", + "comma", + "hyphen", + "period", + "slash", + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "colon", + "semicolon", + "less", + "equal", + "greater", + "question", + "at", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "bracketleft", + "backslash", + "bracketright", + "asciicircum", + "underscore", + "grave", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "braceleft", + "bar", + "braceright", + "asciitilde", + "Adieresis", + "Aring", + "Ccedilla", + "Eacute", + "Ntilde", + "Odieresis", + "Udieresis", + "aacute", + "agrave", + "acircumflex", + "adieresis", + "atilde", + "aring", + "ccedilla", + "eacute", + "egrave", + "ecircumflex", + "edieresis", + "iacute", + "igrave", + "icircumflex", + "idieresis", + "ntilde", + "oacute", + "ograve", + "ocircumflex", + "odieresis", + "otilde", + "uacute", + "ugrave", + "ucircumflex", + "udieresis", + "dagger", + "degree", + "cent", + "sterling", + "section", + "bullet", + "paragraph", + "germandbls", + "registered", + "copyright", + "trademark", + "acute", + "dieresis", + "notequal", + "AE", + "Oslash", + "infinity", + "plusminus", + "lessequal", + "greaterequal", + "yen", + "mu", + "partialdiff", + "summation", + "product", + "pi", + "integral", + "ordfeminine", + "ordmasculine", + "Omega", + "ae", + "oslash", + "questiondown", + "exclamdown", + "logicalnot", + "radical", + "florin", + "approxequal", + "Delta", + "guillemotleft", + "guillemotright", + "ellipsis", + "nonbreakingspace", + "Agrave", + "Atilde", + "Otilde", + "OE", + "oe", + "endash", + "emdash", + "quotedblleft", + "quotedblright", + "quoteleft", + "quoteright", + "divide", + "lozenge", + "ydieresis", + "Ydieresis", + "fraction", + "currency", + "guilsinglleft", + "guilsinglright", + "fi", + "fl", + "daggerdbl", + "periodcentered", + "quotesinglbase", + "quotedblbase", + "perthousand", + "Acircumflex", + "Ecircumflex", + "Aacute", + "Edieresis", + "Egrave", + "Iacute", + "Icircumflex", + "Idieresis", + "Igrave", + "Oacute", + "Ocircumflex", + "apple", + "Ograve", + "Uacute", + "Ucircumflex", + "Ugrave", + "dotlessi", + "circumflex", + "tilde", + "macron", + "breve", + "dotaccent", + "ring", + "cedilla", + "hungarumlaut", + "ogonek", + "caron", + "Lslash", + "lslash", + "Scaron", + "scaron", + "Zcaron", + "zcaron", + "brokenbar", + "Eth", + "eth", + "Yacute", + "yacute", + "Thorn", + "thorn", + "minus", + "multiply", + "onesuperior", + "twosuperior", + "threesuperior", + "onehalf", + "onequarter", + "threequarters", + "franc", + "Gbreve", + "gbreve", + "Idotaccent", + "Scedilla", + "scedilla", + "Cacute", + "cacute", + "Ccaron", + "ccaron", + "dcroat", +]; +function recoverGlyphName(name, glyphsUnicodeMap) { + if (glyphsUnicodeMap[name] !== undefined) { + return name; + } + const unicode = getUnicodeForGlyph(name, glyphsUnicodeMap); + if (unicode !== -1) { + for (const key in glyphsUnicodeMap) { + if (glyphsUnicodeMap[key] === unicode) { + return key; + } + } + } + info("Unable to recover a standard glyph name for: " + name); + return name; +} +function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) { + const charCodeToGlyphId = Object.create(null); + let glyphId, charCode, baseEncoding; + const isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); + if (properties.isInternalFont) { + baseEncoding = builtInEncoding; + for (charCode = 0; charCode < baseEncoding.length; charCode++) { + glyphId = glyphNames.indexOf(baseEncoding[charCode]); + charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; + } + } else if (properties.baseEncodingName) { + baseEncoding = getEncoding(properties.baseEncodingName); + for (charCode = 0; charCode < baseEncoding.length; charCode++) { + glyphId = glyphNames.indexOf(baseEncoding[charCode]); + charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; + } + } else if (isSymbolicFont) { + for (charCode in builtInEncoding) { + charCodeToGlyphId[charCode] = builtInEncoding[charCode]; + } + } else { + baseEncoding = StandardEncoding; + for (charCode = 0; charCode < baseEncoding.length; charCode++) { + glyphId = glyphNames.indexOf(baseEncoding[charCode]); + charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; + } + } + const differences = properties.differences; + let glyphsUnicodeMap; + if (differences) { + for (charCode in differences) { + const glyphName = differences[charCode]; + glyphId = glyphNames.indexOf(glyphName); + if (glyphId === -1) { + if (!glyphsUnicodeMap) { + glyphsUnicodeMap = getGlyphsUnicode(); + } + const standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); + if (standardGlyphName !== glyphName) { + glyphId = glyphNames.indexOf(standardGlyphName); + } + } + charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; + } + } + return charCodeToGlyphId; +} +function normalizeFontName(name) { + return name.replaceAll(/[,_]/g, "-").replaceAll(/\s/g, ""); +} +const getVerticalPresentationForm = getLookupTableFactory((t) => { + t[0x2013] = 0xfe32; + t[0x2014] = 0xfe31; + t[0x2025] = 0xfe30; + t[0x2026] = 0xfe19; + t[0x3001] = 0xfe11; + t[0x3002] = 0xfe12; + t[0x3008] = 0xfe3f; + t[0x3009] = 0xfe40; + t[0x300a] = 0xfe3d; + t[0x300b] = 0xfe3e; + t[0x300c] = 0xfe41; + t[0x300d] = 0xfe42; + t[0x300e] = 0xfe43; + t[0x300f] = 0xfe44; + t[0x3010] = 0xfe3b; + t[0x3011] = 0xfe3c; + t[0x3014] = 0xfe39; + t[0x3015] = 0xfe3a; + t[0x3016] = 0xfe17; + t[0x3017] = 0xfe18; + t[0xfe4f] = 0xfe34; + t[0xff01] = 0xfe15; + t[0xff08] = 0xfe35; + t[0xff09] = 0xfe36; + t[0xff0c] = 0xfe10; + t[0xff1a] = 0xfe13; + t[0xff1b] = 0xfe14; + t[0xff1f] = 0xfe16; + t[0xff3b] = 0xfe47; + t[0xff3d] = 0xfe48; + t[0xff3f] = 0xfe33; + t[0xff5b] = 0xfe37; + t[0xff5d] = 0xfe38; +}); // ./src/core/standard_fonts.js + +const getStdFontMap = getLookupTableFactory(function (t) { + t["Times-Roman"] = "Times-Roman"; + t.Helvetica = "Helvetica"; + t.Courier = "Courier"; + t.Symbol = "Symbol"; + t["Times-Bold"] = "Times-Bold"; + t["Helvetica-Bold"] = "Helvetica-Bold"; + t["Courier-Bold"] = "Courier-Bold"; + t.ZapfDingbats = "ZapfDingbats"; + t["Times-Italic"] = "Times-Italic"; + t["Helvetica-Oblique"] = "Helvetica-Oblique"; + t["Courier-Oblique"] = "Courier-Oblique"; + t["Times-BoldItalic"] = "Times-BoldItalic"; + t["Helvetica-BoldOblique"] = "Helvetica-BoldOblique"; + t["Courier-BoldOblique"] = "Courier-BoldOblique"; + t.ArialNarrow = "Helvetica"; + t["ArialNarrow-Bold"] = "Helvetica-Bold"; + t["ArialNarrow-BoldItalic"] = "Helvetica-BoldOblique"; + t["ArialNarrow-Italic"] = "Helvetica-Oblique"; + t.ArialBlack = "Helvetica"; + t["ArialBlack-Bold"] = "Helvetica-Bold"; + t["ArialBlack-BoldItalic"] = "Helvetica-BoldOblique"; + t["ArialBlack-Italic"] = "Helvetica-Oblique"; + t["Arial-Black"] = "Helvetica"; + t["Arial-Black-Bold"] = "Helvetica-Bold"; + t["Arial-Black-BoldItalic"] = "Helvetica-BoldOblique"; + t["Arial-Black-Italic"] = "Helvetica-Oblique"; + t.Arial = "Helvetica"; + t["Arial-Bold"] = "Helvetica-Bold"; + t["Arial-BoldItalic"] = "Helvetica-BoldOblique"; + t["Arial-Italic"] = "Helvetica-Oblique"; + t.ArialMT = "Helvetica"; + t["Arial-BoldItalicMT"] = "Helvetica-BoldOblique"; + t["Arial-BoldMT"] = "Helvetica-Bold"; + t["Arial-ItalicMT"] = "Helvetica-Oblique"; + t["Arial-BoldItalicMT-BoldItalic"] = "Helvetica-BoldOblique"; + t["Arial-BoldMT-Bold"] = "Helvetica-Bold"; + t["Arial-ItalicMT-Italic"] = "Helvetica-Oblique"; + t.ArialUnicodeMS = "Helvetica"; + t["ArialUnicodeMS-Bold"] = "Helvetica-Bold"; + t["ArialUnicodeMS-BoldItalic"] = "Helvetica-BoldOblique"; + t["ArialUnicodeMS-Italic"] = "Helvetica-Oblique"; + t["Courier-BoldItalic"] = "Courier-BoldOblique"; + t["Courier-Italic"] = "Courier-Oblique"; + t.CourierNew = "Courier"; + t["CourierNew-Bold"] = "Courier-Bold"; + t["CourierNew-BoldItalic"] = "Courier-BoldOblique"; + t["CourierNew-Italic"] = "Courier-Oblique"; + t["CourierNewPS-BoldItalicMT"] = "Courier-BoldOblique"; + t["CourierNewPS-BoldMT"] = "Courier-Bold"; + t["CourierNewPS-ItalicMT"] = "Courier-Oblique"; + t.CourierNewPSMT = "Courier"; + t["Helvetica-BoldItalic"] = "Helvetica-BoldOblique"; + t["Helvetica-Italic"] = "Helvetica-Oblique"; + t["Symbol-Bold"] = "Symbol"; + t["Symbol-BoldItalic"] = "Symbol"; + t["Symbol-Italic"] = "Symbol"; + t.TimesNewRoman = "Times-Roman"; + t["TimesNewRoman-Bold"] = "Times-Bold"; + t["TimesNewRoman-BoldItalic"] = "Times-BoldItalic"; + t["TimesNewRoman-Italic"] = "Times-Italic"; + t.TimesNewRomanPS = "Times-Roman"; + t["TimesNewRomanPS-Bold"] = "Times-Bold"; + t["TimesNewRomanPS-BoldItalic"] = "Times-BoldItalic"; + t["TimesNewRomanPS-BoldItalicMT"] = "Times-BoldItalic"; + t["TimesNewRomanPS-BoldMT"] = "Times-Bold"; + t["TimesNewRomanPS-Italic"] = "Times-Italic"; + t["TimesNewRomanPS-ItalicMT"] = "Times-Italic"; + t.TimesNewRomanPSMT = "Times-Roman"; + t["TimesNewRomanPSMT-Bold"] = "Times-Bold"; + t["TimesNewRomanPSMT-BoldItalic"] = "Times-BoldItalic"; + t["TimesNewRomanPSMT-Italic"] = "Times-Italic"; +}); +const getFontNameToFileMap = getLookupTableFactory(function (t) { + t.Courier = "FoxitFixed.pfb"; + t["Courier-Bold"] = "FoxitFixedBold.pfb"; + t["Courier-BoldOblique"] = "FoxitFixedBoldItalic.pfb"; + t["Courier-Oblique"] = "FoxitFixedItalic.pfb"; + t.Helvetica = "LiberationSans-Regular.ttf"; + t["Helvetica-Bold"] = "LiberationSans-Bold.ttf"; + t["Helvetica-BoldOblique"] = "LiberationSans-BoldItalic.ttf"; + t["Helvetica-Oblique"] = "LiberationSans-Italic.ttf"; + t["Times-Roman"] = "FoxitSerif.pfb"; + t["Times-Bold"] = "FoxitSerifBold.pfb"; + t["Times-BoldItalic"] = "FoxitSerifBoldItalic.pfb"; + t["Times-Italic"] = "FoxitSerifItalic.pfb"; + t.Symbol = "FoxitSymbol.pfb"; + t.ZapfDingbats = "FoxitDingbats.pfb"; + t["LiberationSans-Regular"] = "LiberationSans-Regular.ttf"; + t["LiberationSans-Bold"] = "LiberationSans-Bold.ttf"; + t["LiberationSans-Italic"] = "LiberationSans-Italic.ttf"; + t["LiberationSans-BoldItalic"] = "LiberationSans-BoldItalic.ttf"; +}); +const getNonStdFontMap = getLookupTableFactory(function (t) { + t.Calibri = "Helvetica"; + t["Calibri-Bold"] = "Helvetica-Bold"; + t["Calibri-BoldItalic"] = "Helvetica-BoldOblique"; + t["Calibri-Italic"] = "Helvetica-Oblique"; + t.CenturyGothic = "Helvetica"; + t["CenturyGothic-Bold"] = "Helvetica-Bold"; + t["CenturyGothic-BoldItalic"] = "Helvetica-BoldOblique"; + t["CenturyGothic-Italic"] = "Helvetica-Oblique"; + t.ComicSansMS = "Comic Sans MS"; + t["ComicSansMS-Bold"] = "Comic Sans MS-Bold"; + t["ComicSansMS-BoldItalic"] = "Comic Sans MS-BoldItalic"; + t["ComicSansMS-Italic"] = "Comic Sans MS-Italic"; + t.GillSansMT = "Helvetica"; + t["GillSansMT-Bold"] = "Helvetica-Bold"; + t["GillSansMT-BoldItalic"] = "Helvetica-BoldOblique"; + t["GillSansMT-Italic"] = "Helvetica-Oblique"; + t.Impact = "Helvetica"; + t["ItcSymbol-Bold"] = "Helvetica-Bold"; + t["ItcSymbol-BoldItalic"] = "Helvetica-BoldOblique"; + t["ItcSymbol-Book"] = "Helvetica"; + t["ItcSymbol-BookItalic"] = "Helvetica-Oblique"; + t["ItcSymbol-Medium"] = "Helvetica"; + t["ItcSymbol-MediumItalic"] = "Helvetica-Oblique"; + t.LucidaConsole = "Courier"; + t["LucidaConsole-Bold"] = "Courier-Bold"; + t["LucidaConsole-BoldItalic"] = "Courier-BoldOblique"; + t["LucidaConsole-Italic"] = "Courier-Oblique"; + t["LucidaSans-Demi"] = "Helvetica-Bold"; + t["MS-Gothic"] = "MS Gothic"; + t["MS-Gothic-Bold"] = "MS Gothic-Bold"; + t["MS-Gothic-BoldItalic"] = "MS Gothic-BoldItalic"; + t["MS-Gothic-Italic"] = "MS Gothic-Italic"; + t["MS-Mincho"] = "MS Mincho"; + t["MS-Mincho-Bold"] = "MS Mincho-Bold"; + t["MS-Mincho-BoldItalic"] = "MS Mincho-BoldItalic"; + t["MS-Mincho-Italic"] = "MS Mincho-Italic"; + t["MS-PGothic"] = "MS PGothic"; + t["MS-PGothic-Bold"] = "MS PGothic-Bold"; + t["MS-PGothic-BoldItalic"] = "MS PGothic-BoldItalic"; + t["MS-PGothic-Italic"] = "MS PGothic-Italic"; + t["MS-PMincho"] = "MS PMincho"; + t["MS-PMincho-Bold"] = "MS PMincho-Bold"; + t["MS-PMincho-BoldItalic"] = "MS PMincho-BoldItalic"; + t["MS-PMincho-Italic"] = "MS PMincho-Italic"; + t.NuptialScript = "Times-Italic"; + t.SegoeUISymbol = "Helvetica"; +}); +const getSerifFonts = getLookupTableFactory(function (t) { + t["Adobe Jenson"] = true; + t["Adobe Text"] = true; + t.Albertus = true; + t.Aldus = true; + t.Alexandria = true; + t.Algerian = true; + t["American Typewriter"] = true; + t.Antiqua = true; + t.Apex = true; + t.Arno = true; + t.Aster = true; + t.Aurora = true; + t.Baskerville = true; + t.Bell = true; + t.Bembo = true; + t["Bembo Schoolbook"] = true; + t.Benguiat = true; + t["Berkeley Old Style"] = true; + t["Bernhard Modern"] = true; + t["Berthold City"] = true; + t.Bodoni = true; + t["Bauer Bodoni"] = true; + t["Book Antiqua"] = true; + t.Bookman = true; + t["Bordeaux Roman"] = true; + t["Californian FB"] = true; + t.Calisto = true; + t.Calvert = true; + t.Capitals = true; + t.Cambria = true; + t.Cartier = true; + t.Caslon = true; + t.Catull = true; + t.Centaur = true; + t["Century Old Style"] = true; + t["Century Schoolbook"] = true; + t.Chaparral = true; + t["Charis SIL"] = true; + t.Cheltenham = true; + t["Cholla Slab"] = true; + t.Clarendon = true; + t.Clearface = true; + t.Cochin = true; + t.Colonna = true; + t["Computer Modern"] = true; + t["Concrete Roman"] = true; + t.Constantia = true; + t["Cooper Black"] = true; + t.Corona = true; + t.Ecotype = true; + t.Egyptienne = true; + t.Elephant = true; + t.Excelsior = true; + t.Fairfield = true; + t["FF Scala"] = true; + t.Folkard = true; + t.Footlight = true; + t.FreeSerif = true; + t["Friz Quadrata"] = true; + t.Garamond = true; + t.Gentium = true; + t.Georgia = true; + t.Gloucester = true; + t["Goudy Old Style"] = true; + t["Goudy Schoolbook"] = true; + t["Goudy Pro Font"] = true; + t.Granjon = true; + t["Guardian Egyptian"] = true; + t.Heather = true; + t.Hercules = true; + t["High Tower Text"] = true; + t.Hiroshige = true; + t["Hoefler Text"] = true; + t["Humana Serif"] = true; + t.Imprint = true; + t["Ionic No. 5"] = true; + t.Janson = true; + t.Joanna = true; + t.Korinna = true; + t.Lexicon = true; + t.LiberationSerif = true; + t["Liberation Serif"] = true; + t["Linux Libertine"] = true; + t.Literaturnaya = true; + t.Lucida = true; + t["Lucida Bright"] = true; + t.Melior = true; + t.Memphis = true; + t.Miller = true; + t.Minion = true; + t.Modern = true; + t["Mona Lisa"] = true; + t["Mrs Eaves"] = true; + t["MS Serif"] = true; + t["Museo Slab"] = true; + t["New York"] = true; + t["Nimbus Roman"] = true; + t["NPS Rawlinson Roadway"] = true; + t.NuptialScript = true; + t.Palatino = true; + t.Perpetua = true; + t.Plantin = true; + t["Plantin Schoolbook"] = true; + t.Playbill = true; + t["Poor Richard"] = true; + t["Rawlinson Roadway"] = true; + t.Renault = true; + t.Requiem = true; + t.Rockwell = true; + t.Roman = true; + t["Rotis Serif"] = true; + t.Sabon = true; + t.Scala = true; + t.Seagull = true; + t.Sistina = true; + t.Souvenir = true; + t.STIX = true; + t["Stone Informal"] = true; + t["Stone Serif"] = true; + t.Sylfaen = true; + t.Times = true; + t.Trajan = true; + t["Trinité"] = true; + t["Trump Mediaeval"] = true; + t.Utopia = true; + t["Vale Type"] = true; + t["Bitstream Vera"] = true; + t["Vera Serif"] = true; + t.Versailles = true; + t.Wanted = true; + t.Weiss = true; + t["Wide Latin"] = true; + t.Windsor = true; + t.XITS = true; +}); +const getSymbolsFonts = getLookupTableFactory(function (t) { + t.Dingbats = true; + t.Symbol = true; + t.ZapfDingbats = true; + t.Wingdings = true; + t["Wingdings-Bold"] = true; + t["Wingdings-Regular"] = true; +}); +const getGlyphMapForStandardFonts = getLookupTableFactory(function (t) { + t[2] = 10; + t[3] = 32; + t[4] = 33; + t[5] = 34; + t[6] = 35; + t[7] = 36; + t[8] = 37; + t[9] = 38; + t[10] = 39; + t[11] = 40; + t[12] = 41; + t[13] = 42; + t[14] = 43; + t[15] = 44; + t[16] = 45; + t[17] = 46; + t[18] = 47; + t[19] = 48; + t[20] = 49; + t[21] = 50; + t[22] = 51; + t[23] = 52; + t[24] = 53; + t[25] = 54; + t[26] = 55; + t[27] = 56; + t[28] = 57; + t[29] = 58; + t[30] = 894; + t[31] = 60; + t[32] = 61; + t[33] = 62; + t[34] = 63; + t[35] = 64; + t[36] = 65; + t[37] = 66; + t[38] = 67; + t[39] = 68; + t[40] = 69; + t[41] = 70; + t[42] = 71; + t[43] = 72; + t[44] = 73; + t[45] = 74; + t[46] = 75; + t[47] = 76; + t[48] = 77; + t[49] = 78; + t[50] = 79; + t[51] = 80; + t[52] = 81; + t[53] = 82; + t[54] = 83; + t[55] = 84; + t[56] = 85; + t[57] = 86; + t[58] = 87; + t[59] = 88; + t[60] = 89; + t[61] = 90; + t[62] = 91; + t[63] = 92; + t[64] = 93; + t[65] = 94; + t[66] = 95; + t[67] = 96; + t[68] = 97; + t[69] = 98; + t[70] = 99; + t[71] = 100; + t[72] = 101; + t[73] = 102; + t[74] = 103; + t[75] = 104; + t[76] = 105; + t[77] = 106; + t[78] = 107; + t[79] = 108; + t[80] = 109; + t[81] = 110; + t[82] = 111; + t[83] = 112; + t[84] = 113; + t[85] = 114; + t[86] = 115; + t[87] = 116; + t[88] = 117; + t[89] = 118; + t[90] = 119; + t[91] = 120; + t[92] = 121; + t[93] = 122; + t[94] = 123; + t[95] = 124; + t[96] = 125; + t[97] = 126; + t[98] = 196; + t[99] = 197; + t[100] = 199; + t[101] = 201; + t[102] = 209; + t[103] = 214; + t[104] = 220; + t[105] = 225; + t[106] = 224; + t[107] = 226; + t[108] = 228; + t[109] = 227; + t[110] = 229; + t[111] = 231; + t[112] = 233; + t[113] = 232; + t[114] = 234; + t[115] = 235; + t[116] = 237; + t[117] = 236; + t[118] = 238; + t[119] = 239; + t[120] = 241; + t[121] = 243; + t[122] = 242; + t[123] = 244; + t[124] = 246; + t[125] = 245; + t[126] = 250; + t[127] = 249; + t[128] = 251; + t[129] = 252; + t[130] = 8224; + t[131] = 176; + t[132] = 162; + t[133] = 163; + t[134] = 167; + t[135] = 8226; + t[136] = 182; + t[137] = 223; + t[138] = 174; + t[139] = 169; + t[140] = 8482; + t[141] = 180; + t[142] = 168; + t[143] = 8800; + t[144] = 198; + t[145] = 216; + t[146] = 8734; + t[147] = 177; + t[148] = 8804; + t[149] = 8805; + t[150] = 165; + t[151] = 181; + t[152] = 8706; + t[153] = 8721; + t[154] = 8719; + t[156] = 8747; + t[157] = 170; + t[158] = 186; + t[159] = 8486; + t[160] = 230; + t[161] = 248; + t[162] = 191; + t[163] = 161; + t[164] = 172; + t[165] = 8730; + t[166] = 402; + t[167] = 8776; + t[168] = 8710; + t[169] = 171; + t[170] = 187; + t[171] = 8230; + t[179] = 8220; + t[180] = 8221; + t[181] = 8216; + t[182] = 8217; + t[200] = 193; + t[203] = 205; + t[207] = 211; + t[210] = 218; + t[223] = 711; + t[224] = 321; + t[225] = 322; + t[226] = 352; + t[227] = 353; + t[228] = 381; + t[229] = 382; + t[233] = 221; + t[234] = 253; + t[252] = 263; + t[253] = 268; + t[254] = 269; + t[258] = 258; + t[260] = 260; + t[261] = 261; + t[265] = 280; + t[266] = 281; + t[267] = 282; + t[268] = 283; + t[269] = 313; + t[275] = 323; + t[276] = 324; + t[278] = 328; + t[283] = 344; + t[284] = 345; + t[285] = 346; + t[286] = 347; + t[292] = 367; + t[295] = 377; + t[296] = 378; + t[298] = 380; + t[305] = 963; + t[306] = 964; + t[307] = 966; + t[308] = 8215; + t[309] = 8252; + t[310] = 8319; + t[311] = 8359; + t[312] = 8592; + t[313] = 8593; + t[337] = 9552; + t[493] = 1039; + t[494] = 1040; + t[672] = 1488; + t[673] = 1489; + t[674] = 1490; + t[675] = 1491; + t[676] = 1492; + t[677] = 1493; + t[678] = 1494; + t[679] = 1495; + t[680] = 1496; + t[681] = 1497; + t[682] = 1498; + t[683] = 1499; + t[684] = 1500; + t[685] = 1501; + t[686] = 1502; + t[687] = 1503; + t[688] = 1504; + t[689] = 1505; + t[690] = 1506; + t[691] = 1507; + t[692] = 1508; + t[693] = 1509; + t[694] = 1510; + t[695] = 1511; + t[696] = 1512; + t[697] = 1513; + t[698] = 1514; + t[705] = 1524; + t[706] = 8362; + t[710] = 64288; + t[711] = 64298; + t[759] = 1617; + t[761] = 1776; + t[763] = 1778; + t[775] = 1652; + t[777] = 1764; + t[778] = 1780; + t[779] = 1781; + t[780] = 1782; + t[782] = 771; + t[783] = 64726; + t[786] = 8363; + t[788] = 8532; + t[790] = 768; + t[791] = 769; + t[792] = 768; + t[795] = 803; + t[797] = 64336; + t[798] = 64337; + t[799] = 64342; + t[800] = 64343; + t[801] = 64344; + t[802] = 64345; + t[803] = 64362; + t[804] = 64363; + t[805] = 64364; + t[2424] = 7821; + t[2425] = 7822; + t[2426] = 7823; + t[2427] = 7824; + t[2428] = 7825; + t[2429] = 7826; + t[2430] = 7827; + t[2433] = 7682; + t[2678] = 8045; + t[2679] = 8046; + t[2830] = 1552; + t[2838] = 686; + t[2840] = 751; + t[2842] = 753; + t[2843] = 754; + t[2844] = 755; + t[2846] = 757; + t[2856] = 767; + t[2857] = 848; + t[2858] = 849; + t[2862] = 853; + t[2863] = 854; + t[2864] = 855; + t[2865] = 861; + t[2866] = 862; + t[2906] = 7460; + t[2908] = 7462; + t[2909] = 7463; + t[2910] = 7464; + t[2912] = 7466; + t[2913] = 7467; + t[2914] = 7468; + t[2916] = 7470; + t[2917] = 7471; + t[2918] = 7472; + t[2920] = 7474; + t[2921] = 7475; + t[2922] = 7476; + t[2924] = 7478; + t[2925] = 7479; + t[2926] = 7480; + t[2928] = 7482; + t[2929] = 7483; + t[2930] = 7484; + t[2932] = 7486; + t[2933] = 7487; + t[2934] = 7488; + t[2936] = 7490; + t[2937] = 7491; + t[2938] = 7492; + t[2940] = 7494; + t[2941] = 7495; + t[2942] = 7496; + t[2944] = 7498; + t[2946] = 7500; + t[2948] = 7502; + t[2950] = 7504; + t[2951] = 7505; + t[2952] = 7506; + t[2954] = 7508; + t[2955] = 7509; + t[2956] = 7510; + t[2958] = 7512; + t[2959] = 7513; + t[2960] = 7514; + t[2962] = 7516; + t[2963] = 7517; + t[2964] = 7518; + t[2966] = 7520; + t[2967] = 7521; + t[2968] = 7522; + t[2970] = 7524; + t[2971] = 7525; + t[2972] = 7526; + t[2974] = 7528; + t[2975] = 7529; + t[2976] = 7530; + t[2978] = 1537; + t[2979] = 1538; + t[2980] = 1539; + t[2982] = 1549; + t[2983] = 1551; + t[2984] = 1552; + t[2986] = 1554; + t[2987] = 1555; + t[2988] = 1556; + t[2990] = 1623; + t[2991] = 1624; + t[2995] = 1775; + t[2999] = 1791; + t[3002] = 64290; + t[3003] = 64291; + t[3004] = 64292; + t[3006] = 64294; + t[3007] = 64295; + t[3008] = 64296; + t[3011] = 1900; + t[3014] = 8223; + t[3015] = 8244; + t[3017] = 7532; + t[3018] = 7533; + t[3019] = 7534; + t[3075] = 7590; + t[3076] = 7591; + t[3079] = 7594; + t[3080] = 7595; + t[3083] = 7598; + t[3084] = 7599; + t[3087] = 7602; + t[3088] = 7603; + t[3091] = 7606; + t[3092] = 7607; + t[3095] = 7610; + t[3096] = 7611; + t[3099] = 7614; + t[3100] = 7615; + t[3103] = 7618; + t[3104] = 7619; + t[3107] = 8337; + t[3108] = 8338; + t[3116] = 1884; + t[3119] = 1885; + t[3120] = 1885; + t[3123] = 1886; + t[3124] = 1886; + t[3127] = 1887; + t[3128] = 1887; + t[3131] = 1888; + t[3132] = 1888; + t[3135] = 1889; + t[3136] = 1889; + t[3139] = 1890; + t[3140] = 1890; + t[3143] = 1891; + t[3144] = 1891; + t[3147] = 1892; + t[3148] = 1892; + t[3153] = 580; + t[3154] = 581; + t[3157] = 584; + t[3158] = 585; + t[3161] = 588; + t[3162] = 589; + t[3165] = 891; + t[3166] = 892; + t[3169] = 1274; + t[3170] = 1275; + t[3173] = 1278; + t[3174] = 1279; + t[3181] = 7622; + t[3182] = 7623; + t[3282] = 11799; + t[3316] = 578; + t[3379] = 42785; + t[3393] = 1159; + t[3416] = 8377; +}); +const getSupplementalGlyphMapForArialBlack = getLookupTableFactory( + function (t) { + t[227] = 322; + t[264] = 261; + t[291] = 346; + }, +); +const getSupplementalGlyphMapForCalibri = getLookupTableFactory(function (t) { + t[1] = 32; + t[4] = 65; + t[5] = 192; + t[6] = 193; + t[9] = 196; + t[17] = 66; + t[18] = 67; + t[21] = 268; + t[24] = 68; + t[28] = 69; + t[29] = 200; + t[30] = 201; + t[32] = 282; + t[38] = 70; + t[39] = 71; + t[44] = 72; + t[47] = 73; + t[48] = 204; + t[49] = 205; + t[58] = 74; + t[60] = 75; + t[62] = 76; + t[68] = 77; + t[69] = 78; + t[75] = 79; + t[76] = 210; + t[80] = 214; + t[87] = 80; + t[89] = 81; + t[90] = 82; + t[92] = 344; + t[94] = 83; + t[97] = 352; + t[100] = 84; + t[104] = 85; + t[109] = 220; + t[115] = 86; + t[116] = 87; + t[121] = 88; + t[122] = 89; + t[124] = 221; + t[127] = 90; + t[129] = 381; + t[258] = 97; + t[259] = 224; + t[260] = 225; + t[263] = 228; + t[268] = 261; + t[271] = 98; + t[272] = 99; + t[273] = 263; + t[275] = 269; + t[282] = 100; + t[286] = 101; + t[287] = 232; + t[288] = 233; + t[290] = 283; + t[295] = 281; + t[296] = 102; + t[336] = 103; + t[346] = 104; + t[349] = 105; + t[350] = 236; + t[351] = 237; + t[361] = 106; + t[364] = 107; + t[367] = 108; + t[371] = 322; + t[373] = 109; + t[374] = 110; + t[381] = 111; + t[382] = 242; + t[383] = 243; + t[386] = 246; + t[393] = 112; + t[395] = 113; + t[396] = 114; + t[398] = 345; + t[400] = 115; + t[401] = 347; + t[403] = 353; + t[410] = 116; + t[437] = 117; + t[442] = 252; + t[448] = 118; + t[449] = 119; + t[454] = 120; + t[455] = 121; + t[457] = 253; + t[460] = 122; + t[462] = 382; + t[463] = 380; + t[853] = 44; + t[855] = 58; + t[856] = 46; + t[876] = 47; + t[878] = 45; + t[882] = 45; + t[894] = 40; + t[895] = 41; + t[896] = 91; + t[897] = 93; + t[923] = 64; + t[1004] = 48; + t[1005] = 49; + t[1006] = 50; + t[1007] = 51; + t[1008] = 52; + t[1009] = 53; + t[1010] = 54; + t[1011] = 55; + t[1012] = 56; + t[1013] = 57; + t[1081] = 37; + t[1085] = 43; + t[1086] = 45; +}); +function getStandardFontName(name) { + const fontName = normalizeFontName(name); + const stdFontMap = getStdFontMap(); + return stdFontMap[fontName]; +} +function isKnownFontName(name) { + const fontName = normalizeFontName(name); + return !!( + getStdFontMap()[fontName] || + getNonStdFontMap()[fontName] || + getSerifFonts()[fontName] || + getSymbolsFonts()[fontName] + ); +} // ./src/core/to_unicode_map.js + class ToUnicodeMap { - constructor(e = []) { - this._map = e; + constructor(cmap = []) { + this._map = cmap; } get length() { return this._map.length; } - forEach(e) { - for (const t in this._map) e(t, this._map[t].charCodeAt(0)); + forEach(callback) { + for (const charCode in this._map) { + callback(charCode, this._map[charCode].charCodeAt(0)); + } } - has(e) { - return void 0 !== this._map[e]; + has(i) { + return this._map[i] !== undefined; } - get(e) { - return this._map[e]; + get(i) { + return this._map[i]; } - charCodeOf(e) { - const t = this._map; - if (t.length <= 65536) return t.indexOf(e); - for (const i in t) if (t[i] === e) return 0 | i; + charCodeOf(value) { + const map = this._map; + if (map.length <= 0x10000) { + return map.indexOf(value); + } + for (const charCode in map) { + if (map[charCode] === value) { + return charCode | 0; + } + } return -1; } - amend(e) { - for (const t in e) this._map[t] = e[t]; + amend(map) { + for (const charCode in map) { + this._map[charCode] = map[charCode]; + } } } class IdentityToUnicodeMap { - constructor(e, t) { - this.firstChar = e; - this.lastChar = t; + constructor(firstChar, lastChar) { + this.firstChar = firstChar; + this.lastChar = lastChar; } get length() { return this.lastChar + 1 - this.firstChar; } - forEach(e) { - for (let t = this.firstChar, i = this.lastChar; t <= i; t++) e(t, t); + forEach(callback) { + for (let i = this.firstChar, ii = this.lastChar; i <= ii; i++) { + callback(i, i); + } } - has(e) { - return this.firstChar <= e && e <= this.lastChar; + has(i) { + return this.firstChar <= i && i <= this.lastChar; } - get(e) { - if (this.firstChar <= e && e <= this.lastChar) - return String.fromCharCode(e); + get(i) { + if (this.firstChar <= i && i <= this.lastChar) { + return String.fromCharCode(i); + } + return undefined; } - charCodeOf(e) { - return Number.isInteger(e) && e >= this.firstChar && e <= this.lastChar - ? e + charCodeOf(v) { + return Number.isInteger(v) && v >= this.firstChar && v <= this.lastChar + ? v : -1; } - amend(e) { + amend(map) { unreachable("Should not call amend()"); } -} +} // ./src/core/cff_font.js + class CFFFont { - constructor(e, t) { - this.properties = t; - const i = new CFFParser(e, t, Yi); - this.cff = i.parse(); + constructor(file, properties) { + this.properties = properties; + const parser = new CFFParser(file, properties, SEAC_ANALYSIS_ENABLED); + this.cff = parser.parse(); this.cff.duplicateFirstGlyph(); - const a = new CFFCompiler(this.cff); + const compiler = new CFFCompiler(this.cff); this.seacs = this.cff.seacs; try { - this.data = a.compile(); + this.data = compiler.compile(); } catch { - warn("Failed to compile font " + t.loadedName); - this.data = e; + warn("Failed to compile font " + properties.loadedName); + this.data = file; } this._createBuiltInEncoding(); } @@ -20298,4625 +23784,4999 @@ class CFFFont { return this.cff.charset.charset; } getGlyphMapping() { - const e = this.cff, - t = this.properties, - { cidToGidMap: i, cMap: a } = t, - s = e.charset.charset; - let r, n; - if (t.composite) { - let t, g; - if (i?.length > 0) { - t = Object.create(null); - for (let e = 0, a = i.length; e < a; e++) { - const a = i[e]; - void 0 !== a && (t[a] = e); + const cff = this.cff; + const properties = this.properties; + const { cidToGidMap, cMap } = properties; + const charsets = cff.charset.charset; + let charCodeToGlyphId; + let glyphId; + if (properties.composite) { + let invCidToGidMap; + if (cidToGidMap?.length > 0) { + invCidToGidMap = Object.create(null); + for (let i = 0, ii = cidToGidMap.length; i < ii; i++) { + const gid = cidToGidMap[i]; + if (gid !== undefined) { + invCidToGidMap[gid] = i; + } } } - r = Object.create(null); - if (e.isCIDFont) - for (n = 0; n < s.length; n++) { - const e = s[n]; - g = a.charCodeOf(e); - void 0 !== t?.[g] && (g = t[g]); - r[g] = n; + charCodeToGlyphId = Object.create(null); + let charCode; + if (cff.isCIDFont) { + for (glyphId = 0; glyphId < charsets.length; glyphId++) { + const cid = charsets[glyphId]; + charCode = cMap.charCodeOf(cid); + if (invCidToGidMap?.[charCode] !== undefined) { + charCode = invCidToGidMap[charCode]; + } + charCodeToGlyphId[charCode] = glyphId; } - else - for (n = 0; n < e.charStrings.count; n++) { - g = a.charCodeOf(n); - r[g] = n; + } else { + for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) { + charCode = cMap.charCodeOf(glyphId); + charCodeToGlyphId[charCode] = glyphId; } - return r; + } + return charCodeToGlyphId; } - let g = e.encoding ? e.encoding.encoding : null; - t.isInternalFont && (g = t.defaultEncoding); - r = type1FontGlyphMapping(t, g, s); - return r; + let encoding = cff.encoding ? cff.encoding.encoding : null; + if (properties.isInternalFont) { + encoding = properties.defaultEncoding; + } + charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets); + return charCodeToGlyphId; } - hasGlyphId(e) { - return this.cff.hasGlyphId(e); + hasGlyphId(id) { + return this.cff.hasGlyphId(id); } _createBuiltInEncoding() { - const { charset: e, encoding: t } = this.cff; - if (!e || !t) return; - const i = e.charset, - a = t.encoding, - s = []; - for (const e in a) { - const t = a[e]; - if (t >= 0) { - const a = i[t]; - a && (s[e] = a); - } + const { charset, encoding } = this.cff; + if (!charset || !encoding) { + return; } - s.length > 0 && (this.properties.builtInEncoding = s); - } -} -function getUint32(e, t) { - return ((e[t] << 24) | (e[t + 1] << 16) | (e[t + 2] << 8) | e[t + 3]) >>> 0; -} -function getUint16(e, t) { - return (e[t] << 8) | e[t + 1]; -} -function getInt16(e, t) { - return ((e[t] << 24) | (e[t + 1] << 16)) >> 16; -} -function getInt8(e, t) { - return (e[t] << 24) >> 24; -} -function getFloat214(e, t) { - return getInt16(e, t) / 16384; -} -function getSubroutineBias(e) { - const t = e.length; - let i = 32768; - t < 1240 ? (i = 107) : t < 33900 && (i = 1131); - return i; -} -function parseCmap(e, t, i) { - const a = - 1 === getUint16(e, t + 2) ? getUint32(e, t + 8) : getUint32(e, t + 16), - s = getUint16(e, t + a); - let r, n, g; - if (4 === s) { - getUint16(e, t + a + 2); - const i = getUint16(e, t + a + 6) >> 1; - n = t + a + 14; - r = []; - for (g = 0; g < i; g++, n += 2) r[g] = { end: getUint16(e, n) }; - n += 2; - for (g = 0; g < i; g++, n += 2) r[g].start = getUint16(e, n); - for (g = 0; g < i; g++, n += 2) r[g].idDelta = getUint16(e, n); - for (g = 0; g < i; g++, n += 2) { - let t = getUint16(e, n); - if (0 !== t) { - r[g].ids = []; - for (let i = 0, a = r[g].end - r[g].start + 1; i < a; i++) { - r[g].ids[i] = getUint16(e, n + t); - t += 2; + const charsets = charset.charset, + encodings = encoding.encoding; + const map = []; + for (const charCode in encodings) { + const glyphId = encodings[charCode]; + if (glyphId >= 0) { + const glyphName = charsets[glyphId]; + if (glyphName) { + map[charCode] = glyphName; } } } - return r; - } - if (12 === s) { - const i = getUint32(e, t + a + 12); - n = t + a + 16; - r = []; - for (g = 0; g < i; g++) { - t = getUint32(e, n); - r.push({ - start: t, - end: getUint32(e, n + 4), - idDelta: getUint32(e, n + 8) - t, - }); - n += 12; + if (map.length > 0) { + this.properties.builtInEncoding = map; } - return r; } - throw new FormatError(`unsupported cmap: ${s}`); +} // ./src/core/font_renderer.js + +function getUint32(data, offset) { + return ( + ((data[offset] << 24) | + (data[offset + 1] << 16) | + (data[offset + 2] << 8) | + data[offset + 3]) >>> + 0 + ); } -function parseCff(e, t, i, a) { - const s = new CFFParser(new Stream(e, t, i - t), {}, a).parse(); +function getUint16(data, offset) { + return (data[offset] << 8) | data[offset + 1]; +} +function getInt16(data, offset) { + return ((data[offset] << 24) | (data[offset + 1] << 16)) >> 16; +} +function getInt8(data, offset) { + return (data[offset] << 24) >> 24; +} +function getFloat214(data, offset) { + return getInt16(data, offset) / 16384; +} +function getSubroutineBias(subrs) { + const numSubrs = subrs.length; + let bias = 32768; + if (numSubrs < 1240) { + bias = 107; + } else if (numSubrs < 33900) { + bias = 1131; + } + return bias; +} +function parseCmap(data, start, end) { + const offset = + getUint16(data, start + 2) === 1 + ? getUint32(data, start + 8) + : getUint32(data, start + 16); + const format = getUint16(data, start + offset); + let ranges, p, i; + if (format === 4) { + getUint16(data, start + offset + 2); + const segCount = getUint16(data, start + offset + 6) >> 1; + p = start + offset + 14; + ranges = []; + for (i = 0; i < segCount; i++, p += 2) { + ranges[i] = { + end: getUint16(data, p), + }; + } + p += 2; + for (i = 0; i < segCount; i++, p += 2) { + ranges[i].start = getUint16(data, p); + } + for (i = 0; i < segCount; i++, p += 2) { + ranges[i].idDelta = getUint16(data, p); + } + for (i = 0; i < segCount; i++, p += 2) { + let idOffset = getUint16(data, p); + if (idOffset === 0) { + continue; + } + ranges[i].ids = []; + for (let j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) { + ranges[i].ids[j] = getUint16(data, p + idOffset); + idOffset += 2; + } + } + return ranges; + } else if (format === 12) { + const groups = getUint32(data, start + offset + 12); + p = start + offset + 16; + ranges = []; + for (i = 0; i < groups; i++) { + start = getUint32(data, p); + ranges.push({ + start, + end: getUint32(data, p + 4), + idDelta: getUint32(data, p + 8) - start, + }); + p += 12; + } + return ranges; + } + throw new FormatError(`unsupported cmap: ${format}`); +} +function parseCff(data, start, end, seacAnalysisEnabled) { + const properties = {}; + const parser = new CFFParser( + new Stream(data, start, end - start), + properties, + seacAnalysisEnabled, + ); + const cff = parser.parse(); return { - glyphs: s.charStrings.objects, - subrs: s.topDict.privateDict?.subrsIndex?.objects, - gsubrs: s.globalSubrIndex?.objects, - isCFFCIDFont: s.isCIDFont, - fdSelect: s.fdSelect, - fdArray: s.fdArray, + glyphs: cff.charStrings.objects, + subrs: cff.topDict.privateDict?.subrsIndex?.objects, + gsubrs: cff.globalSubrIndex?.objects, + isCFFCIDFont: cff.isCIDFont, + fdSelect: cff.fdSelect, + fdArray: cff.fdArray, }; } -function lookupCmap(e, t) { - const i = t.codePointAt(0); - let a = 0, - s = 0, - r = e.length - 1; - for (; s < r; ) { - const t = (s + r + 1) >> 1; - i < e[t].start ? (r = t - 1) : (s = t); +function parseGlyfTable(glyf, loca, isGlyphLocationsLong) { + let itemSize, itemDecode; + if (isGlyphLocationsLong) { + itemSize = 4; + itemDecode = getUint32; + } else { + itemSize = 2; + itemDecode = (data, offset) => 2 * getUint16(data, offset); } - e[s].start <= i && - i <= e[s].end && - (a = (e[s].idDelta + (e[s].ids ? e[s].ids[i - e[s].start] : i)) & 65535); - return { charCode: i, glyphId: a }; + const glyphs = []; + let startOffset = itemDecode(loca, 0); + for (let j = itemSize; j < loca.length; j += itemSize) { + const endOffset = itemDecode(loca, j); + glyphs.push(glyf.subarray(startOffset, endOffset)); + startOffset = endOffset; + } + return glyphs; } -function compileGlyf(e, t, i) { - function moveTo(e, i) { - t.add(Ct, [e, i]); +function lookupCmap(ranges, unicode) { + const code = unicode.codePointAt(0); + let gid = 0, + l = 0, + r = ranges.length - 1; + while (l < r) { + const c = (l + r + 1) >> 1; + if (code < ranges[c].start) { + r = c - 1; + } else { + l = c; + } } - function lineTo(e, i) { - t.add(ht, [e, i]); + if (ranges[l].start <= code && code <= ranges[l].end) { + gid = + (ranges[l].idDelta + + (ranges[l].ids ? ranges[l].ids[code - ranges[l].start] : code)) & + 0xffff; } - function quadraticCurveTo(e, i, a, s) { - t.add(Bt, [e, i, a, s]); + return { + charCode: code, + glyphId: gid, + }; +} +function compileGlyf(code, cmds, font) { + function moveTo(x, y) { + cmds.add(FontRenderOps.MOVE_TO, [x, y]); } - let a = 0; - const s = getInt16(e, a); - let r, - n = 0, - g = 0; - a += 10; - if (s < 0) + function lineTo(x, y) { + cmds.add(FontRenderOps.LINE_TO, [x, y]); + } + function quadraticCurveTo(xa, ya, x, y) { + cmds.add(FontRenderOps.QUADRATIC_CURVE_TO, [xa, ya, x, y]); + } + let i = 0; + const numberOfContours = getInt16(code, i); + let flags; + let x = 0, + y = 0; + i += 10; + if (numberOfContours < 0) { do { - r = getUint16(e, a); - const s = getUint16(e, a + 2); - a += 4; - let o, c; - if (1 & r) { - if (2 & r) { - o = getInt16(e, a); - c = getInt16(e, a + 2); + flags = getUint16(code, i); + const glyphIndex = getUint16(code, i + 2); + i += 4; + let arg1, arg2; + if (flags & 0x01) { + if (flags & 0x02) { + arg1 = getInt16(code, i); + arg2 = getInt16(code, i + 2); } else { - o = getUint16(e, a); - c = getUint16(e, a + 2); + arg1 = getUint16(code, i); + arg2 = getUint16(code, i + 2); } - a += 4; - } else if (2 & r) { - o = getInt8(e, a++); - c = getInt8(e, a++); + i += 4; + } else if (flags & 0x02) { + arg1 = getInt8(code, i++); + arg2 = getInt8(code, i++); } else { - o = e[a++]; - c = e[a++]; + arg1 = code[i++]; + arg2 = code[i++]; } - if (2 & r) { - n = o; - g = c; + if (flags & 0x02) { + x = arg1; + y = arg2; } else { - n = 0; - g = 0; + x = 0; + y = 0; } - let C = 1, - h = 1, - l = 0, - Q = 0; - if (8 & r) { - C = h = getFloat214(e, a); - a += 2; - } else if (64 & r) { - C = getFloat214(e, a); - h = getFloat214(e, a + 2); - a += 4; - } else if (128 & r) { - C = getFloat214(e, a); - l = getFloat214(e, a + 2); - Q = getFloat214(e, a + 4); - h = getFloat214(e, a + 6); - a += 8; + let scaleX = 1, + scaleY = 1, + scale01 = 0, + scale10 = 0; + if (flags & 0x08) { + scaleX = scaleY = getFloat214(code, i); + i += 2; + } else if (flags & 0x40) { + scaleX = getFloat214(code, i); + scaleY = getFloat214(code, i + 2); + i += 4; + } else if (flags & 0x80) { + scaleX = getFloat214(code, i); + scale01 = getFloat214(code, i + 2); + scale10 = getFloat214(code, i + 4); + scaleY = getFloat214(code, i + 6); + i += 8; } - const E = i.glyphs[s]; - if (E) { - t.add(Qt); - t.add(ut, [C, l, Q, h, n, g]); - compileGlyf(E, t, i); - t.add(lt); + const subglyph = font.glyphs[glyphIndex]; + if (subglyph) { + cmds.add(FontRenderOps.SAVE); + cmds.add(FontRenderOps.TRANSFORM, [ + scaleX, + scale01, + scale10, + scaleY, + x, + y, + ]); + if (!(flags & 0x02)) { + } + compileGlyf(subglyph, cmds, font); + cmds.add(FontRenderOps.RESTORE); } - } while (32 & r); - else { - const t = []; - let i, o; - for (i = 0; i < s; i++) { - t.push(getUint16(e, a)); - a += 2; + } while (flags & 0x20); + } else { + const endPtsOfContours = []; + let j, jj; + for (j = 0; j < numberOfContours; j++) { + endPtsOfContours.push(getUint16(code, i)); + i += 2; } - a += 2 + getUint16(e, a); - const c = t.at(-1) + 1, - C = []; - for (; C.length < c; ) { - r = e[a++]; - let t = 1; - 8 & r && (t += e[a++]); - for (; t-- > 0; ) C.push({ flags: r }); - } - for (i = 0; i < c; i++) { - switch (18 & C[i].flags) { - case 0: - n += getInt16(e, a); - a += 2; - break; - case 2: - n -= e[a++]; - break; - case 18: - n += e[a++]; + const instructionLength = getUint16(code, i); + i += 2 + instructionLength; + const numberOfPoints = endPtsOfContours.at(-1) + 1; + const points = []; + while (points.length < numberOfPoints) { + flags = code[i++]; + let repeat = 1; + if (flags & 0x08) { + repeat += code[i++]; } - C[i].x = n; - } - for (i = 0; i < c; i++) { - switch (36 & C[i].flags) { - case 0: - g += getInt16(e, a); - a += 2; - break; - case 4: - g -= e[a++]; - break; - case 36: - g += e[a++]; + while (repeat-- > 0) { + points.push({ + flags, + }); } - C[i].y = g; } - let h = 0; - for (a = 0; a < s; a++) { - const e = t[a], - s = C.slice(h, e + 1); - if (1 & s[0].flags) s.push(s[0]); - else if (1 & s.at(-1).flags) s.unshift(s.at(-1)); - else { - const e = { + for (j = 0; j < numberOfPoints; j++) { + switch (points[j].flags & 0x12) { + case 0x00: + x += getInt16(code, i); + i += 2; + break; + case 0x02: + x -= code[i++]; + break; + case 0x12: + x += code[i++]; + break; + } + points[j].x = x; + } + for (j = 0; j < numberOfPoints; j++) { + switch (points[j].flags & 0x24) { + case 0x00: + y += getInt16(code, i); + i += 2; + break; + case 0x04: + y -= code[i++]; + break; + case 0x24: + y += code[i++]; + break; + } + points[j].y = y; + } + let startPoint = 0; + for (i = 0; i < numberOfContours; i++) { + const endPoint = endPtsOfContours[i]; + const contour = points.slice(startPoint, endPoint + 1); + if (contour[0].flags & 1) { + contour.push(contour[0]); + } else if (contour.at(-1).flags & 1) { + contour.unshift(contour.at(-1)); + } else { + const p = { flags: 1, - x: (s[0].x + s.at(-1).x) / 2, - y: (s[0].y + s.at(-1).y) / 2, + x: (contour[0].x + contour.at(-1).x) / 2, + y: (contour[0].y + contour.at(-1).y) / 2, }; - s.unshift(e); - s.push(e); + contour.unshift(p); + contour.push(p); } - moveTo(s[0].x, s[0].y); - for (i = 1, o = s.length; i < o; i++) - if (1 & s[i].flags) lineTo(s[i].x, s[i].y); - else if (1 & s[i + 1].flags) { - quadraticCurveTo(s[i].x, s[i].y, s[i + 1].x, s[i + 1].y); - i++; - } else + moveTo(contour[0].x, contour[0].y); + for (j = 1, jj = contour.length; j < jj; j++) { + if (contour[j].flags & 1) { + lineTo(contour[j].x, contour[j].y); + } else if (contour[j + 1].flags & 1) { quadraticCurveTo( - s[i].x, - s[i].y, - (s[i].x + s[i + 1].x) / 2, - (s[i].y + s[i + 1].y) / 2, + contour[j].x, + contour[j].y, + contour[j + 1].x, + contour[j + 1].y, ); - h = e + 1; + j++; + } else { + quadraticCurveTo( + contour[j].x, + contour[j].y, + (contour[j].x + contour[j + 1].x) / 2, + (contour[j].y + contour[j + 1].y) / 2, + ); + } + } + startPoint = endPoint + 1; } } } -function compileCharString(e, t, i, a) { - function moveTo(e, i) { - t.add(Ct, [e, i]); +function compileCharString(charStringCode, cmds, font, glyphId) { + function moveTo(x, y) { + cmds.add(FontRenderOps.MOVE_TO, [x, y]); } - function lineTo(e, i) { - t.add(ht, [e, i]); + function lineTo(x, y) { + cmds.add(FontRenderOps.LINE_TO, [x, y]); } - function bezierCurveTo(e, i, a, s, r, n) { - t.add(ct, [e, i, a, s, r, n]); + function bezierCurveTo(x1, y1, x2, y2, x, y) { + cmds.add(FontRenderOps.BEZIER_CURVE_TO, [x1, y1, x2, y2, x, y]); } - const s = []; - let r = 0, - n = 0, - g = 0; - !(function parse(e) { - let o = 0; - for (; o < e.length; ) { - let c, - C, - h, - l, - Q, - E, - u, - d, - f, - p = !1, - m = e[o++]; - switch (m) { + const stack = []; + let x = 0, + y = 0; + let stems = 0; + function parse(code) { + let i = 0; + while (i < code.length) { + let stackClean = false; + let v = code[i++]; + let xa, xb, ya, yb, y1, y2, y3, n, subrCode; + switch (v) { case 1: + stems += stack.length >> 1; + stackClean = true; + break; case 3: - case 18: - case 23: - g += s.length >> 1; - p = !0; + stems += stack.length >> 1; + stackClean = true; break; case 4: - n += s.pop(); - moveTo(r, n); - p = !0; + y += stack.pop(); + moveTo(x, y); + stackClean = true; break; case 5: - for (; s.length > 0; ) { - r += s.shift(); - n += s.shift(); - lineTo(r, n); + while (stack.length > 0) { + x += stack.shift(); + y += stack.shift(); + lineTo(x, y); } break; case 6: - for (; s.length > 0; ) { - r += s.shift(); - lineTo(r, n); - if (0 === s.length) break; - n += s.shift(); - lineTo(r, n); + while (stack.length > 0) { + x += stack.shift(); + lineTo(x, y); + if (stack.length === 0) { + break; + } + y += stack.shift(); + lineTo(x, y); } break; case 7: - for (; s.length > 0; ) { - n += s.shift(); - lineTo(r, n); - if (0 === s.length) break; - r += s.shift(); - lineTo(r, n); + while (stack.length > 0) { + y += stack.shift(); + lineTo(x, y); + if (stack.length === 0) { + break; + } + x += stack.shift(); + lineTo(x, y); } break; case 8: - for (; s.length > 0; ) { - c = r + s.shift(); - h = n + s.shift(); - C = c + s.shift(); - l = h + s.shift(); - r = C + s.shift(); - n = l + s.shift(); - bezierCurveTo(c, h, C, l, r, n); + while (stack.length > 0) { + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); } break; case 10: - d = s.pop(); - f = null; - if (i.isCFFCIDFont) { - const e = i.fdSelect.getFDIndex(a); - if (e >= 0 && e < i.fdArray.length) { - const t = i.fdArray[e]; - let a; - t.privateDict?.subrsIndex && - (a = t.privateDict.subrsIndex.objects); - if (a) { - d += getSubroutineBias(a); - f = a[d]; + n = stack.pop(); + subrCode = null; + if (font.isCFFCIDFont) { + const fdIndex = font.fdSelect.getFDIndex(glyphId); + if (fdIndex >= 0 && fdIndex < font.fdArray.length) { + const fontDict = font.fdArray[fdIndex]; + let subrs; + if (fontDict.privateDict?.subrsIndex) { + subrs = fontDict.privateDict.subrsIndex.objects; } - } else warn("Invalid fd index for glyph index."); - } else f = i.subrs[d + i.subrsBias]; - f && parse(f); + if (subrs) { + n += getSubroutineBias(subrs); + subrCode = subrs[n]; + } + } else { + warn("Invalid fd index for glyph index."); + } + } else { + subrCode = font.subrs[n + font.subrsBias]; + } + if (subrCode) { + parse(subrCode); + } break; case 11: return; case 12: - m = e[o++]; - switch (m) { + v = code[i++]; + switch (v) { case 34: - c = r + s.shift(); - C = c + s.shift(); - Q = n + s.shift(); - r = C + s.shift(); - bezierCurveTo(c, n, C, Q, r, Q); - c = r + s.shift(); - C = c + s.shift(); - r = C + s.shift(); - bezierCurveTo(c, Q, C, n, r, n); + xa = x + stack.shift(); + xb = xa + stack.shift(); + y1 = y + stack.shift(); + x = xb + stack.shift(); + bezierCurveTo(xa, y, xb, y1, x, y1); + xa = x + stack.shift(); + xb = xa + stack.shift(); + x = xb + stack.shift(); + bezierCurveTo(xa, y1, xb, y, x, y); break; case 35: - c = r + s.shift(); - h = n + s.shift(); - C = c + s.shift(); - l = h + s.shift(); - r = C + s.shift(); - n = l + s.shift(); - bezierCurveTo(c, h, C, l, r, n); - c = r + s.shift(); - h = n + s.shift(); - C = c + s.shift(); - l = h + s.shift(); - r = C + s.shift(); - n = l + s.shift(); - bezierCurveTo(c, h, C, l, r, n); - s.pop(); + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + stack.pop(); break; case 36: - c = r + s.shift(); - Q = n + s.shift(); - C = c + s.shift(); - E = Q + s.shift(); - r = C + s.shift(); - bezierCurveTo(c, Q, C, E, r, E); - c = r + s.shift(); - C = c + s.shift(); - u = E + s.shift(); - r = C + s.shift(); - bezierCurveTo(c, E, C, u, r, n); + xa = x + stack.shift(); + y1 = y + stack.shift(); + xb = xa + stack.shift(); + y2 = y1 + stack.shift(); + x = xb + stack.shift(); + bezierCurveTo(xa, y1, xb, y2, x, y2); + xa = x + stack.shift(); + xb = xa + stack.shift(); + y3 = y2 + stack.shift(); + x = xb + stack.shift(); + bezierCurveTo(xa, y2, xb, y3, x, y); break; case 37: - const e = r, - t = n; - c = r + s.shift(); - h = n + s.shift(); - C = c + s.shift(); - l = h + s.shift(); - r = C + s.shift(); - n = l + s.shift(); - bezierCurveTo(c, h, C, l, r, n); - c = r + s.shift(); - h = n + s.shift(); - C = c + s.shift(); - l = h + s.shift(); - r = C; - n = l; - Math.abs(r - e) > Math.abs(n - t) - ? (r += s.shift()) - : (n += s.shift()); - bezierCurveTo(c, h, C, l, r, n); + const x0 = x, + y0 = y; + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb; + y = yb; + if (Math.abs(x - x0) > Math.abs(y - y0)) { + x += stack.shift(); + } else { + y += stack.shift(); + } + bezierCurveTo(xa, ya, xb, yb, x, y); break; default: - throw new FormatError(`unknown operator: 12 ${m}`); + throw new FormatError(`unknown operator: 12 ${v}`); } break; case 14: - if (s.length >= 4) { - const e = s.pop(), - a = s.pop(); - n = s.pop(); - r = s.pop(); - t.add(Qt); - t.add(dt, [r, n]); - let g = lookupCmap( - i.cmap, - String.fromCharCode(i.glyphNameMap[fi[e]]), + if (stack.length >= 4) { + const achar = stack.pop(); + const bchar = stack.pop(); + y = stack.pop(); + x = stack.pop(); + cmds.add(FontRenderOps.SAVE); + cmds.add(FontRenderOps.TRANSLATE, [x, y]); + let cmap = lookupCmap( + font.cmap, + String.fromCharCode(font.glyphNameMap[StandardEncoding[achar]]), + ); + compileCharString( + font.glyphs[cmap.glyphId], + cmds, + font, + cmap.glyphId, + ); + cmds.add(FontRenderOps.RESTORE); + cmap = lookupCmap( + font.cmap, + String.fromCharCode(font.glyphNameMap[StandardEncoding[bchar]]), + ); + compileCharString( + font.glyphs[cmap.glyphId], + cmds, + font, + cmap.glyphId, ); - compileCharString(i.glyphs[g.glyphId], t, i, g.glyphId); - t.add(lt); - g = lookupCmap(i.cmap, String.fromCharCode(i.glyphNameMap[fi[a]])); - compileCharString(i.glyphs[g.glyphId], t, i, g.glyphId); } return; + case 18: + stems += stack.length >> 1; + stackClean = true; + break; case 19: + stems += stack.length >> 1; + i += (stems + 7) >> 3; + stackClean = true; + break; case 20: - g += s.length >> 1; - o += (g + 7) >> 3; - p = !0; + stems += stack.length >> 1; + i += (stems + 7) >> 3; + stackClean = true; break; case 21: - n += s.pop(); - r += s.pop(); - moveTo(r, n); - p = !0; + y += stack.pop(); + x += stack.pop(); + moveTo(x, y); + stackClean = true; break; case 22: - r += s.pop(); - moveTo(r, n); - p = !0; + x += stack.pop(); + moveTo(x, y); + stackClean = true; + break; + case 23: + stems += stack.length >> 1; + stackClean = true; break; case 24: - for (; s.length > 2; ) { - c = r + s.shift(); - h = n + s.shift(); - C = c + s.shift(); - l = h + s.shift(); - r = C + s.shift(); - n = l + s.shift(); - bezierCurveTo(c, h, C, l, r, n); + while (stack.length > 2) { + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); } - r += s.shift(); - n += s.shift(); - lineTo(r, n); + x += stack.shift(); + y += stack.shift(); + lineTo(x, y); break; case 25: - for (; s.length > 6; ) { - r += s.shift(); - n += s.shift(); - lineTo(r, n); + while (stack.length > 6) { + x += stack.shift(); + y += stack.shift(); + lineTo(x, y); } - c = r + s.shift(); - h = n + s.shift(); - C = c + s.shift(); - l = h + s.shift(); - r = C + s.shift(); - n = l + s.shift(); - bezierCurveTo(c, h, C, l, r, n); + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); break; case 26: - s.length % 2 && (r += s.shift()); - for (; s.length > 0; ) { - c = r; - h = n + s.shift(); - C = c + s.shift(); - l = h + s.shift(); - r = C; - n = l + s.shift(); - bezierCurveTo(c, h, C, l, r, n); + if (stack.length % 2) { + x += stack.shift(); + } + while (stack.length > 0) { + xa = x; + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb; + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); } break; case 27: - s.length % 2 && (n += s.shift()); - for (; s.length > 0; ) { - c = r + s.shift(); - h = n; - C = c + s.shift(); - l = h + s.shift(); - r = C + s.shift(); - n = l; - bezierCurveTo(c, h, C, l, r, n); + if (stack.length % 2) { + y += stack.shift(); + } + while (stack.length > 0) { + xa = x + stack.shift(); + ya = y; + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb; + bezierCurveTo(xa, ya, xb, yb, x, y); } break; case 28: - s.push(((e[o] << 24) | (e[o + 1] << 16)) >> 16); - o += 2; + stack.push(((code[i] << 24) | (code[i + 1] << 16)) >> 16); + i += 2; break; case 29: - d = s.pop() + i.gsubrsBias; - f = i.gsubrs[d]; - f && parse(f); + n = stack.pop() + font.gsubrsBias; + subrCode = font.gsubrs[n]; + if (subrCode) { + parse(subrCode); + } break; case 30: - for (; s.length > 0; ) { - c = r; - h = n + s.shift(); - C = c + s.shift(); - l = h + s.shift(); - r = C + s.shift(); - n = l + (1 === s.length ? s.shift() : 0); - bezierCurveTo(c, h, C, l, r, n); - if (0 === s.length) break; - c = r + s.shift(); - h = n; - C = c + s.shift(); - l = h + s.shift(); - n = l + s.shift(); - r = C + (1 === s.length ? s.shift() : 0); - bezierCurveTo(c, h, C, l, r, n); + while (stack.length > 0) { + xa = x; + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + (stack.length === 1 ? stack.shift() : 0); + bezierCurveTo(xa, ya, xb, yb, x, y); + if (stack.length === 0) { + break; + } + xa = x + stack.shift(); + ya = y; + xb = xa + stack.shift(); + yb = ya + stack.shift(); + y = yb + stack.shift(); + x = xb + (stack.length === 1 ? stack.shift() : 0); + bezierCurveTo(xa, ya, xb, yb, x, y); } break; case 31: - for (; s.length > 0; ) { - c = r + s.shift(); - h = n; - C = c + s.shift(); - l = h + s.shift(); - n = l + s.shift(); - r = C + (1 === s.length ? s.shift() : 0); - bezierCurveTo(c, h, C, l, r, n); - if (0 === s.length) break; - c = r; - h = n + s.shift(); - C = c + s.shift(); - l = h + s.shift(); - r = C + s.shift(); - n = l + (1 === s.length ? s.shift() : 0); - bezierCurveTo(c, h, C, l, r, n); + while (stack.length > 0) { + xa = x + stack.shift(); + ya = y; + xb = xa + stack.shift(); + yb = ya + stack.shift(); + y = yb + stack.shift(); + x = xb + (stack.length === 1 ? stack.shift() : 0); + bezierCurveTo(xa, ya, xb, yb, x, y); + if (stack.length === 0) { + break; + } + xa = x; + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + (stack.length === 1 ? stack.shift() : 0); + bezierCurveTo(xa, ya, xb, yb, x, y); } break; default: - if (m < 32) throw new FormatError(`unknown operator: ${m}`); - if (m < 247) s.push(m - 139); - else if (m < 251) s.push(256 * (m - 247) + e[o++] + 108); - else if (m < 255) s.push(256 * -(m - 251) - e[o++] - 108); - else { - s.push( - ((e[o] << 24) | (e[o + 1] << 16) | (e[o + 2] << 8) | e[o + 3]) / + if (v < 32) { + throw new FormatError(`unknown operator: ${v}`); + } + if (v < 247) { + stack.push(v - 139); + } else if (v < 251) { + stack.push((v - 247) * 256 + code[i++] + 108); + } else if (v < 255) { + stack.push(-(v - 251) * 256 - code[i++] - 108); + } else { + stack.push( + ((code[i] << 24) | + (code[i + 1] << 16) | + (code[i + 2] << 8) | + code[i + 3]) / 65536, ); - o += 4; + i += 4; } + break; + } + if (stackClean) { + stack.length = 0; } - p && (s.length = 0); } - })(e); + } + parse(charStringCode); } -const $i = []; +const NOOP = []; class Commands { cmds = []; - add(e, t) { - if (t) - if (isNumberArray(t, null)) this.cmds.push(e, ...t); - else { - warn(`Commands.add - "${e}" has at least one non-number arg: "${t}".`); - const i = t.map((e) => ("number" == typeof e ? e : 0)); - this.cmds.push(e, ...i); + add(cmd, args) { + if (args) { + if (!isNumberArray(args, null)) { + warn( + `Commands.add - "${cmd}" has at least one non-number arg: "${args}".`, + ); + const newArgs = args.map((arg) => (typeof arg === "number" ? arg : 0)); + this.cmds.push(cmd, ...newArgs); + } else { + this.cmds.push(cmd, ...args); } - else this.cmds.push(e); + } else { + this.cmds.push(cmd); + } } } class CompiledFont { - constructor(e) { - this.constructor === CompiledFont && - unreachable("Cannot initialize CompiledFont."); - this.fontMatrix = e; + constructor(fontMatrix) { + this.fontMatrix = fontMatrix; this.compiledGlyphs = Object.create(null); this.compiledCharCodeToGlyphId = Object.create(null); } - getPathJs(e) { - const { charCode: t, glyphId: i } = lookupCmap(this.cmap, e); - let a, - s = this.compiledGlyphs[i]; - if (!s) { + getPathJs(unicode) { + const { charCode, glyphId } = lookupCmap(this.cmap, unicode); + let fn = this.compiledGlyphs[glyphId], + compileEx; + if (!fn) { try { - s = this.compileGlyph(this.glyphs[i], i); - } catch (e) { - s = $i; - a = e; + fn = this.compileGlyph(this.glyphs[glyphId], glyphId); + } catch (ex) { + fn = NOOP; + compileEx = ex; } - this.compiledGlyphs[i] = s; + this.compiledGlyphs[glyphId] = fn; } - this.compiledCharCodeToGlyphId[t] ??= i; - if (a) throw a; - return s; + this.compiledCharCodeToGlyphId[charCode] ??= glyphId; + if (compileEx) { + throw compileEx; + } + return fn; } - compileGlyph(e, t) { - if (!e || 0 === e.length || 14 === e[0]) return $i; - let i = this.fontMatrix; - if (this.isCFFCIDFont) { - const e = this.fdSelect.getFDIndex(t); - if (e >= 0 && e < this.fdArray.length) { - i = this.fdArray[e].getByName("FontMatrix") || a; - } else warn("Invalid fd index for glyph index."); + compileGlyph(code, glyphId) { + if (!code || code.length === 0 || code[0] === 14) { + return NOOP; } - const s = new Commands(); - s.add(Qt); - s.add(ut, i.slice()); - s.add(Et); - this.compileGlyphImpl(e, s, t); - s.add(lt); - return s.cmds; + let fontMatrix = this.fontMatrix; + if (this.isCFFCIDFont) { + const fdIndex = this.fdSelect.getFDIndex(glyphId); + if (fdIndex >= 0 && fdIndex < this.fdArray.length) { + const fontDict = this.fdArray[fdIndex]; + fontMatrix = fontDict.getByName("FontMatrix") || FONT_IDENTITY_MATRIX; + } else { + warn("Invalid fd index for glyph index."); + } + } + const cmds = new Commands(); + cmds.add(FontRenderOps.SAVE); + cmds.add(FontRenderOps.TRANSFORM, fontMatrix.slice()); + cmds.add(FontRenderOps.SCALE); + this.compileGlyphImpl(code, cmds, glyphId); + cmds.add(FontRenderOps.RESTORE); + return cmds.cmds; } compileGlyphImpl() { unreachable("Children classes should implement this."); } - hasBuiltPath(e) { - const { charCode: t, glyphId: i } = lookupCmap(this.cmap, e); + hasBuiltPath(unicode) { + const { charCode, glyphId } = lookupCmap(this.cmap, unicode); return ( - void 0 !== this.compiledGlyphs[i] && - void 0 !== this.compiledCharCodeToGlyphId[t] + this.compiledGlyphs[glyphId] !== undefined && + this.compiledCharCodeToGlyphId[charCode] !== undefined ); } } class TrueTypeCompiled extends CompiledFont { - constructor(e, t, i) { - super(i || [488e-6, 0, 0, 488e-6, 0, 0]); - this.glyphs = e; - this.cmap = t; + constructor(glyphs, cmap, fontMatrix) { + super(fontMatrix || [0.000488, 0, 0, 0.000488, 0, 0]); + this.glyphs = glyphs; + this.cmap = cmap; } - compileGlyphImpl(e, t) { - compileGlyf(e, t, this); + compileGlyphImpl(code, cmds) { + compileGlyf(code, cmds, this); } } class Type2Compiled extends CompiledFont { - constructor(e, t, i, a) { - super(i || [0.001, 0, 0, 0.001, 0, 0]); - this.glyphs = e.glyphs; - this.gsubrs = e.gsubrs || []; - this.subrs = e.subrs || []; - this.cmap = t; - this.glyphNameMap = a || Ni(); + constructor(cffInfo, cmap, fontMatrix, glyphNameMap) { + super(fontMatrix || [0.001, 0, 0, 0.001, 0, 0]); + this.glyphs = cffInfo.glyphs; + this.gsubrs = cffInfo.gsubrs || []; + this.subrs = cffInfo.subrs || []; + this.cmap = cmap; + this.glyphNameMap = glyphNameMap || getGlyphsUnicode(); this.gsubrsBias = getSubroutineBias(this.gsubrs); this.subrsBias = getSubroutineBias(this.subrs); - this.isCFFCIDFont = e.isCFFCIDFont; - this.fdSelect = e.fdSelect; - this.fdArray = e.fdArray; + this.isCFFCIDFont = cffInfo.isCFFCIDFont; + this.fdSelect = cffInfo.fdSelect; + this.fdArray = cffInfo.fdArray; } - compileGlyphImpl(e, t, i) { - compileCharString(e, t, this, i); + compileGlyphImpl(code, cmds, glyphId) { + compileCharString(code, cmds, this, glyphId); } } class FontRendererFactory { - static create(e, t) { - const i = new Uint8Array(e.data); - let a, s, r, n, g, o; - const c = getUint16(i, 4); - for (let e = 0, C = 12; e < c; e++, C += 16) { - const e = bytesToString(i.subarray(C, C + 4)), - c = getUint32(i, C + 8), - h = getUint32(i, C + 12); - switch (e) { + static create(font, seacAnalysisEnabled) { + const data = new Uint8Array(font.data); + let cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm; + const numTables = getUint16(data, 4); + for (let i = 0, p = 12; i < numTables; i++, p += 16) { + const tag = bytesToString(data.subarray(p, p + 4)); + const offset = getUint32(data, p + 8); + const length = getUint32(data, p + 12); + switch (tag) { case "cmap": - a = parseCmap(i, c); + cmap = parseCmap(data, offset, offset + length); break; case "glyf": - s = i.subarray(c, c + h); + glyf = data.subarray(offset, offset + length); break; case "loca": - r = i.subarray(c, c + h); + loca = data.subarray(offset, offset + length); break; case "head": - o = getUint16(i, c + 18); - g = getUint16(i, c + 50); + unitsPerEm = getUint16(data, offset + 18); + indexToLocFormat = getUint16(data, offset + 50); break; case "CFF ": - n = parseCff(i, c, c + h, t); + cff = parseCff(data, offset, offset + length, seacAnalysisEnabled); + break; } } - if (s) { - const t = o ? [1 / o, 0, 0, 1 / o, 0, 0] : e.fontMatrix; + if (glyf) { + const fontMatrix = !unitsPerEm + ? font.fontMatrix + : [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0]; return new TrueTypeCompiled( - (function parseGlyfTable(e, t, i) { - let a, s; - if (i) { - a = 4; - s = getUint32; - } else { - a = 2; - s = (e, t) => 2 * getUint16(e, t); - } - const r = []; - let n = s(t, 0); - for (let i = a; i < t.length; i += a) { - const a = s(t, i); - r.push(e.subarray(n, a)); - n = a; - } - return r; - })(s, r, g), - a, - t, + parseGlyfTable(glyf, loca, indexToLocFormat), + cmap, + fontMatrix, ); } - return new Type2Compiled(n, a, e.fontMatrix, e.glyphNameMap); + return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap); } -} -const Aa = getLookupTableFactory(function (e) { - e.Courier = 600; - e["Courier-Bold"] = 600; - e["Courier-BoldOblique"] = 600; - e["Courier-Oblique"] = 600; - e.Helvetica = getLookupTableFactory(function (e) { - e.space = 278; - e.exclam = 278; - e.quotedbl = 355; - e.numbersign = 556; - e.dollar = 556; - e.percent = 889; - e.ampersand = 667; - e.quoteright = 222; - e.parenleft = 333; - e.parenright = 333; - e.asterisk = 389; - e.plus = 584; - e.comma = 278; - e.hyphen = 333; - e.period = 278; - e.slash = 278; - e.zero = 556; - e.one = 556; - e.two = 556; - e.three = 556; - e.four = 556; - e.five = 556; - e.six = 556; - e.seven = 556; - e.eight = 556; - e.nine = 556; - e.colon = 278; - e.semicolon = 278; - e.less = 584; - e.equal = 584; - e.greater = 584; - e.question = 556; - e.at = 1015; - e.A = 667; - e.B = 667; - e.C = 722; - e.D = 722; - e.E = 667; - e.F = 611; - e.G = 778; - e.H = 722; - e.I = 278; - e.J = 500; - e.K = 667; - e.L = 556; - e.M = 833; - e.N = 722; - e.O = 778; - e.P = 667; - e.Q = 778; - e.R = 722; - e.S = 667; - e.T = 611; - e.U = 722; - e.V = 667; - e.W = 944; - e.X = 667; - e.Y = 667; - e.Z = 611; - e.bracketleft = 278; - e.backslash = 278; - e.bracketright = 278; - e.asciicircum = 469; - e.underscore = 556; - e.quoteleft = 222; - e.a = 556; - e.b = 556; - e.c = 500; - e.d = 556; - e.e = 556; - e.f = 278; - e.g = 556; - e.h = 556; - e.i = 222; - e.j = 222; - e.k = 500; - e.l = 222; - e.m = 833; - e.n = 556; - e.o = 556; - e.p = 556; - e.q = 556; - e.r = 333; - e.s = 500; - e.t = 278; - e.u = 556; - e.v = 500; - e.w = 722; - e.x = 500; - e.y = 500; - e.z = 500; - e.braceleft = 334; - e.bar = 260; - e.braceright = 334; - e.asciitilde = 584; - e.exclamdown = 333; - e.cent = 556; - e.sterling = 556; - e.fraction = 167; - e.yen = 556; - e.florin = 556; - e.section = 556; - e.currency = 556; - e.quotesingle = 191; - e.quotedblleft = 333; - e.guillemotleft = 556; - e.guilsinglleft = 333; - e.guilsinglright = 333; - e.fi = 500; - e.fl = 500; - e.endash = 556; - e.dagger = 556; - e.daggerdbl = 556; - e.periodcentered = 278; - e.paragraph = 537; - e.bullet = 350; - e.quotesinglbase = 222; - e.quotedblbase = 333; - e.quotedblright = 333; - e.guillemotright = 556; - e.ellipsis = 1e3; - e.perthousand = 1e3; - e.questiondown = 611; - e.grave = 333; - e.acute = 333; - e.circumflex = 333; - e.tilde = 333; - e.macron = 333; - e.breve = 333; - e.dotaccent = 333; - e.dieresis = 333; - e.ring = 333; - e.cedilla = 333; - e.hungarumlaut = 333; - e.ogonek = 333; - e.caron = 333; - e.emdash = 1e3; - e.AE = 1e3; - e.ordfeminine = 370; - e.Lslash = 556; - e.Oslash = 778; - e.OE = 1e3; - e.ordmasculine = 365; - e.ae = 889; - e.dotlessi = 278; - e.lslash = 222; - e.oslash = 611; - e.oe = 944; - e.germandbls = 611; - e.Idieresis = 278; - e.eacute = 556; - e.abreve = 556; - e.uhungarumlaut = 556; - e.ecaron = 556; - e.Ydieresis = 667; - e.divide = 584; - e.Yacute = 667; - e.Acircumflex = 667; - e.aacute = 556; - e.Ucircumflex = 722; - e.yacute = 500; - e.scommaaccent = 500; - e.ecircumflex = 556; - e.Uring = 722; - e.Udieresis = 722; - e.aogonek = 556; - e.Uacute = 722; - e.uogonek = 556; - e.Edieresis = 667; - e.Dcroat = 722; - e.commaaccent = 250; - e.copyright = 737; - e.Emacron = 667; - e.ccaron = 500; - e.aring = 556; - e.Ncommaaccent = 722; - e.lacute = 222; - e.agrave = 556; - e.Tcommaaccent = 611; - e.Cacute = 722; - e.atilde = 556; - e.Edotaccent = 667; - e.scaron = 500; - e.scedilla = 500; - e.iacute = 278; - e.lozenge = 471; - e.Rcaron = 722; - e.Gcommaaccent = 778; - e.ucircumflex = 556; - e.acircumflex = 556; - e.Amacron = 667; - e.rcaron = 333; - e.ccedilla = 500; - e.Zdotaccent = 611; - e.Thorn = 667; - e.Omacron = 778; - e.Racute = 722; - e.Sacute = 667; - e.dcaron = 643; - e.Umacron = 722; - e.uring = 556; - e.threesuperior = 333; - e.Ograve = 778; - e.Agrave = 667; - e.Abreve = 667; - e.multiply = 584; - e.uacute = 556; - e.Tcaron = 611; - e.partialdiff = 476; - e.ydieresis = 500; - e.Nacute = 722; - e.icircumflex = 278; - e.Ecircumflex = 667; - e.adieresis = 556; - e.edieresis = 556; - e.cacute = 500; - e.nacute = 556; - e.umacron = 556; - e.Ncaron = 722; - e.Iacute = 278; - e.plusminus = 584; - e.brokenbar = 260; - e.registered = 737; - e.Gbreve = 778; - e.Idotaccent = 278; - e.summation = 600; - e.Egrave = 667; - e.racute = 333; - e.omacron = 556; - e.Zacute = 611; - e.Zcaron = 611; - e.greaterequal = 549; - e.Eth = 722; - e.Ccedilla = 722; - e.lcommaaccent = 222; - e.tcaron = 317; - e.eogonek = 556; - e.Uogonek = 722; - e.Aacute = 667; - e.Adieresis = 667; - e.egrave = 556; - e.zacute = 500; - e.iogonek = 222; - e.Oacute = 778; - e.oacute = 556; - e.amacron = 556; - e.sacute = 500; - e.idieresis = 278; - e.Ocircumflex = 778; - e.Ugrave = 722; - e.Delta = 612; - e.thorn = 556; - e.twosuperior = 333; - e.Odieresis = 778; - e.mu = 556; - e.igrave = 278; - e.ohungarumlaut = 556; - e.Eogonek = 667; - e.dcroat = 556; - e.threequarters = 834; - e.Scedilla = 667; - e.lcaron = 299; - e.Kcommaaccent = 667; - e.Lacute = 556; - e.trademark = 1e3; - e.edotaccent = 556; - e.Igrave = 278; - e.Imacron = 278; - e.Lcaron = 556; - e.onehalf = 834; - e.lessequal = 549; - e.ocircumflex = 556; - e.ntilde = 556; - e.Uhungarumlaut = 722; - e.Eacute = 667; - e.emacron = 556; - e.gbreve = 556; - e.onequarter = 834; - e.Scaron = 667; - e.Scommaaccent = 667; - e.Ohungarumlaut = 778; - e.degree = 400; - e.ograve = 556; - e.Ccaron = 722; - e.ugrave = 556; - e.radical = 453; - e.Dcaron = 722; - e.rcommaaccent = 333; - e.Ntilde = 722; - e.otilde = 556; - e.Rcommaaccent = 722; - e.Lcommaaccent = 556; - e.Atilde = 667; - e.Aogonek = 667; - e.Aring = 667; - e.Otilde = 778; - e.zdotaccent = 500; - e.Ecaron = 667; - e.Iogonek = 278; - e.kcommaaccent = 500; - e.minus = 584; - e.Icircumflex = 278; - e.ncaron = 556; - e.tcommaaccent = 278; - e.logicalnot = 584; - e.odieresis = 556; - e.udieresis = 556; - e.notequal = 549; - e.gcommaaccent = 556; - e.eth = 556; - e.zcaron = 500; - e.ncommaaccent = 556; - e.onesuperior = 333; - e.imacron = 278; - e.Euro = 556; - }); - e["Helvetica-Bold"] = getLookupTableFactory(function (e) { - e.space = 278; - e.exclam = 333; - e.quotedbl = 474; - e.numbersign = 556; - e.dollar = 556; - e.percent = 889; - e.ampersand = 722; - e.quoteright = 278; - e.parenleft = 333; - e.parenright = 333; - e.asterisk = 389; - e.plus = 584; - e.comma = 278; - e.hyphen = 333; - e.period = 278; - e.slash = 278; - e.zero = 556; - e.one = 556; - e.two = 556; - e.three = 556; - e.four = 556; - e.five = 556; - e.six = 556; - e.seven = 556; - e.eight = 556; - e.nine = 556; - e.colon = 333; - e.semicolon = 333; - e.less = 584; - e.equal = 584; - e.greater = 584; - e.question = 611; - e.at = 975; - e.A = 722; - e.B = 722; - e.C = 722; - e.D = 722; - e.E = 667; - e.F = 611; - e.G = 778; - e.H = 722; - e.I = 278; - e.J = 556; - e.K = 722; - e.L = 611; - e.M = 833; - e.N = 722; - e.O = 778; - e.P = 667; - e.Q = 778; - e.R = 722; - e.S = 667; - e.T = 611; - e.U = 722; - e.V = 667; - e.W = 944; - e.X = 667; - e.Y = 667; - e.Z = 611; - e.bracketleft = 333; - e.backslash = 278; - e.bracketright = 333; - e.asciicircum = 584; - e.underscore = 556; - e.quoteleft = 278; - e.a = 556; - e.b = 611; - e.c = 556; - e.d = 611; - e.e = 556; - e.f = 333; - e.g = 611; - e.h = 611; - e.i = 278; - e.j = 278; - e.k = 556; - e.l = 278; - e.m = 889; - e.n = 611; - e.o = 611; - e.p = 611; - e.q = 611; - e.r = 389; - e.s = 556; - e.t = 333; - e.u = 611; - e.v = 556; - e.w = 778; - e.x = 556; - e.y = 556; - e.z = 500; - e.braceleft = 389; - e.bar = 280; - e.braceright = 389; - e.asciitilde = 584; - e.exclamdown = 333; - e.cent = 556; - e.sterling = 556; - e.fraction = 167; - e.yen = 556; - e.florin = 556; - e.section = 556; - e.currency = 556; - e.quotesingle = 238; - e.quotedblleft = 500; - e.guillemotleft = 556; - e.guilsinglleft = 333; - e.guilsinglright = 333; - e.fi = 611; - e.fl = 611; - e.endash = 556; - e.dagger = 556; - e.daggerdbl = 556; - e.periodcentered = 278; - e.paragraph = 556; - e.bullet = 350; - e.quotesinglbase = 278; - e.quotedblbase = 500; - e.quotedblright = 500; - e.guillemotright = 556; - e.ellipsis = 1e3; - e.perthousand = 1e3; - e.questiondown = 611; - e.grave = 333; - e.acute = 333; - e.circumflex = 333; - e.tilde = 333; - e.macron = 333; - e.breve = 333; - e.dotaccent = 333; - e.dieresis = 333; - e.ring = 333; - e.cedilla = 333; - e.hungarumlaut = 333; - e.ogonek = 333; - e.caron = 333; - e.emdash = 1e3; - e.AE = 1e3; - e.ordfeminine = 370; - e.Lslash = 611; - e.Oslash = 778; - e.OE = 1e3; - e.ordmasculine = 365; - e.ae = 889; - e.dotlessi = 278; - e.lslash = 278; - e.oslash = 611; - e.oe = 944; - e.germandbls = 611; - e.Idieresis = 278; - e.eacute = 556; - e.abreve = 556; - e.uhungarumlaut = 611; - e.ecaron = 556; - e.Ydieresis = 667; - e.divide = 584; - e.Yacute = 667; - e.Acircumflex = 722; - e.aacute = 556; - e.Ucircumflex = 722; - e.yacute = 556; - e.scommaaccent = 556; - e.ecircumflex = 556; - e.Uring = 722; - e.Udieresis = 722; - e.aogonek = 556; - e.Uacute = 722; - e.uogonek = 611; - e.Edieresis = 667; - e.Dcroat = 722; - e.commaaccent = 250; - e.copyright = 737; - e.Emacron = 667; - e.ccaron = 556; - e.aring = 556; - e.Ncommaaccent = 722; - e.lacute = 278; - e.agrave = 556; - e.Tcommaaccent = 611; - e.Cacute = 722; - e.atilde = 556; - e.Edotaccent = 667; - e.scaron = 556; - e.scedilla = 556; - e.iacute = 278; - e.lozenge = 494; - e.Rcaron = 722; - e.Gcommaaccent = 778; - e.ucircumflex = 611; - e.acircumflex = 556; - e.Amacron = 722; - e.rcaron = 389; - e.ccedilla = 556; - e.Zdotaccent = 611; - e.Thorn = 667; - e.Omacron = 778; - e.Racute = 722; - e.Sacute = 667; - e.dcaron = 743; - e.Umacron = 722; - e.uring = 611; - e.threesuperior = 333; - e.Ograve = 778; - e.Agrave = 722; - e.Abreve = 722; - e.multiply = 584; - e.uacute = 611; - e.Tcaron = 611; - e.partialdiff = 494; - e.ydieresis = 556; - e.Nacute = 722; - e.icircumflex = 278; - e.Ecircumflex = 667; - e.adieresis = 556; - e.edieresis = 556; - e.cacute = 556; - e.nacute = 611; - e.umacron = 611; - e.Ncaron = 722; - e.Iacute = 278; - e.plusminus = 584; - e.brokenbar = 280; - e.registered = 737; - e.Gbreve = 778; - e.Idotaccent = 278; - e.summation = 600; - e.Egrave = 667; - e.racute = 389; - e.omacron = 611; - e.Zacute = 611; - e.Zcaron = 611; - e.greaterequal = 549; - e.Eth = 722; - e.Ccedilla = 722; - e.lcommaaccent = 278; - e.tcaron = 389; - e.eogonek = 556; - e.Uogonek = 722; - e.Aacute = 722; - e.Adieresis = 722; - e.egrave = 556; - e.zacute = 500; - e.iogonek = 278; - e.Oacute = 778; - e.oacute = 611; - e.amacron = 556; - e.sacute = 556; - e.idieresis = 278; - e.Ocircumflex = 778; - e.Ugrave = 722; - e.Delta = 612; - e.thorn = 611; - e.twosuperior = 333; - e.Odieresis = 778; - e.mu = 611; - e.igrave = 278; - e.ohungarumlaut = 611; - e.Eogonek = 667; - e.dcroat = 611; - e.threequarters = 834; - e.Scedilla = 667; - e.lcaron = 400; - e.Kcommaaccent = 722; - e.Lacute = 611; - e.trademark = 1e3; - e.edotaccent = 556; - e.Igrave = 278; - e.Imacron = 278; - e.Lcaron = 611; - e.onehalf = 834; - e.lessequal = 549; - e.ocircumflex = 611; - e.ntilde = 611; - e.Uhungarumlaut = 722; - e.Eacute = 667; - e.emacron = 556; - e.gbreve = 611; - e.onequarter = 834; - e.Scaron = 667; - e.Scommaaccent = 667; - e.Ohungarumlaut = 778; - e.degree = 400; - e.ograve = 611; - e.Ccaron = 722; - e.ugrave = 611; - e.radical = 549; - e.Dcaron = 722; - e.rcommaaccent = 389; - e.Ntilde = 722; - e.otilde = 611; - e.Rcommaaccent = 722; - e.Lcommaaccent = 611; - e.Atilde = 722; - e.Aogonek = 722; - e.Aring = 722; - e.Otilde = 778; - e.zdotaccent = 500; - e.Ecaron = 667; - e.Iogonek = 278; - e.kcommaaccent = 556; - e.minus = 584; - e.Icircumflex = 278; - e.ncaron = 611; - e.tcommaaccent = 333; - e.logicalnot = 584; - e.odieresis = 611; - e.udieresis = 611; - e.notequal = 549; - e.gcommaaccent = 611; - e.eth = 611; - e.zcaron = 500; - e.ncommaaccent = 611; - e.onesuperior = 333; - e.imacron = 278; - e.Euro = 556; - }); - e["Helvetica-BoldOblique"] = getLookupTableFactory(function (e) { - e.space = 278; - e.exclam = 333; - e.quotedbl = 474; - e.numbersign = 556; - e.dollar = 556; - e.percent = 889; - e.ampersand = 722; - e.quoteright = 278; - e.parenleft = 333; - e.parenright = 333; - e.asterisk = 389; - e.plus = 584; - e.comma = 278; - e.hyphen = 333; - e.period = 278; - e.slash = 278; - e.zero = 556; - e.one = 556; - e.two = 556; - e.three = 556; - e.four = 556; - e.five = 556; - e.six = 556; - e.seven = 556; - e.eight = 556; - e.nine = 556; - e.colon = 333; - e.semicolon = 333; - e.less = 584; - e.equal = 584; - e.greater = 584; - e.question = 611; - e.at = 975; - e.A = 722; - e.B = 722; - e.C = 722; - e.D = 722; - e.E = 667; - e.F = 611; - e.G = 778; - e.H = 722; - e.I = 278; - e.J = 556; - e.K = 722; - e.L = 611; - e.M = 833; - e.N = 722; - e.O = 778; - e.P = 667; - e.Q = 778; - e.R = 722; - e.S = 667; - e.T = 611; - e.U = 722; - e.V = 667; - e.W = 944; - e.X = 667; - e.Y = 667; - e.Z = 611; - e.bracketleft = 333; - e.backslash = 278; - e.bracketright = 333; - e.asciicircum = 584; - e.underscore = 556; - e.quoteleft = 278; - e.a = 556; - e.b = 611; - e.c = 556; - e.d = 611; - e.e = 556; - e.f = 333; - e.g = 611; - e.h = 611; - e.i = 278; - e.j = 278; - e.k = 556; - e.l = 278; - e.m = 889; - e.n = 611; - e.o = 611; - e.p = 611; - e.q = 611; - e.r = 389; - e.s = 556; - e.t = 333; - e.u = 611; - e.v = 556; - e.w = 778; - e.x = 556; - e.y = 556; - e.z = 500; - e.braceleft = 389; - e.bar = 280; - e.braceright = 389; - e.asciitilde = 584; - e.exclamdown = 333; - e.cent = 556; - e.sterling = 556; - e.fraction = 167; - e.yen = 556; - e.florin = 556; - e.section = 556; - e.currency = 556; - e.quotesingle = 238; - e.quotedblleft = 500; - e.guillemotleft = 556; - e.guilsinglleft = 333; - e.guilsinglright = 333; - e.fi = 611; - e.fl = 611; - e.endash = 556; - e.dagger = 556; - e.daggerdbl = 556; - e.periodcentered = 278; - e.paragraph = 556; - e.bullet = 350; - e.quotesinglbase = 278; - e.quotedblbase = 500; - e.quotedblright = 500; - e.guillemotright = 556; - e.ellipsis = 1e3; - e.perthousand = 1e3; - e.questiondown = 611; - e.grave = 333; - e.acute = 333; - e.circumflex = 333; - e.tilde = 333; - e.macron = 333; - e.breve = 333; - e.dotaccent = 333; - e.dieresis = 333; - e.ring = 333; - e.cedilla = 333; - e.hungarumlaut = 333; - e.ogonek = 333; - e.caron = 333; - e.emdash = 1e3; - e.AE = 1e3; - e.ordfeminine = 370; - e.Lslash = 611; - e.Oslash = 778; - e.OE = 1e3; - e.ordmasculine = 365; - e.ae = 889; - e.dotlessi = 278; - e.lslash = 278; - e.oslash = 611; - e.oe = 944; - e.germandbls = 611; - e.Idieresis = 278; - e.eacute = 556; - e.abreve = 556; - e.uhungarumlaut = 611; - e.ecaron = 556; - e.Ydieresis = 667; - e.divide = 584; - e.Yacute = 667; - e.Acircumflex = 722; - e.aacute = 556; - e.Ucircumflex = 722; - e.yacute = 556; - e.scommaaccent = 556; - e.ecircumflex = 556; - e.Uring = 722; - e.Udieresis = 722; - e.aogonek = 556; - e.Uacute = 722; - e.uogonek = 611; - e.Edieresis = 667; - e.Dcroat = 722; - e.commaaccent = 250; - e.copyright = 737; - e.Emacron = 667; - e.ccaron = 556; - e.aring = 556; - e.Ncommaaccent = 722; - e.lacute = 278; - e.agrave = 556; - e.Tcommaaccent = 611; - e.Cacute = 722; - e.atilde = 556; - e.Edotaccent = 667; - e.scaron = 556; - e.scedilla = 556; - e.iacute = 278; - e.lozenge = 494; - e.Rcaron = 722; - e.Gcommaaccent = 778; - e.ucircumflex = 611; - e.acircumflex = 556; - e.Amacron = 722; - e.rcaron = 389; - e.ccedilla = 556; - e.Zdotaccent = 611; - e.Thorn = 667; - e.Omacron = 778; - e.Racute = 722; - e.Sacute = 667; - e.dcaron = 743; - e.Umacron = 722; - e.uring = 611; - e.threesuperior = 333; - e.Ograve = 778; - e.Agrave = 722; - e.Abreve = 722; - e.multiply = 584; - e.uacute = 611; - e.Tcaron = 611; - e.partialdiff = 494; - e.ydieresis = 556; - e.Nacute = 722; - e.icircumflex = 278; - e.Ecircumflex = 667; - e.adieresis = 556; - e.edieresis = 556; - e.cacute = 556; - e.nacute = 611; - e.umacron = 611; - e.Ncaron = 722; - e.Iacute = 278; - e.plusminus = 584; - e.brokenbar = 280; - e.registered = 737; - e.Gbreve = 778; - e.Idotaccent = 278; - e.summation = 600; - e.Egrave = 667; - e.racute = 389; - e.omacron = 611; - e.Zacute = 611; - e.Zcaron = 611; - e.greaterequal = 549; - e.Eth = 722; - e.Ccedilla = 722; - e.lcommaaccent = 278; - e.tcaron = 389; - e.eogonek = 556; - e.Uogonek = 722; - e.Aacute = 722; - e.Adieresis = 722; - e.egrave = 556; - e.zacute = 500; - e.iogonek = 278; - e.Oacute = 778; - e.oacute = 611; - e.amacron = 556; - e.sacute = 556; - e.idieresis = 278; - e.Ocircumflex = 778; - e.Ugrave = 722; - e.Delta = 612; - e.thorn = 611; - e.twosuperior = 333; - e.Odieresis = 778; - e.mu = 611; - e.igrave = 278; - e.ohungarumlaut = 611; - e.Eogonek = 667; - e.dcroat = 611; - e.threequarters = 834; - e.Scedilla = 667; - e.lcaron = 400; - e.Kcommaaccent = 722; - e.Lacute = 611; - e.trademark = 1e3; - e.edotaccent = 556; - e.Igrave = 278; - e.Imacron = 278; - e.Lcaron = 611; - e.onehalf = 834; - e.lessequal = 549; - e.ocircumflex = 611; - e.ntilde = 611; - e.Uhungarumlaut = 722; - e.Eacute = 667; - e.emacron = 556; - e.gbreve = 611; - e.onequarter = 834; - e.Scaron = 667; - e.Scommaaccent = 667; - e.Ohungarumlaut = 778; - e.degree = 400; - e.ograve = 611; - e.Ccaron = 722; - e.ugrave = 611; - e.radical = 549; - e.Dcaron = 722; - e.rcommaaccent = 389; - e.Ntilde = 722; - e.otilde = 611; - e.Rcommaaccent = 722; - e.Lcommaaccent = 611; - e.Atilde = 722; - e.Aogonek = 722; - e.Aring = 722; - e.Otilde = 778; - e.zdotaccent = 500; - e.Ecaron = 667; - e.Iogonek = 278; - e.kcommaaccent = 556; - e.minus = 584; - e.Icircumflex = 278; - e.ncaron = 611; - e.tcommaaccent = 333; - e.logicalnot = 584; - e.odieresis = 611; - e.udieresis = 611; - e.notequal = 549; - e.gcommaaccent = 611; - e.eth = 611; - e.zcaron = 500; - e.ncommaaccent = 611; - e.onesuperior = 333; - e.imacron = 278; - e.Euro = 556; - }); - e["Helvetica-Oblique"] = getLookupTableFactory(function (e) { - e.space = 278; - e.exclam = 278; - e.quotedbl = 355; - e.numbersign = 556; - e.dollar = 556; - e.percent = 889; - e.ampersand = 667; - e.quoteright = 222; - e.parenleft = 333; - e.parenright = 333; - e.asterisk = 389; - e.plus = 584; - e.comma = 278; - e.hyphen = 333; - e.period = 278; - e.slash = 278; - e.zero = 556; - e.one = 556; - e.two = 556; - e.three = 556; - e.four = 556; - e.five = 556; - e.six = 556; - e.seven = 556; - e.eight = 556; - e.nine = 556; - e.colon = 278; - e.semicolon = 278; - e.less = 584; - e.equal = 584; - e.greater = 584; - e.question = 556; - e.at = 1015; - e.A = 667; - e.B = 667; - e.C = 722; - e.D = 722; - e.E = 667; - e.F = 611; - e.G = 778; - e.H = 722; - e.I = 278; - e.J = 500; - e.K = 667; - e.L = 556; - e.M = 833; - e.N = 722; - e.O = 778; - e.P = 667; - e.Q = 778; - e.R = 722; - e.S = 667; - e.T = 611; - e.U = 722; - e.V = 667; - e.W = 944; - e.X = 667; - e.Y = 667; - e.Z = 611; - e.bracketleft = 278; - e.backslash = 278; - e.bracketright = 278; - e.asciicircum = 469; - e.underscore = 556; - e.quoteleft = 222; - e.a = 556; - e.b = 556; - e.c = 500; - e.d = 556; - e.e = 556; - e.f = 278; - e.g = 556; - e.h = 556; - e.i = 222; - e.j = 222; - e.k = 500; - e.l = 222; - e.m = 833; - e.n = 556; - e.o = 556; - e.p = 556; - e.q = 556; - e.r = 333; - e.s = 500; - e.t = 278; - e.u = 556; - e.v = 500; - e.w = 722; - e.x = 500; - e.y = 500; - e.z = 500; - e.braceleft = 334; - e.bar = 260; - e.braceright = 334; - e.asciitilde = 584; - e.exclamdown = 333; - e.cent = 556; - e.sterling = 556; - e.fraction = 167; - e.yen = 556; - e.florin = 556; - e.section = 556; - e.currency = 556; - e.quotesingle = 191; - e.quotedblleft = 333; - e.guillemotleft = 556; - e.guilsinglleft = 333; - e.guilsinglright = 333; - e.fi = 500; - e.fl = 500; - e.endash = 556; - e.dagger = 556; - e.daggerdbl = 556; - e.periodcentered = 278; - e.paragraph = 537; - e.bullet = 350; - e.quotesinglbase = 222; - e.quotedblbase = 333; - e.quotedblright = 333; - e.guillemotright = 556; - e.ellipsis = 1e3; - e.perthousand = 1e3; - e.questiondown = 611; - e.grave = 333; - e.acute = 333; - e.circumflex = 333; - e.tilde = 333; - e.macron = 333; - e.breve = 333; - e.dotaccent = 333; - e.dieresis = 333; - e.ring = 333; - e.cedilla = 333; - e.hungarumlaut = 333; - e.ogonek = 333; - e.caron = 333; - e.emdash = 1e3; - e.AE = 1e3; - e.ordfeminine = 370; - e.Lslash = 556; - e.Oslash = 778; - e.OE = 1e3; - e.ordmasculine = 365; - e.ae = 889; - e.dotlessi = 278; - e.lslash = 222; - e.oslash = 611; - e.oe = 944; - e.germandbls = 611; - e.Idieresis = 278; - e.eacute = 556; - e.abreve = 556; - e.uhungarumlaut = 556; - e.ecaron = 556; - e.Ydieresis = 667; - e.divide = 584; - e.Yacute = 667; - e.Acircumflex = 667; - e.aacute = 556; - e.Ucircumflex = 722; - e.yacute = 500; - e.scommaaccent = 500; - e.ecircumflex = 556; - e.Uring = 722; - e.Udieresis = 722; - e.aogonek = 556; - e.Uacute = 722; - e.uogonek = 556; - e.Edieresis = 667; - e.Dcroat = 722; - e.commaaccent = 250; - e.copyright = 737; - e.Emacron = 667; - e.ccaron = 500; - e.aring = 556; - e.Ncommaaccent = 722; - e.lacute = 222; - e.agrave = 556; - e.Tcommaaccent = 611; - e.Cacute = 722; - e.atilde = 556; - e.Edotaccent = 667; - e.scaron = 500; - e.scedilla = 500; - e.iacute = 278; - e.lozenge = 471; - e.Rcaron = 722; - e.Gcommaaccent = 778; - e.ucircumflex = 556; - e.acircumflex = 556; - e.Amacron = 667; - e.rcaron = 333; - e.ccedilla = 500; - e.Zdotaccent = 611; - e.Thorn = 667; - e.Omacron = 778; - e.Racute = 722; - e.Sacute = 667; - e.dcaron = 643; - e.Umacron = 722; - e.uring = 556; - e.threesuperior = 333; - e.Ograve = 778; - e.Agrave = 667; - e.Abreve = 667; - e.multiply = 584; - e.uacute = 556; - e.Tcaron = 611; - e.partialdiff = 476; - e.ydieresis = 500; - e.Nacute = 722; - e.icircumflex = 278; - e.Ecircumflex = 667; - e.adieresis = 556; - e.edieresis = 556; - e.cacute = 500; - e.nacute = 556; - e.umacron = 556; - e.Ncaron = 722; - e.Iacute = 278; - e.plusminus = 584; - e.brokenbar = 260; - e.registered = 737; - e.Gbreve = 778; - e.Idotaccent = 278; - e.summation = 600; - e.Egrave = 667; - e.racute = 333; - e.omacron = 556; - e.Zacute = 611; - e.Zcaron = 611; - e.greaterequal = 549; - e.Eth = 722; - e.Ccedilla = 722; - e.lcommaaccent = 222; - e.tcaron = 317; - e.eogonek = 556; - e.Uogonek = 722; - e.Aacute = 667; - e.Adieresis = 667; - e.egrave = 556; - e.zacute = 500; - e.iogonek = 222; - e.Oacute = 778; - e.oacute = 556; - e.amacron = 556; - e.sacute = 500; - e.idieresis = 278; - e.Ocircumflex = 778; - e.Ugrave = 722; - e.Delta = 612; - e.thorn = 556; - e.twosuperior = 333; - e.Odieresis = 778; - e.mu = 556; - e.igrave = 278; - e.ohungarumlaut = 556; - e.Eogonek = 667; - e.dcroat = 556; - e.threequarters = 834; - e.Scedilla = 667; - e.lcaron = 299; - e.Kcommaaccent = 667; - e.Lacute = 556; - e.trademark = 1e3; - e.edotaccent = 556; - e.Igrave = 278; - e.Imacron = 278; - e.Lcaron = 556; - e.onehalf = 834; - e.lessequal = 549; - e.ocircumflex = 556; - e.ntilde = 556; - e.Uhungarumlaut = 722; - e.Eacute = 667; - e.emacron = 556; - e.gbreve = 556; - e.onequarter = 834; - e.Scaron = 667; - e.Scommaaccent = 667; - e.Ohungarumlaut = 778; - e.degree = 400; - e.ograve = 556; - e.Ccaron = 722; - e.ugrave = 556; - e.radical = 453; - e.Dcaron = 722; - e.rcommaaccent = 333; - e.Ntilde = 722; - e.otilde = 556; - e.Rcommaaccent = 722; - e.Lcommaaccent = 556; - e.Atilde = 667; - e.Aogonek = 667; - e.Aring = 667; - e.Otilde = 778; - e.zdotaccent = 500; - e.Ecaron = 667; - e.Iogonek = 278; - e.kcommaaccent = 500; - e.minus = 584; - e.Icircumflex = 278; - e.ncaron = 556; - e.tcommaaccent = 278; - e.logicalnot = 584; - e.odieresis = 556; - e.udieresis = 556; - e.notequal = 549; - e.gcommaaccent = 556; - e.eth = 556; - e.zcaron = 500; - e.ncommaaccent = 556; - e.onesuperior = 333; - e.imacron = 278; - e.Euro = 556; - }); - e.Symbol = getLookupTableFactory(function (e) { - e.space = 250; - e.exclam = 333; - e.universal = 713; - e.numbersign = 500; - e.existential = 549; - e.percent = 833; - e.ampersand = 778; - e.suchthat = 439; - e.parenleft = 333; - e.parenright = 333; - e.asteriskmath = 500; - e.plus = 549; - e.comma = 250; - e.minus = 549; - e.period = 250; - e.slash = 278; - e.zero = 500; - e.one = 500; - e.two = 500; - e.three = 500; - e.four = 500; - e.five = 500; - e.six = 500; - e.seven = 500; - e.eight = 500; - e.nine = 500; - e.colon = 278; - e.semicolon = 278; - e.less = 549; - e.equal = 549; - e.greater = 549; - e.question = 444; - e.congruent = 549; - e.Alpha = 722; - e.Beta = 667; - e.Chi = 722; - e.Delta = 612; - e.Epsilon = 611; - e.Phi = 763; - e.Gamma = 603; - e.Eta = 722; - e.Iota = 333; - e.theta1 = 631; - e.Kappa = 722; - e.Lambda = 686; - e.Mu = 889; - e.Nu = 722; - e.Omicron = 722; - e.Pi = 768; - e.Theta = 741; - e.Rho = 556; - e.Sigma = 592; - e.Tau = 611; - e.Upsilon = 690; - e.sigma1 = 439; - e.Omega = 768; - e.Xi = 645; - e.Psi = 795; - e.Zeta = 611; - e.bracketleft = 333; - e.therefore = 863; - e.bracketright = 333; - e.perpendicular = 658; - e.underscore = 500; - e.radicalex = 500; - e.alpha = 631; - e.beta = 549; - e.chi = 549; - e.delta = 494; - e.epsilon = 439; - e.phi = 521; - e.gamma = 411; - e.eta = 603; - e.iota = 329; - e.phi1 = 603; - e.kappa = 549; - e.lambda = 549; - e.mu = 576; - e.nu = 521; - e.omicron = 549; - e.pi = 549; - e.theta = 521; - e.rho = 549; - e.sigma = 603; - e.tau = 439; - e.upsilon = 576; - e.omega1 = 713; - e.omega = 686; - e.xi = 493; - e.psi = 686; - e.zeta = 494; - e.braceleft = 480; - e.bar = 200; - e.braceright = 480; - e.similar = 549; - e.Euro = 750; - e.Upsilon1 = 620; - e.minute = 247; - e.lessequal = 549; - e.fraction = 167; - e.infinity = 713; - e.florin = 500; - e.club = 753; - e.diamond = 753; - e.heart = 753; - e.spade = 753; - e.arrowboth = 1042; - e.arrowleft = 987; - e.arrowup = 603; - e.arrowright = 987; - e.arrowdown = 603; - e.degree = 400; - e.plusminus = 549; - e.second = 411; - e.greaterequal = 549; - e.multiply = 549; - e.proportional = 713; - e.partialdiff = 494; - e.bullet = 460; - e.divide = 549; - e.notequal = 549; - e.equivalence = 549; - e.approxequal = 549; - e.ellipsis = 1e3; - e.arrowvertex = 603; - e.arrowhorizex = 1e3; - e.carriagereturn = 658; - e.aleph = 823; - e.Ifraktur = 686; - e.Rfraktur = 795; - e.weierstrass = 987; - e.circlemultiply = 768; - e.circleplus = 768; - e.emptyset = 823; - e.intersection = 768; - e.union = 768; - e.propersuperset = 713; - e.reflexsuperset = 713; - e.notsubset = 713; - e.propersubset = 713; - e.reflexsubset = 713; - e.element = 713; - e.notelement = 713; - e.angle = 768; - e.gradient = 713; - e.registerserif = 790; - e.copyrightserif = 790; - e.trademarkserif = 890; - e.product = 823; - e.radical = 549; - e.dotmath = 250; - e.logicalnot = 713; - e.logicaland = 603; - e.logicalor = 603; - e.arrowdblboth = 1042; - e.arrowdblleft = 987; - e.arrowdblup = 603; - e.arrowdblright = 987; - e.arrowdbldown = 603; - e.lozenge = 494; - e.angleleft = 329; - e.registersans = 790; - e.copyrightsans = 790; - e.trademarksans = 786; - e.summation = 713; - e.parenlefttp = 384; - e.parenleftex = 384; - e.parenleftbt = 384; - e.bracketlefttp = 384; - e.bracketleftex = 384; - e.bracketleftbt = 384; - e.bracelefttp = 494; - e.braceleftmid = 494; - e.braceleftbt = 494; - e.braceex = 494; - e.angleright = 329; - e.integral = 274; - e.integraltp = 686; - e.integralex = 686; - e.integralbt = 686; - e.parenrighttp = 384; - e.parenrightex = 384; - e.parenrightbt = 384; - e.bracketrighttp = 384; - e.bracketrightex = 384; - e.bracketrightbt = 384; - e.bracerighttp = 494; - e.bracerightmid = 494; - e.bracerightbt = 494; - e.apple = 790; - }); - e["Times-Roman"] = getLookupTableFactory(function (e) { - e.space = 250; - e.exclam = 333; - e.quotedbl = 408; - e.numbersign = 500; - e.dollar = 500; - e.percent = 833; - e.ampersand = 778; - e.quoteright = 333; - e.parenleft = 333; - e.parenright = 333; - e.asterisk = 500; - e.plus = 564; - e.comma = 250; - e.hyphen = 333; - e.period = 250; - e.slash = 278; - e.zero = 500; - e.one = 500; - e.two = 500; - e.three = 500; - e.four = 500; - e.five = 500; - e.six = 500; - e.seven = 500; - e.eight = 500; - e.nine = 500; - e.colon = 278; - e.semicolon = 278; - e.less = 564; - e.equal = 564; - e.greater = 564; - e.question = 444; - e.at = 921; - e.A = 722; - e.B = 667; - e.C = 667; - e.D = 722; - e.E = 611; - e.F = 556; - e.G = 722; - e.H = 722; - e.I = 333; - e.J = 389; - e.K = 722; - e.L = 611; - e.M = 889; - e.N = 722; - e.O = 722; - e.P = 556; - e.Q = 722; - e.R = 667; - e.S = 556; - e.T = 611; - e.U = 722; - e.V = 722; - e.W = 944; - e.X = 722; - e.Y = 722; - e.Z = 611; - e.bracketleft = 333; - e.backslash = 278; - e.bracketright = 333; - e.asciicircum = 469; - e.underscore = 500; - e.quoteleft = 333; - e.a = 444; - e.b = 500; - e.c = 444; - e.d = 500; - e.e = 444; - e.f = 333; - e.g = 500; - e.h = 500; - e.i = 278; - e.j = 278; - e.k = 500; - e.l = 278; - e.m = 778; - e.n = 500; - e.o = 500; - e.p = 500; - e.q = 500; - e.r = 333; - e.s = 389; - e.t = 278; - e.u = 500; - e.v = 500; - e.w = 722; - e.x = 500; - e.y = 500; - e.z = 444; - e.braceleft = 480; - e.bar = 200; - e.braceright = 480; - e.asciitilde = 541; - e.exclamdown = 333; - e.cent = 500; - e.sterling = 500; - e.fraction = 167; - e.yen = 500; - e.florin = 500; - e.section = 500; - e.currency = 500; - e.quotesingle = 180; - e.quotedblleft = 444; - e.guillemotleft = 500; - e.guilsinglleft = 333; - e.guilsinglright = 333; - e.fi = 556; - e.fl = 556; - e.endash = 500; - e.dagger = 500; - e.daggerdbl = 500; - e.periodcentered = 250; - e.paragraph = 453; - e.bullet = 350; - e.quotesinglbase = 333; - e.quotedblbase = 444; - e.quotedblright = 444; - e.guillemotright = 500; - e.ellipsis = 1e3; - e.perthousand = 1e3; - e.questiondown = 444; - e.grave = 333; - e.acute = 333; - e.circumflex = 333; - e.tilde = 333; - e.macron = 333; - e.breve = 333; - e.dotaccent = 333; - e.dieresis = 333; - e.ring = 333; - e.cedilla = 333; - e.hungarumlaut = 333; - e.ogonek = 333; - e.caron = 333; - e.emdash = 1e3; - e.AE = 889; - e.ordfeminine = 276; - e.Lslash = 611; - e.Oslash = 722; - e.OE = 889; - e.ordmasculine = 310; - e.ae = 667; - e.dotlessi = 278; - e.lslash = 278; - e.oslash = 500; - e.oe = 722; - e.germandbls = 500; - e.Idieresis = 333; - e.eacute = 444; - e.abreve = 444; - e.uhungarumlaut = 500; - e.ecaron = 444; - e.Ydieresis = 722; - e.divide = 564; - e.Yacute = 722; - e.Acircumflex = 722; - e.aacute = 444; - e.Ucircumflex = 722; - e.yacute = 500; - e.scommaaccent = 389; - e.ecircumflex = 444; - e.Uring = 722; - e.Udieresis = 722; - e.aogonek = 444; - e.Uacute = 722; - e.uogonek = 500; - e.Edieresis = 611; - e.Dcroat = 722; - e.commaaccent = 250; - e.copyright = 760; - e.Emacron = 611; - e.ccaron = 444; - e.aring = 444; - e.Ncommaaccent = 722; - e.lacute = 278; - e.agrave = 444; - e.Tcommaaccent = 611; - e.Cacute = 667; - e.atilde = 444; - e.Edotaccent = 611; - e.scaron = 389; - e.scedilla = 389; - e.iacute = 278; - e.lozenge = 471; - e.Rcaron = 667; - e.Gcommaaccent = 722; - e.ucircumflex = 500; - e.acircumflex = 444; - e.Amacron = 722; - e.rcaron = 333; - e.ccedilla = 444; - e.Zdotaccent = 611; - e.Thorn = 556; - e.Omacron = 722; - e.Racute = 667; - e.Sacute = 556; - e.dcaron = 588; - e.Umacron = 722; - e.uring = 500; - e.threesuperior = 300; - e.Ograve = 722; - e.Agrave = 722; - e.Abreve = 722; - e.multiply = 564; - e.uacute = 500; - e.Tcaron = 611; - e.partialdiff = 476; - e.ydieresis = 500; - e.Nacute = 722; - e.icircumflex = 278; - e.Ecircumflex = 611; - e.adieresis = 444; - e.edieresis = 444; - e.cacute = 444; - e.nacute = 500; - e.umacron = 500; - e.Ncaron = 722; - e.Iacute = 333; - e.plusminus = 564; - e.brokenbar = 200; - e.registered = 760; - e.Gbreve = 722; - e.Idotaccent = 333; - e.summation = 600; - e.Egrave = 611; - e.racute = 333; - e.omacron = 500; - e.Zacute = 611; - e.Zcaron = 611; - e.greaterequal = 549; - e.Eth = 722; - e.Ccedilla = 667; - e.lcommaaccent = 278; - e.tcaron = 326; - e.eogonek = 444; - e.Uogonek = 722; - e.Aacute = 722; - e.Adieresis = 722; - e.egrave = 444; - e.zacute = 444; - e.iogonek = 278; - e.Oacute = 722; - e.oacute = 500; - e.amacron = 444; - e.sacute = 389; - e.idieresis = 278; - e.Ocircumflex = 722; - e.Ugrave = 722; - e.Delta = 612; - e.thorn = 500; - e.twosuperior = 300; - e.Odieresis = 722; - e.mu = 500; - e.igrave = 278; - e.ohungarumlaut = 500; - e.Eogonek = 611; - e.dcroat = 500; - e.threequarters = 750; - e.Scedilla = 556; - e.lcaron = 344; - e.Kcommaaccent = 722; - e.Lacute = 611; - e.trademark = 980; - e.edotaccent = 444; - e.Igrave = 333; - e.Imacron = 333; - e.Lcaron = 611; - e.onehalf = 750; - e.lessequal = 549; - e.ocircumflex = 500; - e.ntilde = 500; - e.Uhungarumlaut = 722; - e.Eacute = 611; - e.emacron = 444; - e.gbreve = 500; - e.onequarter = 750; - e.Scaron = 556; - e.Scommaaccent = 556; - e.Ohungarumlaut = 722; - e.degree = 400; - e.ograve = 500; - e.Ccaron = 667; - e.ugrave = 500; - e.radical = 453; - e.Dcaron = 722; - e.rcommaaccent = 333; - e.Ntilde = 722; - e.otilde = 500; - e.Rcommaaccent = 667; - e.Lcommaaccent = 611; - e.Atilde = 722; - e.Aogonek = 722; - e.Aring = 722; - e.Otilde = 722; - e.zdotaccent = 444; - e.Ecaron = 611; - e.Iogonek = 333; - e.kcommaaccent = 500; - e.minus = 564; - e.Icircumflex = 333; - e.ncaron = 500; - e.tcommaaccent = 278; - e.logicalnot = 564; - e.odieresis = 500; - e.udieresis = 500; - e.notequal = 549; - e.gcommaaccent = 500; - e.eth = 500; - e.zcaron = 444; - e.ncommaaccent = 500; - e.onesuperior = 300; - e.imacron = 278; - e.Euro = 500; - }); - e["Times-Bold"] = getLookupTableFactory(function (e) { - e.space = 250; - e.exclam = 333; - e.quotedbl = 555; - e.numbersign = 500; - e.dollar = 500; - e.percent = 1e3; - e.ampersand = 833; - e.quoteright = 333; - e.parenleft = 333; - e.parenright = 333; - e.asterisk = 500; - e.plus = 570; - e.comma = 250; - e.hyphen = 333; - e.period = 250; - e.slash = 278; - e.zero = 500; - e.one = 500; - e.two = 500; - e.three = 500; - e.four = 500; - e.five = 500; - e.six = 500; - e.seven = 500; - e.eight = 500; - e.nine = 500; - e.colon = 333; - e.semicolon = 333; - e.less = 570; - e.equal = 570; - e.greater = 570; - e.question = 500; - e.at = 930; - e.A = 722; - e.B = 667; - e.C = 722; - e.D = 722; - e.E = 667; - e.F = 611; - e.G = 778; - e.H = 778; - e.I = 389; - e.J = 500; - e.K = 778; - e.L = 667; - e.M = 944; - e.N = 722; - e.O = 778; - e.P = 611; - e.Q = 778; - e.R = 722; - e.S = 556; - e.T = 667; - e.U = 722; - e.V = 722; - e.W = 1e3; - e.X = 722; - e.Y = 722; - e.Z = 667; - e.bracketleft = 333; - e.backslash = 278; - e.bracketright = 333; - e.asciicircum = 581; - e.underscore = 500; - e.quoteleft = 333; - e.a = 500; - e.b = 556; - e.c = 444; - e.d = 556; - e.e = 444; - e.f = 333; - e.g = 500; - e.h = 556; - e.i = 278; - e.j = 333; - e.k = 556; - e.l = 278; - e.m = 833; - e.n = 556; - e.o = 500; - e.p = 556; - e.q = 556; - e.r = 444; - e.s = 389; - e.t = 333; - e.u = 556; - e.v = 500; - e.w = 722; - e.x = 500; - e.y = 500; - e.z = 444; - e.braceleft = 394; - e.bar = 220; - e.braceright = 394; - e.asciitilde = 520; - e.exclamdown = 333; - e.cent = 500; - e.sterling = 500; - e.fraction = 167; - e.yen = 500; - e.florin = 500; - e.section = 500; - e.currency = 500; - e.quotesingle = 278; - e.quotedblleft = 500; - e.guillemotleft = 500; - e.guilsinglleft = 333; - e.guilsinglright = 333; - e.fi = 556; - e.fl = 556; - e.endash = 500; - e.dagger = 500; - e.daggerdbl = 500; - e.periodcentered = 250; - e.paragraph = 540; - e.bullet = 350; - e.quotesinglbase = 333; - e.quotedblbase = 500; - e.quotedblright = 500; - e.guillemotright = 500; - e.ellipsis = 1e3; - e.perthousand = 1e3; - e.questiondown = 500; - e.grave = 333; - e.acute = 333; - e.circumflex = 333; - e.tilde = 333; - e.macron = 333; - e.breve = 333; - e.dotaccent = 333; - e.dieresis = 333; - e.ring = 333; - e.cedilla = 333; - e.hungarumlaut = 333; - e.ogonek = 333; - e.caron = 333; - e.emdash = 1e3; - e.AE = 1e3; - e.ordfeminine = 300; - e.Lslash = 667; - e.Oslash = 778; - e.OE = 1e3; - e.ordmasculine = 330; - e.ae = 722; - e.dotlessi = 278; - e.lslash = 278; - e.oslash = 500; - e.oe = 722; - e.germandbls = 556; - e.Idieresis = 389; - e.eacute = 444; - e.abreve = 500; - e.uhungarumlaut = 556; - e.ecaron = 444; - e.Ydieresis = 722; - e.divide = 570; - e.Yacute = 722; - e.Acircumflex = 722; - e.aacute = 500; - e.Ucircumflex = 722; - e.yacute = 500; - e.scommaaccent = 389; - e.ecircumflex = 444; - e.Uring = 722; - e.Udieresis = 722; - e.aogonek = 500; - e.Uacute = 722; - e.uogonek = 556; - e.Edieresis = 667; - e.Dcroat = 722; - e.commaaccent = 250; - e.copyright = 747; - e.Emacron = 667; - e.ccaron = 444; - e.aring = 500; - e.Ncommaaccent = 722; - e.lacute = 278; - e.agrave = 500; - e.Tcommaaccent = 667; - e.Cacute = 722; - e.atilde = 500; - e.Edotaccent = 667; - e.scaron = 389; - e.scedilla = 389; - e.iacute = 278; - e.lozenge = 494; - e.Rcaron = 722; - e.Gcommaaccent = 778; - e.ucircumflex = 556; - e.acircumflex = 500; - e.Amacron = 722; - e.rcaron = 444; - e.ccedilla = 444; - e.Zdotaccent = 667; - e.Thorn = 611; - e.Omacron = 778; - e.Racute = 722; - e.Sacute = 556; - e.dcaron = 672; - e.Umacron = 722; - e.uring = 556; - e.threesuperior = 300; - e.Ograve = 778; - e.Agrave = 722; - e.Abreve = 722; - e.multiply = 570; - e.uacute = 556; - e.Tcaron = 667; - e.partialdiff = 494; - e.ydieresis = 500; - e.Nacute = 722; - e.icircumflex = 278; - e.Ecircumflex = 667; - e.adieresis = 500; - e.edieresis = 444; - e.cacute = 444; - e.nacute = 556; - e.umacron = 556; - e.Ncaron = 722; - e.Iacute = 389; - e.plusminus = 570; - e.brokenbar = 220; - e.registered = 747; - e.Gbreve = 778; - e.Idotaccent = 389; - e.summation = 600; - e.Egrave = 667; - e.racute = 444; - e.omacron = 500; - e.Zacute = 667; - e.Zcaron = 667; - e.greaterequal = 549; - e.Eth = 722; - e.Ccedilla = 722; - e.lcommaaccent = 278; - e.tcaron = 416; - e.eogonek = 444; - e.Uogonek = 722; - e.Aacute = 722; - e.Adieresis = 722; - e.egrave = 444; - e.zacute = 444; - e.iogonek = 278; - e.Oacute = 778; - e.oacute = 500; - e.amacron = 500; - e.sacute = 389; - e.idieresis = 278; - e.Ocircumflex = 778; - e.Ugrave = 722; - e.Delta = 612; - e.thorn = 556; - e.twosuperior = 300; - e.Odieresis = 778; - e.mu = 556; - e.igrave = 278; - e.ohungarumlaut = 500; - e.Eogonek = 667; - e.dcroat = 556; - e.threequarters = 750; - e.Scedilla = 556; - e.lcaron = 394; - e.Kcommaaccent = 778; - e.Lacute = 667; - e.trademark = 1e3; - e.edotaccent = 444; - e.Igrave = 389; - e.Imacron = 389; - e.Lcaron = 667; - e.onehalf = 750; - e.lessequal = 549; - e.ocircumflex = 500; - e.ntilde = 556; - e.Uhungarumlaut = 722; - e.Eacute = 667; - e.emacron = 444; - e.gbreve = 500; - e.onequarter = 750; - e.Scaron = 556; - e.Scommaaccent = 556; - e.Ohungarumlaut = 778; - e.degree = 400; - e.ograve = 500; - e.Ccaron = 722; - e.ugrave = 556; - e.radical = 549; - e.Dcaron = 722; - e.rcommaaccent = 444; - e.Ntilde = 722; - e.otilde = 500; - e.Rcommaaccent = 722; - e.Lcommaaccent = 667; - e.Atilde = 722; - e.Aogonek = 722; - e.Aring = 722; - e.Otilde = 778; - e.zdotaccent = 444; - e.Ecaron = 667; - e.Iogonek = 389; - e.kcommaaccent = 556; - e.minus = 570; - e.Icircumflex = 389; - e.ncaron = 556; - e.tcommaaccent = 333; - e.logicalnot = 570; - e.odieresis = 500; - e.udieresis = 556; - e.notequal = 549; - e.gcommaaccent = 500; - e.eth = 500; - e.zcaron = 444; - e.ncommaaccent = 556; - e.onesuperior = 300; - e.imacron = 278; - e.Euro = 500; - }); - e["Times-BoldItalic"] = getLookupTableFactory(function (e) { - e.space = 250; - e.exclam = 389; - e.quotedbl = 555; - e.numbersign = 500; - e.dollar = 500; - e.percent = 833; - e.ampersand = 778; - e.quoteright = 333; - e.parenleft = 333; - e.parenright = 333; - e.asterisk = 500; - e.plus = 570; - e.comma = 250; - e.hyphen = 333; - e.period = 250; - e.slash = 278; - e.zero = 500; - e.one = 500; - e.two = 500; - e.three = 500; - e.four = 500; - e.five = 500; - e.six = 500; - e.seven = 500; - e.eight = 500; - e.nine = 500; - e.colon = 333; - e.semicolon = 333; - e.less = 570; - e.equal = 570; - e.greater = 570; - e.question = 500; - e.at = 832; - e.A = 667; - e.B = 667; - e.C = 667; - e.D = 722; - e.E = 667; - e.F = 667; - e.G = 722; - e.H = 778; - e.I = 389; - e.J = 500; - e.K = 667; - e.L = 611; - e.M = 889; - e.N = 722; - e.O = 722; - e.P = 611; - e.Q = 722; - e.R = 667; - e.S = 556; - e.T = 611; - e.U = 722; - e.V = 667; - e.W = 889; - e.X = 667; - e.Y = 611; - e.Z = 611; - e.bracketleft = 333; - e.backslash = 278; - e.bracketright = 333; - e.asciicircum = 570; - e.underscore = 500; - e.quoteleft = 333; - e.a = 500; - e.b = 500; - e.c = 444; - e.d = 500; - e.e = 444; - e.f = 333; - e.g = 500; - e.h = 556; - e.i = 278; - e.j = 278; - e.k = 500; - e.l = 278; - e.m = 778; - e.n = 556; - e.o = 500; - e.p = 500; - e.q = 500; - e.r = 389; - e.s = 389; - e.t = 278; - e.u = 556; - e.v = 444; - e.w = 667; - e.x = 500; - e.y = 444; - e.z = 389; - e.braceleft = 348; - e.bar = 220; - e.braceright = 348; - e.asciitilde = 570; - e.exclamdown = 389; - e.cent = 500; - e.sterling = 500; - e.fraction = 167; - e.yen = 500; - e.florin = 500; - e.section = 500; - e.currency = 500; - e.quotesingle = 278; - e.quotedblleft = 500; - e.guillemotleft = 500; - e.guilsinglleft = 333; - e.guilsinglright = 333; - e.fi = 556; - e.fl = 556; - e.endash = 500; - e.dagger = 500; - e.daggerdbl = 500; - e.periodcentered = 250; - e.paragraph = 500; - e.bullet = 350; - e.quotesinglbase = 333; - e.quotedblbase = 500; - e.quotedblright = 500; - e.guillemotright = 500; - e.ellipsis = 1e3; - e.perthousand = 1e3; - e.questiondown = 500; - e.grave = 333; - e.acute = 333; - e.circumflex = 333; - e.tilde = 333; - e.macron = 333; - e.breve = 333; - e.dotaccent = 333; - e.dieresis = 333; - e.ring = 333; - e.cedilla = 333; - e.hungarumlaut = 333; - e.ogonek = 333; - e.caron = 333; - e.emdash = 1e3; - e.AE = 944; - e.ordfeminine = 266; - e.Lslash = 611; - e.Oslash = 722; - e.OE = 944; - e.ordmasculine = 300; - e.ae = 722; - e.dotlessi = 278; - e.lslash = 278; - e.oslash = 500; - e.oe = 722; - e.germandbls = 500; - e.Idieresis = 389; - e.eacute = 444; - e.abreve = 500; - e.uhungarumlaut = 556; - e.ecaron = 444; - e.Ydieresis = 611; - e.divide = 570; - e.Yacute = 611; - e.Acircumflex = 667; - e.aacute = 500; - e.Ucircumflex = 722; - e.yacute = 444; - e.scommaaccent = 389; - e.ecircumflex = 444; - e.Uring = 722; - e.Udieresis = 722; - e.aogonek = 500; - e.Uacute = 722; - e.uogonek = 556; - e.Edieresis = 667; - e.Dcroat = 722; - e.commaaccent = 250; - e.copyright = 747; - e.Emacron = 667; - e.ccaron = 444; - e.aring = 500; - e.Ncommaaccent = 722; - e.lacute = 278; - e.agrave = 500; - e.Tcommaaccent = 611; - e.Cacute = 667; - e.atilde = 500; - e.Edotaccent = 667; - e.scaron = 389; - e.scedilla = 389; - e.iacute = 278; - e.lozenge = 494; - e.Rcaron = 667; - e.Gcommaaccent = 722; - e.ucircumflex = 556; - e.acircumflex = 500; - e.Amacron = 667; - e.rcaron = 389; - e.ccedilla = 444; - e.Zdotaccent = 611; - e.Thorn = 611; - e.Omacron = 722; - e.Racute = 667; - e.Sacute = 556; - e.dcaron = 608; - e.Umacron = 722; - e.uring = 556; - e.threesuperior = 300; - e.Ograve = 722; - e.Agrave = 667; - e.Abreve = 667; - e.multiply = 570; - e.uacute = 556; - e.Tcaron = 611; - e.partialdiff = 494; - e.ydieresis = 444; - e.Nacute = 722; - e.icircumflex = 278; - e.Ecircumflex = 667; - e.adieresis = 500; - e.edieresis = 444; - e.cacute = 444; - e.nacute = 556; - e.umacron = 556; - e.Ncaron = 722; - e.Iacute = 389; - e.plusminus = 570; - e.brokenbar = 220; - e.registered = 747; - e.Gbreve = 722; - e.Idotaccent = 389; - e.summation = 600; - e.Egrave = 667; - e.racute = 389; - e.omacron = 500; - e.Zacute = 611; - e.Zcaron = 611; - e.greaterequal = 549; - e.Eth = 722; - e.Ccedilla = 667; - e.lcommaaccent = 278; - e.tcaron = 366; - e.eogonek = 444; - e.Uogonek = 722; - e.Aacute = 667; - e.Adieresis = 667; - e.egrave = 444; - e.zacute = 389; - e.iogonek = 278; - e.Oacute = 722; - e.oacute = 500; - e.amacron = 500; - e.sacute = 389; - e.idieresis = 278; - e.Ocircumflex = 722; - e.Ugrave = 722; - e.Delta = 612; - e.thorn = 500; - e.twosuperior = 300; - e.Odieresis = 722; - e.mu = 576; - e.igrave = 278; - e.ohungarumlaut = 500; - e.Eogonek = 667; - e.dcroat = 500; - e.threequarters = 750; - e.Scedilla = 556; - e.lcaron = 382; - e.Kcommaaccent = 667; - e.Lacute = 611; - e.trademark = 1e3; - e.edotaccent = 444; - e.Igrave = 389; - e.Imacron = 389; - e.Lcaron = 611; - e.onehalf = 750; - e.lessequal = 549; - e.ocircumflex = 500; - e.ntilde = 556; - e.Uhungarumlaut = 722; - e.Eacute = 667; - e.emacron = 444; - e.gbreve = 500; - e.onequarter = 750; - e.Scaron = 556; - e.Scommaaccent = 556; - e.Ohungarumlaut = 722; - e.degree = 400; - e.ograve = 500; - e.Ccaron = 667; - e.ugrave = 556; - e.radical = 549; - e.Dcaron = 722; - e.rcommaaccent = 389; - e.Ntilde = 722; - e.otilde = 500; - e.Rcommaaccent = 667; - e.Lcommaaccent = 611; - e.Atilde = 667; - e.Aogonek = 667; - e.Aring = 667; - e.Otilde = 722; - e.zdotaccent = 389; - e.Ecaron = 667; - e.Iogonek = 389; - e.kcommaaccent = 500; - e.minus = 606; - e.Icircumflex = 389; - e.ncaron = 556; - e.tcommaaccent = 278; - e.logicalnot = 606; - e.odieresis = 500; - e.udieresis = 556; - e.notequal = 549; - e.gcommaaccent = 500; - e.eth = 500; - e.zcaron = 389; - e.ncommaaccent = 556; - e.onesuperior = 300; - e.imacron = 278; - e.Euro = 500; - }); - e["Times-Italic"] = getLookupTableFactory(function (e) { - e.space = 250; - e.exclam = 333; - e.quotedbl = 420; - e.numbersign = 500; - e.dollar = 500; - e.percent = 833; - e.ampersand = 778; - e.quoteright = 333; - e.parenleft = 333; - e.parenright = 333; - e.asterisk = 500; - e.plus = 675; - e.comma = 250; - e.hyphen = 333; - e.period = 250; - e.slash = 278; - e.zero = 500; - e.one = 500; - e.two = 500; - e.three = 500; - e.four = 500; - e.five = 500; - e.six = 500; - e.seven = 500; - e.eight = 500; - e.nine = 500; - e.colon = 333; - e.semicolon = 333; - e.less = 675; - e.equal = 675; - e.greater = 675; - e.question = 500; - e.at = 920; - e.A = 611; - e.B = 611; - e.C = 667; - e.D = 722; - e.E = 611; - e.F = 611; - e.G = 722; - e.H = 722; - e.I = 333; - e.J = 444; - e.K = 667; - e.L = 556; - e.M = 833; - e.N = 667; - e.O = 722; - e.P = 611; - e.Q = 722; - e.R = 611; - e.S = 500; - e.T = 556; - e.U = 722; - e.V = 611; - e.W = 833; - e.X = 611; - e.Y = 556; - e.Z = 556; - e.bracketleft = 389; - e.backslash = 278; - e.bracketright = 389; - e.asciicircum = 422; - e.underscore = 500; - e.quoteleft = 333; - e.a = 500; - e.b = 500; - e.c = 444; - e.d = 500; - e.e = 444; - e.f = 278; - e.g = 500; - e.h = 500; - e.i = 278; - e.j = 278; - e.k = 444; - e.l = 278; - e.m = 722; - e.n = 500; - e.o = 500; - e.p = 500; - e.q = 500; - e.r = 389; - e.s = 389; - e.t = 278; - e.u = 500; - e.v = 444; - e.w = 667; - e.x = 444; - e.y = 444; - e.z = 389; - e.braceleft = 400; - e.bar = 275; - e.braceright = 400; - e.asciitilde = 541; - e.exclamdown = 389; - e.cent = 500; - e.sterling = 500; - e.fraction = 167; - e.yen = 500; - e.florin = 500; - e.section = 500; - e.currency = 500; - e.quotesingle = 214; - e.quotedblleft = 556; - e.guillemotleft = 500; - e.guilsinglleft = 333; - e.guilsinglright = 333; - e.fi = 500; - e.fl = 500; - e.endash = 500; - e.dagger = 500; - e.daggerdbl = 500; - e.periodcentered = 250; - e.paragraph = 523; - e.bullet = 350; - e.quotesinglbase = 333; - e.quotedblbase = 556; - e.quotedblright = 556; - e.guillemotright = 500; - e.ellipsis = 889; - e.perthousand = 1e3; - e.questiondown = 500; - e.grave = 333; - e.acute = 333; - e.circumflex = 333; - e.tilde = 333; - e.macron = 333; - e.breve = 333; - e.dotaccent = 333; - e.dieresis = 333; - e.ring = 333; - e.cedilla = 333; - e.hungarumlaut = 333; - e.ogonek = 333; - e.caron = 333; - e.emdash = 889; - e.AE = 889; - e.ordfeminine = 276; - e.Lslash = 556; - e.Oslash = 722; - e.OE = 944; - e.ordmasculine = 310; - e.ae = 667; - e.dotlessi = 278; - e.lslash = 278; - e.oslash = 500; - e.oe = 667; - e.germandbls = 500; - e.Idieresis = 333; - e.eacute = 444; - e.abreve = 500; - e.uhungarumlaut = 500; - e.ecaron = 444; - e.Ydieresis = 556; - e.divide = 675; - e.Yacute = 556; - e.Acircumflex = 611; - e.aacute = 500; - e.Ucircumflex = 722; - e.yacute = 444; - e.scommaaccent = 389; - e.ecircumflex = 444; - e.Uring = 722; - e.Udieresis = 722; - e.aogonek = 500; - e.Uacute = 722; - e.uogonek = 500; - e.Edieresis = 611; - e.Dcroat = 722; - e.commaaccent = 250; - e.copyright = 760; - e.Emacron = 611; - e.ccaron = 444; - e.aring = 500; - e.Ncommaaccent = 667; - e.lacute = 278; - e.agrave = 500; - e.Tcommaaccent = 556; - e.Cacute = 667; - e.atilde = 500; - e.Edotaccent = 611; - e.scaron = 389; - e.scedilla = 389; - e.iacute = 278; - e.lozenge = 471; - e.Rcaron = 611; - e.Gcommaaccent = 722; - e.ucircumflex = 500; - e.acircumflex = 500; - e.Amacron = 611; - e.rcaron = 389; - e.ccedilla = 444; - e.Zdotaccent = 556; - e.Thorn = 611; - e.Omacron = 722; - e.Racute = 611; - e.Sacute = 500; - e.dcaron = 544; - e.Umacron = 722; - e.uring = 500; - e.threesuperior = 300; - e.Ograve = 722; - e.Agrave = 611; - e.Abreve = 611; - e.multiply = 675; - e.uacute = 500; - e.Tcaron = 556; - e.partialdiff = 476; - e.ydieresis = 444; - e.Nacute = 667; - e.icircumflex = 278; - e.Ecircumflex = 611; - e.adieresis = 500; - e.edieresis = 444; - e.cacute = 444; - e.nacute = 500; - e.umacron = 500; - e.Ncaron = 667; - e.Iacute = 333; - e.plusminus = 675; - e.brokenbar = 275; - e.registered = 760; - e.Gbreve = 722; - e.Idotaccent = 333; - e.summation = 600; - e.Egrave = 611; - e.racute = 389; - e.omacron = 500; - e.Zacute = 556; - e.Zcaron = 556; - e.greaterequal = 549; - e.Eth = 722; - e.Ccedilla = 667; - e.lcommaaccent = 278; - e.tcaron = 300; - e.eogonek = 444; - e.Uogonek = 722; - e.Aacute = 611; - e.Adieresis = 611; - e.egrave = 444; - e.zacute = 389; - e.iogonek = 278; - e.Oacute = 722; - e.oacute = 500; - e.amacron = 500; - e.sacute = 389; - e.idieresis = 278; - e.Ocircumflex = 722; - e.Ugrave = 722; - e.Delta = 612; - e.thorn = 500; - e.twosuperior = 300; - e.Odieresis = 722; - e.mu = 500; - e.igrave = 278; - e.ohungarumlaut = 500; - e.Eogonek = 611; - e.dcroat = 500; - e.threequarters = 750; - e.Scedilla = 500; - e.lcaron = 300; - e.Kcommaaccent = 667; - e.Lacute = 556; - e.trademark = 980; - e.edotaccent = 444; - e.Igrave = 333; - e.Imacron = 333; - e.Lcaron = 611; - e.onehalf = 750; - e.lessequal = 549; - e.ocircumflex = 500; - e.ntilde = 500; - e.Uhungarumlaut = 722; - e.Eacute = 611; - e.emacron = 444; - e.gbreve = 500; - e.onequarter = 750; - e.Scaron = 500; - e.Scommaaccent = 500; - e.Ohungarumlaut = 722; - e.degree = 400; - e.ograve = 500; - e.Ccaron = 667; - e.ugrave = 500; - e.radical = 453; - e.Dcaron = 722; - e.rcommaaccent = 389; - e.Ntilde = 667; - e.otilde = 500; - e.Rcommaaccent = 611; - e.Lcommaaccent = 556; - e.Atilde = 611; - e.Aogonek = 611; - e.Aring = 611; - e.Otilde = 722; - e.zdotaccent = 389; - e.Ecaron = 611; - e.Iogonek = 333; - e.kcommaaccent = 444; - e.minus = 675; - e.Icircumflex = 333; - e.ncaron = 500; - e.tcommaaccent = 278; - e.logicalnot = 675; - e.odieresis = 500; - e.udieresis = 500; - e.notequal = 549; - e.gcommaaccent = 500; - e.eth = 500; - e.zcaron = 389; - e.ncommaaccent = 500; - e.onesuperior = 300; - e.imacron = 278; - e.Euro = 500; - }); - e.ZapfDingbats = getLookupTableFactory(function (e) { - e.space = 278; - e.a1 = 974; - e.a2 = 961; - e.a202 = 974; - e.a3 = 980; - e.a4 = 719; - e.a5 = 789; - e.a119 = 790; - e.a118 = 791; - e.a117 = 690; - e.a11 = 960; - e.a12 = 939; - e.a13 = 549; - e.a14 = 855; - e.a15 = 911; - e.a16 = 933; - e.a105 = 911; - e.a17 = 945; - e.a18 = 974; - e.a19 = 755; - e.a20 = 846; - e.a21 = 762; - e.a22 = 761; - e.a23 = 571; - e.a24 = 677; - e.a25 = 763; - e.a26 = 760; - e.a27 = 759; - e.a28 = 754; - e.a6 = 494; - e.a7 = 552; - e.a8 = 537; - e.a9 = 577; - e.a10 = 692; - e.a29 = 786; - e.a30 = 788; - e.a31 = 788; - e.a32 = 790; - e.a33 = 793; - e.a34 = 794; - e.a35 = 816; - e.a36 = 823; - e.a37 = 789; - e.a38 = 841; - e.a39 = 823; - e.a40 = 833; - e.a41 = 816; - e.a42 = 831; - e.a43 = 923; - e.a44 = 744; - e.a45 = 723; - e.a46 = 749; - e.a47 = 790; - e.a48 = 792; - e.a49 = 695; - e.a50 = 776; - e.a51 = 768; - e.a52 = 792; - e.a53 = 759; - e.a54 = 707; - e.a55 = 708; - e.a56 = 682; - e.a57 = 701; - e.a58 = 826; - e.a59 = 815; - e.a60 = 789; - e.a61 = 789; - e.a62 = 707; - e.a63 = 687; - e.a64 = 696; - e.a65 = 689; - e.a66 = 786; - e.a67 = 787; - e.a68 = 713; - e.a69 = 791; - e.a70 = 785; - e.a71 = 791; - e.a72 = 873; - e.a73 = 761; - e.a74 = 762; - e.a203 = 762; - e.a75 = 759; - e.a204 = 759; - e.a76 = 892; - e.a77 = 892; - e.a78 = 788; - e.a79 = 784; - e.a81 = 438; - e.a82 = 138; - e.a83 = 277; - e.a84 = 415; - e.a97 = 392; - e.a98 = 392; - e.a99 = 668; - e.a100 = 668; - e.a89 = 390; - e.a90 = 390; - e.a93 = 317; - e.a94 = 317; - e.a91 = 276; - e.a92 = 276; - e.a205 = 509; - e.a85 = 509; - e.a206 = 410; - e.a86 = 410; - e.a87 = 234; - e.a88 = 234; - e.a95 = 334; - e.a96 = 334; - e.a101 = 732; - e.a102 = 544; - e.a103 = 544; - e.a104 = 910; - e.a106 = 667; - e.a107 = 760; - e.a108 = 760; - e.a112 = 776; - e.a111 = 595; - e.a110 = 694; - e.a109 = 626; - e.a120 = 788; - e.a121 = 788; - e.a122 = 788; - e.a123 = 788; - e.a124 = 788; - e.a125 = 788; - e.a126 = 788; - e.a127 = 788; - e.a128 = 788; - e.a129 = 788; - e.a130 = 788; - e.a131 = 788; - e.a132 = 788; - e.a133 = 788; - e.a134 = 788; - e.a135 = 788; - e.a136 = 788; - e.a137 = 788; - e.a138 = 788; - e.a139 = 788; - e.a140 = 788; - e.a141 = 788; - e.a142 = 788; - e.a143 = 788; - e.a144 = 788; - e.a145 = 788; - e.a146 = 788; - e.a147 = 788; - e.a148 = 788; - e.a149 = 788; - e.a150 = 788; - e.a151 = 788; - e.a152 = 788; - e.a153 = 788; - e.a154 = 788; - e.a155 = 788; - e.a156 = 788; - e.a157 = 788; - e.a158 = 788; - e.a159 = 788; - e.a160 = 894; - e.a161 = 838; - e.a163 = 1016; - e.a164 = 458; - e.a196 = 748; - e.a165 = 924; - e.a192 = 748; - e.a166 = 918; - e.a167 = 927; - e.a168 = 928; - e.a169 = 928; - e.a170 = 834; - e.a171 = 873; - e.a172 = 828; - e.a173 = 924; - e.a162 = 924; - e.a174 = 917; - e.a175 = 930; - e.a176 = 931; - e.a177 = 463; - e.a178 = 883; - e.a179 = 836; - e.a193 = 836; - e.a180 = 867; - e.a199 = 867; - e.a181 = 696; - e.a200 = 696; - e.a182 = 874; - e.a201 = 874; - e.a183 = 760; - e.a184 = 946; - e.a197 = 771; - e.a185 = 865; - e.a194 = 771; - e.a198 = 888; - e.a186 = 967; - e.a195 = 888; - e.a187 = 831; - e.a188 = 873; - e.a189 = 927; - e.a190 = 970; - e.a191 = 918; - }); - }), - ea = getLookupTableFactory(function (e) { - e.Courier = { ascent: 629, descent: -157, capHeight: 562, xHeight: -426 }; - e["Courier-Bold"] = { - ascent: 629, - descent: -157, - capHeight: 562, - xHeight: 439, - }; - e["Courier-Oblique"] = { - ascent: 629, - descent: -157, - capHeight: 562, - xHeight: 426, - }; - e["Courier-BoldOblique"] = { - ascent: 629, - descent: -157, - capHeight: 562, - xHeight: 426, - }; - e.Helvetica = { ascent: 718, descent: -207, capHeight: 718, xHeight: 523 }; - e["Helvetica-Bold"] = { - ascent: 718, - descent: -207, - capHeight: 718, - xHeight: 532, - }; - e["Helvetica-Oblique"] = { - ascent: 718, - descent: -207, - capHeight: 718, - xHeight: 523, - }; - e["Helvetica-BoldOblique"] = { - ascent: 718, - descent: -207, - capHeight: 718, - xHeight: 532, - }; - e["Times-Roman"] = { - ascent: 683, - descent: -217, - capHeight: 662, - xHeight: 450, - }; - e["Times-Bold"] = { - ascent: 683, - descent: -217, - capHeight: 676, - xHeight: 461, - }; - e["Times-Italic"] = { - ascent: 683, - descent: -217, - capHeight: 653, - xHeight: 441, - }; - e["Times-BoldItalic"] = { - ascent: 683, - descent: -217, - capHeight: 669, - xHeight: 462, - }; - e.Symbol = { - ascent: Math.NaN, - descent: Math.NaN, - capHeight: Math.NaN, - xHeight: Math.NaN, - }; - e.ZapfDingbats = { - ascent: Math.NaN, - descent: Math.NaN, - capHeight: Math.NaN, - xHeight: Math.NaN, - }; +} // ./src/core/metrics.js + +const getMetrics = getLookupTableFactory(function (t) { + t.Courier = 600; + t["Courier-Bold"] = 600; + t["Courier-BoldOblique"] = 600; + t["Courier-Oblique"] = 600; + t.Helvetica = getLookupTableFactory(function (t) { + t.space = 278; + t.exclam = 278; + t.quotedbl = 355; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 667; + t.quoteright = 222; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 278; + t.semicolon = 278; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 556; + t.at = 1015; + t.A = 667; + t.B = 667; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 500; + t.K = 667; + t.L = 556; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 278; + t.backslash = 278; + t.bracketright = 278; + t.asciicircum = 469; + t.underscore = 556; + t.quoteleft = 222; + t.a = 556; + t.b = 556; + t.c = 500; + t.d = 556; + t.e = 556; + t.f = 278; + t.g = 556; + t.h = 556; + t.i = 222; + t.j = 222; + t.k = 500; + t.l = 222; + t.m = 833; + t.n = 556; + t.o = 556; + t.p = 556; + t.q = 556; + t.r = 333; + t.s = 500; + t.t = 278; + t.u = 556; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 500; + t.braceleft = 334; + t.bar = 260; + t.braceright = 334; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 191; + t.quotedblleft = 333; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 500; + t.fl = 500; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 537; + t.bullet = 350; + t.quotesinglbase = 222; + t.quotedblbase = 333; + t.quotedblright = 333; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 556; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 222; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 556; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 667; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 500; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 500; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 222; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 500; + t.scedilla = 500; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 556; + t.acircumflex = 556; + t.Amacron = 667; + t.rcaron = 333; + t.ccedilla = 500; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 643; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 667; + t.Abreve = 667; + t.multiply = 584; + t.uacute = 556; + t.Tcaron = 611; + t.partialdiff = 476; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 500; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 260; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 333; + t.omacron = 556; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 222; + t.tcaron = 317; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 667; + t.Adieresis = 667; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 222; + t.Oacute = 778; + t.oacute = 556; + t.amacron = 556; + t.sacute = 500; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 556; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 556; + t.igrave = 278; + t.ohungarumlaut = 556; + t.Eogonek = 667; + t.dcroat = 556; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 299; + t.Kcommaaccent = 667; + t.Lacute = 556; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 556; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 556; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 556; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 556; + t.Ccaron = 722; + t.ugrave = 556; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 333; + t.Ntilde = 722; + t.otilde = 556; + t.Rcommaaccent = 722; + t.Lcommaaccent = 556; + t.Atilde = 667; + t.Aogonek = 667; + t.Aring = 667; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 500; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 556; + t.tcommaaccent = 278; + t.logicalnot = 584; + t.odieresis = 556; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 556; + t.eth = 556; + t.zcaron = 500; + t.ncommaaccent = 556; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; }); + t["Helvetica-Bold"] = getLookupTableFactory(function (t) { + t.space = 278; + t.exclam = 333; + t.quotedbl = 474; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 722; + t.quoteright = 278; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 333; + t.semicolon = 333; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 611; + t.at = 975; + t.A = 722; + t.B = 722; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 556; + t.K = 722; + t.L = 611; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 584; + t.underscore = 556; + t.quoteleft = 278; + t.a = 556; + t.b = 611; + t.c = 556; + t.d = 611; + t.e = 556; + t.f = 333; + t.g = 611; + t.h = 611; + t.i = 278; + t.j = 278; + t.k = 556; + t.l = 278; + t.m = 889; + t.n = 611; + t.o = 611; + t.p = 611; + t.q = 611; + t.r = 389; + t.s = 556; + t.t = 333; + t.u = 611; + t.v = 556; + t.w = 778; + t.x = 556; + t.y = 556; + t.z = 500; + t.braceleft = 389; + t.bar = 280; + t.braceright = 389; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 238; + t.quotedblleft = 500; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 611; + t.fl = 611; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 556; + t.bullet = 350; + t.quotesinglbase = 278; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 611; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 611; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 722; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 556; + t.scommaaccent = 556; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 611; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 556; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 556; + t.scedilla = 556; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 611; + t.acircumflex = 556; + t.Amacron = 722; + t.rcaron = 389; + t.ccedilla = 556; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 743; + t.Umacron = 722; + t.uring = 611; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 584; + t.uacute = 611; + t.Tcaron = 611; + t.partialdiff = 494; + t.ydieresis = 556; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 556; + t.nacute = 611; + t.umacron = 611; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 280; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 389; + t.omacron = 611; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 278; + t.tcaron = 389; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 278; + t.Oacute = 778; + t.oacute = 611; + t.amacron = 556; + t.sacute = 556; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 611; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 611; + t.igrave = 278; + t.ohungarumlaut = 611; + t.Eogonek = 667; + t.dcroat = 611; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 400; + t.Kcommaaccent = 722; + t.Lacute = 611; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 611; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 611; + t.ntilde = 611; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 611; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 611; + t.Ccaron = 722; + t.ugrave = 611; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 722; + t.otilde = 611; + t.Rcommaaccent = 722; + t.Lcommaaccent = 611; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 556; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 611; + t.tcommaaccent = 333; + t.logicalnot = 584; + t.odieresis = 611; + t.udieresis = 611; + t.notequal = 549; + t.gcommaaccent = 611; + t.eth = 611; + t.zcaron = 500; + t.ncommaaccent = 611; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; + }); + t["Helvetica-BoldOblique"] = getLookupTableFactory(function (t) { + t.space = 278; + t.exclam = 333; + t.quotedbl = 474; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 722; + t.quoteright = 278; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 333; + t.semicolon = 333; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 611; + t.at = 975; + t.A = 722; + t.B = 722; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 556; + t.K = 722; + t.L = 611; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 584; + t.underscore = 556; + t.quoteleft = 278; + t.a = 556; + t.b = 611; + t.c = 556; + t.d = 611; + t.e = 556; + t.f = 333; + t.g = 611; + t.h = 611; + t.i = 278; + t.j = 278; + t.k = 556; + t.l = 278; + t.m = 889; + t.n = 611; + t.o = 611; + t.p = 611; + t.q = 611; + t.r = 389; + t.s = 556; + t.t = 333; + t.u = 611; + t.v = 556; + t.w = 778; + t.x = 556; + t.y = 556; + t.z = 500; + t.braceleft = 389; + t.bar = 280; + t.braceright = 389; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 238; + t.quotedblleft = 500; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 611; + t.fl = 611; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 556; + t.bullet = 350; + t.quotesinglbase = 278; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 611; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 611; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 722; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 556; + t.scommaaccent = 556; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 611; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 556; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 556; + t.scedilla = 556; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 611; + t.acircumflex = 556; + t.Amacron = 722; + t.rcaron = 389; + t.ccedilla = 556; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 743; + t.Umacron = 722; + t.uring = 611; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 584; + t.uacute = 611; + t.Tcaron = 611; + t.partialdiff = 494; + t.ydieresis = 556; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 556; + t.nacute = 611; + t.umacron = 611; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 280; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 389; + t.omacron = 611; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 278; + t.tcaron = 389; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 278; + t.Oacute = 778; + t.oacute = 611; + t.amacron = 556; + t.sacute = 556; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 611; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 611; + t.igrave = 278; + t.ohungarumlaut = 611; + t.Eogonek = 667; + t.dcroat = 611; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 400; + t.Kcommaaccent = 722; + t.Lacute = 611; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 611; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 611; + t.ntilde = 611; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 611; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 611; + t.Ccaron = 722; + t.ugrave = 611; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 722; + t.otilde = 611; + t.Rcommaaccent = 722; + t.Lcommaaccent = 611; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 556; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 611; + t.tcommaaccent = 333; + t.logicalnot = 584; + t.odieresis = 611; + t.udieresis = 611; + t.notequal = 549; + t.gcommaaccent = 611; + t.eth = 611; + t.zcaron = 500; + t.ncommaaccent = 611; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; + }); + t["Helvetica-Oblique"] = getLookupTableFactory(function (t) { + t.space = 278; + t.exclam = 278; + t.quotedbl = 355; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 667; + t.quoteright = 222; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 278; + t.semicolon = 278; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 556; + t.at = 1015; + t.A = 667; + t.B = 667; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 500; + t.K = 667; + t.L = 556; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 278; + t.backslash = 278; + t.bracketright = 278; + t.asciicircum = 469; + t.underscore = 556; + t.quoteleft = 222; + t.a = 556; + t.b = 556; + t.c = 500; + t.d = 556; + t.e = 556; + t.f = 278; + t.g = 556; + t.h = 556; + t.i = 222; + t.j = 222; + t.k = 500; + t.l = 222; + t.m = 833; + t.n = 556; + t.o = 556; + t.p = 556; + t.q = 556; + t.r = 333; + t.s = 500; + t.t = 278; + t.u = 556; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 500; + t.braceleft = 334; + t.bar = 260; + t.braceright = 334; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 191; + t.quotedblleft = 333; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 500; + t.fl = 500; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 537; + t.bullet = 350; + t.quotesinglbase = 222; + t.quotedblbase = 333; + t.quotedblright = 333; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 556; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 222; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 556; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 667; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 500; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 500; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 222; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 500; + t.scedilla = 500; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 556; + t.acircumflex = 556; + t.Amacron = 667; + t.rcaron = 333; + t.ccedilla = 500; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 643; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 667; + t.Abreve = 667; + t.multiply = 584; + t.uacute = 556; + t.Tcaron = 611; + t.partialdiff = 476; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 500; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 260; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 333; + t.omacron = 556; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 222; + t.tcaron = 317; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 667; + t.Adieresis = 667; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 222; + t.Oacute = 778; + t.oacute = 556; + t.amacron = 556; + t.sacute = 500; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 556; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 556; + t.igrave = 278; + t.ohungarumlaut = 556; + t.Eogonek = 667; + t.dcroat = 556; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 299; + t.Kcommaaccent = 667; + t.Lacute = 556; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 556; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 556; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 556; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 556; + t.Ccaron = 722; + t.ugrave = 556; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 333; + t.Ntilde = 722; + t.otilde = 556; + t.Rcommaaccent = 722; + t.Lcommaaccent = 556; + t.Atilde = 667; + t.Aogonek = 667; + t.Aring = 667; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 500; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 556; + t.tcommaaccent = 278; + t.logicalnot = 584; + t.odieresis = 556; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 556; + t.eth = 556; + t.zcaron = 500; + t.ncommaaccent = 556; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; + }); + t.Symbol = getLookupTableFactory(function (t) { + t.space = 250; + t.exclam = 333; + t.universal = 713; + t.numbersign = 500; + t.existential = 549; + t.percent = 833; + t.ampersand = 778; + t.suchthat = 439; + t.parenleft = 333; + t.parenright = 333; + t.asteriskmath = 500; + t.plus = 549; + t.comma = 250; + t.minus = 549; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 278; + t.semicolon = 278; + t.less = 549; + t.equal = 549; + t.greater = 549; + t.question = 444; + t.congruent = 549; + t.Alpha = 722; + t.Beta = 667; + t.Chi = 722; + t.Delta = 612; + t.Epsilon = 611; + t.Phi = 763; + t.Gamma = 603; + t.Eta = 722; + t.Iota = 333; + t.theta1 = 631; + t.Kappa = 722; + t.Lambda = 686; + t.Mu = 889; + t.Nu = 722; + t.Omicron = 722; + t.Pi = 768; + t.Theta = 741; + t.Rho = 556; + t.Sigma = 592; + t.Tau = 611; + t.Upsilon = 690; + t.sigma1 = 439; + t.Omega = 768; + t.Xi = 645; + t.Psi = 795; + t.Zeta = 611; + t.bracketleft = 333; + t.therefore = 863; + t.bracketright = 333; + t.perpendicular = 658; + t.underscore = 500; + t.radicalex = 500; + t.alpha = 631; + t.beta = 549; + t.chi = 549; + t.delta = 494; + t.epsilon = 439; + t.phi = 521; + t.gamma = 411; + t.eta = 603; + t.iota = 329; + t.phi1 = 603; + t.kappa = 549; + t.lambda = 549; + t.mu = 576; + t.nu = 521; + t.omicron = 549; + t.pi = 549; + t.theta = 521; + t.rho = 549; + t.sigma = 603; + t.tau = 439; + t.upsilon = 576; + t.omega1 = 713; + t.omega = 686; + t.xi = 493; + t.psi = 686; + t.zeta = 494; + t.braceleft = 480; + t.bar = 200; + t.braceright = 480; + t.similar = 549; + t.Euro = 750; + t.Upsilon1 = 620; + t.minute = 247; + t.lessequal = 549; + t.fraction = 167; + t.infinity = 713; + t.florin = 500; + t.club = 753; + t.diamond = 753; + t.heart = 753; + t.spade = 753; + t.arrowboth = 1042; + t.arrowleft = 987; + t.arrowup = 603; + t.arrowright = 987; + t.arrowdown = 603; + t.degree = 400; + t.plusminus = 549; + t.second = 411; + t.greaterequal = 549; + t.multiply = 549; + t.proportional = 713; + t.partialdiff = 494; + t.bullet = 460; + t.divide = 549; + t.notequal = 549; + t.equivalence = 549; + t.approxequal = 549; + t.ellipsis = 1000; + t.arrowvertex = 603; + t.arrowhorizex = 1000; + t.carriagereturn = 658; + t.aleph = 823; + t.Ifraktur = 686; + t.Rfraktur = 795; + t.weierstrass = 987; + t.circlemultiply = 768; + t.circleplus = 768; + t.emptyset = 823; + t.intersection = 768; + t.union = 768; + t.propersuperset = 713; + t.reflexsuperset = 713; + t.notsubset = 713; + t.propersubset = 713; + t.reflexsubset = 713; + t.element = 713; + t.notelement = 713; + t.angle = 768; + t.gradient = 713; + t.registerserif = 790; + t.copyrightserif = 790; + t.trademarkserif = 890; + t.product = 823; + t.radical = 549; + t.dotmath = 250; + t.logicalnot = 713; + t.logicaland = 603; + t.logicalor = 603; + t.arrowdblboth = 1042; + t.arrowdblleft = 987; + t.arrowdblup = 603; + t.arrowdblright = 987; + t.arrowdbldown = 603; + t.lozenge = 494; + t.angleleft = 329; + t.registersans = 790; + t.copyrightsans = 790; + t.trademarksans = 786; + t.summation = 713; + t.parenlefttp = 384; + t.parenleftex = 384; + t.parenleftbt = 384; + t.bracketlefttp = 384; + t.bracketleftex = 384; + t.bracketleftbt = 384; + t.bracelefttp = 494; + t.braceleftmid = 494; + t.braceleftbt = 494; + t.braceex = 494; + t.angleright = 329; + t.integral = 274; + t.integraltp = 686; + t.integralex = 686; + t.integralbt = 686; + t.parenrighttp = 384; + t.parenrightex = 384; + t.parenrightbt = 384; + t.bracketrighttp = 384; + t.bracketrightex = 384; + t.bracketrightbt = 384; + t.bracerighttp = 494; + t.bracerightmid = 494; + t.bracerightbt = 494; + t.apple = 790; + }); + t["Times-Roman"] = getLookupTableFactory(function (t) { + t.space = 250; + t.exclam = 333; + t.quotedbl = 408; + t.numbersign = 500; + t.dollar = 500; + t.percent = 833; + t.ampersand = 778; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 564; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 278; + t.semicolon = 278; + t.less = 564; + t.equal = 564; + t.greater = 564; + t.question = 444; + t.at = 921; + t.A = 722; + t.B = 667; + t.C = 667; + t.D = 722; + t.E = 611; + t.F = 556; + t.G = 722; + t.H = 722; + t.I = 333; + t.J = 389; + t.K = 722; + t.L = 611; + t.M = 889; + t.N = 722; + t.O = 722; + t.P = 556; + t.Q = 722; + t.R = 667; + t.S = 556; + t.T = 611; + t.U = 722; + t.V = 722; + t.W = 944; + t.X = 722; + t.Y = 722; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 469; + t.underscore = 500; + t.quoteleft = 333; + t.a = 444; + t.b = 500; + t.c = 444; + t.d = 500; + t.e = 444; + t.f = 333; + t.g = 500; + t.h = 500; + t.i = 278; + t.j = 278; + t.k = 500; + t.l = 278; + t.m = 778; + t.n = 500; + t.o = 500; + t.p = 500; + t.q = 500; + t.r = 333; + t.s = 389; + t.t = 278; + t.u = 500; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 444; + t.braceleft = 480; + t.bar = 200; + t.braceright = 480; + t.asciitilde = 541; + t.exclamdown = 333; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 180; + t.quotedblleft = 444; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 556; + t.fl = 556; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 453; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 444; + t.quotedblright = 444; + t.guillemotright = 500; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 444; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 889; + t.ordfeminine = 276; + t.Lslash = 611; + t.Oslash = 722; + t.OE = 889; + t.ordmasculine = 310; + t.ae = 667; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 722; + t.germandbls = 500; + t.Idieresis = 333; + t.eacute = 444; + t.abreve = 444; + t.uhungarumlaut = 500; + t.ecaron = 444; + t.Ydieresis = 722; + t.divide = 564; + t.Yacute = 722; + t.Acircumflex = 722; + t.aacute = 444; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 444; + t.Uacute = 722; + t.uogonek = 500; + t.Edieresis = 611; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 760; + t.Emacron = 611; + t.ccaron = 444; + t.aring = 444; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 444; + t.Tcommaaccent = 611; + t.Cacute = 667; + t.atilde = 444; + t.Edotaccent = 611; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 667; + t.Gcommaaccent = 722; + t.ucircumflex = 500; + t.acircumflex = 444; + t.Amacron = 722; + t.rcaron = 333; + t.ccedilla = 444; + t.Zdotaccent = 611; + t.Thorn = 556; + t.Omacron = 722; + t.Racute = 667; + t.Sacute = 556; + t.dcaron = 588; + t.Umacron = 722; + t.uring = 500; + t.threesuperior = 300; + t.Ograve = 722; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 564; + t.uacute = 500; + t.Tcaron = 611; + t.partialdiff = 476; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 611; + t.adieresis = 444; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 500; + t.umacron = 500; + t.Ncaron = 722; + t.Iacute = 333; + t.plusminus = 564; + t.brokenbar = 200; + t.registered = 760; + t.Gbreve = 722; + t.Idotaccent = 333; + t.summation = 600; + t.Egrave = 611; + t.racute = 333; + t.omacron = 500; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 667; + t.lcommaaccent = 278; + t.tcaron = 326; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 444; + t.zacute = 444; + t.iogonek = 278; + t.Oacute = 722; + t.oacute = 500; + t.amacron = 444; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 722; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 500; + t.twosuperior = 300; + t.Odieresis = 722; + t.mu = 500; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 611; + t.dcroat = 500; + t.threequarters = 750; + t.Scedilla = 556; + t.lcaron = 344; + t.Kcommaaccent = 722; + t.Lacute = 611; + t.trademark = 980; + t.edotaccent = 444; + t.Igrave = 333; + t.Imacron = 333; + t.Lcaron = 611; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 500; + t.Uhungarumlaut = 722; + t.Eacute = 611; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 556; + t.Scommaaccent = 556; + t.Ohungarumlaut = 722; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 667; + t.ugrave = 500; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 333; + t.Ntilde = 722; + t.otilde = 500; + t.Rcommaaccent = 667; + t.Lcommaaccent = 611; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 722; + t.zdotaccent = 444; + t.Ecaron = 611; + t.Iogonek = 333; + t.kcommaaccent = 500; + t.minus = 564; + t.Icircumflex = 333; + t.ncaron = 500; + t.tcommaaccent = 278; + t.logicalnot = 564; + t.odieresis = 500; + t.udieresis = 500; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 444; + t.ncommaaccent = 500; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t["Times-Bold"] = getLookupTableFactory(function (t) { + t.space = 250; + t.exclam = 333; + t.quotedbl = 555; + t.numbersign = 500; + t.dollar = 500; + t.percent = 1000; + t.ampersand = 833; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 570; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 333; + t.semicolon = 333; + t.less = 570; + t.equal = 570; + t.greater = 570; + t.question = 500; + t.at = 930; + t.A = 722; + t.B = 667; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 778; + t.I = 389; + t.J = 500; + t.K = 778; + t.L = 667; + t.M = 944; + t.N = 722; + t.O = 778; + t.P = 611; + t.Q = 778; + t.R = 722; + t.S = 556; + t.T = 667; + t.U = 722; + t.V = 722; + t.W = 1000; + t.X = 722; + t.Y = 722; + t.Z = 667; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 581; + t.underscore = 500; + t.quoteleft = 333; + t.a = 500; + t.b = 556; + t.c = 444; + t.d = 556; + t.e = 444; + t.f = 333; + t.g = 500; + t.h = 556; + t.i = 278; + t.j = 333; + t.k = 556; + t.l = 278; + t.m = 833; + t.n = 556; + t.o = 500; + t.p = 556; + t.q = 556; + t.r = 444; + t.s = 389; + t.t = 333; + t.u = 556; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 444; + t.braceleft = 394; + t.bar = 220; + t.braceright = 394; + t.asciitilde = 520; + t.exclamdown = 333; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 278; + t.quotedblleft = 500; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 556; + t.fl = 556; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 540; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 500; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 500; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 300; + t.Lslash = 667; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 330; + t.ae = 722; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 722; + t.germandbls = 556; + t.Idieresis = 389; + t.eacute = 444; + t.abreve = 500; + t.uhungarumlaut = 556; + t.ecaron = 444; + t.Ydieresis = 722; + t.divide = 570; + t.Yacute = 722; + t.Acircumflex = 722; + t.aacute = 500; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 500; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 747; + t.Emacron = 667; + t.ccaron = 444; + t.aring = 500; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 500; + t.Tcommaaccent = 667; + t.Cacute = 722; + t.atilde = 500; + t.Edotaccent = 667; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 556; + t.acircumflex = 500; + t.Amacron = 722; + t.rcaron = 444; + t.ccedilla = 444; + t.Zdotaccent = 667; + t.Thorn = 611; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 556; + t.dcaron = 672; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 300; + t.Ograve = 778; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 570; + t.uacute = 556; + t.Tcaron = 667; + t.partialdiff = 494; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 500; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 389; + t.plusminus = 570; + t.brokenbar = 220; + t.registered = 747; + t.Gbreve = 778; + t.Idotaccent = 389; + t.summation = 600; + t.Egrave = 667; + t.racute = 444; + t.omacron = 500; + t.Zacute = 667; + t.Zcaron = 667; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 278; + t.tcaron = 416; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 444; + t.zacute = 444; + t.iogonek = 278; + t.Oacute = 778; + t.oacute = 500; + t.amacron = 500; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 556; + t.twosuperior = 300; + t.Odieresis = 778; + t.mu = 556; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 667; + t.dcroat = 556; + t.threequarters = 750; + t.Scedilla = 556; + t.lcaron = 394; + t.Kcommaaccent = 778; + t.Lacute = 667; + t.trademark = 1000; + t.edotaccent = 444; + t.Igrave = 389; + t.Imacron = 389; + t.Lcaron = 667; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 556; + t.Scommaaccent = 556; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 722; + t.ugrave = 556; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 444; + t.Ntilde = 722; + t.otilde = 500; + t.Rcommaaccent = 722; + t.Lcommaaccent = 667; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 778; + t.zdotaccent = 444; + t.Ecaron = 667; + t.Iogonek = 389; + t.kcommaaccent = 556; + t.minus = 570; + t.Icircumflex = 389; + t.ncaron = 556; + t.tcommaaccent = 333; + t.logicalnot = 570; + t.odieresis = 500; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 444; + t.ncommaaccent = 556; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t["Times-BoldItalic"] = getLookupTableFactory(function (t) { + t.space = 250; + t.exclam = 389; + t.quotedbl = 555; + t.numbersign = 500; + t.dollar = 500; + t.percent = 833; + t.ampersand = 778; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 570; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 333; + t.semicolon = 333; + t.less = 570; + t.equal = 570; + t.greater = 570; + t.question = 500; + t.at = 832; + t.A = 667; + t.B = 667; + t.C = 667; + t.D = 722; + t.E = 667; + t.F = 667; + t.G = 722; + t.H = 778; + t.I = 389; + t.J = 500; + t.K = 667; + t.L = 611; + t.M = 889; + t.N = 722; + t.O = 722; + t.P = 611; + t.Q = 722; + t.R = 667; + t.S = 556; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 889; + t.X = 667; + t.Y = 611; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 570; + t.underscore = 500; + t.quoteleft = 333; + t.a = 500; + t.b = 500; + t.c = 444; + t.d = 500; + t.e = 444; + t.f = 333; + t.g = 500; + t.h = 556; + t.i = 278; + t.j = 278; + t.k = 500; + t.l = 278; + t.m = 778; + t.n = 556; + t.o = 500; + t.p = 500; + t.q = 500; + t.r = 389; + t.s = 389; + t.t = 278; + t.u = 556; + t.v = 444; + t.w = 667; + t.x = 500; + t.y = 444; + t.z = 389; + t.braceleft = 348; + t.bar = 220; + t.braceright = 348; + t.asciitilde = 570; + t.exclamdown = 389; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 278; + t.quotedblleft = 500; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 556; + t.fl = 556; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 500; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 500; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 500; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 944; + t.ordfeminine = 266; + t.Lslash = 611; + t.Oslash = 722; + t.OE = 944; + t.ordmasculine = 300; + t.ae = 722; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 722; + t.germandbls = 500; + t.Idieresis = 389; + t.eacute = 444; + t.abreve = 500; + t.uhungarumlaut = 556; + t.ecaron = 444; + t.Ydieresis = 611; + t.divide = 570; + t.Yacute = 611; + t.Acircumflex = 667; + t.aacute = 500; + t.Ucircumflex = 722; + t.yacute = 444; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 500; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 747; + t.Emacron = 667; + t.ccaron = 444; + t.aring = 500; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 500; + t.Tcommaaccent = 611; + t.Cacute = 667; + t.atilde = 500; + t.Edotaccent = 667; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 667; + t.Gcommaaccent = 722; + t.ucircumflex = 556; + t.acircumflex = 500; + t.Amacron = 667; + t.rcaron = 389; + t.ccedilla = 444; + t.Zdotaccent = 611; + t.Thorn = 611; + t.Omacron = 722; + t.Racute = 667; + t.Sacute = 556; + t.dcaron = 608; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 300; + t.Ograve = 722; + t.Agrave = 667; + t.Abreve = 667; + t.multiply = 570; + t.uacute = 556; + t.Tcaron = 611; + t.partialdiff = 494; + t.ydieresis = 444; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 500; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 389; + t.plusminus = 570; + t.brokenbar = 220; + t.registered = 747; + t.Gbreve = 722; + t.Idotaccent = 389; + t.summation = 600; + t.Egrave = 667; + t.racute = 389; + t.omacron = 500; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 667; + t.lcommaaccent = 278; + t.tcaron = 366; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 667; + t.Adieresis = 667; + t.egrave = 444; + t.zacute = 389; + t.iogonek = 278; + t.Oacute = 722; + t.oacute = 500; + t.amacron = 500; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 722; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 500; + t.twosuperior = 300; + t.Odieresis = 722; + t.mu = 576; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 667; + t.dcroat = 500; + t.threequarters = 750; + t.Scedilla = 556; + t.lcaron = 382; + t.Kcommaaccent = 667; + t.Lacute = 611; + t.trademark = 1000; + t.edotaccent = 444; + t.Igrave = 389; + t.Imacron = 389; + t.Lcaron = 611; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 556; + t.Scommaaccent = 556; + t.Ohungarumlaut = 722; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 667; + t.ugrave = 556; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 722; + t.otilde = 500; + t.Rcommaaccent = 667; + t.Lcommaaccent = 611; + t.Atilde = 667; + t.Aogonek = 667; + t.Aring = 667; + t.Otilde = 722; + t.zdotaccent = 389; + t.Ecaron = 667; + t.Iogonek = 389; + t.kcommaaccent = 500; + t.minus = 606; + t.Icircumflex = 389; + t.ncaron = 556; + t.tcommaaccent = 278; + t.logicalnot = 606; + t.odieresis = 500; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 389; + t.ncommaaccent = 556; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t["Times-Italic"] = getLookupTableFactory(function (t) { + t.space = 250; + t.exclam = 333; + t.quotedbl = 420; + t.numbersign = 500; + t.dollar = 500; + t.percent = 833; + t.ampersand = 778; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 675; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 333; + t.semicolon = 333; + t.less = 675; + t.equal = 675; + t.greater = 675; + t.question = 500; + t.at = 920; + t.A = 611; + t.B = 611; + t.C = 667; + t.D = 722; + t.E = 611; + t.F = 611; + t.G = 722; + t.H = 722; + t.I = 333; + t.J = 444; + t.K = 667; + t.L = 556; + t.M = 833; + t.N = 667; + t.O = 722; + t.P = 611; + t.Q = 722; + t.R = 611; + t.S = 500; + t.T = 556; + t.U = 722; + t.V = 611; + t.W = 833; + t.X = 611; + t.Y = 556; + t.Z = 556; + t.bracketleft = 389; + t.backslash = 278; + t.bracketright = 389; + t.asciicircum = 422; + t.underscore = 500; + t.quoteleft = 333; + t.a = 500; + t.b = 500; + t.c = 444; + t.d = 500; + t.e = 444; + t.f = 278; + t.g = 500; + t.h = 500; + t.i = 278; + t.j = 278; + t.k = 444; + t.l = 278; + t.m = 722; + t.n = 500; + t.o = 500; + t.p = 500; + t.q = 500; + t.r = 389; + t.s = 389; + t.t = 278; + t.u = 500; + t.v = 444; + t.w = 667; + t.x = 444; + t.y = 444; + t.z = 389; + t.braceleft = 400; + t.bar = 275; + t.braceright = 400; + t.asciitilde = 541; + t.exclamdown = 389; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 214; + t.quotedblleft = 556; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 500; + t.fl = 500; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 523; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 556; + t.quotedblright = 556; + t.guillemotright = 500; + t.ellipsis = 889; + t.perthousand = 1000; + t.questiondown = 500; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 889; + t.AE = 889; + t.ordfeminine = 276; + t.Lslash = 556; + t.Oslash = 722; + t.OE = 944; + t.ordmasculine = 310; + t.ae = 667; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 667; + t.germandbls = 500; + t.Idieresis = 333; + t.eacute = 444; + t.abreve = 500; + t.uhungarumlaut = 500; + t.ecaron = 444; + t.Ydieresis = 556; + t.divide = 675; + t.Yacute = 556; + t.Acircumflex = 611; + t.aacute = 500; + t.Ucircumflex = 722; + t.yacute = 444; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 500; + t.Uacute = 722; + t.uogonek = 500; + t.Edieresis = 611; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 760; + t.Emacron = 611; + t.ccaron = 444; + t.aring = 500; + t.Ncommaaccent = 667; + t.lacute = 278; + t.agrave = 500; + t.Tcommaaccent = 556; + t.Cacute = 667; + t.atilde = 500; + t.Edotaccent = 611; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 611; + t.Gcommaaccent = 722; + t.ucircumflex = 500; + t.acircumflex = 500; + t.Amacron = 611; + t.rcaron = 389; + t.ccedilla = 444; + t.Zdotaccent = 556; + t.Thorn = 611; + t.Omacron = 722; + t.Racute = 611; + t.Sacute = 500; + t.dcaron = 544; + t.Umacron = 722; + t.uring = 500; + t.threesuperior = 300; + t.Ograve = 722; + t.Agrave = 611; + t.Abreve = 611; + t.multiply = 675; + t.uacute = 500; + t.Tcaron = 556; + t.partialdiff = 476; + t.ydieresis = 444; + t.Nacute = 667; + t.icircumflex = 278; + t.Ecircumflex = 611; + t.adieresis = 500; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 500; + t.umacron = 500; + t.Ncaron = 667; + t.Iacute = 333; + t.plusminus = 675; + t.brokenbar = 275; + t.registered = 760; + t.Gbreve = 722; + t.Idotaccent = 333; + t.summation = 600; + t.Egrave = 611; + t.racute = 389; + t.omacron = 500; + t.Zacute = 556; + t.Zcaron = 556; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 667; + t.lcommaaccent = 278; + t.tcaron = 300; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 611; + t.Adieresis = 611; + t.egrave = 444; + t.zacute = 389; + t.iogonek = 278; + t.Oacute = 722; + t.oacute = 500; + t.amacron = 500; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 722; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 500; + t.twosuperior = 300; + t.Odieresis = 722; + t.mu = 500; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 611; + t.dcroat = 500; + t.threequarters = 750; + t.Scedilla = 500; + t.lcaron = 300; + t.Kcommaaccent = 667; + t.Lacute = 556; + t.trademark = 980; + t.edotaccent = 444; + t.Igrave = 333; + t.Imacron = 333; + t.Lcaron = 611; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 500; + t.Uhungarumlaut = 722; + t.Eacute = 611; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 500; + t.Scommaaccent = 500; + t.Ohungarumlaut = 722; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 667; + t.ugrave = 500; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 667; + t.otilde = 500; + t.Rcommaaccent = 611; + t.Lcommaaccent = 556; + t.Atilde = 611; + t.Aogonek = 611; + t.Aring = 611; + t.Otilde = 722; + t.zdotaccent = 389; + t.Ecaron = 611; + t.Iogonek = 333; + t.kcommaaccent = 444; + t.minus = 675; + t.Icircumflex = 333; + t.ncaron = 500; + t.tcommaaccent = 278; + t.logicalnot = 675; + t.odieresis = 500; + t.udieresis = 500; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 389; + t.ncommaaccent = 500; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t.ZapfDingbats = getLookupTableFactory(function (t) { + t.space = 278; + t.a1 = 974; + t.a2 = 961; + t.a202 = 974; + t.a3 = 980; + t.a4 = 719; + t.a5 = 789; + t.a119 = 790; + t.a118 = 791; + t.a117 = 690; + t.a11 = 960; + t.a12 = 939; + t.a13 = 549; + t.a14 = 855; + t.a15 = 911; + t.a16 = 933; + t.a105 = 911; + t.a17 = 945; + t.a18 = 974; + t.a19 = 755; + t.a20 = 846; + t.a21 = 762; + t.a22 = 761; + t.a23 = 571; + t.a24 = 677; + t.a25 = 763; + t.a26 = 760; + t.a27 = 759; + t.a28 = 754; + t.a6 = 494; + t.a7 = 552; + t.a8 = 537; + t.a9 = 577; + t.a10 = 692; + t.a29 = 786; + t.a30 = 788; + t.a31 = 788; + t.a32 = 790; + t.a33 = 793; + t.a34 = 794; + t.a35 = 816; + t.a36 = 823; + t.a37 = 789; + t.a38 = 841; + t.a39 = 823; + t.a40 = 833; + t.a41 = 816; + t.a42 = 831; + t.a43 = 923; + t.a44 = 744; + t.a45 = 723; + t.a46 = 749; + t.a47 = 790; + t.a48 = 792; + t.a49 = 695; + t.a50 = 776; + t.a51 = 768; + t.a52 = 792; + t.a53 = 759; + t.a54 = 707; + t.a55 = 708; + t.a56 = 682; + t.a57 = 701; + t.a58 = 826; + t.a59 = 815; + t.a60 = 789; + t.a61 = 789; + t.a62 = 707; + t.a63 = 687; + t.a64 = 696; + t.a65 = 689; + t.a66 = 786; + t.a67 = 787; + t.a68 = 713; + t.a69 = 791; + t.a70 = 785; + t.a71 = 791; + t.a72 = 873; + t.a73 = 761; + t.a74 = 762; + t.a203 = 762; + t.a75 = 759; + t.a204 = 759; + t.a76 = 892; + t.a77 = 892; + t.a78 = 788; + t.a79 = 784; + t.a81 = 438; + t.a82 = 138; + t.a83 = 277; + t.a84 = 415; + t.a97 = 392; + t.a98 = 392; + t.a99 = 668; + t.a100 = 668; + t.a89 = 390; + t.a90 = 390; + t.a93 = 317; + t.a94 = 317; + t.a91 = 276; + t.a92 = 276; + t.a205 = 509; + t.a85 = 509; + t.a206 = 410; + t.a86 = 410; + t.a87 = 234; + t.a88 = 234; + t.a95 = 334; + t.a96 = 334; + t.a101 = 732; + t.a102 = 544; + t.a103 = 544; + t.a104 = 910; + t.a106 = 667; + t.a107 = 760; + t.a108 = 760; + t.a112 = 776; + t.a111 = 595; + t.a110 = 694; + t.a109 = 626; + t.a120 = 788; + t.a121 = 788; + t.a122 = 788; + t.a123 = 788; + t.a124 = 788; + t.a125 = 788; + t.a126 = 788; + t.a127 = 788; + t.a128 = 788; + t.a129 = 788; + t.a130 = 788; + t.a131 = 788; + t.a132 = 788; + t.a133 = 788; + t.a134 = 788; + t.a135 = 788; + t.a136 = 788; + t.a137 = 788; + t.a138 = 788; + t.a139 = 788; + t.a140 = 788; + t.a141 = 788; + t.a142 = 788; + t.a143 = 788; + t.a144 = 788; + t.a145 = 788; + t.a146 = 788; + t.a147 = 788; + t.a148 = 788; + t.a149 = 788; + t.a150 = 788; + t.a151 = 788; + t.a152 = 788; + t.a153 = 788; + t.a154 = 788; + t.a155 = 788; + t.a156 = 788; + t.a157 = 788; + t.a158 = 788; + t.a159 = 788; + t.a160 = 894; + t.a161 = 838; + t.a163 = 1016; + t.a164 = 458; + t.a196 = 748; + t.a165 = 924; + t.a192 = 748; + t.a166 = 918; + t.a167 = 927; + t.a168 = 928; + t.a169 = 928; + t.a170 = 834; + t.a171 = 873; + t.a172 = 828; + t.a173 = 924; + t.a162 = 924; + t.a174 = 917; + t.a175 = 930; + t.a176 = 931; + t.a177 = 463; + t.a178 = 883; + t.a179 = 836; + t.a193 = 836; + t.a180 = 867; + t.a199 = 867; + t.a181 = 696; + t.a200 = 696; + t.a182 = 874; + t.a201 = 874; + t.a183 = 760; + t.a184 = 946; + t.a197 = 771; + t.a185 = 865; + t.a194 = 771; + t.a198 = 888; + t.a186 = 967; + t.a195 = 888; + t.a187 = 831; + t.a188 = 873; + t.a189 = 927; + t.a190 = 970; + t.a191 = 918; + }); +}); +const getFontBasicMetrics = getLookupTableFactory(function (t) { + t.Courier = { + ascent: 629, + descent: -157, + capHeight: 562, + xHeight: -426, + }; + t["Courier-Bold"] = { + ascent: 629, + descent: -157, + capHeight: 562, + xHeight: 439, + }; + t["Courier-Oblique"] = { + ascent: 629, + descent: -157, + capHeight: 562, + xHeight: 426, + }; + t["Courier-BoldOblique"] = { + ascent: 629, + descent: -157, + capHeight: 562, + xHeight: 426, + }; + t.Helvetica = { + ascent: 718, + descent: -207, + capHeight: 718, + xHeight: 523, + }; + t["Helvetica-Bold"] = { + ascent: 718, + descent: -207, + capHeight: 718, + xHeight: 532, + }; + t["Helvetica-Oblique"] = { + ascent: 718, + descent: -207, + capHeight: 718, + xHeight: 523, + }; + t["Helvetica-BoldOblique"] = { + ascent: 718, + descent: -207, + capHeight: 718, + xHeight: 532, + }; + t["Times-Roman"] = { + ascent: 683, + descent: -217, + capHeight: 662, + xHeight: 450, + }; + t["Times-Bold"] = { + ascent: 683, + descent: -217, + capHeight: 676, + xHeight: 461, + }; + t["Times-Italic"] = { + ascent: 683, + descent: -217, + capHeight: 653, + xHeight: 441, + }; + t["Times-BoldItalic"] = { + ascent: 683, + descent: -217, + capHeight: 669, + xHeight: 462, + }; + t.Symbol = { + ascent: Math.NaN, + descent: Math.NaN, + capHeight: Math.NaN, + xHeight: Math.NaN, + }; + t.ZapfDingbats = { + ascent: Math.NaN, + descent: Math.NaN, + capHeight: Math.NaN, + xHeight: Math.NaN, + }; +}); // ./src/core/glyf.js + +const ON_CURVE_POINT = 1 << 0; +const X_SHORT_VECTOR = 1 << 1; +const Y_SHORT_VECTOR = 1 << 2; +const REPEAT_FLAG = 1 << 3; +const X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR = 1 << 4; +const Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR = 1 << 5; +const OVERLAP_SIMPLE = 1 << 6; +const ARG_1_AND_2_ARE_WORDS = 1 << 0; +const ARGS_ARE_XY_VALUES = 1 << 1; +const WE_HAVE_A_SCALE = 1 << 3; +const MORE_COMPONENTS = 1 << 5; +const WE_HAVE_AN_X_AND_Y_SCALE = 1 << 6; +const WE_HAVE_A_TWO_BY_TWO = 1 << 7; +const WE_HAVE_INSTRUCTIONS = 1 << 8; class GlyfTable { - constructor({ - glyfTable: e, - isGlyphLocationsLong: t, - locaTable: i, - numGlyphs: a, - }) { + constructor({ glyfTable, isGlyphLocationsLong, locaTable, numGlyphs }) { this.glyphs = []; - const s = new DataView(i.buffer, i.byteOffset, i.byteLength), - r = new DataView(e.buffer, e.byteOffset, e.byteLength), - n = t ? 4 : 2; - let g = t ? s.getUint32(0) : 2 * s.getUint16(0), - o = 0; - for (let e = 0; e < a; e++) { - o += n; - const e = t ? s.getUint32(o) : 2 * s.getUint16(o); - if (e === g) { + const loca = new DataView( + locaTable.buffer, + locaTable.byteOffset, + locaTable.byteLength, + ); + const glyf = new DataView( + glyfTable.buffer, + glyfTable.byteOffset, + glyfTable.byteLength, + ); + const offsetSize = isGlyphLocationsLong ? 4 : 2; + let prev = isGlyphLocationsLong ? loca.getUint32(0) : 2 * loca.getUint16(0); + let pos = 0; + for (let i = 0; i < numGlyphs; i++) { + pos += offsetSize; + const next = isGlyphLocationsLong + ? loca.getUint32(pos) + : 2 * loca.getUint16(pos); + if (next === prev) { this.glyphs.push(new Glyph({})); continue; } - const i = Glyph.parse(g, r); - this.glyphs.push(i); - g = e; + const glyph = Glyph.parse(prev, glyf); + this.glyphs.push(glyph); + prev = next; } } getSize() { - return this.glyphs.reduce((e, t) => e + ((t.getSize() + 3) & -4), 0); + return this.glyphs.reduce((a, g) => { + const size = g.getSize(); + return a + ((size + 3) & ~3); + }, 0); } write() { - const e = this.getSize(), - t = new DataView(new ArrayBuffer(e)), - i = e > 131070, - a = i ? 4 : 2, - s = new DataView(new ArrayBuffer((this.glyphs.length + 1) * a)); - i ? s.setUint32(0, 0) : s.setUint16(0, 0); - let r = 0, - n = 0; - for (const e of this.glyphs) { - r += e.write(r, t); - r = (r + 3) & -4; - n += a; - i ? s.setUint32(n, r) : s.setUint16(n, r >> 1); + const totalSize = this.getSize(); + const glyfTable = new DataView(new ArrayBuffer(totalSize)); + const isLocationLong = totalSize > 0x1fffe; + const offsetSize = isLocationLong ? 4 : 2; + const locaTable = new DataView( + new ArrayBuffer((this.glyphs.length + 1) * offsetSize), + ); + if (isLocationLong) { + locaTable.setUint32(0, 0); + } else { + locaTable.setUint16(0, 0); + } + let pos = 0; + let locaIndex = 0; + for (const glyph of this.glyphs) { + pos += glyph.write(pos, glyfTable); + pos = (pos + 3) & ~3; + locaIndex += offsetSize; + if (isLocationLong) { + locaTable.setUint32(locaIndex, pos); + } else { + locaTable.setUint16(locaIndex, pos >> 1); + } } return { - isLocationLong: i, - loca: new Uint8Array(s.buffer), - glyf: new Uint8Array(t.buffer), + isLocationLong, + loca: new Uint8Array(locaTable.buffer), + glyf: new Uint8Array(glyfTable.buffer), }; } - scale(e) { - for (let t = 0, i = this.glyphs.length; t < i; t++) - this.glyphs[t].scale(e[t]); + scale(factors) { + for (let i = 0, ii = this.glyphs.length; i < ii; i++) { + this.glyphs[i].scale(factors[i]); + } } } class Glyph { - constructor({ header: e = null, simple: t = null, composites: i = null }) { - this.header = e; - this.simple = t; - this.composites = i; + constructor({ header = null, simple = null, composites = null }) { + this.header = header; + this.simple = simple; + this.composites = composites; } - static parse(e, t) { - const [i, a] = GlyphHeader.parse(e, t); - e += i; - if (a.numberOfContours < 0) { - const i = []; - for (;;) { - const [a, s] = CompositeGlyph.parse(e, t); - e += a; - i.push(s); - if (!(32 & s.flags)) break; + static parse(pos, glyf) { + const [read, header] = GlyphHeader.parse(pos, glyf); + pos += read; + if (header.numberOfContours < 0) { + const composites = []; + while (true) { + const [n, composite] = CompositeGlyph.parse(pos, glyf); + pos += n; + composites.push(composite); + if (!(composite.flags & MORE_COMPONENTS)) { + break; + } } - return new Glyph({ header: a, composites: i }); + return new Glyph({ + header, + composites, + }); } - const s = SimpleGlyph.parse(e, t, a.numberOfContours); - return new Glyph({ header: a, simple: s }); + const simple = SimpleGlyph.parse(pos, glyf, header.numberOfContours); + return new Glyph({ + header, + simple, + }); } getSize() { - if (!this.header) return 0; - const e = this.simple + if (!this.header) { + return 0; + } + const size = this.simple ? this.simple.getSize() - : this.composites.reduce((e, t) => e + t.getSize(), 0); - return this.header.getSize() + e; + : this.composites.reduce((a, c) => a + c.getSize(), 0); + return this.header.getSize() + size; } - write(e, t) { - if (!this.header) return 0; - const i = e; - e += this.header.write(e, t); - if (this.simple) e += this.simple.write(e, t); - else for (const i of this.composites) e += i.write(e, t); - return e - i; + write(pos, buf) { + if (!this.header) { + return 0; + } + const spos = pos; + pos += this.header.write(pos, buf); + if (this.simple) { + pos += this.simple.write(pos, buf); + } else { + for (const composite of this.composites) { + pos += composite.write(pos, buf); + } + } + return pos - spos; } - scale(e) { - if (!this.header) return; - const t = (this.header.xMin + this.header.xMax) / 2; - this.header.scale(t, e); - if (this.simple) this.simple.scale(t, e); - else for (const i of this.composites) i.scale(t, e); + scale(factor) { + if (!this.header) { + return; + } + const xMiddle = (this.header.xMin + this.header.xMax) / 2; + this.header.scale(xMiddle, factor); + if (this.simple) { + this.simple.scale(xMiddle, factor); + } else { + for (const composite of this.composites) { + composite.scale(xMiddle, factor); + } + } } } class GlyphHeader { - constructor({ numberOfContours: e, xMin: t, yMin: i, xMax: a, yMax: s }) { - this.numberOfContours = e; - this.xMin = t; - this.yMin = i; - this.xMax = a; - this.yMax = s; + constructor({ numberOfContours, xMin, yMin, xMax, yMax }) { + this.numberOfContours = numberOfContours; + this.xMin = xMin; + this.yMin = yMin; + this.xMax = xMax; + this.yMax = yMax; } - static parse(e, t) { + static parse(pos, glyf) { return [ 10, new GlyphHeader({ - numberOfContours: t.getInt16(e), - xMin: t.getInt16(e + 2), - yMin: t.getInt16(e + 4), - xMax: t.getInt16(e + 6), - yMax: t.getInt16(e + 8), + numberOfContours: glyf.getInt16(pos), + xMin: glyf.getInt16(pos + 2), + yMin: glyf.getInt16(pos + 4), + xMax: glyf.getInt16(pos + 6), + yMax: glyf.getInt16(pos + 8), }), ]; } getSize() { return 10; } - write(e, t) { - t.setInt16(e, this.numberOfContours); - t.setInt16(e + 2, this.xMin); - t.setInt16(e + 4, this.yMin); - t.setInt16(e + 6, this.xMax); - t.setInt16(e + 8, this.yMax); + write(pos, buf) { + buf.setInt16(pos, this.numberOfContours); + buf.setInt16(pos + 2, this.xMin); + buf.setInt16(pos + 4, this.yMin); + buf.setInt16(pos + 6, this.xMax); + buf.setInt16(pos + 8, this.yMax); return 10; } - scale(e, t) { - this.xMin = Math.round(e + (this.xMin - e) * t); - this.xMax = Math.round(e + (this.xMax - e) * t); + scale(x, factor) { + this.xMin = Math.round(x + (this.xMin - x) * factor); + this.xMax = Math.round(x + (this.xMax - x) * factor); } } class Contour { - constructor({ flags: e, xCoordinates: t, yCoordinates: i }) { - this.xCoordinates = t; - this.yCoordinates = i; - this.flags = e; + constructor({ flags, xCoordinates, yCoordinates }) { + this.xCoordinates = xCoordinates; + this.yCoordinates = yCoordinates; + this.flags = flags; } } class SimpleGlyph { - constructor({ contours: e, instructions: t }) { - this.contours = e; - this.instructions = t; + constructor({ contours, instructions }) { + this.contours = contours; + this.instructions = instructions; } - static parse(e, t, i) { - const a = []; - for (let s = 0; s < i; s++) { - const i = t.getUint16(e); - e += 2; - a.push(i); + static parse(pos, glyf, numberOfContours) { + const endPtsOfContours = []; + for (let i = 0; i < numberOfContours; i++) { + const endPt = glyf.getUint16(pos); + pos += 2; + endPtsOfContours.push(endPt); } - const s = a[i - 1] + 1, - r = t.getUint16(e); - e += 2; - const n = new Uint8Array(t).slice(e, e + r); - e += r; - const g = []; - for (let i = 0; i < s; e++, i++) { - let a = t.getUint8(e); - g.push(a); - if (8 & a) { - const s = t.getUint8(++e); - a ^= 8; - for (let e = 0; e < s; e++) g.push(a); - i += s; + const numberOfPt = endPtsOfContours[numberOfContours - 1] + 1; + const instructionLength = glyf.getUint16(pos); + pos += 2; + const instructions = new Uint8Array(glyf).slice( + pos, + pos + instructionLength, + ); + pos += instructionLength; + const flags = []; + for (let i = 0; i < numberOfPt; pos++, i++) { + let flag = glyf.getUint8(pos); + flags.push(flag); + if (flag & REPEAT_FLAG) { + const count = glyf.getUint8(++pos); + flag ^= REPEAT_FLAG; + for (let m = 0; m < count; m++) { + flags.push(flag); + } + i += count; } } - const o = []; - let c = [], - C = [], - h = []; - const l = []; - let Q = 0, - E = 0; - for (let i = 0; i < s; i++) { - const s = g[i]; - if (2 & s) { - const i = t.getUint8(e++); - E += 16 & s ? i : -i; - c.push(E); - } else if (16 & s) c.push(E); - else { - E += t.getInt16(e); - e += 2; - c.push(E); + const allXCoordinates = []; + let xCoordinates = []; + let yCoordinates = []; + let pointFlags = []; + const contours = []; + let endPtsOfContoursIndex = 0; + let lastCoordinate = 0; + for (let i = 0; i < numberOfPt; i++) { + const flag = flags[i]; + if (flag & X_SHORT_VECTOR) { + const x = glyf.getUint8(pos++); + lastCoordinate += flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR ? x : -x; + xCoordinates.push(lastCoordinate); + } else if (flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR) { + xCoordinates.push(lastCoordinate); + } else { + lastCoordinate += glyf.getInt16(pos); + pos += 2; + xCoordinates.push(lastCoordinate); } - if (a[Q] === i) { - Q++; - o.push(c); - c = []; + if (endPtsOfContours[endPtsOfContoursIndex] === i) { + endPtsOfContoursIndex++; + allXCoordinates.push(xCoordinates); + xCoordinates = []; } } - E = 0; - Q = 0; - for (let i = 0; i < s; i++) { - const s = g[i]; - if (4 & s) { - const i = t.getUint8(e++); - E += 32 & s ? i : -i; - C.push(E); - } else if (32 & s) C.push(E); - else { - E += t.getInt16(e); - e += 2; - C.push(E); + lastCoordinate = 0; + endPtsOfContoursIndex = 0; + for (let i = 0; i < numberOfPt; i++) { + const flag = flags[i]; + if (flag & Y_SHORT_VECTOR) { + const y = glyf.getUint8(pos++); + lastCoordinate += flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR ? y : -y; + yCoordinates.push(lastCoordinate); + } else if (flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR) { + yCoordinates.push(lastCoordinate); + } else { + lastCoordinate += glyf.getInt16(pos); + pos += 2; + yCoordinates.push(lastCoordinate); } - h.push((1 & s) | (64 & s)); - if (a[Q] === i) { - c = o[Q]; - Q++; - l.push(new Contour({ flags: h, xCoordinates: c, yCoordinates: C })); - C = []; - h = []; + pointFlags.push((flag & ON_CURVE_POINT) | (flag & OVERLAP_SIMPLE)); + if (endPtsOfContours[endPtsOfContoursIndex] === i) { + xCoordinates = allXCoordinates[endPtsOfContoursIndex]; + endPtsOfContoursIndex++; + contours.push( + new Contour({ + flags: pointFlags, + xCoordinates, + yCoordinates, + }), + ); + yCoordinates = []; + pointFlags = []; } } - return new SimpleGlyph({ contours: l, instructions: n }); + return new SimpleGlyph({ + contours, + instructions, + }); } getSize() { - let e = 2 * this.contours.length + 2 + this.instructions.length, - t = 0, - i = 0; - for (const a of this.contours) { - e += a.flags.length; - for (let s = 0, r = a.xCoordinates.length; s < r; s++) { - const r = a.xCoordinates[s], - n = a.yCoordinates[s]; - let g = Math.abs(r - t); - g > 255 ? (e += 2) : g > 0 && (e += 1); - t = r; - g = Math.abs(n - i); - g > 255 ? (e += 2) : g > 0 && (e += 1); - i = n; + let size = this.contours.length * 2 + 2 + this.instructions.length; + let lastX = 0; + let lastY = 0; + for (const contour of this.contours) { + size += contour.flags.length; + for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) { + const x = contour.xCoordinates[i]; + const y = contour.yCoordinates[i]; + let abs = Math.abs(x - lastX); + if (abs > 255) { + size += 2; + } else if (abs > 0) { + size += 1; + } + lastX = x; + abs = Math.abs(y - lastY); + if (abs > 255) { + size += 2; + } else if (abs > 0) { + size += 1; + } + lastY = y; } } - return e; + return size; } - write(e, t) { - const i = e, - a = [], - s = [], - r = []; - let n = 0, - g = 0; - for (const i of this.contours) { - for (let e = 0, t = i.xCoordinates.length; e < t; e++) { - let t = i.flags[e]; - const o = i.xCoordinates[e]; - let c = o - n; - if (0 === c) { - t |= 16; - a.push(0); + write(pos, buf) { + const spos = pos; + const xCoordinates = []; + const yCoordinates = []; + const flags = []; + let lastX = 0; + let lastY = 0; + for (const contour of this.contours) { + for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) { + let flag = contour.flags[i]; + const x = contour.xCoordinates[i]; + let delta = x - lastX; + if (delta === 0) { + flag |= X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR; + xCoordinates.push(0); } else { - const e = Math.abs(c); - if (e <= 255) { - t |= c >= 0 ? 18 : 2; - a.push(e); - } else a.push(c); + const abs = Math.abs(delta); + if (abs <= 255) { + flag |= + delta >= 0 + ? X_SHORT_VECTOR | X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR + : X_SHORT_VECTOR; + xCoordinates.push(abs); + } else { + xCoordinates.push(delta); + } } - n = o; - const C = i.yCoordinates[e]; - c = C - g; - if (0 === c) { - t |= 32; - s.push(0); + lastX = x; + const y = contour.yCoordinates[i]; + delta = y - lastY; + if (delta === 0) { + flag |= Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR; + yCoordinates.push(0); } else { - const e = Math.abs(c); - if (e <= 255) { - t |= c >= 0 ? 36 : 4; - s.push(e); - } else s.push(c); + const abs = Math.abs(delta); + if (abs <= 255) { + flag |= + delta >= 0 + ? Y_SHORT_VECTOR | Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR + : Y_SHORT_VECTOR; + yCoordinates.push(abs); + } else { + yCoordinates.push(delta); + } } - g = C; - r.push(t); + lastY = y; + flags.push(flag); } - t.setUint16(e, a.length - 1); - e += 2; + buf.setUint16(pos, xCoordinates.length - 1); + pos += 2; } - t.setUint16(e, this.instructions.length); - e += 2; + buf.setUint16(pos, this.instructions.length); + pos += 2; if (this.instructions.length) { - new Uint8Array(t.buffer, 0, t.buffer.byteLength).set( + new Uint8Array(buf.buffer, 0, buf.buffer.byteLength).set( this.instructions, - e, + pos, ); - e += this.instructions.length; + pos += this.instructions.length; } - for (const i of r) t.setUint8(e++, i); - for (let i = 0, s = a.length; i < s; i++) { - const s = a[i], - n = r[i]; - if (2 & n) t.setUint8(e++, s); - else if (!(16 & n)) { - t.setInt16(e, s); - e += 2; + for (const flag of flags) { + buf.setUint8(pos++, flag); + } + for (let i = 0, ii = xCoordinates.length; i < ii; i++) { + const x = xCoordinates[i]; + const flag = flags[i]; + if (flag & X_SHORT_VECTOR) { + buf.setUint8(pos++, x); + } else if (!(flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR)) { + buf.setInt16(pos, x); + pos += 2; } } - for (let i = 0, a = s.length; i < a; i++) { - const a = s[i], - n = r[i]; - if (4 & n) t.setUint8(e++, a); - else if (!(32 & n)) { - t.setInt16(e, a); - e += 2; + for (let i = 0, ii = yCoordinates.length; i < ii; i++) { + const y = yCoordinates[i]; + const flag = flags[i]; + if (flag & Y_SHORT_VECTOR) { + buf.setUint8(pos++, y); + } else if (!(flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR)) { + buf.setInt16(pos, y); + pos += 2; } } - return e - i; + return pos - spos; } - scale(e, t) { - for (const i of this.contours) - if (0 !== i.xCoordinates.length) - for (let a = 0, s = i.xCoordinates.length; a < s; a++) - i.xCoordinates[a] = Math.round(e + (i.xCoordinates[a] - e) * t); + scale(x, factor) { + for (const contour of this.contours) { + if (contour.xCoordinates.length === 0) { + continue; + } + for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) { + contour.xCoordinates[i] = Math.round( + x + (contour.xCoordinates[i] - x) * factor, + ); + } + } } } class CompositeGlyph { constructor({ - flags: e, - glyphIndex: t, - argument1: i, - argument2: a, - transf: s, - instructions: r, + flags, + glyphIndex, + argument1, + argument2, + transf, + instructions, }) { - this.flags = e; - this.glyphIndex = t; - this.argument1 = i; - this.argument2 = a; - this.transf = s; - this.instructions = r; + this.flags = flags; + this.glyphIndex = glyphIndex; + this.argument1 = argument1; + this.argument2 = argument2; + this.transf = transf; + this.instructions = instructions; } - static parse(e, t) { - const i = e, - a = []; - let s = t.getUint16(e); - const r = t.getUint16(e + 2); - e += 4; - let n, g; - if (1 & s) { - if (2 & s) { - n = t.getInt16(e); - g = t.getInt16(e + 2); + static parse(pos, glyf) { + const spos = pos; + const transf = []; + let flags = glyf.getUint16(pos); + const glyphIndex = glyf.getUint16(pos + 2); + pos += 4; + let argument1, argument2; + if (flags & ARG_1_AND_2_ARE_WORDS) { + if (flags & ARGS_ARE_XY_VALUES) { + argument1 = glyf.getInt16(pos); + argument2 = glyf.getInt16(pos + 2); } else { - n = t.getUint16(e); - g = t.getUint16(e + 2); + argument1 = glyf.getUint16(pos); + argument2 = glyf.getUint16(pos + 2); } - e += 4; - s ^= 1; + pos += 4; + flags ^= ARG_1_AND_2_ARE_WORDS; } else { - if (2 & s) { - n = t.getInt8(e); - g = t.getInt8(e + 1); + if (flags & ARGS_ARE_XY_VALUES) { + argument1 = glyf.getInt8(pos); + argument2 = glyf.getInt8(pos + 1); } else { - n = t.getUint8(e); - g = t.getUint8(e + 1); + argument1 = glyf.getUint8(pos); + argument2 = glyf.getUint8(pos + 1); } - e += 2; + pos += 2; } - if (8 & s) { - a.push(t.getUint16(e)); - e += 2; - } else if (64 & s) { - a.push(t.getUint16(e), t.getUint16(e + 2)); - e += 4; - } else if (128 & s) { - a.push( - t.getUint16(e), - t.getUint16(e + 2), - t.getUint16(e + 4), - t.getUint16(e + 6), + if (flags & WE_HAVE_A_SCALE) { + transf.push(glyf.getUint16(pos)); + pos += 2; + } else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) { + transf.push(glyf.getUint16(pos), glyf.getUint16(pos + 2)); + pos += 4; + } else if (flags & WE_HAVE_A_TWO_BY_TWO) { + transf.push( + glyf.getUint16(pos), + glyf.getUint16(pos + 2), + glyf.getUint16(pos + 4), + glyf.getUint16(pos + 6), ); - e += 8; + pos += 8; } - let o = null; - if (256 & s) { - const i = t.getUint16(e); - e += 2; - o = new Uint8Array(t).slice(e, e + i); - e += i; + let instructions = null; + if (flags & WE_HAVE_INSTRUCTIONS) { + const instructionLength = glyf.getUint16(pos); + pos += 2; + instructions = new Uint8Array(glyf).slice(pos, pos + instructionLength); + pos += instructionLength; } return [ - e - i, + pos - spos, new CompositeGlyph({ - flags: s, - glyphIndex: r, - argument1: n, - argument2: g, - transf: a, - instructions: o, + flags, + glyphIndex, + argument1, + argument2, + transf, + instructions, }), ]; } getSize() { - let e = 4 + 2 * this.transf.length; - 256 & this.flags && (e += 2 + this.instructions.length); - e += 2; - 2 & this.flags - ? (this.argument1 >= -128 && + let size = 2 + 2 + this.transf.length * 2; + if (this.flags & WE_HAVE_INSTRUCTIONS) { + size += 2 + this.instructions.length; + } + size += 2; + if (this.flags & 2) { + if ( + !( + this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && - this.argument2 <= 127) || - (e += 2) - : (this.argument1 >= 0 && - this.argument1 <= 255 && - this.argument2 >= 0 && - this.argument2 <= 255) || - (e += 2); - return e; + this.argument2 <= 127 + ) + ) { + size += 2; + } + } else if ( + !( + this.argument1 >= 0 && + this.argument1 <= 255 && + this.argument2 >= 0 && + this.argument2 <= 255 + ) + ) { + size += 2; + } + return size; } - write(e, t) { - const i = e; - 2 & this.flags - ? (this.argument1 >= -128 && + write(pos, buf) { + const spos = pos; + if (this.flags & ARGS_ARE_XY_VALUES) { + if ( + !( + this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && - this.argument2 <= 127) || - (this.flags |= 1) - : (this.argument1 >= 0 && - this.argument1 <= 255 && - this.argument2 >= 0 && - this.argument2 <= 255) || - (this.flags |= 1); - t.setUint16(e, this.flags); - t.setUint16(e + 2, this.glyphIndex); - e += 4; - if (1 & this.flags) { - if (2 & this.flags) { - t.setInt16(e, this.argument1); - t.setInt16(e + 2, this.argument2); + this.argument2 <= 127 + ) + ) { + this.flags |= ARG_1_AND_2_ARE_WORDS; + } + } else if ( + !( + this.argument1 >= 0 && + this.argument1 <= 255 && + this.argument2 >= 0 && + this.argument2 <= 255 + ) + ) { + this.flags |= ARG_1_AND_2_ARE_WORDS; + } + buf.setUint16(pos, this.flags); + buf.setUint16(pos + 2, this.glyphIndex); + pos += 4; + if (this.flags & ARG_1_AND_2_ARE_WORDS) { + if (this.flags & ARGS_ARE_XY_VALUES) { + buf.setInt16(pos, this.argument1); + buf.setInt16(pos + 2, this.argument2); } else { - t.setUint16(e, this.argument1); - t.setUint16(e + 2, this.argument2); + buf.setUint16(pos, this.argument1); + buf.setUint16(pos + 2, this.argument2); } - e += 4; + pos += 4; } else { - t.setUint8(e, this.argument1); - t.setUint8(e + 1, this.argument2); - e += 2; + buf.setUint8(pos, this.argument1); + buf.setUint8(pos + 1, this.argument2); + pos += 2; } - if (256 & this.flags) { - t.setUint16(e, this.instructions.length); - e += 2; + if (this.flags & WE_HAVE_INSTRUCTIONS) { + buf.setUint16(pos, this.instructions.length); + pos += 2; if (this.instructions.length) { - new Uint8Array(t.buffer, 0, t.buffer.byteLength).set( + new Uint8Array(buf.buffer, 0, buf.buffer.byteLength).set( this.instructions, - e, + pos, ); - e += this.instructions.length; + pos += this.instructions.length; } } - return e - i; + return pos - spos; } - scale(e, t) {} + scale(x, factor) {} +} // ./src/core/opentype_file_builder.js + +function writeInt16(dest, offset, num) { + dest[offset] = (num >> 8) & 0xff; + dest[offset + 1] = num & 0xff; } -function writeInt16(e, t, i) { - e[t] = (i >> 8) & 255; - e[t + 1] = 255 & i; +function writeInt32(dest, offset, num) { + dest[offset] = (num >> 24) & 0xff; + dest[offset + 1] = (num >> 16) & 0xff; + dest[offset + 2] = (num >> 8) & 0xff; + dest[offset + 3] = num & 0xff; } -function writeInt32(e, t, i) { - e[t] = (i >> 24) & 255; - e[t + 1] = (i >> 16) & 255; - e[t + 2] = (i >> 8) & 255; - e[t + 3] = 255 & i; -} -function writeData(e, t, i) { - if (i instanceof Uint8Array) e.set(i, t); - else if ("string" == typeof i) - for (let a = 0, s = i.length; a < s; a++) e[t++] = 255 & i.charCodeAt(a); - else for (const a of i) e[t++] = 255 & a; +function writeData(dest, offset, data) { + if (data instanceof Uint8Array) { + dest.set(data, offset); + } else if (typeof data === "string") { + for (let i = 0, ii = data.length; i < ii; i++) { + dest[offset++] = data.charCodeAt(i) & 0xff; + } + } else { + for (const num of data) { + dest[offset++] = num & 0xff; + } + } } +const OTF_HEADER_SIZE = 12; +const OTF_TABLE_ENTRY_SIZE = 16; class OpenTypeFileBuilder { - constructor(e) { - this.sfnt = e; + constructor(sfnt) { + this.sfnt = sfnt; this.tables = Object.create(null); } - static getSearchParams(e, t) { - let i = 1, - a = 0; - for (; (i ^ e) > i; ) { - i <<= 1; - a++; + static getSearchParams(entriesCount, entrySize) { + let maxPower2 = 1, + log2 = 0; + while ((maxPower2 ^ entriesCount) > maxPower2) { + maxPower2 <<= 1; + log2++; } - const s = i * t; - return { range: s, entry: a, rangeShift: t * e - s }; + const searchRange = maxPower2 * entrySize; + return { + range: searchRange, + entry: log2, + rangeShift: entrySize * entriesCount - searchRange, + }; } toArray() { - let e = this.sfnt; - const t = this.tables, - i = Object.keys(t); - i.sort(); - const a = i.length; - let s, - r, - n, - g, - o, - c = 12 + 16 * a; - const C = [c]; - for (s = 0; s < a; s++) { - g = t[i[s]]; - c += ((g.length + 3) & -4) >>> 0; - C.push(c); + let sfnt = this.sfnt; + const tables = this.tables; + const tablesNames = Object.keys(tables); + tablesNames.sort(); + const numTables = tablesNames.length; + let i, j, jj, table, tableName; + let offset = OTF_HEADER_SIZE + numTables * OTF_TABLE_ENTRY_SIZE; + const tableOffsets = [offset]; + for (i = 0; i < numTables; i++) { + table = tables[tablesNames[i]]; + const paddedLength = ((table.length + 3) & ~3) >>> 0; + offset += paddedLength; + tableOffsets.push(offset); } - const h = new Uint8Array(c); - for (s = 0; s < a; s++) { - g = t[i[s]]; - writeData(h, C[s], g); + const file = new Uint8Array(offset); + for (i = 0; i < numTables; i++) { + table = tables[tablesNames[i]]; + writeData(file, tableOffsets[i], table); } - "true" === e && (e = string32(65536)); - h[0] = 255 & e.charCodeAt(0); - h[1] = 255 & e.charCodeAt(1); - h[2] = 255 & e.charCodeAt(2); - h[3] = 255 & e.charCodeAt(3); - writeInt16(h, 4, a); - const l = OpenTypeFileBuilder.getSearchParams(a, 16); - writeInt16(h, 6, l.range); - writeInt16(h, 8, l.entry); - writeInt16(h, 10, l.rangeShift); - c = 12; - for (s = 0; s < a; s++) { - o = i[s]; - h[c] = 255 & o.charCodeAt(0); - h[c + 1] = 255 & o.charCodeAt(1); - h[c + 2] = 255 & o.charCodeAt(2); - h[c + 3] = 255 & o.charCodeAt(3); - let e = 0; - for (r = C[s], n = C[s + 1]; r < n; r += 4) { - e = (e + readUint32(h, r)) >>> 0; + if (sfnt === "true") { + sfnt = string32(0x00010000); + } + file[0] = sfnt.charCodeAt(0) & 0xff; + file[1] = sfnt.charCodeAt(1) & 0xff; + file[2] = sfnt.charCodeAt(2) & 0xff; + file[3] = sfnt.charCodeAt(3) & 0xff; + writeInt16(file, 4, numTables); + const searchParams = OpenTypeFileBuilder.getSearchParams(numTables, 16); + writeInt16(file, 6, searchParams.range); + writeInt16(file, 8, searchParams.entry); + writeInt16(file, 10, searchParams.rangeShift); + offset = OTF_HEADER_SIZE; + for (i = 0; i < numTables; i++) { + tableName = tablesNames[i]; + file[offset] = tableName.charCodeAt(0) & 0xff; + file[offset + 1] = tableName.charCodeAt(1) & 0xff; + file[offset + 2] = tableName.charCodeAt(2) & 0xff; + file[offset + 3] = tableName.charCodeAt(3) & 0xff; + let checksum = 0; + for (j = tableOffsets[i], jj = tableOffsets[i + 1]; j < jj; j += 4) { + const quad = readUint32(file, j); + checksum = (checksum + quad) >>> 0; } - writeInt32(h, c + 4, e); - writeInt32(h, c + 8, C[s]); - writeInt32(h, c + 12, t[o].length); - c += 16; + writeInt32(file, offset + 4, checksum); + writeInt32(file, offset + 8, tableOffsets[i]); + writeInt32(file, offset + 12, tables[tableName].length); + offset += OTF_TABLE_ENTRY_SIZE; } - return h; + return file; } - addTable(e, t) { - if (e in this.tables) throw new Error("Table " + e + " already exists"); - this.tables[e] = t; + addTable(tag, data) { + if (tag in this.tables) { + throw new Error("Table " + tag + " already exists"); + } + this.tables[tag] = data; } -} -const ta = [4], - ia = [5], - aa = [6], - sa = [7], - ra = [8], - na = [12, 35], - ga = [14], - oa = [21], - Ia = [22], - ca = [30], - Ca = [31]; +} // ./src/core/type1_parser.js + +const HINTING_ENABLED = false; +const COMMAND_MAP = { + hstem: [1], + vstem: [3], + vmoveto: [4], + rlineto: [5], + hlineto: [6], + vlineto: [7], + rrcurveto: [8], + callsubr: [10], + flex: [12, 35], + drop: [12, 18], + endchar: [14], + rmoveto: [21], + hmoveto: [22], + vhcurveto: [30], + hvcurveto: [31], +}; class Type1CharString { constructor() { this.width = 0; this.lsb = 0; - this.flexing = !1; + this.flexing = false; this.output = []; this.stack = []; } - convert(e, t, i) { - const a = e.length; - let s, - r, - n, - g = !1; - for (let o = 0; o < a; o++) { - let a = e[o]; - if (a < 32) { - 12 === a && (a = (a << 8) + e[++o]); - switch (a) { + convert(encoded, subrs, seacAnalysisEnabled) { + const count = encoded.length; + let error = false; + let wx, sbx, subrNumber; + for (let i = 0; i < count; i++) { + let value = encoded[i]; + if (value < 32) { + if (value === 12) { + value = (value << 8) + encoded[++i]; + } + switch (value) { case 1: + if (!HINTING_ENABLED) { + this.stack = []; + break; + } + error = this.executeCommand(2, COMMAND_MAP.hstem); + break; case 3: - case 9: - case 3072: - case 3073: - case 3074: - case 3105: - this.stack = []; + if (!HINTING_ENABLED) { + this.stack = []; + break; + } + error = this.executeCommand(2, COMMAND_MAP.vstem); break; case 4: if (this.flexing) { if (this.stack.length < 1) { - g = !0; + error = true; break; } - const e = this.stack.pop(); - this.stack.push(0, e); + const dy = this.stack.pop(); + this.stack.push(0, dy); break; } - g = this.executeCommand(1, ta); + error = this.executeCommand(1, COMMAND_MAP.vmoveto); break; case 5: - g = this.executeCommand(2, ia); + error = this.executeCommand(2, COMMAND_MAP.rlineto); break; case 6: - g = this.executeCommand(1, aa); + error = this.executeCommand(1, COMMAND_MAP.hlineto); break; case 7: - g = this.executeCommand(1, sa); + error = this.executeCommand(1, COMMAND_MAP.vlineto); break; case 8: - g = this.executeCommand(6, ra); + error = this.executeCommand(6, COMMAND_MAP.rrcurveto); + break; + case 9: + this.stack = []; break; case 10: if (this.stack.length < 1) { - g = !0; + error = true; break; } - n = this.stack.pop(); - if (!t[n]) { - g = !0; + subrNumber = this.stack.pop(); + if (!subrs[subrNumber]) { + error = true; break; } - g = this.convert(t[n], t, i); + error = this.convert(subrs[subrNumber], subrs, seacAnalysisEnabled); break; case 11: - return g; + return error; case 13: if (this.stack.length < 2) { - g = !0; + error = true; break; } - s = this.stack.pop(); - r = this.stack.pop(); - this.lsb = r; - this.width = s; - this.stack.push(s, r); - g = this.executeCommand(2, Ia); + wx = this.stack.pop(); + sbx = this.stack.pop(); + this.lsb = sbx; + this.width = wx; + this.stack.push(wx, sbx); + error = this.executeCommand(2, COMMAND_MAP.hmoveto); break; case 14: - this.output.push(ga[0]); + this.output.push(COMMAND_MAP.endchar[0]); break; case 21: - if (this.flexing) break; - g = this.executeCommand(2, oa); + if (this.flexing) { + break; + } + error = this.executeCommand(2, COMMAND_MAP.rmoveto); break; case 22: if (this.flexing) { this.stack.push(0); break; } - g = this.executeCommand(1, Ia); + error = this.executeCommand(1, COMMAND_MAP.hmoveto); break; case 30: - g = this.executeCommand(4, ca); + error = this.executeCommand(4, COMMAND_MAP.vhcurveto); break; case 31: - g = this.executeCommand(4, Ca); + error = this.executeCommand(4, COMMAND_MAP.hvcurveto); break; - case 3078: - if (i) { - const e = this.stack.at(-5); + case (12 << 8) + 0: + this.stack = []; + break; + case (12 << 8) + 1: + if (!HINTING_ENABLED) { + this.stack = []; + break; + } + error = this.executeCommand(2, COMMAND_MAP.vstem); + break; + case (12 << 8) + 2: + if (!HINTING_ENABLED) { + this.stack = []; + break; + } + error = this.executeCommand(2, COMMAND_MAP.hstem); + break; + case (12 << 8) + 6: + if (seacAnalysisEnabled) { + const asb = this.stack.at(-5); this.seac = this.stack.splice(-4, 4); - this.seac[0] += this.lsb - e; - g = this.executeCommand(0, ga); - } else g = this.executeCommand(4, ga); + this.seac[0] += this.lsb - asb; + error = this.executeCommand(0, COMMAND_MAP.endchar); + } else { + error = this.executeCommand(4, COMMAND_MAP.endchar); + } break; - case 3079: + case (12 << 8) + 7: if (this.stack.length < 4) { - g = !0; + error = true; break; } this.stack.pop(); - s = this.stack.pop(); - const e = this.stack.pop(); - r = this.stack.pop(); - this.lsb = r; - this.width = s; - this.stack.push(s, r, e); - g = this.executeCommand(3, oa); + wx = this.stack.pop(); + const sby = this.stack.pop(); + sbx = this.stack.pop(); + this.lsb = sbx; + this.width = wx; + this.stack.push(wx, sbx, sby); + error = this.executeCommand(3, COMMAND_MAP.rmoveto); break; - case 3084: + case (12 << 8) + 12: if (this.stack.length < 2) { - g = !0; + error = true; break; } - const o = this.stack.pop(), - c = this.stack.pop(); - this.stack.push(c / o); + const num2 = this.stack.pop(); + const num1 = this.stack.pop(); + this.stack.push(num1 / num2); break; - case 3088: + case (12 << 8) + 16: if (this.stack.length < 2) { - g = !0; + error = true; break; } - n = this.stack.pop(); - const C = this.stack.pop(); - if (0 === n && 3 === C) { - const e = this.stack.splice(-17, 17); + subrNumber = this.stack.pop(); + const numArgs = this.stack.pop(); + if (subrNumber === 0 && numArgs === 3) { + const flexArgs = this.stack.splice(-17, 17); this.stack.push( - e[2] + e[0], - e[3] + e[1], - e[4], - e[5], - e[6], - e[7], - e[8], - e[9], - e[10], - e[11], - e[12], - e[13], - e[14], + flexArgs[2] + flexArgs[0], + flexArgs[3] + flexArgs[1], + flexArgs[4], + flexArgs[5], + flexArgs[6], + flexArgs[7], + flexArgs[8], + flexArgs[9], + flexArgs[10], + flexArgs[11], + flexArgs[12], + flexArgs[13], + flexArgs[14], ); - g = this.executeCommand(13, na, !0); - this.flexing = !1; - this.stack.push(e[15], e[16]); - } else 1 === n && 0 === C && (this.flexing = !0); + error = this.executeCommand(13, COMMAND_MAP.flex, true); + this.flexing = false; + this.stack.push(flexArgs[15], flexArgs[16]); + } else if (subrNumber === 1 && numArgs === 0) { + this.flexing = true; + } break; - case 3089: + case (12 << 8) + 17: + break; + case (12 << 8) + 33: + this.stack = []; break; default: - warn('Unknown type 1 charstring command of "' + a + '"'); + warn('Unknown type 1 charstring command of "' + value + '"'); + break; } - if (g) break; + if (error) { + break; + } + continue; + } else if (value <= 246) { + value -= 139; + } else if (value <= 250) { + value = (value - 247) * 256 + encoded[++i] + 108; + } else if (value <= 254) { + value = -((value - 251) * 256) - encoded[++i] - 108; } else { - a <= 246 - ? (a -= 139) - : (a = - a <= 250 - ? 256 * (a - 247) + e[++o] + 108 - : a <= 254 - ? -256 * (a - 251) - e[++o] - 108 - : ((255 & e[++o]) << 24) | - ((255 & e[++o]) << 16) | - ((255 & e[++o]) << 8) | - ((255 & e[++o]) << 0)); - this.stack.push(a); + value = + ((encoded[++i] & 0xff) << 24) | + ((encoded[++i] & 0xff) << 16) | + ((encoded[++i] & 0xff) << 8) | + ((encoded[++i] & 0xff) << 0); } + this.stack.push(value); } - return g; + return error; } - executeCommand(e, t, i) { - const a = this.stack.length; - if (e > a) return !0; - const s = a - e; - for (let e = s; e < a; e++) { - let t = this.stack[e]; - if (Number.isInteger(t)) this.output.push(28, (t >> 8) & 255, 255 & t); - else { - t = (65536 * t) | 0; + executeCommand(howManyArgs, command, keepStack) { + const stackLength = this.stack.length; + if (howManyArgs > stackLength) { + return true; + } + const start = stackLength - howManyArgs; + for (let i = start; i < stackLength; i++) { + let value = this.stack[i]; + if (Number.isInteger(value)) { + this.output.push(28, (value >> 8) & 0xff, value & 0xff); + } else { + value = (65536 * value) | 0; this.output.push( 255, - (t >> 24) & 255, - (t >> 16) & 255, - (t >> 8) & 255, - 255 & t, + (value >> 24) & 0xff, + (value >> 16) & 0xff, + (value >> 8) & 0xff, + value & 0xff, ); } } - this.output.push(...t); - i ? this.stack.splice(s, e) : (this.stack.length = 0); - return !1; + this.output.push(...command); + if (keepStack) { + this.stack.splice(start, howManyArgs); + } else { + this.stack.length = 0; + } + return false; } } -function isHexDigit(e) { - return (e >= 48 && e <= 57) || (e >= 65 && e <= 70) || (e >= 97 && e <= 102); -} -function decrypt(e, t, i) { - if (i >= e.length) return new Uint8Array(0); - let a, - s, - r = 0 | t; - for (a = 0; a < i; a++) r = (52845 * (e[a] + r) + 22719) & 65535; - const n = e.length - i, - g = new Uint8Array(n); - for (a = i, s = 0; s < n; a++, s++) { - const t = e[a]; - g[s] = t ^ (r >> 8); - r = (52845 * (t + r) + 22719) & 65535; - } - return g; -} -function isSpecial(e) { +const EEXEC_ENCRYPT_KEY = 55665; +const CHAR_STRS_ENCRYPT_KEY = 4330; +function isHexDigit(code) { return ( - 47 === e || - 91 === e || - 93 === e || - 123 === e || - 125 === e || - 40 === e || - 41 === e + (code >= 48 && code <= 57) || + (code >= 65 && code <= 70) || + (code >= 97 && code <= 102) + ); +} +function decrypt(data, key, discardNumber) { + if (discardNumber >= data.length) { + return new Uint8Array(0); + } + const c1 = 52845, + c2 = 22719; + let r = key | 0, + i, + j; + for (i = 0; i < discardNumber; i++) { + r = ((data[i] + r) * c1 + c2) & ((1 << 16) - 1); + } + const count = data.length - discardNumber; + const decrypted = new Uint8Array(count); + for (i = discardNumber, j = 0; j < count; i++, j++) { + const value = data[i]; + decrypted[j] = value ^ (r >> 8); + r = ((value + r) * c1 + c2) & ((1 << 16) - 1); + } + return decrypted; +} +function decryptAscii(data, key, discardNumber) { + const c1 = 52845, + c2 = 22719; + let r = key | 0; + const count = data.length, + maybeLength = count >>> 1; + const decrypted = new Uint8Array(maybeLength); + let i, j; + for (i = 0, j = 0; i < count; i++) { + const digit1 = data[i]; + if (!isHexDigit(digit1)) { + continue; + } + i++; + let digit2; + while (i < count && !isHexDigit((digit2 = data[i]))) { + i++; + } + if (i < count) { + const value = parseInt(String.fromCharCode(digit1, digit2), 16); + decrypted[j++] = value ^ (r >> 8); + r = ((value + r) * c1 + c2) & ((1 << 16) - 1); + } + } + return decrypted.slice(discardNumber, j); +} +function isSpecial(c) { + return ( + c === 0x2f || + c === 0x5b || + c === 0x5d || + c === 0x7b || + c === 0x7d || + c === 0x28 || + c === 0x29 ); } class Type1Parser { - constructor(e, t, i) { - if (t) { - const t = e.getBytes(), - i = !( - (isHexDigit(t[0]) || isWhiteSpace(t[0])) && - isHexDigit(t[1]) && - isHexDigit(t[2]) && - isHexDigit(t[3]) && - isHexDigit(t[4]) && - isHexDigit(t[5]) && - isHexDigit(t[6]) && - isHexDigit(t[7]) - ); - e = new Stream( - i - ? decrypt(t, 55665, 4) - : (function decryptAscii(e, t, i) { - let a = 0 | t; - const s = e.length, - r = new Uint8Array(s >>> 1); - let n, g; - for (n = 0, g = 0; n < s; n++) { - const t = e[n]; - if (!isHexDigit(t)) continue; - n++; - let i; - for (; n < s && !isHexDigit((i = e[n])); ) n++; - if (n < s) { - const e = parseInt(String.fromCharCode(t, i), 16); - r[g++] = e ^ (a >> 8); - a = (52845 * (e + a) + 22719) & 65535; - } - } - return r.slice(i, g); - })(t, 55665, 4), + constructor(stream, encrypted, seacAnalysisEnabled) { + if (encrypted) { + const data = stream.getBytes(); + const isBinary = !( + (isHexDigit(data[0]) || isWhiteSpace(data[0])) && + isHexDigit(data[1]) && + isHexDigit(data[2]) && + isHexDigit(data[3]) && + isHexDigit(data[4]) && + isHexDigit(data[5]) && + isHexDigit(data[6]) && + isHexDigit(data[7]) + ); + stream = new Stream( + isBinary + ? decrypt(data, EEXEC_ENCRYPT_KEY, 4) + : decryptAscii(data, EEXEC_ENCRYPT_KEY, 4), ); } - this.seacAnalysisEnabled = !!i; - this.stream = e; + this.seacAnalysisEnabled = !!seacAnalysisEnabled; + this.stream = stream; this.nextChar(); } readNumberArray() { this.getToken(); - const e = []; - for (;;) { - const t = this.getToken(); - if (null === t || "]" === t || "}" === t) break; - e.push(parseFloat(t || 0)); + const array = []; + while (true) { + const token = this.getToken(); + if (token === null || token === "]" || token === "}") { + break; + } + array.push(parseFloat(token || 0)); } - return e; + return array; } readNumber() { - const e = this.getToken(); - return parseFloat(e || 0); + const token = this.getToken(); + return parseFloat(token || 0); } readInt() { - const e = this.getToken(); - return 0 | parseInt(e || 0, 10); + const token = this.getToken(); + return parseInt(token || 0, 10) | 0; } readBoolean() { - return "true" === this.getToken() ? 1 : 0; + const token = this.getToken(); + return token === "true" ? 1 : 0; } nextChar() { return (this.currentChar = this.stream.getByte()); @@ -24926,352 +28786,508 @@ class Type1Parser { return (this.currentChar = this.stream.getByte()); } getToken() { - let e = !1, - t = this.currentChar; - for (;;) { - if (-1 === t) return null; - if (e) (10 !== t && 13 !== t) || (e = !1); - else if (37 === t) e = !0; - else if (!isWhiteSpace(t)) break; - t = this.nextChar(); + let comment = false; + let ch = this.currentChar; + while (true) { + if (ch === -1) { + return null; + } + if (comment) { + if (ch === 0x0a || ch === 0x0d) { + comment = false; + } + } else if (ch === 0x25) { + comment = true; + } else if (!isWhiteSpace(ch)) { + break; + } + ch = this.nextChar(); } - if (isSpecial(t)) { + if (isSpecial(ch)) { this.nextChar(); - return String.fromCharCode(t); + return String.fromCharCode(ch); } - let i = ""; + let token = ""; do { - i += String.fromCharCode(t); - t = this.nextChar(); - } while (t >= 0 && !isWhiteSpace(t) && !isSpecial(t)); - return i; + token += String.fromCharCode(ch); + ch = this.nextChar(); + } while (ch >= 0 && !isWhiteSpace(ch) && !isSpecial(ch)); + return token; } - readCharStrings(e, t) { - return -1 === t ? e : decrypt(e, 4330, t); + readCharStrings(bytes, lenIV) { + if (lenIV === -1) { + return bytes; + } + return decrypt(bytes, CHAR_STRS_ENCRYPT_KEY, lenIV); } - extractFontProgram(e) { - const t = this.stream, - i = [], - a = [], - s = Object.create(null); - s.lenIV = 4; - const r = { subrs: [], charstrings: [], properties: { privateData: s } }; - let n, g, o, c; - for (; null !== (n = this.getToken()); ) - if ("/" === n) { - n = this.getToken(); - switch (n) { - case "CharStrings": - this.getToken(); - this.getToken(); - this.getToken(); - this.getToken(); - for (;;) { - n = this.getToken(); - if (null === n || "end" === n) break; - if ("/" !== n) continue; - const e = this.getToken(); - g = this.readInt(); - this.getToken(); - o = g > 0 ? t.getBytes(g) : new Uint8Array(0); - c = r.properties.privateData.lenIV; - const i = this.readCharStrings(o, c); - this.nextChar(); - n = this.getToken(); - "noaccess" === n ? this.getToken() : "/" === n && this.prevChar(); - a.push({ glyph: e, encoded: i }); - } - break; - case "Subrs": - this.readInt(); - this.getToken(); - for (; "dup" === this.getToken(); ) { - const e = this.readInt(); - g = this.readInt(); - this.getToken(); - o = g > 0 ? t.getBytes(g) : new Uint8Array(0); - c = r.properties.privateData.lenIV; - const a = this.readCharStrings(o, c); - this.nextChar(); - n = this.getToken(); - "noaccess" === n && this.getToken(); - i[e] = a; - } - break; - case "BlueValues": - case "OtherBlues": - case "FamilyBlues": - case "FamilyOtherBlues": - const e = this.readNumberArray(); - e.length > 0 && e.length, 0; - break; - case "StemSnapH": - case "StemSnapV": - r.properties.privateData[n] = this.readNumberArray(); - break; - case "StdHW": - case "StdVW": - r.properties.privateData[n] = this.readNumberArray()[0]; - break; - case "BlueShift": - case "lenIV": - case "BlueFuzz": - case "BlueScale": - case "LanguageGroup": - r.properties.privateData[n] = this.readNumber(); - break; - case "ExpansionFactor": - r.properties.privateData[n] = this.readNumber() || 0.06; - break; - case "ForceBold": - r.properties.privateData[n] = this.readBoolean(); - } + extractFontProgram(properties) { + const stream = this.stream; + const subrs = [], + charstrings = []; + const privateData = Object.create(null); + privateData.lenIV = 4; + const program = { + subrs: [], + charstrings: [], + properties: { + privateData, + }, + }; + let token, length, data, lenIV; + while ((token = this.getToken()) !== null) { + if (token !== "/") { + continue; } - for (const { encoded: t, glyph: s } of a) { - const a = new Type1CharString(), - n = a.convert(t, i, this.seacAnalysisEnabled); - let g = a.output; - n && (g = [14]); - const o = { - glyphName: s, - charstring: g, - width: a.width, - lsb: a.lsb, - seac: a.seac, - }; - ".notdef" === s ? r.charstrings.unshift(o) : r.charstrings.push(o); - if (e.builtInEncoding) { - const t = e.builtInEncoding.indexOf(s); - t > -1 && - void 0 === e.widths[t] && - t >= e.firstChar && - t <= e.lastChar && - (e.widths[t] = a.width); + token = this.getToken(); + switch (token) { + case "CharStrings": + this.getToken(); + this.getToken(); + this.getToken(); + this.getToken(); + while (true) { + token = this.getToken(); + if (token === null || token === "end") { + break; + } + if (token !== "/") { + continue; + } + const glyph = this.getToken(); + length = this.readInt(); + this.getToken(); + data = length > 0 ? stream.getBytes(length) : new Uint8Array(0); + lenIV = program.properties.privateData.lenIV; + const encoded = this.readCharStrings(data, lenIV); + this.nextChar(); + token = this.getToken(); + if (token === "noaccess") { + this.getToken(); + } else if (token === "/") { + this.prevChar(); + } + charstrings.push({ + glyph, + encoded, + }); + } + break; + case "Subrs": + this.readInt(); + this.getToken(); + while (this.getToken() === "dup") { + const index = this.readInt(); + length = this.readInt(); + this.getToken(); + data = length > 0 ? stream.getBytes(length) : new Uint8Array(0); + lenIV = program.properties.privateData.lenIV; + const encoded = this.readCharStrings(data, lenIV); + this.nextChar(); + token = this.getToken(); + if (token === "noaccess") { + this.getToken(); + } + subrs[index] = encoded; + } + break; + case "BlueValues": + case "OtherBlues": + case "FamilyBlues": + case "FamilyOtherBlues": + const blueArray = this.readNumberArray(); + if ( + blueArray.length > 0 && + blueArray.length % 2 === 0 && + HINTING_ENABLED + ) { + program.properties.privateData[token] = blueArray; + } + break; + case "StemSnapH": + case "StemSnapV": + program.properties.privateData[token] = this.readNumberArray(); + break; + case "StdHW": + case "StdVW": + program.properties.privateData[token] = this.readNumberArray()[0]; + break; + case "BlueShift": + case "lenIV": + case "BlueFuzz": + case "BlueScale": + case "LanguageGroup": + program.properties.privateData[token] = this.readNumber(); + break; + case "ExpansionFactor": + program.properties.privateData[token] = this.readNumber() || 0.06; + break; + case "ForceBold": + program.properties.privateData[token] = this.readBoolean(); + break; } } - return r; - } - extractFontHeader(e) { - let t; - for (; null !== (t = this.getToken()); ) - if ("/" === t) { - t = this.getToken(); - switch (t) { - case "FontMatrix": - const i = this.readNumberArray(); - e.fontMatrix = i; - break; - case "Encoding": - const a = this.getToken(); - let s; - if (/^\d+$/.test(a)) { - s = []; - const e = 0 | parseInt(a, 10); - this.getToken(); - for (let i = 0; i < e; i++) { - t = this.getToken(); - for (; "dup" !== t && "def" !== t; ) { - t = this.getToken(); - if (null === t) return; - } - if ("def" === t) break; - const e = this.readInt(); - this.getToken(); - const i = this.getToken(); - s[e] = i; - this.getToken(); - } - } else s = getEncoding(a); - e.builtInEncoding = s; - break; - case "FontBBox": - const r = this.readNumberArray(); - e.ascent = Math.max(r[3], r[1]); - e.descent = Math.min(r[1], r[3]); - e.ascentScaled = !0; + for (const { encoded, glyph } of charstrings) { + const charString = new Type1CharString(); + const error = charString.convert( + encoded, + subrs, + this.seacAnalysisEnabled, + ); + let output = charString.output; + if (error) { + output = [14]; + } + const charStringObject = { + glyphName: glyph, + charstring: output, + width: charString.width, + lsb: charString.lsb, + seac: charString.seac, + }; + if (glyph === ".notdef") { + program.charstrings.unshift(charStringObject); + } else { + program.charstrings.push(charStringObject); + } + if (properties.builtInEncoding) { + const index = properties.builtInEncoding.indexOf(glyph); + if ( + index > -1 && + properties.widths[index] === undefined && + index >= properties.firstChar && + index <= properties.lastChar + ) { + properties.widths[index] = charString.width; } } + } + return program; } -} -function findBlock(e, t, i) { - const a = e.length, - s = t.length, - r = a - s; - let n = i, - g = !1; - for (; n < r; ) { - let i = 0; - for (; i < s && e[n + i] === t[i]; ) i++; - if (i >= s) { - n += i; - for (; n < a && isWhiteSpace(e[n]); ) n++; - g = !0; + extractFontHeader(properties) { + let token; + while ((token = this.getToken()) !== null) { + if (token !== "/") { + continue; + } + token = this.getToken(); + switch (token) { + case "FontMatrix": + const matrix = this.readNumberArray(); + properties.fontMatrix = matrix; + break; + case "Encoding": + const encodingArg = this.getToken(); + let encoding; + if (!/^\d+$/.test(encodingArg)) { + encoding = getEncoding(encodingArg); + } else { + encoding = []; + const size = parseInt(encodingArg, 10) | 0; + this.getToken(); + for (let j = 0; j < size; j++) { + token = this.getToken(); + while (token !== "dup" && token !== "def") { + token = this.getToken(); + if (token === null) { + return; + } + } + if (token === "def") { + break; + } + const index = this.readInt(); + this.getToken(); + const glyph = this.getToken(); + encoding[index] = glyph; + this.getToken(); + } + } + properties.builtInEncoding = encoding; + break; + case "FontBBox": + const fontBBox = this.readNumberArray(); + properties.ascent = Math.max(fontBBox[3], fontBBox[1]); + properties.descent = Math.min(fontBBox[1], fontBBox[3]); + properties.ascentScaled = true; + break; + } + } + } +} // ./src/core/type1_font.js + +function findBlock(streamBytes, signature, startIndex) { + const streamBytesLength = streamBytes.length; + const signatureLength = signature.length; + const scanLength = streamBytesLength - signatureLength; + let i = startIndex, + found = false; + while (i < scanLength) { + let j = 0; + while (j < signatureLength && streamBytes[i + j] === signature[j]) { + j++; + } + if (j >= signatureLength) { + i += j; + while (i < streamBytesLength && isWhiteSpace(streamBytes[i])) { + i++; + } + found = true; break; } - n++; + i++; } - return { found: g, length: n }; + return { + found, + length: i, + }; +} +function getHeaderBlock(stream, suggestedLength) { + const EEXEC_SIGNATURE = [0x65, 0x65, 0x78, 0x65, 0x63]; + const streamStartPos = stream.pos; + let headerBytes, headerBytesLength, block; + try { + headerBytes = stream.getBytes(suggestedLength); + headerBytesLength = headerBytes.length; + } catch {} + if (headerBytesLength === suggestedLength) { + block = findBlock( + headerBytes, + EEXEC_SIGNATURE, + suggestedLength - 2 * EEXEC_SIGNATURE.length, + ); + if (block.found && block.length === suggestedLength) { + return { + stream: new Stream(headerBytes), + length: suggestedLength, + }; + } + } + warn('Invalid "Length1" property in Type1 font -- trying to recover.'); + stream.pos = streamStartPos; + const SCAN_BLOCK_LENGTH = 2048; + let actualLength; + while (true) { + const scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH); + block = findBlock(scanBytes, EEXEC_SIGNATURE, 0); + if (block.length === 0) { + break; + } + stream.pos += block.length; + if (block.found) { + actualLength = stream.pos - streamStartPos; + break; + } + } + stream.pos = streamStartPos; + if (actualLength) { + return { + stream: new Stream(stream.getBytes(actualLength)), + length: actualLength, + }; + } + warn('Unable to recover "Length1" property in Type1 font -- using as is.'); + return { + stream: new Stream(stream.getBytes(suggestedLength)), + length: suggestedLength, + }; +} +function getEexecBlock(stream, suggestedLength) { + const eexecBytes = stream.getBytes(); + if (eexecBytes.length === 0) { + throw new FormatError("getEexecBlock - no font program found."); + } + return { + stream: new Stream(eexecBytes), + length: eexecBytes.length, + }; } class Type1Font { - constructor(e, t, i) { - let a = i.length1, - s = i.length2, - r = t.peekBytes(6); - const n = 128 === r[0] && 1 === r[1]; - if (n) { - t.skip(6); - a = (r[5] << 24) | (r[4] << 16) | (r[3] << 8) | r[2]; + constructor(name, file, properties) { + const PFB_HEADER_SIZE = 6; + let headerBlockLength = properties.length1; + let eexecBlockLength = properties.length2; + let pfbHeader = file.peekBytes(PFB_HEADER_SIZE); + const pfbHeaderPresent = pfbHeader[0] === 0x80 && pfbHeader[1] === 0x01; + if (pfbHeaderPresent) { + file.skip(PFB_HEADER_SIZE); + headerBlockLength = + (pfbHeader[5] << 24) | + (pfbHeader[4] << 16) | + (pfbHeader[3] << 8) | + pfbHeader[2]; } - const g = (function getHeaderBlock(e, t) { - const i = [101, 101, 120, 101, 99], - a = e.pos; - let s, r, n, g; - try { - s = e.getBytes(t); - r = s.length; - } catch {} - if (r === t) { - n = findBlock(s, i, t - 2 * i.length); - if (n.found && n.length === t) - return { stream: new Stream(s), length: t }; - } - warn('Invalid "Length1" property in Type1 font -- trying to recover.'); - e.pos = a; - for (;;) { - n = findBlock(e.peekBytes(2048), i, 0); - if (0 === n.length) break; - e.pos += n.length; - if (n.found) { - g = e.pos - a; - break; - } - } - e.pos = a; - if (g) return { stream: new Stream(e.getBytes(g)), length: g }; - warn( - 'Unable to recover "Length1" property in Type1 font -- using as is.', - ); - return { stream: new Stream(e.getBytes(t)), length: t }; - })(t, a); - new Type1Parser(g.stream, !1, Yi).extractFontHeader(i); - if (n) { - r = t.getBytes(6); - s = (r[5] << 24) | (r[4] << 16) | (r[3] << 8) | r[2]; + const headerBlock = getHeaderBlock(file, headerBlockLength); + const headerBlockParser = new Type1Parser( + headerBlock.stream, + false, + SEAC_ANALYSIS_ENABLED, + ); + headerBlockParser.extractFontHeader(properties); + if (pfbHeaderPresent) { + pfbHeader = file.getBytes(PFB_HEADER_SIZE); + eexecBlockLength = + (pfbHeader[5] << 24) | + (pfbHeader[4] << 16) | + (pfbHeader[3] << 8) | + pfbHeader[2]; } - const o = (function getEexecBlock(e, t) { - const i = e.getBytes(); - if (0 === i.length) - throw new FormatError("getEexecBlock - no font program found."); - return { stream: new Stream(i), length: i.length }; - })(t), - c = new Type1Parser(o.stream, !0, Yi).extractFontProgram(i); - for (const e in c.properties) i[e] = c.properties[e]; - const C = c.charstrings, - h = this.getType2Charstrings(C), - l = this.getType2Subrs(c.subrs); - this.charstrings = C; - this.data = this.wrap(e, h, this.charstrings, l, i); - this.seacs = this.getSeacs(c.charstrings); + const eexecBlock = getEexecBlock(file, eexecBlockLength); + const eexecBlockParser = new Type1Parser( + eexecBlock.stream, + true, + SEAC_ANALYSIS_ENABLED, + ); + const data = eexecBlockParser.extractFontProgram(properties); + for (const key in data.properties) { + properties[key] = data.properties[key]; + } + const charstrings = data.charstrings; + const type2Charstrings = this.getType2Charstrings(charstrings); + const subrs = this.getType2Subrs(data.subrs); + this.charstrings = charstrings; + this.data = this.wrap( + name, + type2Charstrings, + this.charstrings, + subrs, + properties, + ); + this.seacs = this.getSeacs(data.charstrings); } get numGlyphs() { return this.charstrings.length + 1; } getCharset() { - const e = [".notdef"]; - for (const { glyphName: t } of this.charstrings) e.push(t); - return e; - } - getGlyphMapping(e) { - const t = this.charstrings; - if (e.composite) { - const i = Object.create(null); - for (let a = 0, s = t.length; a < s; a++) { - i[e.cMap.charCodeOf(a)] = a + 1; - } - return i; + const charset = [".notdef"]; + for (const { glyphName } of this.charstrings) { + charset.push(glyphName); } - const i = [".notdef"]; - let a, s; - for (s = 0; s < t.length; s++) i.push(t[s].glyphName); - const r = e.builtInEncoding; - if (r) { - a = Object.create(null); - for (const e in r) { - s = i.indexOf(r[e]); - s >= 0 && (a[e] = s); + return charset; + } + getGlyphMapping(properties) { + const charstrings = this.charstrings; + if (properties.composite) { + const charCodeToGlyphId = Object.create(null); + for ( + let glyphId = 0, charstringsLen = charstrings.length; + glyphId < charstringsLen; + glyphId++ + ) { + const charCode = properties.cMap.charCodeOf(glyphId); + charCodeToGlyphId[charCode] = glyphId + 1; + } + return charCodeToGlyphId; + } + const glyphNames = [".notdef"]; + let builtInEncoding, glyphId; + for (glyphId = 0; glyphId < charstrings.length; glyphId++) { + glyphNames.push(charstrings[glyphId].glyphName); + } + const encoding = properties.builtInEncoding; + if (encoding) { + builtInEncoding = Object.create(null); + for (const charCode in encoding) { + glyphId = glyphNames.indexOf(encoding[charCode]); + if (glyphId >= 0) { + builtInEncoding[charCode] = glyphId; + } } } - return type1FontGlyphMapping(e, a, i); + return type1FontGlyphMapping(properties, builtInEncoding, glyphNames); } - hasGlyphId(e) { - if (e < 0 || e >= this.numGlyphs) return !1; - if (0 === e) return !0; - return this.charstrings[e - 1].charstring.length > 0; - } - getSeacs(e) { - const t = []; - for (let i = 0, a = e.length; i < a; i++) { - const a = e[i]; - a.seac && (t[i + 1] = a.seac); + hasGlyphId(id) { + if (id < 0 || id >= this.numGlyphs) { + return false; } - return t; - } - getType2Charstrings(e) { - const t = []; - for (const i of e) t.push(i.charstring); - return t; - } - getType2Subrs(e) { - let t = 0; - const i = e.length; - t = i < 1133 ? 107 : i < 33769 ? 1131 : 32768; - const a = []; - let s; - for (s = 0; s < t; s++) a.push([11]); - for (s = 0; s < i; s++) a.push(e[s]); - return a; - } - wrap(e, t, i, a, s) { - const r = new CFF(); - r.header = new CFFHeader(1, 0, 4, 4); - r.names = [e]; - const n = new CFFTopDict(); - n.setByName("version", 391); - n.setByName("Notice", 392); - n.setByName("FullName", 393); - n.setByName("FamilyName", 394); - n.setByName("Weight", 395); - n.setByName("Encoding", null); - n.setByName("FontMatrix", s.fontMatrix); - n.setByName("FontBBox", s.bbox); - n.setByName("charset", null); - n.setByName("CharStrings", null); - n.setByName("Private", null); - r.topDict = n; - const g = new CFFStrings(); - g.add("Version 0.11"); - g.add("See original notice"); - g.add(e); - g.add(e); - g.add("Medium"); - r.strings = g; - r.globalSubrIndex = new CFFIndex(); - const o = t.length, - c = [".notdef"]; - let C, h; - for (C = 0; C < o; C++) { - const e = i[C].glyphName; - -1 === wi.indexOf(e) && g.add(e); - c.push(e); + if (id === 0) { + return true; } - r.charset = new CFFCharset(!1, 0, c); - const l = new CFFIndex(); - l.add([139, 14]); - for (C = 0; C < o; C++) l.add(t[C]); - r.charStrings = l; - const Q = new CFFPrivateDict(); - Q.setByName("Subrs", null); - const E = [ + const glyph = this.charstrings[id - 1]; + return glyph.charstring.length > 0; + } + getSeacs(charstrings) { + const seacMap = []; + for (let i = 0, ii = charstrings.length; i < ii; i++) { + const charstring = charstrings[i]; + if (charstring.seac) { + seacMap[i + 1] = charstring.seac; + } + } + return seacMap; + } + getType2Charstrings(type1Charstrings) { + const type2Charstrings = []; + for (const type1Charstring of type1Charstrings) { + type2Charstrings.push(type1Charstring.charstring); + } + return type2Charstrings; + } + getType2Subrs(type1Subrs) { + let bias = 0; + const count = type1Subrs.length; + if (count < 1133) { + bias = 107; + } else if (count < 33769) { + bias = 1131; + } else { + bias = 32768; + } + const type2Subrs = []; + let i; + for (i = 0; i < bias; i++) { + type2Subrs.push([0x0b]); + } + for (i = 0; i < count; i++) { + type2Subrs.push(type1Subrs[i]); + } + return type2Subrs; + } + wrap(name, glyphs, charstrings, subrs, properties) { + const cff = new CFF(); + cff.header = new CFFHeader(1, 0, 4, 4); + cff.names = [name]; + const topDict = new CFFTopDict(); + topDict.setByName("version", 391); + topDict.setByName("Notice", 392); + topDict.setByName("FullName", 393); + topDict.setByName("FamilyName", 394); + topDict.setByName("Weight", 395); + topDict.setByName("Encoding", null); + topDict.setByName("FontMatrix", properties.fontMatrix); + topDict.setByName("FontBBox", properties.bbox); + topDict.setByName("charset", null); + topDict.setByName("CharStrings", null); + topDict.setByName("Private", null); + cff.topDict = topDict; + const strings = new CFFStrings(); + strings.add("Version 0.11"); + strings.add("See original notice"); + strings.add(name); + strings.add(name); + strings.add("Medium"); + cff.strings = strings; + cff.globalSubrIndex = new CFFIndex(); + const count = glyphs.length; + const charsetArray = [".notdef"]; + let i, ii; + for (i = 0; i < count; i++) { + const glyphName = charstrings[i].glyphName; + const index = CFFStandardStrings.indexOf(glyphName); + if (index === -1) { + strings.add(glyphName); + } + charsetArray.push(glyphName); + } + cff.charset = new CFFCharset(false, 0, charsetArray); + const charStringsIndex = new CFFIndex(); + charStringsIndex.add([0x8b, 0x0e]); + for (i = 0; i < count; i++) { + charStringsIndex.add(glyphs[i]); + } + cff.charStrings = charStringsIndex; + const privateDict = new CFFPrivateDict(); + privateDict.setByName("Subrs", null); + const fields = [ "BlueValues", "OtherBlues", "FamilyBlues", @@ -25287,716 +29303,1024 @@ class Type1Font { "StdHW", "StdVW", ]; - for (C = 0, h = E.length; C < h; C++) { - const e = E[C]; - if (!(e in s.privateData)) continue; - const t = s.privateData[e]; - if (Array.isArray(t)) - for (let e = t.length - 1; e > 0; e--) t[e] -= t[e - 1]; - Q.setByName(e, t); + for (i = 0, ii = fields.length; i < ii; i++) { + const field = fields[i]; + if (!(field in properties.privateData)) { + continue; + } + const value = properties.privateData[field]; + if (Array.isArray(value)) { + for (let j = value.length - 1; j > 0; j--) { + value[j] -= value[j - 1]; + } + } + privateDict.setByName(field, value); } - r.topDict.privateDict = Q; - const u = new CFFIndex(); - for (C = 0, h = a.length; C < h; C++) u.add(a[C]); - Q.subrsIndex = u; - return new CFFCompiler(r).compile(); + cff.topDict.privateDict = privateDict; + const subrIndex = new CFFIndex(); + for (i = 0, ii = subrs.length; i < ii; i++) { + subrIndex.add(subrs[i]); + } + privateDict.subrsIndex = subrIndex; + const compiler = new CFFCompiler(cff); + return compiler.compile(); + } +} // ./src/core/fonts.js + +const PRIVATE_USE_AREAS = [ + [0xe000, 0xf8ff], + [0x100000, 0x10fffd], +]; +const PDF_GLYPH_SPACE_UNITS = 1000; +const EXPORT_DATA_PROPERTIES = [ + "ascent", + "bbox", + "black", + "bold", + "charProcOperatorList", + "composite", + "cssFontInfo", + "data", + "defaultVMetrics", + "defaultWidth", + "descent", + "fallbackName", + "fontMatrix", + "isInvalidPDFjsFont", + "isType3Font", + "italic", + "loadedName", + "mimetype", + "missingFile", + "name", + "remeasure", + "subtype", + "systemFontInfo", + "type", + "vertical", +]; +const EXPORT_DATA_EXTRA_PROPERTIES = [ + "cMap", + "defaultEncoding", + "differences", + "isMonospace", + "isSerifFont", + "isSymbolicFont", + "seacMap", + "toFontChar", + "toUnicode", + "vmetrics", + "widths", +]; +function adjustWidths(properties) { + if (!properties.fontMatrix) { + return; + } + if (properties.fontMatrix[0] === FONT_IDENTITY_MATRIX[0]) { + return; + } + const scale = 0.001 / properties.fontMatrix[0]; + const glyphsWidths = properties.widths; + for (const glyph in glyphsWidths) { + glyphsWidths[glyph] *= scale; + } + properties.defaultWidth *= scale; +} +function adjustTrueTypeToUnicode(properties, isSymbolicFont, nameRecords) { + if (properties.isInternalFont) { + return; + } + if (properties.hasIncludedToUnicodeMap) { + return; + } + if (properties.hasEncoding) { + return; + } + if (properties.toUnicode instanceof IdentityToUnicodeMap) { + return; + } + if (!isSymbolicFont) { + return; + } + if (nameRecords.length === 0) { + return; + } + if (properties.defaultEncoding === WinAnsiEncoding) { + return; + } + for (const r of nameRecords) { + if (!isWinNameRecord(r)) { + return; + } + } + const encoding = WinAnsiEncoding; + const toUnicode = [], + glyphsUnicodeMap = getGlyphsUnicode(); + for (const charCode in encoding) { + const glyphName = encoding[charCode]; + if (glyphName === "") { + continue; + } + const unicode = glyphsUnicodeMap[glyphName]; + if (unicode === undefined) { + continue; + } + toUnicode[charCode] = String.fromCharCode(unicode); + } + if (toUnicode.length > 0) { + properties.toUnicode.amend(toUnicode); } } -const ha = [ - [57344, 63743], - [1048576, 1114109], - ], - Ba = 1e3, - la = [ - "ascent", - "bbox", - "black", - "bold", - "charProcOperatorList", - "composite", - "cssFontInfo", - "data", - "defaultVMetrics", - "defaultWidth", - "descent", - "fallbackName", - "fontMatrix", - "isInvalidPDFjsFont", - "isType3Font", - "italic", - "loadedName", - "mimetype", - "missingFile", - "name", - "remeasure", - "subtype", - "systemFontInfo", - "type", - "vertical", - ], - Qa = [ - "cMap", - "defaultEncoding", - "differences", - "isMonospace", - "isSerifFont", - "isSymbolicFont", - "seacMap", - "toFontChar", - "toUnicode", - "vmetrics", - "widths", - ]; -function adjustWidths(e) { - if (!e.fontMatrix) return; - if (e.fontMatrix[0] === a[0]) return; - const t = 0.001 / e.fontMatrix[0], - i = e.widths; - for (const e in i) i[e] *= t; - e.defaultWidth *= t; +function adjustType1ToUnicode(properties, builtInEncoding) { + if (properties.isInternalFont) { + return; + } + if (properties.hasIncludedToUnicodeMap) { + return; + } + if (builtInEncoding === properties.defaultEncoding) { + return; + } + if (properties.toUnicode instanceof IdentityToUnicodeMap) { + return; + } + const toUnicode = [], + glyphsUnicodeMap = getGlyphsUnicode(); + for (const charCode in builtInEncoding) { + if (properties.hasEncoding) { + if ( + properties.baseEncodingName || + properties.differences[charCode] !== undefined + ) { + continue; + } + } + const glyphName = builtInEncoding[charCode]; + const unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); + if (unicode !== -1) { + toUnicode[charCode] = String.fromCharCode(unicode); + } + } + if (toUnicode.length > 0) { + properties.toUnicode.amend(toUnicode); + } } -function amendFallbackToUnicode(e) { - if (!e.fallbackToUnicode) return; - if (e.toUnicode instanceof IdentityToUnicodeMap) return; - const t = []; - for (const i in e.fallbackToUnicode) - e.toUnicode.has(i) || (t[i] = e.fallbackToUnicode[i]); - t.length > 0 && e.toUnicode.amend(t); +function amendFallbackToUnicode(properties) { + if (!properties.fallbackToUnicode) { + return; + } + if (properties.toUnicode instanceof IdentityToUnicodeMap) { + return; + } + const toUnicode = []; + for (const charCode in properties.fallbackToUnicode) { + if (properties.toUnicode.has(charCode)) { + continue; + } + toUnicode[charCode] = properties.fallbackToUnicode[charCode]; + } + if (toUnicode.length > 0) { + properties.toUnicode.amend(toUnicode); + } } class fonts_Glyph { - constructor(e, t, i, a, s, r, n, g, o) { - this.originalCharCode = e; - this.fontChar = t; - this.unicode = i; - this.accent = a; - this.width = s; - this.vmetric = r; - this.operatorListId = n; - this.isSpace = g; - this.isInFont = o; + constructor( + originalCharCode, + fontChar, + unicode, + accent, + width, + vmetric, + operatorListId, + isSpace, + isInFont, + ) { + this.originalCharCode = originalCharCode; + this.fontChar = fontChar; + this.unicode = unicode; + this.accent = accent; + this.width = width; + this.vmetric = vmetric; + this.operatorListId = operatorListId; + this.isSpace = isSpace; + this.isInFont = isInFont; } get category() { - return shadow( - this, - "category", - (function getCharUnicodeCategory(e) { - const t = Ji.get(e); - if (t) return t; - const i = e.match(Hi), - a = { - isWhitespace: !!i?.[1], - isZeroWidthDiacritic: !!i?.[2], - isInvisibleFormatMark: !!i?.[3], - }; - Ji.set(e, a); - return a; - })(this.unicode), - !0, - ); + return shadow(this, "category", getCharUnicodeCategory(this.unicode), true); } } -function int16(e, t) { - return (e << 8) + t; +function int16(b0, b1) { + return (b0 << 8) + b1; } -function writeSignedInt16(e, t, i) { - e[t + 1] = i; - e[t] = i >>> 8; +function writeSignedInt16(bytes, index, value) { + bytes[index + 1] = value; + bytes[index] = value >>> 8; } -function signedInt16(e, t) { - const i = (e << 8) + t; - return 32768 & i ? i - 65536 : i; +function signedInt16(b0, b1) { + const value = (b0 << 8) + b1; + return value & (1 << 15) ? value - 0x10000 : value; } -function string16(e) { - return String.fromCharCode((e >> 8) & 255, 255 & e); +function writeUint32(bytes, index, value) { + bytes[index + 3] = value & 0xff; + bytes[index + 2] = value >>> 8; + bytes[index + 1] = value >>> 16; + bytes[index] = value >>> 24; } -function safeString16(e) { - e > 32767 ? (e = 32767) : e < -32768 && (e = -32768); - return String.fromCharCode((e >> 8) & 255, 255 & e); +function int32(b0, b1, b2, b3) { + return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; } -function isTrueTypeCollectionFile(e) { - return "ttcf" === bytesToString(e.peekBytes(4)); +function string16(value) { + return String.fromCharCode((value >> 8) & 0xff, value & 0xff); } -function getFontFileType(e, { type: t, subtype: i, composite: a }) { - let s, r; - if ( - (function isTrueTypeFile(e) { - const t = e.peekBytes(4); - return 65536 === readUint32(t, 0) || "true" === bytesToString(t); - })(e) || - isTrueTypeCollectionFile(e) - ) - s = a ? "CIDFontType2" : "TrueType"; - else if ( - (function isOpenTypeFile(e) { - return "OTTO" === bytesToString(e.peekBytes(4)); - })(e) - ) - s = a ? "CIDFontType2" : "OpenType"; - else if ( - (function isType1File(e) { - const t = e.peekBytes(2); - return (37 === t[0] && 33 === t[1]) || (128 === t[0] && 1 === t[1]); - })(e) - ) - s = a ? "CIDFontType0" : "MMType1" === t ? "MMType1" : "Type1"; - else if ( - (function isCFFFile(e) { - const t = e.peekBytes(4); - return t[0] >= 1 && t[3] >= 1 && t[3] <= 4; - })(e) - ) - if (a) { - s = "CIDFontType0"; - r = "CIDFontType0C"; +function safeString16(value) { + if (value > 0x7fff) { + value = 0x7fff; + } else if (value < -0x8000) { + value = -0x8000; + } + return String.fromCharCode((value >> 8) & 0xff, value & 0xff); +} +function isTrueTypeFile(file) { + const header = file.peekBytes(4); + return ( + readUint32(header, 0) === 0x00010000 || bytesToString(header) === "true" + ); +} +function isTrueTypeCollectionFile(file) { + const header = file.peekBytes(4); + return bytesToString(header) === "ttcf"; +} +function isOpenTypeFile(file) { + const header = file.peekBytes(4); + return bytesToString(header) === "OTTO"; +} +function isType1File(file) { + const header = file.peekBytes(2); + if (header[0] === 0x25 && header[1] === 0x21) { + return true; + } + if (header[0] === 0x80 && header[1] === 0x01) { + return true; + } + return false; +} +function isCFFFile(file) { + const header = file.peekBytes(4); + if (header[0] >= 1 && header[3] >= 1 && header[3] <= 4) { + return true; + } + return false; +} +function getFontFileType(file, { type, subtype, composite }) { + let fileType, fileSubtype; + if (isTrueTypeFile(file) || isTrueTypeCollectionFile(file)) { + fileType = composite ? "CIDFontType2" : "TrueType"; + } else if (isOpenTypeFile(file)) { + fileType = composite ? "CIDFontType2" : "OpenType"; + } else if (isType1File(file)) { + if (composite) { + fileType = "CIDFontType0"; } else { - s = "MMType1" === t ? "MMType1" : "Type1"; - r = "Type1C"; + fileType = type === "MMType1" ? "MMType1" : "Type1"; } - else { + } else if (isCFFFile(file)) { + if (composite) { + fileType = "CIDFontType0"; + fileSubtype = "CIDFontType0C"; + } else { + fileType = type === "MMType1" ? "MMType1" : "Type1"; + fileSubtype = "Type1C"; + } + } else { warn("getFontFileType: Unable to detect correct font file Type/Subtype."); - s = t; - r = i; + fileType = type; + fileSubtype = subtype; } - return [s, r]; + return [fileType, fileSubtype]; } -function applyStandardFontGlyphMap(e, t) { - for (const i in t) e[+i] = t[i]; -} -function buildToFontChar(e, t, i) { - const a = []; - let s; - for (let i = 0, r = e.length; i < r; i++) { - s = getUnicodeForGlyph(e[i], t); - -1 !== s && (a[i] = s); +function applyStandardFontGlyphMap(map, glyphMap) { + for (const charCode in glyphMap) { + map[+charCode] = glyphMap[charCode]; } - for (const e in i) { - s = getUnicodeForGlyph(i[e], t); - -1 !== s && (a[+e] = s); +} +function buildToFontChar(encoding, glyphsUnicodeMap, differences) { + const toFontChar = []; + let unicode; + for (let i = 0, ii = encoding.length; i < ii; i++) { + unicode = getUnicodeForGlyph(encoding[i], glyphsUnicodeMap); + if (unicode !== -1) { + toFontChar[i] = unicode; + } } - return a; + for (const charCode in differences) { + unicode = getUnicodeForGlyph(differences[charCode], glyphsUnicodeMap); + if (unicode !== -1) { + toFontChar[+charCode] = unicode; + } + } + return toFontChar; } -function isMacNameRecord(e) { - return 1 === e.platform && 0 === e.encoding && 0 === e.language; +function isMacNameRecord(r) { + return r.platform === 1 && r.encoding === 0 && r.language === 0; } -function isWinNameRecord(e) { - return 3 === e.platform && 1 === e.encoding && 1033 === e.language; +function isWinNameRecord(r) { + return r.platform === 3 && r.encoding === 1 && r.language === 0x409; } -function convertCidString(e, t, i = !1) { - switch (t.length) { +function convertCidString(charCode, cid, shouldThrow = false) { + switch (cid.length) { case 1: - return t.charCodeAt(0); + return cid.charCodeAt(0); case 2: - return (t.charCodeAt(0) << 8) | t.charCodeAt(1); + return (cid.charCodeAt(0) << 8) | cid.charCodeAt(1); } - const a = `Unsupported CID string (charCode ${e}): "${t}".`; - if (i) throw new FormatError(a); - warn(a); - return t; + const msg = `Unsupported CID string (charCode ${charCode}): "${cid}".`; + if (shouldThrow) { + throw new FormatError(msg); + } + warn(msg); + return cid; } -function adjustMapping(e, t, i, a) { - const s = Object.create(null), - r = new Map(), - n = [], - g = new Set(); - let o = 0; - let c = ha[o][0], - C = ha[o][1]; - for (const l in e) { - let Q = e[l]; - if (!t(Q)) continue; - if (c > C) { - o++; - if (o >= ha.length) { +function adjustMapping(charCodeToGlyphId, hasGlyph, newGlyphZeroId, toUnicode) { + const newMap = Object.create(null); + const toUnicodeExtraMap = new Map(); + const toFontChar = []; + const usedGlyphIds = new Set(); + let privateUseAreaIndex = 0; + const privateUseOffetStart = PRIVATE_USE_AREAS[privateUseAreaIndex][0]; + let nextAvailableFontCharCode = privateUseOffetStart; + let privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1]; + const isInPrivateArea = (code) => + (PRIVATE_USE_AREAS[0][0] <= code && code <= PRIVATE_USE_AREAS[0][1]) || + (PRIVATE_USE_AREAS[1][0] <= code && code <= PRIVATE_USE_AREAS[1][1]); + for (const originalCharCode in charCodeToGlyphId) { + let glyphId = charCodeToGlyphId[originalCharCode]; + if (!hasGlyph(glyphId)) { + continue; + } + if (nextAvailableFontCharCode > privateUseOffetEnd) { + privateUseAreaIndex++; + if (privateUseAreaIndex >= PRIVATE_USE_AREAS.length) { warn("Ran out of space in font private use area."); break; } - c = ha[o][0]; - C = ha[o][1]; + nextAvailableFontCharCode = PRIVATE_USE_AREAS[privateUseAreaIndex][0]; + privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1]; } - const E = c++; - 0 === Q && (Q = i); - let u = a.get(l); - "string" == typeof u && (u = u.codePointAt(0)); - if ( - u && - !((h = u), - (ha[0][0] <= h && h <= ha[0][1]) || (ha[1][0] <= h && h <= ha[1][1])) && - !g.has(Q) - ) { - r.set(u, Q); - g.add(Q); + const fontCharCode = nextAvailableFontCharCode++; + if (glyphId === 0) { + glyphId = newGlyphZeroId; } - s[E] = Q; - n[l] = E; + let unicode = toUnicode.get(originalCharCode); + if (typeof unicode === "string") { + unicode = unicode.codePointAt(0); + } + if (unicode && !isInPrivateArea(unicode) && !usedGlyphIds.has(glyphId)) { + toUnicodeExtraMap.set(unicode, glyphId); + usedGlyphIds.add(glyphId); + } + newMap[fontCharCode] = glyphId; + toFontChar[originalCharCode] = fontCharCode; } - var h; return { - toFontChar: n, - charCodeToGlyphId: s, - toUnicodeExtraMap: r, - nextAvailableFontCharCode: c, + toFontChar, + charCodeToGlyphId: newMap, + toUnicodeExtraMap, + nextAvailableFontCharCode, }; } -function createCmapTable(e, t, i) { - const a = (function getRanges(e, t, i) { - const a = []; - for (const t in e) - e[t] >= i || a.push({ fontCharCode: 0 | t, glyphId: e[t] }); - if (t) - for (const [e, s] of t) - s >= i || a.push({ fontCharCode: e, glyphId: s }); - 0 === a.length && a.push({ fontCharCode: 0, glyphId: 0 }); - a.sort(function fontGetRangesSort(e, t) { - return e.fontCharCode - t.fontCharCode; - }); - const s = [], - r = a.length; - for (let e = 0; e < r; ) { - const t = a[e].fontCharCode, - i = [a[e].glyphId]; - ++e; - let n = t; - for (; e < r && n + 1 === a[e].fontCharCode; ) { - i.push(a[e].glyphId); - ++n; - ++e; - if (65535 === n) break; - } - s.push([t, n, i]); +function getRanges(glyphs, toUnicodeExtraMap, numGlyphs) { + const codes = []; + for (const charCode in glyphs) { + if (glyphs[charCode] >= numGlyphs) { + continue; + } + codes.push({ + fontCharCode: charCode | 0, + glyphId: glyphs[charCode], + }); + } + if (toUnicodeExtraMap) { + for (const [unicode, glyphId] of toUnicodeExtraMap) { + if (glyphId >= numGlyphs) { + continue; } - return s; - })(e, t, i), - s = a.at(-1)[1] > 65535 ? 2 : 1; - let r, - n, - g, - o, - c = "\0\0" + string16(s) + "\0\0" + string32(4 + 8 * s); - for (r = a.length - 1; r >= 0 && !(a[r][0] <= 65535); --r); - const C = r + 1; - a[r][0] < 65535 && 65535 === a[r][1] && (a[r][1] = 65534); - const h = a[r][1] < 65535 ? 1 : 0, - l = C + h, - Q = OpenTypeFileBuilder.getSearchParams(l, 2); - let E, - u, - d, - f, - p = "", - m = "", - y = "", - w = "", - D = "", - b = 0; - for (r = 0, n = C; r < n; r++) { - E = a[r]; - u = E[0]; - d = E[1]; - p += string16(u); - m += string16(d); - f = E[2]; - let e = !0; - for (g = 1, o = f.length; g < o; ++g) - if (f[g] !== f[g - 1] + 1) { - e = !1; + codes.push({ + fontCharCode: unicode, + glyphId, + }); + } + } + if (codes.length === 0) { + codes.push({ + fontCharCode: 0, + glyphId: 0, + }); + } + codes.sort(function fontGetRangesSort(a, b) { + return a.fontCharCode - b.fontCharCode; + }); + const ranges = []; + const length = codes.length; + for (let n = 0; n < length; ) { + const start = codes[n].fontCharCode; + const codeIndices = [codes[n].glyphId]; + ++n; + let end = start; + while (n < length && end + 1 === codes[n].fontCharCode) { + codeIndices.push(codes[n].glyphId); + ++end; + ++n; + if (end === 0xffff) { break; } - if (e) { - y += string16((f[0] - u) & 65535); - w += string16(0); - } else { - const e = 2 * (l - r) + 2 * b; - b += d - u + 1; - y += string16(0); - w += string16(e); - for (g = 0, o = f.length; g < o; ++g) D += string16(f[g]); } + ranges.push([start, end, codeIndices]); } - if (h > 0) { - m += "ÿÿ"; - p += "ÿÿ"; - y += "\0"; - w += "\0\0"; - } - const F = - "\0\0" + - string16(2 * l) + - string16(Q.range) + - string16(Q.entry) + - string16(Q.rangeShift) + - m + - "\0\0" + - p + - y + - w + - D; - let S = "", - k = ""; - if (s > 1) { - c += "\0\0\n" + string32(4 + 8 * s + 4 + F.length); - S = ""; - for (r = 0, n = a.length; r < n; r++) { - E = a[r]; - u = E[0]; - f = E[2]; - let e = f[0]; - for (g = 1, o = f.length; g < o; ++g) - if (f[g] !== f[g - 1] + 1) { - d = E[0] + g - 1; - S += string32(u) + string32(d) + string32(e); - u = d + 1; - e = f[g]; - } - S += string32(u) + string32(E[1]) + string32(e); - } - k = - "\0\f\0\0" + - string32(S.length + 16) + - "\0\0\0\0" + - string32(S.length / 12); - } - return c + "\0" + string16(F.length + 4) + F + k + S; + return ranges; } -function createOS2Table(e, t, i) { - i ||= { unitsPerEm: 0, yMax: 0, yMin: 0, ascent: 0, descent: 0 }; - let a = 0, - s = 0, - r = 0, - n = 0, - g = null, - o = 0, - c = -1; - if (t) { - for (let e in t) { - e |= 0; - (g > e || !g) && (g = e); - o < e && (o = e); - c = getUnicodeRangeFor(e, c); - if (c < 32) a |= 1 << c; - else if (c < 64) s |= 1 << (c - 32); - else if (c < 96) r |= 1 << (c - 64); - else { - if (!(c < 123)) - throw new FormatError( - "Unicode ranges Bits > 123 are reserved for internal usage", - ); - n |= 1 << (c - 96); +function createCmapTable(glyphs, toUnicodeExtraMap, numGlyphs) { + const ranges = getRanges(glyphs, toUnicodeExtraMap, numGlyphs); + const numTables = ranges.at(-1)[1] > 0xffff ? 2 : 1; + let cmap = + "\x00\x00" + + string16(numTables) + + "\x00\x03" + + "\x00\x01" + + string32(4 + numTables * 8); + let i, ii, j, jj; + for (i = ranges.length - 1; i >= 0; --i) { + if (ranges[i][0] <= 0xffff) { + break; + } + } + const bmpLength = i + 1; + if (ranges[i][0] < 0xffff && ranges[i][1] === 0xffff) { + ranges[i][1] = 0xfffe; + } + const trailingRangesCount = ranges[i][1] < 0xffff ? 1 : 0; + const segCount = bmpLength + trailingRangesCount; + const searchParams = OpenTypeFileBuilder.getSearchParams(segCount, 2); + let startCount = ""; + let endCount = ""; + let idDeltas = ""; + let idRangeOffsets = ""; + let glyphsIds = ""; + let bias = 0; + let range, start, end, codes; + for (i = 0, ii = bmpLength; i < ii; i++) { + range = ranges[i]; + start = range[0]; + end = range[1]; + startCount += string16(start); + endCount += string16(end); + codes = range[2]; + let contiguous = true; + for (j = 1, jj = codes.length; j < jj; ++j) { + if (codes[j] !== codes[j - 1] + 1) { + contiguous = false; + break; } } - o > 65535 && (o = 65535); - } else { - g = 0; - o = 255; - } - const C = e.bbox || [0, 0, 0, 0], - h = - i.unitsPerEm || - (e.fontMatrix - ? 1 / Math.max(...e.fontMatrix.slice(0, 4).map(Math.abs)) - : 1e3), - l = e.ascentScaled ? 1 : h / Ba, - Q = i.ascent || Math.round(l * (e.ascent || C[3])); - let E = i.descent || Math.round(l * (e.descent || C[1])); - E > 0 && e.descent > 0 && C[1] < 0 && (E = -E); - const u = i.yMax || Q, - d = -i.yMin || -E; - return ( - "\0$ô\0\0\0Š»\0\0\0ŒŠ»\0\0ß\x001\0\0\0\0" + - String.fromCharCode(e.fixedPitch ? 9 : 0) + - "\0\0\0\0\0\0" + - string32(a) + - string32(s) + - string32(r) + - string32(n) + - "*21*" + - string16(e.italicAngle ? 1 : 0) + - string16(g || e.firstChar) + - string16(o || e.lastChar) + - string16(Q) + - string16(E) + - "\0d" + - string16(u) + - string16(d) + - "\0\0\0\0\0\0\0\0" + - string16(e.xHeight) + - string16(e.capHeight) + - string16(0) + - string16(g || e.firstChar) + - "\0" - ); -} -function createPostTable(e) { - return ( - "\0\0\0" + - string32(Math.floor(65536 * e.italicAngle)) + - "\0\0\0\0" + - string32(e.fixedPitch ? 1 : 0) + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - ); -} -function createPostscriptName(e) { - return e.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g, "").slice(0, 63); -} -function createNameTable(e, t) { - t || (t = [[], []]); - const i = [ - t[0][0] || "Original licence", - t[0][1] || e, - t[0][2] || "Unknown", - t[0][3] || "uniqueID", - t[0][4] || e, - t[0][5] || "Version 0.11", - t[0][6] || createPostscriptName(e), - t[0][7] || "Unknown", - t[0][8] || "Unknown", - t[0][9] || "Unknown", - ], - a = []; - let s, r, n, g, o; - for (s = 0, r = i.length; s < r; s++) { - o = t[1][s] || i[s]; - const e = []; - for (n = 0, g = o.length; n < g; n++) e.push(string16(o.charCodeAt(n))); - a.push(e.join("")); - } - const c = [i, a], - C = ["\0", "\0"], - h = ["\0\0", "\0"], - l = ["\0\0", "\t"], - Q = i.length * C.length; - let E = "\0\0" + string16(Q) + string16(12 * Q + 6), - u = 0; - for (s = 0, r = C.length; s < r; s++) { - const e = c[s]; - for (n = 0, g = e.length; n < g; n++) { - o = e[n]; - E += C[s] + h[s] + l[s] + string16(n) + string16(o.length) + string16(u); - u += o.length; + if (!contiguous) { + const offset = (segCount - i) * 2 + bias * 2; + bias += end - start + 1; + idDeltas += string16(0); + idRangeOffsets += string16(offset); + for (j = 0, jj = codes.length; j < jj; ++j) { + glyphsIds += string16(codes[j]); + } + } else { + const startCode = codes[0]; + idDeltas += string16((startCode - start) & 0xffff); + idRangeOffsets += string16(0); } } - E += i.join("") + a.join(""); - return E; + if (trailingRangesCount > 0) { + endCount += "\xFF\xFF"; + startCount += "\xFF\xFF"; + idDeltas += "\x00\x01"; + idRangeOffsets += "\x00\x00"; + } + const format314 = + "\x00\x00" + + string16(2 * segCount) + + string16(searchParams.range) + + string16(searchParams.entry) + + string16(searchParams.rangeShift) + + endCount + + "\x00\x00" + + startCount + + idDeltas + + idRangeOffsets + + glyphsIds; + let format31012 = ""; + let header31012 = ""; + if (numTables > 1) { + cmap += + "\x00\x03" + + "\x00\x0A" + + string32(4 + numTables * 8 + 4 + format314.length); + format31012 = ""; + for (i = 0, ii = ranges.length; i < ii; i++) { + range = ranges[i]; + start = range[0]; + codes = range[2]; + let code = codes[0]; + for (j = 1, jj = codes.length; j < jj; ++j) { + if (codes[j] !== codes[j - 1] + 1) { + end = range[0] + j - 1; + format31012 += string32(start) + string32(end) + string32(code); + start = end + 1; + code = codes[j]; + } + } + format31012 += string32(start) + string32(range[1]) + string32(code); + } + header31012 = + "\x00\x0C" + + "\x00\x00" + + string32(format31012.length + 16) + + "\x00\x00\x00\x00" + + string32(format31012.length / 12); + } + return ( + cmap + + "\x00\x04" + + string16(format314.length + 4) + + format314 + + header31012 + + format31012 + ); +} +function validateOS2Table(os2, file) { + file.pos = (file.start || 0) + os2.offset; + const version = file.getUint16(); + file.skip(60); + const selection = file.getUint16(); + if (version < 4 && selection & 0x0300) { + return false; + } + const firstChar = file.getUint16(); + const lastChar = file.getUint16(); + if (firstChar > lastChar) { + return false; + } + file.skip(6); + const usWinAscent = file.getUint16(); + if (usWinAscent === 0) { + return false; + } + os2.data[8] = os2.data[9] = 0; + return true; +} +function createOS2Table(properties, charstrings, override) { + override ||= { + unitsPerEm: 0, + yMax: 0, + yMin: 0, + ascent: 0, + descent: 0, + }; + let ulUnicodeRange1 = 0; + let ulUnicodeRange2 = 0; + let ulUnicodeRange3 = 0; + let ulUnicodeRange4 = 0; + let firstCharIndex = null; + let lastCharIndex = 0; + let position = -1; + if (charstrings) { + for (let code in charstrings) { + code |= 0; + if (firstCharIndex > code || !firstCharIndex) { + firstCharIndex = code; + } + if (lastCharIndex < code) { + lastCharIndex = code; + } + position = getUnicodeRangeFor(code, position); + if (position < 32) { + ulUnicodeRange1 |= 1 << position; + } else if (position < 64) { + ulUnicodeRange2 |= 1 << (position - 32); + } else if (position < 96) { + ulUnicodeRange3 |= 1 << (position - 64); + } else if (position < 123) { + ulUnicodeRange4 |= 1 << (position - 96); + } else { + throw new FormatError( + "Unicode ranges Bits > 123 are reserved for internal usage", + ); + } + } + if (lastCharIndex > 0xffff) { + lastCharIndex = 0xffff; + } + } else { + firstCharIndex = 0; + lastCharIndex = 255; + } + const bbox = properties.bbox || [0, 0, 0, 0]; + const unitsPerEm = + override.unitsPerEm || + (properties.fontMatrix + ? 1 / Math.max(...properties.fontMatrix.slice(0, 4).map(Math.abs)) + : 1000); + const scale = properties.ascentScaled + ? 1.0 + : unitsPerEm / PDF_GLYPH_SPACE_UNITS; + const typoAscent = + override.ascent || Math.round(scale * (properties.ascent || bbox[3])); + let typoDescent = + override.descent || Math.round(scale * (properties.descent || bbox[1])); + if (typoDescent > 0 && properties.descent > 0 && bbox[1] < 0) { + typoDescent = -typoDescent; + } + const winAscent = override.yMax || typoAscent; + const winDescent = -override.yMin || -typoDescent; + return ( + "\x00\x03" + + "\x02\x24" + + "\x01\xF4" + + "\x00\x05" + + "\x00\x00" + + "\x02\x8A" + + "\x02\xBB" + + "\x00\x00" + + "\x00\x8C" + + "\x02\x8A" + + "\x02\xBB" + + "\x00\x00" + + "\x01\xDF" + + "\x00\x31" + + "\x01\x02" + + "\x00\x00" + + "\x00\x00\x06" + + String.fromCharCode(properties.fixedPitch ? 0x09 : 0x00) + + "\x00\x00\x00\x00\x00\x00" + + string32(ulUnicodeRange1) + + string32(ulUnicodeRange2) + + string32(ulUnicodeRange3) + + string32(ulUnicodeRange4) + + "\x2A\x32\x31\x2A" + + string16(properties.italicAngle ? 1 : 0) + + string16(firstCharIndex || properties.firstChar) + + string16(lastCharIndex || properties.lastChar) + + string16(typoAscent) + + string16(typoDescent) + + "\x00\x64" + + string16(winAscent) + + string16(winDescent) + + "\x00\x00\x00\x00" + + "\x00\x00\x00\x00" + + string16(properties.xHeight) + + string16(properties.capHeight) + + string16(0) + + string16(firstCharIndex || properties.firstChar) + + "\x00\x03" + ); +} +function createPostTable(properties) { + const angle = Math.floor(properties.italicAngle * 2 ** 16); + return ( + "\x00\x03\x00\x00" + + string32(angle) + + "\x00\x00" + + "\x00\x00" + + string32(properties.fixedPitch ? 1 : 0) + + "\x00\x00\x00\x00" + + "\x00\x00\x00\x00" + + "\x00\x00\x00\x00" + + "\x00\x00\x00\x00" + ); +} +function createPostscriptName(name) { + return name.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g, "").slice(0, 63); +} +function createNameTable(name, proto) { + if (!proto) { + proto = [[], []]; + } + const strings = [ + proto[0][0] || "Original licence", + proto[0][1] || name, + proto[0][2] || "Unknown", + proto[0][3] || "uniqueID", + proto[0][4] || name, + proto[0][5] || "Version 0.11", + proto[0][6] || createPostscriptName(name), + proto[0][7] || "Unknown", + proto[0][8] || "Unknown", + proto[0][9] || "Unknown", + ]; + const stringsUnicode = []; + let i, ii, j, jj, str; + for (i = 0, ii = strings.length; i < ii; i++) { + str = proto[1][i] || strings[i]; + const strBufUnicode = []; + for (j = 0, jj = str.length; j < jj; j++) { + strBufUnicode.push(string16(str.charCodeAt(j))); + } + stringsUnicode.push(strBufUnicode.join("")); + } + const names = [strings, stringsUnicode]; + const platforms = ["\x00\x01", "\x00\x03"]; + const encodings = ["\x00\x00", "\x00\x01"]; + const languages = ["\x00\x00", "\x04\x09"]; + const namesRecordCount = strings.length * platforms.length; + let nameTable = + "\x00\x00" + + string16(namesRecordCount) + + string16(namesRecordCount * 12 + 6); + let strOffset = 0; + for (i = 0, ii = platforms.length; i < ii; i++) { + const strs = names[i]; + for (j = 0, jj = strs.length; j < jj; j++) { + str = strs[j]; + const nameRecord = + platforms[i] + + encodings[i] + + languages[i] + + string16(j) + + string16(str.length) + + string16(strOffset); + nameTable += nameRecord; + strOffset += str.length; + } + } + nameTable += strings.join("") + stringsUnicode.join(""); + return nameTable; } class Font { - constructor(e, t, i) { - this.name = e; + constructor(name, file, properties) { + this.name = name; this.psName = null; this.mimetype = null; - this.disableFontFace = !1; - this.loadedName = i.loadedName; - this.isType3Font = i.isType3Font; - this.missingFile = !1; - this.cssFontInfo = i.cssFontInfo; + this.disableFontFace = false; + this.loadedName = properties.loadedName; + this.isType3Font = properties.isType3Font; + this.missingFile = false; + this.cssFontInfo = properties.cssFontInfo; this._charsCache = Object.create(null); this._glyphCache = Object.create(null); - let a = !!(i.flags & Ki); - if (!a && !i.isSimulatedFlags) { - const t = e.replaceAll(/[,_]/g, "-").split("-", 1)[0], - i = Xi(); - for (const e of t.split("+")) - if (i[e]) { - a = !0; + let isSerifFont = !!(properties.flags & FontFlags.Serif); + if (!isSerifFont && !properties.isSimulatedFlags) { + const baseName = name.replaceAll(/[,_]/g, "-").split("-", 1)[0], + serifFonts = getSerifFonts(); + for (const namePart of baseName.split("+")) { + if (serifFonts[namePart]) { + isSerifFont = true; break; } + } + } + this.isSerifFont = isSerifFont; + this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); + this.isMonospace = !!(properties.flags & FontFlags.FixedPitch); + let { type, subtype } = properties; + this.type = type; + this.subtype = subtype; + this.systemFontInfo = properties.systemFontInfo; + const matches = name.match(/^InvalidPDFjsFont_(.*)_\d+$/); + this.isInvalidPDFjsFont = !!matches; + if (this.isInvalidPDFjsFont) { + this.fallbackName = matches[1]; + } else if (this.isMonospace) { + this.fallbackName = "monospace"; + } else if (this.isSerifFont) { + this.fallbackName = "serif"; + } else { + this.fallbackName = "sans-serif"; } - this.isSerifFont = a; - this.isSymbolicFont = !!(i.flags & Ti); - this.isMonospace = !!(i.flags & vi); - let { type: s, subtype: r } = i; - this.type = s; - this.subtype = r; - this.systemFontInfo = i.systemFontInfo; - const n = e.match(/^InvalidPDFjsFont_(.*)_\d+$/); - this.isInvalidPDFjsFont = !!n; - this.isInvalidPDFjsFont - ? (this.fallbackName = n[1]) - : this.isMonospace - ? (this.fallbackName = "monospace") - : this.isSerifFont - ? (this.fallbackName = "serif") - : (this.fallbackName = "sans-serif"); if (this.systemFontInfo?.guessFallback) { - this.systemFontInfo.guessFallback = !1; + this.systemFontInfo.guessFallback = false; this.systemFontInfo.css += `,${this.fallbackName}`; } - this.differences = i.differences; - this.widths = i.widths; - this.defaultWidth = i.defaultWidth; - this.composite = i.composite; - this.cMap = i.cMap; - this.capHeight = i.capHeight / Ba; - this.ascent = i.ascent / Ba; - this.descent = i.descent / Ba; + this.differences = properties.differences; + this.widths = properties.widths; + this.defaultWidth = properties.defaultWidth; + this.composite = properties.composite; + this.cMap = properties.cMap; + this.capHeight = properties.capHeight / PDF_GLYPH_SPACE_UNITS; + this.ascent = properties.ascent / PDF_GLYPH_SPACE_UNITS; + this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS; this.lineHeight = this.ascent - this.descent; - this.fontMatrix = i.fontMatrix; - this.bbox = i.bbox; - this.defaultEncoding = i.defaultEncoding; - this.toUnicode = i.toUnicode; + this.fontMatrix = properties.fontMatrix; + this.bbox = properties.bbox; + this.defaultEncoding = properties.defaultEncoding; + this.toUnicode = properties.toUnicode; this.toFontChar = []; - if ("Type3" === i.type) { - for (let e = 0; e < 256; e++) - this.toFontChar[e] = this.differences[e] || i.defaultEncoding[e]; + if (properties.type === "Type3") { + for (let charCode = 0; charCode < 256; charCode++) { + this.toFontChar[charCode] = + this.differences[charCode] || properties.defaultEncoding[charCode]; + } return; } - this.cidEncoding = i.cidEncoding || ""; - this.vertical = !!i.vertical; + this.cidEncoding = properties.cidEncoding || ""; + this.vertical = !!properties.vertical; if (this.vertical) { - this.vmetrics = i.vmetrics; - this.defaultVMetrics = i.defaultVMetrics; + this.vmetrics = properties.vmetrics; + this.defaultVMetrics = properties.defaultVMetrics; } - if (!t || t.isEmpty) { - t && warn('Font file is empty in "' + e + '" (' + this.loadedName + ")"); - this.fallbackToSystemFont(i); + if (!file || file.isEmpty) { + if (file) { + warn('Font file is empty in "' + name + '" (' + this.loadedName + ")"); + } + this.fallbackToSystemFont(properties); return; } - [s, r] = getFontFileType(t, i); - (s === this.type && r === this.subtype) || + [type, subtype] = getFontFileType(file, properties); + if (type !== this.type || subtype !== this.subtype) { info( - `Inconsistent font file Type/SubType, expected: ${this.type}/${this.subtype} but found: ${s}/${r}.`, + "Inconsistent font file Type/SubType, expected: " + + `${this.type}/${this.subtype} but found: ${type}/${subtype}.`, ); - let g; + } + let data; try { - switch (s) { + switch (type) { case "MMType1": - info("MMType1 font (" + e + "), falling back to Type1."); + info("MMType1 font (" + name + "), falling back to Type1."); case "Type1": case "CIDFontType0": this.mimetype = "font/opentype"; - const a = - "Type1C" === r || "CIDFontType0C" === r - ? new CFFFont(t, i) - : new Type1Font(e, t, i); - adjustWidths(i); - g = this.convert(e, a, i); + const cff = + subtype === "Type1C" || subtype === "CIDFontType0C" + ? new CFFFont(file, properties) + : new Type1Font(name, file, properties); + adjustWidths(properties); + data = this.convert(name, cff, properties); break; case "OpenType": case "TrueType": case "CIDFontType2": this.mimetype = "font/opentype"; - g = this.checkAndRepair(e, t, i); + data = this.checkAndRepair(name, file, properties); if (this.isOpenType) { - adjustWidths(i); - s = "OpenType"; + adjustWidths(properties); + type = "OpenType"; } break; default: - throw new FormatError(`Font ${s} is not supported`); + throw new FormatError(`Font ${type} is not supported`); } } catch (e) { warn(e); - this.fallbackToSystemFont(i); + this.fallbackToSystemFont(properties); return; } - amendFallbackToUnicode(i); - this.data = g; - this.type = s; - this.subtype = r; - this.fontMatrix = i.fontMatrix; - this.widths = i.widths; - this.defaultWidth = i.defaultWidth; - this.toUnicode = i.toUnicode; - this.seacMap = i.seacMap; + amendFallbackToUnicode(properties); + this.data = data; + this.type = type; + this.subtype = subtype; + this.fontMatrix = properties.fontMatrix; + this.widths = properties.widths; + this.defaultWidth = properties.defaultWidth; + this.toUnicode = properties.toUnicode; + this.seacMap = properties.seacMap; } get renderer() { - return shadow(this, "renderer", FontRendererFactory.create(this, Yi)); + const renderer = FontRendererFactory.create(this, SEAC_ANALYSIS_ENABLED); + return shadow(this, "renderer", renderer); } - exportData(e = !1) { - const t = e ? [...la, ...Qa] : la, - i = Object.create(null); - let a, s; - for (a of t) { - s = this[a]; - void 0 !== s && (i[a] = s); + exportData(extraProperties = false) { + const exportDataProperties = extraProperties + ? [...EXPORT_DATA_PROPERTIES, ...EXPORT_DATA_EXTRA_PROPERTIES] + : EXPORT_DATA_PROPERTIES; + const data = Object.create(null); + let property, value; + for (property of exportDataProperties) { + value = this[property]; + if (value !== undefined) { + data[property] = value; + } } - return i; + return data; } - fallbackToSystemFont(e) { - this.missingFile = !0; - const { name: t, type: i } = this; - let a = normalizeFontName(t); - const s = Pi(), - r = ji(), - n = !!s[a], - g = !(!r[a] || !s[r[a]]); - a = s[a] || r[a] || a; - const o = ea()[a]; - if (o) { - isNaN(this.ascent) && (this.ascent = o.ascent / Ba); - isNaN(this.descent) && (this.descent = o.descent / Ba); - isNaN(this.capHeight) && (this.capHeight = o.capHeight / Ba); + fallbackToSystemFont(properties) { + this.missingFile = true; + const { name, type } = this; + let fontName = normalizeFontName(name); + const stdFontMap = getStdFontMap(), + nonStdFontMap = getNonStdFontMap(); + const isStandardFont = !!stdFontMap[fontName]; + const isMappedToStandardFont = !!( + nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]] + ); + fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName; + const fontBasicMetricsMap = getFontBasicMetrics(); + const metrics = fontBasicMetricsMap[fontName]; + if (metrics) { + if (isNaN(this.ascent)) { + this.ascent = metrics.ascent / PDF_GLYPH_SPACE_UNITS; + } + if (isNaN(this.descent)) { + this.descent = metrics.descent / PDF_GLYPH_SPACE_UNITS; + } + if (isNaN(this.capHeight)) { + this.capHeight = metrics.capHeight / PDF_GLYPH_SPACE_UNITS; + } } - this.bold = /bold/gi.test(a); - this.italic = /oblique|italic/gi.test(a); - this.black = /Black/g.test(t); - const c = /Narrow/g.test(t); - this.remeasure = (!n || c) && Object.keys(this.widths).length > 0; + this.bold = /bold/gi.test(fontName); + this.italic = /oblique|italic/gi.test(fontName); + this.black = /Black/g.test(name); + const isNarrow = /Narrow/g.test(name); + this.remeasure = + (!isStandardFont || isNarrow) && Object.keys(this.widths).length > 0; if ( - (n || g) && - "CIDFontType2" === i && + (isStandardFont || isMappedToStandardFont) && + type === "CIDFontType2" && this.cidEncoding.startsWith("Identity-") ) { - const i = e.cidToGidMap, - a = []; - applyStandardFontGlyphMap(a, Vi()); - /Arial-?Black/i.test(t) - ? applyStandardFontGlyphMap(a, zi()) - : /Calibri/i.test(t) && applyStandardFontGlyphMap(a, _i()); - if (i) { - for (const e in a) { - const t = a[e]; - void 0 !== i[t] && (a[+e] = i[t]); - } - i.length !== this.toUnicode.length && - e.hasIncludedToUnicodeMap && - this.toUnicode instanceof IdentityToUnicodeMap && - this.toUnicode.forEach(function (e, t) { - const s = a[e]; - void 0 === i[s] && (a[+e] = t); - }); + const cidToGidMap = properties.cidToGidMap; + const map = []; + applyStandardFontGlyphMap(map, getGlyphMapForStandardFonts()); + if (/Arial-?Black/i.test(name)) { + applyStandardFontGlyphMap(map, getSupplementalGlyphMapForArialBlack()); + } else if (/Calibri/i.test(name)) { + applyStandardFontGlyphMap(map, getSupplementalGlyphMapForCalibri()); } - this.toUnicode instanceof IdentityToUnicodeMap || - this.toUnicode.forEach(function (e, t) { - a[+e] = t; - }); - this.toFontChar = a; - this.toUnicode = new ToUnicodeMap(a); - } else if (/Symbol/i.test(a)) - this.toFontChar = buildToFontChar(mi, Ni(), this.differences); - else if (/Dingbats/i.test(a)) - this.toFontChar = buildToFontChar(yi, Gi(), this.differences); - else if (n) { - const e = buildToFontChar(this.defaultEncoding, Ni(), this.differences); - "CIDFontType2" !== i || - this.cidEncoding.startsWith("Identity-") || - this.toUnicode instanceof IdentityToUnicodeMap || - this.toUnicode.forEach(function (t, i) { - e[+t] = i; - }); - this.toFontChar = e; - } else { - const e = Ni(), - i = []; - this.toUnicode.forEach((t, a) => { - if (!this.composite) { - const i = getUnicodeForGlyph( - this.differences[t] || this.defaultEncoding[t], - e, - ); - -1 !== i && (a = i); + if (cidToGidMap) { + for (const charCode in map) { + const cid = map[charCode]; + if (cidToGidMap[cid] !== undefined) { + map[+charCode] = cidToGidMap[cid]; + } } - i[+t] = a; + if ( + cidToGidMap.length !== this.toUnicode.length && + properties.hasIncludedToUnicodeMap && + this.toUnicode instanceof IdentityToUnicodeMap + ) { + this.toUnicode.forEach(function (charCode, unicodeCharCode) { + const cid = map[charCode]; + if (cidToGidMap[cid] === undefined) { + map[+charCode] = unicodeCharCode; + } + }); + } + } + if (!(this.toUnicode instanceof IdentityToUnicodeMap)) { + this.toUnicode.forEach(function (charCode, unicodeCharCode) { + map[+charCode] = unicodeCharCode; + }); + } + this.toFontChar = map; + this.toUnicode = new ToUnicodeMap(map); + } else if (/Symbol/i.test(fontName)) { + this.toFontChar = buildToFontChar( + SymbolSetEncoding, + getGlyphsUnicode(), + this.differences, + ); + } else if (/Dingbats/i.test(fontName)) { + this.toFontChar = buildToFontChar( + ZapfDingbatsEncoding, + getDingbatsGlyphsUnicode(), + this.differences, + ); + } else if (isStandardFont || isMappedToStandardFont) { + const map = buildToFontChar( + this.defaultEncoding, + getGlyphsUnicode(), + this.differences, + ); + if ( + type === "CIDFontType2" && + !this.cidEncoding.startsWith("Identity-") && + !(this.toUnicode instanceof IdentityToUnicodeMap) + ) { + this.toUnicode.forEach(function (charCode, unicodeCharCode) { + map[+charCode] = unicodeCharCode; + }); + } + this.toFontChar = map; + } else { + const glyphsUnicodeMap = getGlyphsUnicode(); + const map = []; + this.toUnicode.forEach((charCode, unicodeCharCode) => { + if (!this.composite) { + const glyphName = + this.differences[charCode] || this.defaultEncoding[charCode]; + const unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); + if (unicode !== -1) { + unicodeCharCode = unicode; + } + } + map[+charCode] = unicodeCharCode; }); - this.composite && - this.toUnicode instanceof IdentityToUnicodeMap && - /Tahoma|Verdana/i.test(t) && - applyStandardFontGlyphMap(i, Vi()); - this.toFontChar = i; + if (this.composite && this.toUnicode instanceof IdentityToUnicodeMap) { + if (/Tahoma|Verdana/i.test(name)) { + applyStandardFontGlyphMap(map, getGlyphMapForStandardFonts()); + } + } + this.toFontChar = map; } - amendFallbackToUnicode(e); - this.loadedName = a.split("-", 1)[0]; + amendFallbackToUnicode(properties); + this.loadedName = fontName.split("-", 1)[0]; } - checkAndRepair(e, t, i) { - const a = [ + checkAndRepair(name, font, properties) { + const VALID_TABLES = [ "OS/2", "cmap", "head", @@ -26012,160 +30336,846 @@ class Font { "cvt ", "CFF ", ]; - function readTables(e, t) { - const i = Object.create(null); - i["OS/2"] = null; - i.cmap = null; - i.head = null; - i.hhea = null; - i.hmtx = null; - i.maxp = null; - i.name = null; - i.post = null; - for (let s = 0; s < t; s++) { - const t = readTableEntry(e); - a.includes(t.tag) && 0 !== t.length && (i[t.tag] = t); + function readTables(file, numTables) { + const tables = Object.create(null); + tables["OS/2"] = null; + tables.cmap = null; + tables.head = null; + tables.hhea = null; + tables.hmtx = null; + tables.maxp = null; + tables.name = null; + tables.post = null; + for (let i = 0; i < numTables; i++) { + const table = readTableEntry(file); + if (!VALID_TABLES.includes(table.tag)) { + continue; + } + if (table.length === 0) { + continue; + } + tables[table.tag] = table; } - return i; + return tables; } - function readTableEntry(e) { - const t = e.getString(4), - i = e.getInt32() >>> 0, - a = e.getInt32() >>> 0, - s = e.getInt32() >>> 0, - r = e.pos; - e.pos = e.start || 0; - e.skip(a); - const n = e.getBytes(s); - e.pos = r; - if ("head" === t) { - n[8] = n[9] = n[10] = n[11] = 0; - n[17] |= 32; + function readTableEntry(file) { + const tag = file.getString(4); + const checksum = file.getInt32() >>> 0; + const offset = file.getInt32() >>> 0; + const length = file.getInt32() >>> 0; + const previousPosition = file.pos; + file.pos = file.start || 0; + file.skip(offset); + const data = file.getBytes(length); + file.pos = previousPosition; + if (tag === "head") { + data[8] = data[9] = data[10] = data[11] = 0; + data[17] |= 0x20; } - return { tag: t, checksum: i, length: s, offset: a, data: n }; - } - function readOpenTypeHeader(e) { return { - version: e.getString(4), - numTables: e.getUint16(), - searchRange: e.getUint16(), - entrySelector: e.getUint16(), - rangeShift: e.getUint16(), + tag, + checksum, + length, + offset, + data, }; } - function sanitizeGlyph(e, t, i, a, s, r) { - const n = { length: 0, sizeOfInstructions: 0 }; - if (t < 0 || t >= e.length || i > e.length || i - t <= 12) return n; - const g = e.subarray(t, i), - o = signedInt16(g[2], g[3]), - c = signedInt16(g[4], g[5]), - C = signedInt16(g[6], g[7]), - h = signedInt16(g[8], g[9]); - if (o > C) { - writeSignedInt16(g, 2, C); - writeSignedInt16(g, 6, o); + function readOpenTypeHeader(ttf) { + return { + version: ttf.getString(4), + numTables: ttf.getUint16(), + searchRange: ttf.getUint16(), + entrySelector: ttf.getUint16(), + rangeShift: ttf.getUint16(), + }; + } + function readTrueTypeCollectionHeader(ttc) { + const ttcTag = ttc.getString(4); + assert(ttcTag === "ttcf", "Must be a TrueType Collection font."); + const majorVersion = ttc.getUint16(); + const minorVersion = ttc.getUint16(); + const numFonts = ttc.getInt32() >>> 0; + const offsetTable = []; + for (let i = 0; i < numFonts; i++) { + offsetTable.push(ttc.getInt32() >>> 0); } - if (c > h) { - writeSignedInt16(g, 4, h); - writeSignedInt16(g, 8, c); + const header = { + ttcTag, + majorVersion, + minorVersion, + numFonts, + offsetTable, + }; + switch (majorVersion) { + case 1: + return header; + case 2: + header.dsigTag = ttc.getInt32() >>> 0; + header.dsigLength = ttc.getInt32() >>> 0; + header.dsigOffset = ttc.getInt32() >>> 0; + return header; } - const l = signedInt16(g[0], g[1]); - if (l < 0) { - if (l < -1) return n; - a.set(g, s); - n.length = g.length; - return n; - } - let Q, - E = 10, - u = 0; - for (Q = 0; Q < l; Q++) { - u = ((g[E] << 8) | g[E + 1]) + 1; - E += 2; - } - const d = E, - f = (g[E] << 8) | g[E + 1]; - n.sizeOfInstructions = f; - E += 2 + f; - const p = E; - let m = 0; - for (Q = 0; Q < u; Q++) { - const e = g[E++]; - 192 & e && (g[E - 1] = 63 & e); - let t = 2; - 2 & e ? (t = 1) : 16 & e && (t = 0); - let i = 2; - 4 & e ? (i = 1) : 32 & e && (i = 0); - const a = t + i; - m += a; - if (8 & e) { - const e = g[E++]; - 0 === e && (g[E - 1] ^= 8); - Q += e; - m += e * a; + throw new FormatError( + `Invalid TrueType Collection majorVersion: ${majorVersion}.`, + ); + } + function readTrueTypeCollectionData(ttc, fontName) { + const { numFonts, offsetTable } = readTrueTypeCollectionHeader(ttc); + const fontNameParts = fontName.split("+"); + let fallbackData; + for (let i = 0; i < numFonts; i++) { + ttc.pos = (ttc.start || 0) + offsetTable[i]; + const potentialHeader = readOpenTypeHeader(ttc); + const potentialTables = readTables(ttc, potentialHeader.numTables); + if (!potentialTables.name) { + throw new FormatError( + 'TrueType Collection font must contain a "name" table.', + ); + } + const [nameTable] = readNameTable(potentialTables.name); + for (let j = 0, jj = nameTable.length; j < jj; j++) { + for (let k = 0, kk = nameTable[j].length; k < kk; k++) { + const nameEntry = nameTable[j][k]?.replaceAll(/\s/g, ""); + if (!nameEntry) { + continue; + } + if (nameEntry === fontName) { + return { + header: potentialHeader, + tables: potentialTables, + }; + } + if (fontNameParts.length < 2) { + continue; + } + for (const part of fontNameParts) { + if (nameEntry === part) { + fallbackData = { + name: part, + header: potentialHeader, + tables: potentialTables, + }; + } + } + } } } - if (0 === m) return n; - let y = E + m; - if (y > g.length) return n; - if (!r && f > 0) { - a.set(g.subarray(0, d), s); - a.set([0, 0], s + d); - a.set(g.subarray(p, y), s + d + 2); - y -= f; - g.length - y > 3 && (y = (y + 3) & -4); - n.length = y; - return n; - } - if (g.length - y > 3) { - y = (y + 3) & -4; - a.set(g.subarray(0, y), s); - n.length = y; - return n; - } - a.set(g, s); - n.length = g.length; - return n; - } - function readNameTable(e) { - const i = (t.start || 0) + e.offset; - t.pos = i; - const a = [[], []], - s = [], - r = e.length, - n = i + r; - if (0 !== t.getUint16() || r < 6) return [a, s]; - const g = t.getUint16(), - o = t.getUint16(); - let c, C; - for (c = 0; c < g && t.pos + 12 <= n; c++) { - const e = { - platform: t.getUint16(), - encoding: t.getUint16(), - language: t.getUint16(), - name: t.getUint16(), - length: t.getUint16(), - offset: t.getUint16(), + if (fallbackData) { + warn( + `TrueType Collection does not contain "${fontName}" font, ` + + `falling back to "${fallbackData.name}" font instead.`, + ); + return { + header: fallbackData.header, + tables: fallbackData.tables, }; - (isMacNameRecord(e) || isWinNameRecord(e)) && s.push(e); } - for (c = 0, C = s.length; c < C; c++) { - const e = s[c]; - if (e.length <= 0) continue; - const r = i + o + e.offset; - if (r + e.length > n) continue; - t.pos = r; - const g = e.name; - if (e.encoding) { - let i = ""; - for (let a = 0, s = e.length; a < s; a += 2) - i += String.fromCharCode(t.getUint16()); - a[1][g] = i; - } else a[0][g] = t.getString(e.length); - } - return [a, s]; + throw new FormatError( + `TrueType Collection does not contain "${fontName}" font.`, + ); } - const s = [ + function readCmapTable(cmap, file, isSymbolicFont, hasEncoding) { + if (!cmap) { + warn("No cmap table available."); + return { + platformId: -1, + encodingId: -1, + mappings: [], + hasShortCmap: false, + }; + } + let segment; + let start = (file.start || 0) + cmap.offset; + file.pos = start; + file.skip(2); + const numTables = file.getUint16(); + let potentialTable; + let canBreak = false; + for (let i = 0; i < numTables; i++) { + const platformId = file.getUint16(); + const encodingId = file.getUint16(); + const offset = file.getInt32() >>> 0; + let useTable = false; + if ( + potentialTable?.platformId === platformId && + potentialTable?.encodingId === encodingId + ) { + continue; + } + if ( + platformId === 0 && + (encodingId === 0 || encodingId === 1 || encodingId === 3) + ) { + useTable = true; + } else if (platformId === 1 && encodingId === 0) { + useTable = true; + } else if ( + platformId === 3 && + encodingId === 1 && + (hasEncoding || !potentialTable) + ) { + useTable = true; + if (!isSymbolicFont) { + canBreak = true; + } + } else if (isSymbolicFont && platformId === 3 && encodingId === 0) { + useTable = true; + let correctlySorted = true; + if (i < numTables - 1) { + const nextBytes = file.peekBytes(2), + nextPlatformId = int16(nextBytes[0], nextBytes[1]); + if (nextPlatformId < platformId) { + correctlySorted = false; + } + } + if (correctlySorted) { + canBreak = true; + } + } + if (useTable) { + potentialTable = { + platformId, + encodingId, + offset, + }; + } + if (canBreak) { + break; + } + } + if (potentialTable) { + file.pos = start + potentialTable.offset; + } + if (!potentialTable || file.peekByte() === -1) { + warn("Could not find a preferred cmap table."); + return { + platformId: -1, + encodingId: -1, + mappings: [], + hasShortCmap: false, + }; + } + const format = file.getUint16(); + let hasShortCmap = false; + const mappings = []; + let j, glyphId; + if (format === 0) { + file.skip(2 + 2); + for (j = 0; j < 256; j++) { + const index = file.getByte(); + if (!index) { + continue; + } + mappings.push({ + charCode: j, + glyphId: index, + }); + } + hasShortCmap = true; + } else if (format === 2) { + file.skip(2 + 2); + const subHeaderKeys = []; + let maxSubHeaderKey = 0; + for (let i = 0; i < 256; i++) { + const subHeaderKey = file.getUint16() >> 3; + subHeaderKeys.push(subHeaderKey); + maxSubHeaderKey = Math.max(subHeaderKey, maxSubHeaderKey); + } + const subHeaders = []; + for (let i = 0; i <= maxSubHeaderKey; i++) { + subHeaders.push({ + firstCode: file.getUint16(), + entryCount: file.getUint16(), + idDelta: signedInt16(file.getByte(), file.getByte()), + idRangePos: file.pos + file.getUint16(), + }); + } + for (let i = 0; i < 256; i++) { + if (subHeaderKeys[i] === 0) { + file.pos = subHeaders[0].idRangePos + 2 * i; + glyphId = file.getUint16(); + mappings.push({ + charCode: i, + glyphId, + }); + } else { + const s = subHeaders[subHeaderKeys[i]]; + for (j = 0; j < s.entryCount; j++) { + const charCode = (i << 8) + j + s.firstCode; + file.pos = s.idRangePos + 2 * j; + glyphId = file.getUint16(); + if (glyphId !== 0) { + glyphId = (glyphId + s.idDelta) % 65536; + } + mappings.push({ + charCode, + glyphId, + }); + } + } + } + } else if (format === 4) { + file.skip(2 + 2); + const segCount = file.getUint16() >> 1; + file.skip(6); + const segments = []; + let segIndex; + for (segIndex = 0; segIndex < segCount; segIndex++) { + segments.push({ + end: file.getUint16(), + }); + } + file.skip(2); + for (segIndex = 0; segIndex < segCount; segIndex++) { + segments[segIndex].start = file.getUint16(); + } + for (segIndex = 0; segIndex < segCount; segIndex++) { + segments[segIndex].delta = file.getUint16(); + } + let offsetsCount = 0, + offsetIndex; + for (segIndex = 0; segIndex < segCount; segIndex++) { + segment = segments[segIndex]; + const rangeOffset = file.getUint16(); + if (!rangeOffset) { + segment.offsetIndex = -1; + continue; + } + offsetIndex = (rangeOffset >> 1) - (segCount - segIndex); + segment.offsetIndex = offsetIndex; + offsetsCount = Math.max( + offsetsCount, + offsetIndex + segment.end - segment.start + 1, + ); + } + const offsets = []; + for (j = 0; j < offsetsCount; j++) { + offsets.push(file.getUint16()); + } + for (segIndex = 0; segIndex < segCount; segIndex++) { + segment = segments[segIndex]; + start = segment.start; + const end = segment.end; + const delta = segment.delta; + offsetIndex = segment.offsetIndex; + for (j = start; j <= end; j++) { + if (j === 0xffff) { + continue; + } + glyphId = offsetIndex < 0 ? j : offsets[offsetIndex + j - start]; + glyphId = (glyphId + delta) & 0xffff; + mappings.push({ + charCode: j, + glyphId, + }); + } + } + } else if (format === 6) { + file.skip(2 + 2); + const firstCode = file.getUint16(); + const entryCount = file.getUint16(); + for (j = 0; j < entryCount; j++) { + glyphId = file.getUint16(); + const charCode = firstCode + j; + mappings.push({ + charCode, + glyphId, + }); + } + } else if (format === 12) { + file.skip(2 + 4 + 4); + const nGroups = file.getInt32() >>> 0; + for (j = 0; j < nGroups; j++) { + const startCharCode = file.getInt32() >>> 0; + const endCharCode = file.getInt32() >>> 0; + let glyphCode = file.getInt32() >>> 0; + for ( + let charCode = startCharCode; + charCode <= endCharCode; + charCode++ + ) { + mappings.push({ + charCode, + glyphId: glyphCode++, + }); + } + } + } else { + warn("cmap table has unsupported format: " + format); + return { + platformId: -1, + encodingId: -1, + mappings: [], + hasShortCmap: false, + }; + } + mappings.sort(function (a, b) { + return a.charCode - b.charCode; + }); + for (let i = 1; i < mappings.length; i++) { + if (mappings[i - 1].charCode === mappings[i].charCode) { + mappings.splice(i, 1); + i--; + } + } + return { + platformId: potentialTable.platformId, + encodingId: potentialTable.encodingId, + mappings, + hasShortCmap, + }; + } + function sanitizeMetrics( + file, + header, + metrics, + headTable, + numGlyphs, + dupFirstEntry, + ) { + if (!header) { + if (metrics) { + metrics.data = null; + } + return; + } + file.pos = (file.start || 0) + header.offset; + file.pos += 4; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + const caretOffset = file.getUint16(); + file.pos += 8; + file.pos += 2; + let numOfMetrics = file.getUint16(); + if (caretOffset !== 0) { + const macStyle = int16(headTable.data[44], headTable.data[45]); + if (!(macStyle & 2)) { + header.data[22] = 0; + header.data[23] = 0; + } + } + if (numOfMetrics > numGlyphs) { + info( + `The numOfMetrics (${numOfMetrics}) should not be ` + + `greater than the numGlyphs (${numGlyphs}).`, + ); + numOfMetrics = numGlyphs; + header.data[34] = (numOfMetrics & 0xff00) >> 8; + header.data[35] = numOfMetrics & 0x00ff; + } + const numOfSidebearings = numGlyphs - numOfMetrics; + const numMissing = + numOfSidebearings - ((metrics.length - numOfMetrics * 4) >> 1); + if (numMissing > 0) { + const entries = new Uint8Array(metrics.length + numMissing * 2); + entries.set(metrics.data); + if (dupFirstEntry) { + entries[metrics.length] = metrics.data[2]; + entries[metrics.length + 1] = metrics.data[3]; + } + metrics.data = entries; + } + } + function sanitizeGlyph( + source, + sourceStart, + sourceEnd, + dest, + destStart, + hintsValid, + ) { + const glyphProfile = { + length: 0, + sizeOfInstructions: 0, + }; + if ( + sourceStart < 0 || + sourceStart >= source.length || + sourceEnd > source.length || + sourceEnd - sourceStart <= 12 + ) { + return glyphProfile; + } + const glyf = source.subarray(sourceStart, sourceEnd); + const xMin = signedInt16(glyf[2], glyf[3]); + const yMin = signedInt16(glyf[4], glyf[5]); + const xMax = signedInt16(glyf[6], glyf[7]); + const yMax = signedInt16(glyf[8], glyf[9]); + if (xMin > xMax) { + writeSignedInt16(glyf, 2, xMax); + writeSignedInt16(glyf, 6, xMin); + } + if (yMin > yMax) { + writeSignedInt16(glyf, 4, yMax); + writeSignedInt16(glyf, 8, yMin); + } + const contoursCount = signedInt16(glyf[0], glyf[1]); + if (contoursCount < 0) { + if (contoursCount < -1) { + return glyphProfile; + } + dest.set(glyf, destStart); + glyphProfile.length = glyf.length; + return glyphProfile; + } + let i, + j = 10, + flagsCount = 0; + for (i = 0; i < contoursCount; i++) { + const endPoint = (glyf[j] << 8) | glyf[j + 1]; + flagsCount = endPoint + 1; + j += 2; + } + const instructionsStart = j; + const instructionsLength = (glyf[j] << 8) | glyf[j + 1]; + glyphProfile.sizeOfInstructions = instructionsLength; + j += 2 + instructionsLength; + const instructionsEnd = j; + let coordinatesLength = 0; + for (i = 0; i < flagsCount; i++) { + const flag = glyf[j++]; + if (flag & 0xc0) { + glyf[j - 1] = flag & 0x3f; + } + let xLength = 2; + if (flag & 2) { + xLength = 1; + } else if (flag & 16) { + xLength = 0; + } + let yLength = 2; + if (flag & 4) { + yLength = 1; + } else if (flag & 32) { + yLength = 0; + } + const xyLength = xLength + yLength; + coordinatesLength += xyLength; + if (flag & 8) { + const repeat = glyf[j++]; + if (repeat === 0) { + glyf[j - 1] ^= 8; + } + i += repeat; + coordinatesLength += repeat * xyLength; + } + } + if (coordinatesLength === 0) { + return glyphProfile; + } + let glyphDataLength = j + coordinatesLength; + if (glyphDataLength > glyf.length) { + return glyphProfile; + } + if (!hintsValid && instructionsLength > 0) { + dest.set(glyf.subarray(0, instructionsStart), destStart); + dest.set([0, 0], destStart + instructionsStart); + dest.set( + glyf.subarray(instructionsEnd, glyphDataLength), + destStart + instructionsStart + 2, + ); + glyphDataLength -= instructionsLength; + if (glyf.length - glyphDataLength > 3) { + glyphDataLength = (glyphDataLength + 3) & ~3; + } + glyphProfile.length = glyphDataLength; + return glyphProfile; + } + if (glyf.length - glyphDataLength > 3) { + glyphDataLength = (glyphDataLength + 3) & ~3; + dest.set(glyf.subarray(0, glyphDataLength), destStart); + glyphProfile.length = glyphDataLength; + return glyphProfile; + } + dest.set(glyf, destStart); + glyphProfile.length = glyf.length; + return glyphProfile; + } + function sanitizeHead(head, numGlyphs, locaLength) { + const data = head.data; + const version = int32(data[0], data[1], data[2], data[3]); + if (version >> 16 !== 1) { + info("Attempting to fix invalid version in head table: " + version); + data[0] = 0; + data[1] = 1; + data[2] = 0; + data[3] = 0; + } + const indexToLocFormat = int16(data[50], data[51]); + if (indexToLocFormat < 0 || indexToLocFormat > 1) { + info( + "Attempting to fix invalid indexToLocFormat in head table: " + + indexToLocFormat, + ); + const numGlyphsPlusOne = numGlyphs + 1; + if (locaLength === numGlyphsPlusOne << 1) { + data[50] = 0; + data[51] = 0; + } else if (locaLength === numGlyphsPlusOne << 2) { + data[50] = 0; + data[51] = 1; + } else { + throw new FormatError( + "Could not fix indexToLocFormat: " + indexToLocFormat, + ); + } + } + } + function sanitizeGlyphLocations( + loca, + glyf, + numGlyphs, + isGlyphLocationsLong, + hintsValid, + dupFirstEntry, + maxSizeOfInstructions, + ) { + let itemSize, itemDecode, itemEncode; + if (isGlyphLocationsLong) { + itemSize = 4; + itemDecode = function fontItemDecodeLong(data, offset) { + return ( + (data[offset] << 24) | + (data[offset + 1] << 16) | + (data[offset + 2] << 8) | + data[offset + 3] + ); + }; + itemEncode = function fontItemEncodeLong(data, offset, value) { + data[offset] = (value >>> 24) & 0xff; + data[offset + 1] = (value >> 16) & 0xff; + data[offset + 2] = (value >> 8) & 0xff; + data[offset + 3] = value & 0xff; + }; + } else { + itemSize = 2; + itemDecode = function fontItemDecode(data, offset) { + return (data[offset] << 9) | (data[offset + 1] << 1); + }; + itemEncode = function fontItemEncode(data, offset, value) { + data[offset] = (value >> 9) & 0xff; + data[offset + 1] = (value >> 1) & 0xff; + }; + } + const numGlyphsOut = dupFirstEntry ? numGlyphs + 1 : numGlyphs; + const locaDataSize = itemSize * (1 + numGlyphsOut); + const locaData = new Uint8Array(locaDataSize); + locaData.set(loca.data.subarray(0, locaDataSize)); + loca.data = locaData; + const oldGlyfData = glyf.data; + const oldGlyfDataLength = oldGlyfData.length; + const newGlyfData = new Uint8Array(oldGlyfDataLength); + let i, j; + const locaEntries = []; + for (i = 0, j = 0; i < numGlyphs + 1; i++, j += itemSize) { + let offset = itemDecode(locaData, j); + if (offset > oldGlyfDataLength) { + offset = oldGlyfDataLength; + } + locaEntries.push({ + index: i, + offset, + endOffset: 0, + }); + } + locaEntries.sort((a, b) => a.offset - b.offset); + for (i = 0; i < numGlyphs; i++) { + locaEntries[i].endOffset = locaEntries[i + 1].offset; + } + locaEntries.sort((a, b) => a.index - b.index); + for (i = 0; i < numGlyphs; i++) { + const { offset, endOffset } = locaEntries[i]; + if (offset !== 0 || endOffset !== 0) { + break; + } + const nextOffset = locaEntries[i + 1].offset; + if (nextOffset === 0) { + continue; + } + locaEntries[i].endOffset = nextOffset; + break; + } + const last = locaEntries.at(-2); + if (last.offset !== 0 && last.endOffset === 0) { + last.endOffset = oldGlyfDataLength; + } + const missingGlyphs = Object.create(null); + let writeOffset = 0; + itemEncode(locaData, 0, writeOffset); + for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { + const glyphProfile = sanitizeGlyph( + oldGlyfData, + locaEntries[i].offset, + locaEntries[i].endOffset, + newGlyfData, + writeOffset, + hintsValid, + ); + const newLength = glyphProfile.length; + if (newLength === 0) { + missingGlyphs[i] = true; + } + if (glyphProfile.sizeOfInstructions > maxSizeOfInstructions) { + maxSizeOfInstructions = glyphProfile.sizeOfInstructions; + } + writeOffset += newLength; + itemEncode(locaData, j, writeOffset); + } + if (writeOffset === 0) { + const simpleGlyph = new Uint8Array([ + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, + ]); + for (i = 0, j = itemSize; i < numGlyphsOut; i++, j += itemSize) { + itemEncode(locaData, j, simpleGlyph.length); + } + glyf.data = simpleGlyph; + } else if (dupFirstEntry) { + const firstEntryLength = itemDecode(locaData, itemSize); + if (newGlyfData.length > firstEntryLength + writeOffset) { + glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset); + } else { + glyf.data = new Uint8Array(firstEntryLength + writeOffset); + glyf.data.set(newGlyfData.subarray(0, writeOffset)); + } + glyf.data.set(newGlyfData.subarray(0, firstEntryLength), writeOffset); + itemEncode( + loca.data, + locaData.length - itemSize, + writeOffset + firstEntryLength, + ); + } else { + glyf.data = newGlyfData.subarray(0, writeOffset); + } + return { + missingGlyphs, + maxSizeOfInstructions, + }; + } + function readPostScriptTable(post, propertiesObj, maxpNumGlyphs) { + const start = (font.start || 0) + post.offset; + font.pos = start; + const length = post.length, + end = start + length; + const version = font.getInt32(); + font.skip(28); + let glyphNames; + let valid = true; + let i; + switch (version) { + case 0x00010000: + glyphNames = MacStandardGlyphOrdering; + break; + case 0x00020000: + const numGlyphs = font.getUint16(); + if (numGlyphs !== maxpNumGlyphs) { + valid = false; + break; + } + const glyphNameIndexes = []; + for (i = 0; i < numGlyphs; ++i) { + const index = font.getUint16(); + if (index >= 32768) { + valid = false; + break; + } + glyphNameIndexes.push(index); + } + if (!valid) { + break; + } + const customNames = [], + strBuf = []; + while (font.pos < end) { + const stringLength = font.getByte(); + strBuf.length = stringLength; + for (i = 0; i < stringLength; ++i) { + strBuf[i] = String.fromCharCode(font.getByte()); + } + customNames.push(strBuf.join("")); + } + glyphNames = []; + for (i = 0; i < numGlyphs; ++i) { + const j = glyphNameIndexes[i]; + if (j < 258) { + glyphNames.push(MacStandardGlyphOrdering[j]); + continue; + } + glyphNames.push(customNames[j - 258]); + } + break; + case 0x00030000: + break; + default: + warn("Unknown/unsupported post table version " + version); + valid = false; + if (propertiesObj.defaultEncoding) { + glyphNames = propertiesObj.defaultEncoding; + } + break; + } + propertiesObj.glyphNames = glyphNames; + return valid; + } + function readNameTable(nameTable) { + const start = (font.start || 0) + nameTable.offset; + font.pos = start; + const names = [[], []], + records = []; + const length = nameTable.length, + end = start + length; + const format = font.getUint16(); + const FORMAT_0_HEADER_LENGTH = 6; + if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) { + return [names, records]; + } + const numRecords = font.getUint16(); + const stringsStart = font.getUint16(); + const NAME_RECORD_LENGTH = 12; + let i, ii; + for (i = 0; i < numRecords && font.pos + NAME_RECORD_LENGTH <= end; i++) { + const r = { + platform: font.getUint16(), + encoding: font.getUint16(), + language: font.getUint16(), + name: font.getUint16(), + length: font.getUint16(), + offset: font.getUint16(), + }; + if (isMacNameRecord(r) || isWinNameRecord(r)) { + records.push(r); + } + } + for (i = 0, ii = records.length; i < ii; i++) { + const record = records[i]; + if (record.length <= 0) { + continue; + } + const pos = start + stringsStart + record.offset; + if (pos + record.length > end) { + continue; + } + font.pos = pos; + const nameIndex = record.name; + if (record.encoding) { + let str = ""; + for (let j = 0, jj = record.length; j < jj; j += 2) { + str += String.fromCharCode(font.getUint16()); + } + names[1][nameIndex] = str; + } else { + names[0][nameIndex] = font.getString(record.length); + } + } + return [names, records]; + } + const TTOpsStackDeltas = [ 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, @@ -26175,1413 +31185,1263 @@ class Font { -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2, ]; - function sanitizeTTProgram(e, t) { - let i, - a, - r, + function sanitizeTTProgram(table, ttContext) { + let data = table.data; + let i = 0, + j, n, - g, - o = e.data, - c = 0, - C = 0, - h = 0; - const l = [], - Q = [], - E = []; - let u = t.tooComplexToFollowFunctions, - d = !1, - f = 0, - p = 0; - for (let e = o.length; c < e; ) { - const e = o[c++]; - if (64 === e) { - a = o[c++]; - if (d || p) c += a; - else for (i = 0; i < a; i++) l.push(o[c++]); - } else if (65 === e) { - a = o[c++]; - if (d || p) c += 2 * a; - else - for (i = 0; i < a; i++) { - r = o[c++]; - l.push((r << 8) | o[c++]); + b, + funcId, + pc, + lastEndf = 0, + lastDeff = 0; + const stack = []; + const callstack = []; + const functionsCalled = []; + let tooComplexToFollowFunctions = ttContext.tooComplexToFollowFunctions; + let inFDEF = false, + ifLevel = 0, + inELSE = 0; + for (let ii = data.length; i < ii; ) { + const op = data[i++]; + if (op === 0x40) { + n = data[i++]; + if (inFDEF || inELSE) { + i += n; + } else { + for (j = 0; j < n; j++) { + stack.push(data[i++]); } - } else if (176 == (248 & e)) { - a = e - 176 + 1; - if (d || p) c += a; - else for (i = 0; i < a; i++) l.push(o[c++]); - } else if (184 == (248 & e)) { - a = e - 184 + 1; - if (d || p) c += 2 * a; - else - for (i = 0; i < a; i++) { - r = o[c++]; - l.push((r << 8) | o[c++]); + } + } else if (op === 0x41) { + n = data[i++]; + if (inFDEF || inELSE) { + i += n * 2; + } else { + for (j = 0; j < n; j++) { + b = data[i++]; + stack.push((b << 8) | data[i++]); } - } else if (43 !== e || u) - if (44 !== e || u) { - if (45 === e) - if (d) { - d = !1; - C = c; - } else { - g = Q.pop(); - if (!g) { - warn("TT: ENDF bad stack"); - t.hintsValid = !1; + } + } else if ((op & 0xf8) === 0xb0) { + n = op - 0xb0 + 1; + if (inFDEF || inELSE) { + i += n; + } else { + for (j = 0; j < n; j++) { + stack.push(data[i++]); + } + } + } else if ((op & 0xf8) === 0xb8) { + n = op - 0xb8 + 1; + if (inFDEF || inELSE) { + i += n * 2; + } else { + for (j = 0; j < n; j++) { + b = data[i++]; + stack.push(signedInt16(b, data[i++])); + } + } + } else if (op === 0x2b && !tooComplexToFollowFunctions) { + if (!inFDEF && !inELSE) { + funcId = stack.at(-1); + if (isNaN(funcId)) { + info("TT: CALL empty stack (or invalid entry)."); + } else { + ttContext.functionsUsed[funcId] = true; + if (funcId in ttContext.functionsStackDeltas) { + const newStackLength = + stack.length + ttContext.functionsStackDeltas[funcId]; + if (newStackLength < 0) { + warn("TT: CALL invalid functions stack delta."); + ttContext.hintsValid = false; return; } - n = E.pop(); - o = g.data; - c = g.i; - t.functionsStackDeltas[n] = l.length - g.stackTop; + stack.length = newStackLength; + } else if ( + funcId in ttContext.functionsDefined && + !functionsCalled.includes(funcId) + ) { + callstack.push({ + data, + i, + stackTop: stack.length - 1, + }); + functionsCalled.push(funcId); + pc = ttContext.functionsDefined[funcId]; + if (!pc) { + warn("TT: CALL non-existent function"); + ttContext.hintsValid = false; + return; + } + data = pc.data; + i = pc.i; } - else if (137 === e) { - if (d || p) { - warn("TT: nested IDEFs not allowed"); - u = !0; - } - d = !0; - h = c; - } else if (88 === e) ++f; - else if (27 === e) p = f; - else if (89 === e) { - p === f && (p = 0); - --f; - } else if (28 === e && !d && !p) { - const e = l.at(-1); - e > 0 && (c += e - 1); } + } + } else if (op === 0x2c && !tooComplexToFollowFunctions) { + if (inFDEF || inELSE) { + warn("TT: nested FDEFs not allowed"); + tooComplexToFollowFunctions = true; + } + inFDEF = true; + lastDeff = i; + funcId = stack.pop(); + ttContext.functionsDefined[funcId] = { + data, + i, + }; + } else if (op === 0x2d) { + if (inFDEF) { + inFDEF = false; + lastEndf = i; } else { - if (d || p) { - warn("TT: nested FDEFs not allowed"); - u = !0; + pc = callstack.pop(); + if (!pc) { + warn("TT: ENDF bad stack"); + ttContext.hintsValid = false; + return; } - d = !0; - h = c; - n = l.pop(); - t.functionsDefined[n] = { data: o, i: c }; + funcId = functionsCalled.pop(); + data = pc.data; + i = pc.i; + ttContext.functionsStackDeltas[funcId] = stack.length - pc.stackTop; } - else if (!d && !p) { - n = l.at(-1); - if (isNaN(n)) info("TT: CALL empty stack (or invalid entry)."); - else { - t.functionsUsed[n] = !0; - if (n in t.functionsStackDeltas) { - const e = l.length + t.functionsStackDeltas[n]; - if (e < 0) { - warn("TT: CALL invalid functions stack delta."); - t.hintsValid = !1; - return; - } - l.length = e; - } else if (n in t.functionsDefined && !E.includes(n)) { - Q.push({ data: o, i: c, stackTop: l.length - 1 }); - E.push(n); - g = t.functionsDefined[n]; - if (!g) { - warn("TT: CALL non-existent function"); - t.hintsValid = !1; - return; - } - o = g.data; - c = g.i; + } else if (op === 0x89) { + if (inFDEF || inELSE) { + warn("TT: nested IDEFs not allowed"); + tooComplexToFollowFunctions = true; + } + inFDEF = true; + lastDeff = i; + } else if (op === 0x58) { + ++ifLevel; + } else if (op === 0x1b) { + inELSE = ifLevel; + } else if (op === 0x59) { + if (inELSE === ifLevel) { + inELSE = 0; + } + --ifLevel; + } else if (op === 0x1c) { + if (!inFDEF && !inELSE) { + const offset = stack.at(-1); + if (offset > 0) { + i += offset - 1; } } } - if (!d && !p) { - let t = 0; - e <= 142 - ? (t = s[e]) - : e >= 192 && e <= 223 - ? (t = -1) - : e >= 224 && (t = -2); - if (e >= 113 && e <= 117) { - a = l.pop(); - isNaN(a) || (t = 2 * -a); + if (!inFDEF && !inELSE) { + let stackDelta = 0; + if (op <= 0x8e) { + stackDelta = TTOpsStackDeltas[op]; + } else if (op >= 0xc0 && op <= 0xdf) { + stackDelta = -1; + } else if (op >= 0xe0) { + stackDelta = -2; } - for (; t < 0 && l.length > 0; ) { - l.pop(); - t++; + if (op >= 0x71 && op <= 0x75) { + n = stack.pop(); + if (!isNaN(n)) { + stackDelta = -n * 2; + } } - for (; t > 0; ) { - l.push(NaN); - t--; + while (stackDelta < 0 && stack.length > 0) { + stack.pop(); + stackDelta++; + } + while (stackDelta > 0) { + stack.push(NaN); + stackDelta--; } } } - t.tooComplexToFollowFunctions = u; - const m = [o]; - c > o.length && m.push(new Uint8Array(c - o.length)); - if (h > C) { + ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions; + const content = [data]; + if (i > data.length) { + content.push(new Uint8Array(i - data.length)); + } + if (lastDeff > lastEndf) { warn("TT: complementing a missing function tail"); - m.push(new Uint8Array([34, 45])); + content.push(new Uint8Array([0x22, 0x2d])); } - !(function foldTTTable(e, t) { - if (t.length > 1) { - let i, - a, - s = 0; - for (i = 0, a = t.length; i < a; i++) s += t[i].length; - s = (s + 3) & -4; - const r = new Uint8Array(s); - let n = 0; - for (i = 0, a = t.length; i < a; i++) { - r.set(t[i], n); - n += t[i].length; - } - e.data = r; - e.length = s; + foldTTTable(table, content); + } + function checkInvalidFunctions(ttContext, maxFunctionDefs) { + if (ttContext.tooComplexToFollowFunctions) { + return; + } + if (ttContext.functionsDefined.length > maxFunctionDefs) { + warn("TT: more functions defined than expected"); + ttContext.hintsValid = false; + return; + } + for (let j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { + if (j > maxFunctionDefs) { + warn("TT: invalid function id: " + j); + ttContext.hintsValid = false; + return; } - })(e, m); - } - let r, n, g, o; - if ( - isTrueTypeCollectionFile((t = new Stream(new Uint8Array(t.getBytes())))) - ) { - const e = (function readTrueTypeCollectionData(e, t) { - const { numFonts: i, offsetTable: a } = - (function readTrueTypeCollectionHeader(e) { - const t = e.getString(4); - assert("ttcf" === t, "Must be a TrueType Collection font."); - const i = e.getUint16(), - a = e.getUint16(), - s = e.getInt32() >>> 0, - r = []; - for (let t = 0; t < s; t++) r.push(e.getInt32() >>> 0); - const n = { - ttcTag: t, - majorVersion: i, - minorVersion: a, - numFonts: s, - offsetTable: r, - }; - switch (i) { - case 1: - return n; - case 2: - n.dsigTag = e.getInt32() >>> 0; - n.dsigLength = e.getInt32() >>> 0; - n.dsigOffset = e.getInt32() >>> 0; - return n; - } - throw new FormatError( - `Invalid TrueType Collection majorVersion: ${i}.`, - ); - })(e), - s = t.split("+"); - let r; - for (let n = 0; n < i; n++) { - e.pos = (e.start || 0) + a[n]; - const i = readOpenTypeHeader(e), - g = readTables(e, i.numTables); - if (!g.name) - throw new FormatError( - 'TrueType Collection font must contain a "name" table.', - ); - const [o] = readNameTable(g.name); - for (let e = 0, a = o.length; e < a; e++) - for (let a = 0, n = o[e].length; a < n; a++) { - const n = o[e][a]?.replaceAll(/\s/g, ""); - if (n) { - if (n === t) return { header: i, tables: g }; - if (!(s.length < 2)) - for (const e of s) - n === e && (r = { name: e, header: i, tables: g }); - } - } + if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) { + warn("TT: undefined function: " + j); + ttContext.hintsValid = false; + return; } - if (r) { - warn( - `TrueType Collection does not contain "${t}" font, falling back to "${r.name}" font instead.`, - ); - return { header: r.header, tables: r.tables }; + } + } + function foldTTTable(table, content) { + if (content.length > 1) { + let newLength = 0; + let j, jj; + for (j = 0, jj = content.length; j < jj; j++) { + newLength += content[j].length; } - throw new FormatError( - `TrueType Collection does not contain "${t}" font.`, - ); - })(t, this.name); - r = e.header; - n = e.tables; - } else { - r = readOpenTypeHeader(t); - n = readTables(t, r.numTables); - } - const c = !n["CFF "]; - if (c) { - if (!n.loca) throw new FormatError('Required "loca" table is not found'); - if (!n.glyf) { - warn('Required "glyf" table is not found -- trying to recover.'); - n.glyf = { tag: "glyf", data: new Uint8Array(0) }; - } - this.isOpenType = !1; - } else { - const t = - i.composite && - (i.cidToGidMap?.length > 0 || !(i.cMap instanceof IdentityCMap)); - if ( - ("OTTO" === r.version && !t) || - !n.head || - !n.hhea || - !n.maxp || - !n.post - ) { - o = new Stream(n["CFF "].data); - g = new CFFFont(o, i); - adjustWidths(i); - return this.convert(e, g, i); - } - delete n.glyf; - delete n.loca; - delete n.fpgm; - delete n.prep; - delete n["cvt "]; - this.isOpenType = !0; - } - if (!n.maxp) throw new FormatError('Required "maxp" table is not found'); - t.pos = (t.start || 0) + n.maxp.offset; - let C = t.getInt32(); - const h = t.getUint16(); - if (65536 !== C && 20480 !== C) { - if (6 === n.maxp.length) C = 20480; - else { - if (!(n.maxp.length >= 32)) - throw new FormatError('"maxp" table has a wrong version number'); - C = 65536; - } - !(function writeUint32(e, t, i) { - e[t + 3] = 255 & i; - e[t + 2] = i >>> 8; - e[t + 1] = i >>> 16; - e[t] = i >>> 24; - })(n.maxp.data, 0, C); - } - if (i.scaleFactors?.length === h && c) { - const { scaleFactors: e } = i, - t = int16(n.head.data[50], n.head.data[51]), - a = new GlyfTable({ - glyfTable: n.glyf.data, - isGlyphLocationsLong: t, - locaTable: n.loca.data, - numGlyphs: h, - }); - a.scale(e); - const { glyf: s, loca: r, isLocationLong: g } = a.write(); - n.glyf.data = s; - n.loca.data = r; - if (g !== !!t) { - n.head.data[50] = 0; - n.head.data[51] = g ? 1 : 0; - } - const o = n.hmtx.data; - for (let t = 0; t < h; t++) { - const i = 4 * t, - a = Math.round(e[t] * int16(o[i], o[i + 1])); - o[i] = (a >> 8) & 255; - o[i + 1] = 255 & a; - writeSignedInt16( - o, - i + 2, - Math.round(e[t] * signedInt16(o[i + 2], o[i + 3])), - ); + newLength = (newLength + 3) & ~3; + const result = new Uint8Array(newLength); + let pos = 0; + for (j = 0, jj = content.length; j < jj; j++) { + result.set(content[j], pos); + pos += content[j].length; + } + table.data = result; + table.length = newLength; } } - let l = h + 1, - Q = !0; - if (l > 65535) { - Q = !1; - l = h; - warn("Not enough space in glyfs to duplicate first glyph."); - } - let E = 0, - u = 0; - if (C >= 65536 && n.maxp.length >= 32) { - t.pos += 8; - if (t.getUint16() > 2) { - n.maxp.data[14] = 0; - n.maxp.data[15] = 2; - } - t.pos += 4; - E = t.getUint16(); - t.pos += 4; - u = t.getUint16(); - } - n.maxp.data[4] = l >> 8; - n.maxp.data[5] = 255 & l; - const d = (function sanitizeTTPrograms(e, t, i, a) { - const s = { + function sanitizeTTPrograms(fpgm, prep, cvt, maxFunctionDefs) { + const ttContext = { functionsDefined: [], functionsUsed: [], functionsStackDeltas: [], - tooComplexToFollowFunctions: !1, - hintsValid: !0, + tooComplexToFollowFunctions: false, + hintsValid: true, }; - e && sanitizeTTProgram(e, s); - t && sanitizeTTProgram(t, s); - e && - (function checkInvalidFunctions(e, t) { - if (!e.tooComplexToFollowFunctions) - if (e.functionsDefined.length > t) { - warn("TT: more functions defined than expected"); - e.hintsValid = !1; - } else - for (let i = 0, a = e.functionsUsed.length; i < a; i++) { - if (i > t) { - warn("TT: invalid function id: " + i); - e.hintsValid = !1; - return; - } - if (e.functionsUsed[i] && !e.functionsDefined[i]) { - warn("TT: undefined function: " + i); - e.hintsValid = !1; - return; - } - } - })(s, a); - if (i && 1 & i.length) { - const e = new Uint8Array(i.length + 1); - e.set(i.data); - i.data = e; + if (fpgm) { + sanitizeTTProgram(fpgm, ttContext); } - return s.hintsValid; - })(n.fpgm, n.prep, n["cvt "], E); - if (!d) { - delete n.fpgm; - delete n.prep; - delete n["cvt "]; + if (prep) { + sanitizeTTProgram(prep, ttContext); + } + if (fpgm) { + checkInvalidFunctions(ttContext, maxFunctionDefs); + } + if (cvt && cvt.length & 1) { + const cvtData = new Uint8Array(cvt.length + 1); + cvtData.set(cvt.data); + cvt.data = cvtData; + } + return ttContext.hintsValid; } - !(function sanitizeMetrics(e, t, i, a, s, r) { - if (!t) { - i && (i.data = null); - return; + font = new Stream(new Uint8Array(font.getBytes())); + let header, tables; + if (isTrueTypeCollectionFile(font)) { + const ttcData = readTrueTypeCollectionData(font, this.name); + header = ttcData.header; + tables = ttcData.tables; + } else { + header = readOpenTypeHeader(font); + tables = readTables(font, header.numTables); + } + let cff, cffFile; + const isTrueType = !tables["CFF "]; + if (!isTrueType) { + const isComposite = + properties.composite && + (properties.cidToGidMap?.length > 0 || + !(properties.cMap instanceof IdentityCMap)); + if ( + (header.version === "OTTO" && !isComposite) || + !tables.head || + !tables.hhea || + !tables.maxp || + !tables.post + ) { + cffFile = new Stream(tables["CFF "].data); + cff = new CFFFont(cffFile, properties); + adjustWidths(properties); + return this.convert(name, cff, properties); } - e.pos = (e.start || 0) + t.offset; - e.pos += 4; - e.pos += 2; - e.pos += 2; - e.pos += 2; - e.pos += 2; - e.pos += 2; - e.pos += 2; - e.pos += 2; - e.pos += 2; - e.pos += 2; - const n = e.getUint16(); - e.pos += 8; - e.pos += 2; - let g = e.getUint16(); - if (0 !== n) { - if (!(2 & int16(a.data[44], a.data[45]))) { - t.data[22] = 0; - t.data[23] = 0; - } + delete tables.glyf; + delete tables.loca; + delete tables.fpgm; + delete tables.prep; + delete tables["cvt "]; + this.isOpenType = true; + } else { + if (!tables.loca) { + throw new FormatError('Required "loca" table is not found'); } - if (g > s) { - info( - `The numOfMetrics (${g}) should not be greater than the numGlyphs (${s}).`, + if (!tables.glyf) { + warn('Required "glyf" table is not found -- trying to recover.'); + tables.glyf = { + tag: "glyf", + data: new Uint8Array(0), + }; + } + this.isOpenType = false; + } + if (!tables.maxp) { + throw new FormatError('Required "maxp" table is not found'); + } + font.pos = (font.start || 0) + tables.maxp.offset; + let version = font.getInt32(); + const numGlyphs = font.getUint16(); + if (version !== 0x00010000 && version !== 0x00005000) { + if (tables.maxp.length === 6) { + version = 0x0005000; + } else if (tables.maxp.length >= 32) { + version = 0x00010000; + } else { + throw new FormatError(`"maxp" table has a wrong version number`); + } + writeUint32(tables.maxp.data, 0, version); + } + if (properties.scaleFactors?.length === numGlyphs && isTrueType) { + const { scaleFactors } = properties; + const isGlyphLocationsLong = int16( + tables.head.data[50], + tables.head.data[51], + ); + const glyphs = new GlyfTable({ + glyfTable: tables.glyf.data, + isGlyphLocationsLong, + locaTable: tables.loca.data, + numGlyphs, + }); + glyphs.scale(scaleFactors); + const { glyf, loca, isLocationLong } = glyphs.write(); + tables.glyf.data = glyf; + tables.loca.data = loca; + if (isLocationLong !== !!isGlyphLocationsLong) { + tables.head.data[50] = 0; + tables.head.data[51] = isLocationLong ? 1 : 0; + } + const metrics = tables.hmtx.data; + for (let i = 0; i < numGlyphs; i++) { + const j = 4 * i; + const advanceWidth = Math.round( + scaleFactors[i] * int16(metrics[j], metrics[j + 1]), ); - g = s; - t.data[34] = (65280 & g) >> 8; - t.data[35] = 255 & g; - } - const o = s - g - ((i.length - 4 * g) >> 1); - if (o > 0) { - const e = new Uint8Array(i.length + 2 * o); - e.set(i.data); - if (r) { - e[i.length] = i.data[2]; - e[i.length + 1] = i.data[3]; - } - i.data = e; - } - })(t, n.hhea, n.hmtx, n.head, l, Q); - if (!n.head) throw new FormatError('Required "head" table is not found'); - !(function sanitizeHead(e, t, i) { - const a = e.data, - s = (function int32(e, t, i, a) { - return (e << 24) + (t << 16) + (i << 8) + a; - })(a[0], a[1], a[2], a[3]); - if (s >> 16 != 1) { - info("Attempting to fix invalid version in head table: " + s); - a[0] = 0; - a[1] = 1; - a[2] = 0; - a[3] = 0; - } - const r = int16(a[50], a[51]); - if (r < 0 || r > 1) { - info("Attempting to fix invalid indexToLocFormat in head table: " + r); - const e = t + 1; - if (i === e << 1) { - a[50] = 0; - a[51] = 0; - } else { - if (i !== e << 2) - throw new FormatError("Could not fix indexToLocFormat: " + r); - a[50] = 0; - a[51] = 1; - } - } - })(n.head, h, c ? n.loca.length : 0); - let f = Object.create(null); - if (c) { - const e = int16(n.head.data[50], n.head.data[51]), - t = (function sanitizeGlyphLocations(e, t, i, a, s, r, n) { - let g, o, c; - if (a) { - g = 4; - o = function fontItemDecodeLong(e, t) { - return ( - (e[t] << 24) | (e[t + 1] << 16) | (e[t + 2] << 8) | e[t + 3] - ); - }; - c = function fontItemEncodeLong(e, t, i) { - e[t] = (i >>> 24) & 255; - e[t + 1] = (i >> 16) & 255; - e[t + 2] = (i >> 8) & 255; - e[t + 3] = 255 & i; - }; - } else { - g = 2; - o = function fontItemDecode(e, t) { - return (e[t] << 9) | (e[t + 1] << 1); - }; - c = function fontItemEncode(e, t, i) { - e[t] = (i >> 9) & 255; - e[t + 1] = (i >> 1) & 255; - }; - } - const C = r ? i + 1 : i, - h = g * (1 + C), - l = new Uint8Array(h); - l.set(e.data.subarray(0, h)); - e.data = l; - const Q = t.data, - E = Q.length, - u = new Uint8Array(E); - let d, f; - const p = []; - for (d = 0, f = 0; d < i + 1; d++, f += g) { - let e = o(l, f); - e > E && (e = E); - p.push({ index: d, offset: e, endOffset: 0 }); - } - p.sort((e, t) => e.offset - t.offset); - for (d = 0; d < i; d++) p[d].endOffset = p[d + 1].offset; - p.sort((e, t) => e.index - t.index); - for (d = 0; d < i; d++) { - const { offset: e, endOffset: t } = p[d]; - if (0 !== e || 0 !== t) break; - const i = p[d + 1].offset; - if (0 !== i) { - p[d].endOffset = i; - break; - } - } - const m = p.at(-2); - 0 !== m.offset && 0 === m.endOffset && (m.endOffset = E); - const y = Object.create(null); - let w = 0; - c(l, 0, w); - for (d = 0, f = g; d < i; d++, f += g) { - const e = sanitizeGlyph(Q, p[d].offset, p[d].endOffset, u, w, s), - t = e.length; - 0 === t && (y[d] = !0); - e.sizeOfInstructions > n && (n = e.sizeOfInstructions); - w += t; - c(l, f, w); - } - if (0 === w) { - const e = new Uint8Array([ - 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, - ]); - for (d = 0, f = g; d < C; d++, f += g) c(l, f, e.length); - t.data = e; - } else if (r) { - const i = o(l, g); - if (u.length > i + w) t.data = u.subarray(0, i + w); - else { - t.data = new Uint8Array(i + w); - t.data.set(u.subarray(0, w)); - } - t.data.set(u.subarray(0, i), w); - c(e.data, l.length - g, w + i); - } else t.data = u.subarray(0, w); - return { missingGlyphs: y, maxSizeOfInstructions: n }; - })(n.loca, n.glyf, h, e, d, Q, u); - f = t.missingGlyphs; - if (C >= 65536 && n.maxp.length >= 32) { - n.maxp.data[26] = t.maxSizeOfInstructions >> 8; - n.maxp.data[27] = 255 & t.maxSizeOfInstructions; + metrics[j] = (advanceWidth >> 8) & 0xff; + metrics[j + 1] = advanceWidth & 0xff; + const lsb = Math.round( + scaleFactors[i] * signedInt16(metrics[j + 2], metrics[j + 3]), + ); + writeSignedInt16(metrics, j + 2, lsb); } } - if (!n.hhea) throw new FormatError('Required "hhea" table is not found'); - if (0 === n.hhea.data[10] && 0 === n.hhea.data[11]) { - n.hhea.data[10] = 255; - n.hhea.data[11] = 255; + let numGlyphsOut = numGlyphs + 1; + let dupFirstEntry = true; + if (numGlyphsOut > 0xffff) { + dupFirstEntry = false; + numGlyphsOut = numGlyphs; + warn("Not enough space in glyfs to duplicate first glyph."); } - const p = { - unitsPerEm: int16(n.head.data[18], n.head.data[19]), - yMax: signedInt16(n.head.data[42], n.head.data[43]), - yMin: signedInt16(n.head.data[38], n.head.data[39]), - ascent: signedInt16(n.hhea.data[4], n.hhea.data[5]), - descent: signedInt16(n.hhea.data[6], n.hhea.data[7]), - lineGap: signedInt16(n.hhea.data[8], n.hhea.data[9]), + let maxFunctionDefs = 0; + let maxSizeOfInstructions = 0; + if (version >= 0x00010000 && tables.maxp.length >= 32) { + font.pos += 8; + const maxZones = font.getUint16(); + if (maxZones > 2) { + tables.maxp.data[14] = 0; + tables.maxp.data[15] = 2; + } + font.pos += 4; + maxFunctionDefs = font.getUint16(); + font.pos += 4; + maxSizeOfInstructions = font.getUint16(); + } + tables.maxp.data[4] = numGlyphsOut >> 8; + tables.maxp.data[5] = numGlyphsOut & 255; + const hintsValid = sanitizeTTPrograms( + tables.fpgm, + tables.prep, + tables["cvt "], + maxFunctionDefs, + ); + if (!hintsValid) { + delete tables.fpgm; + delete tables.prep; + delete tables["cvt "]; + } + sanitizeMetrics( + font, + tables.hhea, + tables.hmtx, + tables.head, + numGlyphsOut, + dupFirstEntry, + ); + if (!tables.head) { + throw new FormatError('Required "head" table is not found'); + } + sanitizeHead(tables.head, numGlyphs, isTrueType ? tables.loca.length : 0); + let missingGlyphs = Object.create(null); + if (isTrueType) { + const isGlyphLocationsLong = int16( + tables.head.data[50], + tables.head.data[51], + ); + const glyphsInfo = sanitizeGlyphLocations( + tables.loca, + tables.glyf, + numGlyphs, + isGlyphLocationsLong, + hintsValid, + dupFirstEntry, + maxSizeOfInstructions, + ); + missingGlyphs = glyphsInfo.missingGlyphs; + if (version >= 0x00010000 && tables.maxp.length >= 32) { + tables.maxp.data[26] = glyphsInfo.maxSizeOfInstructions >> 8; + tables.maxp.data[27] = glyphsInfo.maxSizeOfInstructions & 255; + } + } + if (!tables.hhea) { + throw new FormatError('Required "hhea" table is not found'); + } + if (tables.hhea.data[10] === 0 && tables.hhea.data[11] === 0) { + tables.hhea.data[10] = 0xff; + tables.hhea.data[11] = 0xff; + } + const metricsOverride = { + unitsPerEm: int16(tables.head.data[18], tables.head.data[19]), + yMax: signedInt16(tables.head.data[42], tables.head.data[43]), + yMin: signedInt16(tables.head.data[38], tables.head.data[39]), + ascent: signedInt16(tables.hhea.data[4], tables.hhea.data[5]), + descent: signedInt16(tables.hhea.data[6], tables.hhea.data[7]), + lineGap: signedInt16(tables.hhea.data[8], tables.hhea.data[9]), }; - this.ascent = p.ascent / p.unitsPerEm; - this.descent = p.descent / p.unitsPerEm; - this.lineGap = p.lineGap / p.unitsPerEm; + this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm; + this.descent = metricsOverride.descent / metricsOverride.unitsPerEm; + this.lineGap = metricsOverride.lineGap / metricsOverride.unitsPerEm; if (this.cssFontInfo?.lineHeight) { this.lineHeight = this.cssFontInfo.metrics.lineHeight; this.lineGap = this.cssFontInfo.metrics.lineGap; - } else this.lineHeight = this.ascent - this.descent + this.lineGap; - n.post && - (function readPostScriptTable(e, i, a) { - const s = (t.start || 0) + e.offset; - t.pos = s; - const r = s + e.length, - n = t.getInt32(); - t.skip(28); - let g, - o, - c = !0; - switch (n) { - case 65536: - g = Oi; - break; - case 131072: - const e = t.getUint16(); - if (e !== a) { - c = !1; - break; - } - const s = []; - for (o = 0; o < e; ++o) { - const e = t.getUint16(); - if (e >= 32768) { - c = !1; - break; - } - s.push(e); - } - if (!c) break; - const C = [], - h = []; - for (; t.pos < r; ) { - const e = t.getByte(); - h.length = e; - for (o = 0; o < e; ++o) h[o] = String.fromCharCode(t.getByte()); - C.push(h.join("")); - } - g = []; - for (o = 0; o < e; ++o) { - const e = s[o]; - e < 258 ? g.push(Oi[e]) : g.push(C[e - 258]); - } - break; - case 196608: - break; - default: - warn("Unknown/unsupported post table version " + n); - c = !1; - i.defaultEncoding && (g = i.defaultEncoding); - } - i.glyphNames = g; - return c; - })(n.post, i, h); - n.post = { tag: "post", data: createPostTable(i) }; - const m = Object.create(null); - function hasGlyph(e) { - return !f[e]; + } else { + this.lineHeight = this.ascent - this.descent + this.lineGap; } - if (i.composite) { - const e = i.cidToGidMap || [], - t = 0 === e.length; - i.cMap.forEach(function (i, a) { - "string" == typeof a && (a = convertCidString(i, a, !0)); - if (a > 65535) throw new FormatError("Max size of CID is 65,535"); - let s = -1; - t ? (s = a) : void 0 !== e[a] && (s = e[a]); - s >= 0 && s < h && hasGlyph(s) && (m[i] = s); + if (tables.post) { + readPostScriptTable(tables.post, properties, numGlyphs); + } + tables.post = { + tag: "post", + data: createPostTable(properties), + }; + const charCodeToGlyphId = Object.create(null); + function hasGlyph(glyphId) { + return !missingGlyphs[glyphId]; + } + if (properties.composite) { + const cidToGidMap = properties.cidToGidMap || []; + const isCidToGidMapEmpty = cidToGidMap.length === 0; + properties.cMap.forEach(function (charCode, cid) { + if (typeof cid === "string") { + cid = convertCidString(charCode, cid, true); + } + if (cid > 0xffff) { + throw new FormatError("Max size of CID is 65,535"); + } + let glyphId = -1; + if (isCidToGidMapEmpty) { + glyphId = cid; + } else if (cidToGidMap[cid] !== undefined) { + glyphId = cidToGidMap[cid]; + } + if (glyphId >= 0 && glyphId < numGlyphs && hasGlyph(glyphId)) { + charCodeToGlyphId[charCode] = glyphId; + } }); } else { - const e = (function readCmapTable(e, t, i, a) { - if (!e) { - warn("No cmap table available."); - return { - platformId: -1, - encodingId: -1, - mappings: [], - hasShortCmap: !1, - }; - } - let s, - r = (t.start || 0) + e.offset; - t.pos = r; - t.skip(2); - const n = t.getUint16(); - let g, - o = !1; - for (let e = 0; e < n; e++) { - const s = t.getUint16(), - r = t.getUint16(), - c = t.getInt32() >>> 0; - let C = !1; - if (g?.platformId !== s || g?.encodingId !== r) { - if (0 !== s || (0 !== r && 1 !== r && 3 !== r)) - if (1 === s && 0 === r) C = !0; - else if (3 !== s || 1 !== r || (!a && g)) { - if (i && 3 === s && 0 === r) { - C = !0; - let i = !0; - if (e < n - 1) { - const e = t.peekBytes(2); - int16(e[0], e[1]) < s && (i = !1); - } - i && (o = !0); - } - } else { - C = !0; - i || (o = !0); - } - else C = !0; - C && (g = { platformId: s, encodingId: r, offset: c }); - if (o) break; - } - } - g && (t.pos = r + g.offset); - if (!g || -1 === t.peekByte()) { - warn("Could not find a preferred cmap table."); - return { - platformId: -1, - encodingId: -1, - mappings: [], - hasShortCmap: !1, - }; - } - const c = t.getUint16(); - let C = !1; - const h = []; - let l, Q; - if (0 === c) { - t.skip(4); - for (l = 0; l < 256; l++) { - const e = t.getByte(); - e && h.push({ charCode: l, glyphId: e }); - } - C = !0; - } else if (2 === c) { - t.skip(4); - const e = []; - let i = 0; - for (let a = 0; a < 256; a++) { - const a = t.getUint16() >> 3; - e.push(a); - i = Math.max(a, i); - } - const a = []; - for (let e = 0; e <= i; e++) - a.push({ - firstCode: t.getUint16(), - entryCount: t.getUint16(), - idDelta: signedInt16(t.getByte(), t.getByte()), - idRangePos: t.pos + t.getUint16(), - }); - for (let i = 0; i < 256; i++) - if (0 === e[i]) { - t.pos = a[0].idRangePos + 2 * i; - Q = t.getUint16(); - h.push({ charCode: i, glyphId: Q }); - } else { - const s = a[e[i]]; - for (l = 0; l < s.entryCount; l++) { - const e = (i << 8) + l + s.firstCode; - t.pos = s.idRangePos + 2 * l; - Q = t.getUint16(); - 0 !== Q && (Q = (Q + s.idDelta) % 65536); - h.push({ charCode: e, glyphId: Q }); - } - } - } else if (4 === c) { - t.skip(4); - const e = t.getUint16() >> 1; - t.skip(6); - const i = []; - let a; - for (a = 0; a < e; a++) i.push({ end: t.getUint16() }); - t.skip(2); - for (a = 0; a < e; a++) i[a].start = t.getUint16(); - for (a = 0; a < e; a++) i[a].delta = t.getUint16(); - let n, - g = 0; - for (a = 0; a < e; a++) { - s = i[a]; - const r = t.getUint16(); - if (r) { - n = (r >> 1) - (e - a); - s.offsetIndex = n; - g = Math.max(g, n + s.end - s.start + 1); - } else s.offsetIndex = -1; - } - const o = []; - for (l = 0; l < g; l++) o.push(t.getUint16()); - for (a = 0; a < e; a++) { - s = i[a]; - r = s.start; - const e = s.end, - t = s.delta; - n = s.offsetIndex; - for (l = r; l <= e; l++) - if (65535 !== l) { - Q = n < 0 ? l : o[n + l - r]; - Q = (Q + t) & 65535; - h.push({ charCode: l, glyphId: Q }); - } - } - } else if (6 === c) { - t.skip(4); - const e = t.getUint16(), - i = t.getUint16(); - for (l = 0; l < i; l++) { - Q = t.getUint16(); - const i = e + l; - h.push({ charCode: i, glyphId: Q }); - } - } else { - if (12 !== c) { - warn("cmap table has unsupported format: " + c); - return { - platformId: -1, - encodingId: -1, - mappings: [], - hasShortCmap: !1, - }; - } - { - t.skip(10); - const e = t.getInt32() >>> 0; - for (l = 0; l < e; l++) { - const e = t.getInt32() >>> 0, - i = t.getInt32() >>> 0; - let a = t.getInt32() >>> 0; - for (let t = e; t <= i; t++) - h.push({ charCode: t, glyphId: a++ }); - } - } - } - h.sort(function (e, t) { - return e.charCode - t.charCode; - }); - for (let e = 1; e < h.length; e++) - if (h[e - 1].charCode === h[e].charCode) { - h.splice(e, 1); - e--; - } - return { - platformId: g.platformId, - encodingId: g.encodingId, - mappings: h, - hasShortCmap: C, - }; - })(n.cmap, t, this.isSymbolicFont, i.hasEncoding), - a = e.platformId, - s = e.encodingId, - r = e.mappings; - let g = [], - o = !1; - !i.hasEncoding || - ("MacRomanEncoding" !== i.baseEncodingName && - "WinAnsiEncoding" !== i.baseEncodingName) || - (g = getEncoding(i.baseEncodingName)); + const cmapTable = readCmapTable( + tables.cmap, + font, + this.isSymbolicFont, + properties.hasEncoding, + ); + const cmapPlatformId = cmapTable.platformId; + const cmapEncodingId = cmapTable.encodingId; + const cmapMappings = cmapTable.mappings; + let baseEncoding = [], + forcePostTable = false; if ( - i.hasEncoding && - !this.isSymbolicFont && - ((3 === a && 1 === s) || (1 === a && 0 === s)) + properties.hasEncoding && + (properties.baseEncodingName === "MacRomanEncoding" || + properties.baseEncodingName === "WinAnsiEncoding") ) { - const e = Ni(); - for (let t = 0; t < 256; t++) { - let n; - n = - void 0 !== this.differences[t] - ? this.differences[t] - : g.length && "" !== g[t] - ? g[t] - : fi[t]; - if (!n) continue; - const o = recoverGlyphName(n, e); - let c; - 3 === a && 1 === s - ? (c = e[o]) - : 1 === a && 0 === s && (c = di.indexOf(o)); - if (void 0 === c) { + baseEncoding = getEncoding(properties.baseEncodingName); + } + if ( + properties.hasEncoding && + !this.isSymbolicFont && + ((cmapPlatformId === 3 && cmapEncodingId === 1) || + (cmapPlatformId === 1 && cmapEncodingId === 0)) + ) { + const glyphsUnicodeMap = getGlyphsUnicode(); + for (let charCode = 0; charCode < 256; charCode++) { + let glyphName; + if (this.differences[charCode] !== undefined) { + glyphName = this.differences[charCode]; + } else if (baseEncoding.length && baseEncoding[charCode] !== "") { + glyphName = baseEncoding[charCode]; + } else { + glyphName = StandardEncoding[charCode]; + } + if (!glyphName) { + continue; + } + const standardGlyphName = recoverGlyphName( + glyphName, + glyphsUnicodeMap, + ); + let unicodeOrCharCode; + if (cmapPlatformId === 3 && cmapEncodingId === 1) { + unicodeOrCharCode = glyphsUnicodeMap[standardGlyphName]; + } else if (cmapPlatformId === 1 && cmapEncodingId === 0) { + unicodeOrCharCode = MacRomanEncoding.indexOf(standardGlyphName); + } + if (unicodeOrCharCode === undefined) { if ( - !i.glyphNames && - i.hasIncludedToUnicodeMap && + !properties.glyphNames && + properties.hasIncludedToUnicodeMap && !(this.toUnicode instanceof IdentityToUnicodeMap) ) { - const e = this.toUnicode.get(t); - e && (c = e.codePointAt(0)); + const unicode = this.toUnicode.get(charCode); + if (unicode) { + unicodeOrCharCode = unicode.codePointAt(0); + } + } + if (unicodeOrCharCode === undefined) { + continue; } - if (void 0 === c) continue; } - for (const e of r) - if (e.charCode === c) { - m[t] = e.glyphId; - break; + for (const mapping of cmapMappings) { + if (mapping.charCode !== unicodeOrCharCode) { + continue; } + charCodeToGlyphId[charCode] = mapping.glyphId; + break; + } } - } else if (0 === a) { - for (const e of r) m[e.charCode] = e.glyphId; - o = !0; - } else if (3 === a && 0 === s) - for (const e of r) { - let t = e.charCode; - t >= 61440 && t <= 61695 && (t &= 255); - m[t] = e.glyphId; + } else if (cmapPlatformId === 0) { + for (const mapping of cmapMappings) { + charCodeToGlyphId[mapping.charCode] = mapping.glyphId; } - else for (const e of r) m[e.charCode] = e.glyphId; - if (i.glyphNames && (g.length || this.differences.length)) - for (let e = 0; e < 256; ++e) { - if (!o && void 0 !== m[e]) continue; - const t = this.differences[e] || g[e]; - if (!t) continue; - const a = i.glyphNames.indexOf(t); - a > 0 && hasGlyph(a) && (m[e] = a); + forcePostTable = true; + } else if (cmapPlatformId === 3 && cmapEncodingId === 0) { + for (const mapping of cmapMappings) { + let charCode = mapping.charCode; + if (charCode >= 0xf000 && charCode <= 0xf0ff) { + charCode &= 0xff; + } + charCodeToGlyphId[charCode] = mapping.glyphId; + } + } else { + for (const mapping of cmapMappings) { + charCodeToGlyphId[mapping.charCode] = mapping.glyphId; } - } - 0 === m.length && (m[0] = 0); - let y = l - 1; - Q || (y = 0); - if (!i.cssFontInfo) { - const e = adjustMapping(m, hasGlyph, y, this.toUnicode); - this.toFontChar = e.toFontChar; - n.cmap = { - tag: "cmap", - data: createCmapTable(e.charCodeToGlyphId, e.toUnicodeExtraMap, l), - }; - (n["OS/2"] && - (function validateOS2Table(e, t) { - t.pos = (t.start || 0) + e.offset; - const i = t.getUint16(); - t.skip(60); - const a = t.getUint16(); - if (i < 4 && 768 & a) return !1; - if (t.getUint16() > t.getUint16()) return !1; - t.skip(6); - if (0 === t.getUint16()) return !1; - e.data[8] = e.data[9] = 0; - return !0; - })(n["OS/2"], t)) || - (n["OS/2"] = { - tag: "OS/2", - data: createOS2Table(i, e.charCodeToGlyphId, p), - }); - } - if (!c) - try { - o = new Stream(n["CFF "].data); - g = new CFFParser(o, i, Yi).parse(); - g.duplicateFirstGlyph(); - const e = new CFFCompiler(g); - n["CFF "].data = e.compile(); - } catch { - warn("Failed to compile font " + i.loadedName); } - if (n.name) { - const [t, a] = readNameTable(n.name); - n.name.data = createNameTable(e, t); - this.psName = t[0][6] || null; - i.composite || - (function adjustTrueTypeToUnicode(e, t, i) { - if (e.isInternalFont) return; - if (e.hasIncludedToUnicodeMap) return; - if (e.hasEncoding) return; - if (e.toUnicode instanceof IdentityToUnicodeMap) return; - if (!t) return; - if (0 === i.length) return; - if (e.defaultEncoding === pi) return; - for (const e of i) if (!isWinNameRecord(e)) return; - const a = pi, - s = [], - r = Ni(); - for (const e in a) { - const t = a[e]; - if ("" === t) continue; - const i = r[t]; - void 0 !== i && (s[e] = String.fromCharCode(i)); - } - s.length > 0 && e.toUnicode.amend(s); - })(i, this.isSymbolicFont, a); - } else n.name = { tag: "name", data: createNameTable(this.name) }; - const w = new OpenTypeFileBuilder(r.version); - for (const e in n) w.addTable(e, n[e].data); - return w.toArray(); - } - convert(e, t, i) { - i.fixedPitch = !1; - i.builtInEncoding && - (function adjustType1ToUnicode(e, t) { - if (e.isInternalFont) return; - if (e.hasIncludedToUnicodeMap) return; - if (t === e.defaultEncoding) return; - if (e.toUnicode instanceof IdentityToUnicodeMap) return; - const i = [], - a = Ni(); - for (const s in t) { - if ( - e.hasEncoding && - (e.baseEncodingName || void 0 !== e.differences[s]) - ) + if ( + properties.glyphNames && + (baseEncoding.length || this.differences.length) + ) { + for (let i = 0; i < 256; ++i) { + if (!forcePostTable && charCodeToGlyphId[i] !== undefined) { continue; - const r = getUnicodeForGlyph(t[s], a); - -1 !== r && (i[s] = String.fromCharCode(r)); - } - i.length > 0 && e.toUnicode.amend(i); - })(i, i.builtInEncoding); - let s = 1; - t instanceof CFFFont && (s = t.numGlyphs - 1); - const r = t.getGlyphMapping(i); - let n = null, - g = r, - o = null; - if (!i.cssFontInfo) { - n = adjustMapping(r, t.hasGlyphId.bind(t), s, this.toUnicode); - this.toFontChar = n.toFontChar; - g = n.charCodeToGlyphId; - o = n.toUnicodeExtraMap; - } - const c = t.numGlyphs; - function getCharCodes(e, t) { - let i = null; - for (const a in e) t === e[a] && (i ||= []).push(0 | a); - return i; - } - function createCharCode(e, t) { - for (const i in e) if (t === e[i]) return 0 | i; - n.charCodeToGlyphId[n.nextAvailableFontCharCode] = t; - return n.nextAvailableFontCharCode++; - } - const C = t.seacs; - if (n && C?.length) { - const e = i.fontMatrix || a, - s = t.getCharset(), - g = Object.create(null); - for (let t in C) { - t |= 0; - const i = C[t], - a = fi[i[2]], - o = fi[i[3]], - c = s.indexOf(a), - h = s.indexOf(o); - if (c < 0 || h < 0) continue; - const l = { - x: i[0] * e[0] + i[1] * e[2] + e[4], - y: i[0] * e[1] + i[1] * e[3] + e[5], - }, - Q = getCharCodes(r, t); - if (Q) - for (const e of Q) { - const t = n.charCodeToGlyphId, - i = createCharCode(t, c), - a = createCharCode(t, h); - g[e] = { - baseFontCharCode: i, - accentFontCharCode: a, - accentOffset: l, - }; } + const glyphName = this.differences[i] || baseEncoding[i]; + if (!glyphName) { + continue; + } + const glyphId = properties.glyphNames.indexOf(glyphName); + if (glyphId > 0 && hasGlyph(glyphId)) { + charCodeToGlyphId[i] = glyphId; + } + } } - i.seacMap = g; } - const h = i.fontMatrix - ? 1 / Math.max(...i.fontMatrix.slice(0, 4).map(Math.abs)) - : 1e3, - l = new OpenTypeFileBuilder("OTTO"); - l.addTable("CFF ", t.data); - l.addTable("OS/2", createOS2Table(i, g)); - l.addTable("cmap", createCmapTable(g, o, c)); - l.addTable( + if (charCodeToGlyphId.length === 0) { + charCodeToGlyphId[0] = 0; + } + let glyphZeroId = numGlyphsOut - 1; + if (!dupFirstEntry) { + glyphZeroId = 0; + } + if (!properties.cssFontInfo) { + const newMapping = adjustMapping( + charCodeToGlyphId, + hasGlyph, + glyphZeroId, + this.toUnicode, + ); + this.toFontChar = newMapping.toFontChar; + tables.cmap = { + tag: "cmap", + data: createCmapTable( + newMapping.charCodeToGlyphId, + newMapping.toUnicodeExtraMap, + numGlyphsOut, + ), + }; + if (!tables["OS/2"] || !validateOS2Table(tables["OS/2"], font)) { + tables["OS/2"] = { + tag: "OS/2", + data: createOS2Table( + properties, + newMapping.charCodeToGlyphId, + metricsOverride, + ), + }; + } + } + if (!isTrueType) { + try { + cffFile = new Stream(tables["CFF "].data); + const parser = new CFFParser( + cffFile, + properties, + SEAC_ANALYSIS_ENABLED, + ); + cff = parser.parse(); + cff.duplicateFirstGlyph(); + const compiler = new CFFCompiler(cff); + tables["CFF "].data = compiler.compile(); + } catch { + warn("Failed to compile font " + properties.loadedName); + } + } + if (!tables.name) { + tables.name = { + tag: "name", + data: createNameTable(this.name), + }; + } else { + const [namePrototype, nameRecords] = readNameTable(tables.name); + tables.name.data = createNameTable(name, namePrototype); + this.psName = namePrototype[0][6] || null; + if (!properties.composite) { + adjustTrueTypeToUnicode(properties, this.isSymbolicFont, nameRecords); + } + } + const builder = new OpenTypeFileBuilder(header.version); + for (const tableTag in tables) { + builder.addTable(tableTag, tables[tableTag].data); + } + return builder.toArray(); + } + convert(fontName, font, properties) { + properties.fixedPitch = false; + if (properties.builtInEncoding) { + adjustType1ToUnicode(properties, properties.builtInEncoding); + } + let glyphZeroId = 1; + if (font instanceof CFFFont) { + glyphZeroId = font.numGlyphs - 1; + } + const mapping = font.getGlyphMapping(properties); + let newMapping = null; + let newCharCodeToGlyphId = mapping; + let toUnicodeExtraMap = null; + if (!properties.cssFontInfo) { + newMapping = adjustMapping( + mapping, + font.hasGlyphId.bind(font), + glyphZeroId, + this.toUnicode, + ); + this.toFontChar = newMapping.toFontChar; + newCharCodeToGlyphId = newMapping.charCodeToGlyphId; + toUnicodeExtraMap = newMapping.toUnicodeExtraMap; + } + const numGlyphs = font.numGlyphs; + function getCharCodes(charCodeToGlyphId, glyphId) { + let charCodes = null; + for (const charCode in charCodeToGlyphId) { + if (glyphId === charCodeToGlyphId[charCode]) { + (charCodes ||= []).push(charCode | 0); + } + } + return charCodes; + } + function createCharCode(charCodeToGlyphId, glyphId) { + for (const charCode in charCodeToGlyphId) { + if (glyphId === charCodeToGlyphId[charCode]) { + return charCode | 0; + } + } + newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = + glyphId; + return newMapping.nextAvailableFontCharCode++; + } + const seacs = font.seacs; + if (newMapping && SEAC_ANALYSIS_ENABLED && seacs?.length) { + const matrix = properties.fontMatrix || FONT_IDENTITY_MATRIX; + const charset = font.getCharset(); + const seacMap = Object.create(null); + for (let glyphId in seacs) { + glyphId |= 0; + const seac = seacs[glyphId]; + const baseGlyphName = StandardEncoding[seac[2]]; + const accentGlyphName = StandardEncoding[seac[3]]; + const baseGlyphId = charset.indexOf(baseGlyphName); + const accentGlyphId = charset.indexOf(accentGlyphName); + if (baseGlyphId < 0 || accentGlyphId < 0) { + continue; + } + const accentOffset = { + x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4], + y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5], + }; + const charCodes = getCharCodes(mapping, glyphId); + if (!charCodes) { + continue; + } + for (const charCode of charCodes) { + const charCodeToGlyphId = newMapping.charCodeToGlyphId; + const baseFontCharCode = createCharCode( + charCodeToGlyphId, + baseGlyphId, + ); + const accentFontCharCode = createCharCode( + charCodeToGlyphId, + accentGlyphId, + ); + seacMap[charCode] = { + baseFontCharCode, + accentFontCharCode, + accentOffset, + }; + } + } + properties.seacMap = seacMap; + } + const unitsPerEm = properties.fontMatrix + ? 1 / Math.max(...properties.fontMatrix.slice(0, 4).map(Math.abs)) + : 1000; + const builder = new OpenTypeFileBuilder("\x4F\x54\x54\x4F"); + builder.addTable("CFF ", font.data); + builder.addTable("OS/2", createOS2Table(properties, newCharCodeToGlyphId)); + builder.addTable( + "cmap", + createCmapTable(newCharCodeToGlyphId, toUnicodeExtraMap, numGlyphs), + ); + builder.addTable( "head", - "\0\0\0\0\0\0\0\0\0\0_<õ\0\0" + - safeString16(h) + - "\0\0\0\0ž\v~'\0\0\0\0ž\v~'\0\0" + - safeString16(i.descent) + - "ÿ" + - safeString16(i.ascent) + - string16(i.italicAngle ? 2 : 0) + - "\0\0\0\0\0\0\0", + "\x00\x01\x00\x00" + + "\x00\x00\x10\x00" + + "\x00\x00\x00\x00" + + "\x5F\x0F\x3C\xF5" + + "\x00\x00" + + safeString16(unitsPerEm) + + "\x00\x00\x00\x00\x9e\x0b\x7e\x27" + + "\x00\x00\x00\x00\x9e\x0b\x7e\x27" + + "\x00\x00" + + safeString16(properties.descent) + + "\x0F\xFF" + + safeString16(properties.ascent) + + string16(properties.italicAngle ? 2 : 0) + + "\x00\x11" + + "\x00\x00" + + "\x00\x00" + + "\x00\x00", ); - l.addTable( + builder.addTable( "hhea", - "\0\0\0" + - safeString16(i.ascent) + - safeString16(i.descent) + - "\0\0ÿÿ\0\0\0\0\0\0" + - safeString16(i.capHeight) + - safeString16(Math.tan(i.italicAngle) * i.xHeight) + - "\0\0\0\0\0\0\0\0\0\0\0\0" + - string16(c), + "\x00\x01\x00\x00" + + safeString16(properties.ascent) + + safeString16(properties.descent) + + "\x00\x00" + + "\xFF\xFF" + + "\x00\x00" + + "\x00\x00" + + "\x00\x00" + + safeString16(properties.capHeight) + + safeString16(Math.tan(properties.italicAngle) * properties.xHeight) + + "\x00\x00" + + "\x00\x00" + + "\x00\x00" + + "\x00\x00" + + "\x00\x00" + + "\x00\x00" + + string16(numGlyphs), ); - l.addTable( + builder.addTable( "hmtx", (function fontFieldsHmtx() { - const e = t.charstrings, - i = t.cff ? t.cff.widths : null; - let a = "\0\0\0\0"; - for (let t = 1, s = c; t < s; t++) { - let s = 0; - if (e) { - const i = e[t - 1]; - s = "width" in i ? i.width : 0; - } else i && (s = Math.ceil(i[t] || 0)); - a += string16(s) + string16(0); + const charstrings = font.charstrings; + const cffWidths = font.cff ? font.cff.widths : null; + let hmtx = "\x00\x00\x00\x00"; + for (let i = 1, ii = numGlyphs; i < ii; i++) { + let width = 0; + if (charstrings) { + const charstring = charstrings[i - 1]; + width = "width" in charstring ? charstring.width : 0; + } else if (cffWidths) { + width = Math.ceil(cffWidths[i] || 0); + } + hmtx += string16(width) + string16(0); } - return a; + return hmtx; })(), ); - l.addTable("maxp", "\0\0P\0" + string16(c)); - l.addTable("name", createNameTable(e)); - l.addTable("post", createPostTable(i)); - return l.toArray(); + builder.addTable("maxp", "\x00\x00\x50\x00" + string16(numGlyphs)); + builder.addTable("name", createNameTable(fontName)); + builder.addTable("post", createPostTable(properties)); + return builder.toArray(); } - _charToGlyph(e, t = !1) { - let i, - a, - s, - r = this._glyphCache[e]; - if (r?.isSpace === t) return r; - let n = e; - if (this.cMap?.contains(e)) { - n = this.cMap.lookup(e); - "string" == typeof n && (n = convertCidString(e, n)); + get _spaceWidth() { + const possibleSpaceReplacements = ["space", "minus", "one", "i", "I"]; + let width; + for (const glyphName of possibleSpaceReplacements) { + if (glyphName in this.widths) { + width = this.widths[glyphName]; + break; + } + const glyphsUnicodeMap = getGlyphsUnicode(); + const glyphUnicode = glyphsUnicodeMap[glyphName]; + let charcode = 0; + if (this.composite && this.cMap.contains(glyphUnicode)) { + charcode = this.cMap.lookup(glyphUnicode); + if (typeof charcode === "string") { + charcode = convertCidString(glyphUnicode, charcode); + } + } + if (!charcode && this.toUnicode) { + charcode = this.toUnicode.charCodeOf(glyphUnicode); + } + if (charcode <= 0) { + charcode = glyphUnicode; + } + width = this.widths[charcode]; + if (width) { + break; + } } - a = this.widths[n]; - "number" != typeof a && (a = this.defaultWidth); - const g = this.vmetrics?.[n]; - let o = this.toUnicode.get(e) || e; - "number" == typeof o && (o = String.fromCharCode(o)); - let c = void 0 !== this.toFontChar[e]; - i = this.toFontChar[e] || e; + return shadow(this, "_spaceWidth", width || this.defaultWidth); + } + _charToGlyph(charcode, isSpace = false) { + let glyph = this._glyphCache[charcode]; + if (glyph?.isSpace === isSpace) { + return glyph; + } + let fontCharCode, width, operatorListId; + let widthCode = charcode; + if (this.cMap?.contains(charcode)) { + widthCode = this.cMap.lookup(charcode); + if (typeof widthCode === "string") { + widthCode = convertCidString(charcode, widthCode); + } + } + width = this.widths[widthCode]; + if (typeof width !== "number") { + width = this.defaultWidth; + } + const vmetric = this.vmetrics?.[widthCode]; + let unicode = this.toUnicode.get(charcode) || charcode; + if (typeof unicode === "number") { + unicode = String.fromCharCode(unicode); + } + let isInFont = this.toFontChar[charcode] !== undefined; + fontCharCode = this.toFontChar[charcode] || charcode; if (this.missingFile) { - const t = this.differences[e] || this.defaultEncoding[e]; - (".notdef" !== t && "" !== t) || "Type1" !== this.type || (i = 32); - i = (function mapSpecialUnicodeValues(e) { - return e >= 65520 && e <= 65535 - ? 0 - : e >= 62976 && e <= 63743 - ? xi()[e] || e - : 173 === e - ? 45 - : e; - })(i); + const glyphName = + this.differences[charcode] || this.defaultEncoding[charcode]; + if ( + (glyphName === ".notdef" || glyphName === "") && + this.type === "Type1" + ) { + fontCharCode = 0x20; + if (glyphName === "") { + width ||= this._spaceWidth; + unicode = String.fromCharCode(fontCharCode); + } + } + fontCharCode = mapSpecialUnicodeValues(fontCharCode); } - this.isType3Font && (s = i); - let C = null; - if (this.seacMap?.[e]) { - c = !0; - const t = this.seacMap[e]; - i = t.baseFontCharCode; - C = { - fontChar: String.fromCodePoint(t.accentFontCharCode), - offset: t.accentOffset, + if (this.isType3Font) { + operatorListId = fontCharCode; + } + let accent = null; + if (this.seacMap?.[charcode]) { + isInFont = true; + const seac = this.seacMap[charcode]; + fontCharCode = seac.baseFontCharCode; + accent = { + fontChar: String.fromCodePoint(seac.accentFontCharCode), + offset: seac.accentOffset, }; } - let h = ""; - "number" == typeof i && - (i <= 1114111 - ? (h = String.fromCodePoint(i)) - : warn(`charToGlyph - invalid fontCharCode: ${i}`)); - r = new fonts_Glyph(e, h, o, C, a, g, s, t, c); - return (this._glyphCache[e] = r); + let fontChar = ""; + if (typeof fontCharCode === "number") { + if (fontCharCode <= 0x10ffff) { + fontChar = String.fromCodePoint(fontCharCode); + } else { + warn(`charToGlyph - invalid fontCharCode: ${fontCharCode}`); + } + } + if (this.missingFile && this.vertical && fontChar.length === 1) { + const vertical = getVerticalPresentationForm()[fontChar.charCodeAt(0)]; + if (vertical) { + fontChar = unicode = String.fromCharCode(vertical); + } + } + glyph = new fonts_Glyph( + charcode, + fontChar, + unicode, + accent, + width, + vmetric, + operatorListId, + isSpace, + isInFont, + ); + return (this._glyphCache[charcode] = glyph); } - charsToGlyphs(e) { - let t = this._charsCache[e]; - if (t) return t; - t = []; + charsToGlyphs(chars) { + let glyphs = this._charsCache[chars]; + if (glyphs) { + return glyphs; + } + glyphs = []; if (this.cMap) { - const i = Object.create(null), - a = e.length; - let s = 0; - for (; s < a; ) { - this.cMap.readCharCode(e, s, i); - const { charcode: a, length: r } = i; - s += r; - const n = this._charToGlyph(a, 1 === r && 32 === e.charCodeAt(s - 1)); - t.push(n); + const c = Object.create(null), + ii = chars.length; + let i = 0; + while (i < ii) { + this.cMap.readCharCode(chars, i, c); + const { charcode, length } = c; + i += length; + const glyph = this._charToGlyph( + charcode, + length === 1 && chars.charCodeAt(i - 1) === 0x20, + ); + glyphs.push(glyph); } - } else - for (let i = 0, a = e.length; i < a; ++i) { - const a = e.charCodeAt(i), - s = this._charToGlyph(a, 32 === a); - t.push(s); + } else { + for (let i = 0, ii = chars.length; i < ii; ++i) { + const charcode = chars.charCodeAt(i); + const glyph = this._charToGlyph(charcode, charcode === 0x20); + glyphs.push(glyph); } - return (this._charsCache[e] = t); + } + return (this._charsCache[chars] = glyphs); } - getCharPositions(e) { - const t = []; + getCharPositions(chars) { + const positions = []; if (this.cMap) { - const i = Object.create(null); - let a = 0; - for (; a < e.length; ) { - this.cMap.readCharCode(e, a, i); - const s = i.length; - t.push([a, a + s]); - a += s; + const c = Object.create(null); + let i = 0; + while (i < chars.length) { + this.cMap.readCharCode(chars, i, c); + const length = c.length; + positions.push([i, i + length]); + i += length; } - } else for (let i = 0, a = e.length; i < a; ++i) t.push([i, i + 1]); - return t; + } else { + for (let i = 0, ii = chars.length; i < ii; ++i) { + positions.push([i, i + 1]); + } + } + return positions; } get glyphCacheValues() { return Object.values(this._glyphCache); } - encodeString(e) { - const t = [], - i = [], - hasCurrentBufErrors = () => t.length % 2 == 1, - a = - this.toUnicode instanceof IdentityToUnicodeMap - ? (e) => this.toUnicode.charCodeOf(e) - : (e) => this.toUnicode.charCodeOf(String.fromCodePoint(e)); - for (let s = 0, r = e.length; s < r; s++) { - const r = e.codePointAt(s); - r > 55295 && (r < 57344 || r > 65533) && s++; + encodeString(str) { + const buffers = []; + const currentBuf = []; + const hasCurrentBufErrors = () => buffers.length % 2 === 1; + const getCharCode = + this.toUnicode instanceof IdentityToUnicodeMap + ? (unicode) => this.toUnicode.charCodeOf(unicode) + : (unicode) => this.toUnicode.charCodeOf(String.fromCodePoint(unicode)); + for (let i = 0, ii = str.length; i < ii; i++) { + const unicode = str.codePointAt(i); + if (unicode > 0xd7ff && (unicode < 0xe000 || unicode > 0xfffd)) { + i++; + } if (this.toUnicode) { - const e = a(r); - if (-1 !== e) { + const charCode = getCharCode(unicode); + if (charCode !== -1) { if (hasCurrentBufErrors()) { - t.push(i.join("")); - i.length = 0; + buffers.push(currentBuf.join("")); + currentBuf.length = 0; + } + const charCodeLength = this.cMap + ? this.cMap.getCharCodeLength(charCode) + : 1; + for (let j = charCodeLength - 1; j >= 0; j--) { + currentBuf.push(String.fromCharCode((charCode >> (8 * j)) & 0xff)); } - for ( - let t = (this.cMap ? this.cMap.getCharCodeLength(e) : 1) - 1; - t >= 0; - t-- - ) - i.push(String.fromCharCode((e >> (8 * t)) & 255)); continue; } } if (!hasCurrentBufErrors()) { - t.push(i.join("")); - i.length = 0; + buffers.push(currentBuf.join("")); + currentBuf.length = 0; } - i.push(String.fromCodePoint(r)); + currentBuf.push(String.fromCodePoint(unicode)); } - t.push(i.join("")); - return t; + buffers.push(currentBuf.join("")); + return buffers; } } class ErrorFont { - constructor(e) { - this.error = e; + constructor(error) { + this.error = error; this.loadedName = "g_font_error"; - this.missingFile = !0; + this.missingFile = true; } charsToGlyphs() { return []; } - encodeString(e) { - return [e]; + encodeString(chars) { + return [chars]; } - exportData(e = !1) { - return { error: this.error }; + exportData(extraProperties = false) { + return { + error: this.error, + }; } -} -const Ea = 2, - ua = 3, - da = 4, - fa = 5, - pa = 6, - ma = 7; +} // ./src/core/pattern.js + +const ShadingType = { + FUNCTION_BASED: 1, + AXIAL: 2, + RADIAL: 3, + FREE_FORM_MESH: 4, + LATTICE_FORM_MESH: 5, + COONS_PATCH_MESH: 6, + TENSOR_PATCH_MESH: 7, +}; class Pattern { constructor() { unreachable("Cannot initialize Pattern."); } - static parseShading(e, t, i, a, s) { - const r = e instanceof BaseStream ? e.dict : e, - n = r.get("ShadingType"); + static parseShading( + shading, + xref, + res, + pdfFunctionFactory, + localColorSpaceCache, + ) { + const dict = shading instanceof BaseStream ? shading.dict : shading; + const type = dict.get("ShadingType"); try { - switch (n) { - case Ea: - case ua: - return new RadialAxialShading(r, t, i, a, s); - case da: - case fa: - case pa: - case ma: - return new MeshShading(e, t, i, a, s); + switch (type) { + case ShadingType.AXIAL: + case ShadingType.RADIAL: + return new RadialAxialShading( + dict, + xref, + res, + pdfFunctionFactory, + localColorSpaceCache, + ); + case ShadingType.FREE_FORM_MESH: + case ShadingType.LATTICE_FORM_MESH: + case ShadingType.COONS_PATCH_MESH: + case ShadingType.TENSOR_PATCH_MESH: + return new MeshShading( + shading, + xref, + res, + pdfFunctionFactory, + localColorSpaceCache, + ); default: - throw new FormatError("Unsupported ShadingType: " + n); + throw new FormatError("Unsupported ShadingType: " + type); } - } catch (e) { - if (e instanceof MissingDataException) throw e; - warn(e); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(ex); return new DummyShading(); } } } class BaseShading { static SMALL_NUMBER = 1e-6; - constructor() { - this.constructor === BaseShading && - unreachable("Cannot initialize BaseShading."); - } getIR() { unreachable("Abstract method `getIR` called."); } } class RadialAxialShading extends BaseShading { - constructor(e, t, i, a, s) { + constructor(dict, xref, resources, pdfFunctionFactory, localColorSpaceCache) { super(); - this.shadingType = e.get("ShadingType"); - let r = 0; - this.shadingType === Ea ? (r = 4) : this.shadingType === ua && (r = 6); - this.coordsArr = e.getArray("Coords"); - if (!isNumberArray(this.coordsArr, r)) - throw new FormatError("RadialAxialShading: Invalid /Coords array."); - const n = ColorSpace.parse({ - cs: e.getRaw("CS") || e.getRaw("ColorSpace"), - xref: t, - resources: i, - pdfFunctionFactory: a, - localColorSpaceCache: s, - }); - this.bbox = lookupNormalRect(e.getArray("BBox"), null); - let g = 0, - o = 1; - const c = e.getArray("Domain"); - isNumberArray(c, 2) && ([g, o] = c); - let C = !1, - h = !1; - const l = e.getArray("Extend"); - (function isBooleanArray(e, t) { - return ( - Array.isArray(e) && - (null === t || e.length === t) && - e.every((e) => "boolean" == typeof e) - ); - })(l, 2) && ([C, h] = l); - if (!(this.shadingType !== ua || (C && h))) { - const [e, t, i, a, s, r] = this.coordsArr, - n = Math.hypot(e - a, t - s); - i <= r + n && r <= i + n && warn("Unsupported radial gradient."); + this.shadingType = dict.get("ShadingType"); + let coordsLen = 0; + if (this.shadingType === ShadingType.AXIAL) { + coordsLen = 4; + } else if (this.shadingType === ShadingType.RADIAL) { + coordsLen = 6; } - this.extendStart = C; - this.extendEnd = h; - const Q = e.getRaw("Function"), - E = a.createFromArray(Q), - u = (o - g) / 840, - d = (this.colorStops = []); - if (g >= o || u <= 0) { + this.coordsArr = dict.getArray("Coords"); + if (!isNumberArray(this.coordsArr, coordsLen)) { + throw new FormatError("RadialAxialShading: Invalid /Coords array."); + } + const cs = ColorSpace.parse({ + cs: dict.getRaw("CS") || dict.getRaw("ColorSpace"), + xref, + resources, + pdfFunctionFactory, + localColorSpaceCache, + }); + this.bbox = lookupNormalRect(dict.getArray("BBox"), null); + let t0 = 0.0, + t1 = 1.0; + const domainArr = dict.getArray("Domain"); + if (isNumberArray(domainArr, 2)) { + [t0, t1] = domainArr; + } + let extendStart = false, + extendEnd = false; + const extendArr = dict.getArray("Extend"); + if (isBooleanArray(extendArr, 2)) { + [extendStart, extendEnd] = extendArr; + } + if ( + this.shadingType === ShadingType.RADIAL && + (!extendStart || !extendEnd) + ) { + const [x1, y1, r1, x2, y2, r2] = this.coordsArr; + const distance = Math.hypot(x1 - x2, y1 - y2); + if (r1 <= r2 + distance && r2 <= r1 + distance) { + warn("Unsupported radial gradient."); + } + } + this.extendStart = extendStart; + this.extendEnd = extendEnd; + const fnObj = dict.getRaw("Function"); + const fn = pdfFunctionFactory.createFromArray(fnObj); + const NUMBER_OF_SAMPLES = 840; + const step = (t1 - t0) / NUMBER_OF_SAMPLES; + const colorStops = (this.colorStops = []); + if (t0 >= t1 || step <= 0) { info("Bad shading domain."); return; } - const f = new Float32Array(n.numComps), - p = new Float32Array(1); - let m, - y = 0; - p[0] = g; - E(p, 0, f, 0); - let w = n.getRgb(f, 0); - const D = Util.makeHexColor(w[0], w[1], w[2]); - d.push([0, D]); - let b = 1; - p[0] = g + u; - E(p, 0, f, 0); - let F = n.getRgb(f, 0), - S = F[0] - w[0] + 1, - k = F[1] - w[1] + 1, - R = F[2] - w[2] + 1, - N = F[0] - w[0] - 1, - G = F[1] - w[1] - 1, - x = F[2] - w[2] - 1; - for (let e = 2; e < 840; e++) { - p[0] = g + e * u; - E(p, 0, f, 0); - m = n.getRgb(f, 0); - const t = e - y; - S = Math.min(S, (m[0] - w[0] + 1) / t); - k = Math.min(k, (m[1] - w[1] + 1) / t); - R = Math.min(R, (m[2] - w[2] + 1) / t); - N = Math.max(N, (m[0] - w[0] - 1) / t); - G = Math.max(G, (m[1] - w[1] - 1) / t); - x = Math.max(x, (m[2] - w[2] - 1) / t); - if (!(N <= S && G <= k && x <= R)) { - const e = Util.makeHexColor(F[0], F[1], F[2]); - d.push([b / 840, e]); - S = m[0] - F[0] + 1; - k = m[1] - F[1] + 1; - R = m[2] - F[2] + 1; - N = m[0] - F[0] - 1; - G = m[1] - F[1] - 1; - x = m[2] - F[2] - 1; - y = b; - w = F; + const color = new Float32Array(cs.numComps), + ratio = new Float32Array(1); + let rgbColor; + let iBase = 0; + ratio[0] = t0; + fn(ratio, 0, color, 0); + let rgbBase = cs.getRgb(color, 0); + const cssColorBase = Util.makeHexColor(rgbBase[0], rgbBase[1], rgbBase[2]); + colorStops.push([0, cssColorBase]); + let iPrev = 1; + ratio[0] = t0 + step; + fn(ratio, 0, color, 0); + let rgbPrev = cs.getRgb(color, 0); + let maxSlopeR = rgbPrev[0] - rgbBase[0] + 1; + let maxSlopeG = rgbPrev[1] - rgbBase[1] + 1; + let maxSlopeB = rgbPrev[2] - rgbBase[2] + 1; + let minSlopeR = rgbPrev[0] - rgbBase[0] - 1; + let minSlopeG = rgbPrev[1] - rgbBase[1] - 1; + let minSlopeB = rgbPrev[2] - rgbBase[2] - 1; + for (let i = 2; i < NUMBER_OF_SAMPLES; i++) { + ratio[0] = t0 + i * step; + fn(ratio, 0, color, 0); + rgbColor = cs.getRgb(color, 0); + const run = i - iBase; + maxSlopeR = Math.min(maxSlopeR, (rgbColor[0] - rgbBase[0] + 1) / run); + maxSlopeG = Math.min(maxSlopeG, (rgbColor[1] - rgbBase[1] + 1) / run); + maxSlopeB = Math.min(maxSlopeB, (rgbColor[2] - rgbBase[2] + 1) / run); + minSlopeR = Math.max(minSlopeR, (rgbColor[0] - rgbBase[0] - 1) / run); + minSlopeG = Math.max(minSlopeG, (rgbColor[1] - rgbBase[1] - 1) / run); + minSlopeB = Math.max(minSlopeB, (rgbColor[2] - rgbBase[2] - 1) / run); + const slopesExist = + minSlopeR <= maxSlopeR && + minSlopeG <= maxSlopeG && + minSlopeB <= maxSlopeB; + if (!slopesExist) { + const cssColor = Util.makeHexColor(rgbPrev[0], rgbPrev[1], rgbPrev[2]); + colorStops.push([iPrev / NUMBER_OF_SAMPLES, cssColor]); + maxSlopeR = rgbColor[0] - rgbPrev[0] + 1; + maxSlopeG = rgbColor[1] - rgbPrev[1] + 1; + maxSlopeB = rgbColor[2] - rgbPrev[2] + 1; + minSlopeR = rgbColor[0] - rgbPrev[0] - 1; + minSlopeG = rgbColor[1] - rgbPrev[1] - 1; + minSlopeB = rgbColor[2] - rgbPrev[2] - 1; + iBase = iPrev; + rgbBase = rgbPrev; } - b = e; - F = m; + iPrev = i; + rgbPrev = rgbColor; } - const U = Util.makeHexColor(F[0], F[1], F[2]); - d.push([1, U]); - let M = "transparent"; - if (e.has("Background")) { - m = n.getRgb(e.get("Background"), 0); - M = Util.makeHexColor(m[0], m[1], m[2]); + const cssColor = Util.makeHexColor(rgbPrev[0], rgbPrev[1], rgbPrev[2]); + colorStops.push([1, cssColor]); + let background = "transparent"; + if (dict.has("Background")) { + rgbColor = cs.getRgb(dict.get("Background"), 0); + background = Util.makeHexColor(rgbColor[0], rgbColor[1], rgbColor[2]); } - if (!C) { - d.unshift([0, M]); - d[1][0] += BaseShading.SMALL_NUMBER; + if (!extendStart) { + colorStops.unshift([0, background]); + colorStops[1][0] += BaseShading.SMALL_NUMBER; } - if (!h) { - d.at(-1)[0] -= BaseShading.SMALL_NUMBER; - d.push([1, M]); + if (!extendEnd) { + colorStops.at(-1)[0] -= BaseShading.SMALL_NUMBER; + colorStops.push([1, background]); } - this.colorStops = d; + this.colorStops = colorStops; } getIR() { - const { coordsArr: e, shadingType: t } = this; - let i, a, s, r, n; - if (t === Ea) { - a = [e[0], e[1]]; - s = [e[2], e[3]]; - r = null; - n = null; - i = "axial"; - } else if (t === ua) { - a = [e[0], e[1]]; - s = [e[3], e[4]]; - r = e[2]; - n = e[5]; - i = "radial"; - } else unreachable(`getPattern type unknown: ${t}`); - return ["RadialAxial", i, this.bbox, this.colorStops, a, s, r, n]; + const { coordsArr, shadingType } = this; + let type, p0, p1, r0, r1; + if (shadingType === ShadingType.AXIAL) { + p0 = [coordsArr[0], coordsArr[1]]; + p1 = [coordsArr[2], coordsArr[3]]; + r0 = null; + r1 = null; + type = "axial"; + } else if (shadingType === ShadingType.RADIAL) { + p0 = [coordsArr[0], coordsArr[1]]; + p1 = [coordsArr[3], coordsArr[4]]; + r0 = coordsArr[2]; + r1 = coordsArr[5]; + type = "radial"; + } else { + unreachable(`getPattern type unknown: ${shadingType}`); + } + return ["RadialAxial", type, this.bbox, this.colorStops, p0, p1, r0, r1]; } } class MeshStreamReader { - constructor(e, t) { - this.stream = e; - this.context = t; + constructor(stream, context) { + this.stream = stream; + this.context = context; this.buffer = 0; this.bufferLength = 0; - const i = t.numComps; - this.tmpCompsBuf = new Float32Array(i); - const a = t.colorSpace.numComps; - this.tmpCsCompsBuf = t.colorFn ? new Float32Array(a) : this.tmpCompsBuf; + const numComps = context.numComps; + this.tmpCompsBuf = new Float32Array(numComps); + const csNumComps = context.colorSpace.numComps; + this.tmpCsCompsBuf = context.colorFn + ? new Float32Array(csNumComps) + : this.tmpCompsBuf; } get hasData() { - if (this.stream.end) return this.stream.pos < this.stream.end; - if (this.bufferLength > 0) return !0; - const e = this.stream.getByte(); - if (e < 0) return !1; - this.buffer = e; + if (this.stream.end) { + return this.stream.pos < this.stream.end; + } + if (this.bufferLength > 0) { + return true; + } + const nextByte = this.stream.getByte(); + if (nextByte < 0) { + return false; + } + this.buffer = nextByte; this.bufferLength = 8; - return !0; + return true; } - readBits(e) { - let t = this.buffer, - i = this.bufferLength; - if (32 === e) { - if (0 === i) + readBits(n) { + let buffer = this.buffer; + let bufferLength = this.bufferLength; + if (n === 32) { + if (bufferLength === 0) { return ( ((this.stream.getByte() << 24) | (this.stream.getByte() << 16) | @@ -27589,24 +32449,31 @@ class MeshStreamReader { this.stream.getByte()) >>> 0 ); - t = - (t << 24) | + } + buffer = + (buffer << 24) | (this.stream.getByte() << 16) | (this.stream.getByte() << 8) | this.stream.getByte(); - const e = this.stream.getByte(); - this.buffer = e & ((1 << i) - 1); - return ((t << (8 - i)) | ((255 & e) >> i)) >>> 0; + const nextByte = this.stream.getByte(); + this.buffer = nextByte & ((1 << bufferLength) - 1); + return ( + ((buffer << (8 - bufferLength)) | + ((nextByte & 0xff) >> bufferLength)) >>> + 0 + ); } - if (8 === e && 0 === i) return this.stream.getByte(); - for (; i < e; ) { - t = (t << 8) | this.stream.getByte(); - i += 8; + if (n === 8 && bufferLength === 0) { + return this.stream.getByte(); } - i -= e; - this.bufferLength = i; - this.buffer = t & ((1 << i) - 1); - return t >> i; + while (bufferLength < n) { + buffer = (buffer << 8) | this.stream.getByte(); + bufferLength += 8; + } + bufferLength -= n; + this.bufferLength = bufferLength; + this.buffer = buffer & ((1 << bufferLength) - 1); + return buffer >> bufferLength; } align() { this.buffer = 0; @@ -27616,585 +32483,651 @@ class MeshStreamReader { return this.readBits(this.context.bitsPerFlag); } readCoordinate() { - const e = this.context.bitsPerCoordinate, - t = this.readBits(e), - i = this.readBits(e), - a = this.context.decode, - s = e < 32 ? 1 / ((1 << e) - 1) : 2.3283064365386963e-10; - return [t * s * (a[1] - a[0]) + a[0], i * s * (a[3] - a[2]) + a[2]]; + const bitsPerCoordinate = this.context.bitsPerCoordinate; + const xi = this.readBits(bitsPerCoordinate); + const yi = this.readBits(bitsPerCoordinate); + const decode = this.context.decode; + const scale = + bitsPerCoordinate < 32 + ? 1 / ((1 << bitsPerCoordinate) - 1) + : 2.3283064365386963e-10; + return [ + xi * scale * (decode[1] - decode[0]) + decode[0], + yi * scale * (decode[3] - decode[2]) + decode[2], + ]; } readComponents() { - const e = this.context.numComps, - t = this.context.bitsPerComponent, - i = t < 32 ? 1 / ((1 << t) - 1) : 2.3283064365386963e-10, - a = this.context.decode, - s = this.tmpCompsBuf; - for (let r = 0, n = 4; r < e; r++, n += 2) { - const e = this.readBits(t); - s[r] = e * i * (a[n + 1] - a[n]) + a[n]; + const numComps = this.context.numComps; + const bitsPerComponent = this.context.bitsPerComponent; + const scale = + bitsPerComponent < 32 + ? 1 / ((1 << bitsPerComponent) - 1) + : 2.3283064365386963e-10; + const decode = this.context.decode; + const components = this.tmpCompsBuf; + for (let i = 0, j = 4; i < numComps; i++, j += 2) { + const ci = this.readBits(bitsPerComponent); + components[i] = ci * scale * (decode[j + 1] - decode[j]) + decode[j]; } - const r = this.tmpCsCompsBuf; - this.context.colorFn && this.context.colorFn(s, 0, r, 0); - return this.context.colorSpace.getRgb(r, 0); + const color = this.tmpCsCompsBuf; + if (this.context.colorFn) { + this.context.colorFn(components, 0, color, 0); + } + return this.context.colorSpace.getRgb(color, 0); } } -let ya = Object.create(null); -function getB(e) { - return (ya[e] ||= (function buildB(e) { - const t = []; - for (let i = 0; i <= e; i++) { - const a = i / e, - s = 1 - a; - t.push( - new Float32Array([s ** 3, 3 * a * s ** 2, 3 * a ** 2 * s, a ** 3]), - ); - } - return t; - })(e)); +let bCache = Object.create(null); +function buildB(count) { + const lut = []; + for (let i = 0; i <= count; i++) { + const t = i / count, + t_ = 1 - t; + lut.push( + new Float32Array([t_ ** 3, 3 * t * t_ ** 2, 3 * t ** 2 * t_, t ** 3]), + ); + } + return lut; +} +function getB(count) { + return (bCache[count] ||= buildB(count)); +} +function clearPatternCaches() { + bCache = Object.create(null); } class MeshShading extends BaseShading { static MIN_SPLIT_PATCH_CHUNKS_AMOUNT = 3; static MAX_SPLIT_PATCH_CHUNKS_AMOUNT = 20; static TRIANGLE_DENSITY = 20; - constructor(e, t, i, a, s) { + constructor( + stream, + xref, + resources, + pdfFunctionFactory, + localColorSpaceCache, + ) { super(); - if (!(e instanceof BaseStream)) + if (!(stream instanceof BaseStream)) { throw new FormatError("Mesh data is not a stream"); - const r = e.dict; - this.shadingType = r.get("ShadingType"); - this.bbox = lookupNormalRect(r.getArray("BBox"), null); - const n = ColorSpace.parse({ - cs: r.getRaw("CS") || r.getRaw("ColorSpace"), - xref: t, - resources: i, - pdfFunctionFactory: a, - localColorSpaceCache: s, + } + const dict = stream.dict; + this.shadingType = dict.get("ShadingType"); + this.bbox = lookupNormalRect(dict.getArray("BBox"), null); + const cs = ColorSpace.parse({ + cs: dict.getRaw("CS") || dict.getRaw("ColorSpace"), + xref, + resources, + pdfFunctionFactory, + localColorSpaceCache, }); - this.background = r.has("Background") - ? n.getRgb(r.get("Background"), 0) + this.background = dict.has("Background") + ? cs.getRgb(dict.get("Background"), 0) : null; - const g = r.getRaw("Function"), - o = g ? a.createFromArray(g) : null; + const fnObj = dict.getRaw("Function"); + const fn = fnObj ? pdfFunctionFactory.createFromArray(fnObj) : null; this.coords = []; this.colors = []; this.figures = []; - const c = { - bitsPerCoordinate: r.get("BitsPerCoordinate"), - bitsPerComponent: r.get("BitsPerComponent"), - bitsPerFlag: r.get("BitsPerFlag"), - decode: r.getArray("Decode"), - colorFn: o, - colorSpace: n, - numComps: o ? 1 : n.numComps, - }, - C = new MeshStreamReader(e, c); - let h = !1; + const decodeContext = { + bitsPerCoordinate: dict.get("BitsPerCoordinate"), + bitsPerComponent: dict.get("BitsPerComponent"), + bitsPerFlag: dict.get("BitsPerFlag"), + decode: dict.getArray("Decode"), + colorFn: fn, + colorSpace: cs, + numComps: fn ? 1 : cs.numComps, + }; + const reader = new MeshStreamReader(stream, decodeContext); + let patchMesh = false; switch (this.shadingType) { - case da: - this._decodeType4Shading(C); + case ShadingType.FREE_FORM_MESH: + this._decodeType4Shading(reader); break; - case fa: - const e = 0 | r.get("VerticesPerRow"); - if (e < 2) throw new FormatError("Invalid VerticesPerRow"); - this._decodeType5Shading(C, e); + case ShadingType.LATTICE_FORM_MESH: + const verticesPerRow = dict.get("VerticesPerRow") | 0; + if (verticesPerRow < 2) { + throw new FormatError("Invalid VerticesPerRow"); + } + this._decodeType5Shading(reader, verticesPerRow); break; - case pa: - this._decodeType6Shading(C); - h = !0; + case ShadingType.COONS_PATCH_MESH: + this._decodeType6Shading(reader); + patchMesh = true; break; - case ma: - this._decodeType7Shading(C); - h = !0; + case ShadingType.TENSOR_PATCH_MESH: + this._decodeType7Shading(reader); + patchMesh = true; break; default: unreachable("Unsupported mesh type."); + break; } - if (h) { + if (patchMesh) { this._updateBounds(); - for (let e = 0, t = this.figures.length; e < t; e++) - this._buildFigureFromPatch(e); + for (let i = 0, ii = this.figures.length; i < ii; i++) { + this._buildFigureFromPatch(i); + } } this._updateBounds(); this._packData(); } - _decodeType4Shading(e) { - const t = this.coords, - i = this.colors, - a = [], - s = []; - let r = 0; - for (; e.hasData; ) { - const n = e.readFlag(), - g = e.readCoordinate(), - o = e.readComponents(); - if (0 === r) { - if (!(0 <= n && n <= 2)) throw new FormatError("Unknown type4 flag"); - switch (n) { + _decodeType4Shading(reader) { + const coords = this.coords; + const colors = this.colors; + const operators = []; + const ps = []; + let verticesLeft = 0; + while (reader.hasData) { + const f = reader.readFlag(); + const coord = reader.readCoordinate(); + const color = reader.readComponents(); + if (verticesLeft === 0) { + if (!(0 <= f && f <= 2)) { + throw new FormatError("Unknown type4 flag"); + } + switch (f) { case 0: - r = 3; + verticesLeft = 3; break; case 1: - s.push(s.at(-2), s.at(-1)); - r = 1; + ps.push(ps.at(-2), ps.at(-1)); + verticesLeft = 1; break; case 2: - s.push(s.at(-3), s.at(-1)); - r = 1; + ps.push(ps.at(-3), ps.at(-1)); + verticesLeft = 1; + break; } - a.push(n); + operators.push(f); } - s.push(t.length); - t.push(g); - i.push(o); - r--; - e.align(); + ps.push(coords.length); + coords.push(coord); + colors.push(color); + verticesLeft--; + reader.align(); } this.figures.push({ type: "triangles", - coords: new Int32Array(s), - colors: new Int32Array(s), + coords: new Int32Array(ps), + colors: new Int32Array(ps), }); } - _decodeType5Shading(e, t) { - const i = this.coords, - a = this.colors, - s = []; - for (; e.hasData; ) { - const t = e.readCoordinate(), - r = e.readComponents(); - s.push(i.length); - i.push(t); - a.push(r); + _decodeType5Shading(reader, verticesPerRow) { + const coords = this.coords; + const colors = this.colors; + const ps = []; + while (reader.hasData) { + const coord = reader.readCoordinate(); + const color = reader.readComponents(); + ps.push(coords.length); + coords.push(coord); + colors.push(color); } this.figures.push({ type: "lattice", - coords: new Int32Array(s), - colors: new Int32Array(s), - verticesPerRow: t, + coords: new Int32Array(ps), + colors: new Int32Array(ps), + verticesPerRow, }); } - _decodeType6Shading(e) { - const t = this.coords, - i = this.colors, - a = new Int32Array(16), - s = new Int32Array(4); - for (; e.hasData; ) { - const r = e.readFlag(); - if (!(0 <= r && r <= 3)) throw new FormatError("Unknown type6 flag"); - const n = t.length; - for (let i = 0, a = 0 !== r ? 8 : 12; i < a; i++) - t.push(e.readCoordinate()); - const g = i.length; - for (let t = 0, a = 0 !== r ? 2 : 4; t < a; t++) - i.push(e.readComponents()); - let o, c, C, h; - switch (r) { + _decodeType6Shading(reader) { + const coords = this.coords; + const colors = this.colors; + const ps = new Int32Array(16); + const cs = new Int32Array(4); + while (reader.hasData) { + const f = reader.readFlag(); + if (!(0 <= f && f <= 3)) { + throw new FormatError("Unknown type6 flag"); + } + const pi = coords.length; + for (let i = 0, ii = f !== 0 ? 8 : 12; i < ii; i++) { + coords.push(reader.readCoordinate()); + } + const ci = colors.length; + for (let i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { + colors.push(reader.readComponents()); + } + let tmp1, tmp2, tmp3, tmp4; + switch (f) { case 0: - a[12] = n + 3; - a[13] = n + 4; - a[14] = n + 5; - a[15] = n + 6; - a[8] = n + 2; - a[11] = n + 7; - a[4] = n + 1; - a[7] = n + 8; - a[0] = n; - a[1] = n + 11; - a[2] = n + 10; - a[3] = n + 9; - s[2] = g + 1; - s[3] = g + 2; - s[0] = g; - s[1] = g + 3; + ps[12] = pi + 3; + ps[13] = pi + 4; + ps[14] = pi + 5; + ps[15] = pi + 6; + ps[8] = pi + 2; + ps[11] = pi + 7; + ps[4] = pi + 1; + ps[7] = pi + 8; + ps[0] = pi; + ps[1] = pi + 11; + ps[2] = pi + 10; + ps[3] = pi + 9; + cs[2] = ci + 1; + cs[3] = ci + 2; + cs[0] = ci; + cs[1] = ci + 3; break; case 1: - o = a[12]; - c = a[13]; - C = a[14]; - h = a[15]; - a[12] = h; - a[13] = n + 0; - a[14] = n + 1; - a[15] = n + 2; - a[8] = C; - a[11] = n + 3; - a[4] = c; - a[7] = n + 4; - a[0] = o; - a[1] = n + 7; - a[2] = n + 6; - a[3] = n + 5; - o = s[2]; - c = s[3]; - s[2] = c; - s[3] = g; - s[0] = o; - s[1] = g + 1; + tmp1 = ps[12]; + tmp2 = ps[13]; + tmp3 = ps[14]; + tmp4 = ps[15]; + ps[12] = tmp4; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = tmp3; + ps[11] = pi + 3; + ps[4] = tmp2; + ps[7] = pi + 4; + ps[0] = tmp1; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + tmp1 = cs[2]; + tmp2 = cs[3]; + cs[2] = tmp2; + cs[3] = ci; + cs[0] = tmp1; + cs[1] = ci + 1; break; case 2: - o = a[15]; - c = a[11]; - a[12] = a[3]; - a[13] = n + 0; - a[14] = n + 1; - a[15] = n + 2; - a[8] = a[7]; - a[11] = n + 3; - a[4] = c; - a[7] = n + 4; - a[0] = o; - a[1] = n + 7; - a[2] = n + 6; - a[3] = n + 5; - o = s[3]; - s[2] = s[1]; - s[3] = g; - s[0] = o; - s[1] = g + 1; + tmp1 = ps[15]; + tmp2 = ps[11]; + ps[12] = ps[3]; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = ps[7]; + ps[11] = pi + 3; + ps[4] = tmp2; + ps[7] = pi + 4; + ps[0] = tmp1; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + tmp1 = cs[3]; + cs[2] = cs[1]; + cs[3] = ci; + cs[0] = tmp1; + cs[1] = ci + 1; break; case 3: - a[12] = a[0]; - a[13] = n + 0; - a[14] = n + 1; - a[15] = n + 2; - a[8] = a[1]; - a[11] = n + 3; - a[4] = a[2]; - a[7] = n + 4; - a[0] = a[3]; - a[1] = n + 7; - a[2] = n + 6; - a[3] = n + 5; - s[2] = s[0]; - s[3] = g; - s[0] = s[1]; - s[1] = g + 1; + ps[12] = ps[0]; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = ps[1]; + ps[11] = pi + 3; + ps[4] = ps[2]; + ps[7] = pi + 4; + ps[0] = ps[3]; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + cs[2] = cs[0]; + cs[3] = ci; + cs[0] = cs[1]; + cs[1] = ci + 1; + break; } - a[5] = t.length; - t.push([ - (-4 * t[a[0]][0] - - t[a[15]][0] + - 6 * (t[a[4]][0] + t[a[1]][0]) - - 2 * (t[a[12]][0] + t[a[3]][0]) + - 3 * (t[a[13]][0] + t[a[7]][0])) / + ps[5] = coords.length; + coords.push([ + (-4 * coords[ps[0]][0] - + coords[ps[15]][0] + + 6 * (coords[ps[4]][0] + coords[ps[1]][0]) - + 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + + 3 * (coords[ps[13]][0] + coords[ps[7]][0])) / 9, - (-4 * t[a[0]][1] - - t[a[15]][1] + - 6 * (t[a[4]][1] + t[a[1]][1]) - - 2 * (t[a[12]][1] + t[a[3]][1]) + - 3 * (t[a[13]][1] + t[a[7]][1])) / + (-4 * coords[ps[0]][1] - + coords[ps[15]][1] + + 6 * (coords[ps[4]][1] + coords[ps[1]][1]) - + 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + + 3 * (coords[ps[13]][1] + coords[ps[7]][1])) / 9, ]); - a[6] = t.length; - t.push([ - (-4 * t[a[3]][0] - - t[a[12]][0] + - 6 * (t[a[2]][0] + t[a[7]][0]) - - 2 * (t[a[0]][0] + t[a[15]][0]) + - 3 * (t[a[4]][0] + t[a[14]][0])) / + ps[6] = coords.length; + coords.push([ + (-4 * coords[ps[3]][0] - + coords[ps[12]][0] + + 6 * (coords[ps[2]][0] + coords[ps[7]][0]) - + 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + + 3 * (coords[ps[4]][0] + coords[ps[14]][0])) / 9, - (-4 * t[a[3]][1] - - t[a[12]][1] + - 6 * (t[a[2]][1] + t[a[7]][1]) - - 2 * (t[a[0]][1] + t[a[15]][1]) + - 3 * (t[a[4]][1] + t[a[14]][1])) / + (-4 * coords[ps[3]][1] - + coords[ps[12]][1] + + 6 * (coords[ps[2]][1] + coords[ps[7]][1]) - + 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + + 3 * (coords[ps[4]][1] + coords[ps[14]][1])) / 9, ]); - a[9] = t.length; - t.push([ - (-4 * t[a[12]][0] - - t[a[3]][0] + - 6 * (t[a[8]][0] + t[a[13]][0]) - - 2 * (t[a[0]][0] + t[a[15]][0]) + - 3 * (t[a[11]][0] + t[a[1]][0])) / + ps[9] = coords.length; + coords.push([ + (-4 * coords[ps[12]][0] - + coords[ps[3]][0] + + 6 * (coords[ps[8]][0] + coords[ps[13]][0]) - + 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + + 3 * (coords[ps[11]][0] + coords[ps[1]][0])) / 9, - (-4 * t[a[12]][1] - - t[a[3]][1] + - 6 * (t[a[8]][1] + t[a[13]][1]) - - 2 * (t[a[0]][1] + t[a[15]][1]) + - 3 * (t[a[11]][1] + t[a[1]][1])) / + (-4 * coords[ps[12]][1] - + coords[ps[3]][1] + + 6 * (coords[ps[8]][1] + coords[ps[13]][1]) - + 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + + 3 * (coords[ps[11]][1] + coords[ps[1]][1])) / 9, ]); - a[10] = t.length; - t.push([ - (-4 * t[a[15]][0] - - t[a[0]][0] + - 6 * (t[a[11]][0] + t[a[14]][0]) - - 2 * (t[a[12]][0] + t[a[3]][0]) + - 3 * (t[a[2]][0] + t[a[8]][0])) / + ps[10] = coords.length; + coords.push([ + (-4 * coords[ps[15]][0] - + coords[ps[0]][0] + + 6 * (coords[ps[11]][0] + coords[ps[14]][0]) - + 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + + 3 * (coords[ps[2]][0] + coords[ps[8]][0])) / 9, - (-4 * t[a[15]][1] - - t[a[0]][1] + - 6 * (t[a[11]][1] + t[a[14]][1]) - - 2 * (t[a[12]][1] + t[a[3]][1]) + - 3 * (t[a[2]][1] + t[a[8]][1])) / + (-4 * coords[ps[15]][1] - + coords[ps[0]][1] + + 6 * (coords[ps[11]][1] + coords[ps[14]][1]) - + 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + + 3 * (coords[ps[2]][1] + coords[ps[8]][1])) / 9, ]); this.figures.push({ type: "patch", - coords: new Int32Array(a), - colors: new Int32Array(s), + coords: new Int32Array(ps), + colors: new Int32Array(cs), }); } } - _decodeType7Shading(e) { - const t = this.coords, - i = this.colors, - a = new Int32Array(16), - s = new Int32Array(4); - for (; e.hasData; ) { - const r = e.readFlag(); - if (!(0 <= r && r <= 3)) throw new FormatError("Unknown type7 flag"); - const n = t.length; - for (let i = 0, a = 0 !== r ? 12 : 16; i < a; i++) - t.push(e.readCoordinate()); - const g = i.length; - for (let t = 0, a = 0 !== r ? 2 : 4; t < a; t++) - i.push(e.readComponents()); - let o, c, C, h; - switch (r) { + _decodeType7Shading(reader) { + const coords = this.coords; + const colors = this.colors; + const ps = new Int32Array(16); + const cs = new Int32Array(4); + while (reader.hasData) { + const f = reader.readFlag(); + if (!(0 <= f && f <= 3)) { + throw new FormatError("Unknown type7 flag"); + } + const pi = coords.length; + for (let i = 0, ii = f !== 0 ? 12 : 16; i < ii; i++) { + coords.push(reader.readCoordinate()); + } + const ci = colors.length; + for (let i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { + colors.push(reader.readComponents()); + } + let tmp1, tmp2, tmp3, tmp4; + switch (f) { case 0: - a[12] = n + 3; - a[13] = n + 4; - a[14] = n + 5; - a[15] = n + 6; - a[8] = n + 2; - a[9] = n + 13; - a[10] = n + 14; - a[11] = n + 7; - a[4] = n + 1; - a[5] = n + 12; - a[6] = n + 15; - a[7] = n + 8; - a[0] = n; - a[1] = n + 11; - a[2] = n + 10; - a[3] = n + 9; - s[2] = g + 1; - s[3] = g + 2; - s[0] = g; - s[1] = g + 3; + ps[12] = pi + 3; + ps[13] = pi + 4; + ps[14] = pi + 5; + ps[15] = pi + 6; + ps[8] = pi + 2; + ps[9] = pi + 13; + ps[10] = pi + 14; + ps[11] = pi + 7; + ps[4] = pi + 1; + ps[5] = pi + 12; + ps[6] = pi + 15; + ps[7] = pi + 8; + ps[0] = pi; + ps[1] = pi + 11; + ps[2] = pi + 10; + ps[3] = pi + 9; + cs[2] = ci + 1; + cs[3] = ci + 2; + cs[0] = ci; + cs[1] = ci + 3; break; case 1: - o = a[12]; - c = a[13]; - C = a[14]; - h = a[15]; - a[12] = h; - a[13] = n + 0; - a[14] = n + 1; - a[15] = n + 2; - a[8] = C; - a[9] = n + 9; - a[10] = n + 10; - a[11] = n + 3; - a[4] = c; - a[5] = n + 8; - a[6] = n + 11; - a[7] = n + 4; - a[0] = o; - a[1] = n + 7; - a[2] = n + 6; - a[3] = n + 5; - o = s[2]; - c = s[3]; - s[2] = c; - s[3] = g; - s[0] = o; - s[1] = g + 1; + tmp1 = ps[12]; + tmp2 = ps[13]; + tmp3 = ps[14]; + tmp4 = ps[15]; + ps[12] = tmp4; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = tmp3; + ps[9] = pi + 9; + ps[10] = pi + 10; + ps[11] = pi + 3; + ps[4] = tmp2; + ps[5] = pi + 8; + ps[6] = pi + 11; + ps[7] = pi + 4; + ps[0] = tmp1; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + tmp1 = cs[2]; + tmp2 = cs[3]; + cs[2] = tmp2; + cs[3] = ci; + cs[0] = tmp1; + cs[1] = ci + 1; break; case 2: - o = a[15]; - c = a[11]; - a[12] = a[3]; - a[13] = n + 0; - a[14] = n + 1; - a[15] = n + 2; - a[8] = a[7]; - a[9] = n + 9; - a[10] = n + 10; - a[11] = n + 3; - a[4] = c; - a[5] = n + 8; - a[6] = n + 11; - a[7] = n + 4; - a[0] = o; - a[1] = n + 7; - a[2] = n + 6; - a[3] = n + 5; - o = s[3]; - s[2] = s[1]; - s[3] = g; - s[0] = o; - s[1] = g + 1; + tmp1 = ps[15]; + tmp2 = ps[11]; + ps[12] = ps[3]; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = ps[7]; + ps[9] = pi + 9; + ps[10] = pi + 10; + ps[11] = pi + 3; + ps[4] = tmp2; + ps[5] = pi + 8; + ps[6] = pi + 11; + ps[7] = pi + 4; + ps[0] = tmp1; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + tmp1 = cs[3]; + cs[2] = cs[1]; + cs[3] = ci; + cs[0] = tmp1; + cs[1] = ci + 1; break; case 3: - a[12] = a[0]; - a[13] = n + 0; - a[14] = n + 1; - a[15] = n + 2; - a[8] = a[1]; - a[9] = n + 9; - a[10] = n + 10; - a[11] = n + 3; - a[4] = a[2]; - a[5] = n + 8; - a[6] = n + 11; - a[7] = n + 4; - a[0] = a[3]; - a[1] = n + 7; - a[2] = n + 6; - a[3] = n + 5; - s[2] = s[0]; - s[3] = g; - s[0] = s[1]; - s[1] = g + 1; + ps[12] = ps[0]; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = ps[1]; + ps[9] = pi + 9; + ps[10] = pi + 10; + ps[11] = pi + 3; + ps[4] = ps[2]; + ps[5] = pi + 8; + ps[6] = pi + 11; + ps[7] = pi + 4; + ps[0] = ps[3]; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + cs[2] = cs[0]; + cs[3] = ci; + cs[0] = cs[1]; + cs[1] = ci + 1; + break; } this.figures.push({ type: "patch", - coords: new Int32Array(a), - colors: new Int32Array(s), + coords: new Int32Array(ps), + colors: new Int32Array(cs), }); } } - _buildFigureFromPatch(e) { - const t = this.figures[e]; - assert("patch" === t.type, "Unexpected patch mesh figure"); - const i = this.coords, - a = this.colors, - s = t.coords, - r = t.colors, - n = Math.min(i[s[0]][0], i[s[3]][0], i[s[12]][0], i[s[15]][0]), - g = Math.min(i[s[0]][1], i[s[3]][1], i[s[12]][1], i[s[15]][1]), - o = Math.max(i[s[0]][0], i[s[3]][0], i[s[12]][0], i[s[15]][0]), - c = Math.max(i[s[0]][1], i[s[3]][1], i[s[12]][1], i[s[15]][1]); - let C = Math.ceil( - ((o - n) * MeshShading.TRIANGLE_DENSITY) / + _buildFigureFromPatch(index) { + const figure = this.figures[index]; + assert(figure.type === "patch", "Unexpected patch mesh figure"); + const coords = this.coords, + colors = this.colors; + const pi = figure.coords; + const ci = figure.colors; + const figureMinX = Math.min( + coords[pi[0]][0], + coords[pi[3]][0], + coords[pi[12]][0], + coords[pi[15]][0], + ); + const figureMinY = Math.min( + coords[pi[0]][1], + coords[pi[3]][1], + coords[pi[12]][1], + coords[pi[15]][1], + ); + const figureMaxX = Math.max( + coords[pi[0]][0], + coords[pi[3]][0], + coords[pi[12]][0], + coords[pi[15]][0], + ); + const figureMaxY = Math.max( + coords[pi[0]][1], + coords[pi[3]][1], + coords[pi[12]][1], + coords[pi[15]][1], + ); + let splitXBy = Math.ceil( + ((figureMaxX - figureMinX) * MeshShading.TRIANGLE_DENSITY) / (this.bounds[2] - this.bounds[0]), ); - C = Math.max( + splitXBy = Math.max( MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, - Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, C), + Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitXBy), ); - let h = Math.ceil( - ((c - g) * MeshShading.TRIANGLE_DENSITY) / + let splitYBy = Math.ceil( + ((figureMaxY - figureMinY) * MeshShading.TRIANGLE_DENSITY) / (this.bounds[3] - this.bounds[1]), ); - h = Math.max( + splitYBy = Math.max( MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, - Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, h), + Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitYBy), ); - const l = C + 1, - Q = new Int32Array((h + 1) * l), - E = new Int32Array((h + 1) * l); - let u = 0; - const d = new Uint8Array(3), - f = new Uint8Array(3), - p = a[r[0]], - m = a[r[1]], - y = a[r[2]], - w = a[r[3]], - D = getB(h), - b = getB(C); - for (let e = 0; e <= h; e++) { - d[0] = ((p[0] * (h - e) + y[0] * e) / h) | 0; - d[1] = ((p[1] * (h - e) + y[1] * e) / h) | 0; - d[2] = ((p[2] * (h - e) + y[2] * e) / h) | 0; - f[0] = ((m[0] * (h - e) + w[0] * e) / h) | 0; - f[1] = ((m[1] * (h - e) + w[1] * e) / h) | 0; - f[2] = ((m[2] * (h - e) + w[2] * e) / h) | 0; - for (let t = 0; t <= C; t++, u++) { - if (!((0 !== e && e !== h) || (0 !== t && t !== C))) continue; - let r = 0, - n = 0, - g = 0; - for (let a = 0; a <= 3; a++) - for (let o = 0; o <= 3; o++, g++) { - const c = D[e][a] * b[t][o]; - r += i[s[g]][0] * c; - n += i[s[g]][1] * c; + const verticesPerRow = splitXBy + 1; + const figureCoords = new Int32Array((splitYBy + 1) * verticesPerRow); + const figureColors = new Int32Array((splitYBy + 1) * verticesPerRow); + let k = 0; + const cl = new Uint8Array(3), + cr = new Uint8Array(3); + const c0 = colors[ci[0]], + c1 = colors[ci[1]], + c2 = colors[ci[2]], + c3 = colors[ci[3]]; + const bRow = getB(splitYBy), + bCol = getB(splitXBy); + for (let row = 0; row <= splitYBy; row++) { + cl[0] = ((c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy) | 0; + cl[1] = ((c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy) | 0; + cl[2] = ((c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy) | 0; + cr[0] = ((c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy) | 0; + cr[1] = ((c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy) | 0; + cr[2] = ((c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy) | 0; + for (let col = 0; col <= splitXBy; col++, k++) { + if ( + (row === 0 || row === splitYBy) && + (col === 0 || col === splitXBy) + ) { + continue; + } + let x = 0, + y = 0; + let q = 0; + for (let i = 0; i <= 3; i++) { + for (let j = 0; j <= 3; j++, q++) { + const m = bRow[row][i] * bCol[col][j]; + x += coords[pi[q]][0] * m; + y += coords[pi[q]][1] * m; } - Q[u] = i.length; - i.push([r, n]); - E[u] = a.length; - const o = new Uint8Array(3); - o[0] = ((d[0] * (C - t) + f[0] * t) / C) | 0; - o[1] = ((d[1] * (C - t) + f[1] * t) / C) | 0; - o[2] = ((d[2] * (C - t) + f[2] * t) / C) | 0; - a.push(o); + } + figureCoords[k] = coords.length; + coords.push([x, y]); + figureColors[k] = colors.length; + const newColor = new Uint8Array(3); + newColor[0] = ((cl[0] * (splitXBy - col) + cr[0] * col) / splitXBy) | 0; + newColor[1] = ((cl[1] * (splitXBy - col) + cr[1] * col) / splitXBy) | 0; + newColor[2] = ((cl[2] * (splitXBy - col) + cr[2] * col) / splitXBy) | 0; + colors.push(newColor); } } - Q[0] = s[0]; - E[0] = r[0]; - Q[C] = s[3]; - E[C] = r[1]; - Q[l * h] = s[12]; - E[l * h] = r[2]; - Q[l * h + C] = s[15]; - E[l * h + C] = r[3]; - this.figures[e] = { + figureCoords[0] = pi[0]; + figureColors[0] = ci[0]; + figureCoords[splitXBy] = pi[3]; + figureColors[splitXBy] = ci[1]; + figureCoords[verticesPerRow * splitYBy] = pi[12]; + figureColors[verticesPerRow * splitYBy] = ci[2]; + figureCoords[verticesPerRow * splitYBy + splitXBy] = pi[15]; + figureColors[verticesPerRow * splitYBy + splitXBy] = ci[3]; + this.figures[index] = { type: "lattice", - coords: Q, - colors: E, - verticesPerRow: l, + coords: figureCoords, + colors: figureColors, + verticesPerRow, }; } _updateBounds() { - let e = this.coords[0][0], - t = this.coords[0][1], - i = e, - a = t; - for (let s = 1, r = this.coords.length; s < r; s++) { - const r = this.coords[s][0], - n = this.coords[s][1]; - e = e > r ? r : e; - t = t > n ? n : t; - i = i < r ? r : i; - a = a < n ? n : a; + let minX = this.coords[0][0], + minY = this.coords[0][1], + maxX = minX, + maxY = minY; + for (let i = 1, ii = this.coords.length; i < ii; i++) { + const x = this.coords[i][0], + y = this.coords[i][1]; + minX = minX > x ? x : minX; + minY = minY > y ? y : minY; + maxX = maxX < x ? x : maxX; + maxY = maxY < y ? y : maxY; } - this.bounds = [e, t, i, a]; + this.bounds = [minX, minY, maxX, maxY]; } _packData() { - let e, t, i, a; - const s = this.coords, - r = new Float32Array(2 * s.length); - for (e = 0, i = 0, t = s.length; e < t; e++) { - const t = s[e]; - r[i++] = t[0]; - r[i++] = t[1]; + let i, ii, j, jj; + const coords = this.coords; + const coordsPacked = new Float32Array(coords.length * 2); + for (i = 0, j = 0, ii = coords.length; i < ii; i++) { + const xy = coords[i]; + coordsPacked[j++] = xy[0]; + coordsPacked[j++] = xy[1]; } - this.coords = r; - const n = this.colors, - g = new Uint8Array(3 * n.length); - for (e = 0, i = 0, t = n.length; e < t; e++) { - const t = n[e]; - g[i++] = t[0]; - g[i++] = t[1]; - g[i++] = t[2]; + this.coords = coordsPacked; + const colors = this.colors; + const colorsPacked = new Uint8Array(colors.length * 3); + for (i = 0, j = 0, ii = colors.length; i < ii; i++) { + const c = colors[i]; + colorsPacked[j++] = c[0]; + colorsPacked[j++] = c[1]; + colorsPacked[j++] = c[2]; } - this.colors = g; - const o = this.figures; - for (e = 0, t = o.length; e < t; e++) { - const t = o[e], - s = t.coords, - r = t.colors; - for (i = 0, a = s.length; i < a; i++) { - s[i] *= 2; - r[i] *= 3; + this.colors = colorsPacked; + const figures = this.figures; + for (i = 0, ii = figures.length; i < ii; i++) { + const figure = figures[i], + ps = figure.coords, + cs = figure.colors; + for (j = 0, jj = ps.length; j < jj; j++) { + ps[j] *= 2; + cs[j] *= 3; } } } getIR() { - const { bounds: e } = this; - if (e[2] - e[0] == 0 || e[3] - e[1] == 0) - throw new FormatError(`Invalid MeshShading bounds: [${e}].`); + const { bounds } = this; + if (bounds[2] - bounds[0] === 0 || bounds[3] - bounds[1] === 0) { + throw new FormatError(`Invalid MeshShading bounds: [${bounds}].`); + } return [ "Mesh", this.shadingType, this.coords, this.colors, this.figures, - e, + bounds, this.bbox, this.background, ]; @@ -28205,1747 +33138,1795 @@ class DummyShading extends BaseShading { return ["Dummy"]; } } -function getTilingPatternIR(e, t, a) { - const s = lookupMatrix(t.getArray("Matrix"), i), - r = lookupNormalRect(t.getArray("BBox"), null); - if (!r || r[2] - r[0] == 0 || r[3] - r[1] == 0) - throw new FormatError("Invalid getTilingPatternIR /BBox array."); - const n = t.get("XStep"); - if ("number" != typeof n) - throw new FormatError("Invalid getTilingPatternIR /XStep value."); - const g = t.get("YStep"); - if ("number" != typeof g) - throw new FormatError("Invalid getTilingPatternIR /YStep value."); - const o = t.get("PaintType"); - if (!Number.isInteger(o)) - throw new FormatError("Invalid getTilingPatternIR /PaintType value."); - const c = t.get("TilingType"); - if (!Number.isInteger(c)) - throw new FormatError("Invalid getTilingPatternIR /TilingType value."); - return ["TilingPattern", a, e, s, r, n, g, o, c]; +function getTilingPatternIR(operatorList, dict, color) { + const matrix = lookupMatrix(dict.getArray("Matrix"), IDENTITY_MATRIX); + const bbox = lookupNormalRect(dict.getArray("BBox"), null); + if (!bbox || bbox[2] - bbox[0] === 0 || bbox[3] - bbox[1] === 0) { + throw new FormatError(`Invalid getTilingPatternIR /BBox array.`); + } + const xstep = dict.get("XStep"); + if (typeof xstep !== "number") { + throw new FormatError(`Invalid getTilingPatternIR /XStep value.`); + } + const ystep = dict.get("YStep"); + if (typeof ystep !== "number") { + throw new FormatError(`Invalid getTilingPatternIR /YStep value.`); + } + const paintType = dict.get("PaintType"); + if (!Number.isInteger(paintType)) { + throw new FormatError(`Invalid getTilingPatternIR /PaintType value.`); + } + const tilingType = dict.get("TilingType"); + if (!Number.isInteger(tilingType)) { + throw new FormatError(`Invalid getTilingPatternIR /TilingType value.`); + } + return [ + "TilingPattern", + color, + operatorList, + matrix, + bbox, + xstep, + ystep, + paintType, + tilingType, + ]; +} // ./src/core/calibri_factors.js + +const CalibriBoldFactors = [ + 1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, + 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.54657, + 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, + 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, + 0.92138, 0.83908, 0.7762, 0.73293, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356, + 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.9121, 0.86943, 0.79795, + 0.88198, 0.77958, 0.70864, 0.81055, 0.90399, 0.88653, 0.96017, 0.82577, + 0.77892, 0.78257, 0.97507, 1.54657, 0.97507, 0.85284, 0.89552, 0.90176, + 0.88762, 0.8785, 0.75241, 0.8785, 0.90518, 0.95015, 0.77618, 0.8785, 0.88401, + 0.91916, 0.86304, 0.88401, 0.91488, 0.8785, 0.8801, 0.8785, 0.8785, 0.91343, + 0.7173, 1.04106, 0.8785, 0.85075, 0.95794, 0.82616, 0.85162, 0.79492, 0.88331, + 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, + 1.7801, 0.89552, 1.24487, 1.13254, 1.12401, 0.96839, 0.85284, 0.68787, + 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1, 1.07463, 1, 0.91056, + 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133, 0.75859, 0.83908, + 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539, 0.73293, 0.73133, + 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958, 0.95958, 0.88506, + 0.9121, 0.86943, 0.86943, 0.86943, 0.86943, 0.86943, 0.85284, 0.87508, + 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795, 0.90807, 0.88762, + 0.88762, 0.88762, 0.88762, 0.88762, 0.88762, 0.8715, 0.75241, 0.90518, + 0.90518, 0.90518, 0.90518, 0.88401, 0.88401, 0.88401, 0.88401, 0.8785, 0.8785, + 0.8801, 0.8801, 0.8801, 0.8801, 0.8801, 0.90747, 0.89049, 0.8785, 0.8785, + 0.8785, 0.8785, 0.85162, 0.8785, 0.85162, 0.83908, 0.88762, 0.83908, 0.88762, + 0.83908, 0.88762, 0.73293, 0.75241, 0.73293, 0.75241, 0.73293, 0.75241, + 0.73293, 0.75241, 0.87289, 0.83016, 0.88506, 0.93125, 0.73133, 0.90518, + 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, + 0.81921, 0.77618, 0.81921, 0.77618, 0.81921, 0.77618, 1, 1, 0.87356, 0.8785, + 0.91075, 0.89608, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, + 0.95958, 0.88401, 0.95958, 0.88401, 0.76229, 0.90167, 0.59526, 0.91916, 1, 1, + 0.86304, 0.69225, 0.88401, 1, 1, 0.70424, 0.79468, 0.91926, 0.88175, 0.70823, + 0.94903, 0.9121, 0.8785, 1, 1, 0.9121, 0.8785, 0.87802, 0.88656, 0.8785, + 0.86943, 0.8801, 0.86943, 0.8801, 0.86943, 0.8801, 0.87402, 0.89291, 0.77958, + 0.91343, 1, 1, 0.77958, 0.91343, 0.70864, 0.7173, 0.70864, 0.7173, 0.70864, + 0.7173, 0.70864, 0.7173, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, + 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, + 0.90399, 0.8785, 0.96017, 0.95794, 0.77892, 0.85162, 0.77892, 0.78257, + 0.79492, 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, + 0.88762, 0.77539, 0.8715, 0.87508, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, + 1.20528, 1, 1.15543, 0.70674, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, + 1.06303, 0.83908, 0.80352, 0.57184, 0.6965, 0.56289, 0.82001, 0.56029, + 0.81235, 1.02988, 0.83908, 0.7762, 0.68156, 0.80367, 0.73133, 0.78257, + 0.87356, 0.86943, 0.95958, 0.75727, 0.89019, 1.04924, 0.9121, 0.7648, 0.86943, + 0.87356, 0.79795, 0.78275, 0.81055, 0.77892, 0.9762, 0.82577, 0.99819, + 0.84896, 0.95958, 0.77892, 0.96108, 1.01407, 0.89049, 1.02988, 0.94211, + 0.96108, 0.8936, 0.84021, 0.87842, 0.96399, 0.79109, 0.89049, 1.00813, + 1.02988, 0.86077, 0.87445, 0.92099, 0.84723, 0.86513, 0.8801, 0.75638, + 0.85714, 0.78216, 0.79586, 0.87965, 0.94211, 0.97747, 0.78287, 0.97926, + 0.84971, 1.02988, 0.94211, 0.8801, 0.94211, 0.84971, 0.73133, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0.90264, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0.90518, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90548, 1, 1, 1, 1, 1, 1, + 0.96017, 0.95794, 0.96017, 0.95794, 0.96017, 0.95794, 0.77892, 0.85162, 1, 1, + 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.92794, 0.87012, + 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71143, 1.06152, 1, 1, 1.03372, + 1.03372, 0.97171, 1.4956, 2.2807, 0.93835, 0.83406, 0.91133, 0.84107, 0.91133, + 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90527, + 1.81055, 0.90527, 1.81055, 1.31006, 1.53711, 0.94434, 1.08696, 1, 0.95018, + 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747, + 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, + 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1, + 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +]; +const CalibriBoldMetrics = { + lineHeight: 1.2207, + lineGap: 0.2207, +}; +const CalibriBoldItalicFactors = [ + 1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, + 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.56239, + 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, + 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, + 0.92138, 0.83908, 0.7762, 0.71805, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356, + 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.90872, 0.85938, 0.79795, + 0.87068, 0.77958, 0.69766, 0.81055, 0.90399, 0.88653, 0.96068, 0.82577, + 0.77892, 0.78257, 0.97507, 1.529, 0.97507, 0.85284, 0.89552, 0.90176, 0.94908, + 0.86411, 0.74012, 0.86411, 0.88323, 0.95015, 0.86411, 0.86331, 0.88401, + 0.91916, 0.86304, 0.88401, 0.9039, 0.86331, 0.86331, 0.86411, 0.86411, + 0.90464, 0.70852, 1.04106, 0.86331, 0.84372, 0.95794, 0.82616, 0.84548, + 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133, + 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, 1.19129, 0.96839, + 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1, + 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133, + 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539, + 0.71805, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958, + 0.95958, 0.88506, 0.90872, 0.85938, 0.85938, 0.85938, 0.85938, 0.85938, + 0.85284, 0.87068, 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795, + 0.90807, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.85887, + 0.74012, 0.88323, 0.88323, 0.88323, 0.88323, 0.88401, 0.88401, 0.88401, + 0.88401, 0.8785, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331, + 0.90747, 0.89049, 0.86331, 0.86331, 0.86331, 0.86331, 0.84548, 0.86411, + 0.84548, 0.83908, 0.94908, 0.83908, 0.94908, 0.83908, 0.94908, 0.71805, + 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.87289, + 0.79538, 0.88506, 0.92726, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, + 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.81921, 0.86411, 0.81921, + 0.86411, 0.81921, 0.86411, 1, 1, 0.87356, 0.86331, 0.91075, 0.8777, 0.95958, + 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, + 0.88401, 0.76467, 0.90167, 0.59526, 0.91916, 1, 1, 0.86304, 0.69225, 0.88401, + 1, 1, 0.70424, 0.77312, 0.91926, 0.88175, 0.70823, 0.94903, 0.90872, 0.86331, + 1, 1, 0.90872, 0.86331, 0.86906, 0.88116, 0.86331, 0.85938, 0.86331, 0.85938, + 0.86331, 0.85938, 0.86331, 0.87402, 0.86549, 0.77958, 0.90464, 1, 1, 0.77958, + 0.90464, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, + 0.70852, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.86331, 0.90399, + 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, + 0.86331, 0.96068, 0.95794, 0.77892, 0.84548, 0.77892, 0.78257, 0.79492, + 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.94908, + 0.77539, 0.85887, 0.87068, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528, + 1, 1.15543, 0.70088, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.48387, + 0.83908, 0.80352, 0.57118, 0.6965, 0.56347, 0.79179, 0.55853, 0.80346, + 1.02988, 0.83908, 0.7762, 0.67174, 0.86036, 0.73133, 0.78257, 0.87356, + 0.86441, 0.95958, 0.75727, 0.89019, 1.04924, 0.90872, 0.74889, 0.85938, + 0.87891, 0.79795, 0.7957, 0.81055, 0.77892, 0.97447, 0.82577, 0.97466, + 0.87179, 0.95958, 0.77892, 0.94252, 0.95612, 0.8753, 1.02988, 0.92733, + 0.94252, 0.87411, 0.84021, 0.8728, 0.95612, 0.74081, 0.8753, 1.02189, 1.02988, + 0.84814, 0.87445, 0.91822, 0.84723, 0.85668, 0.86331, 0.81344, 0.87581, + 0.76422, 0.82046, 0.96057, 0.92733, 0.99375, 0.78022, 0.95452, 0.86015, + 1.02988, 0.92733, 0.86331, 0.92733, 0.86015, 0.73133, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 0.90631, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.88323, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85174, 1, 1, 1, 1, 1, 1, 0.96068, 0.95794, + 0.96068, 0.95794, 0.96068, 0.95794, 0.77892, 0.84548, 1, 1, 0.89552, 0.90527, + 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.89807, 0.87012, 0.87012, 0.87012, + 0.89552, 0.89552, 1.42259, 0.71094, 1.06152, 1, 1, 1.03372, 1.03372, 0.97171, + 1.4956, 2.2807, 0.92972, 0.83406, 0.91133, 0.83326, 0.91133, 1, 1, 1, 0.72021, + 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90616, 1.81055, 0.90527, + 1.81055, 1.3107, 1.53711, 0.94434, 1.08696, 1, 0.95018, 0.77192, 0.85284, + 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747, 0.90747, 0.85356, + 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, + 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, +]; +const CalibriBoldItalicMetrics = { + lineHeight: 1.2207, + lineGap: 0.2207, +}; +const CalibriItalicFactors = [ + 1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601, + 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39543, 0.91133, + 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, + 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071, + 0.8675, 0.81552, 0.72346, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685, + 0.6377, 0.77892, 0.75593, 1.02638, 0.89249, 0.84118, 0.77452, 0.85374, + 0.75186, 0.67789, 0.79776, 0.88844, 0.85066, 0.94309, 0.77818, 0.7306, + 0.76659, 1.10369, 1.38313, 1.10369, 1.06139, 0.89552, 0.8739, 0.9245, 0.9245, + 0.83203, 0.9245, 0.85865, 1.09842, 0.9245, 0.9245, 1.03297, 1.07692, 0.90918, + 1.03297, 0.94959, 0.9245, 0.92274, 0.9245, 0.9245, 1.02933, 0.77832, 1.20562, + 0.9245, 0.8916, 0.98986, 0.86621, 0.89453, 0.79004, 0.94152, 1.77256, 0.94152, + 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.91729, 0.89552, + 1.17889, 1.13254, 1.16359, 0.92098, 0.85284, 0.68787, 0.71353, 0.84737, + 0.90747, 1.0088, 1.0044, 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642, + 0.92098, 0.76288, 0.80504, 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, + 0.8675, 0.8675, 0.76318, 0.72346, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, + 0.90685, 0.90685, 0.90685, 0.86477, 0.89249, 0.84118, 0.84118, 0.84118, + 0.84118, 0.84118, 0.85284, 0.84557, 0.88844, 0.88844, 0.88844, 0.88844, + 0.7306, 0.77452, 0.86331, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, + 0.84843, 0.83203, 0.85865, 0.85865, 0.85865, 0.85865, 0.82601, 0.82601, + 0.82601, 0.82601, 0.94469, 0.9245, 0.92274, 0.92274, 0.92274, 0.92274, + 0.92274, 0.90747, 0.86651, 0.9245, 0.9245, 0.9245, 0.9245, 0.89453, 0.9245, + 0.89453, 0.8675, 0.9245, 0.8675, 0.9245, 0.8675, 0.9245, 0.72346, 0.83203, + 0.72346, 0.83203, 0.72346, 0.83203, 0.72346, 0.83203, 0.85193, 0.8875, + 0.86477, 0.99034, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, + 0.73206, 0.85865, 0.73206, 0.85865, 0.81105, 0.9245, 0.81105, 0.9245, 0.81105, + 0.9245, 1, 1, 0.86275, 0.9245, 0.90872, 0.93591, 0.90685, 0.82601, 0.90685, + 0.82601, 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, 0.82601, 0.77896, + 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, 1, 1, 0.76032, + 0.9375, 0.98156, 0.93407, 0.77261, 1.11429, 0.89249, 0.9245, 1, 1, 0.89249, + 0.9245, 0.92534, 0.86698, 0.9245, 0.84118, 0.92274, 0.84118, 0.92274, 0.84118, + 0.92274, 0.8667, 0.86291, 0.75186, 1.02933, 1, 1, 0.75186, 1.02933, 0.67789, + 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 1, 1, 0.79776, + 0.97655, 0.79776, 1.23023, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, + 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.94309, 0.98986, 0.7306, + 0.89453, 0.7306, 0.76659, 0.79004, 0.76659, 0.79004, 0.76659, 0.79004, + 1.09231, 0.54873, 0.8675, 0.9245, 0.76318, 0.84843, 0.84557, 0.86651, 1, 1, + 0.79776, 1.20562, 1.18622, 1.18622, 1, 1.1437, 0.67009, 0.96334, 0.93695, + 1.35191, 1.40909, 0.95161, 1.48387, 0.8675, 0.90861, 0.6192, 0.7363, 0.64824, + 0.82411, 0.56321, 0.85696, 1.23516, 0.8675, 0.81552, 0.7286, 0.84134, 0.73206, + 0.76659, 0.86275, 0.84369, 0.90685, 0.77892, 0.85871, 1.02638, 0.89249, + 0.75828, 0.84118, 0.85984, 0.77452, 0.76466, 0.79776, 0.7306, 0.90782, + 0.77818, 0.903, 0.87291, 0.90685, 0.7306, 0.99058, 1.03667, 0.94635, 1.23516, + 0.9849, 0.99058, 0.92393, 0.8916, 0.942, 1.03667, 0.75026, 0.94635, 1.0297, + 1.23516, 0.90918, 0.94048, 0.98217, 0.89746, 0.84153, 0.92274, 0.82507, + 0.88832, 0.84438, 0.88178, 1.03525, 0.9849, 1.00225, 0.78086, 0.97248, + 0.89404, 1.23516, 0.9849, 0.92274, 0.9849, 0.89404, 0.73206, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0.89693, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85865, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90933, 1, 1, 1, 1, 1, 1, 0.94309, + 0.98986, 0.94309, 0.98986, 0.94309, 0.98986, 0.7306, 0.89453, 1, 1, 0.89552, + 0.90527, 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, + 1.2566, 0.89552, 0.89552, 1.42259, 0.68994, 1.03809, 1, 1, 1.0176, 1.0176, + 1.11523, 1.4956, 2.01462, 0.97858, 0.82616, 0.91133, 0.83437, 0.91133, 1, 1, + 1, 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90572, 1.81055, + 0.90749, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, + 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, + 0.85284, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, + 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, + 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +]; +const CalibriItalicMetrics = { + lineHeight: 1.2207, + lineGap: 0.2207, +}; +const CalibriRegularFactors = [ + 1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601, + 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39016, 0.91133, + 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, + 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071, + 0.8675, 0.81552, 0.73834, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685, + 0.6377, 0.77892, 0.75593, 1.02638, 0.89385, 0.85122, 0.77452, 0.86503, + 0.75186, 0.68887, 0.79776, 0.88844, 0.85066, 0.94258, 0.77818, 0.7306, + 0.76659, 1.10369, 1.39016, 1.10369, 1.06139, 0.89552, 0.8739, 0.86128, + 0.94469, 0.8457, 0.94469, 0.89464, 1.09842, 0.84636, 0.94469, 1.03297, + 1.07692, 0.90918, 1.03297, 0.95897, 0.94469, 0.9482, 0.94469, 0.94469, + 1.04692, 0.78223, 1.20562, 0.94469, 0.90332, 0.98986, 0.86621, 0.90527, + 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, 0.89552, 0.91133, + 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, 1.08707, 0.92098, + 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, 1.0044, 0.87683, 1, + 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, 0.80504, 0.80972, + 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.76318, 0.73834, + 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, 0.90685, 0.90685, + 0.86477, 0.89385, 0.85122, 0.85122, 0.85122, 0.85122, 0.85122, 0.85284, + 0.85311, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, 0.77452, 0.86331, + 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.8693, 0.8457, 0.89464, + 0.89464, 0.89464, 0.89464, 0.82601, 0.82601, 0.82601, 0.82601, 0.94469, + 0.94469, 0.9482, 0.9482, 0.9482, 0.9482, 0.9482, 0.90747, 0.86651, 0.94469, + 0.94469, 0.94469, 0.94469, 0.90527, 0.94469, 0.90527, 0.8675, 0.86128, 0.8675, + 0.86128, 0.8675, 0.86128, 0.73834, 0.8457, 0.73834, 0.8457, 0.73834, 0.8457, + 0.73834, 0.8457, 0.85193, 0.92454, 0.86477, 0.9921, 0.73206, 0.89464, 0.73206, + 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.81105, + 0.84636, 0.81105, 0.84636, 0.81105, 0.84636, 1, 1, 0.86275, 0.94469, 0.90872, + 0.95786, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, + 1.03297, 0.90685, 0.82601, 0.77741, 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, + 0.75593, 1.03297, 1, 1, 0.76032, 0.90452, 0.98156, 1.11842, 0.77261, 1.11429, + 0.89385, 0.94469, 1, 1, 0.89385, 0.94469, 0.95877, 0.86901, 0.94469, 0.85122, + 0.9482, 0.85122, 0.9482, 0.85122, 0.9482, 0.8667, 0.90016, 0.75186, 1.04692, + 1, 1, 0.75186, 1.04692, 0.68887, 0.78223, 0.68887, 0.78223, 0.68887, 0.78223, + 0.68887, 0.78223, 1, 1, 0.79776, 0.92188, 0.79776, 1.23023, 0.88844, 0.94469, + 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, + 0.88844, 0.94469, 0.94258, 0.98986, 0.7306, 0.90527, 0.7306, 0.76659, 0.79004, + 0.76659, 0.79004, 0.76659, 0.79004, 1.09231, 0.54873, 0.8675, 0.86128, + 0.76318, 0.8693, 0.85311, 0.86651, 1, 1, 0.79776, 1.20562, 1.18622, 1.18622, + 1, 1.1437, 0.67742, 0.96334, 0.93695, 1.35191, 1.40909, 0.95161, 1.48387, + 0.86686, 0.90861, 0.62267, 0.74359, 0.65649, 0.85498, 0.56963, 0.88254, + 1.23516, 0.8675, 0.81552, 0.75443, 0.84503, 0.73206, 0.76659, 0.86275, + 0.85122, 0.90685, 0.77892, 0.85746, 1.02638, 0.89385, 0.75657, 0.85122, + 0.86275, 0.77452, 0.74171, 0.79776, 0.7306, 0.95165, 0.77818, 0.89772, + 0.88831, 0.90685, 0.7306, 0.98142, 1.02191, 0.96576, 1.23516, 0.99018, + 0.98142, 0.9236, 0.89258, 0.94035, 1.02191, 0.78848, 0.96576, 0.9561, 1.23516, + 0.90918, 0.92578, 0.95424, 0.89746, 0.83969, 0.9482, 0.80113, 0.89442, + 0.85208, 0.86155, 0.98022, 0.99018, 1.00452, 0.81209, 0.99247, 0.89181, + 1.23516, 0.99018, 0.9482, 0.99018, 0.89181, 0.73206, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 0.88844, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89464, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.96766, 1, 1, 1, 1, 1, 1, 0.94258, 0.98986, + 0.94258, 0.98986, 0.94258, 0.98986, 0.7306, 0.90527, 1, 1, 0.89552, 0.90527, + 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566, + 0.89552, 0.89552, 1.42259, 0.69043, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523, + 1.4956, 2.01462, 0.99331, 0.82616, 0.91133, 0.84286, 0.91133, 1, 1, 1, + 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90527, 1.81055, + 0.90527, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, + 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, + 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, + 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, + 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, + 1.07185, 0.99413, 0.96334, 1.08065, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +]; +const CalibriRegularMetrics = { + lineHeight: 1.2207, + lineGap: 0.2207, +}; // ./src/core/helvetica_factors.js + +const HelveticaBoldFactors = [ + 0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, + 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, + 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, + 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999, + 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, + 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001, + 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, + 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998, + 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026, + 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026, + 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1, + 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, + 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, + 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006, + 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977, + 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001, + 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, + 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, + 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, + 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973, + 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026, + 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026, + 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, + 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, + 0.99977, 0.99973, 0.99977, 1.03374, 0.99977, 1.00026, 1.00001, 0.99973, + 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, + 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, + 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, + 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.00042, 0.99973, 0.99973, 1.0006, + 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.03828, + 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026, + 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, + 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, + 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, + 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, + 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, + 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, + 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, + 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, + 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, + 0.99998, 1.00034, 0.99977, 1, 0.99997, 1.00026, 1.00078, 1.00036, 0.99973, + 1.00013, 1.0006, 0.99977, 0.99977, 0.99988, 0.85148, 1.00001, 1.00026, + 0.99977, 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 1.00069, + 1.00022, 0.99977, 1.00001, 0.99984, 1.00026, 1.00001, 1.00024, 1.00001, + 0.9999, 1, 1.0006, 1.00001, 1.00041, 0.99962, 1.00026, 1.0006, 0.99995, + 1.00041, 0.99942, 0.99973, 0.99927, 1.00082, 0.99902, 1.00026, 1.00087, + 1.0006, 1.00069, 0.99973, 0.99867, 0.99973, 0.9993, 1.00026, 1.00049, 1.00056, + 1, 0.99988, 0.99935, 0.99995, 0.99954, 1.00055, 0.99945, 1.00032, 1.0006, + 0.99995, 1.00026, 0.99995, 1.00032, 1.00001, 1.00008, 0.99971, 1.00019, + 0.9994, 1.00001, 1.0006, 1.00044, 0.99973, 1.00023, 1.00047, 1, 0.99942, + 0.99561, 0.99989, 1.00035, 0.99977, 1.00035, 0.99977, 1.00019, 0.99944, + 1.00001, 1.00021, 0.99926, 1.00035, 1.00035, 0.99942, 1.00048, 0.99999, + 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, 1.00026, 0.99989, 1.00057, + 1.00001, 0.99936, 1.00052, 1.00012, 0.99996, 1.00043, 1, 1.00035, 0.9994, + 0.99976, 1.00035, 0.99973, 1.00052, 1.00041, 1.00119, 1.00037, 0.99973, + 1.00002, 0.99986, 1.00041, 1.00041, 0.99902, 0.9996, 1.00034, 0.99999, + 1.00026, 0.99999, 1.00026, 0.99973, 1.00052, 0.99973, 1, 0.99973, 1.00041, + 1.00075, 0.9994, 1.0003, 0.99999, 1, 1.00041, 0.99955, 1, 0.99915, 0.99973, + 0.99973, 1.00026, 1.00119, 0.99955, 0.99973, 1.0006, 0.99911, 1.0006, 1.00026, + 0.99972, 1.00026, 0.99902, 1.00041, 0.99973, 0.99999, 1, 1, 1.00038, 1.0005, + 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1, + 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973, + 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998, + 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 0.99971, 1.00047, 1.00023, 1, + 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, 1, 1, 1, 1, + 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027, + 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, + 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, + 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972, + 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, + 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, + 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +]; +const HelveticaBoldMetrics = { + lineHeight: 1.2, + lineGap: 0.2, +}; +const HelveticaBoldItalicFactors = [ + 0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, + 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, + 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, + 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999, + 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, + 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001, + 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, + 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998, + 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026, + 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026, + 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1, + 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, + 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, + 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006, + 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977, + 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001, + 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, + 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, + 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, + 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973, + 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026, + 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026, + 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, + 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, + 0.99977, 0.99973, 0.99977, 1.0044, 0.99977, 1.00026, 1.00001, 0.99973, + 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, + 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, + 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, + 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99971, 0.99973, 0.99973, 1.0006, + 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.01011, + 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026, + 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, + 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, + 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, + 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, + 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, + 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, + 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, + 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, + 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, + 0.99998, 0.99998, 0.99977, 1, 1, 1.00026, 0.99969, 0.99972, 0.99981, 0.9998, + 1.0006, 0.99977, 0.99977, 1.00022, 0.91155, 1.00001, 1.00026, 0.99977, + 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 0.99966, 1.00022, + 1.00032, 1.00001, 0.99944, 1.00026, 1.00001, 0.99968, 1.00001, 1.00047, 1, + 1.0006, 1.00001, 0.99981, 1.00101, 1.00026, 1.0006, 0.99948, 0.99981, 1.00064, + 0.99973, 0.99942, 1.00101, 1.00061, 1.00026, 1.00069, 1.0006, 1.00014, + 0.99973, 1.01322, 0.99973, 1.00065, 1.00026, 1.00012, 0.99923, 1, 1.00064, + 1.00076, 0.99948, 1.00055, 1.00063, 1.00007, 0.99943, 1.0006, 0.99948, + 1.00026, 0.99948, 0.99943, 1.00001, 1.00001, 1.00029, 1.00038, 1.00035, + 1.00001, 1.0006, 1.0006, 0.99973, 0.99978, 1.00001, 1.00057, 0.99989, 0.99967, + 0.99964, 0.99967, 0.99977, 0.99999, 0.99977, 1.00038, 0.99977, 1.00001, + 0.99973, 1.00066, 0.99967, 0.99967, 1.00041, 0.99998, 0.99999, 0.99977, + 1.00022, 0.99967, 1.00001, 0.99977, 1.00026, 0.99964, 1.00031, 1.00001, + 0.99999, 0.99999, 1, 1.00023, 1, 1, 0.99999, 1.00035, 1.00001, 0.99999, + 0.99973, 0.99977, 0.99999, 1.00058, 0.99973, 0.99973, 0.99955, 0.9995, + 1.00026, 1.00026, 1.00032, 0.99989, 1.00034, 0.99999, 1.00026, 1.00026, + 1.00026, 0.99973, 0.45998, 0.99973, 1.00026, 0.99973, 1.00001, 0.99999, + 0.99982, 0.99994, 0.99996, 1, 1.00042, 1.00044, 1.00029, 1.00023, 0.99973, + 0.99973, 1.00026, 0.99949, 1.00002, 0.99973, 1.0006, 1.0006, 1.0006, 0.99975, + 1.00026, 1.00026, 1.00032, 0.98685, 0.99973, 1.00026, 1, 1, 0.99966, 1.00044, + 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1, + 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973, + 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998, + 1.66475, 1, 0.99973, 0.99973, 1, 0.99973, 0.99971, 0.99978, 1, 1, 0.99991, + 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1.00098, 1, 1, 1, 1.00049, 1, 1, + 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027, + 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, + 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, + 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972, + 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, + 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, + 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +]; +const HelveticaBoldItalicMetrics = { + lineHeight: 1.35, + lineGap: 0.2, +}; +const HelveticaItalicFactors = [ + 0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, + 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, + 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, + 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987, + 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, + 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, + 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, + 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973, + 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924, + 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1, + 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973, + 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968, + 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, + 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, + 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977, + 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, + 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, + 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, + 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973, + 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, + 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973, + 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, + 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.0288, + 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, + 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, + 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, + 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, + 1.0006, 0.99946, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, + 0.99973, 0.99924, 0.99973, 1.06311, 0.99973, 1.00024, 0.99973, 0.99924, + 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00041, 0.9998, + 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, + 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, + 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.89547, 1.00026, 1.0006, + 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, + 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, + 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, + 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, + 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, + 0.99998, 1.00001, 1, 1.00054, 0.99977, 1.00084, 1.00007, 0.99973, 1.00013, + 0.99924, 1.00001, 1.00001, 0.99945, 0.91221, 1.00001, 1.00026, 0.99977, + 1.00022, 1.0006, 1.00001, 1.00001, 0.99999, 0.99977, 0.99933, 1.00022, + 1.00054, 1.00001, 1.00065, 1.00026, 1.00001, 1.0001, 1.00001, 1.00052, 1, + 1.0006, 1.00001, 0.99945, 0.99897, 0.99968, 0.99924, 1.00036, 0.99945, + 0.99949, 1, 1.0006, 0.99897, 0.99918, 0.99968, 0.99911, 0.99924, 1, 0.99962, + 1.01487, 1, 1.0005, 0.99973, 1.00012, 1.00043, 1, 0.99995, 0.99994, 1.00036, + 0.99947, 1.00019, 1.00063, 1.00025, 0.99924, 1.00036, 0.99973, 1.00036, + 1.00025, 1.00001, 1.00001, 1.00027, 1.0001, 1.00068, 1.00001, 1.0006, 1.0006, + 1, 1.00008, 0.99957, 0.99972, 0.9994, 0.99954, 0.99975, 1.00051, 1.00001, + 1.00019, 1.00001, 1.0001, 0.99986, 1.00001, 1.00001, 1.00038, 0.99954, + 0.99954, 0.9994, 1.00066, 0.99999, 0.99977, 1.00022, 1.00054, 1.00001, + 0.99977, 1.00026, 0.99975, 1.0001, 1.00001, 0.99993, 0.9995, 0.99955, 1.00016, + 0.99978, 0.99974, 1.00019, 1.00022, 0.99955, 1.00053, 0.99973, 1.00089, + 1.00005, 0.99967, 1.00048, 0.99973, 1.00002, 1.00034, 0.99973, 0.99973, + 0.99964, 1.00006, 1.00066, 0.99947, 0.99973, 0.98894, 0.99973, 1, 0.44898, 1, + 0.99946, 1, 1.00039, 1.00082, 0.99991, 0.99991, 0.99985, 1.00022, 1.00023, + 1.00061, 1.00006, 0.99966, 0.99973, 0.99973, 0.99973, 1.00019, 1.0008, 1, + 0.99924, 0.99924, 0.99924, 0.99983, 1.00044, 0.99973, 0.99964, 0.98332, 1, + 0.99973, 1, 1, 0.99962, 0.99895, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, + 0.99977, 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, + 0.99924, 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, + 0.99999, 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, + 0.99973, 1.00423, 0.99925, 0.99999, 1, 0.99991, 0.99984, 1.00002, 1.00002, + 1.00002, 1.00002, 1.00049, 1, 1.00245, 1, 1, 1, 1, 0.96329, 1, 1.20985, + 1.39713, 1.00003, 0.8254, 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, + 1.00003, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, + 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, + 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, + 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +]; +const HelveticaItalicMetrics = { + lineHeight: 1.35, + lineGap: 0.2, +}; +const HelveticaRegularFactors = [ + 0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, + 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, + 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, + 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987, + 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, + 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, + 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, + 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973, + 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924, + 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1, + 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973, + 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968, + 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, + 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, + 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977, + 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, + 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, + 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, + 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973, + 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, + 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973, + 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, + 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.04596, + 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, + 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, + 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, + 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, + 1.0006, 1.00019, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, + 0.99973, 0.99924, 0.99973, 1.02572, 0.99973, 1.00005, 0.99973, 0.99924, + 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99999, 0.9998, + 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, + 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, + 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.84533, 1.00026, 1.0006, + 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, + 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, + 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, + 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, + 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, + 0.99998, 0.99928, 1, 0.99977, 1.00013, 1.00055, 0.99947, 0.99945, 0.99941, + 0.99924, 1.00001, 1.00001, 1.0004, 0.91621, 1.00001, 1.00026, 0.99977, + 1.00022, 1.0006, 1.00001, 1.00005, 0.99999, 0.99977, 1.00015, 1.00022, + 0.99977, 1.00001, 0.99973, 1.00026, 1.00001, 1.00019, 1.00001, 0.99946, 1, + 1.0006, 1.00001, 0.99978, 1.00045, 0.99973, 0.99924, 1.00023, 0.99978, + 0.99966, 1, 1.00065, 1.00045, 1.00019, 0.99973, 0.99973, 0.99924, 1, 1, + 0.96499, 1, 1.00055, 0.99973, 1.00008, 1.00027, 1, 0.9997, 0.99995, 1.00023, + 0.99933, 1.00019, 1.00015, 1.00031, 0.99924, 1.00023, 0.99973, 1.00023, + 1.00031, 1.00001, 0.99928, 1.00029, 1.00092, 1.00035, 1.00001, 1.0006, 1.0006, + 1, 0.99988, 0.99975, 1, 1.00082, 0.99561, 0.9996, 1.00035, 1.00001, 0.99962, + 1.00001, 1.00092, 0.99964, 1.00001, 0.99963, 0.99999, 1.00035, 1.00035, + 1.00082, 0.99962, 0.99999, 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, + 1.00026, 0.9996, 0.99967, 1.00001, 1.00034, 1.00074, 1.00054, 1.00053, + 1.00063, 0.99971, 0.99962, 1.00035, 0.99975, 0.99977, 0.99973, 1.00043, + 0.99953, 1.0007, 0.99915, 0.99973, 1.00008, 0.99892, 1.00073, 1.00073, + 1.00114, 0.99915, 1.00073, 0.99955, 0.99973, 1.00092, 0.99973, 1, 0.99998, 1, + 1.0003, 1, 1.00043, 1.00001, 0.99969, 1.0003, 1, 1.00035, 1.00001, 0.9995, 1, + 1.00092, 0.99973, 0.99973, 0.99973, 1.0007, 0.9995, 1, 0.99924, 1.0006, + 0.99924, 0.99972, 1.00062, 0.99973, 1.00114, 1.00073, 1, 0.99955, 1, 1, + 1.00047, 0.99968, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, 0.99977, + 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, 0.99924, + 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, 0.99999, + 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, + 0.99971, 0.99925, 1.00023, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, + 1.00002, 1, 1, 1, 1, 1, 1, 1, 0.96329, 1, 1.20985, 1.39713, 1.00003, 0.8254, + 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, + 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, + 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, + 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, + 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +]; +const HelveticaRegularMetrics = { + lineHeight: 1.2, + lineGap: 0.2, +}; // ./src/core/liberationsans_widths.js + +const LiberationSansBoldWidths = [ + 365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, + 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, + 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, + 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, + 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, + 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, + 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333, + 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333, + 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, + 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, + 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, + 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, + 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556, + 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 719, 722, 611, 667, + 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611, + 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 785, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 385, 611, + 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778, + 611, 778, 611, 1000, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556, + 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722, + 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611, + 500, 611, 500, 278, 556, 722, 556, 1000, 889, 778, 611, 667, 556, 611, 333, + 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 465, 722, 333, 853, 906, + 474, 825, 927, 838, 278, 722, 722, 601, 719, 667, 611, 722, 778, 278, 722, + 667, 833, 722, 644, 778, 722, 667, 600, 611, 667, 821, 667, 809, 802, 278, + 667, 615, 451, 611, 278, 582, 615, 610, 556, 606, 475, 460, 611, 541, 278, + 558, 556, 612, 556, 445, 611, 766, 619, 520, 684, 446, 582, 715, 576, 753, + 845, 278, 582, 611, 582, 845, 667, 669, 885, 567, 711, 667, 278, 276, 556, + 1094, 1062, 875, 610, 722, 622, 719, 722, 719, 722, 567, 712, 667, 904, 626, + 719, 719, 610, 702, 833, 722, 778, 719, 667, 722, 611, 622, 854, 667, 730, + 703, 1005, 1019, 870, 979, 719, 711, 1031, 719, 556, 618, 615, 417, 635, 556, + 709, 497, 615, 615, 500, 635, 740, 604, 611, 604, 611, 556, 490, 556, 875, + 556, 615, 581, 833, 844, 729, 854, 615, 552, 854, 583, 556, 556, 611, 417, + 552, 556, 278, 281, 278, 969, 906, 611, 500, 615, 556, 604, 778, 611, 487, + 447, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1000, 1000, 552, + 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1000, 1000, 240, 479, 333, + 333, 604, 333, 167, 396, 556, 556, 1094, 556, 885, 489, 1115, 1000, 768, 600, + 834, 834, 834, 834, 1000, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713, + 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, + 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, + 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, + 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, + 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, + 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, + 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333, + 333, 333, 333, 333, 333, +]; +const LiberationSansBoldMapping = [ + -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, + 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, + 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, + 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, + 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, + 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, + 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, + 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, + 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, + 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, + 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, + 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, + 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, + 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, + 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, + 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, + 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, + 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, + 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, + 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, + 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, + 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, + 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +]; +const LiberationSansBoldItalicWidths = [ + 365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, + 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, + 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, + 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, + 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, + 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, + 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333, + 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333, + 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, + 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, + 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, + 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, + 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556, + 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 740, 722, 611, 667, + 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611, + 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 782, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 396, 611, + 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778, + 611, 778, 611, 1000, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556, + 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722, + 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611, + 500, 611, 500, 278, 556, 722, 556, 1000, 889, 778, 611, 667, 556, 611, 333, + 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 722, 333, 854, 906, + 473, 844, 930, 847, 278, 722, 722, 610, 671, 667, 611, 722, 778, 278, 722, + 667, 833, 722, 657, 778, 718, 667, 590, 611, 667, 822, 667, 829, 781, 278, + 667, 620, 479, 611, 278, 591, 620, 621, 556, 610, 479, 492, 611, 558, 278, + 566, 556, 603, 556, 450, 611, 712, 605, 532, 664, 409, 591, 704, 578, 773, + 834, 278, 591, 611, 591, 834, 667, 667, 886, 614, 719, 667, 278, 278, 556, + 1094, 1042, 854, 622, 719, 677, 719, 722, 708, 722, 614, 722, 667, 927, 643, + 719, 719, 615, 687, 833, 722, 778, 719, 667, 722, 611, 677, 781, 667, 729, + 708, 979, 989, 854, 1000, 708, 719, 1042, 729, 556, 619, 604, 534, 618, 556, + 736, 510, 611, 611, 507, 622, 740, 604, 611, 611, 611, 556, 889, 556, 885, + 556, 646, 583, 889, 935, 707, 854, 594, 552, 865, 589, 556, 556, 611, 469, + 563, 556, 278, 278, 278, 969, 906, 611, 507, 619, 556, 611, 778, 611, 575, + 467, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1000, 1000, 552, + 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1000, 1000, 240, 479, 333, + 333, 604, 333, 167, 396, 556, 556, 1104, 556, 885, 516, 1146, 1000, 768, 600, + 834, 834, 834, 834, 999, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713, + 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, + 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, + 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, + 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, + 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, + 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, + 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333, + 333, 333, 333, 333, 333, +]; +const LiberationSansBoldItalicMapping = [ + -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, + 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, + 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, + 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, + 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, + 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, + 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, + 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, + 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, + 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, + 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, + 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, + 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, + 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, + 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, + 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, + 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, + 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, + 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, + 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, + 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, + 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, + 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +]; +const LiberationSansItalicWidths = [ + 365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, + 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, + 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, + 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, + 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, + 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, + 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333, + 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333, + 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, + 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, + 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, + 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, + 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556, + 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 625, 722, 556, 667, + 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556, + 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278, + 278, 733, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 281, 556, + 400, 556, 222, 722, 556, 722, 556, 722, 556, 615, 723, 556, 778, 556, 778, + 556, 778, 556, 1000, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500, + 667, 500, 667, 500, 611, 278, 611, 354, 611, 278, 722, 556, 722, 556, 722, + 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611, + 500, 611, 500, 222, 556, 667, 556, 1000, 889, 778, 611, 667, 500, 611, 278, + 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 789, 846, + 389, 794, 865, 775, 222, 667, 667, 570, 671, 667, 611, 722, 778, 278, 667, + 667, 833, 722, 648, 778, 725, 667, 600, 611, 667, 837, 667, 831, 761, 278, + 667, 570, 439, 555, 222, 550, 570, 571, 500, 556, 439, 463, 555, 542, 222, + 500, 492, 548, 500, 447, 556, 670, 573, 486, 603, 374, 550, 652, 546, 728, + 779, 222, 550, 556, 550, 779, 667, 667, 843, 544, 708, 667, 278, 278, 500, + 1066, 982, 844, 589, 715, 639, 724, 667, 651, 667, 544, 704, 667, 917, 614, + 715, 715, 589, 686, 833, 722, 778, 725, 667, 722, 611, 639, 795, 667, 727, + 673, 920, 923, 805, 886, 651, 694, 1022, 682, 556, 562, 522, 493, 553, 556, + 688, 465, 556, 556, 472, 564, 686, 550, 556, 556, 556, 500, 833, 500, 835, + 500, 572, 518, 830, 851, 621, 736, 526, 492, 752, 534, 556, 556, 556, 378, + 496, 500, 222, 222, 222, 910, 828, 556, 472, 565, 500, 556, 778, 556, 492, + 339, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1000, 1000, 552, + 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1000, 1000, 188, 354, 333, + 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1083, 1000, 768, 600, + 834, 834, 834, 834, 1000, 500, 998, 500, 1000, 500, 500, 494, 612, 823, 713, + 584, 549, 713, 979, 719, 274, 549, 549, 584, 549, 549, 604, 584, 604, 604, + 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, + 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, + 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, + 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, + 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, + 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324, + 324, 316, 328, 398, 285, +]; +const LiberationSansItalicMapping = [ + -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, + 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, + 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, + 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, + 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, + 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, + 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, + 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, + 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, + 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, + 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, + 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, + 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, + 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, + 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, + 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, + 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, + 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, + 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, + 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, + 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, + 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, + 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +]; +const LiberationSansRegularWidths = [ + 365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, + 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, + 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, + 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, + 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, + 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, + 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333, + 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333, + 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, + 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, + 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, + 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, + 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556, + 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 615, 722, 556, 667, + 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556, + 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278, + 278, 735, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 292, 556, + 334, 556, 222, 722, 556, 722, 556, 722, 556, 604, 723, 556, 778, 556, 778, + 556, 778, 556, 1000, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500, + 667, 500, 667, 500, 611, 278, 611, 375, 611, 278, 722, 556, 722, 556, 722, + 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611, + 500, 611, 500, 222, 556, 667, 556, 1000, 889, 778, 611, 667, 500, 611, 278, + 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 784, 838, + 384, 774, 855, 752, 222, 667, 667, 551, 668, 667, 611, 722, 778, 278, 667, + 668, 833, 722, 650, 778, 722, 667, 618, 611, 667, 798, 667, 835, 748, 278, + 667, 578, 446, 556, 222, 547, 578, 575, 500, 557, 446, 441, 556, 556, 222, + 500, 500, 576, 500, 448, 556, 690, 569, 482, 617, 395, 547, 648, 525, 713, + 781, 222, 547, 556, 547, 781, 667, 667, 865, 542, 719, 667, 278, 278, 500, + 1057, 1010, 854, 583, 722, 635, 719, 667, 656, 667, 542, 677, 667, 923, 604, + 719, 719, 583, 656, 833, 722, 778, 719, 667, 722, 611, 635, 760, 667, 740, + 667, 917, 938, 792, 885, 656, 719, 1010, 722, 556, 573, 531, 365, 583, 556, + 669, 458, 559, 559, 438, 583, 688, 552, 556, 542, 556, 500, 458, 500, 823, + 500, 573, 521, 802, 823, 625, 719, 521, 510, 750, 542, 556, 556, 556, 365, + 510, 500, 222, 278, 222, 906, 812, 556, 438, 559, 500, 552, 778, 556, 489, + 411, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1000, 1000, 552, + 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1000, 1000, 188, 354, 333, + 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1073, 1000, 768, 600, + 834, 834, 834, 834, 1000, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713, + 584, 549, 713, 979, 719, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, + 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, + 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, + 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, + 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, + 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, + 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324, + 324, 316, 328, 398, 285, +]; +const LiberationSansRegularMapping = [ + -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, + 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, + 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, + 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, + 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, + 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, + 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, + 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, + 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, + 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, + 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, + 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, + 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, + 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, + 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, + 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, + 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, + 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, + 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, + 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, + 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, + 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, + 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +]; // ./src/core/myriadpro_factors.js + +const MyriadProBoldFactors = [ + 1.36898, 1, 1, 0.72706, 0.80479, 0.83734, 0.98894, 0.99793, 0.9897, 0.93884, + 0.86209, 0.94292, 0.94292, 1.16661, 1.02058, 0.93582, 0.96694, 0.93582, + 1.19137, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, + 0.99793, 0.99793, 0.99793, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058, + 0.72851, 0.78966, 0.90838, 0.83637, 0.82391, 0.96376, 0.80061, 0.86275, + 0.8768, 0.95407, 1.0258, 0.73901, 0.85022, 0.83655, 1.0156, 0.95546, 0.92179, + 0.87107, 0.92179, 0.82114, 0.8096, 0.89713, 0.94438, 0.95353, 0.94083, + 0.91905, 0.90406, 0.9446, 0.94292, 1.18777, 0.94292, 1.02058, 0.89903, + 0.90088, 0.94938, 0.97898, 0.81093, 0.97571, 0.94938, 1.024, 0.9577, 0.95933, + 0.98621, 1.0474, 0.97455, 0.98981, 0.9672, 0.95933, 0.9446, 0.97898, 0.97407, + 0.97646, 0.78036, 1.10208, 0.95442, 0.95298, 0.97579, 0.9332, 0.94039, 0.938, + 0.80687, 1.01149, 0.80687, 1.02058, 0.80479, 0.99793, 0.99793, 0.99793, + 0.99793, 1.01149, 1.00872, 0.90088, 0.91882, 1.0213, 0.8361, 1.02058, 0.62295, + 0.54324, 0.89022, 1.08595, 1, 1, 0.90088, 1, 0.97455, 0.93582, 0.90088, 1, + 1.05686, 0.8361, 0.99642, 0.99642, 0.99642, 0.72851, 0.90838, 0.90838, + 0.90838, 0.90838, 0.90838, 0.90838, 0.868, 0.82391, 0.80061, 0.80061, 0.80061, + 0.80061, 1.0258, 1.0258, 1.0258, 1.0258, 0.97484, 0.95546, 0.92179, 0.92179, + 0.92179, 0.92179, 0.92179, 1.02058, 0.92179, 0.94438, 0.94438, 0.94438, + 0.94438, 0.90406, 0.86958, 0.98225, 0.94938, 0.94938, 0.94938, 0.94938, + 0.94938, 0.94938, 0.9031, 0.81093, 0.94938, 0.94938, 0.94938, 0.94938, + 0.98621, 0.98621, 0.98621, 0.98621, 0.93969, 0.95933, 0.9446, 0.9446, 0.9446, + 0.9446, 0.9446, 1.08595, 0.9446, 0.95442, 0.95442, 0.95442, 0.95442, 0.94039, + 0.97898, 0.94039, 0.90838, 0.94938, 0.90838, 0.94938, 0.90838, 0.94938, + 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, + 0.96376, 0.84313, 0.97484, 0.97571, 0.80061, 0.94938, 0.80061, 0.94938, + 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.8768, 0.9577, 0.8768, + 0.9577, 0.8768, 0.9577, 1, 1, 0.95407, 0.95933, 0.97069, 0.95933, 1.0258, + 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, + 0.887, 1.01591, 0.73901, 1.0474, 1, 1, 0.97455, 0.83655, 0.98981, 1, 1, + 0.83655, 0.73977, 0.83655, 0.73903, 0.84638, 1.033, 0.95546, 0.95933, 1, 1, + 0.95546, 0.95933, 0.8271, 0.95417, 0.95933, 0.92179, 0.9446, 0.92179, 0.9446, + 0.92179, 0.9446, 0.936, 0.91964, 0.82114, 0.97646, 1, 1, 0.82114, 0.97646, + 0.8096, 0.78036, 0.8096, 0.78036, 1, 1, 0.8096, 0.78036, 1, 1, 0.89713, + 0.77452, 0.89713, 1.10208, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, + 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94083, + 0.97579, 0.90406, 0.94039, 0.90406, 0.9446, 0.938, 0.9446, 0.938, 0.9446, + 0.938, 1, 0.99793, 0.90838, 0.94938, 0.868, 0.9031, 0.92179, 0.9446, 1, 1, + 0.89713, 1.10208, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, + 0.90088, 0.90088, 0.90088, 0.90989, 0.9358, 0.91945, 0.83181, 0.75261, + 0.87992, 0.82976, 0.96034, 0.83689, 0.97268, 1.0078, 0.90838, 0.83637, 0.8019, + 0.90157, 0.80061, 0.9446, 0.95407, 0.92436, 1.0258, 0.85022, 0.97153, 1.0156, + 0.95546, 0.89192, 0.92179, 0.92361, 0.87107, 0.96318, 0.89713, 0.93704, + 0.95638, 0.91905, 0.91709, 0.92796, 1.0258, 0.93704, 0.94836, 1.0373, 0.95933, + 1.0078, 0.95871, 0.94836, 0.96174, 0.92601, 0.9498, 0.98607, 0.95776, 0.95933, + 1.05453, 1.0078, 0.98275, 0.9314, 0.95617, 0.91701, 1.05993, 0.9446, 0.78367, + 0.9553, 1, 0.86832, 1.0128, 0.95871, 0.99394, 0.87548, 0.96361, 0.86774, + 1.0078, 0.95871, 0.9446, 0.95871, 0.86774, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.94083, 0.97579, 0.94083, 0.97579, 0.94083, + 0.97579, 0.90406, 0.94039, 0.96694, 1, 0.89903, 1, 1, 1, 0.93582, 0.93582, + 0.93582, 1, 0.908, 0.908, 0.918, 0.94219, 0.94219, 0.96544, 1, 1.285, 1, 1, + 0.81079, 0.81079, 1, 1, 0.74854, 1, 1, 1, 1, 0.99793, 1, 1, 1, 0.65, 1, + 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.17173, 1, 0.80535, 0.76169, + 1.02058, 1.0732, 1.05486, 1, 1, 1.30692, 1.08595, 1.08595, 1, 1.08595, + 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.16161, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +]; +const MyriadProBoldMetrics = { + lineHeight: 1.2, + lineGap: 0.2, +}; +const MyriadProBoldItalicFactors = [ + 1.36898, 1, 1, 0.66227, 0.80779, 0.81625, 0.97276, 0.97276, 0.97733, 0.92222, + 0.83266, 0.94292, 0.94292, 1.16148, 1.02058, 0.93582, 0.96694, 0.93582, + 1.17337, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, + 0.97276, 0.97276, 0.97276, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058, + 0.71541, 0.76813, 0.85576, 0.80591, 0.80729, 0.94299, 0.77512, 0.83655, + 0.86523, 0.92222, 0.98621, 0.71743, 0.81698, 0.79726, 0.98558, 0.92222, + 0.90637, 0.83809, 0.90637, 0.80729, 0.76463, 0.86275, 0.90699, 0.91605, + 0.9154, 0.85308, 0.85458, 0.90531, 0.94292, 1.21296, 0.94292, 1.02058, + 0.89903, 1.18616, 0.99613, 0.91677, 0.78216, 0.91677, 0.90083, 0.98796, + 0.9135, 0.92168, 0.95381, 0.98981, 0.95298, 0.95381, 0.93459, 0.92168, + 0.91513, 0.92004, 0.91677, 0.95077, 0.748, 1.04502, 0.91677, 0.92061, 0.94236, + 0.89544, 0.89364, 0.9, 0.80687, 0.8578, 0.80687, 1.02058, 0.80779, 0.97276, + 0.97276, 0.97276, 0.97276, 0.8578, 0.99973, 1.18616, 0.91339, 1.08074, + 0.82891, 1.02058, 0.55509, 0.71526, 0.89022, 1.08595, 1, 1, 1.18616, 1, + 0.96736, 0.93582, 1.18616, 1, 1.04864, 0.82711, 0.99043, 0.99043, 0.99043, + 0.71541, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.845, 0.80729, + 0.77512, 0.77512, 0.77512, 0.77512, 0.98621, 0.98621, 0.98621, 0.98621, + 0.95961, 0.92222, 0.90637, 0.90637, 0.90637, 0.90637, 0.90637, 1.02058, + 0.90251, 0.90699, 0.90699, 0.90699, 0.90699, 0.85458, 0.83659, 0.94951, + 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.85811, 0.78216, + 0.90083, 0.90083, 0.90083, 0.90083, 0.95381, 0.95381, 0.95381, 0.95381, + 0.9135, 0.92168, 0.91513, 0.91513, 0.91513, 0.91513, 0.91513, 1.08595, + 0.91677, 0.91677, 0.91677, 0.91677, 0.91677, 0.89364, 0.92332, 0.89364, + 0.85576, 0.99613, 0.85576, 0.99613, 0.85576, 0.99613, 0.80729, 0.78216, + 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, 0.78216, 0.94299, 0.76783, + 0.95961, 0.91677, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, + 0.77512, 0.90083, 0.77512, 0.90083, 0.86523, 0.9135, 0.86523, 0.9135, 0.86523, + 0.9135, 1, 1, 0.92222, 0.92168, 0.92222, 0.92168, 0.98621, 0.95381, 0.98621, + 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.86036, + 0.97096, 0.71743, 0.98981, 1, 1, 0.95298, 0.79726, 0.95381, 1, 1, 0.79726, + 0.6894, 0.79726, 0.74321, 0.81691, 1.0006, 0.92222, 0.92168, 1, 1, 0.92222, + 0.92168, 0.79464, 0.92098, 0.92168, 0.90637, 0.91513, 0.90637, 0.91513, + 0.90637, 0.91513, 0.909, 0.87514, 0.80729, 0.95077, 1, 1, 0.80729, 0.95077, + 0.76463, 0.748, 0.76463, 0.748, 1, 1, 0.76463, 0.748, 1, 1, 0.86275, 0.72651, + 0.86275, 1.04502, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, + 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.9154, 0.94236, + 0.85458, 0.89364, 0.85458, 0.90531, 0.9, 0.90531, 0.9, 0.90531, 0.9, 1, + 0.97276, 0.85576, 0.99613, 0.845, 0.85811, 0.90251, 0.91677, 1, 1, 0.86275, + 1.04502, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, + 1.18616, 1.18616, 1.00899, 1.30628, 0.85576, 0.80178, 0.66862, 0.7927, + 0.69323, 0.88127, 0.72459, 0.89711, 0.95381, 0.85576, 0.80591, 0.7805, + 0.94729, 0.77512, 0.90531, 0.92222, 0.90637, 0.98621, 0.81698, 0.92655, + 0.98558, 0.92222, 0.85359, 0.90637, 0.90976, 0.83809, 0.94523, 0.86275, + 0.83509, 0.93157, 0.85308, 0.83392, 0.92346, 0.98621, 0.83509, 0.92886, + 0.91324, 0.92168, 0.95381, 0.90646, 0.92886, 0.90557, 0.86847, 0.90276, + 0.91324, 0.86842, 0.92168, 0.99531, 0.95381, 0.9224, 0.85408, 0.92699, + 0.86847, 1.0051, 0.91513, 0.80487, 0.93481, 1, 0.88159, 1.05214, 0.90646, + 0.97355, 0.81539, 0.89398, 0.85923, 0.95381, 0.90646, 0.91513, 0.90646, + 0.85923, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0.9154, 0.94236, 0.9154, 0.94236, 0.9154, 0.94236, 0.85458, 0.89364, 0.96694, + 1, 0.89903, 1, 1, 1, 0.91782, 0.91782, 0.91782, 1, 0.896, 0.896, 0.896, + 0.9332, 0.9332, 0.95973, 1, 1.26, 1, 1, 0.80479, 0.80178, 1, 1, 0.85633, 1, 1, + 1, 1, 0.97276, 1, 1, 1, 0.698, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1.14542, 1, 0.79199, 0.78694, 1.02058, 1.03493, 1.05486, 1, 1, 1.23026, + 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.20006, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +]; +const MyriadProBoldItalicMetrics = { + lineHeight: 1.2, + lineGap: 0.2, +}; +const MyriadProItalicFactors = [ + 1.36898, 1, 1, 0.65507, 0.84943, 0.85639, 0.88465, 0.88465, 0.86936, 0.88307, + 0.86948, 0.85283, 0.85283, 1.06383, 1.02058, 0.75945, 0.9219, 0.75945, + 1.17337, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, + 0.88465, 0.88465, 0.88465, 0.75945, 0.75945, 1.02058, 1.02058, 1.02058, + 0.69046, 0.70926, 0.85158, 0.77812, 0.76852, 0.89591, 0.70466, 0.76125, + 0.80094, 0.86822, 0.83864, 0.728, 0.77212, 0.79475, 0.93637, 0.87514, 0.8588, + 0.76013, 0.8588, 0.72421, 0.69866, 0.77598, 0.85991, 0.80811, 0.87832, + 0.78112, 0.77512, 0.8562, 1.0222, 1.18417, 1.0222, 1.27014, 0.89903, 1.15012, + 0.93859, 0.94399, 0.846, 0.94399, 0.81453, 1.0186, 0.94219, 0.96017, 1.03075, + 1.02175, 0.912, 1.03075, 0.96998, 0.96017, 0.93859, 0.94399, 0.94399, 0.95493, + 0.746, 1.12658, 0.94578, 0.91, 0.979, 0.882, 0.882, 0.83, 0.85034, 0.83537, + 0.85034, 1.02058, 0.70869, 0.88465, 0.88465, 0.88465, 0.88465, 0.83537, + 0.90083, 1.15012, 0.9161, 0.94565, 0.73541, 1.02058, 0.53609, 0.69353, + 0.79519, 1.08595, 1, 1, 1.15012, 1, 0.91974, 0.75945, 1.15012, 1, 0.9446, + 0.73361, 0.9005, 0.9005, 0.9005, 0.62864, 0.85158, 0.85158, 0.85158, 0.85158, + 0.85158, 0.85158, 0.773, 0.76852, 0.70466, 0.70466, 0.70466, 0.70466, 0.83864, + 0.83864, 0.83864, 0.83864, 0.90561, 0.87514, 0.8588, 0.8588, 0.8588, 0.8588, + 0.8588, 1.02058, 0.85751, 0.85991, 0.85991, 0.85991, 0.85991, 0.77512, + 0.76013, 0.88075, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, + 0.8075, 0.846, 0.81453, 0.81453, 0.81453, 0.81453, 0.82424, 0.82424, 0.82424, + 0.82424, 0.9278, 0.96017, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, + 1.08595, 0.8562, 0.94578, 0.94578, 0.94578, 0.94578, 0.882, 0.94578, 0.882, + 0.85158, 0.93859, 0.85158, 0.93859, 0.85158, 0.93859, 0.76852, 0.846, 0.76852, + 0.846, 0.76852, 0.846, 0.76852, 0.846, 0.89591, 0.8544, 0.90561, 0.94399, + 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, + 0.70466, 0.81453, 0.80094, 0.94219, 0.80094, 0.94219, 0.80094, 0.94219, 1, 1, + 0.86822, 0.96017, 0.86822, 0.96017, 0.83864, 0.82424, 0.83864, 0.82424, + 0.83864, 0.82424, 0.83864, 1.03075, 0.83864, 0.82424, 0.81402, 1.02738, 0.728, + 1.02175, 1, 1, 0.912, 0.79475, 1.03075, 1, 1, 0.79475, 0.83911, 0.79475, + 0.66266, 0.80553, 1.06676, 0.87514, 0.96017, 1, 1, 0.87514, 0.96017, 0.86865, + 0.87396, 0.96017, 0.8588, 0.93859, 0.8588, 0.93859, 0.8588, 0.93859, 0.867, + 0.84759, 0.72421, 0.95493, 1, 1, 0.72421, 0.95493, 0.69866, 0.746, 0.69866, + 0.746, 1, 1, 0.69866, 0.746, 1, 1, 0.77598, 0.88417, 0.77598, 1.12658, + 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, + 0.85991, 0.94578, 0.85991, 0.94578, 0.87832, 0.979, 0.77512, 0.882, 0.77512, + 0.8562, 0.83, 0.8562, 0.83, 0.8562, 0.83, 1, 0.88465, 0.85158, 0.93859, 0.773, + 0.8075, 0.85751, 0.8562, 1, 1, 0.77598, 1.12658, 1.15012, 1.15012, 1.15012, + 1.15012, 1.15012, 1.15313, 1.15012, 1.15012, 1.15012, 1.08106, 1.03901, + 0.85158, 0.77025, 0.62264, 0.7646, 0.65351, 0.86026, 0.69461, 0.89947, + 1.03075, 0.85158, 0.77812, 0.76449, 0.88836, 0.70466, 0.8562, 0.86822, 0.8588, + 0.83864, 0.77212, 0.85308, 0.93637, 0.87514, 0.82352, 0.8588, 0.85701, + 0.76013, 0.89058, 0.77598, 0.8156, 0.82565, 0.78112, 0.77899, 0.89386, + 0.83864, 0.8156, 0.9486, 0.92388, 0.96186, 1.03075, 0.91123, 0.9486, 0.93298, + 0.878, 0.93942, 0.92388, 0.84596, 0.96186, 0.95119, 1.03075, 0.922, 0.88787, + 0.95829, 0.88, 0.93559, 0.93859, 0.78815, 0.93758, 1, 0.89217, 1.03737, + 0.91123, 0.93969, 0.77487, 0.85769, 0.86799, 1.03075, 0.91123, 0.93859, + 0.91123, 0.86799, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 0.87832, 0.979, 0.87832, 0.979, 0.87832, 0.979, 0.77512, 0.882, 0.9219, + 1, 0.89903, 1, 1, 1, 0.87321, 0.87321, 0.87321, 1, 1.027, 1.027, 1.027, + 0.86847, 0.86847, 0.79121, 1, 1.124, 1, 1, 0.73572, 0.73572, 1, 1, 0.85034, 1, + 1, 1, 1, 0.88465, 1, 1, 1, 0.669, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1.04828, 1, 0.74948, 0.75187, 1.02058, 0.98391, 1.02119, 1, 1, 1.06233, + 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05233, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +]; +const MyriadProItalicMetrics = { + lineHeight: 1.2, + lineGap: 0.2, +}; +const MyriadProRegularFactors = [ + 1.36898, 1, 1, 0.76305, 0.82784, 0.94935, 0.89364, 0.92241, 0.89073, 0.90706, + 0.98472, 0.85283, 0.85283, 1.0664, 1.02058, 0.74505, 0.9219, 0.74505, 1.23456, + 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, + 0.92241, 0.92241, 0.74505, 0.74505, 1.02058, 1.02058, 1.02058, 0.73002, + 0.72601, 0.91755, 0.8126, 0.80314, 0.92222, 0.73764, 0.79726, 0.83051, + 0.90284, 0.86023, 0.74, 0.8126, 0.84869, 0.96518, 0.91115, 0.8858, 0.79761, + 0.8858, 0.74498, 0.73914, 0.81363, 0.89591, 0.83659, 0.89633, 0.85608, 0.8111, + 0.90531, 1.0222, 1.22736, 1.0222, 1.27014, 0.89903, 0.90088, 0.86667, 1.0231, + 0.896, 1.01411, 0.90083, 1.05099, 1.00512, 0.99793, 1.05326, 1.09377, 0.938, + 1.06226, 1.00119, 0.99793, 0.98714, 1.0231, 1.01231, 0.98196, 0.792, 1.19137, + 0.99074, 0.962, 1.01915, 0.926, 0.942, 0.856, 0.85034, 0.92006, 0.85034, + 1.02058, 0.69067, 0.92241, 0.92241, 0.92241, 0.92241, 0.92006, 0.9332, + 0.90088, 0.91882, 0.93484, 0.75339, 1.02058, 0.56866, 0.54324, 0.79519, + 1.08595, 1, 1, 0.90088, 1, 0.95325, 0.74505, 0.90088, 1, 0.97198, 0.75339, + 0.91009, 0.91009, 0.91009, 0.66466, 0.91755, 0.91755, 0.91755, 0.91755, + 0.91755, 0.91755, 0.788, 0.80314, 0.73764, 0.73764, 0.73764, 0.73764, 0.86023, + 0.86023, 0.86023, 0.86023, 0.92915, 0.91115, 0.8858, 0.8858, 0.8858, 0.8858, + 0.8858, 1.02058, 0.8858, 0.89591, 0.89591, 0.89591, 0.89591, 0.8111, 0.79611, + 0.89713, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86936, 0.896, + 0.90083, 0.90083, 0.90083, 0.90083, 0.84224, 0.84224, 0.84224, 0.84224, + 0.97276, 0.99793, 0.98714, 0.98714, 0.98714, 0.98714, 0.98714, 1.08595, + 0.89876, 0.99074, 0.99074, 0.99074, 0.99074, 0.942, 1.0231, 0.942, 0.91755, + 0.86667, 0.91755, 0.86667, 0.91755, 0.86667, 0.80314, 0.896, 0.80314, 0.896, + 0.80314, 0.896, 0.80314, 0.896, 0.92222, 0.93372, 0.92915, 1.01411, 0.73764, + 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, + 0.90083, 0.83051, 1.00512, 0.83051, 1.00512, 0.83051, 1.00512, 1, 1, 0.90284, + 0.99793, 0.90976, 0.99793, 0.86023, 0.84224, 0.86023, 0.84224, 0.86023, + 0.84224, 0.86023, 1.05326, 0.86023, 0.84224, 0.82873, 1.07469, 0.74, 1.09377, + 1, 1, 0.938, 0.84869, 1.06226, 1, 1, 0.84869, 0.83704, 0.84869, 0.81441, + 0.85588, 1.08927, 0.91115, 0.99793, 1, 1, 0.91115, 0.99793, 0.91887, 0.90991, + 0.99793, 0.8858, 0.98714, 0.8858, 0.98714, 0.8858, 0.98714, 0.894, 0.91434, + 0.74498, 0.98196, 1, 1, 0.74498, 0.98196, 0.73914, 0.792, 0.73914, 0.792, 1, + 1, 0.73914, 0.792, 1, 1, 0.81363, 0.904, 0.81363, 1.19137, 0.89591, 0.99074, + 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, + 0.89591, 0.99074, 0.89633, 1.01915, 0.8111, 0.942, 0.8111, 0.90531, 0.856, + 0.90531, 0.856, 0.90531, 0.856, 1, 0.92241, 0.91755, 0.86667, 0.788, 0.86936, + 0.8858, 0.89876, 1, 1, 0.81363, 1.19137, 0.90088, 0.90088, 0.90088, 0.90088, + 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90388, 1.03901, 0.92138, + 0.78105, 0.7154, 0.86169, 0.80513, 0.94007, 0.82528, 0.98612, 1.06226, + 0.91755, 0.8126, 0.81884, 0.92819, 0.73764, 0.90531, 0.90284, 0.8858, 0.86023, + 0.8126, 0.91172, 0.96518, 0.91115, 0.83089, 0.8858, 0.87791, 0.79761, 0.89297, + 0.81363, 0.88157, 0.89992, 0.85608, 0.81992, 0.94307, 0.86023, 0.88157, + 0.95308, 0.98699, 0.99793, 1.06226, 0.95817, 0.95308, 0.97358, 0.928, 0.98088, + 0.98699, 0.92761, 0.99793, 0.96017, 1.06226, 0.986, 0.944, 0.95978, 0.938, + 0.96705, 0.98714, 0.80442, 0.98972, 1, 0.89762, 1.04552, 0.95817, 0.99007, + 0.87064, 0.91879, 0.88888, 1.06226, 0.95817, 0.98714, 0.95817, 0.88888, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89633, 1.01915, + 0.89633, 1.01915, 0.89633, 1.01915, 0.8111, 0.942, 0.9219, 1, 0.89903, 1, 1, + 1, 0.93173, 0.93173, 0.93173, 1, 1.06304, 1.06304, 1.06904, 0.89903, 0.89903, + 0.80549, 1, 1.156, 1, 1, 0.76575, 0.76575, 1, 1, 0.72458, 1, 1, 1, 1, 0.92241, + 1, 1, 1, 0.619, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.07257, 1, + 0.74705, 0.71119, 1.02058, 1.024, 1.02119, 1, 1, 1.1536, 1.08595, 1.08595, 1, + 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05638, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, +]; +const MyriadProRegularMetrics = { + lineHeight: 1.2, + lineGap: 0.2, +}; // ./src/core/segoeui_factors.js + +const SegoeuiBoldFactors = [ + 1.76738, 1, 1, 0.99297, 0.9824, 1.04016, 1.06497, 1.03424, 0.97529, 1.17647, + 1.23203, 1.1085, 1.1085, 1.16939, 1.2107, 0.9754, 1.21408, 0.9754, 1.59578, + 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, + 1.03424, 1.03424, 0.81378, 0.81378, 1.2107, 1.2107, 1.2107, 0.71703, 0.97847, + 0.97363, 0.88776, 0.8641, 1.02096, 0.79795, 0.85132, 0.914, 1.06085, 1.1406, + 0.8007, 0.89858, 0.83693, 1.14889, 1.09398, 0.97489, 0.92094, 0.97489, + 0.90399, 0.84041, 0.95923, 1.00135, 1, 1.06467, 0.98243, 0.90996, 0.99361, + 1.1085, 1.56942, 1.1085, 1.2107, 0.74627, 0.94282, 0.96752, 1.01519, 0.86304, + 1.01359, 0.97278, 1.15103, 1.01359, 0.98561, 1.02285, 1.02285, 1.00527, + 1.02285, 1.0302, 0.99041, 1.0008, 1.01519, 1.01359, 1.02258, 0.79104, 1.16862, + 0.99041, 0.97454, 1.02511, 0.99298, 0.96752, 0.95801, 0.94856, 1.16579, + 0.94856, 1.2107, 0.9824, 1.03424, 1.03424, 1, 1.03424, 1.16579, 0.8727, + 1.3871, 1.18622, 1.10818, 1.04478, 1.2107, 1.18622, 0.75155, 0.94994, 1.28826, + 1.21408, 1.21408, 0.91056, 1, 0.91572, 0.9754, 0.64663, 1.18328, 1.24866, + 1.04478, 1.14169, 1.15749, 1.17389, 0.71703, 0.97363, 0.97363, 0.97363, + 0.97363, 0.97363, 0.97363, 0.93506, 0.8641, 0.79795, 0.79795, 0.79795, + 0.79795, 1.1406, 1.1406, 1.1406, 1.1406, 1.02096, 1.09398, 0.97426, 0.97426, + 0.97426, 0.97426, 0.97426, 1.2107, 0.97489, 1.00135, 1.00135, 1.00135, + 1.00135, 0.90996, 0.92094, 1.02798, 0.96752, 0.96752, 0.96752, 0.96752, + 0.96752, 0.96752, 0.93136, 0.86304, 0.97278, 0.97278, 0.97278, 0.97278, + 1.02285, 1.02285, 1.02285, 1.02285, 0.97122, 0.99041, 1, 1, 1, 1, 1, 1.28826, + 1.0008, 0.99041, 0.99041, 0.99041, 0.99041, 0.96752, 1.01519, 0.96752, + 0.97363, 0.96752, 0.97363, 0.96752, 0.97363, 0.96752, 0.8641, 0.86304, 0.8641, + 0.86304, 0.8641, 0.86304, 0.8641, 0.86304, 1.02096, 1.03057, 1.02096, 1.03517, + 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, + 0.79795, 0.97278, 0.914, 1.01359, 0.914, 1.01359, 0.914, 1.01359, 1, 1, + 1.06085, 0.98561, 1.06085, 1.00879, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, + 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 0.97138, 1.08692, 0.8007, 1.02285, + 1, 1, 1.00527, 0.83693, 1.02285, 1, 1, 0.83693, 0.9455, 0.83693, 0.90418, + 0.83693, 1.13005, 1.09398, 0.99041, 1, 1, 1.09398, 0.99041, 0.96692, 1.09251, + 0.99041, 0.97489, 1.0008, 0.97489, 1.0008, 0.97489, 1.0008, 0.93994, 0.97931, + 0.90399, 1.02258, 1, 1, 0.90399, 1.02258, 0.84041, 0.79104, 0.84041, 0.79104, + 0.84041, 0.79104, 0.84041, 0.79104, 1, 1, 0.95923, 1.07034, 0.95923, 1.16862, + 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, + 1.00135, 0.99041, 1.00135, 0.99041, 1.06467, 1.02511, 0.90996, 0.96752, + 0.90996, 0.99361, 0.95801, 0.99361, 0.95801, 0.99361, 0.95801, 1.07733, + 1.03424, 0.97363, 0.96752, 0.93506, 0.93136, 0.97489, 1.0008, 1, 1, 0.95923, + 1.16862, 1.15103, 1.15103, 1.01173, 1.03959, 0.75953, 0.81378, 0.79912, + 1.15103, 1.21994, 0.95161, 0.87815, 1.01149, 0.81525, 0.7676, 0.98167, + 1.01134, 1.02546, 0.84097, 1.03089, 1.18102, 0.97363, 0.88776, 0.85134, + 0.97826, 0.79795, 0.99361, 1.06085, 0.97489, 1.1406, 0.89858, 1.0388, 1.14889, + 1.09398, 0.86039, 0.97489, 1.0595, 0.92094, 0.94793, 0.95923, 0.90996, + 0.99346, 0.98243, 1.02112, 0.95493, 1.1406, 0.90996, 1.03574, 1.02597, 1.0008, + 1.18102, 1.06628, 1.03574, 1.0192, 1.01932, 1.00886, 0.97531, 1.0106, 1.0008, + 1.13189, 1.18102, 1.02277, 0.98683, 1.0016, 0.99561, 1.07237, 1.0008, 0.90434, + 0.99921, 0.93803, 0.8965, 1.23085, 1.06628, 1.04983, 0.96268, 1.0499, 0.98439, + 1.18102, 1.06628, 1.0008, 1.06628, 0.98439, 0.79795, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1.09466, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.97278, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.02065, 1, 1, 1, 1, 1, 1, 1.06467, 1.02511, + 1.06467, 1.02511, 1.06467, 1.02511, 0.90996, 0.96752, 1, 1.21408, 0.89903, 1, + 1, 0.75155, 1.04394, 1.04394, 1.04394, 1.04394, 0.98633, 0.98633, 0.98633, + 0.73047, 0.73047, 1.20642, 0.91211, 1.25635, 1.222, 1.02956, 1.03372, 1.03372, + 0.96039, 1.24633, 1, 1.12454, 0.93503, 1.03424, 1.19687, 1.03424, 1, 1, 1, + 0.771, 1, 1, 1.15749, 1.15749, 1.15749, 1.10948, 0.86279, 0.94434, 0.86279, + 0.94434, 0.86182, 1, 1, 1.16897, 1, 0.96085, 0.90137, 1.2107, 1.18416, + 1.13973, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21172, 1.29004, + 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, + 1.18874, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, + 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.09193, 1.09193, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +]; +const SegoeuiBoldMetrics = { + lineHeight: 1.33008, + lineGap: 0, +}; +const SegoeuiBoldItalicFactors = [ + 1.76738, 1, 1, 0.98946, 1.03959, 1.04016, 1.02809, 1.036, 0.97639, 1.10953, + 1.23203, 1.11144, 1.11144, 1.16939, 1.21237, 0.9754, 1.21261, 0.9754, 1.59754, + 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 0.81378, + 0.81378, 1.21237, 1.21237, 1.21237, 0.73541, 0.97847, 0.97363, 0.89723, + 0.87897, 1.0426, 0.79429, 0.85292, 0.91149, 1.05815, 1.1406, 0.79631, 0.90128, + 0.83853, 1.04396, 1.10615, 0.97552, 0.94436, 0.97552, 0.88641, 0.80527, + 0.96083, 1.00135, 1, 1.06777, 0.9817, 0.91142, 0.99361, 1.11144, 1.57293, + 1.11144, 1.21237, 0.74627, 1.31818, 1.06585, 0.97042, 0.83055, 0.97042, + 0.93503, 1.1261, 0.97042, 0.97922, 1.14236, 0.94552, 1.01054, 1.14236, + 1.02471, 0.97922, 0.94165, 0.97042, 0.97042, 1.0276, 0.78929, 1.1261, 0.97922, + 0.95874, 1.02197, 0.98507, 0.96752, 0.97168, 0.95107, 1.16579, 0.95107, + 1.21237, 1.03959, 1.036, 1.036, 1, 1.036, 1.16579, 0.87357, 1.31818, 1.18754, + 1.26781, 1.05356, 1.21237, 1.18622, 0.79487, 0.94994, 1.29004, 1.24047, + 1.24047, 1.31818, 1, 0.91484, 0.9754, 1.31818, 1.1349, 1.24866, 1.05356, + 1.13934, 1.15574, 1.17389, 0.73541, 0.97363, 0.97363, 0.97363, 0.97363, + 0.97363, 0.97363, 0.94385, 0.87897, 0.79429, 0.79429, 0.79429, 0.79429, + 1.1406, 1.1406, 1.1406, 1.1406, 1.0426, 1.10615, 0.97552, 0.97552, 0.97552, + 0.97552, 0.97552, 1.21237, 0.97552, 1.00135, 1.00135, 1.00135, 1.00135, + 0.91142, 0.94436, 0.98721, 1.06585, 1.06585, 1.06585, 1.06585, 1.06585, + 1.06585, 0.96705, 0.83055, 0.93503, 0.93503, 0.93503, 0.93503, 1.14236, + 1.14236, 1.14236, 1.14236, 0.93125, 0.97922, 0.94165, 0.94165, 0.94165, + 0.94165, 0.94165, 1.29004, 0.94165, 0.97922, 0.97922, 0.97922, 0.97922, + 0.96752, 0.97042, 0.96752, 0.97363, 1.06585, 0.97363, 1.06585, 0.97363, + 1.06585, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, + 0.83055, 1.0426, 1.0033, 1.0426, 0.97042, 0.79429, 0.93503, 0.79429, 0.93503, + 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.91149, 0.97042, + 0.91149, 0.97042, 0.91149, 0.97042, 1, 1, 1.05815, 0.97922, 1.05815, 0.97922, + 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, + 1.14236, 0.97441, 1.04302, 0.79631, 1.01582, 1, 1, 1.01054, 0.83853, 1.14236, + 1, 1, 0.83853, 1.09125, 0.83853, 0.90418, 0.83853, 1.19508, 1.10615, 0.97922, + 1, 1, 1.10615, 0.97922, 1.01034, 1.10466, 0.97922, 0.97552, 0.94165, 0.97552, + 0.94165, 0.97552, 0.94165, 0.91602, 0.91981, 0.88641, 1.0276, 1, 1, 0.88641, + 1.0276, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, + 0.78929, 1, 1, 0.96083, 1.05403, 0.95923, 1.16862, 1.00135, 0.97922, 1.00135, + 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, + 0.97922, 1.06777, 1.02197, 0.91142, 0.96752, 0.91142, 0.99361, 0.97168, + 0.99361, 0.97168, 0.99361, 0.97168, 1.23199, 1.036, 0.97363, 1.06585, 0.94385, + 0.96705, 0.97552, 0.94165, 1, 1, 0.96083, 1.1261, 1.31818, 1.31818, 1.31818, + 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 0.95161, 1.27126, + 1.00811, 0.83284, 0.77702, 0.99137, 0.95253, 1.0347, 0.86142, 1.07205, + 1.14236, 0.97363, 0.89723, 0.86869, 1.09818, 0.79429, 0.99361, 1.05815, + 0.97552, 1.1406, 0.90128, 1.06662, 1.04396, 1.10615, 0.84918, 0.97552, + 1.04694, 0.94436, 0.98015, 0.96083, 0.91142, 1.00356, 0.9817, 1.01945, + 0.98999, 1.1406, 0.91142, 1.04961, 0.9898, 1.00639, 1.14236, 1.07514, 1.04961, + 0.99607, 1.02897, 1.008, 0.9898, 0.95134, 1.00639, 1.11121, 1.14236, 1.00518, + 0.97981, 1.02186, 1, 1.08578, 0.94165, 0.99314, 0.98387, 0.93028, 0.93377, + 1.35125, 1.07514, 1.10687, 0.93491, 1.04232, 1.00351, 1.14236, 1.07514, + 0.94165, 1.07514, 1.00351, 0.79429, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1.09097, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.93503, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0.96609, 1, 1, 1, 1, 1, 1, 1.06777, 1.02197, 1.06777, + 1.02197, 1.06777, 1.02197, 0.91142, 0.96752, 1, 1.21261, 0.89903, 1, 1, + 0.75155, 1.04745, 1.04745, 1.04745, 1.04394, 0.98633, 0.98633, 0.98633, + 0.72959, 0.72959, 1.20502, 0.91406, 1.26514, 1.222, 1.02956, 1.03372, 1.03372, + 0.96039, 1.24633, 1, 1.09125, 0.93327, 1.03336, 1.16541, 1.036, 1, 1, 1, + 0.771, 1, 1, 1.15574, 1.15574, 1.15574, 1.15574, 0.86364, 0.94434, 0.86279, + 0.94434, 0.86224, 1, 1, 1.16798, 1, 0.96085, 0.90068, 1.21237, 1.18416, + 1.13904, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21339, 1.29004, + 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, + 1.18775, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, + 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.13269, 1.13269, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +]; +const SegoeuiBoldItalicMetrics = { + lineHeight: 1.33008, + lineGap: 0, +}; +const SegoeuiItalicFactors = [ + 1.76738, 1, 1, 0.98946, 1.14763, 1.05365, 1.06234, 0.96927, 0.92586, 1.15373, + 1.18414, 0.91349, 0.91349, 1.07403, 1.17308, 0.78383, 1.20088, 0.78383, + 1.42531, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, + 0.96927, 0.96927, 0.96927, 0.78383, 0.78383, 1.17308, 1.17308, 1.17308, + 0.77349, 0.94565, 0.94729, 0.85944, 0.88506, 0.9858, 0.74817, 0.80016, + 0.88449, 0.98039, 0.95782, 0.69238, 0.89898, 0.83231, 0.98183, 1.03989, + 0.96924, 0.86237, 0.96924, 0.80595, 0.74524, 0.86091, 0.95402, 0.94143, + 0.98448, 0.8858, 0.83089, 0.93285, 1.0949, 1.39016, 1.0949, 1.45994, 0.74627, + 1.04839, 0.97454, 0.97454, 0.87207, 0.97454, 0.87533, 1.06151, 0.97454, + 1.00176, 1.16484, 1.08132, 0.98047, 1.16484, 1.02989, 1.01054, 0.96225, + 0.97454, 0.97454, 1.06598, 0.79004, 1.16344, 1.00351, 0.94629, 0.9973, + 0.91016, 0.96777, 0.9043, 0.91082, 0.92481, 0.91082, 1.17308, 0.95748, + 0.96927, 0.96927, 1, 0.96927, 0.92481, 0.80597, 1.04839, 1.23393, 1.1781, + 0.9245, 1.17308, 1.20808, 0.63218, 0.94261, 1.24822, 1.09971, 1.09971, + 1.04839, 1, 0.85273, 0.78032, 1.04839, 1.09971, 1.22326, 0.9245, 1.09836, + 1.13525, 1.15222, 0.70424, 0.94729, 0.94729, 0.94729, 0.94729, 0.94729, + 0.94729, 0.85498, 0.88506, 0.74817, 0.74817, 0.74817, 0.74817, 0.95782, + 0.95782, 0.95782, 0.95782, 0.9858, 1.03989, 0.96924, 0.96924, 0.96924, + 0.96924, 0.96924, 1.17308, 0.96924, 0.95402, 0.95402, 0.95402, 0.95402, + 0.83089, 0.86237, 0.88409, 0.97454, 0.97454, 0.97454, 0.97454, 0.97454, + 0.97454, 0.92916, 0.87207, 0.87533, 0.87533, 0.87533, 0.87533, 0.93146, + 0.93146, 0.93146, 0.93146, 0.93854, 1.01054, 0.96225, 0.96225, 0.96225, + 0.96225, 0.96225, 1.24822, 0.8761, 1.00351, 1.00351, 1.00351, 1.00351, + 0.96777, 0.97454, 0.96777, 0.94729, 0.97454, 0.94729, 0.97454, 0.94729, + 0.97454, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, + 0.87207, 0.9858, 0.95391, 0.9858, 0.97454, 0.74817, 0.87533, 0.74817, 0.87533, + 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.88449, 0.97454, + 0.88449, 0.97454, 0.88449, 0.97454, 1, 1, 0.98039, 1.00176, 0.98039, 1.00176, + 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 1.16484, + 0.95782, 0.93146, 0.84421, 1.12761, 0.69238, 1.08132, 1, 1, 0.98047, 0.83231, + 1.16484, 1, 1, 0.84723, 1.04861, 0.84723, 0.78755, 0.83231, 1.23736, 1.03989, + 1.01054, 1, 1, 1.03989, 1.01054, 0.9857, 1.03849, 1.01054, 0.96924, 0.96225, + 0.96924, 0.96225, 0.96924, 0.96225, 0.92383, 0.90171, 0.80595, 1.06598, 1, 1, + 0.80595, 1.06598, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, 0.79004, + 0.74524, 0.79004, 1, 1, 0.86091, 1.02759, 0.85771, 1.16344, 0.95402, 1.00351, + 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, + 0.95402, 1.00351, 0.98448, 0.9973, 0.83089, 0.96777, 0.83089, 0.93285, 0.9043, + 0.93285, 0.9043, 0.93285, 0.9043, 1.31868, 0.96927, 0.94729, 0.97454, 0.85498, + 0.92916, 0.96924, 0.8761, 1, 1, 0.86091, 1.16344, 1.04839, 1.04839, 1.04839, + 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 0.81965, 0.81965, + 0.94729, 0.78032, 0.71022, 0.90883, 0.84171, 0.99877, 0.77596, 1.05734, 1.2, + 0.94729, 0.85944, 0.82791, 0.9607, 0.74817, 0.93285, 0.98039, 0.96924, + 0.95782, 0.89898, 0.98316, 0.98183, 1.03989, 0.78614, 0.96924, 0.97642, + 0.86237, 0.86075, 0.86091, 0.83089, 0.90082, 0.8858, 0.97296, 1.01284, + 0.95782, 0.83089, 1.0976, 1.04, 1.03342, 1.2, 1.0675, 1.0976, 0.98205, + 1.03809, 1.05097, 1.04, 0.95364, 1.03342, 1.05401, 1.2, 1.02148, 1.0119, + 1.04724, 1.0127, 1.02732, 0.96225, 0.8965, 0.97783, 0.93574, 0.94818, 1.30679, + 1.0675, 1.11826, 0.99821, 1.0557, 1.0326, 1.2, 1.0675, 0.96225, 1.0675, + 1.0326, 0.74817, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.03754, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.87533, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0.98705, 1, 1, 1, 1, 1, 1, 0.98448, 0.9973, 0.98448, 0.9973, 0.98448, 0.9973, + 0.83089, 0.96777, 1, 1.20088, 0.89903, 1, 1, 0.75155, 0.94945, 0.94945, + 0.94945, 0.94945, 1.12317, 1.12317, 1.12317, 0.67603, 0.67603, 1.15621, + 0.73584, 1.21191, 1.22135, 1.06483, 0.94868, 0.94868, 0.95996, 1.24633, 1, + 1.07497, 0.87709, 0.96927, 1.01473, 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.09836, + 1.09836, 1.09836, 1.01522, 0.86321, 0.94434, 0.8649, 0.94434, 0.86182, 1, 1, + 1.083, 1, 0.91578, 0.86438, 1.17308, 1.18416, 1.14589, 0.69825, 0.97622, + 1.96791, 1.24822, 1.24822, 1.17308, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, + 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.17984, 1.42603, 1, 1.42603, + 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, + 1.10742, 1.10742, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +]; +const SegoeuiItalicMetrics = { + lineHeight: 1.33008, + lineGap: 0, +}; +const SegoeuiRegularFactors = [ + 1.76738, 1, 1, 0.98594, 1.02285, 1.10454, 1.06234, 0.96927, 0.92037, 1.19985, + 1.2046, 0.90616, 0.90616, 1.07152, 1.1714, 0.78032, 1.20088, 0.78032, 1.40246, + 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, + 0.96927, 0.96927, 0.78032, 0.78032, 1.1714, 1.1714, 1.1714, 0.80597, 0.94084, + 0.96706, 0.85944, 0.85734, 0.97093, 0.75842, 0.79936, 0.88198, 0.9831, + 0.95782, 0.71387, 0.86969, 0.84636, 1.07796, 1.03584, 0.96924, 0.83968, + 0.96924, 0.82826, 0.79649, 0.85771, 0.95132, 0.93119, 0.98965, 0.88433, + 0.8287, 0.93365, 1.08612, 1.3638, 1.08612, 1.45786, 0.74627, 0.80499, 0.91484, + 1.05707, 0.92383, 1.05882, 0.9403, 1.12654, 1.05882, 1.01756, 1.09011, + 1.09011, 0.99414, 1.09011, 1.034, 1.01756, 1.05356, 1.05707, 1.05882, 1.04399, + 0.84863, 1.21968, 1.01756, 0.95801, 1.00068, 0.91797, 0.96777, 0.9043, + 0.90351, 0.92105, 0.90351, 1.1714, 0.85337, 0.96927, 0.96927, 0.99912, + 0.96927, 0.92105, 0.80597, 1.2434, 1.20808, 1.05937, 0.90957, 1.1714, 1.20808, + 0.75155, 0.94261, 1.24644, 1.09971, 1.09971, 0.84751, 1, 0.85273, 0.78032, + 0.61584, 1.05425, 1.17914, 0.90957, 1.08665, 1.11593, 1.14169, 0.73381, + 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.86035, 0.85734, + 0.75842, 0.75842, 0.75842, 0.75842, 0.95782, 0.95782, 0.95782, 0.95782, + 0.97093, 1.03584, 0.96924, 0.96924, 0.96924, 0.96924, 0.96924, 1.1714, + 0.96924, 0.95132, 0.95132, 0.95132, 0.95132, 0.8287, 0.83968, 0.89049, + 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.93575, 0.92383, + 0.9403, 0.9403, 0.9403, 0.9403, 0.8717, 0.8717, 0.8717, 0.8717, 1.00527, + 1.01756, 1.05356, 1.05356, 1.05356, 1.05356, 1.05356, 1.24644, 0.95923, + 1.01756, 1.01756, 1.01756, 1.01756, 0.96777, 1.05707, 0.96777, 0.96706, + 0.91484, 0.96706, 0.91484, 0.96706, 0.91484, 0.85734, 0.92383, 0.85734, + 0.92383, 0.85734, 0.92383, 0.85734, 0.92383, 0.97093, 1.0969, 0.97093, + 1.05882, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, + 0.75842, 0.9403, 0.88198, 1.05882, 0.88198, 1.05882, 0.88198, 1.05882, 1, 1, + 0.9831, 1.01756, 0.9831, 1.01756, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782, + 0.8717, 0.95782, 1.09011, 0.95782, 0.8717, 0.84784, 1.11551, 0.71387, 1.09011, + 1, 1, 0.99414, 0.84636, 1.09011, 1, 1, 0.84636, 1.0536, 0.84636, 0.94298, + 0.84636, 1.23297, 1.03584, 1.01756, 1, 1, 1.03584, 1.01756, 1.00323, 1.03444, + 1.01756, 0.96924, 1.05356, 0.96924, 1.05356, 0.96924, 1.05356, 0.93066, + 0.98293, 0.82826, 1.04399, 1, 1, 0.82826, 1.04399, 0.79649, 0.84863, 0.79649, + 0.84863, 0.79649, 0.84863, 0.79649, 0.84863, 1, 1, 0.85771, 1.17318, 0.85771, + 1.21968, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, + 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.98965, 1.00068, 0.8287, + 0.96777, 0.8287, 0.93365, 0.9043, 0.93365, 0.9043, 0.93365, 0.9043, 1.08571, + 0.96927, 0.96706, 0.91484, 0.86035, 0.93575, 0.96924, 0.95923, 1, 1, 0.85771, + 1.21968, 1.11437, 1.11437, 0.93109, 0.91202, 0.60411, 0.84164, 0.55572, + 1.01173, 0.97361, 0.81818, 0.81818, 0.96635, 0.78032, 0.72727, 0.92366, + 0.98601, 1.03405, 0.77968, 1.09799, 1.2, 0.96706, 0.85944, 0.85638, 0.96491, + 0.75842, 0.93365, 0.9831, 0.96924, 0.95782, 0.86969, 0.94152, 1.07796, + 1.03584, 0.78437, 0.96924, 0.98715, 0.83968, 0.83491, 0.85771, 0.8287, + 0.94492, 0.88433, 0.9287, 1.0098, 0.95782, 0.8287, 1.0625, 0.98248, 1.03424, + 1.2, 1.01071, 1.0625, 0.95246, 1.03809, 1.04912, 0.98248, 1.00221, 1.03424, + 1.05443, 1.2, 1.04785, 0.99609, 1.00169, 1.05176, 0.99346, 1.05356, 0.9087, + 1.03004, 0.95542, 0.93117, 1.23362, 1.01071, 1.07831, 1.02512, 1.05205, + 1.03502, 1.2, 1.01071, 1.05356, 1.01071, 1.03502, 0.75842, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1.03719, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9403, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.04021, 1, 1, 1, 1, 1, 1, 0.98965, + 1.00068, 0.98965, 1.00068, 0.98965, 1.00068, 0.8287, 0.96777, 1, 1.20088, + 0.89903, 1, 1, 0.75155, 1.03077, 1.03077, 1.03077, 1.03077, 1.13196, 1.13196, + 1.13196, 0.67428, 0.67428, 1.16039, 0.73291, 1.20996, 1.22135, 1.06483, + 0.94868, 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87796, 0.96927, 1.01518, + 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.10539, 1.10539, 1.11358, 1.06967, 0.86279, + 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.083, 1, 0.91578, 0.86507, 1.1714, + 1.18416, 1.14589, 0.69825, 0.97622, 1.9697, 1.24822, 1.24822, 1.17238, + 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, + 0.87025, 1.18083, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, + 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.10938, 1.10938, 1, 1, 1, + 1.05425, 1.09971, 1.09971, 1.09971, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +]; +const SegoeuiRegularMetrics = { + lineHeight: 1.33008, + lineGap: 0, +}; // ./src/core/xfa_fonts.js + +const getXFAFontMap = getLookupTableFactory(function (t) { + t["MyriadPro-Regular"] = t["PdfJS-Fallback-Regular"] = { + name: "LiberationSans-Regular", + factors: MyriadProRegularFactors, + baseWidths: LiberationSansRegularWidths, + baseMapping: LiberationSansRegularMapping, + metrics: MyriadProRegularMetrics, + }; + t["MyriadPro-Bold"] = t["PdfJS-Fallback-Bold"] = { + name: "LiberationSans-Bold", + factors: MyriadProBoldFactors, + baseWidths: LiberationSansBoldWidths, + baseMapping: LiberationSansBoldMapping, + metrics: MyriadProBoldMetrics, + }; + t["MyriadPro-It"] = + t["MyriadPro-Italic"] = + t["PdfJS-Fallback-Italic"] = + { + name: "LiberationSans-Italic", + factors: MyriadProItalicFactors, + baseWidths: LiberationSansItalicWidths, + baseMapping: LiberationSansItalicMapping, + metrics: MyriadProItalicMetrics, + }; + t["MyriadPro-BoldIt"] = + t["MyriadPro-BoldItalic"] = + t["PdfJS-Fallback-BoldItalic"] = + { + name: "LiberationSans-BoldItalic", + factors: MyriadProBoldItalicFactors, + baseWidths: LiberationSansBoldItalicWidths, + baseMapping: LiberationSansBoldItalicMapping, + metrics: MyriadProBoldItalicMetrics, + }; + t.ArialMT = + t.Arial = + t["Arial-Regular"] = + { + name: "LiberationSans-Regular", + baseWidths: LiberationSansRegularWidths, + baseMapping: LiberationSansRegularMapping, + }; + t["Arial-BoldMT"] = t["Arial-Bold"] = { + name: "LiberationSans-Bold", + baseWidths: LiberationSansBoldWidths, + baseMapping: LiberationSansBoldMapping, + }; + t["Arial-ItalicMT"] = t["Arial-Italic"] = { + name: "LiberationSans-Italic", + baseWidths: LiberationSansItalicWidths, + baseMapping: LiberationSansItalicMapping, + }; + t["Arial-BoldItalicMT"] = t["Arial-BoldItalic"] = { + name: "LiberationSans-BoldItalic", + baseWidths: LiberationSansBoldItalicWidths, + baseMapping: LiberationSansBoldItalicMapping, + }; + t["Calibri-Regular"] = { + name: "LiberationSans-Regular", + factors: CalibriRegularFactors, + baseWidths: LiberationSansRegularWidths, + baseMapping: LiberationSansRegularMapping, + metrics: CalibriRegularMetrics, + }; + t["Calibri-Bold"] = { + name: "LiberationSans-Bold", + factors: CalibriBoldFactors, + baseWidths: LiberationSansBoldWidths, + baseMapping: LiberationSansBoldMapping, + metrics: CalibriBoldMetrics, + }; + t["Calibri-Italic"] = { + name: "LiberationSans-Italic", + factors: CalibriItalicFactors, + baseWidths: LiberationSansItalicWidths, + baseMapping: LiberationSansItalicMapping, + metrics: CalibriItalicMetrics, + }; + t["Calibri-BoldItalic"] = { + name: "LiberationSans-BoldItalic", + factors: CalibriBoldItalicFactors, + baseWidths: LiberationSansBoldItalicWidths, + baseMapping: LiberationSansBoldItalicMapping, + metrics: CalibriBoldItalicMetrics, + }; + t["Segoeui-Regular"] = { + name: "LiberationSans-Regular", + factors: SegoeuiRegularFactors, + baseWidths: LiberationSansRegularWidths, + baseMapping: LiberationSansRegularMapping, + metrics: SegoeuiRegularMetrics, + }; + t["Segoeui-Bold"] = { + name: "LiberationSans-Bold", + factors: SegoeuiBoldFactors, + baseWidths: LiberationSansBoldWidths, + baseMapping: LiberationSansBoldMapping, + metrics: SegoeuiBoldMetrics, + }; + t["Segoeui-Italic"] = { + name: "LiberationSans-Italic", + factors: SegoeuiItalicFactors, + baseWidths: LiberationSansItalicWidths, + baseMapping: LiberationSansItalicMapping, + metrics: SegoeuiItalicMetrics, + }; + t["Segoeui-BoldItalic"] = { + name: "LiberationSans-BoldItalic", + factors: SegoeuiBoldItalicFactors, + baseWidths: LiberationSansBoldItalicWidths, + baseMapping: LiberationSansBoldItalicMapping, + metrics: SegoeuiBoldItalicMetrics, + }; + t["Helvetica-Regular"] = t.Helvetica = { + name: "LiberationSans-Regular", + factors: HelveticaRegularFactors, + baseWidths: LiberationSansRegularWidths, + baseMapping: LiberationSansRegularMapping, + metrics: HelveticaRegularMetrics, + }; + t["Helvetica-Bold"] = { + name: "LiberationSans-Bold", + factors: HelveticaBoldFactors, + baseWidths: LiberationSansBoldWidths, + baseMapping: LiberationSansBoldMapping, + metrics: HelveticaBoldMetrics, + }; + t["Helvetica-Italic"] = { + name: "LiberationSans-Italic", + factors: HelveticaItalicFactors, + baseWidths: LiberationSansItalicWidths, + baseMapping: LiberationSansItalicMapping, + metrics: HelveticaItalicMetrics, + }; + t["Helvetica-BoldItalic"] = { + name: "LiberationSans-BoldItalic", + factors: HelveticaBoldItalicFactors, + baseWidths: LiberationSansBoldItalicWidths, + baseMapping: LiberationSansBoldItalicMapping, + metrics: HelveticaBoldItalicMetrics, + }; +}); +function getXfaFontName(name) { + const fontName = normalizeFontName(name); + const fontMap = getXFAFontMap(); + return fontMap[fontName]; } -const wa = [ - 1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, - 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.54657, - 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, - 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, - 0.92138, 0.83908, 0.7762, 0.73293, 0.87289, 0.73133, 0.7514, 0.81921, - 0.87356, 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.9121, 0.86943, - 0.79795, 0.88198, 0.77958, 0.70864, 0.81055, 0.90399, 0.88653, 0.96017, - 0.82577, 0.77892, 0.78257, 0.97507, 1.54657, 0.97507, 0.85284, 0.89552, - 0.90176, 0.88762, 0.8785, 0.75241, 0.8785, 0.90518, 0.95015, 0.77618, - 0.8785, 0.88401, 0.91916, 0.86304, 0.88401, 0.91488, 0.8785, 0.8801, 0.8785, - 0.8785, 0.91343, 0.7173, 1.04106, 0.8785, 0.85075, 0.95794, 0.82616, - 0.85162, 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, - 0.91133, 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, 1.12401, - 0.96839, 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, - 0.90323, 1, 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, - 0.82845, 0.84133, 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, - 0.83908, 0.77539, 0.73293, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, - 0.95958, 0.95958, 0.95958, 0.88506, 0.9121, 0.86943, 0.86943, 0.86943, - 0.86943, 0.86943, 0.85284, 0.87508, 0.90399, 0.90399, 0.90399, 0.90399, - 0.77892, 0.79795, 0.90807, 0.88762, 0.88762, 0.88762, 0.88762, 0.88762, - 0.88762, 0.8715, 0.75241, 0.90518, 0.90518, 0.90518, 0.90518, 0.88401, - 0.88401, 0.88401, 0.88401, 0.8785, 0.8785, 0.8801, 0.8801, 0.8801, 0.8801, - 0.8801, 0.90747, 0.89049, 0.8785, 0.8785, 0.8785, 0.8785, 0.85162, 0.8785, - 0.85162, 0.83908, 0.88762, 0.83908, 0.88762, 0.83908, 0.88762, 0.73293, - 0.75241, 0.73293, 0.75241, 0.73293, 0.75241, 0.73293, 0.75241, 0.87289, - 0.83016, 0.88506, 0.93125, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, - 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.81921, 0.77618, 0.81921, - 0.77618, 0.81921, 0.77618, 1, 1, 0.87356, 0.8785, 0.91075, 0.89608, 0.95958, - 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, - 0.88401, 0.76229, 0.90167, 0.59526, 0.91916, 1, 1, 0.86304, 0.69225, - 0.88401, 1, 1, 0.70424, 0.79468, 0.91926, 0.88175, 0.70823, 0.94903, 0.9121, - 0.8785, 1, 1, 0.9121, 0.8785, 0.87802, 0.88656, 0.8785, 0.86943, 0.8801, - 0.86943, 0.8801, 0.86943, 0.8801, 0.87402, 0.89291, 0.77958, 0.91343, 1, 1, - 0.77958, 0.91343, 0.70864, 0.7173, 0.70864, 0.7173, 0.70864, 0.7173, - 0.70864, 0.7173, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.8785, - 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, - 0.8785, 0.96017, 0.95794, 0.77892, 0.85162, 0.77892, 0.78257, 0.79492, - 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.88762, - 0.77539, 0.8715, 0.87508, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528, - 1, 1.15543, 0.70674, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.06303, - 0.83908, 0.80352, 0.57184, 0.6965, 0.56289, 0.82001, 0.56029, 0.81235, - 1.02988, 0.83908, 0.7762, 0.68156, 0.80367, 0.73133, 0.78257, 0.87356, - 0.86943, 0.95958, 0.75727, 0.89019, 1.04924, 0.9121, 0.7648, 0.86943, - 0.87356, 0.79795, 0.78275, 0.81055, 0.77892, 0.9762, 0.82577, 0.99819, - 0.84896, 0.95958, 0.77892, 0.96108, 1.01407, 0.89049, 1.02988, 0.94211, - 0.96108, 0.8936, 0.84021, 0.87842, 0.96399, 0.79109, 0.89049, 1.00813, - 1.02988, 0.86077, 0.87445, 0.92099, 0.84723, 0.86513, 0.8801, 0.75638, - 0.85714, 0.78216, 0.79586, 0.87965, 0.94211, 0.97747, 0.78287, 0.97926, - 0.84971, 1.02988, 0.94211, 0.8801, 0.94211, 0.84971, 0.73133, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0.90264, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 0.90518, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90548, 1, 1, 1, 1, 1, 1, - 0.96017, 0.95794, 0.96017, 0.95794, 0.96017, 0.95794, 0.77892, 0.85162, 1, - 1, 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.92794, - 0.87012, 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71143, 1.06152, 1, - 1, 1.03372, 1.03372, 0.97171, 1.4956, 2.2807, 0.93835, 0.83406, 0.91133, - 0.84107, 0.91133, 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, - 0.81499, 0.90527, 1.81055, 0.90527, 1.81055, 1.31006, 1.53711, 0.94434, - 1.08696, 1, 0.95018, 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, - 1.37077, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, - 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, - 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - ], - Da = { lineHeight: 1.2207, lineGap: 0.2207 }, - ba = [ - 1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, - 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.56239, - 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, - 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, - 0.92138, 0.83908, 0.7762, 0.71805, 0.87289, 0.73133, 0.7514, 0.81921, - 0.87356, 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.90872, 0.85938, - 0.79795, 0.87068, 0.77958, 0.69766, 0.81055, 0.90399, 0.88653, 0.96068, - 0.82577, 0.77892, 0.78257, 0.97507, 1.529, 0.97507, 0.85284, 0.89552, - 0.90176, 0.94908, 0.86411, 0.74012, 0.86411, 0.88323, 0.95015, 0.86411, - 0.86331, 0.88401, 0.91916, 0.86304, 0.88401, 0.9039, 0.86331, 0.86331, - 0.86411, 0.86411, 0.90464, 0.70852, 1.04106, 0.86331, 0.84372, 0.95794, - 0.82616, 0.84548, 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, - 0.89552, 0.91133, 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, - 1.19129, 0.96839, 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, - 1.0088, 0.90323, 1, 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, - 0.82845, 0.84133, 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, - 0.83908, 0.77539, 0.71805, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, - 0.95958, 0.95958, 0.95958, 0.88506, 0.90872, 0.85938, 0.85938, 0.85938, - 0.85938, 0.85938, 0.85284, 0.87068, 0.90399, 0.90399, 0.90399, 0.90399, - 0.77892, 0.79795, 0.90807, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, - 0.94908, 0.85887, 0.74012, 0.88323, 0.88323, 0.88323, 0.88323, 0.88401, - 0.88401, 0.88401, 0.88401, 0.8785, 0.86331, 0.86331, 0.86331, 0.86331, - 0.86331, 0.86331, 0.90747, 0.89049, 0.86331, 0.86331, 0.86331, 0.86331, - 0.84548, 0.86411, 0.84548, 0.83908, 0.94908, 0.83908, 0.94908, 0.83908, - 0.94908, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, - 0.74012, 0.87289, 0.79538, 0.88506, 0.92726, 0.73133, 0.88323, 0.73133, - 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.81921, - 0.86411, 0.81921, 0.86411, 0.81921, 0.86411, 1, 1, 0.87356, 0.86331, - 0.91075, 0.8777, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, - 0.95958, 0.88401, 0.95958, 0.88401, 0.76467, 0.90167, 0.59526, 0.91916, 1, - 1, 0.86304, 0.69225, 0.88401, 1, 1, 0.70424, 0.77312, 0.91926, 0.88175, - 0.70823, 0.94903, 0.90872, 0.86331, 1, 1, 0.90872, 0.86331, 0.86906, - 0.88116, 0.86331, 0.85938, 0.86331, 0.85938, 0.86331, 0.85938, 0.86331, - 0.87402, 0.86549, 0.77958, 0.90464, 1, 1, 0.77958, 0.90464, 0.69766, - 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 1, 1, - 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.86331, 0.90399, 0.86331, - 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, - 0.96068, 0.95794, 0.77892, 0.84548, 0.77892, 0.78257, 0.79492, 0.78257, - 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.94908, 0.77539, - 0.85887, 0.87068, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528, 1, - 1.15543, 0.70088, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.48387, - 0.83908, 0.80352, 0.57118, 0.6965, 0.56347, 0.79179, 0.55853, 0.80346, - 1.02988, 0.83908, 0.7762, 0.67174, 0.86036, 0.73133, 0.78257, 0.87356, - 0.86441, 0.95958, 0.75727, 0.89019, 1.04924, 0.90872, 0.74889, 0.85938, - 0.87891, 0.79795, 0.7957, 0.81055, 0.77892, 0.97447, 0.82577, 0.97466, - 0.87179, 0.95958, 0.77892, 0.94252, 0.95612, 0.8753, 1.02988, 0.92733, - 0.94252, 0.87411, 0.84021, 0.8728, 0.95612, 0.74081, 0.8753, 1.02189, - 1.02988, 0.84814, 0.87445, 0.91822, 0.84723, 0.85668, 0.86331, 0.81344, - 0.87581, 0.76422, 0.82046, 0.96057, 0.92733, 0.99375, 0.78022, 0.95452, - 0.86015, 1.02988, 0.92733, 0.86331, 0.92733, 0.86015, 0.73133, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0.90631, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0.88323, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85174, 1, 1, 1, 1, 1, - 1, 0.96068, 0.95794, 0.96068, 0.95794, 0.96068, 0.95794, 0.77892, 0.84548, - 1, 1, 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.89807, - 0.87012, 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71094, 1.06152, 1, - 1, 1.03372, 1.03372, 0.97171, 1.4956, 2.2807, 0.92972, 0.83406, 0.91133, - 0.83326, 0.91133, 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, - 0.81499, 0.90616, 1.81055, 0.90527, 1.81055, 1.3107, 1.53711, 0.94434, - 1.08696, 1, 0.95018, 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, - 1.37077, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, - 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, - 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - ], - Fa = { lineHeight: 1.2207, lineGap: 0.2207 }, - Sa = [ - 1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, - 1.15601, 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39543, - 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, - 0.91133, 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, - 0.88071, 0.8675, 0.81552, 0.72346, 0.85193, 0.73206, 0.7522, 0.81105, - 0.86275, 0.90685, 0.6377, 0.77892, 0.75593, 1.02638, 0.89249, 0.84118, - 0.77452, 0.85374, 0.75186, 0.67789, 0.79776, 0.88844, 0.85066, 0.94309, - 0.77818, 0.7306, 0.76659, 1.10369, 1.38313, 1.10369, 1.06139, 0.89552, - 0.8739, 0.9245, 0.9245, 0.83203, 0.9245, 0.85865, 1.09842, 0.9245, 0.9245, - 1.03297, 1.07692, 0.90918, 1.03297, 0.94959, 0.9245, 0.92274, 0.9245, - 0.9245, 1.02933, 0.77832, 1.20562, 0.9245, 0.8916, 0.98986, 0.86621, - 0.89453, 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, 0.89552, - 0.91133, 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, 1.16359, - 0.92098, 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, 1.0044, - 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, 0.80504, - 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.76318, - 0.72346, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, 0.90685, - 0.90685, 0.86477, 0.89249, 0.84118, 0.84118, 0.84118, 0.84118, 0.84118, - 0.85284, 0.84557, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, 0.77452, - 0.86331, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.84843, 0.83203, - 0.85865, 0.85865, 0.85865, 0.85865, 0.82601, 0.82601, 0.82601, 0.82601, - 0.94469, 0.9245, 0.92274, 0.92274, 0.92274, 0.92274, 0.92274, 0.90747, - 0.86651, 0.9245, 0.9245, 0.9245, 0.9245, 0.89453, 0.9245, 0.89453, 0.8675, - 0.9245, 0.8675, 0.9245, 0.8675, 0.9245, 0.72346, 0.83203, 0.72346, 0.83203, - 0.72346, 0.83203, 0.72346, 0.83203, 0.85193, 0.8875, 0.86477, 0.99034, - 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, - 0.73206, 0.85865, 0.81105, 0.9245, 0.81105, 0.9245, 0.81105, 0.9245, 1, 1, - 0.86275, 0.9245, 0.90872, 0.93591, 0.90685, 0.82601, 0.90685, 0.82601, - 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, 0.82601, 0.77896, 1.05611, - 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, 1, 1, 0.76032, 0.9375, - 0.98156, 0.93407, 0.77261, 1.11429, 0.89249, 0.9245, 1, 1, 0.89249, 0.9245, - 0.92534, 0.86698, 0.9245, 0.84118, 0.92274, 0.84118, 0.92274, 0.84118, - 0.92274, 0.8667, 0.86291, 0.75186, 1.02933, 1, 1, 0.75186, 1.02933, 0.67789, - 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 1, 1, - 0.79776, 0.97655, 0.79776, 1.23023, 0.88844, 0.9245, 0.88844, 0.9245, - 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.94309, - 0.98986, 0.7306, 0.89453, 0.7306, 0.76659, 0.79004, 0.76659, 0.79004, - 0.76659, 0.79004, 1.09231, 0.54873, 0.8675, 0.9245, 0.76318, 0.84843, - 0.84557, 0.86651, 1, 1, 0.79776, 1.20562, 1.18622, 1.18622, 1, 1.1437, - 0.67009, 0.96334, 0.93695, 1.35191, 1.40909, 0.95161, 1.48387, 0.8675, - 0.90861, 0.6192, 0.7363, 0.64824, 0.82411, 0.56321, 0.85696, 1.23516, - 0.8675, 0.81552, 0.7286, 0.84134, 0.73206, 0.76659, 0.86275, 0.84369, - 0.90685, 0.77892, 0.85871, 1.02638, 0.89249, 0.75828, 0.84118, 0.85984, - 0.77452, 0.76466, 0.79776, 0.7306, 0.90782, 0.77818, 0.903, 0.87291, - 0.90685, 0.7306, 0.99058, 1.03667, 0.94635, 1.23516, 0.9849, 0.99058, - 0.92393, 0.8916, 0.942, 1.03667, 0.75026, 0.94635, 1.0297, 1.23516, 0.90918, - 0.94048, 0.98217, 0.89746, 0.84153, 0.92274, 0.82507, 0.88832, 0.84438, - 0.88178, 1.03525, 0.9849, 1.00225, 0.78086, 0.97248, 0.89404, 1.23516, - 0.9849, 0.92274, 0.9849, 0.89404, 0.73206, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 0.89693, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85865, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90933, 1, 1, 1, 1, 1, 1, 0.94309, 0.98986, - 0.94309, 0.98986, 0.94309, 0.98986, 0.7306, 0.89453, 1, 1, 0.89552, 0.90527, - 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566, - 0.89552, 0.89552, 1.42259, 0.68994, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523, - 1.4956, 2.01462, 0.97858, 0.82616, 0.91133, 0.83437, 0.91133, 1, 1, 1, - 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90572, 1.81055, - 0.90749, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, - 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, - 0.85284, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, - 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, - 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - ], - ka = { lineHeight: 1.2207, lineGap: 0.2207 }, - Ra = [ - 1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, - 1.15601, 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39016, - 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, - 0.91133, 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, - 0.88071, 0.8675, 0.81552, 0.73834, 0.85193, 0.73206, 0.7522, 0.81105, - 0.86275, 0.90685, 0.6377, 0.77892, 0.75593, 1.02638, 0.89385, 0.85122, - 0.77452, 0.86503, 0.75186, 0.68887, 0.79776, 0.88844, 0.85066, 0.94258, - 0.77818, 0.7306, 0.76659, 1.10369, 1.39016, 1.10369, 1.06139, 0.89552, - 0.8739, 0.86128, 0.94469, 0.8457, 0.94469, 0.89464, 1.09842, 0.84636, - 0.94469, 1.03297, 1.07692, 0.90918, 1.03297, 0.95897, 0.94469, 0.9482, - 0.94469, 0.94469, 1.04692, 0.78223, 1.20562, 0.94469, 0.90332, 0.98986, - 0.86621, 0.90527, 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, - 0.89552, 0.91133, 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, - 1.08707, 0.92098, 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, - 1.0044, 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, - 0.80504, 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, - 0.76318, 0.73834, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, - 0.90685, 0.90685, 0.86477, 0.89385, 0.85122, 0.85122, 0.85122, 0.85122, - 0.85122, 0.85284, 0.85311, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, - 0.77452, 0.86331, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, - 0.8693, 0.8457, 0.89464, 0.89464, 0.89464, 0.89464, 0.82601, 0.82601, - 0.82601, 0.82601, 0.94469, 0.94469, 0.9482, 0.9482, 0.9482, 0.9482, 0.9482, - 0.90747, 0.86651, 0.94469, 0.94469, 0.94469, 0.94469, 0.90527, 0.94469, - 0.90527, 0.8675, 0.86128, 0.8675, 0.86128, 0.8675, 0.86128, 0.73834, 0.8457, - 0.73834, 0.8457, 0.73834, 0.8457, 0.73834, 0.8457, 0.85193, 0.92454, - 0.86477, 0.9921, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, - 0.73206, 0.89464, 0.73206, 0.89464, 0.81105, 0.84636, 0.81105, 0.84636, - 0.81105, 0.84636, 1, 1, 0.86275, 0.94469, 0.90872, 0.95786, 0.90685, - 0.82601, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, - 0.82601, 0.77741, 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, - 1, 1, 0.76032, 0.90452, 0.98156, 1.11842, 0.77261, 1.11429, 0.89385, - 0.94469, 1, 1, 0.89385, 0.94469, 0.95877, 0.86901, 0.94469, 0.85122, 0.9482, - 0.85122, 0.9482, 0.85122, 0.9482, 0.8667, 0.90016, 0.75186, 1.04692, 1, 1, - 0.75186, 1.04692, 0.68887, 0.78223, 0.68887, 0.78223, 0.68887, 0.78223, - 0.68887, 0.78223, 1, 1, 0.79776, 0.92188, 0.79776, 1.23023, 0.88844, - 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, - 0.94469, 0.88844, 0.94469, 0.94258, 0.98986, 0.7306, 0.90527, 0.7306, - 0.76659, 0.79004, 0.76659, 0.79004, 0.76659, 0.79004, 1.09231, 0.54873, - 0.8675, 0.86128, 0.76318, 0.8693, 0.85311, 0.86651, 1, 1, 0.79776, 1.20562, - 1.18622, 1.18622, 1, 1.1437, 0.67742, 0.96334, 0.93695, 1.35191, 1.40909, - 0.95161, 1.48387, 0.86686, 0.90861, 0.62267, 0.74359, 0.65649, 0.85498, - 0.56963, 0.88254, 1.23516, 0.8675, 0.81552, 0.75443, 0.84503, 0.73206, - 0.76659, 0.86275, 0.85122, 0.90685, 0.77892, 0.85746, 1.02638, 0.89385, - 0.75657, 0.85122, 0.86275, 0.77452, 0.74171, 0.79776, 0.7306, 0.95165, - 0.77818, 0.89772, 0.88831, 0.90685, 0.7306, 0.98142, 1.02191, 0.96576, - 1.23516, 0.99018, 0.98142, 0.9236, 0.89258, 0.94035, 1.02191, 0.78848, - 0.96576, 0.9561, 1.23516, 0.90918, 0.92578, 0.95424, 0.89746, 0.83969, - 0.9482, 0.80113, 0.89442, 0.85208, 0.86155, 0.98022, 0.99018, 1.00452, - 0.81209, 0.99247, 0.89181, 1.23516, 0.99018, 0.9482, 0.99018, 0.89181, - 0.73206, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.88844, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89464, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0.96766, 1, 1, 1, 1, 1, 1, 0.94258, 0.98986, 0.94258, 0.98986, 0.94258, - 0.98986, 0.7306, 0.90527, 1, 1, 0.89552, 0.90527, 1, 0.90186, 1.12308, - 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566, 0.89552, 0.89552, - 1.42259, 0.69043, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523, 1.4956, 2.01462, - 0.99331, 0.82616, 0.91133, 0.84286, 0.91133, 1, 1, 1, 0.70508, 1, 1.23108, - 0.79801, 0.84426, 0.84426, 0.774, 0.90527, 1.81055, 0.90527, 1.81055, - 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, 0.85284, 0.90747, - 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, 0.85356, 0.90747, - 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, - 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1.07185, 0.99413, - 0.96334, 1.08065, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - ], - Na = { lineHeight: 1.2207, lineGap: 0.2207 }, - Ga = [ - 0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, - 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, - 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, - 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, - 0.9999, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, - 0.99977, 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, - 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, - 1.00001, 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, - 0.99998, 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, - 1.00026, 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, - 1.00026, 1.00026, 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, - 0.99973, 0.99973, 1, 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, - 0.99973, 0.99973, 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, - 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, - 0.99973, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, - 1.00026, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, - 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, - 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, - 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, - 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, - 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, - 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, - 1.00026, 1.00026, 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, - 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, - 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 1.03374, 0.99977, 1.00026, - 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, - 1.00001, 0.99973, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, - 1.00022, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, - 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.00042, - 0.99973, 0.99973, 1.0006, 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, - 1.00026, 1.0006, 1.00026, 1.03828, 1.00026, 0.99999, 1.00026, 1.0006, - 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.9993, 0.9998, - 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1, 1.00016, - 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, 0.99959, 1.00001, 0.99973, - 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00026, 0.99998, - 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, 1.00026, 0.99977, 1.00026, - 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, - 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, 1.00026, 1, 1.00026, 1, - 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, 0.99982, 1.00022, 1.00026, - 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, - 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 1.00034, 0.99977, 1, - 0.99997, 1.00026, 1.00078, 1.00036, 0.99973, 1.00013, 1.0006, 0.99977, - 0.99977, 0.99988, 0.85148, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, - 0.99977, 1.00001, 0.99999, 0.99977, 1.00069, 1.00022, 0.99977, 1.00001, - 0.99984, 1.00026, 1.00001, 1.00024, 1.00001, 0.9999, 1, 1.0006, 1.00001, - 1.00041, 0.99962, 1.00026, 1.0006, 0.99995, 1.00041, 0.99942, 0.99973, - 0.99927, 1.00082, 0.99902, 1.00026, 1.00087, 1.0006, 1.00069, 0.99973, - 0.99867, 0.99973, 0.9993, 1.00026, 1.00049, 1.00056, 1, 0.99988, 0.99935, - 0.99995, 0.99954, 1.00055, 0.99945, 1.00032, 1.0006, 0.99995, 1.00026, - 0.99995, 1.00032, 1.00001, 1.00008, 0.99971, 1.00019, 0.9994, 1.00001, - 1.0006, 1.00044, 0.99973, 1.00023, 1.00047, 1, 0.99942, 0.99561, 0.99989, - 1.00035, 0.99977, 1.00035, 0.99977, 1.00019, 0.99944, 1.00001, 1.00021, - 0.99926, 1.00035, 1.00035, 0.99942, 1.00048, 0.99999, 0.99977, 1.00022, - 1.00035, 1.00001, 0.99977, 1.00026, 0.99989, 1.00057, 1.00001, 0.99936, - 1.00052, 1.00012, 0.99996, 1.00043, 1, 1.00035, 0.9994, 0.99976, 1.00035, - 0.99973, 1.00052, 1.00041, 1.00119, 1.00037, 0.99973, 1.00002, 0.99986, - 1.00041, 1.00041, 0.99902, 0.9996, 1.00034, 0.99999, 1.00026, 0.99999, - 1.00026, 0.99973, 1.00052, 0.99973, 1, 0.99973, 1.00041, 1.00075, 0.9994, - 1.0003, 0.99999, 1, 1.00041, 0.99955, 1, 0.99915, 0.99973, 0.99973, 1.00026, - 1.00119, 0.99955, 0.99973, 1.0006, 0.99911, 1.0006, 1.00026, 0.99972, - 1.00026, 0.99902, 1.00041, 0.99973, 0.99999, 1, 1, 1.00038, 1.0005, 1.00016, - 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1, - 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973, - 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, - 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 0.99971, 1.00047, - 1.00023, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, - 1, 1, 1, 1, 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, - 0.99561, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, - 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, - 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, - 1.00026, 1.00026, 0.99972, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, - 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, - 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - ], - xa = { lineHeight: 1.2, lineGap: 0.2 }, - Ua = [ - 0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, - 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, - 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, - 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, - 0.9999, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, - 0.99977, 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, - 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, - 1.00001, 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, - 0.99998, 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, - 1.00026, 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, - 1.00026, 1.00026, 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, - 0.99973, 0.99973, 1, 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, - 0.99973, 0.99973, 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, - 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, - 0.99973, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, - 1.00026, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, - 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, - 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, - 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, - 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, - 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, - 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, - 1.00026, 1.00026, 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, - 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, - 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 1.0044, 0.99977, 1.00026, - 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, - 1.00001, 0.99973, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, - 1.00022, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, - 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99971, - 0.99973, 0.99973, 1.0006, 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, - 1.00026, 1.0006, 1.00026, 1.01011, 1.00026, 0.99999, 1.00026, 1.0006, - 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.9993, 0.9998, - 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1, 1.00016, - 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, 0.99959, 1.00001, 0.99973, - 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00026, 0.99998, - 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, 1.00026, 0.99977, 1.00026, - 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, - 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, 1.00026, 1, 1.00026, 1, - 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, 0.99982, 1.00022, 1.00026, - 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, - 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99977, 1, - 1, 1.00026, 0.99969, 0.99972, 0.99981, 0.9998, 1.0006, 0.99977, 0.99977, - 1.00022, 0.91155, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 0.99977, - 1.00001, 0.99999, 0.99977, 0.99966, 1.00022, 1.00032, 1.00001, 0.99944, - 1.00026, 1.00001, 0.99968, 1.00001, 1.00047, 1, 1.0006, 1.00001, 0.99981, - 1.00101, 1.00026, 1.0006, 0.99948, 0.99981, 1.00064, 0.99973, 0.99942, - 1.00101, 1.00061, 1.00026, 1.00069, 1.0006, 1.00014, 0.99973, 1.01322, - 0.99973, 1.00065, 1.00026, 1.00012, 0.99923, 1, 1.00064, 1.00076, 0.99948, - 1.00055, 1.00063, 1.00007, 0.99943, 1.0006, 0.99948, 1.00026, 0.99948, - 0.99943, 1.00001, 1.00001, 1.00029, 1.00038, 1.00035, 1.00001, 1.0006, - 1.0006, 0.99973, 0.99978, 1.00001, 1.00057, 0.99989, 0.99967, 0.99964, - 0.99967, 0.99977, 0.99999, 0.99977, 1.00038, 0.99977, 1.00001, 0.99973, - 1.00066, 0.99967, 0.99967, 1.00041, 0.99998, 0.99999, 0.99977, 1.00022, - 0.99967, 1.00001, 0.99977, 1.00026, 0.99964, 1.00031, 1.00001, 0.99999, - 0.99999, 1, 1.00023, 1, 1, 0.99999, 1.00035, 1.00001, 0.99999, 0.99973, - 0.99977, 0.99999, 1.00058, 0.99973, 0.99973, 0.99955, 0.9995, 1.00026, - 1.00026, 1.00032, 0.99989, 1.00034, 0.99999, 1.00026, 1.00026, 1.00026, - 0.99973, 0.45998, 0.99973, 1.00026, 0.99973, 1.00001, 0.99999, 0.99982, - 0.99994, 0.99996, 1, 1.00042, 1.00044, 1.00029, 1.00023, 0.99973, 0.99973, - 1.00026, 0.99949, 1.00002, 0.99973, 1.0006, 1.0006, 1.0006, 0.99975, - 1.00026, 1.00026, 1.00032, 0.98685, 0.99973, 1.00026, 1, 1, 0.99966, - 1.00044, 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, - 0.99973, 1, 1, 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, - 1, 0.99973, 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, - 0.99999, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1, 0.99973, 0.99971, - 0.99978, 1, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, - 1.00098, 1, 1, 1, 1.00049, 1, 1, 0.99972, 1, 1.20985, 1.39713, 1.00003, - 1.00031, 1.00015, 1, 0.99561, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, - 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, - 1.00026, 1.00026, 1.00026, 1.00026, 0.99972, 0.99999, 0.99999, 0.99999, - 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, - 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - ], - Ma = { lineHeight: 1.35, lineGap: 0.2 }, - La = [ - 0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, - 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, - 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, - 0.99973, 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, - 0.99987, 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, - 0.99977, 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, - 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, - 1.00001, 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, - 0.99973, 0.99973, 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, - 0.99924, 1, 0.99924, 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, - 1, 1.0006, 0.99973, 1, 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, - 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, - 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, - 1, 0.99998, 1, 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, - 1.00002, 1.00002, 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, - 1.00001, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, - 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, - 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, - 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, - 0.99982, 1, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, - 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, - 1.06409, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 1, 0.99973, 1, - 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 0.99977, 1, 0.99977, - 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.0288, 0.99977, 0.99973, 1.00001, - 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, - 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, - 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, - 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, 1.0006, 0.99946, 1.00034, 1, - 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, 0.99973, 0.99924, 0.99973, - 1.06311, 0.99973, 1.00024, 0.99973, 0.99924, 0.99977, 0.99973, 0.99977, - 0.99973, 0.99977, 0.99973, 1.00041, 0.9998, 0.99973, 1.00022, 0.99973, - 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, 0.99977, 0.99998, 0.99977, - 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00001, 1, - 1.00026, 1.0006, 1.00026, 0.89547, 1.00026, 1.0006, 0.99977, 0.99973, - 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, - 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, 1.00026, 1, - 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, 0.99982, - 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, 0.99998, - 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, - 1.00001, 1, 1.00054, 0.99977, 1.00084, 1.00007, 0.99973, 1.00013, 0.99924, - 1.00001, 1.00001, 0.99945, 0.91221, 1.00001, 1.00026, 0.99977, 1.00022, - 1.0006, 1.00001, 1.00001, 0.99999, 0.99977, 0.99933, 1.00022, 1.00054, - 1.00001, 1.00065, 1.00026, 1.00001, 1.0001, 1.00001, 1.00052, 1, 1.0006, - 1.00001, 0.99945, 0.99897, 0.99968, 0.99924, 1.00036, 0.99945, 0.99949, 1, - 1.0006, 0.99897, 0.99918, 0.99968, 0.99911, 0.99924, 1, 0.99962, 1.01487, 1, - 1.0005, 0.99973, 1.00012, 1.00043, 1, 0.99995, 0.99994, 1.00036, 0.99947, - 1.00019, 1.00063, 1.00025, 0.99924, 1.00036, 0.99973, 1.00036, 1.00025, - 1.00001, 1.00001, 1.00027, 1.0001, 1.00068, 1.00001, 1.0006, 1.0006, 1, - 1.00008, 0.99957, 0.99972, 0.9994, 0.99954, 0.99975, 1.00051, 1.00001, - 1.00019, 1.00001, 1.0001, 0.99986, 1.00001, 1.00001, 1.00038, 0.99954, - 0.99954, 0.9994, 1.00066, 0.99999, 0.99977, 1.00022, 1.00054, 1.00001, - 0.99977, 1.00026, 0.99975, 1.0001, 1.00001, 0.99993, 0.9995, 0.99955, - 1.00016, 0.99978, 0.99974, 1.00019, 1.00022, 0.99955, 1.00053, 0.99973, - 1.00089, 1.00005, 0.99967, 1.00048, 0.99973, 1.00002, 1.00034, 0.99973, - 0.99973, 0.99964, 1.00006, 1.00066, 0.99947, 0.99973, 0.98894, 0.99973, 1, - 0.44898, 1, 0.99946, 1, 1.00039, 1.00082, 0.99991, 0.99991, 0.99985, - 1.00022, 1.00023, 1.00061, 1.00006, 0.99966, 0.99973, 0.99973, 0.99973, - 1.00019, 1.0008, 1, 0.99924, 0.99924, 0.99924, 0.99983, 1.00044, 0.99973, - 0.99964, 0.98332, 1, 0.99973, 1, 1, 0.99962, 0.99895, 1.00016, 0.99977, - 1.00016, 0.99977, 1.00016, 0.99977, 1.00001, 1, 1, 1, 0.99973, 1, 1, - 0.99955, 0.99924, 0.99924, 0.99924, 0.99924, 0.99998, 0.99998, 0.99998, - 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, 0.99999, 0.99998, 0.99998, 1, - 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 1.00423, 0.99925, - 0.99999, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1.00049, - 1, 1.00245, 1, 1, 1, 1, 0.96329, 1, 1.20985, 1.39713, 1.00003, 0.8254, - 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, 1.00003, 1.00031, 1.00031, - 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, - 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, 0.99999, 0.99999, - 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, - 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, - ], - Ha = { lineHeight: 1.35, lineGap: 0.2 }, - Ja = [ - 0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, - 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, - 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, - 0.99973, 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, - 0.99987, 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, - 0.99977, 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, - 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, - 1.00001, 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, - 0.99973, 0.99973, 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, - 0.99924, 1, 0.99924, 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, - 1, 1.0006, 0.99973, 1, 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, - 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, - 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, - 1, 0.99998, 1, 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, - 1.00002, 1.00002, 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, - 1.00001, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, - 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, - 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, - 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, - 0.99982, 1, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, - 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, - 1.06409, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 1, 0.99973, 1, - 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 0.99977, 1, 0.99977, - 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.04596, 0.99977, 0.99973, 1.00001, - 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, - 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, - 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, - 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, 1.0006, 1.00019, 1.00034, 1, - 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, 0.99973, 0.99924, 0.99973, - 1.02572, 0.99973, 1.00005, 0.99973, 0.99924, 0.99977, 0.99973, 0.99977, - 0.99973, 0.99977, 0.99973, 0.99999, 0.9998, 0.99973, 1.00022, 0.99973, - 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, 0.99977, 0.99998, 0.99977, - 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00001, 1, - 1.00026, 1.0006, 1.00026, 0.84533, 1.00026, 1.0006, 0.99977, 0.99973, - 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, - 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, 1.00026, 1, - 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, 0.99982, - 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, 0.99998, - 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, - 0.99928, 1, 0.99977, 1.00013, 1.00055, 0.99947, 0.99945, 0.99941, 0.99924, - 1.00001, 1.00001, 1.0004, 0.91621, 1.00001, 1.00026, 0.99977, 1.00022, - 1.0006, 1.00001, 1.00005, 0.99999, 0.99977, 1.00015, 1.00022, 0.99977, - 1.00001, 0.99973, 1.00026, 1.00001, 1.00019, 1.00001, 0.99946, 1, 1.0006, - 1.00001, 0.99978, 1.00045, 0.99973, 0.99924, 1.00023, 0.99978, 0.99966, 1, - 1.00065, 1.00045, 1.00019, 0.99973, 0.99973, 0.99924, 1, 1, 0.96499, 1, - 1.00055, 0.99973, 1.00008, 1.00027, 1, 0.9997, 0.99995, 1.00023, 0.99933, - 1.00019, 1.00015, 1.00031, 0.99924, 1.00023, 0.99973, 1.00023, 1.00031, - 1.00001, 0.99928, 1.00029, 1.00092, 1.00035, 1.00001, 1.0006, 1.0006, 1, - 0.99988, 0.99975, 1, 1.00082, 0.99561, 0.9996, 1.00035, 1.00001, 0.99962, - 1.00001, 1.00092, 0.99964, 1.00001, 0.99963, 0.99999, 1.00035, 1.00035, - 1.00082, 0.99962, 0.99999, 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, - 1.00026, 0.9996, 0.99967, 1.00001, 1.00034, 1.00074, 1.00054, 1.00053, - 1.00063, 0.99971, 0.99962, 1.00035, 0.99975, 0.99977, 0.99973, 1.00043, - 0.99953, 1.0007, 0.99915, 0.99973, 1.00008, 0.99892, 1.00073, 1.00073, - 1.00114, 0.99915, 1.00073, 0.99955, 0.99973, 1.00092, 0.99973, 1, 0.99998, - 1, 1.0003, 1, 1.00043, 1.00001, 0.99969, 1.0003, 1, 1.00035, 1.00001, - 0.9995, 1, 1.00092, 0.99973, 0.99973, 0.99973, 1.0007, 0.9995, 1, 0.99924, - 1.0006, 0.99924, 0.99972, 1.00062, 0.99973, 1.00114, 1.00073, 1, 0.99955, 1, - 1, 1.00047, 0.99968, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, 0.99977, - 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, - 0.99924, 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, - 1.00267, 0.99999, 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, - 0.99973, 1.00023, 0.99973, 0.99971, 0.99925, 1.00023, 1, 0.99991, 0.99984, - 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, 1, 1, 1, 1, 0.96329, 1, - 1.20985, 1.39713, 1.00003, 0.8254, 1.00015, 1, 1.00035, 1.00027, 1.00031, - 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, - 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, - 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, - 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, - 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, - 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, - ], - Ya = { lineHeight: 1.2, lineGap: 0.2 }, - va = [ - 365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, - 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, - 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, - 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, - 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, - 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, - 778, 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, - 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, - 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1e3, - 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, - 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, - 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, - 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, - 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 719, 722, 611, - 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, - 611, 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, - 278, 278, 785, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 385, - 611, 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, - 778, 611, 778, 611, 1e3, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, - 556, 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, - 722, 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, - 611, 500, 611, 500, 278, 556, 722, 556, 1e3, 889, 778, 611, 667, 556, 611, - 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 465, 722, 333, 853, - 906, 474, 825, 927, 838, 278, 722, 722, 601, 719, 667, 611, 722, 778, 278, - 722, 667, 833, 722, 644, 778, 722, 667, 600, 611, 667, 821, 667, 809, 802, - 278, 667, 615, 451, 611, 278, 582, 615, 610, 556, 606, 475, 460, 611, 541, - 278, 558, 556, 612, 556, 445, 611, 766, 619, 520, 684, 446, 582, 715, 576, - 753, 845, 278, 582, 611, 582, 845, 667, 669, 885, 567, 711, 667, 278, 276, - 556, 1094, 1062, 875, 610, 722, 622, 719, 722, 719, 722, 567, 712, 667, 904, - 626, 719, 719, 610, 702, 833, 722, 778, 719, 667, 722, 611, 622, 854, 667, - 730, 703, 1005, 1019, 870, 979, 719, 711, 1031, 719, 556, 618, 615, 417, - 635, 556, 709, 497, 615, 615, 500, 635, 740, 604, 611, 604, 611, 556, 490, - 556, 875, 556, 615, 581, 833, 844, 729, 854, 615, 552, 854, 583, 556, 556, - 611, 417, 552, 556, 278, 281, 278, 969, 906, 611, 500, 615, 556, 604, 778, - 611, 487, 447, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1e3, - 1e3, 552, 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1e3, 1e3, 240, - 479, 333, 333, 604, 333, 167, 396, 556, 556, 1094, 556, 885, 489, 1115, 1e3, - 768, 600, 834, 834, 834, 834, 1e3, 500, 1e3, 500, 1e3, 500, 500, 494, 612, - 823, 713, 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, - 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, - 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, - 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, - 708, 708, 708, 708, 729, 604, 604, 354, 354, 1e3, 990, 990, 990, 990, 494, - 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, - 750, 750, 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, - 333, 333, 333, 333, 333, 333, 333, - ], - Ka = [ - -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, - 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, - 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, - 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, - 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, - 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, - 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, - 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, - 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, - 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, - 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, - 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, - 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, - 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, - 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, - 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, - 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, - 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, - 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, - 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, - 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, - 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, - 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, - 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, - 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, - 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, - 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, - 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, - ], - Ta = [ - 365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, - 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, - 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, - 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, - 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, - 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, - 778, 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, - 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, - 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1e3, - 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, - 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, - 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, - 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, - 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 740, 722, 611, - 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, - 611, 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, - 278, 278, 782, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 396, - 611, 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, - 778, 611, 778, 611, 1e3, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, - 556, 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, - 722, 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, - 611, 500, 611, 500, 278, 556, 722, 556, 1e3, 889, 778, 611, 667, 556, 611, - 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 722, 333, 854, - 906, 473, 844, 930, 847, 278, 722, 722, 610, 671, 667, 611, 722, 778, 278, - 722, 667, 833, 722, 657, 778, 718, 667, 590, 611, 667, 822, 667, 829, 781, - 278, 667, 620, 479, 611, 278, 591, 620, 621, 556, 610, 479, 492, 611, 558, - 278, 566, 556, 603, 556, 450, 611, 712, 605, 532, 664, 409, 591, 704, 578, - 773, 834, 278, 591, 611, 591, 834, 667, 667, 886, 614, 719, 667, 278, 278, - 556, 1094, 1042, 854, 622, 719, 677, 719, 722, 708, 722, 614, 722, 667, 927, - 643, 719, 719, 615, 687, 833, 722, 778, 719, 667, 722, 611, 677, 781, 667, - 729, 708, 979, 989, 854, 1e3, 708, 719, 1042, 729, 556, 619, 604, 534, 618, - 556, 736, 510, 611, 611, 507, 622, 740, 604, 611, 611, 611, 556, 889, 556, - 885, 556, 646, 583, 889, 935, 707, 854, 594, 552, 865, 589, 556, 556, 611, - 469, 563, 556, 278, 278, 278, 969, 906, 611, 507, 619, 556, 611, 778, 611, - 575, 467, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1e3, 1e3, - 552, 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1e3, 1e3, 240, 479, - 333, 333, 604, 333, 167, 396, 556, 556, 1104, 556, 885, 516, 1146, 1e3, 768, - 600, 834, 834, 834, 834, 999, 500, 1e3, 500, 1e3, 500, 500, 494, 612, 823, - 713, 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, - 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, - 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, - 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, - 708, 708, 708, 729, 604, 604, 354, 354, 1e3, 990, 990, 990, 990, 494, 604, - 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, - 750, 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, - 333, 333, 333, 333, 333, 333, - ], - qa = [ - -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, - 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, - 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, - 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, - 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, - 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, - 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, - 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, - 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, - 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, - 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, - 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, - 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, - 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, - 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, - 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, - 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, - 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, - 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, - 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, - 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, - 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, - 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, - 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, - 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, - 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, - 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, - 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, - ], - Oa = [ - 365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, - 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, - 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, - 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, - 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, - 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, - 722, 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, - 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, - 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1e3, - 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, - 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, - 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, - 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, - 556, 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 625, 722, 556, - 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, - 556, 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, - 278, 278, 733, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 281, - 556, 400, 556, 222, 722, 556, 722, 556, 722, 556, 615, 723, 556, 778, 556, - 778, 556, 778, 556, 1e3, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, - 500, 667, 500, 667, 500, 611, 278, 611, 354, 611, 278, 722, 556, 722, 556, - 722, 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, - 611, 500, 611, 500, 222, 556, 667, 556, 1e3, 889, 778, 611, 667, 500, 611, - 278, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 789, - 846, 389, 794, 865, 775, 222, 667, 667, 570, 671, 667, 611, 722, 778, 278, - 667, 667, 833, 722, 648, 778, 725, 667, 600, 611, 667, 837, 667, 831, 761, - 278, 667, 570, 439, 555, 222, 550, 570, 571, 500, 556, 439, 463, 555, 542, - 222, 500, 492, 548, 500, 447, 556, 670, 573, 486, 603, 374, 550, 652, 546, - 728, 779, 222, 550, 556, 550, 779, 667, 667, 843, 544, 708, 667, 278, 278, - 500, 1066, 982, 844, 589, 715, 639, 724, 667, 651, 667, 544, 704, 667, 917, - 614, 715, 715, 589, 686, 833, 722, 778, 725, 667, 722, 611, 639, 795, 667, - 727, 673, 920, 923, 805, 886, 651, 694, 1022, 682, 556, 562, 522, 493, 553, - 556, 688, 465, 556, 556, 472, 564, 686, 550, 556, 556, 556, 500, 833, 500, - 835, 500, 572, 518, 830, 851, 621, 736, 526, 492, 752, 534, 556, 556, 556, - 378, 496, 500, 222, 222, 222, 910, 828, 556, 472, 565, 500, 556, 778, 556, - 492, 339, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1e3, 1e3, - 552, 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1e3, 1e3, 188, 354, - 333, 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1083, 1e3, 768, - 600, 834, 834, 834, 834, 1e3, 500, 998, 500, 1e3, 500, 500, 494, 612, 823, - 713, 584, 549, 713, 979, 719, 274, 549, 549, 584, 549, 549, 604, 584, 604, - 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, - 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, - 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, - 708, 708, 708, 729, 604, 604, 354, 354, 1e3, 990, 990, 990, 990, 494, 604, - 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, - 750, 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, - 324, 324, 316, 328, 398, 285, - ], - Pa = [ - -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, - 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, - 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, - 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, - 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, - 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, - 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, - 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, - 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, - 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, - 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, - 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, - 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, - 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, - 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, - 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, - 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, - 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, - 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, - 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, - 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, - 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, - 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, - 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, - 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, - 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, - 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, - 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, - ], - Wa = [ - 365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, - 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, - 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, - 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, - 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, - 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, - 722, 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, - 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, - 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1e3, - 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, - 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, - 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, - 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, - 556, 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 615, 722, 556, - 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, - 556, 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, - 278, 278, 735, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 292, - 556, 334, 556, 222, 722, 556, 722, 556, 722, 556, 604, 723, 556, 778, 556, - 778, 556, 778, 556, 1e3, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, - 500, 667, 500, 667, 500, 611, 278, 611, 375, 611, 278, 722, 556, 722, 556, - 722, 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, - 611, 500, 611, 500, 222, 556, 667, 556, 1e3, 889, 778, 611, 667, 500, 611, - 278, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 784, - 838, 384, 774, 855, 752, 222, 667, 667, 551, 668, 667, 611, 722, 778, 278, - 667, 668, 833, 722, 650, 778, 722, 667, 618, 611, 667, 798, 667, 835, 748, - 278, 667, 578, 446, 556, 222, 547, 578, 575, 500, 557, 446, 441, 556, 556, - 222, 500, 500, 576, 500, 448, 556, 690, 569, 482, 617, 395, 547, 648, 525, - 713, 781, 222, 547, 556, 547, 781, 667, 667, 865, 542, 719, 667, 278, 278, - 500, 1057, 1010, 854, 583, 722, 635, 719, 667, 656, 667, 542, 677, 667, 923, - 604, 719, 719, 583, 656, 833, 722, 778, 719, 667, 722, 611, 635, 760, 667, - 740, 667, 917, 938, 792, 885, 656, 719, 1010, 722, 556, 573, 531, 365, 583, - 556, 669, 458, 559, 559, 438, 583, 688, 552, 556, 542, 556, 500, 458, 500, - 823, 500, 573, 521, 802, 823, 625, 719, 521, 510, 750, 542, 556, 556, 556, - 365, 510, 500, 222, 278, 222, 906, 812, 556, 438, 559, 500, 552, 778, 556, - 489, 411, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1e3, 1e3, - 552, 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1e3, 1e3, 188, 354, - 333, 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1073, 1e3, 768, - 600, 834, 834, 834, 834, 1e3, 500, 1e3, 500, 1e3, 500, 500, 494, 612, 823, - 713, 584, 549, 713, 979, 719, 274, 549, 549, 583, 549, 549, 604, 584, 604, - 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, - 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, - 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, - 708, 708, 708, 729, 604, 604, 354, 354, 1e3, 990, 990, 990, 990, 494, 604, - 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, - 750, 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, - 324, 324, 316, 328, 398, 285, - ], - ja = [ - -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, - 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, - 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, - 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, - 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, - 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, - 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, - 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, - 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, - 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, - 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, - 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, - 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, - 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, - 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, - 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, - 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, - 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, - 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, - 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, - 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, - 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, - 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, - 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, - 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, - 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, - 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, - 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, - ], - Xa = [ - 1.36898, 1, 1, 0.72706, 0.80479, 0.83734, 0.98894, 0.99793, 0.9897, 0.93884, - 0.86209, 0.94292, 0.94292, 1.16661, 1.02058, 0.93582, 0.96694, 0.93582, - 1.19137, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, - 0.99793, 0.99793, 0.99793, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058, - 0.72851, 0.78966, 0.90838, 0.83637, 0.82391, 0.96376, 0.80061, 0.86275, - 0.8768, 0.95407, 1.0258, 0.73901, 0.85022, 0.83655, 1.0156, 0.95546, - 0.92179, 0.87107, 0.92179, 0.82114, 0.8096, 0.89713, 0.94438, 0.95353, - 0.94083, 0.91905, 0.90406, 0.9446, 0.94292, 1.18777, 0.94292, 1.02058, - 0.89903, 0.90088, 0.94938, 0.97898, 0.81093, 0.97571, 0.94938, 1.024, - 0.9577, 0.95933, 0.98621, 1.0474, 0.97455, 0.98981, 0.9672, 0.95933, 0.9446, - 0.97898, 0.97407, 0.97646, 0.78036, 1.10208, 0.95442, 0.95298, 0.97579, - 0.9332, 0.94039, 0.938, 0.80687, 1.01149, 0.80687, 1.02058, 0.80479, - 0.99793, 0.99793, 0.99793, 0.99793, 1.01149, 1.00872, 0.90088, 0.91882, - 1.0213, 0.8361, 1.02058, 0.62295, 0.54324, 0.89022, 1.08595, 1, 1, 0.90088, - 1, 0.97455, 0.93582, 0.90088, 1, 1.05686, 0.8361, 0.99642, 0.99642, 0.99642, - 0.72851, 0.90838, 0.90838, 0.90838, 0.90838, 0.90838, 0.90838, 0.868, - 0.82391, 0.80061, 0.80061, 0.80061, 0.80061, 1.0258, 1.0258, 1.0258, 1.0258, - 0.97484, 0.95546, 0.92179, 0.92179, 0.92179, 0.92179, 0.92179, 1.02058, - 0.92179, 0.94438, 0.94438, 0.94438, 0.94438, 0.90406, 0.86958, 0.98225, - 0.94938, 0.94938, 0.94938, 0.94938, 0.94938, 0.94938, 0.9031, 0.81093, - 0.94938, 0.94938, 0.94938, 0.94938, 0.98621, 0.98621, 0.98621, 0.98621, - 0.93969, 0.95933, 0.9446, 0.9446, 0.9446, 0.9446, 0.9446, 1.08595, 0.9446, - 0.95442, 0.95442, 0.95442, 0.95442, 0.94039, 0.97898, 0.94039, 0.90838, - 0.94938, 0.90838, 0.94938, 0.90838, 0.94938, 0.82391, 0.81093, 0.82391, - 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, 0.96376, 0.84313, 0.97484, - 0.97571, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, - 0.94938, 0.80061, 0.94938, 0.8768, 0.9577, 0.8768, 0.9577, 0.8768, 0.9577, - 1, 1, 0.95407, 0.95933, 0.97069, 0.95933, 1.0258, 0.98621, 1.0258, 0.98621, - 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 0.887, 1.01591, 0.73901, - 1.0474, 1, 1, 0.97455, 0.83655, 0.98981, 1, 1, 0.83655, 0.73977, 0.83655, - 0.73903, 0.84638, 1.033, 0.95546, 0.95933, 1, 1, 0.95546, 0.95933, 0.8271, - 0.95417, 0.95933, 0.92179, 0.9446, 0.92179, 0.9446, 0.92179, 0.9446, 0.936, - 0.91964, 0.82114, 0.97646, 1, 1, 0.82114, 0.97646, 0.8096, 0.78036, 0.8096, - 0.78036, 1, 1, 0.8096, 0.78036, 1, 1, 0.89713, 0.77452, 0.89713, 1.10208, - 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, - 0.94438, 0.95442, 0.94438, 0.95442, 0.94083, 0.97579, 0.90406, 0.94039, - 0.90406, 0.9446, 0.938, 0.9446, 0.938, 0.9446, 0.938, 1, 0.99793, 0.90838, - 0.94938, 0.868, 0.9031, 0.92179, 0.9446, 1, 1, 0.89713, 1.10208, 0.90088, - 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, - 0.90989, 0.9358, 0.91945, 0.83181, 0.75261, 0.87992, 0.82976, 0.96034, - 0.83689, 0.97268, 1.0078, 0.90838, 0.83637, 0.8019, 0.90157, 0.80061, - 0.9446, 0.95407, 0.92436, 1.0258, 0.85022, 0.97153, 1.0156, 0.95546, - 0.89192, 0.92179, 0.92361, 0.87107, 0.96318, 0.89713, 0.93704, 0.95638, - 0.91905, 0.91709, 0.92796, 1.0258, 0.93704, 0.94836, 1.0373, 0.95933, - 1.0078, 0.95871, 0.94836, 0.96174, 0.92601, 0.9498, 0.98607, 0.95776, - 0.95933, 1.05453, 1.0078, 0.98275, 0.9314, 0.95617, 0.91701, 1.05993, - 0.9446, 0.78367, 0.9553, 1, 0.86832, 1.0128, 0.95871, 0.99394, 0.87548, - 0.96361, 0.86774, 1.0078, 0.95871, 0.9446, 0.95871, 0.86774, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.94083, - 0.97579, 0.94083, 0.97579, 0.94083, 0.97579, 0.90406, 0.94039, 0.96694, 1, - 0.89903, 1, 1, 1, 0.93582, 0.93582, 0.93582, 1, 0.908, 0.908, 0.918, - 0.94219, 0.94219, 0.96544, 1, 1.285, 1, 1, 0.81079, 0.81079, 1, 1, 0.74854, - 1, 1, 1, 1, 0.99793, 1, 1, 1, 0.65, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1.17173, 1, 0.80535, 0.76169, 1.02058, 1.0732, 1.05486, 1, 1, 1.30692, - 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1.16161, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - ], - Za = { lineHeight: 1.2, lineGap: 0.2 }, - Va = [ - 1.36898, 1, 1, 0.66227, 0.80779, 0.81625, 0.97276, 0.97276, 0.97733, - 0.92222, 0.83266, 0.94292, 0.94292, 1.16148, 1.02058, 0.93582, 0.96694, - 0.93582, 1.17337, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, - 0.97276, 0.97276, 0.97276, 0.97276, 0.78076, 0.78076, 1.02058, 1.02058, - 1.02058, 0.71541, 0.76813, 0.85576, 0.80591, 0.80729, 0.94299, 0.77512, - 0.83655, 0.86523, 0.92222, 0.98621, 0.71743, 0.81698, 0.79726, 0.98558, - 0.92222, 0.90637, 0.83809, 0.90637, 0.80729, 0.76463, 0.86275, 0.90699, - 0.91605, 0.9154, 0.85308, 0.85458, 0.90531, 0.94292, 1.21296, 0.94292, - 1.02058, 0.89903, 1.18616, 0.99613, 0.91677, 0.78216, 0.91677, 0.90083, - 0.98796, 0.9135, 0.92168, 0.95381, 0.98981, 0.95298, 0.95381, 0.93459, - 0.92168, 0.91513, 0.92004, 0.91677, 0.95077, 0.748, 1.04502, 0.91677, - 0.92061, 0.94236, 0.89544, 0.89364, 0.9, 0.80687, 0.8578, 0.80687, 1.02058, - 0.80779, 0.97276, 0.97276, 0.97276, 0.97276, 0.8578, 0.99973, 1.18616, - 0.91339, 1.08074, 0.82891, 1.02058, 0.55509, 0.71526, 0.89022, 1.08595, 1, - 1, 1.18616, 1, 0.96736, 0.93582, 1.18616, 1, 1.04864, 0.82711, 0.99043, - 0.99043, 0.99043, 0.71541, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, - 0.85576, 0.845, 0.80729, 0.77512, 0.77512, 0.77512, 0.77512, 0.98621, - 0.98621, 0.98621, 0.98621, 0.95961, 0.92222, 0.90637, 0.90637, 0.90637, - 0.90637, 0.90637, 1.02058, 0.90251, 0.90699, 0.90699, 0.90699, 0.90699, - 0.85458, 0.83659, 0.94951, 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, - 0.99613, 0.85811, 0.78216, 0.90083, 0.90083, 0.90083, 0.90083, 0.95381, - 0.95381, 0.95381, 0.95381, 0.9135, 0.92168, 0.91513, 0.91513, 0.91513, - 0.91513, 0.91513, 1.08595, 0.91677, 0.91677, 0.91677, 0.91677, 0.91677, - 0.89364, 0.92332, 0.89364, 0.85576, 0.99613, 0.85576, 0.99613, 0.85576, - 0.99613, 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, - 0.78216, 0.94299, 0.76783, 0.95961, 0.91677, 0.77512, 0.90083, 0.77512, - 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.86523, - 0.9135, 0.86523, 0.9135, 0.86523, 0.9135, 1, 1, 0.92222, 0.92168, 0.92222, - 0.92168, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, - 0.95381, 0.98621, 0.95381, 0.86036, 0.97096, 0.71743, 0.98981, 1, 1, - 0.95298, 0.79726, 0.95381, 1, 1, 0.79726, 0.6894, 0.79726, 0.74321, 0.81691, - 1.0006, 0.92222, 0.92168, 1, 1, 0.92222, 0.92168, 0.79464, 0.92098, 0.92168, - 0.90637, 0.91513, 0.90637, 0.91513, 0.90637, 0.91513, 0.909, 0.87514, - 0.80729, 0.95077, 1, 1, 0.80729, 0.95077, 0.76463, 0.748, 0.76463, 0.748, 1, - 1, 0.76463, 0.748, 1, 1, 0.86275, 0.72651, 0.86275, 1.04502, 0.90699, - 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, - 0.91677, 0.90699, 0.91677, 0.9154, 0.94236, 0.85458, 0.89364, 0.85458, - 0.90531, 0.9, 0.90531, 0.9, 0.90531, 0.9, 1, 0.97276, 0.85576, 0.99613, - 0.845, 0.85811, 0.90251, 0.91677, 1, 1, 0.86275, 1.04502, 1.18616, 1.18616, - 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.00899, - 1.30628, 0.85576, 0.80178, 0.66862, 0.7927, 0.69323, 0.88127, 0.72459, - 0.89711, 0.95381, 0.85576, 0.80591, 0.7805, 0.94729, 0.77512, 0.90531, - 0.92222, 0.90637, 0.98621, 0.81698, 0.92655, 0.98558, 0.92222, 0.85359, - 0.90637, 0.90976, 0.83809, 0.94523, 0.86275, 0.83509, 0.93157, 0.85308, - 0.83392, 0.92346, 0.98621, 0.83509, 0.92886, 0.91324, 0.92168, 0.95381, - 0.90646, 0.92886, 0.90557, 0.86847, 0.90276, 0.91324, 0.86842, 0.92168, - 0.99531, 0.95381, 0.9224, 0.85408, 0.92699, 0.86847, 1.0051, 0.91513, - 0.80487, 0.93481, 1, 0.88159, 1.05214, 0.90646, 0.97355, 0.81539, 0.89398, - 0.85923, 0.95381, 0.90646, 0.91513, 0.90646, 0.85923, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9154, 0.94236, - 0.9154, 0.94236, 0.9154, 0.94236, 0.85458, 0.89364, 0.96694, 1, 0.89903, 1, - 1, 1, 0.91782, 0.91782, 0.91782, 1, 0.896, 0.896, 0.896, 0.9332, 0.9332, - 0.95973, 1, 1.26, 1, 1, 0.80479, 0.80178, 1, 1, 0.85633, 1, 1, 1, 1, - 0.97276, 1, 1, 1, 0.698, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1.14542, 1, 0.79199, 0.78694, 1.02058, 1.03493, 1.05486, 1, 1, 1.23026, - 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1.20006, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - ], - za = { lineHeight: 1.2, lineGap: 0.2 }, - _a = [ - 1.36898, 1, 1, 0.65507, 0.84943, 0.85639, 0.88465, 0.88465, 0.86936, - 0.88307, 0.86948, 0.85283, 0.85283, 1.06383, 1.02058, 0.75945, 0.9219, - 0.75945, 1.17337, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, - 0.88465, 0.88465, 0.88465, 0.88465, 0.75945, 0.75945, 1.02058, 1.02058, - 1.02058, 0.69046, 0.70926, 0.85158, 0.77812, 0.76852, 0.89591, 0.70466, - 0.76125, 0.80094, 0.86822, 0.83864, 0.728, 0.77212, 0.79475, 0.93637, - 0.87514, 0.8588, 0.76013, 0.8588, 0.72421, 0.69866, 0.77598, 0.85991, - 0.80811, 0.87832, 0.78112, 0.77512, 0.8562, 1.0222, 1.18417, 1.0222, - 1.27014, 0.89903, 1.15012, 0.93859, 0.94399, 0.846, 0.94399, 0.81453, - 1.0186, 0.94219, 0.96017, 1.03075, 1.02175, 0.912, 1.03075, 0.96998, - 0.96017, 0.93859, 0.94399, 0.94399, 0.95493, 0.746, 1.12658, 0.94578, 0.91, - 0.979, 0.882, 0.882, 0.83, 0.85034, 0.83537, 0.85034, 1.02058, 0.70869, - 0.88465, 0.88465, 0.88465, 0.88465, 0.83537, 0.90083, 1.15012, 0.9161, - 0.94565, 0.73541, 1.02058, 0.53609, 0.69353, 0.79519, 1.08595, 1, 1, - 1.15012, 1, 0.91974, 0.75945, 1.15012, 1, 0.9446, 0.73361, 0.9005, 0.9005, - 0.9005, 0.62864, 0.85158, 0.85158, 0.85158, 0.85158, 0.85158, 0.85158, - 0.773, 0.76852, 0.70466, 0.70466, 0.70466, 0.70466, 0.83864, 0.83864, - 0.83864, 0.83864, 0.90561, 0.87514, 0.8588, 0.8588, 0.8588, 0.8588, 0.8588, - 1.02058, 0.85751, 0.85991, 0.85991, 0.85991, 0.85991, 0.77512, 0.76013, - 0.88075, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.8075, - 0.846, 0.81453, 0.81453, 0.81453, 0.81453, 0.82424, 0.82424, 0.82424, - 0.82424, 0.9278, 0.96017, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, - 1.08595, 0.8562, 0.94578, 0.94578, 0.94578, 0.94578, 0.882, 0.94578, 0.882, - 0.85158, 0.93859, 0.85158, 0.93859, 0.85158, 0.93859, 0.76852, 0.846, - 0.76852, 0.846, 0.76852, 0.846, 0.76852, 0.846, 0.89591, 0.8544, 0.90561, - 0.94399, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, - 0.81453, 0.70466, 0.81453, 0.80094, 0.94219, 0.80094, 0.94219, 0.80094, - 0.94219, 1, 1, 0.86822, 0.96017, 0.86822, 0.96017, 0.83864, 0.82424, - 0.83864, 0.82424, 0.83864, 0.82424, 0.83864, 1.03075, 0.83864, 0.82424, - 0.81402, 1.02738, 0.728, 1.02175, 1, 1, 0.912, 0.79475, 1.03075, 1, 1, - 0.79475, 0.83911, 0.79475, 0.66266, 0.80553, 1.06676, 0.87514, 0.96017, 1, - 1, 0.87514, 0.96017, 0.86865, 0.87396, 0.96017, 0.8588, 0.93859, 0.8588, - 0.93859, 0.8588, 0.93859, 0.867, 0.84759, 0.72421, 0.95493, 1, 1, 0.72421, - 0.95493, 0.69866, 0.746, 0.69866, 0.746, 1, 1, 0.69866, 0.746, 1, 1, - 0.77598, 0.88417, 0.77598, 1.12658, 0.85991, 0.94578, 0.85991, 0.94578, - 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, - 0.87832, 0.979, 0.77512, 0.882, 0.77512, 0.8562, 0.83, 0.8562, 0.83, 0.8562, - 0.83, 1, 0.88465, 0.85158, 0.93859, 0.773, 0.8075, 0.85751, 0.8562, 1, 1, - 0.77598, 1.12658, 1.15012, 1.15012, 1.15012, 1.15012, 1.15012, 1.15313, - 1.15012, 1.15012, 1.15012, 1.08106, 1.03901, 0.85158, 0.77025, 0.62264, - 0.7646, 0.65351, 0.86026, 0.69461, 0.89947, 1.03075, 0.85158, 0.77812, - 0.76449, 0.88836, 0.70466, 0.8562, 0.86822, 0.8588, 0.83864, 0.77212, - 0.85308, 0.93637, 0.87514, 0.82352, 0.8588, 0.85701, 0.76013, 0.89058, - 0.77598, 0.8156, 0.82565, 0.78112, 0.77899, 0.89386, 0.83864, 0.8156, - 0.9486, 0.92388, 0.96186, 1.03075, 0.91123, 0.9486, 0.93298, 0.878, 0.93942, - 0.92388, 0.84596, 0.96186, 0.95119, 1.03075, 0.922, 0.88787, 0.95829, 0.88, - 0.93559, 0.93859, 0.78815, 0.93758, 1, 0.89217, 1.03737, 0.91123, 0.93969, - 0.77487, 0.85769, 0.86799, 1.03075, 0.91123, 0.93859, 0.91123, 0.86799, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0.87832, 0.979, 0.87832, 0.979, 0.87832, 0.979, 0.77512, 0.882, 0.9219, 1, - 0.89903, 1, 1, 1, 0.87321, 0.87321, 0.87321, 1, 1.027, 1.027, 1.027, - 0.86847, 0.86847, 0.79121, 1, 1.124, 1, 1, 0.73572, 0.73572, 1, 1, 0.85034, - 1, 1, 1, 1, 0.88465, 1, 1, 1, 0.669, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1.04828, 1, 0.74948, 0.75187, 1.02058, 0.98391, 1.02119, 1, 1, - 1.06233, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1.05233, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - ], - $a = { lineHeight: 1.2, lineGap: 0.2 }, - As = [ - 1.36898, 1, 1, 0.76305, 0.82784, 0.94935, 0.89364, 0.92241, 0.89073, - 0.90706, 0.98472, 0.85283, 0.85283, 1.0664, 1.02058, 0.74505, 0.9219, - 0.74505, 1.23456, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, - 0.92241, 0.92241, 0.92241, 0.92241, 0.74505, 0.74505, 1.02058, 1.02058, - 1.02058, 0.73002, 0.72601, 0.91755, 0.8126, 0.80314, 0.92222, 0.73764, - 0.79726, 0.83051, 0.90284, 0.86023, 0.74, 0.8126, 0.84869, 0.96518, 0.91115, - 0.8858, 0.79761, 0.8858, 0.74498, 0.73914, 0.81363, 0.89591, 0.83659, - 0.89633, 0.85608, 0.8111, 0.90531, 1.0222, 1.22736, 1.0222, 1.27014, - 0.89903, 0.90088, 0.86667, 1.0231, 0.896, 1.01411, 0.90083, 1.05099, - 1.00512, 0.99793, 1.05326, 1.09377, 0.938, 1.06226, 1.00119, 0.99793, - 0.98714, 1.0231, 1.01231, 0.98196, 0.792, 1.19137, 0.99074, 0.962, 1.01915, - 0.926, 0.942, 0.856, 0.85034, 0.92006, 0.85034, 1.02058, 0.69067, 0.92241, - 0.92241, 0.92241, 0.92241, 0.92006, 0.9332, 0.90088, 0.91882, 0.93484, - 0.75339, 1.02058, 0.56866, 0.54324, 0.79519, 1.08595, 1, 1, 0.90088, 1, - 0.95325, 0.74505, 0.90088, 1, 0.97198, 0.75339, 0.91009, 0.91009, 0.91009, - 0.66466, 0.91755, 0.91755, 0.91755, 0.91755, 0.91755, 0.91755, 0.788, - 0.80314, 0.73764, 0.73764, 0.73764, 0.73764, 0.86023, 0.86023, 0.86023, - 0.86023, 0.92915, 0.91115, 0.8858, 0.8858, 0.8858, 0.8858, 0.8858, 1.02058, - 0.8858, 0.89591, 0.89591, 0.89591, 0.89591, 0.8111, 0.79611, 0.89713, - 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86936, 0.896, - 0.90083, 0.90083, 0.90083, 0.90083, 0.84224, 0.84224, 0.84224, 0.84224, - 0.97276, 0.99793, 0.98714, 0.98714, 0.98714, 0.98714, 0.98714, 1.08595, - 0.89876, 0.99074, 0.99074, 0.99074, 0.99074, 0.942, 1.0231, 0.942, 0.91755, - 0.86667, 0.91755, 0.86667, 0.91755, 0.86667, 0.80314, 0.896, 0.80314, 0.896, - 0.80314, 0.896, 0.80314, 0.896, 0.92222, 0.93372, 0.92915, 1.01411, 0.73764, - 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, - 0.90083, 0.83051, 1.00512, 0.83051, 1.00512, 0.83051, 1.00512, 1, 1, - 0.90284, 0.99793, 0.90976, 0.99793, 0.86023, 0.84224, 0.86023, 0.84224, - 0.86023, 0.84224, 0.86023, 1.05326, 0.86023, 0.84224, 0.82873, 1.07469, - 0.74, 1.09377, 1, 1, 0.938, 0.84869, 1.06226, 1, 1, 0.84869, 0.83704, - 0.84869, 0.81441, 0.85588, 1.08927, 0.91115, 0.99793, 1, 1, 0.91115, - 0.99793, 0.91887, 0.90991, 0.99793, 0.8858, 0.98714, 0.8858, 0.98714, - 0.8858, 0.98714, 0.894, 0.91434, 0.74498, 0.98196, 1, 1, 0.74498, 0.98196, - 0.73914, 0.792, 0.73914, 0.792, 1, 1, 0.73914, 0.792, 1, 1, 0.81363, 0.904, - 0.81363, 1.19137, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, - 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89633, 1.01915, - 0.8111, 0.942, 0.8111, 0.90531, 0.856, 0.90531, 0.856, 0.90531, 0.856, 1, - 0.92241, 0.91755, 0.86667, 0.788, 0.86936, 0.8858, 0.89876, 1, 1, 0.81363, - 1.19137, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, - 0.90088, 0.90088, 0.90388, 1.03901, 0.92138, 0.78105, 0.7154, 0.86169, - 0.80513, 0.94007, 0.82528, 0.98612, 1.06226, 0.91755, 0.8126, 0.81884, - 0.92819, 0.73764, 0.90531, 0.90284, 0.8858, 0.86023, 0.8126, 0.91172, - 0.96518, 0.91115, 0.83089, 0.8858, 0.87791, 0.79761, 0.89297, 0.81363, - 0.88157, 0.89992, 0.85608, 0.81992, 0.94307, 0.86023, 0.88157, 0.95308, - 0.98699, 0.99793, 1.06226, 0.95817, 0.95308, 0.97358, 0.928, 0.98088, - 0.98699, 0.92761, 0.99793, 0.96017, 1.06226, 0.986, 0.944, 0.95978, 0.938, - 0.96705, 0.98714, 0.80442, 0.98972, 1, 0.89762, 1.04552, 0.95817, 0.99007, - 0.87064, 0.91879, 0.88888, 1.06226, 0.95817, 0.98714, 0.95817, 0.88888, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0.89633, 1.01915, 0.89633, 1.01915, 0.89633, 1.01915, 0.8111, 0.942, 0.9219, - 1, 0.89903, 1, 1, 1, 0.93173, 0.93173, 0.93173, 1, 1.06304, 1.06304, - 1.06904, 0.89903, 0.89903, 0.80549, 1, 1.156, 1, 1, 0.76575, 0.76575, 1, 1, - 0.72458, 1, 1, 1, 1, 0.92241, 1, 1, 1, 0.619, 1, 1.36145, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1.07257, 1, 0.74705, 0.71119, 1.02058, 1.024, 1.02119, 1, 1, - 1.1536, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1.05638, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - ], - es = { lineHeight: 1.2, lineGap: 0.2 }, - ts = [ - 1.76738, 1, 1, 0.99297, 0.9824, 1.04016, 1.06497, 1.03424, 0.97529, 1.17647, - 1.23203, 1.1085, 1.1085, 1.16939, 1.2107, 0.9754, 1.21408, 0.9754, 1.59578, - 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, - 1.03424, 1.03424, 0.81378, 0.81378, 1.2107, 1.2107, 1.2107, 0.71703, - 0.97847, 0.97363, 0.88776, 0.8641, 1.02096, 0.79795, 0.85132, 0.914, - 1.06085, 1.1406, 0.8007, 0.89858, 0.83693, 1.14889, 1.09398, 0.97489, - 0.92094, 0.97489, 0.90399, 0.84041, 0.95923, 1.00135, 1, 1.06467, 0.98243, - 0.90996, 0.99361, 1.1085, 1.56942, 1.1085, 1.2107, 0.74627, 0.94282, - 0.96752, 1.01519, 0.86304, 1.01359, 0.97278, 1.15103, 1.01359, 0.98561, - 1.02285, 1.02285, 1.00527, 1.02285, 1.0302, 0.99041, 1.0008, 1.01519, - 1.01359, 1.02258, 0.79104, 1.16862, 0.99041, 0.97454, 1.02511, 0.99298, - 0.96752, 0.95801, 0.94856, 1.16579, 0.94856, 1.2107, 0.9824, 1.03424, - 1.03424, 1, 1.03424, 1.16579, 0.8727, 1.3871, 1.18622, 1.10818, 1.04478, - 1.2107, 1.18622, 0.75155, 0.94994, 1.28826, 1.21408, 1.21408, 0.91056, 1, - 0.91572, 0.9754, 0.64663, 1.18328, 1.24866, 1.04478, 1.14169, 1.15749, - 1.17389, 0.71703, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, - 0.93506, 0.8641, 0.79795, 0.79795, 0.79795, 0.79795, 1.1406, 1.1406, 1.1406, - 1.1406, 1.02096, 1.09398, 0.97426, 0.97426, 0.97426, 0.97426, 0.97426, - 1.2107, 0.97489, 1.00135, 1.00135, 1.00135, 1.00135, 0.90996, 0.92094, - 1.02798, 0.96752, 0.96752, 0.96752, 0.96752, 0.96752, 0.96752, 0.93136, - 0.86304, 0.97278, 0.97278, 0.97278, 0.97278, 1.02285, 1.02285, 1.02285, - 1.02285, 0.97122, 0.99041, 1, 1, 1, 1, 1, 1.28826, 1.0008, 0.99041, 0.99041, - 0.99041, 0.99041, 0.96752, 1.01519, 0.96752, 0.97363, 0.96752, 0.97363, - 0.96752, 0.97363, 0.96752, 0.8641, 0.86304, 0.8641, 0.86304, 0.8641, - 0.86304, 0.8641, 0.86304, 1.02096, 1.03057, 1.02096, 1.03517, 0.79795, - 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, - 0.97278, 0.914, 1.01359, 0.914, 1.01359, 0.914, 1.01359, 1, 1, 1.06085, - 0.98561, 1.06085, 1.00879, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, - 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 0.97138, 1.08692, 0.8007, - 1.02285, 1, 1, 1.00527, 0.83693, 1.02285, 1, 1, 0.83693, 0.9455, 0.83693, - 0.90418, 0.83693, 1.13005, 1.09398, 0.99041, 1, 1, 1.09398, 0.99041, - 0.96692, 1.09251, 0.99041, 0.97489, 1.0008, 0.97489, 1.0008, 0.97489, - 1.0008, 0.93994, 0.97931, 0.90399, 1.02258, 1, 1, 0.90399, 1.02258, 0.84041, - 0.79104, 0.84041, 0.79104, 0.84041, 0.79104, 0.84041, 0.79104, 1, 1, - 0.95923, 1.07034, 0.95923, 1.16862, 1.00135, 0.99041, 1.00135, 0.99041, - 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, - 1.06467, 1.02511, 0.90996, 0.96752, 0.90996, 0.99361, 0.95801, 0.99361, - 0.95801, 0.99361, 0.95801, 1.07733, 1.03424, 0.97363, 0.96752, 0.93506, - 0.93136, 0.97489, 1.0008, 1, 1, 0.95923, 1.16862, 1.15103, 1.15103, 1.01173, - 1.03959, 0.75953, 0.81378, 0.79912, 1.15103, 1.21994, 0.95161, 0.87815, - 1.01149, 0.81525, 0.7676, 0.98167, 1.01134, 1.02546, 0.84097, 1.03089, - 1.18102, 0.97363, 0.88776, 0.85134, 0.97826, 0.79795, 0.99361, 1.06085, - 0.97489, 1.1406, 0.89858, 1.0388, 1.14889, 1.09398, 0.86039, 0.97489, - 1.0595, 0.92094, 0.94793, 0.95923, 0.90996, 0.99346, 0.98243, 1.02112, - 0.95493, 1.1406, 0.90996, 1.03574, 1.02597, 1.0008, 1.18102, 1.06628, - 1.03574, 1.0192, 1.01932, 1.00886, 0.97531, 1.0106, 1.0008, 1.13189, - 1.18102, 1.02277, 0.98683, 1.0016, 0.99561, 1.07237, 1.0008, 0.90434, - 0.99921, 0.93803, 0.8965, 1.23085, 1.06628, 1.04983, 0.96268, 1.0499, - 0.98439, 1.18102, 1.06628, 1.0008, 1.06628, 0.98439, 0.79795, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1.09466, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 0.97278, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.02065, 1, 1, 1, 1, 1, 1, - 1.06467, 1.02511, 1.06467, 1.02511, 1.06467, 1.02511, 0.90996, 0.96752, 1, - 1.21408, 0.89903, 1, 1, 0.75155, 1.04394, 1.04394, 1.04394, 1.04394, - 0.98633, 0.98633, 0.98633, 0.73047, 0.73047, 1.20642, 0.91211, 1.25635, - 1.222, 1.02956, 1.03372, 1.03372, 0.96039, 1.24633, 1, 1.12454, 0.93503, - 1.03424, 1.19687, 1.03424, 1, 1, 1, 0.771, 1, 1, 1.15749, 1.15749, 1.15749, - 1.10948, 0.86279, 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.16897, 1, - 0.96085, 0.90137, 1.2107, 1.18416, 1.13973, 0.69825, 0.9716, 2.10339, - 1.29004, 1.29004, 1.21172, 1.29004, 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, - 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18874, 1.42603, 1, - 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, - 1, 1, 1, 1.09193, 1.09193, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, - ], - is = { lineHeight: 1.33008, lineGap: 0 }, - as = [ - 1.76738, 1, 1, 0.98946, 1.03959, 1.04016, 1.02809, 1.036, 0.97639, 1.10953, - 1.23203, 1.11144, 1.11144, 1.16939, 1.21237, 0.9754, 1.21261, 0.9754, - 1.59754, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, - 1.036, 0.81378, 0.81378, 1.21237, 1.21237, 1.21237, 0.73541, 0.97847, - 0.97363, 0.89723, 0.87897, 1.0426, 0.79429, 0.85292, 0.91149, 1.05815, - 1.1406, 0.79631, 0.90128, 0.83853, 1.04396, 1.10615, 0.97552, 0.94436, - 0.97552, 0.88641, 0.80527, 0.96083, 1.00135, 1, 1.06777, 0.9817, 0.91142, - 0.99361, 1.11144, 1.57293, 1.11144, 1.21237, 0.74627, 1.31818, 1.06585, - 0.97042, 0.83055, 0.97042, 0.93503, 1.1261, 0.97042, 0.97922, 1.14236, - 0.94552, 1.01054, 1.14236, 1.02471, 0.97922, 0.94165, 0.97042, 0.97042, - 1.0276, 0.78929, 1.1261, 0.97922, 0.95874, 1.02197, 0.98507, 0.96752, - 0.97168, 0.95107, 1.16579, 0.95107, 1.21237, 1.03959, 1.036, 1.036, 1, - 1.036, 1.16579, 0.87357, 1.31818, 1.18754, 1.26781, 1.05356, 1.21237, - 1.18622, 0.79487, 0.94994, 1.29004, 1.24047, 1.24047, 1.31818, 1, 0.91484, - 0.9754, 1.31818, 1.1349, 1.24866, 1.05356, 1.13934, 1.15574, 1.17389, - 0.73541, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.94385, - 0.87897, 0.79429, 0.79429, 0.79429, 0.79429, 1.1406, 1.1406, 1.1406, 1.1406, - 1.0426, 1.10615, 0.97552, 0.97552, 0.97552, 0.97552, 0.97552, 1.21237, - 0.97552, 1.00135, 1.00135, 1.00135, 1.00135, 0.91142, 0.94436, 0.98721, - 1.06585, 1.06585, 1.06585, 1.06585, 1.06585, 1.06585, 0.96705, 0.83055, - 0.93503, 0.93503, 0.93503, 0.93503, 1.14236, 1.14236, 1.14236, 1.14236, - 0.93125, 0.97922, 0.94165, 0.94165, 0.94165, 0.94165, 0.94165, 1.29004, - 0.94165, 0.97922, 0.97922, 0.97922, 0.97922, 0.96752, 0.97042, 0.96752, - 0.97363, 1.06585, 0.97363, 1.06585, 0.97363, 1.06585, 0.87897, 0.83055, - 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, 0.83055, 1.0426, 1.0033, - 1.0426, 0.97042, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, - 0.79429, 0.93503, 0.79429, 0.93503, 0.91149, 0.97042, 0.91149, 0.97042, - 0.91149, 0.97042, 1, 1, 1.05815, 0.97922, 1.05815, 0.97922, 1.1406, 1.14236, - 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 0.97441, - 1.04302, 0.79631, 1.01582, 1, 1, 1.01054, 0.83853, 1.14236, 1, 1, 0.83853, - 1.09125, 0.83853, 0.90418, 0.83853, 1.19508, 1.10615, 0.97922, 1, 1, - 1.10615, 0.97922, 1.01034, 1.10466, 0.97922, 0.97552, 0.94165, 0.97552, - 0.94165, 0.97552, 0.94165, 0.91602, 0.91981, 0.88641, 1.0276, 1, 1, 0.88641, - 1.0276, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, - 0.78929, 1, 1, 0.96083, 1.05403, 0.95923, 1.16862, 1.00135, 0.97922, - 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, - 1.00135, 0.97922, 1.06777, 1.02197, 0.91142, 0.96752, 0.91142, 0.99361, - 0.97168, 0.99361, 0.97168, 0.99361, 0.97168, 1.23199, 1.036, 0.97363, - 1.06585, 0.94385, 0.96705, 0.97552, 0.94165, 1, 1, 0.96083, 1.1261, 1.31818, - 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, - 0.95161, 1.27126, 1.00811, 0.83284, 0.77702, 0.99137, 0.95253, 1.0347, - 0.86142, 1.07205, 1.14236, 0.97363, 0.89723, 0.86869, 1.09818, 0.79429, - 0.99361, 1.05815, 0.97552, 1.1406, 0.90128, 1.06662, 1.04396, 1.10615, - 0.84918, 0.97552, 1.04694, 0.94436, 0.98015, 0.96083, 0.91142, 1.00356, - 0.9817, 1.01945, 0.98999, 1.1406, 0.91142, 1.04961, 0.9898, 1.00639, - 1.14236, 1.07514, 1.04961, 0.99607, 1.02897, 1.008, 0.9898, 0.95134, - 1.00639, 1.11121, 1.14236, 1.00518, 0.97981, 1.02186, 1, 1.08578, 0.94165, - 0.99314, 0.98387, 0.93028, 0.93377, 1.35125, 1.07514, 1.10687, 0.93491, - 1.04232, 1.00351, 1.14236, 1.07514, 0.94165, 1.07514, 1.00351, 0.79429, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.09097, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 0.93503, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.96609, 1, 1, - 1, 1, 1, 1, 1.06777, 1.02197, 1.06777, 1.02197, 1.06777, 1.02197, 0.91142, - 0.96752, 1, 1.21261, 0.89903, 1, 1, 0.75155, 1.04745, 1.04745, 1.04745, - 1.04394, 0.98633, 0.98633, 0.98633, 0.72959, 0.72959, 1.20502, 0.91406, - 1.26514, 1.222, 1.02956, 1.03372, 1.03372, 0.96039, 1.24633, 1, 1.09125, - 0.93327, 1.03336, 1.16541, 1.036, 1, 1, 1, 0.771, 1, 1, 1.15574, 1.15574, - 1.15574, 1.15574, 0.86364, 0.94434, 0.86279, 0.94434, 0.86224, 1, 1, - 1.16798, 1, 0.96085, 0.90068, 1.21237, 1.18416, 1.13904, 0.69825, 0.9716, - 2.10339, 1.29004, 1.29004, 1.21339, 1.29004, 1.29004, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, - 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18775, 1.42603, - 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, - 1.34163, 1, 1, 1, 1.13269, 1.13269, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, - ], - ss = { lineHeight: 1.33008, lineGap: 0 }, - rs = [ - 1.76738, 1, 1, 0.98946, 1.14763, 1.05365, 1.06234, 0.96927, 0.92586, - 1.15373, 1.18414, 0.91349, 0.91349, 1.07403, 1.17308, 0.78383, 1.20088, - 0.78383, 1.42531, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, - 0.96927, 0.96927, 0.96927, 0.96927, 0.78383, 0.78383, 1.17308, 1.17308, - 1.17308, 0.77349, 0.94565, 0.94729, 0.85944, 0.88506, 0.9858, 0.74817, - 0.80016, 0.88449, 0.98039, 0.95782, 0.69238, 0.89898, 0.83231, 0.98183, - 1.03989, 0.96924, 0.86237, 0.96924, 0.80595, 0.74524, 0.86091, 0.95402, - 0.94143, 0.98448, 0.8858, 0.83089, 0.93285, 1.0949, 1.39016, 1.0949, - 1.45994, 0.74627, 1.04839, 0.97454, 0.97454, 0.87207, 0.97454, 0.87533, - 1.06151, 0.97454, 1.00176, 1.16484, 1.08132, 0.98047, 1.16484, 1.02989, - 1.01054, 0.96225, 0.97454, 0.97454, 1.06598, 0.79004, 1.16344, 1.00351, - 0.94629, 0.9973, 0.91016, 0.96777, 0.9043, 0.91082, 0.92481, 0.91082, - 1.17308, 0.95748, 0.96927, 0.96927, 1, 0.96927, 0.92481, 0.80597, 1.04839, - 1.23393, 1.1781, 0.9245, 1.17308, 1.20808, 0.63218, 0.94261, 1.24822, - 1.09971, 1.09971, 1.04839, 1, 0.85273, 0.78032, 1.04839, 1.09971, 1.22326, - 0.9245, 1.09836, 1.13525, 1.15222, 0.70424, 0.94729, 0.94729, 0.94729, - 0.94729, 0.94729, 0.94729, 0.85498, 0.88506, 0.74817, 0.74817, 0.74817, - 0.74817, 0.95782, 0.95782, 0.95782, 0.95782, 0.9858, 1.03989, 0.96924, - 0.96924, 0.96924, 0.96924, 0.96924, 1.17308, 0.96924, 0.95402, 0.95402, - 0.95402, 0.95402, 0.83089, 0.86237, 0.88409, 0.97454, 0.97454, 0.97454, - 0.97454, 0.97454, 0.97454, 0.92916, 0.87207, 0.87533, 0.87533, 0.87533, - 0.87533, 0.93146, 0.93146, 0.93146, 0.93146, 0.93854, 1.01054, 0.96225, - 0.96225, 0.96225, 0.96225, 0.96225, 1.24822, 0.8761, 1.00351, 1.00351, - 1.00351, 1.00351, 0.96777, 0.97454, 0.96777, 0.94729, 0.97454, 0.94729, - 0.97454, 0.94729, 0.97454, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, - 0.87207, 0.88506, 0.87207, 0.9858, 0.95391, 0.9858, 0.97454, 0.74817, - 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, - 0.87533, 0.88449, 0.97454, 0.88449, 0.97454, 0.88449, 0.97454, 1, 1, - 0.98039, 1.00176, 0.98039, 1.00176, 0.95782, 0.93146, 0.95782, 0.93146, - 0.95782, 0.93146, 0.95782, 1.16484, 0.95782, 0.93146, 0.84421, 1.12761, - 0.69238, 1.08132, 1, 1, 0.98047, 0.83231, 1.16484, 1, 1, 0.84723, 1.04861, - 0.84723, 0.78755, 0.83231, 1.23736, 1.03989, 1.01054, 1, 1, 1.03989, - 1.01054, 0.9857, 1.03849, 1.01054, 0.96924, 0.96225, 0.96924, 0.96225, - 0.96924, 0.96225, 0.92383, 0.90171, 0.80595, 1.06598, 1, 1, 0.80595, - 1.06598, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, - 0.79004, 1, 1, 0.86091, 1.02759, 0.85771, 1.16344, 0.95402, 1.00351, - 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, - 0.95402, 1.00351, 0.98448, 0.9973, 0.83089, 0.96777, 0.83089, 0.93285, - 0.9043, 0.93285, 0.9043, 0.93285, 0.9043, 1.31868, 0.96927, 0.94729, - 0.97454, 0.85498, 0.92916, 0.96924, 0.8761, 1, 1, 0.86091, 1.16344, 1.04839, - 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, - 0.81965, 0.81965, 0.94729, 0.78032, 0.71022, 0.90883, 0.84171, 0.99877, - 0.77596, 1.05734, 1.2, 0.94729, 0.85944, 0.82791, 0.9607, 0.74817, 0.93285, - 0.98039, 0.96924, 0.95782, 0.89898, 0.98316, 0.98183, 1.03989, 0.78614, - 0.96924, 0.97642, 0.86237, 0.86075, 0.86091, 0.83089, 0.90082, 0.8858, - 0.97296, 1.01284, 0.95782, 0.83089, 1.0976, 1.04, 1.03342, 1.2, 1.0675, - 1.0976, 0.98205, 1.03809, 1.05097, 1.04, 0.95364, 1.03342, 1.05401, 1.2, - 1.02148, 1.0119, 1.04724, 1.0127, 1.02732, 0.96225, 0.8965, 0.97783, - 0.93574, 0.94818, 1.30679, 1.0675, 1.11826, 0.99821, 1.0557, 1.0326, 1.2, - 1.0675, 0.96225, 1.0675, 1.0326, 0.74817, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1.03754, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.87533, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.98705, 1, 1, 1, 1, 1, 1, 0.98448, 0.9973, - 0.98448, 0.9973, 0.98448, 0.9973, 0.83089, 0.96777, 1, 1.20088, 0.89903, 1, - 1, 0.75155, 0.94945, 0.94945, 0.94945, 0.94945, 1.12317, 1.12317, 1.12317, - 0.67603, 0.67603, 1.15621, 0.73584, 1.21191, 1.22135, 1.06483, 0.94868, - 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87709, 0.96927, 1.01473, 0.96927, - 1, 1, 1, 0.77295, 1, 1, 1.09836, 1.09836, 1.09836, 1.01522, 0.86321, - 0.94434, 0.8649, 0.94434, 0.86182, 1, 1, 1.083, 1, 0.91578, 0.86438, - 1.17308, 1.18416, 1.14589, 0.69825, 0.97622, 1.96791, 1.24822, 1.24822, - 1.17308, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, - 0.87025, 0.87025, 0.87025, 1.17984, 1.42603, 1, 1.42603, 1.42603, 0.99862, - 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.10742, 1.10742, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - ], - ns = { lineHeight: 1.33008, lineGap: 0 }, - gs = [ - 1.76738, 1, 1, 0.98594, 1.02285, 1.10454, 1.06234, 0.96927, 0.92037, - 1.19985, 1.2046, 0.90616, 0.90616, 1.07152, 1.1714, 0.78032, 1.20088, - 0.78032, 1.40246, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, - 0.96927, 0.96927, 0.96927, 0.96927, 0.78032, 0.78032, 1.1714, 1.1714, - 1.1714, 0.80597, 0.94084, 0.96706, 0.85944, 0.85734, 0.97093, 0.75842, - 0.79936, 0.88198, 0.9831, 0.95782, 0.71387, 0.86969, 0.84636, 1.07796, - 1.03584, 0.96924, 0.83968, 0.96924, 0.82826, 0.79649, 0.85771, 0.95132, - 0.93119, 0.98965, 0.88433, 0.8287, 0.93365, 1.08612, 1.3638, 1.08612, - 1.45786, 0.74627, 0.80499, 0.91484, 1.05707, 0.92383, 1.05882, 0.9403, - 1.12654, 1.05882, 1.01756, 1.09011, 1.09011, 0.99414, 1.09011, 1.034, - 1.01756, 1.05356, 1.05707, 1.05882, 1.04399, 0.84863, 1.21968, 1.01756, - 0.95801, 1.00068, 0.91797, 0.96777, 0.9043, 0.90351, 0.92105, 0.90351, - 1.1714, 0.85337, 0.96927, 0.96927, 0.99912, 0.96927, 0.92105, 0.80597, - 1.2434, 1.20808, 1.05937, 0.90957, 1.1714, 1.20808, 0.75155, 0.94261, - 1.24644, 1.09971, 1.09971, 0.84751, 1, 0.85273, 0.78032, 0.61584, 1.05425, - 1.17914, 0.90957, 1.08665, 1.11593, 1.14169, 0.73381, 0.96706, 0.96706, - 0.96706, 0.96706, 0.96706, 0.96706, 0.86035, 0.85734, 0.75842, 0.75842, - 0.75842, 0.75842, 0.95782, 0.95782, 0.95782, 0.95782, 0.97093, 1.03584, - 0.96924, 0.96924, 0.96924, 0.96924, 0.96924, 1.1714, 0.96924, 0.95132, - 0.95132, 0.95132, 0.95132, 0.8287, 0.83968, 0.89049, 0.91484, 0.91484, - 0.91484, 0.91484, 0.91484, 0.91484, 0.93575, 0.92383, 0.9403, 0.9403, - 0.9403, 0.9403, 0.8717, 0.8717, 0.8717, 0.8717, 1.00527, 1.01756, 1.05356, - 1.05356, 1.05356, 1.05356, 1.05356, 1.24644, 0.95923, 1.01756, 1.01756, - 1.01756, 1.01756, 0.96777, 1.05707, 0.96777, 0.96706, 0.91484, 0.96706, - 0.91484, 0.96706, 0.91484, 0.85734, 0.92383, 0.85734, 0.92383, 0.85734, - 0.92383, 0.85734, 0.92383, 0.97093, 1.0969, 0.97093, 1.05882, 0.75842, - 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, - 0.88198, 1.05882, 0.88198, 1.05882, 0.88198, 1.05882, 1, 1, 0.9831, 1.01756, - 0.9831, 1.01756, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782, - 1.09011, 0.95782, 0.8717, 0.84784, 1.11551, 0.71387, 1.09011, 1, 1, 0.99414, - 0.84636, 1.09011, 1, 1, 0.84636, 1.0536, 0.84636, 0.94298, 0.84636, 1.23297, - 1.03584, 1.01756, 1, 1, 1.03584, 1.01756, 1.00323, 1.03444, 1.01756, - 0.96924, 1.05356, 0.96924, 1.05356, 0.96924, 1.05356, 0.93066, 0.98293, - 0.82826, 1.04399, 1, 1, 0.82826, 1.04399, 0.79649, 0.84863, 0.79649, - 0.84863, 0.79649, 0.84863, 0.79649, 0.84863, 1, 1, 0.85771, 1.17318, - 0.85771, 1.21968, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, - 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.98965, 1.00068, - 0.8287, 0.96777, 0.8287, 0.93365, 0.9043, 0.93365, 0.9043, 0.93365, 0.9043, - 1.08571, 0.96927, 0.96706, 0.91484, 0.86035, 0.93575, 0.96924, 0.95923, 1, - 1, 0.85771, 1.21968, 1.11437, 1.11437, 0.93109, 0.91202, 0.60411, 0.84164, - 0.55572, 1.01173, 0.97361, 0.81818, 0.81818, 0.96635, 0.78032, 0.72727, - 0.92366, 0.98601, 1.03405, 0.77968, 1.09799, 1.2, 0.96706, 0.85944, 0.85638, - 0.96491, 0.75842, 0.93365, 0.9831, 0.96924, 0.95782, 0.86969, 0.94152, - 1.07796, 1.03584, 0.78437, 0.96924, 0.98715, 0.83968, 0.83491, 0.85771, - 0.8287, 0.94492, 0.88433, 0.9287, 1.0098, 0.95782, 0.8287, 1.0625, 0.98248, - 1.03424, 1.2, 1.01071, 1.0625, 0.95246, 1.03809, 1.04912, 0.98248, 1.00221, - 1.03424, 1.05443, 1.2, 1.04785, 0.99609, 1.00169, 1.05176, 0.99346, 1.05356, - 0.9087, 1.03004, 0.95542, 0.93117, 1.23362, 1.01071, 1.07831, 1.02512, - 1.05205, 1.03502, 1.2, 1.01071, 1.05356, 1.01071, 1.03502, 0.75842, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.03719, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0.9403, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.04021, 1, 1, 1, 1, 1, - 1, 0.98965, 1.00068, 0.98965, 1.00068, 0.98965, 1.00068, 0.8287, 0.96777, 1, - 1.20088, 0.89903, 1, 1, 0.75155, 1.03077, 1.03077, 1.03077, 1.03077, - 1.13196, 1.13196, 1.13196, 0.67428, 0.67428, 1.16039, 0.73291, 1.20996, - 1.22135, 1.06483, 0.94868, 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87796, - 0.96927, 1.01518, 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.10539, 1.10539, - 1.11358, 1.06967, 0.86279, 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.083, - 1, 0.91578, 0.86507, 1.1714, 1.18416, 1.14589, 0.69825, 0.97622, 1.9697, - 1.24822, 1.24822, 1.17238, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, - 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18083, 1.42603, 1, - 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, - 1, 1, 1, 1.10938, 1.10938, 1, 1, 1, 1.05425, 1.09971, 1.09971, 1.09971, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - ], - os = { lineHeight: 1.33008, lineGap: 0 }, - Is = getLookupTableFactory(function (e) { - e["MyriadPro-Regular"] = e["PdfJS-Fallback-Regular"] = { - name: "LiberationSans-Regular", - factors: As, - baseWidths: Wa, - baseMapping: ja, - metrics: es, - }; - e["MyriadPro-Bold"] = e["PdfJS-Fallback-Bold"] = { - name: "LiberationSans-Bold", - factors: Xa, - baseWidths: va, - baseMapping: Ka, - metrics: Za, - }; - e["MyriadPro-It"] = - e["MyriadPro-Italic"] = - e["PdfJS-Fallback-Italic"] = - { - name: "LiberationSans-Italic", - factors: _a, - baseWidths: Oa, - baseMapping: Pa, - metrics: $a, - }; - e["MyriadPro-BoldIt"] = - e["MyriadPro-BoldItalic"] = - e["PdfJS-Fallback-BoldItalic"] = - { - name: "LiberationSans-BoldItalic", - factors: Va, - baseWidths: Ta, - baseMapping: qa, - metrics: za, - }; - e.ArialMT = - e.Arial = - e["Arial-Regular"] = - { name: "LiberationSans-Regular", baseWidths: Wa, baseMapping: ja }; - e["Arial-BoldMT"] = e["Arial-Bold"] = { - name: "LiberationSans-Bold", - baseWidths: va, - baseMapping: Ka, - }; - e["Arial-ItalicMT"] = e["Arial-Italic"] = { - name: "LiberationSans-Italic", - baseWidths: Oa, - baseMapping: Pa, - }; - e["Arial-BoldItalicMT"] = e["Arial-BoldItalic"] = { - name: "LiberationSans-BoldItalic", - baseWidths: Ta, - baseMapping: qa, - }; - e["Calibri-Regular"] = { - name: "LiberationSans-Regular", - factors: Ra, - baseWidths: Wa, - baseMapping: ja, - metrics: Na, - }; - e["Calibri-Bold"] = { - name: "LiberationSans-Bold", - factors: wa, - baseWidths: va, - baseMapping: Ka, - metrics: Da, - }; - e["Calibri-Italic"] = { - name: "LiberationSans-Italic", - factors: Sa, - baseWidths: Oa, - baseMapping: Pa, - metrics: ka, - }; - e["Calibri-BoldItalic"] = { - name: "LiberationSans-BoldItalic", - factors: ba, - baseWidths: Ta, - baseMapping: qa, - metrics: Fa, - }; - e["Segoeui-Regular"] = { - name: "LiberationSans-Regular", - factors: gs, - baseWidths: Wa, - baseMapping: ja, - metrics: os, - }; - e["Segoeui-Bold"] = { - name: "LiberationSans-Bold", - factors: ts, - baseWidths: va, - baseMapping: Ka, - metrics: is, - }; - e["Segoeui-Italic"] = { - name: "LiberationSans-Italic", - factors: rs, - baseWidths: Oa, - baseMapping: Pa, - metrics: ns, - }; - e["Segoeui-BoldItalic"] = { - name: "LiberationSans-BoldItalic", - factors: as, - baseWidths: Ta, - baseMapping: qa, - metrics: ss, - }; - e["Helvetica-Regular"] = e.Helvetica = { - name: "LiberationSans-Regular", - factors: Ja, - baseWidths: Wa, - baseMapping: ja, - metrics: Ya, - }; - e["Helvetica-Bold"] = { - name: "LiberationSans-Bold", - factors: Ga, - baseWidths: va, - baseMapping: Ka, - metrics: xa, - }; - e["Helvetica-Italic"] = { - name: "LiberationSans-Italic", - factors: La, - baseWidths: Oa, - baseMapping: Pa, - metrics: Ha, - }; - e["Helvetica-BoldItalic"] = { - name: "LiberationSans-BoldItalic", - factors: Ua, - baseWidths: Ta, - baseMapping: qa, - metrics: Ma, - }; - }); -function getXfaFontName(e) { - const t = normalizeFontName(e); - return Is()[t]; -} -function getXfaFontDict(e) { - const t = (function getXfaFontWidths(e) { - const t = getXfaFontName(e); - if (!t) return null; - const { baseWidths: i, baseMapping: a, factors: s } = t, - r = s ? i.map((e, t) => e * s[t]) : i; - let n, - g = -2; - const o = []; - for (const [e, t] of a.map((e, t) => [e, t]).sort(([e], [t]) => e - t)) - if (-1 !== e) - if (e === g + 1) { - n.push(r[t]); - g += 1; - } else { - g = e; - n = [r[t]]; - o.push(e, n); - } - return o; - })(e), - i = new Dict(null); - i.set("BaseFont", Name.get(e)); - i.set("Type", Name.get("Font")); - i.set("Subtype", Name.get("CIDFontType2")); - i.set("Encoding", Name.get("Identity-H")); - i.set("CIDToGIDMap", Name.get("Identity")); - i.set("W", t); - i.set("FirstChar", t[0]); - i.set("LastChar", t.at(-2) + t.at(-1).length - 1); - const a = new Dict(null); - i.set("FontDescriptor", a); - const s = new Dict(null); - s.set("Ordering", "Identity"); - s.set("Registry", "Adobe"); - s.set("Supplement", 0); - i.set("CIDSystemInfo", s); - return i; +function getXfaFontWidths(name) { + const info = getXfaFontName(name); + if (!info) { + return null; + } + const { baseWidths, baseMapping, factors } = info; + const rescaledBaseWidths = !factors + ? baseWidths + : baseWidths.map((w, i) => w * factors[i]); + let currentCode = -2; + let currentArray; + const newWidths = []; + for (const [unicode, glyphIndex] of baseMapping + .map((charUnicode, index) => [charUnicode, index]) + .sort(([unicode1], [unicode2]) => unicode1 - unicode2)) { + if (unicode === -1) { + continue; + } + if (unicode === currentCode + 1) { + currentArray.push(rescaledBaseWidths[glyphIndex]); + currentCode += 1; + } else { + currentCode = unicode; + currentArray = [rescaledBaseWidths[glyphIndex]]; + newWidths.push(unicode, currentArray); + } + } + return newWidths; } +function getXfaFontDict(name) { + const widths = getXfaFontWidths(name); + const dict = new Dict(null); + dict.set("BaseFont", Name.get(name)); + dict.set("Type", Name.get("Font")); + dict.set("Subtype", Name.get("CIDFontType2")); + dict.set("Encoding", Name.get("Identity-H")); + dict.set("CIDToGIDMap", Name.get("Identity")); + dict.set("W", widths); + dict.set("FirstChar", widths[0]); + dict.set("LastChar", widths.at(-2) + widths.at(-1).length - 1); + const descriptor = new Dict(null); + dict.set("FontDescriptor", descriptor); + const systemInfo = new Dict(null); + systemInfo.set("Ordering", "Identity"); + systemInfo.set("Registry", "Adobe"); + systemInfo.set("Supplement", 0); + dict.set("CIDSystemInfo", systemInfo); + return dict; +} // ./src/core/ps_parser.js + class PostScriptParser { - constructor(e) { - this.lexer = e; + constructor(lexer) { + this.lexer = lexer; this.operators = []; this.token = null; this.prev = null; @@ -29954,89 +34935,119 @@ class PostScriptParser { this.prev = this.token; this.token = this.lexer.getToken(); } - accept(e) { - if (this.token.type === e) { + accept(type) { + if (this.token.type === type) { this.nextToken(); - return !0; + return true; } - return !1; + return false; } - expect(e) { - if (this.accept(e)) return !0; + expect(type) { + if (this.accept(type)) { + return true; + } throw new FormatError( - `Unexpected symbol: found ${this.token.type} expected ${e}.`, + `Unexpected symbol: found ${this.token.type} expected ${type}.`, ); } parse() { this.nextToken(); - this.expect(cs.LBRACE); + this.expect(PostScriptTokenTypes.LBRACE); this.parseBlock(); - this.expect(cs.RBRACE); + this.expect(PostScriptTokenTypes.RBRACE); return this.operators; } parseBlock() { - for (;;) - if (this.accept(cs.NUMBER)) this.operators.push(this.prev.value); - else if (this.accept(cs.OPERATOR)) this.operators.push(this.prev.value); - else { - if (!this.accept(cs.LBRACE)) return; + while (true) { + if (this.accept(PostScriptTokenTypes.NUMBER)) { + this.operators.push(this.prev.value); + } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { + this.operators.push(this.prev.value); + } else if (this.accept(PostScriptTokenTypes.LBRACE)) { this.parseCondition(); - } - } - parseCondition() { - const e = this.operators.length; - this.operators.push(null, null); - this.parseBlock(); - this.expect(cs.RBRACE); - if (this.accept(cs.IF)) { - this.operators[e] = this.operators.length; - this.operators[e + 1] = "jz"; - } else { - if (!this.accept(cs.LBRACE)) - throw new FormatError("PS Function: error parsing conditional."); - { - const t = this.operators.length; - this.operators.push(null, null); - const i = this.operators.length; - this.parseBlock(); - this.expect(cs.RBRACE); - this.expect(cs.IFELSE); - this.operators[t] = this.operators.length; - this.operators[t + 1] = "j"; - this.operators[e] = i; - this.operators[e + 1] = "jz"; + } else { + return; } } } + parseCondition() { + const conditionLocation = this.operators.length; + this.operators.push(null, null); + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + if (this.accept(PostScriptTokenTypes.IF)) { + this.operators[conditionLocation] = this.operators.length; + this.operators[conditionLocation + 1] = "jz"; + } else if (this.accept(PostScriptTokenTypes.LBRACE)) { + const jumpLocation = this.operators.length; + this.operators.push(null, null); + const endOfTrue = this.operators.length; + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + this.expect(PostScriptTokenTypes.IFELSE); + this.operators[jumpLocation] = this.operators.length; + this.operators[jumpLocation + 1] = "j"; + this.operators[conditionLocation] = endOfTrue; + this.operators[conditionLocation + 1] = "jz"; + } else { + throw new FormatError("PS Function: error parsing conditional."); + } + } } -const cs = { LBRACE: 0, RBRACE: 1, NUMBER: 2, OPERATOR: 3, IF: 4, IFELSE: 5 }; +const PostScriptTokenTypes = { + LBRACE: 0, + RBRACE: 1, + NUMBER: 2, + OPERATOR: 3, + IF: 4, + IFELSE: 5, +}; class PostScriptToken { static get opCache() { return shadow(this, "opCache", Object.create(null)); } - constructor(e, t) { - this.type = e; - this.value = t; + constructor(type, value) { + this.type = type; + this.value = value; } - static getOperator(e) { - return (PostScriptToken.opCache[e] ||= new PostScriptToken(cs.OPERATOR, e)); + static getOperator(op) { + return (PostScriptToken.opCache[op] ||= new PostScriptToken( + PostScriptTokenTypes.OPERATOR, + op, + )); } static get LBRACE() { - return shadow(this, "LBRACE", new PostScriptToken(cs.LBRACE, "{")); + return shadow( + this, + "LBRACE", + new PostScriptToken(PostScriptTokenTypes.LBRACE, "{"), + ); } static get RBRACE() { - return shadow(this, "RBRACE", new PostScriptToken(cs.RBRACE, "}")); + return shadow( + this, + "RBRACE", + new PostScriptToken(PostScriptTokenTypes.RBRACE, "}"), + ); } static get IF() { - return shadow(this, "IF", new PostScriptToken(cs.IF, "IF")); + return shadow( + this, + "IF", + new PostScriptToken(PostScriptTokenTypes.IF, "IF"), + ); } static get IFELSE() { - return shadow(this, "IFELSE", new PostScriptToken(cs.IFELSE, "IFELSE")); + return shadow( + this, + "IFELSE", + new PostScriptToken(PostScriptTokenTypes.IFELSE, "IFELSE"), + ); } } class PostScriptLexer { - constructor(e) { - this.stream = e; + constructor(stream) { + this.stream = stream; this.nextChar(); this.strBuf = []; } @@ -30044,1962 +35055,2443 @@ class PostScriptLexer { return (this.currentChar = this.stream.getByte()); } getToken() { - let e = !1, - t = this.currentChar; - for (;;) { - if (t < 0) return pt; - if (e) (10 !== t && 13 !== t) || (e = !1); - else if (37 === t) e = !0; - else if (!isWhiteSpace(t)) break; - t = this.nextChar(); + let comment = false; + let ch = this.currentChar; + while (true) { + if (ch < 0) { + return EOF; + } + if (comment) { + if (ch === 0x0a || ch === 0x0d) { + comment = false; + } + } else if (ch === 0x25) { + comment = true; + } else if (!isWhiteSpace(ch)) { + break; + } + ch = this.nextChar(); } - switch (0 | t) { - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - case 43: - case 45: - case 46: - return new PostScriptToken(cs.NUMBER, this.getNumber()); - case 123: + switch (ch | 0) { + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x2b: + case 0x2d: + case 0x2e: + return new PostScriptToken( + PostScriptTokenTypes.NUMBER, + this.getNumber(), + ); + case 0x7b: this.nextChar(); return PostScriptToken.LBRACE; - case 125: + case 0x7d: this.nextChar(); return PostScriptToken.RBRACE; } - const i = this.strBuf; - i.length = 0; - i[0] = String.fromCharCode(t); - for ( - ; - (t = this.nextChar()) >= 0 && - ((t >= 65 && t <= 90) || (t >= 97 && t <= 122)); - - ) - i.push(String.fromCharCode(t)); - const a = i.join(""); - switch (a.toLowerCase()) { + const strBuf = this.strBuf; + strBuf.length = 0; + strBuf[0] = String.fromCharCode(ch); + while ( + (ch = this.nextChar()) >= 0 && + ((ch >= 0x41 && ch <= 0x5a) || (ch >= 0x61 && ch <= 0x7a)) + ) { + strBuf.push(String.fromCharCode(ch)); + } + const str = strBuf.join(""); + switch (str.toLowerCase()) { case "if": return PostScriptToken.IF; case "ifelse": return PostScriptToken.IFELSE; default: - return PostScriptToken.getOperator(a); + return PostScriptToken.getOperator(str); } } getNumber() { - let e = this.currentChar; - const t = this.strBuf; - t.length = 0; - t[0] = String.fromCharCode(e); - for ( - ; - (e = this.nextChar()) >= 0 && - ((e >= 48 && e <= 57) || 45 === e || 46 === e); - - ) - t.push(String.fromCharCode(e)); - const i = parseFloat(t.join("")); - if (isNaN(i)) throw new FormatError(`Invalid floating point number: ${i}`); - return i; + let ch = this.currentChar; + const strBuf = this.strBuf; + strBuf.length = 0; + strBuf[0] = String.fromCharCode(ch); + while ((ch = this.nextChar()) >= 0) { + if ((ch >= 0x30 && ch <= 0x39) || ch === 0x2d || ch === 0x2e) { + strBuf.push(String.fromCharCode(ch)); + } else { + break; + } + } + const value = parseFloat(strBuf.join("")); + if (isNaN(value)) { + throw new FormatError(`Invalid floating point number: ${value}`); + } + return value; } -} +} // ./src/core/image_utils.js + class BaseLocalCache { - constructor(e) { - this.constructor === BaseLocalCache && - unreachable("Cannot initialize BaseLocalCache."); - this._onlyRefs = !0 === e?.onlyRefs; + constructor(options) { + this._onlyRefs = options?.onlyRefs === true; if (!this._onlyRefs) { this._nameRefMap = new Map(); this._imageMap = new Map(); } this._imageCache = new RefSetCache(); } - getByName(e) { - this._onlyRefs && unreachable("Should not call `getByName` method."); - const t = this._nameRefMap.get(e); - return t ? this.getByRef(t) : this._imageMap.get(e) || null; + getByName(name) { + if (this._onlyRefs) { + unreachable("Should not call `getByName` method."); + } + const ref = this._nameRefMap.get(name); + if (ref) { + return this.getByRef(ref); + } + return this._imageMap.get(name) || null; } - getByRef(e) { - return this._imageCache.get(e) || null; + getByRef(ref) { + return this._imageCache.get(ref) || null; } - set(e, t, i) { + set(name, ref, data) { unreachable("Abstract method `set` called."); } } class LocalImageCache extends BaseLocalCache { - set(e, t = null, i) { - if ("string" != typeof e) + set(name, ref = null, data) { + if (typeof name !== "string") { throw new Error('LocalImageCache.set - expected "name" argument.'); - if (t) { - if (this._imageCache.has(t)) return; - this._nameRefMap.set(e, t); - this._imageCache.put(t, i); - } else this._imageMap.has(e) || this._imageMap.set(e, i); + } + if (ref) { + if (this._imageCache.has(ref)) { + return; + } + this._nameRefMap.set(name, ref); + this._imageCache.put(ref, data); + return; + } + if (this._imageMap.has(name)) { + return; + } + this._imageMap.set(name, data); } } class LocalColorSpaceCache extends BaseLocalCache { - set(e = null, t = null, i) { - if ("string" != typeof e && !t) + set(name = null, ref = null, data) { + if (typeof name !== "string" && !ref) { throw new Error( 'LocalColorSpaceCache.set - expected "name" and/or "ref" argument.', ); - if (t) { - if (this._imageCache.has(t)) return; - null !== e && this._nameRefMap.set(e, t); - this._imageCache.put(t, i); - } else this._imageMap.has(e) || this._imageMap.set(e, i); + } + if (ref) { + if (this._imageCache.has(ref)) { + return; + } + if (name !== null) { + this._nameRefMap.set(name, ref); + } + this._imageCache.put(ref, data); + return; + } + if (this._imageMap.has(name)) { + return; + } + this._imageMap.set(name, data); } } class LocalFunctionCache extends BaseLocalCache { - constructor(e) { - super({ onlyRefs: !0 }); + constructor(options) { + super({ + onlyRefs: true, + }); } - set(e = null, t, i) { - if (!t) + set(name = null, ref, data) { + if (!ref) { throw new Error('LocalFunctionCache.set - expected "ref" argument.'); - this._imageCache.has(t) || this._imageCache.put(t, i); + } + if (this._imageCache.has(ref)) { + return; + } + this._imageCache.put(ref, data); } } class LocalGStateCache extends BaseLocalCache { - set(e, t = null, i) { - if ("string" != typeof e) + set(name, ref = null, data) { + if (typeof name !== "string") { throw new Error('LocalGStateCache.set - expected "name" argument.'); - if (t) { - if (this._imageCache.has(t)) return; - this._nameRefMap.set(e, t); - this._imageCache.put(t, i); - } else this._imageMap.has(e) || this._imageMap.set(e, i); + } + if (ref) { + if (this._imageCache.has(ref)) { + return; + } + this._nameRefMap.set(name, ref); + this._imageCache.put(ref, data); + return; + } + if (this._imageMap.has(name)) { + return; + } + this._imageMap.set(name, data); } } class LocalTilingPatternCache extends BaseLocalCache { - constructor(e) { - super({ onlyRefs: !0 }); + constructor(options) { + super({ + onlyRefs: true, + }); } - set(e = null, t, i) { - if (!t) + set(name = null, ref, data) { + if (!ref) { throw new Error('LocalTilingPatternCache.set - expected "ref" argument.'); - this._imageCache.has(t) || this._imageCache.put(t, i); + } + if (this._imageCache.has(ref)) { + return; + } + this._imageCache.put(ref, data); } } class RegionalImageCache extends BaseLocalCache { - constructor(e) { - super({ onlyRefs: !0 }); + constructor(options) { + super({ + onlyRefs: true, + }); } - set(e = null, t, i) { - if (!t) + set(name = null, ref, data) { + if (!ref) { throw new Error('RegionalImageCache.set - expected "ref" argument.'); - this._imageCache.has(t) || this._imageCache.put(t, i); + } + if (this._imageCache.has(ref)) { + return; + } + this._imageCache.put(ref, data); } } class GlobalImageCache { static NUM_PAGES_THRESHOLD = 2; static MIN_IMAGES_TO_CACHE = 10; - static MAX_BYTE_SIZE = 5e7; - #D = new RefSet(); + static MAX_BYTE_SIZE = 5 * MAX_IMAGE_SIZE_TO_CACHE; + #decodeFailedSet = new RefSet(); constructor() { this._refCache = new RefSetCache(); this._imageCache = new RefSetCache(); } - get #b() { - let e = 0; - for (const t of this._imageCache) e += t.byteSize; - return e; - } - get #F() { - return ( - !(this._imageCache.size < GlobalImageCache.MIN_IMAGES_TO_CACHE) && - !(this.#b < GlobalImageCache.MAX_BYTE_SIZE) - ); - } - shouldCache(e, t) { - let i = this._refCache.get(e); - if (!i) { - i = new Set(); - this._refCache.put(e, i); + get #byteSize() { + let byteSize = 0; + for (const imageData of this._imageCache) { + byteSize += imageData.byteSize; } - i.add(t); - return ( - !(i.size < GlobalImageCache.NUM_PAGES_THRESHOLD) && - !(!this._imageCache.has(e) && this.#F) - ); + return byteSize; } - addDecodeFailed(e) { - this.#D.put(e); + get #cacheLimitReached() { + if (this._imageCache.size < GlobalImageCache.MIN_IMAGES_TO_CACHE) { + return false; + } + if (this.#byteSize < GlobalImageCache.MAX_BYTE_SIZE) { + return false; + } + return true; } - hasDecodeFailed(e) { - return this.#D.has(e); + shouldCache(ref, pageIndex) { + let pageIndexSet = this._refCache.get(ref); + if (!pageIndexSet) { + pageIndexSet = new Set(); + this._refCache.put(ref, pageIndexSet); + } + pageIndexSet.add(pageIndex); + if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) { + return false; + } + if (!this._imageCache.has(ref) && this.#cacheLimitReached) { + return false; + } + return true; } - addByteSize(e, t) { - const i = this._imageCache.get(e); - i && (i.byteSize || (i.byteSize = t)); + addDecodeFailed(ref) { + this.#decodeFailedSet.put(ref); } - getData(e, t) { - const i = this._refCache.get(e); - if (!i) return null; - if (i.size < GlobalImageCache.NUM_PAGES_THRESHOLD) return null; - const a = this._imageCache.get(e); - if (!a) return null; - i.add(t); - return a; + hasDecodeFailed(ref) { + return this.#decodeFailedSet.has(ref); } - setData(e, t) { - if (!this._refCache.has(e)) + addByteSize(ref, byteSize) { + const imageData = this._imageCache.get(ref); + if (!imageData) { + return; + } + if (imageData.byteSize) { + return; + } + imageData.byteSize = byteSize; + } + getData(ref, pageIndex) { + const pageIndexSet = this._refCache.get(ref); + if (!pageIndexSet) { + return null; + } + if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) { + return null; + } + const imageData = this._imageCache.get(ref); + if (!imageData) { + return null; + } + pageIndexSet.add(pageIndex); + return imageData; + } + setData(ref, data) { + if (!this._refCache.has(ref)) { throw new Error( 'GlobalImageCache.setData - expected "shouldCache" to have been called.', ); - this._imageCache.has(e) || - (this.#F - ? warn("GlobalImageCache.setData - cache limit reached.") - : this._imageCache.put(e, t)); + } + if (this._imageCache.has(ref)) { + return; + } + if (this.#cacheLimitReached) { + warn("GlobalImageCache.setData - cache limit reached."); + return; + } + this._imageCache.put(ref, data); } - clear(e = !1) { - if (!e) { - this.#D.clear(); + clear(onlyData = false) { + if (!onlyData) { + this.#decodeFailedSet.clear(); this._refCache.clear(); } this._imageCache.clear(); } -} +} // ./src/core/function.js + class PDFFunctionFactory { - constructor({ xref: e, isEvalSupported: t = !0 }) { - this.xref = e; - this.isEvalSupported = !1 !== t; + constructor({ xref, isEvalSupported = true }) { + this.xref = xref; + this.isEvalSupported = isEvalSupported !== false; } - create(e) { - const t = this.getCached(e); - if (t) return t; - const i = PDFFunction.parse({ + create(fn) { + const cachedFunction = this.getCached(fn); + if (cachedFunction) { + return cachedFunction; + } + const parsedFunction = PDFFunction.parse({ xref: this.xref, isEvalSupported: this.isEvalSupported, - fn: e instanceof Ref ? this.xref.fetch(e) : e, + fn: fn instanceof Ref ? this.xref.fetch(fn) : fn, }); - this._cache(e, i); - return i; + this._cache(fn, parsedFunction); + return parsedFunction; } - createFromArray(e) { - const t = this.getCached(e); - if (t) return t; - const i = PDFFunction.parseArray({ + createFromArray(fnObj) { + const cachedFunction = this.getCached(fnObj); + if (cachedFunction) { + return cachedFunction; + } + const parsedFunction = PDFFunction.parseArray({ xref: this.xref, isEvalSupported: this.isEvalSupported, - fnObj: e instanceof Ref ? this.xref.fetch(e) : e, + fnObj: fnObj instanceof Ref ? this.xref.fetch(fnObj) : fnObj, }); - this._cache(e, i); - return i; + this._cache(fnObj, parsedFunction); + return parsedFunction; } - getCached(e) { - let t; - e instanceof Ref - ? (t = e) - : e instanceof Dict - ? (t = e.objId) - : e instanceof BaseStream && (t = e.dict?.objId); - if (t) { - const e = this._localFunctionCache.getByRef(t); - if (e) return e; + getCached(cacheKey) { + let fnRef; + if (cacheKey instanceof Ref) { + fnRef = cacheKey; + } else if (cacheKey instanceof Dict) { + fnRef = cacheKey.objId; + } else if (cacheKey instanceof BaseStream) { + fnRef = cacheKey.dict?.objId; + } + if (fnRef) { + const localFunction = this._localFunctionCache.getByRef(fnRef); + if (localFunction) { + return localFunction; + } } return null; } - _cache(e, t) { - if (!t) + _cache(cacheKey, parsedFunction) { + if (!parsedFunction) { throw new Error( 'PDFFunctionFactory._cache - expected "parsedFunction" argument.', ); - let i; - e instanceof Ref - ? (i = e) - : e instanceof Dict - ? (i = e.objId) - : e instanceof BaseStream && (i = e.dict?.objId); - i && this._localFunctionCache.set(null, i, t); + } + let fnRef; + if (cacheKey instanceof Ref) { + fnRef = cacheKey; + } else if (cacheKey instanceof Dict) { + fnRef = cacheKey.objId; + } else if (cacheKey instanceof BaseStream) { + fnRef = cacheKey.dict?.objId; + } + if (fnRef) { + this._localFunctionCache.set(null, fnRef, parsedFunction); + } } get _localFunctionCache() { return shadow(this, "_localFunctionCache", new LocalFunctionCache()); } } -function toNumberArray(e) { - return Array.isArray(e) - ? isNumberArray(e, null) - ? e - : e.map((e) => +e) - : null; +function toNumberArray(arr) { + if (!Array.isArray(arr)) { + return null; + } + if (!isNumberArray(arr, null)) { + return arr.map((x) => +x); + } + return arr; } class PDFFunction { - static getSampleArray(e, t, i, a) { - let s, - r, - n = 1; - for (s = 0, r = e.length; s < r; s++) n *= e[s]; - n *= t; - const g = new Array(n); - let o = 0, - c = 0; - const C = 1 / (2 ** i - 1), - h = a.getBytes((n * i + 7) / 8); - let l = 0; - for (s = 0; s < n; s++) { - for (; o < i; ) { - c <<= 8; - c |= h[l++]; - o += 8; - } - o -= i; - g[s] = (c >> o) * C; - c &= (1 << o) - 1; + static getSampleArray(size, outputSize, bps, stream) { + let i, ii; + let length = 1; + for (i = 0, ii = size.length; i < ii; i++) { + length *= size[i]; } - return g; + length *= outputSize; + const array = new Array(length); + let codeSize = 0; + let codeBuf = 0; + const sampleMul = 1.0 / (2.0 ** bps - 1); + const strBytes = stream.getBytes((length * bps + 7) / 8); + let strIdx = 0; + for (i = 0; i < length; i++) { + while (codeSize < bps) { + codeBuf <<= 8; + codeBuf |= strBytes[strIdx++]; + codeSize += 8; + } + codeSize -= bps; + array[i] = (codeBuf >> codeSize) * sampleMul; + codeBuf &= (1 << codeSize) - 1; + } + return array; } - static parse({ xref: e, isEvalSupported: t, fn: i }) { - const a = i.dict || i; - switch (a.get("FunctionType")) { + static parse({ xref, isEvalSupported, fn }) { + const dict = fn.dict || fn; + const typeNum = dict.get("FunctionType"); + switch (typeNum) { case 0: return this.constructSampled({ - xref: e, - isEvalSupported: t, - fn: i, - dict: a, + xref, + isEvalSupported, + fn, + dict, }); case 1: break; case 2: return this.constructInterpolated({ - xref: e, - isEvalSupported: t, - dict: a, + xref, + isEvalSupported, + dict, }); case 3: - return this.constructStiched({ xref: e, isEvalSupported: t, dict: a }); + return this.constructStiched({ + xref, + isEvalSupported, + dict, + }); case 4: return this.constructPostScript({ - xref: e, - isEvalSupported: t, - fn: i, - dict: a, + xref, + isEvalSupported, + fn, + dict, }); } throw new FormatError("Unknown type of function"); } - static parseArray({ xref: e, isEvalSupported: t, fnObj: i }) { - if (!Array.isArray(i)) - return this.parse({ xref: e, isEvalSupported: t, fn: i }); - const a = []; - for (const s of i) - a.push(this.parse({ xref: e, isEvalSupported: t, fn: e.fetchIfRef(s) })); - return function (e, t, i, s) { - for (let r = 0, n = a.length; r < n; r++) a[r](e, t, i, s + r); + static parseArray({ xref, isEvalSupported, fnObj }) { + if (!Array.isArray(fnObj)) { + return this.parse({ + xref, + isEvalSupported, + fn: fnObj, + }); + } + const fnArray = []; + for (const fn of fnObj) { + fnArray.push( + this.parse({ + xref, + isEvalSupported, + fn: xref.fetchIfRef(fn), + }), + ); + } + return function (src, srcOffset, dest, destOffset) { + for (let i = 0, ii = fnArray.length; i < ii; i++) { + fnArray[i](src, srcOffset, dest, destOffset + i); + } }; } - static constructSampled({ xref: e, isEvalSupported: t, fn: i, dict: a }) { - function toMultiArray(e) { - const t = e.length, - i = []; - let a = 0; - for (let s = 0; s < t; s += 2) i[a++] = [e[s], e[s + 1]]; - return i; + static constructSampled({ xref, isEvalSupported, fn, dict }) { + function toMultiArray(arr) { + const inputLength = arr.length; + const out = []; + let index = 0; + for (let i = 0; i < inputLength; i += 2) { + out[index++] = [arr[i], arr[i + 1]]; + } + return out; } - function interpolate(e, t, i, a, s) { - return a + ((s - a) / (i - t)) * (e - t); + function interpolate(x, xmin, xmax, ymin, ymax) { + return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin)); } - let s = toNumberArray(a.getArray("Domain")), - r = toNumberArray(a.getArray("Range")); - if (!s || !r) throw new FormatError("No domain or range"); - const n = s.length / 2, - g = r.length / 2; - s = toMultiArray(s); - r = toMultiArray(r); - const o = toNumberArray(a.getArray("Size")), - c = a.get("BitsPerSample"), - C = a.get("Order") || 1; - 1 !== C && info("No support for cubic spline interpolation: " + C); - let h = toNumberArray(a.getArray("Encode")); - if (h) h = toMultiArray(h); - else { - h = []; - for (let e = 0; e < n; ++e) h.push([0, o[e] - 1]); + let domain = toNumberArray(dict.getArray("Domain")); + let range = toNumberArray(dict.getArray("Range")); + if (!domain || !range) { + throw new FormatError("No domain or range"); } - let l = toNumberArray(a.getArray("Decode")); - l = l ? toMultiArray(l) : r; - const Q = this.getSampleArray(o, g, c, i); - return function constructSampledFn(e, t, i, a) { - const c = 1 << n, - C = new Float64Array(c), - E = new Uint32Array(c); - let u, d; - for (d = 0; d < c; d++) C[d] = 1; - let f = g, - p = 1; - for (u = 0; u < n; ++u) { - const i = s[u][0], - a = s[u][1]; - let r = interpolate( - Math.min(Math.max(e[t + u], i), a), - i, - a, - h[u][0], - h[u][1], + const inputSize = domain.length / 2; + const outputSize = range.length / 2; + domain = toMultiArray(domain); + range = toMultiArray(range); + const size = toNumberArray(dict.getArray("Size")); + const bps = dict.get("BitsPerSample"); + const order = dict.get("Order") || 1; + if (order !== 1) { + info("No support for cubic spline interpolation: " + order); + } + let encode = toNumberArray(dict.getArray("Encode")); + if (!encode) { + encode = []; + for (let i = 0; i < inputSize; ++i) { + encode.push([0, size[i] - 1]); + } + } else { + encode = toMultiArray(encode); + } + let decode = toNumberArray(dict.getArray("Decode")); + decode = !decode ? range : toMultiArray(decode); + const samples = this.getSampleArray(size, outputSize, bps, fn); + return function constructSampledFn(src, srcOffset, dest, destOffset) { + const cubeVertices = 1 << inputSize; + const cubeN = new Float64Array(cubeVertices); + const cubeVertex = new Uint32Array(cubeVertices); + let i, j; + for (j = 0; j < cubeVertices; j++) { + cubeN[j] = 1; + } + let k = outputSize, + pos = 1; + for (i = 0; i < inputSize; ++i) { + const domain_2i = domain[i][0]; + const domain_2i_1 = domain[i][1]; + const xi = Math.min( + Math.max(src[srcOffset + i], domain_2i), + domain_2i_1, ); - const n = o[u]; - r = Math.min(Math.max(r, 0), n - 1); - const g = r < n - 1 ? Math.floor(r) : r - 1, - l = g + 1 - r, - Q = r - g, - m = g * f, - y = m + f; - for (d = 0; d < c; d++) - if (d & p) { - C[d] *= Q; - E[d] += y; + let e = interpolate( + xi, + domain_2i, + domain_2i_1, + encode[i][0], + encode[i][1], + ); + const size_i = size[i]; + e = Math.min(Math.max(e, 0), size_i - 1); + const e0 = e < size_i - 1 ? Math.floor(e) : e - 1; + const n0 = e0 + 1 - e; + const n1 = e - e0; + const offset0 = e0 * k; + const offset1 = offset0 + k; + for (j = 0; j < cubeVertices; j++) { + if (j & pos) { + cubeN[j] *= n1; + cubeVertex[j] += offset1; } else { - C[d] *= l; - E[d] += m; + cubeN[j] *= n0; + cubeVertex[j] += offset0; } - f *= n; - p <<= 1; + } + k *= size_i; + pos <<= 1; } - for (d = 0; d < g; ++d) { - let e = 0; - for (u = 0; u < c; u++) e += Q[E[u] + d] * C[u]; - e = interpolate(e, 0, 1, l[d][0], l[d][1]); - i[a + d] = Math.min(Math.max(e, r[d][0]), r[d][1]); + for (j = 0; j < outputSize; ++j) { + let rj = 0; + for (i = 0; i < cubeVertices; i++) { + rj += samples[cubeVertex[i] + j] * cubeN[i]; + } + rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); + dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]); } }; } - static constructInterpolated({ xref: e, isEvalSupported: t, dict: i }) { - const a = toNumberArray(i.getArray("C0")) || [0], - s = toNumberArray(i.getArray("C1")) || [1], - r = i.get("N"), - n = []; - for (let e = 0, t = a.length; e < t; ++e) n.push(s[e] - a[e]); - const g = n.length; - return function constructInterpolatedFn(e, t, i, s) { - const o = 1 === r ? e[t] : e[t] ** r; - for (let e = 0; e < g; ++e) i[s + e] = a[e] + o * n[e]; + static constructInterpolated({ xref, isEvalSupported, dict }) { + const c0 = toNumberArray(dict.getArray("C0")) || [0]; + const c1 = toNumberArray(dict.getArray("C1")) || [1]; + const n = dict.get("N"); + const diff = []; + for (let i = 0, ii = c0.length; i < ii; ++i) { + diff.push(c1[i] - c0[i]); + } + const length = diff.length; + return function constructInterpolatedFn(src, srcOffset, dest, destOffset) { + const x = n === 1 ? src[srcOffset] : src[srcOffset] ** n; + for (let j = 0; j < length; ++j) { + dest[destOffset + j] = c0[j] + x * diff[j]; + } }; } - static constructStiched({ xref: e, isEvalSupported: t, dict: i }) { - const a = toNumberArray(i.getArray("Domain")); - if (!a) throw new FormatError("No domain"); - if (1 !== a.length / 2) + static constructStiched({ xref, isEvalSupported, dict }) { + const domain = toNumberArray(dict.getArray("Domain")); + if (!domain) { + throw new FormatError("No domain"); + } + const inputSize = domain.length / 2; + if (inputSize !== 1) { throw new FormatError("Bad domain for stiched function"); - const s = []; - for (const a of i.get("Functions")) - s.push(this.parse({ xref: e, isEvalSupported: t, fn: e.fetchIfRef(a) })); - const r = toNumberArray(i.getArray("Bounds")), - n = toNumberArray(i.getArray("Encode")), - g = new Float32Array(1); - return function constructStichedFn(e, t, i, o) { - const c = (function constructStichedFromIRClip(e, t, i) { - e > i ? (e = i) : e < t && (e = t); - return e; - })(e[t], a[0], a[1]), - C = r.length; - let h; - for (h = 0; h < C && !(c < r[h]); ++h); - let l = a[0]; - h > 0 && (l = r[h - 1]); - let Q = a[1]; - h < r.length && (Q = r[h]); - const E = n[2 * h], - u = n[2 * h + 1]; - g[0] = l === Q ? E : E + ((c - l) * (u - E)) / (Q - l); - s[h](g, 0, i, o); + } + const fns = []; + for (const fn of dict.get("Functions")) { + fns.push( + this.parse({ + xref, + isEvalSupported, + fn: xref.fetchIfRef(fn), + }), + ); + } + const bounds = toNumberArray(dict.getArray("Bounds")); + const encode = toNumberArray(dict.getArray("Encode")); + const tmpBuf = new Float32Array(1); + return function constructStichedFn(src, srcOffset, dest, destOffset) { + const clip = function constructStichedFromIRClip(v, min, max) { + if (v > max) { + v = max; + } else if (v < min) { + v = min; + } + return v; + }; + const v = clip(src[srcOffset], domain[0], domain[1]); + const length = bounds.length; + let i; + for (i = 0; i < length; ++i) { + if (v < bounds[i]) { + break; + } + } + let dmin = domain[0]; + if (i > 0) { + dmin = bounds[i - 1]; + } + let dmax = domain[1]; + if (i < bounds.length) { + dmax = bounds[i]; + } + const rmin = encode[2 * i]; + const rmax = encode[2 * i + 1]; + tmpBuf[0] = + dmin === dmax + ? rmin + : rmin + ((v - dmin) * (rmax - rmin)) / (dmax - dmin); + fns[i](tmpBuf, 0, dest, destOffset); }; } - static constructPostScript({ xref: e, isEvalSupported: t, fn: i, dict: a }) { - const s = toNumberArray(a.getArray("Domain")), - r = toNumberArray(a.getArray("Range")); - if (!s) throw new FormatError("No domain."); - if (!r) throw new FormatError("No range."); - const n = new PostScriptLexer(i), - g = new PostScriptParser(n).parse(); - if (t && FeatureTest.isEvalSupported) { - const e = new PostScriptCompiler().compile(g, s, r); - if (e) return new Function("src", "srcOffset", "dest", "destOffset", e); + static constructPostScript({ xref, isEvalSupported, fn, dict }) { + const domain = toNumberArray(dict.getArray("Domain")); + const range = toNumberArray(dict.getArray("Range")); + if (!domain) { + throw new FormatError("No domain."); + } + if (!range) { + throw new FormatError("No range."); + } + const lexer = new PostScriptLexer(fn); + const parser = new PostScriptParser(lexer); + const code = parser.parse(); + if (isEvalSupported && FeatureTest.isEvalSupported) { + const compiled = new PostScriptCompiler().compile(code, domain, range); + if (compiled) { + return new Function("src", "srcOffset", "dest", "destOffset", compiled); + } } info("Unable to compile PS function"); - const o = r.length >> 1, - c = s.length >> 1, - C = new PostScriptEvaluator(g), - h = Object.create(null); - let l = 8192; - const Q = new Float32Array(c); - return function constructPostScriptFn(e, t, i, a) { - let s, - n, - g = ""; - const E = Q; - for (s = 0; s < c; s++) { - n = e[t + s]; - E[s] = n; - g += n + "_"; + const numOutputs = range.length >> 1; + const numInputs = domain.length >> 1; + const evaluator = new PostScriptEvaluator(code); + const cache = Object.create(null); + const MAX_CACHE_SIZE = 2048 * 4; + let cache_available = MAX_CACHE_SIZE; + const tmpBuf = new Float32Array(numInputs); + return function constructPostScriptFn(src, srcOffset, dest, destOffset) { + let i, value; + let key = ""; + const input = tmpBuf; + for (i = 0; i < numInputs; i++) { + value = src[srcOffset + i]; + input[i] = value; + key += value + "_"; } - const u = h[g]; - if (void 0 !== u) { - i.set(u, a); + const cachedValue = cache[key]; + if (cachedValue !== undefined) { + dest.set(cachedValue, destOffset); return; } - const d = new Float32Array(o), - f = C.execute(E), - p = f.length - o; - for (s = 0; s < o; s++) { - n = f[p + s]; - let e = r[2 * s]; - if (n < e) n = e; - else { - e = r[2 * s + 1]; - n > e && (n = e); + const output = new Float32Array(numOutputs); + const stack = evaluator.execute(input); + const stackIndex = stack.length - numOutputs; + for (i = 0; i < numOutputs; i++) { + value = stack[stackIndex + i]; + let bound = range[i * 2]; + if (value < bound) { + value = bound; + } else { + bound = range[i * 2 + 1]; + if (value > bound) { + value = bound; + } } - d[s] = n; + output[i] = value; } - if (l > 0) { - l--; - h[g] = d; + if (cache_available > 0) { + cache_available--; + cache[key] = output; } - i.set(d, a); + dest.set(output, destOffset); }; } } -function isPDFFunction(e) { - let t; - if (e instanceof Dict) t = e; - else { - if (!(e instanceof BaseStream)) return !1; - t = e.dict; +function isPDFFunction(v) { + let fnDict; + if (v instanceof Dict) { + fnDict = v; + } else if (v instanceof BaseStream) { + fnDict = v.dict; + } else { + return false; } - return t.has("FunctionType"); + return fnDict.has("FunctionType"); } class PostScriptStack { static MAX_STACK_SIZE = 100; - constructor(e) { - this.stack = e ? Array.from(e) : []; + constructor(initialStack) { + this.stack = initialStack ? Array.from(initialStack) : []; } - push(e) { - if (this.stack.length >= PostScriptStack.MAX_STACK_SIZE) + push(value) { + if (this.stack.length >= PostScriptStack.MAX_STACK_SIZE) { throw new Error("PostScript function stack overflow."); - this.stack.push(e); + } + this.stack.push(value); } pop() { - if (this.stack.length <= 0) + if (this.stack.length <= 0) { throw new Error("PostScript function stack underflow."); + } return this.stack.pop(); } - copy(e) { - if (this.stack.length + e >= PostScriptStack.MAX_STACK_SIZE) + copy(n) { + if (this.stack.length + n >= PostScriptStack.MAX_STACK_SIZE) { throw new Error("PostScript function stack overflow."); - const t = this.stack; - for (let i = t.length - e, a = e - 1; a >= 0; a--, i++) t.push(t[i]); - } - index(e) { - this.push(this.stack[this.stack.length - e - 1]); - } - roll(e, t) { - const i = this.stack, - a = i.length - e, - s = i.length - 1, - r = a + (t - Math.floor(t / e) * e); - for (let e = a, t = s; e < t; e++, t--) { - const a = i[e]; - i[e] = i[t]; - i[t] = a; } - for (let e = a, t = r - 1; e < t; e++, t--) { - const a = i[e]; - i[e] = i[t]; - i[t] = a; + const stack = this.stack; + for (let i = stack.length - n, j = n - 1; j >= 0; j--, i++) { + stack.push(stack[i]); } - for (let e = r, t = s; e < t; e++, t--) { - const a = i[e]; - i[e] = i[t]; - i[t] = a; + } + index(n) { + this.push(this.stack[this.stack.length - n - 1]); + } + roll(n, p) { + const stack = this.stack; + const l = stack.length - n; + const r = stack.length - 1; + const c = l + (p - Math.floor(p / n) * n); + for (let i = l, j = r; i < j; i++, j--) { + const t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + for (let i = l, j = c - 1; i < j; i++, j--) { + const t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + for (let i = c, j = r; i < j; i++, j--) { + const t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; } } } class PostScriptEvaluator { - constructor(e) { - this.operators = e; + constructor(operators) { + this.operators = operators; } - execute(e) { - const t = new PostScriptStack(e); - let i = 0; - const a = this.operators, - s = a.length; - let r, n, g; - for (; i < s; ) { - r = a[i++]; - if ("number" != typeof r) - switch (r) { - case "jz": - g = t.pop(); - n = t.pop(); - n || (i = g); - break; - case "j": - n = t.pop(); - i = n; - break; - case "abs": - n = t.pop(); - t.push(Math.abs(n)); - break; - case "add": - g = t.pop(); - n = t.pop(); - t.push(n + g); - break; - case "and": - g = t.pop(); - n = t.pop(); - "boolean" == typeof n && "boolean" == typeof g - ? t.push(n && g) - : t.push(n & g); - break; - case "atan": - g = t.pop(); - n = t.pop(); - n = (Math.atan2(n, g) / Math.PI) * 180; - n < 0 && (n += 360); - t.push(n); - break; - case "bitshift": - g = t.pop(); - n = t.pop(); - n > 0 ? t.push(n << g) : t.push(n >> g); - break; - case "ceiling": - n = t.pop(); - t.push(Math.ceil(n)); - break; - case "copy": - n = t.pop(); - t.copy(n); - break; - case "cos": - n = t.pop(); - t.push(Math.cos(((n % 360) / 180) * Math.PI)); - break; - case "cvi": - n = 0 | t.pop(); - t.push(n); - break; - case "cvr": - break; - case "div": - g = t.pop(); - n = t.pop(); - t.push(n / g); - break; - case "dup": - t.copy(1); - break; - case "eq": - g = t.pop(); - n = t.pop(); - t.push(n === g); - break; - case "exch": - t.roll(2, 1); - break; - case "exp": - g = t.pop(); - n = t.pop(); - t.push(n ** g); - break; - case "false": - t.push(!1); - break; - case "floor": - n = t.pop(); - t.push(Math.floor(n)); - break; - case "ge": - g = t.pop(); - n = t.pop(); - t.push(n >= g); - break; - case "gt": - g = t.pop(); - n = t.pop(); - t.push(n > g); - break; - case "idiv": - g = t.pop(); - n = t.pop(); - t.push((n / g) | 0); - break; - case "index": - n = t.pop(); - t.index(n); - break; - case "le": - g = t.pop(); - n = t.pop(); - t.push(n <= g); - break; - case "ln": - n = t.pop(); - t.push(Math.log(n)); - break; - case "log": - n = t.pop(); - t.push(Math.log10(n)); - break; - case "lt": - g = t.pop(); - n = t.pop(); - t.push(n < g); - break; - case "mod": - g = t.pop(); - n = t.pop(); - t.push(n % g); - break; - case "mul": - g = t.pop(); - n = t.pop(); - t.push(n * g); - break; - case "ne": - g = t.pop(); - n = t.pop(); - t.push(n !== g); - break; - case "neg": - n = t.pop(); - t.push(-n); - break; - case "not": - n = t.pop(); - "boolean" == typeof n ? t.push(!n) : t.push(~n); - break; - case "or": - g = t.pop(); - n = t.pop(); - "boolean" == typeof n && "boolean" == typeof g - ? t.push(n || g) - : t.push(n | g); - break; - case "pop": - t.pop(); - break; - case "roll": - g = t.pop(); - n = t.pop(); - t.roll(n, g); - break; - case "round": - n = t.pop(); - t.push(Math.round(n)); - break; - case "sin": - n = t.pop(); - t.push(Math.sin(((n % 360) / 180) * Math.PI)); - break; - case "sqrt": - n = t.pop(); - t.push(Math.sqrt(n)); - break; - case "sub": - g = t.pop(); - n = t.pop(); - t.push(n - g); - break; - case "true": - t.push(!0); - break; - case "truncate": - n = t.pop(); - n = n < 0 ? Math.ceil(n) : Math.floor(n); - t.push(n); - break; - case "xor": - g = t.pop(); - n = t.pop(); - "boolean" == typeof n && "boolean" == typeof g - ? t.push(n !== g) - : t.push(n ^ g); - break; - default: - throw new FormatError(`Unknown operator ${r}`); - } - else t.push(r); + execute(initialStack) { + const stack = new PostScriptStack(initialStack); + let counter = 0; + const operators = this.operators; + const length = operators.length; + let operator, a, b; + while (counter < length) { + operator = operators[counter++]; + if (typeof operator === "number") { + stack.push(operator); + continue; + } + switch (operator) { + case "jz": + b = stack.pop(); + a = stack.pop(); + if (!a) { + counter = b; + } + break; + case "j": + a = stack.pop(); + counter = a; + break; + case "abs": + a = stack.pop(); + stack.push(Math.abs(a)); + break; + case "add": + b = stack.pop(); + a = stack.pop(); + stack.push(a + b); + break; + case "and": + b = stack.pop(); + a = stack.pop(); + if (typeof a === "boolean" && typeof b === "boolean") { + stack.push(a && b); + } else { + stack.push(a & b); + } + break; + case "atan": + b = stack.pop(); + a = stack.pop(); + a = (Math.atan2(a, b) / Math.PI) * 180; + if (a < 0) { + a += 360; + } + stack.push(a); + break; + case "bitshift": + b = stack.pop(); + a = stack.pop(); + if (a > 0) { + stack.push(a << b); + } else { + stack.push(a >> b); + } + break; + case "ceiling": + a = stack.pop(); + stack.push(Math.ceil(a)); + break; + case "copy": + a = stack.pop(); + stack.copy(a); + break; + case "cos": + a = stack.pop(); + stack.push(Math.cos(((a % 360) / 180) * Math.PI)); + break; + case "cvi": + a = stack.pop() | 0; + stack.push(a); + break; + case "cvr": + break; + case "div": + b = stack.pop(); + a = stack.pop(); + stack.push(a / b); + break; + case "dup": + stack.copy(1); + break; + case "eq": + b = stack.pop(); + a = stack.pop(); + stack.push(a === b); + break; + case "exch": + stack.roll(2, 1); + break; + case "exp": + b = stack.pop(); + a = stack.pop(); + stack.push(a ** b); + break; + case "false": + stack.push(false); + break; + case "floor": + a = stack.pop(); + stack.push(Math.floor(a)); + break; + case "ge": + b = stack.pop(); + a = stack.pop(); + stack.push(a >= b); + break; + case "gt": + b = stack.pop(); + a = stack.pop(); + stack.push(a > b); + break; + case "idiv": + b = stack.pop(); + a = stack.pop(); + stack.push((a / b) | 0); + break; + case "index": + a = stack.pop(); + stack.index(a); + break; + case "le": + b = stack.pop(); + a = stack.pop(); + stack.push(a <= b); + break; + case "ln": + a = stack.pop(); + stack.push(Math.log(a)); + break; + case "log": + a = stack.pop(); + stack.push(Math.log10(a)); + break; + case "lt": + b = stack.pop(); + a = stack.pop(); + stack.push(a < b); + break; + case "mod": + b = stack.pop(); + a = stack.pop(); + stack.push(a % b); + break; + case "mul": + b = stack.pop(); + a = stack.pop(); + stack.push(a * b); + break; + case "ne": + b = stack.pop(); + a = stack.pop(); + stack.push(a !== b); + break; + case "neg": + a = stack.pop(); + stack.push(-a); + break; + case "not": + a = stack.pop(); + if (typeof a === "boolean") { + stack.push(!a); + } else { + stack.push(~a); + } + break; + case "or": + b = stack.pop(); + a = stack.pop(); + if (typeof a === "boolean" && typeof b === "boolean") { + stack.push(a || b); + } else { + stack.push(a | b); + } + break; + case "pop": + stack.pop(); + break; + case "roll": + b = stack.pop(); + a = stack.pop(); + stack.roll(a, b); + break; + case "round": + a = stack.pop(); + stack.push(Math.round(a)); + break; + case "sin": + a = stack.pop(); + stack.push(Math.sin(((a % 360) / 180) * Math.PI)); + break; + case "sqrt": + a = stack.pop(); + stack.push(Math.sqrt(a)); + break; + case "sub": + b = stack.pop(); + a = stack.pop(); + stack.push(a - b); + break; + case "true": + stack.push(true); + break; + case "truncate": + a = stack.pop(); + a = a < 0 ? Math.ceil(a) : Math.floor(a); + stack.push(a); + break; + case "xor": + b = stack.pop(); + a = stack.pop(); + if (typeof a === "boolean" && typeof b === "boolean") { + stack.push(a !== b); + } else { + stack.push(a ^ b); + } + break; + default: + throw new FormatError(`Unknown operator ${operator}`); + } } - return t.stack; + return stack.stack; } } class AstNode { - constructor(e) { - this.type = e; + constructor(type) { + this.type = type; } - visit(e) { + visit(visitor) { unreachable("abstract method"); } } class AstArgument extends AstNode { - constructor(e, t, i) { + constructor(index, min, max) { super("args"); - this.index = e; - this.min = t; - this.max = i; + this.index = index; + this.min = min; + this.max = max; } - visit(e) { - e.visitArgument(this); + visit(visitor) { + visitor.visitArgument(this); } } class AstLiteral extends AstNode { - constructor(e) { + constructor(number) { super("literal"); - this.number = e; - this.min = e; - this.max = e; + this.number = number; + this.min = number; + this.max = number; } - visit(e) { - e.visitLiteral(this); + visit(visitor) { + visitor.visitLiteral(this); } } class AstBinaryOperation extends AstNode { - constructor(e, t, i, a, s) { + constructor(op, arg1, arg2, min, max) { super("binary"); - this.op = e; - this.arg1 = t; - this.arg2 = i; - this.min = a; - this.max = s; + this.op = op; + this.arg1 = arg1; + this.arg2 = arg2; + this.min = min; + this.max = max; } - visit(e) { - e.visitBinaryOperation(this); + visit(visitor) { + visitor.visitBinaryOperation(this); } } class AstMin extends AstNode { - constructor(e, t) { + constructor(arg, max) { super("max"); - this.arg = e; - this.min = e.min; - this.max = t; + this.arg = arg; + this.min = arg.min; + this.max = max; } - visit(e) { - e.visitMin(this); + visit(visitor) { + visitor.visitMin(this); } } class AstVariable extends AstNode { - constructor(e, t, i) { + constructor(index, min, max) { super("var"); - this.index = e; - this.min = t; - this.max = i; + this.index = index; + this.min = min; + this.max = max; } - visit(e) { - e.visitVariable(this); + visit(visitor) { + visitor.visitVariable(this); } } class AstVariableDefinition extends AstNode { - constructor(e, t) { + constructor(variable, arg) { super("definition"); - this.variable = e; - this.arg = t; + this.variable = variable; + this.arg = arg; } - visit(e) { - e.visitVariableDefinition(this); + visit(visitor) { + visitor.visitVariableDefinition(this); } } class ExpressionBuilderVisitor { constructor() { this.parts = []; } - visitArgument(e) { + visitArgument(arg) { this.parts.push( "Math.max(", - e.min, + arg.min, ", Math.min(", - e.max, + arg.max, ", src[srcOffset + ", - e.index, + arg.index, "]))", ); } - visitVariable(e) { - this.parts.push("v", e.index); + visitVariable(variable) { + this.parts.push("v", variable.index); } - visitLiteral(e) { - this.parts.push(e.number); + visitLiteral(literal) { + this.parts.push(literal.number); } - visitBinaryOperation(e) { + visitBinaryOperation(operation) { this.parts.push("("); - e.arg1.visit(this); - this.parts.push(" ", e.op, " "); - e.arg2.visit(this); + operation.arg1.visit(this); + this.parts.push(" ", operation.op, " "); + operation.arg2.visit(this); this.parts.push(")"); } - visitVariableDefinition(e) { + visitVariableDefinition(definition) { this.parts.push("var "); - e.variable.visit(this); + definition.variable.visit(this); this.parts.push(" = "); - e.arg.visit(this); + definition.arg.visit(this); this.parts.push(";"); } - visitMin(e) { + visitMin(max) { this.parts.push("Math.min("); - e.arg.visit(this); - this.parts.push(", ", e.max, ")"); + max.arg.visit(this); + this.parts.push(", ", max.max, ")"); } toString() { return this.parts.join(""); } } -function buildAddOperation(e, t) { - return "literal" === t.type && 0 === t.number - ? e - : "literal" === e.type && 0 === e.number - ? t - : "literal" === t.type && "literal" === e.type - ? new AstLiteral(e.number + t.number) - : new AstBinaryOperation("+", e, t, e.min + t.min, e.max + t.max); -} -function buildMulOperation(e, t) { - if ("literal" === t.type) { - if (0 === t.number) return new AstLiteral(0); - if (1 === t.number) return e; - if ("literal" === e.type) return new AstLiteral(e.number * t.number); +function buildAddOperation(num1, num2) { + if (num2.type === "literal" && num2.number === 0) { + return num1; } - if ("literal" === e.type) { - if (0 === e.number) return new AstLiteral(0); - if (1 === e.number) return t; + if (num1.type === "literal" && num1.number === 0) { + return num2; } - const i = Math.min( - e.min * t.min, - e.min * t.max, - e.max * t.min, - e.max * t.max, - ), - a = Math.max(e.min * t.min, e.min * t.max, e.max * t.min, e.max * t.max); - return new AstBinaryOperation("*", e, t, i, a); -} -function buildSubOperation(e, t) { - if ("literal" === t.type) { - if (0 === t.number) return e; - if ("literal" === e.type) return new AstLiteral(e.number - t.number); + if (num2.type === "literal" && num1.type === "literal") { + return new AstLiteral(num1.number + num2.number); } - return "binary" === t.type && - "-" === t.op && - "literal" === e.type && - 1 === e.number && - "literal" === t.arg1.type && - 1 === t.arg1.number - ? t.arg2 - : new AstBinaryOperation("-", e, t, e.min - t.max, e.max - t.min); + return new AstBinaryOperation( + "+", + num1, + num2, + num1.min + num2.min, + num1.max + num2.max, + ); } -function buildMinOperation(e, t) { - return e.min >= t ? new AstLiteral(t) : e.max <= t ? e : new AstMin(e, t); +function buildMulOperation(num1, num2) { + if (num2.type === "literal") { + if (num2.number === 0) { + return new AstLiteral(0); + } else if (num2.number === 1) { + return num1; + } else if (num1.type === "literal") { + return new AstLiteral(num1.number * num2.number); + } + } + if (num1.type === "literal") { + if (num1.number === 0) { + return new AstLiteral(0); + } else if (num1.number === 1) { + return num2; + } + } + const min = Math.min( + num1.min * num2.min, + num1.min * num2.max, + num1.max * num2.min, + num1.max * num2.max, + ); + const max = Math.max( + num1.min * num2.min, + num1.min * num2.max, + num1.max * num2.min, + num1.max * num2.max, + ); + return new AstBinaryOperation("*", num1, num2, min, max); +} +function buildSubOperation(num1, num2) { + if (num2.type === "literal") { + if (num2.number === 0) { + return num1; + } else if (num1.type === "literal") { + return new AstLiteral(num1.number - num2.number); + } + } + if ( + num2.type === "binary" && + num2.op === "-" && + num1.type === "literal" && + num1.number === 1 && + num2.arg1.type === "literal" && + num2.arg1.number === 1 + ) { + return num2.arg2; + } + return new AstBinaryOperation( + "-", + num1, + num2, + num1.min - num2.max, + num1.max - num2.min, + ); +} +function buildMinOperation(num1, max) { + if (num1.min >= max) { + return new AstLiteral(max); + } else if (num1.max <= max) { + return num1; + } + return new AstMin(num1, max); } class PostScriptCompiler { - compile(e, t, i) { - const a = [], - s = [], - r = t.length >> 1, - n = i.length >> 1; - let g, - o, - c, - C, - h, - l, - Q, - E, - u = 0; - for (let e = 0; e < r; e++) - a.push(new AstArgument(e, t[2 * e], t[2 * e + 1])); - for (let t = 0, i = e.length; t < i; t++) { - E = e[t]; - if ("number" != typeof E) - switch (E) { - case "add": - if (a.length < 2) return null; - C = a.pop(); - c = a.pop(); - a.push(buildAddOperation(c, C)); - break; - case "cvr": - if (a.length < 1) return null; - break; - case "mul": - if (a.length < 2) return null; - C = a.pop(); - c = a.pop(); - a.push(buildMulOperation(c, C)); - break; - case "sub": - if (a.length < 2) return null; - C = a.pop(); - c = a.pop(); - a.push(buildSubOperation(c, C)); - break; - case "exch": - if (a.length < 2) return null; - h = a.pop(); - l = a.pop(); - a.push(h, l); - break; - case "pop": - if (a.length < 1) return null; - a.pop(); - break; - case "index": - if (a.length < 1) return null; - c = a.pop(); - if ("literal" !== c.type) return null; - g = c.number; - if (g < 0 || !Number.isInteger(g) || a.length < g) return null; - h = a[a.length - g - 1]; - if ("literal" === h.type || "var" === h.type) { - a.push(h); - break; - } - Q = new AstVariable(u++, h.min, h.max); - a[a.length - g - 1] = Q; - a.push(Q); - s.push(new AstVariableDefinition(Q, h)); - break; - case "dup": - if (a.length < 1) return null; - if ( - "number" == typeof e[t + 1] && - "gt" === e[t + 2] && - e[t + 3] === t + 7 && - "jz" === e[t + 4] && - "pop" === e[t + 5] && - e[t + 6] === e[t + 1] - ) { - c = a.pop(); - a.push(buildMinOperation(c, e[t + 1])); - t += 6; - break; - } - h = a.at(-1); - if ("literal" === h.type || "var" === h.type) { - a.push(h); - break; - } - Q = new AstVariable(u++, h.min, h.max); - a[a.length - 1] = Q; - a.push(Q); - s.push(new AstVariableDefinition(Q, h)); - break; - case "roll": - if (a.length < 2) return null; - C = a.pop(); - c = a.pop(); - if ("literal" !== C.type || "literal" !== c.type) return null; - o = C.number; - g = c.number; - if ( - g <= 0 || - !Number.isInteger(g) || - !Number.isInteger(o) || - a.length < g - ) - return null; - o = ((o % g) + g) % g; - if (0 === o) break; - a.push(...a.splice(a.length - g, g - o)); - break; - default: + compile(code, domain, range) { + const stack = []; + const instructions = []; + const inputSize = domain.length >> 1, + outputSize = range.length >> 1; + let lastRegister = 0; + let n, j; + let num1, num2, ast1, ast2, tmpVar, item; + for (let i = 0; i < inputSize; i++) { + stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); + } + for (let i = 0, ii = code.length; i < ii; i++) { + item = code[i]; + if (typeof item === "number") { + stack.push(new AstLiteral(item)); + continue; + } + switch (item) { + case "add": + if (stack.length < 2) { return null; - } - else a.push(new AstLiteral(E)); - } - if (a.length !== n) return null; - const d = []; - for (const e of s) { - const t = new ExpressionBuilderVisitor(); - e.visit(t); - d.push(t.toString()); - } - for (let e = 0, t = a.length; e < t; e++) { - const t = a[e], - s = new ExpressionBuilderVisitor(); - t.visit(s); - const r = i[2 * e], - n = i[2 * e + 1], - g = [s.toString()]; - if (r > t.min) { - g.unshift("Math.max(", r, ", "); - g.push(")"); + } + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildAddOperation(num1, num2)); + break; + case "cvr": + if (stack.length < 1) { + return null; + } + break; + case "mul": + if (stack.length < 2) { + return null; + } + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildMulOperation(num1, num2)); + break; + case "sub": + if (stack.length < 2) { + return null; + } + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildSubOperation(num1, num2)); + break; + case "exch": + if (stack.length < 2) { + return null; + } + ast1 = stack.pop(); + ast2 = stack.pop(); + stack.push(ast1, ast2); + break; + case "pop": + if (stack.length < 1) { + return null; + } + stack.pop(); + break; + case "index": + if (stack.length < 1) { + return null; + } + num1 = stack.pop(); + if (num1.type !== "literal") { + return null; + } + n = num1.number; + if (n < 0 || !Number.isInteger(n) || stack.length < n) { + return null; + } + ast1 = stack[stack.length - n - 1]; + if (ast1.type === "literal" || ast1.type === "var") { + stack.push(ast1); + break; + } + tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); + stack[stack.length - n - 1] = tmpVar; + stack.push(tmpVar); + instructions.push(new AstVariableDefinition(tmpVar, ast1)); + break; + case "dup": + if (stack.length < 1) { + return null; + } + if ( + typeof code[i + 1] === "number" && + code[i + 2] === "gt" && + code[i + 3] === i + 7 && + code[i + 4] === "jz" && + code[i + 5] === "pop" && + code[i + 6] === code[i + 1] + ) { + num1 = stack.pop(); + stack.push(buildMinOperation(num1, code[i + 1])); + i += 6; + break; + } + ast1 = stack.at(-1); + if (ast1.type === "literal" || ast1.type === "var") { + stack.push(ast1); + break; + } + tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); + stack[stack.length - 1] = tmpVar; + stack.push(tmpVar); + instructions.push(new AstVariableDefinition(tmpVar, ast1)); + break; + case "roll": + if (stack.length < 2) { + return null; + } + num2 = stack.pop(); + num1 = stack.pop(); + if (num2.type !== "literal" || num1.type !== "literal") { + return null; + } + j = num2.number; + n = num1.number; + if ( + n <= 0 || + !Number.isInteger(n) || + !Number.isInteger(j) || + stack.length < n + ) { + return null; + } + j = ((j % n) + n) % n; + if (j === 0) { + break; + } + stack.push(...stack.splice(stack.length - n, n - j)); + break; + default: + return null; } - if (n < t.max) { - g.unshift("Math.min(", n, ", "); - g.push(")"); - } - g.unshift("dest[destOffset + ", e, "] = "); - g.push(";"); - d.push(g.join("")); } - return d.join("\n"); + if (stack.length !== outputSize) { + return null; + } + const result = []; + for (const instruction of instructions) { + const statementBuilder = new ExpressionBuilderVisitor(); + instruction.visit(statementBuilder); + result.push(statementBuilder.toString()); + } + for (let i = 0, ii = stack.length; i < ii; i++) { + const expr = stack[i], + statementBuilder = new ExpressionBuilderVisitor(); + expr.visit(statementBuilder); + const min = range[i * 2], + max = range[i * 2 + 1]; + const out = [statementBuilder.toString()]; + if (min > expr.min) { + out.unshift("Math.max(", min, ", "); + out.push(")"); + } + if (max < expr.max) { + out.unshift("Math.min(", max, ", "); + out.push(")"); + } + out.unshift("dest[destOffset + ", i, "] = "); + out.push(";"); + result.push(out.join("")); + } + return result.join("\n"); + } +} // ./src/core/bidi.js + +const baseTypes = [ + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "S", + "B", + "S", + "WS", + "B", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "B", + "B", + "B", + "S", + "WS", + "ON", + "ON", + "ET", + "ET", + "ET", + "ON", + "ON", + "ON", + "ON", + "ON", + "ES", + "CS", + "ES", + "CS", + "CS", + "EN", + "EN", + "EN", + "EN", + "EN", + "EN", + "EN", + "EN", + "EN", + "EN", + "CS", + "ON", + "ON", + "ON", + "ON", + "ON", + "ON", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "ON", + "ON", + "ON", + "ON", + "ON", + "ON", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "ON", + "ON", + "ON", + "ON", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "B", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "BN", + "CS", + "ON", + "ET", + "ET", + "ET", + "ET", + "ON", + "ON", + "ON", + "ON", + "L", + "ON", + "ON", + "BN", + "ON", + "ON", + "ET", + "ET", + "EN", + "EN", + "ON", + "L", + "ON", + "ON", + "ON", + "EN", + "L", + "ON", + "ON", + "ON", + "ON", + "ON", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "ON", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "ON", + "L", + "L", + "L", + "L", + "L", + "L", + "L", + "L", +]; +const arabicTypes = [ + "AN", + "AN", + "AN", + "AN", + "AN", + "AN", + "ON", + "ON", + "AL", + "ET", + "ET", + "AL", + "CS", + "AL", + "ON", + "ON", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "AL", + "AL", + "", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "AN", + "AN", + "AN", + "AN", + "AN", + "AN", + "AN", + "AN", + "AN", + "AN", + "ET", + "AN", + "AN", + "AL", + "AL", + "AL", + "NSM", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "AN", + "ON", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "NSM", + "AL", + "AL", + "NSM", + "NSM", + "ON", + "NSM", + "NSM", + "NSM", + "NSM", + "AL", + "AL", + "EN", + "EN", + "EN", + "EN", + "EN", + "EN", + "EN", + "EN", + "EN", + "EN", + "AL", + "AL", + "AL", + "AL", + "AL", + "AL", +]; +function isOdd(i) { + return (i & 1) !== 0; +} +function isEven(i) { + return (i & 1) === 0; +} +function findUnequal(arr, start, value) { + let j, jj; + for (j = start, jj = arr.length; j < jj; ++j) { + if (arr[j] !== value) { + return j; + } + } + return j; +} +function setValues(arr, start, end, value) { + for (let j = start; j < end; ++j) { + arr[j] = value; } } -const Cs = [ - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "S", - "B", - "S", - "WS", - "B", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "B", - "B", - "B", - "S", - "WS", - "ON", - "ON", - "ET", - "ET", - "ET", - "ON", - "ON", - "ON", - "ON", - "ON", - "ES", - "CS", - "ES", - "CS", - "CS", - "EN", - "EN", - "EN", - "EN", - "EN", - "EN", - "EN", - "EN", - "EN", - "EN", - "CS", - "ON", - "ON", - "ON", - "ON", - "ON", - "ON", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "ON", - "ON", - "ON", - "ON", - "ON", - "ON", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "ON", - "ON", - "ON", - "ON", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "B", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "BN", - "CS", - "ON", - "ET", - "ET", - "ET", - "ET", - "ON", - "ON", - "ON", - "ON", - "L", - "ON", - "ON", - "BN", - "ON", - "ON", - "ET", - "ET", - "EN", - "EN", - "ON", - "L", - "ON", - "ON", - "ON", - "EN", - "L", - "ON", - "ON", - "ON", - "ON", - "ON", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "ON", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "ON", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - "L", - ], - hs = [ - "AN", - "AN", - "AN", - "AN", - "AN", - "AN", - "ON", - "ON", - "AL", - "ET", - "ET", - "AL", - "CS", - "AL", - "ON", - "ON", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "AL", - "AL", - "", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "AN", - "AN", - "AN", - "AN", - "AN", - "AN", - "AN", - "AN", - "AN", - "AN", - "ET", - "AN", - "AN", - "AL", - "AL", - "AL", - "NSM", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "AN", - "ON", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "NSM", - "AL", - "AL", - "NSM", - "NSM", - "ON", - "NSM", - "NSM", - "NSM", - "NSM", - "AL", - "AL", - "EN", - "EN", - "EN", - "EN", - "EN", - "EN", - "EN", - "EN", - "EN", - "EN", - "AL", - "AL", - "AL", - "AL", - "AL", - "AL", - ]; -function isOdd(e) { - return 0 != (1 & e); -} -function isEven(e) { - return 0 == (1 & e); -} -function findUnequal(e, t, i) { - let a, s; - for (a = t, s = e.length; a < s; ++a) if (e[a] !== i) return a; - return a; -} -function setValues(e, t, i, a) { - for (let s = t; s < i; ++s) e[s] = a; -} -function reverseValues(e, t, i) { - for (let a = t, s = i - 1; a < s; ++a, --s) { - const t = e[a]; - e[a] = e[s]; - e[s] = t; +function reverseValues(arr, start, end) { + for (let i = start, j = end - 1; i < j; ++i, --j) { + const temp = arr[i]; + arr[i] = arr[j]; + arr[j] = temp; } } -function createBidiText(e, t, i = !1) { - let a = "ltr"; - i ? (a = "ttb") : t || (a = "rtl"); - return { str: e, dir: a }; +function createBidiText(str, isLTR, vertical = false) { + let dir = "ltr"; + if (vertical) { + dir = "ttb"; + } else if (!isLTR) { + dir = "rtl"; + } + return { + str, + dir, + }; } -const Bs = [], - ls = []; -function bidi(e, t = -1, i = !1) { - let a = !0; - const s = e.length; - if (0 === s || i) return createBidiText(e, a, i); - Bs.length = s; - ls.length = s; - let r, - n, - g = 0; - for (r = 0; r < s; ++r) { - Bs[r] = e.charAt(r); - const t = e.charCodeAt(r); - let i = "L"; - if (t <= 255) i = Cs[t]; - else if (1424 <= t && t <= 1524) i = "R"; - else if (1536 <= t && t <= 1791) { - i = hs[255 & t]; - i || warn("Bidi: invalid Unicode character " + t.toString(16)); - } else - ((1792 <= t && t <= 2220) || - (64336 <= t && t <= 65023) || - (65136 <= t && t <= 65279)) && - (i = "AL"); - ("R" !== i && "AL" !== i && "AN" !== i) || g++; - ls[r] = i; +const chars = []; +const types = []; +function bidi(str, startLevel = -1, vertical = false) { + let isLTR = true; + const strLength = str.length; + if (strLength === 0 || vertical) { + return createBidiText(str, isLTR, vertical); } - if (0 === g) { - a = !0; - return createBidiText(e, a); + chars.length = strLength; + types.length = strLength; + let numBidi = 0; + let i, ii; + for (i = 0; i < strLength; ++i) { + chars[i] = str.charAt(i); + const charCode = str.charCodeAt(i); + let charType = "L"; + if (charCode <= 0x00ff) { + charType = baseTypes[charCode]; + } else if (0x0590 <= charCode && charCode <= 0x05f4) { + charType = "R"; + } else if (0x0600 <= charCode && charCode <= 0x06ff) { + charType = arabicTypes[charCode & 0xff]; + if (!charType) { + warn("Bidi: invalid Unicode character " + charCode.toString(16)); + } + } else if ( + (0x0700 <= charCode && charCode <= 0x08ac) || + (0xfb50 <= charCode && charCode <= 0xfdff) || + (0xfe70 <= charCode && charCode <= 0xfeff) + ) { + charType = "AL"; + } + if (charType === "R" || charType === "AL" || charType === "AN") { + numBidi++; + } + types[i] = charType; } - if (-1 === t) - if (g / s < 0.3 && s > 4) { - a = !0; - t = 0; + if (numBidi === 0) { + isLTR = true; + return createBidiText(str, isLTR); + } + if (startLevel === -1) { + if (numBidi / strLength < 0.3 && strLength > 4) { + isLTR = true; + startLevel = 0; } else { - a = !1; - t = 1; + isLTR = false; + startLevel = 1; } - const o = []; - for (r = 0; r < s; ++r) o[r] = t; - const c = isOdd(t) ? "R" : "L", - C = c, - h = C; - let l, - Q = C; - for (r = 0; r < s; ++r) "NSM" === ls[r] ? (ls[r] = Q) : (Q = ls[r]); - Q = C; - for (r = 0; r < s; ++r) { - l = ls[r]; - "EN" === l - ? (ls[r] = "AL" === Q ? "AN" : "EN") - : ("R" !== l && "L" !== l && "AL" !== l) || (Q = l); } - for (r = 0; r < s; ++r) { - l = ls[r]; - "AL" === l && (ls[r] = "R"); + const levels = []; + for (i = 0; i < strLength; ++i) { + levels[i] = startLevel; } - for (r = 1; r < s - 1; ++r) { - "ES" === ls[r] && - "EN" === ls[r - 1] && - "EN" === ls[r + 1] && - (ls[r] = "EN"); - "CS" !== ls[r] || - ("EN" !== ls[r - 1] && "AN" !== ls[r - 1]) || - ls[r + 1] !== ls[r - 1] || - (ls[r] = ls[r - 1]); - } - for (r = 0; r < s; ++r) - if ("EN" === ls[r]) { - for (let e = r - 1; e >= 0 && "ET" === ls[e]; --e) ls[e] = "EN"; - for (let e = r + 1; e < s && "ET" === ls[e]; ++e) ls[e] = "EN"; + const e = isOdd(startLevel) ? "R" : "L"; + const sor = e; + const eor = sor; + let lastType = sor; + for (i = 0; i < strLength; ++i) { + if (types[i] === "NSM") { + types[i] = lastType; + } else { + lastType = types[i]; } - for (r = 0; r < s; ++r) { - l = ls[r]; - ("WS" !== l && "ES" !== l && "ET" !== l && "CS" !== l) || (ls[r] = "ON"); } - Q = C; - for (r = 0; r < s; ++r) { - l = ls[r]; - "EN" === l - ? (ls[r] = "L" === Q ? "L" : "EN") - : ("R" !== l && "L" !== l) || (Q = l); - } - for (r = 0; r < s; ++r) - if ("ON" === ls[r]) { - const e = findUnequal(ls, r + 1, "ON"); - let t = C; - r > 0 && (t = ls[r - 1]); - let i = h; - e + 1 < s && (i = ls[e + 1]); - "L" !== t && (t = "R"); - "L" !== i && (i = "R"); - t === i && setValues(ls, r, e, t); - r = e - 1; + lastType = sor; + let t; + for (i = 0; i < strLength; ++i) { + t = types[i]; + if (t === "EN") { + types[i] = lastType === "AL" ? "AN" : "EN"; + } else if (t === "R" || t === "L" || t === "AL") { + lastType = t; } - for (r = 0; r < s; ++r) "ON" === ls[r] && (ls[r] = c); - for (r = 0; r < s; ++r) { - l = ls[r]; - isEven(o[r]) - ? "R" === l - ? (o[r] += 1) - : ("AN" !== l && "EN" !== l) || (o[r] += 2) - : ("L" !== l && "AN" !== l && "EN" !== l) || (o[r] += 1); } - let E, - u = -1, - d = 99; - for (r = 0, n = o.length; r < n; ++r) { - E = o[r]; - u < E && (u = E); - d > E && isOdd(E) && (d = E); + for (i = 0; i < strLength; ++i) { + t = types[i]; + if (t === "AL") { + types[i] = "R"; + } } - for (E = u; E >= d; --E) { - let e = -1; - for (r = 0, n = o.length; r < n; ++r) - if (o[r] < E) { - if (e >= 0) { - reverseValues(Bs, e, r); - e = -1; + for (i = 1; i < strLength - 1; ++i) { + if (types[i] === "ES" && types[i - 1] === "EN" && types[i + 1] === "EN") { + types[i] = "EN"; + } + if ( + types[i] === "CS" && + (types[i - 1] === "EN" || types[i - 1] === "AN") && + types[i + 1] === types[i - 1] + ) { + types[i] = types[i - 1]; + } + } + for (i = 0; i < strLength; ++i) { + if (types[i] === "EN") { + for (let j = i - 1; j >= 0; --j) { + if (types[j] !== "ET") { + break; } - } else e < 0 && (e = r); - e >= 0 && reverseValues(Bs, e, o.length); + types[j] = "EN"; + } + for (let j = i + 1; j < strLength; ++j) { + if (types[j] !== "ET") { + break; + } + types[j] = "EN"; + } + } } - for (r = 0, n = Bs.length; r < n; ++r) { - const e = Bs[r]; - ("<" !== e && ">" !== e) || (Bs[r] = ""); + for (i = 0; i < strLength; ++i) { + t = types[i]; + if (t === "WS" || t === "ES" || t === "ET" || t === "CS") { + types[i] = "ON"; + } } - return createBidiText(Bs.join(""), a); + lastType = sor; + for (i = 0; i < strLength; ++i) { + t = types[i]; + if (t === "EN") { + types[i] = lastType === "L" ? "L" : "EN"; + } else if (t === "R" || t === "L") { + lastType = t; + } + } + for (i = 0; i < strLength; ++i) { + if (types[i] === "ON") { + const end = findUnequal(types, i + 1, "ON"); + let before = sor; + if (i > 0) { + before = types[i - 1]; + } + let after = eor; + if (end + 1 < strLength) { + after = types[end + 1]; + } + if (before !== "L") { + before = "R"; + } + if (after !== "L") { + after = "R"; + } + if (before === after) { + setValues(types, i, end, before); + } + i = end - 1; + } + } + for (i = 0; i < strLength; ++i) { + if (types[i] === "ON") { + types[i] = e; + } + } + for (i = 0; i < strLength; ++i) { + t = types[i]; + if (isEven(levels[i])) { + if (t === "R") { + levels[i] += 1; + } else if (t === "AN" || t === "EN") { + levels[i] += 2; + } + } else if (t === "L" || t === "AN" || t === "EN") { + levels[i] += 1; + } + } + let highestLevel = -1; + let lowestOddLevel = 99; + let level; + for (i = 0, ii = levels.length; i < ii; ++i) { + level = levels[i]; + if (highestLevel < level) { + highestLevel = level; + } + if (lowestOddLevel > level && isOdd(level)) { + lowestOddLevel = level; + } + } + for (level = highestLevel; level >= lowestOddLevel; --level) { + let start = -1; + for (i = 0, ii = levels.length; i < ii; ++i) { + if (levels[i] < level) { + if (start >= 0) { + reverseValues(chars, start, i); + start = -1; + } + } else if (start < 0) { + start = i; + } + } + if (start >= 0) { + reverseValues(chars, start, levels.length); + } + } + for (i = 0, ii = chars.length; i < ii; ++i) { + const ch = chars[i]; + if (ch === "<" || ch === ">") { + chars[i] = ""; + } + } + return createBidiText(chars.join(""), isLTR); +} // ./src/core/font_substitutions.js + +const NORMAL = { + style: "normal", + weight: "normal", +}; +const BOLD = { + style: "normal", + weight: "bold", +}; +const ITALIC = { + style: "italic", + weight: "normal", +}; +const BOLDITALIC = { + style: "italic", + weight: "bold", +}; +const substitutionMap = new Map([ + [ + "Times-Roman", + { + local: [ + "Times New Roman", + "Times-Roman", + "Times", + "Liberation Serif", + "Nimbus Roman", + "Nimbus Roman L", + "Tinos", + "Thorndale", + "TeX Gyre Termes", + "FreeSerif", + "Linux Libertine O", + "Libertinus Serif", + "DejaVu Serif", + "Bitstream Vera Serif", + "Ubuntu", + ], + style: NORMAL, + ultimate: "serif", + }, + ], + [ + "Times-Bold", + { + alias: "Times-Roman", + style: BOLD, + ultimate: "serif", + }, + ], + [ + "Times-Italic", + { + alias: "Times-Roman", + style: ITALIC, + ultimate: "serif", + }, + ], + [ + "Times-BoldItalic", + { + alias: "Times-Roman", + style: BOLDITALIC, + ultimate: "serif", + }, + ], + [ + "Helvetica", + { + local: [ + "Helvetica", + "Helvetica Neue", + "Arial", + "Arial Nova", + "Liberation Sans", + "Arimo", + "Nimbus Sans", + "Nimbus Sans L", + "A030", + "TeX Gyre Heros", + "FreeSans", + "DejaVu Sans", + "Albany", + "Bitstream Vera Sans", + "Arial Unicode MS", + "Microsoft Sans Serif", + "Apple Symbols", + "Cantarell", + ], + path: "LiberationSans-Regular.ttf", + style: NORMAL, + ultimate: "sans-serif", + }, + ], + [ + "Helvetica-Bold", + { + alias: "Helvetica", + path: "LiberationSans-Bold.ttf", + style: BOLD, + ultimate: "sans-serif", + }, + ], + [ + "Helvetica-Oblique", + { + alias: "Helvetica", + path: "LiberationSans-Italic.ttf", + style: ITALIC, + ultimate: "sans-serif", + }, + ], + [ + "Helvetica-BoldOblique", + { + alias: "Helvetica", + path: "LiberationSans-BoldItalic.ttf", + style: BOLDITALIC, + ultimate: "sans-serif", + }, + ], + [ + "Courier", + { + local: [ + "Courier", + "Courier New", + "Liberation Mono", + "Nimbus Mono", + "Nimbus Mono L", + "Cousine", + "Cumberland", + "TeX Gyre Cursor", + "FreeMono", + "Linux Libertine Mono O", + "Libertinus Mono", + ], + style: NORMAL, + ultimate: "monospace", + }, + ], + [ + "Courier-Bold", + { + alias: "Courier", + style: BOLD, + ultimate: "monospace", + }, + ], + [ + "Courier-Oblique", + { + alias: "Courier", + style: ITALIC, + ultimate: "monospace", + }, + ], + [ + "Courier-BoldOblique", + { + alias: "Courier", + style: BOLDITALIC, + ultimate: "monospace", + }, + ], + [ + "ArialBlack", + { + local: ["Arial Black"], + style: { + style: "normal", + weight: "900", + }, + fallback: "Helvetica-Bold", + }, + ], + [ + "ArialBlack-Bold", + { + alias: "ArialBlack", + }, + ], + [ + "ArialBlack-Italic", + { + alias: "ArialBlack", + style: { + style: "italic", + weight: "900", + }, + fallback: "Helvetica-BoldOblique", + }, + ], + [ + "ArialBlack-BoldItalic", + { + alias: "ArialBlack-Italic", + }, + ], + [ + "ArialNarrow", + { + local: [ + "Arial Narrow", + "Liberation Sans Narrow", + "Helvetica Condensed", + "Nimbus Sans Narrow", + "TeX Gyre Heros Cn", + ], + style: NORMAL, + fallback: "Helvetica", + }, + ], + [ + "ArialNarrow-Bold", + { + alias: "ArialNarrow", + style: BOLD, + fallback: "Helvetica-Bold", + }, + ], + [ + "ArialNarrow-Italic", + { + alias: "ArialNarrow", + style: ITALIC, + fallback: "Helvetica-Oblique", + }, + ], + [ + "ArialNarrow-BoldItalic", + { + alias: "ArialNarrow", + style: BOLDITALIC, + fallback: "Helvetica-BoldOblique", + }, + ], + [ + "Calibri", + { + local: ["Calibri", "Carlito"], + style: NORMAL, + fallback: "Helvetica", + }, + ], + [ + "Calibri-Bold", + { + alias: "Calibri", + style: BOLD, + fallback: "Helvetica-Bold", + }, + ], + [ + "Calibri-Italic", + { + alias: "Calibri", + style: ITALIC, + fallback: "Helvetica-Oblique", + }, + ], + [ + "Calibri-BoldItalic", + { + alias: "Calibri", + style: BOLDITALIC, + fallback: "Helvetica-BoldOblique", + }, + ], + [ + "Wingdings", + { + local: ["Wingdings", "URW Dingbats"], + style: NORMAL, + }, + ], + [ + "Wingdings-Regular", + { + alias: "Wingdings", + }, + ], + [ + "Wingdings-Bold", + { + alias: "Wingdings", + }, + ], +]); +const fontAliases = new Map([["Arial-Black", "ArialBlack"]]); +function getStyleToAppend(style) { + switch (style) { + case BOLD: + return "Bold"; + case ITALIC: + return "Italic"; + case BOLDITALIC: + return "Bold Italic"; + default: + if (style?.weight === "bold") { + return "Bold"; + } + if (style?.style === "italic") { + return "Italic"; + } + } + return ""; } -const Qs = { style: "normal", weight: "normal" }, - Es = { style: "normal", weight: "bold" }, - us = { style: "italic", weight: "normal" }, - ds = { style: "italic", weight: "bold" }, - fs = new Map([ - [ - "Times-Roman", - { - local: [ - "Times New Roman", - "Times-Roman", - "Times", - "Liberation Serif", - "Nimbus Roman", - "Nimbus Roman L", - "Tinos", - "Thorndale", - "TeX Gyre Termes", - "FreeSerif", - "Linux Libertine O", - "Libertinus Serif", - "DejaVu Serif", - "Bitstream Vera Serif", - "Ubuntu", - ], - style: Qs, - ultimate: "serif", - }, - ], - ["Times-Bold", { alias: "Times-Roman", style: Es, ultimate: "serif" }], - ["Times-Italic", { alias: "Times-Roman", style: us, ultimate: "serif" }], - [ - "Times-BoldItalic", - { alias: "Times-Roman", style: ds, ultimate: "serif" }, - ], - [ - "Helvetica", - { - local: [ - "Helvetica", - "Helvetica Neue", - "Arial", - "Arial Nova", - "Liberation Sans", - "Arimo", - "Nimbus Sans", - "Nimbus Sans L", - "A030", - "TeX Gyre Heros", - "FreeSans", - "DejaVu Sans", - "Albany", - "Bitstream Vera Sans", - "Arial Unicode MS", - "Microsoft Sans Serif", - "Apple Symbols", - "Cantarell", - ], - path: "LiberationSans-Regular.ttf", - style: Qs, - ultimate: "sans-serif", - }, - ], - [ - "Helvetica-Bold", - { - alias: "Helvetica", - path: "LiberationSans-Bold.ttf", - style: Es, - ultimate: "sans-serif", - }, - ], - [ - "Helvetica-Oblique", - { - alias: "Helvetica", - path: "LiberationSans-Italic.ttf", - style: us, - ultimate: "sans-serif", - }, - ], - [ - "Helvetica-BoldOblique", - { - alias: "Helvetica", - path: "LiberationSans-BoldItalic.ttf", - style: ds, - ultimate: "sans-serif", - }, - ], - [ - "Courier", - { - local: [ - "Courier", - "Courier New", - "Liberation Mono", - "Nimbus Mono", - "Nimbus Mono L", - "Cousine", - "Cumberland", - "TeX Gyre Cursor", - "FreeMono", - "Linux Libertine Mono O", - "Libertinus Mono", - ], - style: Qs, - ultimate: "monospace", - }, - ], - ["Courier-Bold", { alias: "Courier", style: Es, ultimate: "monospace" }], - ["Courier-Oblique", { alias: "Courier", style: us, ultimate: "monospace" }], - [ - "Courier-BoldOblique", - { alias: "Courier", style: ds, ultimate: "monospace" }, - ], - [ - "ArialBlack", - { - local: ["Arial Black"], - style: { style: "normal", weight: "900" }, - fallback: "Helvetica-Bold", - }, - ], - ["ArialBlack-Bold", { alias: "ArialBlack" }], - [ - "ArialBlack-Italic", - { - alias: "ArialBlack", - style: { style: "italic", weight: "900" }, - fallback: "Helvetica-BoldOblique", - }, - ], - ["ArialBlack-BoldItalic", { alias: "ArialBlack-Italic" }], - [ - "ArialNarrow", - { - local: [ - "Arial Narrow", - "Liberation Sans Narrow", - "Helvetica Condensed", - "Nimbus Sans Narrow", - "TeX Gyre Heros Cn", - ], - style: Qs, - fallback: "Helvetica", - }, - ], - [ - "ArialNarrow-Bold", - { alias: "ArialNarrow", style: Es, fallback: "Helvetica-Bold" }, - ], - [ - "ArialNarrow-Italic", - { alias: "ArialNarrow", style: us, fallback: "Helvetica-Oblique" }, - ], - [ - "ArialNarrow-BoldItalic", - { alias: "ArialNarrow", style: ds, fallback: "Helvetica-BoldOblique" }, - ], - [ - "Calibri", - { local: ["Calibri", "Carlito"], style: Qs, fallback: "Helvetica" }, - ], - [ - "Calibri-Bold", - { alias: "Calibri", style: Es, fallback: "Helvetica-Bold" }, - ], - [ - "Calibri-Italic", - { alias: "Calibri", style: us, fallback: "Helvetica-Oblique" }, - ], - [ - "Calibri-BoldItalic", - { alias: "Calibri", style: ds, fallback: "Helvetica-BoldOblique" }, - ], - ["Wingdings", { local: ["Wingdings", "URW Dingbats"], style: Qs }], - ["Wingdings-Regular", { alias: "Wingdings" }], - ["Wingdings-Bold", { alias: "Wingdings" }], - ]), - ps = new Map([["Arial-Black", "ArialBlack"]]); -function getFamilyName(e) { - const t = new Set([ +function getFamilyName(str) { + const keywords = new Set([ "thin", "extralight", "ultralight", @@ -32033,789 +37525,1024 @@ function getFamilyName(e) { "ultraexpanded", "bolditalic", ]); - return e + return str .split(/[- ,+]+/g) - .filter((e) => !t.has(e.toLowerCase())) + .filter((tok) => !keywords.has(tok.toLowerCase())) .join(" "); } function generateFont( - { alias: e, local: t, path: i, fallback: a, style: s, ultimate: r }, - n, - g, - o = !0, - c = !0, - C = "", + { alias, local, path, fallback, style, ultimate }, + src, + localFontPath, + useFallback = true, + usePath = true, + append = "", ) { - const h = { style: null, ultimate: null }; - if (t) { - const e = C ? ` ${C}` : ""; - for (const i of t) n.push(`local(${i}${e})`); + const result = { + style: null, + ultimate: null, + }; + if (local) { + const extra = append ? ` ${append}` : ""; + for (const name of local) { + src.push(`local(${name}${extra})`); + } } - if (e) { - const t = fs.get(e), - r = - C || - (function getStyleToAppend(e) { - switch (e) { - case Es: - return "Bold"; - case us: - return "Italic"; - case ds: - return "Bold Italic"; - default: - if ("bold" === e?.weight) return "Bold"; - if ("italic" === e?.style) return "Italic"; - } - return ""; - })(s); - Object.assign(h, generateFont(t, n, g, o && !a, c && !i, r)); + if (alias) { + const substitution = substitutionMap.get(alias); + const aliasAppend = append || getStyleToAppend(style); + Object.assign( + result, + generateFont( + substitution, + src, + localFontPath, + useFallback && !fallback, + usePath && !path, + aliasAppend, + ), + ); } - s && (h.style = s); - r && (h.ultimate = r); - if (o && a) { - const e = fs.get(a), - { ultimate: t } = generateFont(e, n, g, o, c && !i, C); - h.ultimate ||= t; + if (style) { + result.style = style; } - c && i && g && n.push(`url(${g}${i})`); - return h; + if (ultimate) { + result.ultimate = ultimate; + } + if (useFallback && fallback) { + const fallbackInfo = substitutionMap.get(fallback); + const { ultimate: fallbackUltimate } = generateFont( + fallbackInfo, + src, + localFontPath, + useFallback, + usePath && !path, + append, + ); + result.ultimate ||= fallbackUltimate; + } + if (usePath && path && localFontPath) { + src.push(`url(${localFontPath}${path})`); + } + return result; } -function getFontSubstitution(e, t, i, a, s, r) { - if (a.startsWith("InvalidPDFjsFont_")) return null; - ("TrueType" !== r && "Type1" !== r) || - !/^[A-Z]{6}\+/.test(a) || - (a = a.slice(7)); - const n = (a = normalizeFontName(a)); - let g = e.get(n); - if (g) return g; - let o = fs.get(a); - if (!o) - for (const [e, t] of ps) - if (a.startsWith(e)) { - a = `${t}${a.substring(e.length)}`; - o = fs.get(a); +function getFontSubstitution( + systemFontCache, + idFactory, + localFontPath, + baseFontName, + standardFontName, + type, +) { + if (baseFontName.startsWith("InvalidPDFjsFont_")) { + return null; + } + if ( + (type === "TrueType" || type === "Type1") && + /^[A-Z]{6}\+/.test(baseFontName) + ) { + baseFontName = baseFontName.slice(7); + } + baseFontName = normalizeFontName(baseFontName); + const key = baseFontName; + let substitutionInfo = systemFontCache.get(key); + if (substitutionInfo) { + return substitutionInfo; + } + let substitution = substitutionMap.get(baseFontName); + if (!substitution) { + for (const [alias, subst] of fontAliases) { + if (baseFontName.startsWith(alias)) { + baseFontName = `${subst}${baseFontName.substring(alias.length)}`; + substitution = substitutionMap.get(baseFontName); break; } - let c = !1; - if (!o) { - o = fs.get(s); - c = !0; + } } - const C = `${t.getDocId()}_s${t.createFontId()}`; - if (!o) { - if (!validateFontName(a)) { - warn(`Cannot substitute the font because of its name: ${a}`); - e.set(n, null); + let mustAddBaseFont = false; + if (!substitution) { + substitution = substitutionMap.get(standardFontName); + mustAddBaseFont = true; + } + const loadedName = `${idFactory.getDocId()}_s${idFactory.createFontId()}`; + if (!substitution) { + if (!validateFontName(baseFontName)) { + warn(`Cannot substitute the font because of its name: ${baseFontName}`); + systemFontCache.set(key, null); return null; } - const t = /bold/gi.test(a), - i = /oblique|italic/gi.test(a), - s = (t && i && ds) || (t && Es) || (i && us) || Qs; - g = { - css: `"${getFamilyName(a)}",${C}`, - guessFallback: !0, - loadedName: C, - baseFontName: a, - src: `local(${a})`, - style: s, + const bold = /bold/gi.test(baseFontName); + const italic = /oblique|italic/gi.test(baseFontName); + const style = + (bold && italic && BOLDITALIC) || + (bold && BOLD) || + (italic && ITALIC) || + NORMAL; + substitutionInfo = { + css: `"${getFamilyName(baseFontName)}",${loadedName}`, + guessFallback: true, + loadedName, + baseFontName, + src: `local(${baseFontName})`, + style, }; - e.set(n, g); - return g; + systemFontCache.set(key, substitutionInfo); + return substitutionInfo; } - const h = []; - c && validateFontName(a) && h.push(`local(${a})`); - const { style: l, ultimate: Q } = generateFont(o, h, i), - E = null === Q, - u = E ? "" : `,${Q}`; - g = { - css: `"${getFamilyName(a)}",${C}${u}`, - guessFallback: E, - loadedName: C, - baseFontName: a, - src: h.join(","), - style: l, + const src = []; + if (mustAddBaseFont && validateFontName(baseFontName)) { + src.push(`local(${baseFontName})`); + } + const { style, ultimate } = generateFont(substitution, src, localFontPath); + const guessFallback = ultimate === null; + const fallback = guessFallback ? "" : `,${ultimate}`; + substitutionInfo = { + css: `"${getFamilyName(baseFontName)}",${loadedName}${fallback}`, + guessFallback, + loadedName, + baseFontName, + src: src.join(","), + style, }; - e.set(n, g); - return g; -} + systemFontCache.set(key, substitutionInfo); + return substitutionInfo; +} // ./src/core/image_resizer.js + +const MIN_IMAGE_DIM = 2048; +const MAX_IMAGE_DIM = 65537; +const MAX_ERROR = 128; class ImageResizer { - constructor(e, t) { - this._imgData = e; - this._isMask = t; + static #goodSquareLength = MIN_IMAGE_DIM; + static #isChrome = false; + constructor(imgData, isMask) { + this._imgData = imgData; + this._isMask = isMask; } - static needsToBeResized(e, t) { - if (e <= this._goodSquareLength && t <= this._goodSquareLength) return !1; - const { MAX_DIM: i } = this; - if (e > i || t > i) return !0; - const a = e * t; - if (this._hasMaxArea) return a > this.MAX_AREA; - if (a < this._goodSquareLength ** 2) return !1; - if (this._areGoodDims(e, t)) { - this._goodSquareLength = Math.max( - this._goodSquareLength, - Math.floor(Math.sqrt(e * t)), - ); - return !1; + static get canUseImageDecoder() { + return shadow( + this, + "canUseImageDecoder", + this.#isChrome || typeof ImageDecoder === "undefined" + ? Promise.resolve(false) + : ImageDecoder.isTypeSupported("image/bmp"), + ); + } + static needsToBeResized(width, height) { + if (width <= this.#goodSquareLength && height <= this.#goodSquareLength) { + return false; } - this._goodSquareLength = this._guessMax(this._goodSquareLength, i, 128, 0); - return a > (this.MAX_AREA = this._goodSquareLength ** 2); + const { MAX_DIM } = this; + if (width > MAX_DIM || height > MAX_DIM) { + return true; + } + const area = width * height; + if (this._hasMaxArea) { + return area > this.MAX_AREA; + } + if (area < this.#goodSquareLength ** 2) { + return false; + } + if (this._areGoodDims(width, height)) { + this.#goodSquareLength = Math.max( + this.#goodSquareLength, + Math.floor(Math.sqrt(width * height)), + ); + return false; + } + this.#goodSquareLength = this._guessMax( + this.#goodSquareLength, + MAX_DIM, + MAX_ERROR, + 0, + ); + const maxArea = (this.MAX_AREA = this.#goodSquareLength ** 2); + return area > maxArea; } static get MAX_DIM() { - return shadow(this, "MAX_DIM", this._guessMax(2048, 65537, 0, 1)); + return shadow( + this, + "MAX_DIM", + this._guessMax(MIN_IMAGE_DIM, MAX_IMAGE_DIM, 0, 1), + ); } static get MAX_AREA() { - this._hasMaxArea = !0; + this._hasMaxArea = true; return shadow( this, "MAX_AREA", - this._guessMax(ImageResizer._goodSquareLength, this.MAX_DIM, 128, 0) ** 2, + this._guessMax(this.#goodSquareLength, this.MAX_DIM, MAX_ERROR, 0) ** 2, ); } - static set MAX_AREA(e) { - if (e >= 0) { - this._hasMaxArea = !0; - shadow(this, "MAX_AREA", e); + static set MAX_AREA(area) { + if (area >= 0) { + this._hasMaxArea = true; + shadow(this, "MAX_AREA", area); } } - static setMaxArea(e) { - this._hasMaxArea || (this.MAX_AREA = e >> 2); + static setMaxArea(area) { + if (!this._hasMaxArea) { + this.MAX_AREA = area >> 2; + } } - static _areGoodDims(e, t) { + static setOptions(opts) { + this.setMaxArea(opts.maxArea ?? -1); + this.#isChrome = opts.isChrome ?? false; + } + static _areGoodDims(width, height) { try { - const i = new OffscreenCanvas(e, t), - a = i.getContext("2d"); - a.fillRect(0, 0, 1, 1); - const s = a.getImageData(0, 0, 1, 1).data[3]; - i.width = i.height = 1; - return 0 !== s; + const canvas = new OffscreenCanvas(width, height); + const ctx = canvas.getContext("2d"); + ctx.fillRect(0, 0, 1, 1); + const opacity = ctx.getImageData(0, 0, 1, 1).data[3]; + canvas.width = canvas.height = 1; + return opacity !== 0; } catch { - return !1; + return false; } } - static _guessMax(e, t, i, a) { - for (; e + i + 1 < t; ) { - const i = Math.floor((e + t) / 2), - s = a || i; - this._areGoodDims(i, s) ? (e = i) : (t = i); + static _guessMax(start, end, tolerance, defaultHeight) { + while (start + tolerance + 1 < end) { + const middle = Math.floor((start + end) / 2); + const height = defaultHeight || middle; + if (this._areGoodDims(middle, height)) { + start = middle; + } else { + end = middle; + } } - return e; + return start; } - static async createImage(e, t = !1) { - return new ImageResizer(e, t)._createImage(); + static async createImage(imgData, isMask = false) { + return new ImageResizer(imgData, isMask)._createImage(); } async _createImage() { - const e = this._encodeBMP(), - t = new Blob([e.buffer], { type: "image/bmp" }), - i = createImageBitmap(t), - { MAX_AREA: a, MAX_DIM: s } = ImageResizer, - { _imgData: r } = this, - { width: n, height: g } = r, - o = Math.max(n / s, g / s, Math.sqrt((n * g) / a)), - c = Math.max(o, 2), - C = Math.round(10 * (o + 1.25)) / 10 / c, - h = Math.floor(Math.log2(C)), - l = new Array(h + 2).fill(2); - l[0] = c; - l.splice(-1, 1, C / (1 << h)); - let Q = n, - E = g, - u = await i; - for (const e of l) { - const t = Q, - i = E; - Q = Math.floor(Q / e) - 1; - E = Math.floor(E / e) - 1; - const a = new OffscreenCanvas(Q, E); - a.getContext("2d").drawImage(u, 0, 0, t, i, 0, 0, Q, E); - u = a.transferToImageBitmap(); + const data = this._encodeBMP(); + let decoder, imagePromise; + if (await ImageResizer.canUseImageDecoder) { + decoder = new ImageDecoder({ + data, + type: "image/bmp", + preferAnimation: false, + transfer: [data.buffer], + }); + imagePromise = decoder + .decode() + .catch((reason) => { + warn(`BMP image decoding failed: ${reason}`); + return createImageBitmap( + new Blob([this._encodeBMP().buffer], { + type: "image/bmp", + }), + ); + }) + .finally(() => { + decoder.close(); + }); + } else { + imagePromise = createImageBitmap( + new Blob([data.buffer], { + type: "image/bmp", + }), + ); } - r.data = null; - r.bitmap = u; - r.width = Q; - r.height = E; - return r; + const { MAX_AREA, MAX_DIM } = ImageResizer; + const { _imgData: imgData } = this; + const { width, height } = imgData; + const minFactor = Math.max( + width / MAX_DIM, + height / MAX_DIM, + Math.sqrt((width * height) / MAX_AREA), + ); + const firstFactor = Math.max(minFactor, 2); + const factor = Math.round(10 * (minFactor + 1.25)) / 10 / firstFactor; + const N = Math.floor(Math.log2(factor)); + const steps = new Array(N + 2).fill(2); + steps[0] = firstFactor; + steps.splice(-1, 1, factor / (1 << N)); + let newWidth = width; + let newHeight = height; + const result = await imagePromise; + let bitmap = result.image || result; + for (const step of steps) { + const prevWidth = newWidth; + const prevHeight = newHeight; + newWidth = Math.floor(newWidth / step) - 1; + newHeight = Math.floor(newHeight / step) - 1; + const canvas = new OffscreenCanvas(newWidth, newHeight); + const ctx = canvas.getContext("2d"); + ctx.drawImage( + bitmap, + 0, + 0, + prevWidth, + prevHeight, + 0, + 0, + newWidth, + newHeight, + ); + bitmap.close(); + bitmap = canvas.transferToImageBitmap(); + } + imgData.data = null; + imgData.bitmap = bitmap; + imgData.width = newWidth; + imgData.height = newHeight; + return imgData; } _encodeBMP() { - const { width: e, height: t, kind: i } = this._imgData; - let a, - s = this._imgData.data, - r = new Uint8Array(0), - n = r, - g = 0; - switch (i) { - case D: { - a = 1; - r = new Uint8Array( + const { width, height, kind } = this._imgData; + let data = this._imgData.data; + let bitPerPixel; + let colorTable = new Uint8Array(0); + let maskTable = colorTable; + let compression = 0; + switch (kind) { + case ImageKind.GRAYSCALE_1BPP: { + bitPerPixel = 1; + colorTable = new Uint8Array( this._isMask ? [255, 255, 255, 255, 0, 0, 0, 0] : [0, 0, 0, 0, 255, 255, 255, 255], ); - const i = (e + 7) >> 3, - n = (i + 3) & -4; - if (i !== n) { - const e = new Uint8Array(n * t); - let a = 0; - for (let r = 0, g = t * i; r < g; r += i, a += n) - e.set(s.subarray(r, r + i), a); - s = e; + const rowLen = (width + 7) >> 3; + const rowSize = (rowLen + 3) & -4; + if (rowLen !== rowSize) { + const newData = new Uint8Array(rowSize * height); + let k = 0; + for ( + let i = 0, ii = height * rowLen; + i < ii; + i += rowLen, k += rowSize + ) { + newData.set(data.subarray(i, i + rowLen), k); + } + data = newData; } break; } - case b: - a = 24; - if (3 & e) { - const i = 3 * e, - a = (i + 3) & -4, - r = a - i, - n = new Uint8Array(a * t); - let g = 0; - for (let e = 0, a = t * i; e < a; e += i) { - const t = s.subarray(e, e + i); - for (let e = 0; e < i; e += 3) { - n[g++] = t[e + 2]; - n[g++] = t[e + 1]; - n[g++] = t[e]; + case ImageKind.RGB_24BPP: { + bitPerPixel = 24; + if (width & 3) { + const rowLen = 3 * width; + const rowSize = (rowLen + 3) & -4; + const extraLen = rowSize - rowLen; + const newData = new Uint8Array(rowSize * height); + let k = 0; + for (let i = 0, ii = height * rowLen; i < ii; i += rowLen) { + const row = data.subarray(i, i + rowLen); + for (let j = 0; j < rowLen; j += 3) { + newData[k++] = row[j + 2]; + newData[k++] = row[j + 1]; + newData[k++] = row[j]; } - g += r; + k += extraLen; } - s = n; - } else - for (let e = 0, t = s.length; e < t; e += 3) { - const t = s[e]; - s[e] = s[e + 2]; - s[e + 2] = t; - } - break; - case F: - a = 32; - g = 3; - n = new Uint8Array(68); - const i = new DataView(n.buffer); - if (FeatureTest.isLittleEndian) { - i.setUint32(0, 255, !0); - i.setUint32(4, 65280, !0); - i.setUint32(8, 16711680, !0); - i.setUint32(12, 4278190080, !0); + data = newData; } else { - i.setUint32(0, 4278190080, !0); - i.setUint32(4, 16711680, !0); - i.setUint32(8, 65280, !0); - i.setUint32(12, 255, !0); + for (let i = 0, ii = data.length; i < ii; i += 3) { + const tmp = data[i]; + data[i] = data[i + 2]; + data[i + 2] = tmp; + } + } + break; + } + case ImageKind.RGBA_32BPP: + bitPerPixel = 32; + compression = 3; + maskTable = new Uint8Array(4 + 4 + 4 + 4 + 52); + const view = new DataView(maskTable.buffer); + if (FeatureTest.isLittleEndian) { + view.setUint32(0, 0x000000ff, true); + view.setUint32(4, 0x0000ff00, true); + view.setUint32(8, 0x00ff0000, true); + view.setUint32(12, 0xff000000, true); + } else { + view.setUint32(0, 0xff000000, true); + view.setUint32(4, 0x00ff0000, true); + view.setUint32(8, 0x0000ff00, true); + view.setUint32(12, 0x000000ff, true); } break; default: throw new Error("invalid format"); } - let o = 0; - const c = 40 + n.length, - C = 14 + c + r.length + s.length, - h = new Uint8Array(C), - l = new DataView(h.buffer); - l.setUint16(o, 19778, !0); - o += 2; - l.setUint32(o, C, !0); - o += 4; - l.setUint32(o, 0, !0); - o += 4; - l.setUint32(o, 14 + c + r.length, !0); - o += 4; - l.setUint32(o, c, !0); - o += 4; - l.setInt32(o, e, !0); - o += 4; - l.setInt32(o, -t, !0); - o += 4; - l.setUint16(o, 1, !0); - o += 2; - l.setUint16(o, a, !0); - o += 2; - l.setUint32(o, g, !0); - o += 4; - l.setUint32(o, 0, !0); - o += 4; - l.setInt32(o, 0, !0); - o += 4; - l.setInt32(o, 0, !0); - o += 4; - l.setUint32(o, r.length / 4, !0); - o += 4; - l.setUint32(o, 0, !0); - o += 4; - h.set(n, o); - o += n.length; - h.set(r, o); - o += r.length; - h.set(s, o); - return h; + let i = 0; + const headerLength = 40 + maskTable.length; + const fileLength = 14 + headerLength + colorTable.length + data.length; + const bmpData = new Uint8Array(fileLength); + const view = new DataView(bmpData.buffer); + view.setUint16(i, 0x4d42, true); + i += 2; + view.setUint32(i, fileLength, true); + i += 4; + view.setUint32(i, 0, true); + i += 4; + view.setUint32(i, 14 + headerLength + colorTable.length, true); + i += 4; + view.setUint32(i, headerLength, true); + i += 4; + view.setInt32(i, width, true); + i += 4; + view.setInt32(i, -height, true); + i += 4; + view.setUint16(i, 1, true); + i += 2; + view.setUint16(i, bitPerPixel, true); + i += 2; + view.setUint32(i, compression, true); + i += 4; + view.setUint32(i, 0, true); + i += 4; + view.setInt32(i, 0, true); + i += 4; + view.setInt32(i, 0, true); + i += 4; + view.setUint32(i, colorTable.length / 4, true); + i += 4; + view.setUint32(i, 0, true); + i += 4; + bmpData.set(maskTable, i); + i += maskTable.length; + bmpData.set(colorTable, i); + i += colorTable.length; + bmpData.set(data, i); + return bmpData; } -} -ImageResizer._goodSquareLength = 2048; -const ms = 3285377520, - ys = 4294901760, - ws = 65535; +} // ./src/shared/murmurhash3.js + +const SEED = 0xc3d2e1f0; +const MASK_HIGH = 0xffff0000; +const MASK_LOW = 0xffff; class MurmurHash3_64 { - constructor(e) { - this.h1 = e ? 4294967295 & e : ms; - this.h2 = e ? 4294967295 & e : ms; + constructor(seed) { + this.h1 = seed ? seed & 0xffffffff : SEED; + this.h2 = seed ? seed & 0xffffffff : SEED; } - update(e) { - let t, i; - if ("string" == typeof e) { - t = new Uint8Array(2 * e.length); - i = 0; - for (let a = 0, s = e.length; a < s; a++) { - const s = e.charCodeAt(a); - if (s <= 255) t[i++] = s; - else { - t[i++] = s >>> 8; - t[i++] = 255 & s; + update(input) { + let data, length; + if (typeof input === "string") { + data = new Uint8Array(input.length * 2); + length = 0; + for (let i = 0, ii = input.length; i < ii; i++) { + const code = input.charCodeAt(i); + if (code <= 0xff) { + data[length++] = code; + } else { + data[length++] = code >>> 8; + data[length++] = code & 0xff; } } + } else if (ArrayBuffer.isView(input)) { + data = input.slice(); + length = data.byteLength; } else { - if (!ArrayBuffer.isView(e)) - throw new Error("Invalid data format, must be a string or TypedArray."); - t = e.slice(); - i = t.byteLength; + throw new Error("Invalid data format, must be a string or TypedArray."); } - const a = i >> 2, - s = i - 4 * a, - r = new Uint32Array(t.buffer, 0, a); - let n = 0, - g = 0, - o = this.h1, - c = this.h2; - const C = 3432918353, - h = 461845907, - l = 11601, - Q = 13715; - for (let e = 0; e < a; e++) - if (1 & e) { - n = r[e]; - n = ((n * C) & ys) | ((n * l) & ws); - n = (n << 15) | (n >>> 17); - n = ((n * h) & ys) | ((n * Q) & ws); - o ^= n; - o = (o << 13) | (o >>> 19); - o = 5 * o + 3864292196; + const blockCounts = length >> 2; + const tailLength = length - blockCounts * 4; + const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts); + let k1 = 0, + k2 = 0; + let h1 = this.h1, + h2 = this.h2; + const C1 = 0xcc9e2d51, + C2 = 0x1b873593; + const C1_LOW = C1 & MASK_LOW, + C2_LOW = C2 & MASK_LOW; + for (let i = 0; i < blockCounts; i++) { + if (i & 1) { + k1 = dataUint32[i]; + k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW); + k1 = (k1 << 15) | (k1 >>> 17); + k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW); + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); + h1 = h1 * 5 + 0xe6546b64; } else { - g = r[e]; - g = ((g * C) & ys) | ((g * l) & ws); - g = (g << 15) | (g >>> 17); - g = ((g * h) & ys) | ((g * Q) & ws); - c ^= g; - c = (c << 13) | (c >>> 19); - c = 5 * c + 3864292196; + k2 = dataUint32[i]; + k2 = ((k2 * C1) & MASK_HIGH) | ((k2 * C1_LOW) & MASK_LOW); + k2 = (k2 << 15) | (k2 >>> 17); + k2 = ((k2 * C2) & MASK_HIGH) | ((k2 * C2_LOW) & MASK_LOW); + h2 ^= k2; + h2 = (h2 << 13) | (h2 >>> 19); + h2 = h2 * 5 + 0xe6546b64; } - n = 0; - switch (s) { - case 3: - n ^= t[4 * a + 2] << 16; - case 2: - n ^= t[4 * a + 1] << 8; - case 1: - n ^= t[4 * a]; - n = ((n * C) & ys) | ((n * l) & ws); - n = (n << 15) | (n >>> 17); - n = ((n * h) & ys) | ((n * Q) & ws); - 1 & a ? (o ^= n) : (c ^= n); } - this.h1 = o; - this.h2 = c; + k1 = 0; + switch (tailLength) { + case 3: + k1 ^= data[blockCounts * 4 + 2] << 16; + case 2: + k1 ^= data[blockCounts * 4 + 1] << 8; + case 1: + k1 ^= data[blockCounts * 4]; + k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW); + k1 = (k1 << 15) | (k1 >>> 17); + k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW); + if (blockCounts & 1) { + h1 ^= k1; + } else { + h2 ^= k1; + } + } + this.h1 = h1; + this.h2 = h2; } hexdigest() { - let e = this.h1, - t = this.h2; - e ^= t >>> 1; - e = ((3981806797 * e) & ys) | ((36045 * e) & ws); - t = - ((4283543511 * t) & ys) | - (((2950163797 * ((t << 16) | (e >>> 16))) & ys) >>> 16); - e ^= t >>> 1; - e = ((444984403 * e) & ys) | ((60499 * e) & ws); - t = - ((3301882366 * t) & ys) | - (((3120437893 * ((t << 16) | (e >>> 16))) & ys) >>> 16); - e ^= t >>> 1; + let h1 = this.h1, + h2 = this.h2; + h1 ^= h2 >>> 1; + h1 = ((h1 * 0xed558ccd) & MASK_HIGH) | ((h1 * 0x8ccd) & MASK_LOW); + h2 = + ((h2 * 0xff51afd7) & MASK_HIGH) | + (((((h2 << 16) | (h1 >>> 16)) * 0xafd7ed55) & MASK_HIGH) >>> 16); + h1 ^= h2 >>> 1; + h1 = ((h1 * 0x1a85ec53) & MASK_HIGH) | ((h1 * 0xec53) & MASK_LOW); + h2 = + ((h2 * 0xc4ceb9fe) & MASK_HIGH) | + (((((h2 << 16) | (h1 >>> 16)) * 0xb9fe1a85) & MASK_HIGH) >>> 16); + h1 ^= h2 >>> 1; return ( - (e >>> 0).toString(16).padStart(8, "0") + - (t >>> 0).toString(16).padStart(8, "0") + (h1 >>> 0).toString(16).padStart(8, "0") + + (h2 >>> 0).toString(16).padStart(8, "0") ); } -} -function addState(e, t, i, a, s) { - let r = e; - for (let e = 0, i = t.length - 1; e < i; e++) { - const i = t[e]; - r = r[i] ||= []; +} // ./src/core/operator_list.js + +function addState(parentState, pattern, checkFn, iterateFn, processFn) { + let state = parentState; + for (let i = 0, ii = pattern.length - 1; i < ii; i++) { + const item = pattern[i]; + state = state[item] ||= []; } - r[t.at(-1)] = { checkFn: i, iterateFn: a, processFn: s }; + state[pattern.at(-1)] = { + checkFn, + iterateFn, + processFn, + }; } -const Ds = []; +const InitialState = []; addState( - Ds, - [GA, UA, ze, xA], + InitialState, + [OPS.save, OPS.transform, OPS.paintInlineImageXObject, OPS.restore], null, - function iterateInlineImageGroup(e, t) { - const i = e.fnArray, - a = (t - (e.iCurr - 3)) % 4; - switch (a) { + function iterateInlineImageGroup(context, i) { + const fnArray = context.fnArray; + const iFirstSave = context.iCurr - 3; + const pos = (i - iFirstSave) % 4; + switch (pos) { case 0: - return i[t] === GA; + return fnArray[i] === OPS.save; case 1: - return i[t] === UA; + return fnArray[i] === OPS.transform; case 2: - return i[t] === ze; + return fnArray[i] === OPS.paintInlineImageXObject; case 3: - return i[t] === xA; + return fnArray[i] === OPS.restore; } - throw new Error(`iterateInlineImageGroup - invalid pos: ${a}`); + throw new Error(`iterateInlineImageGroup - invalid pos: ${pos}`); }, - function foundInlineImageGroup(e, t) { - const i = e.fnArray, - a = e.argsArray, - s = e.iCurr, - r = s - 3, - n = s - 2, - g = s - 1, - o = Math.min(Math.floor((t - r) / 4), 200); - if (o < 10) return t - ((t - r) % 4); - let c = 0; - const C = []; - let h = 0, - l = 1, - Q = 1; - for (let e = 0; e < o; e++) { - const t = a[n + (e << 2)], - i = a[g + (e << 2)][0]; - if (l + i.width > 1e3) { - c = Math.max(c, l); - Q += h + 2; - l = 0; - h = 0; - } - C.push({ transform: t, x: l, y: Q, w: i.width, h: i.height }); - l += i.width + 2; - h = Math.max(h, i.height); + function foundInlineImageGroup(context, i) { + const MIN_IMAGES_IN_INLINE_IMAGES_BLOCK = 10; + const MAX_IMAGES_IN_INLINE_IMAGES_BLOCK = 200; + const MAX_WIDTH = 1000; + const IMAGE_PADDING = 1; + const fnArray = context.fnArray, + argsArray = context.argsArray; + const curr = context.iCurr; + const iFirstSave = curr - 3; + const iFirstTransform = curr - 2; + const iFirstPIIXO = curr - 1; + const count = Math.min( + Math.floor((i - iFirstSave) / 4), + MAX_IMAGES_IN_INLINE_IMAGES_BLOCK, + ); + if (count < MIN_IMAGES_IN_INLINE_IMAGES_BLOCK) { + return i - ((i - iFirstSave) % 4); } - const E = Math.max(c, l) + 1, - u = Q + h + 1, - d = new Uint8Array(E * u * 4), - f = E << 2; - for (let e = 0; e < o; e++) { - const t = a[g + (e << 2)][0].data, - i = C[e].w << 2; - let s = 0, - r = (C[e].x + C[e].y * E) << 2; - d.set(t.subarray(0, i), r - f); - for (let a = 0, n = C[e].h; a < n; a++) { - d.set(t.subarray(s, s + i), r); - s += i; - r += f; + let maxX = 0; + const map = []; + let maxLineHeight = 0; + let currentX = IMAGE_PADDING, + currentY = IMAGE_PADDING; + for (let q = 0; q < count; q++) { + const transform = argsArray[iFirstTransform + (q << 2)]; + const img = argsArray[iFirstPIIXO + (q << 2)][0]; + if (currentX + img.width > MAX_WIDTH) { + maxX = Math.max(maxX, currentX); + currentY += maxLineHeight + 2 * IMAGE_PADDING; + currentX = 0; + maxLineHeight = 0; } - d.set(t.subarray(s - i, s), r); - for (; r >= 0; ) { - t[r - 4] = t[r]; - t[r - 3] = t[r + 1]; - t[r - 2] = t[r + 2]; - t[r - 1] = t[r + 3]; - t[r + i] = t[r + i - 4]; - t[r + i + 1] = t[r + i - 3]; - t[r + i + 2] = t[r + i - 2]; - t[r + i + 3] = t[r + i - 1]; - r -= f; + map.push({ + transform, + x: currentX, + y: currentY, + w: img.width, + h: img.height, + }); + currentX += img.width + 2 * IMAGE_PADDING; + maxLineHeight = Math.max(maxLineHeight, img.height); + } + const imgWidth = Math.max(maxX, currentX) + IMAGE_PADDING; + const imgHeight = currentY + maxLineHeight + IMAGE_PADDING; + const imgData = new Uint8Array(imgWidth * imgHeight * 4); + const imgRowSize = imgWidth << 2; + for (let q = 0; q < count; q++) { + const data = argsArray[iFirstPIIXO + (q << 2)][0].data; + const rowSize = map[q].w << 2; + let dataOffset = 0; + let offset = (map[q].x + map[q].y * imgWidth) << 2; + imgData.set(data.subarray(0, rowSize), offset - imgRowSize); + for (let k = 0, kk = map[q].h; k < kk; k++) { + imgData.set(data.subarray(dataOffset, dataOffset + rowSize), offset); + dataOffset += rowSize; + offset += imgRowSize; + } + imgData.set(data.subarray(dataOffset - rowSize, dataOffset), offset); + while (offset >= 0) { + data[offset - 4] = data[offset]; + data[offset - 3] = data[offset + 1]; + data[offset - 2] = data[offset + 2]; + data[offset - 1] = data[offset + 3]; + data[offset + rowSize] = data[offset + rowSize - 4]; + data[offset + rowSize + 1] = data[offset + rowSize - 3]; + data[offset + rowSize + 2] = data[offset + rowSize - 2]; + data[offset + rowSize + 3] = data[offset + rowSize - 1]; + offset -= imgRowSize; } } - const p = { width: E, height: u }; - if (e.isOffscreenCanvasSupported) { - const e = new OffscreenCanvas(E, u); - e.getContext("2d").putImageData( - new ImageData(new Uint8ClampedArray(d.buffer), E, u), + const img = { + width: imgWidth, + height: imgHeight, + }; + if (context.isOffscreenCanvasSupported) { + const canvas = new OffscreenCanvas(imgWidth, imgHeight); + const ctx = canvas.getContext("2d"); + ctx.putImageData( + new ImageData( + new Uint8ClampedArray(imgData.buffer), + imgWidth, + imgHeight, + ), 0, 0, ); - p.bitmap = e.transferToImageBitmap(); - p.data = null; + img.bitmap = canvas.transferToImageBitmap(); + img.data = null; } else { - p.kind = F; - p.data = d; + img.kind = ImageKind.RGBA_32BPP; + img.data = imgData; } - i.splice(r, 4 * o, _e); - a.splice(r, 4 * o, [p, C]); - return r + 1; + fnArray.splice(iFirstSave, count * 4, OPS.paintInlineImageXObjectGroup); + argsArray.splice(iFirstSave, count * 4, [img, map]); + return iFirstSave + 1; }, ); addState( - Ds, - [GA, UA, Xe, xA], + InitialState, + [OPS.save, OPS.transform, OPS.paintImageMaskXObject, OPS.restore], null, - function iterateImageMaskGroup(e, t) { - const i = e.fnArray, - a = (t - (e.iCurr - 3)) % 4; - switch (a) { + function iterateImageMaskGroup(context, i) { + const fnArray = context.fnArray; + const iFirstSave = context.iCurr - 3; + const pos = (i - iFirstSave) % 4; + switch (pos) { case 0: - return i[t] === GA; + return fnArray[i] === OPS.save; case 1: - return i[t] === UA; + return fnArray[i] === OPS.transform; case 2: - return i[t] === Xe; + return fnArray[i] === OPS.paintImageMaskXObject; case 3: - return i[t] === xA; + return fnArray[i] === OPS.restore; } - throw new Error(`iterateImageMaskGroup - invalid pos: ${a}`); + throw new Error(`iterateImageMaskGroup - invalid pos: ${pos}`); }, - function foundImageMaskGroup(e, t) { - const i = e.fnArray, - a = e.argsArray, - s = e.iCurr, - r = s - 3, - n = s - 2, - g = s - 1; - let o = Math.floor((t - r) / 4); - if (o < 10) return t - ((t - r) % 4); - let c, - C, - h = !1; - const l = a[g][0], - Q = a[n][0], - E = a[n][1], - u = a[n][2], - d = a[n][3]; - if (E === u) { - h = !0; - c = n + 4; - let e = g + 4; - for (let t = 1; t < o; t++, c += 4, e += 4) { - C = a[c]; + function foundImageMaskGroup(context, i) { + const MIN_IMAGES_IN_MASKS_BLOCK = 10; + const MAX_IMAGES_IN_MASKS_BLOCK = 100; + const MAX_SAME_IMAGES_IN_MASKS_BLOCK = 1000; + const fnArray = context.fnArray, + argsArray = context.argsArray; + const curr = context.iCurr; + const iFirstSave = curr - 3; + const iFirstTransform = curr - 2; + const iFirstPIMXO = curr - 1; + let count = Math.floor((i - iFirstSave) / 4); + if (count < MIN_IMAGES_IN_MASKS_BLOCK) { + return i - ((i - iFirstSave) % 4); + } + let isSameImage = false; + let iTransform, transformArgs; + const firstPIMXOArg0 = argsArray[iFirstPIMXO][0]; + const firstTransformArg0 = argsArray[iFirstTransform][0], + firstTransformArg1 = argsArray[iFirstTransform][1], + firstTransformArg2 = argsArray[iFirstTransform][2], + firstTransformArg3 = argsArray[iFirstTransform][3]; + if (firstTransformArg1 === firstTransformArg2) { + isSameImage = true; + iTransform = iFirstTransform + 4; + let iPIMXO = iFirstPIMXO + 4; + for (let q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) { + transformArgs = argsArray[iTransform]; if ( - a[e][0] !== l || - C[0] !== Q || - C[1] !== E || - C[2] !== u || - C[3] !== d + argsArray[iPIMXO][0] !== firstPIMXOArg0 || + transformArgs[0] !== firstTransformArg0 || + transformArgs[1] !== firstTransformArg1 || + transformArgs[2] !== firstTransformArg2 || + transformArgs[3] !== firstTransformArg3 ) { - t < 10 ? (h = !1) : (o = t); + if (q < MIN_IMAGES_IN_MASKS_BLOCK) { + isSameImage = false; + } else { + count = q; + } break; } } } - if (h) { - o = Math.min(o, 1e3); - const e = new Float32Array(2 * o); - c = n; - for (let t = 0; t < o; t++, c += 4) { - C = a[c]; - e[t << 1] = C[4]; - e[1 + (t << 1)] = C[5]; + if (isSameImage) { + count = Math.min(count, MAX_SAME_IMAGES_IN_MASKS_BLOCK); + const positions = new Float32Array(count * 2); + iTransform = iFirstTransform; + for (let q = 0; q < count; q++, iTransform += 4) { + transformArgs = argsArray[iTransform]; + positions[q << 1] = transformArgs[4]; + positions[(q << 1) + 1] = transformArgs[5]; } - i.splice(r, 4 * o, At); - a.splice(r, 4 * o, [l, Q, E, u, d, e]); + fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectRepeat); + argsArray.splice(iFirstSave, count * 4, [ + firstPIMXOArg0, + firstTransformArg0, + firstTransformArg1, + firstTransformArg2, + firstTransformArg3, + positions, + ]); } else { - o = Math.min(o, 100); - const e = []; - for (let t = 0; t < o; t++) { - C = a[n + (t << 2)]; - const i = a[g + (t << 2)][0]; - e.push({ - data: i.data, - width: i.width, - height: i.height, - interpolate: i.interpolate, - count: i.count, - transform: C, + count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK); + const images = []; + for (let q = 0; q < count; q++) { + transformArgs = argsArray[iFirstTransform + (q << 2)]; + const maskParams = argsArray[iFirstPIMXO + (q << 2)][0]; + images.push({ + data: maskParams.data, + width: maskParams.width, + height: maskParams.height, + interpolate: maskParams.interpolate, + count: maskParams.count, + transform: transformArgs, }); } - i.splice(r, 4 * o, Ze); - a.splice(r, 4 * o, [e]); + fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectGroup); + argsArray.splice(iFirstSave, count * 4, [images]); } - return r + 1; + return iFirstSave + 1; }, ); addState( - Ds, - [GA, UA, Ve, xA], - function (e) { - const t = e.argsArray, - i = e.iCurr - 2; - return 0 === t[i][1] && 0 === t[i][2]; + InitialState, + [OPS.save, OPS.transform, OPS.paintImageXObject, OPS.restore], + function (context) { + const argsArray = context.argsArray; + const iFirstTransform = context.iCurr - 2; + return ( + argsArray[iFirstTransform][1] === 0 && argsArray[iFirstTransform][2] === 0 + ); }, - function iterateImageGroup(e, t) { - const i = e.fnArray, - a = e.argsArray, - s = (t - (e.iCurr - 3)) % 4; - switch (s) { + function iterateImageGroup(context, i) { + const fnArray = context.fnArray, + argsArray = context.argsArray; + const iFirstSave = context.iCurr - 3; + const pos = (i - iFirstSave) % 4; + switch (pos) { case 0: - return i[t] === GA; + return fnArray[i] === OPS.save; case 1: - if (i[t] !== UA) return !1; - const s = e.iCurr - 2, - r = a[s][0], - n = a[s][3]; - return a[t][0] === r && 0 === a[t][1] && 0 === a[t][2] && a[t][3] === n; + if (fnArray[i] !== OPS.transform) { + return false; + } + const iFirstTransform = context.iCurr - 2; + const firstTransformArg0 = argsArray[iFirstTransform][0]; + const firstTransformArg3 = argsArray[iFirstTransform][3]; + if ( + argsArray[i][0] !== firstTransformArg0 || + argsArray[i][1] !== 0 || + argsArray[i][2] !== 0 || + argsArray[i][3] !== firstTransformArg3 + ) { + return false; + } + return true; case 2: - if (i[t] !== Ve) return !1; - const g = a[e.iCurr - 1][0]; - return a[t][0] === g; + if (fnArray[i] !== OPS.paintImageXObject) { + return false; + } + const iFirstPIXO = context.iCurr - 1; + const firstPIXOArg0 = argsArray[iFirstPIXO][0]; + if (argsArray[i][0] !== firstPIXOArg0) { + return false; + } + return true; case 3: - return i[t] === xA; + return fnArray[i] === OPS.restore; } - throw new Error(`iterateImageGroup - invalid pos: ${s}`); + throw new Error(`iterateImageGroup - invalid pos: ${pos}`); }, - function (e, t) { - const i = e.fnArray, - a = e.argsArray, - s = e.iCurr, - r = s - 3, - n = s - 2, - g = a[s - 1][0], - o = a[n][0], - c = a[n][3], - C = Math.min(Math.floor((t - r) / 4), 1e3); - if (C < 3) return t - ((t - r) % 4); - const h = new Float32Array(2 * C); - let l = n; - for (let e = 0; e < C; e++, l += 4) { - const t = a[l]; - h[e << 1] = t[4]; - h[1 + (e << 1)] = t[5]; + function (context, i) { + const MIN_IMAGES_IN_BLOCK = 3; + const MAX_IMAGES_IN_BLOCK = 1000; + const fnArray = context.fnArray, + argsArray = context.argsArray; + const curr = context.iCurr; + const iFirstSave = curr - 3; + const iFirstTransform = curr - 2; + const iFirstPIXO = curr - 1; + const firstPIXOArg0 = argsArray[iFirstPIXO][0]; + const firstTransformArg0 = argsArray[iFirstTransform][0]; + const firstTransformArg3 = argsArray[iFirstTransform][3]; + const count = Math.min( + Math.floor((i - iFirstSave) / 4), + MAX_IMAGES_IN_BLOCK, + ); + if (count < MIN_IMAGES_IN_BLOCK) { + return i - ((i - iFirstSave) % 4); } - const Q = [g, o, c, h]; - i.splice(r, 4 * C, $e); - a.splice(r, 4 * C, Q); - return r + 1; + const positions = new Float32Array(count * 2); + let iTransform = iFirstTransform; + for (let q = 0; q < count; q++, iTransform += 4) { + const transformArgs = argsArray[iTransform]; + positions[q << 1] = transformArgs[4]; + positions[(q << 1) + 1] = transformArgs[5]; + } + const args = [ + firstPIXOArg0, + firstTransformArg0, + firstTransformArg3, + positions, + ]; + fnArray.splice(iFirstSave, count * 4, OPS.paintImageXObjectRepeat); + argsArray.splice(iFirstSave, count * 4, args); + return iFirstSave + 1; }, ); addState( - Ds, - [$A, se, Ie, Ce, Ae], + InitialState, + [OPS.beginText, OPS.setFont, OPS.setTextMatrix, OPS.showText, OPS.endText], null, - function iterateShowTextGroup(e, t) { - const i = e.fnArray, - a = e.argsArray, - s = (t - (e.iCurr - 4)) % 5; - switch (s) { + function iterateShowTextGroup(context, i) { + const fnArray = context.fnArray, + argsArray = context.argsArray; + const iFirstSave = context.iCurr - 4; + const pos = (i - iFirstSave) % 5; + switch (pos) { case 0: - return i[t] === $A; + return fnArray[i] === OPS.beginText; case 1: - return i[t] === se; + return fnArray[i] === OPS.setFont; case 2: - return i[t] === Ie; + return fnArray[i] === OPS.setTextMatrix; case 3: - if (i[t] !== Ce) return !1; - const s = e.iCurr - 3, - r = a[s][0], - n = a[s][1]; - return a[t][0] === r && a[t][1] === n; + if (fnArray[i] !== OPS.showText) { + return false; + } + const iFirstSetFont = context.iCurr - 3; + const firstSetFontArg0 = argsArray[iFirstSetFont][0]; + const firstSetFontArg1 = argsArray[iFirstSetFont][1]; + if ( + argsArray[i][0] !== firstSetFontArg0 || + argsArray[i][1] !== firstSetFontArg1 + ) { + return false; + } + return true; case 4: - return i[t] === Ae; + return fnArray[i] === OPS.endText; } - throw new Error(`iterateShowTextGroup - invalid pos: ${s}`); + throw new Error(`iterateShowTextGroup - invalid pos: ${pos}`); }, - function (e, t) { - const i = e.fnArray, - a = e.argsArray, - s = e.iCurr, - r = s - 4, - n = s - 3, - g = s - 2, - o = s - 1, - c = s, - C = a[n][0], - h = a[n][1]; - let l = Math.min(Math.floor((t - r) / 5), 1e3); - if (l < 3) return t - ((t - r) % 5); - let Q = r; + function (context, i) { + const MIN_CHARS_IN_BLOCK = 3; + const MAX_CHARS_IN_BLOCK = 1000; + const fnArray = context.fnArray, + argsArray = context.argsArray; + const curr = context.iCurr; + const iFirstBeginText = curr - 4; + const iFirstSetFont = curr - 3; + const iFirstSetTextMatrix = curr - 2; + const iFirstShowText = curr - 1; + const iFirstEndText = curr; + const firstSetFontArg0 = argsArray[iFirstSetFont][0]; + const firstSetFontArg1 = argsArray[iFirstSetFont][1]; + let count = Math.min( + Math.floor((i - iFirstBeginText) / 5), + MAX_CHARS_IN_BLOCK, + ); + if (count < MIN_CHARS_IN_BLOCK) { + return i - ((i - iFirstBeginText) % 5); + } + let iFirst = iFirstBeginText; if ( - r >= 4 && - i[r - 4] === i[n] && - i[r - 3] === i[g] && - i[r - 2] === i[o] && - i[r - 1] === i[c] && - a[r - 4][0] === C && - a[r - 4][1] === h + iFirstBeginText >= 4 && + fnArray[iFirstBeginText - 4] === fnArray[iFirstSetFont] && + fnArray[iFirstBeginText - 3] === fnArray[iFirstSetTextMatrix] && + fnArray[iFirstBeginText - 2] === fnArray[iFirstShowText] && + fnArray[iFirstBeginText - 1] === fnArray[iFirstEndText] && + argsArray[iFirstBeginText - 4][0] === firstSetFontArg0 && + argsArray[iFirstBeginText - 4][1] === firstSetFontArg1 ) { - l++; - Q -= 5; + count++; + iFirst -= 5; } - let E = Q + 4; - for (let e = 1; e < l; e++) { - i.splice(E, 3); - a.splice(E, 3); - E += 2; + let iEndText = iFirst + 4; + for (let q = 1; q < count; q++) { + fnArray.splice(iEndText, 3); + argsArray.splice(iEndText, 3); + iEndText += 2; } - return E + 1; + return iEndText + 1; }, ); class NullOptimizer { - constructor(e) { - this.queue = e; + constructor(queue) { + this.queue = queue; } _optimize() {} - push(e, t) { - this.queue.fnArray.push(e); - this.queue.argsArray.push(t); + push(fn, args) { + this.queue.fnArray.push(fn); + this.queue.argsArray.push(args); this._optimize(); } flush() {} reset() {} } class QueueOptimizer extends NullOptimizer { - constructor(e) { - super(e); + constructor(queue) { + super(queue); this.state = null; this.context = { iCurr: 0, - fnArray: e.fnArray, - argsArray: e.argsArray, - isOffscreenCanvasSupported: !1, + fnArray: queue.fnArray, + argsArray: queue.argsArray, + isOffscreenCanvasSupported: false, }; this.match = null; this.lastProcessed = 0; } - set isOffscreenCanvasSupported(e) { - this.context.isOffscreenCanvasSupported = e; + set isOffscreenCanvasSupported(value) { + this.context.isOffscreenCanvasSupported = value; } _optimize() { - const e = this.queue.fnArray; - let t = this.lastProcessed, - i = e.length, - a = this.state, - s = this.match; - if (!a && !s && t + 1 === i && !Ds[e[t]]) { - this.lastProcessed = i; + const fnArray = this.queue.fnArray; + let i = this.lastProcessed, + ii = fnArray.length; + let state = this.state; + let match = this.match; + if (!state && !match && i + 1 === ii && !InitialState[fnArray[i]]) { + this.lastProcessed = ii; return; } - const r = this.context; - for (; t < i; ) { - if (s) { - if ((0, s.iterateFn)(r, t)) { - t++; + const context = this.context; + while (i < ii) { + if (match) { + const iterate = (0, match.iterateFn)(context, i); + if (iterate) { + i++; continue; } - t = (0, s.processFn)(r, t + 1); - i = e.length; - s = null; - a = null; - if (t >= i) break; + i = (0, match.processFn)(context, i + 1); + ii = fnArray.length; + match = null; + state = null; + if (i >= ii) { + break; + } } - a = (a || Ds)[e[t]]; - if (a && !Array.isArray(a)) { - r.iCurr = t; - t++; - if (!a.checkFn || (0, a.checkFn)(r)) { - s = a; - a = null; - } else a = null; - } else t++; + state = (state || InitialState)[fnArray[i]]; + if (!state || Array.isArray(state)) { + i++; + continue; + } + context.iCurr = i; + i++; + if (state.checkFn && !(0, state.checkFn)(context)) { + state = null; + continue; + } + match = state; + state = null; } - this.state = a; - this.match = s; - this.lastProcessed = t; + this.state = state; + this.match = match; + this.lastProcessed = i; } flush() { - for (; this.match; ) { - const e = this.queue.fnArray.length; - this.lastProcessed = (0, this.match.processFn)(this.context, e); + while (this.match) { + const length = this.queue.fnArray.length; + this.lastProcessed = (0, this.match.processFn)(this.context, length); this.match = null; this.state = null; this._optimize(); @@ -32828,21 +38555,23 @@ class QueueOptimizer extends NullOptimizer { } } class OperatorList { - static CHUNK_SIZE = 1e3; + static CHUNK_SIZE = 1000; static CHUNK_SIZE_ABOUT = this.CHUNK_SIZE - 5; - constructor(e = 0, t) { - this._streamSink = t; + constructor(intent = 0, streamSink) { + this._streamSink = streamSink; this.fnArray = []; this.argsArray = []; this.optimizer = - !t || e & Q ? new NullOptimizer(this) : new QueueOptimizer(this); + streamSink && !(intent & RenderingIntentFlag.OPLIST) + ? new QueueOptimizer(this) + : new NullOptimizer(this); this.dependencies = new Set(); this._totalLength = 0; this.weight = 0; - this._resolved = t ? null : Promise.resolve(); + this._resolved = streamSink ? null : Promise.resolve(); } - set isOffscreenCanvasSupported(e) { - this.optimizer.isOffscreenCanvasSupported = e; + set isOffscreenCanvasSupported(value) { + this.optimizer.isOffscreenCanvasSupported = value; } get length() { return this.argsArray.length; @@ -32853,35 +38582,52 @@ class OperatorList { get totalLength() { return this._totalLength + this.length; } - addOp(e, t) { - this.optimizer.push(e, t); + addOp(fn, args) { + this.optimizer.push(fn, args); this.weight++; - this._streamSink && - (this.weight >= OperatorList.CHUNK_SIZE || - (this.weight >= OperatorList.CHUNK_SIZE_ABOUT && - (e === xA || e === Ae))) && - this.flush(); - } - addImageOps(e, t, i) { - void 0 !== i && this.addOp(Je, ["OC", i]); - this.addOp(e, t); - void 0 !== i && this.addOp(Ye, []); - } - addDependency(e) { - if (!this.dependencies.has(e)) { - this.dependencies.add(e); - this.addOp(yA, [e]); + if (this._streamSink) { + if (this.weight >= OperatorList.CHUNK_SIZE) { + this.flush(); + } else if ( + this.weight >= OperatorList.CHUNK_SIZE_ABOUT && + (fn === OPS.restore || fn === OPS.endText) + ) { + this.flush(); + } } } - addDependencies(e) { - for (const t of e) this.addDependency(t); + addImageOps(fn, args, optionalContent) { + if (optionalContent !== undefined) { + this.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); + } + this.addOp(fn, args); + if (optionalContent !== undefined) { + this.addOp(OPS.endMarkedContent, []); + } } - addOpList(e) { - if (e instanceof OperatorList) { - for (const t of e.dependencies) this.dependencies.add(t); - for (let t = 0, i = e.length; t < i; t++) - this.addOp(e.fnArray[t], e.argsArray[t]); - } else warn('addOpList - ignoring invalid "opList" parameter.'); + addDependency(dependency) { + if (this.dependencies.has(dependency)) { + return; + } + this.dependencies.add(dependency); + this.addOp(OPS.dependency, [dependency]); + } + addDependencies(dependencies) { + for (const dependency of dependencies) { + this.addDependency(dependency); + } + } + addOpList(opList) { + if (!(opList instanceof OperatorList)) { + warn('addOpList - ignoring invalid "opList" parameter.'); + return; + } + for (const dependency of opList.dependencies) { + this.dependencies.add(dependency); + } + for (let i = 0, ii = opList.length; i < ii; i++) { + this.addOp(opList.fnArray[i], opList.argsArray[i]); + } } getIR() { return { @@ -32891,31 +38637,33 @@ class OperatorList { }; } get _transfers() { - const e = [], - { fnArray: t, argsArray: i, length: a } = this; - for (let s = 0; s < a; s++) - switch (t[s]) { - case ze: - case _e: - case Xe: - const t = i[s][0]; - !t.cached && - t.data?.buffer instanceof ArrayBuffer && - e.push(t.data.buffer); + const transfers = []; + const { fnArray, argsArray, length } = this; + for (let i = 0; i < length; i++) { + switch (fnArray[i]) { + case OPS.paintInlineImageXObject: + case OPS.paintInlineImageXObjectGroup: + case OPS.paintImageMaskXObject: + const arg = argsArray[i][0]; + if (!arg.cached && arg.data?.buffer instanceof ArrayBuffer) { + transfers.push(arg.data.buffer); + } + break; } - return e; + } + return transfers; } - flush(e = !1, t = null) { + flush(lastChunk = false, separateAnnots = null) { this.optimizer.flush(); - const i = this.length; - this._totalLength += i; + const length = this.length; + this._totalLength += length; this._streamSink.enqueue( { fnArray: this.fnArray, argsArray: this.argsArray, - lastChunk: e, - separateAnnots: t, - length: i, + lastChunk, + separateAnnots, + length, }, 1, this._transfers, @@ -32926,302 +38674,360 @@ class OperatorList { this.weight = 0; this.optimizer.reset(); } +} // ./src/core/image.js + +function decodeAndClamp(value, addend, coefficient, max) { + value = addend + value * coefficient; + if (value < 0) { + value = 0; + } else if (value > max) { + value = max; + } + return value; } -function decodeAndClamp(e, t, i, a) { - (e = t + e * i) < 0 ? (e = 0) : e > a && (e = a); - return e; -} -function resizeImageMask(e, t, i, a, s, r) { - const n = s * r; - let g; - g = - t <= 8 - ? new Uint8Array(n) - : t <= 16 - ? new Uint16Array(n) - : new Uint32Array(n); - const o = i / s, - c = a / r; - let C, - h, - l, - Q, - E = 0; - const u = new Uint16Array(s), - d = i; - for (C = 0; C < s; C++) u[C] = Math.floor(C * o); - for (C = 0; C < r; C++) { - l = Math.floor(C * c) * d; - for (h = 0; h < s; h++) { - Q = l + u[h]; - g[E++] = e[Q]; +function resizeImageMask(src, bpc, w1, h1, w2, h2) { + const length = w2 * h2; + let dest; + if (bpc <= 8) { + dest = new Uint8Array(length); + } else if (bpc <= 16) { + dest = new Uint16Array(length); + } else { + dest = new Uint32Array(length); + } + const xRatio = w1 / w2; + const yRatio = h1 / h2; + let i, + j, + py, + newIndex = 0, + oldIndex; + const xScaled = new Uint16Array(w2); + const w1Scanline = w1; + for (i = 0; i < w2; i++) { + xScaled[i] = Math.floor(i * xRatio); + } + for (i = 0; i < h2; i++) { + py = Math.floor(i * yRatio) * w1Scanline; + for (j = 0; j < w2; j++) { + oldIndex = py + xScaled[j]; + dest[newIndex++] = src[oldIndex]; } } - return g; + return dest; } class PDFImage { constructor({ - xref: e, - res: t, - image: i, - isInline: a = !1, - smask: s = null, - mask: r = null, - isMask: n = !1, - pdfFunctionFactory: g, - localColorSpaceCache: o, + xref, + res, + image, + isInline = false, + smask = null, + mask = null, + isMask = false, + pdfFunctionFactory, + localColorSpaceCache, }) { - this.image = i; - const c = i.dict, - C = c.get("F", "Filter"); - let h; - if (C instanceof Name) h = C.name; - else if (Array.isArray(C)) { - const t = e.fetchIfRef(C[0]); - t instanceof Name && (h = t.name); + this.image = image; + const dict = image.dict; + const filter = dict.get("F", "Filter"); + let filterName; + if (filter instanceof Name) { + filterName = filter.name; + } else if (Array.isArray(filter)) { + const filterZero = xref.fetchIfRef(filter[0]); + if (filterZero instanceof Name) { + filterName = filterZero.name; + } } - switch (h) { + switch (filterName) { case "JPXDecode": ({ - width: i.width, - height: i.height, - componentsCount: i.numComps, - bitsPerComponent: i.bitsPerComponent, - } = JpxImage.parseImageProperties(i.stream)); - i.stream.reset(); + width: image.width, + height: image.height, + componentsCount: image.numComps, + bitsPerComponent: image.bitsPerComponent, + } = JpxImage.parseImageProperties(image.stream)); + image.stream.reset(); this.jpxDecoderOptions = { numComponents: 0, - isIndexedColormap: !1, - smaskInData: c.has("SMaskInData"), + isIndexedColormap: false, + smaskInData: dict.has("SMaskInData"), }; break; case "JBIG2Decode": - i.bitsPerComponent = 1; - i.numComps = 1; + image.bitsPerComponent = 1; + image.numComps = 1; + break; } - let l = c.get("W", "Width"), - Q = c.get("H", "Height"); + let width = dict.get("W", "Width"); + let height = dict.get("H", "Height"); if ( - Number.isInteger(i.width) && - i.width > 0 && - Number.isInteger(i.height) && - i.height > 0 && - (i.width !== l || i.height !== Q) + Number.isInteger(image.width) && + image.width > 0 && + Number.isInteger(image.height) && + image.height > 0 && + (image.width !== width || image.height !== height) ) { warn( - "PDFImage - using the Width/Height of the image data, rather than the image dictionary.", + "PDFImage - using the Width/Height of the image data, " + + "rather than the image dictionary.", ); - l = i.width; - Q = i.height; + width = image.width; + height = image.height; } - if (l < 1 || Q < 1) - throw new FormatError(`Invalid image width: ${l} or height: ${Q}`); - this.width = l; - this.height = Q; - this.interpolate = c.get("I", "Interpolate"); - this.imageMask = c.get("IM", "ImageMask") || !1; - this.matte = c.get("Matte") || !1; - let E = i.bitsPerComponent; - if (!E) { - E = c.get("BPC", "BitsPerComponent"); - if (!E) { - if (!this.imageMask) + if (width < 1 || height < 1) { + throw new FormatError( + `Invalid image width: ${width} or height: ${height}`, + ); + } + this.width = width; + this.height = height; + this.interpolate = dict.get("I", "Interpolate"); + this.imageMask = dict.get("IM", "ImageMask") || false; + this.matte = dict.get("Matte") || false; + let bitsPerComponent = image.bitsPerComponent; + if (!bitsPerComponent) { + bitsPerComponent = dict.get("BPC", "BitsPerComponent"); + if (!bitsPerComponent) { + if (this.imageMask) { + bitsPerComponent = 1; + } else { throw new FormatError( `Bits per component missing in image: ${this.imageMask}`, ); - E = 1; + } } } - this.bpc = E; + this.bpc = bitsPerComponent; if (!this.imageMask) { - let s = c.getRaw("CS") || c.getRaw("ColorSpace"); - const r = !!s; - if (r) - this.jpxDecoderOptions?.smaskInData && (s = Name.get("DeviceRGBA")); - else if (this.jpxDecoderOptions) s = Name.get("DeviceRGBA"); - else - switch (i.numComps) { - case 1: - s = Name.get("DeviceGray"); - break; - case 3: - s = Name.get("DeviceRGB"); - break; - case 4: - s = Name.get("DeviceCMYK"); - break; - default: - throw new Error( - `Images with ${i.numComps} color components not supported.`, - ); + let colorSpace = dict.getRaw("CS") || dict.getRaw("ColorSpace"); + const hasColorSpace = !!colorSpace; + if (!hasColorSpace) { + if (this.jpxDecoderOptions) { + colorSpace = Name.get("DeviceRGBA"); + } else { + switch (image.numComps) { + case 1: + colorSpace = Name.get("DeviceGray"); + break; + case 3: + colorSpace = Name.get("DeviceRGB"); + break; + case 4: + colorSpace = Name.get("DeviceCMYK"); + break; + default: + throw new Error( + `Images with ${image.numComps} color components not supported.`, + ); + } } + } else if (this.jpxDecoderOptions?.smaskInData) { + colorSpace = Name.get("DeviceRGBA"); + } this.colorSpace = ColorSpace.parse({ - cs: s, - xref: e, - resources: a ? t : null, - pdfFunctionFactory: g, - localColorSpaceCache: o, + cs: colorSpace, + xref, + resources: isInline ? res : null, + pdfFunctionFactory, + localColorSpaceCache, }); this.numComps = this.colorSpace.numComps; if (this.jpxDecoderOptions) { - this.jpxDecoderOptions.numComponents = r ? this.numComp : 0; + this.jpxDecoderOptions.numComponents = hasColorSpace ? this.numComp : 0; this.jpxDecoderOptions.isIndexedColormap = - "Indexed" === this.colorSpace.name; + this.colorSpace.name === "Indexed"; } } - this.decode = c.getArray("D", "Decode"); - this.needsDecode = !1; + this.decode = dict.getArray("D", "Decode"); + this.needsDecode = false; if ( this.decode && - ((this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode, E)) || - (n && !ColorSpace.isDefaultDecode(this.decode, 1))) + ((this.colorSpace && + !this.colorSpace.isDefaultDecode(this.decode, bitsPerComponent)) || + (isMask && !ColorSpace.isDefaultDecode(this.decode, 1))) ) { - this.needsDecode = !0; - const e = (1 << E) - 1; + this.needsDecode = true; + const max = (1 << bitsPerComponent) - 1; this.decodeCoefficients = []; this.decodeAddends = []; - const t = "Indexed" === this.colorSpace?.name; - for (let i = 0, a = 0; i < this.decode.length; i += 2, ++a) { - const s = this.decode[i], - r = this.decode[i + 1]; - this.decodeCoefficients[a] = t ? (r - s) / e : r - s; - this.decodeAddends[a] = t ? s : e * s; + const isIndexed = this.colorSpace?.name === "Indexed"; + for (let i = 0, j = 0; i < this.decode.length; i += 2, ++j) { + const dmin = this.decode[i]; + const dmax = this.decode[i + 1]; + this.decodeCoefficients[j] = isIndexed + ? (dmax - dmin) / max + : dmax - dmin; + this.decodeAddends[j] = isIndexed ? dmin : max * dmin; } } - if (s) + if (smask) { this.smask = new PDFImage({ - xref: e, - res: t, - image: s, - isInline: a, - pdfFunctionFactory: g, - localColorSpaceCache: o, + xref, + res, + image: smask, + isInline, + pdfFunctionFactory, + localColorSpaceCache, }); - else if (r) - if (r instanceof BaseStream) { - r.dict.get("IM", "ImageMask") - ? (this.mask = new PDFImage({ - xref: e, - res: t, - image: r, - isInline: a, - isMask: !0, - pdfFunctionFactory: g, - localColorSpaceCache: o, - })) - : warn("Ignoring /Mask in image without /ImageMask."); - } else this.mask = r; + } else if (mask) { + if (mask instanceof BaseStream) { + const maskDict = mask.dict, + imageMask = maskDict.get("IM", "ImageMask"); + if (!imageMask) { + warn("Ignoring /Mask in image without /ImageMask."); + } else { + this.mask = new PDFImage({ + xref, + res, + image: mask, + isInline, + isMask: true, + pdfFunctionFactory, + localColorSpaceCache, + }); + } + } else { + this.mask = mask; + } + } } static async buildImage({ - xref: e, - res: t, - image: i, - isInline: a = !1, - pdfFunctionFactory: s, - localColorSpaceCache: r, + xref, + res, + image, + isInline = false, + pdfFunctionFactory, + localColorSpaceCache, }) { - const n = i; - let g = null, - o = null; - const c = i.dict.get("SMask"), - C = i.dict.get("Mask"); - c - ? c instanceof BaseStream - ? (g = c) - : warn("Unsupported /SMask format.") - : C && - (C instanceof BaseStream || Array.isArray(C) - ? (o = C) - : warn("Unsupported /Mask format.")); + const imageData = image; + let smaskData = null; + let maskData = null; + const smask = image.dict.get("SMask"); + const mask = image.dict.get("Mask"); + if (smask) { + if (smask instanceof BaseStream) { + smaskData = smask; + } else { + warn("Unsupported /SMask format."); + } + } else if (mask) { + if (mask instanceof BaseStream || Array.isArray(mask)) { + maskData = mask; + } else { + warn("Unsupported /Mask format."); + } + } return new PDFImage({ - xref: e, - res: t, - image: n, - isInline: a, - smask: g, - mask: o, - pdfFunctionFactory: s, - localColorSpaceCache: r, + xref, + res, + image: imageData, + isInline, + smask: smaskData, + mask: maskData, + pdfFunctionFactory, + localColorSpaceCache, }); } static createRawMask({ - imgArray: e, - width: t, - height: i, - imageIsFromDecodeStream: a, - inverseDecode: s, - interpolate: r, + imgArray, + width, + height, + imageIsFromDecodeStream, + inverseDecode, + interpolate, }) { - const n = ((t + 7) >> 3) * i, - g = e.byteLength; - let o, c; - if (!a || (s && !(n === g))) - if (s) { - o = new Uint8Array(n); - o.set(e); - o.fill(255, g); - } else o = new Uint8Array(e); - else o = e; - if (s) for (c = 0; c < g; c++) o[c] ^= 255; - return { data: o, width: t, height: i, interpolate: r }; + const computedLength = ((width + 7) >> 3) * height; + const actualLength = imgArray.byteLength; + const haveFullData = computedLength === actualLength; + let data, i; + if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) { + data = imgArray; + } else if (!inverseDecode) { + data = new Uint8Array(imgArray); + } else { + data = new Uint8Array(computedLength); + data.set(imgArray); + data.fill(0xff, actualLength); + } + if (inverseDecode) { + for (i = 0; i < actualLength; i++) { + data[i] ^= 0xff; + } + } + return { + data, + width, + height, + interpolate, + }; } static async createMask({ - imgArray: e, - width: t, - height: i, - imageIsFromDecodeStream: a, - inverseDecode: s, - interpolate: r, - isOffscreenCanvasSupported: n = !1, + imgArray, + width, + height, + imageIsFromDecodeStream, + inverseDecode, + interpolate, + isOffscreenCanvasSupported = false, }) { - const g = 1 === t && 1 === i && s === (0 === e.length || !!(128 & e[0])); - if (g) return { isSingleOpaquePixel: g }; - if (n) { - if (ImageResizer.needsToBeResized(t, i)) { - const a = new Uint8ClampedArray(t * i * 4); + const isSingleOpaquePixel = + width === 1 && + height === 1 && + inverseDecode === (imgArray.length === 0 || !!(imgArray[0] & 128)); + if (isSingleOpaquePixel) { + return { + isSingleOpaquePixel, + }; + } + if (isOffscreenCanvasSupported) { + if (ImageResizer.needsToBeResized(width, height)) { + const data = new Uint8ClampedArray(width * height * 4); convertBlackAndWhiteToRGBA({ - src: e, - dest: a, - width: t, - height: i, + src: imgArray, + dest: data, + width, + height, nonBlackColor: 0, - inverseDecode: s, + inverseDecode, }); return ImageResizer.createImage({ - kind: F, - data: a, - width: t, - height: i, - interpolate: r, + kind: ImageKind.RGBA_32BPP, + data, + width, + height, + interpolate, }); } - const a = new OffscreenCanvas(t, i), - n = a.getContext("2d"), - g = n.createImageData(t, i); + const canvas = new OffscreenCanvas(width, height); + const ctx = canvas.getContext("2d"); + const imgData = ctx.createImageData(width, height); convertBlackAndWhiteToRGBA({ - src: e, - dest: g.data, - width: t, - height: i, + src: imgArray, + dest: imgData.data, + width, + height, nonBlackColor: 0, - inverseDecode: s, + inverseDecode, }); - n.putImageData(g, 0, 0); + ctx.putImageData(imgData, 0, 0); + const bitmap = canvas.transferToImageBitmap(); return { data: null, - width: t, - height: i, - interpolate: r, - bitmap: a.transferToImageBitmap(), + width, + height, + interpolate, + bitmap, }; } return this.createRawMask({ - imgArray: e, - width: t, - height: i, - inverseDecode: s, - imageIsFromDecodeStream: a, - interpolate: r, + imgArray, + width, + height, + inverseDecode, + imageIsFromDecodeStream, + interpolate, }); } get drawWidth() { @@ -33234,215 +39040,274 @@ class PDFImage { this.mask?.height || 0, ); } - decodeBuffer(e) { - const t = this.bpc, - i = this.numComps, - a = this.decodeAddends, - s = this.decodeCoefficients, - r = (1 << t) - 1; - let n, g; - if (1 === t) { - for (n = 0, g = e.length; n < g; n++) e[n] = +!e[n]; + decodeBuffer(buffer) { + const bpc = this.bpc; + const numComps = this.numComps; + const decodeAddends = this.decodeAddends; + const decodeCoefficients = this.decodeCoefficients; + const max = (1 << bpc) - 1; + let i, ii; + if (bpc === 1) { + for (i = 0, ii = buffer.length; i < ii; i++) { + buffer[i] = +!buffer[i]; + } return; } - let o = 0; - for (n = 0, g = this.width * this.height; n < g; n++) - for (let t = 0; t < i; t++) { - e[o] = decodeAndClamp(e[o], a[t], s[t], r); - o++; + let index = 0; + for (i = 0, ii = this.width * this.height; i < ii; i++) { + for (let j = 0; j < numComps; j++) { + buffer[index] = decodeAndClamp( + buffer[index], + decodeAddends[j], + decodeCoefficients[j], + max, + ); + index++; } + } } - getComponents(e) { - const t = this.bpc; - if (8 === t) return e; - const i = this.width, - a = this.height, - s = this.numComps, - r = i * a * s; - let n, - g = 0; - n = - t <= 8 - ? new Uint8Array(r) - : t <= 16 - ? new Uint16Array(r) - : new Uint32Array(r); - const o = i * s, - c = (1 << t) - 1; - let C, - h, - l = 0; - if (1 === t) { - let t, i, s; - for (let r = 0; r < a; r++) { - i = l + (-8 & o); - s = l + o; - for (; l < i; ) { - h = e[g++]; - n[l] = (h >> 7) & 1; - n[l + 1] = (h >> 6) & 1; - n[l + 2] = (h >> 5) & 1; - n[l + 3] = (h >> 4) & 1; - n[l + 4] = (h >> 3) & 1; - n[l + 5] = (h >> 2) & 1; - n[l + 6] = (h >> 1) & 1; - n[l + 7] = 1 & h; - l += 8; + getComponents(buffer) { + const bpc = this.bpc; + if (bpc === 8) { + return buffer; + } + const width = this.width; + const height = this.height; + const numComps = this.numComps; + const length = width * height * numComps; + let bufferPos = 0; + let output; + if (bpc <= 8) { + output = new Uint8Array(length); + } else if (bpc <= 16) { + output = new Uint16Array(length); + } else { + output = new Uint32Array(length); + } + const rowComps = width * numComps; + const max = (1 << bpc) - 1; + let i = 0, + ii, + buf; + if (bpc === 1) { + let mask, loop1End, loop2End; + for (let j = 0; j < height; j++) { + loop1End = i + (rowComps & ~7); + loop2End = i + rowComps; + while (i < loop1End) { + buf = buffer[bufferPos++]; + output[i] = (buf >> 7) & 1; + output[i + 1] = (buf >> 6) & 1; + output[i + 2] = (buf >> 5) & 1; + output[i + 3] = (buf >> 4) & 1; + output[i + 4] = (buf >> 3) & 1; + output[i + 5] = (buf >> 2) & 1; + output[i + 6] = (buf >> 1) & 1; + output[i + 7] = buf & 1; + i += 8; } - if (l < s) { - h = e[g++]; - t = 128; - for (; l < s; ) { - n[l++] = +!!(h & t); - t >>= 1; + if (i < loop2End) { + buf = buffer[bufferPos++]; + mask = 128; + while (i < loop2End) { + output[i++] = +!!(buf & mask); + mask >>= 1; } } } } else { - let i = 0; - h = 0; - for (l = 0, C = r; l < C; ++l) { - if (l % o == 0) { - h = 0; - i = 0; + let bits = 0; + buf = 0; + for (i = 0, ii = length; i < ii; ++i) { + if (i % rowComps === 0) { + buf = 0; + bits = 0; } - for (; i < t; ) { - h = (h << 8) | e[g++]; - i += 8; + while (bits < bpc) { + buf = (buf << 8) | buffer[bufferPos++]; + bits += 8; } - const a = i - t; - let s = h >> a; - s < 0 ? (s = 0) : s > c && (s = c); - n[l] = s; - h &= (1 << a) - 1; - i = a; + const remainingBits = bits - bpc; + let value = buf >> remainingBits; + if (value < 0) { + value = 0; + } else if (value > max) { + value = max; + } + output[i] = value; + buf &= (1 << remainingBits) - 1; + bits = remainingBits; } } - return n; + return output; } - async fillOpacity(e, t, i, a, s) { - const r = this.smask, - n = this.mask; - let g, o, c, C, h, l; - if (r) { - o = r.width; - c = r.height; - g = new Uint8ClampedArray(o * c); - await r.fillGrayBuffer(g); - (o === t && c === i) || (g = resizeImageMask(g, r.bpc, o, c, t, i)); - } else if (n) - if (n instanceof PDFImage) { - o = n.width; - c = n.height; - g = new Uint8ClampedArray(o * c); - n.numComps = 1; - await n.fillGrayBuffer(g); - for (C = 0, h = o * c; C < h; ++C) g[C] = 255 - g[C]; - (o === t && c === i) || (g = resizeImageMask(g, n.bpc, o, c, t, i)); - } else { - if (!Array.isArray(n)) throw new FormatError("Unknown mask format."); - { - g = new Uint8ClampedArray(t * i); - const e = this.numComps; - for (C = 0, h = t * i; C < h; ++C) { - let t = 0; - const i = C * e; - for (l = 0; l < e; ++l) { - const e = s[i + l], - a = 2 * l; - if (e < n[a] || e > n[a + 1]) { - t = 255; - break; - } - } - g[C] = t; - } - } + async fillOpacity(rgbaBuf, width, height, actualHeight, image) { + const smask = this.smask; + const mask = this.mask; + let alphaBuf, sw, sh, i, ii, j; + if (smask) { + sw = smask.width; + sh = smask.height; + alphaBuf = new Uint8ClampedArray(sw * sh); + await smask.fillGrayBuffer(alphaBuf); + if (sw !== width || sh !== height) { + alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, width, height); } - if (g) for (C = 0, l = 3, h = t * a; C < h; ++C, l += 4) e[l] = g[C]; - else for (C = 0, l = 3, h = t * a; C < h; ++C, l += 4) e[l] = 255; + } else if (mask) { + if (mask instanceof PDFImage) { + sw = mask.width; + sh = mask.height; + alphaBuf = new Uint8ClampedArray(sw * sh); + mask.numComps = 1; + await mask.fillGrayBuffer(alphaBuf); + for (i = 0, ii = sw * sh; i < ii; ++i) { + alphaBuf[i] = 255 - alphaBuf[i]; + } + if (sw !== width || sh !== height) { + alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, width, height); + } + } else if (Array.isArray(mask)) { + alphaBuf = new Uint8ClampedArray(width * height); + const numComps = this.numComps; + for (i = 0, ii = width * height; i < ii; ++i) { + let opacity = 0; + const imageOffset = i * numComps; + for (j = 0; j < numComps; ++j) { + const color = image[imageOffset + j]; + const maskOffset = j * 2; + if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { + opacity = 255; + break; + } + } + alphaBuf[i] = opacity; + } + } else { + throw new FormatError("Unknown mask format."); + } + } + if (alphaBuf) { + for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { + rgbaBuf[j] = alphaBuf[i]; + } + } else { + for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { + rgbaBuf[j] = 255; + } + } } - undoPreblend(e, t, i) { - const a = this.smask?.matte; - if (!a) return; - const s = this.colorSpace.getRgb(a, 0), - r = s[0], - n = s[1], - g = s[2], - o = t * i * 4; - for (let t = 0; t < o; t += 4) { - const i = e[t + 3]; - if (0 === i) { - e[t] = 255; - e[t + 1] = 255; - e[t + 2] = 255; + undoPreblend(buffer, width, height) { + const matte = this.smask?.matte; + if (!matte) { + return; + } + const matteRgb = this.colorSpace.getRgb(matte, 0); + const matteR = matteRgb[0]; + const matteG = matteRgb[1]; + const matteB = matteRgb[2]; + const length = width * height * 4; + for (let i = 0; i < length; i += 4) { + const alpha = buffer[i + 3]; + if (alpha === 0) { + buffer[i] = 255; + buffer[i + 1] = 255; + buffer[i + 2] = 255; continue; } - const a = 255 / i; - e[t] = (e[t] - r) * a + r; - e[t + 1] = (e[t + 1] - n) * a + n; - e[t + 2] = (e[t + 2] - g) * a + g; + const k = 255 / alpha; + buffer[i] = (buffer[i] - matteR) * k + matteR; + buffer[i + 1] = (buffer[i + 1] - matteG) * k + matteG; + buffer[i + 2] = (buffer[i + 2] - matteB) * k + matteB; } } - async createImageData(e = !1, t = !1) { - const i = this.drawWidth, - a = this.drawHeight, - s = { - width: i, - height: a, - interpolate: this.interpolate, - kind: 0, - data: null, - }, - r = this.numComps, - n = this.width, - g = this.height, - o = this.bpc, - c = (n * r * o + 7) >> 3, - C = t && ImageResizer.needsToBeResized(i, a); - if ("DeviceRGBA" === this.colorSpace.name) { - s.kind = F; - const e = (s.data = await this.getImageBytes(g * n * 4, {})); - return t - ? C - ? ImageResizer.createImage(s, !1) - : this.createBitmap(F, i, a, e) - : s; + async createImageData(forceRGBA = false, isOffscreenCanvasSupported = false) { + const drawWidth = this.drawWidth; + const drawHeight = this.drawHeight; + const imgData = { + width: drawWidth, + height: drawHeight, + interpolate: this.interpolate, + kind: 0, + data: null, + }; + const numComps = this.numComps; + const originalWidth = this.width; + const originalHeight = this.height; + const bpc = this.bpc; + const rowBytes = (originalWidth * numComps * bpc + 7) >> 3; + const mustBeResized = + isOffscreenCanvasSupported && + ImageResizer.needsToBeResized(drawWidth, drawHeight); + if (!this.smask && !this.mask && this.colorSpace.name === "DeviceRGBA") { + imgData.kind = ImageKind.RGBA_32BPP; + const imgArray = (imgData.data = await this.getImageBytes( + originalHeight * originalWidth * 4, + {}, + )); + if (isOffscreenCanvasSupported) { + if (!mustBeResized) { + return this.createBitmap( + ImageKind.RGBA_32BPP, + drawWidth, + drawHeight, + imgArray, + ); + } + return ImageResizer.createImage(imgData, false); + } + return imgData; } - if (!e) { - let e; - "DeviceGray" === this.colorSpace.name && 1 === o - ? (e = D) - : "DeviceRGB" !== this.colorSpace.name || - 8 !== o || - this.needsDecode || - (e = b); - if (e && !this.smask && !this.mask && i === n && a === g) { - const r = await this.getImageBytes(g * c, {}); - if (t) - return C - ? ImageResizer.createImage( - { - data: r, - kind: e, - width: i, - height: a, - interpolate: this.interpolate, - }, - this.needsDecode, - ) - : this.createBitmap(e, n, g, r); - s.kind = e; - s.data = r; + if (!forceRGBA) { + let kind; + if (this.colorSpace.name === "DeviceGray" && bpc === 1) { + kind = ImageKind.GRAYSCALE_1BPP; + } else if ( + this.colorSpace.name === "DeviceRGB" && + bpc === 8 && + !this.needsDecode + ) { + kind = ImageKind.RGB_24BPP; + } + if ( + kind && + !this.smask && + !this.mask && + drawWidth === originalWidth && + drawHeight === originalHeight + ) { + const image = await this.#getImage(originalWidth, originalHeight); + if (image) { + return image; + } + const data = await this.getImageBytes(originalHeight * rowBytes, {}); + if (isOffscreenCanvasSupported) { + if (mustBeResized) { + return ImageResizer.createImage( + { + data, + kind, + width: drawWidth, + height: drawHeight, + interpolate: this.interpolate, + }, + this.needsDecode, + ); + } + return this.createBitmap(kind, originalWidth, originalHeight, data); + } + imgData.kind = kind; + imgData.data = data; if (this.needsDecode) { assert( - e === D, + kind === ImageKind.GRAYSCALE_1BPP, "PDFImage.createImageData: The image must be grayscale.", ); - const t = s.data; - for (let e = 0, i = t.length; e < i; e++) t[e] ^= 255; + const buffer = imgData.data; + for (let i = 0, ii = buffer.length; i < ii; i++) { + buffer[i] ^= 0xff; + } } - return s; + return imgData; } if ( this.image instanceof JpegStream && @@ -33450,187 +39315,272 @@ class PDFImage { !this.mask && !this.needsDecode ) { - let e = g * c; - if (t && !C) { - let t = !1; + let imageLength = originalHeight * rowBytes; + if (isOffscreenCanvasSupported && !mustBeResized) { + let isHandled = false; switch (this.colorSpace.name) { case "DeviceGray": - e *= 4; - t = !0; + imageLength *= 4; + isHandled = true; break; case "DeviceRGB": - e = (e / 3) * 4; - t = !0; + imageLength = (imageLength / 3) * 4; + isHandled = true; break; case "DeviceCMYK": - t = !0; + isHandled = true; + break; } - if (t) { - const t = await this.getImageBytes(e, { - drawWidth: i, - drawHeight: a, - forceRGBA: !0, + if (isHandled) { + const image = await this.#getImage(drawWidth, drawHeight); + if (image) { + return image; + } + const rgba = await this.getImageBytes(imageLength, { + drawWidth, + drawHeight, + forceRGBA: true, }); - return this.createBitmap(F, i, a, t); + return this.createBitmap( + ImageKind.RGBA_32BPP, + drawWidth, + drawHeight, + rgba, + ); } - } else + } else { switch (this.colorSpace.name) { case "DeviceGray": - e *= 3; + imageLength *= 3; case "DeviceRGB": case "DeviceCMYK": - s.kind = b; - s.data = await this.getImageBytes(e, { - drawWidth: i, - drawHeight: a, - forceRGB: !0, + imgData.kind = ImageKind.RGB_24BPP; + imgData.data = await this.getImageBytes(imageLength, { + drawWidth, + drawHeight, + forceRGB: true, }); - return C ? ImageResizer.createImage(s) : s; + if (mustBeResized) { + return ImageResizer.createImage(imgData); + } + return imgData; } + } } } - const h = await this.getImageBytes(g * c, { internal: !0 }), - l = 0 | (((h.length / c) * a) / g), - Q = this.getComponents(h); - let E, u, d, f, p, m; - if (t && !C) { - d = new OffscreenCanvas(i, a); - f = d.getContext("2d"); - p = f.createImageData(i, a); - m = p.data; + const imgArray = await this.getImageBytes(originalHeight * rowBytes, { + internal: true, + }); + const actualHeight = + 0 | (((imgArray.length / rowBytes) * drawHeight) / originalHeight); + const comps = this.getComponents(imgArray); + let alpha01, maybeUndoPreblend; + let canvas, ctx, canvasImgData, data; + if (isOffscreenCanvasSupported && !mustBeResized) { + canvas = new OffscreenCanvas(drawWidth, drawHeight); + ctx = canvas.getContext("2d"); + canvasImgData = ctx.createImageData(drawWidth, drawHeight); + data = canvasImgData.data; } - s.kind = F; - if (e || this.smask || this.mask) { - (t && !C) || (m = new Uint8ClampedArray(i * a * 4)); - E = 1; - u = !0; - await this.fillOpacity(m, i, a, l, Q); - } else { - if (!t || C) { - s.kind = b; - m = new Uint8ClampedArray(i * a * 3); - E = 0; + imgData.kind = ImageKind.RGBA_32BPP; + if (!forceRGBA && !this.smask && !this.mask) { + if (!isOffscreenCanvasSupported || mustBeResized) { + imgData.kind = ImageKind.RGB_24BPP; + data = new Uint8ClampedArray(drawWidth * drawHeight * 3); + alpha01 = 0; } else { - new Uint32Array(m.buffer).fill( - FeatureTest.isLittleEndian ? 4278190080 : 255, - ); - E = 1; + const arr = new Uint32Array(data.buffer); + arr.fill(FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff); + alpha01 = 1; } - u = !1; + maybeUndoPreblend = false; + } else { + if (!isOffscreenCanvasSupported || mustBeResized) { + data = new Uint8ClampedArray(drawWidth * drawHeight * 4); + } + alpha01 = 1; + maybeUndoPreblend = true; + await this.fillOpacity(data, drawWidth, drawHeight, actualHeight, comps); } - this.needsDecode && this.decodeBuffer(Q); - this.colorSpace.fillRgb(m, n, g, i, a, l, o, Q, E); - u && this.undoPreblend(m, i, l); - if (t && !C) { - f.putImageData(p, 0, 0); + if (this.needsDecode) { + this.decodeBuffer(comps); + } + this.colorSpace.fillRgb( + data, + originalWidth, + originalHeight, + drawWidth, + drawHeight, + actualHeight, + bpc, + comps, + alpha01, + ); + if (maybeUndoPreblend) { + this.undoPreblend(data, drawWidth, actualHeight); + } + if (isOffscreenCanvasSupported && !mustBeResized) { + ctx.putImageData(canvasImgData, 0, 0); + const bitmap = canvas.transferToImageBitmap(); return { data: null, - width: i, - height: a, - bitmap: d.transferToImageBitmap(), + width: drawWidth, + height: drawHeight, + bitmap, interpolate: this.interpolate, }; } - s.data = m; - return C ? ImageResizer.createImage(s) : s; + imgData.data = data; + if (mustBeResized) { + return ImageResizer.createImage(imgData); + } + return imgData; } - async fillGrayBuffer(e) { - const t = this.numComps; - if (1 !== t) - throw new FormatError(`Reading gray scale from a color image: ${t}`); - const i = this.width, - a = this.height, - s = this.bpc, - r = (i * t * s + 7) >> 3, - n = await this.getImageBytes(a * r, { internal: !0 }), - g = this.getComponents(n); - let o, c; - if (1 === s) { - c = i * a; - if (this.needsDecode) for (o = 0; o < c; ++o) e[o] = (g[o] - 1) & 255; - else for (o = 0; o < c; ++o) e[o] = 255 & -g[o]; + async fillGrayBuffer(buffer) { + const numComps = this.numComps; + if (numComps !== 1) { + throw new FormatError( + `Reading gray scale from a color image: ${numComps}`, + ); + } + const width = this.width; + const height = this.height; + const bpc = this.bpc; + const rowBytes = (width * numComps * bpc + 7) >> 3; + const imgArray = await this.getImageBytes(height * rowBytes, { + internal: true, + }); + const comps = this.getComponents(imgArray); + let i, length; + if (bpc === 1) { + length = width * height; + if (this.needsDecode) { + for (i = 0; i < length; ++i) { + buffer[i] = (comps[i] - 1) & 255; + } + } else { + for (i = 0; i < length; ++i) { + buffer[i] = -comps[i] & 255; + } + } return; } - this.needsDecode && this.decodeBuffer(g); - c = i * a; - const C = 255 / ((1 << s) - 1); - for (o = 0; o < c; ++o) e[o] = C * g[o]; + if (this.needsDecode) { + this.decodeBuffer(comps); + } + length = width * height; + const scale = 255 / ((1 << bpc) - 1); + for (i = 0; i < length; ++i) { + buffer[i] = scale * comps[i]; + } } - createBitmap(e, t, i, a) { - const s = new OffscreenCanvas(t, i), - r = s.getContext("2d"); - let n; - if (e === F) n = new ImageData(a, t, i); - else { - n = r.createImageData(t, i); + createBitmap(kind, width, height, src) { + const canvas = new OffscreenCanvas(width, height); + const ctx = canvas.getContext("2d"); + let imgData; + if (kind === ImageKind.RGBA_32BPP) { + imgData = new ImageData(src, width, height); + } else { + imgData = ctx.createImageData(width, height); convertToRGBA({ - kind: e, - src: a, - dest: new Uint32Array(n.data.buffer), - width: t, - height: i, + kind, + src, + dest: new Uint32Array(imgData.data.buffer), + width, + height, inverseDecode: this.needsDecode, }); } - r.putImageData(n, 0, 0); + ctx.putImageData(imgData, 0, 0); + const bitmap = canvas.transferToImageBitmap(); return { data: null, - width: t, - height: i, - bitmap: s.transferToImageBitmap(), + width, + height, + bitmap, + interpolate: this.interpolate, + }; + } + async #getImage(width, height) { + const bitmap = await this.image.getTransferableImage(); + if (!bitmap) { + return null; + } + return { + data: null, + width, + height, + bitmap, interpolate: this.interpolate, }; } async getImageBytes( - e, + length, { - drawWidth: t, - drawHeight: i, - forceRGBA: a = !1, - forceRGB: s = !1, - internal: r = !1, + drawWidth, + drawHeight, + forceRGBA = false, + forceRGB = false, + internal = false, }, ) { this.image.reset(); - this.image.drawWidth = t || this.width; - this.image.drawHeight = i || this.height; - this.image.forceRGBA = !!a; - this.image.forceRGB = !!s; - const n = await this.image.getImageData(e, this.jpxDecoderOptions); - if (r || this.image instanceof DecodeStream) return n; + this.image.drawWidth = drawWidth || this.width; + this.image.drawHeight = drawHeight || this.height; + this.image.forceRGBA = !!forceRGBA; + this.image.forceRGB = !!forceRGB; + const imageBytes = await this.image.getImageData( + length, + this.jpxDecoderOptions, + ); + if (internal || this.image instanceof DecodeStream) { + return imageBytes; + } assert( - n instanceof Uint8Array, + imageBytes instanceof Uint8Array, 'PDFImage.getImageBytes: Unsupported "imageBytes" type.', ); - return new Uint8Array(n); + return new Uint8Array(imageBytes); } -} -const bs = Object.freeze({ - maxImageSize: -1, - disableFontFace: !1, - ignoreErrors: !1, - isEvalSupported: !0, - isOffscreenCanvasSupported: !1, - canvasMaxAreaInBytes: -1, - fontExtraProperties: !1, - useSystemFonts: !0, - cMapUrl: null, - standardFontDataUrl: null, - }), - Fs = 1, - Ss = 2, - ks = Promise.resolve(); -function normalizeBlendMode(e, t = !1) { - if (Array.isArray(e)) { - for (const t of e) { - const e = normalizeBlendMode(t, !0); - if (e) return e; +} // ./src/core/evaluator.js + +const DefaultPartialEvaluatorOptions = Object.freeze({ + maxImageSize: -1, + disableFontFace: false, + ignoreErrors: false, + isEvalSupported: true, + isOffscreenCanvasSupported: false, + isChrome: false, + canvasMaxAreaInBytes: -1, + fontExtraProperties: false, + useSystemFonts: true, + cMapUrl: null, + standardFontDataUrl: null, +}); +const PatternType = { + TILING: 1, + SHADING: 2, +}; +const TEXT_CHUNK_BATCH_SIZE = 10; +const deferred = Promise.resolve(); +function normalizeBlendMode(value, parsingArray = false) { + if (Array.isArray(value)) { + for (const val of value) { + const maybeBM = normalizeBlendMode(val, true); + if (maybeBM) { + return maybeBM; + } } - warn(`Unsupported blend mode Array: ${e}`); + warn(`Unsupported blend mode Array: ${value}`); return "source-over"; } - if (!(e instanceof Name)) return t ? null : "source-over"; - switch (e.name) { + if (!(value instanceof Name)) { + if (parsingArray) { + return null; + } + return "source-over"; + } + switch (value.name) { case "Normal": case "Compatible": return "source-over"; @@ -33665,14 +39615,20 @@ function normalizeBlendMode(e, t = !1) { case "Luminosity": return "luminosity"; } - if (t) return null; - warn(`Unsupported blend mode: ${e.name}`); + if (parsingArray) { + return null; + } + warn(`Unsupported blend mode: ${value.name}`); return "source-over"; } -function addLocallyCachedImageOps(e, t) { - t.objId && e.addDependency(t.objId); - e.addImageOps(t.fn, t.args, t.optionalContent); - t.fn === Xe && t.args[0]?.count > 0 && t.args[0].count++; +function addLocallyCachedImageOps(opList, data) { + if (data.objId) { + opList.addDependency(data.objId); + } + opList.addImageOps(data.fn, data.args, data.optionalContent); + if (data.fn === OPS.paintImageMaskXObject && data.args[0]?.count > 0) { + data.args[0].count++; + } } class TimeSlotManager { static TIME_SLOT_DURATION_MS = 20; @@ -33681,7 +39637,9 @@ class TimeSlotManager { this.reset(); } check() { - if (++this.checked < TimeSlotManager.CHECK_TIME_EVERY) return !1; + if (++this.checked < TimeSlotManager.CHECK_TIME_EVERY) { + return false; + } this.checked = 0; return this.endTime <= Date.now(); } @@ -33692,526 +39650,783 @@ class TimeSlotManager { } class PartialEvaluator { constructor({ - xref: e, - handler: t, - pageIndex: i, - idFactory: a, - fontCache: s, - builtInCMapCache: r, - standardFontDataCache: n, - globalImageCache: g, - systemFontCache: o, - options: c = null, + xref, + handler, + pageIndex, + idFactory, + fontCache, + builtInCMapCache, + standardFontDataCache, + globalImageCache, + systemFontCache, + options = null, }) { - this.xref = e; - this.handler = t; - this.pageIndex = i; - this.idFactory = a; - this.fontCache = s; - this.builtInCMapCache = r; - this.standardFontDataCache = n; - this.globalImageCache = g; - this.systemFontCache = o; - this.options = c || bs; + this.xref = xref; + this.handler = handler; + this.pageIndex = pageIndex; + this.idFactory = idFactory; + this.fontCache = fontCache; + this.builtInCMapCache = builtInCMapCache; + this.standardFontDataCache = standardFontDataCache; + this.globalImageCache = globalImageCache; + this.systemFontCache = systemFontCache; + this.options = options || DefaultPartialEvaluatorOptions; this.type3FontRefs = null; this._regionalImageCache = new RegionalImageCache(); this._fetchBuiltInCMapBound = this.fetchBuiltInCMap.bind(this); - ImageResizer.setMaxArea(this.options.canvasMaxAreaInBytes); + ImageResizer.setOptions({ + isChrome: this.options.isChrome, + maxArea: this.options.canvasMaxAreaInBytes, + }); } get _pdfFunctionFactory() { - return shadow( - this, - "_pdfFunctionFactory", - new PDFFunctionFactory({ - xref: this.xref, - isEvalSupported: this.options.isEvalSupported, - }), - ); + const pdfFunctionFactory = new PDFFunctionFactory({ + xref: this.xref, + isEvalSupported: this.options.isEvalSupported, + }); + return shadow(this, "_pdfFunctionFactory", pdfFunctionFactory); } get parsingType3Font() { return !!this.type3FontRefs; } - clone(e = null) { - const t = Object.create(this); - t.options = Object.assign(Object.create(null), this.options, e); - return t; + clone(newOptions = null) { + const newEvaluator = Object.create(this); + newEvaluator.options = Object.assign( + Object.create(null), + this.options, + newOptions, + ); + return newEvaluator; } - hasBlendModes(e, t) { - if (!(e instanceof Dict)) return !1; - if (e.objId && t.has(e.objId)) return !1; - const i = new RefSet(t); - e.objId && i.put(e.objId); - const a = [e], - s = this.xref; - for (; a.length; ) { - const e = a.shift(), - t = e.get("ExtGState"); - if (t instanceof Dict) - for (let e of t.getRawValues()) { - if (e instanceof Ref) { - if (i.has(e)) continue; - try { - e = s.fetch(e); - } catch (t) { - i.put(e); - info(`hasBlendModes - ignoring ExtGState: "${t}".`); - continue; - } - } - if (!(e instanceof Dict)) continue; - e.objId && i.put(e.objId); - const t = e.get("BM"); - if (t instanceof Name) { - if ("Normal" !== t.name) return !0; - } else if (void 0 !== t && Array.isArray(t)) - for (const e of t) - if (e instanceof Name && "Normal" !== e.name) return !0; - } - const r = e.get("XObject"); - if (r instanceof Dict) - for (let e of r.getRawValues()) { - if (e instanceof Ref) { - if (i.has(e)) continue; - try { - e = s.fetch(e); - } catch (t) { - i.put(e); - info(`hasBlendModes - ignoring XObject: "${t}".`); - continue; - } - } - if (!(e instanceof BaseStream)) continue; - e.dict.objId && i.put(e.dict.objId); - const t = e.dict.get("Resources"); - if (t instanceof Dict && (!t.objId || !i.has(t.objId))) { - a.push(t); - t.objId && i.put(t.objId); - } - } + hasBlendModes(resources, nonBlendModesSet) { + if (!(resources instanceof Dict)) { + return false; } - for (const e of i) t.put(e); - return !1; + if (resources.objId && nonBlendModesSet.has(resources.objId)) { + return false; + } + const processed = new RefSet(nonBlendModesSet); + if (resources.objId) { + processed.put(resources.objId); + } + const nodes = [resources], + xref = this.xref; + while (nodes.length) { + const node = nodes.shift(); + const graphicStates = node.get("ExtGState"); + if (graphicStates instanceof Dict) { + for (let graphicState of graphicStates.getRawValues()) { + if (graphicState instanceof Ref) { + if (processed.has(graphicState)) { + continue; + } + try { + graphicState = xref.fetch(graphicState); + } catch (ex) { + processed.put(graphicState); + info(`hasBlendModes - ignoring ExtGState: "${ex}".`); + continue; + } + } + if (!(graphicState instanceof Dict)) { + continue; + } + if (graphicState.objId) { + processed.put(graphicState.objId); + } + const bm = graphicState.get("BM"); + if (bm instanceof Name) { + if (bm.name !== "Normal") { + return true; + } + continue; + } + if (bm !== undefined && Array.isArray(bm)) { + for (const element of bm) { + if (element instanceof Name && element.name !== "Normal") { + return true; + } + } + } + } + } + const xObjects = node.get("XObject"); + if (!(xObjects instanceof Dict)) { + continue; + } + for (let xObject of xObjects.getRawValues()) { + if (xObject instanceof Ref) { + if (processed.has(xObject)) { + continue; + } + try { + xObject = xref.fetch(xObject); + } catch (ex) { + processed.put(xObject); + info(`hasBlendModes - ignoring XObject: "${ex}".`); + continue; + } + } + if (!(xObject instanceof BaseStream)) { + continue; + } + if (xObject.dict.objId) { + processed.put(xObject.dict.objId); + } + const xResources = xObject.dict.get("Resources"); + if (!(xResources instanceof Dict)) { + continue; + } + if (xResources.objId && processed.has(xResources.objId)) { + continue; + } + nodes.push(xResources); + if (xResources.objId) { + processed.put(xResources.objId); + } + } + } + for (const ref of processed) { + nonBlendModesSet.put(ref); + } + return false; } - async fetchBuiltInCMap(e) { - const t = this.builtInCMapCache.get(e); - if (t) return t; - let i; - if (null !== this.options.cMapUrl) { - const t = `${this.options.cMapUrl}${e}.bcmap`, - a = await fetch(t); - if (!a.ok) + async fetchBuiltInCMap(name) { + const cachedData = this.builtInCMapCache.get(name); + if (cachedData) { + return cachedData; + } + let data; + if (this.options.cMapUrl !== null) { + const url = `${this.options.cMapUrl}${name}.bcmap`; + const response = await fetch(url); + if (!response.ok) { throw new Error( - `fetchBuiltInCMap: failed to fetch file "${t}" with "${a.statusText}".`, + `fetchBuiltInCMap: failed to fetch file "${url}" with "${response.statusText}".`, ); - i = { - cMapData: new Uint8Array(await a.arrayBuffer()), - compressionType: mA.BINARY, + } + data = { + cMapData: new Uint8Array(await response.arrayBuffer()), + isCompressed: true, }; - } else - i = await this.handler.sendWithPromise("FetchBuiltInCMap", { name: e }); - i.compressionType !== mA.NONE && this.builtInCMapCache.set(e, i); - return i; + } else { + data = await this.handler.sendWithPromise("FetchBuiltInCMap", { + name, + }); + } + this.builtInCMapCache.set(name, data); + return data; } - async fetchStandardFontData(e) { - const t = this.standardFontDataCache.get(e); - if (t) return new Stream(t); - if (this.options.useSystemFonts && "Symbol" !== e && "ZapfDingbats" !== e) + async fetchStandardFontData(name) { + const cachedData = this.standardFontDataCache.get(name); + if (cachedData) { + return new Stream(cachedData); + } + if ( + this.options.useSystemFonts && + name !== "Symbol" && + name !== "ZapfDingbats" + ) { return null; - const i = Wi()[e]; - let a; - if (null !== this.options.standardFontDataUrl) { - const e = `${this.options.standardFontDataUrl}${i}`, - t = await fetch(e); - t.ok - ? (a = new Uint8Array(await t.arrayBuffer())) - : warn( - `fetchStandardFontData: failed to fetch file "${e}" with "${t.statusText}".`, - ); - } else + } + const standardFontNameToFileName = getFontNameToFileMap(), + filename = standardFontNameToFileName[name]; + let data; + if (this.options.standardFontDataUrl !== null) { + const url = `${this.options.standardFontDataUrl}${filename}`; + const response = await fetch(url); + if (!response.ok) { + warn( + `fetchStandardFontData: failed to fetch file "${url}" with "${response.statusText}".`, + ); + } else { + data = new Uint8Array(await response.arrayBuffer()); + } + } else { try { - a = await this.handler.sendWithPromise("FetchStandardFontData", { - filename: i, + data = await this.handler.sendWithPromise("FetchStandardFontData", { + filename, }); } catch (e) { - warn(`fetchStandardFontData: failed to fetch file "${i}" with "${e}".`); + warn( + `fetchStandardFontData: failed to fetch file "${filename}" with "${e}".`, + ); } - if (!a) return null; - this.standardFontDataCache.set(e, a); - return new Stream(a); + } + if (!data) { + return null; + } + this.standardFontDataCache.set(name, data); + return new Stream(data); } - async buildFormXObject(e, t, i, a, s, r, n) { - const g = t.dict, - o = lookupMatrix(g.getArray("Matrix"), null), - c = lookupNormalRect(g.getArray("BBox"), null); - let C, h; - g.has("OC") && (C = await this.parseMarkedContentProps(g.get("OC"), e)); - void 0 !== C && a.addOp(Je, ["OC", C]); - const l = g.get("Group"); - if (l) { - h = { matrix: o, bbox: c, smask: i, isolated: !1, knockout: !1 }; - let t = null; - if (isName(l.get("S"), "Transparency")) { - h.isolated = l.get("I") || !1; - h.knockout = l.get("K") || !1; - if (l.has("CS")) { - const i = l.getRaw("CS"), - a = ColorSpace.getCached(i, this.xref, n); - t = - a || - (await this.parseColorSpace({ - cs: i, - resources: e, - localColorSpaceCache: n, - })); + async buildFormXObject( + resources, + xobj, + smask, + operatorList, + task, + initialState, + localColorSpaceCache, + ) { + const dict = xobj.dict; + const matrix = lookupMatrix(dict.getArray("Matrix"), null); + const bbox = lookupNormalRect(dict.getArray("BBox"), null); + let optionalContent, groupOptions; + if (dict.has("OC")) { + optionalContent = await this.parseMarkedContentProps( + dict.get("OC"), + resources, + ); + } + if (optionalContent !== undefined) { + operatorList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); + } + const group = dict.get("Group"); + if (group) { + groupOptions = { + matrix, + bbox, + smask, + isolated: false, + knockout: false, + }; + const groupSubtype = group.get("S"); + let colorSpace = null; + if (isName(groupSubtype, "Transparency")) { + groupOptions.isolated = group.get("I") || false; + groupOptions.knockout = group.get("K") || false; + if (group.has("CS")) { + const cs = group.getRaw("CS"); + const cachedColorSpace = ColorSpace.getCached( + cs, + this.xref, + localColorSpaceCache, + ); + if (cachedColorSpace) { + colorSpace = cachedColorSpace; + } else { + colorSpace = await this.parseColorSpace({ + cs, + resources, + localColorSpaceCache, + }); + } } } - if (i?.backdrop) { - t ||= ColorSpace.singletons.rgb; - i.backdrop = t.getRgb(i.backdrop, 0); + if (smask?.backdrop) { + colorSpace ||= ColorSpace.singletons.rgb; + smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); } - a.addOp(Oe, [h]); + operatorList.addOp(OPS.beginGroup, [groupOptions]); } - const Q = l ? [o, null] : [o, c]; - a.addOp(Te, Q); + const args = group ? [matrix, null] : [matrix, bbox]; + operatorList.addOp(OPS.paintFormXObjectBegin, args); await this.getOperatorList({ - stream: t, - task: s, - resources: g.get("Resources") || e, - operatorList: a, - initialState: r, + stream: xobj, + task, + resources: dict.get("Resources") || resources, + operatorList, + initialState, }); - a.addOp(qe, []); - l && a.addOp(Pe, [h]); - void 0 !== C && a.addOp(Ye, []); + operatorList.addOp(OPS.paintFormXObjectEnd, []); + if (group) { + operatorList.addOp(OPS.endGroup, [groupOptions]); + } + if (optionalContent !== undefined) { + operatorList.addOp(OPS.endMarkedContent, []); + } } - _sendImgData(e, t, i = !1) { - const a = t ? [t.bitmap || t.data.buffer] : null; - return this.parsingType3Font || i - ? this.handler.send("commonobj", [e, "Image", t], a) - : this.handler.send("obj", [e, this.pageIndex, "Image", t], a); + _sendImgData(objId, imgData, cacheGlobally = false) { + const transfers = imgData ? [imgData.bitmap || imgData.data.buffer] : null; + if (this.parsingType3Font || cacheGlobally) { + return this.handler.send( + "commonobj", + [objId, "Image", imgData], + transfers, + ); + } + return this.handler.send( + "obj", + [objId, this.pageIndex, "Image", imgData], + transfers, + ); } async buildPaintImageXObject({ - resources: e, - image: t, - isInline: i = !1, - operatorList: a, - cacheKey: s, - localImageCache: r, - localColorSpaceCache: n, + resources, + image, + isInline = false, + operatorList, + cacheKey, + localImageCache, + localColorSpaceCache, }) { - const g = t.dict, - o = g.objId, - c = g.get("W", "Width"), - C = g.get("H", "Height"); - if (!c || "number" != typeof c || !C || "number" != typeof C) { + const dict = image.dict; + const imageRef = dict.objId; + const w = dict.get("W", "Width"); + const h = dict.get("H", "Height"); + if (!(w && typeof w === "number") || !(h && typeof h === "number")) { warn("Image dimensions are missing, or not numbers."); return; } - const h = this.options.maxImageSize; - if (-1 !== h && c * C > h) { - const e = "Image exceeded maximum allowed size and was removed."; + const maxImageSize = this.options.maxImageSize; + if (maxImageSize !== -1 && w * h > maxImageSize) { + const msg = "Image exceeded maximum allowed size and was removed."; if (this.options.ignoreErrors) { - warn(e); + warn(msg); return; } - throw new Error(e); + throw new Error(msg); } - let l; - g.has("OC") && (l = await this.parseMarkedContentProps(g.get("OC"), e)); - let Q, E; - if (g.get("IM", "ImageMask") || !1) { - const e = g.get("I", "Interpolate"), - i = (c + 7) >> 3, - n = t.getBytes(i * C), - h = g.getArray("D", "Decode"); + let optionalContent; + if (dict.has("OC")) { + optionalContent = await this.parseMarkedContentProps( + dict.get("OC"), + resources, + ); + } + const imageMask = dict.get("IM", "ImageMask") || false; + let imgData, args; + if (imageMask) { + const interpolate = dict.get("I", "Interpolate"); + const bitStrideLength = (w + 7) >> 3; + const imgArray = image.getBytes(bitStrideLength * h); + const decode = dict.getArray("D", "Decode"); if (this.parsingType3Font) { - Q = PDFImage.createRawMask({ - imgArray: n, - width: c, - height: C, - imageIsFromDecodeStream: t instanceof DecodeStream, - inverseDecode: h?.[0] > 0, - interpolate: e, + imgData = PDFImage.createRawMask({ + imgArray, + width: w, + height: h, + imageIsFromDecodeStream: image instanceof DecodeStream, + inverseDecode: decode?.[0] > 0, + interpolate, }); - Q.cached = !!s; - E = [Q]; - a.addImageOps(Xe, E, l); - if (s) { - const e = { fn: Xe, args: E, optionalContent: l }; - r.set(s, o, e); - o && this._regionalImageCache.set(null, o, e); + imgData.cached = !!cacheKey; + args = [imgData]; + operatorList.addImageOps( + OPS.paintImageMaskXObject, + args, + optionalContent, + ); + if (cacheKey) { + const cacheData = { + fn: OPS.paintImageMaskXObject, + args, + optionalContent, + }; + localImageCache.set(cacheKey, imageRef, cacheData); + if (imageRef) { + this._regionalImageCache.set(null, imageRef, cacheData); + } } return; } - Q = await PDFImage.createMask({ - imgArray: n, - width: c, - height: C, - imageIsFromDecodeStream: t instanceof DecodeStream, - inverseDecode: h?.[0] > 0, - interpolate: e, + imgData = await PDFImage.createMask({ + imgArray, + width: w, + height: h, + imageIsFromDecodeStream: image instanceof DecodeStream, + inverseDecode: decode?.[0] > 0, + interpolate, isOffscreenCanvasSupported: this.options.isOffscreenCanvasSupported, }); - if (Q.isSingleOpaquePixel) { - a.addImageOps(et, [], l); - if (s) { - const e = { fn: et, args: [], optionalContent: l }; - r.set(s, o, e); - o && this._regionalImageCache.set(null, o, e); + if (imgData.isSingleOpaquePixel) { + operatorList.addImageOps( + OPS.paintSolidColorImageMask, + [], + optionalContent, + ); + if (cacheKey) { + const cacheData = { + fn: OPS.paintSolidColorImageMask, + args: [], + optionalContent, + }; + localImageCache.set(cacheKey, imageRef, cacheData); + if (imageRef) { + this._regionalImageCache.set(null, imageRef, cacheData); + } } return; } - const u = `mask_${this.idFactory.createObjId()}`; - a.addDependency(u); - Q.dataLen = Q.bitmap ? Q.width * Q.height * 4 : Q.data.length; - this._sendImgData(u, Q); - E = [ + const objId = `mask_${this.idFactory.createObjId()}`; + operatorList.addDependency(objId); + imgData.dataLen = imgData.bitmap + ? imgData.width * imgData.height * 4 + : imgData.data.length; + this._sendImgData(objId, imgData); + args = [ { - data: u, - width: Q.width, - height: Q.height, - interpolate: Q.interpolate, + data: objId, + width: imgData.width, + height: imgData.height, + interpolate: imgData.interpolate, count: 1, }, ]; - a.addImageOps(Xe, E, l); - if (s) { - const e = { objId: u, fn: Xe, args: E, optionalContent: l }; - r.set(s, o, e); - o && this._regionalImageCache.set(null, o, e); + operatorList.addImageOps( + OPS.paintImageMaskXObject, + args, + optionalContent, + ); + if (cacheKey) { + const cacheData = { + objId, + fn: OPS.paintImageMaskXObject, + args, + optionalContent, + }; + localImageCache.set(cacheKey, imageRef, cacheData); + if (imageRef) { + this._regionalImageCache.set(null, imageRef, cacheData); + } } return; } - if (i && c + C < 200 && !g.has("SMask") && !g.has("Mask")) { + const SMALL_IMAGE_DIMENSIONS = 200; + if ( + isInline && + w + h < SMALL_IMAGE_DIMENSIONS && + !dict.has("SMask") && + !dict.has("Mask") + ) { try { - const s = new PDFImage({ + const imageObj = new PDFImage({ xref: this.xref, - res: e, - image: t, - isInline: i, + res: resources, + image, + isInline, pdfFunctionFactory: this._pdfFunctionFactory, - localColorSpaceCache: n, + localColorSpaceCache, }); - Q = await s.createImageData(!0, !1); - a.isOffscreenCanvasSupported = this.options.isOffscreenCanvasSupported; - a.addImageOps(ze, [Q], l); - } catch (e) { - const t = `Unable to decode inline image: "${e}".`; - if (!this.options.ignoreErrors) throw new Error(t); - warn(t); + imgData = await imageObj.createImageData(true, false); + operatorList.isOffscreenCanvasSupported = + this.options.isOffscreenCanvasSupported; + operatorList.addImageOps( + OPS.paintInlineImageXObject, + [imgData], + optionalContent, + ); + } catch (reason) { + const msg = `Unable to decode inline image: "${reason}".`; + if (!this.options.ignoreErrors) { + throw new Error(msg); + } + warn(msg); } return; } - let u = `img_${this.idFactory.createObjId()}`, - d = !1; - if (this.parsingType3Font) u = `${this.idFactory.getDocId()}_type3_${u}`; - else if (s && o) { - d = this.globalImageCache.shouldCache(o, this.pageIndex); - if (d) { - assert(!i, "Cannot cache an inline image globally."); - u = `${this.idFactory.getDocId()}_${u}`; + let objId = `img_${this.idFactory.createObjId()}`, + cacheGlobally = false; + if (this.parsingType3Font) { + objId = `${this.idFactory.getDocId()}_type3_${objId}`; + } else if (cacheKey && imageRef) { + cacheGlobally = this.globalImageCache.shouldCache( + imageRef, + this.pageIndex, + ); + if (cacheGlobally) { + assert(!isInline, "Cannot cache an inline image globally."); + objId = `${this.idFactory.getDocId()}_${objId}`; } } - a.addDependency(u); - E = [u, c, C]; - a.addImageOps(Ve, E, l); - if (d) { - if (this.globalImageCache.hasDecodeFailed(o)) { - this.globalImageCache.setData(o, { - objId: u, - fn: Ve, - args: E, - optionalContent: l, + operatorList.addDependency(objId); + args = [objId, w, h]; + operatorList.addImageOps(OPS.paintImageXObject, args, optionalContent); + if (cacheGlobally) { + if (this.globalImageCache.hasDecodeFailed(imageRef)) { + this.globalImageCache.setData(imageRef, { + objId, + fn: OPS.paintImageXObject, + args, + optionalContent, byteSize: 0, }); - this._sendImgData(u, null, d); + this._sendImgData(objId, null, cacheGlobally); return; } - if (c * C > 25e4 || g.has("SMask") || g.has("Mask")) { - const e = await this.handler.sendWithPromise("commonobj", [ - u, + if (w * h > 250000 || dict.has("SMask") || dict.has("Mask")) { + const localLength = await this.handler.sendWithPromise("commonobj", [ + objId, "CopyLocalImage", - { imageRef: o }, + { + imageRef, + }, ]); - if (e) { - this.globalImageCache.setData(o, { - objId: u, - fn: Ve, - args: E, - optionalContent: l, + if (localLength) { + this.globalImageCache.setData(imageRef, { + objId, + fn: OPS.paintImageXObject, + args, + optionalContent, byteSize: 0, }); - this.globalImageCache.addByteSize(o, e); + this.globalImageCache.addByteSize(imageRef, localLength); return; } } } PDFImage.buildImage({ xref: this.xref, - res: e, - image: t, - isInline: i, + res: resources, + image, + isInline, pdfFunctionFactory: this._pdfFunctionFactory, - localColorSpaceCache: n, + localColorSpaceCache, }) - .then(async (e) => { - Q = await e.createImageData( - !1, + .then(async (imageObj) => { + imgData = await imageObj.createImageData( + false, this.options.isOffscreenCanvasSupported, ); - Q.dataLen = Q.bitmap ? Q.width * Q.height * 4 : Q.data.length; - Q.ref = o; - d && this.globalImageCache.addByteSize(o, Q.dataLen); - return this._sendImgData(u, Q, d); + imgData.dataLen = imgData.bitmap + ? imgData.width * imgData.height * 4 + : imgData.data.length; + imgData.ref = imageRef; + if (cacheGlobally) { + this.globalImageCache.addByteSize(imageRef, imgData.dataLen); + } + return this._sendImgData(objId, imgData, cacheGlobally); }) - .catch((e) => { - warn(`Unable to decode image "${u}": "${e}".`); - o && this.globalImageCache.addDecodeFailed(o); - return this._sendImgData(u, null, d); + .catch((reason) => { + warn(`Unable to decode image "${objId}": "${reason}".`); + if (imageRef) { + this.globalImageCache.addDecodeFailed(imageRef); + } + return this._sendImgData(objId, null, cacheGlobally); }); - if (s) { - const e = { objId: u, fn: Ve, args: E, optionalContent: l }; - r.set(s, o, e); - if (o) { - this._regionalImageCache.set(null, o, e); - d && - this.globalImageCache.setData(o, { - objId: u, - fn: Ve, - args: E, - optionalContent: l, + if (cacheKey) { + const cacheData = { + objId, + fn: OPS.paintImageXObject, + args, + optionalContent, + }; + localImageCache.set(cacheKey, imageRef, cacheData); + if (imageRef) { + this._regionalImageCache.set(null, imageRef, cacheData); + if (cacheGlobally) { + this.globalImageCache.setData(imageRef, { + objId, + fn: OPS.paintImageXObject, + args, + optionalContent, byteSize: 0, }); + } } } } - handleSMask(e, t, i, a, s, r) { - const n = e.get("G"), - g = { subtype: e.get("S").name, backdrop: e.get("BC") }, - o = e.get("TR"); - if (isPDFFunction(o)) { - const e = this._pdfFunctionFactory.create(o), - t = new Uint8Array(256), - i = new Float32Array(1); - for (let a = 0; a < 256; a++) { - i[0] = a / 255; - e(i, 0, i, 0); - t[a] = (255 * i[0]) | 0; + handleSMask( + smask, + resources, + operatorList, + task, + stateManager, + localColorSpaceCache, + ) { + const smaskContent = smask.get("G"); + const smaskOptions = { + subtype: smask.get("S").name, + backdrop: smask.get("BC"), + }; + const transferObj = smask.get("TR"); + if (isPDFFunction(transferObj)) { + const transferFn = this._pdfFunctionFactory.create(transferObj); + const transferMap = new Uint8Array(256); + const tmp = new Float32Array(1); + for (let i = 0; i < 256; i++) { + tmp[0] = i / 255; + transferFn(tmp, 0, tmp, 0); + transferMap[i] = (tmp[0] * 255) | 0; } - g.transferMap = t; + smaskOptions.transferMap = transferMap; } - return this.buildFormXObject(t, n, g, i, a, s.state.clone(), r); + return this.buildFormXObject( + resources, + smaskContent, + smaskOptions, + operatorList, + task, + stateManager.state.clone(), + localColorSpaceCache, + ); } - handleTransferFunction(e) { - let t; - if (Array.isArray(e)) t = e; - else { - if (!isPDFFunction(e)) return null; - t = [e]; + handleTransferFunction(tr) { + let transferArray; + if (Array.isArray(tr)) { + transferArray = tr; + } else if (isPDFFunction(tr)) { + transferArray = [tr]; + } else { + return null; } - const i = []; - let a = 0, - s = 0; - for (const e of t) { - const t = this.xref.fetchIfRef(e); - a++; - if (isName(t, "Identity")) { - i.push(null); + const transferMaps = []; + let numFns = 0, + numEffectfulFns = 0; + for (const entry of transferArray) { + const transferObj = this.xref.fetchIfRef(entry); + numFns++; + if (isName(transferObj, "Identity")) { + transferMaps.push(null); continue; + } else if (!isPDFFunction(transferObj)) { + return null; } - if (!isPDFFunction(t)) return null; - const r = this._pdfFunctionFactory.create(t), - n = new Uint8Array(256), - g = new Float32Array(1); - for (let e = 0; e < 256; e++) { - g[0] = e / 255; - r(g, 0, g, 0); - n[e] = (255 * g[0]) | 0; + const transferFn = this._pdfFunctionFactory.create(transferObj); + const transferMap = new Uint8Array(256), + tmp = new Float32Array(1); + for (let j = 0; j < 256; j++) { + tmp[0] = j / 255; + transferFn(tmp, 0, tmp, 0); + transferMap[j] = (tmp[0] * 255) | 0; } - i.push(n); - s++; + transferMaps.push(transferMap); + numEffectfulFns++; } - return (1 !== a && 4 !== a) || 0 === s ? null : i; + if (!(numFns === 1 || numFns === 4)) { + return null; + } + if (numEffectfulFns === 0) { + return null; + } + return transferMaps; } - handleTilingType(e, t, i, a, s, r, n, g) { - const o = new OperatorList(), - c = Dict.merge({ xref: this.xref, dictArray: [s.get("Resources"), i] }); + handleTilingType( + fn, + color, + resources, + pattern, + patternDict, + operatorList, + task, + localTilingPatternCache, + ) { + const tilingOpList = new OperatorList(); + const patternResources = Dict.merge({ + xref: this.xref, + dictArray: [patternDict.get("Resources"), resources], + }); return this.getOperatorList({ - stream: a, - task: n, - resources: c, - operatorList: o, + stream: pattern, + task, + resources: patternResources, + operatorList: tilingOpList, }) .then(function () { - const i = o.getIR(), - a = getTilingPatternIR(i, s, t); - r.addDependencies(o.dependencies); - r.addOp(e, a); - s.objId && g.set(null, s.objId, { operatorListIR: i, dict: s }); - }) - .catch((e) => { - if (!(e instanceof AbortException)) { - if (!this.options.ignoreErrors) throw e; - warn(`handleTilingType - ignoring pattern: "${e}".`); + const operatorListIR = tilingOpList.getIR(); + const tilingPatternIR = getTilingPatternIR( + operatorListIR, + patternDict, + color, + ); + operatorList.addDependencies(tilingOpList.dependencies); + operatorList.addOp(fn, tilingPatternIR); + if (patternDict.objId) { + localTilingPatternCache.set(null, patternDict.objId, { + operatorListIR, + dict: patternDict, + }); } + }) + .catch((reason) => { + if (reason instanceof AbortException) { + return; + } + if (this.options.ignoreErrors) { + warn(`handleTilingType - ignoring pattern: "${reason}".`); + return; + } + throw reason; }); } - async handleSetFont(e, t, i, a, s, r, n = null, g = null) { - const o = t?.[0] instanceof Name ? t[0].name : null; - let c = await this.loadFont(o, i, e, n, g); - if (c.font.isType3Font) + async handleSetFont( + resources, + fontArgs, + fontRef, + operatorList, + task, + state, + fallbackFontDict = null, + cssFontInfo = null, + ) { + const fontName = fontArgs?.[0] instanceof Name ? fontArgs[0].name : null; + let translated = await this.loadFont( + fontName, + fontRef, + resources, + fallbackFontDict, + cssFontInfo, + ); + if (translated.font.isType3Font) { try { - await c.loadType3Data(this, e, s); - a.addDependencies(c.type3Dependencies); - } catch (e) { - c = new TranslatedFont({ + await translated.loadType3Data(this, resources, task); + operatorList.addDependencies(translated.type3Dependencies); + } catch (reason) { + translated = new TranslatedFont({ loadedName: "g_font_error", - font: new ErrorFont(`Type3 font load error: ${e}`), - dict: c.font, + font: new ErrorFont(`Type3 font load error: ${reason}`), + dict: translated.font, evaluatorOptions: this.options, }); } - r.font = c.font; - c.send(this.handler); - return c.loadedName; - } - handleText(e, t) { - const i = t.font, - a = i.charsToGlyphs(e); - if (i.data) { - (!!(t.textRenderingMode & w) || - "Pattern" === t.fillColorSpace.name || - i.disableFontFace || - this.options.disableFontFace) && - PartialEvaluator.buildFontPaths(i, a, this.handler, this.options); } - return a; + state.font = translated.font; + translated.send(this.handler); + return translated.loadedName; } - ensureStateFont(e) { - if (e.font) return; - const t = new FormatError( + handleText(chars, state) { + const font = state.font; + const glyphs = font.charsToGlyphs(chars); + if (font.data) { + const isAddToPathSet = !!( + state.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG + ); + if ( + isAddToPathSet || + state.fillColorSpace.name === "Pattern" || + font.disableFontFace || + this.options.disableFontFace + ) { + PartialEvaluator.buildFontPaths( + font, + glyphs, + this.handler, + this.options, + ); + } + } + return glyphs; + } + ensureStateFont(state) { + if (state.font) { + return; + } + const reason = new FormatError( "Missing setFont (Tf) operator before text rendering operator.", ); - if (!this.options.ignoreErrors) throw t; - warn(`ensureStateFont: "${t}".`); + if (this.options.ignoreErrors) { + warn(`ensureStateFont: "${reason}".`); + return; + } + throw reason; } async setGState({ - resources: e, - gState: t, - operatorList: i, - cacheKey: a, - task: s, - stateManager: r, - localGStateCache: n, - localColorSpaceCache: g, + resources, + gState, + operatorList, + cacheKey, + task, + stateManager, + localGStateCache, + localColorSpaceCache, }) { - const o = t.objId; - let c = !0; - const C = []; - let h = Promise.resolve(); - for (const a of t.getKeys()) { - const n = t.get(a); - switch (a) { + const gStateRef = gState.objId; + let isSimpleGState = true; + const gStateObj = []; + let promise = Promise.resolve(); + for (const key of gState.getKeys()) { + const value = gState.get(key); + switch (key) { case "Type": break; case "LW": @@ -34223,34 +40438,52 @@ class PartialEvaluator { case "FL": case "CA": case "ca": - C.push([a, n]); + gStateObj.push([key, value]); break; case "Font": - c = !1; - h = h.then(() => - this.handleSetFont(e, null, n[0], i, s, r.state).then(function (e) { - i.addDependency(e); - C.push([a, [e, n[1]]]); + isSimpleGState = false; + promise = promise.then(() => + this.handleSetFont( + resources, + null, + value[0], + operatorList, + task, + stateManager.state, + ).then(function (loadedName) { + operatorList.addDependency(loadedName); + gStateObj.push([key, [loadedName, value[1]]]); }), ); break; case "BM": - C.push([a, normalizeBlendMode(n)]); + gStateObj.push([key, normalizeBlendMode(value)]); break; case "SMask": - if (isName(n, "None")) { - C.push([a, !1]); + if (isName(value, "None")) { + gStateObj.push([key, false]); break; } - if (n instanceof Dict) { - c = !1; - h = h.then(() => this.handleSMask(n, e, i, s, r, g)); - C.push([a, !0]); - } else warn("Unsupported SMask type"); + if (value instanceof Dict) { + isSimpleGState = false; + promise = promise.then(() => + this.handleSMask( + value, + resources, + operatorList, + task, + stateManager, + localColorSpaceCache, + ), + ); + gStateObj.push([key, true]); + } else { + warn("Unsupported SMask type"); + } break; case "TR": - const t = this.handleTransferFunction(n); - C.push([a, t]); + const transferMaps = this.handleTransferFunction(value); + gStateObj.push([key, transferMaps]); break; case "OP": case "op": @@ -34265,2244 +40498,2978 @@ class PartialEvaluator { case "SA": case "AIS": case "TK": - info("graphic state operator " + a); + info("graphic state operator " + key); break; default: - info("Unknown graphic state operator " + a); + info("Unknown graphic state operator " + key); + break; } } - await h; - C.length > 0 && i.addOp(NA, [C]); - c && n.set(a, o, C); + await promise; + if (gStateObj.length > 0) { + operatorList.addOp(OPS.setGState, [gStateObj]); + } + if (isSimpleGState) { + localGStateCache.set(cacheKey, gStateRef, gStateObj); + } } - loadFont(e, t, i, a = null, s = null) { - const errorFont = async () => - new TranslatedFont({ + loadFont( + fontName, + font, + resources, + fallbackFontDict = null, + cssFontInfo = null, + ) { + const errorFont = async () => { + return new TranslatedFont({ loadedName: "g_font_error", - font: new ErrorFont(`Font "${e}" is not available.`), - dict: t, + font: new ErrorFont(`Font "${fontName}" is not available.`), + dict: font, evaluatorOptions: this.options, }); - let r; - if (t) t instanceof Ref && (r = t); - else { - const t = i.get("Font"); - t && (r = t.getRaw(e)); - } - if (r) { - if (this.type3FontRefs?.has(r)) return errorFont(); - if (this.fontCache.has(r)) return this.fontCache.get(r); - try { - t = this.xref.fetchIfRef(r); - } catch (e) { - warn(`loadFont - lookup failed: "${e}".`); + }; + let fontRef; + if (font) { + if (font instanceof Ref) { + fontRef = font; + } + } else { + const fontRes = resources.get("Font"); + if (fontRes) { + fontRef = fontRes.getRaw(fontName); } } - if (!(t instanceof Dict)) { + if (fontRef) { + if (this.type3FontRefs?.has(fontRef)) { + return errorFont(); + } + if (this.fontCache.has(fontRef)) { + return this.fontCache.get(fontRef); + } + try { + font = this.xref.fetchIfRef(fontRef); + } catch (ex) { + warn(`loadFont - lookup failed: "${ex}".`); + } + } + if (!(font instanceof Dict)) { if (!this.options.ignoreErrors && !this.parsingType3Font) { - warn(`Font "${e}" is not available.`); + warn(`Font "${fontName}" is not available.`); return errorFont(); } warn( - `Font "${e}" is not available -- attempting to fallback to a default font.`, + `Font "${fontName}" is not available -- attempting to fallback to a default font.`, ); - t = a || PartialEvaluator.fallbackFontDict; + font = fallbackFontDict || PartialEvaluator.fallbackFontDict; } - if (t.cacheKey && this.fontCache.has(t.cacheKey)) - return this.fontCache.get(t.cacheKey); - const { promise: n, resolve: g } = Promise.withResolvers(); - let o; + if (font.cacheKey && this.fontCache.has(font.cacheKey)) { + return this.fontCache.get(font.cacheKey); + } + const { promise, resolve } = Promise.withResolvers(); + let preEvaluatedFont; try { - o = this.preEvaluateFont(t); - o.cssFontInfo = s; - } catch (e) { - warn(`loadFont - preEvaluateFont failed: "${e}".`); + preEvaluatedFont = this.preEvaluateFont(font); + preEvaluatedFont.cssFontInfo = cssFontInfo; + } catch (reason) { + warn(`loadFont - preEvaluateFont failed: "${reason}".`); return errorFont(); } - const { descriptor: c, hash: C } = o, - h = r instanceof Ref; - let l; - if (C && c instanceof Dict) { - const e = (c.fontAliases ||= Object.create(null)); - if (e[C]) { - const t = e[C].aliasRef; - if (h && t && this.fontCache.has(t)) { - this.fontCache.putAlias(r, t); - return this.fontCache.get(r); + const { descriptor, hash } = preEvaluatedFont; + const fontRefIsRef = fontRef instanceof Ref; + let fontID; + if (hash && descriptor instanceof Dict) { + const fontAliases = (descriptor.fontAliases ||= Object.create(null)); + if (fontAliases[hash]) { + const aliasFontRef = fontAliases[hash].aliasRef; + if (fontRefIsRef && aliasFontRef && this.fontCache.has(aliasFontRef)) { + this.fontCache.putAlias(fontRef, aliasFontRef); + return this.fontCache.get(fontRef); } - } else e[C] = { fontID: this.idFactory.createFontId() }; - h && (e[C].aliasRef = r); - l = e[C].fontID; - } else l = this.idFactory.createFontId(); - assert(l?.startsWith("f"), 'The "fontID" must be (correctly) defined.'); - if (h) this.fontCache.put(r, n); - else { - t.cacheKey = `cacheKey_${l}`; - this.fontCache.put(t.cacheKey, n); + } else { + fontAliases[hash] = { + fontID: this.idFactory.createFontId(), + }; + } + if (fontRefIsRef) { + fontAliases[hash].aliasRef = fontRef; + } + fontID = fontAliases[hash].fontID; + } else { + fontID = this.idFactory.createFontId(); } - t.loadedName = `${this.idFactory.getDocId()}_${l}`; - this.translateFont(o) - .then((e) => { - g( + assert( + fontID?.startsWith("f"), + 'The "fontID" must be (correctly) defined.', + ); + if (fontRefIsRef) { + this.fontCache.put(fontRef, promise); + } else { + font.cacheKey = `cacheKey_${fontID}`; + this.fontCache.put(font.cacheKey, promise); + } + font.loadedName = `${this.idFactory.getDocId()}_${fontID}`; + this.translateFont(preEvaluatedFont) + .then((translatedFont) => { + resolve( new TranslatedFont({ - loadedName: t.loadedName, - font: e, - dict: t, + loadedName: font.loadedName, + font: translatedFont, + dict: font, evaluatorOptions: this.options, }), ); }) - .catch((e) => { - warn(`loadFont - translateFont failed: "${e}".`); - g( + .catch((reason) => { + warn(`loadFont - translateFont failed: "${reason}".`); + resolve( new TranslatedFont({ - loadedName: t.loadedName, - font: new ErrorFont(e instanceof Error ? e.message : e), - dict: t, + loadedName: font.loadedName, + font: new ErrorFont( + reason instanceof Error ? reason.message : reason, + ), + dict: font, evaluatorOptions: this.options, }), ); }); - return n; + return promise; } - buildPath(e, t, i, a = !1) { - const s = e.length - 1; - i || (i = []); - if (s < 0 || e.fnArray[s] !== tt) { - if (a) { - warn(`Encountered path operator "${t}" inside of a text object.`); - e.addOp(GA, null); + buildPath(operatorList, fn, args, parsingText = false) { + const lastIndex = operatorList.length - 1; + if (!args) { + args = []; + } + if ( + lastIndex < 0 || + operatorList.fnArray[lastIndex] !== OPS.constructPath + ) { + if (parsingText) { + warn(`Encountered path operator "${fn}" inside of a text object.`); + operatorList.addOp(OPS.save, null); } - let s; - switch (t) { - case KA: - const e = i[0] + i[2], - t = i[1] + i[3]; - s = [ - Math.min(i[0], e), - Math.min(i[1], t), - Math.max(i[0], e), - Math.max(i[1], t), + let minMax; + switch (fn) { + case OPS.rectangle: + const x = args[0] + args[2]; + const y = args[1] + args[3]; + minMax = [ + Math.min(args[0], x), + Math.min(args[1], y), + Math.max(args[0], x), + Math.max(args[1], y), ]; break; - case MA: - case LA: - s = [i[0], i[1], i[0], i[1]]; + case OPS.moveTo: + case OPS.lineTo: + minMax = [args[0], args[1], args[0], args[1]]; break; default: - s = [1 / 0, 1 / 0, -1 / 0, -1 / 0]; - } - e.addOp(tt, [[t], i, s]); - a && e.addOp(xA, null); - } else { - const a = e.argsArray[s]; - a[0].push(t); - a[1].push(...i); - const r = a[2]; - switch (t) { - case KA: - const e = i[0] + i[2], - t = i[1] + i[3]; - r[0] = Math.min(r[0], i[0], e); - r[1] = Math.min(r[1], i[1], t); - r[2] = Math.max(r[2], i[0], e); - r[3] = Math.max(r[3], i[1], t); + minMax = [Infinity, Infinity, -Infinity, -Infinity]; + break; + } + operatorList.addOp(OPS.constructPath, [[fn], args, minMax]); + if (parsingText) { + operatorList.addOp(OPS.restore, null); + } + } else { + const opArgs = operatorList.argsArray[lastIndex]; + opArgs[0].push(fn); + opArgs[1].push(...args); + const minMax = opArgs[2]; + switch (fn) { + case OPS.rectangle: + const x = args[0] + args[2]; + const y = args[1] + args[3]; + minMax[0] = Math.min(minMax[0], args[0], x); + minMax[1] = Math.min(minMax[1], args[1], y); + minMax[2] = Math.max(minMax[2], args[0], x); + minMax[3] = Math.max(minMax[3], args[1], y); + break; + case OPS.moveTo: + case OPS.lineTo: + minMax[0] = Math.min(minMax[0], args[0]); + minMax[1] = Math.min(minMax[1], args[1]); + minMax[2] = Math.max(minMax[2], args[0]); + minMax[3] = Math.max(minMax[3], args[1]); break; - case MA: - case LA: - r[0] = Math.min(r[0], i[0]); - r[1] = Math.min(r[1], i[1]); - r[2] = Math.max(r[2], i[0]); - r[3] = Math.max(r[3], i[1]); } } } - parseColorSpace({ cs: e, resources: t, localColorSpaceCache: i }) { + parseColorSpace({ cs, resources, localColorSpaceCache }) { return ColorSpace.parseAsync({ - cs: e, + cs, xref: this.xref, - resources: t, + resources, pdfFunctionFactory: this._pdfFunctionFactory, - localColorSpaceCache: i, - }).catch((e) => { - if (e instanceof AbortException) return null; - if (this.options.ignoreErrors) { - warn(`parseColorSpace - ignoring ColorSpace: "${e}".`); + localColorSpaceCache, + }).catch((reason) => { + if (reason instanceof AbortException) { return null; } - throw e; + if (this.options.ignoreErrors) { + warn(`parseColorSpace - ignoring ColorSpace: "${reason}".`); + return null; + } + throw reason; }); } parseShading({ - shading: e, - resources: t, - localColorSpaceCache: i, - localShadingPatternCache: a, + shading, + resources, + localColorSpaceCache, + localShadingPatternCache, }) { - let s, - r = a.get(e); - if (r) return r; + let id = localShadingPatternCache.get(shading); + if (id) { + return id; + } + let patternIR; try { - s = Pattern.parseShading( - e, + const shadingFill = Pattern.parseShading( + shading, this.xref, - t, + resources, this._pdfFunctionFactory, - i, - ).getIR(); - } catch (t) { - if (t instanceof AbortException) return null; - if (this.options.ignoreErrors) { - warn(`parseShading - ignoring shading: "${t}".`); - a.set(e, null); + localColorSpaceCache, + ); + patternIR = shadingFill.getIR(); + } catch (reason) { + if (reason instanceof AbortException) { return null; } - throw t; + if (this.options.ignoreErrors) { + warn(`parseShading - ignoring shading: "${reason}".`); + localShadingPatternCache.set(shading, null); + return null; + } + throw reason; } - r = `pattern_${this.idFactory.createObjId()}`; - this.parsingType3Font && (r = `${this.idFactory.getDocId()}_type3_${r}`); - a.set(e, r); - this.parsingType3Font - ? this.handler.send("commonobj", [r, "Pattern", s]) - : this.handler.send("obj", [r, this.pageIndex, "Pattern", s]); - return r; + id = `pattern_${this.idFactory.createObjId()}`; + if (this.parsingType3Font) { + id = `${this.idFactory.getDocId()}_type3_${id}`; + } + localShadingPatternCache.set(shading, id); + if (this.parsingType3Font) { + this.handler.send("commonobj", [id, "Pattern", patternIR]); + } else { + this.handler.send("obj", [id, this.pageIndex, "Pattern", patternIR]); + } + return id; } - handleColorN(e, t, i, a, s, r, n, g, o, c) { - const C = i.pop(); - if (C instanceof Name) { - const h = s.getRaw(C.name), - l = h instanceof Ref && o.getByRef(h); - if (l) + handleColorN( + operatorList, + fn, + args, + cs, + patterns, + resources, + task, + localColorSpaceCache, + localTilingPatternCache, + localShadingPatternCache, + ) { + const patternName = args.pop(); + if (patternName instanceof Name) { + const rawPattern = patterns.getRaw(patternName.name); + const localTilingPattern = + rawPattern instanceof Ref && + localTilingPatternCache.getByRef(rawPattern); + if (localTilingPattern) { try { - const s = a.base ? a.base.getRgb(i, 0) : null, - r = getTilingPatternIR(l.operatorListIR, l.dict, s); - e.addOp(t, r); - return; + const color = cs.base ? cs.base.getRgb(args, 0) : null; + const tilingPatternIR = getTilingPatternIR( + localTilingPattern.operatorListIR, + localTilingPattern.dict, + color, + ); + operatorList.addOp(fn, tilingPatternIR); + return undefined; } catch {} - const Q = this.xref.fetchIfRef(h); - if (Q) { - const s = Q instanceof BaseStream ? Q.dict : Q, - C = s.get("PatternType"); - if (C === Fs) { - const g = a.base ? a.base.getRgb(i, 0) : null; - return this.handleTilingType(t, g, r, Q, s, e, n, o); - } - if (C === Ss) { - const i = s.get("Shading"), - a = this.parseShading({ - shading: i, - resources: r, - localColorSpaceCache: g, - localShadingPatternCache: c, - }); - if (a) { - const i = lookupMatrix(s.getArray("Matrix"), null); - e.addOp(t, ["Shading", a, i]); + } + const pattern = this.xref.fetchIfRef(rawPattern); + if (pattern) { + const dict = pattern instanceof BaseStream ? pattern.dict : pattern; + const typeNum = dict.get("PatternType"); + if (typeNum === PatternType.TILING) { + const color = cs.base ? cs.base.getRgb(args, 0) : null; + return this.handleTilingType( + fn, + color, + resources, + pattern, + dict, + operatorList, + task, + localTilingPatternCache, + ); + } else if (typeNum === PatternType.SHADING) { + const shading = dict.get("Shading"); + const objId = this.parseShading({ + shading, + resources, + localColorSpaceCache, + localShadingPatternCache, + }); + if (objId) { + const matrix = lookupMatrix(dict.getArray("Matrix"), null); + operatorList.addOp(fn, ["Shading", objId, matrix]); } - return; + return undefined; } - throw new FormatError(`Unknown PatternType: ${C}`); + throw new FormatError(`Unknown PatternType: ${typeNum}`); } } - throw new FormatError(`Unknown PatternName: ${C}`); + throw new FormatError(`Unknown PatternName: ${patternName}`); } - _parseVisibilityExpression(e, t, i) { - if (++t > 10) { + _parseVisibilityExpression(array, nestingCounter, currentResult) { + const MAX_NESTING = 10; + if (++nestingCounter > MAX_NESTING) { warn("Visibility expression is too deeply nested"); return; } - const a = e.length, - s = this.xref.fetchIfRef(e[0]); - if (!(a < 2) && s instanceof Name) { - switch (s.name) { - case "And": - case "Or": - case "Not": - i.push(s.name); - break; - default: - warn(`Invalid operator ${s.name} in visibility expression`); - return; - } - for (let s = 1; s < a; s++) { - const a = e[s], - r = this.xref.fetchIfRef(a); - if (Array.isArray(r)) { - const e = []; - i.push(e); - this._parseVisibilityExpression(r, t, e); - } else a instanceof Ref && i.push(a.toString()); - } - } else warn("Invalid visibility expression"); - } - async parseMarkedContentProps(e, t) { - let i; - if (e instanceof Name) { - i = t.get("Properties").get(e.name); - } else { - if (!(e instanceof Dict)) - throw new FormatError("Optional content properties malformed."); - i = e; + const length = array.length; + const operator = this.xref.fetchIfRef(array[0]); + if (length < 2 || !(operator instanceof Name)) { + warn("Invalid visibility expression"); + return; } - const a = i.get("Type")?.name; - if ("OCG" === a) return { type: a, id: i.objId }; - if ("OCMD" === a) { - const e = i.get("VE"); - if (Array.isArray(e)) { - const t = []; - this._parseVisibilityExpression(e, 0, t); - if (t.length > 0) return { type: "OCMD", expression: t }; + switch (operator.name) { + case "And": + case "Or": + case "Not": + currentResult.push(operator.name); + break; + default: + warn(`Invalid operator ${operator.name} in visibility expression`); + return; + } + for (let i = 1; i < length; i++) { + const raw = array[i]; + const object = this.xref.fetchIfRef(raw); + if (Array.isArray(object)) { + const nestedResult = []; + currentResult.push(nestedResult); + this._parseVisibilityExpression(object, nestingCounter, nestedResult); + } else if (raw instanceof Ref) { + currentResult.push(raw.toString()); } - const t = i.get("OCGs"); - if (Array.isArray(t) || t instanceof Dict) { - const e = []; - if (Array.isArray(t)) for (const i of t) e.push(i.toString()); - else e.push(t.objId); + } + } + async parseMarkedContentProps(contentProperties, resources) { + let optionalContent; + if (contentProperties instanceof Name) { + const properties = resources.get("Properties"); + optionalContent = properties.get(contentProperties.name); + } else if (contentProperties instanceof Dict) { + optionalContent = contentProperties; + } else { + throw new FormatError("Optional content properties malformed."); + } + const optionalContentType = optionalContent.get("Type")?.name; + if (optionalContentType === "OCG") { + return { + type: optionalContentType, + id: optionalContent.objId, + }; + } else if (optionalContentType === "OCMD") { + const expression = optionalContent.get("VE"); + if (Array.isArray(expression)) { + const result = []; + this._parseVisibilityExpression(expression, 0, result); + if (result.length > 0) { + return { + type: "OCMD", + expression: result, + }; + } + } + const optionalContentGroups = optionalContent.get("OCGs"); + if ( + Array.isArray(optionalContentGroups) || + optionalContentGroups instanceof Dict + ) { + const groupIds = []; + if (Array.isArray(optionalContentGroups)) { + for (const ocg of optionalContentGroups) { + groupIds.push(ocg.toString()); + } + } else { + groupIds.push(optionalContentGroups.objId); + } return { - type: a, - ids: e, - policy: i.get("P") instanceof Name ? i.get("P").name : null, + type: optionalContentType, + ids: groupIds, + policy: + optionalContent.get("P") instanceof Name + ? optionalContent.get("P").name + : null, expression: null, }; + } else if (optionalContentGroups instanceof Ref) { + return { + type: optionalContentType, + id: optionalContentGroups.toString(), + }; } - if (t instanceof Ref) return { type: a, id: t.toString() }; } return null; } getOperatorList({ - stream: e, - task: t, - resources: i, - operatorList: a, - initialState: s = null, - fallbackFontDict: r = null, + stream, + task, + resources, + operatorList, + initialState = null, + fallbackFontDict = null, }) { - i ||= Dict.empty; - s ||= new EvalState(); - if (!a) + resources ||= Dict.empty; + initialState ||= new EvalState(); + if (!operatorList) { throw new Error('getOperatorList: missing "operatorList" parameter'); - const n = this, - g = this.xref; - let o = !1; - const c = new LocalImageCache(), - C = new LocalColorSpaceCache(), - h = new LocalGStateCache(), - l = new LocalTilingPatternCache(), - Q = new Map(), - E = i.get("XObject") || Dict.empty, - u = i.get("Pattern") || Dict.empty, - d = new StateManager(s), - f = new EvaluatorPreprocessor(e, g, d), - p = new TimeSlotManager(); - function closePendingRestoreOPS(e) { - for (let e = 0, t = f.savedStatesDepth; e < t; e++) a.addOp(xA, []); } - return new Promise(function promiseBody(e, s) { - const next = function (t) { - Promise.all([t, a.ready]).then(function () { + const self = this; + const xref = this.xref; + let parsingText = false; + const localImageCache = new LocalImageCache(); + const localColorSpaceCache = new LocalColorSpaceCache(); + const localGStateCache = new LocalGStateCache(); + const localTilingPatternCache = new LocalTilingPatternCache(); + const localShadingPatternCache = new Map(); + const xobjs = resources.get("XObject") || Dict.empty; + const patterns = resources.get("Pattern") || Dict.empty; + const stateManager = new StateManager(initialState); + const preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); + const timeSlotManager = new TimeSlotManager(); + function closePendingRestoreOPS(argument) { + for (let i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { + operatorList.addOp(OPS.restore, []); + } + } + return new Promise(function promiseBody(resolve, reject) { + const next = function (promise) { + Promise.all([promise, operatorList.ready]).then(function () { try { - promiseBody(e, s); - } catch (e) { - s(e); + promiseBody(resolve, reject); + } catch (ex) { + reject(ex); } - }, s); + }, reject); }; - t.ensureNotTerminated(); - p.reset(); - const m = {}; - let y, w, D, b, F, S; - for (; !(y = p.check()); ) { - m.args = null; - if (!f.read(m)) break; - let e = m.args, - s = m.fn; - switch (0 | s) { - case Ue: - S = e[0] instanceof Name; - F = e[0].name; - if (S) { - const t = c.getByName(F); - if (t) { - addLocallyCachedImageOps(a, t); - e = null; + task.ensureNotTerminated(); + timeSlotManager.reset(); + const operation = {}; + let stop, i, ii, cs, name, isValidName; + while (!(stop = timeSlotManager.check())) { + operation.args = null; + if (!preprocessor.read(operation)) { + break; + } + let args = operation.args; + let fn = operation.fn; + switch (fn | 0) { + case OPS.paintXObject: + isValidName = args[0] instanceof Name; + name = args[0].name; + if (isValidName) { + const localImage = localImageCache.getByName(name); + if (localImage) { + addLocallyCachedImageOps(operatorList, localImage); + args = null; continue; } } next( - new Promise(function (e, s) { - if (!S) + new Promise(function (resolveXObject, rejectXObject) { + if (!isValidName) { throw new FormatError("XObject must be referred to by name."); - let r = E.getRaw(F); - if (r instanceof Ref) { - const t = c.getByRef(r) || n._regionalImageCache.getByRef(r); - if (t) { - addLocallyCachedImageOps(a, t); - e(); - return; - } - const i = n.globalImageCache.getData(r, n.pageIndex); - if (i) { - a.addDependency(i.objId); - a.addImageOps(i.fn, i.args, i.optionalContent); - e(); - return; - } - r = g.fetch(r); } - if (!(r instanceof BaseStream)) + let xobj = xobjs.getRaw(name); + if (xobj instanceof Ref) { + const localImage = + localImageCache.getByRef(xobj) || + self._regionalImageCache.getByRef(xobj); + if (localImage) { + addLocallyCachedImageOps(operatorList, localImage); + resolveXObject(); + return; + } + const globalImage = self.globalImageCache.getData( + xobj, + self.pageIndex, + ); + if (globalImage) { + operatorList.addDependency(globalImage.objId); + operatorList.addImageOps( + globalImage.fn, + globalImage.args, + globalImage.optionalContent, + ); + resolveXObject(); + return; + } + xobj = xref.fetch(xobj); + } + if (!(xobj instanceof BaseStream)) { throw new FormatError("XObject should be a stream"); - const o = r.dict.get("Subtype"); - if (!(o instanceof Name)) + } + const type = xobj.dict.get("Subtype"); + if (!(type instanceof Name)) { throw new FormatError("XObject should have a Name subtype"); - if ("Form" !== o.name) - if ("Image" !== o.name) { - if ("PS" !== o.name) - throw new FormatError( - `Unhandled XObject subtype ${o.name}`, - ); - info("Ignored XObject subtype PS"); - e(); - } else - n.buildPaintImageXObject({ - resources: i, - image: r, - operatorList: a, - cacheKey: F, - localImageCache: c, - localColorSpaceCache: C, - }).then(e, s); - else { - d.save(); - n.buildFormXObject(i, r, null, a, t, d.state.clone(), C).then( - function () { - d.restore(); - e(); - }, - s, + } + if (type.name === "Form") { + stateManager.save(); + self + .buildFormXObject( + resources, + xobj, + null, + operatorList, + task, + stateManager.state.clone(), + localColorSpaceCache, + ) + .then(function () { + stateManager.restore(); + resolveXObject(); + }, rejectXObject); + return; + } else if (type.name === "Image") { + self + .buildPaintImageXObject({ + resources, + image: xobj, + operatorList, + cacheKey: name, + localImageCache, + localColorSpaceCache, + }) + .then(resolveXObject, rejectXObject); + return; + } else if (type.name === "PS") { + info("Ignored XObject subtype PS"); + } else { + throw new FormatError( + `Unhandled XObject subtype ${type.name}`, ); } - }).catch(function (e) { - if (!(e instanceof AbortException)) { - if (!n.options.ignoreErrors) throw e; - warn(`getOperatorList - ignoring XObject: "${e}".`); + resolveXObject(); + }).catch(function (reason) { + if (reason instanceof AbortException) { + return; } + if (self.options.ignoreErrors) { + warn(`getOperatorList - ignoring XObject: "${reason}".`); + return; + } + throw reason; }), ); return; - case se: - var k = e[1]; + case OPS.setFont: + var fontSize = args[1]; next( - n.handleSetFont(i, e, null, a, t, d.state, r).then(function (e) { - a.addDependency(e); - a.addOp(se, [e, k]); - }), + self + .handleSetFont( + resources, + args, + null, + operatorList, + task, + stateManager.state, + fallbackFontDict, + ) + .then(function (loadedName) { + operatorList.addDependency(loadedName); + operatorList.addOp(OPS.setFont, [loadedName, fontSize]); + }), ); return; - case $A: - o = !0; + case OPS.beginText: + parsingText = true; break; - case Ae: - o = !1; + case OPS.endText: + parsingText = false; break; - case xe: - var R = e[0].cacheKey; - if (R) { - const t = c.getByName(R); - if (t) { - addLocallyCachedImageOps(a, t); - e = null; + case OPS.endInlineImage: + var cacheKey = args[0].cacheKey; + if (cacheKey) { + const localImage = localImageCache.getByName(cacheKey); + if (localImage) { + addLocallyCachedImageOps(operatorList, localImage); + args = null; continue; } } next( - n.buildPaintImageXObject({ - resources: i, - image: e[0], - isInline: !0, - operatorList: a, - cacheKey: R, - localImageCache: c, - localColorSpaceCache: C, + self.buildPaintImageXObject({ + resources, + image: args[0], + isInline: true, + operatorList, + cacheKey, + localImageCache, + localColorSpaceCache, }), ); return; - case Ce: - if (!d.state.font) { - n.ensureStateFont(d.state); + case OPS.showText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); continue; } - e[0] = n.handleText(e[0], d.state); + args[0] = self.handleText(args[0], stateManager.state); break; - case he: - if (!d.state.font) { - n.ensureStateFont(d.state); + case OPS.showSpacedText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); continue; } - var N = [], - G = d.state; - for (const t of e[0]) - "string" == typeof t - ? N.push(...n.handleText(t, G)) - : "number" == typeof t && N.push(t); - e[0] = N; - s = Ce; - break; - case Be: - if (!d.state.font) { - n.ensureStateFont(d.state); - continue; - } - a.addOp(ce); - e[0] = n.handleText(e[0], d.state); - s = Ce; - break; - case le: - if (!d.state.font) { - n.ensureStateFont(d.state); - continue; - } - a.addOp(ce); - a.addOp(te, [e.shift()]); - a.addOp(ee, [e.shift()]); - e[0] = n.handleText(e[0], d.state); - s = Ce; - break; - case re: - d.state.textRenderingMode = e[0]; - break; - case de: { - const t = ColorSpace.getCached(e[0], g, C); - if (t) { - d.state.fillColorSpace = t; - continue; - } - next( - n - .parseColorSpace({ - cs: e[0], - resources: i, - localColorSpaceCache: C, - }) - .then(function (e) { - e && (d.state.fillColorSpace = e); - }), - ); - return; - } - case ue: { - const t = ColorSpace.getCached(e[0], g, C); - if (t) { - d.state.strokeColorSpace = t; - continue; - } - next( - n - .parseColorSpace({ - cs: e[0], - resources: i, - localColorSpaceCache: C, - }) - .then(function (e) { - e && (d.state.strokeColorSpace = e); - }), - ); - return; - } - case me: - b = d.state.fillColorSpace; - e = b.getRgb(e, 0); - s = Fe; - break; - case fe: - b = d.state.strokeColorSpace; - e = b.getRgb(e, 0); - s = be; - break; - case De: - d.state.fillColorSpace = ColorSpace.singletons.gray; - e = ColorSpace.singletons.gray.getRgb(e, 0); - s = Fe; - break; - case we: - d.state.strokeColorSpace = ColorSpace.singletons.gray; - e = ColorSpace.singletons.gray.getRgb(e, 0); - s = be; - break; - case ke: - d.state.fillColorSpace = ColorSpace.singletons.cmyk; - e = ColorSpace.singletons.cmyk.getRgb(e, 0); - s = Fe; - break; - case Se: - d.state.strokeColorSpace = ColorSpace.singletons.cmyk; - e = ColorSpace.singletons.cmyk.getRgb(e, 0); - s = be; - break; - case Fe: - d.state.fillColorSpace = ColorSpace.singletons.rgb; - e = ColorSpace.singletons.rgb.getRgb(e, 0); - break; - case be: - d.state.strokeColorSpace = ColorSpace.singletons.rgb; - e = ColorSpace.singletons.rgb.getRgb(e, 0); - break; - case ye: - b = d.state.fillColorSpace; - if ("Pattern" === b.name) { - next(n.handleColorN(a, ye, e, b, u, i, t, C, l, Q)); - return; - } - e = b.getRgb(e, 0); - s = Fe; - break; - case pe: - b = d.state.strokeColorSpace; - if ("Pattern" === b.name) { - next(n.handleColorN(a, pe, e, b, u, i, t, C, l, Q)); - return; - } - e = b.getRgb(e, 0); - s = be; - break; - case Re: - var x = i.get("Shading"); - if (!x) throw new FormatError("No shading resource found"); - var U = x.get(e[0].name); - if (!U) throw new FormatError("No shading object found"); - const f = n.parseShading({ - shading: U, - resources: i, - localColorSpaceCache: C, - localShadingPatternCache: Q, - }); - if (!f) continue; - e = [f]; - s = Re; - break; - case NA: - S = e[0] instanceof Name; - F = e[0].name; - if (S) { - const t = h.getByName(F); - if (t) { - t.length > 0 && a.addOp(NA, [t]); - e = null; - continue; + var combinedGlyphs = []; + var state = stateManager.state; + for (const arrItem of args[0]) { + if (typeof arrItem === "string") { + combinedGlyphs.push(...self.handleText(arrItem, state)); + } else if (typeof arrItem === "number") { + combinedGlyphs.push(arrItem); } } - next( - new Promise(function (e, s) { - if (!S) - throw new FormatError("GState must be referred to by name."); - const r = i.get("ExtGState"); - if (!(r instanceof Dict)) - throw new FormatError("ExtGState should be a dictionary."); - const g = r.get(F); - if (!(g instanceof Dict)) - throw new FormatError("GState should be a dictionary."); - n.setGState({ - resources: i, - gState: g, - operatorList: a, - cacheKey: F, - task: t, - stateManager: d, - localGStateCache: h, - localColorSpaceCache: C, - }).then(e, s); - }).catch(function (e) { - if (!(e instanceof AbortException)) { - if (!n.options.ignoreErrors) throw e; - warn(`getOperatorList - ignoring ExtGState: "${e}".`); - } - }), - ); - return; - case MA: - case LA: - case HA: - case JA: - case YA: - case vA: - case KA: - n.buildPath(a, s, e, o); - continue; - case Me: - case Le: - case ve: - case Ke: - continue; - case Je: - if (!(e[0] instanceof Name)) { - warn(`Expected name for beginMarkedContentProps arg0=${e[0]}`); - a.addOp(Je, ["OC", null]); + args[0] = combinedGlyphs; + fn = OPS.showText; + break; + case OPS.nextLineShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); continue; } - if ("OC" === e[0].name) { + operatorList.addOp(OPS.nextLine); + args[0] = self.handleText(args[0], stateManager.state); + fn = OPS.showText; + break; + case OPS.nextLineSetSpacingShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + operatorList.addOp(OPS.nextLine); + operatorList.addOp(OPS.setWordSpacing, [args.shift()]); + operatorList.addOp(OPS.setCharSpacing, [args.shift()]); + args[0] = self.handleText(args[0], stateManager.state); + fn = OPS.showText; + break; + case OPS.setTextRenderingMode: + stateManager.state.textRenderingMode = args[0]; + break; + case OPS.setFillColorSpace: { + const cachedColorSpace = ColorSpace.getCached( + args[0], + xref, + localColorSpaceCache, + ); + if (cachedColorSpace) { + stateManager.state.fillColorSpace = cachedColorSpace; + continue; + } + next( + self + .parseColorSpace({ + cs: args[0], + resources, + localColorSpaceCache, + }) + .then(function (colorSpace) { + stateManager.state.fillColorSpace = + colorSpace || ColorSpace.singletons.gray; + }), + ); + return; + } + case OPS.setStrokeColorSpace: { + const cachedColorSpace = ColorSpace.getCached( + args[0], + xref, + localColorSpaceCache, + ); + if (cachedColorSpace) { + stateManager.state.strokeColorSpace = cachedColorSpace; + continue; + } + next( + self + .parseColorSpace({ + cs: args[0], + resources, + localColorSpaceCache, + }) + .then(function (colorSpace) { + stateManager.state.strokeColorSpace = + colorSpace || ColorSpace.singletons.gray; + }), + ); + return; + } + case OPS.setFillColor: + cs = stateManager.state.fillColorSpace; + args = cs.getRgb(args, 0); + fn = OPS.setFillRGBColor; + break; + case OPS.setStrokeColor: + cs = stateManager.state.strokeColorSpace; + args = cs.getRgb(args, 0); + fn = OPS.setStrokeRGBColor; + break; + case OPS.setFillGray: + stateManager.state.fillColorSpace = ColorSpace.singletons.gray; + args = ColorSpace.singletons.gray.getRgb(args, 0); + fn = OPS.setFillRGBColor; + break; + case OPS.setStrokeGray: + stateManager.state.strokeColorSpace = ColorSpace.singletons.gray; + args = ColorSpace.singletons.gray.getRgb(args, 0); + fn = OPS.setStrokeRGBColor; + break; + case OPS.setFillCMYKColor: + stateManager.state.fillColorSpace = ColorSpace.singletons.cmyk; + args = ColorSpace.singletons.cmyk.getRgb(args, 0); + fn = OPS.setFillRGBColor; + break; + case OPS.setStrokeCMYKColor: + stateManager.state.strokeColorSpace = ColorSpace.singletons.cmyk; + args = ColorSpace.singletons.cmyk.getRgb(args, 0); + fn = OPS.setStrokeRGBColor; + break; + case OPS.setFillRGBColor: + stateManager.state.fillColorSpace = ColorSpace.singletons.rgb; + args = ColorSpace.singletons.rgb.getRgb(args, 0); + break; + case OPS.setStrokeRGBColor: + stateManager.state.strokeColorSpace = ColorSpace.singletons.rgb; + args = ColorSpace.singletons.rgb.getRgb(args, 0); + break; + case OPS.setFillColorN: + cs = stateManager.state.patternFillColorSpace; + if (!cs) { + if (isNumberArray(args, null)) { + args = ColorSpace.singletons.gray.getRgb(args, 0); + fn = OPS.setFillRGBColor; + break; + } + args = []; + fn = OPS.setFillTransparent; + break; + } + if (cs.name === "Pattern") { next( - n - .parseMarkedContentProps(e[1], i) - .then((e) => { - a.addOp(Je, ["OC", e]); + self.handleColorN( + operatorList, + OPS.setFillColorN, + args, + cs, + patterns, + resources, + task, + localColorSpaceCache, + localTilingPatternCache, + localShadingPatternCache, + ), + ); + return; + } + args = cs.getRgb(args, 0); + fn = OPS.setFillRGBColor; + break; + case OPS.setStrokeColorN: + cs = stateManager.state.patternStrokeColorSpace; + if (!cs) { + if (isNumberArray(args, null)) { + args = ColorSpace.singletons.gray.getRgb(args, 0); + fn = OPS.setStrokeRGBColor; + break; + } + args = []; + fn = OPS.setStrokeTransparent; + break; + } + if (cs.name === "Pattern") { + next( + self.handleColorN( + operatorList, + OPS.setStrokeColorN, + args, + cs, + patterns, + resources, + task, + localColorSpaceCache, + localTilingPatternCache, + localShadingPatternCache, + ), + ); + return; + } + args = cs.getRgb(args, 0); + fn = OPS.setStrokeRGBColor; + break; + case OPS.shadingFill: + let shading; + try { + const shadingRes = resources.get("Shading"); + if (!shadingRes) { + throw new FormatError("No shading resource found"); + } + shading = shadingRes.get(args[0].name); + if (!shading) { + throw new FormatError("No shading object found"); + } + } catch (reason) { + if (reason instanceof AbortException) { + continue; + } + if (self.options.ignoreErrors) { + warn(`getOperatorList - ignoring Shading: "${reason}".`); + continue; + } + throw reason; + } + const patternId = self.parseShading({ + shading, + resources, + localColorSpaceCache, + localShadingPatternCache, + }); + if (!patternId) { + continue; + } + args = [patternId]; + fn = OPS.shadingFill; + break; + case OPS.setGState: + isValidName = args[0] instanceof Name; + name = args[0].name; + if (isValidName) { + const localGStateObj = localGStateCache.getByName(name); + if (localGStateObj) { + if (localGStateObj.length > 0) { + operatorList.addOp(OPS.setGState, [localGStateObj]); + } + args = null; + continue; + } + } + next( + new Promise(function (resolveGState, rejectGState) { + if (!isValidName) { + throw new FormatError("GState must be referred to by name."); + } + const extGState = resources.get("ExtGState"); + if (!(extGState instanceof Dict)) { + throw new FormatError("ExtGState should be a dictionary."); + } + const gState = extGState.get(name); + if (!(gState instanceof Dict)) { + throw new FormatError("GState should be a dictionary."); + } + self + .setGState({ + resources, + gState, + operatorList, + cacheKey: name, + task, + stateManager, + localGStateCache, + localColorSpaceCache, }) - .catch((e) => { - if (!(e instanceof AbortException)) { - if (!n.options.ignoreErrors) throw e; - warn( - `getOperatorList - ignoring beginMarkedContentProps: "${e}".`, - ); - a.addOp(Je, ["OC", null]); + .then(resolveGState, rejectGState); + }).catch(function (reason) { + if (reason instanceof AbortException) { + return; + } + if (self.options.ignoreErrors) { + warn(`getOperatorList - ignoring ExtGState: "${reason}".`); + return; + } + throw reason; + }), + ); + return; + case OPS.moveTo: + case OPS.lineTo: + case OPS.curveTo: + case OPS.curveTo2: + case OPS.curveTo3: + case OPS.closePath: + case OPS.rectangle: + self.buildPath(operatorList, fn, args, parsingText); + continue; + case OPS.markPoint: + case OPS.markPointProps: + case OPS.beginCompat: + case OPS.endCompat: + continue; + case OPS.beginMarkedContentProps: + if (!(args[0] instanceof Name)) { + warn(`Expected name for beginMarkedContentProps arg0=${args[0]}`); + operatorList.addOp(OPS.beginMarkedContentProps, ["OC", null]); + continue; + } + if (args[0].name === "OC") { + next( + self + .parseMarkedContentProps(args[1], resources) + .then((data) => { + operatorList.addOp(OPS.beginMarkedContentProps, [ + "OC", + data, + ]); + }) + .catch((reason) => { + if (reason instanceof AbortException) { + return; } + if (self.options.ignoreErrors) { + warn( + `getOperatorList - ignoring beginMarkedContentProps: "${reason}".`, + ); + operatorList.addOp(OPS.beginMarkedContentProps, [ + "OC", + null, + ]); + return; + } + throw reason; }), ); return; } - e = [e[0].name, e[1] instanceof Dict ? e[1].get("MCID") : null]; + args = [ + args[0].name, + args[1] instanceof Dict ? args[1].get("MCID") : null, + ]; break; + case OPS.beginMarkedContent: + case OPS.endMarkedContent: default: - if (null !== e) { - for (w = 0, D = e.length; w < D && !(e[w] instanceof Dict); w++); - if (w < D) { - warn("getOperatorList - ignoring operator: " + s); + if (args !== null) { + for (i = 0, ii = args.length; i < ii; i++) { + if (args[i] instanceof Dict) { + break; + } + } + if (i < ii) { + warn("getOperatorList - ignoring operator: " + fn); continue; } } } - a.addOp(s, e); + operatorList.addOp(fn, args); } - if (y) next(ks); - else { - closePendingRestoreOPS(); - e(); + if (stop) { + next(deferred); + return; } - }).catch((e) => { - if (!(e instanceof AbortException)) { - if (!this.options.ignoreErrors) throw e; + closePendingRestoreOPS(); + resolve(); + }).catch((reason) => { + if (reason instanceof AbortException) { + return; + } + if (this.options.ignoreErrors) { warn( - `getOperatorList - ignoring errors during "${t.name}" task: "${e}".`, + `getOperatorList - ignoring errors during "${task.name}" ` + + `task: "${reason}".`, ); closePendingRestoreOPS(); + return; } + throw reason; }); } getTextContent({ - stream: e, - task: t, - resources: s, - stateManager: r = null, - includeMarkedContent: n = !1, - sink: g, - seenStyles: o = new Set(), - viewBox: c, - lang: C = null, - markedContentData: h = null, - disableNormalization: l = !1, - keepWhiteSpace: Q = !1, + stream, + task, + resources, + stateManager = null, + includeMarkedContent = false, + sink, + seenStyles = new Set(), + viewBox, + lang = null, + markedContentData = null, + disableNormalization = false, + keepWhiteSpace = false, }) { - s ||= Dict.empty; - r ||= new StateManager(new TextState()); - n && (h ||= { level: 0 }); - const E = { items: [], styles: Object.create(null), lang: C }, - u = { - initialized: !1, - str: [], - totalWidth: 0, - totalHeight: 0, - width: 0, - height: 0, - vertical: !1, - prevTransform: null, - textAdvanceScale: 0, - spaceInFlowMin: 0, - spaceInFlowMax: 0, - trackingSpaceMin: 1 / 0, - negativeSpaceMax: -1 / 0, - notASpace: -1 / 0, - transform: null, - fontName: null, - hasEOL: !1, - }, - d = [" ", " "]; - let f = 0; - function saveLastChar(e) { - const t = (f + 1) % 2, - i = " " !== d[f] && " " === d[t]; - d[f] = e; - f = t; - return !Q && i; + resources ||= Dict.empty; + stateManager ||= new StateManager(new TextState()); + if (includeMarkedContent) { + markedContentData ||= { + level: 0, + }; + } + const textContent = { + items: [], + styles: Object.create(null), + lang, + }; + const textContentItem = { + initialized: false, + str: [], + totalWidth: 0, + totalHeight: 0, + width: 0, + height: 0, + vertical: false, + prevTransform: null, + textAdvanceScale: 0, + spaceInFlowMin: 0, + spaceInFlowMax: 0, + trackingSpaceMin: Infinity, + negativeSpaceMax: -Infinity, + notASpace: -Infinity, + transform: null, + fontName: null, + hasEOL: false, + }; + const twoLastChars = [" ", " "]; + let twoLastCharsPos = 0; + function saveLastChar(char) { + const nextPos = (twoLastCharsPos + 1) % 2; + const ret = + twoLastChars[twoLastCharsPos] !== " " && twoLastChars[nextPos] === " "; + twoLastChars[twoLastCharsPos] = char; + twoLastCharsPos = nextPos; + return !keepWhiteSpace && ret; } function shouldAddWhitepsace() { - return !Q && " " !== d[f] && " " === d[(f + 1) % 2]; + return ( + !keepWhiteSpace && + twoLastChars[twoLastCharsPos] !== " " && + twoLastChars[(twoLastCharsPos + 1) % 2] === " " + ); } function resetLastChars() { - d[0] = d[1] = " "; - f = 0; + twoLastChars[0] = twoLastChars[1] = " "; + twoLastCharsPos = 0; } - const p = this, - m = this.xref, - y = []; - let w = null; - const D = new LocalImageCache(), - b = new LocalGStateCache(), - F = new EvaluatorPreprocessor(e, m, r); - let S; + const TRACKING_SPACE_FACTOR = 0.102; + const NOT_A_SPACE_FACTOR = 0.03; + const NEGATIVE_SPACE_FACTOR = -0.2; + const SPACE_IN_FLOW_MIN_FACTOR = 0.102; + const SPACE_IN_FLOW_MAX_FACTOR = 0.6; + const VERTICAL_SHIFT_RATIO = 0.25; + const self = this; + const xref = this.xref; + const showSpacedTextBuffer = []; + let xobjs = null; + const emptyXObjectCache = new LocalImageCache(); + const emptyGStateCache = new LocalGStateCache(); + const preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); + let textState; function pushWhitespace({ - width: e = 0, - height: t = 0, - transform: i = u.prevTransform, - fontName: a = u.fontName, + width = 0, + height = 0, + transform = textContentItem.prevTransform, + fontName = textContentItem.fontName, }) { - E.items.push({ + textContent.items.push({ str: " ", dir: "ltr", - width: e, - height: t, - transform: i, - fontName: a, - hasEOL: !1, + width, + height, + transform, + fontName, + hasEOL: false, }); } function getCurrentTextTransform() { - const e = S.font, - t = [S.fontSize * S.textHScale, 0, 0, S.fontSize, 0, S.textRise]; + const font = textState.font; + const tsm = [ + textState.fontSize * textState.textHScale, + 0, + 0, + textState.fontSize, + 0, + textState.textRise, + ]; if ( - e.isType3Font && - (S.fontSize <= 1 || e.isCharBBox) && - !isArrayEqual(S.fontMatrix, a) + font.isType3Font && + (textState.fontSize <= 1 || font.isCharBBox) && + !isArrayEqual(textState.fontMatrix, FONT_IDENTITY_MATRIX) ) { - const i = e.bbox[3] - e.bbox[1]; - i > 0 && (t[3] *= i * S.fontMatrix[3]); + const glyphHeight = font.bbox[3] - font.bbox[1]; + if (glyphHeight > 0) { + tsm[3] *= glyphHeight * textState.fontMatrix[3]; + } } - return Util.transform(S.ctm, Util.transform(S.textMatrix, t)); + return Util.transform( + textState.ctm, + Util.transform(textState.textMatrix, tsm), + ); } function ensureTextContentItem() { - if (u.initialized) return u; - const { font: e, loadedName: t } = S; - if (!o.has(t)) { - o.add(t); - E.styles[t] = { - fontFamily: e.fallbackName, - ascent: e.ascent, - descent: e.descent, - vertical: e.vertical, + if (textContentItem.initialized) { + return textContentItem; + } + const { font, loadedName } = textState; + if (!seenStyles.has(loadedName)) { + seenStyles.add(loadedName); + textContent.styles[loadedName] = { + fontFamily: font.fallbackName, + ascent: font.ascent, + descent: font.descent, + vertical: font.vertical, }; - if (p.options.fontExtraProperties && e.systemFontInfo) { - const i = E.styles[t]; - i.fontSubstitution = e.systemFontInfo.css; - i.fontSubstitutionLoadedName = e.systemFontInfo.loadedName; + if (self.options.fontExtraProperties && font.systemFontInfo) { + const style = textContent.styles[loadedName]; + style.fontSubstitution = font.systemFontInfo.css; + style.fontSubstitutionLoadedName = font.systemFontInfo.loadedName; } } - u.fontName = t; - const i = (u.transform = getCurrentTextTransform()); - if (e.vertical) { - u.width = u.totalWidth = Math.hypot(i[0], i[1]); - u.height = u.totalHeight = 0; - u.vertical = !0; + textContentItem.fontName = loadedName; + const trm = (textContentItem.transform = getCurrentTextTransform()); + if (!font.vertical) { + textContentItem.width = textContentItem.totalWidth = 0; + textContentItem.height = textContentItem.totalHeight = Math.hypot( + trm[2], + trm[3], + ); + textContentItem.vertical = false; } else { - u.width = u.totalWidth = 0; - u.height = u.totalHeight = Math.hypot(i[2], i[3]); - u.vertical = !1; + textContentItem.width = textContentItem.totalWidth = Math.hypot( + trm[0], + trm[1], + ); + textContentItem.height = textContentItem.totalHeight = 0; + textContentItem.vertical = true; } - const a = Math.hypot(S.textLineMatrix[0], S.textLineMatrix[1]), - s = Math.hypot(S.ctm[0], S.ctm[1]); - u.textAdvanceScale = s * a; - const { fontSize: r } = S; - u.trackingSpaceMin = 0.102 * r; - u.notASpace = 0.03 * r; - u.negativeSpaceMax = -0.2 * r; - u.spaceInFlowMin = 0.102 * r; - u.spaceInFlowMax = 0.6 * r; - u.hasEOL = !1; - u.initialized = !0; - return u; + const scaleLineX = Math.hypot( + textState.textLineMatrix[0], + textState.textLineMatrix[1], + ); + const scaleCtmX = Math.hypot(textState.ctm[0], textState.ctm[1]); + textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; + const { fontSize } = textState; + textContentItem.trackingSpaceMin = fontSize * TRACKING_SPACE_FACTOR; + textContentItem.notASpace = fontSize * NOT_A_SPACE_FACTOR; + textContentItem.negativeSpaceMax = fontSize * NEGATIVE_SPACE_FACTOR; + textContentItem.spaceInFlowMin = fontSize * SPACE_IN_FLOW_MIN_FACTOR; + textContentItem.spaceInFlowMax = fontSize * SPACE_IN_FLOW_MAX_FACTOR; + textContentItem.hasEOL = false; + textContentItem.initialized = true; + return textContentItem; } function updateAdvanceScale() { - if (!u.initialized) return; - const e = Math.hypot(S.textLineMatrix[0], S.textLineMatrix[1]), - t = Math.hypot(S.ctm[0], S.ctm[1]) * e; - if (t !== u.textAdvanceScale) { - if (u.vertical) { - u.totalHeight += u.height * u.textAdvanceScale; - u.height = 0; - } else { - u.totalWidth += u.width * u.textAdvanceScale; - u.width = 0; - } - u.textAdvanceScale = t; + if (!textContentItem.initialized) { + return; } + const scaleLineX = Math.hypot( + textState.textLineMatrix[0], + textState.textLineMatrix[1], + ); + const scaleCtmX = Math.hypot(textState.ctm[0], textState.ctm[1]); + const scaleFactor = scaleCtmX * scaleLineX; + if (scaleFactor === textContentItem.textAdvanceScale) { + return; + } + if (!textContentItem.vertical) { + textContentItem.totalWidth += + textContentItem.width * textContentItem.textAdvanceScale; + textContentItem.width = 0; + } else { + textContentItem.totalHeight += + textContentItem.height * textContentItem.textAdvanceScale; + textContentItem.height = 0; + } + textContentItem.textAdvanceScale = scaleFactor; } - function runBidiTransform(e) { - let t = e.str.join(""); - l || - (t = (function normalizeUnicode(e) { - if (!ot) { - ot = - /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu; - It = new Map([["ſt", "ſt"]]); - } - return e.replaceAll(ot, (e, t, i) => - t ? t.normalize("NFKC") : It.get(i), - ); - })(t)); - const i = bidi(t, -1, e.vertical); + function runBidiTransform(textChunk) { + let text = textChunk.str.join(""); + if (!disableNormalization) { + text = normalizeUnicode(text); + } + const bidiResult = bidi(text, -1, textChunk.vertical); return { - str: i.str, - dir: i.dir, - width: Math.abs(e.totalWidth), - height: Math.abs(e.totalHeight), - transform: e.transform, - fontName: e.fontName, - hasEOL: e.hasEOL, + str: bidiResult.str, + dir: bidiResult.dir, + width: Math.abs(textChunk.totalWidth), + height: Math.abs(textChunk.totalHeight), + transform: textChunk.transform, + fontName: textChunk.fontName, + hasEOL: textChunk.hasEOL, }; } - async function handleSetFont(e, i) { - const r = await p.loadFont(e, i, s); - if (r.font.isType3Font) + async function handleSetFont(fontName, fontRef) { + const translated = await self.loadFont(fontName, fontRef, resources); + if (translated.font.isType3Font) { try { - await r.loadType3Data(p, s, t); + await translated.loadType3Data(self, resources, task); } catch {} - S.loadedName = r.loadedName; - S.font = r.font; - S.fontMatrix = r.font.fontMatrix || a; + } + textState.loadedName = translated.loadedName; + textState.font = translated.font; + textState.fontMatrix = translated.font.fontMatrix || FONT_IDENTITY_MATRIX; } - function applyInverseRotation(e, t, i) { - const a = Math.hypot(i[0], i[1]); - return [(i[0] * e + i[1] * t) / a, (i[2] * e + i[3] * t) / a]; + function applyInverseRotation(x, y, matrix) { + const scale = Math.hypot(matrix[0], matrix[1]); + return [ + (matrix[0] * x + matrix[1] * y) / scale, + (matrix[2] * x + matrix[3] * y) / scale, + ]; } - function compareWithLastPosition(e) { - const t = getCurrentTextTransform(); - let i = t[4], - a = t[5]; - if (S.font?.vertical) { - if (i < c[0] || i > c[2] || a + e < c[1] || a > c[3]) return !1; - } else if (i + e < c[0] || i > c[2] || a < c[1] || a > c[3]) return !1; - if (!S.font || !u.prevTransform) return !0; - let s = u.prevTransform[4], - r = u.prevTransform[5]; - if (s === i && r === a) return !0; - let n = -1; - t[0] && 0 === t[1] && 0 === t[2] - ? (n = t[0] > 0 ? 0 : 180) - : t[1] && 0 === t[0] && 0 === t[3] && (n = t[1] > 0 ? 90 : 270); - switch (n) { + function compareWithLastPosition(glyphWidth) { + const currentTransform = getCurrentTextTransform(); + let posX = currentTransform[4]; + let posY = currentTransform[5]; + if (textState.font?.vertical) { + if ( + posX < viewBox[0] || + posX > viewBox[2] || + posY + glyphWidth < viewBox[1] || + posY > viewBox[3] + ) { + return false; + } + } else if ( + posX + glyphWidth < viewBox[0] || + posX > viewBox[2] || + posY < viewBox[1] || + posY > viewBox[3] + ) { + return false; + } + if (!textState.font || !textContentItem.prevTransform) { + return true; + } + let lastPosX = textContentItem.prevTransform[4]; + let lastPosY = textContentItem.prevTransform[5]; + if (lastPosX === posX && lastPosY === posY) { + return true; + } + let rotate = -1; + if ( + currentTransform[0] && + currentTransform[1] === 0 && + currentTransform[2] === 0 + ) { + rotate = currentTransform[0] > 0 ? 0 : 180; + } else if ( + currentTransform[1] && + currentTransform[0] === 0 && + currentTransform[3] === 0 + ) { + rotate = currentTransform[1] > 0 ? 90 : 270; + } + switch (rotate) { case 0: break; case 90: - [i, a] = [a, i]; - [s, r] = [r, s]; + [posX, posY] = [posY, posX]; + [lastPosX, lastPosY] = [lastPosY, lastPosX]; break; case 180: - [i, a, s, r] = [-i, -a, -s, -r]; + [posX, posY, lastPosX, lastPosY] = [ + -posX, + -posY, + -lastPosX, + -lastPosY, + ]; break; case 270: - [i, a] = [-a, -i]; - [s, r] = [-r, -s]; + [posX, posY] = [-posY, -posX]; + [lastPosX, lastPosY] = [-lastPosY, -lastPosX]; break; default: - [i, a] = applyInverseRotation(i, a, t); - [s, r] = applyInverseRotation(s, r, u.prevTransform); + [posX, posY] = applyInverseRotation(posX, posY, currentTransform); + [lastPosX, lastPosY] = applyInverseRotation( + lastPosX, + lastPosY, + textContentItem.prevTransform, + ); } - if (S.font.vertical) { - const e = (r - a) / u.textAdvanceScale, - t = i - s, - n = Math.sign(u.height); - if (e < n * u.negativeSpaceMax) { - if (Math.abs(t) > 0.5 * u.width) { + if (textState.font.vertical) { + const advanceY = (lastPosY - posY) / textContentItem.textAdvanceScale; + const advanceX = posX - lastPosX; + const textOrientation = Math.sign(textContentItem.height); + if (advanceY < textOrientation * textContentItem.negativeSpaceMax) { + if (Math.abs(advanceX) > 0.5 * textContentItem.width) { appendEOL(); - return !0; + return true; } resetLastChars(); flushTextContentItem(); - return !0; + return true; } - if (Math.abs(t) > u.width) { + if (Math.abs(advanceX) > textContentItem.width) { appendEOL(); - return !0; + return true; } - e <= n * u.notASpace && resetLastChars(); - if (e <= n * u.trackingSpaceMin) + if (advanceY <= textOrientation * textContentItem.notASpace) { + resetLastChars(); + } + if (advanceY <= textOrientation * textContentItem.trackingSpaceMin) { if (shouldAddWhitepsace()) { resetLastChars(); flushTextContentItem(); - pushWhitespace({ height: Math.abs(e) }); - } else u.height += e; - else if (!addFakeSpaces(e, u.prevTransform, n)) - if (0 === u.str.length) { + pushWhitespace({ + height: Math.abs(advanceY), + }); + } else { + textContentItem.height += advanceY; + } + } else if ( + !addFakeSpaces( + advanceY, + textContentItem.prevTransform, + textOrientation, + ) + ) { + if (textContentItem.str.length === 0) { resetLastChars(); - pushWhitespace({ height: Math.abs(e) }); - } else u.height += e; - Math.abs(t) > 0.25 * u.width && flushTextContentItem(); - return !0; + pushWhitespace({ + height: Math.abs(advanceY), + }); + } else { + textContentItem.height += advanceY; + } + } + if (Math.abs(advanceX) > textContentItem.width * VERTICAL_SHIFT_RATIO) { + flushTextContentItem(); + } + return true; } - const g = (i - s) / u.textAdvanceScale, - o = a - r, - C = Math.sign(u.width); - if (g < C * u.negativeSpaceMax) { - if (Math.abs(o) > 0.5 * u.height) { + const advanceX = (posX - lastPosX) / textContentItem.textAdvanceScale; + const advanceY = posY - lastPosY; + const textOrientation = Math.sign(textContentItem.width); + if (advanceX < textOrientation * textContentItem.negativeSpaceMax) { + if (Math.abs(advanceY) > 0.5 * textContentItem.height) { appendEOL(); - return !0; + return true; } resetLastChars(); flushTextContentItem(); - return !0; + return true; } - if (Math.abs(o) > u.height) { + if (Math.abs(advanceY) > textContentItem.height) { appendEOL(); - return !0; + return true; } - g <= C * u.notASpace && resetLastChars(); - if (g <= C * u.trackingSpaceMin) + if (advanceX <= textOrientation * textContentItem.notASpace) { + resetLastChars(); + } + if (advanceX <= textOrientation * textContentItem.trackingSpaceMin) { if (shouldAddWhitepsace()) { resetLastChars(); flushTextContentItem(); - pushWhitespace({ width: Math.abs(g) }); - } else u.width += g; - else if (!addFakeSpaces(g, u.prevTransform, C)) - if (0 === u.str.length) { + pushWhitespace({ + width: Math.abs(advanceX), + }); + } else { + textContentItem.width += advanceX; + } + } else if ( + !addFakeSpaces(advanceX, textContentItem.prevTransform, textOrientation) + ) { + if (textContentItem.str.length === 0) { resetLastChars(); - pushWhitespace({ width: Math.abs(g) }); - } else u.width += g; - Math.abs(o) > 0.25 * u.height && flushTextContentItem(); - return !0; + pushWhitespace({ + width: Math.abs(advanceX), + }); + } else { + textContentItem.width += advanceX; + } + } + if (Math.abs(advanceY) > textContentItem.height * VERTICAL_SHIFT_RATIO) { + flushTextContentItem(); + } + return true; } - function buildTextContentItem({ chars: e, extraSpacing: t }) { - const i = S.font; - if (!e) { - const e = S.charSpacing + t; - e && - (i.vertical - ? S.translateTextMatrix(0, -e) - : S.translateTextMatrix(e * S.textHScale, 0)); - Q && compareWithLastPosition(0); + function buildTextContentItem({ chars, extraSpacing }) { + const font = textState.font; + if (!chars) { + const charSpacing = textState.charSpacing + extraSpacing; + if (charSpacing) { + if (!font.vertical) { + textState.translateTextMatrix( + charSpacing * textState.textHScale, + 0, + ); + } else { + textState.translateTextMatrix(0, -charSpacing); + } + } + if (keepWhiteSpace) { + compareWithLastPosition(0); + } return; } - const a = i.charsToGlyphs(e), - s = S.fontMatrix[0] * S.fontSize; - for (let e = 0, r = a.length; e < r; e++) { - const n = a[e], - { category: g } = n; - if (g.isInvisibleFormatMark) continue; - let o = S.charSpacing + (e + 1 === r ? t : 0), - c = n.width; - i.vertical && (c = n.vmetric ? n.vmetric[0] : -c); - let C = c * s; - if (!Q && g.isWhitespace) { - if (i.vertical) { - o += -C + S.wordSpacing; - S.translateTextMatrix(0, -o); + const glyphs = font.charsToGlyphs(chars); + const scale = textState.fontMatrix[0] * textState.fontSize; + for (let i = 0, ii = glyphs.length; i < ii; i++) { + const glyph = glyphs[i]; + const { category } = glyph; + if (category.isInvisibleFormatMark) { + continue; + } + let charSpacing = + textState.charSpacing + (i + 1 === ii ? extraSpacing : 0); + let glyphWidth = glyph.width; + if (font.vertical) { + glyphWidth = glyph.vmetric ? glyph.vmetric[0] : -glyphWidth; + } + let scaledDim = glyphWidth * scale; + if (!keepWhiteSpace && category.isWhitespace) { + if (!font.vertical) { + charSpacing += scaledDim + textState.wordSpacing; + textState.translateTextMatrix( + charSpacing * textState.textHScale, + 0, + ); } else { - o += C + S.wordSpacing; - S.translateTextMatrix(o * S.textHScale, 0); + charSpacing += -scaledDim + textState.wordSpacing; + textState.translateTextMatrix(0, -charSpacing); } saveLastChar(" "); continue; } - if (!g.isZeroWidthDiacritic && !compareWithLastPosition(C)) { - i.vertical - ? S.translateTextMatrix(0, C) - : S.translateTextMatrix(C * S.textHScale, 0); + if ( + !category.isZeroWidthDiacritic && + !compareWithLastPosition(scaledDim) + ) { + if (!font.vertical) { + textState.translateTextMatrix(scaledDim * textState.textHScale, 0); + } else { + textState.translateTextMatrix(0, scaledDim); + } continue; } - const h = ensureTextContentItem(); - g.isZeroWidthDiacritic && (C = 0); - if (i.vertical) { - S.translateTextMatrix(0, C); - C = Math.abs(C); - h.height += C; - } else { - C *= S.textHScale; - S.translateTextMatrix(C, 0); - h.width += C; + const textChunk = ensureTextContentItem(); + if (category.isZeroWidthDiacritic) { + scaledDim = 0; + } + if (!font.vertical) { + scaledDim *= textState.textHScale; + textState.translateTextMatrix(scaledDim, 0); + textChunk.width += scaledDim; + } else { + textState.translateTextMatrix(0, scaledDim); + scaledDim = Math.abs(scaledDim); + textChunk.height += scaledDim; + } + if (scaledDim) { + textChunk.prevTransform = getCurrentTextTransform(); + } + const glyphUnicode = glyph.unicode; + if (saveLastChar(glyphUnicode)) { + textChunk.str.push(" "); + } + textChunk.str.push(glyphUnicode); + if (charSpacing) { + if (!font.vertical) { + textState.translateTextMatrix( + charSpacing * textState.textHScale, + 0, + ); + } else { + textState.translateTextMatrix(0, -charSpacing); + } } - C && (h.prevTransform = getCurrentTextTransform()); - const l = n.unicode; - saveLastChar(l) && h.str.push(" "); - h.str.push(l); - o && - (i.vertical - ? S.translateTextMatrix(0, -o) - : S.translateTextMatrix(o * S.textHScale, 0)); } } function appendEOL() { resetLastChars(); - if (u.initialized) { - u.hasEOL = !0; + if (textContentItem.initialized) { + textContentItem.hasEOL = true; flushTextContentItem(); - } else - E.items.push({ + } else { + textContent.items.push({ str: "", dir: "ltr", width: 0, height: 0, transform: getCurrentTextTransform(), - fontName: S.loadedName, - hasEOL: !0, + fontName: textState.loadedName, + hasEOL: true, }); - } - function addFakeSpaces(e, t, i) { - if (i * u.spaceInFlowMin <= e && e <= i * u.spaceInFlowMax) { - if (u.initialized) { - resetLastChars(); - u.str.push(" "); - } - return !1; } - const a = u.fontName; - let s = 0; - if (u.vertical) { - s = e; - e = 0; + } + function addFakeSpaces(width, transf, textOrientation) { + if ( + textOrientation * textContentItem.spaceInFlowMin <= width && + width <= textOrientation * textContentItem.spaceInFlowMax + ) { + if (textContentItem.initialized) { + resetLastChars(); + textContentItem.str.push(" "); + } + return false; + } + const fontName = textContentItem.fontName; + let height = 0; + if (textContentItem.vertical) { + height = width; + width = 0; } flushTextContentItem(); resetLastChars(); pushWhitespace({ - width: Math.abs(e), - height: Math.abs(s), - transform: t || getCurrentTextTransform(), - fontName: a, + width: Math.abs(width), + height: Math.abs(height), + transform: transf || getCurrentTextTransform(), + fontName, }); - return !0; + return true; } function flushTextContentItem() { - if (u.initialized && u.str) { - u.vertical - ? (u.totalHeight += u.height * u.textAdvanceScale) - : (u.totalWidth += u.width * u.textAdvanceScale); - E.items.push(runBidiTransform(u)); - u.initialized = !1; - u.str.length = 0; + if (!textContentItem.initialized || !textContentItem.str) { + return; } - } - function enqueueChunk(e = !1) { - const t = E.items.length; - if (0 !== t && !(e && t < 10)) { - g.enqueue(E, t); - E.items = []; - E.styles = Object.create(null); + if (!textContentItem.vertical) { + textContentItem.totalWidth += + textContentItem.width * textContentItem.textAdvanceScale; + } else { + textContentItem.totalHeight += + textContentItem.height * textContentItem.textAdvanceScale; } + textContent.items.push(runBidiTransform(textContentItem)); + textContentItem.initialized = false; + textContentItem.str.length = 0; } - const k = new TimeSlotManager(); - return new Promise(function promiseBody(e, a) { - const next = function (t) { - enqueueChunk(!0); - Promise.all([t, g.ready]).then(function () { + function enqueueChunk(batch = false) { + const length = textContent.items.length; + if (length === 0) { + return; + } + if (batch && length < TEXT_CHUNK_BATCH_SIZE) { + return; + } + sink.enqueue(textContent, length); + textContent.items = []; + textContent.styles = Object.create(null); + } + const timeSlotManager = new TimeSlotManager(); + return new Promise(function promiseBody(resolve, reject) { + const next = function (promise) { + enqueueChunk(true); + Promise.all([promise, sink.ready]).then(function () { try { - promiseBody(e, a); - } catch (e) { - a(e); + promiseBody(resolve, reject); + } catch (ex) { + reject(ex); } - }, a); + }, reject); }; - t.ensureNotTerminated(); - k.reset(); - const u = {}; - let d, - f = []; - for (; !(d = k.check()); ) { - f.length = 0; - u.args = f; - if (!F.read(u)) break; - const e = S; - S = r.state; - const a = u.fn; - f = u.args; - switch (0 | a) { - case se: - var R = f[0].name, - N = f[1]; - if (S.font && R === S.fontName && N === S.fontSize) break; + task.ensureNotTerminated(); + timeSlotManager.reset(); + const operation = {}; + let stop, + args = []; + while (!(stop = timeSlotManager.check())) { + args.length = 0; + operation.args = args; + if (!preprocessor.read(operation)) { + break; + } + const previousState = textState; + textState = stateManager.state; + const fn = operation.fn; + args = operation.args; + switch (fn | 0) { + case OPS.setFont: + var fontNameArg = args[0].name, + fontSizeArg = args[1]; + if ( + textState.font && + fontNameArg === textState.fontName && + fontSizeArg === textState.fontSize + ) { + break; + } flushTextContentItem(); - S.fontName = R; - S.fontSize = N; - next(handleSetFont(R, null)); + textState.fontName = fontNameArg; + textState.fontSize = fontSizeArg; + next(handleSetFont(fontNameArg, null)); return; - case ne: - S.textRise = f[0]; + case OPS.setTextRise: + textState.textRise = args[0]; break; - case ie: - S.textHScale = f[0] / 100; + case OPS.setHScale: + textState.textHScale = args[0] / 100; break; - case ae: - S.leading = f[0]; + case OPS.setLeading: + textState.leading = args[0]; break; - case ge: - S.translateTextLineMatrix(f[0], f[1]); - S.textMatrix = S.textLineMatrix.slice(); + case OPS.moveText: + textState.translateTextLineMatrix(args[0], args[1]); + textState.textMatrix = textState.textLineMatrix.slice(); break; - case oe: - S.leading = -f[1]; - S.translateTextLineMatrix(f[0], f[1]); - S.textMatrix = S.textLineMatrix.slice(); + case OPS.setLeadingMoveText: + textState.leading = -args[1]; + textState.translateTextLineMatrix(args[0], args[1]); + textState.textMatrix = textState.textLineMatrix.slice(); break; - case ce: - S.carriageReturn(); + case OPS.nextLine: + textState.carriageReturn(); break; - case Ie: - S.setTextMatrix(f[0], f[1], f[2], f[3], f[4], f[5]); - S.setTextLineMatrix(f[0], f[1], f[2], f[3], f[4], f[5]); + case OPS.setTextMatrix: + textState.setTextMatrix( + args[0], + args[1], + args[2], + args[3], + args[4], + args[5], + ); + textState.setTextLineMatrix( + args[0], + args[1], + args[2], + args[3], + args[4], + args[5], + ); updateAdvanceScale(); break; - case ee: - S.charSpacing = f[0]; + case OPS.setCharSpacing: + textState.charSpacing = args[0]; break; - case te: - S.wordSpacing = f[0]; + case OPS.setWordSpacing: + textState.wordSpacing = args[0]; break; - case $A: - S.textMatrix = i.slice(); - S.textLineMatrix = i.slice(); + case OPS.beginText: + textState.textMatrix = IDENTITY_MATRIX.slice(); + textState.textLineMatrix = IDENTITY_MATRIX.slice(); break; - case he: - if (!r.state.font) { - p.ensureStateFont(r.state); + case OPS.showSpacedText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); continue; } - const a = ((S.font.vertical ? 1 : -1) * S.fontSize) / 1e3, - u = f[0]; - for (let e = 0, t = u.length; e < t; e++) { - const t = u[e]; - if ("string" == typeof t) y.push(t); - else if ("number" == typeof t && 0 !== t) { - const e = y.join(""); - y.length = 0; - buildTextContentItem({ chars: e, extraSpacing: t * a }); + const spaceFactor = + ((textState.font.vertical ? 1 : -1) * textState.fontSize) / 1000; + const elements = args[0]; + for (let i = 0, ii = elements.length; i < ii; i++) { + const item = elements[i]; + if (typeof item === "string") { + showSpacedTextBuffer.push(item); + } else if (typeof item === "number" && item !== 0) { + const str = showSpacedTextBuffer.join(""); + showSpacedTextBuffer.length = 0; + buildTextContentItem({ + chars: str, + extraSpacing: item * spaceFactor, + }); } } - if (y.length > 0) { - const e = y.join(""); - y.length = 0; - buildTextContentItem({ chars: e, extraSpacing: 0 }); + if (showSpacedTextBuffer.length > 0) { + const str = showSpacedTextBuffer.join(""); + showSpacedTextBuffer.length = 0; + buildTextContentItem({ + chars: str, + extraSpacing: 0, + }); } break; - case Ce: - if (!r.state.font) { - p.ensureStateFont(r.state); + case OPS.showText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); continue; } - buildTextContentItem({ chars: f[0], extraSpacing: 0 }); + buildTextContentItem({ + chars: args[0], + extraSpacing: 0, + }); break; - case Be: - if (!r.state.font) { - p.ensureStateFont(r.state); + case OPS.nextLineShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); continue; } - S.carriageReturn(); - buildTextContentItem({ chars: f[0], extraSpacing: 0 }); + textState.carriageReturn(); + buildTextContentItem({ + chars: args[0], + extraSpacing: 0, + }); break; - case le: - if (!r.state.font) { - p.ensureStateFont(r.state); + case OPS.nextLineSetSpacingShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); continue; } - S.wordSpacing = f[0]; - S.charSpacing = f[1]; - S.carriageReturn(); - buildTextContentItem({ chars: f[2], extraSpacing: 0 }); + textState.wordSpacing = args[0]; + textState.charSpacing = args[1]; + textState.carriageReturn(); + buildTextContentItem({ + chars: args[2], + extraSpacing: 0, + }); break; - case Ue: + case OPS.paintXObject: flushTextContentItem(); - w || (w = s.get("XObject") || Dict.empty); - var G = f[0] instanceof Name, - x = f[0].name; - if (G && D.getByName(x)) break; + if (!xobjs) { + xobjs = resources.get("XObject") || Dict.empty; + } + var isValidName = args[0] instanceof Name; + var name = args[0].name; + if (isValidName && emptyXObjectCache.getByName(name)) { + break; + } next( - new Promise(function (e, i) { - if (!G) + new Promise(function (resolveXObject, rejectXObject) { + if (!isValidName) { throw new FormatError("XObject must be referred to by name."); - let a = w.getRaw(x); - if (a instanceof Ref) { - if (D.getByRef(a)) { - e(); - return; - } - if (p.globalImageCache.getData(a, p.pageIndex)) { - e(); - return; - } - a = m.fetch(a); } - if (!(a instanceof BaseStream)) + let xobj = xobjs.getRaw(name); + if (xobj instanceof Ref) { + if (emptyXObjectCache.getByRef(xobj)) { + resolveXObject(); + return; + } + const globalImage = self.globalImageCache.getData( + xobj, + self.pageIndex, + ); + if (globalImage) { + resolveXObject(); + return; + } + xobj = xref.fetch(xobj); + } + if (!(xobj instanceof BaseStream)) { throw new FormatError("XObject should be a stream"); - const E = a.dict.get("Subtype"); - if (!(E instanceof Name)) + } + const type = xobj.dict.get("Subtype"); + if (!(type instanceof Name)) { throw new FormatError("XObject should have a Name subtype"); - if ("Form" !== E.name) { - D.set(x, a.dict.objId, !0); - e(); + } + if (type.name !== "Form") { + emptyXObjectCache.set(name, xobj.dict.objId, true); + resolveXObject(); return; } - const u = r.state.clone(), - d = new StateManager(u), - f = lookupMatrix(a.dict.getArray("Matrix"), null); - f && d.transform(f); + const currentState = stateManager.state.clone(); + const xObjStateManager = new StateManager(currentState); + const matrix = lookupMatrix(xobj.dict.getArray("Matrix"), null); + if (matrix) { + xObjStateManager.transform(matrix); + } enqueueChunk(); - const y = { - enqueueInvoked: !1, - enqueue(e, t) { - this.enqueueInvoked = !0; - g.enqueue(e, t); + const sinkWrapper = { + enqueueInvoked: false, + enqueue(chunk, size) { + this.enqueueInvoked = true; + sink.enqueue(chunk, size); }, get desiredSize() { - return g.desiredSize; + return sink.desiredSize; }, get ready() { - return g.ready; + return sink.ready; }, }; - p.getTextContent({ - stream: a, - task: t, - resources: a.dict.get("Resources") || s, - stateManager: d, - includeMarkedContent: n, - sink: y, - seenStyles: o, - viewBox: c, - lang: C, - markedContentData: h, - disableNormalization: l, - keepWhiteSpace: Q, - }).then(function () { - y.enqueueInvoked || D.set(x, a.dict.objId, !0); - e(); - }, i); - }).catch(function (e) { - if (!(e instanceof AbortException)) { - if (!p.options.ignoreErrors) throw e; - warn(`getTextContent - ignoring XObject: "${e}".`); + self + .getTextContent({ + stream: xobj, + task, + resources: xobj.dict.get("Resources") || resources, + stateManager: xObjStateManager, + includeMarkedContent, + sink: sinkWrapper, + seenStyles, + viewBox, + lang, + markedContentData, + disableNormalization, + keepWhiteSpace, + }) + .then(function () { + if (!sinkWrapper.enqueueInvoked) { + emptyXObjectCache.set(name, xobj.dict.objId, true); + } + resolveXObject(); + }, rejectXObject); + }).catch(function (reason) { + if (reason instanceof AbortException) { + return; } + if (self.options.ignoreErrors) { + warn(`getTextContent - ignoring XObject: "${reason}".`); + return; + } + throw reason; }), ); return; - case NA: - G = f[0] instanceof Name; - x = f[0].name; - if (G && b.getByName(x)) break; + case OPS.setGState: + isValidName = args[0] instanceof Name; + name = args[0].name; + if (isValidName && emptyGStateCache.getByName(name)) { + break; + } next( - new Promise(function (e, t) { - if (!G) + new Promise(function (resolveGState, rejectGState) { + if (!isValidName) { throw new FormatError("GState must be referred to by name."); - const i = s.get("ExtGState"); - if (!(i instanceof Dict)) + } + const extGState = resources.get("ExtGState"); + if (!(extGState instanceof Dict)) { throw new FormatError("ExtGState should be a dictionary."); - const a = i.get(x); - if (!(a instanceof Dict)) + } + const gState = extGState.get(name); + if (!(gState instanceof Dict)) { throw new FormatError("GState should be a dictionary."); - const r = a.get("Font"); - if (r) { - flushTextContentItem(); - S.fontName = null; - S.fontSize = r[1]; - handleSetFont(null, r[0]).then(e, t); - } else { - b.set(x, a.objId, !0); - e(); } - }).catch(function (e) { - if (!(e instanceof AbortException)) { - if (!p.options.ignoreErrors) throw e; - warn(`getTextContent - ignoring ExtGState: "${e}".`); + const gStateFont = gState.get("Font"); + if (!gStateFont) { + emptyGStateCache.set(name, gState.objId, true); + resolveGState(); + return; } + flushTextContentItem(); + textState.fontName = null; + textState.fontSize = gStateFont[1]; + handleSetFont(null, gStateFont[0]).then( + resolveGState, + rejectGState, + ); + }).catch(function (reason) { + if (reason instanceof AbortException) { + return; + } + if (self.options.ignoreErrors) { + warn(`getTextContent - ignoring ExtGState: "${reason}".`); + return; + } + throw reason; }), ); return; - case He: + case OPS.beginMarkedContent: flushTextContentItem(); - if (n) { - h.level++; - E.items.push({ + if (includeMarkedContent) { + markedContentData.level++; + textContent.items.push({ type: "beginMarkedContent", - tag: f[0] instanceof Name ? f[0].name : null, + tag: args[0] instanceof Name ? args[0].name : null, }); } break; - case Je: + case OPS.beginMarkedContentProps: flushTextContentItem(); - if (n) { - h.level++; - let e = null; - f[1] instanceof Dict && (e = f[1].get("MCID")); - E.items.push({ + if (includeMarkedContent) { + markedContentData.level++; + let mcid = null; + if (args[1] instanceof Dict) { + mcid = args[1].get("MCID"); + } + textContent.items.push({ type: "beginMarkedContentProps", - id: Number.isInteger(e) - ? `${p.idFactory.getPageObjId()}_mc${e}` + id: Number.isInteger(mcid) + ? `${self.idFactory.getPageObjId()}_mc${mcid}` : null, - tag: f[0] instanceof Name ? f[0].name : null, + tag: args[0] instanceof Name ? args[0].name : null, }); } break; - case Ye: + case OPS.endMarkedContent: flushTextContentItem(); - if (n) { - if (0 === h.level) break; - h.level--; - E.items.push({ type: "endMarkedContent" }); + if (includeMarkedContent) { + if (markedContentData.level === 0) { + break; + } + markedContentData.level--; + textContent.items.push({ + type: "endMarkedContent", + }); } break; - case xA: - !e || - (e.font === S.font && - e.fontSize === S.fontSize && - e.fontName === S.fontName) || + case OPS.restore: + if ( + previousState && + (previousState.font !== textState.font || + previousState.fontSize !== textState.fontSize || + previousState.fontName !== textState.fontName) + ) { flushTextContentItem(); + } + break; } - if (E.items.length >= g.desiredSize) { - d = !0; + if (textContent.items.length >= sink.desiredSize) { + stop = true; break; } } - if (d) next(ks); - else { - flushTextContentItem(); - enqueueChunk(); - e(); + if (stop) { + next(deferred); + return; } - }).catch((e) => { - if (!(e instanceof AbortException)) { - if (!this.options.ignoreErrors) throw e; + flushTextContentItem(); + enqueueChunk(); + resolve(); + }).catch((reason) => { + if (reason instanceof AbortException) { + return; + } + if (this.options.ignoreErrors) { warn( - `getTextContent - ignoring errors during "${t.name}" task: "${e}".`, + `getTextContent - ignoring errors during "${task.name}" ` + + `task: "${reason}".`, ); flushTextContentItem(); enqueueChunk(); + return; } + throw reason; }); } - async extractDataStructures(e, t) { - const i = this.xref; - let a; - const s = this.readToUnicode(t.toUnicode); - if (t.composite) { - const i = e.get("CIDSystemInfo"); - i instanceof Dict && - (t.cidSystemInfo = { - registry: stringToPDFString(i.get("Registry")), - ordering: stringToPDFString(i.get("Ordering")), - supplement: i.get("Supplement"), - }); + async extractDataStructures(dict, properties) { + const xref = this.xref; + let cidToGidBytes; + const toUnicodePromise = this.readToUnicode(properties.toUnicode); + if (properties.composite) { + const cidSystemInfo = dict.get("CIDSystemInfo"); + if (cidSystemInfo instanceof Dict) { + properties.cidSystemInfo = { + registry: stringToPDFString(cidSystemInfo.get("Registry")), + ordering: stringToPDFString(cidSystemInfo.get("Ordering")), + supplement: cidSystemInfo.get("Supplement"), + }; + } try { - const t = e.get("CIDToGIDMap"); - t instanceof BaseStream && (a = t.getBytes()); - } catch (e) { - if (!this.options.ignoreErrors) throw e; - warn(`extractDataStructures - ignoring CIDToGIDMap data: "${e}".`); + const cidToGidMap = dict.get("CIDToGIDMap"); + if (cidToGidMap instanceof BaseStream) { + cidToGidBytes = cidToGidMap.getBytes(); + } + } catch (ex) { + if (!this.options.ignoreErrors) { + throw ex; + } + warn(`extractDataStructures - ignoring CIDToGIDMap data: "${ex}".`); } } - const r = []; - let n, - g = null; - if (e.has("Encoding")) { - n = e.get("Encoding"); - if (n instanceof Dict) { - g = n.get("BaseEncoding"); - g = g instanceof Name ? g.name : null; - if (n.has("Differences")) { - const e = n.get("Differences"); - let t = 0; - for (const a of e) { - const e = i.fetchIfRef(a); - if ("number" == typeof e) t = e; - else { - if (!(e instanceof Name)) - throw new FormatError( - `Invalid entry in 'Differences' array: ${e}`, - ); - r[t++] = e.name; + const differences = []; + let baseEncodingName = null; + let encoding; + if (dict.has("Encoding")) { + encoding = dict.get("Encoding"); + if (encoding instanceof Dict) { + baseEncodingName = encoding.get("BaseEncoding"); + baseEncodingName = + baseEncodingName instanceof Name ? baseEncodingName.name : null; + if (encoding.has("Differences")) { + const diffEncoding = encoding.get("Differences"); + let index = 0; + for (const entry of diffEncoding) { + const data = xref.fetchIfRef(entry); + if (typeof data === "number") { + index = data; + } else if (data instanceof Name) { + differences[index++] = data.name; + } else { + throw new FormatError( + `Invalid entry in 'Differences' array: ${data}`, + ); } } } - } else if (n instanceof Name) g = n.name; - else { - const e = "Encoding is not a Name nor a Dict"; - if (!this.options.ignoreErrors) throw new FormatError(e); - warn(e); + } else if (encoding instanceof Name) { + baseEncodingName = encoding.name; + } else { + const msg = "Encoding is not a Name nor a Dict"; + if (!this.options.ignoreErrors) { + throw new FormatError(msg); + } + warn(msg); } - "MacRomanEncoding" !== g && - "MacExpertEncoding" !== g && - "WinAnsiEncoding" !== g && - (g = null); - } - const o = !t.file || t.isInternalFont, - c = Zi()[t.name]; - g && o && c && (g = null); - if (g) t.defaultEncoding = getEncoding(g); - else { - const e = !!(t.flags & Ti), - i = !!(t.flags & qi); - n = fi; - "TrueType" !== t.type || i || (n = pi); - if (e || c) { - n = di; - o && - (/Symbol/i.test(t.name) - ? (n = mi) - : /Dingbats/i.test(t.name) - ? (n = yi) - : /Wingdings/i.test(t.name) && (n = pi)); + if ( + baseEncodingName !== "MacRomanEncoding" && + baseEncodingName !== "MacExpertEncoding" && + baseEncodingName !== "WinAnsiEncoding" + ) { + baseEncodingName = null; } - t.defaultEncoding = n; } - t.differences = r; - t.baseEncodingName = g; - t.hasEncoding = !!g || r.length > 0; - t.dict = e; - t.toUnicode = await s; - const C = await this.buildToUnicode(t); - t.toUnicode = C; - a && (t.cidToGidMap = this.readCidToGidMap(a, C)); - return t; + const nonEmbeddedFont = !properties.file || properties.isInternalFont, + isSymbolsFontName = getSymbolsFonts()[properties.name]; + if (baseEncodingName && nonEmbeddedFont && isSymbolsFontName) { + baseEncodingName = null; + } + if (baseEncodingName) { + properties.defaultEncoding = getEncoding(baseEncodingName); + } else { + const isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); + const isNonsymbolicFont = !!(properties.flags & FontFlags.Nonsymbolic); + encoding = StandardEncoding; + if (properties.type === "TrueType" && !isNonsymbolicFont) { + encoding = WinAnsiEncoding; + } + if (isSymbolicFont || isSymbolsFontName) { + encoding = MacRomanEncoding; + if (nonEmbeddedFont) { + if (/Symbol/i.test(properties.name)) { + encoding = SymbolSetEncoding; + } else if (/Dingbats/i.test(properties.name)) { + encoding = ZapfDingbatsEncoding; + } else if (/Wingdings/i.test(properties.name)) { + encoding = WinAnsiEncoding; + } + } + } + properties.defaultEncoding = encoding; + } + properties.differences = differences; + properties.baseEncodingName = baseEncodingName; + properties.hasEncoding = !!baseEncodingName || differences.length > 0; + properties.dict = dict; + properties.toUnicode = await toUnicodePromise; + const builtToUnicode = await this.buildToUnicode(properties); + properties.toUnicode = builtToUnicode; + if (cidToGidBytes) { + properties.cidToGidMap = this.readCidToGidMap( + cidToGidBytes, + builtToUnicode, + ); + } + return properties; } - _simpleFontToUnicode(e, t = !1) { - assert(!e.composite, "Must be a simple font."); - const i = [], - a = e.defaultEncoding.slice(), - s = e.baseEncodingName, - r = e.differences; - for (const e in r) { - const t = r[e]; - ".notdef" !== t && (a[e] = t); - } - const n = Ni(); - for (const r in a) { - let g = a[r]; - if ("" === g) continue; - let o = n[g]; - if (void 0 !== o) { - i[r] = String.fromCharCode(o); + _simpleFontToUnicode(properties, forceGlyphs = false) { + assert(!properties.composite, "Must be a simple font."); + const toUnicode = []; + const encoding = properties.defaultEncoding.slice(); + const baseEncodingName = properties.baseEncodingName; + const differences = properties.differences; + for (const charcode in differences) { + const glyphName = differences[charcode]; + if (glyphName === ".notdef") { continue; } - let c = 0; - switch (g[0]) { + encoding[charcode] = glyphName; + } + const glyphsUnicodeMap = getGlyphsUnicode(); + for (const charcode in encoding) { + let glyphName = encoding[charcode]; + if (glyphName === "") { + continue; + } + let unicode = glyphsUnicodeMap[glyphName]; + if (unicode !== undefined) { + toUnicode[charcode] = String.fromCharCode(unicode); + continue; + } + let code = 0; + switch (glyphName[0]) { case "G": - 3 === g.length && (c = parseInt(g.substring(1), 16)); + if (glyphName.length === 3) { + code = parseInt(glyphName.substring(1), 16); + } break; case "g": - 5 === g.length && (c = parseInt(g.substring(1), 16)); + if (glyphName.length === 5) { + code = parseInt(glyphName.substring(1), 16); + } break; case "C": case "c": - if (g.length >= 3 && g.length <= 4) { - const i = g.substring(1); - if (t) { - c = parseInt(i, 16); + if (glyphName.length >= 3 && glyphName.length <= 4) { + const codeStr = glyphName.substring(1); + if (forceGlyphs) { + code = parseInt(codeStr, 16); break; } - c = +i; - if (Number.isNaN(c) && Number.isInteger(parseInt(i, 16))) - return this._simpleFontToUnicode(e, !0); + code = +codeStr; + if (Number.isNaN(code) && Number.isInteger(parseInt(codeStr, 16))) { + return this._simpleFontToUnicode(properties, true); + } } break; case "u": - o = getUnicodeForGlyph(g, n); - -1 !== o && (c = o); + unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); + if (unicode !== -1) { + code = unicode; + } break; default: - switch (g) { + switch (glyphName) { case "f_h": case "f_t": case "T_h": - i[r] = g.replaceAll("_", ""); + toUnicode[charcode] = glyphName.replaceAll("_", ""); continue; } + break; } - if (c > 0 && c <= 1114111 && Number.isInteger(c)) { - if (s && c === +r) { - const e = getEncoding(s); - if (e && (g = e[r])) { - i[r] = String.fromCharCode(n[g]); + if (code > 0 && code <= 0x10ffff && Number.isInteger(code)) { + if (baseEncodingName && code === +charcode) { + const baseEncoding = getEncoding(baseEncodingName); + if (baseEncoding && (glyphName = baseEncoding[charcode])) { + toUnicode[charcode] = String.fromCharCode( + glyphsUnicodeMap[glyphName], + ); continue; } } - i[r] = String.fromCodePoint(c); + toUnicode[charcode] = String.fromCodePoint(code); } } - return i; + return toUnicode; } - async buildToUnicode(e) { - e.hasIncludedToUnicodeMap = e.toUnicode?.length > 0; - if (e.hasIncludedToUnicodeMap) { - !e.composite && - e.hasEncoding && - (e.fallbackToUnicode = this._simpleFontToUnicode(e)); - return e.toUnicode; + async buildToUnicode(properties) { + properties.hasIncludedToUnicodeMap = properties.toUnicode?.length > 0; + if (properties.hasIncludedToUnicodeMap) { + if (!properties.composite && properties.hasEncoding) { + properties.fallbackToUnicode = this._simpleFontToUnicode(properties); + } + return properties.toUnicode; + } + if (!properties.composite) { + return new ToUnicodeMap(this._simpleFontToUnicode(properties)); } - if (!e.composite) return new ToUnicodeMap(this._simpleFontToUnicode(e)); if ( - e.composite && - ((e.cMap.builtInCMap && !(e.cMap instanceof IdentityCMap)) || - ("Adobe" === e.cidSystemInfo?.registry && - ("GB1" === e.cidSystemInfo.ordering || - "CNS1" === e.cidSystemInfo.ordering || - "Japan1" === e.cidSystemInfo.ordering || - "Korea1" === e.cidSystemInfo.ordering))) + properties.composite && + ((properties.cMap.builtInCMap && + !(properties.cMap instanceof IdentityCMap)) || + (properties.cidSystemInfo?.registry === "Adobe" && + (properties.cidSystemInfo.ordering === "GB1" || + properties.cidSystemInfo.ordering === "CNS1" || + properties.cidSystemInfo.ordering === "Japan1" || + properties.cidSystemInfo.ordering === "Korea1"))) ) { - const { registry: t, ordering: i } = e.cidSystemInfo, - a = Name.get(`${t}-${i}-UCS2`), - s = await CMapFactory.create({ - encoding: a, - fetchBuiltInCMap: this._fetchBuiltInCMapBound, - useCMap: null, - }), - r = [], - n = []; - e.cMap.forEach(function (e, t) { - if (t > 65535) throw new FormatError("Max size of CID is 65,535"); - const i = s.lookup(t); - if (i) { - n.length = 0; - for (let e = 0, t = i.length; e < t; e += 2) - n.push((i.charCodeAt(e) << 8) + i.charCodeAt(e + 1)); - r[e] = String.fromCharCode(...n); - } - }); - return new ToUnicodeMap(r); - } - return new IdentityToUnicodeMap(e.firstChar, e.lastChar); - } - async readToUnicode(e) { - if (!e) return null; - if (e instanceof Name) { - const t = await CMapFactory.create({ - encoding: e, + const { registry, ordering } = properties.cidSystemInfo; + const ucs2CMapName = Name.get(`${registry}-${ordering}-UCS2`); + const ucs2CMap = await CMapFactory.create({ + encoding: ucs2CMapName, fetchBuiltInCMap: this._fetchBuiltInCMapBound, useCMap: null, }); - return t instanceof IdentityCMap - ? new IdentityToUnicodeMap(0, 65535) - : new ToUnicodeMap(t.getMap()); + const toUnicode = [], + buf = []; + properties.cMap.forEach(function (charcode, cid) { + if (cid > 0xffff) { + throw new FormatError("Max size of CID is 65,535"); + } + const ucs2 = ucs2CMap.lookup(cid); + if (ucs2) { + buf.length = 0; + for (let i = 0, ii = ucs2.length; i < ii; i += 2) { + buf.push((ucs2.charCodeAt(i) << 8) + ucs2.charCodeAt(i + 1)); + } + toUnicode[charcode] = String.fromCharCode(...buf); + } + }); + return new ToUnicodeMap(toUnicode); } - if (e instanceof BaseStream) + return new IdentityToUnicodeMap(properties.firstChar, properties.lastChar); + } + async readToUnicode(cmapObj) { + if (!cmapObj) { + return null; + } + if (cmapObj instanceof Name) { + const cmap = await CMapFactory.create({ + encoding: cmapObj, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null, + }); + if (cmap instanceof IdentityCMap) { + return new IdentityToUnicodeMap(0, 0xffff); + } + return new ToUnicodeMap(cmap.getMap()); + } + if (cmapObj instanceof BaseStream) { try { - const t = await CMapFactory.create({ - encoding: e, + const cmap = await CMapFactory.create({ + encoding: cmapObj, fetchBuiltInCMap: this._fetchBuiltInCMapBound, useCMap: null, }); - if (t instanceof IdentityCMap) - return new IdentityToUnicodeMap(0, 65535); - const i = new Array(t.length); - t.forEach(function (e, t) { - if ("number" == typeof t) { - i[e] = String.fromCodePoint(t); + if (cmap instanceof IdentityCMap) { + return new IdentityToUnicodeMap(0, 0xffff); + } + const map = new Array(cmap.length); + cmap.forEach(function (charCode, token) { + if (typeof token === "number") { + map[charCode] = String.fromCodePoint(token); return; } - const a = []; - for (let e = 0; e < t.length; e += 2) { - const i = (t.charCodeAt(e) << 8) | t.charCodeAt(e + 1); - if (55296 != (63488 & i)) { - a.push(i); + if (token.length % 2 !== 0) { + token = "\u0000" + token; + } + const str = []; + for (let k = 0; k < token.length; k += 2) { + const w1 = (token.charCodeAt(k) << 8) | token.charCodeAt(k + 1); + if ((w1 & 0xf800) !== 0xd800) { + str.push(w1); continue; } - e += 2; - const s = (t.charCodeAt(e) << 8) | t.charCodeAt(e + 1); - a.push(((1023 & i) << 10) + (1023 & s) + 65536); + k += 2; + const w2 = (token.charCodeAt(k) << 8) | token.charCodeAt(k + 1); + str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); } - i[e] = String.fromCodePoint(...a); + map[charCode] = String.fromCodePoint(...str); }); - return new ToUnicodeMap(i); - } catch (e) { - if (e instanceof AbortException) return null; - if (this.options.ignoreErrors) { - warn(`readToUnicode - ignoring ToUnicode data: "${e}".`); + return new ToUnicodeMap(map); + } catch (reason) { + if (reason instanceof AbortException) { return null; } - throw e; + if (this.options.ignoreErrors) { + warn(`readToUnicode - ignoring ToUnicode data: "${reason}".`); + return null; + } + throw reason; } + } return null; } - readCidToGidMap(e, t) { - const i = []; - for (let a = 0, s = e.length; a < s; a++) { - const s = (e[a++] << 8) | e[a], - r = a >> 1; - (0 !== s || t.has(r)) && (i[r] = s); + readCidToGidMap(glyphsData, toUnicode) { + const result = []; + for (let j = 0, jj = glyphsData.length; j < jj; j++) { + const glyphID = (glyphsData[j++] << 8) | glyphsData[j]; + const code = j >> 1; + if (glyphID === 0 && !toUnicode.has(code)) { + continue; + } + result[code] = glyphID; } - return i; + return result; } - extractWidths(e, t, i) { - const a = this.xref; - let s = [], - r = 0; - const n = []; - let g; - if (i.composite) { - const t = e.get("DW"); - r = "number" == typeof t ? Math.ceil(t) : 1e3; - const o = e.get("W"); - if (Array.isArray(o)) - for (let e = 0, t = o.length; e < t; e++) { - let t = a.fetchIfRef(o[e++]); - if (!Number.isInteger(t)) break; - const i = a.fetchIfRef(o[e]); - if (Array.isArray(i)) - for (const e of i) { - const i = a.fetchIfRef(e); - "number" == typeof i && (s[t] = i); - t++; - } - else { - if (!Number.isInteger(i)) break; - { - const r = a.fetchIfRef(o[++e]); - if ("number" != typeof r) continue; - for (let e = t; e <= i; e++) s[e] = r; - } - } - } - if (i.vertical) { - const t = e.getArray("DW2"); - let i = isNumberArray(t, 2) ? t : [880, -1e3]; - g = [i[1], 0.5 * r, i[0]]; - i = e.get("W2"); - if (Array.isArray(i)) - for (let e = 0, t = i.length; e < t; e++) { - let t = a.fetchIfRef(i[e++]); - if (!Number.isInteger(t)) break; - const s = a.fetchIfRef(i[e]); - if (Array.isArray(s)) - for (let e = 0, i = s.length; e < i; e++) { - const i = [ - a.fetchIfRef(s[e++]), - a.fetchIfRef(s[e++]), - a.fetchIfRef(s[e]), - ]; - isNumberArray(i, null) && (n[t] = i); - t++; - } - else { - if (!Number.isInteger(s)) break; - { - const r = [ - a.fetchIfRef(i[++e]), - a.fetchIfRef(i[++e]), - a.fetchIfRef(i[++e]), - ]; - if (!isNumberArray(r, null)) continue; - for (let e = t; e <= s; e++) n[e] = r; - } - } - } - } - } else { - const n = e.get("Widths"); - if (Array.isArray(n)) { - let e = i.firstChar; - for (const t of n) { - const i = a.fetchIfRef(t); - "number" == typeof i && (s[e] = i); - e++; - } - const g = t.get("MissingWidth"); - r = "number" == typeof g ? g : 0; - } else { - const t = e.get("BaseFont"); - if (t instanceof Name) { - const e = this.getBaseFontMetrics(t.name); - s = this.buildCharCodeToWidth(e.widths, i); - r = e.defaultWidth; - } - } - } - let o = !0, - c = r; - for (const e in s) { - const t = s[e]; - if (t) - if (c) { - if (c !== t) { - o = !1; + extractWidths(dict, descriptor, properties) { + const xref = this.xref; + let glyphsWidths = []; + let defaultWidth = 0; + const glyphsVMetrics = []; + let defaultVMetrics; + if (properties.composite) { + const dw = dict.get("DW"); + defaultWidth = typeof dw === "number" ? Math.ceil(dw) : 1000; + const widths = dict.get("W"); + if (Array.isArray(widths)) { + for (let i = 0, ii = widths.length; i < ii; i++) { + let start = xref.fetchIfRef(widths[i++]); + if (!Number.isInteger(start)) { break; } - } else c = t; - } - o ? (i.flags |= vi) : (i.flags &= ~vi); - i.defaultWidth = r; - i.widths = s; - i.defaultVMetrics = g; - i.vmetrics = n; - } - isSerifFont(e) { - const t = e.split("-", 1)[0]; - return t in Xi() || /serif/gi.test(t); - } - getBaseFontMetrics(e) { - let t = 0, - i = Object.create(null), - a = !1; - let s = Pi()[e] || e; - const r = Aa(); - s in r || (s = this.isSerifFont(e) ? "Times-Roman" : "Helvetica"); - const n = r[s]; - if ("number" == typeof n) { - t = n; - a = !0; - } else i = n(); - return { defaultWidth: t, monospace: a, widths: i }; - } - buildCharCodeToWidth(e, t) { - const i = Object.create(null), - a = t.differences, - s = t.defaultEncoding; - for (let t = 0; t < 256; t++) - t in a && e[a[t]] - ? (i[t] = e[a[t]]) - : t in s && e[s[t]] && (i[t] = e[s[t]]); - return i; - } - preEvaluateFont(e) { - const t = e; - let i = e.get("Subtype"); - if (!(i instanceof Name)) throw new FormatError("invalid font Subtype"); - let a, - s = !1; - if ("Type0" === i.name) { - const t = e.get("DescendantFonts"); - if (!t) throw new FormatError("Descendant fonts are not specified"); - if ( - !( - (e = Array.isArray(t) ? this.xref.fetchIfRef(t[0]) : t) instanceof - Dict - ) - ) - throw new FormatError("Descendant font is not a dictionary."); - i = e.get("Subtype"); - if (!(i instanceof Name)) throw new FormatError("invalid font Subtype"); - s = !0; - } - let r = e.get("FirstChar"); - Number.isInteger(r) || (r = 0); - let n = e.get("LastChar"); - Number.isInteger(n) || (n = s ? 65535 : 255); - const g = e.get("FontDescriptor"), - o = e.get("ToUnicode") || t.get("ToUnicode"); - if (g) { - a = new MurmurHash3_64(); - const i = t.getRaw("Encoding"); - if (i instanceof Name) a.update(i.name); - else if (i instanceof Ref) a.update(i.toString()); - else if (i instanceof Dict) - for (const e of i.getRawValues()) - if (e instanceof Name) a.update(e.name); - else if (e instanceof Ref) a.update(e.toString()); - else if (Array.isArray(e)) { - const t = e.length, - i = new Array(t); - for (let a = 0; a < t; a++) { - const t = e[a]; - t instanceof Name - ? (i[a] = t.name) - : ("number" == typeof t || t instanceof Ref) && - (i[a] = t.toString()); + const code = xref.fetchIfRef(widths[i]); + if (Array.isArray(code)) { + for (const c of code) { + const width = xref.fetchIfRef(c); + if (typeof width === "number") { + glyphsWidths[start] = width; + } + start++; } - a.update(i.join()); + } else if (Number.isInteger(code)) { + const width = xref.fetchIfRef(widths[++i]); + if (typeof width !== "number") { + continue; + } + for (let j = start; j <= code; j++) { + glyphsWidths[j] = width; + } + } else { + break; } - a.update(`${r}-${n}`); - if (o instanceof BaseStream) { - const e = o.str || o, - t = e.buffer - ? new Uint8Array(e.buffer.buffer, 0, e.bufferLength) - : new Uint8Array(e.bytes.buffer, e.start, e.end - e.start); - a.update(t); - } else o instanceof Name && a.update(o.name); - const g = e.get("Widths") || t.get("Widths"); - if (Array.isArray(g)) { - const e = []; - for (const t of g) - ("number" == typeof t || t instanceof Ref) && e.push(t.toString()); - a.update(e.join()); - } - if (s) { - a.update("compositeFont"); - const i = e.get("W") || t.get("W"); - if (Array.isArray(i)) { - const e = []; - for (const t of i) - if ("number" == typeof t || t instanceof Ref) e.push(t.toString()); - else if (Array.isArray(t)) { - const i = []; - for (const e of t) - ("number" == typeof e || e instanceof Ref) && - i.push(e.toString()); - e.push(`[${i.join()}]`); - } - a.update(e.join()); } - const s = e.getRaw("CIDToGIDMap") || t.getRaw("CIDToGIDMap"); - s instanceof Name - ? a.update(s.name) - : s instanceof Ref - ? a.update(s.toString()) - : s instanceof BaseStream && a.update(s.peekBytes()); + } + if (properties.vertical) { + const dw2 = dict.getArray("DW2"); + let vmetrics = isNumberArray(dw2, 2) ? dw2 : [880, -1000]; + defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]]; + vmetrics = dict.get("W2"); + if (Array.isArray(vmetrics)) { + for (let i = 0, ii = vmetrics.length; i < ii; i++) { + let start = xref.fetchIfRef(vmetrics[i++]); + if (!Number.isInteger(start)) { + break; + } + const code = xref.fetchIfRef(vmetrics[i]); + if (Array.isArray(code)) { + for (let j = 0, jj = code.length; j < jj; j++) { + const vmetric = [ + xref.fetchIfRef(code[j++]), + xref.fetchIfRef(code[j++]), + xref.fetchIfRef(code[j]), + ]; + if (isNumberArray(vmetric, null)) { + glyphsVMetrics[start] = vmetric; + } + start++; + } + } else if (Number.isInteger(code)) { + const vmetric = [ + xref.fetchIfRef(vmetrics[++i]), + xref.fetchIfRef(vmetrics[++i]), + xref.fetchIfRef(vmetrics[++i]), + ]; + if (!isNumberArray(vmetric, null)) { + continue; + } + for (let j = start; j <= code; j++) { + glyphsVMetrics[j] = vmetric; + } + } else { + break; + } + } + } + } + } else { + const widths = dict.get("Widths"); + if (Array.isArray(widths)) { + let j = properties.firstChar; + for (const w of widths) { + const width = xref.fetchIfRef(w); + if (typeof width === "number") { + glyphsWidths[j] = width; + } + j++; + } + const missingWidth = descriptor.get("MissingWidth"); + defaultWidth = typeof missingWidth === "number" ? missingWidth : 0; + } else { + const baseFontName = dict.get("BaseFont"); + if (baseFontName instanceof Name) { + const metrics = this.getBaseFontMetrics(baseFontName.name); + glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties); + defaultWidth = metrics.defaultWidth; + } + } + } + let isMonospace = true; + let firstWidth = defaultWidth; + for (const glyph in glyphsWidths) { + const glyphWidth = glyphsWidths[glyph]; + if (!glyphWidth) { + continue; + } + if (!firstWidth) { + firstWidth = glyphWidth; + continue; + } + if (firstWidth !== glyphWidth) { + isMonospace = false; + break; + } + } + if (isMonospace) { + properties.flags |= FontFlags.FixedPitch; + } else { + properties.flags &= ~FontFlags.FixedPitch; + } + properties.defaultWidth = defaultWidth; + properties.widths = glyphsWidths; + properties.defaultVMetrics = defaultVMetrics; + properties.vmetrics = glyphsVMetrics; + } + isSerifFont(baseFontName) { + const fontNameWoStyle = baseFontName.split("-", 1)[0]; + return ( + fontNameWoStyle in getSerifFonts() || /serif/gi.test(fontNameWoStyle) + ); + } + getBaseFontMetrics(name) { + let defaultWidth = 0; + let widths = Object.create(null); + let monospace = false; + const stdFontMap = getStdFontMap(); + let lookupName = stdFontMap[name] || name; + const Metrics = getMetrics(); + if (!(lookupName in Metrics)) { + lookupName = this.isSerifFont(name) ? "Times-Roman" : "Helvetica"; + } + const glyphWidths = Metrics[lookupName]; + if (typeof glyphWidths === "number") { + defaultWidth = glyphWidths; + monospace = true; + } else { + widths = glyphWidths(); + } + return { + defaultWidth, + monospace, + widths, + }; + } + buildCharCodeToWidth(widthsByGlyphName, properties) { + const widths = Object.create(null); + const differences = properties.differences; + const encoding = properties.defaultEncoding; + for (let charCode = 0; charCode < 256; charCode++) { + if (charCode in differences && widthsByGlyphName[differences[charCode]]) { + widths[charCode] = widthsByGlyphName[differences[charCode]]; + continue; + } + if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { + widths[charCode] = widthsByGlyphName[encoding[charCode]]; + continue; + } + } + return widths; + } + preEvaluateFont(dict) { + const baseDict = dict; + let type = dict.get("Subtype"); + if (!(type instanceof Name)) { + throw new FormatError("invalid font Subtype"); + } + let composite = false; + let hash; + if (type.name === "Type0") { + const df = dict.get("DescendantFonts"); + if (!df) { + throw new FormatError("Descendant fonts are not specified"); + } + dict = Array.isArray(df) ? this.xref.fetchIfRef(df[0]) : df; + if (!(dict instanceof Dict)) { + throw new FormatError("Descendant font is not a dictionary."); + } + type = dict.get("Subtype"); + if (!(type instanceof Name)) { + throw new FormatError("invalid font Subtype"); + } + composite = true; + } + let firstChar = dict.get("FirstChar"); + if (!Number.isInteger(firstChar)) { + firstChar = 0; + } + let lastChar = dict.get("LastChar"); + if (!Number.isInteger(lastChar)) { + lastChar = composite ? 0xffff : 0xff; + } + const descriptor = dict.get("FontDescriptor"); + const toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode"); + if (descriptor) { + hash = new MurmurHash3_64(); + const encoding = baseDict.getRaw("Encoding"); + if (encoding instanceof Name) { + hash.update(encoding.name); + } else if (encoding instanceof Ref) { + hash.update(encoding.toString()); + } else if (encoding instanceof Dict) { + for (const entry of encoding.getRawValues()) { + if (entry instanceof Name) { + hash.update(entry.name); + } else if (entry instanceof Ref) { + hash.update(entry.toString()); + } else if (Array.isArray(entry)) { + const diffLength = entry.length, + diffBuf = new Array(diffLength); + for (let j = 0; j < diffLength; j++) { + const diffEntry = entry[j]; + if (diffEntry instanceof Name) { + diffBuf[j] = diffEntry.name; + } else if ( + typeof diffEntry === "number" || + diffEntry instanceof Ref + ) { + diffBuf[j] = diffEntry.toString(); + } + } + hash.update(diffBuf.join()); + } + } + } + hash.update(`${firstChar}-${lastChar}`); + if (toUnicode instanceof BaseStream) { + const stream = toUnicode.str || toUnicode; + const uint8array = stream.buffer + ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) + : new Uint8Array( + stream.bytes.buffer, + stream.start, + stream.end - stream.start, + ); + hash.update(uint8array); + } else if (toUnicode instanceof Name) { + hash.update(toUnicode.name); + } + const widths = dict.get("Widths") || baseDict.get("Widths"); + if (Array.isArray(widths)) { + const widthsBuf = []; + for (const entry of widths) { + if (typeof entry === "number" || entry instanceof Ref) { + widthsBuf.push(entry.toString()); + } + } + hash.update(widthsBuf.join()); + } + if (composite) { + hash.update("compositeFont"); + const compositeWidths = dict.get("W") || baseDict.get("W"); + if (Array.isArray(compositeWidths)) { + const widthsBuf = []; + for (const entry of compositeWidths) { + if (typeof entry === "number" || entry instanceof Ref) { + widthsBuf.push(entry.toString()); + } else if (Array.isArray(entry)) { + const subWidthsBuf = []; + for (const element of entry) { + if (typeof element === "number" || element instanceof Ref) { + subWidthsBuf.push(element.toString()); + } + } + widthsBuf.push(`[${subWidthsBuf.join()}]`); + } + } + hash.update(widthsBuf.join()); + } + const cidToGidMap = + dict.getRaw("CIDToGIDMap") || baseDict.getRaw("CIDToGIDMap"); + if (cidToGidMap instanceof Name) { + hash.update(cidToGidMap.name); + } else if (cidToGidMap instanceof Ref) { + hash.update(cidToGidMap.toString()); + } else if (cidToGidMap instanceof BaseStream) { + hash.update(cidToGidMap.peekBytes()); + } } } return { - descriptor: g, - dict: e, - baseDict: t, - composite: s, - type: i.name, - firstChar: r, - lastChar: n, - toUnicode: o, - hash: a ? a.hexdigest() : "", + descriptor, + dict, + baseDict, + composite, + type: type.name, + firstChar, + lastChar, + toUnicode, + hash: hash ? hash.hexdigest() : "", }; } async translateFont({ - descriptor: e, - dict: t, - baseDict: i, - composite: s, - type: r, - firstChar: n, - lastChar: g, - toUnicode: o, - cssFontInfo: c, + descriptor, + dict, + baseDict, + composite, + type, + firstChar, + lastChar, + toUnicode, + cssFontInfo, }) { - const C = "Type3" === r; - if (!e) { - if (!C) { - let e = t.get("BaseFont"); - if (!(e instanceof Name)) + const isType3Font = type === "Type3"; + if (!descriptor) { + if (isType3Font) { + const bbox = lookupNormalRect(dict.getArray("FontBBox"), [0, 0, 0, 0]); + descriptor = new Dict(null); + descriptor.set("FontName", Name.get(type)); + descriptor.set("FontBBox", bbox); + } else { + let baseFontName = dict.get("BaseFont"); + if (!(baseFontName instanceof Name)) { throw new FormatError("Base font is not specified"); - e = e.name.replaceAll(/[,_]/g, "-"); - const a = this.getBaseFontMetrics(e), - s = e.split("-", 1)[0], - c = - (this.isSerifFont(s) ? Ki : 0) | - (a.monospace ? vi : 0) | - (Zi()[s] ? Ti : qi), - h = { - type: r, - name: e, - loadedName: i.loadedName, - systemFontInfo: null, - widths: a.widths, - defaultWidth: a.defaultWidth, - isSimulatedFlags: !0, - flags: c, - firstChar: n, - lastChar: g, - toUnicode: o, - xHeight: 0, - capHeight: 0, - italicAngle: 0, - isType3Font: C, - }, - l = t.get("Widths"), - Q = getStandardFontName(e); - let E = null; - if (Q) { - E = await this.fetchStandardFontData(Q); - h.isInternalFont = !!E; } - !h.isInternalFont && - this.options.useSystemFonts && - (h.systemFontInfo = getFontSubstitution( + baseFontName = baseFontName.name.replaceAll(/[,_]/g, "-"); + const metrics = this.getBaseFontMetrics(baseFontName); + const fontNameWoStyle = baseFontName.split("-", 1)[0]; + const flags = + (this.isSerifFont(fontNameWoStyle) ? FontFlags.Serif : 0) | + (metrics.monospace ? FontFlags.FixedPitch : 0) | + (getSymbolsFonts()[fontNameWoStyle] + ? FontFlags.Symbolic + : FontFlags.Nonsymbolic); + const properties = { + type, + name: baseFontName, + loadedName: baseDict.loadedName, + systemFontInfo: null, + widths: metrics.widths, + defaultWidth: metrics.defaultWidth, + isSimulatedFlags: true, + flags, + firstChar, + lastChar, + toUnicode, + xHeight: 0, + capHeight: 0, + italicAngle: 0, + isType3Font, + }; + const widths = dict.get("Widths"); + const standardFontName = getStandardFontName(baseFontName); + let file = null; + if (standardFontName) { + file = await this.fetchStandardFontData(standardFontName); + properties.isInternalFont = !!file; + } + if (!properties.isInternalFont && this.options.useSystemFonts) { + properties.systemFontInfo = getFontSubstitution( this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, - e, - Q, - r, - )); - const u = await this.extractDataStructures(t, h); - if (Array.isArray(l)) { - const e = []; - let t = n; - for (const i of l) { - const a = this.xref.fetchIfRef(i); - "number" == typeof a && (e[t] = a); - t++; + baseFontName, + standardFontName, + type, + ); + } + const newProperties = await this.extractDataStructures( + dict, + properties, + ); + if (Array.isArray(widths)) { + const glyphWidths = []; + let j = firstChar; + for (const w of widths) { + const width = this.xref.fetchIfRef(w); + if (typeof width === "number") { + glyphWidths[j] = width; + } + j++; } - u.widths = e; - } else u.widths = this.buildCharCodeToWidth(a.widths, u); - return new Font(e, E, u); - } - { - const i = lookupNormalRect(t.getArray("FontBBox"), [0, 0, 0, 0]); - (e = new Dict(null)).set("FontName", Name.get(r)); - e.set("FontBBox", i); + newProperties.widths = glyphWidths; + } else { + newProperties.widths = this.buildCharCodeToWidth( + metrics.widths, + newProperties, + ); + } + return new Font(baseFontName, file, newProperties); } } - let h = e.get("FontName"), - l = t.get("BaseFont"); - "string" == typeof h && (h = Name.get(h)); - "string" == typeof l && (l = Name.get(l)); - const Q = h?.name, - E = l?.name; - if (!C && Q !== E) { + let fontName = descriptor.get("FontName"); + let baseFont = dict.get("BaseFont"); + if (typeof fontName === "string") { + fontName = Name.get(fontName); + } + if (typeof baseFont === "string") { + baseFont = Name.get(baseFont); + } + const fontNameStr = fontName?.name; + const baseFontStr = baseFont?.name; + if (!isType3Font && fontNameStr !== baseFontStr) { info( - `The FontDescriptor's FontName is "${Q}" but should be the same as the Font's BaseFont "${E}".`, + `The FontDescriptor's FontName is "${fontNameStr}" but ` + + `should be the same as the Font's BaseFont "${baseFontStr}".`, ); - Q && - E && - (E.startsWith(Q) || (!isKnownFontName(Q) && isKnownFontName(E))) && - (h = null); + if ( + fontNameStr && + baseFontStr && + (baseFontStr.startsWith(fontNameStr) || + (!isKnownFontName(fontNameStr) && isKnownFontName(baseFontStr))) + ) { + fontName = null; + } } - h ||= l; - if (!(h instanceof Name)) throw new FormatError("invalid font name"); - let u, d, f, p, m; + fontName ||= baseFont; + if (!(fontName instanceof Name)) { + throw new FormatError("invalid font name"); + } + let fontFile, subtype, length1, length2, length3; try { - u = e.get("FontFile", "FontFile2", "FontFile3"); - } catch (e) { - if (!this.options.ignoreErrors) throw e; - warn(`translateFont - fetching "${h.name}" font file: "${e}".`); - u = new NullStream(); + fontFile = descriptor.get("FontFile", "FontFile2", "FontFile3"); + if (fontFile) { + if (!(fontFile instanceof BaseStream)) { + throw new FormatError("FontFile should be a stream"); + } else if (fontFile.isEmpty) { + throw new FormatError("FontFile is empty"); + } + } + } catch (ex) { + if (!this.options.ignoreErrors) { + throw ex; + } + warn(`translateFont - fetching "${fontName.name}" font file: "${ex}".`); + fontFile = null; } - let y = !1, - w = null, - D = null; - if (u) { - if (u.dict) { - const e = u.dict.get("Subtype"); - e instanceof Name && (d = e.name); - f = u.dict.get("Length1"); - p = u.dict.get("Length2"); - m = u.dict.get("Length3"); + let isInternalFont = false; + let glyphScaleFactors = null; + let systemFontInfo = null; + if (fontFile) { + if (fontFile.dict) { + const subtypeEntry = fontFile.dict.get("Subtype"); + if (subtypeEntry instanceof Name) { + subtype = subtypeEntry.name; + } + length1 = fontFile.dict.get("Length1"); + length2 = fontFile.dict.get("Length2"); + length3 = fontFile.dict.get("Length3"); } - } else if (c) { - const e = getXfaFontName(h.name); - if (e) { - c.fontFamily = `${c.fontFamily}-PdfJS-XFA`; - c.metrics = e.metrics || null; - w = e.factors || null; - u = await this.fetchStandardFontData(e.name); - y = !!u; - i = t = getXfaFontDict(h.name); - s = !0; + } else if (cssFontInfo) { + const standardFontName = getXfaFontName(fontName.name); + if (standardFontName) { + cssFontInfo.fontFamily = `${cssFontInfo.fontFamily}-PdfJS-XFA`; + cssFontInfo.metrics = standardFontName.metrics || null; + glyphScaleFactors = standardFontName.factors || null; + fontFile = await this.fetchStandardFontData(standardFontName.name); + isInternalFont = !!fontFile; + baseDict = dict = getXfaFontDict(fontName.name); + composite = true; } - } else if (!C) { - const e = getStandardFontName(h.name); - if (e) { - u = await this.fetchStandardFontData(e); - y = !!u; + } else if (!isType3Font) { + const standardFontName = getStandardFontName(fontName.name); + if (standardFontName) { + fontFile = await this.fetchStandardFontData(standardFontName); + isInternalFont = !!fontFile; } - !y && - this.options.useSystemFonts && - (D = getFontSubstitution( + if (!isInternalFont && this.options.useSystemFonts) { + systemFontInfo = getFontSubstitution( this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, - h.name, - e, - r, - )); + fontName.name, + standardFontName, + type, + ); + } } - const b = lookupMatrix(t.getArray("FontMatrix"), a), - F = lookupNormalRect( - e.getArray("FontBBox") || t.getArray("FontBBox"), - void 0, - ); - let S = e.get("Ascent"); - "number" != typeof S && (S = void 0); - let k = e.get("Descent"); - "number" != typeof k && (k = void 0); - let R = e.get("XHeight"); - "number" != typeof R && (R = 0); - let N = e.get("CapHeight"); - "number" != typeof N && (N = 0); - let G = e.get("Flags"); - Number.isInteger(G) || (G = 0); - let x = e.get("ItalicAngle"); - "number" != typeof x && (x = 0); - const U = { - type: r, - name: h.name, - subtype: d, - file: u, - length1: f, - length2: p, - length3: m, - isInternalFont: y, - loadedName: i.loadedName, - composite: s, - fixedPitch: !1, - fontMatrix: b, - firstChar: n, - lastChar: g, - toUnicode: o, - bbox: F, - ascent: S, - descent: k, - xHeight: R, - capHeight: N, - flags: G, - italicAngle: x, - isType3Font: C, - cssFontInfo: c, - scaleFactors: w, - systemFontInfo: D, + const fontMatrix = lookupMatrix( + dict.getArray("FontMatrix"), + FONT_IDENTITY_MATRIX, + ); + const bbox = lookupNormalRect( + descriptor.getArray("FontBBox") || dict.getArray("FontBBox"), + undefined, + ); + let ascent = descriptor.get("Ascent"); + if (typeof ascent !== "number") { + ascent = undefined; + } + let descent = descriptor.get("Descent"); + if (typeof descent !== "number") { + descent = undefined; + } + let xHeight = descriptor.get("XHeight"); + if (typeof xHeight !== "number") { + xHeight = 0; + } + let capHeight = descriptor.get("CapHeight"); + if (typeof capHeight !== "number") { + capHeight = 0; + } + let flags = descriptor.get("Flags"); + if (!Number.isInteger(flags)) { + flags = 0; + } + let italicAngle = descriptor.get("ItalicAngle"); + if (typeof italicAngle !== "number") { + italicAngle = 0; + } + const properties = { + type, + name: fontName.name, + subtype, + file: fontFile, + length1, + length2, + length3, + isInternalFont, + loadedName: baseDict.loadedName, + composite, + fixedPitch: false, + fontMatrix, + firstChar, + lastChar, + toUnicode, + bbox, + ascent, + descent, + xHeight, + capHeight, + flags, + italicAngle, + isType3Font, + cssFontInfo, + scaleFactors: glyphScaleFactors, + systemFontInfo, }; - if (s) { - const e = i.get("Encoding"); - e instanceof Name && (U.cidEncoding = e.name); - const t = await CMapFactory.create({ - encoding: e, + if (composite) { + const cidEncoding = baseDict.get("Encoding"); + if (cidEncoding instanceof Name) { + properties.cidEncoding = cidEncoding.name; + } + const cMap = await CMapFactory.create({ + encoding: cidEncoding, fetchBuiltInCMap: this._fetchBuiltInCMapBound, useCMap: null, }); - U.cMap = t; - U.vertical = U.cMap.vertical; + properties.cMap = cMap; + properties.vertical = properties.cMap.vertical; } - const M = await this.extractDataStructures(t, U); - this.extractWidths(t, e, M); - return new Font(h.name, u, M); + const newProperties = await this.extractDataStructures(dict, properties); + this.extractWidths(dict, descriptor, newProperties); + return new Font(fontName.name, fontFile, newProperties); } - static buildFontPaths(e, t, i, a) { - function buildPath(t) { - const s = `${e.loadedName}_path_${t}`; + static buildFontPaths(font, glyphs, handler, evaluatorOptions) { + function buildPath(fontChar) { + const glyphName = `${font.loadedName}_path_${fontChar}`; try { - if (e.renderer.hasBuiltPath(t)) return; - i.send("commonobj", [s, "FontPath", e.renderer.getPathJs(t)]); - } catch (e) { - if (a.ignoreErrors) { - warn(`buildFontPaths - ignoring ${s} glyph: "${e}".`); + if (font.renderer.hasBuiltPath(fontChar)) { return; } - throw e; + handler.send("commonobj", [ + glyphName, + "FontPath", + font.renderer.getPathJs(fontChar), + ]); + } catch (reason) { + if (evaluatorOptions.ignoreErrors) { + warn(`buildFontPaths - ignoring ${glyphName} glyph: "${reason}".`); + return; + } + throw reason; } } - for (const e of t) { - buildPath(e.fontChar); - const t = e.accent; - t?.fontChar && buildPath(t.fontChar); + for (const glyph of glyphs) { + buildPath(glyph.fontChar); + const accent = glyph.accent; + if (accent?.fontChar) { + buildPath(accent.fontChar); + } } } static get fallbackFontDict() { - const e = new Dict(); - e.set("BaseFont", Name.get("Helvetica")); - e.set("Type", Name.get("FallbackType")); - e.set("Subtype", Name.get("FallbackType")); - e.set("Encoding", Name.get("WinAnsiEncoding")); - return shadow(this, "fallbackFontDict", e); + const dict = new Dict(); + dict.set("BaseFont", Name.get("Helvetica")); + dict.set("Type", Name.get("FallbackType")); + dict.set("Subtype", Name.get("FallbackType")); + dict.set("Encoding", Name.get("WinAnsiEncoding")); + return shadow(this, "fallbackFontDict", dict); } } class TranslatedFont { - constructor({ loadedName: e, font: t, dict: i, evaluatorOptions: a }) { - this.loadedName = e; - this.font = t; - this.dict = i; - this._evaluatorOptions = a || bs; + constructor({ loadedName, font, dict, evaluatorOptions }) { + this.loadedName = loadedName; + this.font = font; + this.dict = dict; + this._evaluatorOptions = evaluatorOptions || DefaultPartialEvaluatorOptions; this.type3Loaded = null; - this.type3Dependencies = t.isType3Font ? new Set() : null; - this.sent = !1; + this.type3Dependencies = font.isType3Font ? new Set() : null; + this.sent = false; } - send(e) { - if (!this.sent) { - this.sent = !0; - e.send("commonobj", [ - this.loadedName, - "Font", - this.font.exportData(this._evaluatorOptions.fontExtraProperties), - ]); + send(handler) { + if (this.sent) { + return; } + this.sent = true; + handler.send("commonobj", [ + this.loadedName, + "Font", + this.font.exportData(this._evaluatorOptions.fontExtraProperties), + ]); } - fallback(e) { - if (this.font.data) { - this.font.disableFontFace = !0; - PartialEvaluator.buildFontPaths( - this.font, - this.font.glyphCacheValues, - e, - this._evaluatorOptions, - ); + fallback(handler) { + if (!this.font.data) { + return; } + this.font.disableFontFace = true; + PartialEvaluator.buildFontPaths( + this.font, + this.font.glyphCacheValues, + handler, + this._evaluatorOptions, + ); } - loadType3Data(e, t, i) { - if (this.type3Loaded) return this.type3Loaded; - if (!this.font.isType3Font) throw new Error("Must be a Type3 font."); - const a = e.clone({ ignoreErrors: !1 }), - s = new RefSet(e.type3FontRefs); - this.dict.objId && !s.has(this.dict.objId) && s.put(this.dict.objId); - a.type3FontRefs = s; - const r = this.font, - n = this.type3Dependencies; - let g = Promise.resolve(); - const o = this.dict.get("CharProcs"), - c = this.dict.get("Resources") || t, - C = Object.create(null), - h = Util.normalizeRect(r.bbox || [0, 0, 0, 0]), - l = h[2] - h[0], - Q = h[3] - h[1], - E = Math.hypot(l, Q); - for (const e of o.getKeys()) - g = g.then(() => { - const t = o.get(e), - s = new OperatorList(); - return a + loadType3Data(evaluator, resources, task) { + if (this.type3Loaded) { + return this.type3Loaded; + } + if (!this.font.isType3Font) { + throw new Error("Must be a Type3 font."); + } + const type3Evaluator = evaluator.clone({ + ignoreErrors: false, + }); + const type3FontRefs = new RefSet(evaluator.type3FontRefs); + if (this.dict.objId && !type3FontRefs.has(this.dict.objId)) { + type3FontRefs.put(this.dict.objId); + } + type3Evaluator.type3FontRefs = type3FontRefs; + const translatedFont = this.font, + type3Dependencies = this.type3Dependencies; + let loadCharProcsPromise = Promise.resolve(); + const charProcs = this.dict.get("CharProcs"); + const fontResources = this.dict.get("Resources") || resources; + const charProcOperatorList = Object.create(null); + const fontBBox = Util.normalizeRect(translatedFont.bbox || [0, 0, 0, 0]), + width = fontBBox[2] - fontBBox[0], + height = fontBBox[3] - fontBBox[1]; + const fontBBoxSize = Math.hypot(width, height); + for (const key of charProcs.getKeys()) { + loadCharProcsPromise = loadCharProcsPromise.then(() => { + const glyphStream = charProcs.get(key); + const operatorList = new OperatorList(); + return type3Evaluator .getOperatorList({ - stream: t, - task: i, - resources: c, - operatorList: s, + stream: glyphStream, + task, + resources: fontResources, + operatorList, }) .then(() => { - s.fnArray[0] === Ee && this._removeType3ColorOperators(s, E); - C[e] = s.getIR(); - for (const e of s.dependencies) n.add(e); + if (operatorList.fnArray[0] === OPS.setCharWidthAndBounds) { + this._removeType3ColorOperators(operatorList, fontBBoxSize); + } + charProcOperatorList[key] = operatorList.getIR(); + for (const dependency of operatorList.dependencies) { + type3Dependencies.add(dependency); + } }) - .catch(function (t) { - warn(`Type3 font resource "${e}" is not available.`); - const i = new OperatorList(); - C[e] = i.getIR(); + .catch(function (reason) { + warn(`Type3 font resource "${key}" is not available.`); + const dummyOperatorList = new OperatorList(); + charProcOperatorList[key] = dummyOperatorList.getIR(); }); }); - this.type3Loaded = g.then(() => { - r.charProcOperatorList = C; + } + this.type3Loaded = loadCharProcsPromise.then(() => { + translatedFont.charProcOperatorList = charProcOperatorList; if (this._bbox) { - r.isCharBBox = !0; - r.bbox = this._bbox; + translatedFont.isCharBBox = true; + translatedFont.bbox = this._bbox; } }); return this.type3Loaded; } - _removeType3ColorOperators(e, t = NaN) { - const i = Util.normalizeRect(e.argsArray[0].slice(2)), - a = i[2] - i[0], - s = i[3] - i[1], - r = Math.hypot(a, s); - if (0 === a || 0 === s) { - e.fnArray.splice(0, 1); - e.argsArray.splice(0, 1); - } else if (0 === t || Math.round(r / t) >= 10) { - this._bbox || (this._bbox = [1 / 0, 1 / 0, -1 / 0, -1 / 0]); - this._bbox[0] = Math.min(this._bbox[0], i[0]); - this._bbox[1] = Math.min(this._bbox[1], i[1]); - this._bbox[2] = Math.max(this._bbox[2], i[2]); - this._bbox[3] = Math.max(this._bbox[3], i[3]); + _removeType3ColorOperators(operatorList, fontBBoxSize = NaN) { + const charBBox = Util.normalizeRect(operatorList.argsArray[0].slice(2)), + width = charBBox[2] - charBBox[0], + height = charBBox[3] - charBBox[1]; + const charBBoxSize = Math.hypot(width, height); + if (width === 0 || height === 0) { + operatorList.fnArray.splice(0, 1); + operatorList.argsArray.splice(0, 1); + } else if ( + fontBBoxSize === 0 || + Math.round(charBBoxSize / fontBBoxSize) >= 10 + ) { + if (!this._bbox) { + this._bbox = [Infinity, Infinity, -Infinity, -Infinity]; + } + this._bbox[0] = Math.min(this._bbox[0], charBBox[0]); + this._bbox[1] = Math.min(this._bbox[1], charBBox[1]); + this._bbox[2] = Math.max(this._bbox[2], charBBox[2]); + this._bbox[3] = Math.max(this._bbox[3], charBBox[3]); } - let n = 0, - g = e.length; - for (; n < g; ) { - switch (e.fnArray[n]) { - case Ee: + let i = 0, + ii = operatorList.length; + while (i < ii) { + switch (operatorList.fnArray[i]) { + case OPS.setCharWidthAndBounds: break; - case ue: - case de: - case fe: - case pe: - case me: - case ye: - case we: - case De: - case be: - case Fe: - case Se: - case ke: - case Re: - case kA: - e.fnArray.splice(n, 1); - e.argsArray.splice(n, 1); - g--; + case OPS.setStrokeColorSpace: + case OPS.setFillColorSpace: + case OPS.setStrokeColor: + case OPS.setStrokeColorN: + case OPS.setFillColor: + case OPS.setFillColorN: + case OPS.setStrokeGray: + case OPS.setFillGray: + case OPS.setStrokeRGBColor: + case OPS.setFillRGBColor: + case OPS.setStrokeCMYKColor: + case OPS.setFillCMYKColor: + case OPS.shadingFill: + case OPS.setRenderingIntent: + operatorList.fnArray.splice(i, 1); + operatorList.argsArray.splice(i, 1); + ii--; continue; - case NA: - const [t] = e.argsArray[n]; - let i = 0, - a = t.length; - for (; i < a; ) { - const [e] = t[i]; - switch (e) { + case OPS.setGState: + const [gStateObj] = operatorList.argsArray[i]; + let j = 0, + jj = gStateObj.length; + while (j < jj) { + const [gStateKey] = gStateObj[j]; + switch (gStateKey) { case "TR": case "TR2": case "HT": @@ -36510,98 +43477,115 @@ class TranslatedFont { case "BG2": case "UCR": case "UCR2": - t.splice(i, 1); - a--; + gStateObj.splice(j, 1); + jj--; continue; } - i++; + j++; } + break; } - n++; + i++; } } } class StateManager { - constructor(e = new EvalState()) { - this.state = e; + constructor(initialState = new EvalState()) { + this.state = initialState; this.stateStack = []; } save() { - const e = this.state; + const old = this.state; this.stateStack.push(this.state); - this.state = e.clone(); + this.state = old.clone(); } restore() { - const e = this.stateStack.pop(); - e && (this.state = e); + const prev = this.stateStack.pop(); + if (prev) { + this.state = prev; + } } - transform(e) { - this.state.ctm = Util.transform(this.state.ctm, e); + transform(args) { + this.state.ctm = Util.transform(this.state.ctm, args); } } class TextState { constructor() { - this.ctm = new Float32Array(i); + this.ctm = new Float32Array(IDENTITY_MATRIX); this.fontName = null; this.fontSize = 0; this.loadedName = null; this.font = null; - this.fontMatrix = a; - this.textMatrix = i.slice(); - this.textLineMatrix = i.slice(); + this.fontMatrix = FONT_IDENTITY_MATRIX; + this.textMatrix = IDENTITY_MATRIX.slice(); + this.textLineMatrix = IDENTITY_MATRIX.slice(); this.charSpacing = 0; this.wordSpacing = 0; this.leading = 0; this.textHScale = 1; this.textRise = 0; } - setTextMatrix(e, t, i, a, s, r) { - const n = this.textMatrix; - n[0] = e; - n[1] = t; - n[2] = i; - n[3] = a; - n[4] = s; - n[5] = r; + setTextMatrix(a, b, c, d, e, f) { + const m = this.textMatrix; + m[0] = a; + m[1] = b; + m[2] = c; + m[3] = d; + m[4] = e; + m[5] = f; } - setTextLineMatrix(e, t, i, a, s, r) { - const n = this.textLineMatrix; - n[0] = e; - n[1] = t; - n[2] = i; - n[3] = a; - n[4] = s; - n[5] = r; + setTextLineMatrix(a, b, c, d, e, f) { + const m = this.textLineMatrix; + m[0] = a; + m[1] = b; + m[2] = c; + m[3] = d; + m[4] = e; + m[5] = f; } - translateTextMatrix(e, t) { - const i = this.textMatrix; - i[4] = i[0] * e + i[2] * t + i[4]; - i[5] = i[1] * e + i[3] * t + i[5]; + translateTextMatrix(x, y) { + const m = this.textMatrix; + m[4] = m[0] * x + m[2] * y + m[4]; + m[5] = m[1] * x + m[3] * y + m[5]; } - translateTextLineMatrix(e, t) { - const i = this.textLineMatrix; - i[4] = i[0] * e + i[2] * t + i[4]; - i[5] = i[1] * e + i[3] * t + i[5]; + translateTextLineMatrix(x, y) { + const m = this.textLineMatrix; + m[4] = m[0] * x + m[2] * y + m[4]; + m[5] = m[1] * x + m[3] * y + m[5]; } carriageReturn() { this.translateTextLineMatrix(0, -this.leading); this.textMatrix = this.textLineMatrix.slice(); } clone() { - const e = Object.create(this); - e.textMatrix = this.textMatrix.slice(); - e.textLineMatrix = this.textLineMatrix.slice(); - e.fontMatrix = this.fontMatrix.slice(); - return e; + const clone = Object.create(this); + clone.textMatrix = this.textMatrix.slice(); + clone.textLineMatrix = this.textLineMatrix.slice(); + clone.fontMatrix = this.fontMatrix.slice(); + return clone; } } class EvalState { constructor() { - this.ctm = new Float32Array(i); + this.ctm = new Float32Array(IDENTITY_MATRIX); this.font = null; - this.textRenderingMode = y; - this.fillColorSpace = ColorSpace.singletons.gray; - this.strokeColorSpace = ColorSpace.singletons.gray; + this.textRenderingMode = TextRenderingMode.FILL; + this._fillColorSpace = ColorSpace.singletons.gray; + this._strokeColorSpace = ColorSpace.singletons.gray; + this.patternFillColorSpace = null; + this.patternStrokeColorSpace = null; + } + get fillColorSpace() { + return this._fillColorSpace; + } + set fillColorSpace(colorSpace) { + this._fillColorSpace = this.patternFillColorSpace = colorSpace; + } + get strokeColorSpace() { + return this._strokeColorSpace; + } + set strokeColorSpace(colorSpace) { + this._strokeColorSpace = this.patternStrokeColorSpace = colorSpace; } clone() { return Object.create(this); @@ -36613,79 +43597,371 @@ class EvaluatorPreprocessor { this, "opMap", Object.assign(Object.create(null), { - w: { id: wA, numArgs: 1, variableArgs: !1 }, - J: { id: DA, numArgs: 1, variableArgs: !1 }, - j: { id: bA, numArgs: 1, variableArgs: !1 }, - M: { id: FA, numArgs: 1, variableArgs: !1 }, - d: { id: SA, numArgs: 2, variableArgs: !1 }, - ri: { id: kA, numArgs: 1, variableArgs: !1 }, - i: { id: RA, numArgs: 1, variableArgs: !1 }, - gs: { id: NA, numArgs: 1, variableArgs: !1 }, - q: { id: GA, numArgs: 0, variableArgs: !1 }, - Q: { id: xA, numArgs: 0, variableArgs: !1 }, - cm: { id: UA, numArgs: 6, variableArgs: !1 }, - m: { id: MA, numArgs: 2, variableArgs: !1 }, - l: { id: LA, numArgs: 2, variableArgs: !1 }, - c: { id: HA, numArgs: 6, variableArgs: !1 }, - v: { id: JA, numArgs: 4, variableArgs: !1 }, - y: { id: YA, numArgs: 4, variableArgs: !1 }, - h: { id: vA, numArgs: 0, variableArgs: !1 }, - re: { id: KA, numArgs: 4, variableArgs: !1 }, - S: { id: TA, numArgs: 0, variableArgs: !1 }, - s: { id: qA, numArgs: 0, variableArgs: !1 }, - f: { id: OA, numArgs: 0, variableArgs: !1 }, - F: { id: OA, numArgs: 0, variableArgs: !1 }, - "f*": { id: PA, numArgs: 0, variableArgs: !1 }, - B: { id: WA, numArgs: 0, variableArgs: !1 }, - "B*": { id: jA, numArgs: 0, variableArgs: !1 }, - b: { id: XA, numArgs: 0, variableArgs: !1 }, - "b*": { id: ZA, numArgs: 0, variableArgs: !1 }, - n: { id: VA, numArgs: 0, variableArgs: !1 }, - W: { id: zA, numArgs: 0, variableArgs: !1 }, - "W*": { id: _A, numArgs: 0, variableArgs: !1 }, - BT: { id: $A, numArgs: 0, variableArgs: !1 }, - ET: { id: Ae, numArgs: 0, variableArgs: !1 }, - Tc: { id: ee, numArgs: 1, variableArgs: !1 }, - Tw: { id: te, numArgs: 1, variableArgs: !1 }, - Tz: { id: ie, numArgs: 1, variableArgs: !1 }, - TL: { id: ae, numArgs: 1, variableArgs: !1 }, - Tf: { id: se, numArgs: 2, variableArgs: !1 }, - Tr: { id: re, numArgs: 1, variableArgs: !1 }, - Ts: { id: ne, numArgs: 1, variableArgs: !1 }, - Td: { id: ge, numArgs: 2, variableArgs: !1 }, - TD: { id: oe, numArgs: 2, variableArgs: !1 }, - Tm: { id: Ie, numArgs: 6, variableArgs: !1 }, - "T*": { id: ce, numArgs: 0, variableArgs: !1 }, - Tj: { id: Ce, numArgs: 1, variableArgs: !1 }, - TJ: { id: he, numArgs: 1, variableArgs: !1 }, - "'": { id: Be, numArgs: 1, variableArgs: !1 }, - '"': { id: le, numArgs: 3, variableArgs: !1 }, - d0: { id: Qe, numArgs: 2, variableArgs: !1 }, - d1: { id: Ee, numArgs: 6, variableArgs: !1 }, - CS: { id: ue, numArgs: 1, variableArgs: !1 }, - cs: { id: de, numArgs: 1, variableArgs: !1 }, - SC: { id: fe, numArgs: 4, variableArgs: !0 }, - SCN: { id: pe, numArgs: 33, variableArgs: !0 }, - sc: { id: me, numArgs: 4, variableArgs: !0 }, - scn: { id: ye, numArgs: 33, variableArgs: !0 }, - G: { id: we, numArgs: 1, variableArgs: !1 }, - g: { id: De, numArgs: 1, variableArgs: !1 }, - RG: { id: be, numArgs: 3, variableArgs: !1 }, - rg: { id: Fe, numArgs: 3, variableArgs: !1 }, - K: { id: Se, numArgs: 4, variableArgs: !1 }, - k: { id: ke, numArgs: 4, variableArgs: !1 }, - sh: { id: Re, numArgs: 1, variableArgs: !1 }, - BI: { id: Ne, numArgs: 0, variableArgs: !1 }, - ID: { id: Ge, numArgs: 0, variableArgs: !1 }, - EI: { id: xe, numArgs: 1, variableArgs: !1 }, - Do: { id: Ue, numArgs: 1, variableArgs: !1 }, - MP: { id: Me, numArgs: 1, variableArgs: !1 }, - DP: { id: Le, numArgs: 2, variableArgs: !1 }, - BMC: { id: He, numArgs: 1, variableArgs: !1 }, - BDC: { id: Je, numArgs: 2, variableArgs: !1 }, - EMC: { id: Ye, numArgs: 0, variableArgs: !1 }, - BX: { id: ve, numArgs: 0, variableArgs: !1 }, - EX: { id: Ke, numArgs: 0, variableArgs: !1 }, + w: { + id: OPS.setLineWidth, + numArgs: 1, + variableArgs: false, + }, + J: { + id: OPS.setLineCap, + numArgs: 1, + variableArgs: false, + }, + j: { + id: OPS.setLineJoin, + numArgs: 1, + variableArgs: false, + }, + M: { + id: OPS.setMiterLimit, + numArgs: 1, + variableArgs: false, + }, + d: { + id: OPS.setDash, + numArgs: 2, + variableArgs: false, + }, + ri: { + id: OPS.setRenderingIntent, + numArgs: 1, + variableArgs: false, + }, + i: { + id: OPS.setFlatness, + numArgs: 1, + variableArgs: false, + }, + gs: { + id: OPS.setGState, + numArgs: 1, + variableArgs: false, + }, + q: { + id: OPS.save, + numArgs: 0, + variableArgs: false, + }, + Q: { + id: OPS.restore, + numArgs: 0, + variableArgs: false, + }, + cm: { + id: OPS.transform, + numArgs: 6, + variableArgs: false, + }, + m: { + id: OPS.moveTo, + numArgs: 2, + variableArgs: false, + }, + l: { + id: OPS.lineTo, + numArgs: 2, + variableArgs: false, + }, + c: { + id: OPS.curveTo, + numArgs: 6, + variableArgs: false, + }, + v: { + id: OPS.curveTo2, + numArgs: 4, + variableArgs: false, + }, + y: { + id: OPS.curveTo3, + numArgs: 4, + variableArgs: false, + }, + h: { + id: OPS.closePath, + numArgs: 0, + variableArgs: false, + }, + re: { + id: OPS.rectangle, + numArgs: 4, + variableArgs: false, + }, + S: { + id: OPS.stroke, + numArgs: 0, + variableArgs: false, + }, + s: { + id: OPS.closeStroke, + numArgs: 0, + variableArgs: false, + }, + f: { + id: OPS.fill, + numArgs: 0, + variableArgs: false, + }, + F: { + id: OPS.fill, + numArgs: 0, + variableArgs: false, + }, + "f*": { + id: OPS.eoFill, + numArgs: 0, + variableArgs: false, + }, + B: { + id: OPS.fillStroke, + numArgs: 0, + variableArgs: false, + }, + "B*": { + id: OPS.eoFillStroke, + numArgs: 0, + variableArgs: false, + }, + b: { + id: OPS.closeFillStroke, + numArgs: 0, + variableArgs: false, + }, + "b*": { + id: OPS.closeEOFillStroke, + numArgs: 0, + variableArgs: false, + }, + n: { + id: OPS.endPath, + numArgs: 0, + variableArgs: false, + }, + W: { + id: OPS.clip, + numArgs: 0, + variableArgs: false, + }, + "W*": { + id: OPS.eoClip, + numArgs: 0, + variableArgs: false, + }, + BT: { + id: OPS.beginText, + numArgs: 0, + variableArgs: false, + }, + ET: { + id: OPS.endText, + numArgs: 0, + variableArgs: false, + }, + Tc: { + id: OPS.setCharSpacing, + numArgs: 1, + variableArgs: false, + }, + Tw: { + id: OPS.setWordSpacing, + numArgs: 1, + variableArgs: false, + }, + Tz: { + id: OPS.setHScale, + numArgs: 1, + variableArgs: false, + }, + TL: { + id: OPS.setLeading, + numArgs: 1, + variableArgs: false, + }, + Tf: { + id: OPS.setFont, + numArgs: 2, + variableArgs: false, + }, + Tr: { + id: OPS.setTextRenderingMode, + numArgs: 1, + variableArgs: false, + }, + Ts: { + id: OPS.setTextRise, + numArgs: 1, + variableArgs: false, + }, + Td: { + id: OPS.moveText, + numArgs: 2, + variableArgs: false, + }, + TD: { + id: OPS.setLeadingMoveText, + numArgs: 2, + variableArgs: false, + }, + Tm: { + id: OPS.setTextMatrix, + numArgs: 6, + variableArgs: false, + }, + "T*": { + id: OPS.nextLine, + numArgs: 0, + variableArgs: false, + }, + Tj: { + id: OPS.showText, + numArgs: 1, + variableArgs: false, + }, + TJ: { + id: OPS.showSpacedText, + numArgs: 1, + variableArgs: false, + }, + "'": { + id: OPS.nextLineShowText, + numArgs: 1, + variableArgs: false, + }, + '"': { + id: OPS.nextLineSetSpacingShowText, + numArgs: 3, + variableArgs: false, + }, + d0: { + id: OPS.setCharWidth, + numArgs: 2, + variableArgs: false, + }, + d1: { + id: OPS.setCharWidthAndBounds, + numArgs: 6, + variableArgs: false, + }, + CS: { + id: OPS.setStrokeColorSpace, + numArgs: 1, + variableArgs: false, + }, + cs: { + id: OPS.setFillColorSpace, + numArgs: 1, + variableArgs: false, + }, + SC: { + id: OPS.setStrokeColor, + numArgs: 4, + variableArgs: true, + }, + SCN: { + id: OPS.setStrokeColorN, + numArgs: 33, + variableArgs: true, + }, + sc: { + id: OPS.setFillColor, + numArgs: 4, + variableArgs: true, + }, + scn: { + id: OPS.setFillColorN, + numArgs: 33, + variableArgs: true, + }, + G: { + id: OPS.setStrokeGray, + numArgs: 1, + variableArgs: false, + }, + g: { + id: OPS.setFillGray, + numArgs: 1, + variableArgs: false, + }, + RG: { + id: OPS.setStrokeRGBColor, + numArgs: 3, + variableArgs: false, + }, + rg: { + id: OPS.setFillRGBColor, + numArgs: 3, + variableArgs: false, + }, + K: { + id: OPS.setStrokeCMYKColor, + numArgs: 4, + variableArgs: false, + }, + k: { + id: OPS.setFillCMYKColor, + numArgs: 4, + variableArgs: false, + }, + sh: { + id: OPS.shadingFill, + numArgs: 1, + variableArgs: false, + }, + BI: { + id: OPS.beginInlineImage, + numArgs: 0, + variableArgs: false, + }, + ID: { + id: OPS.beginImageData, + numArgs: 0, + variableArgs: false, + }, + EI: { + id: OPS.endInlineImage, + numArgs: 1, + variableArgs: false, + }, + Do: { + id: OPS.paintXObject, + numArgs: 1, + variableArgs: false, + }, + MP: { + id: OPS.markPoint, + numArgs: 1, + variableArgs: false, + }, + DP: { + id: OPS.markPointProps, + numArgs: 2, + variableArgs: false, + }, + BMC: { + id: OPS.beginMarkedContent, + numArgs: 1, + variableArgs: false, + }, + BDC: { + id: OPS.beginMarkedContentProps, + numArgs: 2, + variableArgs: false, + }, + EMC: { + id: OPS.endMarkedContent, + numArgs: 0, + variableArgs: false, + }, + BX: { + id: OPS.beginCompat, + numArgs: 0, + variableArgs: false, + }, + EX: { + id: OPS.endCompat, + numArgs: 0, + variableArgs: false, + }, BM: null, BD: null, true: null, @@ -36700,612 +43976,739 @@ class EvaluatorPreprocessor { ); } static MAX_INVALID_PATH_OPS = 10; - constructor(e, t, i = new StateManager()) { + constructor(stream, xref, stateManager = new StateManager()) { this.parser = new Parser({ - lexer: new Lexer(e, EvaluatorPreprocessor.opMap), - xref: t, + lexer: new Lexer(stream, EvaluatorPreprocessor.opMap), + xref, }); - this.stateManager = i; + this.stateManager = stateManager; this.nonProcessedArgs = []; - this._isPathOp = !1; + this._isPathOp = false; this._numInvalidPathOPS = 0; } get savedStatesDepth() { return this.stateManager.stateStack.length; } - read(e) { - let t = e.args; - for (;;) { - const i = this.parser.getObj(); - if (i instanceof Cmd) { - const a = i.cmd, - s = EvaluatorPreprocessor.opMap[a]; - if (!s) { - warn(`Unknown command "${a}".`); + read(operation) { + let args = operation.args; + while (true) { + const obj = this.parser.getObj(); + if (obj instanceof Cmd) { + const cmd = obj.cmd; + const opSpec = EvaluatorPreprocessor.opMap[cmd]; + if (!opSpec) { + warn(`Unknown command "${cmd}".`); continue; } - const r = s.id, - n = s.numArgs; - let g = null !== t ? t.length : 0; - this._isPathOp || (this._numInvalidPathOPS = 0); - this._isPathOp = r >= MA && r <= VA; - if (s.variableArgs) - g > n && - info( - `Command ${a}: expected [0, ${n}] args, but received ${g} args.`, - ); - else { - if (g !== n) { - const e = this.nonProcessedArgs; - for (; g > n; ) { - e.push(t.shift()); - g--; + const fn = opSpec.id; + const numArgs = opSpec.numArgs; + let argsLength = args !== null ? args.length : 0; + if (!this._isPathOp) { + this._numInvalidPathOPS = 0; + } + this._isPathOp = fn >= OPS.moveTo && fn <= OPS.endPath; + if (!opSpec.variableArgs) { + if (argsLength !== numArgs) { + const nonProcessedArgs = this.nonProcessedArgs; + while (argsLength > numArgs) { + nonProcessedArgs.push(args.shift()); + argsLength--; } - for (; g < n && 0 !== e.length; ) { - null === t && (t = []); - t.unshift(e.pop()); - g++; + while (argsLength < numArgs && nonProcessedArgs.length !== 0) { + if (args === null) { + args = []; + } + args.unshift(nonProcessedArgs.pop()); + argsLength++; } } - if (g < n) { - const e = `command ${a}: expected ${n} args, but received ${g} args.`; + if (argsLength < numArgs) { + const partialMsg = + `command ${cmd}: expected ${numArgs} args, ` + + `but received ${argsLength} args.`; if ( this._isPathOp && ++this._numInvalidPathOPS > EvaluatorPreprocessor.MAX_INVALID_PATH_OPS - ) - throw new FormatError(`Invalid ${e}`); - warn(`Skipping ${e}`); - null !== t && (t.length = 0); + ) { + throw new FormatError(`Invalid ${partialMsg}`); + } + warn(`Skipping ${partialMsg}`); + if (args !== null) { + args.length = 0; + } continue; } + } else if (argsLength > numArgs) { + info( + `Command ${cmd}: expected [0, ${numArgs}] args, ` + + `but received ${argsLength} args.`, + ); } - this.preprocessCommand(r, t); - e.fn = r; - e.args = t; - return !0; + this.preprocessCommand(fn, args); + operation.fn = fn; + operation.args = args; + return true; } - if (i === pt) return !1; - if (null !== i) { - null === t && (t = []); - t.push(i); - if (t.length > 33) throw new FormatError("Too many arguments"); + if (obj === EOF) { + return false; + } + if (obj !== null) { + if (args === null) { + args = []; + } + args.push(obj); + if (args.length > 33) { + throw new FormatError("Too many arguments"); + } } } } - preprocessCommand(e, t) { - switch (0 | e) { - case GA: + preprocessCommand(fn, args) { + switch (fn | 0) { + case OPS.save: this.stateManager.save(); break; - case xA: + case OPS.restore: this.stateManager.restore(); break; - case UA: - this.stateManager.transform(t); + case OPS.transform: + this.stateManager.transform(args); + break; } } -} +} // ./src/core/default_appearance.js + class DefaultAppearanceEvaluator extends EvaluatorPreprocessor { - constructor(e) { - super(new StringStream(e)); + constructor(str) { + super(new StringStream(str)); } parse() { - const e = { fn: 0, args: [] }, - t = { fontSize: 0, fontName: "", fontColor: new Uint8ClampedArray(3) }; + const operation = { + fn: 0, + args: [], + }; + const result = { + fontSize: 0, + fontName: "", + fontColor: new Uint8ClampedArray(3), + }; try { - for (;;) { - e.args.length = 0; - if (!this.read(e)) break; - if (0 !== this.savedStatesDepth) continue; - const { fn: i, args: a } = e; - switch (0 | i) { - case se: - const [e, i] = a; - e instanceof Name && (t.fontName = e.name); - "number" == typeof i && i > 0 && (t.fontSize = i); + while (true) { + operation.args.length = 0; + if (!this.read(operation)) { + break; + } + if (this.savedStatesDepth !== 0) { + continue; + } + const { fn, args } = operation; + switch (fn | 0) { + case OPS.setFont: + const [fontName, fontSize] = args; + if (fontName instanceof Name) { + result.fontName = fontName.name; + } + if (typeof fontSize === "number" && fontSize > 0) { + result.fontSize = fontSize; + } break; - case Fe: - ColorSpace.singletons.rgb.getRgbItem(a, 0, t.fontColor, 0); + case OPS.setFillRGBColor: + ColorSpace.singletons.rgb.getRgbItem(args, 0, result.fontColor, 0); break; - case De: - ColorSpace.singletons.gray.getRgbItem(a, 0, t.fontColor, 0); + case OPS.setFillGray: + ColorSpace.singletons.gray.getRgbItem(args, 0, result.fontColor, 0); + break; + case OPS.setFillCMYKColor: + ColorSpace.singletons.cmyk.getRgbItem(args, 0, result.fontColor, 0); break; - case ke: - ColorSpace.singletons.cmyk.getRgbItem(a, 0, t.fontColor, 0); } } - } catch (e) { - warn(`parseDefaultAppearance - ignoring errors: "${e}".`); + } catch (reason) { + warn(`parseDefaultAppearance - ignoring errors: "${reason}".`); } - return t; + return result; } } -function parseDefaultAppearance(e) { - return new DefaultAppearanceEvaluator(e).parse(); +function parseDefaultAppearance(str) { + return new DefaultAppearanceEvaluator(str).parse(); } class AppearanceStreamEvaluator extends EvaluatorPreprocessor { - constructor(e, t, i) { - super(e); - this.stream = e; - this.evaluatorOptions = t; - this.xref = i; - this.resources = e.dict?.get("Resources"); + constructor(stream, evaluatorOptions, xref) { + super(stream); + this.stream = stream; + this.evaluatorOptions = evaluatorOptions; + this.xref = xref; + this.resources = stream.dict?.get("Resources"); } parse() { - const e = { fn: 0, args: [] }; - let t = { - scaleFactor: 1, - fontSize: 0, - fontName: "", - fontColor: new Uint8ClampedArray(3), - fillColorSpace: ColorSpace.singletons.gray, - }, - i = !1; - const a = []; + const operation = { + fn: 0, + args: [], + }; + let result = { + scaleFactor: 1, + fontSize: 0, + fontName: "", + fontColor: new Uint8ClampedArray(3), + fillColorSpace: ColorSpace.singletons.gray, + }; + let breakLoop = false; + const stack = []; try { - for (;;) { - e.args.length = 0; - if (i || !this.read(e)) break; - const { fn: s, args: r } = e; - switch (0 | s) { - case GA: - a.push({ - scaleFactor: t.scaleFactor, - fontSize: t.fontSize, - fontName: t.fontName, - fontColor: t.fontColor.slice(), - fillColorSpace: t.fillColorSpace, + while (true) { + operation.args.length = 0; + if (breakLoop || !this.read(operation)) { + break; + } + const { fn, args } = operation; + switch (fn | 0) { + case OPS.save: + stack.push({ + scaleFactor: result.scaleFactor, + fontSize: result.fontSize, + fontName: result.fontName, + fontColor: result.fontColor.slice(), + fillColorSpace: result.fillColorSpace, }); break; - case xA: - t = a.pop() || t; + case OPS.restore: + result = stack.pop() || result; break; - case Ie: - t.scaleFactor *= Math.hypot(r[0], r[1]); + case OPS.setTextMatrix: + result.scaleFactor *= Math.hypot(args[0], args[1]); break; - case se: - const [e, s] = r; - e instanceof Name && (t.fontName = e.name); - "number" == typeof s && s > 0 && (t.fontSize = s * t.scaleFactor); + case OPS.setFont: + const [fontName, fontSize] = args; + if (fontName instanceof Name) { + result.fontName = fontName.name; + } + if (typeof fontSize === "number" && fontSize > 0) { + result.fontSize = fontSize * result.scaleFactor; + } break; - case de: - t.fillColorSpace = ColorSpace.parse({ - cs: r[0], + case OPS.setFillColorSpace: + result.fillColorSpace = ColorSpace.parse({ + cs: args[0], xref: this.xref, resources: this.resources, pdfFunctionFactory: this._pdfFunctionFactory, localColorSpaceCache: this._localColorSpaceCache, }); break; - case me: - t.fillColorSpace.getRgbItem(r, 0, t.fontColor, 0); + case OPS.setFillColor: + const cs = result.fillColorSpace; + cs.getRgbItem(args, 0, result.fontColor, 0); break; - case Fe: - ColorSpace.singletons.rgb.getRgbItem(r, 0, t.fontColor, 0); + case OPS.setFillRGBColor: + ColorSpace.singletons.rgb.getRgbItem(args, 0, result.fontColor, 0); break; - case De: - ColorSpace.singletons.gray.getRgbItem(r, 0, t.fontColor, 0); + case OPS.setFillGray: + ColorSpace.singletons.gray.getRgbItem(args, 0, result.fontColor, 0); break; - case ke: - ColorSpace.singletons.cmyk.getRgbItem(r, 0, t.fontColor, 0); + case OPS.setFillCMYKColor: + ColorSpace.singletons.cmyk.getRgbItem(args, 0, result.fontColor, 0); + break; + case OPS.showText: + case OPS.showSpacedText: + case OPS.nextLineShowText: + case OPS.nextLineSetSpacingShowText: + breakLoop = true; break; - case Ce: - case he: - case Be: - case le: - i = !0; } } - } catch (e) { - warn(`parseAppearanceStream - ignoring errors: "${e}".`); + } catch (reason) { + warn(`parseAppearanceStream - ignoring errors: "${reason}".`); } this.stream.reset(); - delete t.scaleFactor; - delete t.fillColorSpace; - return t; + delete result.scaleFactor; + delete result.fillColorSpace; + return result; } get _localColorSpaceCache() { return shadow(this, "_localColorSpaceCache", new LocalColorSpaceCache()); } get _pdfFunctionFactory() { - return shadow( - this, - "_pdfFunctionFactory", - new PDFFunctionFactory({ - xref: this.xref, - isEvalSupported: this.evaluatorOptions.isEvalSupported, - }), - ); + const pdfFunctionFactory = new PDFFunctionFactory({ + xref: this.xref, + isEvalSupported: this.evaluatorOptions.isEvalSupported, + }); + return shadow(this, "_pdfFunctionFactory", pdfFunctionFactory); } } -function getPdfColor(e, t) { - if (e[0] === e[1] && e[1] === e[2]) { - return `${numberToString(e[0] / 255)} ${t ? "g" : "G"}`; +function parseAppearanceStream(stream, evaluatorOptions, xref) { + return new AppearanceStreamEvaluator(stream, evaluatorOptions, xref).parse(); +} +function getPdfColor(color, isFill) { + if (color[0] === color[1] && color[1] === color[2]) { + const gray = color[0] / 255; + return `${numberToString(gray)} ${isFill ? "g" : "G"}`; } return ( - Array.from(e, (e) => numberToString(e / 255)).join(" ") + - " " + - (t ? "rg" : "RG") + Array.from(color, (c) => numberToString(c / 255)).join(" ") + + ` ${isFill ? "rg" : "RG"}` ); } +function createDefaultAppearance({ fontSize, fontName, fontColor }) { + return `/${escapePDFName(fontName)} ${fontSize} Tf ${getPdfColor(fontColor, true)}`; +} class FakeUnicodeFont { - constructor(e, t) { - this.xref = e; + constructor(xref, fontFamily) { + this.xref = xref; this.widths = null; - this.firstChar = 1 / 0; - this.lastChar = -1 / 0; - this.fontFamily = t; - const i = new OffscreenCanvas(1, 1); - this.ctxMeasure = i.getContext("2d", { willReadFrequently: !0 }); - FakeUnicodeFont._fontNameId || (FakeUnicodeFont._fontNameId = 1); + this.firstChar = Infinity; + this.lastChar = -Infinity; + this.fontFamily = fontFamily; + const canvas = new OffscreenCanvas(1, 1); + this.ctxMeasure = canvas.getContext("2d", { + willReadFrequently: true, + }); + if (!FakeUnicodeFont._fontNameId) { + FakeUnicodeFont._fontNameId = 1; + } this.fontName = Name.get( - `InvalidPDFjsFont_${t}_${FakeUnicodeFont._fontNameId++}`, + `InvalidPDFjsFont_${fontFamily}_${FakeUnicodeFont._fontNameId++}`, ); } get fontDescriptorRef() { if (!FakeUnicodeFont._fontDescriptorRef) { - const e = new Dict(this.xref); - e.set("Type", Name.get("FontDescriptor")); - e.set("FontName", this.fontName); - e.set("FontFamily", "MyriadPro Regular"); - e.set("FontBBox", [0, 0, 0, 0]); - e.set("FontStretch", Name.get("Normal")); - e.set("FontWeight", 400); - e.set("ItalicAngle", 0); - FakeUnicodeFont._fontDescriptorRef = this.xref.getNewPersistentRef(e); + const fontDescriptor = new Dict(this.xref); + fontDescriptor.set("Type", Name.get("FontDescriptor")); + fontDescriptor.set("FontName", this.fontName); + fontDescriptor.set("FontFamily", "MyriadPro Regular"); + fontDescriptor.set("FontBBox", [0, 0, 0, 0]); + fontDescriptor.set("FontStretch", Name.get("Normal")); + fontDescriptor.set("FontWeight", 400); + fontDescriptor.set("ItalicAngle", 0); + FakeUnicodeFont._fontDescriptorRef = + this.xref.getNewPersistentRef(fontDescriptor); } return FakeUnicodeFont._fontDescriptorRef; } get descendantFontRef() { - const e = new Dict(this.xref); - e.set("BaseFont", this.fontName); - e.set("Type", Name.get("Font")); - e.set("Subtype", Name.get("CIDFontType0")); - e.set("CIDToGIDMap", Name.get("Identity")); - e.set("FirstChar", this.firstChar); - e.set("LastChar", this.lastChar); - e.set("FontDescriptor", this.fontDescriptorRef); - e.set("DW", 1e3); - const t = [], - i = [...this.widths.entries()].sort(); - let a = null, - s = null; - for (const [e, r] of i) - if (a) - if (e === a + s.length) s.push(r); - else { - t.push(a, s); - a = e; - s = [r]; - } - else { - a = e; - s = [r]; + const descendantFont = new Dict(this.xref); + descendantFont.set("BaseFont", this.fontName); + descendantFont.set("Type", Name.get("Font")); + descendantFont.set("Subtype", Name.get("CIDFontType0")); + descendantFont.set("CIDToGIDMap", Name.get("Identity")); + descendantFont.set("FirstChar", this.firstChar); + descendantFont.set("LastChar", this.lastChar); + descendantFont.set("FontDescriptor", this.fontDescriptorRef); + descendantFont.set("DW", 1000); + const widths = []; + const chars = [...this.widths.entries()].sort(); + let currentChar = null; + let currentWidths = null; + for (const [char, width] of chars) { + if (!currentChar) { + currentChar = char; + currentWidths = [width]; + continue; } - a && t.push(a, s); - e.set("W", t); - const r = new Dict(this.xref); - r.set("Ordering", "Identity"); - r.set("Registry", "Adobe"); - r.set("Supplement", 0); - e.set("CIDSystemInfo", r); - return this.xref.getNewPersistentRef(e); + if (char === currentChar + currentWidths.length) { + currentWidths.push(width); + } else { + widths.push(currentChar, currentWidths); + currentChar = char; + currentWidths = [width]; + } + } + if (currentChar) { + widths.push(currentChar, currentWidths); + } + descendantFont.set("W", widths); + const cidSystemInfo = new Dict(this.xref); + cidSystemInfo.set("Ordering", "Identity"); + cidSystemInfo.set("Registry", "Adobe"); + cidSystemInfo.set("Supplement", 0); + descendantFont.set("CIDSystemInfo", cidSystemInfo); + return this.xref.getNewPersistentRef(descendantFont); } get baseFontRef() { - const e = new Dict(this.xref); - e.set("BaseFont", this.fontName); - e.set("Type", Name.get("Font")); - e.set("Subtype", Name.get("Type0")); - e.set("Encoding", Name.get("Identity-H")); - e.set("DescendantFonts", [this.descendantFontRef]); - e.set("ToUnicode", Name.get("Identity-H")); - return this.xref.getNewPersistentRef(e); + const baseFont = new Dict(this.xref); + baseFont.set("BaseFont", this.fontName); + baseFont.set("Type", Name.get("Font")); + baseFont.set("Subtype", Name.get("Type0")); + baseFont.set("Encoding", Name.get("Identity-H")); + baseFont.set("DescendantFonts", [this.descendantFontRef]); + baseFont.set("ToUnicode", Name.get("Identity-H")); + return this.xref.getNewPersistentRef(baseFont); } get resources() { - const e = new Dict(this.xref), - t = new Dict(this.xref); - t.set(this.fontName.name, this.baseFontRef); - e.set("Font", t); - return e; + const resources = new Dict(this.xref); + const font = new Dict(this.xref); + font.set(this.fontName.name, this.baseFontRef); + resources.set("Font", font); + return resources; } _createContext() { this.widths = new Map(); this.ctxMeasure.font = `1000px ${this.fontFamily}`; return this.ctxMeasure; } - createFontResources(e) { - const t = this._createContext(); - for (const i of e.split(/\r\n?|\n/)) - for (const e of i.split("")) { - const i = e.charCodeAt(0); - if (this.widths.has(i)) continue; - const a = t.measureText(e), - s = Math.ceil(a.width); - this.widths.set(i, s); - this.firstChar = Math.min(i, this.firstChar); - this.lastChar = Math.max(i, this.lastChar); + createFontResources(text) { + const ctx = this._createContext(); + for (const line of text.split(/\r\n?|\n/)) { + for (const char of line.split("")) { + const code = char.charCodeAt(0); + if (this.widths.has(code)) { + continue; + } + const metrics = ctx.measureText(char); + const width = Math.ceil(metrics.width); + this.widths.set(code, width); + this.firstChar = Math.min(code, this.firstChar); + this.lastChar = Math.max(code, this.lastChar); } + } return this.resources; } - static getFirstPositionInfo(e, t, i) { - const [a, n, g, o] = e; - let c = g - a, - C = o - n; - t % 180 != 0 && ([c, C] = [C, c]); - const h = s * i; + static getFirstPositionInfo(rect, rotation, fontSize) { + const [x1, y1, x2, y2] = rect; + let w = x2 - x1; + let h = y2 - y1; + if (rotation % 180 !== 0) { + [w, h] = [h, w]; + } + const lineHeight = LINE_FACTOR * fontSize; + const lineDescent = LINE_DESCENT_FACTOR * fontSize; return { - coords: [0, C + r * i - h], - bbox: [0, 0, c, C], - matrix: 0 !== t ? getRotationMatrix(t, C, h) : void 0, + coords: [0, h + lineDescent - lineHeight], + bbox: [0, 0, w, h], + matrix: + rotation !== 0 ? getRotationMatrix(rotation, h, lineHeight) : undefined, }; } - createAppearance(e, t, i, a, n, g) { - const o = this._createContext(), - c = []; - let C = -1 / 0; - for (const t of e.split(/\r\n?|\n/)) { - c.push(t); - const e = o.measureText(t).width; - C = Math.max(C, e); - for (const e of codePointIter(t)) { - const t = String.fromCodePoint(e); - let i = this.widths.get(e); - if (void 0 === i) { - const a = o.measureText(t); - i = Math.ceil(a.width); - this.widths.set(e, i); - this.firstChar = Math.min(e, this.firstChar); - this.lastChar = Math.max(e, this.lastChar); + createAppearance(text, rect, rotation, fontSize, bgColor, strokeAlpha) { + const ctx = this._createContext(); + const lines = []; + let maxWidth = -Infinity; + for (const line of text.split(/\r\n?|\n/)) { + lines.push(line); + const lineWidth = ctx.measureText(line).width; + maxWidth = Math.max(maxWidth, lineWidth); + for (const code of codePointIter(line)) { + const char = String.fromCodePoint(code); + let width = this.widths.get(code); + if (width === undefined) { + const metrics = ctx.measureText(char); + width = Math.ceil(metrics.width); + this.widths.set(code, width); + this.firstChar = Math.min(code, this.firstChar); + this.lastChar = Math.max(code, this.lastChar); } } } - C *= a / 1e3; - const [h, l, Q, E] = t; - let u = Q - h, - d = E - l; - i % 180 != 0 && ([u, d] = [d, u]); - let f = 1; - C > u && (f = u / C); - let p = 1; - const m = s * a, - y = r * a, - w = m * c.length; - w > d && (p = d / w); - const D = a * Math.min(f, p), - b = [ - "q", - `0 0 ${numberToString(u)} ${numberToString(d)} re W n`, - "BT", - `1 0 0 1 0 ${numberToString(d + y)} Tm 0 Tc ${getPdfColor(n, !0)}`, - `/${this.fontName.name} ${numberToString(D)} Tf`, - ], - { resources: F } = this; - if (1 !== (g = "number" == typeof g && g >= 0 && g <= 1 ? g : 1)) { - b.push("/R0 gs"); - const e = new Dict(this.xref), - t = new Dict(this.xref); - t.set("ca", g); - t.set("CA", g); - t.set("Type", Name.get("ExtGState")); - e.set("R0", t); - F.set("ExtGState", e); + maxWidth *= fontSize / 1000; + const [x1, y1, x2, y2] = rect; + let w = x2 - x1; + let h = y2 - y1; + if (rotation % 180 !== 0) { + [w, h] = [h, w]; } - const S = numberToString(m); - for (const e of c) b.push(`0 -${S} Td <${stringToUTF16HexString(e)}> Tj`); - b.push("ET", "Q"); - const k = b.join("\n"), - R = new Dict(this.xref); - R.set("Subtype", Name.get("Form")); - R.set("Type", Name.get("XObject")); - R.set("BBox", [0, 0, u, d]); - R.set("Length", k.length); - R.set("Resources", F); - if (i) { - const e = getRotationMatrix(i, u, d); - R.set("Matrix", e); + let hscale = 1; + if (maxWidth > w) { + hscale = w / maxWidth; } - const N = new StringStream(k); - N.dict = R; - return N; + let vscale = 1; + const lineHeight = LINE_FACTOR * fontSize; + const lineDescent = LINE_DESCENT_FACTOR * fontSize; + const maxHeight = lineHeight * lines.length; + if (maxHeight > h) { + vscale = h / maxHeight; + } + const fscale = Math.min(hscale, vscale); + const newFontSize = fontSize * fscale; + const buffer = [ + "q", + `0 0 ${numberToString(w)} ${numberToString(h)} re W n`, + `BT`, + `1 0 0 1 0 ${numberToString(h + lineDescent)} Tm 0 Tc ${getPdfColor(bgColor, true)}`, + `/${this.fontName.name} ${numberToString(newFontSize)} Tf`, + ]; + const { resources } = this; + strokeAlpha = + typeof strokeAlpha === "number" && strokeAlpha >= 0 && strokeAlpha <= 1 + ? strokeAlpha + : 1; + if (strokeAlpha !== 1) { + buffer.push("/R0 gs"); + const extGState = new Dict(this.xref); + const r0 = new Dict(this.xref); + r0.set("ca", strokeAlpha); + r0.set("CA", strokeAlpha); + r0.set("Type", Name.get("ExtGState")); + extGState.set("R0", r0); + resources.set("ExtGState", extGState); + } + const vShift = numberToString(lineHeight); + for (const line of lines) { + buffer.push(`0 -${vShift} Td <${stringToUTF16HexString(line)}> Tj`); + } + buffer.push("ET", "Q"); + const appearance = buffer.join("\n"); + const appearanceStreamDict = new Dict(this.xref); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", [0, 0, w, h]); + appearanceStreamDict.set("Length", appearance.length); + appearanceStreamDict.set("Resources", resources); + if (rotation) { + const matrix = getRotationMatrix(rotation, w, h); + appearanceStreamDict.set("Matrix", matrix); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; } -} +} // ./src/core/name_number_tree.js + class NameOrNumberTree { - constructor(e, t, i) { - this.constructor === NameOrNumberTree && - unreachable("Cannot initialize NameOrNumberTree."); - this.root = e; - this.xref = t; - this._type = i; + constructor(root, xref, type) { + this.root = root; + this.xref = xref; + this._type = type; } getAll() { - const e = new Map(); - if (!this.root) return e; - const t = this.xref, - i = new RefSet(); - i.put(this.root); - const a = [this.root]; - for (; a.length > 0; ) { - const s = t.fetchIfRef(a.shift()); - if (!(s instanceof Dict)) continue; - if (s.has("Kids")) { - const e = s.get("Kids"); - if (!Array.isArray(e)) continue; - for (const t of e) { - if (i.has(t)) + const map = new Map(); + if (!this.root) { + return map; + } + const xref = this.xref; + const processed = new RefSet(); + processed.put(this.root); + const queue = [this.root]; + while (queue.length > 0) { + const obj = xref.fetchIfRef(queue.shift()); + if (!(obj instanceof Dict)) { + continue; + } + if (obj.has("Kids")) { + const kids = obj.get("Kids"); + if (!Array.isArray(kids)) { + continue; + } + for (const kid of kids) { + if (processed.has(kid)) { throw new FormatError(`Duplicate entry in "${this._type}" tree.`); - a.push(t); - i.put(t); + } + queue.push(kid); + processed.put(kid); } continue; } - const r = s.get(this._type); - if (Array.isArray(r)) - for (let i = 0, a = r.length; i < a; i += 2) - e.set(t.fetchIfRef(r[i]), t.fetchIfRef(r[i + 1])); + const entries = obj.get(this._type); + if (!Array.isArray(entries)) { + continue; + } + for (let i = 0, ii = entries.length; i < ii; i += 2) { + map.set(xref.fetchIfRef(entries[i]), xref.fetchIfRef(entries[i + 1])); + } } - return e; + return map; } - get(e) { - if (!this.root) return null; - const t = this.xref; - let i = t.fetchIfRef(this.root), - a = 0; - for (; i.has("Kids"); ) { - if (++a > 10) { + getRaw(key) { + if (!this.root) { + return null; + } + const xref = this.xref; + let kidsOrEntries = xref.fetchIfRef(this.root); + let loopCount = 0; + const MAX_LEVELS = 10; + while (kidsOrEntries.has("Kids")) { + if (++loopCount > MAX_LEVELS) { warn(`Search depth limit reached for "${this._type}" tree.`); return null; } - const s = i.get("Kids"); - if (!Array.isArray(s)) return null; - let r = 0, - n = s.length - 1; - for (; r <= n; ) { - const a = (r + n) >> 1, - g = t.fetchIfRef(s[a]), - o = g.get("Limits"); - if (e < t.fetchIfRef(o[0])) n = a - 1; - else { - if (!(e > t.fetchIfRef(o[1]))) { - i = g; - break; - } - r = a + 1; + const kids = kidsOrEntries.get("Kids"); + if (!Array.isArray(kids)) { + return null; + } + let l = 0, + r = kids.length - 1; + while (l <= r) { + const m = (l + r) >> 1; + const kid = xref.fetchIfRef(kids[m]); + const limits = kid.get("Limits"); + if (key < xref.fetchIfRef(limits[0])) { + r = m - 1; + } else if (key > xref.fetchIfRef(limits[1])) { + l = m + 1; + } else { + kidsOrEntries = kid; + break; } } - if (r > n) return null; + if (l > r) { + return null; + } } - const s = i.get(this._type); - if (Array.isArray(s)) { - let i = 0, - a = s.length - 2; - for (; i <= a; ) { - const r = (i + a) >> 1, - n = r + (1 & r), - g = t.fetchIfRef(s[n]); - if (e < g) a = n - 2; - else { - if (!(e > g)) return t.fetchIfRef(s[n + 1]); - i = n + 2; + const entries = kidsOrEntries.get(this._type); + if (Array.isArray(entries)) { + let l = 0, + r = entries.length - 2; + while (l <= r) { + const tmp = (l + r) >> 1, + m = tmp + (tmp & 1); + const currentKey = xref.fetchIfRef(entries[m]); + if (key < currentKey) { + r = m - 2; + } else if (key > currentKey) { + l = m + 2; + } else { + return entries[m + 1]; } } } return null; } + get(key) { + return this.xref.fetchIfRef(this.getRaw(key)); + } } class NameTree extends NameOrNumberTree { - constructor(e, t) { - super(e, t, "Names"); + constructor(root, xref) { + super(root, xref, "Names"); } } class NumberTree extends NameOrNumberTree { - constructor(e, t) { - super(e, t, "Nums"); + constructor(root, xref) { + super(root, xref, "Nums"); } -} +} // ./src/core/cleanup_helper.js + function clearGlobalCaches() { - !(function clearPatternCaches() { - ya = Object.create(null); - })(); - !(function clearPrimitiveCaches() { - mt = Object.create(null); - yt = Object.create(null); - wt = Object.create(null); - })(); - !(function clearUnicodeCaches() { - Ji.clear(); - })(); + clearPatternCaches(); + clearPrimitiveCaches(); + clearUnicodeCaches(); JpxImage.cleanup(); +} // ./src/core/file_spec.js + +function pickPlatformItem(dict) { + if (!(dict instanceof Dict)) { + return null; + } + if (dict.has("UF")) { + return dict.get("UF"); + } else if (dict.has("F")) { + return dict.get("F"); + } else if (dict.has("Unix")) { + return dict.get("Unix"); + } else if (dict.has("Mac")) { + return dict.get("Mac"); + } else if (dict.has("DOS")) { + return dict.get("DOS"); + } + return null; } -function pickPlatformItem(e) { - return e instanceof Dict - ? e.has("UF") - ? e.get("UF") - : e.has("F") - ? e.get("F") - : e.has("Unix") - ? e.get("Unix") - : e.has("Mac") - ? e.get("Mac") - : e.has("DOS") - ? e.get("DOS") - : null - : null; +function stripPath(str) { + return str.substring(str.lastIndexOf("/") + 1); } class FileSpec { - #S = !1; - constructor(e, t, i = !1) { - if (e instanceof Dict) { - this.xref = t; - this.root = e; - e.has("FS") && (this.fs = e.get("FS")); - e.has("RF") && warn("Related file specifications are not supported"); - i || - (e.has("EF") - ? (this.#S = !0) - : warn("Non-embedded file specifications are not supported")); + #contentAvailable = false; + constructor(root, xref, skipContent = false) { + if (!(root instanceof Dict)) { + return; + } + this.xref = xref; + this.root = root; + if (root.has("FS")) { + this.fs = root.get("FS"); + } + if (root.has("RF")) { + warn("Related file specifications are not supported"); + } + if (!skipContent) { + if (root.has("EF")) { + this.#contentAvailable = true; + } else { + warn("Non-embedded file specifications are not supported"); + } } } get filename() { - let e = ""; - const t = pickPlatformItem(this.root); - t && - "string" == typeof t && - (e = stringToPDFString(t) + let filename = ""; + const item = pickPlatformItem(this.root); + if (item && typeof item === "string") { + filename = stringToPDFString(item) .replaceAll("\\\\", "\\") .replaceAll("\\/", "/") - .replaceAll("\\", "/")); - return shadow(this, "filename", e || "unnamed"); + .replaceAll("\\", "/"); + } + return shadow(this, "filename", filename || "unnamed"); } get content() { - if (!this.#S) return null; + if (!this.#contentAvailable) { + return null; + } this._contentRef ||= pickPlatformItem(this.root?.get("EF")); - let e = null; + let content = null; if (this._contentRef) { - const t = this.xref.fetchIfRef(this._contentRef); - t instanceof BaseStream - ? (e = t.getBytes()) - : warn( - "Embedded file specification points to non-existing/invalid content", - ); - } else warn("Embedded file specification does not have any content"); - return e; + const fileObj = this.xref.fetchIfRef(this._contentRef); + if (fileObj instanceof BaseStream) { + content = fileObj.getBytes(); + } else { + warn( + "Embedded file specification points to non-existing/invalid content", + ); + } + } else { + warn("Embedded file specification does not have any content"); + } + return content; } get description() { - let e = ""; - const t = this.root?.get("Desc"); - t && "string" == typeof t && (e = stringToPDFString(t)); - return shadow(this, "description", e); + let description = ""; + const desc = this.root?.get("Desc"); + if (desc && typeof desc === "string") { + description = stringToPDFString(desc); + } + return shadow(this, "description", description); } get serializable() { return { rawFilename: this.filename, - filename: ((e = this.filename), e.substring(e.lastIndexOf("/") + 1)), + filename: stripPath(this.filename), content: this.content, description: this.description, }; - var e; } +} // ./src/core/xml_parser.js + +const XMLParserErrorCode = { + NoError: 0, + EndOfDocument: -1, + UnterminatedCdat: -2, + UnterminatedXmlDeclaration: -3, + UnterminatedDoctypeDeclaration: -4, + UnterminatedComment: -5, + MalformedElement: -6, + OutOfMemory: -7, + UnterminatedAttributeValue: -8, + UnterminatedElement: -9, + ElementNeverBegun: -10, +}; +function isWhitespace(s, index) { + const ch = s[index]; + return ch === " " || ch === "\n" || ch === "\r" || ch === "\t"; } -const Rs = 0, - Ns = -2, - Gs = -3, - xs = -4, - Us = -5, - Ms = -6, - Ls = -9; -function isWhitespace(e, t) { - const i = e[t]; - return " " === i || "\n" === i || "\r" === i || "\t" === i; +function isWhitespaceString(s) { + for (let i = 0, ii = s.length; i < ii; i++) { + if (!isWhitespace(s, i)) { + return false; + } + } + return true; } class XMLParserBase { - _resolveEntities(e) { - return e.replaceAll(/&([^;]+);/g, (e, t) => { - if ("#x" === t.substring(0, 2)) - return String.fromCodePoint(parseInt(t.substring(2), 16)); - if ("#" === t.substring(0, 1)) - return String.fromCodePoint(parseInt(t.substring(1), 10)); - switch (t) { + _resolveEntities(s) { + return s.replaceAll(/&([^;]+);/g, (all, entity) => { + if (entity.substring(0, 2) === "#x") { + return String.fromCodePoint(parseInt(entity.substring(2), 16)); + } else if (entity.substring(0, 1) === "#") { + return String.fromCodePoint(parseInt(entity.substring(1), 10)); + } + switch (entity) { case "lt": return "<"; case "gt": @@ -37317,196 +44720,248 @@ class XMLParserBase { case "apos": return "'"; } - return this.onResolveEntity(t); + return this.onResolveEntity(entity); }); } - _parseContent(e, t) { - const i = []; - let a = t; + _parseContent(s, start) { + const attributes = []; + let pos = start; function skipWs() { - for (; a < e.length && isWhitespace(e, a); ) ++a; + while (pos < s.length && isWhitespace(s, pos)) { + ++pos; + } } - for ( - ; - a < e.length && !isWhitespace(e, a) && ">" !== e[a] && "/" !== e[a]; - - ) - ++a; - const s = e.substring(t, a); + while ( + pos < s.length && + !isWhitespace(s, pos) && + s[pos] !== ">" && + s[pos] !== "/" + ) { + ++pos; + } + const name = s.substring(start, pos); skipWs(); - for (; a < e.length && ">" !== e[a] && "/" !== e[a] && "?" !== e[a]; ) { + while ( + pos < s.length && + s[pos] !== ">" && + s[pos] !== "/" && + s[pos] !== "?" + ) { skipWs(); - let t = "", - s = ""; - for (; a < e.length && !isWhitespace(e, a) && "=" !== e[a]; ) { - t += e[a]; - ++a; + let attrName = "", + attrValue = ""; + while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== "=") { + attrName += s[pos]; + ++pos; } skipWs(); - if ("=" !== e[a]) return null; - ++a; + if (s[pos] !== "=") { + return null; + } + ++pos; skipWs(); - const r = e[a]; - if ('"' !== r && "'" !== r) return null; - const n = e.indexOf(r, ++a); - if (n < 0) return null; - s = e.substring(a, n); - i.push({ name: t, value: this._resolveEntities(s) }); - a = n + 1; + const attrEndChar = s[pos]; + if (attrEndChar !== '"' && attrEndChar !== "'") { + return null; + } + const attrEndIndex = s.indexOf(attrEndChar, ++pos); + if (attrEndIndex < 0) { + return null; + } + attrValue = s.substring(pos, attrEndIndex); + attributes.push({ + name: attrName, + value: this._resolveEntities(attrValue), + }); + pos = attrEndIndex + 1; skipWs(); } - return { name: s, attributes: i, parsed: a - t }; + return { + name, + attributes, + parsed: pos - start, + }; } - _parseProcessingInstruction(e, t) { - let i = t; - for ( - ; - i < e.length && - !isWhitespace(e, i) && - ">" !== e[i] && - "?" !== e[i] && - "/" !== e[i]; - - ) - ++i; - const a = e.substring(t, i); - !(function skipWs() { - for (; i < e.length && isWhitespace(e, i); ) ++i; - })(); - const s = i; - for (; i < e.length && ("?" !== e[i] || ">" !== e[i + 1]); ) ++i; - return { name: a, value: e.substring(s, i), parsed: i - t }; + _parseProcessingInstruction(s, start) { + let pos = start; + function skipWs() { + while (pos < s.length && isWhitespace(s, pos)) { + ++pos; + } + } + while ( + pos < s.length && + !isWhitespace(s, pos) && + s[pos] !== ">" && + s[pos] !== "?" && + s[pos] !== "/" + ) { + ++pos; + } + const name = s.substring(start, pos); + skipWs(); + const attrStart = pos; + while (pos < s.length && (s[pos] !== "?" || s[pos + 1] !== ">")) { + ++pos; + } + const value = s.substring(attrStart, pos); + return { + name, + value, + parsed: pos - start, + }; } - parseXml(e) { - let t = 0; - for (; t < e.length; ) { - let i = t; - if ("<" === e[t]) { - ++i; - let t; - switch (e[i]) { + parseXml(s) { + let i = 0; + while (i < s.length) { + const ch = s[i]; + let j = i; + if (ch === "<") { + ++j; + const ch2 = s[j]; + let q; + switch (ch2) { case "/": - ++i; - t = e.indexOf(">", i); - if (t < 0) { - this.onError(Ls); + ++j; + q = s.indexOf(">", j); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedElement); return; } - this.onEndElement(e.substring(i, t)); - i = t + 1; + this.onEndElement(s.substring(j, q)); + j = q + 1; break; case "?": - ++i; - const a = this._parseProcessingInstruction(e, i); - if ("?>" !== e.substring(i + a.parsed, i + a.parsed + 2)) { - this.onError(Gs); + ++j; + const pi = this._parseProcessingInstruction(s, j); + if (s.substring(j + pi.parsed, j + pi.parsed + 2) !== "?>") { + this.onError(XMLParserErrorCode.UnterminatedXmlDeclaration); return; } - this.onPi(a.name, a.value); - i += a.parsed + 2; + this.onPi(pi.name, pi.value); + j += pi.parsed + 2; break; case "!": - if ("--" === e.substring(i + 1, i + 3)) { - t = e.indexOf("--\x3e", i + 3); - if (t < 0) { - this.onError(Us); + if (s.substring(j + 1, j + 3) === "--") { + q = s.indexOf("-->", j + 3); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedComment); return; } - this.onComment(e.substring(i + 3, t)); - i = t + 3; - } else if ("[CDATA[" === e.substring(i + 1, i + 8)) { - t = e.indexOf("]]>", i + 8); - if (t < 0) { - this.onError(Ns); + this.onComment(s.substring(j + 3, q)); + j = q + 3; + } else if (s.substring(j + 1, j + 8) === "[CDATA[") { + q = s.indexOf("]]>", j + 8); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedCdat); return; } - this.onCdata(e.substring(i + 8, t)); - i = t + 3; - } else { - if ("DOCTYPE" !== e.substring(i + 1, i + 8)) { - this.onError(Ms); + this.onCdata(s.substring(j + 8, q)); + j = q + 3; + } else if (s.substring(j + 1, j + 8) === "DOCTYPE") { + const q2 = s.indexOf("[", j + 8); + let complexDoctype = false; + q = s.indexOf(">", j + 8); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration); return; } - { - const a = e.indexOf("[", i + 8); - let s = !1; - t = e.indexOf(">", i + 8); - if (t < 0) { - this.onError(xs); + if (q2 > 0 && q > q2) { + q = s.indexOf("]>", j + 8); + if (q < 0) { + this.onError( + XMLParserErrorCode.UnterminatedDoctypeDeclaration, + ); return; } - if (a > 0 && t > a) { - t = e.indexOf("]>", i + 8); - if (t < 0) { - this.onError(xs); - return; - } - s = !0; - } - const r = e.substring(i + 8, t + (s ? 1 : 0)); - this.onDoctype(r); - i = t + (s ? 2 : 1); + complexDoctype = true; } + const doctypeContent = s.substring( + j + 8, + q + (complexDoctype ? 1 : 0), + ); + this.onDoctype(doctypeContent); + j = q + (complexDoctype ? 2 : 1); + } else { + this.onError(XMLParserErrorCode.MalformedElement); + return; } break; default: - const s = this._parseContent(e, i); - if (null === s) { - this.onError(Ms); + const content = this._parseContent(s, j); + if (content === null) { + this.onError(XMLParserErrorCode.MalformedElement); return; } - let r = !1; - if ("/>" === e.substring(i + s.parsed, i + s.parsed + 2)) r = !0; - else if (">" !== e.substring(i + s.parsed, i + s.parsed + 1)) { - this.onError(Ls); + let isClosed = false; + if ( + s.substring(j + content.parsed, j + content.parsed + 2) === "/>" + ) { + isClosed = true; + } else if ( + s.substring(j + content.parsed, j + content.parsed + 1) !== ">" + ) { + this.onError(XMLParserErrorCode.UnterminatedElement); return; } - this.onBeginElement(s.name, s.attributes, r); - i += s.parsed + (r ? 2 : 1); + this.onBeginElement(content.name, content.attributes, isClosed); + j += content.parsed + (isClosed ? 2 : 1); + break; } } else { - for (; i < e.length && "<" !== e[i]; ) i++; - const a = e.substring(t, i); - this.onText(this._resolveEntities(a)); + while (j < s.length && s[j] !== "<") { + j++; + } + const text = s.substring(i, j); + this.onText(this._resolveEntities(text)); } - t = i; + i = j; } } - onResolveEntity(e) { - return `&${e};`; + onResolveEntity(name) { + return `&${name};`; } - onPi(e, t) {} - onComment(e) {} - onCdata(e) {} - onDoctype(e) {} - onText(e) {} - onBeginElement(e, t, i) {} - onEndElement(e) {} - onError(e) {} + onPi(name, value) {} + onComment(text) {} + onCdata(text) {} + onDoctype(doctypeContent) {} + onText(text) {} + onBeginElement(name, attributes, isEmpty) {} + onEndElement(name) {} + onError(code) {} } class SimpleDOMNode { - constructor(e, t) { - this.nodeName = e; - this.nodeValue = t; - Object.defineProperty(this, "parentNode", { value: null, writable: !0 }); + constructor(nodeName, nodeValue) { + this.nodeName = nodeName; + this.nodeValue = nodeValue; + Object.defineProperty(this, "parentNode", { + value: null, + writable: true, + }); } get firstChild() { return this.childNodes?.[0]; } get nextSibling() { - const e = this.parentNode.childNodes; - if (!e) return; - const t = e.indexOf(this); - return -1 !== t ? e[t + 1] : void 0; + const childNodes = this.parentNode.childNodes; + if (!childNodes) { + return undefined; + } + const index = childNodes.indexOf(this); + if (index === -1) { + return undefined; + } + return childNodes[index + 1]; } get textContent() { + if (!this.childNodes) { + return this.nodeValue || ""; + } return this.childNodes - ? this.childNodes - .map(function (e) { - return e.textContent; - }) - .join("") - : this.nodeValue || ""; + .map(function (child) { + return child.textContent; + }) + .join(""); } get children() { return this.childNodes || []; @@ -37514,2523 +44969,3235 @@ class SimpleDOMNode { hasChildNodes() { return this.childNodes?.length > 0; } - searchNode(e, t) { - if (t >= e.length) return this; - const i = e[t]; - if (i.name.startsWith("#") && t < e.length - 1) - return this.searchNode(e, t + 1); - const a = []; - let s = this; - for (;;) { - if (i.name === s.nodeName) { - if (0 !== i.pos) { - if (0 === a.length) return null; - { - const [r] = a.pop(); - let n = 0; - for (const a of r.childNodes) - if (i.name === a.nodeName) { - if (n === i.pos) return a.searchNode(e, t + 1); - n++; - } - return s.searchNode(e, t + 1); + searchNode(paths, pos) { + if (pos >= paths.length) { + return this; + } + const component = paths[pos]; + if (component.name.startsWith("#") && pos < paths.length - 1) { + return this.searchNode(paths, pos + 1); + } + const stack = []; + let node = this; + while (true) { + if (component.name === node.nodeName) { + if (component.pos === 0) { + const res = node.searchNode(paths, pos + 1); + if (res !== null) { + return res; } - } - { - const i = s.searchNode(e, t + 1); - if (null !== i) return i; + } else if (stack.length === 0) { + return null; + } else { + const [parent] = stack.pop(); + let siblingPos = 0; + for (const child of parent.childNodes) { + if (component.name === child.nodeName) { + if (siblingPos === component.pos) { + return child.searchNode(paths, pos + 1); + } + siblingPos++; + } + } + return node.searchNode(paths, pos + 1); } } - if (s.childNodes?.length > 0) { - a.push([s, 0]); - s = s.childNodes[0]; + if (node.childNodes?.length > 0) { + stack.push([node, 0]); + node = node.childNodes[0]; + } else if (stack.length === 0) { + return null; } else { - if (0 === a.length) return null; - for (; 0 !== a.length; ) { - const [e, t] = a.pop(), - i = t + 1; - if (i < e.childNodes.length) { - a.push([e, i]); - s = e.childNodes[i]; + while (stack.length !== 0) { + const [parent, currentPos] = stack.pop(); + const newPos = currentPos + 1; + if (newPos < parent.childNodes.length) { + stack.push([parent, newPos]); + node = parent.childNodes[newPos]; break; } } - if (0 === a.length) return null; + if (stack.length === 0) { + return null; + } } } } - dump(e) { - if ("#text" !== this.nodeName) { - e.push(`<${this.nodeName}`); - if (this.attributes) - for (const t of this.attributes) - e.push(` ${t.name}="${encodeToXmlString(t.value)}"`); - if (this.hasChildNodes()) { - e.push(">"); - for (const t of this.childNodes) t.dump(e); - e.push(``); - } else - this.nodeValue - ? e.push(`>${encodeToXmlString(this.nodeValue)}`) - : e.push("/>"); - } else e.push(encodeToXmlString(this.nodeValue)); + dump(buffer) { + if (this.nodeName === "#text") { + buffer.push(encodeToXmlString(this.nodeValue)); + return; + } + buffer.push(`<${this.nodeName}`); + if (this.attributes) { + for (const attribute of this.attributes) { + buffer.push( + ` ${attribute.name}="${encodeToXmlString(attribute.value)}"`, + ); + } + } + if (this.hasChildNodes()) { + buffer.push(">"); + for (const child of this.childNodes) { + child.dump(buffer); + } + buffer.push(``); + } else if (this.nodeValue) { + buffer.push(`>${encodeToXmlString(this.nodeValue)}`); + } else { + buffer.push("/>"); + } } } class SimpleXMLParser extends XMLParserBase { - constructor({ hasAttributes: e = !1, lowerCaseName: t = !1 }) { + constructor({ hasAttributes = false, lowerCaseName = false }) { super(); this._currentFragment = null; this._stack = null; - this._errorCode = Rs; - this._hasAttributes = e; - this._lowerCaseName = t; + this._errorCode = XMLParserErrorCode.NoError; + this._hasAttributes = hasAttributes; + this._lowerCaseName = lowerCaseName; } - parseFromString(e) { + parseFromString(data) { this._currentFragment = []; this._stack = []; - this._errorCode = Rs; - this.parseXml(e); - if (this._errorCode !== Rs) return; - const [t] = this._currentFragment; - return t ? { documentElement: t } : void 0; + this._errorCode = XMLParserErrorCode.NoError; + this.parseXml(data); + if (this._errorCode !== XMLParserErrorCode.NoError) { + return undefined; + } + const [documentElement] = this._currentFragment; + if (!documentElement) { + return undefined; + } + return { + documentElement, + }; } - onText(e) { - if ( - (function isWhitespaceString(e) { - for (let t = 0, i = e.length; t < i; t++) - if (!isWhitespace(e, t)) return !1; - return !0; - })(e) - ) + onText(text) { + if (isWhitespaceString(text)) { return; - const t = new SimpleDOMNode("#text", e); - this._currentFragment.push(t); + } + const node = new SimpleDOMNode("#text", text); + this._currentFragment.push(node); } - onCdata(e) { - const t = new SimpleDOMNode("#text", e); - this._currentFragment.push(t); + onCdata(text) { + const node = new SimpleDOMNode("#text", text); + this._currentFragment.push(node); } - onBeginElement(e, t, i) { - this._lowerCaseName && (e = e.toLowerCase()); - const a = new SimpleDOMNode(e); - a.childNodes = []; - this._hasAttributes && (a.attributes = t); - this._currentFragment.push(a); - if (!i) { - this._stack.push(this._currentFragment); - this._currentFragment = a.childNodes; + onBeginElement(name, attributes, isEmpty) { + if (this._lowerCaseName) { + name = name.toLowerCase(); + } + const node = new SimpleDOMNode(name); + node.childNodes = []; + if (this._hasAttributes) { + node.attributes = attributes; + } + this._currentFragment.push(node); + if (isEmpty) { + return; + } + this._stack.push(this._currentFragment); + this._currentFragment = node.childNodes; + } + onEndElement(name) { + this._currentFragment = this._stack.pop() || []; + const lastElement = this._currentFragment.at(-1); + if (!lastElement) { + return null; + } + for (const childNode of lastElement.childNodes) { + childNode.parentNode = lastElement; + } + return lastElement; + } + onError(code) { + this._errorCode = code; + } +} // ./src/core/metadata_parser.js + +class MetadataParser { + constructor(data) { + data = this._repair(data); + const parser = new SimpleXMLParser({ + lowerCaseName: true, + }); + const xmlDocument = parser.parseFromString(data); + this._metadataMap = new Map(); + this._data = data; + if (xmlDocument) { + this._parse(xmlDocument); } } - onEndElement(e) { - this._currentFragment = this._stack.pop() || []; - const t = this._currentFragment.at(-1); - if (!t) return null; - for (const e of t.childNodes) e.parentNode = t; - return t; - } - onError(e) { - this._errorCode = e; - } -} -class MetadataParser { - constructor(e) { - e = this._repair(e); - const t = new SimpleXMLParser({ lowerCaseName: !0 }).parseFromString(e); - this._metadataMap = new Map(); - this._data = e; - t && this._parse(t); - } - _repair(e) { - return e + _repair(data) { + return data .replace(/^[^<]+/, "") - .replaceAll(/>\\376\\377([^<]+)/g, function (e, t) { - const i = t - .replaceAll(/\\([0-3])([0-7])([0-7])/g, function (e, t, i, a) { - return String.fromCharCode(64 * t + 8 * i + 1 * a); - }) - .replaceAll(/&(amp|apos|gt|lt|quot);/g, function (e, t) { - switch (t) { - case "amp": - return "&"; - case "apos": - return "'"; - case "gt": - return ">"; - case "lt": - return "<"; - case "quot": - return '"'; - } - throw new Error(`_repair: ${t} isn't defined.`); - }), - a = [">"]; - for (let e = 0, t = i.length; e < t; e += 2) { - const t = 256 * i.charCodeAt(e) + i.charCodeAt(e + 1); - t >= 32 && t < 127 && 60 !== t && 62 !== t && 38 !== t - ? a.push(String.fromCharCode(t)) - : a.push("&#x" + (65536 + t).toString(16).substring(1) + ";"); + .replaceAll(/>\\376\\377([^<]+)/g, function (all, codes) { + const bytes = codes + .replaceAll(/\\([0-3])([0-7])([0-7])/g, function (code, d1, d2, d3) { + return String.fromCharCode(d1 * 64 + d2 * 8 + d3 * 1); + }) + .replaceAll(/&(amp|apos|gt|lt|quot);/g, function (str, name) { + switch (name) { + case "amp": + return "&"; + case "apos": + return "'"; + case "gt": + return ">"; + case "lt": + return "<"; + case "quot": + return '"'; + } + throw new Error(`_repair: ${name} isn't defined.`); + }); + const charBuf = [">"]; + for (let i = 0, ii = bytes.length; i < ii; i += 2) { + const code = bytes.charCodeAt(i) * 256 + bytes.charCodeAt(i + 1); + if ( + code >= 32 && + code < 127 && + code !== 60 && + code !== 62 && + code !== 38 + ) { + charBuf.push(String.fromCharCode(code)); + } else { + charBuf.push( + "&#x" + (0x10000 + code).toString(16).substring(1) + ";", + ); + } } - return a.join(""); + return charBuf.join(""); }); } - _getSequence(e) { - const t = e.nodeName; - return "rdf:bag" !== t && "rdf:seq" !== t && "rdf:alt" !== t - ? null - : e.childNodes.filter((e) => "rdf:li" === e.nodeName); - } - _parseArray(e) { - if (!e.hasChildNodes()) return; - const [t] = e.childNodes, - i = this._getSequence(t) || []; - this._metadataMap.set( - e.nodeName, - i.map((e) => e.textContent.trim()), - ); - } - _parse(e) { - let t = e.documentElement; - if ("rdf:rdf" !== t.nodeName) { - t = t.firstChild; - for (; t && "rdf:rdf" !== t.nodeName; ) t = t.nextSibling; + _getSequence(entry) { + const name = entry.nodeName; + if (name !== "rdf:bag" && name !== "rdf:seq" && name !== "rdf:alt") { + return null; } - if (t && "rdf:rdf" === t.nodeName && t.hasChildNodes()) - for (const e of t.childNodes) - if ("rdf:description" === e.nodeName) - for (const t of e.childNodes) { - const e = t.nodeName; - switch (e) { - case "#text": - continue; - case "dc:creator": - case "dc:subject": - this._parseArray(t); - continue; - } - this._metadataMap.set(e, t.textContent.trim()); - } + return entry.childNodes.filter((node) => node.nodeName === "rdf:li"); } - get serializable() { - return { parsedData: this._metadataMap, rawData: this._data }; - } -} -class DecryptStream extends DecodeStream { - constructor(e, t, i) { - super(t); - this.str = e; - this.dict = e.dict; - this.decrypt = i; - this.nextChunk = null; - this.initialized = !1; - } - readBlock() { - let e; - if (this.initialized) e = this.nextChunk; - else { - e = this.str.getBytes(512); - this.initialized = !0; - } - if (!e || 0 === e.length) { - this.eof = !0; + _parseArray(entry) { + if (!entry.hasChildNodes()) { return; } - this.nextChunk = this.str.getBytes(512); - const t = this.nextChunk?.length > 0; - e = (0, this.decrypt)(e, !t); - const i = this.bufferLength, - a = i + e.length; - this.ensureBuffer(a).set(e, i); - this.bufferLength = a; + const [seqNode] = entry.childNodes; + const sequence = this._getSequence(seqNode) || []; + this._metadataMap.set( + entry.nodeName, + sequence.map((node) => node.textContent.trim()), + ); } -} + _parse(xmlDocument) { + let rdf = xmlDocument.documentElement; + if (rdf.nodeName !== "rdf:rdf") { + rdf = rdf.firstChild; + while (rdf && rdf.nodeName !== "rdf:rdf") { + rdf = rdf.nextSibling; + } + } + if (!rdf || rdf.nodeName !== "rdf:rdf" || !rdf.hasChildNodes()) { + return; + } + for (const desc of rdf.childNodes) { + if (desc.nodeName !== "rdf:description") { + continue; + } + for (const entry of desc.childNodes) { + const name = entry.nodeName; + switch (name) { + case "#text": + continue; + case "dc:creator": + case "dc:subject": + this._parseArray(entry); + continue; + } + this._metadataMap.set(name, entry.textContent.trim()); + } + } + } + get serializable() { + return { + parsedData: this._metadataMap, + rawData: this._data, + }; + } +} // ./src/core/decrypt_stream.js + +const chunkSize = 512; +class DecryptStream extends DecodeStream { + constructor(str, maybeLength, decrypt) { + super(maybeLength); + this.str = str; + this.dict = str.dict; + this.decrypt = decrypt; + this.nextChunk = null; + this.initialized = false; + } + readBlock() { + let chunk; + if (this.initialized) { + chunk = this.nextChunk; + } else { + chunk = this.str.getBytes(chunkSize); + this.initialized = true; + } + if (!chunk || chunk.length === 0) { + this.eof = true; + return; + } + this.nextChunk = this.str.getBytes(chunkSize); + const hasMoreData = this.nextChunk?.length > 0; + const decrypt = this.decrypt; + chunk = decrypt(chunk, !hasMoreData); + const bufferLength = this.bufferLength, + newLength = bufferLength + chunk.length, + buffer = this.ensureBuffer(newLength); + buffer.set(chunk, bufferLength); + this.bufferLength = newLength; + } +} // ./src/core/crypto.js + class ARCFourCipher { - constructor(e) { + constructor(key) { this.a = 0; this.b = 0; - const t = new Uint8Array(256), - i = e.length; - for (let e = 0; e < 256; ++e) t[e] = e; - for (let a = 0, s = 0; a < 256; ++a) { - const r = t[a]; - s = (s + r + e[a % i]) & 255; - t[a] = t[s]; - t[s] = r; + const s = new Uint8Array(256); + const keyLength = key.length; + for (let i = 0; i < 256; ++i) { + s[i] = i; } - this.s = t; - } - encryptBlock(e) { - let t = this.a, - i = this.b; - const a = this.s, - s = e.length, - r = new Uint8Array(s); - for (let n = 0; n < s; ++n) { - t = (t + 1) & 255; - const s = a[t]; - i = (i + s) & 255; - const g = a[i]; - a[t] = g; - a[i] = s; - r[n] = e[n] ^ a[(s + g) & 255]; + for (let i = 0, j = 0; i < 256; ++i) { + const tmp = s[i]; + j = (j + tmp + key[i % keyLength]) & 0xff; + s[i] = s[j]; + s[j] = tmp; } - this.a = t; - this.b = i; - return r; + this.s = s; } - decryptBlock(e) { - return this.encryptBlock(e); + encryptBlock(data) { + let a = this.a, + b = this.b; + const s = this.s; + const n = data.length; + const output = new Uint8Array(n); + for (let i = 0; i < n; ++i) { + a = (a + 1) & 0xff; + const tmp = s[a]; + b = (b + tmp) & 0xff; + const tmp2 = s[b]; + s[a] = tmp2; + s[b] = tmp; + output[i] = data[i] ^ s[(tmp + tmp2) & 0xff]; + } + this.a = a; + this.b = b; + return output; } - encrypt(e) { - return this.encryptBlock(e); + decryptBlock(data) { + return this.encryptBlock(data); + } + encrypt(data) { + return this.encryptBlock(data); } } -const Hs = (function calculateMD5Closure() { - const e = new Uint8Array([ - 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, - 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, - 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, - 10, 15, 21, - ]), - t = new Int32Array([ - -680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, - -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, - 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, - 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, - 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, - 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, - -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, - -722521979, 76029189, -640364487, -421815835, 530742520, -995338651, - -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, - -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, - -145523070, -1120210379, 718787259, -343485551, - ]); - return function hash(i, a, s) { - let r = 1732584193, - n = -271733879, - g = -1732584194, - o = 271733878; - const c = (s + 72) & -64, - C = new Uint8Array(c); - let h, l; - for (h = 0; h < s; ++h) C[h] = i[a++]; - C[h++] = 128; - const Q = c - 8; - for (; h < Q; ) C[h++] = 0; - C[h++] = (s << 3) & 255; - C[h++] = (s >> 5) & 255; - C[h++] = (s >> 13) & 255; - C[h++] = (s >> 21) & 255; - C[h++] = (s >>> 29) & 255; - C[h++] = 0; - C[h++] = 0; - C[h++] = 0; - const E = new Int32Array(16); - for (h = 0; h < c; ) { - for (l = 0; l < 16; ++l, h += 4) - E[l] = C[h] | (C[h + 1] << 8) | (C[h + 2] << 16) | (C[h + 3] << 24); - let i, - a, - s = r, - c = n, - Q = g, - u = o; - for (l = 0; l < 64; ++l) { - if (l < 16) { - i = (c & Q) | (~c & u); - a = l; - } else if (l < 32) { - i = (u & c) | (~u & Q); - a = (5 * l + 1) & 15; - } else if (l < 48) { - i = c ^ Q ^ u; - a = (3 * l + 5) & 15; - } else { - i = Q ^ (c | ~u); - a = (7 * l) & 15; - } - const r = u, - n = (s + i + t[l] + E[a]) | 0, - g = e[l]; - u = Q; - Q = c; - c = (c + ((n << g) | (n >>> (32 - g)))) | 0; - s = r; +const calculateMD5 = (function calculateMD5Closure() { + const r = new Uint8Array([ + 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, + 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, + 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, + 15, 21, + ]); + const k = new Int32Array([ + -680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, + -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, + 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, + 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, + 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, + 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, + -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, + -722521979, 76029189, -640364487, -421815835, 530742520, -995338651, + -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, + -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, + -145523070, -1120210379, 718787259, -343485551, + ]); + function hash(data, offset, length) { + let h0 = 1732584193, + h1 = -271733879, + h2 = -1732584194, + h3 = 271733878; + const paddedLength = (length + 72) & ~63; + const padded = new Uint8Array(paddedLength); + let i, j; + for (i = 0; i < length; ++i) { + padded[i] = data[offset++]; + } + padded[i++] = 0x80; + const n = paddedLength - 8; + while (i < n) { + padded[i++] = 0; + } + padded[i++] = (length << 3) & 0xff; + padded[i++] = (length >> 5) & 0xff; + padded[i++] = (length >> 13) & 0xff; + padded[i++] = (length >> 21) & 0xff; + padded[i++] = (length >>> 29) & 0xff; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + const w = new Int32Array(16); + for (i = 0; i < paddedLength; ) { + for (j = 0; j < 16; ++j, i += 4) { + w[j] = + padded[i] | + (padded[i + 1] << 8) | + (padded[i + 2] << 16) | + (padded[i + 3] << 24); } - r = (r + s) | 0; - n = (n + c) | 0; - g = (g + Q) | 0; - o = (o + u) | 0; + let a = h0, + b = h1, + c = h2, + d = h3, + f, + g; + for (j = 0; j < 64; ++j) { + if (j < 16) { + f = (b & c) | (~b & d); + g = j; + } else if (j < 32) { + f = (d & b) | (~d & c); + g = (5 * j + 1) & 15; + } else if (j < 48) { + f = b ^ c ^ d; + g = (3 * j + 5) & 15; + } else { + f = c ^ (b | ~d); + g = (7 * j) & 15; + } + const tmp = d, + rotateArg = (a + f + k[j] + w[g]) | 0, + rotate = r[j]; + d = c; + c = b; + b = (b + ((rotateArg << rotate) | (rotateArg >>> (32 - rotate)))) | 0; + a = tmp; + } + h0 = (h0 + a) | 0; + h1 = (h1 + b) | 0; + h2 = (h2 + c) | 0; + h3 = (h3 + d) | 0; } return new Uint8Array([ - 255 & r, - (r >> 8) & 255, - (r >> 16) & 255, - (r >>> 24) & 255, - 255 & n, - (n >> 8) & 255, - (n >> 16) & 255, - (n >>> 24) & 255, - 255 & g, - (g >> 8) & 255, - (g >> 16) & 255, - (g >>> 24) & 255, - 255 & o, - (o >> 8) & 255, - (o >> 16) & 255, - (o >>> 24) & 255, + h0 & 0xff, + (h0 >> 8) & 0xff, + (h0 >> 16) & 0xff, + (h0 >>> 24) & 0xff, + h1 & 0xff, + (h1 >> 8) & 0xff, + (h1 >> 16) & 0xff, + (h1 >>> 24) & 0xff, + h2 & 0xff, + (h2 >> 8) & 0xff, + (h2 >> 16) & 0xff, + (h2 >>> 24) & 0xff, + h3 & 0xff, + (h3 >> 8) & 0xff, + (h3 >> 16) & 0xff, + (h3 >>> 24) & 0xff, ]); - }; + } + return hash; })(); class Word64 { - constructor(e, t) { - this.high = 0 | e; - this.low = 0 | t; + constructor(highInteger, lowInteger) { + this.high = highInteger | 0; + this.low = lowInteger | 0; } - and(e) { - this.high &= e.high; - this.low &= e.low; + and(word) { + this.high &= word.high; + this.low &= word.low; } - xor(e) { - this.high ^= e.high; - this.low ^= e.low; + xor(word) { + this.high ^= word.high; + this.low ^= word.low; } - or(e) { - this.high |= e.high; - this.low |= e.low; + or(word) { + this.high |= word.high; + this.low |= word.low; } - shiftRight(e) { - if (e >= 32) { - this.low = (this.high >>> (e - 32)) | 0; + shiftRight(places) { + if (places >= 32) { + this.low = (this.high >>> (places - 32)) | 0; this.high = 0; } else { - this.low = (this.low >>> e) | (this.high << (32 - e)); - this.high = (this.high >>> e) | 0; + this.low = (this.low >>> places) | (this.high << (32 - places)); + this.high = (this.high >>> places) | 0; } } - shiftLeft(e) { - if (e >= 32) { - this.high = this.low << (e - 32); + shiftLeft(places) { + if (places >= 32) { + this.high = this.low << (places - 32); this.low = 0; } else { - this.high = (this.high << e) | (this.low >>> (32 - e)); - this.low <<= e; + this.high = (this.high << places) | (this.low >>> (32 - places)); + this.low <<= places; } } - rotateRight(e) { - let t, i; - if (32 & e) { - i = this.low; - t = this.high; + rotateRight(places) { + let low, high; + if (places & 32) { + high = this.low; + low = this.high; } else { - t = this.low; - i = this.high; + low = this.low; + high = this.high; } - e &= 31; - this.low = (t >>> e) | (i << (32 - e)); - this.high = (i >>> e) | (t << (32 - e)); + places &= 31; + this.low = (low >>> places) | (high << (32 - places)); + this.high = (high >>> places) | (low << (32 - places)); } not() { this.high = ~this.high; this.low = ~this.low; } - add(e) { - const t = (this.low >>> 0) + (e.low >>> 0); - let i = (this.high >>> 0) + (e.high >>> 0); - t > 4294967295 && (i += 1); - this.low = 0 | t; - this.high = 0 | i; + add(word) { + const lowAdd = (this.low >>> 0) + (word.low >>> 0); + let highAdd = (this.high >>> 0) + (word.high >>> 0); + if (lowAdd > 0xffffffff) { + highAdd += 1; + } + this.low = lowAdd | 0; + this.high = highAdd | 0; } - copyTo(e, t) { - e[t] = (this.high >>> 24) & 255; - e[t + 1] = (this.high >> 16) & 255; - e[t + 2] = (this.high >> 8) & 255; - e[t + 3] = 255 & this.high; - e[t + 4] = (this.low >>> 24) & 255; - e[t + 5] = (this.low >> 16) & 255; - e[t + 6] = (this.low >> 8) & 255; - e[t + 7] = 255 & this.low; + copyTo(bytes, offset) { + bytes[offset] = (this.high >>> 24) & 0xff; + bytes[offset + 1] = (this.high >> 16) & 0xff; + bytes[offset + 2] = (this.high >> 8) & 0xff; + bytes[offset + 3] = this.high & 0xff; + bytes[offset + 4] = (this.low >>> 24) & 0xff; + bytes[offset + 5] = (this.low >> 16) & 0xff; + bytes[offset + 6] = (this.low >> 8) & 0xff; + bytes[offset + 7] = this.low & 0xff; } - assign(e) { - this.high = e.high; - this.low = e.low; + assign(word) { + this.high = word.high; + this.low = word.low; } } -const Js = (function calculateSHA256Closure() { - function rotr(e, t) { - return (e >>> t) | (e << (32 - t)); - } - function ch(e, t, i) { - return (e & t) ^ (~e & i); - } - function maj(e, t, i) { - return (e & t) ^ (e & i) ^ (t & i); - } - function sigma(e) { - return rotr(e, 2) ^ rotr(e, 13) ^ rotr(e, 22); - } - function sigmaPrime(e) { - return rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25); - } - function littleSigma(e) { - return rotr(e, 7) ^ rotr(e, 18) ^ (e >>> 3); - } - const e = [ - 1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, - 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, - 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, - 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, - 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, - 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, - 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, - 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, - 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, - 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, - 2428436474, 2756734187, 3204031479, 3329325298, - ]; - return function hash(t, i, a) { - let s = 1779033703, - r = 3144134277, - n = 1013904242, - g = 2773480762, - o = 1359893119, - c = 2600822924, - C = 528734635, - h = 1541459225; - const l = 64 * Math.ceil((a + 9) / 64), - Q = new Uint8Array(l); - let E, u; - for (E = 0; E < a; ++E) Q[E] = t[i++]; - Q[E++] = 128; - const d = l - 8; - for (; E < d; ) Q[E++] = 0; - Q[E++] = 0; - Q[E++] = 0; - Q[E++] = 0; - Q[E++] = (a >>> 29) & 255; - Q[E++] = (a >> 21) & 255; - Q[E++] = (a >> 13) & 255; - Q[E++] = (a >> 5) & 255; - Q[E++] = (a << 3) & 255; - const f = new Uint32Array(64); - for (E = 0; E < l; ) { - for (u = 0; u < 16; ++u) { - f[u] = (Q[E] << 24) | (Q[E + 1] << 16) | (Q[E + 2] << 8) | Q[E + 3]; - E += 4; - } - for (u = 16; u < 64; ++u) - f[u] = - ((rotr((p = f[u - 2]), 17) ^ rotr(p, 19) ^ (p >>> 10)) + - f[u - 7] + - littleSigma(f[u - 15]) + - f[u - 16]) | - 0; - let t, - i, - a = s, - l = r, - d = n, - m = g, - y = o, - w = c, - D = C, - b = h; - for (u = 0; u < 64; ++u) { - t = b + sigmaPrime(y) + ch(y, w, D) + e[u] + f[u]; - i = sigma(a) + maj(a, l, d); - b = D; - D = w; - w = y; - y = (m + t) | 0; - m = d; - d = l; - l = a; - a = (t + i) | 0; - } - s = (s + a) | 0; - r = (r + l) | 0; - n = (n + d) | 0; - g = (g + m) | 0; - o = (o + y) | 0; - c = (c + w) | 0; - C = (C + D) | 0; - h = (h + b) | 0; - } - var p; - return new Uint8Array([ - (s >> 24) & 255, - (s >> 16) & 255, - (s >> 8) & 255, - 255 & s, - (r >> 24) & 255, - (r >> 16) & 255, - (r >> 8) & 255, - 255 & r, - (n >> 24) & 255, - (n >> 16) & 255, - (n >> 8) & 255, - 255 & n, - (g >> 24) & 255, - (g >> 16) & 255, - (g >> 8) & 255, - 255 & g, - (o >> 24) & 255, - (o >> 16) & 255, - (o >> 8) & 255, - 255 & o, - (c >> 24) & 255, - (c >> 16) & 255, - (c >> 8) & 255, - 255 & c, - (C >> 24) & 255, - (C >> 16) & 255, - (C >> 8) & 255, - 255 & C, - (h >> 24) & 255, - (h >> 16) & 255, - (h >> 8) & 255, - 255 & h, - ]); - }; - })(), - Ys = (function calculateSHA512Closure() { - function ch(e, t, i, a, s) { - e.assign(t); - e.and(i); - s.assign(t); - s.not(); - s.and(a); - e.xor(s); - } - function maj(e, t, i, a, s) { - e.assign(t); - e.and(i); - s.assign(t); - s.and(a); - e.xor(s); - s.assign(i); - s.and(a); - e.xor(s); - } - function sigma(e, t, i) { - e.assign(t); - e.rotateRight(28); - i.assign(t); - i.rotateRight(34); - e.xor(i); - i.assign(t); - i.rotateRight(39); - e.xor(i); - } - function sigmaPrime(e, t, i) { - e.assign(t); - e.rotateRight(14); - i.assign(t); - i.rotateRight(18); - e.xor(i); - i.assign(t); - i.rotateRight(41); - e.xor(i); - } - function littleSigma(e, t, i) { - e.assign(t); - e.rotateRight(1); - i.assign(t); - i.rotateRight(8); - e.xor(i); - i.assign(t); - i.shiftRight(7); - e.xor(i); - } - function littleSigmaPrime(e, t, i) { - e.assign(t); - e.rotateRight(19); - i.assign(t); - i.rotateRight(61); - e.xor(i); - i.assign(t); - i.shiftRight(6); - e.xor(i); - } - const e = [ - new Word64(1116352408, 3609767458), - new Word64(1899447441, 602891725), - new Word64(3049323471, 3964484399), - new Word64(3921009573, 2173295548), - new Word64(961987163, 4081628472), - new Word64(1508970993, 3053834265), - new Word64(2453635748, 2937671579), - new Word64(2870763221, 3664609560), - new Word64(3624381080, 2734883394), - new Word64(310598401, 1164996542), - new Word64(607225278, 1323610764), - new Word64(1426881987, 3590304994), - new Word64(1925078388, 4068182383), - new Word64(2162078206, 991336113), - new Word64(2614888103, 633803317), - new Word64(3248222580, 3479774868), - new Word64(3835390401, 2666613458), - new Word64(4022224774, 944711139), - new Word64(264347078, 2341262773), - new Word64(604807628, 2007800933), - new Word64(770255983, 1495990901), - new Word64(1249150122, 1856431235), - new Word64(1555081692, 3175218132), - new Word64(1996064986, 2198950837), - new Word64(2554220882, 3999719339), - new Word64(2821834349, 766784016), - new Word64(2952996808, 2566594879), - new Word64(3210313671, 3203337956), - new Word64(3336571891, 1034457026), - new Word64(3584528711, 2466948901), - new Word64(113926993, 3758326383), - new Word64(338241895, 168717936), - new Word64(666307205, 1188179964), - new Word64(773529912, 1546045734), - new Word64(1294757372, 1522805485), - new Word64(1396182291, 2643833823), - new Word64(1695183700, 2343527390), - new Word64(1986661051, 1014477480), - new Word64(2177026350, 1206759142), - new Word64(2456956037, 344077627), - new Word64(2730485921, 1290863460), - new Word64(2820302411, 3158454273), - new Word64(3259730800, 3505952657), - new Word64(3345764771, 106217008), - new Word64(3516065817, 3606008344), - new Word64(3600352804, 1432725776), - new Word64(4094571909, 1467031594), - new Word64(275423344, 851169720), - new Word64(430227734, 3100823752), - new Word64(506948616, 1363258195), - new Word64(659060556, 3750685593), - new Word64(883997877, 3785050280), - new Word64(958139571, 3318307427), - new Word64(1322822218, 3812723403), - new Word64(1537002063, 2003034995), - new Word64(1747873779, 3602036899), - new Word64(1955562222, 1575990012), - new Word64(2024104815, 1125592928), - new Word64(2227730452, 2716904306), - new Word64(2361852424, 442776044), - new Word64(2428436474, 593698344), - new Word64(2756734187, 3733110249), - new Word64(3204031479, 2999351573), - new Word64(3329325298, 3815920427), - new Word64(3391569614, 3928383900), - new Word64(3515267271, 566280711), - new Word64(3940187606, 3454069534), - new Word64(4118630271, 4000239992), - new Word64(116418474, 1914138554), - new Word64(174292421, 2731055270), - new Word64(289380356, 3203993006), - new Word64(460393269, 320620315), - new Word64(685471733, 587496836), - new Word64(852142971, 1086792851), - new Word64(1017036298, 365543100), - new Word64(1126000580, 2618297676), - new Word64(1288033470, 3409855158), - new Word64(1501505948, 4234509866), - new Word64(1607167915, 987167468), - new Word64(1816402316, 1246189591), - ]; - return function hash(t, i, a, s = !1) { - let r, n, g, o, c, C, h, l; - if (s) { - r = new Word64(3418070365, 3238371032); - n = new Word64(1654270250, 914150663); - g = new Word64(2438529370, 812702999); - o = new Word64(355462360, 4144912697); - c = new Word64(1731405415, 4290775857); - C = new Word64(2394180231, 1750603025); - h = new Word64(3675008525, 1694076839); - l = new Word64(1203062813, 3204075428); - } else { - r = new Word64(1779033703, 4089235720); - n = new Word64(3144134277, 2227873595); - g = new Word64(1013904242, 4271175723); - o = new Word64(2773480762, 1595750129); - c = new Word64(1359893119, 2917565137); - C = new Word64(2600822924, 725511199); - h = new Word64(528734635, 4215389547); - l = new Word64(1541459225, 327033209); - } - const Q = 128 * Math.ceil((a + 17) / 128), - E = new Uint8Array(Q); - let u, d; - for (u = 0; u < a; ++u) E[u] = t[i++]; - E[u++] = 128; - const f = Q - 16; - for (; u < f; ) E[u++] = 0; - E[u++] = 0; - E[u++] = 0; - E[u++] = 0; - E[u++] = 0; - E[u++] = 0; - E[u++] = 0; - E[u++] = 0; - E[u++] = 0; - E[u++] = 0; - E[u++] = 0; - E[u++] = 0; - E[u++] = (a >>> 29) & 255; - E[u++] = (a >> 21) & 255; - E[u++] = (a >> 13) & 255; - E[u++] = (a >> 5) & 255; - E[u++] = (a << 3) & 255; - const p = new Array(80); - for (u = 0; u < 80; u++) p[u] = new Word64(0, 0); - let m = new Word64(0, 0), - y = new Word64(0, 0), - w = new Word64(0, 0), - D = new Word64(0, 0), - b = new Word64(0, 0), - F = new Word64(0, 0), - S = new Word64(0, 0), - k = new Word64(0, 0); - const R = new Word64(0, 0), - N = new Word64(0, 0), - G = new Word64(0, 0), - x = new Word64(0, 0); - let U, M; - for (u = 0; u < Q; ) { - for (d = 0; d < 16; ++d) { - p[d].high = - (E[u] << 24) | (E[u + 1] << 16) | (E[u + 2] << 8) | E[u + 3]; - p[d].low = - (E[u + 4] << 24) | (E[u + 5] << 16) | (E[u + 6] << 8) | E[u + 7]; - u += 8; - } - for (d = 16; d < 80; ++d) { - U = p[d]; - littleSigmaPrime(U, p[d - 2], x); - U.add(p[d - 7]); - littleSigma(G, p[d - 15], x); - U.add(G); - U.add(p[d - 16]); - } - m.assign(r); - y.assign(n); - w.assign(g); - D.assign(o); - b.assign(c); - F.assign(C); - S.assign(h); - k.assign(l); - for (d = 0; d < 80; ++d) { - R.assign(k); - sigmaPrime(G, b, x); - R.add(G); - ch(G, b, F, S, x); - R.add(G); - R.add(e[d]); - R.add(p[d]); - sigma(N, m, x); - maj(G, m, y, w, x); - N.add(G); - U = k; - k = S; - S = F; - F = b; - D.add(R); - b = D; - D = w; - w = y; - y = m; - U.assign(R); - U.add(N); - m = U; - } - r.add(m); - n.add(y); - g.add(w); - o.add(D); - c.add(b); - C.add(F); - h.add(S); - l.add(k); - } - if (s) { - M = new Uint8Array(48); - r.copyTo(M, 0); - n.copyTo(M, 8); - g.copyTo(M, 16); - o.copyTo(M, 24); - c.copyTo(M, 32); - C.copyTo(M, 40); - } else { - M = new Uint8Array(64); - r.copyTo(M, 0); - n.copyTo(M, 8); - g.copyTo(M, 16); - o.copyTo(M, 24); - c.copyTo(M, 32); - C.copyTo(M, 40); - h.copyTo(M, 48); - l.copyTo(M, 56); - } - return M; - }; - })(); -class NullCipher { - decryptBlock(e) { - return e; +const calculateSHA256 = (function calculateSHA256Closure() { + function rotr(x, n) { + return (x >>> n) | (x << (32 - n)); } - encrypt(e) { - return e; + function ch(x, y, z) { + return (x & y) ^ (~x & z); + } + function maj(x, y, z) { + return (x & y) ^ (x & z) ^ (y & z); + } + function sigma(x) { + return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22); + } + function sigmaPrime(x) { + return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25); + } + function littleSigma(x) { + return rotr(x, 7) ^ rotr(x, 18) ^ (x >>> 3); + } + function littleSigmaPrime(x) { + return rotr(x, 17) ^ rotr(x, 19) ^ (x >>> 10); + } + const k = [ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, + 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, + 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, + 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, + 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, + 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2, + ]; + function hash(data, offset, length) { + let h0 = 0x6a09e667, + h1 = 0xbb67ae85, + h2 = 0x3c6ef372, + h3 = 0xa54ff53a, + h4 = 0x510e527f, + h5 = 0x9b05688c, + h6 = 0x1f83d9ab, + h7 = 0x5be0cd19; + const paddedLength = Math.ceil((length + 9) / 64) * 64; + const padded = new Uint8Array(paddedLength); + let i, j; + for (i = 0; i < length; ++i) { + padded[i] = data[offset++]; + } + padded[i++] = 0x80; + const n = paddedLength - 8; + while (i < n) { + padded[i++] = 0; + } + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = (length >>> 29) & 0xff; + padded[i++] = (length >> 21) & 0xff; + padded[i++] = (length >> 13) & 0xff; + padded[i++] = (length >> 5) & 0xff; + padded[i++] = (length << 3) & 0xff; + const w = new Uint32Array(64); + for (i = 0; i < paddedLength; ) { + for (j = 0; j < 16; ++j) { + w[j] = + (padded[i] << 24) | + (padded[i + 1] << 16) | + (padded[i + 2] << 8) | + padded[i + 3]; + i += 4; + } + for (j = 16; j < 64; ++j) { + w[j] = + (littleSigmaPrime(w[j - 2]) + + w[j - 7] + + littleSigma(w[j - 15]) + + w[j - 16]) | + 0; + } + let a = h0, + b = h1, + c = h2, + d = h3, + e = h4, + f = h5, + g = h6, + h = h7, + t1, + t2; + for (j = 0; j < 64; ++j) { + t1 = h + sigmaPrime(e) + ch(e, f, g) + k[j] + w[j]; + t2 = sigma(a) + maj(a, b, c); + h = g; + g = f; + f = e; + e = (d + t1) | 0; + d = c; + c = b; + b = a; + a = (t1 + t2) | 0; + } + h0 = (h0 + a) | 0; + h1 = (h1 + b) | 0; + h2 = (h2 + c) | 0; + h3 = (h3 + d) | 0; + h4 = (h4 + e) | 0; + h5 = (h5 + f) | 0; + h6 = (h6 + g) | 0; + h7 = (h7 + h) | 0; + } + return new Uint8Array([ + (h0 >> 24) & 0xff, + (h0 >> 16) & 0xff, + (h0 >> 8) & 0xff, + h0 & 0xff, + (h1 >> 24) & 0xff, + (h1 >> 16) & 0xff, + (h1 >> 8) & 0xff, + h1 & 0xff, + (h2 >> 24) & 0xff, + (h2 >> 16) & 0xff, + (h2 >> 8) & 0xff, + h2 & 0xff, + (h3 >> 24) & 0xff, + (h3 >> 16) & 0xff, + (h3 >> 8) & 0xff, + h3 & 0xff, + (h4 >> 24) & 0xff, + (h4 >> 16) & 0xff, + (h4 >> 8) & 0xff, + h4 & 0xff, + (h5 >> 24) & 0xff, + (h5 >> 16) & 0xff, + (h5 >> 8) & 0xff, + h5 & 0xff, + (h6 >> 24) & 0xff, + (h6 >> 16) & 0xff, + (h6 >> 8) & 0xff, + h6 & 0xff, + (h7 >> 24) & 0xff, + (h7 >> 16) & 0xff, + (h7 >> 8) & 0xff, + h7 & 0xff, + ]); + } + return hash; +})(); +const calculateSHA512 = (function calculateSHA512Closure() { + function ch(result, x, y, z, tmp) { + result.assign(x); + result.and(y); + tmp.assign(x); + tmp.not(); + tmp.and(z); + result.xor(tmp); + } + function maj(result, x, y, z, tmp) { + result.assign(x); + result.and(y); + tmp.assign(x); + tmp.and(z); + result.xor(tmp); + tmp.assign(y); + tmp.and(z); + result.xor(tmp); + } + function sigma(result, x, tmp) { + result.assign(x); + result.rotateRight(28); + tmp.assign(x); + tmp.rotateRight(34); + result.xor(tmp); + tmp.assign(x); + tmp.rotateRight(39); + result.xor(tmp); + } + function sigmaPrime(result, x, tmp) { + result.assign(x); + result.rotateRight(14); + tmp.assign(x); + tmp.rotateRight(18); + result.xor(tmp); + tmp.assign(x); + tmp.rotateRight(41); + result.xor(tmp); + } + function littleSigma(result, x, tmp) { + result.assign(x); + result.rotateRight(1); + tmp.assign(x); + tmp.rotateRight(8); + result.xor(tmp); + tmp.assign(x); + tmp.shiftRight(7); + result.xor(tmp); + } + function littleSigmaPrime(result, x, tmp) { + result.assign(x); + result.rotateRight(19); + tmp.assign(x); + tmp.rotateRight(61); + result.xor(tmp); + tmp.assign(x); + tmp.shiftRight(6); + result.xor(tmp); + } + const k = [ + new Word64(0x428a2f98, 0xd728ae22), + new Word64(0x71374491, 0x23ef65cd), + new Word64(0xb5c0fbcf, 0xec4d3b2f), + new Word64(0xe9b5dba5, 0x8189dbbc), + new Word64(0x3956c25b, 0xf348b538), + new Word64(0x59f111f1, 0xb605d019), + new Word64(0x923f82a4, 0xaf194f9b), + new Word64(0xab1c5ed5, 0xda6d8118), + new Word64(0xd807aa98, 0xa3030242), + new Word64(0x12835b01, 0x45706fbe), + new Word64(0x243185be, 0x4ee4b28c), + new Word64(0x550c7dc3, 0xd5ffb4e2), + new Word64(0x72be5d74, 0xf27b896f), + new Word64(0x80deb1fe, 0x3b1696b1), + new Word64(0x9bdc06a7, 0x25c71235), + new Word64(0xc19bf174, 0xcf692694), + new Word64(0xe49b69c1, 0x9ef14ad2), + new Word64(0xefbe4786, 0x384f25e3), + new Word64(0x0fc19dc6, 0x8b8cd5b5), + new Word64(0x240ca1cc, 0x77ac9c65), + new Word64(0x2de92c6f, 0x592b0275), + new Word64(0x4a7484aa, 0x6ea6e483), + new Word64(0x5cb0a9dc, 0xbd41fbd4), + new Word64(0x76f988da, 0x831153b5), + new Word64(0x983e5152, 0xee66dfab), + new Word64(0xa831c66d, 0x2db43210), + new Word64(0xb00327c8, 0x98fb213f), + new Word64(0xbf597fc7, 0xbeef0ee4), + new Word64(0xc6e00bf3, 0x3da88fc2), + new Word64(0xd5a79147, 0x930aa725), + new Word64(0x06ca6351, 0xe003826f), + new Word64(0x14292967, 0x0a0e6e70), + new Word64(0x27b70a85, 0x46d22ffc), + new Word64(0x2e1b2138, 0x5c26c926), + new Word64(0x4d2c6dfc, 0x5ac42aed), + new Word64(0x53380d13, 0x9d95b3df), + new Word64(0x650a7354, 0x8baf63de), + new Word64(0x766a0abb, 0x3c77b2a8), + new Word64(0x81c2c92e, 0x47edaee6), + new Word64(0x92722c85, 0x1482353b), + new Word64(0xa2bfe8a1, 0x4cf10364), + new Word64(0xa81a664b, 0xbc423001), + new Word64(0xc24b8b70, 0xd0f89791), + new Word64(0xc76c51a3, 0x0654be30), + new Word64(0xd192e819, 0xd6ef5218), + new Word64(0xd6990624, 0x5565a910), + new Word64(0xf40e3585, 0x5771202a), + new Word64(0x106aa070, 0x32bbd1b8), + new Word64(0x19a4c116, 0xb8d2d0c8), + new Word64(0x1e376c08, 0x5141ab53), + new Word64(0x2748774c, 0xdf8eeb99), + new Word64(0x34b0bcb5, 0xe19b48a8), + new Word64(0x391c0cb3, 0xc5c95a63), + new Word64(0x4ed8aa4a, 0xe3418acb), + new Word64(0x5b9cca4f, 0x7763e373), + new Word64(0x682e6ff3, 0xd6b2b8a3), + new Word64(0x748f82ee, 0x5defb2fc), + new Word64(0x78a5636f, 0x43172f60), + new Word64(0x84c87814, 0xa1f0ab72), + new Word64(0x8cc70208, 0x1a6439ec), + new Word64(0x90befffa, 0x23631e28), + new Word64(0xa4506ceb, 0xde82bde9), + new Word64(0xbef9a3f7, 0xb2c67915), + new Word64(0xc67178f2, 0xe372532b), + new Word64(0xca273ece, 0xea26619c), + new Word64(0xd186b8c7, 0x21c0c207), + new Word64(0xeada7dd6, 0xcde0eb1e), + new Word64(0xf57d4f7f, 0xee6ed178), + new Word64(0x06f067aa, 0x72176fba), + new Word64(0x0a637dc5, 0xa2c898a6), + new Word64(0x113f9804, 0xbef90dae), + new Word64(0x1b710b35, 0x131c471b), + new Word64(0x28db77f5, 0x23047d84), + new Word64(0x32caab7b, 0x40c72493), + new Word64(0x3c9ebe0a, 0x15c9bebc), + new Word64(0x431d67c4, 0x9c100d4c), + new Word64(0x4cc5d4be, 0xcb3e42b6), + new Word64(0x597f299c, 0xfc657e2a), + new Word64(0x5fcb6fab, 0x3ad6faec), + new Word64(0x6c44198c, 0x4a475817), + ]; + function hash(data, offset, length, mode384 = false) { + let h0, h1, h2, h3, h4, h5, h6, h7; + if (!mode384) { + h0 = new Word64(0x6a09e667, 0xf3bcc908); + h1 = new Word64(0xbb67ae85, 0x84caa73b); + h2 = new Word64(0x3c6ef372, 0xfe94f82b); + h3 = new Word64(0xa54ff53a, 0x5f1d36f1); + h4 = new Word64(0x510e527f, 0xade682d1); + h5 = new Word64(0x9b05688c, 0x2b3e6c1f); + h6 = new Word64(0x1f83d9ab, 0xfb41bd6b); + h7 = new Word64(0x5be0cd19, 0x137e2179); + } else { + h0 = new Word64(0xcbbb9d5d, 0xc1059ed8); + h1 = new Word64(0x629a292a, 0x367cd507); + h2 = new Word64(0x9159015a, 0x3070dd17); + h3 = new Word64(0x152fecd8, 0xf70e5939); + h4 = new Word64(0x67332667, 0xffc00b31); + h5 = new Word64(0x8eb44a87, 0x68581511); + h6 = new Word64(0xdb0c2e0d, 0x64f98fa7); + h7 = new Word64(0x47b5481d, 0xbefa4fa4); + } + const paddedLength = Math.ceil((length + 17) / 128) * 128; + const padded = new Uint8Array(paddedLength); + let i, j; + for (i = 0; i < length; ++i) { + padded[i] = data[offset++]; + } + padded[i++] = 0x80; + const n = paddedLength - 16; + while (i < n) { + padded[i++] = 0; + } + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = (length >>> 29) & 0xff; + padded[i++] = (length >> 21) & 0xff; + padded[i++] = (length >> 13) & 0xff; + padded[i++] = (length >> 5) & 0xff; + padded[i++] = (length << 3) & 0xff; + const w = new Array(80); + for (i = 0; i < 80; i++) { + w[i] = new Word64(0, 0); + } + let a = new Word64(0, 0), + b = new Word64(0, 0), + c = new Word64(0, 0); + let d = new Word64(0, 0), + e = new Word64(0, 0), + f = new Word64(0, 0); + let g = new Word64(0, 0), + h = new Word64(0, 0); + const t1 = new Word64(0, 0), + t2 = new Word64(0, 0); + const tmp1 = new Word64(0, 0), + tmp2 = new Word64(0, 0); + let tmp3; + for (i = 0; i < paddedLength; ) { + for (j = 0; j < 16; ++j) { + w[j].high = + (padded[i] << 24) | + (padded[i + 1] << 16) | + (padded[i + 2] << 8) | + padded[i + 3]; + w[j].low = + (padded[i + 4] << 24) | + (padded[i + 5] << 16) | + (padded[i + 6] << 8) | + padded[i + 7]; + i += 8; + } + for (j = 16; j < 80; ++j) { + tmp3 = w[j]; + littleSigmaPrime(tmp3, w[j - 2], tmp2); + tmp3.add(w[j - 7]); + littleSigma(tmp1, w[j - 15], tmp2); + tmp3.add(tmp1); + tmp3.add(w[j - 16]); + } + a.assign(h0); + b.assign(h1); + c.assign(h2); + d.assign(h3); + e.assign(h4); + f.assign(h5); + g.assign(h6); + h.assign(h7); + for (j = 0; j < 80; ++j) { + t1.assign(h); + sigmaPrime(tmp1, e, tmp2); + t1.add(tmp1); + ch(tmp1, e, f, g, tmp2); + t1.add(tmp1); + t1.add(k[j]); + t1.add(w[j]); + sigma(t2, a, tmp2); + maj(tmp1, a, b, c, tmp2); + t2.add(tmp1); + tmp3 = h; + h = g; + g = f; + f = e; + d.add(t1); + e = d; + d = c; + c = b; + b = a; + tmp3.assign(t1); + tmp3.add(t2); + a = tmp3; + } + h0.add(a); + h1.add(b); + h2.add(c); + h3.add(d); + h4.add(e); + h5.add(f); + h6.add(g); + h7.add(h); + } + let result; + if (!mode384) { + result = new Uint8Array(64); + h0.copyTo(result, 0); + h1.copyTo(result, 8); + h2.copyTo(result, 16); + h3.copyTo(result, 24); + h4.copyTo(result, 32); + h5.copyTo(result, 40); + h6.copyTo(result, 48); + h7.copyTo(result, 56); + } else { + result = new Uint8Array(48); + h0.copyTo(result, 0); + h1.copyTo(result, 8); + h2.copyTo(result, 16); + h3.copyTo(result, 24); + h4.copyTo(result, 32); + h5.copyTo(result, 40); + } + return result; + } + return hash; +})(); +function calculateSHA384(data, offset, length) { + return calculateSHA512(data, offset, length, true); +} +class NullCipher { + decryptBlock(data) { + return data; + } + encrypt(data) { + return data; } } class AESBaseCipher { constructor() { - this.constructor === AESBaseCipher && - unreachable("Cannot initialize AESBaseCipher."); this._s = new Uint8Array([ - 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, - 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, - 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, - 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, - 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, - 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, - 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, - 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, - 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, - 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, - 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, - 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, - 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, - 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, - 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, - 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, - 22, + 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, + 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, + 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, + 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, + 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, + 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, + 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, + 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, + 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, + 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, + 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, + 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, + 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, + 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, + 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, + 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, + 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, + 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, + 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, + 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, + 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, + 0xb0, 0x54, 0xbb, 0x16, ]); this._inv_s = new Uint8Array([ - 82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, - 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, - 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, - 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, - 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, - 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, - 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, - 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, - 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, - 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, - 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, - 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, - 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, - 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, - 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, - 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125, + 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, + 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, + 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, + 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, + 0x08, 0x2e, 0xa1, 0x66, 0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xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, + 0x55, 0x21, 0x0c, 0x7d, ]); this._mix = new Uint32Array([ - 0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, - 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, - 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, - 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, - 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, - 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, - 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, - 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, - 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, - 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, - 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, - 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, - 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, - 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, - 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, - 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, - 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, - 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, - 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, - 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, - 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, - 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, - 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, - 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, - 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, - 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, - 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, - 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, - 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, - 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, - 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, - 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, - 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, - 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, - 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, - 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, - 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, - 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, - 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, - 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, - 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, - 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, - 2438237621, 2203032232, 2370213795, + 0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, + 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, + 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, + 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, + 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, + 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, + 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, + 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, + 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, + 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, + 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, + 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, + 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, + 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, + 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, + 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, + 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, + 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, + 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, + 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, + 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, + 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, + 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, + 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, + 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, + 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, + 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, + 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, + 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, + 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, + 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, + 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, + 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, + 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, + 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, + 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, + 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, + 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, + 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, + 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, + 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, + 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, + 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3, ]); this._mixCol = new Uint8Array(256); - for (let e = 0; e < 256; e++) - this._mixCol[e] = e < 128 ? e << 1 : (e << 1) ^ 27; + for (let i = 0; i < 256; i++) { + this._mixCol[i] = i < 128 ? i << 1 : (i << 1) ^ 0x1b; + } this.buffer = new Uint8Array(16); this.bufferPosition = 0; } - _expandKey(e) { + _expandKey(cipherKey) { unreachable("Cannot call `_expandKey` on the base class"); } - _decrypt(e, t) { - let i, a, s; - const r = new Uint8Array(16); - r.set(e); - for (let e = 0, i = this._keySize; e < 16; ++e, ++i) r[e] ^= t[i]; - for (let e = this._cyclesOfRepetition - 1; e >= 1; --e) { - i = r[13]; - r[13] = r[9]; - r[9] = r[5]; - r[5] = r[1]; - r[1] = i; - i = r[14]; - a = r[10]; - r[14] = r[6]; - r[10] = r[2]; - r[6] = i; - r[2] = a; - i = r[15]; - a = r[11]; - s = r[7]; - r[15] = r[3]; - r[11] = i; - r[7] = a; - r[3] = s; - for (let e = 0; e < 16; ++e) r[e] = this._inv_s[r[e]]; - for (let i = 0, a = 16 * e; i < 16; ++i, ++a) r[i] ^= t[a]; - for (let e = 0; e < 16; e += 4) { - const t = this._mix[r[e]], - a = this._mix[r[e + 1]], - s = this._mix[r[e + 2]], - n = this._mix[r[e + 3]]; - i = - t ^ - (a >>> 8) ^ - (a << 24) ^ - (s >>> 16) ^ - (s << 16) ^ - (n >>> 24) ^ - (n << 8); - r[e] = (i >>> 24) & 255; - r[e + 1] = (i >> 16) & 255; - r[e + 2] = (i >> 8) & 255; - r[e + 3] = 255 & i; + _decrypt(input, key) { + let t, u, v; + const state = new Uint8Array(16); + state.set(input); + for (let j = 0, k = this._keySize; j < 16; ++j, ++k) { + state[j] ^= key[k]; + } + for (let i = this._cyclesOfRepetition - 1; i >= 1; --i) { + t = state[13]; + state[13] = state[9]; + state[9] = state[5]; + state[5] = state[1]; + state[1] = t; + t = state[14]; + u = state[10]; + state[14] = state[6]; + state[10] = state[2]; + state[6] = t; + state[2] = u; + t = state[15]; + u = state[11]; + v = state[7]; + state[15] = state[3]; + state[11] = t; + state[7] = u; + state[3] = v; + for (let j = 0; j < 16; ++j) { + state[j] = this._inv_s[state[j]]; + } + for (let j = 0, k = i * 16; j < 16; ++j, ++k) { + state[j] ^= key[k]; + } + for (let j = 0; j < 16; j += 4) { + const s0 = this._mix[state[j]]; + const s1 = this._mix[state[j + 1]]; + const s2 = this._mix[state[j + 2]]; + const s3 = this._mix[state[j + 3]]; + t = + s0 ^ + (s1 >>> 8) ^ + (s1 << 24) ^ + (s2 >>> 16) ^ + (s2 << 16) ^ + (s3 >>> 24) ^ + (s3 << 8); + state[j] = (t >>> 24) & 0xff; + state[j + 1] = (t >> 16) & 0xff; + state[j + 2] = (t >> 8) & 0xff; + state[j + 3] = t & 0xff; } } - i = r[13]; - r[13] = r[9]; - r[9] = r[5]; - r[5] = r[1]; - r[1] = i; - i = r[14]; - a = r[10]; - r[14] = r[6]; - r[10] = r[2]; - r[6] = i; - r[2] = a; - i = r[15]; - a = r[11]; - s = r[7]; - r[15] = r[3]; - r[11] = i; - r[7] = a; - r[3] = s; - for (let e = 0; e < 16; ++e) { - r[e] = this._inv_s[r[e]]; - r[e] ^= t[e]; + t = state[13]; + state[13] = state[9]; + state[9] = state[5]; + state[5] = state[1]; + state[1] = t; + t = state[14]; + u = state[10]; + state[14] = state[6]; + state[10] = state[2]; + state[6] = t; + state[2] = u; + t = state[15]; + u = state[11]; + v = state[7]; + state[15] = state[3]; + state[11] = t; + state[7] = u; + state[3] = v; + for (let j = 0; j < 16; ++j) { + state[j] = this._inv_s[state[j]]; + state[j] ^= key[j]; } - return r; + return state; } - _encrypt(e, t) { - const i = this._s; - let a, s, r; - const n = new Uint8Array(16); - n.set(e); - for (let e = 0; e < 16; ++e) n[e] ^= t[e]; - for (let e = 1; e < this._cyclesOfRepetition; e++) { - for (let e = 0; e < 16; ++e) n[e] = i[n[e]]; - r = n[1]; - n[1] = n[5]; - n[5] = n[9]; - n[9] = n[13]; - n[13] = r; - r = n[2]; - s = n[6]; - n[2] = n[10]; - n[6] = n[14]; - n[10] = r; - n[14] = s; - r = n[3]; - s = n[7]; - a = n[11]; - n[3] = n[15]; - n[7] = r; - n[11] = s; - n[15] = a; - for (let e = 0; e < 16; e += 4) { - const t = n[e + 0], - i = n[e + 1], - s = n[e + 2], - r = n[e + 3]; - a = t ^ i ^ s ^ r; - n[e + 0] ^= a ^ this._mixCol[t ^ i]; - n[e + 1] ^= a ^ this._mixCol[i ^ s]; - n[e + 2] ^= a ^ this._mixCol[s ^ r]; - n[e + 3] ^= a ^ this._mixCol[r ^ t]; + _encrypt(input, key) { + const s = this._s; + let t, u, v; + const state = new Uint8Array(16); + state.set(input); + for (let j = 0; j < 16; ++j) { + state[j] ^= key[j]; + } + for (let i = 1; i < this._cyclesOfRepetition; i++) { + for (let j = 0; j < 16; ++j) { + state[j] = s[state[j]]; + } + v = state[1]; + state[1] = state[5]; + state[5] = state[9]; + state[9] = state[13]; + state[13] = v; + v = state[2]; + u = state[6]; + state[2] = state[10]; + state[6] = state[14]; + state[10] = v; + state[14] = u; + v = state[3]; + u = state[7]; + t = state[11]; + state[3] = state[15]; + state[7] = v; + state[11] = u; + state[15] = t; + for (let j = 0; j < 16; j += 4) { + const s0 = state[j + 0]; + const s1 = state[j + 1]; + const s2 = state[j + 2]; + const s3 = state[j + 3]; + t = s0 ^ s1 ^ s2 ^ s3; + state[j + 0] ^= t ^ this._mixCol[s0 ^ s1]; + state[j + 1] ^= t ^ this._mixCol[s1 ^ s2]; + state[j + 2] ^= t ^ this._mixCol[s2 ^ s3]; + state[j + 3] ^= t ^ this._mixCol[s3 ^ s0]; + } + for (let j = 0, k = i * 16; j < 16; ++j, ++k) { + state[j] ^= key[k]; } - for (let i = 0, a = 16 * e; i < 16; ++i, ++a) n[i] ^= t[a]; } - for (let e = 0; e < 16; ++e) n[e] = i[n[e]]; - r = n[1]; - n[1] = n[5]; - n[5] = n[9]; - n[9] = n[13]; - n[13] = r; - r = n[2]; - s = n[6]; - n[2] = n[10]; - n[6] = n[14]; - n[10] = r; - n[14] = s; - r = n[3]; - s = n[7]; - a = n[11]; - n[3] = n[15]; - n[7] = r; - n[11] = s; - n[15] = a; - for (let e = 0, i = this._keySize; e < 16; ++e, ++i) n[e] ^= t[i]; - return n; + for (let j = 0; j < 16; ++j) { + state[j] = s[state[j]]; + } + v = state[1]; + state[1] = state[5]; + state[5] = state[9]; + state[9] = state[13]; + state[13] = v; + v = state[2]; + u = state[6]; + state[2] = state[10]; + state[6] = state[14]; + state[10] = v; + state[14] = u; + v = state[3]; + u = state[7]; + t = state[11]; + state[3] = state[15]; + state[7] = v; + state[11] = u; + state[15] = t; + for (let j = 0, k = this._keySize; j < 16; ++j, ++k) { + state[j] ^= key[k]; + } + return state; } - _decryptBlock2(e, t) { - const i = e.length; - let a = this.buffer, - s = this.bufferPosition; - const r = []; - let n = this.iv; - for (let t = 0; t < i; ++t) { - a[s] = e[t]; - ++s; - if (s < 16) continue; - const i = this._decrypt(a, this._key); - for (let e = 0; e < 16; ++e) i[e] ^= n[e]; - n = a; - r.push(i); - a = new Uint8Array(16); - s = 0; + _decryptBlock2(data, finalize) { + const sourceLength = data.length; + let buffer = this.buffer, + bufferLength = this.bufferPosition; + const result = []; + let iv = this.iv; + for (let i = 0; i < sourceLength; ++i) { + buffer[bufferLength] = data[i]; + ++bufferLength; + if (bufferLength < 16) { + continue; + } + const plain = this._decrypt(buffer, this._key); + for (let j = 0; j < 16; ++j) { + plain[j] ^= iv[j]; + } + iv = buffer; + result.push(plain); + buffer = new Uint8Array(16); + bufferLength = 0; } - this.buffer = a; - this.bufferLength = s; - this.iv = n; - if (0 === r.length) return new Uint8Array(0); - let g = 16 * r.length; - if (t) { - const e = r.at(-1); - let t = e[15]; - if (t <= 16) { - for (let i = 15, a = 16 - t; i >= a; --i) - if (e[i] !== t) { - t = 0; + this.buffer = buffer; + this.bufferLength = bufferLength; + this.iv = iv; + if (result.length === 0) { + return new Uint8Array(0); + } + let outputLength = 16 * result.length; + if (finalize) { + const lastBlock = result.at(-1); + let psLen = lastBlock[15]; + if (psLen <= 16) { + for (let i = 15, ii = 16 - psLen; i >= ii; --i) { + if (lastBlock[i] !== psLen) { + psLen = 0; break; } - g -= t; - r[r.length - 1] = e.subarray(0, 16 - t); + } + outputLength -= psLen; + result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); } } - const o = new Uint8Array(g); - for (let e = 0, t = 0, i = r.length; e < i; ++e, t += 16) o.set(r[e], t); - return o; + const output = new Uint8Array(outputLength); + for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { + output.set(result[i], j); + } + return output; } - decryptBlock(e, t, i = null) { - const a = e.length, - s = this.buffer; - let r = this.bufferPosition; - if (i) this.iv = i; - else { - for (let t = 0; r < 16 && t < a; ++t, ++r) s[r] = e[t]; - if (r < 16) { - this.bufferLength = r; + decryptBlock(data, finalize, iv = null) { + const sourceLength = data.length; + const buffer = this.buffer; + let bufferLength = this.bufferPosition; + if (iv) { + this.iv = iv; + } else { + for ( + let i = 0; + bufferLength < 16 && i < sourceLength; + ++i, ++bufferLength + ) { + buffer[bufferLength] = data[i]; + } + if (bufferLength < 16) { + this.bufferLength = bufferLength; return new Uint8Array(0); } - this.iv = s; - e = e.subarray(16); + this.iv = buffer; + data = data.subarray(16); } this.buffer = new Uint8Array(16); this.bufferLength = 0; this.decryptBlock = this._decryptBlock2; - return this.decryptBlock(e, t); + return this.decryptBlock(data, finalize); } - encrypt(e, t) { - const i = e.length; - let a = this.buffer, - s = this.bufferPosition; - const r = []; - t || (t = new Uint8Array(16)); - for (let n = 0; n < i; ++n) { - a[s] = e[n]; - ++s; - if (s < 16) continue; - for (let e = 0; e < 16; ++e) a[e] ^= t[e]; - const i = this._encrypt(a, this._key); - t = i; - r.push(i); - a = new Uint8Array(16); - s = 0; + encrypt(data, iv) { + const sourceLength = data.length; + let buffer = this.buffer, + bufferLength = this.bufferPosition; + const result = []; + if (!iv) { + iv = new Uint8Array(16); } - this.buffer = a; - this.bufferLength = s; - this.iv = t; - if (0 === r.length) return new Uint8Array(0); - const n = 16 * r.length, - g = new Uint8Array(n); - for (let e = 0, t = 0, i = r.length; e < i; ++e, t += 16) g.set(r[e], t); - return g; + for (let i = 0; i < sourceLength; ++i) { + buffer[bufferLength] = data[i]; + ++bufferLength; + if (bufferLength < 16) { + continue; + } + for (let j = 0; j < 16; ++j) { + buffer[j] ^= iv[j]; + } + const cipher = this._encrypt(buffer, this._key); + iv = cipher; + result.push(cipher); + buffer = new Uint8Array(16); + bufferLength = 0; + } + this.buffer = buffer; + this.bufferLength = bufferLength; + this.iv = iv; + if (result.length === 0) { + return new Uint8Array(0); + } + const outputLength = 16 * result.length; + const output = new Uint8Array(outputLength); + for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { + output.set(result[i], j); + } + return output; } } class AES128Cipher extends AESBaseCipher { - constructor(e) { + constructor(key) { super(); this._cyclesOfRepetition = 10; this._keySize = 160; this._rcon = new Uint8Array([ - 141, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, - 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145, 57, 114, - 228, 211, 189, 97, 194, 159, 37, 74, 148, 51, 102, 204, 131, 29, 58, 116, - 232, 203, 141, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, - 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, - 145, 57, 114, 228, 211, 189, 97, 194, 159, 37, 74, 148, 51, 102, 204, 131, - 29, 58, 116, 232, 203, 141, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, - 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, - 197, 145, 57, 114, 228, 211, 189, 97, 194, 159, 37, 74, 148, 51, 102, 204, - 131, 29, 58, 116, 232, 203, 141, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, - 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, - 239, 197, 145, 57, 114, 228, 211, 189, 97, 194, 159, 37, 74, 148, 51, 102, - 204, 131, 29, 58, 116, 232, 203, 141, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, - 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, - 250, 239, 197, 145, 57, 114, 228, 211, 189, 97, 194, 159, 37, 74, 148, 51, - 102, 204, 131, 29, 58, 116, 232, 203, 141, + 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, + 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, + 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, + 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, + 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, + 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, + 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, + 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, + 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, + 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, + 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, + 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, + 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, + 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, + 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, + 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, + 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, + 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, + 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, + 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, + 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, + 0x74, 0xe8, 0xcb, 0x8d, ]); - this._key = this._expandKey(e); + this._key = this._expandKey(key); } - _expandKey(e) { - const t = this._s, - i = this._rcon, - a = new Uint8Array(176); - a.set(e); - for (let e = 16, s = 1; e < 176; ++s) { - let r = a[e - 3], - n = a[e - 2], - g = a[e - 1], - o = a[e - 4]; - r = t[r]; - n = t[n]; - g = t[g]; - o = t[o]; - r ^= i[s]; - for (let t = 0; t < 4; ++t) { - a[e] = r ^= a[e - 16]; - e++; - a[e] = n ^= a[e - 16]; - e++; - a[e] = g ^= a[e - 16]; - e++; - a[e] = o ^= a[e - 16]; - e++; + _expandKey(cipherKey) { + const b = 176; + const s = this._s; + const rcon = this._rcon; + const result = new Uint8Array(b); + result.set(cipherKey); + for (let j = 16, i = 1; j < b; ++i) { + let t1 = result[j - 3]; + let t2 = result[j - 2]; + let t3 = result[j - 1]; + let t4 = result[j - 4]; + t1 = s[t1]; + t2 = s[t2]; + t3 = s[t3]; + t4 = s[t4]; + t1 ^= rcon[i]; + for (let n = 0; n < 4; ++n) { + result[j] = t1 ^= result[j - 16]; + j++; + result[j] = t2 ^= result[j - 16]; + j++; + result[j] = t3 ^= result[j - 16]; + j++; + result[j] = t4 ^= result[j - 16]; + j++; } } - return a; + return result; } } class AES256Cipher extends AESBaseCipher { - constructor(e) { + constructor(key) { super(); this._cyclesOfRepetition = 14; this._keySize = 224; - this._key = this._expandKey(e); + this._key = this._expandKey(key); } - _expandKey(e) { - const t = this._s, - i = new Uint8Array(240); - i.set(e); - let a, - s, - r, - n, - g = 1; - for (let e = 32, o = 1; e < 240; ++o) { - if (e % 32 == 16) { - a = t[a]; - s = t[s]; - r = t[r]; - n = t[n]; - } else if (e % 32 == 0) { - a = i[e - 3]; - s = i[e - 2]; - r = i[e - 1]; - n = i[e - 4]; - a = t[a]; - s = t[s]; - r = t[r]; - n = t[n]; - a ^= g; - (g <<= 1) >= 256 && (g = 255 & (27 ^ g)); + _expandKey(cipherKey) { + const b = 240; + const s = this._s; + const result = new Uint8Array(b); + result.set(cipherKey); + let r = 1; + let t1, t2, t3, t4; + for (let j = 32, i = 1; j < b; ++i) { + if (j % 32 === 16) { + t1 = s[t1]; + t2 = s[t2]; + t3 = s[t3]; + t4 = s[t4]; + } else if (j % 32 === 0) { + t1 = result[j - 3]; + t2 = result[j - 2]; + t3 = result[j - 1]; + t4 = result[j - 4]; + t1 = s[t1]; + t2 = s[t2]; + t3 = s[t3]; + t4 = s[t4]; + t1 ^= r; + if ((r <<= 1) >= 256) { + r = (r ^ 0x1b) & 0xff; + } } - for (let t = 0; t < 4; ++t) { - i[e] = a ^= i[e - 32]; - e++; - i[e] = s ^= i[e - 32]; - e++; - i[e] = r ^= i[e - 32]; - e++; - i[e] = n ^= i[e - 32]; - e++; + for (let n = 0; n < 4; ++n) { + result[j] = t1 ^= result[j - 32]; + j++; + result[j] = t2 ^= result[j - 32]; + j++; + result[j] = t3 ^= result[j - 32]; + j++; + result[j] = t4 ^= result[j - 32]; + j++; } } - return i; + return result; } } class PDF17 { - checkOwnerPassword(e, t, i, a) { - const s = new Uint8Array(e.length + 56); - s.set(e, 0); - s.set(t, e.length); - s.set(i, e.length + t.length); - return isArrayEqual(Js(s, 0, s.length), a); + checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { + const hashData = new Uint8Array(password.length + 56); + hashData.set(password, 0); + hashData.set(ownerValidationSalt, password.length); + hashData.set(userBytes, password.length + ownerValidationSalt.length); + const result = calculateSHA256(hashData, 0, hashData.length); + return isArrayEqual(result, ownerPassword); } - checkUserPassword(e, t, i) { - const a = new Uint8Array(e.length + 8); - a.set(e, 0); - a.set(t, e.length); - return isArrayEqual(Js(a, 0, a.length), i); + checkUserPassword(password, userValidationSalt, userPassword) { + const hashData = new Uint8Array(password.length + 8); + hashData.set(password, 0); + hashData.set(userValidationSalt, password.length); + const result = calculateSHA256(hashData, 0, hashData.length); + return isArrayEqual(result, userPassword); } - getOwnerKey(e, t, i, a) { - const s = new Uint8Array(e.length + 56); - s.set(e, 0); - s.set(t, e.length); - s.set(i, e.length + t.length); - const r = Js(s, 0, s.length); - return new AES256Cipher(r).decryptBlock(a, !1, new Uint8Array(16)); + getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { + const hashData = new Uint8Array(password.length + 56); + hashData.set(password, 0); + hashData.set(ownerKeySalt, password.length); + hashData.set(userBytes, password.length + ownerKeySalt.length); + const key = calculateSHA256(hashData, 0, hashData.length); + const cipher = new AES256Cipher(key); + return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); } - getUserKey(e, t, i) { - const a = new Uint8Array(e.length + 8); - a.set(e, 0); - a.set(t, e.length); - const s = Js(a, 0, a.length); - return new AES256Cipher(s).decryptBlock(i, !1, new Uint8Array(16)); + getUserKey(password, userKeySalt, userEncryption) { + const hashData = new Uint8Array(password.length + 8); + hashData.set(password, 0); + hashData.set(userKeySalt, password.length); + const key = calculateSHA256(hashData, 0, hashData.length); + const cipher = new AES256Cipher(key); + return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); } } class PDF20 { - _hash(e, t, i) { - let a = Js(t, 0, t.length).subarray(0, 32), - s = [0], - r = 0; - for (; r < 64 || s.at(-1) > r - 32; ) { - const t = e.length + a.length + i.length, - c = new Uint8Array(t); - let C = 0; - c.set(e, C); - C += e.length; - c.set(a, C); - C += a.length; - c.set(i, C); - const h = new Uint8Array(64 * t); - for (let e = 0, i = 0; e < 64; e++, i += t) h.set(c, i); - s = new AES128Cipher(a.subarray(0, 16)).encrypt(h, a.subarray(16, 32)); - const l = s.slice(0, 16).reduce((e, t) => e + t, 0) % 3; - 0 === l - ? (a = Js(s, 0, s.length)) - : 1 === l - ? (a = ((n = s), (g = 0), (o = s.length), Ys(n, g, o, !0))) - : 2 === l && (a = Ys(s, 0, s.length)); - r++; + _hash(password, input, userBytes) { + let k = calculateSHA256(input, 0, input.length).subarray(0, 32); + let e = [0]; + let i = 0; + while (i < 64 || e.at(-1) > i - 32) { + const combinedLength = password.length + k.length + userBytes.length, + combinedArray = new Uint8Array(combinedLength); + let writeOffset = 0; + combinedArray.set(password, writeOffset); + writeOffset += password.length; + combinedArray.set(k, writeOffset); + writeOffset += k.length; + combinedArray.set(userBytes, writeOffset); + const k1 = new Uint8Array(combinedLength * 64); + for (let j = 0, pos = 0; j < 64; j++, pos += combinedLength) { + k1.set(combinedArray, pos); + } + const cipher = new AES128Cipher(k.subarray(0, 16)); + e = cipher.encrypt(k1, k.subarray(16, 32)); + const remainder = e.slice(0, 16).reduce((a, b) => a + b, 0) % 3; + if (remainder === 0) { + k = calculateSHA256(e, 0, e.length); + } else if (remainder === 1) { + k = calculateSHA384(e, 0, e.length); + } else if (remainder === 2) { + k = calculateSHA512(e, 0, e.length); + } + i++; } - var n, g, o; - return a.subarray(0, 32); + return k.subarray(0, 32); } - checkOwnerPassword(e, t, i, a) { - const s = new Uint8Array(e.length + 56); - s.set(e, 0); - s.set(t, e.length); - s.set(i, e.length + t.length); - return isArrayEqual(this._hash(e, s, i), a); + checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { + const hashData = new Uint8Array(password.length + 56); + hashData.set(password, 0); + hashData.set(ownerValidationSalt, password.length); + hashData.set(userBytes, password.length + ownerValidationSalt.length); + const result = this._hash(password, hashData, userBytes); + return isArrayEqual(result, ownerPassword); } - checkUserPassword(e, t, i) { - const a = new Uint8Array(e.length + 8); - a.set(e, 0); - a.set(t, e.length); - return isArrayEqual(this._hash(e, a, []), i); + checkUserPassword(password, userValidationSalt, userPassword) { + const hashData = new Uint8Array(password.length + 8); + hashData.set(password, 0); + hashData.set(userValidationSalt, password.length); + const result = this._hash(password, hashData, []); + return isArrayEqual(result, userPassword); } - getOwnerKey(e, t, i, a) { - const s = new Uint8Array(e.length + 56); - s.set(e, 0); - s.set(t, e.length); - s.set(i, e.length + t.length); - const r = this._hash(e, s, i); - return new AES256Cipher(r).decryptBlock(a, !1, new Uint8Array(16)); + getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { + const hashData = new Uint8Array(password.length + 56); + hashData.set(password, 0); + hashData.set(ownerKeySalt, password.length); + hashData.set(userBytes, password.length + ownerKeySalt.length); + const key = this._hash(password, hashData, userBytes); + const cipher = new AES256Cipher(key); + return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); } - getUserKey(e, t, i) { - const a = new Uint8Array(e.length + 8); - a.set(e, 0); - a.set(t, e.length); - const s = this._hash(e, a, []); - return new AES256Cipher(s).decryptBlock(i, !1, new Uint8Array(16)); + getUserKey(password, userKeySalt, userEncryption) { + const hashData = new Uint8Array(password.length + 8); + hashData.set(password, 0); + hashData.set(userKeySalt, password.length); + const key = this._hash(password, hashData, []); + const cipher = new AES256Cipher(key); + return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); } } class CipherTransform { - constructor(e, t) { - this.StringCipherConstructor = e; - this.StreamCipherConstructor = t; + constructor(stringCipherConstructor, streamCipherConstructor) { + this.StringCipherConstructor = stringCipherConstructor; + this.StreamCipherConstructor = streamCipherConstructor; } - createStream(e, t) { - const i = new this.StreamCipherConstructor(); - return new DecryptStream(e, t, function cipherTransformDecryptStream(e, t) { - return i.decryptBlock(e, t); - }); + createStream(stream, length) { + const cipher = new this.StreamCipherConstructor(); + return new DecryptStream( + stream, + length, + function cipherTransformDecryptStream(data, finalize) { + return cipher.decryptBlock(data, finalize); + }, + ); } - decryptString(e) { - const t = new this.StringCipherConstructor(); - let i = stringToBytes(e); - i = t.decryptBlock(i, !0); - return bytesToString(i); + decryptString(s) { + const cipher = new this.StringCipherConstructor(); + let data = stringToBytes(s); + data = cipher.decryptBlock(data, true); + return bytesToString(data); } - encryptString(e) { - const t = new this.StringCipherConstructor(); - if (t instanceof AESBaseCipher) { - const i = 16 - (e.length % 16); - e += String.fromCharCode(i).repeat(i); - const a = new Uint8Array(16); - if ("undefined" != typeof crypto) crypto.getRandomValues(a); - else for (let e = 0; e < 16; e++) a[e] = Math.floor(256 * Math.random()); - let s = stringToBytes(e); - s = t.encrypt(s, a); - const r = new Uint8Array(16 + s.length); - r.set(a); - r.set(s, 16); - return bytesToString(r); + encryptString(s) { + const cipher = new this.StringCipherConstructor(); + if (cipher instanceof AESBaseCipher) { + const strLen = s.length; + const pad = 16 - (strLen % 16); + s += String.fromCharCode(pad).repeat(pad); + const iv = new Uint8Array(16); + if (typeof crypto !== "undefined") { + crypto.getRandomValues(iv); + } else { + for (let i = 0; i < 16; i++) { + iv[i] = Math.floor(256 * Math.random()); + } + } + let data = stringToBytes(s); + data = cipher.encrypt(data, iv); + const buf = new Uint8Array(16 + data.length); + buf.set(iv); + buf.set(data, 16); + return bytesToString(buf); } - let i = stringToBytes(e); - i = t.encrypt(i); - return bytesToString(i); + let data = stringToBytes(s); + data = cipher.encrypt(data); + return bytesToString(data); } } class CipherTransformFactory { - static #k = new Uint8Array([ - 40, 191, 78, 94, 78, 117, 138, 65, 100, 0, 78, 86, 255, 250, 1, 8, 46, 46, - 0, 182, 208, 104, 62, 128, 47, 12, 169, 254, 100, 83, 105, 122, + static #defaultPasswordBytes = new Uint8Array([ + 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, 0x56, + 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80, + 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a, ]); - #R(e, t, i, a, s, r, n, g, o, c, C, h) { - if (t) { - const e = Math.min(127, t.length); - t = t.subarray(0, e); - } else t = []; - const l = 6 === e ? new PDF20() : new PDF17(); - return l.checkUserPassword(t, g, n) - ? l.getUserKey(t, o, C) - : t.length && l.checkOwnerPassword(t, a, r, i) - ? l.getOwnerKey(t, s, r, c) - : null; - } - #N(e, t, i, a, s, r, n, g) { - const o = 40 + i.length + e.length, - c = new Uint8Array(o); - let C, - h, - l = 0; - if (t) { - h = Math.min(32, t.length); - for (; l < h; ++l) c[l] = t[l]; - } - C = 0; - for (; l < 32; ) c[l++] = CipherTransformFactory.#k[C++]; - for (C = 0, h = i.length; C < h; ++C) c[l++] = i[C]; - c[l++] = 255 & s; - c[l++] = (s >> 8) & 255; - c[l++] = (s >> 16) & 255; - c[l++] = (s >>> 24) & 255; - for (C = 0, h = e.length; C < h; ++C) c[l++] = e[C]; - if (r >= 4 && !g) { - c[l++] = 255; - c[l++] = 255; - c[l++] = 255; - c[l++] = 255; - } - let Q = Hs(c, 0, l); - const E = n >> 3; - if (r >= 3) for (C = 0; C < 50; ++C) Q = Hs(Q, 0, E); - const u = Q.subarray(0, E); - let d, f; - if (r >= 3) { - for (l = 0; l < 32; ++l) c[l] = CipherTransformFactory.#k[l]; - for (C = 0, h = e.length; C < h; ++C) c[l++] = e[C]; - d = new ARCFourCipher(u); - f = d.encryptBlock(Hs(c, 0, l)); - h = u.length; - const t = new Uint8Array(h); - for (C = 1; C <= 19; ++C) { - for (let e = 0; e < h; ++e) t[e] = u[e] ^ C; - d = new ARCFourCipher(t); - f = d.encryptBlock(f); - } - for (C = 0, h = f.length; C < h; ++C) if (a[C] !== f[C]) return null; + #createEncryptionKey20( + revision, + password, + ownerPassword, + ownerValidationSalt, + ownerKeySalt, + uBytes, + userPassword, + userValidationSalt, + userKeySalt, + ownerEncryption, + userEncryption, + perms, + ) { + if (password) { + const passwordLength = Math.min(127, password.length); + password = password.subarray(0, passwordLength); } else { - d = new ARCFourCipher(u); - f = d.encryptBlock(CipherTransformFactory.#k); - for (C = 0, h = f.length; C < h; ++C) if (a[C] !== f[C]) return null; + password = []; } - return u; + const pdfAlgorithm = revision === 6 ? new PDF20() : new PDF17(); + if ( + pdfAlgorithm.checkUserPassword(password, userValidationSalt, userPassword) + ) { + return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption); + } else if ( + password.length && + pdfAlgorithm.checkOwnerPassword( + password, + ownerValidationSalt, + uBytes, + ownerPassword, + ) + ) { + return pdfAlgorithm.getOwnerKey( + password, + ownerKeySalt, + uBytes, + ownerEncryption, + ); + } + return null; } - #G(e, t, i, a) { - const s = new Uint8Array(32); - let r = 0; - const n = Math.min(32, e.length); - for (; r < n; ++r) s[r] = e[r]; - let g = 0; - for (; r < 32; ) s[r++] = CipherTransformFactory.#k[g++]; - let o = Hs(s, 0, r); - const c = a >> 3; - if (i >= 3) for (g = 0; g < 50; ++g) o = Hs(o, 0, o.length); - let C, h; - if (i >= 3) { - h = t; - const e = new Uint8Array(c); - for (g = 19; g >= 0; g--) { - for (let t = 0; t < c; ++t) e[t] = o[t] ^ g; - C = new ARCFourCipher(e); - h = C.encryptBlock(h); + #prepareKeyData( + fileId, + password, + ownerPassword, + userPassword, + flags, + revision, + keyLength, + encryptMetadata, + ) { + const hashDataSize = 40 + ownerPassword.length + fileId.length; + const hashData = new Uint8Array(hashDataSize); + let i = 0, + j, + n; + if (password) { + n = Math.min(32, password.length); + for (; i < n; ++i) { + hashData[i] = password[i]; + } + } + j = 0; + while (i < 32) { + hashData[i++] = CipherTransformFactory.#defaultPasswordBytes[j++]; + } + for (j = 0, n = ownerPassword.length; j < n; ++j) { + hashData[i++] = ownerPassword[j]; + } + hashData[i++] = flags & 0xff; + hashData[i++] = (flags >> 8) & 0xff; + hashData[i++] = (flags >> 16) & 0xff; + hashData[i++] = (flags >>> 24) & 0xff; + for (j = 0, n = fileId.length; j < n; ++j) { + hashData[i++] = fileId[j]; + } + if (revision >= 4 && !encryptMetadata) { + hashData[i++] = 0xff; + hashData[i++] = 0xff; + hashData[i++] = 0xff; + hashData[i++] = 0xff; + } + let hash = calculateMD5(hashData, 0, i); + const keyLengthInBytes = keyLength >> 3; + if (revision >= 3) { + for (j = 0; j < 50; ++j) { + hash = calculateMD5(hash, 0, keyLengthInBytes); + } + } + const encryptionKey = hash.subarray(0, keyLengthInBytes); + let cipher, checkData; + if (revision >= 3) { + for (i = 0; i < 32; ++i) { + hashData[i] = CipherTransformFactory.#defaultPasswordBytes[i]; + } + for (j = 0, n = fileId.length; j < n; ++j) { + hashData[i++] = fileId[j]; + } + cipher = new ARCFourCipher(encryptionKey); + checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i)); + n = encryptionKey.length; + const derivedKey = new Uint8Array(n); + for (j = 1; j <= 19; ++j) { + for (let k = 0; k < n; ++k) { + derivedKey[k] = encryptionKey[k] ^ j; + } + cipher = new ARCFourCipher(derivedKey); + checkData = cipher.encryptBlock(checkData); + } + for (j = 0, n = checkData.length; j < n; ++j) { + if (userPassword[j] !== checkData[j]) { + return null; + } } } else { - C = new ARCFourCipher(o.subarray(0, c)); - h = C.encryptBlock(t); + cipher = new ARCFourCipher(encryptionKey); + checkData = cipher.encryptBlock( + CipherTransformFactory.#defaultPasswordBytes, + ); + for (j = 0, n = checkData.length; j < n; ++j) { + if (userPassword[j] !== checkData[j]) { + return null; + } + } } - return h; + return encryptionKey; } - #x(e, t, i, a = !1) { - const s = new Uint8Array(i.length + 9), - r = i.length; - let n; - for (n = 0; n < r; ++n) s[n] = i[n]; - s[n++] = 255 & e; - s[n++] = (e >> 8) & 255; - s[n++] = (e >> 16) & 255; - s[n++] = 255 & t; - s[n++] = (t >> 8) & 255; - if (a) { - s[n++] = 115; - s[n++] = 65; - s[n++] = 108; - s[n++] = 84; + #decodeUserPassword(password, ownerPassword, revision, keyLength) { + const hashData = new Uint8Array(32); + let i = 0; + const n = Math.min(32, password.length); + for (; i < n; ++i) { + hashData[i] = password[i]; } - return Hs(s, 0, n).subarray(0, Math.min(i.length + 5, 16)); + let j = 0; + while (i < 32) { + hashData[i++] = CipherTransformFactory.#defaultPasswordBytes[j++]; + } + let hash = calculateMD5(hashData, 0, i); + const keyLengthInBytes = keyLength >> 3; + if (revision >= 3) { + for (j = 0; j < 50; ++j) { + hash = calculateMD5(hash, 0, hash.length); + } + } + let cipher, userPassword; + if (revision >= 3) { + userPassword = ownerPassword; + const derivedKey = new Uint8Array(keyLengthInBytes); + for (j = 19; j >= 0; j--) { + for (let k = 0; k < keyLengthInBytes; ++k) { + derivedKey[k] = hash[k] ^ j; + } + cipher = new ARCFourCipher(derivedKey); + userPassword = cipher.encryptBlock(userPassword); + } + } else { + cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes)); + userPassword = cipher.encryptBlock(ownerPassword); + } + return userPassword; } - #U(e, t, i, a, s) { - if (!(t instanceof Name)) + #buildObjectKey(num, gen, encryptionKey, isAes = false) { + const key = new Uint8Array(encryptionKey.length + 9); + const n = encryptionKey.length; + let i; + for (i = 0; i < n; ++i) { + key[i] = encryptionKey[i]; + } + key[i++] = num & 0xff; + key[i++] = (num >> 8) & 0xff; + key[i++] = (num >> 16) & 0xff; + key[i++] = gen & 0xff; + key[i++] = (gen >> 8) & 0xff; + if (isAes) { + key[i++] = 0x73; + key[i++] = 0x41; + key[i++] = 0x6c; + key[i++] = 0x54; + } + const hash = calculateMD5(key, 0, i); + return hash.subarray(0, Math.min(encryptionKey.length + 5, 16)); + } + #buildCipherConstructor(cf, name, num, gen, key) { + if (!(name instanceof Name)) { throw new FormatError("Invalid crypt filter name."); - const r = this, - n = e.get(t.name), - g = n?.get("CFM"); - if (!g || "None" === g.name) + } + const self = this; + const cryptFilter = cf.get(name.name); + const cfm = cryptFilter?.get("CFM"); + if (!cfm || cfm.name === "None") { return function () { return new NullCipher(); }; - if ("V2" === g.name) + } + if (cfm.name === "V2") { return function () { - return new ARCFourCipher(r.#x(i, a, s, !1)); + return new ARCFourCipher(self.#buildObjectKey(num, gen, key, false)); }; - if ("AESV2" === g.name) + } + if (cfm.name === "AESV2") { return function () { - return new AES128Cipher(r.#x(i, a, s, !0)); + return new AES128Cipher(self.#buildObjectKey(num, gen, key, true)); }; - if ("AESV3" === g.name) + } + if (cfm.name === "AESV3") { return function () { - return new AES256Cipher(s); + return new AES256Cipher(key); }; + } throw new FormatError("Unknown crypto method"); } - constructor(e, t, i) { - const a = e.get("Filter"); - if (!isName(a, "Standard")) + constructor(dict, fileId, password) { + const filter = dict.get("Filter"); + if (!isName(filter, "Standard")) { throw new FormatError("unknown encryption method"); - this.filterName = a.name; - this.dict = e; - const s = e.get("V"); - if (!Number.isInteger(s) || (1 !== s && 2 !== s && 4 !== s && 5 !== s)) + } + this.filterName = filter.name; + this.dict = dict; + const algorithm = dict.get("V"); + if ( + !Number.isInteger(algorithm) || + (algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) + ) { throw new FormatError("unsupported encryption algorithm"); - this.algorithm = s; - let r = e.get("Length"); - if (!r) - if (s <= 3) r = 40; - else { - const t = e.get("CF"), - i = e.get("StmF"); - if (t instanceof Dict && i instanceof Name) { - t.suppressEncryption = !0; - const e = t.get(i.name); - r = e?.get("Length") || 128; - r < 40 && (r <<= 3); + } + this.algorithm = algorithm; + let keyLength = dict.get("Length"); + if (!keyLength) { + if (algorithm <= 3) { + keyLength = 40; + } else { + const cfDict = dict.get("CF"); + const streamCryptoName = dict.get("StmF"); + if (cfDict instanceof Dict && streamCryptoName instanceof Name) { + cfDict.suppressEncryption = true; + const handlerDict = cfDict.get(streamCryptoName.name); + keyLength = handlerDict?.get("Length") || 128; + if (keyLength < 40) { + keyLength <<= 3; + } } } - if (!Number.isInteger(r) || r < 40 || r % 8 != 0) + } + if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) { throw new FormatError("invalid key length"); - const n = stringToBytes(e.get("O")), - g = stringToBytes(e.get("U")), - o = n.subarray(0, 32), - c = g.subarray(0, 32), - C = e.get("P"), - h = e.get("R"), - l = (4 === s || 5 === s) && !1 !== e.get("EncryptMetadata"); - this.encryptMetadata = l; - const Q = stringToBytes(t); - let E, u; - if (i) { - if (6 === h) + } + const ownerBytes = stringToBytes(dict.get("O")), + userBytes = stringToBytes(dict.get("U")); + const ownerPassword = ownerBytes.subarray(0, 32); + const userPassword = userBytes.subarray(0, 32); + const flags = dict.get("P"); + const revision = dict.get("R"); + const encryptMetadata = + (algorithm === 4 || algorithm === 5) && + dict.get("EncryptMetadata") !== false; + this.encryptMetadata = encryptMetadata; + const fileIdBytes = stringToBytes(fileId); + let passwordBytes; + if (password) { + if (revision === 6) { try { - i = utf8StringToString(i); + password = utf8StringToString(password); } catch { warn( "CipherTransformFactory: Unable to convert UTF8 encoded password.", ); } - E = stringToBytes(i); + } + passwordBytes = stringToBytes(password); } - if (5 !== s) u = this.#N(Q, E, o, c, C, h, r, l); - else { - const t = n.subarray(32, 40), - i = n.subarray(40, 48), - a = g.subarray(0, 48), - s = g.subarray(32, 40), - r = g.subarray(40, 48), - C = stringToBytes(e.get("OE")), - l = stringToBytes(e.get("UE")), - Q = stringToBytes(e.get("Perms")); - u = this.#R(h, E, o, t, i, a, c, s, r, C, l, Q); + let encryptionKey; + if (algorithm !== 5) { + encryptionKey = this.#prepareKeyData( + fileIdBytes, + passwordBytes, + ownerPassword, + userPassword, + flags, + revision, + keyLength, + encryptMetadata, + ); + } else { + const ownerValidationSalt = ownerBytes.subarray(32, 40); + const ownerKeySalt = ownerBytes.subarray(40, 48); + const uBytes = userBytes.subarray(0, 48); + const userValidationSalt = userBytes.subarray(32, 40); + const userKeySalt = userBytes.subarray(40, 48); + const ownerEncryption = stringToBytes(dict.get("OE")); + const userEncryption = stringToBytes(dict.get("UE")); + const perms = stringToBytes(dict.get("Perms")); + encryptionKey = this.#createEncryptionKey20( + revision, + passwordBytes, + ownerPassword, + ownerValidationSalt, + ownerKeySalt, + uBytes, + userPassword, + userValidationSalt, + userKeySalt, + ownerEncryption, + userEncryption, + perms, + ); } - if (!u && !i) throw new PasswordException("No password given", it); - if (!u && i) { - const e = this.#G(E, o, h, r); - u = this.#N(Q, e, o, c, C, h, r, l); + if (!encryptionKey && !password) { + throw new PasswordException( + "No password given", + PasswordResponses.NEED_PASSWORD, + ); + } else if (!encryptionKey && password) { + const decodedPassword = this.#decodeUserPassword( + passwordBytes, + ownerPassword, + revision, + keyLength, + ); + encryptionKey = this.#prepareKeyData( + fileIdBytes, + decodedPassword, + ownerPassword, + userPassword, + flags, + revision, + keyLength, + encryptMetadata, + ); } - if (!u) throw new PasswordException("Incorrect Password", at); - this.encryptionKey = u; - if (s >= 4) { - const t = e.get("CF"); - t instanceof Dict && (t.suppressEncryption = !0); - this.cf = t; - this.stmf = e.get("StmF") || Name.get("Identity"); - this.strf = e.get("StrF") || Name.get("Identity"); - this.eff = e.get("EFF") || this.stmf; + if (!encryptionKey) { + throw new PasswordException( + "Incorrect Password", + PasswordResponses.INCORRECT_PASSWORD, + ); + } + this.encryptionKey = encryptionKey; + if (algorithm >= 4) { + const cf = dict.get("CF"); + if (cf instanceof Dict) { + cf.suppressEncryption = true; + } + this.cf = cf; + this.stmf = dict.get("StmF") || Name.get("Identity"); + this.strf = dict.get("StrF") || Name.get("Identity"); + this.eff = dict.get("EFF") || this.stmf; } } - createCipherTransform(e, t) { - if (4 === this.algorithm || 5 === this.algorithm) + createCipherTransform(num, gen) { + if (this.algorithm === 4 || this.algorithm === 5) { return new CipherTransform( - this.#U(this.cf, this.strf, e, t, this.encryptionKey), - this.#U(this.cf, this.stmf, e, t, this.encryptionKey), + this.#buildCipherConstructor( + this.cf, + this.strf, + num, + gen, + this.encryptionKey, + ), + this.#buildCipherConstructor( + this.cf, + this.stmf, + num, + gen, + this.encryptionKey, + ), ); - const i = this.#x(e, t, this.encryptionKey, !1), - cipherConstructor = function () { - return new ARCFourCipher(i); - }; + } + const key = this.#buildObjectKey(num, gen, this.encryptionKey, false); + const cipherConstructor = function () { + return new ARCFourCipher(key); + }; return new CipherTransform(cipherConstructor, cipherConstructor); } -} -async function writeObject(e, t, i, { encrypt: a = null }) { - const s = a?.createCipherTransform(e.num, e.gen); - i.push(`${e.num} ${e.gen} obj\n`); - t instanceof Dict - ? await writeDict(t, i, s) - : t instanceof BaseStream - ? await writeStream(t, i, s) - : (Array.isArray(t) || ArrayBuffer.isView(t)) && - (await writeArray(t, i, s)); - i.push("\nendobj\n"); -} -async function writeDict(e, t, i) { - t.push("<<"); - for (const a of e.getKeys()) { - t.push(` /${escapePDFName(a)} `); - await writeValue(e.getRaw(a), t, i); +} // ./src/core/writer.js + +async function writeObject(ref, obj, buffer, { encrypt = null }) { + const transform = encrypt?.createCipherTransform(ref.num, ref.gen); + buffer.push(`${ref.num} ${ref.gen} obj\n`); + if (obj instanceof Dict) { + await writeDict(obj, buffer, transform); + } else if (obj instanceof BaseStream) { + await writeStream(obj, buffer, transform); + } else if (Array.isArray(obj) || ArrayBuffer.isView(obj)) { + await writeArray(obj, buffer, transform); } - t.push(">>"); + buffer.push("\nendobj\n"); } -async function writeStream(e, t, i) { - let a = e.getBytes(); - const { dict: s } = e, - [r, n] = await Promise.all([ - s.getAsync("Filter"), - s.getAsync("DecodeParms"), - ]), - g = isName( - Array.isArray(r) ? await s.xref.fetchIfRefAsync(r[0]) : r, - "FlateDecode", - ); - if (a.length >= 256 || g) +async function writeDict(dict, buffer, transform) { + buffer.push("<<"); + for (const key of dict.getKeys()) { + buffer.push(` /${escapePDFName(key)} `); + await writeValue(dict.getRaw(key), buffer, transform); + } + buffer.push(">>"); +} +async function writeStream(stream, buffer, transform) { + let bytes = stream.getBytes(); + const { dict } = stream; + const [filter, params] = await Promise.all([ + dict.getAsync("Filter"), + dict.getAsync("DecodeParms"), + ]); + const filterZero = Array.isArray(filter) + ? await dict.xref.fetchIfRefAsync(filter[0]) + : filter; + const isFilterZeroFlateDecode = isName(filterZero, "FlateDecode"); + const MIN_LENGTH_FOR_COMPRESSING = 256; + if (bytes.length >= MIN_LENGTH_FOR_COMPRESSING || isFilterZeroFlateDecode) { try { - const e = new CompressionStream("deflate"), - t = e.writable.getWriter(); - t.write(a); - t.close(); - const i = await new Response(e.readable).arrayBuffer(); - a = new Uint8Array(i); - let o, c; - if (r) { - if (!g) { - o = Array.isArray(r) - ? [Name.get("FlateDecode"), ...r] - : [Name.get("FlateDecode"), r]; - n && (c = Array.isArray(n) ? [null, ...n] : [null, n]); + const cs = new CompressionStream("deflate"); + const writer = cs.writable.getWriter(); + await writer.ready; + writer + .write(bytes) + .then(async () => { + await writer.ready; + await writer.close(); + }) + .catch(() => {}); + const buf = await new Response(cs.readable).arrayBuffer(); + bytes = new Uint8Array(buf); + let newFilter, newParams; + if (!filter) { + newFilter = Name.get("FlateDecode"); + } else if (!isFilterZeroFlateDecode) { + newFilter = Array.isArray(filter) + ? [Name.get("FlateDecode"), ...filter] + : [Name.get("FlateDecode"), filter]; + if (params) { + newParams = Array.isArray(params) + ? [null, ...params] + : [null, params]; } - } else o = Name.get("FlateDecode"); - o && s.set("Filter", o); - c && s.set("DecodeParms", c); - } catch (e) { - info(`writeStream - cannot compress data: "${e}".`); + } + if (newFilter) { + dict.set("Filter", newFilter); + } + if (newParams) { + dict.set("DecodeParms", newParams); + } + } catch (ex) { + info(`writeStream - cannot compress data: "${ex}".`); } - let o = bytesToString(a); - i && (o = i.encryptString(o)); - s.set("Length", o.length); - await writeDict(s, t, i); - t.push(" stream\n", o, "\nendstream"); -} -async function writeArray(e, t, i) { - t.push("["); - let a = !0; - for (const s of e) { - a ? (a = !1) : t.push(" "); - await writeValue(s, t, i); } - t.push("]"); -} -async function writeValue(e, t, i) { - if (e instanceof Name) t.push(`/${escapePDFName(e.name)}`); - else if (e instanceof Ref) t.push(`${e.num} ${e.gen} R`); - else if (Array.isArray(e) || ArrayBuffer.isView(e)) await writeArray(e, t, i); - else if ("string" == typeof e) { - i && (e = i.encryptString(e)); - t.push(`(${escapeString(e)})`); - } else - "number" == typeof e - ? t.push(numberToString(e)) - : "boolean" == typeof e - ? t.push(e.toString()) - : e instanceof Dict - ? await writeDict(e, t, i) - : e instanceof BaseStream - ? await writeStream(e, t, i) - : null === e - ? t.push("null") - : warn( - `Unhandled value in writer: ${typeof e}, please file a bug.`, - ); -} -function writeInt(e, t, i, a) { - for (let s = t + i - 1; s > i - 1; s--) { - a[s] = 255 & e; - e >>= 8; + let string = bytesToString(bytes); + if (transform) { + string = transform.encryptString(string); } - return i + t; + dict.set("Length", string.length); + await writeDict(dict, buffer, transform); + buffer.push(" stream\n", string, "\nendstream"); } -function writeString(e, t, i) { - for (let a = 0, s = e.length; a < s; a++) i[t + a] = 255 & e.charCodeAt(a); +async function writeArray(array, buffer, transform) { + buffer.push("["); + let first = true; + for (const val of array) { + if (!first) { + buffer.push(" "); + } else { + first = false; + } + await writeValue(val, buffer, transform); + } + buffer.push("]"); } -function updateXFA({ xfaData: e, xfaDatasetsRef: t, newRefs: i, xref: a }) { - if (null === e) { - e = (function writeXFADataForAcroform(e, t) { - const i = new SimpleXMLParser({ hasAttributes: !0 }).parseFromString(e); - for (const { xfa: e } of t) { - if (!e) continue; - const { path: t, value: a } = e; - if (!t) continue; - const s = parseXFAPath(t); - let r = i.documentElement.searchNode(s, 0); - !r && s.length > 1 && (r = i.documentElement.searchNode([s.at(-1)], 0)); - r - ? (r.childNodes = Array.isArray(a) - ? a.map((e) => new SimpleDOMNode("value", e)) - : [new SimpleDOMNode("#text", a)]) - : warn(`Node not found for path: ${t}`); - } - const a = []; - i.documentElement.dump(a); - return a.join(""); - })(a.fetchIfRef(t).getString(), i); +async function writeValue(value, buffer, transform) { + if (value instanceof Name) { + buffer.push(`/${escapePDFName(value.name)}`); + } else if (value instanceof Ref) { + buffer.push(`${value.num} ${value.gen} R`); + } else if (Array.isArray(value) || ArrayBuffer.isView(value)) { + await writeArray(value, buffer, transform); + } else if (typeof value === "string") { + if (transform) { + value = transform.encryptString(value); + } + buffer.push(`(${escapeString(value)})`); + } else if (typeof value === "number") { + buffer.push(numberToString(value)); + } else if (typeof value === "boolean") { + buffer.push(value.toString()); + } else if (value instanceof Dict) { + await writeDict(value, buffer, transform); + } else if (value instanceof BaseStream) { + await writeStream(value, buffer, transform); + } else if (value === null) { + buffer.push("null"); + } else { + warn(`Unhandled value in writer: ${typeof value}, please file a bug.`); } - const s = a.encrypt; - if (s) { - e = s.createCipherTransform(t.num, t.gen).encryptString(e); +} +function writeInt(number, size, offset, buffer) { + for (let i = size + offset - 1; i > offset - 1; i--) { + buffer[i] = number & 0xff; + number >>= 8; } - const r = - `${t.num} ${t.gen} obj\n<< /Type /EmbeddedFile /Length ${e.length}>>\nstream\n` + - e + + return offset + size; +} +function writeString(string, offset, buffer) { + for (let i = 0, len = string.length; i < len; i++) { + buffer[offset + i] = string.charCodeAt(i) & 0xff; + } +} +function computeMD5(filesize, xrefInfo) { + const time = Math.floor(Date.now() / 1000); + const filename = xrefInfo.filename || ""; + const md5Buffer = [time.toString(), filename, filesize.toString()]; + let md5BufferLen = md5Buffer.reduce((a, str) => a + str.length, 0); + for (const value of Object.values(xrefInfo.info)) { + md5Buffer.push(value); + md5BufferLen += value.length; + } + const array = new Uint8Array(md5BufferLen); + let offset = 0; + for (const str of md5Buffer) { + writeString(str, offset, array); + offset += str.length; + } + return bytesToString(calculateMD5(array)); +} +function writeXFADataForAcroform(str, newRefs) { + const xml = new SimpleXMLParser({ + hasAttributes: true, + }).parseFromString(str); + for (const { xfa } of newRefs) { + if (!xfa) { + continue; + } + const { path, value } = xfa; + if (!path) { + continue; + } + const nodePath = parseXFAPath(path); + let node = xml.documentElement.searchNode(nodePath, 0); + if (!node && nodePath.length > 1) { + node = xml.documentElement.searchNode([nodePath.at(-1)], 0); + } + if (node) { + node.childNodes = Array.isArray(value) + ? value.map((val) => new SimpleDOMNode("value", val)) + : [new SimpleDOMNode("#text", value)]; + } else { + warn(`Node not found for path: ${path}`); + } + } + const buffer = []; + xml.documentElement.dump(buffer); + return buffer.join(""); +} +async function updateAcroform({ + xref, + acroForm, + acroFormRef, + hasXfa, + hasXfaDatasetsEntry, + xfaDatasetsRef, + needAppearances, + newRefs, +}) { + if (hasXfa && !hasXfaDatasetsEntry && !xfaDatasetsRef) { + warn("XFA - Cannot save it"); + } + if (!needAppearances && (!hasXfa || !xfaDatasetsRef || hasXfaDatasetsEntry)) { + return; + } + const dict = acroForm.clone(); + if (hasXfa && !hasXfaDatasetsEntry) { + const newXfa = acroForm.get("XFA").slice(); + newXfa.splice(2, 0, "datasets"); + newXfa.splice(3, 0, xfaDatasetsRef); + dict.set("XFA", newXfa); + } + if (needAppearances) { + dict.set("NeedAppearances", true); + } + const buffer = []; + await writeObject(acroFormRef, dict, buffer, xref); + newRefs.push({ + ref: acroFormRef, + data: buffer.join(""), + }); +} +function updateXFA({ xfaData, xfaDatasetsRef, newRefs, xref }) { + if (xfaData === null) { + const datasets = xref.fetchIfRef(xfaDatasetsRef); + xfaData = writeXFADataForAcroform(datasets.getString(), newRefs); + } + const encrypt = xref.encrypt; + if (encrypt) { + const transform = encrypt.createCipherTransform( + xfaDatasetsRef.num, + xfaDatasetsRef.gen, + ); + xfaData = transform.encryptString(xfaData); + } + const data = + `${xfaDatasetsRef.num} ${xfaDatasetsRef.gen} obj\n` + + `<< /Type /EmbeddedFile /Length ${xfaData.length}>>\nstream\n` + + xfaData + "\nendstream\nendobj\n"; - i.push({ ref: t, data: r }); + newRefs.push({ + ref: xfaDatasetsRef, + data, + }); } -function getIndexes(e) { - const t = []; - for (const { ref: i } of e) - i.num === t.at(-2) + t.at(-1) ? (t[t.length - 1] += 1) : t.push(i.num, 1); - return t; -} -function computeIDs(e, t, i) { - if (Array.isArray(t.fileIds) && t.fileIds.length > 0) { - const a = (function computeMD5(e, t) { - const i = Math.floor(Date.now() / 1e3), - a = t.filename || "", - s = [i.toString(), a, e.toString()]; - let r = s.reduce((e, t) => e + t.length, 0); - for (const e of Object.values(t.info)) { - s.push(e); - r += e.length; - } - const n = new Uint8Array(r); - let g = 0; - for (const e of s) { - writeString(e, g, n); - g += e.length; - } - return bytesToString(Hs(n)); - })(e, t); - i.set("ID", [t.fileIds[0], a]); +async function getXRefTable(xrefInfo, baseOffset, newRefs, newXref, buffer) { + buffer.push("xref\n"); + const indexes = getIndexes(newRefs); + let indexesPosition = 0; + for (const { ref, data } of newRefs) { + if (ref.num === indexes[indexesPosition]) { + buffer.push( + `${indexes[indexesPosition]} ${indexes[indexesPosition + 1]}\n`, + ); + indexesPosition += 2; + } + if (data !== null) { + buffer.push( + `${baseOffset.toString().padStart(10, "0")} ${Math.min(ref.gen, 0xffff).toString().padStart(5, "0")} n\r\n`, + ); + baseOffset += data.length; + } else { + buffer.push( + `0000000000 ${Math.min(ref.gen + 1, 0xffff) + .toString() + .padStart(5, "0")} f\r\n`, + ); + } } + computeIDs(baseOffset, xrefInfo, newXref); + buffer.push("trailer\n"); + await writeDict(newXref, buffer); + buffer.push("\nstartxref\n", baseOffset.toString(), "\n%%EOF\n"); +} +function getIndexes(newRefs) { + const indexes = []; + for (const { ref } of newRefs) { + if (ref.num === indexes.at(-2) + indexes.at(-1)) { + indexes[indexes.length - 1] += 1; + } else { + indexes.push(ref.num, 1); + } + } + return indexes; +} +async function getXRefStreamTable( + xrefInfo, + baseOffset, + newRefs, + newXref, + buffer, +) { + const xrefTableData = []; + let maxOffset = 0; + let maxGen = 0; + for (const { ref, data } of newRefs) { + let gen; + maxOffset = Math.max(maxOffset, baseOffset); + if (data !== null) { + gen = Math.min(ref.gen, 0xffff); + xrefTableData.push([1, baseOffset, gen]); + baseOffset += data.length; + } else { + gen = Math.min(ref.gen + 1, 0xffff); + xrefTableData.push([0, 0, gen]); + } + maxGen = Math.max(maxGen, gen); + } + newXref.set("Index", getIndexes(newRefs)); + const offsetSize = getSizeInBytes(maxOffset); + const maxGenSize = getSizeInBytes(maxGen); + const sizes = [1, offsetSize, maxGenSize]; + newXref.set("W", sizes); + computeIDs(baseOffset, xrefInfo, newXref); + const structSize = sizes.reduce((a, x) => a + x, 0); + const data = new Uint8Array(structSize * xrefTableData.length); + const stream = new Stream(data); + stream.dict = newXref; + let offset = 0; + for (const [type, objOffset, gen] of xrefTableData) { + offset = writeInt(type, sizes[0], offset, data); + offset = writeInt(objOffset, sizes[1], offset, data); + offset = writeInt(gen, sizes[2], offset, data); + } + await writeObject(xrefInfo.newRef, stream, buffer, {}); + buffer.push("startxref\n", baseOffset.toString(), "\n%%EOF\n"); +} +function computeIDs(baseOffset, xrefInfo, newXref) { + if (Array.isArray(xrefInfo.fileIds) && xrefInfo.fileIds.length > 0) { + const md5 = computeMD5(baseOffset, xrefInfo); + newXref.set("ID", [xrefInfo.fileIds[0], md5]); + } +} +function getTrailerDict(xrefInfo, newRefs, useXrefStream) { + const newXref = new Dict(null); + newXref.set("Prev", xrefInfo.startXRef); + const refForXrefTable = xrefInfo.newRef; + if (useXrefStream) { + newRefs.push({ + ref: refForXrefTable, + data: "", + }); + newXref.set("Size", refForXrefTable.num + 1); + newXref.set("Type", Name.get("XRef")); + } else { + newXref.set("Size", refForXrefTable.num); + } + if (xrefInfo.rootRef !== null) { + newXref.set("Root", xrefInfo.rootRef); + } + if (xrefInfo.infoRef !== null) { + newXref.set("Info", xrefInfo.infoRef); + } + if (xrefInfo.encryptRef !== null) { + newXref.set("Encrypt", xrefInfo.encryptRef); + } + return newXref; } async function incrementalUpdate({ - originalData: e, - xrefInfo: t, - newRefs: i, - xref: a = null, - hasXfa: s = !1, - xfaDatasetsRef: r = null, - hasXfaDatasetsEntry: n = !1, - needAppearances: g, - acroFormRef: o = null, - acroForm: c = null, - xfaData: C = null, - useXrefStream: h = !1, + originalData, + xrefInfo, + newRefs, + xref = null, + hasXfa = false, + xfaDatasetsRef = null, + hasXfaDatasetsEntry = false, + needAppearances, + acroFormRef = null, + acroForm = null, + xfaData = null, + useXrefStream = false, }) { - await (async function updateAcroform({ - xref: e, - acroForm: t, - acroFormRef: i, - hasXfa: a, - hasXfaDatasetsEntry: s, - xfaDatasetsRef: r, - needAppearances: n, - newRefs: g, - }) { - !a || s || r || warn("XFA - Cannot save it"); - if (!n && (!a || !r || s)) return; - const o = t.clone(); - if (a && !s) { - const e = t.get("XFA").slice(); - e.splice(2, 0, "datasets"); - e.splice(3, 0, r); - o.set("XFA", e); - } - n && o.set("NeedAppearances", !0); - const c = []; - await writeObject(i, o, c, e); - g.push({ ref: i, data: c.join("") }); - })({ - xref: a, - acroForm: c, - acroFormRef: o, - hasXfa: s, - hasXfaDatasetsEntry: n, - xfaDatasetsRef: r, - needAppearances: g, - newRefs: i, + await updateAcroform({ + xref, + acroForm, + acroFormRef, + hasXfa, + hasXfaDatasetsEntry, + xfaDatasetsRef, + needAppearances, + newRefs, }); - s && updateXFA({ xfaData: C, xfaDatasetsRef: r, newRefs: i, xref: a }); - const l = []; - let Q = e.length; - const E = e.at(-1); - if (10 !== E && 13 !== E) { - l.push("\n"); - Q += 1; + if (hasXfa) { + updateXFA({ + xfaData, + xfaDatasetsRef, + newRefs, + xref, + }); } - const u = (function getTrailerDict(e, t, i) { - const a = new Dict(null); - a.set("Prev", e.startXRef); - const s = e.newRef; - if (i) { - t.push({ ref: s, data: "" }); - a.set("Size", s.num + 1); - a.set("Type", Name.get("XRef")); - } else a.set("Size", s.num); - null !== e.rootRef && a.set("Root", e.rootRef); - null !== e.infoRef && a.set("Info", e.infoRef); - null !== e.encryptRef && a.set("Encrypt", e.encryptRef); - return a; - })(t, i, h); - i = i.sort((e, t) => e.ref.num - t.ref.num); - for (const { data: e } of i) null !== e && l.push(e); - await (h - ? (async function getXRefStreamTable(e, t, i, a, s) { - const r = []; - let n = 0, - g = 0; - for (const { ref: e, data: a } of i) { - let i; - n = Math.max(n, t); - if (null !== a) { - i = Math.min(e.gen, 65535); - r.push([1, t, i]); - t += a.length; - } else { - i = Math.min(e.gen + 1, 65535); - r.push([0, 0, i]); - } - g = Math.max(g, i); - } - a.set("Index", getIndexes(i)); - const o = [1, getSizeInBytes(n), getSizeInBytes(g)]; - a.set("W", o); - computeIDs(t, e, a); - const c = o.reduce((e, t) => e + t, 0), - C = new Uint8Array(c * r.length), - h = new Stream(C); - h.dict = a; - let l = 0; - for (const [e, t, i] of r) { - l = writeInt(e, o[0], l, C); - l = writeInt(t, o[1], l, C); - l = writeInt(i, o[2], l, C); - } - await writeObject(e.newRef, h, s, {}); - s.push("startxref\n", t.toString(), "\n%%EOF\n"); - })(t, Q, i, u, l) - : (async function getXRefTable(e, t, i, a, s) { - s.push("xref\n"); - const r = getIndexes(i); - let n = 0; - for (const { ref: e, data: a } of i) { - if (e.num === r[n]) { - s.push(`${r[n]} ${r[n + 1]}\n`); - n += 2; - } - if (null !== a) { - s.push( - `${t.toString().padStart(10, "0")} ${Math.min(e.gen, 65535).toString().padStart(5, "0")} n\r\n`, - ); - t += a.length; - } else - s.push( - `0000000000 ${Math.min(e.gen + 1, 65535) - .toString() - .padStart(5, "0")} f\r\n`, - ); - } - computeIDs(t, e, a); - s.push("trailer\n"); - await writeDict(a, s); - s.push("\nstartxref\n", t.toString(), "\n%%EOF\n"); - })(t, Q, i, u, l)); - const d = l.reduce((e, t) => e + t.length, e.length), - f = new Uint8Array(d); - f.set(e); - let p = e.length; - for (const e of l) { - writeString(e, p, f); - p += e.length; + const buffer = []; + let baseOffset = originalData.length; + const lastByte = originalData.at(-1); + if (lastByte !== 0x0a && lastByte !== 0x0d) { + buffer.push("\n"); + baseOffset += 1; } - return f; -} -const vs = 1, - Ks = 2, - Ts = 3, - qs = 4, - Os = 5; + const newXref = getTrailerDict(xrefInfo, newRefs, useXrefStream); + newRefs = newRefs.sort((a, b) => a.ref.num - b.ref.num); + for (const { data } of newRefs) { + if (data !== null) { + buffer.push(data); + } + } + await (useXrefStream + ? getXRefStreamTable(xrefInfo, baseOffset, newRefs, newXref, buffer) + : getXRefTable(xrefInfo, baseOffset, newRefs, newXref, buffer)); + const totalLength = buffer.reduce( + (a, str) => a + str.length, + originalData.length, + ); + const array = new Uint8Array(totalLength); + array.set(originalData); + let offset = originalData.length; + for (const str of buffer) { + writeString(str, offset, array); + offset += str.length; + } + return array; +} // ./src/core/struct_tree.js + +const MAX_DEPTH = 40; +const StructElementType = { + PAGE_CONTENT: 1, + STREAM_CONTENT: 2, + OBJECT: 3, + ANNOTATION: 4, + ELEMENT: 5, +}; class StructTreeRoot { - constructor(e, t) { - this.dict = e; - this.ref = t instanceof Ref ? t : null; + constructor(rootDict, rootRef) { + this.dict = rootDict; + this.ref = rootRef instanceof Ref ? rootRef : null; this.roleMap = new Map(); this.structParentIds = null; } init() { this.readRoleMap(); } - #M(e, t, i) { - if (!(e instanceof Ref) || t < 0) return; - this.structParentIds ||= new RefSetCache(); - let a = this.structParentIds.get(e); - if (!a) { - a = []; - this.structParentIds.put(e, a); - } - a.push([t, i]); - } - addAnnotationIdToPage(e, t) { - this.#M(e, t, qs); - } - readRoleMap() { - const e = this.dict.get("RoleMap"); - e instanceof Dict && - e.forEach((e, t) => { - t instanceof Name && this.roleMap.set(e, t.name); - }); - } - static async canCreateStructureTree({ - catalogRef: e, - pdfManager: t, - newAnnotationsByPage: i, - }) { - if (!(e instanceof Ref)) { - warn("Cannot save the struct tree: no catalog reference."); - return !1; - } - let a = 0, - s = !0; - for (const [e, r] of i) { - const { ref: i } = await t.getPage(e); - if (!(i instanceof Ref)) { - warn(`Cannot save the struct tree: page ${e} has no ref.`); - s = !0; - break; - } - for (const e of r) - if (e.accessibilityData?.type) { - e.parentTreeId = a++; - s = !1; - } - } - if (s) { - for (const e of i.values()) for (const t of e) delete t.parentTreeId; - return !1; - } - return !0; - } - static async createStructureTree({ - newAnnotationsByPage: e, - xref: t, - catalogRef: i, - pdfManager: a, - newRefs: s, - }) { - const r = a.catalog.cloneDict(), - n = new RefSetCache(); - n.put(i, r); - const g = t.getNewTemporaryRef(); - r.set("StructTreeRoot", g); - const o = new Dict(t); - o.set("Type", Name.get("StructTreeRoot")); - const c = t.getNewTemporaryRef(); - o.set("ParentTree", c); - const C = []; - o.set("K", C); - n.put(g, o); - const h = new Dict(t), - l = []; - h.set("Nums", l); - const Q = await this.#L({ - newAnnotationsByPage: e, - structTreeRootRef: g, - kids: C, - nums: l, - xref: t, - pdfManager: a, - cache: n, - }); - o.set("ParentTreeNextKey", Q); - n.put(c, h); - const E = []; - for (const [e, i] of n.items()) { - E.length = 0; - await writeObject(e, i, E, t); - s.push({ ref: e, data: E.join("") }); - } - } - async canUpdateStructTree({ - pdfManager: e, - xref: t, - newAnnotationsByPage: i, - }) { - if (!this.ref) { - warn("Cannot update the struct tree: no root reference."); - return !1; - } - let a = this.dict.get("ParentTreeNextKey"); - if (!Number.isInteger(a) || a < 0) { - warn("Cannot update the struct tree: invalid next key."); - return !1; - } - const s = this.dict.get("ParentTree"); - if (!(s instanceof Dict)) { - warn("Cannot update the struct tree: ParentTree isn't a dict."); - return !1; - } - const r = s.get("Nums"); - if (!Array.isArray(r)) { - warn("Cannot update the struct tree: nums isn't an array."); - return !1; - } - const n = new NumberTree(s, t); - for (const t of i.keys()) { - const { pageDict: i } = await e.getPage(t); - if (!i.has("StructParents")) continue; - const a = i.get("StructParents"); - if (!Number.isInteger(a) || !Array.isArray(n.get(a))) { - warn(`Cannot save the struct tree: page ${t} has a wrong id.`); - return !1; - } - } - let g = !0; - for (const [t, s] of i) { - const { pageDict: i } = await e.getPage(t); - StructTreeRoot.#H({ - elements: s, - xref: this.dict.xref, - pageDict: i, - numberTree: n, - }); - for (const e of s) - if (e.accessibilityData?.type) { - e.parentTreeId = a++; - g = !1; - } - } - if (g) { - for (const e of i.values()) - for (const t of e) { - delete t.parentTreeId; - delete t.structTreeParent; - } - return !1; - } - return !0; - } - async updateStructureTree({ - newAnnotationsByPage: e, - pdfManager: t, - newRefs: i, - }) { - const a = this.dict.xref, - s = this.dict.clone(), - r = this.ref, - n = new RefSetCache(); - n.put(r, s); - let g, - o = s.getRaw("ParentTree"); - if (o instanceof Ref) g = a.fetch(o); - else { - g = o; - o = a.getNewTemporaryRef(); - s.set("ParentTree", o); - } - g = g.clone(); - n.put(o, g); - let c = g.getRaw("Nums"), - C = null; - if (c instanceof Ref) { - C = c; - c = a.fetch(C); - } - c = c.slice(); - C || g.set("Nums", c); - const h = await StructTreeRoot.#L({ - newAnnotationsByPage: e, - structTreeRootRef: r, - kids: null, - nums: c, - xref: a, - pdfManager: t, - cache: n, - }); - s.set("ParentTreeNextKey", h); - C && n.put(C, c); - const l = []; - for (const [e, t] of n.items()) { - l.length = 0; - await writeObject(e, t, l, a); - i.push({ ref: e, data: l.join("") }); - } - } - static async #L({ - newAnnotationsByPage: e, - structTreeRootRef: t, - kids: i, - nums: a, - xref: s, - pdfManager: r, - cache: n, - }) { - const g = Name.get("OBJR"); - let o = -1 / 0; - for (const [c, C] of e) { - const { ref: e } = await r.getPage(c), - h = e instanceof Ref; - for (const { - accessibilityData: r, - ref: c, - parentTreeId: l, - structTreeParent: Q, - } of C) { - if (!r?.type) continue; - const { - type: C, - title: E, - lang: u, - alt: d, - expanded: f, - actualText: p, - } = r; - o = Math.max(o, l); - const m = s.getNewTemporaryRef(), - y = new Dict(s); - y.set("S", Name.get(C)); - E && y.set("T", E); - u && y.set("Lang", u); - d && y.set("Alt", d); - f && y.set("E", f); - p && y.set("ActualText", p); - await this.#J({ - structTreeParent: Q, - tagDict: y, - newTagRef: m, - structTreeRootRef: t, - fallbackKids: i, - xref: s, - cache: n, - }); - const w = new Dict(s); - y.set("K", w); - w.set("Type", g); - h && w.set("Pg", e); - w.set("Obj", c); - n.put(m, y); - a.push(l, m); - } - } - return o + 1; - } - static #H({ elements: e, xref: t, pageDict: i, numberTree: a }) { - const s = new Map(); - for (const t of e) - if (t.structTreeParentId) { - const e = parseInt(t.structTreeParentId.split("_mc")[1], 10); - let i = s.get(e); - if (!i) { - i = []; - s.set(e, i); - } - i.push(t); - } - const r = i.get("StructParents"); - if (!Number.isInteger(r)) return; - const n = a.get(r), - updateElement = (e, i, a) => { - const r = s.get(e); - if (r) { - const e = i.getRaw("P"), - s = t.fetchIfRef(e); - if (e instanceof Ref && s instanceof Dict) { - const e = { ref: a, dict: i }; - for (const t of r) t.structTreeParent = e; - } - return !0; - } - return !1; - }; - for (const e of n) { - if (!(e instanceof Ref)) continue; - const i = t.fetch(e), - a = i.get("K"); - if (Number.isInteger(a)) updateElement(a, i, e); - else if (Array.isArray(a)) - for (let s of a) { - s = t.fetchIfRef(s); - if (Number.isInteger(s) && updateElement(s, i, e)) break; - if (!(s instanceof Dict)) continue; - if (!isName(s.get("Type"), "MCR")) break; - const a = s.get("MCID"); - if (Number.isInteger(a) && updateElement(a, i, e)) break; - } - } - } - static async #J({ - structTreeParent: e, - tagDict: t, - newTagRef: i, - structTreeRootRef: a, - fallbackKids: s, - xref: r, - cache: n, - }) { - let g, - o = null; - if (e) { - ({ ref: o } = e); - g = e.dict.getRaw("P") || a; - } else g = a; - t.set("P", g); - const c = r.fetchIfRef(g); - if (!c) { - s.push(i); + #addIdToPage(pageRef, id, type) { + if (!(pageRef instanceof Ref) || id < 0) { return; } - let C = n.get(g); - if (!C) { - C = c.clone(); - n.put(g, C); + this.structParentIds ||= new RefSetCache(); + let ids = this.structParentIds.get(pageRef); + if (!ids) { + ids = []; + this.structParentIds.put(pageRef, ids); } - const h = C.getRaw("K"); - let l = h instanceof Ref ? n.get(h) : null; - if (!l) { - l = r.fetchIfRef(h); - l = Array.isArray(l) ? l.slice() : [h]; - const e = r.getNewTemporaryRef(); - C.set("K", e); - n.put(e, l); + ids.push([id, type]); + } + addAnnotationIdToPage(pageRef, id) { + this.#addIdToPage(pageRef, id, StructElementType.ANNOTATION); + } + readRoleMap() { + const roleMapDict = this.dict.get("RoleMap"); + if (!(roleMapDict instanceof Dict)) { + return; } - const Q = l.indexOf(o); - l.splice(Q >= 0 ? Q + 1 : l.length, 0, i); + roleMapDict.forEach((key, value) => { + if (!(value instanceof Name)) { + return; + } + this.roleMap.set(key, value.name); + }); + } + static async canCreateStructureTree({ + catalogRef, + pdfManager, + newAnnotationsByPage, + }) { + if (!(catalogRef instanceof Ref)) { + warn("Cannot save the struct tree: no catalog reference."); + return false; + } + let nextKey = 0; + let hasNothingToUpdate = true; + for (const [pageIndex, elements] of newAnnotationsByPage) { + const { ref: pageRef } = await pdfManager.getPage(pageIndex); + if (!(pageRef instanceof Ref)) { + warn(`Cannot save the struct tree: page ${pageIndex} has no ref.`); + hasNothingToUpdate = true; + break; + } + for (const element of elements) { + if (element.accessibilityData?.type) { + element.parentTreeId = nextKey++; + hasNothingToUpdate = false; + } + } + } + if (hasNothingToUpdate) { + for (const elements of newAnnotationsByPage.values()) { + for (const element of elements) { + delete element.parentTreeId; + } + } + return false; + } + return true; + } + static async createStructureTree({ + newAnnotationsByPage, + xref, + catalogRef, + pdfManager, + newRefs, + }) { + const root = pdfManager.catalog.cloneDict(); + const cache = new RefSetCache(); + cache.put(catalogRef, root); + const structTreeRootRef = xref.getNewTemporaryRef(); + root.set("StructTreeRoot", structTreeRootRef); + const structTreeRoot = new Dict(xref); + structTreeRoot.set("Type", Name.get("StructTreeRoot")); + const parentTreeRef = xref.getNewTemporaryRef(); + structTreeRoot.set("ParentTree", parentTreeRef); + const kids = []; + structTreeRoot.set("K", kids); + cache.put(structTreeRootRef, structTreeRoot); + const parentTree = new Dict(xref); + const nums = []; + parentTree.set("Nums", nums); + const nextKey = await this.#writeKids({ + newAnnotationsByPage, + structTreeRootRef, + structTreeRoot: null, + kids, + nums, + xref, + pdfManager, + newRefs, + cache, + }); + structTreeRoot.set("ParentTreeNextKey", nextKey); + cache.put(parentTreeRef, parentTree); + const buffer = []; + for (const [ref, obj] of cache.items()) { + buffer.length = 0; + await writeObject(ref, obj, buffer, xref); + newRefs.push({ + ref, + data: buffer.join(""), + }); + } + } + async canUpdateStructTree({ pdfManager, xref, newAnnotationsByPage }) { + if (!this.ref) { + warn("Cannot update the struct tree: no root reference."); + return false; + } + let nextKey = this.dict.get("ParentTreeNextKey"); + if (!Number.isInteger(nextKey) || nextKey < 0) { + warn("Cannot update the struct tree: invalid next key."); + return false; + } + const parentTree = this.dict.get("ParentTree"); + if (!(parentTree instanceof Dict)) { + warn("Cannot update the struct tree: ParentTree isn't a dict."); + return false; + } + const nums = parentTree.get("Nums"); + if (!Array.isArray(nums)) { + warn("Cannot update the struct tree: nums isn't an array."); + return false; + } + const numberTree = new NumberTree(parentTree, xref); + for (const pageIndex of newAnnotationsByPage.keys()) { + const { pageDict } = await pdfManager.getPage(pageIndex); + if (!pageDict.has("StructParents")) { + continue; + } + const id = pageDict.get("StructParents"); + if (!Number.isInteger(id) || !Array.isArray(numberTree.get(id))) { + warn(`Cannot save the struct tree: page ${pageIndex} has a wrong id.`); + return false; + } + } + let hasNothingToUpdate = true; + for (const [pageIndex, elements] of newAnnotationsByPage) { + const { pageDict } = await pdfManager.getPage(pageIndex); + StructTreeRoot.#collectParents({ + elements, + xref: this.dict.xref, + pageDict, + numberTree, + }); + for (const element of elements) { + if (element.accessibilityData?.type) { + if (!(element.accessibilityData.structParent >= 0)) { + element.parentTreeId = nextKey++; + } + hasNothingToUpdate = false; + } + } + } + if (hasNothingToUpdate) { + for (const elements of newAnnotationsByPage.values()) { + for (const element of elements) { + delete element.parentTreeId; + delete element.structTreeParent; + } + } + return false; + } + return true; + } + async updateStructureTree({ newAnnotationsByPage, pdfManager, newRefs }) { + const xref = this.dict.xref; + const structTreeRoot = this.dict.clone(); + const structTreeRootRef = this.ref; + const cache = new RefSetCache(); + cache.put(structTreeRootRef, structTreeRoot); + let parentTreeRef = structTreeRoot.getRaw("ParentTree"); + let parentTree; + if (parentTreeRef instanceof Ref) { + parentTree = xref.fetch(parentTreeRef); + } else { + parentTree = parentTreeRef; + parentTreeRef = xref.getNewTemporaryRef(); + structTreeRoot.set("ParentTree", parentTreeRef); + } + parentTree = parentTree.clone(); + cache.put(parentTreeRef, parentTree); + let nums = parentTree.getRaw("Nums"); + let numsRef = null; + if (nums instanceof Ref) { + numsRef = nums; + nums = xref.fetch(numsRef); + } + nums = nums.slice(); + if (!numsRef) { + parentTree.set("Nums", nums); + } + const newNextKey = await StructTreeRoot.#writeKids({ + newAnnotationsByPage, + structTreeRootRef, + structTreeRoot: this, + kids: null, + nums, + xref, + pdfManager, + newRefs, + cache, + }); + if (newNextKey === -1) { + return; + } + structTreeRoot.set("ParentTreeNextKey", newNextKey); + if (numsRef) { + cache.put(numsRef, nums); + } + const buffer = []; + for (const [ref, obj] of cache.items()) { + buffer.length = 0; + await writeObject(ref, obj, buffer, xref); + newRefs.push({ + ref, + data: buffer.join(""), + }); + } + } + static async #writeKids({ + newAnnotationsByPage, + structTreeRootRef, + structTreeRoot, + kids, + nums, + xref, + pdfManager, + newRefs, + cache, + }) { + const objr = Name.get("OBJR"); + let nextKey = -1; + let structTreePageObjs; + const buffer = []; + for (const [pageIndex, elements] of newAnnotationsByPage) { + const page = await pdfManager.getPage(pageIndex); + const { ref: pageRef } = page; + const isPageRef = pageRef instanceof Ref; + for (const { + accessibilityData, + ref, + parentTreeId, + structTreeParent, + } of elements) { + if (!accessibilityData?.type) { + continue; + } + const { structParent } = accessibilityData; + if ( + structTreeRoot && + Number.isInteger(structParent) && + structParent >= 0 + ) { + let objs = (structTreePageObjs ||= new Map()).get(pageIndex); + if (objs === undefined) { + const structTreePage = new StructTreePage( + structTreeRoot, + page.pageDict, + ); + objs = structTreePage.collectObjects(pageRef); + structTreePageObjs.set(pageIndex, objs); + } + const objRef = objs?.get(structParent); + if (objRef) { + const tagDict = xref.fetch(objRef).clone(); + StructTreeRoot.#writeProperties(tagDict, accessibilityData); + buffer.length = 0; + await writeObject(objRef, tagDict, buffer, xref); + newRefs.push({ + ref: objRef, + data: buffer.join(""), + }); + continue; + } + } + nextKey = Math.max(nextKey, parentTreeId); + const tagRef = xref.getNewTemporaryRef(); + const tagDict = new Dict(xref); + StructTreeRoot.#writeProperties(tagDict, accessibilityData); + await this.#updateParentTag({ + structTreeParent, + tagDict, + newTagRef: tagRef, + structTreeRootRef, + fallbackKids: kids, + xref, + cache, + }); + const objDict = new Dict(xref); + tagDict.set("K", objDict); + objDict.set("Type", objr); + if (isPageRef) { + objDict.set("Pg", pageRef); + } + objDict.set("Obj", ref); + cache.put(tagRef, tagDict); + nums.push(parentTreeId, tagRef); + } + } + return nextKey + 1; + } + static #writeProperties( + tagDict, + { type, title, lang, alt, expanded, actualText }, + ) { + tagDict.set("S", Name.get(type)); + if (title) { + tagDict.set("T", stringToAsciiOrUTF16BE(title)); + } + if (lang) { + tagDict.set("Lang", stringToAsciiOrUTF16BE(lang)); + } + if (alt) { + tagDict.set("Alt", stringToAsciiOrUTF16BE(alt)); + } + if (expanded) { + tagDict.set("E", stringToAsciiOrUTF16BE(expanded)); + } + if (actualText) { + tagDict.set("ActualText", stringToAsciiOrUTF16BE(actualText)); + } + } + static #collectParents({ elements, xref, pageDict, numberTree }) { + const idToElements = new Map(); + for (const element of elements) { + if (element.structTreeParentId) { + const id = parseInt(element.structTreeParentId.split("_mc")[1], 10); + let elems = idToElements.get(id); + if (!elems) { + elems = []; + idToElements.set(id, elems); + } + elems.push(element); + } + } + const id = pageDict.get("StructParents"); + if (!Number.isInteger(id)) { + return; + } + const parentArray = numberTree.get(id); + const updateElement = (kid, pageKid, kidRef) => { + const elems = idToElements.get(kid); + if (elems) { + const parentRef = pageKid.getRaw("P"); + const parentDict = xref.fetchIfRef(parentRef); + if (parentRef instanceof Ref && parentDict instanceof Dict) { + const params = { + ref: kidRef, + dict: pageKid, + }; + for (const element of elems) { + element.structTreeParent = params; + } + } + return true; + } + return false; + }; + for (const kidRef of parentArray) { + if (!(kidRef instanceof Ref)) { + continue; + } + const pageKid = xref.fetch(kidRef); + const k = pageKid.get("K"); + if (Number.isInteger(k)) { + updateElement(k, pageKid, kidRef); + continue; + } + if (!Array.isArray(k)) { + continue; + } + for (let kid of k) { + kid = xref.fetchIfRef(kid); + if (Number.isInteger(kid) && updateElement(kid, pageKid, kidRef)) { + break; + } + if (!(kid instanceof Dict)) { + continue; + } + if (!isName(kid.get("Type"), "MCR")) { + break; + } + const mcid = kid.get("MCID"); + if (Number.isInteger(mcid) && updateElement(mcid, pageKid, kidRef)) { + break; + } + } + } + } + static async #updateParentTag({ + structTreeParent, + tagDict, + newTagRef, + structTreeRootRef, + fallbackKids, + xref, + cache, + }) { + let ref = null; + let parentRef; + if (structTreeParent) { + ({ ref } = structTreeParent); + parentRef = structTreeParent.dict.getRaw("P") || structTreeRootRef; + } else { + parentRef = structTreeRootRef; + } + tagDict.set("P", parentRef); + const parentDict = xref.fetchIfRef(parentRef); + if (!parentDict) { + fallbackKids.push(newTagRef); + return; + } + let cachedParentDict = cache.get(parentRef); + if (!cachedParentDict) { + cachedParentDict = parentDict.clone(); + cache.put(parentRef, cachedParentDict); + } + const parentKidsRaw = cachedParentDict.getRaw("K"); + let cachedParentKids = + parentKidsRaw instanceof Ref ? cache.get(parentKidsRaw) : null; + if (!cachedParentKids) { + cachedParentKids = xref.fetchIfRef(parentKidsRaw); + cachedParentKids = Array.isArray(cachedParentKids) + ? cachedParentKids.slice() + : [parentKidsRaw]; + const parentKidsRef = xref.getNewTemporaryRef(); + cachedParentDict.set("K", parentKidsRef); + cache.put(parentKidsRef, cachedParentKids); + } + const index = cachedParentKids.indexOf(ref); + cachedParentKids.splice( + index >= 0 ? index + 1 : cachedParentKids.length, + 0, + newTagRef, + ); } } class StructElementNode { - constructor(e, t) { - this.tree = e; - this.dict = t; + constructor(tree, dict) { + this.tree = tree; + this.dict = dict; this.kids = []; this.parseKids(); } get role() { - const e = this.dict.get("S"), - t = e instanceof Name ? e.name : "", - { root: i } = this.tree; - return i.roleMap.has(t) ? i.roleMap.get(t) : t; + const nameObj = this.dict.get("S"); + const name = nameObj instanceof Name ? nameObj.name : ""; + const { root } = this.tree; + if (root.roleMap.has(name)) { + return root.roleMap.get(name); + } + return name; } parseKids() { - let e = null; - const t = this.dict.getRaw("Pg"); - t instanceof Ref && (e = t.toString()); - const i = this.dict.get("K"); - if (Array.isArray(i)) - for (const t of i) { - const i = this.parseKid(e, t); - i && this.kids.push(i); + let pageObjId = null; + const objRef = this.dict.getRaw("Pg"); + if (objRef instanceof Ref) { + pageObjId = objRef.toString(); + } + const kids = this.dict.get("K"); + if (Array.isArray(kids)) { + for (const kid of kids) { + const element = this.parseKid(pageObjId, kid); + if (element) { + this.kids.push(element); + } + } + } else { + const element = this.parseKid(pageObjId, kids); + if (element) { + this.kids.push(element); } - else { - const t = this.parseKid(e, i); - t && this.kids.push(t); } } - parseKid(e, t) { - if (Number.isInteger(t)) - return this.tree.pageDict.objId !== e - ? null - : new StructElement({ type: vs, mcid: t, pageObjId: e }); - let i = null; - t instanceof Ref - ? (i = this.dict.xref.fetch(t)) - : t instanceof Dict && (i = t); - if (!i) return null; - const a = i.getRaw("Pg"); - a instanceof Ref && (e = a.toString()); - const s = i.get("Type") instanceof Name ? i.get("Type").name : null; - if ("MCR" === s) { - if (this.tree.pageDict.objId !== e) return null; - const t = i.getRaw("Stm"); + parseKid(pageObjId, kid) { + if (Number.isInteger(kid)) { + if (this.tree.pageDict.objId !== pageObjId) { + return null; + } return new StructElement({ - type: Ks, - refObjId: t instanceof Ref ? t.toString() : null, - pageObjId: e, - mcid: i.get("MCID"), + type: StructElementType.PAGE_CONTENT, + mcid: kid, + pageObjId, }); } - if ("OBJR" === s) { - if (this.tree.pageDict.objId !== e) return null; - const t = i.getRaw("Obj"); + let kidDict = null; + if (kid instanceof Ref) { + kidDict = this.dict.xref.fetch(kid); + } else if (kid instanceof Dict) { + kidDict = kid; + } + if (!kidDict) { + return null; + } + const pageRef = kidDict.getRaw("Pg"); + if (pageRef instanceof Ref) { + pageObjId = pageRef.toString(); + } + const type = + kidDict.get("Type") instanceof Name ? kidDict.get("Type").name : null; + if (type === "MCR") { + if (this.tree.pageDict.objId !== pageObjId) { + return null; + } + const kidRef = kidDict.getRaw("Stm"); return new StructElement({ - type: Ts, - refObjId: t instanceof Ref ? t.toString() : null, - pageObjId: e, + type: StructElementType.STREAM_CONTENT, + refObjId: kidRef instanceof Ref ? kidRef.toString() : null, + pageObjId, + mcid: kidDict.get("MCID"), }); } - return new StructElement({ type: Os, dict: i }); + if (type === "OBJR") { + if (this.tree.pageDict.objId !== pageObjId) { + return null; + } + const kidRef = kidDict.getRaw("Obj"); + return new StructElement({ + type: StructElementType.OBJECT, + refObjId: kidRef instanceof Ref ? kidRef.toString() : null, + pageObjId, + }); + } + return new StructElement({ + type: StructElementType.ELEMENT, + dict: kidDict, + }); } } class StructElement { constructor({ - type: e, - dict: t = null, - mcid: i = null, - pageObjId: a = null, - refObjId: s = null, + type, + dict = null, + mcid = null, + pageObjId = null, + refObjId = null, }) { - this.type = e; - this.dict = t; - this.mcid = i; - this.pageObjId = a; - this.refObjId = s; + this.type = type; + this.dict = dict; + this.mcid = mcid; + this.pageObjId = pageObjId; + this.refObjId = refObjId; this.parentNode = null; } } class StructTreePage { - constructor(e, t) { - this.root = e; - this.rootDict = e ? e.dict : null; - this.pageDict = t; + constructor(structTreeRoot, pageDict) { + this.root = structTreeRoot; + this.rootDict = structTreeRoot ? structTreeRoot.dict : null; + this.pageDict = pageDict; this.nodes = []; } - parse(e) { - if (!this.root || !this.rootDict) return; - const t = this.rootDict.get("ParentTree"); - if (!t) return; - const i = this.pageDict.get("StructParents"), - a = e instanceof Ref && this.root.structParentIds?.get(e); - if (!Number.isInteger(i) && !a) return; - const s = new Map(), - r = new NumberTree(t, this.rootDict.xref); - if (Number.isInteger(i)) { - const e = r.get(i); - if (Array.isArray(e)) - for (const t of e) - t instanceof Ref && this.addNode(this.rootDict.xref.fetch(t), s); + collectObjects(pageRef) { + if (!this.root || !this.rootDict || !(pageRef instanceof Ref)) { + return null; } - if (a) - for (const [e, t] of a) { - const i = r.get(e); - if (i) { - const e = this.addNode(this.rootDict.xref.fetchIfRef(i), s); - 1 === e?.kids?.length && - e.kids[0].type === Ts && - (e.kids[0].type = t); + const parentTree = this.rootDict.get("ParentTree"); + if (!parentTree) { + return null; + } + const ids = this.root.structParentIds?.get(pageRef); + if (!ids) { + return null; + } + const map = new Map(); + const numberTree = new NumberTree(parentTree, this.rootDict.xref); + for (const [elemId] of ids) { + const obj = numberTree.getRaw(elemId); + if (obj instanceof Ref) { + map.set(elemId, obj); + } + } + return map; + } + parse(pageRef) { + if (!this.root || !this.rootDict || !(pageRef instanceof Ref)) { + return; + } + const parentTree = this.rootDict.get("ParentTree"); + if (!parentTree) { + return; + } + const id = this.pageDict.get("StructParents"); + const ids = this.root.structParentIds?.get(pageRef); + if (!Number.isInteger(id) && !ids) { + return; + } + const map = new Map(); + const numberTree = new NumberTree(parentTree, this.rootDict.xref); + if (Number.isInteger(id)) { + const parentArray = numberTree.get(id); + if (Array.isArray(parentArray)) { + for (const ref of parentArray) { + if (ref instanceof Ref) { + this.addNode(this.rootDict.xref.fetch(ref), map); + } } } + } + if (!ids) { + return; + } + for (const [elemId, type] of ids) { + const obj = numberTree.get(elemId); + if (obj) { + const elem = this.addNode(this.rootDict.xref.fetchIfRef(obj), map); + if ( + elem?.kids?.length === 1 && + elem.kids[0].type === StructElementType.OBJECT + ) { + elem.kids[0].type = type; + } + } + } } - addNode(e, t, i = 0) { - if (i > 40) { + addNode(dict, map, level = 0) { + if (level > MAX_DEPTH) { warn("StructTree MAX_DEPTH reached."); return null; } - if (t.has(e)) return t.get(e); - const a = new StructElementNode(this, e); - t.set(e, a); - const s = e.get("P"); - if (!s || isName(s.get("Type"), "StructTreeRoot")) { - this.addTopLevelNode(e, a) || t.delete(e); - return a; + if (!(dict instanceof Dict)) { + return null; } - const r = this.addNode(s, t, i + 1); - if (!r) return a; - let n = !1; - for (const t of r.kids) - if (t.type === Os && t.dict === e) { - t.parentNode = a; - n = !0; + if (map.has(dict)) { + return map.get(dict); + } + const element = new StructElementNode(this, dict); + map.set(dict, element); + const parent = dict.get("P"); + if (!parent || isName(parent.get("Type"), "StructTreeRoot")) { + if (!this.addTopLevelNode(dict, element)) { + map.delete(dict); } - n || t.delete(e); - return a; + return element; + } + const parentNode = this.addNode(parent, map, level + 1); + if (!parentNode) { + return element; + } + let save = false; + for (const kid of parentNode.kids) { + if (kid.type === StructElementType.ELEMENT && kid.dict === dict) { + kid.parentNode = element; + save = true; + } + } + if (!save) { + map.delete(dict); + } + return element; } - addTopLevelNode(e, t) { - const i = this.rootDict.get("K"); - if (!i) return !1; - if (i instanceof Dict) { - if (i.objId !== e.objId) return !1; - this.nodes[0] = t; - return !0; + addTopLevelNode(dict, element) { + const obj = this.rootDict.get("K"); + if (!obj) { + return false; } - if (!Array.isArray(i)) return !0; - let a = !1; - for (let s = 0; s < i.length; s++) { - const r = i[s]; - if (r?.toString() === e.objId) { - this.nodes[s] = t; - a = !0; + if (obj instanceof Dict) { + if (obj.objId !== dict.objId) { + return false; + } + this.nodes[0] = element; + return true; + } + if (!Array.isArray(obj)) { + return true; + } + let save = false; + for (let i = 0; i < obj.length; i++) { + const kidRef = obj[i]; + if (kidRef?.toString() === dict.objId) { + this.nodes[i] = element; + save = true; } } - return a; + return save; } get serializable() { - function nodeToSerializable(e, t, i = 0) { - if (i > 40) { + function nodeToSerializable(node, parent, level = 0) { + if (level > MAX_DEPTH) { warn("StructTree too deep to be fully serialized."); return; } - const a = Object.create(null); - a.role = e.role; - a.children = []; - t.children.push(a); - const s = e.dict.get("Alt"); - "string" == typeof s && (a.alt = stringToPDFString(s)); - const r = e.dict.get("Lang"); - "string" == typeof r && (a.lang = stringToPDFString(r)); - for (const t of e.kids) { - const e = t.type === Os ? t.parentNode : null; - e - ? nodeToSerializable(e, a, i + 1) - : t.type === vs || t.type === Ks - ? a.children.push({ - type: "content", - id: `p${t.pageObjId}_mc${t.mcid}`, - }) - : t.type === Ts - ? a.children.push({ type: "object", id: t.refObjId }) - : t.type === qs && - a.children.push({ - type: "annotation", - id: `pdfjs_internal_id_${t.refObjId}`, - }); + const obj = Object.create(null); + obj.role = node.role; + obj.children = []; + parent.children.push(obj); + let alt = node.dict.get("Alt"); + if (typeof alt !== "string") { + alt = node.dict.get("ActualText"); + } + if (typeof alt === "string") { + obj.alt = stringToPDFString(alt); + } + const a = node.dict.get("A"); + if (a instanceof Dict) { + const bbox = lookupNormalRect(a.getArray("BBox"), null); + if (bbox) { + obj.bbox = bbox; + } else { + const width = a.get("Width"); + const height = a.get("Height"); + if ( + typeof width === "number" && + width > 0 && + typeof height === "number" && + height > 0 + ) { + obj.bbox = [0, 0, width, height]; + } + } + } + const lang = node.dict.get("Lang"); + if (typeof lang === "string") { + obj.lang = stringToPDFString(lang); + } + for (const kid of node.kids) { + const kidElement = + kid.type === StructElementType.ELEMENT ? kid.parentNode : null; + if (kidElement) { + nodeToSerializable(kidElement, obj, level + 1); + continue; + } else if ( + kid.type === StructElementType.PAGE_CONTENT || + kid.type === StructElementType.STREAM_CONTENT + ) { + obj.children.push({ + type: "content", + id: `p${kid.pageObjId}_mc${kid.mcid}`, + }); + } else if (kid.type === StructElementType.OBJECT) { + obj.children.push({ + type: "object", + id: kid.refObjId, + }); + } else if (kid.type === StructElementType.ANNOTATION) { + obj.children.push({ + type: "annotation", + id: `${AnnotationPrefix}${kid.refObjId}`, + }); + } } } - const e = Object.create(null); - e.children = []; - e.role = "Root"; - for (const t of this.nodes) t && nodeToSerializable(t, e); - return e; + const root = Object.create(null); + root.children = []; + root.role = "Root"; + for (const child of this.nodes) { + if (!child) { + continue; + } + nodeToSerializable(child, root); + } + return root; } -} -function isValidExplicitDest(e) { - if (!Array.isArray(e) || e.length < 2) return !1; - const [t, i, ...a] = e; - if (!(t instanceof Ref || Number.isInteger(t))) return !1; - if (!(i instanceof Name)) return !1; - let s = !0; - switch (i.name) { +} // ./src/core/catalog.js + +function isValidExplicitDest(dest) { + if (!Array.isArray(dest) || dest.length < 2) { + return false; + } + const [page, zoom, ...args] = dest; + if (!(page instanceof Ref) && !Number.isInteger(page)) { + return false; + } + if (!(zoom instanceof Name)) { + return false; + } + const argsLen = args.length; + let allowNull = true; + switch (zoom.name) { case "XYZ": - if (3 !== a.length) return !1; + if (argsLen < 2 || argsLen > 3) { + return false; + } break; case "Fit": case "FitB": - return 0 === a.length; + return argsLen === 0; case "FitH": case "FitBH": case "FitV": case "FitBV": - if (1 !== a.length) return !1; + if (argsLen > 1) { + return false; + } break; case "FitR": - if (4 !== a.length) return !1; - s = !1; + if (argsLen !== 4) { + return false; + } + allowNull = false; break; default: - return !1; + return false; } - for (const e of a) - if (!("number" == typeof e || (s && null === e))) return !1; - return !0; + for (const arg of args) { + if (!(typeof arg === "number" || (allowNull && arg === null))) { + return false; + } + } + return true; } -function fetchDest(e) { - e instanceof Dict && (e = e.get("D")); - return isValidExplicitDest(e) ? e : null; +function fetchDest(dest) { + if (dest instanceof Dict) { + dest = dest.get("D"); + } + return isValidExplicitDest(dest) ? dest : null; } -function fetchRemoteDest(e) { - let t = e.get("D"); - if (t) { - t instanceof Name && (t = t.name); - if ("string" == typeof t) return stringToPDFString(t); - if (isValidExplicitDest(t)) return JSON.stringify(t); +function fetchRemoteDest(action) { + let dest = action.get("D"); + if (dest) { + if (dest instanceof Name) { + dest = dest.name; + } + if (typeof dest === "string") { + return stringToPDFString(dest); + } else if (isValidExplicitDest(dest)) { + return JSON.stringify(dest); + } } return null; } class Catalog { - constructor(e, t) { - this.pdfManager = e; - this.xref = t; - this._catDict = t.getCatalogObj(); - if (!(this._catDict instanceof Dict)) + constructor(pdfManager, xref) { + this.pdfManager = pdfManager; + this.xref = xref; + this._catDict = xref.getCatalogObj(); + if (!(this._catDict instanceof Dict)) { throw new FormatError("Catalog object is not a dictionary."); + } this.toplevelPagesDict; this._actualNumPages = null; this.fontCache = new RefSetCache(); @@ -40039,6 +48206,7 @@ class Catalog { this.globalImageCache = new GlobalImageCache(); this.pageKidsCountCache = new RefSetCache(); this.pageIndexCache = new RefSetCache(); + this.pageDictCache = new RefSetCache(); this.nonBlendModesSet = new RefSet(); this.systemFontCache = new Map(); } @@ -40046,494 +48214,693 @@ class Catalog { return this._catDict.clone(); } get version() { - const e = this._catDict.get("Version"); - if (e instanceof Name) { - if (bt.test(e.name)) return shadow(this, "version", e.name); - warn(`Invalid PDF catalog version: ${e.name}`); + const version = this._catDict.get("Version"); + if (version instanceof Name) { + if (PDF_VERSION_REGEXP.test(version.name)) { + return shadow(this, "version", version.name); + } + warn(`Invalid PDF catalog version: ${version.name}`); } return shadow(this, "version", null); } get lang() { - const e = this._catDict.get("Lang"); + const lang = this._catDict.get("Lang"); return shadow( this, "lang", - e && "string" == typeof e ? stringToPDFString(e) : null, + lang && typeof lang === "string" ? stringToPDFString(lang) : null, ); } get needsRendering() { - const e = this._catDict.get("NeedsRendering"); - return shadow(this, "needsRendering", "boolean" == typeof e && e); + const needsRendering = this._catDict.get("NeedsRendering"); + return shadow( + this, + "needsRendering", + typeof needsRendering === "boolean" ? needsRendering : false, + ); } get collection() { - let e = null; + let collection = null; try { - const t = this._catDict.get("Collection"); - t instanceof Dict && t.size > 0 && (e = t); - } catch (e) { - if (e instanceof MissingDataException) throw e; + const obj = this._catDict.get("Collection"); + if (obj instanceof Dict && obj.size > 0) { + collection = obj; + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } info("Cannot fetch Collection entry; assuming no collection is present."); } - return shadow(this, "collection", e); + return shadow(this, "collection", collection); } get acroForm() { - let e = null; + let acroForm = null; try { - const t = this._catDict.get("AcroForm"); - t instanceof Dict && t.size > 0 && (e = t); - } catch (e) { - if (e instanceof MissingDataException) throw e; + const obj = this._catDict.get("AcroForm"); + if (obj instanceof Dict && obj.size > 0) { + acroForm = obj; + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } info("Cannot fetch AcroForm entry; assuming no forms are present."); } - return shadow(this, "acroForm", e); + return shadow(this, "acroForm", acroForm); } get acroFormRef() { - const e = this._catDict.getRaw("AcroForm"); - return shadow(this, "acroFormRef", e instanceof Ref ? e : null); + const value = this._catDict.getRaw("AcroForm"); + return shadow(this, "acroFormRef", value instanceof Ref ? value : null); } get metadata() { - const e = this._catDict.getRaw("Metadata"); - if (!(e instanceof Ref)) return shadow(this, "metadata", null); - let t = null; + const streamRef = this._catDict.getRaw("Metadata"); + if (!(streamRef instanceof Ref)) { + return shadow(this, "metadata", null); + } + let metadata = null; try { - const i = this.xref.fetch(e, !this.xref.encrypt?.encryptMetadata); - if (i instanceof BaseStream && i.dict instanceof Dict) { - const e = i.dict.get("Type"), - a = i.dict.get("Subtype"); - if (isName(e, "Metadata") && isName(a, "XML")) { - const e = stringToUTF8String(i.getString()); - e && (t = new MetadataParser(e).serializable); + const stream = this.xref.fetch( + streamRef, + !this.xref.encrypt?.encryptMetadata, + ); + if (stream instanceof BaseStream && stream.dict instanceof Dict) { + const type = stream.dict.get("Type"); + const subtype = stream.dict.get("Subtype"); + if (isName(type, "Metadata") && isName(subtype, "XML")) { + const data = stringToUTF8String(stream.getString()); + if (data) { + metadata = new MetadataParser(data).serializable; + } } } - } catch (e) { - if (e instanceof MissingDataException) throw e; - info(`Skipping invalid Metadata: "${e}".`); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + info(`Skipping invalid Metadata: "${ex}".`); } - return shadow(this, "metadata", t); + return shadow(this, "metadata", metadata); } get markInfo() { - let e = null; + let markInfo = null; try { - e = this._readMarkInfo(); - } catch (e) { - if (e instanceof MissingDataException) throw e; + markInfo = this._readMarkInfo(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } warn("Unable to read mark info."); } - return shadow(this, "markInfo", e); + return shadow(this, "markInfo", markInfo); } _readMarkInfo() { - const e = this._catDict.get("MarkInfo"); - if (!(e instanceof Dict)) return null; - const t = { Marked: !1, UserProperties: !1, Suspects: !1 }; - for (const i in t) { - const a = e.get(i); - "boolean" == typeof a && (t[i] = a); + const obj = this._catDict.get("MarkInfo"); + if (!(obj instanceof Dict)) { + return null; } - return t; + const markInfo = { + Marked: false, + UserProperties: false, + Suspects: false, + }; + for (const key in markInfo) { + const value = obj.get(key); + if (typeof value === "boolean") { + markInfo[key] = value; + } + } + return markInfo; } get structTreeRoot() { - let e = null; + let structTree = null; try { - e = this._readStructTreeRoot(); - } catch (e) { - if (e instanceof MissingDataException) throw e; + structTree = this._readStructTreeRoot(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } warn("Unable read to structTreeRoot info."); } - return shadow(this, "structTreeRoot", e); + return shadow(this, "structTreeRoot", structTree); } _readStructTreeRoot() { - const e = this._catDict.getRaw("StructTreeRoot"), - t = this.xref.fetchIfRef(e); - if (!(t instanceof Dict)) return null; - const i = new StructTreeRoot(t, e); - i.init(); - return i; + const rawObj = this._catDict.getRaw("StructTreeRoot"); + const obj = this.xref.fetchIfRef(rawObj); + if (!(obj instanceof Dict)) { + return null; + } + const root = new StructTreeRoot(obj, rawObj); + root.init(); + return root; } get toplevelPagesDict() { - const e = this._catDict.get("Pages"); - if (!(e instanceof Dict)) + const pagesObj = this._catDict.get("Pages"); + if (!(pagesObj instanceof Dict)) { throw new FormatError("Invalid top-level pages dictionary."); - return shadow(this, "toplevelPagesDict", e); + } + return shadow(this, "toplevelPagesDict", pagesObj); } get documentOutline() { - let e = null; + let obj = null; try { - e = this._readDocumentOutline(); - } catch (e) { - if (e instanceof MissingDataException) throw e; + obj = this._readDocumentOutline(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } warn("Unable to read document outline."); } - return shadow(this, "documentOutline", e); + return shadow(this, "documentOutline", obj); } _readDocumentOutline() { - let e = this._catDict.get("Outlines"); - if (!(e instanceof Dict)) return null; - e = e.getRaw("First"); - if (!(e instanceof Ref)) return null; - const t = { items: [] }, - i = [{ obj: e, parent: t }], - a = new RefSet(); - a.put(e); - const s = this.xref, - r = new Uint8ClampedArray(3); - for (; i.length > 0; ) { - const t = i.shift(), - n = s.fetchIfRef(t.obj); - if (null === n) continue; - n.has("Title") || warn("Invalid outline item encountered."); - const g = { url: null, dest: null, action: null }; + let obj = this._catDict.get("Outlines"); + if (!(obj instanceof Dict)) { + return null; + } + obj = obj.getRaw("First"); + if (!(obj instanceof Ref)) { + return null; + } + const root = { + items: [], + }; + const queue = [ + { + obj, + parent: root, + }, + ]; + const processed = new RefSet(); + processed.put(obj); + const xref = this.xref, + blackColor = new Uint8ClampedArray(3); + while (queue.length > 0) { + const i = queue.shift(); + const outlineDict = xref.fetchIfRef(i.obj); + if (outlineDict === null) { + continue; + } + if (!outlineDict.has("Title")) { + warn("Invalid outline item encountered."); + } + const data = { + url: null, + dest: null, + action: null, + }; Catalog.parseDestDictionary({ - destDict: n, - resultObj: g, + destDict: outlineDict, + resultObj: data, docBaseUrl: this.baseUrl, docAttachments: this.attachments, }); - const o = n.get("Title"), - c = n.get("F") || 0, - C = n.getArray("C"), - h = n.get("Count"); - let l = r; - !isNumberArray(C, 3) || - (0 === C[0] && 0 === C[1] && 0 === C[2]) || - (l = ColorSpace.singletons.rgb.getRgb(C, 0)); - const Q = { - action: g.action, - attachment: g.attachment, - dest: g.dest, - url: g.url, - unsafeUrl: g.unsafeUrl, - newWindow: g.newWindow, - setOCGState: g.setOCGState, - title: "string" == typeof o ? stringToPDFString(o) : "", - color: l, - count: Number.isInteger(h) ? h : void 0, - bold: !!(2 & c), - italic: !!(1 & c), + const title = outlineDict.get("Title"); + const flags = outlineDict.get("F") || 0; + const color = outlineDict.getArray("C"); + const count = outlineDict.get("Count"); + let rgbColor = blackColor; + if ( + isNumberArray(color, 3) && + (color[0] !== 0 || color[1] !== 0 || color[2] !== 0) + ) { + rgbColor = ColorSpace.singletons.rgb.getRgb(color, 0); + } + const outlineItem = { + action: data.action, + attachment: data.attachment, + dest: data.dest, + url: data.url, + unsafeUrl: data.unsafeUrl, + newWindow: data.newWindow, + setOCGState: data.setOCGState, + title: typeof title === "string" ? stringToPDFString(title) : "", + color: rgbColor, + count: Number.isInteger(count) ? count : undefined, + bold: !!(flags & 2), + italic: !!(flags & 1), items: [], }; - t.parent.items.push(Q); - e = n.getRaw("First"); - if (e instanceof Ref && !a.has(e)) { - i.push({ obj: e, parent: Q }); - a.put(e); + i.parent.items.push(outlineItem); + obj = outlineDict.getRaw("First"); + if (obj instanceof Ref && !processed.has(obj)) { + queue.push({ + obj, + parent: outlineItem, + }); + processed.put(obj); } - e = n.getRaw("Next"); - if (e instanceof Ref && !a.has(e)) { - i.push({ obj: e, parent: t.parent }); - a.put(e); + obj = outlineDict.getRaw("Next"); + if (obj instanceof Ref && !processed.has(obj)) { + queue.push({ + obj, + parent: i.parent, + }); + processed.put(obj); } } - return t.items.length > 0 ? t.items : null; + return root.items.length > 0 ? root.items : null; } get permissions() { - let e = null; + let permissions = null; try { - e = this._readPermissions(); - } catch (e) { - if (e instanceof MissingDataException) throw e; + permissions = this._readPermissions(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } warn("Unable to read permissions."); } - return shadow(this, "permissions", e); + return shadow(this, "permissions", permissions); } _readPermissions() { - const e = this.xref.trailer.get("Encrypt"); - if (!(e instanceof Dict)) return null; - let t = e.get("P"); - if ("number" != typeof t) return null; - t += 2 ** 32; - const i = []; - for (const e in m) { - const a = m[e]; - t & a && i.push(a); + const encrypt = this.xref.trailer.get("Encrypt"); + if (!(encrypt instanceof Dict)) { + return null; } - return i; + let flags = encrypt.get("P"); + if (typeof flags !== "number") { + return null; + } + flags += 2 ** 32; + const permissions = []; + for (const key in PermissionFlag) { + const value = PermissionFlag[key]; + if (flags & value) { + permissions.push(value); + } + } + return permissions; } get optionalContentConfig() { - let e = null; + let config = null; try { - const t = this._catDict.get("OCProperties"); - if (!t) return shadow(this, "optionalContentConfig", null); - const i = t.get("D"); - if (!i) return shadow(this, "optionalContentConfig", null); - const a = t.get("OCGs"); - if (!Array.isArray(a)) return shadow(this, "optionalContentConfig", null); - const s = [], - r = new RefSet(); - for (const e of a) - if (e instanceof Ref && !r.has(e)) { - r.put(e); - s.push(this.#Y(e)); - } - e = this.#v(i, r); - e.groups = s; - } catch (e) { - if (e instanceof MissingDataException) throw e; - warn(`Unable to read optional content config: ${e}`); - } - return shadow(this, "optionalContentConfig", e); - } - #Y(e) { - const t = this.xref.fetch(e), - i = { - id: e.toString(), - name: null, - intent: null, - usage: { print: null, view: null }, - }, - a = t.get("Name"); - "string" == typeof a && (i.name = stringToPDFString(a)); - let s = t.getArray("Intent"); - Array.isArray(s) || (s = [s]); - s.every((e) => e instanceof Name) && (i.intent = s.map((e) => e.name)); - const r = t.get("Usage"); - if (!(r instanceof Dict)) return i; - const n = i.usage, - g = r.get("Print"); - if (g instanceof Dict) { - const e = g.get("PrintState"); - if (e instanceof Name) - switch (e.name) { - case "ON": - case "OFF": - n.print = { printState: e.name }; - } - } - const o = r.get("View"); - if (o instanceof Dict) { - const e = o.get("ViewState"); - if (e instanceof Name) - switch (e.name) { - case "ON": - case "OFF": - n.view = { viewState: e.name }; - } - } - return i; - } - #v(e, t) { - function parseOnOff(e) { - const i = []; - if (Array.isArray(e)) - for (const a of e) a instanceof Ref && t.has(a) && i.push(a.toString()); - return i; - } - function parseOrder(e, i = 0) { - if (!Array.isArray(e)) return null; - const s = []; - for (const r of e) { - if (r instanceof Ref && t.has(r)) { - a.put(r); - s.push(r.toString()); + const properties = this._catDict.get("OCProperties"); + if (!properties) { + return shadow(this, "optionalContentConfig", null); + } + const defaultConfig = properties.get("D"); + if (!defaultConfig) { + return shadow(this, "optionalContentConfig", null); + } + const groupsData = properties.get("OCGs"); + if (!Array.isArray(groupsData)) { + return shadow(this, "optionalContentConfig", null); + } + const groupRefCache = new RefSetCache(); + for (const groupRef of groupsData) { + if (!(groupRef instanceof Ref) || groupRefCache.has(groupRef)) { continue; } - const e = parseNestedOrder(r, i); - e && s.push(e); + groupRefCache.put(groupRef, this.#readOptionalContentGroup(groupRef)); } - if (i > 0) return s; - const r = []; - for (const e of t) a.has(e) || r.push(e.toString()); - r.length && s.push({ name: null, order: r }); - return s; + config = this.#readOptionalContentConfig(defaultConfig, groupRefCache); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`Unable to read optional content config: ${ex}`); } - function parseNestedOrder(e, t) { - if (++t > s) { + return shadow(this, "optionalContentConfig", config); + } + #readOptionalContentGroup(groupRef) { + const group = this.xref.fetch(groupRef); + const obj = { + id: groupRef.toString(), + name: null, + intent: null, + usage: { + print: null, + view: null, + }, + rbGroups: [], + }; + const name = group.get("Name"); + if (typeof name === "string") { + obj.name = stringToPDFString(name); + } + let intent = group.getArray("Intent"); + if (!Array.isArray(intent)) { + intent = [intent]; + } + if (intent.every((i) => i instanceof Name)) { + obj.intent = intent.map((i) => i.name); + } + const usage = group.get("Usage"); + if (!(usage instanceof Dict)) { + return obj; + } + const usageObj = obj.usage; + const print = usage.get("Print"); + if (print instanceof Dict) { + const printState = print.get("PrintState"); + if (printState instanceof Name) { + switch (printState.name) { + case "ON": + case "OFF": + usageObj.print = { + printState: printState.name, + }; + } + } + } + const view = usage.get("View"); + if (view instanceof Dict) { + const viewState = view.get("ViewState"); + if (viewState instanceof Name) { + switch (viewState.name) { + case "ON": + case "OFF": + usageObj.view = { + viewState: viewState.name, + }; + } + } + } + return obj; + } + #readOptionalContentConfig(config, groupRefCache) { + function parseOnOff(refs) { + const onParsed = []; + if (Array.isArray(refs)) { + for (const value of refs) { + if (!(value instanceof Ref)) { + continue; + } + if (groupRefCache.has(value)) { + onParsed.push(value.toString()); + } + } + } + return onParsed; + } + function parseOrder(refs, nestedLevels = 0) { + if (!Array.isArray(refs)) { + return null; + } + const order = []; + for (const value of refs) { + if (value instanceof Ref && groupRefCache.has(value)) { + parsedOrderRefs.put(value); + order.push(value.toString()); + continue; + } + const nestedOrder = parseNestedOrder(value, nestedLevels); + if (nestedOrder) { + order.push(nestedOrder); + } + } + if (nestedLevels > 0) { + return order; + } + const hiddenGroups = []; + for (const [groupRef] of groupRefCache.items()) { + if (parsedOrderRefs.has(groupRef)) { + continue; + } + hiddenGroups.push(groupRef.toString()); + } + if (hiddenGroups.length) { + order.push({ + name: null, + order: hiddenGroups, + }); + } + return order; + } + function parseNestedOrder(ref, nestedLevels) { + if (++nestedLevels > MAX_NESTED_LEVELS) { warn("parseNestedOrder - reached MAX_NESTED_LEVELS."); return null; } - const a = i.fetchIfRef(e); - if (!Array.isArray(a)) return null; - const r = i.fetchIfRef(a[0]); - if ("string" != typeof r) return null; - const n = parseOrder(a.slice(1), t); - return n && n.length ? { name: stringToPDFString(r), order: n } : null; + const value = xref.fetchIfRef(ref); + if (!Array.isArray(value)) { + return null; + } + const nestedName = xref.fetchIfRef(value[0]); + if (typeof nestedName !== "string") { + return null; + } + const nestedOrder = parseOrder(value.slice(1), nestedLevels); + if (!nestedOrder || !nestedOrder.length) { + return null; + } + return { + name: stringToPDFString(nestedName), + order: nestedOrder, + }; } - const i = this.xref, - a = new RefSet(), - s = 10; + function parseRBGroups(rbGroups) { + if (!Array.isArray(rbGroups)) { + return; + } + for (const value of rbGroups) { + const rbGroup = xref.fetchIfRef(value); + if (!Array.isArray(rbGroup) || !rbGroup.length) { + continue; + } + const parsedRbGroup = new Set(); + for (const ref of rbGroup) { + if ( + ref instanceof Ref && + groupRefCache.has(ref) && + !parsedRbGroup.has(ref.toString()) + ) { + parsedRbGroup.add(ref.toString()); + groupRefCache.get(ref).rbGroups.push(parsedRbGroup); + } + } + } + } + const xref = this.xref, + parsedOrderRefs = new RefSet(), + MAX_NESTED_LEVELS = 10; + parseRBGroups(config.get("RBGroups")); return { name: - "string" == typeof e.get("Name") - ? stringToPDFString(e.get("Name")) + typeof config.get("Name") === "string" + ? stringToPDFString(config.get("Name")) : null, creator: - "string" == typeof e.get("Creator") - ? stringToPDFString(e.get("Creator")) + typeof config.get("Creator") === "string" + ? stringToPDFString(config.get("Creator")) : null, baseState: - e.get("BaseState") instanceof Name ? e.get("BaseState").name : null, - on: parseOnOff(e.get("ON")), - off: parseOnOff(e.get("OFF")), - order: parseOrder(e.get("Order")), - groups: null, + config.get("BaseState") instanceof Name + ? config.get("BaseState").name + : null, + on: parseOnOff(config.get("ON")), + off: parseOnOff(config.get("OFF")), + order: parseOrder(config.get("Order")), + groups: [...groupRefCache], }; } - setActualNumPages(e = null) { - this._actualNumPages = e; + setActualNumPages(num = null) { + this._actualNumPages = num; } get hasActualNumPages() { - return null !== this._actualNumPages; + return this._actualNumPages !== null; } get _pagesCount() { - const e = this.toplevelPagesDict.get("Count"); - if (!Number.isInteger(e)) + const obj = this.toplevelPagesDict.get("Count"); + if (!Number.isInteger(obj)) { throw new FormatError( "Page count in top-level pages dictionary is not an integer.", ); - return shadow(this, "_pagesCount", e); + } + return shadow(this, "_pagesCount", obj); } get numPages() { return this.hasActualNumPages ? this._actualNumPages : this._pagesCount; } get destinations() { - const e = this._readDests(), - t = Object.create(null); - if (e instanceof NameTree) - for (const [i, a] of e.getAll()) { - const e = fetchDest(a); - e && (t[stringToPDFString(i)] = e); + const obj = this._readDests(), + dests = Object.create(null); + if (obj instanceof NameTree) { + for (const [key, value] of obj.getAll()) { + const dest = fetchDest(value); + if (dest) { + dests[stringToPDFString(key)] = dest; + } } - else - e instanceof Dict && - e.forEach(function (e, i) { - const a = fetchDest(i); - a && (t[e] = a); - }); - return shadow(this, "destinations", t); + } else if (obj instanceof Dict) { + obj.forEach(function (key, value) { + const dest = fetchDest(value); + if (dest) { + dests[key] = dest; + } + }); + } + return shadow(this, "destinations", dests); } - getDestination(e) { - const t = this._readDests(); - if (t instanceof NameTree) { - const i = fetchDest(t.get(e)); - if (i) return i; - const a = this.destinations[e]; - if (a) { - warn(`Found "${e}" at an incorrect position in the NameTree.`); - return a; + getDestination(id) { + const obj = this._readDests(); + if (obj instanceof NameTree) { + const dest = fetchDest(obj.get(id)); + if (dest) { + return dest; + } + const allDest = this.destinations[id]; + if (allDest) { + warn(`Found "${id}" at an incorrect position in the NameTree.`); + return allDest; + } + } else if (obj instanceof Dict) { + const dest = fetchDest(obj.get(id)); + if (dest) { + return dest; } - } else if (t instanceof Dict) { - const i = fetchDest(t.get(e)); - if (i) return i; } return null; } _readDests() { - const e = this._catDict.get("Names"); - return e?.has("Dests") - ? new NameTree(e.getRaw("Dests"), this.xref) - : this._catDict.has("Dests") - ? this._catDict.get("Dests") - : void 0; + const obj = this._catDict.get("Names"); + if (obj?.has("Dests")) { + return new NameTree(obj.getRaw("Dests"), this.xref); + } else if (this._catDict.has("Dests")) { + return this._catDict.get("Dests"); + } + return undefined; } get pageLabels() { - let e = null; + let obj = null; try { - e = this._readPageLabels(); - } catch (e) { - if (e instanceof MissingDataException) throw e; + obj = this._readPageLabels(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } warn("Unable to read page labels."); } - return shadow(this, "pageLabels", e); + return shadow(this, "pageLabels", obj); } _readPageLabels() { - const e = this._catDict.getRaw("PageLabels"); - if (!e) return null; - const t = new Array(this.numPages); - let i = null, - a = ""; - const s = new NumberTree(e, this.xref).getAll(); - let r = "", - n = 1; - for (let e = 0, g = this.numPages; e < g; e++) { - const g = s.get(e); - if (void 0 !== g) { - if (!(g instanceof Dict)) + const obj = this._catDict.getRaw("PageLabels"); + if (!obj) { + return null; + } + const pageLabels = new Array(this.numPages); + let style = null, + prefix = ""; + const numberTree = new NumberTree(obj, this.xref); + const nums = numberTree.getAll(); + let currentLabel = "", + currentIndex = 1; + for (let i = 0, ii = this.numPages; i < ii; i++) { + const labelDict = nums.get(i); + if (labelDict !== undefined) { + if (!(labelDict instanceof Dict)) { throw new FormatError("PageLabel is not a dictionary."); - if (g.has("Type") && !isName(g.get("Type"), "PageLabel")) + } + if ( + labelDict.has("Type") && + !isName(labelDict.get("Type"), "PageLabel") + ) { throw new FormatError("Invalid type in PageLabel dictionary."); - if (g.has("S")) { - const e = g.get("S"); - if (!(e instanceof Name)) + } + if (labelDict.has("S")) { + const s = labelDict.get("S"); + if (!(s instanceof Name)) { throw new FormatError("Invalid style in PageLabel dictionary."); - i = e.name; - } else i = null; - if (g.has("P")) { - const e = g.get("P"); - if ("string" != typeof e) + } + style = s.name; + } else { + style = null; + } + if (labelDict.has("P")) { + const p = labelDict.get("P"); + if (typeof p !== "string") { throw new FormatError("Invalid prefix in PageLabel dictionary."); - a = stringToPDFString(e); - } else a = ""; - if (g.has("St")) { - const e = g.get("St"); - if (!(Number.isInteger(e) && e >= 1)) + } + prefix = stringToPDFString(p); + } else { + prefix = ""; + } + if (labelDict.has("St")) { + const st = labelDict.get("St"); + if (!(Number.isInteger(st) && st >= 1)) { throw new FormatError("Invalid start in PageLabel dictionary."); - n = e; - } else n = 1; + } + currentIndex = st; + } else { + currentIndex = 1; + } } - switch (i) { + switch (style) { case "D": - r = n; + currentLabel = currentIndex; break; case "R": case "r": - r = toRomanNumerals(n, "r" === i); + currentLabel = toRomanNumerals(currentIndex, style === "r"); break; case "A": case "a": - const e = 26, - t = "a" === i ? 97 : 65, - a = n - 1; - r = String.fromCharCode(t + (a % e)).repeat(Math.floor(a / e) + 1); + const LIMIT = 26; + const A_UPPER_CASE = 0x41, + A_LOWER_CASE = 0x61; + const baseCharCode = style === "a" ? A_LOWER_CASE : A_UPPER_CASE; + const letterIndex = currentIndex - 1; + const character = String.fromCharCode( + baseCharCode + (letterIndex % LIMIT), + ); + currentLabel = character.repeat(Math.floor(letterIndex / LIMIT) + 1); break; default: - if (i) + if (style) { throw new FormatError( - `Invalid style "${i}" in PageLabel dictionary.`, + `Invalid style "${style}" in PageLabel dictionary.`, ); - r = ""; + } + currentLabel = ""; } - t[e] = a + r; - n++; + pageLabels[i] = prefix + currentLabel; + currentIndex++; } - return t; + return pageLabels; } get pageLayout() { - const e = this._catDict.get("PageLayout"); - let t = ""; - if (e instanceof Name) - switch (e.name) { + const obj = this._catDict.get("PageLayout"); + let pageLayout = ""; + if (obj instanceof Name) { + switch (obj.name) { case "SinglePage": case "OneColumn": case "TwoColumnLeft": case "TwoColumnRight": case "TwoPageLeft": case "TwoPageRight": - t = e.name; + pageLayout = obj.name; } - return shadow(this, "pageLayout", t); + } + return shadow(this, "pageLayout", pageLayout); } get pageMode() { - const e = this._catDict.get("PageMode"); - let t = "UseNone"; - if (e instanceof Name) - switch (e.name) { + const obj = this._catDict.get("PageMode"); + let pageMode = "UseNone"; + if (obj instanceof Name) { + switch (obj.name) { case "UseNone": case "UseOutlines": case "UseThumbs": case "FullScreen": case "UseOC": case "UseAttachments": - t = e.name; + pageMode = obj.name; } - return shadow(this, "pageMode", t); + } + return shadow(this, "pageMode", pageMode); } get viewerPreferences() { - const e = this._catDict.get("ViewerPreferences"); - if (!(e instanceof Dict)) return shadow(this, "viewerPreferences", null); - let t = null; - for (const i of e.getKeys()) { - const a = e.get(i); - let s; - switch (i) { + const obj = this._catDict.get("ViewerPreferences"); + if (!(obj instanceof Dict)) { + return shadow(this, "viewerPreferences", null); + } + let prefs = null; + for (const key of obj.getKeys()) { + const value = obj.get(key); + let prefValue; + switch (key) { case "HideToolbar": case "HideMenubar": case "HideWindowUI": @@ -40541,313 +48908,422 @@ class Catalog { case "CenterWindow": case "DisplayDocTitle": case "PickTrayByPDFSize": - "boolean" == typeof a && (s = a); + if (typeof value === "boolean") { + prefValue = value; + } break; case "NonFullScreenPageMode": - if (a instanceof Name) - switch (a.name) { + if (value instanceof Name) { + switch (value.name) { case "UseNone": case "UseOutlines": case "UseThumbs": case "UseOC": - s = a.name; + prefValue = value.name; break; default: - s = "UseNone"; + prefValue = "UseNone"; } + } break; case "Direction": - if (a instanceof Name) - switch (a.name) { + if (value instanceof Name) { + switch (value.name) { case "L2R": case "R2L": - s = a.name; + prefValue = value.name; break; default: - s = "L2R"; + prefValue = "L2R"; } + } break; case "ViewArea": case "ViewClip": case "PrintArea": case "PrintClip": - if (a instanceof Name) - switch (a.name) { + if (value instanceof Name) { + switch (value.name) { case "MediaBox": case "CropBox": case "BleedBox": case "TrimBox": case "ArtBox": - s = a.name; + prefValue = value.name; break; default: - s = "CropBox"; + prefValue = "CropBox"; } + } break; case "PrintScaling": - if (a instanceof Name) - switch (a.name) { + if (value instanceof Name) { + switch (value.name) { case "None": case "AppDefault": - s = a.name; + prefValue = value.name; break; default: - s = "AppDefault"; + prefValue = "AppDefault"; } + } break; case "Duplex": - if (a instanceof Name) - switch (a.name) { + if (value instanceof Name) { + switch (value.name) { case "Simplex": case "DuplexFlipShortEdge": case "DuplexFlipLongEdge": - s = a.name; + prefValue = value.name; break; default: - s = "None"; + prefValue = "None"; } + } break; case "PrintPageRange": - if (Array.isArray(a) && a.length % 2 == 0) { - a.every( - (e, t, i) => - Number.isInteger(e) && - e > 0 && - (0 === t || e >= i[t - 1]) && - e <= this.numPages, - ) && (s = a); + if (Array.isArray(value) && value.length % 2 === 0) { + const isValid = value.every( + (page, i, arr) => + Number.isInteger(page) && + page > 0 && + (i === 0 || page >= arr[i - 1]) && + page <= this.numPages, + ); + if (isValid) { + prefValue = value; + } } break; case "NumCopies": - Number.isInteger(a) && a > 0 && (s = a); + if (Number.isInteger(value) && value > 0) { + prefValue = value; + } break; default: - warn(`Ignoring non-standard key in ViewerPreferences: ${i}.`); + warn(`Ignoring non-standard key in ViewerPreferences: ${key}.`); continue; } - if (void 0 !== s) { - t || (t = Object.create(null)); - t[i] = s; - } else warn(`Bad value, for key "${i}", in ViewerPreferences: ${a}.`); + if (prefValue === undefined) { + warn(`Bad value, for key "${key}", in ViewerPreferences: ${value}.`); + continue; + } + if (!prefs) { + prefs = Object.create(null); + } + prefs[key] = prefValue; } - return shadow(this, "viewerPreferences", t); + return shadow(this, "viewerPreferences", prefs); } get openAction() { - const e = this._catDict.get("OpenAction"), - t = Object.create(null); - if (e instanceof Dict) { - const i = new Dict(this.xref); - i.set("A", e); - const a = { url: null, dest: null, action: null }; - Catalog.parseDestDictionary({ destDict: i, resultObj: a }); - Array.isArray(a.dest) - ? (t.dest = a.dest) - : a.action && (t.action = a.action); - } else Array.isArray(e) && (t.dest = e); - return shadow(this, "openAction", objectSize(t) > 0 ? t : null); + const obj = this._catDict.get("OpenAction"); + const openAction = Object.create(null); + if (obj instanceof Dict) { + const destDict = new Dict(this.xref); + destDict.set("A", obj); + const resultObj = { + url: null, + dest: null, + action: null, + }; + Catalog.parseDestDictionary({ + destDict, + resultObj, + }); + if (Array.isArray(resultObj.dest)) { + openAction.dest = resultObj.dest; + } else if (resultObj.action) { + openAction.action = resultObj.action; + } + } else if (Array.isArray(obj)) { + openAction.dest = obj; + } + return shadow( + this, + "openAction", + objectSize(openAction) > 0 ? openAction : null, + ); } get attachments() { - const e = this._catDict.get("Names"); - let t = null; - if (e instanceof Dict && e.has("EmbeddedFiles")) { - const i = new NameTree(e.getRaw("EmbeddedFiles"), this.xref); - for (const [e, a] of i.getAll()) { - const i = new FileSpec(a, this.xref); - t || (t = Object.create(null)); - t[stringToPDFString(e)] = i.serializable; + const obj = this._catDict.get("Names"); + let attachments = null; + if (obj instanceof Dict && obj.has("EmbeddedFiles")) { + const nameTree = new NameTree(obj.getRaw("EmbeddedFiles"), this.xref); + for (const [key, value] of nameTree.getAll()) { + const fs = new FileSpec(value, this.xref); + if (!attachments) { + attachments = Object.create(null); + } + attachments[stringToPDFString(key)] = fs.serializable; } } - return shadow(this, "attachments", t); + return shadow(this, "attachments", attachments); } get xfaImages() { - const e = this._catDict.get("Names"); - let t = null; - if (e instanceof Dict && e.has("XFAImages")) { - const i = new NameTree(e.getRaw("XFAImages"), this.xref); - for (const [e, a] of i.getAll()) { - t || (t = new Dict(this.xref)); - t.set(stringToPDFString(e), a); + const obj = this._catDict.get("Names"); + let xfaImages = null; + if (obj instanceof Dict && obj.has("XFAImages")) { + const nameTree = new NameTree(obj.getRaw("XFAImages"), this.xref); + for (const [key, value] of nameTree.getAll()) { + if (!xfaImages) { + xfaImages = new Dict(this.xref); + } + xfaImages.set(stringToPDFString(key), value); } } - return shadow(this, "xfaImages", t); + return shadow(this, "xfaImages", xfaImages); } _collectJavaScript() { - const e = this._catDict.get("Names"); - let t = null; - function appendIfJavaScriptDict(e, i) { - if (!(i instanceof Dict)) return; - if (!isName(i.get("S"), "JavaScript")) return; - let a = i.get("JS"); - if (a instanceof BaseStream) a = a.getString(); - else if ("string" != typeof a) return; - a = stringToPDFString(a).replaceAll("\0", ""); - a && (t ||= new Map()).set(e, a); - } - if (e instanceof Dict && e.has("JavaScript")) { - const t = new NameTree(e.getRaw("JavaScript"), this.xref); - for (const [e, i] of t.getAll()) - appendIfJavaScriptDict(stringToPDFString(e), i); - } - const i = this._catDict.get("OpenAction"); - i && appendIfJavaScriptDict("OpenAction", i); - return t; - } - get jsActions() { - const e = this._collectJavaScript(); - let t = collectActions(this.xref, this._catDict, dA); - if (e) { - t ||= Object.create(null); - for (const [i, a] of e) i in t ? t[i].push(a) : (t[i] = [a]); - } - return shadow(this, "jsActions", t); - } - async fontFallback(e, t) { - const i = await Promise.all(this.fontCache); - for (const a of i) - if (a.loadedName === e) { - a.fallback(t); + const obj = this._catDict.get("Names"); + let javaScript = null; + function appendIfJavaScriptDict(name, jsDict) { + if (!(jsDict instanceof Dict)) { return; } + if (!isName(jsDict.get("S"), "JavaScript")) { + return; + } + let js = jsDict.get("JS"); + if (js instanceof BaseStream) { + js = js.getString(); + } else if (typeof js !== "string") { + return; + } + js = stringToPDFString(js).replaceAll("\x00", ""); + if (js) { + (javaScript ||= new Map()).set(name, js); + } + } + if (obj instanceof Dict && obj.has("JavaScript")) { + const nameTree = new NameTree(obj.getRaw("JavaScript"), this.xref); + for (const [key, value] of nameTree.getAll()) { + appendIfJavaScriptDict(stringToPDFString(key), value); + } + } + const openAction = this._catDict.get("OpenAction"); + if (openAction) { + appendIfJavaScriptDict("OpenAction", openAction); + } + return javaScript; } - async cleanup(e = !1) { + get jsActions() { + const javaScript = this._collectJavaScript(); + let actions = collectActions( + this.xref, + this._catDict, + DocumentActionEventType, + ); + if (javaScript) { + actions ||= Object.create(null); + for (const [key, val] of javaScript) { + if (key in actions) { + actions[key].push(val); + } else { + actions[key] = [val]; + } + } + } + return shadow(this, "jsActions", actions); + } + async fontFallback(id, handler) { + const translatedFonts = await Promise.all(this.fontCache); + for (const translatedFont of translatedFonts) { + if (translatedFont.loadedName === id) { + translatedFont.fallback(handler); + return; + } + } + } + async cleanup(manuallyTriggered = false) { clearGlobalCaches(); - this.globalImageCache.clear(e); + this.globalImageCache.clear(manuallyTriggered); this.pageKidsCountCache.clear(); this.pageIndexCache.clear(); + this.pageDictCache.clear(); this.nonBlendModesSet.clear(); - const t = await Promise.all(this.fontCache); - for (const { dict: e } of t) delete e.cacheKey; + const translatedFonts = await Promise.all(this.fontCache); + for (const { dict } of translatedFonts) { + delete dict.cacheKey; + } this.fontCache.clear(); this.builtInCMapCache.clear(); this.standardFontDataCache.clear(); this.systemFontCache.clear(); } - async getPageDict(e) { - const t = [this.toplevelPagesDict], - i = new RefSet(), - a = this._catDict.getRaw("Pages"); - a instanceof Ref && i.put(a); - const s = this.xref, - r = this.pageKidsCountCache, - n = this.pageIndexCache; - let g = 0; - for (; t.length; ) { - const a = t.pop(); - if (a instanceof Ref) { - const o = r.get(a); - if (o >= 0 && g + o <= e) { - g += o; + async getPageDict(pageIndex) { + const nodesToVisit = [this.toplevelPagesDict]; + const visitedNodes = new RefSet(); + const pagesRef = this._catDict.getRaw("Pages"); + if (pagesRef instanceof Ref) { + visitedNodes.put(pagesRef); + } + const xref = this.xref, + pageKidsCountCache = this.pageKidsCountCache, + pageIndexCache = this.pageIndexCache, + pageDictCache = this.pageDictCache; + let currentPageIndex = 0; + while (nodesToVisit.length) { + const currentNode = nodesToVisit.pop(); + if (currentNode instanceof Ref) { + const count = pageKidsCountCache.get(currentNode); + if (count >= 0 && currentPageIndex + count <= pageIndex) { + currentPageIndex += count; continue; } - if (i.has(a)) + if (visitedNodes.has(currentNode)) { throw new FormatError("Pages tree contains circular reference."); - i.put(a); - const c = await s.fetchAsync(a); - if (c instanceof Dict) { - let t = c.getRaw("Type"); - t instanceof Ref && (t = await s.fetchAsync(t)); - if (isName(t, "Page") || !c.has("Kids")) { - r.has(a) || r.put(a, 1); - n.has(a) || n.put(a, g); - if (g === e) return [c, a]; - g++; + } + visitedNodes.put(currentNode); + const obj = await (pageDictCache.get(currentNode) || + xref.fetchAsync(currentNode)); + if (obj instanceof Dict) { + let type = obj.getRaw("Type"); + if (type instanceof Ref) { + type = await xref.fetchAsync(type); + } + if (isName(type, "Page") || !obj.has("Kids")) { + if (!pageKidsCountCache.has(currentNode)) { + pageKidsCountCache.put(currentNode, 1); + } + if (!pageIndexCache.has(currentNode)) { + pageIndexCache.put(currentNode, currentPageIndex); + } + if (currentPageIndex === pageIndex) { + return [obj, currentNode]; + } + currentPageIndex++; continue; } } - t.push(c); + nodesToVisit.push(obj); continue; } - if (!(a instanceof Dict)) + if (!(currentNode instanceof Dict)) { throw new FormatError( "Page dictionary kid reference points to wrong type of object.", ); - const { objId: o } = a; - let c = a.getRaw("Count"); - c instanceof Ref && (c = await s.fetchAsync(c)); - if (Number.isInteger(c) && c >= 0) { - o && !r.has(o) && r.put(o, c); - if (g + c <= e) { - g += c; + } + const { objId } = currentNode; + let count = currentNode.getRaw("Count"); + if (count instanceof Ref) { + count = await xref.fetchAsync(count); + } + if (Number.isInteger(count) && count >= 0) { + if (objId && !pageKidsCountCache.has(objId)) { + pageKidsCountCache.put(objId, count); + } + if (currentPageIndex + count <= pageIndex) { + currentPageIndex += count; continue; } } - let C = a.getRaw("Kids"); - C instanceof Ref && (C = await s.fetchAsync(C)); - if (!Array.isArray(C)) { - let t = a.getRaw("Type"); - t instanceof Ref && (t = await s.fetchAsync(t)); - if (isName(t, "Page") || !a.has("Kids")) { - if (g === e) return [a, null]; - g++; + let kids = currentNode.getRaw("Kids"); + if (kids instanceof Ref) { + kids = await xref.fetchAsync(kids); + } + if (!Array.isArray(kids)) { + let type = currentNode.getRaw("Type"); + if (type instanceof Ref) { + type = await xref.fetchAsync(type); + } + if (isName(type, "Page") || !currentNode.has("Kids")) { + if (currentPageIndex === pageIndex) { + return [currentNode, null]; + } + currentPageIndex++; continue; } throw new FormatError("Page dictionary kids object is not an array."); } - for (let e = C.length - 1; e >= 0; e--) t.push(C[e]); - } - throw new Error(`Page index ${e} not found.`); - } - async getAllPageDicts(e = !1) { - const { ignoreErrors: t } = this.pdfManager.evaluatorOptions, - i = [{ currentNode: this.toplevelPagesDict, posInKids: 0 }], - a = new RefSet(), - s = this._catDict.getRaw("Pages"); - s instanceof Ref && a.put(s); - const r = new Map(), - n = this.xref, - g = this.pageIndexCache; - let o = 0; - function addPageDict(e, t) { - t && !g.has(t) && g.put(t, o); - r.set(o++, [e, t]); - } - function addPageError(i) { - if (i instanceof XRefEntryException && !e) throw i; - if (e && t && 0 === o) { - warn(`getAllPageDicts - Skipping invalid first page: "${i}".`); - i = Dict.empty; + for (let last = kids.length - 1; last >= 0; last--) { + const lastKid = kids[last]; + nodesToVisit.push(lastKid); + if ( + currentNode === this.toplevelPagesDict && + lastKid instanceof Ref && + !pageDictCache.has(lastKid) + ) { + pageDictCache.put(lastKid, xref.fetchAsync(lastKid)); + } } - r.set(o++, [i, null]); } - for (; i.length > 0; ) { - const e = i.at(-1), - { currentNode: t, posInKids: s } = e; - let r = t.getRaw("Kids"); - if (r instanceof Ref) + throw new Error(`Page index ${pageIndex} not found.`); + } + async getAllPageDicts(recoveryMode = false) { + const { ignoreErrors } = this.pdfManager.evaluatorOptions; + const queue = [ + { + currentNode: this.toplevelPagesDict, + posInKids: 0, + }, + ]; + const visitedNodes = new RefSet(); + const pagesRef = this._catDict.getRaw("Pages"); + if (pagesRef instanceof Ref) { + visitedNodes.put(pagesRef); + } + const map = new Map(), + xref = this.xref, + pageIndexCache = this.pageIndexCache; + let pageIndex = 0; + function addPageDict(pageDict, pageRef) { + if (pageRef && !pageIndexCache.has(pageRef)) { + pageIndexCache.put(pageRef, pageIndex); + } + map.set(pageIndex++, [pageDict, pageRef]); + } + function addPageError(error) { + if (error instanceof XRefEntryException && !recoveryMode) { + throw error; + } + if (recoveryMode && ignoreErrors && pageIndex === 0) { + warn(`getAllPageDicts - Skipping invalid first page: "${error}".`); + error = Dict.empty; + } + map.set(pageIndex++, [error, null]); + } + while (queue.length > 0) { + const queueItem = queue.at(-1); + const { currentNode, posInKids } = queueItem; + let kids = currentNode.getRaw("Kids"); + if (kids instanceof Ref) { try { - r = await n.fetchAsync(r); - } catch (e) { - addPageError(e); + kids = await xref.fetchAsync(kids); + } catch (ex) { + addPageError(ex); break; } - if (!Array.isArray(r)) { + } + if (!Array.isArray(kids)) { addPageError( new FormatError("Page dictionary kids object is not an array."), ); break; } - if (s >= r.length) { - i.pop(); + if (posInKids >= kids.length) { + queue.pop(); continue; } - const g = r[s]; - let o; - if (g instanceof Ref) { - if (a.has(g)) { + const kidObj = kids[posInKids]; + let obj; + if (kidObj instanceof Ref) { + if (visitedNodes.has(kidObj)) { addPageError( new FormatError("Pages tree contains circular reference."), ); break; } - a.put(g); + visitedNodes.put(kidObj); try { - o = await n.fetchAsync(g); - } catch (e) { - addPageError(e); + obj = await xref.fetchAsync(kidObj); + } catch (ex) { + addPageError(ex); break; } - } else o = g; - if (!(o instanceof Dict)) { + } else { + obj = kidObj; + } + if (!(obj instanceof Dict)) { addPageError( new FormatError( "Page dictionary kid reference points to wrong type of object.", @@ -40855,669 +49331,1017 @@ class Catalog { ); break; } - let c = o.getRaw("Type"); - if (c instanceof Ref) + let type = obj.getRaw("Type"); + if (type instanceof Ref) { try { - c = await n.fetchAsync(c); - } catch (e) { - addPageError(e); + type = await xref.fetchAsync(type); + } catch (ex) { + addPageError(ex); break; } - isName(c, "Page") || !o.has("Kids") - ? addPageDict(o, g instanceof Ref ? g : null) - : i.push({ currentNode: o, posInKids: 0 }); - e.posInKids++; + } + if (isName(type, "Page") || !obj.has("Kids")) { + addPageDict(obj, kidObj instanceof Ref ? kidObj : null); + } else { + queue.push({ + currentNode: obj, + posInKids: 0, + }); + } + queueItem.posInKids++; } - return r; + return map; } - getPageIndex(e) { - const t = this.pageIndexCache.get(e); - if (void 0 !== t) return Promise.resolve(t); - const i = this.xref; - let a = 0; - const next = (t) => - (function pagesBeforeRef(t) { - let a, - s = 0; - return i - .fetchAsync(t) - .then(function (i) { - if ( - isRefsEqual(t, e) && - !isDict(i, "Page") && - !(i instanceof Dict && !i.has("Type") && i.has("Contents")) - ) - throw new FormatError( - "The reference does not point to a /Page dictionary.", - ); - if (!i) return null; - if (!(i instanceof Dict)) - throw new FormatError("Node must be a dictionary."); - a = i.getRaw("Parent"); - return i.getAsync("Parent"); - }) - .then(function (e) { - if (!e) return null; - if (!(e instanceof Dict)) - throw new FormatError("Parent must be a dictionary."); - return e.getAsync("Kids"); - }) - .then(function (e) { - if (!e) return null; - const r = []; - let n = !1; - for (const a of e) { - if (!(a instanceof Ref)) - throw new FormatError("Kid must be a reference."); - if (isRefsEqual(a, t)) { - n = !0; - break; - } - r.push( - i.fetchAsync(a).then(function (e) { - if (!(e instanceof Dict)) - throw new FormatError("Kid node must be a dictionary."); - e.has("Count") ? (s += e.get("Count")) : s++; - }), - ); + getPageIndex(pageRef) { + const cachedPageIndex = this.pageIndexCache.get(pageRef); + if (cachedPageIndex !== undefined) { + return Promise.resolve(cachedPageIndex); + } + const xref = this.xref; + function pagesBeforeRef(kidRef) { + let total = 0, + parentRef; + return xref + .fetchAsync(kidRef) + .then(function (node) { + if ( + isRefsEqual(kidRef, pageRef) && + !isDict(node, "Page") && + !(node instanceof Dict && !node.has("Type") && node.has("Contents")) + ) { + throw new FormatError( + "The reference does not point to a /Page dictionary.", + ); + } + if (!node) { + return null; + } + if (!(node instanceof Dict)) { + throw new FormatError("Node must be a dictionary."); + } + parentRef = node.getRaw("Parent"); + return node.getAsync("Parent"); + }) + .then(function (parent) { + if (!parent) { + return null; + } + if (!(parent instanceof Dict)) { + throw new FormatError("Parent must be a dictionary."); + } + return parent.getAsync("Kids"); + }) + .then(function (kids) { + if (!kids) { + return null; + } + const kidPromises = []; + let found = false; + for (const kid of kids) { + if (!(kid instanceof Ref)) { + throw new FormatError("Kid must be a reference."); } - if (!n) - throw new FormatError( - "Kid reference not found in parent's kids.", - ); - return Promise.all(r).then(function () { - return [s, a]; - }); + if (isRefsEqual(kid, kidRef)) { + found = true; + break; + } + kidPromises.push( + xref.fetchAsync(kid).then(function (obj) { + if (!(obj instanceof Dict)) { + throw new FormatError("Kid node must be a dictionary."); + } + if (obj.has("Count")) { + total += obj.get("Count"); + } else { + total++; + } + }), + ); + } + if (!found) { + throw new FormatError("Kid reference not found in parent's kids."); + } + return Promise.all(kidPromises).then(function () { + return [total, parentRef]; }); - })(t).then((t) => { - if (!t) { - this.pageIndexCache.put(e, a); - return a; + }); + } + let total = 0; + const next = (ref) => + pagesBeforeRef(ref).then((args) => { + if (!args) { + this.pageIndexCache.put(pageRef, total); + return total; } - const [i, s] = t; - a += i; - return next(s); + const [count, parentRef] = args; + total += count; + return next(parentRef); }); - return next(e); + return next(pageRef); } get baseUrl() { - const e = this._catDict.get("URI"); - if (e instanceof Dict) { - const t = e.get("Base"); - if ("string" == typeof t) { - const e = createValidAbsoluteUrl(t, null, { tryConvertEncoding: !0 }); - if (e) return shadow(this, "baseUrl", e.href); + const uri = this._catDict.get("URI"); + if (uri instanceof Dict) { + const base = uri.get("Base"); + if (typeof base === "string") { + const absoluteUrl = createValidAbsoluteUrl(base, null, { + tryConvertEncoding: true, + }); + if (absoluteUrl) { + return shadow(this, "baseUrl", absoluteUrl.href); + } } } return shadow(this, "baseUrl", this.pdfManager.docBaseUrl); } static parseDestDictionary({ - destDict: e, - resultObj: t, - docBaseUrl: i = null, - docAttachments: a = null, + destDict, + resultObj, + docBaseUrl = null, + docAttachments = null, }) { - if (!(e instanceof Dict)) { + if (!(destDict instanceof Dict)) { warn("parseDestDictionary: `destDict` must be a dictionary."); return; } - let s, - r, - n = e.get("A"); - if (!(n instanceof Dict)) - if (e.has("Dest")) n = e.get("Dest"); - else { - n = e.get("AA"); - n instanceof Dict && - (n.has("D") ? (n = n.get("D")) : n.has("U") && (n = n.get("U"))); + let action = destDict.get("A"), + url, + dest; + if (!(action instanceof Dict)) { + if (destDict.has("Dest")) { + action = destDict.get("Dest"); + } else { + action = destDict.get("AA"); + if (action instanceof Dict) { + if (action.has("D")) { + action = action.get("D"); + } else if (action.has("U")) { + action = action.get("U"); + } + } } - if (n instanceof Dict) { - const e = n.get("S"); - if (!(e instanceof Name)) { + } + if (action instanceof Dict) { + const actionType = action.get("S"); + if (!(actionType instanceof Name)) { warn("parseDestDictionary: Invalid type in Action dictionary."); return; } - const i = e.name; - switch (i) { + const actionName = actionType.name; + switch (actionName) { case "ResetForm": - const e = n.get("Flags"), - g = 0 == (1 & ("number" == typeof e ? e : 0)), - o = [], - c = []; - for (const e of n.get("Fields") || []) - e instanceof Ref - ? c.push(e.toString()) - : "string" == typeof e && o.push(stringToPDFString(e)); - t.resetForm = { fields: o, refs: c, include: g }; + const flags = action.get("Flags"); + const include = ((typeof flags === "number" ? flags : 0) & 1) === 0; + const fields = []; + const refs = []; + for (const obj of action.get("Fields") || []) { + if (obj instanceof Ref) { + refs.push(obj.toString()); + } else if (typeof obj === "string") { + fields.push(stringToPDFString(obj)); + } + } + resultObj.resetForm = { + fields, + refs, + include, + }; break; case "URI": - s = n.get("URI"); - s instanceof Name && (s = "/" + s.name); + url = action.get("URI"); + if (url instanceof Name) { + url = "/" + url.name; + } break; case "GoTo": - r = n.get("D"); + dest = action.get("D"); break; case "Launch": case "GoToR": - const C = n.get("F"); - if (C instanceof Dict) { - const e = new FileSpec(C, null, !0), - { rawFilename: t } = e.serializable; - s = t; - } else "string" == typeof C && (s = C); - const h = fetchRemoteDest(n); - h && "string" == typeof s && (s = s.split("#", 1)[0] + "#" + h); - const l = n.get("NewWindow"); - "boolean" == typeof l && (t.newWindow = l); + const urlDict = action.get("F"); + if (urlDict instanceof Dict) { + const fs = new FileSpec(urlDict, null, true); + const { rawFilename } = fs.serializable; + url = rawFilename; + } else if (typeof urlDict === "string") { + url = urlDict; + } + const remoteDest = fetchRemoteDest(action); + if (remoteDest && typeof url === "string") { + url = url.split("#", 1)[0] + "#" + remoteDest; + } + const newWindow = action.get("NewWindow"); + if (typeof newWindow === "boolean") { + resultObj.newWindow = newWindow; + } break; case "GoToE": - const Q = n.get("T"); - let E; - if (a && Q instanceof Dict) { - const e = Q.get("R"), - t = Q.get("N"); - isName(e, "C") && - "string" == typeof t && - (E = a[stringToPDFString(t)]); + const target = action.get("T"); + let attachment; + if (docAttachments && target instanceof Dict) { + const relationship = target.get("R"); + const name = target.get("N"); + if (isName(relationship, "C") && typeof name === "string") { + attachment = docAttachments[stringToPDFString(name)]; + } + } + if (attachment) { + resultObj.attachment = attachment; + const attachmentDest = fetchRemoteDest(action); + if (attachmentDest) { + resultObj.attachmentDest = attachmentDest; + } + } else { + warn(`parseDestDictionary - unimplemented "GoToE" action.`); } - if (E) { - t.attachment = E; - const e = fetchRemoteDest(n); - e && (t.attachmentDest = e); - } else warn('parseDestDictionary - unimplemented "GoToE" action.'); break; case "Named": - const u = n.get("N"); - u instanceof Name && (t.action = u.name); + const namedAction = action.get("N"); + if (namedAction instanceof Name) { + resultObj.action = namedAction.name; + } break; case "SetOCGState": - const d = n.get("State"), - f = n.get("PreserveRB"); - if (!Array.isArray(d) || 0 === d.length) break; - const p = []; - for (const e of d) - if (e instanceof Name) - switch (e.name) { + const state = action.get("State"); + const preserveRB = action.get("PreserveRB"); + if (!Array.isArray(state) || state.length === 0) { + break; + } + const stateArr = []; + for (const elem of state) { + if (elem instanceof Name) { + switch (elem.name) { case "ON": case "OFF": case "Toggle": - p.push(e.name); + stateArr.push(elem.name); + break; } - else e instanceof Ref && p.push(e.toString()); - if (p.length !== d.length) break; - t.setOCGState = { state: p, preserveRB: "boolean" != typeof f || f }; + } else if (elem instanceof Ref) { + stateArr.push(elem.toString()); + } + } + if (stateArr.length !== state.length) { + break; + } + resultObj.setOCGState = { + state: stateArr, + preserveRB: typeof preserveRB === "boolean" ? preserveRB : true, + }; break; case "JavaScript": - const m = n.get("JS"); - let y; - m instanceof BaseStream - ? (y = m.getString()) - : "string" == typeof m && (y = m); - const w = y && recoverJsURL(stringToPDFString(y)); - if (w) { - s = w.url; - t.newWindow = w.newWindow; + const jsAction = action.get("JS"); + let js; + if (jsAction instanceof BaseStream) { + js = jsAction.getString(); + } else if (typeof jsAction === "string") { + js = jsAction; + } + const jsURL = js && recoverJsURL(stringToPDFString(js)); + if (jsURL) { + url = jsURL.url; + resultObj.newWindow = jsURL.newWindow; break; } default: - if ("JavaScript" === i || "SubmitForm" === i) break; - warn(`parseDestDictionary - unsupported action: "${i}".`); + if (actionName === "JavaScript" || actionName === "SubmitForm") { + break; + } + warn(`parseDestDictionary - unsupported action: "${actionName}".`); + break; } - } else e.has("Dest") && (r = e.get("Dest")); - if ("string" == typeof s) { - const e = createValidAbsoluteUrl(s, i, { - addDefaultProtocol: !0, - tryConvertEncoding: !0, - }); - e && (t.url = e.href); - t.unsafeUrl = s; + } else if (destDict.has("Dest")) { + dest = destDict.get("Dest"); } - if (r) { - r instanceof Name && (r = r.name); - "string" == typeof r - ? (t.dest = stringToPDFString(r)) - : isValidExplicitDest(r) && (t.dest = r); + if (typeof url === "string") { + const absoluteUrl = createValidAbsoluteUrl(url, docBaseUrl, { + addDefaultProtocol: true, + tryConvertEncoding: true, + }); + if (absoluteUrl) { + resultObj.url = absoluteUrl.href; + } + resultObj.unsafeUrl = url; + } + if (dest) { + if (dest instanceof Name) { + dest = dest.name; + } + if (typeof dest === "string") { + resultObj.dest = stringToPDFString(dest); + } else if (isValidExplicitDest(dest)) { + resultObj.dest = dest; + } + } + } +} // ./src/core/object_loader.js + +function mayHaveChildren(value) { + return ( + value instanceof Ref || + value instanceof Dict || + value instanceof BaseStream || + Array.isArray(value) + ); +} +function addChildren(node, nodesToVisit) { + if (node instanceof Dict) { + node = node.getRawValues(); + } else if (node instanceof BaseStream) { + node = node.dict.getRawValues(); + } else if (!Array.isArray(node)) { + return; + } + for (const rawValue of node) { + if (mayHaveChildren(rawValue)) { + nodesToVisit.push(rawValue); } } } -function addChildren(e, t) { - if (e instanceof Dict) e = e.getRawValues(); - else if (e instanceof BaseStream) e = e.dict.getRawValues(); - else if (!Array.isArray(e)) return; - for (const a of e) - ((i = a) instanceof Ref || - i instanceof Dict || - i instanceof BaseStream || - Array.isArray(i)) && - t.push(a); - var i; -} class ObjectLoader { - constructor(e, t, i) { - this.dict = e; - this.keys = t; - this.xref = i; + constructor(dict, keys, xref) { + this.dict = dict; + this.keys = keys; + this.xref = xref; this.refSet = null; } async load() { - if (this.xref.stream.isDataLoaded) return; - const { keys: e, dict: t } = this; + if (this.xref.stream.isDataLoaded) { + return undefined; + } + const { keys, dict } = this; this.refSet = new RefSet(); - const i = []; - for (const a of e) { - const e = t.getRaw(a); - void 0 !== e && i.push(e); + const nodesToVisit = []; + for (const key of keys) { + const rawValue = dict.getRaw(key); + if (rawValue !== undefined) { + nodesToVisit.push(rawValue); + } } - return this._walk(i); + return this._walk(nodesToVisit); } - async _walk(e) { - const t = [], - i = []; - for (; e.length; ) { - let a = e.pop(); - if (a instanceof Ref) { - if (this.refSet.has(a)) continue; + async _walk(nodesToVisit) { + const nodesToRevisit = []; + const pendingRequests = []; + while (nodesToVisit.length) { + let currentNode = nodesToVisit.pop(); + if (currentNode instanceof Ref) { + if (this.refSet.has(currentNode)) { + continue; + } try { - this.refSet.put(a); - a = this.xref.fetch(a); - } catch (e) { - if (!(e instanceof MissingDataException)) { - warn(`ObjectLoader._walk - requesting all data: "${e}".`); + this.refSet.put(currentNode); + currentNode = this.xref.fetch(currentNode); + } catch (ex) { + if (!(ex instanceof MissingDataException)) { + warn(`ObjectLoader._walk - requesting all data: "${ex}".`); this.refSet = null; - const { manager: t } = this.xref.stream; - return t.requestAllChunks(); + const { manager } = this.xref.stream; + return manager.requestAllChunks(); } - t.push(a); - i.push({ begin: e.begin, end: e.end }); + nodesToRevisit.push(currentNode); + pendingRequests.push({ + begin: ex.begin, + end: ex.end, + }); } } - if (a instanceof BaseStream) { - const e = a.getBaseStreams(); - if (e) { - let s = !1; - for (const t of e) - if (!t.isDataLoaded) { - s = !0; - i.push({ begin: t.start, end: t.end }); + if (currentNode instanceof BaseStream) { + const baseStreams = currentNode.getBaseStreams(); + if (baseStreams) { + let foundMissingData = false; + for (const stream of baseStreams) { + if (stream.isDataLoaded) { + continue; } - s && t.push(a); + foundMissingData = true; + pendingRequests.push({ + begin: stream.start, + end: stream.end, + }); + } + if (foundMissingData) { + nodesToRevisit.push(currentNode); + } } } - addChildren(a, e); + addChildren(currentNode, nodesToVisit); } - if (i.length) { - await this.xref.stream.manager.requestRanges(i); - for (const e of t) e instanceof Ref && this.refSet.remove(e); - return this._walk(t); + if (pendingRequests.length) { + await this.xref.stream.manager.requestRanges(pendingRequests); + for (const node of nodesToRevisit) { + if (node instanceof Ref) { + this.refSet.remove(node); + } + } + return this._walk(nodesToRevisit); } this.refSet = null; + return undefined; } -} -const Ws = Symbol(), - js = Symbol(), - Xs = Symbol(), - Zs = Symbol(), - Vs = Symbol(), - zs = Symbol(), - _s = Symbol(), - $s = Symbol(), - Ar = Symbol(), - er = Symbol("content"), - tr = Symbol("data"), - ir = Symbol(), - ar = Symbol("extra"), - sr = Symbol(), - rr = Symbol(), - nr = Symbol(), - gr = Symbol(), - or = Symbol(), - Ir = Symbol(), - cr = Symbol(), - Cr = Symbol(), - hr = Symbol(), - lr = Symbol(), - Qr = Symbol(), - Er = Symbol(), - ur = Symbol(), - dr = Symbol(), - fr = Symbol(), - pr = Symbol(), - mr = Symbol(), - yr = Symbol(), - wr = Symbol(), - Dr = Symbol(), - br = Symbol(), - Fr = Symbol(), - Sr = Symbol(), - kr = Symbol(), - Rr = Symbol(), - Nr = Symbol(), - Gr = Symbol(), - xr = Symbol(), - Ur = Symbol(), - Mr = Symbol(), - Lr = Symbol(), - Hr = Symbol(), - Jr = Symbol("namespaceId"), - Yr = Symbol("nodeName"), - vr = Symbol(), - Kr = Symbol(), - Tr = Symbol(), - qr = Symbol(), - Or = Symbol(), - Pr = Symbol(), - Wr = Symbol(), - jr = Symbol(), - Xr = Symbol("root"), - Zr = Symbol(), - Vr = Symbol(), - zr = Symbol(), - _r = Symbol(), - $r = Symbol(), - An = Symbol(), - en = Symbol(), - tn = Symbol(), - an = Symbol(), - sn = Symbol(), - rn = Symbol(), - nn = Symbol("uid"), - gn = Symbol(), - on = { - config: { - id: 0, - check: (e) => e.startsWith("http://www.xfa.org/schema/xci/"), - }, - connectionSet: { - id: 1, - check: (e) => - e.startsWith("http://www.xfa.org/schema/xfa-connection-set/"), - }, - datasets: { - id: 2, - check: (e) => e.startsWith("http://www.xfa.org/schema/xfa-data/"), - }, - form: { - id: 3, - check: (e) => e.startsWith("http://www.xfa.org/schema/xfa-form/"), - }, - localeSet: { - id: 4, - check: (e) => e.startsWith("http://www.xfa.org/schema/xfa-locale-set/"), - }, - pdf: { id: 5, check: (e) => "http://ns.adobe.com/xdp/pdf/" === e }, - signature: { - id: 6, - check: (e) => "http://www.w3.org/2000/09/xmldsig#" === e, - }, - sourceSet: { - id: 7, - check: (e) => e.startsWith("http://www.xfa.org/schema/xfa-source-set/"), - }, - stylesheet: { - id: 8, - check: (e) => "http://www.w3.org/1999/XSL/Transform" === e, - }, - template: { - id: 9, - check: (e) => e.startsWith("http://www.xfa.org/schema/xfa-template/"), - }, - xdc: { - id: 10, - check: (e) => e.startsWith("http://www.xfa.org/schema/xdc/"), - }, - xdp: { id: 11, check: (e) => "http://ns.adobe.com/xdp/" === e }, - xfdf: { id: 12, check: (e) => "http://ns.adobe.com/xfdf/" === e }, - xhtml: { id: 13, check: (e) => "http://www.w3.org/1999/xhtml" === e }, - xmpmeta: { id: 14, check: (e) => "http://ns.adobe.com/xmpmeta/" === e }, +} // ./src/core/xfa/symbol_utils.js + +const $acceptWhitespace = Symbol(); +const $addHTML = Symbol(); +const $appendChild = Symbol(); +const $childrenToHTML = Symbol(); +const $clean = Symbol(); +const $cleanPage = Symbol(); +const $cleanup = Symbol(); +const $clone = Symbol(); +const $consumed = Symbol(); +const $content = Symbol("content"); +const $data = Symbol("data"); +const $dump = Symbol(); +const $extra = Symbol("extra"); +const $finalize = Symbol(); +const $flushHTML = Symbol(); +const $getAttributeIt = Symbol(); +const $getAttributes = Symbol(); +const $getAvailableSpace = Symbol(); +const $getChildrenByClass = Symbol(); +const $getChildrenByName = Symbol(); +const $getChildrenByNameIt = Symbol(); +const $getDataValue = Symbol(); +const $getExtra = Symbol(); +const $getRealChildrenByNameIt = Symbol(); +const $getChildren = Symbol(); +const $getContainedChildren = Symbol(); +const $getNextPage = Symbol(); +const $getSubformParent = Symbol(); +const $getParent = Symbol(); +const $getTemplateRoot = Symbol(); +const $globalData = Symbol(); +const $hasSettableValue = Symbol(); +const $ids = Symbol(); +const $indexOf = Symbol(); +const $insertAt = Symbol(); +const $isCDATAXml = Symbol(); +const $isBindable = Symbol(); +const $isDataValue = Symbol(); +const $isDescendent = Symbol(); +const $isNsAgnostic = Symbol(); +const $isSplittable = Symbol(); +const $isThereMoreWidth = Symbol(); +const $isTransparent = Symbol(); +const $isUsable = Symbol(); +const $lastAttribute = Symbol(); +const $namespaceId = Symbol("namespaceId"); +const $nodeName = Symbol("nodeName"); +const $nsAttributes = Symbol(); +const $onChild = Symbol(); +const $onChildCheck = Symbol(); +const $onText = Symbol(); +const $pushGlyphs = Symbol(); +const $popPara = Symbol(); +const $pushPara = Symbol(); +const $removeChild = Symbol(); +const $root = Symbol("root"); +const $resolvePrototypes = Symbol(); +const $searchNode = Symbol(); +const $setId = Symbol(); +const $setSetAttributes = Symbol(); +const $setValue = Symbol(); +const $tabIndex = Symbol(); +const $text = Symbol(); +const $toPages = Symbol(); +const $toHTML = Symbol(); +const $toString = Symbol(); +const $toStyle = Symbol(); +const $uid = Symbol("uid"); // ./src/core/xfa/namespaces.js + +const $buildXFAObject = Symbol(); +const NamespaceIds = { + config: { + id: 0, + check: (ns) => ns.startsWith("http://www.xfa.org/schema/xci/"), }, - In = { - pt: (e) => e, - cm: (e) => (e / 2.54) * 72, - mm: (e) => (e / 25.4) * 72, - in: (e) => 72 * e, - px: (e) => e, + connectionSet: { + id: 1, + check: (ns) => + ns.startsWith("http://www.xfa.org/schema/xfa-connection-set/"), }, - cn = /([+-]?\d+\.?\d*)(.*)/; -function stripQuotes(e) { - return e.startsWith("'") || e.startsWith('"') ? e.slice(1, -1) : e; + datasets: { + id: 2, + check: (ns) => ns.startsWith("http://www.xfa.org/schema/xfa-data/"), + }, + form: { + id: 3, + check: (ns) => ns.startsWith("http://www.xfa.org/schema/xfa-form/"), + }, + localeSet: { + id: 4, + check: (ns) => ns.startsWith("http://www.xfa.org/schema/xfa-locale-set/"), + }, + pdf: { + id: 5, + check: (ns) => ns === "http://ns.adobe.com/xdp/pdf/", + }, + signature: { + id: 6, + check: (ns) => ns === "http://www.w3.org/2000/09/xmldsig#", + }, + sourceSet: { + id: 7, + check: (ns) => ns.startsWith("http://www.xfa.org/schema/xfa-source-set/"), + }, + stylesheet: { + id: 8, + check: (ns) => ns === "http://www.w3.org/1999/XSL/Transform", + }, + template: { + id: 9, + check: (ns) => ns.startsWith("http://www.xfa.org/schema/xfa-template/"), + }, + xdc: { + id: 10, + check: (ns) => ns.startsWith("http://www.xfa.org/schema/xdc/"), + }, + xdp: { + id: 11, + check: (ns) => ns === "http://ns.adobe.com/xdp/", + }, + xfdf: { + id: 12, + check: (ns) => ns === "http://ns.adobe.com/xfdf/", + }, + xhtml: { + id: 13, + check: (ns) => ns === "http://www.w3.org/1999/xhtml", + }, + xmpmeta: { + id: 14, + check: (ns) => ns === "http://ns.adobe.com/xmpmeta/", + }, +}; // ./src/core/xfa/utils.js + +const dimConverters = { + pt: (x) => x, + cm: (x) => (x / 2.54) * 72, + mm: (x) => (x / (10 * 2.54)) * 72, + in: (x) => x * 72, + px: (x) => x, +}; +const measurementPattern = /([+-]?\d+\.?\d*)(.*)/; +function stripQuotes(str) { + if (str.startsWith("'") || str.startsWith('"')) { + return str.slice(1, -1); + } + return str; } -function getInteger({ data: e, defaultValue: t, validate: i }) { - if (!e) return t; - e = e.trim(); - const a = parseInt(e, 10); - return !isNaN(a) && i(a) ? a : t; +function getInteger({ data, defaultValue, validate }) { + if (!data) { + return defaultValue; + } + data = data.trim(); + const n = parseInt(data, 10); + if (!isNaN(n) && validate(n)) { + return n; + } + return defaultValue; } -function getFloat({ data: e, defaultValue: t, validate: i }) { - if (!e) return t; - e = e.trim(); - const a = parseFloat(e); - return !isNaN(a) && i(a) ? a : t; +function getFloat({ data, defaultValue, validate }) { + if (!data) { + return defaultValue; + } + data = data.trim(); + const n = parseFloat(data); + if (!isNaN(n) && validate(n)) { + return n; + } + return defaultValue; } -function getKeyword({ data: e, defaultValue: t, validate: i }) { - return e && i((e = e.trim())) ? e : t; +function getKeyword({ data, defaultValue, validate }) { + if (!data) { + return defaultValue; + } + data = data.trim(); + if (validate(data)) { + return data; + } + return defaultValue; } -function getStringOption(e, t) { +function getStringOption(data, options) { return getKeyword({ - data: e, - defaultValue: t[0], - validate: (e) => t.includes(e), + data, + defaultValue: options[0], + validate: (k) => options.includes(k), }); } -function getMeasurement(e, t = "0") { - t ||= "0"; - if (!e) return getMeasurement(t); - const i = e.trim().match(cn); - if (!i) return getMeasurement(t); - const [, a, s] = i, - r = parseFloat(a); - if (isNaN(r)) return getMeasurement(t); - if (0 === r) return 0; - const n = In[s]; - return n ? n(r) : r; +function getMeasurement(str, def = "0") { + def ||= "0"; + if (!str) { + return getMeasurement(def); + } + const match = str.trim().match(measurementPattern); + if (!match) { + return getMeasurement(def); + } + const [, valueStr, unit] = match; + const value = parseFloat(valueStr); + if (isNaN(value)) { + return getMeasurement(def); + } + if (value === 0) { + return 0; + } + const conv = dimConverters[unit]; + if (conv) { + return conv(value); + } + return value; } -function getRatio(e) { - if (!e) return { num: 1, den: 1 }; - const t = e +function getRatio(data) { + if (!data) { + return { + num: 1, + den: 1, + }; + } + const ratio = data .trim() .split(/\s*:\s*/) - .map((e) => parseFloat(e)) - .filter((e) => !isNaN(e)); - 1 === t.length && t.push(1); - if (0 === t.length) return { num: 1, den: 1 }; - const [i, a] = t; - return { num: i, den: a }; + .map((x) => parseFloat(x)) + .filter((x) => !isNaN(x)); + if (ratio.length === 1) { + ratio.push(1); + } + if (ratio.length === 0) { + return { + num: 1, + den: 1, + }; + } + const [num, den] = ratio; + return { + num, + den, + }; } -function getRelevant(e) { - return e - ? e - .trim() - .split(/\s+/) - .map((e) => ({ excluded: "-" === e[0], viewname: e.substring(1) })) - : []; +function getRelevant(data) { + if (!data) { + return []; + } + return data + .trim() + .split(/\s+/) + .map((e) => ({ + excluded: e[0] === "-", + viewname: e.substring(1), + })); +} +function getColor(data, def = [0, 0, 0]) { + let [r, g, b] = def; + if (!data) { + return { + r, + g, + b, + }; + } + const color = data + .trim() + .split(/\s*,\s*/) + .map((c) => Math.min(Math.max(0, parseInt(c.trim(), 10)), 255)) + .map((c) => (isNaN(c) ? 0 : c)); + if (color.length < 3) { + return { + r, + g, + b, + }; + } + [r, g, b] = color; + return { + r, + g, + b, + }; +} +function getBBox(data) { + const def = -1; + if (!data) { + return { + x: def, + y: def, + width: def, + height: def, + }; + } + const bbox = data + .trim() + .split(/\s*,\s*/) + .map((m) => getMeasurement(m, "-1")); + if (bbox.length < 4 || bbox[2] < 0 || bbox[3] < 0) { + return { + x: def, + y: def, + width: def, + height: def, + }; + } + const [x, y, width, height] = bbox; + return { + x, + y, + width, + height, + }; } class HTMLResult { static get FAILURE() { - return shadow(this, "FAILURE", new HTMLResult(!1, null, null, null)); + return shadow(this, "FAILURE", new HTMLResult(false, null, null, null)); } static get EMPTY() { - return shadow(this, "EMPTY", new HTMLResult(!0, null, null, null)); + return shadow(this, "EMPTY", new HTMLResult(true, null, null, null)); } - constructor(e, t, i, a) { - this.success = e; - this.html = t; - this.bbox = i; - this.breakNode = a; + constructor(success, html, bbox, breakNode) { + this.success = success; + this.html = html; + this.bbox = bbox; + this.breakNode = breakNode; } isBreak() { return !!this.breakNode; } - static breakNode(e) { - return new HTMLResult(!1, null, null, e); + static breakNode(node) { + return new HTMLResult(false, null, null, node); } - static success(e, t = null) { - return new HTMLResult(!0, e, t, null); + static success(html, bbox = null) { + return new HTMLResult(true, html, bbox, null); } -} +} // ./src/core/xfa/fonts.js + class FontFinder { - constructor(e) { + constructor(pdfFonts) { this.fonts = new Map(); this.cache = new Map(); this.warned = new Set(); this.defaultFont = null; - this.add(e); + this.add(pdfFonts); } - add(e, t = null) { - for (const t of e) this.addPdfFont(t); - for (const e of this.fonts.values()) - e.regular || (e.regular = e.italic || e.bold || e.bolditalic); - if (!t || 0 === t.size) return; - const i = this.fonts.get("PdfJS-Fallback-PdfJS-XFA"); - for (const e of t) this.fonts.set(e, i); + add(pdfFonts, reallyMissingFonts = null) { + for (const pdfFont of pdfFonts) { + this.addPdfFont(pdfFont); + } + for (const pdfFont of this.fonts.values()) { + if (!pdfFont.regular) { + pdfFont.regular = pdfFont.italic || pdfFont.bold || pdfFont.bolditalic; + } + } + if (!reallyMissingFonts || reallyMissingFonts.size === 0) { + return; + } + const myriad = this.fonts.get("PdfJS-Fallback-PdfJS-XFA"); + for (const missing of reallyMissingFonts) { + this.fonts.set(missing, myriad); + } } - addPdfFont(e) { - const t = e.cssFontInfo, - i = t.fontFamily; - let a = this.fonts.get(i); - if (!a) { - a = Object.create(null); - this.fonts.set(i, a); - this.defaultFont || (this.defaultFont = a); + addPdfFont(pdfFont) { + const cssFontInfo = pdfFont.cssFontInfo; + const name = cssFontInfo.fontFamily; + let font = this.fonts.get(name); + if (!font) { + font = Object.create(null); + this.fonts.set(name, font); + if (!this.defaultFont) { + this.defaultFont = font; + } } - let s = ""; - const r = parseFloat(t.fontWeight); - 0 !== parseFloat(t.italicAngle) - ? (s = r >= 700 ? "bolditalic" : "italic") - : r >= 700 && (s = "bold"); - if (!s) { - (e.name.includes("Bold") || e.psName?.includes("Bold")) && (s = "bold"); - (e.name.includes("Italic") || - e.name.endsWith("It") || - e.psName?.includes("Italic") || - e.psName?.endsWith("It")) && - (s += "italic"); + let property = ""; + const fontWeight = parseFloat(cssFontInfo.fontWeight); + if (parseFloat(cssFontInfo.italicAngle) !== 0) { + property = fontWeight >= 700 ? "bolditalic" : "italic"; + } else if (fontWeight >= 700) { + property = "bold"; } - s || (s = "regular"); - a[s] = e; + if (!property) { + if (pdfFont.name.includes("Bold") || pdfFont.psName?.includes("Bold")) { + property = "bold"; + } + if ( + pdfFont.name.includes("Italic") || + pdfFont.name.endsWith("It") || + pdfFont.psName?.includes("Italic") || + pdfFont.psName?.endsWith("It") + ) { + property += "italic"; + } + } + if (!property) { + property = "regular"; + } + font[property] = pdfFont; } getDefault() { return this.defaultFont; } - find(e, t = !0) { - let i = this.fonts.get(e) || this.cache.get(e); - if (i) return i; - const a = /,|-|_| |bolditalic|bold|italic|regular|it/gi; - let s = e.replaceAll(a, ""); - i = this.fonts.get(s); - if (i) { - this.cache.set(e, i); - return i; + find(fontName, mustWarn = true) { + let font = this.fonts.get(fontName) || this.cache.get(fontName); + if (font) { + return font; } - s = s.toLowerCase(); - const r = []; - for (const [e, t] of this.fonts.entries()) - e.replaceAll(a, "").toLowerCase().startsWith(s) && r.push(t); - if (0 === r.length) - for (const [, e] of this.fonts.entries()) - e.regular.name?.replaceAll(a, "").toLowerCase().startsWith(s) && - r.push(e); - if (0 === r.length) { - s = s.replaceAll(/psmt|mt/gi, ""); - for (const [e, t] of this.fonts.entries()) - e.replaceAll(a, "").toLowerCase().startsWith(s) && r.push(t); + const pattern = /,|-|_| |bolditalic|bold|italic|regular|it/gi; + let name = fontName.replaceAll(pattern, ""); + font = this.fonts.get(name); + if (font) { + this.cache.set(fontName, font); + return font; } - if (0 === r.length) - for (const e of this.fonts.values()) - e.regular.name?.replaceAll(a, "").toLowerCase().startsWith(s) && - r.push(e); - if (r.length >= 1) { - 1 !== r.length && - t && - warn(`XFA - Too many choices to guess the correct font: ${e}`); - this.cache.set(e, r[0]); - return r[0]; + name = name.toLowerCase(); + const maybe = []; + for (const [family, pdfFont] of this.fonts.entries()) { + if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) { + maybe.push(pdfFont); + } } - if (t && !this.warned.has(e)) { - this.warned.add(e); - warn(`XFA - Cannot find the font: ${e}`); + if (maybe.length === 0) { + for (const [, pdfFont] of this.fonts.entries()) { + if ( + pdfFont.regular.name + ?.replaceAll(pattern, "") + .toLowerCase() + .startsWith(name) + ) { + maybe.push(pdfFont); + } + } + } + if (maybe.length === 0) { + name = name.replaceAll(/psmt|mt/gi, ""); + for (const [family, pdfFont] of this.fonts.entries()) { + if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) { + maybe.push(pdfFont); + } + } + } + if (maybe.length === 0) { + for (const pdfFont of this.fonts.values()) { + if ( + pdfFont.regular.name + ?.replaceAll(pattern, "") + .toLowerCase() + .startsWith(name) + ) { + maybe.push(pdfFont); + } + } + } + if (maybe.length >= 1) { + if (maybe.length !== 1 && mustWarn) { + warn(`XFA - Too many choices to guess the correct font: ${fontName}`); + } + this.cache.set(fontName, maybe[0]); + return maybe[0]; + } + if (mustWarn && !this.warned.has(fontName)) { + this.warned.add(fontName); + warn(`XFA - Cannot find the font: ${fontName}`); } return null; } } -function selectFont(e, t) { - return "italic" === e.posture - ? "bold" === e.weight - ? t.bolditalic - : t.italic - : "bold" === e.weight - ? t.bold - : t.regular; +function selectFont(xfaFont, typeface) { + if (xfaFont.posture === "italic") { + if (xfaFont.weight === "bold") { + return typeface.bolditalic; + } + return typeface.italic; + } else if (xfaFont.weight === "bold") { + return typeface.bold; + } + return typeface.regular; } +function fonts_getMetrics(xfaFont, real = false) { + let pdfFont = null; + if (xfaFont) { + const name = stripQuotes(xfaFont.typeface); + const typeface = xfaFont[$globalData].fontFinder.find(name); + pdfFont = selectFont(xfaFont, typeface); + } + if (!pdfFont) { + return { + lineHeight: 12, + lineGap: 2, + lineNoGap: 10, + }; + } + const size = xfaFont.size || 10; + const lineHeight = pdfFont.lineHeight + ? Math.max(real ? 0 : 1.2, pdfFont.lineHeight) + : 1.2; + const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap; + return { + lineHeight: lineHeight * size, + lineGap: lineGap * size, + lineNoGap: Math.max(1, lineHeight - lineGap) * size, + }; +} // ./src/core/xfa/text.js + +const WIDTH_FACTOR = 1.02; class FontInfo { - constructor(e, t, i, a) { - this.lineHeight = i; - this.paraMargin = t || { top: 0, bottom: 0, left: 0, right: 0 }; - if (!e) { - [this.pdfFont, this.xfaFont] = this.defaultFont(a); + constructor(xfaFont, margin, lineHeight, fontFinder) { + this.lineHeight = lineHeight; + this.paraMargin = margin || { + top: 0, + bottom: 0, + left: 0, + right: 0, + }; + if (!xfaFont) { + [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder); return; } this.xfaFont = { - typeface: e.typeface, - posture: e.posture, - weight: e.weight, - size: e.size, - letterSpacing: e.letterSpacing, + typeface: xfaFont.typeface, + posture: xfaFont.posture, + weight: xfaFont.weight, + size: xfaFont.size, + letterSpacing: xfaFont.letterSpacing, }; - const s = a.find(e.typeface); - if (s) { - this.pdfFont = selectFont(e, s); - this.pdfFont || ([this.pdfFont, this.xfaFont] = this.defaultFont(a)); - } else [this.pdfFont, this.xfaFont] = this.defaultFont(a); - } - defaultFont(e) { - const t = - e.find("Helvetica", !1) || - e.find("Myriad Pro", !1) || - e.find("Arial", !1) || - e.getDefault(); - if (t?.regular) { - const e = t.regular; - return [ - e, - { - typeface: e.cssFontInfo.fontFamily, - posture: "normal", - weight: "normal", - size: 10, - letterSpacing: 0, - }, - ]; + const typeface = fontFinder.find(xfaFont.typeface); + if (!typeface) { + [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder); + return; } - return [ - null, - { - typeface: "Courier", + this.pdfFont = selectFont(xfaFont, typeface); + if (!this.pdfFont) { + [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder); + } + } + defaultFont(fontFinder) { + const font = + fontFinder.find("Helvetica", false) || + fontFinder.find("Myriad Pro", false) || + fontFinder.find("Arial", false) || + fontFinder.getDefault(); + if (font?.regular) { + const pdfFont = font.regular; + const info = pdfFont.cssFontInfo; + const xfaFont = { + typeface: info.fontFamily, posture: "normal", weight: "normal", size: 10, letterSpacing: 0, - }, - ]; + }; + return [pdfFont, xfaFont]; + } + const xfaFont = { + typeface: "Courier", + posture: "normal", + weight: "normal", + size: 10, + letterSpacing: 0, + }; + return [null, xfaFont]; } } class FontSelector { - constructor(e, t, i, a) { - this.fontFinder = a; - this.stack = [new FontInfo(e, t, i, a)]; + constructor( + defaultXfaFont, + defaultParaMargin, + defaultLineHeight, + fontFinder, + ) { + this.fontFinder = fontFinder; + this.stack = [ + new FontInfo( + defaultXfaFont, + defaultParaMargin, + defaultLineHeight, + fontFinder, + ), + ]; } - pushData(e, t, i) { - const a = this.stack.at(-1); - for (const t of ["typeface", "posture", "weight", "size", "letterSpacing"]) - e[t] || (e[t] = a.xfaFont[t]); - for (const e of ["top", "bottom", "left", "right"]) - isNaN(t[e]) && (t[e] = a.paraMargin[e]); - const s = new FontInfo(e, t, i || a.lineHeight, this.fontFinder); - s.pdfFont || (s.pdfFont = a.pdfFont); - this.stack.push(s); + pushData(xfaFont, margin, lineHeight) { + const lastFont = this.stack.at(-1); + for (const name of [ + "typeface", + "posture", + "weight", + "size", + "letterSpacing", + ]) { + if (!xfaFont[name]) { + xfaFont[name] = lastFont.xfaFont[name]; + } + } + for (const name of ["top", "bottom", "left", "right"]) { + if (isNaN(margin[name])) { + margin[name] = lastFont.paraMargin[name]; + } + } + const fontInfo = new FontInfo( + xfaFont, + margin, + lineHeight || lastFont.lineHeight, + this.fontFinder, + ); + if (!fontInfo.pdfFont) { + fontInfo.pdfFont = lastFont.pdfFont; + } + this.stack.push(fontInfo); } popFont() { this.stack.pop(); @@ -41527,1186 +50351,1523 @@ class FontSelector { } } class TextMeasure { - constructor(e, t, i, a) { + constructor(defaultXfaFont, defaultParaMargin, defaultLineHeight, fonts) { this.glyphs = []; - this.fontSelector = new FontSelector(e, t, i, a); + this.fontSelector = new FontSelector( + defaultXfaFont, + defaultParaMargin, + defaultLineHeight, + fonts, + ); this.extraHeight = 0; } - pushData(e, t, i) { - this.fontSelector.pushData(e, t, i); + pushData(xfaFont, margin, lineHeight) { + this.fontSelector.pushData(xfaFont, margin, lineHeight); } - popFont(e) { + popFont(xfaFont) { return this.fontSelector.popFont(); } addPara() { - const e = this.fontSelector.topFont(); - this.extraHeight += e.paraMargin.top + e.paraMargin.bottom; + const lastFont = this.fontSelector.topFont(); + this.extraHeight += lastFont.paraMargin.top + lastFont.paraMargin.bottom; } - addString(e) { - if (!e) return; - const t = this.fontSelector.topFont(), - i = t.xfaFont.size; - if (t.pdfFont) { - const a = t.xfaFont.letterSpacing, - s = t.pdfFont, - r = s.lineHeight || 1.2, - n = t.lineHeight || Math.max(1.2, r) * i, - g = r - (void 0 === s.lineGap ? 0.2 : s.lineGap), - o = Math.max(1, g) * i, - c = i / 1e3, - C = s.defaultWidth || s.charsToGlyphs(" ")[0].width; - for (const t of e.split(/[\u2029\n]/)) { - const e = s.encodeString(t).join(""), - i = s.charsToGlyphs(e); - for (const e of i) { - const t = e.width || C; - this.glyphs.push([t * c + a, n, o, e.unicode, !1]); + addString(str) { + if (!str) { + return; + } + const lastFont = this.fontSelector.topFont(); + const fontSize = lastFont.xfaFont.size; + if (lastFont.pdfFont) { + const letterSpacing = lastFont.xfaFont.letterSpacing; + const pdfFont = lastFont.pdfFont; + const fontLineHeight = pdfFont.lineHeight || 1.2; + const lineHeight = + lastFont.lineHeight || Math.max(1.2, fontLineHeight) * fontSize; + const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap; + const noGap = fontLineHeight - lineGap; + const firstLineHeight = Math.max(1, noGap) * fontSize; + const scale = fontSize / 1000; + const fallbackWidth = + pdfFont.defaultWidth || pdfFont.charsToGlyphs(" ")[0].width; + for (const line of str.split(/[\u2029\n]/)) { + const encodedLine = pdfFont.encodeString(line).join(""); + const glyphs = pdfFont.charsToGlyphs(encodedLine); + for (const glyph of glyphs) { + const width = glyph.width || fallbackWidth; + this.glyphs.push([ + width * scale + letterSpacing, + lineHeight, + firstLineHeight, + glyph.unicode, + false, + ]); } - this.glyphs.push([0, 0, 0, "\n", !0]); - } - this.glyphs.pop(); - } else { - for (const t of e.split(/[\u2029\n]/)) { - for (const e of t.split("")) this.glyphs.push([i, 1.2 * i, i, e, !1]); - this.glyphs.push([0, 0, 0, "\n", !0]); + this.glyphs.push([0, 0, 0, "\n", true]); } this.glyphs.pop(); + return; } - } - compute(e) { - let t = -1, - i = 0, - a = 0, - s = 0, - r = 0, - n = 0, - g = !1, - o = !0; - for (let c = 0, C = this.glyphs.length; c < C; c++) { - const [C, h, l, Q, E] = this.glyphs[c], - u = " " === Q, - d = o ? l : h; - if (E) { - a = Math.max(a, r); - r = 0; - s += n; - n = d; - t = -1; - i = 0; - o = !1; - } else if (u) - if (r + C > e) { - a = Math.max(a, r); - r = 0; - s += n; - n = d; - t = -1; - i = 0; - g = !0; - o = !1; - } else { - n = Math.max(d, n); - i = r; - r += C; - t = c; - } - else if (r + C > e) { - s += n; - n = d; - if (-1 !== t) { - c = t; - a = Math.max(a, i); - r = 0; - t = -1; - i = 0; - } else { - a = Math.max(a, r); - r = C; - } - g = !0; - o = !1; - } else { - r += C; - n = Math.max(d, n); + for (const line of str.split(/[\u2029\n]/)) { + for (const char of line.split("")) { + this.glyphs.push([fontSize, 1.2 * fontSize, fontSize, char, false]); } + this.glyphs.push([0, 0, 0, "\n", true]); } - a = Math.max(a, r); - s += n + this.extraHeight; - return { width: 1.02 * a, height: s, isBroken: g }; + this.glyphs.pop(); } + compute(maxWidth) { + let lastSpacePos = -1, + lastSpaceWidth = 0, + width = 0, + height = 0, + currentLineWidth = 0, + currentLineHeight = 0; + let isBroken = false; + let isFirstLine = true; + for (let i = 0, ii = this.glyphs.length; i < ii; i++) { + const [glyphWidth, lineHeight, firstLineHeight, char, isEOL] = + this.glyphs[i]; + const isSpace = char === " "; + const glyphHeight = isFirstLine ? firstLineHeight : lineHeight; + if (isEOL) { + width = Math.max(width, currentLineWidth); + currentLineWidth = 0; + height += currentLineHeight; + currentLineHeight = glyphHeight; + lastSpacePos = -1; + lastSpaceWidth = 0; + isFirstLine = false; + continue; + } + if (isSpace) { + if (currentLineWidth + glyphWidth > maxWidth) { + width = Math.max(width, currentLineWidth); + currentLineWidth = 0; + height += currentLineHeight; + currentLineHeight = glyphHeight; + lastSpacePos = -1; + lastSpaceWidth = 0; + isBroken = true; + isFirstLine = false; + } else { + currentLineHeight = Math.max(glyphHeight, currentLineHeight); + lastSpaceWidth = currentLineWidth; + currentLineWidth += glyphWidth; + lastSpacePos = i; + } + continue; + } + if (currentLineWidth + glyphWidth > maxWidth) { + height += currentLineHeight; + currentLineHeight = glyphHeight; + if (lastSpacePos !== -1) { + i = lastSpacePos; + width = Math.max(width, lastSpaceWidth); + currentLineWidth = 0; + lastSpacePos = -1; + lastSpaceWidth = 0; + } else { + width = Math.max(width, currentLineWidth); + currentLineWidth = glyphWidth; + } + isBroken = true; + isFirstLine = false; + continue; + } + currentLineWidth += glyphWidth; + currentLineHeight = Math.max(glyphHeight, currentLineHeight); + } + width = Math.max(width, currentLineWidth); + height += currentLineHeight + this.extraHeight; + return { + width: WIDTH_FACTOR * width, + height, + isBroken, + }; + } +} // ./src/core/xfa/som.js + +const namePattern = /^[^.[]+/; +const indexPattern = /^[^\]]+/; +const operators = { + dot: 0, + dotDot: 1, + dotHash: 2, + dotBracket: 3, + dotParen: 4, +}; +const shortcuts = new Map([ + ["$data", (root, current) => (root.datasets ? root.datasets.data : root)], + [ + "$record", + (root, current) => + (root.datasets ? root.datasets.data : root)[$getChildren]()[0], + ], + ["$template", (root, current) => root.template], + ["$connectionSet", (root, current) => root.connectionSet], + ["$form", (root, current) => root.form], + ["$layout", (root, current) => root.layout], + ["$host", (root, current) => root.host], + ["$dataWindow", (root, current) => root.dataWindow], + ["$event", (root, current) => root.event], + ["!", (root, current) => root.datasets], + ["$xfa", (root, current) => root], + ["xfa", (root, current) => root], + ["$", (root, current) => current], +]); +const somCache = new WeakMap(); +function parseIndex(index) { + index = index.trim(); + if (index === "*") { + return Infinity; + } + return parseInt(index, 10) || 0; } -const Cn = /^[^.[]+/, - hn = /^[^\]]+/, - Bn = { dot: 0, dotDot: 1, dotHash: 2, dotBracket: 3, dotParen: 4 }, - ln = new Map([ - ["$data", (e, t) => (e.datasets ? e.datasets.data : e)], - ["$record", (e, t) => (e.datasets ? e.datasets.data : e)[Er]()[0]], - ["$template", (e, t) => e.template], - ["$connectionSet", (e, t) => e.connectionSet], - ["$form", (e, t) => e.form], - ["$layout", (e, t) => e.layout], - ["$host", (e, t) => e.host], - ["$dataWindow", (e, t) => e.dataWindow], - ["$event", (e, t) => e.event], - ["!", (e, t) => e.datasets], - ["$xfa", (e, t) => e], - ["xfa", (e, t) => e], - ["$", (e, t) => t], - ]), - Qn = new WeakMap(); -function parseExpression(e, t, i = !0) { - let a = e.match(Cn); - if (!a) return null; - let [s] = a; - const r = [ +function parseExpression(expr, dotDotAllowed, noExpr = true) { + let match = expr.match(namePattern); + if (!match) { + return null; + } + let [name] = match; + const parsed = [ { - name: s, - cacheName: "." + s, + name, + cacheName: "." + name, index: 0, js: null, formCalc: null, - operator: Bn.dot, + operator: operators.dot, }, ]; - let n = s.length; - for (; n < e.length; ) { - const o = n; - if ("[" === e.charAt(n++)) { - a = e.slice(n).match(hn); - if (!a) { + let pos = name.length; + while (pos < expr.length) { + const spos = pos; + const char = expr.charAt(pos++); + if (char === "[") { + match = expr.slice(pos).match(indexPattern); + if (!match) { warn("XFA - Invalid index in SOM expression"); return null; } - r.at(-1).index = - "*" === (g = (g = a[0]).trim()) ? 1 / 0 : parseInt(g, 10) || 0; - n += a[0].length + 1; + parsed.at(-1).index = parseIndex(match[0]); + pos += match[0].length + 1; continue; } - let c; - switch (e.charAt(n)) { + let operator; + switch (expr.charAt(pos)) { case ".": - if (!t) return null; - n++; - c = Bn.dotDot; + if (!dotDotAllowed) { + return null; + } + pos++; + operator = operators.dotDot; break; case "#": - n++; - c = Bn.dotHash; + pos++; + operator = operators.dotHash; break; case "[": - if (i) { + if (noExpr) { warn( "XFA - SOM expression contains a FormCalc subexpression which is not supported for now.", ); return null; } - c = Bn.dotBracket; + operator = operators.dotBracket; break; case "(": - if (i) { + if (noExpr) { warn( "XFA - SOM expression contains a JavaScript subexpression which is not supported for now.", ); return null; } - c = Bn.dotParen; + operator = operators.dotParen; break; default: - c = Bn.dot; + operator = operators.dot; + break; } - a = e.slice(n).match(Cn); - if (!a) break; - [s] = a; - n += s.length; - r.push({ - name: s, - cacheName: e.slice(o, n), - operator: c, + match = expr.slice(pos).match(namePattern); + if (!match) { + break; + } + [name] = match; + pos += name.length; + parsed.push({ + name, + cacheName: expr.slice(spos, pos), + operator, index: 0, js: null, formCalc: null, }); } - var g; - return r; + return parsed; } -function searchNode(e, t, i, a = !0, s = !0) { - const r = parseExpression(i, a); - if (!r) return null; - const n = ln.get(r[0].name); - let g, - o = 0; - if (n) { - g = !0; - e = [n(e, t)]; - o = 1; +function searchNode( + root, + container, + expr, + dotDotAllowed = true, + useCache = true, +) { + const parsed = parseExpression(expr, dotDotAllowed); + if (!parsed) { + return null; + } + const fn = shortcuts.get(parsed[0].name); + let i = 0; + let isQualified; + if (fn) { + isQualified = true; + root = [fn(root, container)]; + i = 1; } else { - g = null === t; - e = [t || e]; + isQualified = container === null; + root = [container || root]; } - for (let i = r.length; o < i; o++) { - const { name: i, cacheName: a, operator: n, index: c } = r[o], - C = []; - for (const t of e) { - if (!t.isXFAObject) continue; - let e, r; - if (s) { - r = Qn.get(t); - if (!r) { - r = new Map(); - Qn.set(t, r); - } - e = r.get(a); + for (let ii = parsed.length; i < ii; i++) { + const { name, cacheName, operator, index } = parsed[i]; + const nodes = []; + for (const node of root) { + if (!node.isXFAObject) { + continue; } - if (!e) { - switch (n) { - case Bn.dot: - e = t[cr](i, !1); - break; - case Bn.dotDot: - e = t[cr](i, !0); - break; - case Bn.dotHash: - e = t[Ir](i); - e = e.isXFAObjectArray ? e.children : [e]; + let children, cached; + if (useCache) { + cached = somCache.get(node); + if (!cached) { + cached = new Map(); + somCache.set(node, cached); } - s && r.set(a, e); + children = cached.get(cacheName); + } + if (!children) { + switch (operator) { + case operators.dot: + children = node[$getChildrenByName](name, false); + break; + case operators.dotDot: + children = node[$getChildrenByName](name, true); + break; + case operators.dotHash: + children = node[$getChildrenByClass](name); + children = children.isXFAObjectArray + ? children.children + : [children]; + break; + default: + break; + } + if (useCache) { + cached.set(cacheName, children); + } + } + if (children.length > 0) { + nodes.push(children); } - e.length > 0 && C.push(e); } - if (0 !== C.length || g || 0 !== o) - e = isFinite(c) - ? C.filter((e) => c < e.length).map((e) => e[c]) - : C.flat(); - else { - const i = t[pr](); - if (!(t = i)) return null; - o = -1; - e = [t]; - } - } - return 0 === e.length ? null : e; -} -function createDataNode(e, t, i) { - const a = parseExpression(i); - if (!a) return null; - if (a.some((e) => e.operator === Bn.dotDot)) return null; - const s = ln.get(a[0].name); - let r = 0; - if (s) { - e = s(e, t); - r = 1; - } else e = t || e; - for (let t = a.length; r < t; r++) { - const { name: t, operator: i, index: s } = a[r]; - if (!isFinite(s)) { - a[r].index = 0; - return e.createNodes(a.slice(r)); - } - let n; - switch (i) { - case Bn.dot: - n = e[cr](t, !1); - break; - case Bn.dotDot: - n = e[cr](t, !0); - break; - case Bn.dotHash: - n = e[Ir](t); - n = n.isXFAObjectArray ? n.children : [n]; - } - if (0 === n.length) return e.createNodes(a.slice(r)); - if (!(s < n.length)) { - a[r].index = s - n.length; - return e.createNodes(a.slice(r)); - } - { - const t = n[s]; - if (!t.isXFAObject) { - warn("XFA - Cannot create a node."); + if (nodes.length === 0 && !isQualified && i === 0) { + const parent = container[$getParent](); + container = parent; + if (!container) { return null; } - e = t; + i = -1; + root = [container]; + continue; + } + root = isFinite(index) + ? nodes.filter((node) => index < node.length).map((node) => node[index]) + : nodes.flat(); + } + if (root.length === 0) { + return null; + } + return root; +} +function createDataNode(root, container, expr) { + const parsed = parseExpression(expr); + if (!parsed) { + return null; + } + if (parsed.some((x) => x.operator === operators.dotDot)) { + return null; + } + const fn = shortcuts.get(parsed[0].name); + let i = 0; + if (fn) { + root = fn(root, container); + i = 1; + } else { + root = container || root; + } + for (let ii = parsed.length; i < ii; i++) { + const { name, operator, index } = parsed[i]; + if (!isFinite(index)) { + parsed[i].index = 0; + return root.createNodes(parsed.slice(i)); + } + let children; + switch (operator) { + case operators.dot: + children = root[$getChildrenByName](name, false); + break; + case operators.dotDot: + children = root[$getChildrenByName](name, true); + break; + case operators.dotHash: + children = root[$getChildrenByClass](name); + children = children.isXFAObjectArray ? children.children : [children]; + break; + default: + break; + } + if (children.length === 0) { + return root.createNodes(parsed.slice(i)); + } + if (index < children.length) { + const child = children[index]; + if (!child.isXFAObject) { + warn(`XFA - Cannot create a node.`); + return null; + } + root = child; + } else { + parsed[i].index = index - children.length; + return root.createNodes(parsed.slice(i)); } } return null; -} -const En = Symbol(), - un = Symbol(), - dn = Symbol(), - fn = Symbol("_children"), - pn = Symbol(), - mn = Symbol(), - yn = Symbol(), - wn = Symbol(), - Dn = Symbol(), - bn = Symbol(), - Fn = Symbol(), - Sn = Symbol(), - kn = Symbol(), - Rn = Symbol("parent"), - Nn = Symbol(), - Gn = Symbol(), - xn = Symbol(); -let Un = 0; -const Mn = on.datasets.id; +} // ./src/core/xfa/xfa_object.js + +const _applyPrototype = Symbol(); +const _attributes = Symbol(); +const _attributeNames = Symbol(); +const _children = Symbol("_children"); +const _cloneAttribute = Symbol(); +const _dataValue = Symbol(); +const _defaultValue = Symbol(); +const _filteredChildrenGenerator = Symbol(); +const _getPrototype = Symbol(); +const _getUnsetAttributes = Symbol(); +const _hasChildren = Symbol(); +const _max = Symbol(); +const _options = Symbol(); +const _parent = Symbol("parent"); +const _resolvePrototypesHelper = Symbol(); +const _setAttributes = Symbol(); +const _validator = Symbol(); +let uid = 0; +const NS_DATASETS = NamespaceIds.datasets.id; class XFAObject { - constructor(e, t, i = !1) { - this[Jr] = e; - this[Yr] = t; - this[Fn] = i; - this[Rn] = null; - this[fn] = []; - this[nn] = `${t}${Un++}`; - this[yr] = null; + constructor(nsId, name, hasChildren = false) { + this[$namespaceId] = nsId; + this[$nodeName] = name; + this[_hasChildren] = hasChildren; + this[_parent] = null; + this[_children] = []; + this[$uid] = `${name}${uid++}`; + this[$globalData] = null; } get isXFAObject() { - return !0; + return true; } get isXFAObjectArray() { - return !1; + return false; } - createNodes(e) { - let t = this, - i = null; - for (const { name: a, index: s } of e) { - for (let e = 0, r = isFinite(s) ? s : 0; e <= r; e++) { - const e = t[Jr] === Mn ? -1 : t[Jr]; - i = new XmlObject(e, a); - t[Xs](i); + createNodes(path) { + let root = this, + node = null; + for (const { name, index } of path) { + for (let i = 0, ii = isFinite(index) ? index : 0; i <= ii; i++) { + const nsId = + root[$namespaceId] === NS_DATASETS ? -1 : root[$namespaceId]; + node = new XmlObject(nsId, name); + root[$appendChild](node); } - t = i; + root = node; } - return i; + return node; } - [Kr](e) { - if (!this[Fn] || !this[Tr](e)) return !1; - const t = e[Yr], - i = this[t]; - if (!(i instanceof XFAObjectArray)) { - null !== i && this[jr](i); - this[t] = e; - this[Xs](e); - return !0; + [$onChild](child) { + if (!this[_hasChildren] || !this[$onChildCheck](child)) { + return false; } - if (i.push(e)) { - this[Xs](e); - return !0; + const name = child[$nodeName]; + const node = this[name]; + if (node instanceof XFAObjectArray) { + if (node.push(child)) { + this[$appendChild](child); + return true; + } + } else { + if (node !== null) { + this[$removeChild](node); + } + this[name] = child; + this[$appendChild](child); + return true; } - let a = ""; - this.id - ? (a = ` (id: ${this.id})`) - : this.name && (a = ` (name: ${this.name} ${this.h.value})`); - warn(`XFA - node "${this[Yr]}"${a} has already enough "${t}"!`); - return !1; + let id = ""; + if (this.id) { + id = ` (id: ${this.id})`; + } else if (this.name) { + id = ` (name: ${this.name} ${this.h.value})`; + } + warn(`XFA - node "${this[$nodeName]}"${id} has already enough "${name}"!`); + return false; } - [Tr](e) { - return this.hasOwnProperty(e[Yr]) && e[Jr] === this[Jr]; + [$onChildCheck](child) { + return ( + this.hasOwnProperty(child[$nodeName]) && + child[$namespaceId] === this[$namespaceId] + ); } - [Gr]() { - return !1; + [$isNsAgnostic]() { + return false; } - [Ws]() { - return !1; + [$acceptWhitespace]() { + return false; } - [Sr]() { - return !1; + [$isCDATAXml]() { + return false; } - [kr]() { - return !1; + [$isBindable]() { + return false; } - [Pr]() { - this.para && this[mr]()[ar].paraStack.pop(); + [$popPara]() { + if (this.para) { + this[$getTemplateRoot]()[$extra].paraStack.pop(); + } } - [Wr]() { - this[mr]()[ar].paraStack.push(this.para); + [$pushPara]() { + this[$getTemplateRoot]()[$extra].paraStack.push(this.para); } - [zr](e) { - this.id && this[Jr] === on.template.id && e.set(this.id, this); + [$setId](ids) { + if (this.id && this[$namespaceId] === NamespaceIds.template.id) { + ids.set(this.id, this); + } } - [mr]() { - return this[yr].template; + [$getTemplateRoot]() { + return this[$globalData].template; } - [xr]() { - return !1; + [$isSplittable]() { + return false; } - [Ur]() { - return !1; + [$isThereMoreWidth]() { + return false; } - [Xs](e) { - e[Rn] = this; - this[fn].push(e); - !e[yr] && this[yr] && (e[yr] = this[yr]); + [$appendChild](child) { + child[_parent] = this; + this[_children].push(child); + if (!child[$globalData] && this[$globalData]) { + child[$globalData] = this[$globalData]; + } } - [jr](e) { - const t = this[fn].indexOf(e); - this[fn].splice(t, 1); + [$removeChild](child) { + const i = this[_children].indexOf(child); + this[_children].splice(i, 1); } - [wr]() { + [$hasSettableValue]() { return this.hasOwnProperty("value"); } - [$r](e) {} - [qr](e) {} - [sr]() {} - [Vs](e) { - delete this[Fn]; - if (this[_s]) { - e.clean(this[_s]); - delete this[_s]; + [$setValue](_) {} + [$onText](_) {} + [$finalize]() {} + [$clean](builder) { + delete this[_hasChildren]; + if (this[$cleanup]) { + builder.clean(this[$cleanup]); + delete this[$cleanup]; } } - [br](e) { - return this[fn].indexOf(e); + [$indexOf](child) { + return this[_children].indexOf(child); } - [Fr](e, t) { - t[Rn] = this; - this[fn].splice(e, 0, t); - !t[yr] && this[yr] && (t[yr] = this[yr]); + [$insertAt](i, child) { + child[_parent] = this; + this[_children].splice(i, 0, child); + if (!child[$globalData] && this[$globalData]) { + child[$globalData] = this[$globalData]; + } } - [Mr]() { + [$isTransparent]() { return !this.name; } - [Hr]() { + [$lastAttribute]() { return ""; } - [en]() { - return 0 === this[fn].length - ? this[er] - : this[fn].map((e) => e[en]()).join(""); + [$text]() { + if (this[_children].length === 0) { + return this[$content]; + } + return this[_children].map((c) => c[$text]()).join(""); } - get [dn]() { - const e = Object.getPrototypeOf(this); - if (!e._attributes) { - const t = (e._attributes = new Set()); - for (const e of Object.getOwnPropertyNames(this)) { + get [_attributeNames]() { + const proto = Object.getPrototypeOf(this); + if (!proto._attributes) { + const attributes = (proto._attributes = new Set()); + for (const name of Object.getOwnPropertyNames(this)) { if ( - null === this[e] || - this[e] instanceof XFAObject || - this[e] instanceof XFAObjectArray - ) + this[name] === null || + this[name] instanceof XFAObject || + this[name] instanceof XFAObjectArray + ) { break; - t.add(e); - } - } - return shadow(this, dn, e._attributes); - } - [Nr](e) { - let t = this; - for (; t; ) { - if (t === e) return !0; - t = t[pr](); - } - return !1; - } - [pr]() { - return this[Rn]; - } - [fr]() { - return this[pr](); - } - [Er](e = null) { - return e ? this[e] : this[fn]; - } - [ir]() { - const e = Object.create(null); - this[er] && (e.$content = this[er]); - for (const t of Object.getOwnPropertyNames(this)) { - const i = this[t]; - null !== i && - (i instanceof XFAObject - ? (e[t] = i[ir]()) - : i instanceof XFAObjectArray - ? i.isEmpty() || (e[t] = i.dump()) - : (e[t] = i)); - } - return e; - } - [rn]() { - return null; - } - [an]() { - return HTMLResult.EMPTY; - } - *[ur]() { - for (const e of this[Er]()) yield e; - } - *[wn](e, t) { - for (const i of this[ur]()) - if (!e || t === e.has(i[Yr])) { - const e = this[or](), - t = i[an](e); - t.success || (this[ar].failingNode = i); - yield t; - } - } - [rr]() { - return null; - } - [js](e, t) { - this[ar].children.push(e); - } - [or]() {} - [Zs]({ filter: e = null, include: t = !0 }) { - if (this[ar].generator) { - const e = this[or](), - t = this[ar].failingNode[an](e); - if (!t.success) return t; - t.html && this[js](t.html, t.bbox); - delete this[ar].failingNode; - } else this[ar].generator = this[wn](e, t); - for (;;) { - const e = this[ar].generator.next(); - if (e.done) break; - const t = e.value; - if (!t.success) return t; - t.html && this[js](t.html, t.bbox); - } - this[ar].generator = null; - return HTMLResult.EMPTY; - } - [_r](e) { - this[Gn] = new Set(Object.keys(e)); - } - [bn](e) { - const t = this[dn], - i = this[Gn]; - return [...e].filter((e) => t.has(e) && !i.has(e)); - } - [Zr](e, t = new Set()) { - for (const i of this[fn]) i[Nn](e, t); - } - [Nn](e, t) { - const i = this[Dn](e, t); - i ? this[En](i, e, t) : this[Zr](e, t); - } - [Dn](e, t) { - const { use: i, usehref: a } = this; - if (!i && !a) return null; - let s = null, - r = null, - n = null, - g = i; - if (a) { - g = a; - a.startsWith("#som(") && a.endsWith(")") - ? (r = a.slice(5, -1)) - : a.startsWith(".#som(") && a.endsWith(")") - ? (r = a.slice(6, -1)) - : a.startsWith("#") - ? (n = a.slice(1)) - : a.startsWith(".#") && (n = a.slice(2)); - } else i.startsWith("#") ? (n = i.slice(1)) : (r = i); - this.use = this.usehref = ""; - if (n) s = e.get(n); - else { - s = searchNode(e.get(Xr), this, r, !0, !1); - s && (s = s[0]); - } - if (!s) { - warn(`XFA - Invalid prototype reference: ${g}.`); - return null; - } - if (s[Yr] !== this[Yr]) { - warn(`XFA - Incompatible prototype: ${s[Yr]} !== ${this[Yr]}.`); - return null; - } - if (t.has(s)) { - warn("XFA - Cycle detected in prototypes use."); - return null; - } - t.add(s); - const o = s[Dn](e, t); - o && s[En](o, e, t); - s[Zr](e, t); - t.delete(s); - return s; - } - [En](e, t, i) { - if (i.has(e)) { - warn("XFA - Cycle detected in prototypes use."); - return; - } - !this[er] && e[er] && (this[er] = e[er]); - new Set(i).add(e); - for (const t of this[bn](e[Gn])) { - this[t] = e[t]; - this[Gn] && this[Gn].add(t); - } - for (const a of Object.getOwnPropertyNames(this)) { - if (this[dn].has(a)) continue; - const s = this[a], - r = e[a]; - if (s instanceof XFAObjectArray) { - for (const e of s[fn]) e[Nn](t, i); - for (let a = s[fn].length, n = r[fn].length; a < n; a++) { - const r = e[fn][a][$s](); - if (!s.push(r)) break; - r[Rn] = this; - this[fn].push(r); - r[Nn](t, i); } - } else if (null === s) { - if (null !== r) { - const e = r[$s](); - e[Rn] = this; - this[a] = e; - this[fn].push(e); - e[Nn](t, i); - } - } else { - s[Zr](t, i); - r && s[En](r, t, i); + attributes.add(name); } } + return shadow(this, _attributeNames, proto._attributes); } - static [pn](e) { - return Array.isArray(e) - ? e.map((e) => XFAObject[pn](e)) - : "object" == typeof e && null !== e - ? Object.assign({}, e) - : e; - } - [$s]() { - const e = Object.create(Object.getPrototypeOf(this)); - for (const t of Object.getOwnPropertySymbols(this)) - try { - e[t] = this[t]; - } catch { - shadow(e, t, this[t]); + [$isDescendent](parent) { + let node = this; + while (node) { + if (node === parent) { + return true; } - e[nn] = `${e[Yr]}${Un++}`; - e[fn] = []; - for (const t of Object.getOwnPropertyNames(this)) { - if (this[dn].has(t)) { - e[t] = XFAObject[pn](this[t]); + node = node[$getParent](); + } + return false; + } + [$getParent]() { + return this[_parent]; + } + [$getSubformParent]() { + return this[$getParent](); + } + [$getChildren](name = null) { + if (!name) { + return this[_children]; + } + return this[name]; + } + [$dump]() { + const dumped = Object.create(null); + if (this[$content]) { + dumped.$content = this[$content]; + } + for (const name of Object.getOwnPropertyNames(this)) { + const value = this[name]; + if (value === null) { continue; } - const i = this[t]; - e[t] = i instanceof XFAObjectArray ? new XFAObjectArray(i[Sn]) : null; - } - for (const t of this[fn]) { - const i = t[Yr], - a = t[$s](); - e[fn].push(a); - a[Rn] = e; - null === e[i] ? (e[i] = a) : e[i][fn].push(a); - } - return e; - } - [Er](e = null) { - return e ? this[fn].filter((t) => t[Yr] === e) : this[fn]; - } - [Ir](e) { - return this[e]; - } - [cr](e, t, i = !0) { - return Array.from(this[Cr](e, t, i)); - } - *[Cr](e, t, i = !0) { - if ("parent" !== e) { - for (const i of this[fn]) { - i[Yr] === e && (yield i); - i.name === e && (yield i); - (t || i[Mr]()) && (yield* i[Cr](e, t, !1)); + if (value instanceof XFAObject) { + dumped[name] = value[$dump](); + } else if (value instanceof XFAObjectArray) { + if (!value.isEmpty()) { + dumped[name] = value.dump(); + } + } else { + dumped[name] = value; } - i && this[dn].has(e) && (yield new XFAAttribute(this, e, this[e])); - } else yield this[Rn]; + } + return dumped; + } + [$toStyle]() { + return null; + } + [$toHTML]() { + return HTMLResult.EMPTY; + } + *[$getContainedChildren]() { + for (const node of this[$getChildren]()) { + yield node; + } + } + *[_filteredChildrenGenerator](filter, include) { + for (const node of this[$getContainedChildren]()) { + if (!filter || include === filter.has(node[$nodeName])) { + const availableSpace = this[$getAvailableSpace](); + const res = node[$toHTML](availableSpace); + if (!res.success) { + this[$extra].failingNode = node; + } + yield res; + } + } + } + [$flushHTML]() { + return null; + } + [$addHTML](html, bbox) { + this[$extra].children.push(html); + } + [$getAvailableSpace]() {} + [$childrenToHTML]({ filter = null, include = true }) { + if (!this[$extra].generator) { + this[$extra].generator = this[_filteredChildrenGenerator]( + filter, + include, + ); + } else { + const availableSpace = this[$getAvailableSpace](); + const res = this[$extra].failingNode[$toHTML](availableSpace); + if (!res.success) { + return res; + } + if (res.html) { + this[$addHTML](res.html, res.bbox); + } + delete this[$extra].failingNode; + } + while (true) { + const gen = this[$extra].generator.next(); + if (gen.done) { + break; + } + const res = gen.value; + if (!res.success) { + return res; + } + if (res.html) { + this[$addHTML](res.html, res.bbox); + } + } + this[$extra].generator = null; + return HTMLResult.EMPTY; + } + [$setSetAttributes](attributes) { + this[_setAttributes] = new Set(Object.keys(attributes)); + } + [_getUnsetAttributes](protoAttributes) { + const allAttr = this[_attributeNames]; + const setAttr = this[_setAttributes]; + return [...protoAttributes].filter( + (x) => allAttr.has(x) && !setAttr.has(x), + ); + } + [$resolvePrototypes](ids, ancestors = new Set()) { + for (const child of this[_children]) { + child[_resolvePrototypesHelper](ids, ancestors); + } + } + [_resolvePrototypesHelper](ids, ancestors) { + const proto = this[_getPrototype](ids, ancestors); + if (proto) { + this[_applyPrototype](proto, ids, ancestors); + } else { + this[$resolvePrototypes](ids, ancestors); + } + } + [_getPrototype](ids, ancestors) { + const { use, usehref } = this; + if (!use && !usehref) { + return null; + } + let proto = null; + let somExpression = null; + let id = null; + let ref = use; + if (usehref) { + ref = usehref; + if (usehref.startsWith("#som(") && usehref.endsWith(")")) { + somExpression = usehref.slice("#som(".length, -1); + } else if (usehref.startsWith(".#som(") && usehref.endsWith(")")) { + somExpression = usehref.slice(".#som(".length, -1); + } else if (usehref.startsWith("#")) { + id = usehref.slice(1); + } else if (usehref.startsWith(".#")) { + id = usehref.slice(2); + } + } else if (use.startsWith("#")) { + id = use.slice(1); + } else { + somExpression = use; + } + this.use = this.usehref = ""; + if (id) { + proto = ids.get(id); + } else { + proto = searchNode(ids.get($root), this, somExpression, true, false); + if (proto) { + proto = proto[0]; + } + } + if (!proto) { + warn(`XFA - Invalid prototype reference: ${ref}.`); + return null; + } + if (proto[$nodeName] !== this[$nodeName]) { + warn( + `XFA - Incompatible prototype: ${proto[$nodeName]} !== ${this[$nodeName]}.`, + ); + return null; + } + if (ancestors.has(proto)) { + warn(`XFA - Cycle detected in prototypes use.`); + return null; + } + ancestors.add(proto); + const protoProto = proto[_getPrototype](ids, ancestors); + if (protoProto) { + proto[_applyPrototype](protoProto, ids, ancestors); + } + proto[$resolvePrototypes](ids, ancestors); + ancestors.delete(proto); + return proto; + } + [_applyPrototype](proto, ids, ancestors) { + if (ancestors.has(proto)) { + warn(`XFA - Cycle detected in prototypes use.`); + return; + } + if (!this[$content] && proto[$content]) { + this[$content] = proto[$content]; + } + const newAncestors = new Set(ancestors); + newAncestors.add(proto); + for (const unsetAttrName of this[_getUnsetAttributes]( + proto[_setAttributes], + )) { + this[unsetAttrName] = proto[unsetAttrName]; + if (this[_setAttributes]) { + this[_setAttributes].add(unsetAttrName); + } + } + for (const name of Object.getOwnPropertyNames(this)) { + if (this[_attributeNames].has(name)) { + continue; + } + const value = this[name]; + const protoValue = proto[name]; + if (value instanceof XFAObjectArray) { + for (const child of value[_children]) { + child[_resolvePrototypesHelper](ids, ancestors); + } + for ( + let i = value[_children].length, ii = protoValue[_children].length; + i < ii; + i++ + ) { + const child = proto[_children][i][$clone](); + if (value.push(child)) { + child[_parent] = this; + this[_children].push(child); + child[_resolvePrototypesHelper](ids, ancestors); + } else { + break; + } + } + continue; + } + if (value !== null) { + value[$resolvePrototypes](ids, ancestors); + if (protoValue) { + value[_applyPrototype](protoValue, ids, ancestors); + } + continue; + } + if (protoValue !== null) { + const child = protoValue[$clone](); + child[_parent] = this; + this[name] = child; + this[_children].push(child); + child[_resolvePrototypesHelper](ids, ancestors); + } + } + } + static [_cloneAttribute](obj) { + if (Array.isArray(obj)) { + return obj.map((x) => XFAObject[_cloneAttribute](x)); + } + if (typeof obj === "object" && obj !== null) { + return Object.assign({}, obj); + } + return obj; + } + [$clone]() { + const clone = Object.create(Object.getPrototypeOf(this)); + for (const $symbol of Object.getOwnPropertySymbols(this)) { + try { + clone[$symbol] = this[$symbol]; + } catch { + shadow(clone, $symbol, this[$symbol]); + } + } + clone[$uid] = `${clone[$nodeName]}${uid++}`; + clone[_children] = []; + for (const name of Object.getOwnPropertyNames(this)) { + if (this[_attributeNames].has(name)) { + clone[name] = XFAObject[_cloneAttribute](this[name]); + continue; + } + const value = this[name]; + clone[name] = + value instanceof XFAObjectArray + ? new XFAObjectArray(value[_max]) + : null; + } + for (const child of this[_children]) { + const name = child[$nodeName]; + const clonedChild = child[$clone](); + clone[_children].push(clonedChild); + clonedChild[_parent] = clone; + if (clone[name] === null) { + clone[name] = clonedChild; + } else { + clone[name][_children].push(clonedChild); + } + } + return clone; + } + [$getChildren](name = null) { + if (!name) { + return this[_children]; + } + return this[_children].filter((c) => c[$nodeName] === name); + } + [$getChildrenByClass](name) { + return this[name]; + } + [$getChildrenByName](name, allTransparent, first = true) { + return Array.from(this[$getChildrenByNameIt](name, allTransparent, first)); + } + *[$getChildrenByNameIt](name, allTransparent, first = true) { + if (name === "parent") { + yield this[_parent]; + return; + } + for (const child of this[_children]) { + if (child[$nodeName] === name) { + yield child; + } + if (child.name === name) { + yield child; + } + if (allTransparent || child[$isTransparent]()) { + yield* child[$getChildrenByNameIt](name, allTransparent, false); + } + } + if (first && this[_attributeNames].has(name)) { + yield new XFAAttribute(this, name, this[name]); + } } } class XFAObjectArray { - constructor(e = 1 / 0) { - this[Sn] = e; - this[fn] = []; + constructor(max = Infinity) { + this[_max] = max; + this[_children] = []; } get isXFAObject() { - return !1; + return false; } get isXFAObjectArray() { - return !0; + return true; } - push(e) { - if (this[fn].length <= this[Sn]) { - this[fn].push(e); - return !0; + push(child) { + const len = this[_children].length; + if (len <= this[_max]) { + this[_children].push(child); + return true; } - warn(`XFA - node "${e[Yr]}" accepts no more than ${this[Sn]} children`); - return !1; + warn( + `XFA - node "${child[$nodeName]}" accepts no more than ${this[_max]} children`, + ); + return false; } isEmpty() { - return 0 === this[fn].length; + return this[_children].length === 0; } dump() { - return 1 === this[fn].length - ? this[fn][0][ir]() - : this[fn].map((e) => e[ir]()); + return this[_children].length === 1 + ? this[_children][0][$dump]() + : this[_children].map((x) => x[$dump]()); } - [$s]() { - const e = new XFAObjectArray(this[Sn]); - e[fn] = this[fn].map((e) => e[$s]()); - return e; + [$clone]() { + const clone = new XFAObjectArray(this[_max]); + clone[_children] = this[_children].map((c) => c[$clone]()); + return clone; } get children() { - return this[fn]; + return this[_children]; } clear() { - this[fn].length = 0; + this[_children].length = 0; } } class XFAAttribute { - constructor(e, t, i) { - this[Rn] = e; - this[Yr] = t; - this[er] = i; - this[Ar] = !1; - this[nn] = "attribute" + Un++; + constructor(node, name, value) { + this[_parent] = node; + this[$nodeName] = name; + this[$content] = value; + this[$consumed] = false; + this[$uid] = `attribute${uid++}`; } - [pr]() { - return this[Rn]; + [$getParent]() { + return this[_parent]; } - [Rr]() { - return !0; + [$isDataValue]() { + return true; } - [hr]() { - return this[er].trim(); + [$getDataValue]() { + return this[$content].trim(); } - [$r](e) { - e = e.value || ""; - this[er] = e.toString(); + [$setValue](value) { + value = value.value || ""; + this[$content] = value.toString(); } - [en]() { - return this[er]; + [$text]() { + return this[$content]; } - [Nr](e) { - return this[Rn] === e || this[Rn][Nr](e); + [$isDescendent](parent) { + return this[_parent] === parent || this[_parent][$isDescendent](parent); } } class XmlObject extends XFAObject { - constructor(e, t, i = {}) { - super(e, t); - this[er] = ""; - this[mn] = null; - if ("#text" !== t) { - const e = new Map(); - this[un] = e; - for (const [t, a] of Object.entries(i)) - e.set(t, new XFAAttribute(this, t, a)); - if (i.hasOwnProperty(vr)) { - const e = i[vr].xfa.dataNode; - void 0 !== e && - ("dataGroup" === e - ? (this[mn] = !1) - : "dataValue" === e && (this[mn] = !0)); + constructor(nsId, name, attributes = {}) { + super(nsId, name); + this[$content] = ""; + this[_dataValue] = null; + if (name !== "#text") { + const map = new Map(); + this[_attributes] = map; + for (const [attrName, value] of Object.entries(attributes)) { + map.set(attrName, new XFAAttribute(this, attrName, value)); + } + if (attributes.hasOwnProperty($nsAttributes)) { + const dataNode = attributes[$nsAttributes].xfa.dataNode; + if (dataNode !== undefined) { + if (dataNode === "dataGroup") { + this[_dataValue] = false; + } else if (dataNode === "dataValue") { + this[_dataValue] = true; + } + } } } - this[Ar] = !1; + this[$consumed] = false; } - [sn](e) { - const t = this[Yr]; - if ("#text" === t) { - e.push(encodeToXmlString(this[er])); + [$toString](buf) { + const tagName = this[$nodeName]; + if (tagName === "#text") { + buf.push(encodeToXmlString(this[$content])); return; } - const i = utf8StringToString(t), - a = this[Jr] === Mn ? "xfa:" : ""; - e.push(`<${a}${i}`); - for (const [t, i] of this[un].entries()) { - const a = utf8StringToString(t); - e.push(` ${a}="${encodeToXmlString(i[er])}"`); + const utf8TagName = utf8StringToString(tagName); + const prefix = this[$namespaceId] === NS_DATASETS ? "xfa:" : ""; + buf.push(`<${prefix}${utf8TagName}`); + for (const [name, value] of this[_attributes].entries()) { + const utf8Name = utf8StringToString(name); + buf.push(` ${utf8Name}="${encodeToXmlString(value[$content])}"`); } - null !== this[mn] && - (this[mn] - ? e.push(' xfa:dataNode="dataValue"') - : e.push(' xfa:dataNode="dataGroup"')); - if (this[er] || 0 !== this[fn].length) { - e.push(">"); - if (this[er]) - "string" == typeof this[er] - ? e.push(encodeToXmlString(this[er])) - : this[er][sn](e); - else for (const t of this[fn]) t[sn](e); - e.push(``); - } else e.push("/>"); - } - [Kr](e) { - if (this[er]) { - const e = new XmlObject(this[Jr], "#text"); - this[Xs](e); - e[er] = this[er]; - this[er] = ""; + if (this[_dataValue] !== null) { + if (this[_dataValue]) { + buf.push(` xfa:dataNode="dataValue"`); + } else { + buf.push(` xfa:dataNode="dataGroup"`); + } } - this[Xs](e); - return !0; + if (!this[$content] && this[_children].length === 0) { + buf.push("/>"); + return; + } + buf.push(">"); + if (this[$content]) { + if (typeof this[$content] === "string") { + buf.push(encodeToXmlString(this[$content])); + } else { + this[$content][$toString](buf); + } + } else { + for (const child of this[_children]) { + child[$toString](buf); + } + } + buf.push(``); } - [qr](e) { - this[er] += e; + [$onChild](child) { + if (this[$content]) { + const node = new XmlObject(this[$namespaceId], "#text"); + this[$appendChild](node); + node[$content] = this[$content]; + this[$content] = ""; + } + this[$appendChild](child); + return true; } - [sr]() { - if (this[er] && this[fn].length > 0) { - const e = new XmlObject(this[Jr], "#text"); - this[Xs](e); - e[er] = this[er]; - delete this[er]; + [$onText](str) { + this[$content] += str; + } + [$finalize]() { + if (this[$content] && this[_children].length > 0) { + const node = new XmlObject(this[$namespaceId], "#text"); + this[$appendChild](node); + node[$content] = this[$content]; + delete this[$content]; } } - [an]() { - return "#text" === this[Yr] - ? HTMLResult.success({ name: "#text", value: this[er] }) - : HTMLResult.EMPTY; + [$toHTML]() { + if (this[$nodeName] === "#text") { + return HTMLResult.success({ + name: "#text", + value: this[$content], + }); + } + return HTMLResult.EMPTY; } - [Er](e = null) { - return e ? this[fn].filter((t) => t[Yr] === e) : this[fn]; + [$getChildren](name = null) { + if (!name) { + return this[_children]; + } + return this[_children].filter((c) => c[$nodeName] === name); } - [gr]() { - return this[un]; + [$getAttributes]() { + return this[_attributes]; } - [Ir](e) { - const t = this[un].get(e); - return void 0 !== t ? t : this[Er](e); + [$getChildrenByClass](name) { + const value = this[_attributes].get(name); + if (value !== undefined) { + return value; + } + return this[$getChildren](name); } - *[Cr](e, t) { - const i = this[un].get(e); - i && (yield i); - for (const i of this[fn]) { - i[Yr] === e && (yield i); - t && (yield* i[Cr](e, t)); + *[$getChildrenByNameIt](name, allTransparent) { + const value = this[_attributes].get(name); + if (value) { + yield value; + } + for (const child of this[_children]) { + if (child[$nodeName] === name) { + yield child; + } + if (allTransparent) { + yield* child[$getChildrenByNameIt](name, allTransparent); + } } } - *[nr](e, t) { - const i = this[un].get(e); - !i || (t && i[Ar]) || (yield i); - for (const i of this[fn]) yield* i[nr](e, t); - } - *[Qr](e, t, i) { - for (const a of this[fn]) { - a[Yr] !== e || (i && a[Ar]) || (yield a); - t && (yield* a[Qr](e, t, i)); + *[$getAttributeIt](name, skipConsumed) { + const value = this[_attributes].get(name); + if (value && (!skipConsumed || !value[$consumed])) { + yield value; + } + for (const child of this[_children]) { + yield* child[$getAttributeIt](name, skipConsumed); } } - [Rr]() { - return null === this[mn] - ? 0 === this[fn].length || this[fn][0][Jr] === on.xhtml.id - : this[mn]; + *[$getRealChildrenByNameIt](name, allTransparent, skipConsumed) { + for (const child of this[_children]) { + if (child[$nodeName] === name && (!skipConsumed || !child[$consumed])) { + yield child; + } + if (allTransparent) { + yield* child[$getRealChildrenByNameIt]( + name, + allTransparent, + skipConsumed, + ); + } + } } - [hr]() { - return null === this[mn] - ? 0 === this[fn].length - ? this[er].trim() - : this[fn][0][Jr] === on.xhtml.id - ? this[fn][0][en]().trim() - : null - : this[er].trim(); + [$isDataValue]() { + if (this[_dataValue] === null) { + return ( + this[_children].length === 0 || + this[_children][0][$namespaceId] === NamespaceIds.xhtml.id + ); + } + return this[_dataValue]; } - [$r](e) { - e = e.value || ""; - this[er] = e.toString(); + [$getDataValue]() { + if (this[_dataValue] === null) { + if (this[_children].length === 0) { + return this[$content].trim(); + } + if (this[_children][0][$namespaceId] === NamespaceIds.xhtml.id) { + return this[_children][0][$text]().trim(); + } + return null; + } + return this[$content].trim(); } - [ir](e = !1) { - const t = Object.create(null); - e && (t.$ns = this[Jr]); - this[er] && (t.$content = this[er]); - t.$name = this[Yr]; - t.children = []; - for (const i of this[fn]) t.children.push(i[ir](e)); - t.attributes = Object.create(null); - for (const [e, i] of this[un]) t.attributes[e] = i[er]; - return t; + [$setValue](value) { + value = value.value || ""; + this[$content] = value.toString(); + } + [$dump](hasNS = false) { + const dumped = Object.create(null); + if (hasNS) { + dumped.$ns = this[$namespaceId]; + } + if (this[$content]) { + dumped.$content = this[$content]; + } + dumped.$name = this[$nodeName]; + dumped.children = []; + for (const child of this[_children]) { + dumped.children.push(child[$dump](hasNS)); + } + dumped.attributes = Object.create(null); + for (const [name, value] of this[_attributes]) { + dumped.attributes[name] = value[$content]; + } + return dumped; } } class ContentObject extends XFAObject { - constructor(e, t) { - super(e, t); - this[er] = ""; + constructor(nsId, name) { + super(nsId, name); + this[$content] = ""; } - [qr](e) { - this[er] += e; + [$onText](text) { + this[$content] += text; } - [sr]() {} + [$finalize]() {} } class OptionObject extends ContentObject { - constructor(e, t, i) { - super(e, t); - this[kn] = i; + constructor(nsId, name, options) { + super(nsId, name); + this[_options] = options; } - [sr]() { - this[er] = getKeyword({ - data: this[er], - defaultValue: this[kn][0], - validate: (e) => this[kn].includes(e), + [$finalize]() { + this[$content] = getKeyword({ + data: this[$content], + defaultValue: this[_options][0], + validate: (k) => this[_options].includes(k), }); } - [Vs](e) { - super[Vs](e); - delete this[kn]; + [$clean](builder) { + super[$clean](builder); + delete this[_options]; } } class StringObject extends ContentObject { - [sr]() { - this[er] = this[er].trim(); + [$finalize]() { + this[$content] = this[$content].trim(); } } class IntegerObject extends ContentObject { - constructor(e, t, i, a) { - super(e, t); - this[yn] = i; - this[xn] = a; + constructor(nsId, name, defaultValue, validator) { + super(nsId, name); + this[_defaultValue] = defaultValue; + this[_validator] = validator; } - [sr]() { - this[er] = getInteger({ - data: this[er], - defaultValue: this[yn], - validate: this[xn], + [$finalize]() { + this[$content] = getInteger({ + data: this[$content], + defaultValue: this[_defaultValue], + validate: this[_validator], }); } - [Vs](e) { - super[Vs](e); - delete this[yn]; - delete this[xn]; + [$clean](builder) { + super[$clean](builder); + delete this[_defaultValue]; + delete this[_validator]; } } class Option01 extends IntegerObject { - constructor(e, t) { - super(e, t, 0, (e) => 1 === e); + constructor(nsId, name) { + super(nsId, name, 0, (n) => n === 1); } } class Option10 extends IntegerObject { - constructor(e, t) { - super(e, t, 1, (e) => 0 === e); + constructor(nsId, name) { + super(nsId, name, 1, (n) => n === 0); } +} // ./src/core/xfa/html_utils.js + +function measureToString(m) { + if (typeof m === "string") { + return "0px"; + } + return Number.isInteger(m) ? `${m}px` : `${m.toFixed(2)}px`; } -function measureToString(e) { - return "string" == typeof e - ? "0px" - : Number.isInteger(e) - ? `${e}px` - : `${e.toFixed(2)}px`; -} -const Ln = { - anchorType(e, t) { - const i = e[fr](); - if (i && (!i.layout || "position" === i.layout)) { - "transform" in t || (t.transform = ""); - switch (e.anchorType) { - case "bottomCenter": - t.transform += "translate(-50%, -100%)"; - break; - case "bottomLeft": - t.transform += "translate(0,-100%)"; - break; - case "bottomRight": - t.transform += "translate(-100%,-100%)"; - break; - case "middleCenter": - t.transform += "translate(-50%,-50%)"; - break; - case "middleLeft": - t.transform += "translate(0,-50%)"; - break; - case "middleRight": - t.transform += "translate(-100%,-50%)"; - break; - case "topCenter": - t.transform += "translate(-50%,0)"; - break; - case "topRight": - t.transform += "translate(-100%,0)"; - } +const converters = { + anchorType(node, style) { + const parent = node[$getSubformParent](); + if (!parent || (parent.layout && parent.layout !== "position")) { + return; + } + if (!("transform" in style)) { + style.transform = ""; + } + switch (node.anchorType) { + case "bottomCenter": + style.transform += "translate(-50%, -100%)"; + break; + case "bottomLeft": + style.transform += "translate(0,-100%)"; + break; + case "bottomRight": + style.transform += "translate(-100%,-100%)"; + break; + case "middleCenter": + style.transform += "translate(-50%,-50%)"; + break; + case "middleLeft": + style.transform += "translate(0,-50%)"; + break; + case "middleRight": + style.transform += "translate(-100%,-50%)"; + break; + case "topCenter": + style.transform += "translate(-50%,0)"; + break; + case "topRight": + style.transform += "translate(-100%,0)"; + break; } }, - dimensions(e, t) { - const i = e[fr](); - let a = e.w; - const s = e.h; - if (i.layout?.includes("row")) { - const t = i[ar], - s = e.colSpan; - let r; - if (-1 === s) { - r = t.columnWidths.slice(t.currentColumn).reduce((e, t) => e + t, 0); - t.currentColumn = 0; + dimensions(node, style) { + const parent = node[$getSubformParent](); + let width = node.w; + const height = node.h; + if (parent.layout?.includes("row")) { + const extra = parent[$extra]; + const colSpan = node.colSpan; + let w; + if (colSpan === -1) { + w = extra.columnWidths + .slice(extra.currentColumn) + .reduce((a, x) => a + x, 0); + extra.currentColumn = 0; } else { - r = t.columnWidths - .slice(t.currentColumn, t.currentColumn + s) - .reduce((e, t) => e + t, 0); - t.currentColumn = (t.currentColumn + e.colSpan) % t.columnWidths.length; + w = extra.columnWidths + .slice(extra.currentColumn, extra.currentColumn + colSpan) + .reduce((a, x) => a + x, 0); + extra.currentColumn = + (extra.currentColumn + node.colSpan) % extra.columnWidths.length; + } + if (!isNaN(w)) { + width = node.w = w; } - isNaN(r) || (a = e.w = r); } - t.width = "" !== a ? measureToString(a) : "auto"; - t.height = "" !== s ? measureToString(s) : "auto"; + style.width = width !== "" ? measureToString(width) : "auto"; + style.height = height !== "" ? measureToString(height) : "auto"; }, - position(e, t) { - const i = e[fr](); - if (!i?.layout || "position" === i.layout) { - t.position = "absolute"; - t.left = measureToString(e.x); - t.top = measureToString(e.y); + position(node, style) { + const parent = node[$getSubformParent](); + if (parent?.layout && parent.layout !== "position") { + return; + } + style.position = "absolute"; + style.left = measureToString(node.x); + style.top = measureToString(node.y); + }, + rotate(node, style) { + if (node.rotate) { + if (!("transform" in style)) { + style.transform = ""; + } + style.transform += `rotate(-${node.rotate}deg)`; + style.transformOrigin = "top left"; } }, - rotate(e, t) { - if (e.rotate) { - "transform" in t || (t.transform = ""); - t.transform += `rotate(-${e.rotate}deg)`; - t.transformOrigin = "top left"; - } - }, - presence(e, t) { - switch (e.presence) { + presence(node, style) { + switch (node.presence) { case "invisible": - t.visibility = "hidden"; + style.visibility = "hidden"; break; case "hidden": case "inactive": - t.display = "none"; + style.display = "none"; + break; } }, - hAlign(e, t) { - if ("para" === e[Yr]) - switch (e.hAlign) { + hAlign(node, style) { + if (node[$nodeName] === "para") { + switch (node.hAlign) { case "justifyAll": - t.textAlign = "justify-all"; + style.textAlign = "justify-all"; break; case "radix": - t.textAlign = "left"; + style.textAlign = "left"; break; default: - t.textAlign = e.hAlign; + style.textAlign = node.hAlign; } - else - switch (e.hAlign) { + } else { + switch (node.hAlign) { case "left": - t.alignSelf = "start"; + style.alignSelf = "start"; break; case "center": - t.alignSelf = "center"; + style.alignSelf = "center"; break; case "right": - t.alignSelf = "end"; + style.alignSelf = "end"; + break; } + } }, - margin(e, t) { - e.margin && (t.margin = e.margin[rn]().margin); + margin(node, style) { + if (node.margin) { + style.margin = node.margin[$toStyle]().margin; + } }, }; -function setMinMaxDimensions(e, t) { - if ("position" === e[fr]().layout) { - e.minW > 0 && (t.minWidth = measureToString(e.minW)); - e.maxW > 0 && (t.maxWidth = measureToString(e.maxW)); - e.minH > 0 && (t.minHeight = measureToString(e.minH)); - e.maxH > 0 && (t.maxHeight = measureToString(e.maxH)); +function setMinMaxDimensions(node, style) { + const parent = node[$getSubformParent](); + if (parent.layout === "position") { + if (node.minW > 0) { + style.minWidth = measureToString(node.minW); + } + if (node.maxW > 0) { + style.maxWidth = measureToString(node.maxW); + } + if (node.minH > 0) { + style.minHeight = measureToString(node.minH); + } + if (node.maxH > 0) { + style.maxHeight = measureToString(node.maxH); + } } } -function layoutText(e, t, i, a, s, r) { - const n = new TextMeasure(t, i, a, s); - "string" == typeof e ? n.addString(e) : e[Or](n); - return n.compute(r); +function layoutText(text, xfaFont, margin, lineHeight, fontFinder, width) { + const measure = new TextMeasure(xfaFont, margin, lineHeight, fontFinder); + if (typeof text === "string") { + measure.addString(text); + } else { + text[$pushGlyphs](measure); + } + return measure.compute(width); } -function layoutNode(e, t) { - let i = null, - a = null, - s = !1; - if ((!e.w || !e.h) && e.value) { - let r = 0, - n = 0; - if (e.margin) { - r = e.margin.leftInset + e.margin.rightInset; - n = e.margin.topInset + e.margin.bottomInset; +function layoutNode(node, availableSpace) { + let height = null; + let width = null; + let isBroken = false; + if ((!node.w || !node.h) && node.value) { + let marginH = 0; + let marginV = 0; + if (node.margin) { + marginH = node.margin.leftInset + node.margin.rightInset; + marginV = node.margin.topInset + node.margin.bottomInset; } - let g = null, - o = null; - if (e.para) { - o = Object.create(null); - g = "" === e.para.lineHeight ? null : e.para.lineHeight; - o.top = "" === e.para.spaceAbove ? 0 : e.para.spaceAbove; - o.bottom = "" === e.para.spaceBelow ? 0 : e.para.spaceBelow; - o.left = "" === e.para.marginLeft ? 0 : e.para.marginLeft; - o.right = "" === e.para.marginRight ? 0 : e.para.marginRight; + let lineHeight = null; + let margin = null; + if (node.para) { + margin = Object.create(null); + lineHeight = node.para.lineHeight === "" ? null : node.para.lineHeight; + margin.top = node.para.spaceAbove === "" ? 0 : node.para.spaceAbove; + margin.bottom = node.para.spaceBelow === "" ? 0 : node.para.spaceBelow; + margin.left = node.para.marginLeft === "" ? 0 : node.para.marginLeft; + margin.right = node.para.marginRight === "" ? 0 : node.para.marginRight; } - let c = e.font; - if (!c) { - const t = e[mr](); - let i = e[pr](); - for (; i && i !== t; ) { - if (i.font) { - c = i.font; + let font = node.font; + if (!font) { + const root = node[$getTemplateRoot](); + let parent = node[$getParent](); + while (parent && parent !== root) { + if (parent.font) { + font = parent.font; break; } - i = i[pr](); + parent = parent[$getParent](); } } - const C = (e.w || t.width) - r, - h = e[yr].fontFinder; + const maxWidth = (node.w || availableSpace.width) - marginH; + const fontFinder = node[$globalData].fontFinder; if ( - e.value.exData && - e.value.exData[er] && - "text/html" === e.value.exData.contentType + node.value.exData && + node.value.exData[$content] && + node.value.exData.contentType === "text/html" ) { - const t = layoutText(e.value.exData[er], c, o, g, h, C); - a = t.width; - i = t.height; - s = t.isBroken; + const res = layoutText( + node.value.exData[$content], + font, + margin, + lineHeight, + fontFinder, + maxWidth, + ); + width = res.width; + height = res.height; + isBroken = res.isBroken; } else { - const t = e.value[en](); - if (t) { - const e = layoutText(t, c, o, g, h, C); - a = e.width; - i = e.height; - s = e.isBroken; + const text = node.value[$text](); + if (text) { + const res = layoutText( + text, + font, + margin, + lineHeight, + fontFinder, + maxWidth, + ); + width = res.width; + height = res.height; + isBroken = res.isBroken; } } - null === a || e.w || (a += r); - null === i || e.h || (i += n); - } - return { w: a, h: i, isBroken: s }; -} -function computeBbox(e, t, i) { - let a; - if ("" !== e.w && "" !== e.h) a = [e.x, e.y, e.w, e.h]; - else { - if (!i) return null; - let s = e.w; - if ("" === s) { - if (0 === e.maxW) { - const t = e[fr](); - s = "position" === t.layout && "" !== t.w ? 0 : e.minW; - } else s = Math.min(e.maxW, i.width); - t.attributes.style.width = measureToString(s); + if (width !== null && !node.w) { + width += marginH; } - let r = e.h; - if ("" === r) { - if (0 === e.maxH) { - const t = e[fr](); - r = "position" === t.layout && "" !== t.h ? 0 : e.minH; - } else r = Math.min(e.maxH, i.height); - t.attributes.style.height = measureToString(r); + if (height !== null && !node.h) { + height += marginV; } - a = [e.x, e.y, s, r]; } - return a; + return { + w: width, + h: height, + isBroken, + }; } -function fixDimensions(e) { - const t = e[fr](); - if (t.layout?.includes("row")) { - const i = t[ar], - a = e.colSpan; - let s; - s = - -1 === a - ? i.columnWidths.slice(i.currentColumn).reduce((e, t) => e + t, 0) - : i.columnWidths - .slice(i.currentColumn, i.currentColumn + a) - .reduce((e, t) => e + t, 0); - isNaN(s) || (e.w = s); +function computeBbox(node, html, availableSpace) { + let bbox; + if (node.w !== "" && node.h !== "") { + bbox = [node.x, node.y, node.w, node.h]; + } else { + if (!availableSpace) { + return null; + } + let width = node.w; + if (width === "") { + if (node.maxW === 0) { + const parent = node[$getSubformParent](); + width = parent.layout === "position" && parent.w !== "" ? 0 : node.minW; + } else { + width = Math.min(node.maxW, availableSpace.width); + } + html.attributes.style.width = measureToString(width); + } + let height = node.h; + if (height === "") { + if (node.maxH === 0) { + const parent = node[$getSubformParent](); + height = + parent.layout === "position" && parent.h !== "" ? 0 : node.minH; + } else { + height = Math.min(node.maxH, availableSpace.height); + } + html.attributes.style.height = measureToString(height); + } + bbox = [node.x, node.y, width, height]; } - t.layout && "position" !== t.layout && (e.x = e.y = 0); - "table" === e.layout && - "" === e.w && - Array.isArray(e.columnWidths) && - (e.w = e.columnWidths.reduce((e, t) => e + t, 0)); + return bbox; } -function layoutClass(e) { - switch (e.layout) { +function fixDimensions(node) { + const parent = node[$getSubformParent](); + if (parent.layout?.includes("row")) { + const extra = parent[$extra]; + const colSpan = node.colSpan; + let width; + if (colSpan === -1) { + width = extra.columnWidths + .slice(extra.currentColumn) + .reduce((a, w) => a + w, 0); + } else { + width = extra.columnWidths + .slice(extra.currentColumn, extra.currentColumn + colSpan) + .reduce((a, w) => a + w, 0); + } + if (!isNaN(width)) { + node.w = width; + } + } + if (parent.layout && parent.layout !== "position") { + node.x = node.y = 0; + } + if (node.layout === "table") { + if (node.w === "" && Array.isArray(node.columnWidths)) { + node.w = node.columnWidths.reduce((a, x) => a + x, 0); + } + } +} +function layoutClass(node) { + switch (node.layout) { case "position": - default: return "xfaPosition"; case "lr-tb": return "xfaLrTb"; @@ -42720,81 +51881,103 @@ function layoutClass(e) { return "xfaTable"; case "tb": return "xfaTb"; + default: + return "xfaPosition"; } } -function toStyle(e, ...t) { - const i = Object.create(null); - for (const a of t) { - const t = e[a]; - if (null !== t) - if (Ln.hasOwnProperty(a)) Ln[a](e, i); - else if (t instanceof XFAObject) { - const e = t[rn](); - e - ? Object.assign(i, e) - : warn(`(DEBUG) - XFA - style for ${a} not implemented yet`); +function toStyle(node, ...names) { + const style = Object.create(null); + for (const name of names) { + const value = node[name]; + if (value === null) { + continue; + } + if (converters.hasOwnProperty(name)) { + converters[name](node, style); + continue; + } + if (value instanceof XFAObject) { + const newStyle = value[$toStyle](); + if (newStyle) { + Object.assign(style, newStyle); + } else { + warn(`(DEBUG) - XFA - style for ${name} not implemented yet`); } + } } - return i; + return style; } -function createWrapper(e, t) { - const { attributes: i } = t, - { style: a } = i, - s = { - name: "div", - attributes: { class: ["xfaWrapper"], style: Object.create(null) }, - children: [], - }; - i.class.push("xfaWrapped"); - if (e.border) { - const { widths: i, insets: r } = e.border[ar]; - let n, - g, - o = r[0], - c = r[3]; - const C = r[0] + r[2], - h = r[1] + r[3]; - switch (e.border.hand) { +function createWrapper(node, html) { + const { attributes } = html; + const { style } = attributes; + const wrapper = { + name: "div", + attributes: { + class: ["xfaWrapper"], + style: Object.create(null), + }, + children: [], + }; + attributes.class.push("xfaWrapped"); + if (node.border) { + const { widths, insets } = node.border[$extra]; + let width, height; + let top = insets[0]; + let left = insets[3]; + const insetsH = insets[0] + insets[2]; + const insetsW = insets[1] + insets[3]; + switch (node.border.hand) { case "even": - o -= i[0] / 2; - c -= i[3] / 2; - n = `calc(100% + ${(i[1] + i[3]) / 2 - h}px)`; - g = `calc(100% + ${(i[0] + i[2]) / 2 - C}px)`; + top -= widths[0] / 2; + left -= widths[3] / 2; + width = `calc(100% + ${(widths[1] + widths[3]) / 2 - insetsW}px)`; + height = `calc(100% + ${(widths[0] + widths[2]) / 2 - insetsH}px)`; break; case "left": - o -= i[0]; - c -= i[3]; - n = `calc(100% + ${i[1] + i[3] - h}px)`; - g = `calc(100% + ${i[0] + i[2] - C}px)`; + top -= widths[0]; + left -= widths[3]; + width = `calc(100% + ${widths[1] + widths[3] - insetsW}px)`; + height = `calc(100% + ${widths[0] + widths[2] - insetsH}px)`; break; case "right": - n = h ? `calc(100% - ${h}px)` : "100%"; - g = C ? `calc(100% - ${C}px)` : "100%"; + width = insetsW ? `calc(100% - ${insetsW}px)` : "100%"; + height = insetsH ? `calc(100% - ${insetsH}px)` : "100%"; + break; } - const l = ["xfaBorder"]; - isPrintOnly(e.border) && l.push("xfaPrintOnly"); - const Q = { + const classNames = ["xfaBorder"]; + if (isPrintOnly(node.border)) { + classNames.push("xfaPrintOnly"); + } + const border = { name: "div", attributes: { - class: l, - style: { top: `${o}px`, left: `${c}px`, width: n, height: g }, + class: classNames, + style: { + top: `${top}px`, + left: `${left}px`, + width, + height, + }, }, children: [], }; - for (const e of [ + for (const key of [ "border", "borderWidth", "borderColor", "borderRadius", "borderStyle", - ]) - if (void 0 !== a[e]) { - Q.attributes.style[e] = a[e]; - delete a[e]; + ]) { + if (style[key] !== undefined) { + border.attributes.style[key] = style[key]; + delete style[key]; } - s.children.push(Q, t); - } else s.children.push(t); - for (const e of [ + } + wrapper.children.push(border, html); + } else { + wrapper.children.push(html); + } + for (const key of [ "background", "backgroundClip", "top", @@ -42808,599 +51991,781 @@ function createWrapper(e, t) { "transform", "transformOrigin", "visibility", - ]) - if (void 0 !== a[e]) { - s.attributes.style[e] = a[e]; - delete a[e]; - } - s.attributes.style.position = - "absolute" === a.position ? "absolute" : "relative"; - delete a.position; - if (a.alignSelf) { - s.attributes.style.alignSelf = a.alignSelf; - delete a.alignSelf; - } - return s; -} -function fixTextIndent(e) { - const t = getMeasurement(e.textIndent, "0px"); - if (t >= 0) return; - const i = - "padding" + - ("left" === ("right" === e.textAlign ? "right" : "left") - ? "Left" - : "Right"), - a = getMeasurement(e[i], "0px"); - e[i] = a - t + "px"; -} -function setAccess(e, t) { - switch (e.access) { - case "nonInteractive": - t.push("xfaNonInteractive"); - break; - case "readOnly": - t.push("xfaReadOnly"); - break; - case "protected": - t.push("xfaDisabled"); - } -} -function isPrintOnly(e) { - return ( - e.relevant.length > 0 && - !e.relevant[0].excluded && - "print" === e.relevant[0].viewname - ); -} -function getCurrentPara(e) { - const t = e[mr]()[ar].paraStack; - return t.length ? t.at(-1) : null; -} -function setPara(e, t, i) { - if (i.attributes.class?.includes("xfaRich")) { - if (t) { - "" === e.h && (t.height = "auto"); - "" === e.w && (t.width = "auto"); - } - const a = getCurrentPara(e); - if (a) { - const e = i.attributes.style; - e.display = "flex"; - e.flexDirection = "column"; - switch (a.vAlign) { - case "top": - e.justifyContent = "start"; - break; - case "bottom": - e.justifyContent = "end"; - break; - case "middle": - e.justifyContent = "center"; - } - const t = a[rn](); - for (const [i, a] of Object.entries(t)) i in e || (e[i] = a); + ]) { + if (style[key] !== undefined) { + wrapper.attributes.style[key] = style[key]; + delete style[key]; } } + wrapper.attributes.style.position = + style.position === "absolute" ? "absolute" : "relative"; + delete style.position; + if (style.alignSelf) { + wrapper.attributes.style.alignSelf = style.alignSelf; + delete style.alignSelf; + } + return wrapper; } -function setFontFamily(e, t, i, a) { - if (!i) { - delete a.fontFamily; +function fixTextIndent(styles) { + const indent = getMeasurement(styles.textIndent, "0px"); + if (indent >= 0) { return; } - const s = stripQuotes(e.typeface); - a.fontFamily = `"${s}"`; - const r = i.find(s); - if (r) { - const { fontFamily: i } = r.regular.cssFontInfo; - i !== s && (a.fontFamily = `"${i}"`); - const n = getCurrentPara(t); - if (n && "" !== n.lineHeight) return; - if (a.lineHeight) return; - const g = selectFont(e, r); - g && (a.lineHeight = Math.max(1.2, g.lineHeight)); + const align = styles.textAlign === "right" ? "right" : "left"; + const name = "padding" + (align === "left" ? "Left" : "Right"); + const padding = getMeasurement(styles[name], "0px"); + styles[name] = `${padding - indent}px`; +} +function setAccess(node, classNames) { + switch (node.access) { + case "nonInteractive": + classNames.push("xfaNonInteractive"); + break; + case "readOnly": + classNames.push("xfaReadOnly"); + break; + case "protected": + classNames.push("xfaDisabled"); + break; } } -function fixURL(e) { - const t = createValidAbsoluteUrl(e, null, { - addDefaultProtocol: !0, - tryConvertEncoding: !0, - }); - return t ? t.href : null; +function isPrintOnly(node) { + return ( + node.relevant.length > 0 && + !node.relevant[0].excluded && + node.relevant[0].viewname === "print" + ); } -function createLine(e, t) { +function getCurrentPara(node) { + const stack = node[$getTemplateRoot]()[$extra].paraStack; + return stack.length ? stack.at(-1) : null; +} +function setPara(node, nodeStyle, value) { + if (value.attributes.class?.includes("xfaRich")) { + if (nodeStyle) { + if (node.h === "") { + nodeStyle.height = "auto"; + } + if (node.w === "") { + nodeStyle.width = "auto"; + } + } + const para = getCurrentPara(node); + if (para) { + const valueStyle = value.attributes.style; + valueStyle.display = "flex"; + valueStyle.flexDirection = "column"; + switch (para.vAlign) { + case "top": + valueStyle.justifyContent = "start"; + break; + case "bottom": + valueStyle.justifyContent = "end"; + break; + case "middle": + valueStyle.justifyContent = "center"; + break; + } + const paraStyle = para[$toStyle](); + for (const [key, val] of Object.entries(paraStyle)) { + if (!(key in valueStyle)) { + valueStyle[key] = val; + } + } + } + } +} +function setFontFamily(xfaFont, node, fontFinder, style) { + if (!fontFinder) { + delete style.fontFamily; + return; + } + const name = stripQuotes(xfaFont.typeface); + style.fontFamily = `"${name}"`; + const typeface = fontFinder.find(name); + if (typeface) { + const { fontFamily } = typeface.regular.cssFontInfo; + if (fontFamily !== name) { + style.fontFamily = `"${fontFamily}"`; + } + const para = getCurrentPara(node); + if (para && para.lineHeight !== "") { + return; + } + if (style.lineHeight) { + return; + } + const pdfFont = selectFont(xfaFont, typeface); + if (pdfFont) { + style.lineHeight = Math.max(1.2, pdfFont.lineHeight); + } + } +} +function fixURL(str) { + const absoluteUrl = createValidAbsoluteUrl(str, null, { + addDefaultProtocol: true, + tryConvertEncoding: true, + }); + return absoluteUrl ? absoluteUrl.href : null; +} // ./src/core/xfa/layout.js + +function createLine(node, children) { return { name: "div", - attributes: { class: ["lr-tb" === e.layout ? "xfaLr" : "xfaRl"] }, - children: t, + attributes: { + class: [node.layout === "lr-tb" ? "xfaLr" : "xfaRl"], + }, + children, }; } -function flushHTML(e) { - if (!e[ar]) return null; - const t = { - name: "div", - attributes: e[ar].attributes, - children: e[ar].children, - }; - if (e[ar].failingNode) { - const i = e[ar].failingNode[rr](); - i && - (e.layout.endsWith("-tb") - ? t.children.push(createLine(e, [i])) - : t.children.push(i)); +function flushHTML(node) { + if (!node[$extra]) { + return null; } - return 0 === t.children.length ? null : t; + const attributes = node[$extra].attributes; + const html = { + name: "div", + attributes, + children: node[$extra].children, + }; + if (node[$extra].failingNode) { + const htmlFromFailing = node[$extra].failingNode[$flushHTML](); + if (htmlFromFailing) { + if (node.layout.endsWith("-tb")) { + html.children.push(createLine(node, [htmlFromFailing])); + } else { + html.children.push(htmlFromFailing); + } + } + } + if (html.children.length === 0) { + return null; + } + return html; } -function addHTML(e, t, i) { - const a = e[ar], - s = a.availableSpace, - [r, n, g, o] = i; - switch (e.layout) { - case "position": - a.width = Math.max(a.width, r + g); - a.height = Math.max(a.height, n + o); - a.children.push(t); +function addHTML(node, html, bbox) { + const extra = node[$extra]; + const availableSpace = extra.availableSpace; + const [x, y, w, h] = bbox; + switch (node.layout) { + case "position": { + extra.width = Math.max(extra.width, x + w); + extra.height = Math.max(extra.height, y + h); + extra.children.push(html); break; + } case "lr-tb": case "rl-tb": - if (!a.line || 1 === a.attempt) { - a.line = createLine(e, []); - a.children.push(a.line); - a.numberInLine = 0; + if (!extra.line || extra.attempt === 1) { + extra.line = createLine(node, []); + extra.children.push(extra.line); + extra.numberInLine = 0; } - a.numberInLine += 1; - a.line.children.push(t); - if (0 === a.attempt) { - a.currentWidth += g; - a.height = Math.max(a.height, a.prevHeight + o); + extra.numberInLine += 1; + extra.line.children.push(html); + if (extra.attempt === 0) { + extra.currentWidth += w; + extra.height = Math.max(extra.height, extra.prevHeight + h); } else { - a.currentWidth = g; - a.prevHeight = a.height; - a.height += o; - a.attempt = 0; + extra.currentWidth = w; + extra.prevHeight = extra.height; + extra.height += h; + extra.attempt = 0; } - a.width = Math.max(a.width, a.currentWidth); + extra.width = Math.max(extra.width, extra.currentWidth); break; case "rl-row": case "row": { - a.children.push(t); - a.width += g; - a.height = Math.max(a.height, o); - const e = measureToString(a.height); - for (const t of a.children) t.attributes.style.height = e; + extra.children.push(html); + extra.width += w; + extra.height = Math.max(extra.height, h); + const height = measureToString(extra.height); + for (const child of extra.children) { + child.attributes.style.height = height; + } + break; + } + case "table": { + extra.width = Math.min(availableSpace.width, Math.max(extra.width, w)); + extra.height += h; + extra.children.push(html); + break; + } + case "tb": { + extra.width = Math.min(availableSpace.width, Math.max(extra.width, w)); + extra.height += h; + extra.children.push(html); break; } - case "table": - case "tb": - a.width = Math.min(s.width, Math.max(a.width, g)); - a.height += o; - a.children.push(t); } } -function getAvailableSpace(e) { - const t = e[ar].availableSpace, - i = e.margin ? e.margin.topInset + e.margin.bottomInset : 0, - a = e.margin ? e.margin.leftInset + e.margin.rightInset : 0; - switch (e.layout) { +function getAvailableSpace(node) { + const availableSpace = node[$extra].availableSpace; + const marginV = node.margin + ? node.margin.topInset + node.margin.bottomInset + : 0; + const marginH = node.margin + ? node.margin.leftInset + node.margin.rightInset + : 0; + switch (node.layout) { case "lr-tb": case "rl-tb": - return 0 === e[ar].attempt - ? { - width: t.width - a - e[ar].currentWidth, - height: t.height - i - e[ar].prevHeight, - } - : { width: t.width - a, height: t.height - i - e[ar].height }; + if (node[$extra].attempt === 0) { + return { + width: availableSpace.width - marginH - node[$extra].currentWidth, + height: availableSpace.height - marginV - node[$extra].prevHeight, + }; + } + return { + width: availableSpace.width - marginH, + height: availableSpace.height - marginV - node[$extra].height, + }; case "rl-row": case "row": + const width = node[$extra].columnWidths + .slice(node[$extra].currentColumn) + .reduce((a, x) => a + x); return { - width: e[ar].columnWidths - .slice(e[ar].currentColumn) - .reduce((e, t) => e + t), - height: t.height - a, + width, + height: availableSpace.height - marginH, }; case "table": case "tb": - return { width: t.width - a, height: t.height - i - e[ar].height }; + return { + width: availableSpace.width - marginH, + height: availableSpace.height - marginV - node[$extra].height, + }; + case "position": default: - return t; + return availableSpace; } } -function checkDimensions(e, t) { - if (null === e[mr]()[ar].firstUnsplittable) return !0; - if (0 === e.w || 0 === e.h) return !0; - const i = e[fr](), - a = i[ar]?.attempt || 0, - [, s, r, n] = (function getTransformedBBox(e) { - let t, - i, - a = "" === e.w ? NaN : e.w, - s = "" === e.h ? NaN : e.h, - [r, n] = [0, 0]; - switch (e.anchorType || "") { - case "bottomCenter": - [r, n] = [a / 2, s]; - break; - case "bottomLeft": - [r, n] = [0, s]; - break; - case "bottomRight": - [r, n] = [a, s]; - break; - case "middleCenter": - [r, n] = [a / 2, s / 2]; - break; - case "middleLeft": - [r, n] = [0, s / 2]; - break; - case "middleRight": - [r, n] = [a, s / 2]; - break; - case "topCenter": - [r, n] = [a / 2, 0]; - break; - case "topRight": - [r, n] = [a, 0]; - } - switch (e.rotate || 0) { - case 0: - [t, i] = [-r, -n]; - break; - case 90: - [t, i] = [-n, r]; - [a, s] = [s, -a]; - break; - case 180: - [t, i] = [r, n]; - [a, s] = [-a, -s]; - break; - case 270: - [t, i] = [n, -r]; - [a, s] = [-s, a]; - } - return [ - e.x + t + Math.min(0, a), - e.y + i + Math.min(0, s), - Math.abs(a), - Math.abs(s), - ]; - })(e); - switch (i.layout) { +function getTransformedBBox(node) { + let w = node.w === "" ? NaN : node.w; + let h = node.h === "" ? NaN : node.h; + let [centerX, centerY] = [0, 0]; + switch (node.anchorType || "") { + case "bottomCenter": + [centerX, centerY] = [w / 2, h]; + break; + case "bottomLeft": + [centerX, centerY] = [0, h]; + break; + case "bottomRight": + [centerX, centerY] = [w, h]; + break; + case "middleCenter": + [centerX, centerY] = [w / 2, h / 2]; + break; + case "middleLeft": + [centerX, centerY] = [0, h / 2]; + break; + case "middleRight": + [centerX, centerY] = [w, h / 2]; + break; + case "topCenter": + [centerX, centerY] = [w / 2, 0]; + break; + case "topRight": + [centerX, centerY] = [w, 0]; + break; + } + let x, y; + switch (node.rotate || 0) { + case 0: + [x, y] = [-centerX, -centerY]; + break; + case 90: + [x, y] = [-centerY, centerX]; + [w, h] = [h, -w]; + break; + case 180: + [x, y] = [centerX, centerY]; + [w, h] = [-w, -h]; + break; + case 270: + [x, y] = [centerY, -centerX]; + [w, h] = [-h, w]; + break; + } + return [ + node.x + x + Math.min(0, w), + node.y + y + Math.min(0, h), + Math.abs(w), + Math.abs(h), + ]; +} +function checkDimensions(node, space) { + if (node[$getTemplateRoot]()[$extra].firstUnsplittable === null) { + return true; + } + if (node.w === 0 || node.h === 0) { + return true; + } + const ERROR = 2; + const parent = node[$getSubformParent](); + const attempt = parent[$extra]?.attempt || 0; + const [, y, w, h] = getTransformedBBox(node); + switch (parent.layout) { case "lr-tb": case "rl-tb": - return 0 === a - ? e[mr]()[ar].noLayoutFailure - ? "" !== e.w - ? Math.round(r - t.width) <= 2 - : t.width > 2 - : !("" !== e.h && Math.round(n - t.height) > 2) && - ("" !== e.w - ? Math.round(r - t.width) <= 2 || - (0 === i[ar].numberInLine && t.height > 2) - : t.width > 2) - : !!e[mr]()[ar].noLayoutFailure || - (!("" !== e.h && Math.round(n - t.height) > 2) && - ("" === e.w || Math.round(r - t.width) <= 2 || !i[Ur]()) && - t.height > 2); + if (attempt === 0) { + if (!node[$getTemplateRoot]()[$extra].noLayoutFailure) { + if (node.h !== "" && Math.round(h - space.height) > ERROR) { + return false; + } + if (node.w !== "") { + if (Math.round(w - space.width) <= ERROR) { + return true; + } + if (parent[$extra].numberInLine === 0) { + return space.height > ERROR; + } + return false; + } + return space.width > ERROR; + } + if (node.w !== "") { + return Math.round(w - space.width) <= ERROR; + } + return space.width > ERROR; + } + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; + } + if (node.h !== "" && Math.round(h - space.height) > ERROR) { + return false; + } + if (node.w === "" || Math.round(w - space.width) <= ERROR) { + return space.height > ERROR; + } + if (parent[$isThereMoreWidth]()) { + return false; + } + return space.height > ERROR; case "table": case "tb": - return ( - !!e[mr]()[ar].noLayoutFailure || - ("" === e.h || e[xr]() - ? ("" === e.w || Math.round(r - t.width) <= 2 || !i[Ur]()) && - t.height > 2 - : Math.round(n - t.height) <= 2) - ); + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; + } + if (node.h !== "" && !node[$isSplittable]()) { + return Math.round(h - space.height) <= ERROR; + } + if (node.w === "" || Math.round(w - space.width) <= ERROR) { + return space.height > ERROR; + } + if (parent[$isThereMoreWidth]()) { + return false; + } + return space.height > ERROR; case "position": - if (e[mr]()[ar].noLayoutFailure) return !0; - if ("" === e.h || Math.round(n + s - t.height) <= 2) return !0; - return n + s > e[mr]()[ar].currentContentArea.h; + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; + } + if (node.h === "" || Math.round(h + y - space.height) <= ERROR) { + return true; + } + const area = node[$getTemplateRoot]()[$extra].currentContentArea; + return h + y > area.h; case "rl-row": case "row": - return ( - !!e[mr]()[ar].noLayoutFailure || - "" === e.h || - Math.round(n - t.height) <= 2 - ); - default: - return !0; - } -} -const Hn = on.template.id, - Jn = "http://www.w3.org/2000/svg", - Yn = /^H(\d+)$/, - vn = new Set([ - "image/gif", - "image/jpeg", - "image/jpg", - "image/pjpeg", - "image/png", - "image/apng", - "image/x-png", - "image/bmp", - "image/x-ms-bmp", - "image/tiff", - "image/tif", - "application/octet-stream", - ]), - Kn = [ - [[66, 77], "image/bmp"], - [[255, 216, 255], "image/jpeg"], - [[73, 73, 42, 0], "image/tiff"], - [[77, 77, 0, 42], "image/tiff"], - [[71, 73, 70, 56, 57, 97], "image/gif"], - [[137, 80, 78, 71, 13, 10, 26, 10], "image/png"], - ]; -function getBorderDims(e) { - if (!e || !e.border) return { w: 0, h: 0 }; - const t = e.border[lr](); - return t - ? { - w: t.widths[0] + t.widths[2] + t.insets[0] + t.insets[2], - h: t.widths[1] + t.widths[3] + t.insets[1] + t.insets[3], + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; } - : { w: 0, h: 0 }; + if (node.h !== "") { + return Math.round(h - space.height) <= ERROR; + } + return true; + default: + return true; + } +} // ./src/core/xfa/template.js + +const TEMPLATE_NS_ID = NamespaceIds.template.id; +const SVG_NS = "http://www.w3.org/2000/svg"; +const MAX_ATTEMPTS_FOR_LRTB_LAYOUT = 2; +const MAX_EMPTY_PAGES = 3; +const DEFAULT_TAB_INDEX = 5000; +const HEADING_PATTERN = /^H(\d+)$/; +const MIMES = new Set([ + "image/gif", + "image/jpeg", + "image/jpg", + "image/pjpeg", + "image/png", + "image/apng", + "image/x-png", + "image/bmp", + "image/x-ms-bmp", + "image/tiff", + "image/tif", + "application/octet-stream", +]); +const IMAGES_HEADERS = [ + [[0x42, 0x4d], "image/bmp"], + [[0xff, 0xd8, 0xff], "image/jpeg"], + [[0x49, 0x49, 0x2a, 0x00], "image/tiff"], + [[0x4d, 0x4d, 0x00, 0x2a], "image/tiff"], + [[0x47, 0x49, 0x46, 0x38, 0x39, 0x61], "image/gif"], + [[0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a], "image/png"], +]; +function getBorderDims(node) { + if (!node || !node.border) { + return { + w: 0, + h: 0, + }; + } + const borderExtra = node.border[$getExtra](); + if (!borderExtra) { + return { + w: 0, + h: 0, + }; + } + return { + w: + borderExtra.widths[0] + + borderExtra.widths[2] + + borderExtra.insets[0] + + borderExtra.insets[2], + h: + borderExtra.widths[1] + + borderExtra.widths[3] + + borderExtra.insets[1] + + borderExtra.insets[3], + }; } -function hasMargin(e) { +function hasMargin(node) { return ( - e.margin && - (e.margin.topInset || - e.margin.rightInset || - e.margin.bottomInset || - e.margin.leftInset) + node.margin && + (node.margin.topInset || + node.margin.rightInset || + node.margin.bottomInset || + node.margin.leftInset) ); } -function _setValue(e, t) { - if (!e.value) { - const t = new Value({}); - e[Xs](t); - e.value = t; +function _setValue(templateNode, value) { + if (!templateNode.value) { + const nodeValue = new Value({}); + templateNode[$appendChild](nodeValue); + templateNode.value = nodeValue; } - e.value[$r](t); + templateNode.value[$setValue](value); } -function* getContainedChildren(e) { - for (const t of e[Er]()) t instanceof SubformSet ? yield* t[ur]() : yield t; +function* getContainedChildren(node) { + for (const child of node[$getChildren]()) { + if (child instanceof SubformSet) { + yield* child[$getContainedChildren](); + continue; + } + yield child; + } } -function isRequired(e) { - return "error" === e.validate?.nullTest; +function isRequired(node) { + return node.validate?.nullTest === "error"; } -function setTabIndex(e) { - for (; e; ) { - if (!e.traversal) { - e[An] = e[pr]()[An]; +function setTabIndex(node) { + while (node) { + if (!node.traversal) { + node[$tabIndex] = node[$getParent]()[$tabIndex]; return; } - if (e[An]) return; - let t = null; - for (const i of e.traversal[Er]()) - if ("next" === i.operation) { - t = i; + if (node[$tabIndex]) { + return; + } + let next = null; + for (const child of node.traversal[$getChildren]()) { + if (child.operation === "next") { + next = child; break; } - if (!t || !t.ref) { - e[An] = e[pr]()[An]; + } + if (!next || !next.ref) { + node[$tabIndex] = node[$getParent]()[$tabIndex]; return; } - const i = e[mr](); - e[An] = ++i[An]; - const a = i[Vr](t.ref, e); - if (!a) return; - e = a[0]; + const root = node[$getTemplateRoot](); + node[$tabIndex] = ++root[$tabIndex]; + const ref = root[$searchNode](next.ref, node); + if (!ref) { + return; + } + node = ref[0]; } } -function applyAssist(e, t) { - const i = e.assist; - if (i) { - const e = i[an](); - e && (t.title = e); - const a = i.role.match(Yn); - if (a) { - const e = "heading", - i = a[1]; - t.role = e; - t["aria-level"] = i; +function applyAssist(obj, attributes) { + const assist = obj.assist; + if (assist) { + const assistTitle = assist[$toHTML](); + if (assistTitle) { + attributes.title = assistTitle; + } + const role = assist.role; + const match = role.match(HEADING_PATTERN); + if (match) { + const ariaRole = "heading"; + const ariaLevel = match[1]; + attributes.role = ariaRole; + attributes["aria-level"] = ariaLevel; } } - if ("table" === e.layout) t.role = "table"; - else if ("row" === e.layout) t.role = "row"; - else { - const i = e[pr](); - "row" === i.layout && - (t.role = "TH" === i.assist?.role ? "columnheader" : "cell"); + if (obj.layout === "table") { + attributes.role = "table"; + } else if (obj.layout === "row") { + attributes.role = "row"; + } else { + const parent = obj[$getParent](); + if (parent.layout === "row") { + attributes.role = parent.assist?.role === "TH" ? "columnheader" : "cell"; + } } } -function ariaLabel(e) { - if (!e.assist) return null; - const t = e.assist; - return t.speak && "" !== t.speak[er] - ? t.speak[er] - : t.toolTip - ? t.toolTip[er] - : null; +function ariaLabel(obj) { + if (!obj.assist) { + return null; + } + const assist = obj.assist; + if (assist.speak && assist.speak[$content] !== "") { + return assist.speak[$content]; + } + if (assist.toolTip) { + return assist.toolTip[$content]; + } + return null; } -function valueToHtml(e) { +function valueToHtml(value) { return HTMLResult.success({ name: "div", - attributes: { class: ["xfaRich"], style: Object.create(null) }, + attributes: { + class: ["xfaRich"], + style: Object.create(null), + }, children: [ - { name: "span", attributes: { style: Object.create(null) }, value: e }, + { + name: "span", + attributes: { + style: Object.create(null), + }, + value, + }, ], }); } -function setFirstUnsplittable(e) { - const t = e[mr](); - if (null === t[ar].firstUnsplittable) { - t[ar].firstUnsplittable = e; - t[ar].noLayoutFailure = !0; +function setFirstUnsplittable(node) { + const root = node[$getTemplateRoot](); + if (root[$extra].firstUnsplittable === null) { + root[$extra].firstUnsplittable = node; + root[$extra].noLayoutFailure = true; } } -function unsetFirstUnsplittable(e) { - const t = e[mr](); - t[ar].firstUnsplittable === e && (t[ar].noLayoutFailure = !1); -} -function handleBreak(e) { - if (e[ar]) return !1; - e[ar] = Object.create(null); - if ("auto" === e.targetType) return !1; - const t = e[mr](); - let i = null; - if (e.target) { - i = t[Vr](e.target, e[pr]()); - if (!i) return !1; - i = i[0]; +function unsetFirstUnsplittable(node) { + const root = node[$getTemplateRoot](); + if (root[$extra].firstUnsplittable === node) { + root[$extra].noLayoutFailure = false; } - const { currentPageArea: a, currentContentArea: s } = t[ar]; - if ("pageArea" === e.targetType) { - i instanceof PageArea || (i = null); - if (e.startNew) { - e[ar].target = i || a; - return !0; +} +function handleBreak(node) { + if (node[$extra]) { + return false; + } + node[$extra] = Object.create(null); + if (node.targetType === "auto") { + return false; + } + const root = node[$getTemplateRoot](); + let target = null; + if (node.target) { + target = root[$searchNode](node.target, node[$getParent]()); + if (!target) { + return false; } - if (i && i !== a) { - e[ar].target = i; - return !0; + target = target[0]; + } + const { currentPageArea, currentContentArea } = root[$extra]; + if (node.targetType === "pageArea") { + if (!(target instanceof PageArea)) { + target = null; } - return !1; + if (node.startNew) { + node[$extra].target = target || currentPageArea; + return true; + } else if (target && target !== currentPageArea) { + node[$extra].target = target; + return true; + } + return false; } - i instanceof ContentArea || (i = null); - const r = i && i[pr](); - let n, - g = r; - if (e.startNew) - if (i) { - const e = r.contentArea.children, - t = e.indexOf(s), - a = e.indexOf(i); - -1 !== t && t < a && (g = null); - n = a - 1; - } else n = a.contentArea.children.indexOf(s); - else { - if (!i || i === s) return !1; - n = r.contentArea.children.indexOf(i) - 1; - g = r === a ? null : r; + if (!(target instanceof ContentArea)) { + target = null; } - e[ar].target = g; - e[ar].index = n; - return !0; + const pageArea = target && target[$getParent](); + let index; + let nextPageArea = pageArea; + if (node.startNew) { + if (target) { + const contentAreas = pageArea.contentArea.children; + const indexForCurrent = contentAreas.indexOf(currentContentArea); + const indexForTarget = contentAreas.indexOf(target); + if (indexForCurrent !== -1 && indexForCurrent < indexForTarget) { + nextPageArea = null; + } + index = indexForTarget - 1; + } else { + index = currentPageArea.contentArea.children.indexOf(currentContentArea); + } + } else if (target && target !== currentContentArea) { + const contentAreas = pageArea.contentArea.children; + index = contentAreas.indexOf(target) - 1; + nextPageArea = pageArea === currentPageArea ? null : pageArea; + } else { + return false; + } + node[$extra].target = nextPageArea; + node[$extra].index = index; + return true; } -function handleOverflow(e, t, i) { - const a = e[mr](), - s = a[ar].noLayoutFailure, - r = t[fr]; - t[fr] = () => e; - a[ar].noLayoutFailure = !0; - const n = t[an](i); - e[js](n.html, n.bbox); - a[ar].noLayoutFailure = s; - t[fr] = r; +function handleOverflow(node, extraNode, space) { + const root = node[$getTemplateRoot](); + const saved = root[$extra].noLayoutFailure; + const savedMethod = extraNode[$getSubformParent]; + extraNode[$getSubformParent] = () => node; + root[$extra].noLayoutFailure = true; + const res = extraNode[$toHTML](space); + node[$addHTML](res.html, res.bbox); + root[$extra].noLayoutFailure = saved; + extraNode[$getSubformParent] = savedMethod; } class AppearanceFilter extends StringObject { - constructor(e) { - super(Hn, "appearanceFilter"); - this.id = e.id || ""; - this.type = getStringOption(e.type, ["optional", "required"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "appearanceFilter"); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Arc extends XFAObject { - constructor(e) { - super(Hn, "arc", !0); + constructor(attributes) { + super(TEMPLATE_NS_ID, "arc", true); this.circular = getInteger({ - data: e.circular, + data: attributes.circular, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); - this.hand = getStringOption(e.hand, ["even", "left", "right"]); - this.id = e.id || ""; + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; this.startAngle = getFloat({ - data: e.startAngle, + data: attributes.startAngle, defaultValue: 0, - validate: (e) => !0, + validate: (x) => true, }); this.sweepAngle = getFloat({ - data: e.sweepAngle, + data: attributes.sweepAngle, defaultValue: 360, - validate: (e) => !0, + validate: (x) => true, }); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.edge = null; this.fill = null; } - [an]() { - const e = this.edge || new Edge({}), - t = e[rn](), - i = Object.create(null); - "visible" === this.fill?.presence - ? Object.assign(i, this.fill[rn]()) - : (i.fill = "transparent"); - i.strokeWidth = measureToString("visible" === e.presence ? e.thickness : 0); - i.stroke = t.color; - let a; - const s = { - xmlns: Jn, - style: { width: "100%", height: "100%", overflow: "visible" }, + [$toHTML]() { + const edge = this.edge || new Edge({}); + const edgeStyle = edge[$toStyle](); + const style = Object.create(null); + if (this.fill?.presence === "visible") { + Object.assign(style, this.fill[$toStyle]()); + } else { + style.fill = "transparent"; + } + style.strokeWidth = measureToString( + edge.presence === "visible" ? edge.thickness : 0, + ); + style.stroke = edgeStyle.color; + let arc; + const attributes = { + xmlns: SVG_NS, + style: { + width: "100%", + height: "100%", + overflow: "visible", + }, }; - if (360 === this.sweepAngle) - a = { + if (this.sweepAngle === 360) { + arc = { name: "ellipse", attributes: { - xmlns: Jn, + xmlns: SVG_NS, cx: "50%", cy: "50%", rx: "50%", ry: "50%", - style: i, + style, }, }; - else { - const e = (this.startAngle * Math.PI) / 180, - t = (this.sweepAngle * Math.PI) / 180, - r = this.sweepAngle > 180 ? 1 : 0, - [n, g, o, c] = [ - 50 * (1 + Math.cos(e)), - 50 * (1 - Math.sin(e)), - 50 * (1 + Math.cos(e + t)), - 50 * (1 - Math.sin(e + t)), - ]; - a = { + } else { + const startAngle = (this.startAngle * Math.PI) / 180; + const sweepAngle = (this.sweepAngle * Math.PI) / 180; + const largeArc = this.sweepAngle > 180 ? 1 : 0; + const [x1, y1, x2, y2] = [ + 50 * (1 + Math.cos(startAngle)), + 50 * (1 - Math.sin(startAngle)), + 50 * (1 + Math.cos(startAngle + sweepAngle)), + 50 * (1 - Math.sin(startAngle + sweepAngle)), + ]; + arc = { name: "path", attributes: { - xmlns: Jn, - d: `M ${n} ${g} A 50 50 0 ${r} 0 ${o} ${c}`, + xmlns: SVG_NS, + d: `M ${x1} ${y1} A 50 50 0 ${largeArc} 0 ${x2} ${y2}`, vectorEffect: "non-scaling-stroke", - style: i, + style, }, }; - Object.assign(s, { viewBox: "0 0 100 100", preserveAspectRatio: "none" }); + Object.assign(attributes, { + viewBox: "0 0 100 100", + preserveAspectRatio: "none", + }); } - const r = { name: "svg", children: [a], attributes: s }; - if (hasMargin(this[pr]()[pr]())) + const svg = { + name: "svg", + children: [arc], + attributes, + }; + const parent = this[$getParent]()[$getParent](); + if (hasMargin(parent)) { return HTMLResult.success({ name: "div", attributes: { - style: { display: "inline", width: "100%", height: "100%" }, + style: { + display: "inline", + width: "100%", + height: "100%", + }, }, - children: [r], + children: [svg], }); - r.attributes.style.position = "absolute"; - return HTMLResult.success(r); + } + svg.attributes.style.position = "absolute"; + return HTMLResult.success(svg); } } class Area extends XFAObject { - constructor(e) { - super(Hn, "area", !0); + constructor(attributes) { + super(TEMPLATE_NS_ID, "area", true); this.colSpan = getInteger({ - data: e.colSpan, + data: attributes.colSpan, defaultValue: 1, - validate: (e) => e >= 1 || -1 === e, + validate: (n) => n >= 1 || n === -1, }); - this.id = e.id || ""; - this.name = e.name || ""; - this.relevant = getRelevant(e.relevant); - this.use = e.use || ""; - this.usehref = e.usehref || ""; - this.x = getMeasurement(e.x, "0pt"); - this.y = getMeasurement(e.y, "0pt"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); this.desc = null; this.extras = null; this.area = new XFAObjectArray(); @@ -43411,32 +52776,45 @@ class Area extends XFAObject { this.subform = new XFAObjectArray(); this.subformSet = new XFAObjectArray(); } - *[ur]() { + *[$getContainedChildren]() { yield* getContainedChildren(this); } - [Mr]() { - return !0; + [$isTransparent]() { + return true; } - [kr]() { - return !0; + [$isBindable]() { + return true; } - [js](e, t) { - const [i, a, s, r] = t; - this[ar].width = Math.max(this[ar].width, i + s); - this[ar].height = Math.max(this[ar].height, a + r); - this[ar].children.push(e); + [$addHTML](html, bbox) { + const [x, y, w, h] = bbox; + this[$extra].width = Math.max(this[$extra].width, x + w); + this[$extra].height = Math.max(this[$extra].height, y + h); + this[$extra].children.push(html); } - [or]() { - return this[ar].availableSpace; + [$getAvailableSpace]() { + return this[$extra].availableSpace; } - [an](e) { - const t = toStyle(this, "position"), - i = { style: t, id: this[nn], class: ["xfaArea"] }; - isPrintOnly(this) && i.class.push("xfaPrintOnly"); - this.name && (i.xfaName = this.name); - const a = []; - this[ar] = { children: a, width: 0, height: 0, availableSpace: e }; - const s = this[Zs]({ + [$toHTML](availableSpace) { + const style = toStyle(this, "position"); + const attributes = { + style, + id: this[$uid], + class: ["xfaArea"], + }; + if (isPrintOnly(this)) { + attributes.class.push("xfaPrintOnly"); + } + if (this.name) { + attributes.xfaName = this.name; + } + const children = []; + this[$extra] = { + children, + width: 0, + height: 0, + availableSpace, + }; + const result = this[$childrenToHTML]({ filter: new Set([ "area", "draw", @@ -43445,42 +52823,50 @@ class Area extends XFAObject { "subform", "subformSet", ]), - include: !0, + include: true, }); - if (!s.success) { - if (s.isBreak()) return s; - delete this[ar]; + if (!result.success) { + if (result.isBreak()) { + return result; + } + delete this[$extra]; return HTMLResult.FAILURE; } - t.width = measureToString(this[ar].width); - t.height = measureToString(this[ar].height); - const r = { name: "div", attributes: i, children: a }, - n = [this.x, this.y, this[ar].width, this[ar].height]; - delete this[ar]; - return HTMLResult.success(r, n); + style.width = measureToString(this[$extra].width); + style.height = measureToString(this[$extra].height); + const html = { + name: "div", + attributes, + children, + }; + const bbox = [this.x, this.y, this[$extra].width, this[$extra].height]; + delete this[$extra]; + return HTMLResult.success(html, bbox); } } class Assist extends XFAObject { - constructor(e) { - super(Hn, "assist", !0); - this.id = e.id || ""; - this.role = e.role || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "assist", true); + this.id = attributes.id || ""; + this.role = attributes.role || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.speak = null; this.toolTip = null; } - [an]() { - return this.toolTip?.[er] || null; + [$toHTML]() { + return this.toolTip?.[$content] || null; } } class Barcode extends XFAObject { - constructor(e) { - super(Hn, "barcode", !0); + constructor(attributes) { + super(TEMPLATE_NS_ID, "barcode", true); this.charEncoding = getKeyword({ - data: e.charEncoding ? e.charEncoding.toLowerCase() : "", + data: attributes.charEncoding + ? attributes.charEncoding.toLowerCase() + : "", defaultValue: "", - validate: (e) => + validate: (k) => [ "utf-8", "big-five", @@ -43493,9 +52879,9 @@ class Barcode extends XFAObject { "shift-jis", "ucs-2", "utf-16", - ].includes(e) || e.match(/iso-8859-\d{2}/), + ].includes(k) || k.match(/iso-8859-\d{2}/), }); - this.checksum = getStringOption(e.checksum, [ + this.checksum = getStringOption(attributes.checksum, [ "none", "1mod10", "1mod10_1mod11", @@ -43503,38 +52889,41 @@ class Barcode extends XFAObject { "auto", ]); this.dataColumnCount = getInteger({ - data: e.dataColumnCount, + data: attributes.dataColumnCount, defaultValue: -1, - validate: (e) => e >= 0, + validate: (x) => x >= 0, }); this.dataLength = getInteger({ - data: e.dataLength, + data: attributes.dataLength, defaultValue: -1, - validate: (e) => e >= 0, + validate: (x) => x >= 0, }); - this.dataPrep = getStringOption(e.dataPrep, ["none", "flateCompress"]); + this.dataPrep = getStringOption(attributes.dataPrep, [ + "none", + "flateCompress", + ]); this.dataRowCount = getInteger({ - data: e.dataRowCount, + data: attributes.dataRowCount, defaultValue: -1, - validate: (e) => e >= 0, + validate: (x) => x >= 0, }); - this.endChar = e.endChar || ""; + this.endChar = attributes.endChar || ""; this.errorCorrectionLevel = getInteger({ - data: e.errorCorrectionLevel, + data: attributes.errorCorrectionLevel, defaultValue: -1, - validate: (e) => e >= 0 && e <= 8, + validate: (x) => x >= 0 && x <= 8, }); - this.id = e.id || ""; - this.moduleHeight = getMeasurement(e.moduleHeight, "5mm"); - this.moduleWidth = getMeasurement(e.moduleWidth, "0.25mm"); + this.id = attributes.id || ""; + this.moduleHeight = getMeasurement(attributes.moduleHeight, "5mm"); + this.moduleWidth = getMeasurement(attributes.moduleWidth, "0.25mm"); this.printCheckDigit = getInteger({ - data: e.printCheckDigit, + data: attributes.printCheckDigit, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); - this.rowColumnRatio = getRatio(e.rowColumnRatio); - this.startChar = e.startChar || ""; - this.textLocation = getStringOption(e.textLocation, [ + this.rowColumnRatio = getRatio(attributes.rowColumnRatio); + this.startChar = attributes.startChar || ""; + this.textLocation = getStringOption(attributes.textLocation, [ "below", "above", "aboveEmbedded", @@ -43542,458 +52931,507 @@ class Barcode extends XFAObject { "none", ]); this.truncate = getInteger({ - data: e.truncate, + data: attributes.truncate, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); - this.type = getStringOption(e.type ? e.type.toLowerCase() : "", [ - "aztec", - "codabar", - "code2of5industrial", - "code2of5interleaved", - "code2of5matrix", - "code2of5standard", - "code3of9", - "code3of9extended", - "code11", - "code49", - "code93", - "code128", - "code128a", - "code128b", - "code128c", - "code128sscc", - "datamatrix", - "ean8", - "ean8add2", - "ean8add5", - "ean13", - "ean13add2", - "ean13add5", - "ean13pwcd", - "fim", - "logmars", - "maxicode", - "msi", - "pdf417", - "pdf417macro", - "plessey", - "postauscust2", - "postauscust3", - "postausreplypaid", - "postausstandard", - "postukrm4scc", - "postusdpbc", - "postusimb", - "postusstandard", - "postus5zip", - "qrcode", - "rfid", - "rss14", - "rss14expanded", - "rss14limited", - "rss14stacked", - "rss14stackedomni", - "rss14truncated", - "telepen", - "ucc128", - "ucc128random", - "ucc128sscc", - "upca", - "upcaadd2", - "upcaadd5", - "upcapwcd", - "upce", - "upceadd2", - "upceadd5", - "upcean2", - "upcean5", - "upsmaxicode", - ]); - this.upsMode = getStringOption(e.upsMode, [ + this.type = getStringOption( + attributes.type ? attributes.type.toLowerCase() : "", + [ + "aztec", + "codabar", + "code2of5industrial", + "code2of5interleaved", + "code2of5matrix", + "code2of5standard", + "code3of9", + "code3of9extended", + "code11", + "code49", + "code93", + "code128", + "code128a", + "code128b", + "code128c", + "code128sscc", + "datamatrix", + "ean8", + "ean8add2", + "ean8add5", + "ean13", + "ean13add2", + "ean13add5", + "ean13pwcd", + "fim", + "logmars", + "maxicode", + "msi", + "pdf417", + "pdf417macro", + "plessey", + "postauscust2", + "postauscust3", + "postausreplypaid", + "postausstandard", + "postukrm4scc", + "postusdpbc", + "postusimb", + "postusstandard", + "postus5zip", + "qrcode", + "rfid", + "rss14", + "rss14expanded", + "rss14limited", + "rss14stacked", + "rss14stackedomni", + "rss14truncated", + "telepen", + "ucc128", + "ucc128random", + "ucc128sscc", + "upca", + "upcaadd2", + "upcaadd5", + "upcapwcd", + "upce", + "upceadd2", + "upceadd5", + "upcean2", + "upcean5", + "upsmaxicode", + ], + ); + this.upsMode = getStringOption(attributes.upsMode, [ "usCarrier", "internationalCarrier", "secureSymbol", "standardSymbol", ]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; - this.wideNarrowRatio = getRatio(e.wideNarrowRatio); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.wideNarrowRatio = getRatio(attributes.wideNarrowRatio); this.encrypt = null; this.extras = null; } } class Bind extends XFAObject { - constructor(e) { - super(Hn, "bind", !0); - this.match = getStringOption(e.match, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "bind", true); + this.match = getStringOption(attributes.match, [ "once", "dataRef", "global", "none", ]); - this.ref = e.ref || ""; + this.ref = attributes.ref || ""; this.picture = null; } } class BindItems extends XFAObject { - constructor(e) { - super(Hn, "bindItems"); - this.connection = e.connection || ""; - this.labelRef = e.labelRef || ""; - this.ref = e.ref || ""; - this.valueRef = e.valueRef || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "bindItems"); + this.connection = attributes.connection || ""; + this.labelRef = attributes.labelRef || ""; + this.ref = attributes.ref || ""; + this.valueRef = attributes.valueRef || ""; } } class Bookend extends XFAObject { - constructor(e) { - super(Hn, "bookend"); - this.id = e.id || ""; - this.leader = e.leader || ""; - this.trailer = e.trailer || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "bookend"); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class BooleanElement extends Option01 { - constructor(e) { - super(Hn, "boolean"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "boolean"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } - [an](e) { - return valueToHtml(1 === this[er] ? "1" : "0"); + [$toHTML](availableSpace) { + return valueToHtml(this[$content] === 1 ? "1" : "0"); } } class Border extends XFAObject { - constructor(e) { - super(Hn, "border", !0); - this.break = getStringOption(e.break, ["close", "open"]); - this.hand = getStringOption(e.hand, ["even", "left", "right"]); - this.id = e.id || ""; - this.presence = getStringOption(e.presence, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "border", true); + this.break = getStringOption(attributes.break, ["close", "open"]); + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; + this.presence = getStringOption(attributes.presence, [ "visible", "hidden", "inactive", "invisible", ]); - this.relevant = getRelevant(e.relevant); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.corner = new XFAObjectArray(4); this.edge = new XFAObjectArray(4); this.extras = null; this.fill = null; this.margin = null; } - [lr]() { - if (!this[ar]) { - const e = this.edge.children.slice(); - if (e.length < 4) { - const t = e.at(-1) || new Edge({}); - for (let i = e.length; i < 4; i++) e.push(t); + [$getExtra]() { + if (!this[$extra]) { + const edges = this.edge.children.slice(); + if (edges.length < 4) { + const defaultEdge = edges.at(-1) || new Edge({}); + for (let i = edges.length; i < 4; i++) { + edges.push(defaultEdge); + } } - const t = e.map((e) => e.thickness), - i = [0, 0, 0, 0]; + const widths = edges.map((edge) => edge.thickness); + const insets = [0, 0, 0, 0]; if (this.margin) { - i[0] = this.margin.topInset; - i[1] = this.margin.rightInset; - i[2] = this.margin.bottomInset; - i[3] = this.margin.leftInset; + insets[0] = this.margin.topInset; + insets[1] = this.margin.rightInset; + insets[2] = this.margin.bottomInset; + insets[3] = this.margin.leftInset; } - this[ar] = { widths: t, insets: i, edges: e }; + this[$extra] = { + widths, + insets, + edges, + }; } - return this[ar]; + return this[$extra]; } - [rn]() { - const { edges: e } = this[lr](), - t = e.map((e) => { - const t = e[rn](); - t.color ||= "#000000"; - return t; - }), - i = Object.create(null); - this.margin && Object.assign(i, this.margin[rn]()); - "visible" === this.fill?.presence && Object.assign(i, this.fill[rn]()); - if (this.corner.children.some((e) => 0 !== e.radius)) { - const e = this.corner.children.map((e) => e[rn]()); - if (2 === e.length || 3 === e.length) { - const t = e.at(-1); - for (let i = e.length; i < 4; i++) e.push(t); + [$toStyle]() { + const { edges } = this[$getExtra](); + const edgeStyles = edges.map((node) => { + const style = node[$toStyle](); + style.color ||= "#000000"; + return style; + }); + const style = Object.create(null); + if (this.margin) { + Object.assign(style, this.margin[$toStyle]()); + } + if (this.fill?.presence === "visible") { + Object.assign(style, this.fill[$toStyle]()); + } + if (this.corner.children.some((node) => node.radius !== 0)) { + const cornerStyles = this.corner.children.map((node) => node[$toStyle]()); + if (cornerStyles.length === 2 || cornerStyles.length === 3) { + const last = cornerStyles.at(-1); + for (let i = cornerStyles.length; i < 4; i++) { + cornerStyles.push(last); + } } - i.borderRadius = e.map((e) => e.radius).join(" "); + style.borderRadius = cornerStyles.map((s) => s.radius).join(" "); } switch (this.presence) { case "invisible": case "hidden": - i.borderStyle = ""; + style.borderStyle = ""; break; case "inactive": - i.borderStyle = "none"; + style.borderStyle = "none"; break; default: - i.borderStyle = t.map((e) => e.style).join(" "); + style.borderStyle = edgeStyles.map((s) => s.style).join(" "); + break; } - i.borderWidth = t.map((e) => e.width).join(" "); - i.borderColor = t.map((e) => e.color).join(" "); - return i; + style.borderWidth = edgeStyles.map((s) => s.width).join(" "); + style.borderColor = edgeStyles.map((s) => s.color).join(" "); + return style; } } class Break extends XFAObject { - constructor(e) { - super(Hn, "break", !0); - this.after = getStringOption(e.after, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "break", true); + this.after = getStringOption(attributes.after, [ "auto", "contentArea", "pageArea", "pageEven", "pageOdd", ]); - this.afterTarget = e.afterTarget || ""; - this.before = getStringOption(e.before, [ + this.afterTarget = attributes.afterTarget || ""; + this.before = getStringOption(attributes.before, [ "auto", "contentArea", "pageArea", "pageEven", "pageOdd", ]); - this.beforeTarget = e.beforeTarget || ""; - this.bookendLeader = e.bookendLeader || ""; - this.bookendTrailer = e.bookendTrailer || ""; - this.id = e.id || ""; - this.overflowLeader = e.overflowLeader || ""; - this.overflowTarget = e.overflowTarget || ""; - this.overflowTrailer = e.overflowTrailer || ""; + this.beforeTarget = attributes.beforeTarget || ""; + this.bookendLeader = attributes.bookendLeader || ""; + this.bookendTrailer = attributes.bookendTrailer || ""; + this.id = attributes.id || ""; + this.overflowLeader = attributes.overflowLeader || ""; + this.overflowTarget = attributes.overflowTarget || ""; + this.overflowTrailer = attributes.overflowTrailer || ""; this.startNew = getInteger({ - data: e.startNew, + data: attributes.startNew, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; } } class BreakAfter extends XFAObject { - constructor(e) { - super(Hn, "breakAfter", !0); - this.id = e.id || ""; - this.leader = e.leader || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "breakAfter", true); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; this.startNew = getInteger({ - data: e.startNew, + data: attributes.startNew, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); - this.target = e.target || ""; - this.targetType = getStringOption(e.targetType, [ + this.target = attributes.target || ""; + this.targetType = getStringOption(attributes.targetType, [ "auto", "contentArea", "pageArea", ]); - this.trailer = e.trailer || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.script = null; } } class BreakBefore extends XFAObject { - constructor(e) { - super(Hn, "breakBefore", !0); - this.id = e.id || ""; - this.leader = e.leader || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "breakBefore", true); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; this.startNew = getInteger({ - data: e.startNew, + data: attributes.startNew, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); - this.target = e.target || ""; - this.targetType = getStringOption(e.targetType, [ + this.target = attributes.target || ""; + this.targetType = getStringOption(attributes.targetType, [ "auto", "contentArea", "pageArea", ]); - this.trailer = e.trailer || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.script = null; } - [an](e) { - this[ar] = {}; + [$toHTML](availableSpace) { + this[$extra] = {}; return HTMLResult.FAILURE; } } class Button extends XFAObject { - constructor(e) { - super(Hn, "button", !0); - this.highlight = getStringOption(e.highlight, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "button", true); + this.highlight = getStringOption(attributes.highlight, [ "inverted", "none", "outline", "push", ]); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; } - [an](e) { - const t = this[pr]()[pr](), - i = { - name: "button", - attributes: { id: this[nn], class: ["xfaButton"], style: {} }, + [$toHTML](availableSpace) { + const parent = this[$getParent](); + const grandpa = parent[$getParent](); + const htmlButton = { + name: "button", + attributes: { + id: this[$uid], + class: ["xfaButton"], + style: {}, + }, + children: [], + }; + for (const event of grandpa.event.children) { + if (event.activity !== "click" || !event.script) { + continue; + } + const jsURL = recoverJsURL(event.script[$content]); + if (!jsURL) { + continue; + } + const href = fixURL(jsURL.url); + if (!href) { + continue; + } + htmlButton.children.push({ + name: "a", + attributes: { + id: "link" + this[$uid], + href, + newWindow: jsURL.newWindow, + class: ["xfaLink"], + style: {}, + }, children: [], - }; - for (const e of t.event.children) { - if ("click" !== e.activity || !e.script) continue; - const t = recoverJsURL(e.script[er]); - if (!t) continue; - const a = fixURL(t.url); - a && - i.children.push({ - name: "a", - attributes: { - id: "link" + this[nn], - href: a, - newWindow: t.newWindow, - class: ["xfaLink"], - style: {}, - }, - children: [], - }); + }); } - return HTMLResult.success(i); + return HTMLResult.success(htmlButton); } } class Calculate extends XFAObject { - constructor(e) { - super(Hn, "calculate", !0); - this.id = e.id || ""; - this.override = getStringOption(e.override, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "calculate", true); + this.id = attributes.id || ""; + this.override = getStringOption(attributes.override, [ "disabled", "error", "ignore", "warning", ]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; this.message = null; this.script = null; } } class Caption extends XFAObject { - constructor(e) { - super(Hn, "caption", !0); - this.id = e.id || ""; - this.placement = getStringOption(e.placement, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "caption", true); + this.id = attributes.id || ""; + this.placement = getStringOption(attributes.placement, [ "left", "bottom", "inline", "right", "top", ]); - this.presence = getStringOption(e.presence, [ + this.presence = getStringOption(attributes.presence, [ "visible", "hidden", "inactive", "invisible", ]); - this.reserve = Math.ceil(getMeasurement(e.reserve)); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.reserve = Math.ceil(getMeasurement(attributes.reserve)); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; this.font = null; this.margin = null; this.para = null; this.value = null; } - [$r](e) { - _setValue(this, e); + [$setValue](value) { + _setValue(this, value); } - [lr](e) { - if (!this[ar]) { - let { width: t, height: i } = e; + [$getExtra](availableSpace) { + if (!this[$extra]) { + let { width, height } = availableSpace; switch (this.placement) { case "left": case "right": case "inline": - t = this.reserve <= 0 ? t : this.reserve; + width = this.reserve <= 0 ? width : this.reserve; break; case "top": case "bottom": - i = this.reserve <= 0 ? i : this.reserve; + height = this.reserve <= 0 ? height : this.reserve; + break; } - this[ar] = layoutNode(this, { width: t, height: i }); + this[$extra] = layoutNode(this, { + width, + height, + }); } - return this[ar]; + return this[$extra]; } - [an](e) { - if (!this.value) return HTMLResult.EMPTY; - this[Wr](); - const t = this.value[an](e).html; - if (!t) { - this[Pr](); + [$toHTML](availableSpace) { + if (!this.value) { return HTMLResult.EMPTY; } - const i = this.reserve; + this[$pushPara](); + const value = this.value[$toHTML](availableSpace).html; + if (!value) { + this[$popPara](); + return HTMLResult.EMPTY; + } + const savedReserve = this.reserve; if (this.reserve <= 0) { - const { w: t, h: i } = this[lr](e); + const { w, h } = this[$getExtra](availableSpace); switch (this.placement) { case "left": case "right": case "inline": - this.reserve = t; + this.reserve = w; break; case "top": case "bottom": - this.reserve = i; + this.reserve = h; + break; } } - const a = []; - "string" == typeof t ? a.push({ name: "#text", value: t }) : a.push(t); - const s = toStyle(this, "font", "margin", "visibility"); + const children = []; + if (typeof value === "string") { + children.push({ + name: "#text", + value, + }); + } else { + children.push(value); + } + const style = toStyle(this, "font", "margin", "visibility"); switch (this.placement) { case "left": case "right": - this.reserve > 0 && (s.width = measureToString(this.reserve)); + if (this.reserve > 0) { + style.width = measureToString(this.reserve); + } break; case "top": case "bottom": - this.reserve > 0 && (s.height = measureToString(this.reserve)); + if (this.reserve > 0) { + style.height = measureToString(this.reserve); + } + break; } - setPara(this, null, t); - this[Pr](); - this.reserve = i; + setPara(this, null, value); + this[$popPara](); + this.reserve = savedReserve; return HTMLResult.success({ name: "div", - attributes: { style: s, class: ["xfaCaption"] }, - children: a, + attributes: { + style, + class: ["xfaCaption"], + }, + children, }); } } class Certificate extends StringObject { - constructor(e) { - super(Hn, "certificate"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "certificate"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Certificates extends XFAObject { - constructor(e) { - super(Hn, "certificates", !0); - this.credentialServerPolicy = getStringOption(e.credentialServerPolicy, [ - "optional", - "required", - ]); - this.id = e.id || ""; - this.url = e.url || ""; - this.urlPolicy = e.urlPolicy || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "certificates", true); + this.credentialServerPolicy = getStringOption( + attributes.credentialServerPolicy, + ["optional", "required"], + ); + this.id = attributes.id || ""; + this.url = attributes.url || ""; + this.urlPolicy = attributes.urlPolicy || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.encryption = null; this.issuers = null; this.keyUsage = null; @@ -44003,10 +53441,10 @@ class Certificates extends XFAObject { } } class CheckButton extends XFAObject { - constructor(e) { - super(Hn, "checkButton", !0); - this.id = e.id || ""; - this.mark = getStringOption(e.mark, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "checkButton", true); + this.id = attributes.id || ""; + this.mark = getStringOption(attributes.mark, [ "default", "check", "circle", @@ -44015,251 +53453,279 @@ class CheckButton extends XFAObject { "square", "star", ]); - this.shape = getStringOption(e.shape, ["square", "round"]); - this.size = getMeasurement(e.size, "10pt"); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.shape = getStringOption(attributes.shape, ["square", "round"]); + this.size = getMeasurement(attributes.size, "10pt"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.border = null; this.extras = null; this.margin = null; } - [an](e) { - const t = toStyle("margin"), - i = measureToString(this.size); - t.width = t.height = i; - let a, s, r; - const n = this[pr]()[pr](), - g = (n.items.children.length && n.items.children[0][an]().html) || [], - o = { - on: (void 0 !== g[0] ? g[0] : "on").toString(), - off: (void 0 !== g[1] ? g[1] : "off").toString(), - }, - c = (n.value?.[en]() || "off") === o.on || void 0, - C = n[fr](), - h = n[nn]; - let l; - if (C instanceof ExclGroup) { - r = C[nn]; - a = "radio"; - s = "xfaRadio"; - l = C[tr]?.[nn] || C[nn]; + [$toHTML](availableSpace) { + const style = toStyle("margin"); + const size = measureToString(this.size); + style.width = style.height = size; + let type; + let className; + let groupId; + const field = this[$getParent]()[$getParent](); + const items = + (field.items.children.length && + field.items.children[0][$toHTML]().html) || + []; + const exportedValue = { + on: (items[0] !== undefined ? items[0] : "on").toString(), + off: (items[1] !== undefined ? items[1] : "off").toString(), + }; + const value = field.value?.[$text]() || "off"; + const checked = value === exportedValue.on || undefined; + const container = field[$getSubformParent](); + const fieldId = field[$uid]; + let dataId; + if (container instanceof ExclGroup) { + groupId = container[$uid]; + type = "radio"; + className = "xfaRadio"; + dataId = container[$data]?.[$uid] || container[$uid]; } else { - a = "checkbox"; - s = "xfaCheckbox"; - l = n[tr]?.[nn] || n[nn]; + type = "checkbox"; + className = "xfaCheckbox"; + dataId = field[$data]?.[$uid] || field[$uid]; } - const Q = { + const input = { name: "input", attributes: { - class: [s], - style: t, - fieldId: h, - dataId: l, - type: a, - checked: c, - xfaOn: o.on, - xfaOff: o.off, - "aria-label": ariaLabel(n), - "aria-required": !1, + class: [className], + style, + fieldId, + dataId, + type, + checked, + xfaOn: exportedValue.on, + xfaOff: exportedValue.off, + "aria-label": ariaLabel(field), + "aria-required": false, }, }; - r && (Q.attributes.name = r); - if (isRequired(n)) { - Q.attributes["aria-required"] = !0; - Q.attributes.required = !0; + if (groupId) { + input.attributes.name = groupId; + } + if (isRequired(field)) { + input.attributes["aria-required"] = true; + input.attributes.required = true; } return HTMLResult.success({ name: "label", - attributes: { class: ["xfaLabel"] }, - children: [Q], + attributes: { + class: ["xfaLabel"], + }, + children: [input], }); } } class ChoiceList extends XFAObject { - constructor(e) { - super(Hn, "choiceList", !0); - this.commitOn = getStringOption(e.commitOn, ["select", "exit"]); - this.id = e.id || ""; - this.open = getStringOption(e.open, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "choiceList", true); + this.commitOn = getStringOption(attributes.commitOn, ["select", "exit"]); + this.id = attributes.id || ""; + this.open = getStringOption(attributes.open, [ "userControl", "always", "multiSelect", "onEntry", ]); this.textEntry = getInteger({ - data: e.textEntry, + data: attributes.textEntry, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.border = null; this.extras = null; this.margin = null; } - [an](e) { - const t = toStyle(this, "border", "margin"), - i = this[pr]()[pr](), - a = { fontSize: `calc(${i.font?.size || 10}px * var(--scale-factor))` }, - s = []; - if (i.items.children.length > 0) { - const e = i.items; - let t = 0, - r = 0; - if (2 === e.children.length) { - t = e.children[0].save; - r = 1 - t; + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "margin"); + const ui = this[$getParent](); + const field = ui[$getParent](); + const fontSize = field.font?.size || 10; + const optionStyle = { + fontSize: `calc(${fontSize}px * var(--scale-factor))`, + }; + const children = []; + if (field.items.children.length > 0) { + const items = field.items; + let displayedIndex = 0; + let saveIndex = 0; + if (items.children.length === 2) { + displayedIndex = items.children[0].save; + saveIndex = 1 - displayedIndex; } - const n = e.children[t][an]().html, - g = e.children[r][an]().html; - let o = !1; - const c = i.value?.[en]() || ""; - for (let e = 0, t = n.length; e < t; e++) { - const t = { + const displayed = items.children[displayedIndex][$toHTML]().html; + const values = items.children[saveIndex][$toHTML]().html; + let selected = false; + const value = field.value?.[$text]() || ""; + for (let i = 0, ii = displayed.length; i < ii; i++) { + const option = { name: "option", - attributes: { value: g[e] || n[e], style: a }, - value: n[e], + attributes: { + value: values[i] || displayed[i], + style: optionStyle, + }, + value: displayed[i], }; - g[e] === c && (t.attributes.selected = o = !0); - s.push(t); + if (values[i] === value) { + option.attributes.selected = selected = true; + } + children.push(option); } - o || - s.splice(0, 0, { + if (!selected) { + children.splice(0, 0, { name: "option", - attributes: { hidden: !0, selected: !0 }, + attributes: { + hidden: true, + selected: true, + }, value: " ", }); + } } - const r = { + const selectAttributes = { class: ["xfaSelect"], - fieldId: i[nn], - dataId: i[tr]?.[nn] || i[nn], - style: t, - "aria-label": ariaLabel(i), - "aria-required": !1, + fieldId: field[$uid], + dataId: field[$data]?.[$uid] || field[$uid], + style, + "aria-label": ariaLabel(field), + "aria-required": false, }; - if (isRequired(i)) { - r["aria-required"] = !0; - r.required = !0; + if (isRequired(field)) { + selectAttributes["aria-required"] = true; + selectAttributes.required = true; + } + if (this.open === "multiSelect") { + selectAttributes.multiple = true; } - "multiSelect" === this.open && (r.multiple = !0); return HTMLResult.success({ name: "label", - attributes: { class: ["xfaLabel"] }, - children: [{ name: "select", children: s, attributes: r }], + attributes: { + class: ["xfaLabel"], + }, + children: [ + { + name: "select", + children, + attributes: selectAttributes, + }, + ], }); } } class Color extends XFAObject { - constructor(e) { - super(Hn, "color", !0); - this.cSpace = getStringOption(e.cSpace, ["SRGB"]); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; - this.value = e.value - ? (function getColor(e, t = [0, 0, 0]) { - let [i, a, s] = t; - if (!e) return { r: i, g: a, b: s }; - const r = e - .trim() - .split(/\s*,\s*/) - .map((e) => Math.min(Math.max(0, parseInt(e.trim(), 10)), 255)) - .map((e) => (isNaN(e) ? 0 : e)); - if (r.length < 3) return { r: i, g: a, b: s }; - [i, a, s] = r; - return { r: i, g: a, b: s }; - })(e.value) - : ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "color", true); + this.cSpace = getStringOption(attributes.cSpace, ["SRGB"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.value = attributes.value ? getColor(attributes.value) : ""; this.extras = null; } - [wr]() { - return !1; + [$hasSettableValue]() { + return false; } - [rn]() { + [$toStyle]() { return this.value ? Util.makeHexColor(this.value.r, this.value.g, this.value.b) : null; } } class Comb extends XFAObject { - constructor(e) { - super(Hn, "comb"); - this.id = e.id || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "comb"); + this.id = attributes.id || ""; this.numberOfCells = getInteger({ - data: e.numberOfCells, + data: attributes.numberOfCells, defaultValue: 0, - validate: (e) => e >= 0, + validate: (x) => x >= 0, }); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Connect extends XFAObject { - constructor(e) { - super(Hn, "connect", !0); - this.connection = e.connection || ""; - this.id = e.id || ""; - this.ref = e.ref || ""; - this.usage = getStringOption(e.usage, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "connect", true); + this.connection = attributes.connection || ""; + this.id = attributes.id || ""; + this.ref = attributes.ref || ""; + this.usage = getStringOption(attributes.usage, [ "exportAndImport", "exportOnly", "importOnly", ]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.picture = null; } } class ContentArea extends XFAObject { - constructor(e) { - super(Hn, "contentArea", !0); - this.h = getMeasurement(e.h); - this.id = e.id || ""; - this.name = e.name || ""; - this.relevant = getRelevant(e.relevant); - this.use = e.use || ""; - this.usehref = e.usehref || ""; - this.w = getMeasurement(e.w); - this.x = getMeasurement(e.x, "0pt"); - this.y = getMeasurement(e.y, "0pt"); + constructor(attributes) { + super(TEMPLATE_NS_ID, "contentArea", true); + this.h = getMeasurement(attributes.h); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = getMeasurement(attributes.w); + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); this.desc = null; this.extras = null; } - [an](e) { - const t = { - left: measureToString(this.x), - top: measureToString(this.y), - width: measureToString(this.w), - height: measureToString(this.h), - }, - i = ["xfaContentarea"]; - isPrintOnly(this) && i.push("xfaPrintOnly"); + [$toHTML](availableSpace) { + const left = measureToString(this.x); + const top = measureToString(this.y); + const style = { + left, + top, + width: measureToString(this.w), + height: measureToString(this.h), + }; + const classNames = ["xfaContentarea"]; + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); + } return HTMLResult.success({ name: "div", children: [], - attributes: { style: t, class: i, id: this[nn] }, + attributes: { + style, + class: classNames, + id: this[$uid], + }, }); } } class Corner extends XFAObject { - constructor(e) { - super(Hn, "corner", !0); - this.id = e.id || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "corner", true); + this.id = attributes.id || ""; this.inverted = getInteger({ - data: e.inverted, + data: attributes.inverted, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); - this.join = getStringOption(e.join, ["square", "round"]); - this.presence = getStringOption(e.presence, [ + this.join = getStringOption(attributes.join, ["square", "round"]); + this.presence = getStringOption(attributes.presence, [ "visible", "hidden", "inactive", "invisible", ]); - this.radius = getMeasurement(e.radius); - this.stroke = getStringOption(e.stroke, [ + this.radius = getMeasurement(attributes.radius); + this.stroke = getStringOption(attributes.stroke, [ "solid", "dashDot", "dashDotDot", @@ -44270,134 +53736,138 @@ class Corner extends XFAObject { "lowered", "raised", ]); - this.thickness = getMeasurement(e.thickness, "0.5pt"); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.thickness = getMeasurement(attributes.thickness, "0.5pt"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.color = null; this.extras = null; } - [rn]() { - const e = toStyle(this, "visibility"); - e.radius = measureToString("square" === this.join ? 0 : this.radius); - return e; + [$toStyle]() { + const style = toStyle(this, "visibility"); + style.radius = measureToString(this.join === "square" ? 0 : this.radius); + return style; } } class DateElement extends ContentObject { - constructor(e) { - super(Hn, "date"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "date"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } - [sr]() { - const e = this[er].trim(); - this[er] = e ? new Date(e) : null; + [$finalize]() { + const date = this[$content].trim(); + this[$content] = date ? new Date(date) : null; } - [an](e) { - return valueToHtml(this[er] ? this[er].toString() : ""); + [$toHTML](availableSpace) { + return valueToHtml(this[$content] ? this[$content].toString() : ""); } } class DateTime extends ContentObject { - constructor(e) { - super(Hn, "dateTime"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "dateTime"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } - [sr]() { - const e = this[er].trim(); - this[er] = e ? new Date(e) : null; + [$finalize]() { + const date = this[$content].trim(); + this[$content] = date ? new Date(date) : null; } - [an](e) { - return valueToHtml(this[er] ? this[er].toString() : ""); + [$toHTML](availableSpace) { + return valueToHtml(this[$content] ? this[$content].toString() : ""); } } class DateTimeEdit extends XFAObject { - constructor(e) { - super(Hn, "dateTimeEdit", !0); - this.hScrollPolicy = getStringOption(e.hScrollPolicy, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "dateTimeEdit", true); + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, [ "auto", "off", "on", ]); - this.id = e.id || ""; - this.picker = getStringOption(e.picker, ["host", "none"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.id = attributes.id || ""; + this.picker = getStringOption(attributes.picker, ["host", "none"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.border = null; this.comb = null; this.extras = null; this.margin = null; } - [an](e) { - const t = toStyle(this, "border", "font", "margin"), - i = this[pr]()[pr](), - a = { - name: "input", - attributes: { - type: "text", - fieldId: i[nn], - dataId: i[tr]?.[nn] || i[nn], - class: ["xfaTextfield"], - style: t, - "aria-label": ariaLabel(i), - "aria-required": !1, - }, - }; - if (isRequired(i)) { - a.attributes["aria-required"] = !0; - a.attributes.required = !0; + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "font", "margin"); + const field = this[$getParent]()[$getParent](); + const html = { + name: "input", + attributes: { + type: "text", + fieldId: field[$uid], + dataId: field[$data]?.[$uid] || field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false, + }, + }; + if (isRequired(field)) { + html.attributes["aria-required"] = true; + html.attributes.required = true; } return HTMLResult.success({ name: "label", - attributes: { class: ["xfaLabel"] }, - children: [a], + attributes: { + class: ["xfaLabel"], + }, + children: [html], }); } } class Decimal extends ContentObject { - constructor(e) { - super(Hn, "decimal"); + constructor(attributes) { + super(TEMPLATE_NS_ID, "decimal"); this.fracDigits = getInteger({ - data: e.fracDigits, + data: attributes.fracDigits, defaultValue: 2, - validate: (e) => !0, + validate: (x) => true, }); - this.id = e.id || ""; + this.id = attributes.id || ""; this.leadDigits = getInteger({ - data: e.leadDigits, + data: attributes.leadDigits, defaultValue: -1, - validate: (e) => !0, + validate: (x) => true, }); - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } - [sr]() { - const e = parseFloat(this[er].trim()); - this[er] = isNaN(e) ? null : e; + [$finalize]() { + const number = parseFloat(this[$content].trim()); + this[$content] = isNaN(number) ? null : number; } - [an](e) { - return valueToHtml(null !== this[er] ? this[er].toString() : ""); + [$toHTML](availableSpace) { + return valueToHtml( + this[$content] !== null ? this[$content].toString() : "", + ); } } class DefaultUi extends XFAObject { - constructor(e) { - super(Hn, "defaultUi", !0); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "defaultUi", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; } } class Desc extends XFAObject { - constructor(e) { - super(Hn, "desc", !0); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "desc", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.boolean = new XFAObjectArray(); this.date = new XFAObjectArray(); this.dateTime = new XFAObjectArray(); @@ -44411,27 +53881,33 @@ class Desc extends XFAObject { } } class DigestMethod extends OptionObject { - constructor(e) { - super(Hn, "digestMethod", ["", "SHA1", "SHA256", "SHA512", "RIPEMD160"]); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "digestMethod", [ + "", + "SHA1", + "SHA256", + "SHA512", + "RIPEMD160", + ]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class DigestMethods extends XFAObject { - constructor(e) { - super(Hn, "digestMethods", !0); - this.id = e.id || ""; - this.type = getStringOption(e.type, ["optional", "required"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "digestMethods", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.digestMethod = new XFAObjectArray(); } } class Draw extends XFAObject { - constructor(e) { - super(Hn, "draw", !0); - this.anchorType = getStringOption(e.anchorType, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "draw", true); + this.anchorType = getStringOption(attributes.anchorType, [ "topLeft", "bottomCenter", "bottomLeft", @@ -44443,12 +53919,12 @@ class Draw extends XFAObject { "topRight", ]); this.colSpan = getInteger({ - data: e.colSpan, + data: attributes.colSpan, defaultValue: 1, - validate: (e) => e >= 1 || -1 === e, + validate: (n) => n >= 1 || n === -1, }); - this.h = e.h ? getMeasurement(e.h) : ""; - this.hAlign = getStringOption(e.hAlign, [ + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, [ "left", "center", "justify", @@ -44456,30 +53932,30 @@ class Draw extends XFAObject { "radix", "right", ]); - this.id = e.id || ""; - this.locale = e.locale || ""; - this.maxH = getMeasurement(e.maxH, "0pt"); - this.maxW = getMeasurement(e.maxW, "0pt"); - this.minH = getMeasurement(e.minH, "0pt"); - this.minW = getMeasurement(e.minW, "0pt"); - this.name = e.name || ""; - this.presence = getStringOption(e.presence, [ + this.id = attributes.id || ""; + this.locale = attributes.locale || ""; + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, [ "visible", "hidden", "inactive", "invisible", ]); - this.relevant = getRelevant(e.relevant); + this.relevant = getRelevant(attributes.relevant); this.rotate = getInteger({ - data: e.rotate, + data: attributes.rotate, defaultValue: 0, - validate: (e) => e % 90 == 0, + validate: (x) => x % 90 === 0, }); - this.use = e.use || ""; - this.usehref = e.usehref || ""; - this.w = e.w ? getMeasurement(e.w) : ""; - this.x = getMeasurement(e.x, "0pt"); - this.y = getMeasurement(e.y, "0pt"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); this.assist = null; this.border = null; this.caption = null; @@ -44494,35 +53970,38 @@ class Draw extends XFAObject { this.value = null; this.setProperty = new XFAObjectArray(); } - [$r](e) { - _setValue(this, e); + [$setValue](value) { + _setValue(this, value); } - [an](e) { + [$toHTML](availableSpace) { setTabIndex(this); - if ("hidden" === this.presence || "inactive" === this.presence) + if (this.presence === "hidden" || this.presence === "inactive") { return HTMLResult.EMPTY; + } fixDimensions(this); - this[Wr](); - const t = this.w, - i = this.h, - { w: a, h: s, isBroken: r } = layoutNode(this, e); - if (a && "" === this.w) { - if (r && this[fr]()[Ur]()) { - this[Pr](); + this[$pushPara](); + const savedW = this.w; + const savedH = this.h; + const { w, h, isBroken } = layoutNode(this, availableSpace); + if (w && this.w === "") { + if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) { + this[$popPara](); return HTMLResult.FAILURE; } - this.w = a; + this.w = w; + } + if (h && this.h === "") { + this.h = h; } - s && "" === this.h && (this.h = s); setFirstUnsplittable(this); - if (!checkDimensions(this, e)) { - this.w = t; - this.h = i; - this[Pr](); + if (!checkDimensions(this, availableSpace)) { + this.w = savedW; + this.h = savedH; + this[$popPara](); return HTMLResult.FAILURE; } unsetFirstUnsplittable(this); - const n = toStyle( + const style = toStyle( this, "font", "hAlign", @@ -44534,46 +54013,60 @@ class Draw extends XFAObject { "border", "margin", ); - setMinMaxDimensions(this, n); - if (n.margin) { - n.padding = n.margin; - delete n.margin; + setMinMaxDimensions(this, style); + if (style.margin) { + style.padding = style.margin; + delete style.margin; } - const g = ["xfaDraw"]; - this.font && g.push("xfaFont"); - isPrintOnly(this) && g.push("xfaPrintOnly"); - const o = { style: n, id: this[nn], class: g }; - this.name && (o.xfaName = this.name); - const c = { name: "div", attributes: o, children: [] }; - applyAssist(this, o); - const C = computeBbox(this, c, e), - h = this.value ? this.value[an](e).html : null; - if (null === h) { - this.w = t; - this.h = i; - this[Pr](); - return HTMLResult.success(createWrapper(this, c), C); + const classNames = ["xfaDraw"]; + if (this.font) { + classNames.push("xfaFont"); } - c.children.push(h); - setPara(this, n, h); - this.w = t; - this.h = i; - this[Pr](); - return HTMLResult.success(createWrapper(this, c), C); + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); + } + const attributes = { + style, + id: this[$uid], + class: classNames, + }; + if (this.name) { + attributes.xfaName = this.name; + } + const html = { + name: "div", + attributes, + children: [], + }; + applyAssist(this, attributes); + const bbox = computeBbox(this, html, availableSpace); + const value = this.value ? this.value[$toHTML](availableSpace).html : null; + if (value === null) { + this.w = savedW; + this.h = savedH; + this[$popPara](); + return HTMLResult.success(createWrapper(this, html), bbox); + } + html.children.push(value); + setPara(this, style, value); + this.w = savedW; + this.h = savedH; + this[$popPara](); + return HTMLResult.success(createWrapper(this, html), bbox); } } class Edge extends XFAObject { - constructor(e) { - super(Hn, "edge", !0); - this.cap = getStringOption(e.cap, ["square", "butt", "round"]); - this.id = e.id || ""; - this.presence = getStringOption(e.presence, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "edge", true); + this.cap = getStringOption(attributes.cap, ["square", "butt", "round"]); + this.id = attributes.id || ""; + this.presence = getStringOption(attributes.presence, [ "visible", "hidden", "inactive", "invisible", ]); - this.stroke = getStringOption(e.stroke, [ + this.stroke = getStringOption(attributes.stroke, [ "solid", "dashDot", "dashDotDot", @@ -44584,130 +54077,140 @@ class Edge extends XFAObject { "lowered", "raised", ]); - this.thickness = getMeasurement(e.thickness, "0.5pt"); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.thickness = getMeasurement(attributes.thickness, "0.5pt"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.color = null; this.extras = null; } - [rn]() { - const e = toStyle(this, "visibility"); - Object.assign(e, { + [$toStyle]() { + const style = toStyle(this, "visibility"); + Object.assign(style, { linecap: this.cap, width: measureToString(this.thickness), - color: this.color ? this.color[rn]() : "#000000", + color: this.color ? this.color[$toStyle]() : "#000000", style: "", }); - if ("visible" !== this.presence) e.style = "none"; - else + if (this.presence !== "visible") { + style.style = "none"; + } else { switch (this.stroke) { case "solid": - e.style = "solid"; + style.style = "solid"; break; case "dashDot": + style.style = "dashed"; + break; case "dashDotDot": + style.style = "dashed"; + break; case "dashed": - e.style = "dashed"; + style.style = "dashed"; break; case "dotted": - e.style = "dotted"; + style.style = "dotted"; break; case "embossed": - e.style = "ridge"; + style.style = "ridge"; break; case "etched": - e.style = "groove"; + style.style = "groove"; break; case "lowered": - e.style = "inset"; + style.style = "inset"; break; case "raised": - e.style = "outset"; + style.style = "outset"; + break; } - return e; + } + return style; } } class Encoding extends OptionObject { - constructor(e) { - super(Hn, "encoding", [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "encoding", [ "adbe.x509.rsa_sha1", "adbe.pkcs7.detached", "adbe.pkcs7.sha1", ]); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Encodings extends XFAObject { - constructor(e) { - super(Hn, "encodings", !0); - this.id = e.id || ""; - this.type = getStringOption(e.type, ["optional", "required"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "encodings", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.encoding = new XFAObjectArray(); } } class Encrypt extends XFAObject { - constructor(e) { - super(Hn, "encrypt", !0); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "encrypt", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.certificate = null; } } class EncryptData extends XFAObject { - constructor(e) { - super(Hn, "encryptData", !0); - this.id = e.id || ""; - this.operation = getStringOption(e.operation, ["encrypt", "decrypt"]); - this.target = e.target || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryptData", true); + this.id = attributes.id || ""; + this.operation = getStringOption(attributes.operation, [ + "encrypt", + "decrypt", + ]); + this.target = attributes.target || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.filter = null; this.manifest = null; } } class Encryption extends XFAObject { - constructor(e) { - super(Hn, "encryption", !0); - this.id = e.id || ""; - this.type = getStringOption(e.type, ["optional", "required"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryption", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.certificate = new XFAObjectArray(); } } class EncryptionMethod extends OptionObject { - constructor(e) { - super(Hn, "encryptionMethod", [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryptionMethod", [ "", "AES256-CBC", "TRIPLEDES-CBC", "AES128-CBC", "AES192-CBC", ]); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class EncryptionMethods extends XFAObject { - constructor(e) { - super(Hn, "encryptionMethods", !0); - this.id = e.id || ""; - this.type = getStringOption(e.type, ["optional", "required"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryptionMethods", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.encryptionMethod = new XFAObjectArray(); } } class Event extends XFAObject { - constructor(e) { - super(Hn, "event", !0); - this.activity = getStringOption(e.activity, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "event", true); + this.activity = getStringOption(attributes.activity, [ "click", "change", "docClose", @@ -44736,12 +54239,15 @@ class Event extends XFAObject { "ready", "validationState", ]); - this.id = e.id || ""; - this.listen = getStringOption(e.listen, ["refOnly", "refAndDescendents"]); - this.name = e.name || ""; - this.ref = e.ref || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.id = attributes.id || ""; + this.listen = getStringOption(attributes.listen, [ + "refOnly", + "refAndDescendents", + ]); + this.name = attributes.name || ""; + this.ref = attributes.ref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; this.encryptData = null; this.execute = null; @@ -44751,57 +54257,61 @@ class Event extends XFAObject { } } class ExData extends ContentObject { - constructor(e) { - super(Hn, "exData"); - this.contentType = e.contentType || ""; - this.href = e.href || ""; - this.id = e.id || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "exData"); + this.contentType = attributes.contentType || ""; + this.href = attributes.href || ""; + this.id = attributes.id || ""; this.maxLength = getInteger({ - data: e.maxLength, + data: attributes.maxLength, defaultValue: -1, - validate: (e) => e >= -1, + validate: (x) => x >= -1, }); - this.name = e.name || ""; - this.rid = e.rid || ""; - this.transferEncoding = getStringOption(e.transferEncoding, [ + this.name = attributes.name || ""; + this.rid = attributes.rid || ""; + this.transferEncoding = getStringOption(attributes.transferEncoding, [ "none", "base64", "package", ]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } - [Sr]() { - return "text/html" === this.contentType; + [$isCDATAXml]() { + return this.contentType === "text/html"; } - [Kr](e) { - if ("text/html" === this.contentType && e[Jr] === on.xhtml.id) { - this[er] = e; - return !0; + [$onChild](child) { + if ( + this.contentType === "text/html" && + child[$namespaceId] === NamespaceIds.xhtml.id + ) { + this[$content] = child; + return true; } - if ("text/xml" === this.contentType) { - this[er] = e; - return !0; + if (this.contentType === "text/xml") { + this[$content] = child; + return true; } - return !1; + return false; } - [an](e) { - return "text/html" === this.contentType && this[er] - ? this[er][an](e) - : HTMLResult.EMPTY; + [$toHTML](availableSpace) { + if (this.contentType !== "text/html" || !this[$content]) { + return HTMLResult.EMPTY; + } + return this[$content][$toHTML](availableSpace); } } class ExObject extends XFAObject { - constructor(e) { - super(Hn, "exObject", !0); - this.archive = e.archive || ""; - this.classId = e.classId || ""; - this.codeBase = e.codeBase || ""; - this.codeType = e.codeType || ""; - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "exObject", true); + this.archive = attributes.archive || ""; + this.classId = attributes.classId || ""; + this.codeBase = attributes.codeBase || ""; + this.codeType = attributes.codeType || ""; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; this.boolean = new XFAObjectArray(); this.date = new XFAObjectArray(); @@ -44817,16 +54327,16 @@ class ExObject extends XFAObject { } } class ExclGroup extends XFAObject { - constructor(e) { - super(Hn, "exclGroup", !0); - this.access = getStringOption(e.access, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "exclGroup", true); + this.access = getStringOption(attributes.access, [ "open", "nonInteractive", "protected", "readOnly", ]); - this.accessKey = e.accessKey || ""; - this.anchorType = getStringOption(e.anchorType, [ + this.accessKey = attributes.accessKey || ""; + this.anchorType = getStringOption(attributes.anchorType, [ "topLeft", "bottomCenter", "bottomLeft", @@ -44838,12 +54348,12 @@ class ExclGroup extends XFAObject { "topRight", ]); this.colSpan = getInteger({ - data: e.colSpan, + data: attributes.colSpan, defaultValue: 1, - validate: (e) => e >= 1 || -1 === e, + validate: (n) => n >= 1 || n === -1, }); - this.h = e.h ? getMeasurement(e.h) : ""; - this.hAlign = getStringOption(e.hAlign, [ + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, [ "left", "center", "justify", @@ -44851,8 +54361,8 @@ class ExclGroup extends XFAObject { "radix", "right", ]); - this.id = e.id || ""; - this.layout = getStringOption(e.layout, [ + this.id = attributes.id || ""; + this.layout = getStringOption(attributes.layout, [ "position", "lr-tb", "rl-row", @@ -44861,23 +54371,23 @@ class ExclGroup extends XFAObject { "table", "tb", ]); - this.maxH = getMeasurement(e.maxH, "0pt"); - this.maxW = getMeasurement(e.maxW, "0pt"); - this.minH = getMeasurement(e.minH, "0pt"); - this.minW = getMeasurement(e.minW, "0pt"); - this.name = e.name || ""; - this.presence = getStringOption(e.presence, [ + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, [ "visible", "hidden", "inactive", "invisible", ]); - this.relevant = getRelevant(e.relevant); - this.use = e.use || ""; - this.usehref = e.usehref || ""; - this.w = e.w ? getMeasurement(e.w) : ""; - this.x = getMeasurement(e.x, "0pt"); - this.y = getMeasurement(e.y, "0pt"); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); this.assist = null; this.bind = null; this.border = null; @@ -44894,170 +54404,218 @@ class ExclGroup extends XFAObject { this.field = new XFAObjectArray(); this.setProperty = new XFAObjectArray(); } - [kr]() { - return !0; + [$isBindable]() { + return true; } - [wr]() { - return !0; + [$hasSettableValue]() { + return true; } - [$r](e) { - for (const t of this.field.children) { - if (!t.value) { - const e = new Value({}); - t[Xs](e); - t.value = e; + [$setValue](value) { + for (const field of this.field.children) { + if (!field.value) { + const nodeValue = new Value({}); + field[$appendChild](nodeValue); + field.value = nodeValue; } - t.value[$r](e); + field.value[$setValue](value); } } - [Ur]() { + [$isThereMoreWidth]() { return ( (this.layout.endsWith("-tb") && - 0 === this[ar].attempt && - this[ar].numberInLine > 0) || - this[pr]()[Ur]() + this[$extra].attempt === 0 && + this[$extra].numberInLine > 0) || + this[$getParent]()[$isThereMoreWidth]() ); } - [xr]() { - const e = this[fr](); - if (!e[xr]()) return !1; - if (void 0 !== this[ar]._isSplittable) return this[ar]._isSplittable; - if ("position" === this.layout || this.layout.includes("row")) { - this[ar]._isSplittable = !1; - return !1; + [$isSplittable]() { + const parent = this[$getSubformParent](); + if (!parent[$isSplittable]()) { + return false; } - if (e.layout?.endsWith("-tb") && 0 !== e[ar].numberInLine) return !1; - this[ar]._isSplittable = !0; - return !0; + if (this[$extra]._isSplittable !== undefined) { + return this[$extra]._isSplittable; + } + if (this.layout === "position" || this.layout.includes("row")) { + this[$extra]._isSplittable = false; + return false; + } + if (parent.layout?.endsWith("-tb") && parent[$extra].numberInLine !== 0) { + return false; + } + this[$extra]._isSplittable = true; + return true; } - [rr]() { + [$flushHTML]() { return flushHTML(this); } - [js](e, t) { - addHTML(this, e, t); + [$addHTML](html, bbox) { + addHTML(this, html, bbox); } - [or]() { + [$getAvailableSpace]() { return getAvailableSpace(this); } - [an](e) { + [$toHTML](availableSpace) { setTabIndex(this); if ( - "hidden" === this.presence || - "inactive" === this.presence || - 0 === this.h || - 0 === this.w - ) + this.presence === "hidden" || + this.presence === "inactive" || + this.h === 0 || + this.w === 0 + ) { return HTMLResult.EMPTY; + } fixDimensions(this); - const t = [], - i = { id: this[nn], class: [] }; - setAccess(this, i.class); - this[ar] || (this[ar] = Object.create(null)); - Object.assign(this[ar], { - children: t, - attributes: i, + const children = []; + const attributes = { + id: this[$uid], + class: [], + }; + setAccess(this, attributes.class); + if (!this[$extra]) { + this[$extra] = Object.create(null); + } + Object.assign(this[$extra], { + children, + attributes, attempt: 0, line: null, numberInLine: 0, availableSpace: { - width: Math.min(this.w || 1 / 0, e.width), - height: Math.min(this.h || 1 / 0, e.height), + width: Math.min(this.w || Infinity, availableSpace.width), + height: Math.min(this.h || Infinity, availableSpace.height), }, width: 0, height: 0, prevHeight: 0, currentWidth: 0, }); - const a = this[xr](); - a || setFirstUnsplittable(this); - if (!checkDimensions(this, e)) return HTMLResult.FAILURE; - const s = new Set(["field"]); + const isSplittable = this[$isSplittable](); + if (!isSplittable) { + setFirstUnsplittable(this); + } + if (!checkDimensions(this, availableSpace)) { + return HTMLResult.FAILURE; + } + const filter = new Set(["field"]); if (this.layout.includes("row")) { - const e = this[fr]().columnWidths; - if (Array.isArray(e) && e.length > 0) { - this[ar].columnWidths = e; - this[ar].currentColumn = 0; + const columnWidths = this[$getSubformParent]().columnWidths; + if (Array.isArray(columnWidths) && columnWidths.length > 0) { + this[$extra].columnWidths = columnWidths; + this[$extra].currentColumn = 0; } } - const r = toStyle( - this, - "anchorType", - "dimensions", - "position", - "presence", - "border", - "margin", - "hAlign", - ), - n = ["xfaExclgroup"], - g = layoutClass(this); - g && n.push(g); - isPrintOnly(this) && n.push("xfaPrintOnly"); - i.style = r; - i.class = n; - this.name && (i.xfaName = this.name); - this[Wr](); - const o = "lr-tb" === this.layout || "rl-tb" === this.layout, - c = o ? 2 : 1; - for (; this[ar].attempt < c; this[ar].attempt++) { - o && 1 === this[ar].attempt && (this[ar].numberInLine = 0); - const e = this[Zs]({ filter: s, include: !0 }); - if (e.success) break; - if (e.isBreak()) { - this[Pr](); - return e; + const style = toStyle( + this, + "anchorType", + "dimensions", + "position", + "presence", + "border", + "margin", + "hAlign", + ); + const classNames = ["xfaExclgroup"]; + const cl = layoutClass(this); + if (cl) { + classNames.push(cl); + } + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); + } + attributes.style = style; + attributes.class = classNames; + if (this.name) { + attributes.xfaName = this.name; + } + this[$pushPara](); + const isLrTb = this.layout === "lr-tb" || this.layout === "rl-tb"; + const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1; + for (; this[$extra].attempt < maxRun; this[$extra].attempt++) { + if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) { + this[$extra].numberInLine = 0; + } + const result = this[$childrenToHTML]({ + filter, + include: true, + }); + if (result.success) { + break; + } + if (result.isBreak()) { + this[$popPara](); + return result; } if ( - o && - 0 === this[ar].attempt && - 0 === this[ar].numberInLine && - !this[mr]()[ar].noLayoutFailure + isLrTb && + this[$extra].attempt === 0 && + this[$extra].numberInLine === 0 && + !this[$getTemplateRoot]()[$extra].noLayoutFailure ) { - this[ar].attempt = c; + this[$extra].attempt = maxRun; break; } } - this[Pr](); - a || unsetFirstUnsplittable(this); - if (this[ar].attempt === c) { - a || delete this[ar]; + this[$popPara](); + if (!isSplittable) { + unsetFirstUnsplittable(this); + } + if (this[$extra].attempt === maxRun) { + if (!isSplittable) { + delete this[$extra]; + } return HTMLResult.FAILURE; } - let C = 0, - h = 0; + let marginH = 0; + let marginV = 0; if (this.margin) { - C = this.margin.leftInset + this.margin.rightInset; - h = this.margin.topInset + this.margin.bottomInset; + marginH = this.margin.leftInset + this.margin.rightInset; + marginV = this.margin.topInset + this.margin.bottomInset; } - const l = Math.max(this[ar].width + C, this.w || 0), - Q = Math.max(this[ar].height + h, this.h || 0), - E = [this.x, this.y, l, Q]; - "" === this.w && (r.width = measureToString(l)); - "" === this.h && (r.height = measureToString(Q)); - const u = { name: "div", attributes: i, children: t }; - applyAssist(this, i); - delete this[ar]; - return HTMLResult.success(createWrapper(this, u), E); + const width = Math.max(this[$extra].width + marginH, this.w || 0); + const height = Math.max(this[$extra].height + marginV, this.h || 0); + const bbox = [this.x, this.y, width, height]; + if (this.w === "") { + style.width = measureToString(width); + } + if (this.h === "") { + style.height = measureToString(height); + } + const html = { + name: "div", + attributes, + children, + }; + applyAssist(this, attributes); + delete this[$extra]; + return HTMLResult.success(createWrapper(this, html), bbox); } } class Execute extends XFAObject { - constructor(e) { - super(Hn, "execute"); - this.connection = e.connection || ""; - this.executeType = getStringOption(e.executeType, ["import", "remerge"]); - this.id = e.id || ""; - this.runAt = getStringOption(e.runAt, ["client", "both", "server"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "execute"); + this.connection = attributes.connection || ""; + this.executeType = getStringOption(attributes.executeType, [ + "import", + "remerge", + ]); + this.id = attributes.id || ""; + this.runAt = getStringOption(attributes.runAt, [ + "client", + "both", + "server", + ]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Extras extends XFAObject { - constructor(e) { - super(Hn, "extras", !0); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "extras", true); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.boolean = new XFAObjectArray(); this.date = new XFAObjectArray(); this.dateTime = new XFAObjectArray(); @@ -45072,16 +54630,16 @@ class Extras extends XFAObject { } } class Field extends XFAObject { - constructor(e) { - super(Hn, "field", !0); - this.access = getStringOption(e.access, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "field", true); + this.access = getStringOption(attributes.access, [ "open", "nonInteractive", "protected", "readOnly", ]); - this.accessKey = e.accessKey || ""; - this.anchorType = getStringOption(e.anchorType, [ + this.accessKey = attributes.accessKey || ""; + this.anchorType = getStringOption(attributes.anchorType, [ "topLeft", "bottomCenter", "bottomLeft", @@ -45093,12 +54651,12 @@ class Field extends XFAObject { "topRight", ]); this.colSpan = getInteger({ - data: e.colSpan, + data: attributes.colSpan, defaultValue: 1, - validate: (e) => e >= 1 || -1 === e, + validate: (n) => n >= 1 || n === -1, }); - this.h = e.h ? getMeasurement(e.h) : ""; - this.hAlign = getStringOption(e.hAlign, [ + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, [ "left", "center", "justify", @@ -45106,30 +54664,30 @@ class Field extends XFAObject { "radix", "right", ]); - this.id = e.id || ""; - this.locale = e.locale || ""; - this.maxH = getMeasurement(e.maxH, "0pt"); - this.maxW = getMeasurement(e.maxW, "0pt"); - this.minH = getMeasurement(e.minH, "0pt"); - this.minW = getMeasurement(e.minW, "0pt"); - this.name = e.name || ""; - this.presence = getStringOption(e.presence, [ + this.id = attributes.id || ""; + this.locale = attributes.locale || ""; + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, [ "visible", "hidden", "inactive", "invisible", ]); - this.relevant = getRelevant(e.relevant); + this.relevant = getRelevant(attributes.relevant); this.rotate = getInteger({ - data: e.rotate, + data: attributes.rotate, defaultValue: 0, - validate: (e) => e % 90 == 0, + validate: (x) => x % 90 === 0, }); - this.use = e.use || ""; - this.usehref = e.usehref || ""; - this.w = e.w ? getMeasurement(e.w) : ""; - this.x = getMeasurement(e.x, "0pt"); - this.y = getMeasurement(e.y, "0pt"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); this.assist = null; this.bind = null; this.border = null; @@ -45152,135 +54710,128 @@ class Field extends XFAObject { this.event = new XFAObjectArray(); this.setProperty = new XFAObjectArray(); } - [kr]() { - return !0; + [$isBindable]() { + return true; } - [$r](e) { - _setValue(this, e); + [$setValue](value) { + _setValue(this, value); } - [an](e) { + [$toHTML](availableSpace) { setTabIndex(this); if (!this.ui) { this.ui = new Ui({}); - this.ui[yr] = this[yr]; - this[Xs](this.ui); - let e; + this.ui[$globalData] = this[$globalData]; + this[$appendChild](this.ui); + let node; switch (this.items.children.length) { case 0: - e = new TextEdit({}); - this.ui.textEdit = e; + node = new TextEdit({}); + this.ui.textEdit = node; break; case 1: - e = new CheckButton({}); - this.ui.checkButton = e; + node = new CheckButton({}); + this.ui.checkButton = node; break; case 2: - e = new ChoiceList({}); - this.ui.choiceList = e; + node = new ChoiceList({}); + this.ui.choiceList = node; + break; } - this.ui[Xs](e); + this.ui[$appendChild](node); } if ( !this.ui || - "hidden" === this.presence || - "inactive" === this.presence || - 0 === this.h || - 0 === this.w - ) + this.presence === "hidden" || + this.presence === "inactive" || + this.h === 0 || + this.w === 0 + ) { return HTMLResult.EMPTY; - this.caption && delete this.caption[ar]; - this[Wr](); - const t = this.caption ? this.caption[an](e).html : null, - i = this.w, - a = this.h; - let s = 0, - r = 0; - if (this.margin) { - s = this.margin.leftInset + this.margin.rightInset; - r = this.margin.topInset + this.margin.bottomInset; } - let n = null; - if ("" === this.w || "" === this.h) { - let t = null, - i = null, - a = 0, - g = 0; - if (this.ui.checkButton) a = g = this.ui.checkButton.size; - else { - const { w: t, h: i } = layoutNode(this, e); - if (null !== t) { - a = t; - g = i; - } else - g = (function fonts_getMetrics(e, t = !1) { - let i = null; - if (e) { - const t = stripQuotes(e.typeface), - a = e[yr].fontFinder.find(t); - i = selectFont(e, a); - } - if (!i) return { lineHeight: 12, lineGap: 2, lineNoGap: 10 }; - const a = e.size || 10, - s = i.lineHeight ? Math.max(t ? 0 : 1.2, i.lineHeight) : 1.2, - r = void 0 === i.lineGap ? 0.2 : i.lineGap; - return { - lineHeight: s * a, - lineGap: r * a, - lineNoGap: Math.max(1, s - r) * a, - }; - })(this.font, !0).lineNoGap; + if (this.caption) { + delete this.caption[$extra]; + } + this[$pushPara](); + const caption = this.caption + ? this.caption[$toHTML](availableSpace).html + : null; + const savedW = this.w; + const savedH = this.h; + let marginH = 0; + let marginV = 0; + if (this.margin) { + marginH = this.margin.leftInset + this.margin.rightInset; + marginV = this.margin.topInset + this.margin.bottomInset; + } + let borderDims = null; + if (this.w === "" || this.h === "") { + let width = null; + let height = null; + let uiW = 0; + let uiH = 0; + if (this.ui.checkButton) { + uiW = uiH = this.ui.checkButton.size; + } else { + const { w, h } = layoutNode(this, availableSpace); + if (w !== null) { + uiW = w; + uiH = h; + } else { + uiH = fonts_getMetrics(this.font, true).lineNoGap; + } } - n = getBorderDims(this.ui[lr]()); - a += n.w; - g += n.h; + borderDims = getBorderDims(this.ui[$getExtra]()); + uiW += borderDims.w; + uiH += borderDims.h; if (this.caption) { - const { w: s, h: r, isBroken: n } = this.caption[lr](e); - if (n && this[fr]()[Ur]()) { - this[Pr](); + const { w, h, isBroken } = this.caption[$getExtra](availableSpace); + if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) { + this[$popPara](); return HTMLResult.FAILURE; } - t = s; - i = r; + width = w; + height = h; switch (this.caption.placement) { case "left": case "right": case "inline": - t += a; + width += uiW; break; case "top": case "bottom": - i += g; + height += uiH; + break; } } else { - t = a; - i = g; + width = uiW; + height = uiH; } - if (t && "" === this.w) { - t += s; + if (width && this.w === "") { + width += marginH; this.w = Math.min( - this.maxW <= 0 ? 1 / 0 : this.maxW, - this.minW + 1 < t ? t : this.minW, + this.maxW <= 0 ? Infinity : this.maxW, + this.minW + 1 < width ? width : this.minW, ); } - if (i && "" === this.h) { - i += r; + if (height && this.h === "") { + height += marginV; this.h = Math.min( - this.maxH <= 0 ? 1 / 0 : this.maxH, - this.minH + 1 < i ? i : this.minH, + this.maxH <= 0 ? Infinity : this.maxH, + this.minH + 1 < height ? height : this.minH, ); } } - this[Pr](); + this[$popPara](); fixDimensions(this); setFirstUnsplittable(this); - if (!checkDimensions(this, e)) { - this.w = i; - this.h = a; - this[Pr](); + if (!checkDimensions(this, availableSpace)) { + this.w = savedW; + this.h = savedH; + this[$popPara](); return HTMLResult.FAILURE; } unsetFirstUnsplittable(this); - const g = toStyle( + const style = toStyle( this, "font", "dimensions", @@ -45291,118 +54842,167 @@ class Field extends XFAObject { "margin", "hAlign", ); - setMinMaxDimensions(this, g); - const o = ["xfaField"]; - this.font && o.push("xfaFont"); - isPrintOnly(this) && o.push("xfaPrintOnly"); - const c = { style: g, id: this[nn], class: o }; - if (g.margin) { - g.padding = g.margin; - delete g.margin; + setMinMaxDimensions(this, style); + const classNames = ["xfaField"]; + if (this.font) { + classNames.push("xfaFont"); } - setAccess(this, o); - this.name && (c.xfaName = this.name); - const C = [], - h = { name: "div", attributes: c, children: C }; - applyAssist(this, c); - const l = this.border ? this.border[rn]() : null, - Q = computeBbox(this, h, e), - E = this.ui[an]().html; - if (!E) { - Object.assign(g, l); - return HTMLResult.success(createWrapper(this, h), Q); + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); } - this[An] && - (E.children?.[0] - ? (E.children[0].attributes.tabindex = this[An]) - : (E.attributes.tabindex = this[An])); - E.attributes.style || (E.attributes.style = Object.create(null)); - let u = null; + const attributes = { + style, + id: this[$uid], + class: classNames, + }; + if (style.margin) { + style.padding = style.margin; + delete style.margin; + } + setAccess(this, classNames); + if (this.name) { + attributes.xfaName = this.name; + } + const children = []; + const html = { + name: "div", + attributes, + children, + }; + applyAssist(this, attributes); + const borderStyle = this.border ? this.border[$toStyle]() : null; + const bbox = computeBbox(this, html, availableSpace); + const ui = this.ui[$toHTML]().html; + if (!ui) { + Object.assign(style, borderStyle); + return HTMLResult.success(createWrapper(this, html), bbox); + } + if (this[$tabIndex]) { + if (ui.children?.[0]) { + ui.children[0].attributes.tabindex = this[$tabIndex]; + } else { + ui.attributes.tabindex = this[$tabIndex]; + } + } + if (!ui.attributes.style) { + ui.attributes.style = Object.create(null); + } + let aElement = null; if (this.ui.button) { - 1 === E.children.length && ([u] = E.children.splice(0, 1)); - Object.assign(E.attributes.style, l); - } else Object.assign(g, l); - C.push(E); - if (this.value) - if (this.ui.imageEdit) E.children.push(this.value[an]().html); - else if (!this.ui.button) { - let e = ""; - if (this.value.exData) e = this.value.exData[en](); - else if (this.value.text) e = this.value.text[lr](); - else { - const t = this.value[an]().html; - null !== t && (e = t.children[0].value); - } - this.ui.textEdit && - this.value.text?.maxChars && - (E.children[0].attributes.maxLength = this.value.text.maxChars); - if (e) { - if (this.ui.numericEdit) { - e = parseFloat(e); - e = isNaN(e) ? "" : e.toString(); + if (ui.children.length === 1) { + [aElement] = ui.children.splice(0, 1); + } + Object.assign(ui.attributes.style, borderStyle); + } else { + Object.assign(style, borderStyle); + } + children.push(ui); + if (this.value) { + if (this.ui.imageEdit) { + ui.children.push(this.value[$toHTML]().html); + } else if (!this.ui.button) { + let value = ""; + if (this.value.exData) { + value = this.value.exData[$text](); + } else if (this.value.text) { + value = this.value.text[$getExtra](); + } else { + const htmlValue = this.value[$toHTML]().html; + if (htmlValue !== null) { + value = htmlValue.children[0].value; + } + } + if (this.ui.textEdit && this.value.text?.maxChars) { + ui.children[0].attributes.maxLength = this.value.text.maxChars; + } + if (value) { + if (this.ui.numericEdit) { + value = parseFloat(value); + value = isNaN(value) ? "" : value.toString(); + } + if (ui.children[0].name === "textarea") { + ui.children[0].attributes.textContent = value; + } else { + ui.children[0].attributes.value = value; } - "textarea" === E.children[0].name - ? (E.children[0].attributes.textContent = e) - : (E.children[0].attributes.value = e); } } - if (!this.ui.imageEdit && E.children?.[0] && this.h) { - n = n || getBorderDims(this.ui[lr]()); - let t = 0; - if (this.caption && ["top", "bottom"].includes(this.caption.placement)) { - t = this.caption.reserve; - t <= 0 && (t = this.caption[lr](e).h); - const i = this.h - t - r - n.h; - E.children[0].attributes.style.height = measureToString(i); - } else E.children[0].attributes.style.height = "100%"; } - u && E.children.push(u); - if (!t) { - E.attributes.class && E.attributes.class.push("xfaLeft"); - this.w = i; - this.h = a; - return HTMLResult.success(createWrapper(this, h), Q); + if (!this.ui.imageEdit && ui.children?.[0] && this.h) { + borderDims = borderDims || getBorderDims(this.ui[$getExtra]()); + let captionHeight = 0; + if (this.caption && ["top", "bottom"].includes(this.caption.placement)) { + captionHeight = this.caption.reserve; + if (captionHeight <= 0) { + captionHeight = this.caption[$getExtra](availableSpace).h; + } + const inputHeight = this.h - captionHeight - marginV - borderDims.h; + ui.children[0].attributes.style.height = measureToString(inputHeight); + } else { + ui.children[0].attributes.style.height = "100%"; + } + } + if (aElement) { + ui.children.push(aElement); + } + if (!caption) { + if (ui.attributes.class) { + ui.attributes.class.push("xfaLeft"); + } + this.w = savedW; + this.h = savedH; + return HTMLResult.success(createWrapper(this, html), bbox); } if (this.ui.button) { - g.padding && delete g.padding; - "div" === t.name && (t.name = "span"); - E.children.push(t); - return HTMLResult.success(h, Q); + if (style.padding) { + delete style.padding; + } + if (caption.name === "div") { + caption.name = "span"; + } + ui.children.push(caption); + return HTMLResult.success(html, bbox); + } else if (this.ui.checkButton) { + caption.attributes.class[0] = "xfaCaptionForCheckButton"; } - this.ui.checkButton && (t.attributes.class[0] = "xfaCaptionForCheckButton"); - E.attributes.class || (E.attributes.class = []); - E.children.splice(0, 0, t); + if (!ui.attributes.class) { + ui.attributes.class = []; + } + ui.children.splice(0, 0, caption); switch (this.caption.placement) { case "left": - case "inline": - E.attributes.class.push("xfaLeft"); + ui.attributes.class.push("xfaLeft"); break; case "right": - E.attributes.class.push("xfaRight"); + ui.attributes.class.push("xfaRight"); break; case "top": - E.attributes.class.push("xfaTop"); + ui.attributes.class.push("xfaTop"); break; case "bottom": - E.attributes.class.push("xfaBottom"); + ui.attributes.class.push("xfaBottom"); + break; + case "inline": + ui.attributes.class.push("xfaLeft"); + break; } - this.w = i; - this.h = a; - return HTMLResult.success(createWrapper(this, h), Q); + this.w = savedW; + this.h = savedH; + return HTMLResult.success(createWrapper(this, html), bbox); } } class Fill extends XFAObject { - constructor(e) { - super(Hn, "fill", !0); - this.id = e.id || ""; - this.presence = getStringOption(e.presence, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "fill", true); + this.id = attributes.id || ""; + this.presence = getStringOption(attributes.presence, [ "visible", "hidden", "inactive", "invisible", ]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.color = null; this.extras = null; this.linear = null; @@ -45411,53 +55011,62 @@ class Fill extends XFAObject { this.solid = null; this.stipple = null; } - [rn]() { - const e = this[pr](), - t = e[pr]()[pr](), - i = Object.create(null); - let a = "color", - s = a; - if (e instanceof Border) { - a = "background-color"; - s = "background"; - t instanceof Ui && (i.backgroundColor = "white"); + [$toStyle]() { + const parent = this[$getParent](); + const grandpa = parent[$getParent](); + const ggrandpa = grandpa[$getParent](); + const style = Object.create(null); + let propName = "color"; + let altPropName = propName; + if (parent instanceof Border) { + propName = "background-color"; + altPropName = "background"; + if (ggrandpa instanceof Ui) { + style.backgroundColor = "white"; + } } - if (e instanceof Rectangle || e instanceof Arc) { - a = s = "fill"; - i.fill = "white"; + if (parent instanceof Rectangle || parent instanceof Arc) { + propName = altPropName = "fill"; + style.fill = "white"; } - for (const e of Object.getOwnPropertyNames(this)) { - if ("extras" === e || "color" === e) continue; - const t = this[e]; - if (!(t instanceof XFAObject)) continue; - const r = t[rn](this.color); - r && (i[r.startsWith("#") ? a : s] = r); - return i; + for (const name of Object.getOwnPropertyNames(this)) { + if (name === "extras" || name === "color") { + continue; + } + const obj = this[name]; + if (!(obj instanceof XFAObject)) { + continue; + } + const color = obj[$toStyle](this.color); + if (color) { + style[color.startsWith("#") ? propName : altPropName] = color; + } + return style; } if (this.color?.value) { - const e = this.color[rn](); - i[e.startsWith("#") ? a : s] = e; + const color = this.color[$toStyle](); + style[color.startsWith("#") ? propName : altPropName] = color; } - return i; + return style; } } class Filter extends XFAObject { - constructor(e) { - super(Hn, "filter", !0); - this.addRevocationInfo = getStringOption(e.addRevocationInfo, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "filter", true); + this.addRevocationInfo = getStringOption(attributes.addRevocationInfo, [ "", "required", "optional", "none", ]); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.version = getInteger({ data: this.version, defaultValue: 5, - validate: (e) => e >= 1 && e <= 5, + validate: (x) => x >= 1 && x <= 5, }); this.appearanceFilter = null; this.certificates = null; @@ -45472,290 +55081,342 @@ class Filter extends XFAObject { } } class Float extends ContentObject { - constructor(e) { - super(Hn, "float"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "float"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } - [sr]() { - const e = parseFloat(this[er].trim()); - this[er] = isNaN(e) ? null : e; + [$finalize]() { + const number = parseFloat(this[$content].trim()); + this[$content] = isNaN(number) ? null : number; } - [an](e) { - return valueToHtml(null !== this[er] ? this[er].toString() : ""); + [$toHTML](availableSpace) { + return valueToHtml( + this[$content] !== null ? this[$content].toString() : "", + ); } } class template_Font extends XFAObject { - constructor(e) { - super(Hn, "font", !0); - this.baselineShift = getMeasurement(e.baselineShift); + constructor(attributes) { + super(TEMPLATE_NS_ID, "font", true); + this.baselineShift = getMeasurement(attributes.baselineShift); this.fontHorizontalScale = getFloat({ - data: e.fontHorizontalScale, + data: attributes.fontHorizontalScale, defaultValue: 100, - validate: (e) => e >= 0, + validate: (x) => x >= 0, }); this.fontVerticalScale = getFloat({ - data: e.fontVerticalScale, + data: attributes.fontVerticalScale, defaultValue: 100, - validate: (e) => e >= 0, + validate: (x) => x >= 0, }); - this.id = e.id || ""; - this.kerningMode = getStringOption(e.kerningMode, ["none", "pair"]); - this.letterSpacing = getMeasurement(e.letterSpacing, "0"); + this.id = attributes.id || ""; + this.kerningMode = getStringOption(attributes.kerningMode, [ + "none", + "pair", + ]); + this.letterSpacing = getMeasurement(attributes.letterSpacing, "0"); this.lineThrough = getInteger({ - data: e.lineThrough, + data: attributes.lineThrough, defaultValue: 0, - validate: (e) => 1 === e || 2 === e, + validate: (x) => x === 1 || x === 2, }); - this.lineThroughPeriod = getStringOption(e.lineThroughPeriod, [ + this.lineThroughPeriod = getStringOption(attributes.lineThroughPeriod, [ "all", "word", ]); this.overline = getInteger({ - data: e.overline, + data: attributes.overline, defaultValue: 0, - validate: (e) => 1 === e || 2 === e, + validate: (x) => x === 1 || x === 2, }); - this.overlinePeriod = getStringOption(e.overlinePeriod, ["all", "word"]); - this.posture = getStringOption(e.posture, ["normal", "italic"]); - this.size = getMeasurement(e.size, "10pt"); - this.typeface = e.typeface || "Courier"; + this.overlinePeriod = getStringOption(attributes.overlinePeriod, [ + "all", + "word", + ]); + this.posture = getStringOption(attributes.posture, ["normal", "italic"]); + this.size = getMeasurement(attributes.size, "10pt"); + this.typeface = attributes.typeface || "Courier"; this.underline = getInteger({ - data: e.underline, + data: attributes.underline, defaultValue: 0, - validate: (e) => 1 === e || 2 === e, + validate: (x) => x === 1 || x === 2, }); - this.underlinePeriod = getStringOption(e.underlinePeriod, ["all", "word"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; - this.weight = getStringOption(e.weight, ["normal", "bold"]); + this.underlinePeriod = getStringOption(attributes.underlinePeriod, [ + "all", + "word", + ]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.weight = getStringOption(attributes.weight, ["normal", "bold"]); this.extras = null; this.fill = null; } - [Vs](e) { - super[Vs](e); - this[yr].usedTypefaces.add(this.typeface); + [$clean](builder) { + super[$clean](builder); + this[$globalData].usedTypefaces.add(this.typeface); } - [rn]() { - const e = toStyle(this, "fill"), - t = e.color; - if (t) - if ("#000000" === t) delete e.color; - else if (!t.startsWith("#")) { - e.background = t; - e.backgroundClip = "text"; - e.color = "transparent"; + [$toStyle]() { + const style = toStyle(this, "fill"); + const color = style.color; + if (color) { + if (color === "#000000") { + delete style.color; + } else if (!color.startsWith("#")) { + style.background = color; + style.backgroundClip = "text"; + style.color = "transparent"; } - this.baselineShift && - (e.verticalAlign = measureToString(this.baselineShift)); - e.fontKerning = "none" === this.kerningMode ? "none" : "normal"; - e.letterSpacing = measureToString(this.letterSpacing); - if (0 !== this.lineThrough) { - e.textDecoration = "line-through"; - 2 === this.lineThrough && (e.textDecorationStyle = "double"); } - if (0 !== this.overline) { - e.textDecoration = "overline"; - 2 === this.overline && (e.textDecorationStyle = "double"); + if (this.baselineShift) { + style.verticalAlign = measureToString(this.baselineShift); } - e.fontStyle = this.posture; - e.fontSize = measureToString(0.99 * this.size); - setFontFamily(this, this, this[yr].fontFinder, e); - if (0 !== this.underline) { - e.textDecoration = "underline"; - 2 === this.underline && (e.textDecorationStyle = "double"); + style.fontKerning = this.kerningMode === "none" ? "none" : "normal"; + style.letterSpacing = measureToString(this.letterSpacing); + if (this.lineThrough !== 0) { + style.textDecoration = "line-through"; + if (this.lineThrough === 2) { + style.textDecorationStyle = "double"; + } } - e.fontWeight = this.weight; - return e; + if (this.overline !== 0) { + style.textDecoration = "overline"; + if (this.overline === 2) { + style.textDecorationStyle = "double"; + } + } + style.fontStyle = this.posture; + style.fontSize = measureToString(0.99 * this.size); + setFontFamily(this, this, this[$globalData].fontFinder, style); + if (this.underline !== 0) { + style.textDecoration = "underline"; + if (this.underline === 2) { + style.textDecorationStyle = "double"; + } + } + style.fontWeight = this.weight; + return style; } } class Format extends XFAObject { - constructor(e) { - super(Hn, "format", !0); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "format", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; this.picture = null; } } class Handler extends StringObject { - constructor(e) { - super(Hn, "handler"); - this.id = e.id || ""; - this.type = getStringOption(e.type, ["optional", "required"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "handler"); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Hyphenation extends XFAObject { - constructor(e) { - super(Hn, "hyphenation"); + constructor(attributes) { + super(TEMPLATE_NS_ID, "hyphenation"); this.excludeAllCaps = getInteger({ - data: e.excludeAllCaps, + data: attributes.excludeAllCaps, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); this.excludeInitialCap = getInteger({ - data: e.excludeInitialCap, + data: attributes.excludeInitialCap, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); this.hyphenate = getInteger({ - data: e.hyphenate, + data: attributes.hyphenate, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); - this.id = e.id || ""; + this.id = attributes.id || ""; this.pushCharacterCount = getInteger({ - data: e.pushCharacterCount, + data: attributes.pushCharacterCount, defaultValue: 3, - validate: (e) => e >= 0, + validate: (x) => x >= 0, }); this.remainCharacterCount = getInteger({ - data: e.remainCharacterCount, + data: attributes.remainCharacterCount, defaultValue: 3, - validate: (e) => e >= 0, + validate: (x) => x >= 0, }); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.wordCharacterCount = getInteger({ - data: e.wordCharacterCount, + data: attributes.wordCharacterCount, defaultValue: 7, - validate: (e) => e >= 0, + validate: (x) => x >= 0, }); } } class Image extends StringObject { - constructor(e) { - super(Hn, "image"); - this.aspect = getStringOption(e.aspect, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "image"); + this.aspect = getStringOption(attributes.aspect, [ "fit", "actual", "height", "none", "width", ]); - this.contentType = e.contentType || ""; - this.href = e.href || ""; - this.id = e.id || ""; - this.name = e.name || ""; - this.transferEncoding = getStringOption(e.transferEncoding, [ + this.contentType = attributes.contentType || ""; + this.href = attributes.href || ""; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.transferEncoding = getStringOption(attributes.transferEncoding, [ "base64", "none", "package", ]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } - [an]() { - if (this.contentType && !vn.has(this.contentType.toLowerCase())) + [$toHTML]() { + if (this.contentType && !MIMES.has(this.contentType.toLowerCase())) { return HTMLResult.EMPTY; - let e = this[yr].images && this[yr].images.get(this.href); - if (!e && (this.href || !this[er])) return HTMLResult.EMPTY; - e || - "base64" !== this.transferEncoding || - (e = stringToBytes(atob(this[er]))); - if (!e) return HTMLResult.EMPTY; + } + let buffer = + this[$globalData].images && this[$globalData].images.get(this.href); + if (!buffer && (this.href || !this[$content])) { + return HTMLResult.EMPTY; + } + if (!buffer && this.transferEncoding === "base64") { + buffer = fromBase64Util(this[$content]); + } + if (!buffer) { + return HTMLResult.EMPTY; + } if (!this.contentType) { - for (const [t, i] of Kn) - if (e.length > t.length && t.every((t, i) => t === e[i])) { - this.contentType = i; + for (const [header, type] of IMAGES_HEADERS) { + if ( + buffer.length > header.length && + header.every((x, i) => x === buffer[i]) + ) { + this.contentType = type; break; } - if (!this.contentType) return HTMLResult.EMPTY; + } + if (!this.contentType) { + return HTMLResult.EMPTY; + } } - const t = new Blob([e], { type: this.contentType }); - let i; + const blob = new Blob([buffer], { + type: this.contentType, + }); + let style; switch (this.aspect) { case "fit": case "actual": break; case "height": - i = { height: "100%", objectFit: "fill" }; + style = { + height: "100%", + objectFit: "fill", + }; break; case "none": - i = { width: "100%", height: "100%", objectFit: "fill" }; + style = { + width: "100%", + height: "100%", + objectFit: "fill", + }; break; case "width": - i = { width: "100%", objectFit: "fill" }; + style = { + width: "100%", + objectFit: "fill", + }; + break; } - const a = this[pr](); + const parent = this[$getParent](); return HTMLResult.success({ name: "img", attributes: { class: ["xfaImage"], - style: i, - src: URL.createObjectURL(t), - alt: a ? ariaLabel(a[pr]()) : null, + style, + src: URL.createObjectURL(blob), + alt: parent ? ariaLabel(parent[$getParent]()) : null, }, }); } } class ImageEdit extends XFAObject { - constructor(e) { - super(Hn, "imageEdit", !0); - this.data = getStringOption(e.data, ["link", "embed"]); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "imageEdit", true); + this.data = getStringOption(attributes.data, ["link", "embed"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.border = null; this.extras = null; this.margin = null; } - [an](e) { - return "embed" === this.data - ? HTMLResult.success({ name: "div", children: [], attributes: {} }) - : HTMLResult.EMPTY; + [$toHTML](availableSpace) { + if (this.data === "embed") { + return HTMLResult.success({ + name: "div", + children: [], + attributes: {}, + }); + } + return HTMLResult.EMPTY; } } class Integer extends ContentObject { - constructor(e) { - super(Hn, "integer"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "integer"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } - [sr]() { - const e = parseInt(this[er].trim(), 10); - this[er] = isNaN(e) ? null : e; + [$finalize]() { + const number = parseInt(this[$content].trim(), 10); + this[$content] = isNaN(number) ? null : number; } - [an](e) { - return valueToHtml(null !== this[er] ? this[er].toString() : ""); + [$toHTML](availableSpace) { + return valueToHtml( + this[$content] !== null ? this[$content].toString() : "", + ); } } class Issuers extends XFAObject { - constructor(e) { - super(Hn, "issuers", !0); - this.id = e.id || ""; - this.type = getStringOption(e.type, ["optional", "required"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "issuers", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.certificate = new XFAObjectArray(); } } class Items extends XFAObject { - constructor(e) { - super(Hn, "items", !0); - this.id = e.id || ""; - this.name = e.name || ""; - this.presence = getStringOption(e.presence, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "items", true); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, [ "visible", "hidden", "inactive", "invisible", ]); - this.ref = e.ref || ""; + this.ref = attributes.ref || ""; this.save = getInteger({ - data: e.save, + data: attributes.save, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.boolean = new XFAObjectArray(); this.date = new XFAObjectArray(); this.dateTime = new XFAObjectArray(); @@ -45767,162 +55428,187 @@ class Items extends XFAObject { this.text = new XFAObjectArray(); this.time = new XFAObjectArray(); } - [an]() { - const e = []; - for (const t of this[Er]()) e.push(t[en]()); - return HTMLResult.success(e); + [$toHTML]() { + const output = []; + for (const child of this[$getChildren]()) { + output.push(child[$text]()); + } + return HTMLResult.success(output); } } class Keep extends XFAObject { - constructor(e) { - super(Hn, "keep", !0); - this.id = e.id || ""; - const t = ["none", "contentArea", "pageArea"]; - this.intact = getStringOption(e.intact, t); - this.next = getStringOption(e.next, t); - this.previous = getStringOption(e.previous, t); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "keep", true); + this.id = attributes.id || ""; + const options = ["none", "contentArea", "pageArea"]; + this.intact = getStringOption(attributes.intact, options); + this.next = getStringOption(attributes.next, options); + this.previous = getStringOption(attributes.previous, options); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; } } class KeyUsage extends XFAObject { - constructor(e) { - super(Hn, "keyUsage"); - const t = ["", "yes", "no"]; - this.crlSign = getStringOption(e.crlSign, t); - this.dataEncipherment = getStringOption(e.dataEncipherment, t); - this.decipherOnly = getStringOption(e.decipherOnly, t); - this.digitalSignature = getStringOption(e.digitalSignature, t); - this.encipherOnly = getStringOption(e.encipherOnly, t); - this.id = e.id || ""; - this.keyAgreement = getStringOption(e.keyAgreement, t); - this.keyCertSign = getStringOption(e.keyCertSign, t); - this.keyEncipherment = getStringOption(e.keyEncipherment, t); - this.nonRepudiation = getStringOption(e.nonRepudiation, t); - this.type = getStringOption(e.type, ["optional", "required"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "keyUsage"); + const options = ["", "yes", "no"]; + this.crlSign = getStringOption(attributes.crlSign, options); + this.dataEncipherment = getStringOption( + attributes.dataEncipherment, + options, + ); + this.decipherOnly = getStringOption(attributes.decipherOnly, options); + this.digitalSignature = getStringOption( + attributes.digitalSignature, + options, + ); + this.encipherOnly = getStringOption(attributes.encipherOnly, options); + this.id = attributes.id || ""; + this.keyAgreement = getStringOption(attributes.keyAgreement, options); + this.keyCertSign = getStringOption(attributes.keyCertSign, options); + this.keyEncipherment = getStringOption(attributes.keyEncipherment, options); + this.nonRepudiation = getStringOption(attributes.nonRepudiation, options); + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Line extends XFAObject { - constructor(e) { - super(Hn, "line", !0); - this.hand = getStringOption(e.hand, ["even", "left", "right"]); - this.id = e.id || ""; - this.slope = getStringOption(e.slope, ["\\", "/"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "line", true); + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; + this.slope = getStringOption(attributes.slope, ["\\", "/"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.edge = null; } - [an]() { - const e = this[pr]()[pr](), - t = this.edge || new Edge({}), - i = t[rn](), - a = Object.create(null), - s = "visible" === t.presence ? t.thickness : 0; - a.strokeWidth = measureToString(s); - a.stroke = i.color; - let r, - n, - g, - o, - c = "100%", - C = "100%"; - if (e.w <= s) { - [r, n, g, o] = ["50%", 0, "50%", "100%"]; - c = a.strokeWidth; - } else if (e.h <= s) { - [r, n, g, o] = [0, "50%", "100%", "50%"]; - C = a.strokeWidth; - } else - "\\" === this.slope - ? ([r, n, g, o] = [0, 0, "100%", "100%"]) - : ([r, n, g, o] = [0, "100%", "100%", 0]); - const h = { - name: "svg", - children: [ - { - name: "line", - attributes: { xmlns: Jn, x1: r, y1: n, x2: g, y2: o, style: a }, - }, - ], + [$toHTML]() { + const parent = this[$getParent]()[$getParent](); + const edge = this.edge || new Edge({}); + const edgeStyle = edge[$toStyle](); + const style = Object.create(null); + const thickness = edge.presence === "visible" ? edge.thickness : 0; + style.strokeWidth = measureToString(thickness); + style.stroke = edgeStyle.color; + let x1, y1, x2, y2; + let width = "100%"; + let height = "100%"; + if (parent.w <= thickness) { + [x1, y1, x2, y2] = ["50%", 0, "50%", "100%"]; + width = style.strokeWidth; + } else if (parent.h <= thickness) { + [x1, y1, x2, y2] = [0, "50%", "100%", "50%"]; + height = style.strokeWidth; + } else if (this.slope === "\\") { + [x1, y1, x2, y2] = [0, 0, "100%", "100%"]; + } else { + [x1, y1, x2, y2] = [0, "100%", "100%", 0]; + } + const line = { + name: "line", attributes: { - xmlns: Jn, - width: c, - height: C, - style: { overflow: "visible" }, + xmlns: SVG_NS, + x1, + y1, + x2, + y2, + style, }, }; - if (hasMargin(e)) + const svg = { + name: "svg", + children: [line], + attributes: { + xmlns: SVG_NS, + width, + height, + style: { + overflow: "visible", + }, + }, + }; + if (hasMargin(parent)) { return HTMLResult.success({ name: "div", attributes: { - style: { display: "inline", width: "100%", height: "100%" }, + style: { + display: "inline", + width: "100%", + height: "100%", + }, }, - children: [h], + children: [svg], }); - h.attributes.style.position = "absolute"; - return HTMLResult.success(h); + } + svg.attributes.style.position = "absolute"; + return HTMLResult.success(svg); } } class Linear extends XFAObject { - constructor(e) { - super(Hn, "linear", !0); - this.id = e.id || ""; - this.type = getStringOption(e.type, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "linear", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, [ "toRight", "toBottom", "toLeft", "toTop", ]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.color = null; this.extras = null; } - [rn](e) { - e = e ? e[rn]() : "#FFFFFF"; - return `linear-gradient(${this.type.replace(/([RBLT])/, " $1").toLowerCase()}, ${e}, ${this.color ? this.color[rn]() : "#000000"})`; + [$toStyle](startColor) { + startColor = startColor ? startColor[$toStyle]() : "#FFFFFF"; + const transf = this.type.replace(/([RBLT])/, " $1").toLowerCase(); + const endColor = this.color ? this.color[$toStyle]() : "#000000"; + return `linear-gradient(${transf}, ${startColor}, ${endColor})`; } } class LockDocument extends ContentObject { - constructor(e) { - super(Hn, "lockDocument"); - this.id = e.id || ""; - this.type = getStringOption(e.type, ["optional", "required"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "lockDocument"); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } - [sr]() { - this[er] = getStringOption(this[er], ["auto", "0", "1"]); + [$finalize]() { + this[$content] = getStringOption(this[$content], ["auto", "0", "1"]); } } class Manifest extends XFAObject { - constructor(e) { - super(Hn, "manifest", !0); - this.action = getStringOption(e.action, ["include", "all", "exclude"]); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "manifest", true); + this.action = getStringOption(attributes.action, [ + "include", + "all", + "exclude", + ]); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; this.ref = new XFAObjectArray(); } } class Margin extends XFAObject { - constructor(e) { - super(Hn, "margin", !0); - this.bottomInset = getMeasurement(e.bottomInset, "0"); - this.id = e.id || ""; - this.leftInset = getMeasurement(e.leftInset, "0"); - this.rightInset = getMeasurement(e.rightInset, "0"); - this.topInset = getMeasurement(e.topInset, "0"); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "margin", true); + this.bottomInset = getMeasurement(attributes.bottomInset, "0"); + this.id = attributes.id || ""; + this.leftInset = getMeasurement(attributes.leftInset, "0"); + this.rightInset = getMeasurement(attributes.rightInset, "0"); + this.topInset = getMeasurement(attributes.topInset, "0"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; } - [rn]() { + [$toStyle]() { return { margin: measureToString(this.topInset) + @@ -45936,214 +55622,234 @@ class Margin extends XFAObject { } } class Mdp extends XFAObject { - constructor(e) { - super(Hn, "mdp"); - this.id = e.id || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "mdp"); + this.id = attributes.id || ""; this.permissions = getInteger({ - data: e.permissions, + data: attributes.permissions, defaultValue: 2, - validate: (e) => 1 === e || 3 === e, + validate: (x) => x === 1 || x === 3, }); - this.signatureType = getStringOption(e.signatureType, ["filler", "author"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.signatureType = getStringOption(attributes.signatureType, [ + "filler", + "author", + ]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Medium extends XFAObject { - constructor(e) { - super(Hn, "medium"); - this.id = e.id || ""; - this.imagingBBox = (function getBBox(e) { - const t = -1; - if (!e) return { x: t, y: t, width: t, height: t }; - const i = e - .trim() - .split(/\s*,\s*/) - .map((e) => getMeasurement(e, "-1")); - if (i.length < 4 || i[2] < 0 || i[3] < 0) - return { x: t, y: t, width: t, height: t }; - const [a, s, r, n] = i; - return { x: a, y: s, width: r, height: n }; - })(e.imagingBBox); - this.long = getMeasurement(e.long); - this.orientation = getStringOption(e.orientation, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "medium"); + this.id = attributes.id || ""; + this.imagingBBox = getBBox(attributes.imagingBBox); + this.long = getMeasurement(attributes.long); + this.orientation = getStringOption(attributes.orientation, [ "portrait", "landscape", ]); - this.short = getMeasurement(e.short); - this.stock = e.stock || ""; - this.trayIn = getStringOption(e.trayIn, ["auto", "delegate", "pageFront"]); - this.trayOut = getStringOption(e.trayOut, ["auto", "delegate"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.short = getMeasurement(attributes.short); + this.stock = attributes.stock || ""; + this.trayIn = getStringOption(attributes.trayIn, [ + "auto", + "delegate", + "pageFront", + ]); + this.trayOut = getStringOption(attributes.trayOut, ["auto", "delegate"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Message extends XFAObject { - constructor(e) { - super(Hn, "message", !0); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "message", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.text = new XFAObjectArray(); } } class NumericEdit extends XFAObject { - constructor(e) { - super(Hn, "numericEdit", !0); - this.hScrollPolicy = getStringOption(e.hScrollPolicy, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "numericEdit", true); + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, [ "auto", "off", "on", ]); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.border = null; this.comb = null; this.extras = null; this.margin = null; } - [an](e) { - const t = toStyle(this, "border", "font", "margin"), - i = this[pr]()[pr](), - a = { - name: "input", - attributes: { - type: "text", - fieldId: i[nn], - dataId: i[tr]?.[nn] || i[nn], - class: ["xfaTextfield"], - style: t, - "aria-label": ariaLabel(i), - "aria-required": !1, - }, - }; - if (isRequired(i)) { - a.attributes["aria-required"] = !0; - a.attributes.required = !0; + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "font", "margin"); + const field = this[$getParent]()[$getParent](); + const html = { + name: "input", + attributes: { + type: "text", + fieldId: field[$uid], + dataId: field[$data]?.[$uid] || field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false, + }, + }; + if (isRequired(field)) { + html.attributes["aria-required"] = true; + html.attributes.required = true; } return HTMLResult.success({ name: "label", - attributes: { class: ["xfaLabel"] }, - children: [a], + attributes: { + class: ["xfaLabel"], + }, + children: [html], }); } } class Occur extends XFAObject { - constructor(e) { - super(Hn, "occur", !0); - this.id = e.id || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "occur", true); + this.id = attributes.id || ""; this.initial = - "" !== e.initial - ? getInteger({ data: e.initial, defaultValue: "", validate: (e) => !0 }) + attributes.initial !== "" + ? getInteger({ + data: attributes.initial, + defaultValue: "", + validate: (x) => true, + }) : ""; this.max = - "" !== e.max - ? getInteger({ data: e.max, defaultValue: 1, validate: (e) => !0 }) + attributes.max !== "" + ? getInteger({ + data: attributes.max, + defaultValue: 1, + validate: (x) => true, + }) : ""; this.min = - "" !== e.min - ? getInteger({ data: e.min, defaultValue: 1, validate: (e) => !0 }) + attributes.min !== "" + ? getInteger({ + data: attributes.min, + defaultValue: 1, + validate: (x) => true, + }) : ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; } - [Vs]() { - const e = this[pr](), - t = this.min; - "" === this.min && - (this.min = e instanceof PageArea || e instanceof PageSet ? 0 : 1); - "" === this.max && - (this.max = - "" === t - ? e instanceof PageArea || e instanceof PageSet - ? -1 - : 1 - : this.min); - -1 !== this.max && this.max < this.min && (this.max = this.min); - "" === this.initial && - (this.initial = e instanceof Template ? 1 : this.min); + [$clean]() { + const parent = this[$getParent](); + const originalMin = this.min; + if (this.min === "") { + this.min = + parent instanceof PageArea || parent instanceof PageSet ? 0 : 1; + } + if (this.max === "") { + if (originalMin === "") { + this.max = + parent instanceof PageArea || parent instanceof PageSet ? -1 : 1; + } else { + this.max = this.min; + } + } + if (this.max !== -1 && this.max < this.min) { + this.max = this.min; + } + if (this.initial === "") { + this.initial = parent instanceof Template ? 1 : this.min; + } } } class Oid extends StringObject { - constructor(e) { - super(Hn, "oid"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "oid"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Oids extends XFAObject { - constructor(e) { - super(Hn, "oids", !0); - this.id = e.id || ""; - this.type = getStringOption(e.type, ["optional", "required"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "oids", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.oid = new XFAObjectArray(); } } class Overflow extends XFAObject { - constructor(e) { - super(Hn, "overflow"); - this.id = e.id || ""; - this.leader = e.leader || ""; - this.target = e.target || ""; - this.trailer = e.trailer || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "overflow"); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; + this.target = attributes.target || ""; + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } - [lr]() { - if (!this[ar]) { - const e = this[pr](), - t = this[mr](), - i = t[Vr](this.target, e), - a = t[Vr](this.leader, e), - s = t[Vr](this.trailer, e); - this[ar] = { - target: i?.[0] || null, - leader: a?.[0] || null, - trailer: s?.[0] || null, - addLeader: !1, - addTrailer: !1, + [$getExtra]() { + if (!this[$extra]) { + const parent = this[$getParent](); + const root = this[$getTemplateRoot](); + const target = root[$searchNode](this.target, parent); + const leader = root[$searchNode](this.leader, parent); + const trailer = root[$searchNode](this.trailer, parent); + this[$extra] = { + target: target?.[0] || null, + leader: leader?.[0] || null, + trailer: trailer?.[0] || null, + addLeader: false, + addTrailer: false, }; } - return this[ar]; + return this[$extra]; } } class PageArea extends XFAObject { - constructor(e) { - super(Hn, "pageArea", !0); - this.blankOrNotBlank = getStringOption(e.blankOrNotBlank, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "pageArea", true); + this.blankOrNotBlank = getStringOption(attributes.blankOrNotBlank, [ "any", "blank", "notBlank", ]); - this.id = e.id || ""; + this.id = attributes.id || ""; this.initialNumber = getInteger({ - data: e.initialNumber, + data: attributes.initialNumber, defaultValue: 1, - validate: (e) => !0, + validate: (x) => true, }); - this.name = e.name || ""; + this.name = attributes.name || ""; this.numbered = getInteger({ - data: e.numbered, + data: attributes.numbered, defaultValue: 1, - validate: (e) => !0, + validate: (x) => true, }); - this.oddOrEven = getStringOption(e.oddOrEven, ["any", "even", "odd"]); - this.pagePosition = getStringOption(e.pagePosition, [ + this.oddOrEven = getStringOption(attributes.oddOrEven, [ + "any", + "even", + "odd", + ]); + this.pagePosition = getStringOption(attributes.pagePosition, [ "any", "first", "last", "only", "rest", ]); - this.relevant = getRelevant(e.relevant); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.desc = null; this.extras = null; this.medium = null; @@ -46155,142 +55861,189 @@ class PageArea extends XFAObject { this.field = new XFAObjectArray(); this.subform = new XFAObjectArray(); } - [Lr]() { - if (!this[ar]) { - this[ar] = { numberOfUse: 0 }; - return !0; + [$isUsable]() { + if (!this[$extra]) { + this[$extra] = { + numberOfUse: 0, + }; + return true; } return ( !this.occur || - -1 === this.occur.max || - this[ar].numberOfUse < this.occur.max + this.occur.max === -1 || + this[$extra].numberOfUse < this.occur.max ); } - [zs]() { - delete this[ar]; + [$cleanPage]() { + delete this[$extra]; } - [dr]() { - this[ar] || (this[ar] = { numberOfUse: 0 }); - const e = this[pr](); - if ("orderedOccurrence" === e.relation && this[Lr]()) { - this[ar].numberOfUse += 1; - return this; + [$getNextPage]() { + if (!this[$extra]) { + this[$extra] = { + numberOfUse: 0, + }; } - return e[dr](); - } - [or]() { - return this[ar].space || { width: 0, height: 0 }; - } - [an]() { - this[ar] || (this[ar] = { numberOfUse: 1 }); - const e = []; - this[ar].children = e; - const t = Object.create(null); - if (this.medium && this.medium.short && this.medium.long) { - t.width = measureToString(this.medium.short); - t.height = measureToString(this.medium.long); - this[ar].space = { width: this.medium.short, height: this.medium.long }; - if ("landscape" === this.medium.orientation) { - const e = t.width; - t.width = t.height; - t.height = e; - this[ar].space = { width: this.medium.long, height: this.medium.short }; + const parent = this[$getParent](); + if (parent.relation === "orderedOccurrence") { + if (this[$isUsable]()) { + this[$extra].numberOfUse += 1; + return this; } - } else warn("XFA - No medium specified in pageArea: please file a bug."); - this[Zs]({ + } + return parent[$getNextPage](); + } + [$getAvailableSpace]() { + return ( + this[$extra].space || { + width: 0, + height: 0, + } + ); + } + [$toHTML]() { + if (!this[$extra]) { + this[$extra] = { + numberOfUse: 1, + }; + } + const children = []; + this[$extra].children = children; + const style = Object.create(null); + if (this.medium && this.medium.short && this.medium.long) { + style.width = measureToString(this.medium.short); + style.height = measureToString(this.medium.long); + this[$extra].space = { + width: this.medium.short, + height: this.medium.long, + }; + if (this.medium.orientation === "landscape") { + const x = style.width; + style.width = style.height; + style.height = x; + this[$extra].space = { + width: this.medium.long, + height: this.medium.short, + }; + } + } else { + warn("XFA - No medium specified in pageArea: please file a bug."); + } + this[$childrenToHTML]({ filter: new Set(["area", "draw", "field", "subform"]), - include: !0, + include: true, + }); + this[$childrenToHTML]({ + filter: new Set(["contentArea"]), + include: true, }); - this[Zs]({ filter: new Set(["contentArea"]), include: !0 }); return HTMLResult.success({ name: "div", - children: e, + children, attributes: { class: ["xfaPage"], - id: this[nn], - style: t, + id: this[$uid], + style, xfaName: this.name, }, }); } } class PageSet extends XFAObject { - constructor(e) { - super(Hn, "pageSet", !0); - this.duplexImposition = getStringOption(e.duplexImposition, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "pageSet", true); + this.duplexImposition = getStringOption(attributes.duplexImposition, [ "longEdge", "shortEdge", ]); - this.id = e.id || ""; - this.name = e.name || ""; - this.relation = getStringOption(e.relation, [ + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relation = getStringOption(attributes.relation, [ "orderedOccurrence", "duplexPaginated", "simplexPaginated", ]); - this.relevant = getRelevant(e.relevant); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; this.occur = null; this.pageArea = new XFAObjectArray(); this.pageSet = new XFAObjectArray(); } - [zs]() { - for (const e of this.pageArea.children) e[zs](); - for (const e of this.pageSet.children) e[zs](); + [$cleanPage]() { + for (const page of this.pageArea.children) { + page[$cleanPage](); + } + for (const page of this.pageSet.children) { + page[$cleanPage](); + } } - [Lr]() { + [$isUsable]() { return ( !this.occur || - -1 === this.occur.max || - this[ar].numberOfUse < this.occur.max + this.occur.max === -1 || + this[$extra].numberOfUse < this.occur.max ); } - [dr]() { - this[ar] || - (this[ar] = { numberOfUse: 1, pageIndex: -1, pageSetIndex: -1 }); - if ("orderedOccurrence" === this.relation) { - if (this[ar].pageIndex + 1 < this.pageArea.children.length) { - this[ar].pageIndex += 1; - return this.pageArea.children[this[ar].pageIndex][dr](); - } - if (this[ar].pageSetIndex + 1 < this.pageSet.children.length) { - this[ar].pageSetIndex += 1; - return this.pageSet.children[this[ar].pageSetIndex][dr](); - } - if (this[Lr]()) { - this[ar].numberOfUse += 1; - this[ar].pageIndex = -1; - this[ar].pageSetIndex = -1; - return this[dr](); - } - const e = this[pr](); - if (e instanceof PageSet) return e[dr](); - this[zs](); - return this[dr](); + [$getNextPage]() { + if (!this[$extra]) { + this[$extra] = { + numberOfUse: 1, + pageIndex: -1, + pageSetIndex: -1, + }; } - const e = this[mr]()[ar].pageNumber, - t = e % 2 == 0 ? "even" : "odd", - i = 0 === e ? "first" : "rest"; - let a = this.pageArea.children.find( - (e) => e.oddOrEven === t && e.pagePosition === i, + if (this.relation === "orderedOccurrence") { + if (this[$extra].pageIndex + 1 < this.pageArea.children.length) { + this[$extra].pageIndex += 1; + const pageArea = this.pageArea.children[this[$extra].pageIndex]; + return pageArea[$getNextPage](); + } + if (this[$extra].pageSetIndex + 1 < this.pageSet.children.length) { + this[$extra].pageSetIndex += 1; + return this.pageSet.children[this[$extra].pageSetIndex][$getNextPage](); + } + if (this[$isUsable]()) { + this[$extra].numberOfUse += 1; + this[$extra].pageIndex = -1; + this[$extra].pageSetIndex = -1; + return this[$getNextPage](); + } + const parent = this[$getParent](); + if (parent instanceof PageSet) { + return parent[$getNextPage](); + } + this[$cleanPage](); + return this[$getNextPage](); + } + const pageNumber = this[$getTemplateRoot]()[$extra].pageNumber; + const parity = pageNumber % 2 === 0 ? "even" : "odd"; + const position = pageNumber === 0 ? "first" : "rest"; + let page = this.pageArea.children.find( + (p) => p.oddOrEven === parity && p.pagePosition === position, ); - if (a) return a; - a = this.pageArea.children.find( - (e) => "any" === e.oddOrEven && e.pagePosition === i, + if (page) { + return page; + } + page = this.pageArea.children.find( + (p) => p.oddOrEven === "any" && p.pagePosition === position, ); - if (a) return a; - a = this.pageArea.children.find( - (e) => "any" === e.oddOrEven && "any" === e.pagePosition, + if (page) { + return page; + } + page = this.pageArea.children.find( + (p) => p.oddOrEven === "any" && p.pagePosition === "any", ); - return a || this.pageArea.children[0]; + if (page) { + return page; + } + return this.pageArea.children[0]; } } class Para extends XFAObject { - constructor(e) { - super(Hn, "para", !0); - this.hAlign = getStringOption(e.hAlign, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "para", true); + this.hAlign = getStringOption(attributes.hAlign, [ "left", "center", "justify", @@ -46298,81 +56051,109 @@ class Para extends XFAObject { "radix", "right", ]); - this.id = e.id || ""; - this.lineHeight = e.lineHeight ? getMeasurement(e.lineHeight, "0pt") : ""; - this.marginLeft = e.marginLeft ? getMeasurement(e.marginLeft, "0pt") : ""; - this.marginRight = e.marginRight - ? getMeasurement(e.marginRight, "0pt") + this.id = attributes.id || ""; + this.lineHeight = attributes.lineHeight + ? getMeasurement(attributes.lineHeight, "0pt") + : ""; + this.marginLeft = attributes.marginLeft + ? getMeasurement(attributes.marginLeft, "0pt") + : ""; + this.marginRight = attributes.marginRight + ? getMeasurement(attributes.marginRight, "0pt") : ""; this.orphans = getInteger({ - data: e.orphans, + data: attributes.orphans, defaultValue: 0, - validate: (e) => e >= 0, + validate: (x) => x >= 0, }); - this.preserve = e.preserve || ""; - this.radixOffset = e.radixOffset - ? getMeasurement(e.radixOffset, "0pt") + this.preserve = attributes.preserve || ""; + this.radixOffset = attributes.radixOffset + ? getMeasurement(attributes.radixOffset, "0pt") : ""; - this.spaceAbove = e.spaceAbove ? getMeasurement(e.spaceAbove, "0pt") : ""; - this.spaceBelow = e.spaceBelow ? getMeasurement(e.spaceBelow, "0pt") : ""; - this.tabDefault = e.tabDefault ? getMeasurement(this.tabDefault) : ""; - this.tabStops = (e.tabStops || "") + this.spaceAbove = attributes.spaceAbove + ? getMeasurement(attributes.spaceAbove, "0pt") + : ""; + this.spaceBelow = attributes.spaceBelow + ? getMeasurement(attributes.spaceBelow, "0pt") + : ""; + this.tabDefault = attributes.tabDefault + ? getMeasurement(this.tabDefault) + : ""; + this.tabStops = (attributes.tabStops || "") .trim() .split(/\s+/) - .map((e, t) => (t % 2 == 1 ? getMeasurement(e) : e)); - this.textIndent = e.textIndent ? getMeasurement(e.textIndent, "0pt") : ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; - this.vAlign = getStringOption(e.vAlign, ["top", "bottom", "middle"]); + .map((x, i) => (i % 2 === 1 ? getMeasurement(x) : x)); + this.textIndent = attributes.textIndent + ? getMeasurement(attributes.textIndent, "0pt") + : ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.vAlign = getStringOption(attributes.vAlign, [ + "top", + "bottom", + "middle", + ]); this.widows = getInteger({ - data: e.widows, + data: attributes.widows, defaultValue: 0, - validate: (e) => e >= 0, + validate: (x) => x >= 0, }); this.hyphenation = null; } - [rn]() { - const e = toStyle(this, "hAlign"); - "" !== this.marginLeft && - (e.paddingLeft = measureToString(this.marginLeft)); - "" !== this.marginRight && - (e.paddingight = measureToString(this.marginRight)); - "" !== this.spaceAbove && (e.paddingTop = measureToString(this.spaceAbove)); - "" !== this.spaceBelow && - (e.paddingBottom = measureToString(this.spaceBelow)); - if ("" !== this.textIndent) { - e.textIndent = measureToString(this.textIndent); - fixTextIndent(e); + [$toStyle]() { + const style = toStyle(this, "hAlign"); + if (this.marginLeft !== "") { + style.paddingLeft = measureToString(this.marginLeft); } - this.lineHeight > 0 && (e.lineHeight = measureToString(this.lineHeight)); - "" !== this.tabDefault && (e.tabSize = measureToString(this.tabDefault)); - this.tabStops.length; - this.hyphenatation && Object.assign(e, this.hyphenatation[rn]()); - return e; + if (this.marginRight !== "") { + style.paddingight = measureToString(this.marginRight); + } + if (this.spaceAbove !== "") { + style.paddingTop = measureToString(this.spaceAbove); + } + if (this.spaceBelow !== "") { + style.paddingBottom = measureToString(this.spaceBelow); + } + if (this.textIndent !== "") { + style.textIndent = measureToString(this.textIndent); + fixTextIndent(style); + } + if (this.lineHeight > 0) { + style.lineHeight = measureToString(this.lineHeight); + } + if (this.tabDefault !== "") { + style.tabSize = measureToString(this.tabDefault); + } + if (this.tabStops.length > 0) { + } + if (this.hyphenatation) { + Object.assign(style, this.hyphenatation[$toStyle]()); + } + return style; } } class PasswordEdit extends XFAObject { - constructor(e) { - super(Hn, "passwordEdit", !0); - this.hScrollPolicy = getStringOption(e.hScrollPolicy, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "passwordEdit", true); + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, [ "auto", "off", "on", ]); - this.id = e.id || ""; - this.passwordChar = e.passwordChar || "*"; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.id = attributes.id || ""; + this.passwordChar = attributes.passwordChar || "*"; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.border = null; this.extras = null; this.margin = null; } } class template_Pattern extends XFAObject { - constructor(e) { - super(Hn, "pattern", !0); - this.id = e.id || ""; - this.type = getStringOption(e.type, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "pattern", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, [ "crossHatch", "crossDiagonal", "diagonalLeft", @@ -46380,44 +56161,45 @@ class template_Pattern extends XFAObject { "horizontal", "vertical", ]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.color = null; this.extras = null; } - [rn](e) { - e = e ? e[rn]() : "#FFFFFF"; - const t = this.color ? this.color[rn]() : "#000000", - i = "repeating-linear-gradient", - a = `${e},${e} 5px,${t} 5px,${t} 10px`; + [$toStyle](startColor) { + startColor = startColor ? startColor[$toStyle]() : "#FFFFFF"; + const endColor = this.color ? this.color[$toStyle]() : "#000000"; + const width = 5; + const cmd = "repeating-linear-gradient"; + const colors = `${startColor},${startColor} ${width}px,${endColor} ${width}px,${endColor} ${2 * width}px`; switch (this.type) { case "crossHatch": - return `${i}(to top,${a}) ${i}(to right,${a})`; + return `${cmd}(to top,${colors}) ${cmd}(to right,${colors})`; case "crossDiagonal": - return `${i}(45deg,${a}) ${i}(-45deg,${a})`; + return `${cmd}(45deg,${colors}) ${cmd}(-45deg,${colors})`; case "diagonalLeft": - return `${i}(45deg,${a})`; + return `${cmd}(45deg,${colors})`; case "diagonalRight": - return `${i}(-45deg,${a})`; + return `${cmd}(-45deg,${colors})`; case "horizontal": - return `${i}(to top,${a})`; + return `${cmd}(to top,${colors})`; case "vertical": - return `${i}(to right,${a})`; + return `${cmd}(to right,${colors})`; } return ""; } } class Picture extends StringObject { - constructor(e) { - super(Hn, "picture"); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "picture"); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Proto extends XFAObject { - constructor(e) { - super(Hn, "proto", !0); + constructor(attributes) { + super(TEMPLATE_NS_ID, "proto", true); this.appearanceFilter = new XFAObjectArray(); this.arc = new XFAObjectArray(); this.area = new XFAObjectArray(); @@ -46531,147 +56313,173 @@ class Proto extends XFAObject { } } class Radial extends XFAObject { - constructor(e) { - super(Hn, "radial", !0); - this.id = e.id || ""; - this.type = getStringOption(e.type, ["toEdge", "toCenter"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "radial", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["toEdge", "toCenter"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.color = null; this.extras = null; } - [rn](e) { - e = e ? e[rn]() : "#FFFFFF"; - const t = this.color ? this.color[rn]() : "#000000"; - return `radial-gradient(circle at center, ${"toEdge" === this.type ? `${e},${t}` : `${t},${e}`})`; + [$toStyle](startColor) { + startColor = startColor ? startColor[$toStyle]() : "#FFFFFF"; + const endColor = this.color ? this.color[$toStyle]() : "#000000"; + const colors = + this.type === "toEdge" + ? `${startColor},${endColor}` + : `${endColor},${startColor}`; + return `radial-gradient(circle at center, ${colors})`; } } class Reason extends StringObject { - constructor(e) { - super(Hn, "reason"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "reason"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Reasons extends XFAObject { - constructor(e) { - super(Hn, "reasons", !0); - this.id = e.id || ""; - this.type = getStringOption(e.type, ["optional", "required"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "reasons", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.reason = new XFAObjectArray(); } } class Rectangle extends XFAObject { - constructor(e) { - super(Hn, "rectangle", !0); - this.hand = getStringOption(e.hand, ["even", "left", "right"]); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "rectangle", true); + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.corner = new XFAObjectArray(4); this.edge = new XFAObjectArray(4); this.fill = null; } - [an]() { - const e = this.edge.children.length ? this.edge.children[0] : new Edge({}), - t = e[rn](), - i = Object.create(null); - "visible" === this.fill?.presence - ? Object.assign(i, this.fill[rn]()) - : (i.fill = "transparent"); - i.strokeWidth = measureToString("visible" === e.presence ? e.thickness : 0); - i.stroke = t.color; - const a = ( - this.corner.children.length ? this.corner.children[0] : new Corner({}) - )[rn](), - s = { - name: "svg", - children: [ - { - name: "rect", - attributes: { - xmlns: Jn, - width: "100%", - height: "100%", - x: 0, - y: 0, - rx: a.radius, - ry: a.radius, - style: i, - }, - }, - ], - attributes: { - xmlns: Jn, - style: { overflow: "visible" }, - width: "100%", - height: "100%", + [$toHTML]() { + const edge = this.edge.children.length + ? this.edge.children[0] + : new Edge({}); + const edgeStyle = edge[$toStyle](); + const style = Object.create(null); + if (this.fill?.presence === "visible") { + Object.assign(style, this.fill[$toStyle]()); + } else { + style.fill = "transparent"; + } + style.strokeWidth = measureToString( + edge.presence === "visible" ? edge.thickness : 0, + ); + style.stroke = edgeStyle.color; + const corner = this.corner.children.length + ? this.corner.children[0] + : new Corner({}); + const cornerStyle = corner[$toStyle](); + const rect = { + name: "rect", + attributes: { + xmlns: SVG_NS, + width: "100%", + height: "100%", + x: 0, + y: 0, + rx: cornerStyle.radius, + ry: cornerStyle.radius, + style, + }, + }; + const svg = { + name: "svg", + children: [rect], + attributes: { + xmlns: SVG_NS, + style: { + overflow: "visible", }, - }; - if (hasMargin(this[pr]()[pr]())) + width: "100%", + height: "100%", + }, + }; + const parent = this[$getParent]()[$getParent](); + if (hasMargin(parent)) { return HTMLResult.success({ name: "div", attributes: { - style: { display: "inline", width: "100%", height: "100%" }, + style: { + display: "inline", + width: "100%", + height: "100%", + }, }, - children: [s], + children: [svg], }); - s.attributes.style.position = "absolute"; - return HTMLResult.success(s); + } + svg.attributes.style.position = "absolute"; + return HTMLResult.success(svg); } } class RefElement extends StringObject { - constructor(e) { - super(Hn, "ref"); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "ref"); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Script extends StringObject { - constructor(e) { - super(Hn, "script"); - this.binding = e.binding || ""; - this.contentType = e.contentType || ""; - this.id = e.id || ""; - this.name = e.name || ""; - this.runAt = getStringOption(e.runAt, ["client", "both", "server"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "script"); + this.binding = attributes.binding || ""; + this.contentType = attributes.contentType || ""; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.runAt = getStringOption(attributes.runAt, [ + "client", + "both", + "server", + ]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class SetProperty extends XFAObject { - constructor(e) { - super(Hn, "setProperty"); - this.connection = e.connection || ""; - this.ref = e.ref || ""; - this.target = e.target || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "setProperty"); + this.connection = attributes.connection || ""; + this.ref = attributes.ref || ""; + this.target = attributes.target || ""; } } class SignData extends XFAObject { - constructor(e) { - super(Hn, "signData", !0); - this.id = e.id || ""; - this.operation = getStringOption(e.operation, ["sign", "clear", "verify"]); - this.ref = e.ref || ""; - this.target = e.target || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "signData", true); + this.id = attributes.id || ""; + this.operation = getStringOption(attributes.operation, [ + "sign", + "clear", + "verify", + ]); + this.ref = attributes.ref || ""; + this.target = attributes.target || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.filter = null; this.manifest = null; } } class Signature extends XFAObject { - constructor(e) { - super(Hn, "signature", !0); - this.id = e.id || ""; - this.type = getStringOption(e.type, ["PDF1.3", "PDF1.6"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "signature", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["PDF1.3", "PDF1.6"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.border = null; this.extras = null; this.filter = null; @@ -46680,85 +56488,85 @@ class Signature extends XFAObject { } } class Signing extends XFAObject { - constructor(e) { - super(Hn, "signing", !0); - this.id = e.id || ""; - this.type = getStringOption(e.type, ["optional", "required"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "signing", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.certificate = new XFAObjectArray(); } } class Solid extends XFAObject { - constructor(e) { - super(Hn, "solid", !0); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "solid", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; } - [rn](e) { - return e ? e[rn]() : "#FFFFFF"; + [$toStyle](startColor) { + return startColor ? startColor[$toStyle]() : "#FFFFFF"; } } class Speak extends StringObject { - constructor(e) { - super(Hn, "speak"); + constructor(attributes) { + super(TEMPLATE_NS_ID, "speak"); this.disable = getInteger({ - data: e.disable, + data: attributes.disable, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); - this.id = e.id || ""; - this.priority = getStringOption(e.priority, [ + this.id = attributes.id || ""; + this.priority = getStringOption(attributes.priority, [ "custom", "caption", "name", "toolTip", ]); - this.rid = e.rid || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.rid = attributes.rid || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Stipple extends XFAObject { - constructor(e) { - super(Hn, "stipple", !0); - this.id = e.id || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "stipple", true); + this.id = attributes.id || ""; this.rate = getInteger({ - data: e.rate, + data: attributes.rate, defaultValue: 50, - validate: (e) => e >= 0 && e <= 100, + validate: (x) => x >= 0 && x <= 100, }); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.color = null; this.extras = null; } - [rn](e) { - const t = this.rate / 100; + [$toStyle](bgColor) { + const alpha = this.rate / 100; return Util.makeHexColor( - Math.round(e.value.r * (1 - t) + this.value.r * t), - Math.round(e.value.g * (1 - t) + this.value.g * t), - Math.round(e.value.b * (1 - t) + this.value.b * t), + Math.round(bgColor.value.r * (1 - alpha) + this.value.r * alpha), + Math.round(bgColor.value.g * (1 - alpha) + this.value.g * alpha), + Math.round(bgColor.value.b * (1 - alpha) + this.value.b * alpha), ); } } class Subform extends XFAObject { - constructor(e) { - super(Hn, "subform", !0); - this.access = getStringOption(e.access, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "subform", true); + this.access = getStringOption(attributes.access, [ "open", "nonInteractive", "protected", "readOnly", ]); this.allowMacro = getInteger({ - data: e.allowMacro, + data: attributes.allowMacro, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); - this.anchorType = getStringOption(e.anchorType, [ + this.anchorType = getStringOption(attributes.anchorType, [ "topLeft", "bottomCenter", "bottomLeft", @@ -46770,16 +56578,16 @@ class Subform extends XFAObject { "topRight", ]); this.colSpan = getInteger({ - data: e.colSpan, + data: attributes.colSpan, defaultValue: 1, - validate: (e) => e >= 1 || -1 === e, + validate: (n) => n >= 1 || n === -1, }); - this.columnWidths = (e.columnWidths || "") + this.columnWidths = (attributes.columnWidths || "") .trim() .split(/\s+/) - .map((e) => ("-1" === e ? -1 : getMeasurement(e))); - this.h = e.h ? getMeasurement(e.h) : ""; - this.hAlign = getStringOption(e.hAlign, [ + .map((x) => (x === "-1" ? -1 : getMeasurement(x))); + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, [ "left", "center", "justify", @@ -46787,8 +56595,8 @@ class Subform extends XFAObject { "radix", "right", ]); - this.id = e.id || ""; - this.layout = getStringOption(e.layout, [ + this.id = attributes.id || ""; + this.layout = getStringOption(attributes.layout, [ "position", "lr-tb", "rl-row", @@ -46797,30 +56605,33 @@ class Subform extends XFAObject { "table", "tb", ]); - this.locale = e.locale || ""; - this.maxH = getMeasurement(e.maxH, "0pt"); - this.maxW = getMeasurement(e.maxW, "0pt"); - this.mergeMode = getStringOption(e.mergeMode, [ + this.locale = attributes.locale || ""; + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.mergeMode = getStringOption(attributes.mergeMode, [ "consumeData", "matchTemplate", ]); - this.minH = getMeasurement(e.minH, "0pt"); - this.minW = getMeasurement(e.minW, "0pt"); - this.name = e.name || ""; - this.presence = getStringOption(e.presence, [ + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, [ "visible", "hidden", "inactive", "invisible", ]); - this.relevant = getRelevant(e.relevant); - this.restoreState = getStringOption(e.restoreState, ["manual", "auto"]); - this.scope = getStringOption(e.scope, ["name", "none"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; - this.w = e.w ? getMeasurement(e.w) : ""; - this.x = getMeasurement(e.x, "0pt"); - this.y = getMeasurement(e.y, "0pt"); + this.relevant = getRelevant(attributes.relevant); + this.restoreState = getStringOption(attributes.restoreState, [ + "manual", + "auto", + ]); + this.scope = getStringOption(attributes.scope, ["name", "none"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); this.assist = null; this.bind = null; this.bookend = null; @@ -46852,123 +56663,149 @@ class Subform extends XFAObject { this.subform = new XFAObjectArray(); this.subformSet = new XFAObjectArray(); } - [fr]() { - const e = this[pr](); - return e instanceof SubformSet ? e[fr]() : e; + [$getSubformParent]() { + const parent = this[$getParent](); + if (parent instanceof SubformSet) { + return parent[$getSubformParent](); + } + return parent; } - [kr]() { - return !0; + [$isBindable]() { + return true; } - [Ur]() { + [$isThereMoreWidth]() { return ( (this.layout.endsWith("-tb") && - 0 === this[ar].attempt && - this[ar].numberInLine > 0) || - this[pr]()[Ur]() + this[$extra].attempt === 0 && + this[$extra].numberInLine > 0) || + this[$getParent]()[$isThereMoreWidth]() ); } - *[ur]() { + *[$getContainedChildren]() { yield* getContainedChildren(this); } - [rr]() { + [$flushHTML]() { return flushHTML(this); } - [js](e, t) { - addHTML(this, e, t); + [$addHTML](html, bbox) { + addHTML(this, html, bbox); } - [or]() { + [$getAvailableSpace]() { return getAvailableSpace(this); } - [xr]() { - const e = this[fr](); - if (!e[xr]()) return !1; - if (void 0 !== this[ar]._isSplittable) return this[ar]._isSplittable; - if ("position" === this.layout || this.layout.includes("row")) { - this[ar]._isSplittable = !1; - return !1; + [$isSplittable]() { + const parent = this[$getSubformParent](); + if (!parent[$isSplittable]()) { + return false; } - if (this.keep && "none" !== this.keep.intact) { - this[ar]._isSplittable = !1; - return !1; + if (this[$extra]._isSplittable !== undefined) { + return this[$extra]._isSplittable; } - if (e.layout?.endsWith("-tb") && 0 !== e[ar].numberInLine) return !1; - this[ar]._isSplittable = !0; - return !0; + if (this.layout === "position" || this.layout.includes("row")) { + this[$extra]._isSplittable = false; + return false; + } + if (this.keep && this.keep.intact !== "none") { + this[$extra]._isSplittable = false; + return false; + } + if (parent.layout?.endsWith("-tb") && parent[$extra].numberInLine !== 0) { + return false; + } + this[$extra]._isSplittable = true; + return true; } - [an](e) { + [$toHTML](availableSpace) { setTabIndex(this); if (this.break) { - if ("auto" !== this.break.after || "" !== this.break.afterTarget) { - const e = new BreakAfter({ + if (this.break.after !== "auto" || this.break.afterTarget !== "") { + const node = new BreakAfter({ targetType: this.break.after, target: this.break.afterTarget, startNew: this.break.startNew.toString(), }); - e[yr] = this[yr]; - this[Xs](e); - this.breakAfter.push(e); + node[$globalData] = this[$globalData]; + this[$appendChild](node); + this.breakAfter.push(node); } - if ("auto" !== this.break.before || "" !== this.break.beforeTarget) { - const e = new BreakBefore({ + if (this.break.before !== "auto" || this.break.beforeTarget !== "") { + const node = new BreakBefore({ targetType: this.break.before, target: this.break.beforeTarget, startNew: this.break.startNew.toString(), }); - e[yr] = this[yr]; - this[Xs](e); - this.breakBefore.push(e); + node[$globalData] = this[$globalData]; + this[$appendChild](node); + this.breakBefore.push(node); } - if ("" !== this.break.overflowTarget) { - const e = new Overflow({ + if (this.break.overflowTarget !== "") { + const node = new Overflow({ target: this.break.overflowTarget, leader: this.break.overflowLeader, trailer: this.break.overflowTrailer, }); - e[yr] = this[yr]; - this[Xs](e); - this.overflow.push(e); + node[$globalData] = this[$globalData]; + this[$appendChild](node); + this.overflow.push(node); } - this[jr](this.break); + this[$removeChild](this.break); this.break = null; } - if ("hidden" === this.presence || "inactive" === this.presence) + if (this.presence === "hidden" || this.presence === "inactive") { return HTMLResult.EMPTY; - (this.breakBefore.children.length > 1 || - this.breakAfter.children.length > 1) && + } + if ( + this.breakBefore.children.length > 1 || + this.breakAfter.children.length > 1 + ) { warn( "XFA - Several breakBefore or breakAfter in subforms: please file a bug.", ); - if (this.breakBefore.children.length >= 1) { - const e = this.breakBefore.children[0]; - if (handleBreak(e)) return HTMLResult.breakNode(e); } - if (this[ar]?.afterBreakAfter) return HTMLResult.EMPTY; + if (this.breakBefore.children.length >= 1) { + const breakBefore = this.breakBefore.children[0]; + if (handleBreak(breakBefore)) { + return HTMLResult.breakNode(breakBefore); + } + } + if (this[$extra]?.afterBreakAfter) { + return HTMLResult.EMPTY; + } fixDimensions(this); - const t = [], - i = { id: this[nn], class: [] }; - setAccess(this, i.class); - this[ar] || (this[ar] = Object.create(null)); - Object.assign(this[ar], { - children: t, + const children = []; + const attributes = { + id: this[$uid], + class: [], + }; + setAccess(this, attributes.class); + if (!this[$extra]) { + this[$extra] = Object.create(null); + } + Object.assign(this[$extra], { + children, line: null, - attributes: i, + attributes, attempt: 0, numberInLine: 0, availableSpace: { - width: Math.min(this.w || 1 / 0, e.width), - height: Math.min(this.h || 1 / 0, e.height), + width: Math.min(this.w || Infinity, availableSpace.width), + height: Math.min(this.h || Infinity, availableSpace.height), }, width: 0, height: 0, prevHeight: 0, currentWidth: 0, }); - const a = this[mr](), - s = a[ar].noLayoutFailure, - r = this[xr](); - r || setFirstUnsplittable(this); - if (!checkDimensions(this, e)) return HTMLResult.FAILURE; - const n = new Set([ + const root = this[$getTemplateRoot](); + const savedNoLayoutFailure = root[$extra].noLayoutFailure; + const isSplittable = this[$isSplittable](); + if (!isSplittable) { + setFirstUnsplittable(this); + } + if (!checkDimensions(this, availableSpace)) { + return HTMLResult.FAILURE; + } + const filter = new Set([ "area", "draw", "exclGroup", @@ -46977,111 +56814,140 @@ class Subform extends XFAObject { "subformSet", ]); if (this.layout.includes("row")) { - const e = this[fr]().columnWidths; - if (Array.isArray(e) && e.length > 0) { - this[ar].columnWidths = e; - this[ar].currentColumn = 0; + const columnWidths = this[$getSubformParent]().columnWidths; + if (Array.isArray(columnWidths) && columnWidths.length > 0) { + this[$extra].columnWidths = columnWidths; + this[$extra].currentColumn = 0; } } - const g = toStyle( - this, - "anchorType", - "dimensions", - "position", - "presence", - "border", - "margin", - "hAlign", - ), - o = ["xfaSubform"], - c = layoutClass(this); - c && o.push(c); - i.style = g; - i.class = o; - this.name && (i.xfaName = this.name); + const style = toStyle( + this, + "anchorType", + "dimensions", + "position", + "presence", + "border", + "margin", + "hAlign", + ); + const classNames = ["xfaSubform"]; + const cl = layoutClass(this); + if (cl) { + classNames.push(cl); + } + attributes.style = style; + attributes.class = classNames; + if (this.name) { + attributes.xfaName = this.name; + } if (this.overflow) { - const t = this.overflow[lr](); - if (t.addLeader) { - t.addLeader = !1; - handleOverflow(this, t.leader, e); + const overflowExtra = this.overflow[$getExtra](); + if (overflowExtra.addLeader) { + overflowExtra.addLeader = false; + handleOverflow(this, overflowExtra.leader, availableSpace); } } - this[Wr](); - const C = "lr-tb" === this.layout || "rl-tb" === this.layout, - h = C ? 2 : 1; - for (; this[ar].attempt < h; this[ar].attempt++) { - C && 1 === this[ar].attempt && (this[ar].numberInLine = 0); - const e = this[Zs]({ filter: n, include: !0 }); - if (e.success) break; - if (e.isBreak()) { - this[Pr](); - return e; + this[$pushPara](); + const isLrTb = this.layout === "lr-tb" || this.layout === "rl-tb"; + const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1; + for (; this[$extra].attempt < maxRun; this[$extra].attempt++) { + if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) { + this[$extra].numberInLine = 0; + } + const result = this[$childrenToHTML]({ + filter, + include: true, + }); + if (result.success) { + break; + } + if (result.isBreak()) { + this[$popPara](); + return result; } if ( - C && - 0 === this[ar].attempt && - 0 === this[ar].numberInLine && - !a[ar].noLayoutFailure + isLrTb && + this[$extra].attempt === 0 && + this[$extra].numberInLine === 0 && + !root[$extra].noLayoutFailure ) { - this[ar].attempt = h; + this[$extra].attempt = maxRun; break; } } - this[Pr](); - r || unsetFirstUnsplittable(this); - a[ar].noLayoutFailure = s; - if (this[ar].attempt === h) { - this.overflow && (this[mr]()[ar].overflowNode = this.overflow); - r || delete this[ar]; + this[$popPara](); + if (!isSplittable) { + unsetFirstUnsplittable(this); + } + root[$extra].noLayoutFailure = savedNoLayoutFailure; + if (this[$extra].attempt === maxRun) { + if (this.overflow) { + this[$getTemplateRoot]()[$extra].overflowNode = this.overflow; + } + if (!isSplittable) { + delete this[$extra]; + } return HTMLResult.FAILURE; } if (this.overflow) { - const t = this.overflow[lr](); - if (t.addTrailer) { - t.addTrailer = !1; - handleOverflow(this, t.trailer, e); + const overflowExtra = this.overflow[$getExtra](); + if (overflowExtra.addTrailer) { + overflowExtra.addTrailer = false; + handleOverflow(this, overflowExtra.trailer, availableSpace); } } - let l = 0, - Q = 0; + let marginH = 0; + let marginV = 0; if (this.margin) { - l = this.margin.leftInset + this.margin.rightInset; - Q = this.margin.topInset + this.margin.bottomInset; + marginH = this.margin.leftInset + this.margin.rightInset; + marginV = this.margin.topInset + this.margin.bottomInset; } - const E = Math.max(this[ar].width + l, this.w || 0), - u = Math.max(this[ar].height + Q, this.h || 0), - d = [this.x, this.y, E, u]; - "" === this.w && (g.width = measureToString(E)); - "" === this.h && (g.height = measureToString(u)); - if (("0px" === g.width || "0px" === g.height) && 0 === t.length) + const width = Math.max(this[$extra].width + marginH, this.w || 0); + const height = Math.max(this[$extra].height + marginV, this.h || 0); + const bbox = [this.x, this.y, width, height]; + if (this.w === "") { + style.width = measureToString(width); + } + if (this.h === "") { + style.height = measureToString(height); + } + if ( + (style.width === "0px" || style.height === "0px") && + children.length === 0 + ) { return HTMLResult.EMPTY; - const f = { name: "div", attributes: i, children: t }; - applyAssist(this, i); - const p = HTMLResult.success(createWrapper(this, f), d); + } + const html = { + name: "div", + attributes, + children, + }; + applyAssist(this, attributes); + const result = HTMLResult.success(createWrapper(this, html), bbox); if (this.breakAfter.children.length >= 1) { - const e = this.breakAfter.children[0]; - if (handleBreak(e)) { - this[ar].afterBreakAfter = p; - return HTMLResult.breakNode(e); + const breakAfter = this.breakAfter.children[0]; + if (handleBreak(breakAfter)) { + this[$extra].afterBreakAfter = result; + return HTMLResult.breakNode(breakAfter); } } - delete this[ar]; - return p; + delete this[$extra]; + return result; } } class SubformSet extends XFAObject { - constructor(e) { - super(Hn, "subformSet", !0); - this.id = e.id || ""; - this.name = e.name || ""; - this.relation = getStringOption(e.relation, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "subformSet", true); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relation = getStringOption(attributes.relation, [ "ordered", "choice", "unordered", ]); - this.relevant = getRelevant(e.relevant); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.bookend = null; this.break = null; this.desc = null; @@ -47093,55 +56959,58 @@ class SubformSet extends XFAObject { this.subform = new XFAObjectArray(); this.subformSet = new XFAObjectArray(); } - *[ur]() { + *[$getContainedChildren]() { yield* getContainedChildren(this); } - [fr]() { - let e = this[pr](); - for (; !(e instanceof Subform); ) e = e[pr](); - return e; + [$getSubformParent]() { + let parent = this[$getParent](); + while (!(parent instanceof Subform)) { + parent = parent[$getParent](); + } + return parent; } - [kr]() { - return !0; + [$isBindable]() { + return true; } } class SubjectDN extends ContentObject { - constructor(e) { - super(Hn, "subjectDN"); - this.delimiter = e.delimiter || ","; - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "subjectDN"); + this.delimiter = attributes.delimiter || ","; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } - [sr]() { - this[er] = new Map( - this[er].split(this.delimiter).map((e) => { - (e = e.split("=", 2))[0] = e[0].trim(); - return e; + [$finalize]() { + this[$content] = new Map( + this[$content].split(this.delimiter).map((kv) => { + kv = kv.split("=", 2); + kv[0] = kv[0].trim(); + return kv; }), ); } } class SubjectDNs extends XFAObject { - constructor(e) { - super(Hn, "subjectDNs", !0); - this.id = e.id || ""; - this.type = getStringOption(e.type, ["optional", "required"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "subjectDNs", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.subjectDN = new XFAObjectArray(); } } class Submit extends XFAObject { - constructor(e) { - super(Hn, "submit", !0); + constructor(attributes) { + super(TEMPLATE_NS_ID, "submit", true); this.embedPDF = getInteger({ - data: e.embedPDF, + data: attributes.embedPDF, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); - this.format = getStringOption(e.format, [ + this.format = getStringOption(attributes.format, [ "xdp", "formdata", "pdf", @@ -47149,12 +57018,14 @@ class Submit extends XFAObject { "xfd", "xml", ]); - this.id = e.id || ""; - this.target = e.target || ""; + this.id = attributes.id || ""; + this.target = attributes.target || ""; this.textEncoding = getKeyword({ - data: e.textEncoding ? e.textEncoding.toLowerCase() : "", + data: attributes.textEncoding + ? attributes.textEncoding.toLowerCase() + : "", defaultValue: "", - validate: (e) => + validate: (k) => [ "utf-8", "big-five", @@ -47167,302 +57038,371 @@ class Submit extends XFAObject { "shift-jis", "ucs-2", "utf-16", - ].includes(e) || e.match(/iso-8859-\d{2}/), + ].includes(k) || k.match(/iso-8859-\d{2}/), }); - this.use = e.use || ""; - this.usehref = e.usehref || ""; - this.xdpContent = e.xdpContent || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.xdpContent = attributes.xdpContent || ""; this.encrypt = null; this.encryptData = new XFAObjectArray(); this.signData = new XFAObjectArray(); } } class Template extends XFAObject { - constructor(e) { - super(Hn, "template", !0); - this.baseProfile = getStringOption(e.baseProfile, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "template", true); + this.baseProfile = getStringOption(attributes.baseProfile, [ "full", "interactiveForms", ]); this.extras = null; this.subform = new XFAObjectArray(); } - [sr]() { - 0 === this.subform.children.length && + [$finalize]() { + if (this.subform.children.length === 0) { warn("XFA - No subforms in template node."); - this.subform.children.length >= 2 && + } + if (this.subform.children.length >= 2) { warn("XFA - Several subforms in template node: please file a bug."); - this[An] = 5e3; + } + this[$tabIndex] = DEFAULT_TAB_INDEX; } - [xr]() { - return !0; + [$isSplittable]() { + return true; } - [Vr](e, t) { - return e.startsWith("#") - ? [this[Dr].get(e.slice(1))] - : searchNode(this, t, e, !0, !0); + [$searchNode](expr, container) { + if (expr.startsWith("#")) { + return [this[$ids].get(expr.slice(1))]; + } + return searchNode(this, container, expr, true, true); } - *[tn]() { - if (!this.subform.children.length) - return HTMLResult.success({ name: "div", children: [] }); - this[ar] = { + *[$toPages]() { + if (!this.subform.children.length) { + return HTMLResult.success({ + name: "div", + children: [], + }); + } + this[$extra] = { overflowNode: null, firstUnsplittable: null, currentContentArea: null, currentPageArea: null, - noLayoutFailure: !1, + noLayoutFailure: false, pageNumber: 1, pagePosition: "first", oddOrEven: "odd", blankOrNotBlank: "nonBlank", paraStack: [], }; - const e = this.subform.children[0]; - e.pageSet[zs](); - const t = e.pageSet.pageArea.children, - i = { name: "div", children: [] }; - let a = null, - s = null, - r = null; - if (e.breakBefore.children.length >= 1) { - s = e.breakBefore.children[0]; - r = s.target; + const root = this.subform.children[0]; + root.pageSet[$cleanPage](); + const pageAreas = root.pageSet.pageArea.children; + const mainHtml = { + name: "div", + children: [], + }; + let pageArea = null; + let breakBefore = null; + let breakBeforeTarget = null; + if (root.breakBefore.children.length >= 1) { + breakBefore = root.breakBefore.children[0]; + breakBeforeTarget = breakBefore.target; } else if ( - e.subform.children.length >= 1 && - e.subform.children[0].breakBefore.children.length >= 1 + root.subform.children.length >= 1 && + root.subform.children[0].breakBefore.children.length >= 1 ) { - s = e.subform.children[0].breakBefore.children[0]; - r = s.target; - } else if (e.break?.beforeTarget) { - s = e.break; - r = s.beforeTarget; + breakBefore = root.subform.children[0].breakBefore.children[0]; + breakBeforeTarget = breakBefore.target; + } else if (root.break?.beforeTarget) { + breakBefore = root.break; + breakBeforeTarget = breakBefore.beforeTarget; } else if ( - e.subform.children.length >= 1 && - e.subform.children[0].break?.beforeTarget + root.subform.children.length >= 1 && + root.subform.children[0].break?.beforeTarget ) { - s = e.subform.children[0].break; - r = s.beforeTarget; + breakBefore = root.subform.children[0].break; + breakBeforeTarget = breakBefore.beforeTarget; } - if (s) { - const e = this[Vr](r, s[pr]()); - if (e instanceof PageArea) { - a = e; - s[ar] = {}; + if (breakBefore) { + const target = this[$searchNode]( + breakBeforeTarget, + breakBefore[$getParent](), + ); + if (target instanceof PageArea) { + pageArea = target; + breakBefore[$extra] = {}; } } - a || (a = t[0]); - a[ar] = { numberOfUse: 1 }; - const n = a[pr](); - n[ar] = { + if (!pageArea) { + pageArea = pageAreas[0]; + } + pageArea[$extra] = { numberOfUse: 1, - pageIndex: n.pageArea.children.indexOf(a), + }; + const pageAreaParent = pageArea[$getParent](); + pageAreaParent[$extra] = { + numberOfUse: 1, + pageIndex: pageAreaParent.pageArea.children.indexOf(pageArea), pageSetIndex: 0, }; - let g, - o = null, - c = null, - C = !0, - h = 0, - l = 0; - for (;;) { - if (C) h = 0; - else { - i.children.pop(); - if (3 == ++h) { + let targetPageArea; + let leader = null; + let trailer = null; + let hasSomething = true; + let hasSomethingCounter = 0; + let startIndex = 0; + while (true) { + if (!hasSomething) { + mainHtml.children.pop(); + if (++hasSomethingCounter === MAX_EMPTY_PAGES) { warn("XFA - Something goes wrong: please file a bug."); - return i; + return mainHtml; } + } else { + hasSomethingCounter = 0; } - g = null; - this[ar].currentPageArea = a; - const t = a[an]().html; - i.children.push(t); - if (o) { - this[ar].noLayoutFailure = !0; - t.children.push(o[an](a[ar].space).html); - o = null; + targetPageArea = null; + this[$extra].currentPageArea = pageArea; + const page = pageArea[$toHTML]().html; + mainHtml.children.push(page); + if (leader) { + this[$extra].noLayoutFailure = true; + page.children.push(leader[$toHTML](pageArea[$extra].space).html); + leader = null; } - if (c) { - this[ar].noLayoutFailure = !0; - t.children.push(c[an](a[ar].space).html); - c = null; + if (trailer) { + this[$extra].noLayoutFailure = true; + page.children.push(trailer[$toHTML](pageArea[$extra].space).html); + trailer = null; } - const s = a.contentArea.children, - r = t.children.filter((e) => - e.attributes.class.includes("xfaContentarea"), - ); - C = !1; - this[ar].firstUnsplittable = null; - this[ar].noLayoutFailure = !1; - const flush = (t) => { - const i = e[rr](); - if (i) { - C ||= i.children?.length > 0; - r[t].children.push(i); + const contentAreas = pageArea.contentArea.children; + const htmlContentAreas = page.children.filter((node) => + node.attributes.class.includes("xfaContentarea"), + ); + hasSomething = false; + this[$extra].firstUnsplittable = null; + this[$extra].noLayoutFailure = false; + const flush = (index) => { + const html = root[$flushHTML](); + if (html) { + hasSomething ||= html.children?.length > 0; + htmlContentAreas[index].children.push(html); } }; - for (let t = l, a = s.length; t < a; t++) { - const a = (this[ar].currentContentArea = s[t]), - n = { width: a.w, height: a.h }; - l = 0; - if (o) { - r[t].children.push(o[an](n).html); - o = null; + for (let i = startIndex, ii = contentAreas.length; i < ii; i++) { + const contentArea = (this[$extra].currentContentArea = contentAreas[i]); + const space = { + width: contentArea.w, + height: contentArea.h, + }; + startIndex = 0; + if (leader) { + htmlContentAreas[i].children.push(leader[$toHTML](space).html); + leader = null; } - if (c) { - r[t].children.push(c[an](n).html); - c = null; + if (trailer) { + htmlContentAreas[i].children.push(trailer[$toHTML](space).html); + trailer = null; } - const h = e[an](n); - if (h.success) { - if (h.html) { - C ||= h.html.children?.length > 0; - r[t].children.push(h.html); - } else !C && i.children.length > 1 && i.children.pop(); - return i; - } - if (h.isBreak()) { - const e = h.breakNode; - flush(t); - if ("auto" === e.targetType) continue; - if (e.leader) { - o = this[Vr](e.leader, e[pr]()); - o = o ? o[0] : null; + const html = root[$toHTML](space); + if (html.success) { + if (html.html) { + hasSomething ||= html.html.children?.length > 0; + htmlContentAreas[i].children.push(html.html); + } else if (!hasSomething && mainHtml.children.length > 1) { + mainHtml.children.pop(); } - if (e.trailer) { - c = this[Vr](e.trailer, e[pr]()); - c = c ? c[0] : null; + return mainHtml; + } + if (html.isBreak()) { + const node = html.breakNode; + flush(i); + if (node.targetType === "auto") { + continue; } - if ("pageArea" === e.targetType) { - g = e[ar].target; - t = 1 / 0; - } else if (e[ar].target) { - g = e[ar].target; - l = e[ar].index + 1; - t = 1 / 0; - } else t = e[ar].index; - } else if (this[ar].overflowNode) { - const e = this[ar].overflowNode; - this[ar].overflowNode = null; - const i = e[lr](), - a = i.target; - i.addLeader = null !== i.leader; - i.addTrailer = null !== i.trailer; - flush(t); - const r = t; - t = 1 / 0; - if (a instanceof PageArea) g = a; - else if (a instanceof ContentArea) { - const e = s.indexOf(a); - if (-1 !== e) e > r ? (t = e - 1) : (l = e); - else { - g = a[pr](); - l = g.contentArea.children.indexOf(a); + if (node.leader) { + leader = this[$searchNode](node.leader, node[$getParent]()); + leader = leader ? leader[0] : null; + } + if (node.trailer) { + trailer = this[$searchNode](node.trailer, node[$getParent]()); + trailer = trailer ? trailer[0] : null; + } + if (node.targetType === "pageArea") { + targetPageArea = node[$extra].target; + i = Infinity; + } else if (!node[$extra].target) { + i = node[$extra].index; + } else { + targetPageArea = node[$extra].target; + startIndex = node[$extra].index + 1; + i = Infinity; + } + continue; + } + if (this[$extra].overflowNode) { + const node = this[$extra].overflowNode; + this[$extra].overflowNode = null; + const overflowExtra = node[$getExtra](); + const target = overflowExtra.target; + overflowExtra.addLeader = overflowExtra.leader !== null; + overflowExtra.addTrailer = overflowExtra.trailer !== null; + flush(i); + const currentIndex = i; + i = Infinity; + if (target instanceof PageArea) { + targetPageArea = target; + } else if (target instanceof ContentArea) { + const index = contentAreas.indexOf(target); + if (index !== -1) { + if (index > currentIndex) { + i = index - 1; + } else { + startIndex = index; + } + } else { + targetPageArea = target[$getParent](); + startIndex = targetPageArea.contentArea.children.indexOf(target); } } - } else flush(t); + continue; + } + flush(i); } - this[ar].pageNumber += 1; - g && (g[Lr]() ? (g[ar].numberOfUse += 1) : (g = null)); - a = g || a[dr](); + this[$extra].pageNumber += 1; + if (targetPageArea) { + if (targetPageArea[$isUsable]()) { + targetPageArea[$extra].numberOfUse += 1; + } else { + targetPageArea = null; + } + } + pageArea = targetPageArea || pageArea[$getNextPage](); yield null; } } } class Text extends ContentObject { - constructor(e) { - super(Hn, "text"); - this.id = e.id || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "text"); + this.id = attributes.id || ""; this.maxChars = getInteger({ - data: e.maxChars, + data: attributes.maxChars, defaultValue: 0, - validate: (e) => e >= 0, + validate: (x) => x >= 0, }); - this.name = e.name || ""; - this.rid = e.rid || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.name = attributes.name || ""; + this.rid = attributes.rid || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } - [Ws]() { - return !0; + [$acceptWhitespace]() { + return true; } - [Kr](e) { - if (e[Jr] === on.xhtml.id) { - this[er] = e; - return !0; + [$onChild](child) { + if (child[$namespaceId] === NamespaceIds.xhtml.id) { + this[$content] = child; + return true; } - warn(`XFA - Invalid content in Text: ${e[Yr]}.`); - return !1; + warn(`XFA - Invalid content in Text: ${child[$nodeName]}.`); + return false; } - [qr](e) { - this[er] instanceof XFAObject || super[qr](e); + [$onText](str) { + if (this[$content] instanceof XFAObject) { + return; + } + super[$onText](str); } - [sr]() { - "string" == typeof this[er] && - (this[er] = this[er].replaceAll("\r\n", "\n")); + [$finalize]() { + if (typeof this[$content] === "string") { + this[$content] = this[$content].replaceAll("\r\n", "\n"); + } } - [lr]() { - return "string" == typeof this[er] - ? this[er] - .split(/[\u2029\u2028\n]/) - .reduce((e, t) => { - t && e.push(t); - return e; - }, []) - .join("\n") - : this[er][en](); + [$getExtra]() { + if (typeof this[$content] === "string") { + return this[$content] + .split(/[\u2029\u2028\n]/) + .reduce((acc, line) => { + if (line) { + acc.push(line); + } + return acc; + }, []) + .join("\n"); + } + return this[$content][$text](); } - [an](e) { - if ("string" == typeof this[er]) { - const e = valueToHtml(this[er]).html; - if (this[er].includes("\u2029")) { - e.name = "div"; - e.children = []; - this[er] + [$toHTML](availableSpace) { + if (typeof this[$content] === "string") { + const html = valueToHtml(this[$content]).html; + if (this[$content].includes("\u2029")) { + html.name = "div"; + html.children = []; + this[$content] .split("\u2029") - .map((e) => - e.split(/[\u2028\n]/).reduce((e, t) => { - e.push({ name: "span", value: t }, { name: "br" }); - return e; + .map((para) => + para.split(/[\u2028\n]/).reduce((acc, line) => { + acc.push( + { + name: "span", + value: line, + }, + { + name: "br", + }, + ); + return acc; }, []), ) - .forEach((t) => { - e.children.push({ name: "p", children: t }); + .forEach((lines) => { + html.children.push({ + name: "p", + children: lines, + }); }); - } else if (/[\u2028\n]/.test(this[er])) { - e.name = "div"; - e.children = []; - this[er].split(/[\u2028\n]/).forEach((t) => { - e.children.push({ name: "span", value: t }, { name: "br" }); + } else if (/[\u2028\n]/.test(this[$content])) { + html.name = "div"; + html.children = []; + this[$content].split(/[\u2028\n]/).forEach((line) => { + html.children.push( + { + name: "span", + value: line, + }, + { + name: "br", + }, + ); }); } - return HTMLResult.success(e); + return HTMLResult.success(html); } - return this[er][an](e); + return this[$content][$toHTML](availableSpace); } } class TextEdit extends XFAObject { - constructor(e) { - super(Hn, "textEdit", !0); + constructor(attributes) { + super(TEMPLATE_NS_ID, "textEdit", true); this.allowRichText = getInteger({ - data: e.allowRichText, + data: attributes.allowRichText, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); - this.hScrollPolicy = getStringOption(e.hScrollPolicy, [ + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, [ "auto", "off", "on", ]); - this.id = e.id || ""; + this.id = attributes.id || ""; this.multiLine = getInteger({ - data: e.multiLine, + data: attributes.multiLine, defaultValue: "", - validate: (e) => 0 === e || 1 === e, + validate: (x) => x === 0 || x === 1, }); - this.use = e.use || ""; - this.usehref = e.usehref || ""; - this.vScrollPolicy = getStringOption(e.vScrollPolicy, [ + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.vScrollPolicy = getStringOption(attributes.vScrollPolicy, [ "auto", "off", "on", @@ -47472,97 +57412,102 @@ class TextEdit extends XFAObject { this.extras = null; this.margin = null; } - [an](e) { - const t = toStyle(this, "border", "font", "margin"); - let i; - const a = this[pr]()[pr](); - "" === this.multiLine && (this.multiLine = a instanceof Draw ? 1 : 0); - i = - 1 === this.multiLine - ? { - name: "textarea", - attributes: { - dataId: a[tr]?.[nn] || a[nn], - fieldId: a[nn], - class: ["xfaTextfield"], - style: t, - "aria-label": ariaLabel(a), - "aria-required": !1, - }, - } - : { - name: "input", - attributes: { - type: "text", - dataId: a[tr]?.[nn] || a[nn], - fieldId: a[nn], - class: ["xfaTextfield"], - style: t, - "aria-label": ariaLabel(a), - "aria-required": !1, - }, - }; - if (isRequired(a)) { - i.attributes["aria-required"] = !0; - i.attributes.required = !0; + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "font", "margin"); + let html; + const field = this[$getParent]()[$getParent](); + if (this.multiLine === "") { + this.multiLine = field instanceof Draw ? 1 : 0; + } + if (this.multiLine === 1) { + html = { + name: "textarea", + attributes: { + dataId: field[$data]?.[$uid] || field[$uid], + fieldId: field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false, + }, + }; + } else { + html = { + name: "input", + attributes: { + type: "text", + dataId: field[$data]?.[$uid] || field[$uid], + fieldId: field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false, + }, + }; + } + if (isRequired(field)) { + html.attributes["aria-required"] = true; + html.attributes.required = true; } return HTMLResult.success({ name: "label", - attributes: { class: ["xfaLabel"] }, - children: [i], + attributes: { + class: ["xfaLabel"], + }, + children: [html], }); } } class Time extends StringObject { - constructor(e) { - super(Hn, "time"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "time"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } - [sr]() { - const e = this[er].trim(); - this[er] = e ? new Date(e) : null; + [$finalize]() { + const date = this[$content].trim(); + this[$content] = date ? new Date(date) : null; } - [an](e) { - return valueToHtml(this[er] ? this[er].toString() : ""); + [$toHTML](availableSpace) { + return valueToHtml(this[$content] ? this[$content].toString() : ""); } } class TimeStamp extends XFAObject { - constructor(e) { - super(Hn, "timeStamp"); - this.id = e.id || ""; - this.server = e.server || ""; - this.type = getStringOption(e.type, ["optional", "required"]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "timeStamp"); + this.id = attributes.id || ""; + this.server = attributes.server || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class ToolTip extends StringObject { - constructor(e) { - super(Hn, "toolTip"); - this.id = e.id || ""; - this.rid = e.rid || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "toolTip"); + this.id = attributes.id || ""; + this.rid = attributes.rid || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Traversal extends XFAObject { - constructor(e) { - super(Hn, "traversal", !0); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "traversal", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; this.traverse = new XFAObjectArray(); } } class Traverse extends XFAObject { - constructor(e) { - super(Hn, "traverse", !0); - this.id = e.id || ""; - this.operation = getStringOption(e.operation, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "traverse", true); + this.id = attributes.id || ""; + this.operation = getStringOption(attributes.operation, [ "next", "back", "down", @@ -47571,25 +57516,25 @@ class Traverse extends XFAObject { "right", "up", ]); - this.ref = e.ref || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.ref = attributes.ref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; this.script = null; } get name() { return this.operation; } - [Mr]() { - return !1; + [$isTransparent]() { + return false; } } class Ui extends XFAObject { - constructor(e) { - super(Hn, "ui", !0); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "ui", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; this.picture = null; this.barcode = null; @@ -47604,46 +57549,52 @@ class Ui extends XFAObject { this.signature = null; this.textEdit = null; } - [lr]() { - if (void 0 === this[ar]) { - for (const e of Object.getOwnPropertyNames(this)) { - if ("extras" === e || "picture" === e) continue; - const t = this[e]; - if (t instanceof XFAObject) { - this[ar] = t; - return t; + [$getExtra]() { + if (this[$extra] === undefined) { + for (const name of Object.getOwnPropertyNames(this)) { + if (name === "extras" || name === "picture") { + continue; } + const obj = this[name]; + if (!(obj instanceof XFAObject)) { + continue; + } + this[$extra] = obj; + return obj; } - this[ar] = null; + this[$extra] = null; } - return this[ar]; + return this[$extra]; } - [an](e) { - const t = this[lr](); - return t ? t[an](e) : HTMLResult.EMPTY; + [$toHTML](availableSpace) { + const obj = this[$getExtra](); + if (obj) { + return obj[$toHTML](availableSpace); + } + return HTMLResult.EMPTY; } } class Validate extends XFAObject { - constructor(e) { - super(Hn, "validate", !0); - this.formatTest = getStringOption(e.formatTest, [ + constructor(attributes) { + super(TEMPLATE_NS_ID, "validate", true); + this.formatTest = getStringOption(attributes.formatTest, [ "warning", "disabled", "error", ]); - this.id = e.id || ""; - this.nullTest = getStringOption(e.nullTest, [ + this.id = attributes.id || ""; + this.nullTest = getStringOption(attributes.nullTest, [ "disabled", "error", "warning", ]); - this.scriptTest = getStringOption(e.scriptTest, [ + this.scriptTest = getStringOption(attributes.scriptTest, [ "error", "disabled", "warning", ]); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.extras = null; this.message = null; this.picture = null; @@ -47651,17 +57602,17 @@ class Validate extends XFAObject { } } class Value extends XFAObject { - constructor(e) { - super(Hn, "value", !0); - this.id = e.id || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "value", true); + this.id = attributes.id || ""; this.override = getInteger({ - data: e.override, + data: attributes.override, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); - this.relevant = getRelevant(e.relevant); - this.use = e.use || ""; - this.usehref = e.usehref || ""; + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.arc = null; this.boolean = null; this.date = null; @@ -47676,55 +57627,68 @@ class Value extends XFAObject { this.text = null; this.time = null; } - [$r](e) { - const t = this[pr](); - if (t instanceof Field && t.ui?.imageEdit) { - if (!this.image) { - this.image = new Image({}); - this[Xs](this.image); + [$setValue](value) { + const parent = this[$getParent](); + if (parent instanceof Field) { + if (parent.ui?.imageEdit) { + if (!this.image) { + this.image = new Image({}); + this[$appendChild](this.image); + } + this.image[$content] = value[$content]; + return; } - this.image[er] = e[er]; + } + const valueName = value[$nodeName]; + if (this[valueName] !== null) { + this[valueName][$content] = value[$content]; return; } - const i = e[Yr]; - if (null === this[i]) { - for (const e of Object.getOwnPropertyNames(this)) { - const t = this[e]; - if (t instanceof XFAObject) { - this[e] = null; - this[jr](t); - } + for (const name of Object.getOwnPropertyNames(this)) { + const obj = this[name]; + if (obj instanceof XFAObject) { + this[name] = null; + this[$removeChild](obj); } - this[e[Yr]] = e; - this[Xs](e); - } else this[i][er] = e[er]; + } + this[value[$nodeName]] = value; + this[$appendChild](value); } - [en]() { - if (this.exData) - return "string" == typeof this.exData[er] - ? this.exData[er].trim() - : this.exData[er][en]().trim(); - for (const e of Object.getOwnPropertyNames(this)) { - if ("image" === e) continue; - const t = this[e]; - if (t instanceof XFAObject) return (t[er] || "").toString().trim(); + [$text]() { + if (this.exData) { + if (typeof this.exData[$content] === "string") { + return this.exData[$content].trim(); + } + return this.exData[$content][$text]().trim(); + } + for (const name of Object.getOwnPropertyNames(this)) { + if (name === "image") { + continue; + } + const obj = this[name]; + if (obj instanceof XFAObject) { + return (obj[$content] || "").toString().trim(); + } } return null; } - [an](e) { - for (const t of Object.getOwnPropertyNames(this)) { - const i = this[t]; - if (i instanceof XFAObject) return i[an](e); + [$toHTML](availableSpace) { + for (const name of Object.getOwnPropertyNames(this)) { + const obj = this[name]; + if (!(obj instanceof XFAObject)) { + continue; + } + return obj[$toHTML](availableSpace); } return HTMLResult.EMPTY; } } class Variables extends XFAObject { - constructor(e) { - super(Hn, "variables", !0); - this.id = e.id || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(TEMPLATE_NS_ID, "variables", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; this.boolean = new XFAObjectArray(); this.date = new XFAObjectArray(); this.dateTime = new XFAObjectArray(); @@ -47738,371 +57702,374 @@ class Variables extends XFAObject { this.text = new XFAObjectArray(); this.time = new XFAObjectArray(); } - [Mr]() { - return !0; + [$isTransparent]() { + return true; } } class TemplateNamespace { - static [gn](e, t) { - if (TemplateNamespace.hasOwnProperty(e)) { - const i = TemplateNamespace[e](t); - i[_r](t); - return i; + static [$buildXFAObject](name, attributes) { + if (TemplateNamespace.hasOwnProperty(name)) { + const node = TemplateNamespace[name](attributes); + node[$setSetAttributes](attributes); + return node; } + return undefined; } - static appearanceFilter(e) { - return new AppearanceFilter(e); + static appearanceFilter(attrs) { + return new AppearanceFilter(attrs); } - static arc(e) { - return new Arc(e); + static arc(attrs) { + return new Arc(attrs); } - static area(e) { - return new Area(e); + static area(attrs) { + return new Area(attrs); } - static assist(e) { - return new Assist(e); + static assist(attrs) { + return new Assist(attrs); } - static barcode(e) { - return new Barcode(e); + static barcode(attrs) { + return new Barcode(attrs); } - static bind(e) { - return new Bind(e); + static bind(attrs) { + return new Bind(attrs); } - static bindItems(e) { - return new BindItems(e); + static bindItems(attrs) { + return new BindItems(attrs); } - static bookend(e) { - return new Bookend(e); + static bookend(attrs) { + return new Bookend(attrs); } - static boolean(e) { - return new BooleanElement(e); + static boolean(attrs) { + return new BooleanElement(attrs); } - static border(e) { - return new Border(e); + static border(attrs) { + return new Border(attrs); } - static break(e) { - return new Break(e); + static break(attrs) { + return new Break(attrs); } - static breakAfter(e) { - return new BreakAfter(e); + static breakAfter(attrs) { + return new BreakAfter(attrs); } - static breakBefore(e) { - return new BreakBefore(e); + static breakBefore(attrs) { + return new BreakBefore(attrs); } - static button(e) { - return new Button(e); + static button(attrs) { + return new Button(attrs); } - static calculate(e) { - return new Calculate(e); + static calculate(attrs) { + return new Calculate(attrs); } - static caption(e) { - return new Caption(e); + static caption(attrs) { + return new Caption(attrs); } - static certificate(e) { - return new Certificate(e); + static certificate(attrs) { + return new Certificate(attrs); } - static certificates(e) { - return new Certificates(e); + static certificates(attrs) { + return new Certificates(attrs); } - static checkButton(e) { - return new CheckButton(e); + static checkButton(attrs) { + return new CheckButton(attrs); } - static choiceList(e) { - return new ChoiceList(e); + static choiceList(attrs) { + return new ChoiceList(attrs); } - static color(e) { - return new Color(e); + static color(attrs) { + return new Color(attrs); } - static comb(e) { - return new Comb(e); + static comb(attrs) { + return new Comb(attrs); } - static connect(e) { - return new Connect(e); + static connect(attrs) { + return new Connect(attrs); } - static contentArea(e) { - return new ContentArea(e); + static contentArea(attrs) { + return new ContentArea(attrs); } - static corner(e) { - return new Corner(e); + static corner(attrs) { + return new Corner(attrs); } - static date(e) { - return new DateElement(e); + static date(attrs) { + return new DateElement(attrs); } - static dateTime(e) { - return new DateTime(e); + static dateTime(attrs) { + return new DateTime(attrs); } - static dateTimeEdit(e) { - return new DateTimeEdit(e); + static dateTimeEdit(attrs) { + return new DateTimeEdit(attrs); } - static decimal(e) { - return new Decimal(e); + static decimal(attrs) { + return new Decimal(attrs); } - static defaultUi(e) { - return new DefaultUi(e); + static defaultUi(attrs) { + return new DefaultUi(attrs); } - static desc(e) { - return new Desc(e); + static desc(attrs) { + return new Desc(attrs); } - static digestMethod(e) { - return new DigestMethod(e); + static digestMethod(attrs) { + return new DigestMethod(attrs); } - static digestMethods(e) { - return new DigestMethods(e); + static digestMethods(attrs) { + return new DigestMethods(attrs); } - static draw(e) { - return new Draw(e); + static draw(attrs) { + return new Draw(attrs); } - static edge(e) { - return new Edge(e); + static edge(attrs) { + return new Edge(attrs); } - static encoding(e) { - return new Encoding(e); + static encoding(attrs) { + return new Encoding(attrs); } - static encodings(e) { - return new Encodings(e); + static encodings(attrs) { + return new Encodings(attrs); } - static encrypt(e) { - return new Encrypt(e); + static encrypt(attrs) { + return new Encrypt(attrs); } - static encryptData(e) { - return new EncryptData(e); + static encryptData(attrs) { + return new EncryptData(attrs); } - static encryption(e) { - return new Encryption(e); + static encryption(attrs) { + return new Encryption(attrs); } - static encryptionMethod(e) { - return new EncryptionMethod(e); + static encryptionMethod(attrs) { + return new EncryptionMethod(attrs); } - static encryptionMethods(e) { - return new EncryptionMethods(e); + static encryptionMethods(attrs) { + return new EncryptionMethods(attrs); } - static event(e) { - return new Event(e); + static event(attrs) { + return new Event(attrs); } - static exData(e) { - return new ExData(e); + static exData(attrs) { + return new ExData(attrs); } - static exObject(e) { - return new ExObject(e); + static exObject(attrs) { + return new ExObject(attrs); } - static exclGroup(e) { - return new ExclGroup(e); + static exclGroup(attrs) { + return new ExclGroup(attrs); } - static execute(e) { - return new Execute(e); + static execute(attrs) { + return new Execute(attrs); } - static extras(e) { - return new Extras(e); + static extras(attrs) { + return new Extras(attrs); } - static field(e) { - return new Field(e); + static field(attrs) { + return new Field(attrs); } - static fill(e) { - return new Fill(e); + static fill(attrs) { + return new Fill(attrs); } - static filter(e) { - return new Filter(e); + static filter(attrs) { + return new Filter(attrs); } - static float(e) { - return new Float(e); + static float(attrs) { + return new Float(attrs); } - static font(e) { - return new template_Font(e); + static font(attrs) { + return new template_Font(attrs); } - static format(e) { - return new Format(e); + static format(attrs) { + return new Format(attrs); } - static handler(e) { - return new Handler(e); + static handler(attrs) { + return new Handler(attrs); } - static hyphenation(e) { - return new Hyphenation(e); + static hyphenation(attrs) { + return new Hyphenation(attrs); } - static image(e) { - return new Image(e); + static image(attrs) { + return new Image(attrs); } - static imageEdit(e) { - return new ImageEdit(e); + static imageEdit(attrs) { + return new ImageEdit(attrs); } - static integer(e) { - return new Integer(e); + static integer(attrs) { + return new Integer(attrs); } - static issuers(e) { - return new Issuers(e); + static issuers(attrs) { + return new Issuers(attrs); } - static items(e) { - return new Items(e); + static items(attrs) { + return new Items(attrs); } - static keep(e) { - return new Keep(e); + static keep(attrs) { + return new Keep(attrs); } - static keyUsage(e) { - return new KeyUsage(e); + static keyUsage(attrs) { + return new KeyUsage(attrs); } - static line(e) { - return new Line(e); + static line(attrs) { + return new Line(attrs); } - static linear(e) { - return new Linear(e); + static linear(attrs) { + return new Linear(attrs); } - static lockDocument(e) { - return new LockDocument(e); + static lockDocument(attrs) { + return new LockDocument(attrs); } - static manifest(e) { - return new Manifest(e); + static manifest(attrs) { + return new Manifest(attrs); } - static margin(e) { - return new Margin(e); + static margin(attrs) { + return new Margin(attrs); } - static mdp(e) { - return new Mdp(e); + static mdp(attrs) { + return new Mdp(attrs); } - static medium(e) { - return new Medium(e); + static medium(attrs) { + return new Medium(attrs); } - static message(e) { - return new Message(e); + static message(attrs) { + return new Message(attrs); } - static numericEdit(e) { - return new NumericEdit(e); + static numericEdit(attrs) { + return new NumericEdit(attrs); } - static occur(e) { - return new Occur(e); + static occur(attrs) { + return new Occur(attrs); } - static oid(e) { - return new Oid(e); + static oid(attrs) { + return new Oid(attrs); } - static oids(e) { - return new Oids(e); + static oids(attrs) { + return new Oids(attrs); } - static overflow(e) { - return new Overflow(e); + static overflow(attrs) { + return new Overflow(attrs); } - static pageArea(e) { - return new PageArea(e); + static pageArea(attrs) { + return new PageArea(attrs); } - static pageSet(e) { - return new PageSet(e); + static pageSet(attrs) { + return new PageSet(attrs); } - static para(e) { - return new Para(e); + static para(attrs) { + return new Para(attrs); } - static passwordEdit(e) { - return new PasswordEdit(e); + static passwordEdit(attrs) { + return new PasswordEdit(attrs); } - static pattern(e) { - return new template_Pattern(e); + static pattern(attrs) { + return new template_Pattern(attrs); } - static picture(e) { - return new Picture(e); + static picture(attrs) { + return new Picture(attrs); } - static proto(e) { - return new Proto(e); + static proto(attrs) { + return new Proto(attrs); } - static radial(e) { - return new Radial(e); + static radial(attrs) { + return new Radial(attrs); } - static reason(e) { - return new Reason(e); + static reason(attrs) { + return new Reason(attrs); } - static reasons(e) { - return new Reasons(e); + static reasons(attrs) { + return new Reasons(attrs); } - static rectangle(e) { - return new Rectangle(e); + static rectangle(attrs) { + return new Rectangle(attrs); } - static ref(e) { - return new RefElement(e); + static ref(attrs) { + return new RefElement(attrs); } - static script(e) { - return new Script(e); + static script(attrs) { + return new Script(attrs); } - static setProperty(e) { - return new SetProperty(e); + static setProperty(attrs) { + return new SetProperty(attrs); } - static signData(e) { - return new SignData(e); + static signData(attrs) { + return new SignData(attrs); } - static signature(e) { - return new Signature(e); + static signature(attrs) { + return new Signature(attrs); } - static signing(e) { - return new Signing(e); + static signing(attrs) { + return new Signing(attrs); } - static solid(e) { - return new Solid(e); + static solid(attrs) { + return new Solid(attrs); } - static speak(e) { - return new Speak(e); + static speak(attrs) { + return new Speak(attrs); } - static stipple(e) { - return new Stipple(e); + static stipple(attrs) { + return new Stipple(attrs); } - static subform(e) { - return new Subform(e); + static subform(attrs) { + return new Subform(attrs); } - static subformSet(e) { - return new SubformSet(e); + static subformSet(attrs) { + return new SubformSet(attrs); } - static subjectDN(e) { - return new SubjectDN(e); + static subjectDN(attrs) { + return new SubjectDN(attrs); } - static subjectDNs(e) { - return new SubjectDNs(e); + static subjectDNs(attrs) { + return new SubjectDNs(attrs); } - static submit(e) { - return new Submit(e); + static submit(attrs) { + return new Submit(attrs); } - static template(e) { - return new Template(e); + static template(attrs) { + return new Template(attrs); } - static text(e) { - return new Text(e); + static text(attrs) { + return new Text(attrs); } - static textEdit(e) { - return new TextEdit(e); + static textEdit(attrs) { + return new TextEdit(attrs); } - static time(e) { - return new Time(e); + static time(attrs) { + return new Time(attrs); } - static timeStamp(e) { - return new TimeStamp(e); + static timeStamp(attrs) { + return new TimeStamp(attrs); } - static toolTip(e) { - return new ToolTip(e); + static toolTip(attrs) { + return new ToolTip(attrs); } - static traversal(e) { - return new Traversal(e); + static traversal(attrs) { + return new Traversal(attrs); } - static traverse(e) { - return new Traverse(e); + static traverse(attrs) { + return new Traverse(attrs); } - static ui(e) { - return new Ui(e); + static ui(attrs) { + return new Ui(attrs); } - static validate(e) { - return new Validate(e); + static validate(attrs) { + return new Validate(attrs); } - static value(e) { - return new Value(e); + static value(attrs) { + return new Value(attrs); } - static variables(e) { - return new Variables(e); + static variables(attrs) { + return new Variables(attrs); } -} -const Tn = on.datasets.id; -function createText(e) { - const t = new Text({}); - t[er] = e; - return t; +} // ./src/core/xfa/bind.js + +const bind_NS_DATASETS = NamespaceIds.datasets.id; +function createText(content) { + const node = new Text({}); + node[$content] = content; + return node; } class Binder { - constructor(e) { - this.root = e; - this.datasets = e.datasets; - this.data = e.datasets?.data || new XmlObject(on.datasets.id, "data"); - this.emptyMerge = 0 === this.data[Er]().length; - this.root.form = this.form = e.template[$s](); + constructor(root) { + this.root = root; + this.datasets = root.datasets; + this.data = + root.datasets?.data || new XmlObject(NamespaceIds.datasets.id, "data"); + this.emptyMerge = this.data[$getChildren]().length === 0; + this.root.form = this.form = root.template[$clone](); } _isConsumeData() { return !this.emptyMerge && this._mergeMode; @@ -48117,362 +58084,478 @@ class Binder { getData() { return this.data; } - _bindValue(e, t, i) { - e[tr] = t; - if (e[wr]()) - if (t[Rr]()) { - const i = t[hr](); - e[$r](createText(i)); + _bindValue(formNode, data, picture) { + formNode[$data] = data; + if (formNode[$hasSettableValue]()) { + if (data[$isDataValue]()) { + const value = data[$getDataValue](); + formNode[$setValue](createText(value)); } else if ( - e instanceof Field && - "multiSelect" === e.ui?.choiceList?.open + formNode instanceof Field && + formNode.ui?.choiceList?.open === "multiSelect" ) { - const i = t[Er]() - .map((e) => e[er].trim()) + const value = data[$getChildren]() + .map((child) => child[$content].trim()) .join("\n"); - e[$r](createText(i)); - } else - this._isConsumeData() && warn("XFA - Nodes haven't the same type."); - else - !t[Rr]() || this._isMatchTemplate() - ? this._bindElement(e, t) - : warn("XFA - Nodes haven't the same type."); - } - _findDataByNameToConsume(e, t, i, a) { - if (!e) return null; - let s, r; - for (let a = 0; a < 3; a++) { - s = i[Qr](e, !1, !0); - for (;;) { - r = s.next().value; - if (!r) break; - if (t === r[Rr]()) return r; + formNode[$setValue](createText(value)); + } else if (this._isConsumeData()) { + warn(`XFA - Nodes haven't the same type.`); } - if (i[Jr] === on.datasets.id && "data" === i[Yr]) break; - i = i[pr](); + } else if (!data[$isDataValue]() || this._isMatchTemplate()) { + this._bindElement(formNode, data); + } else { + warn(`XFA - Nodes haven't the same type.`); } - if (!a) return null; - s = this.data[Qr](e, !0, !1); - r = s.next().value; - if (r) return r; - s = this.data[nr](e, !0); - r = s.next().value; - return r?.[Rr]() ? r : null; } - _setProperties(e, t) { - if (e.hasOwnProperty("setProperty")) - for (const { ref: i, target: a, connection: s } of e.setProperty - .children) { - if (s) continue; - if (!i) continue; - const r = searchNode(this.root, t, i, !1, !1); - if (!r) { - warn(`XFA - Invalid reference: ${i}.`); - continue; + _findDataByNameToConsume(name, isValue, dataNode, global) { + if (!name) { + return null; + } + let generator, match; + for (let i = 0; i < 3; i++) { + generator = dataNode[$getRealChildrenByNameIt](name, false, true); + while (true) { + match = generator.next().value; + if (!match) { + break; } - const [n] = r; - if (!n[Nr](this.data)) { - warn("XFA - Invalid node: must be a data node."); - continue; + if (isValue === match[$isDataValue]()) { + return match; } - const g = searchNode(this.root, e, a, !1, !1); - if (!g) { - warn(`XFA - Invalid target: ${a}.`); - continue; - } - const [o] = g; - if (!o[Nr](e)) { - warn("XFA - Invalid target: must be a property or subproperty."); - continue; - } - const c = o[pr](); - if (o instanceof SetProperty || c instanceof SetProperty) { - warn( - "XFA - Invalid target: cannot be a setProperty or one of its properties.", - ); - continue; - } - if (o instanceof BindItems || c instanceof BindItems) { - warn( - "XFA - Invalid target: cannot be a bindItems or one of its properties.", - ); - continue; - } - const C = n[en](), - h = o[Yr]; - if (o instanceof XFAAttribute) { - const e = Object.create(null); - e[h] = C; - const t = Reflect.construct(Object.getPrototypeOf(c).constructor, [ - e, - ]); - c[h] = t[h]; - } else if (o.hasOwnProperty(er)) { - o[tr] = n; - o[er] = C; - o[sr](); - } else warn("XFA - Invalid node to use in setProperty"); } + if ( + dataNode[$namespaceId] === NamespaceIds.datasets.id && + dataNode[$nodeName] === "data" + ) { + break; + } + dataNode = dataNode[$getParent](); + } + if (!global) { + return null; + } + generator = this.data[$getRealChildrenByNameIt](name, true, false); + match = generator.next().value; + if (match) { + return match; + } + generator = this.data[$getAttributeIt](name, true); + match = generator.next().value; + if (match?.[$isDataValue]()) { + return match; + } + return null; } - _bindItems(e, t) { - if ( - !e.hasOwnProperty("items") || - !e.hasOwnProperty("bindItems") || - e.bindItems.isEmpty() - ) + _setProperties(formNode, dataNode) { + if (!formNode.hasOwnProperty("setProperty")) { return; - for (const t of e.items.children) e[jr](t); - e.items.clear(); - const i = new Items({}), - a = new Items({}); - e[Xs](i); - e.items.push(i); - e[Xs](a); - e.items.push(a); - for (const { ref: s, labelRef: r, valueRef: n, connection: g } of e - .bindItems.children) { - if (g) continue; - if (!s) continue; - const e = searchNode(this.root, t, s, !1, !1); - if (e) - for (const t of e) { - if (!t[Nr](this.datasets)) { - warn(`XFA - Invalid ref (${s}): must be a datasets child.`); - continue; - } - const e = searchNode(this.root, t, r, !0, !1); - if (!e) { - warn(`XFA - Invalid label: ${r}.`); - continue; - } - const [g] = e; - if (!g[Nr](this.datasets)) { - warn("XFA - Invalid label: must be a datasets child."); - continue; - } - const o = searchNode(this.root, t, n, !0, !1); - if (!o) { - warn(`XFA - Invalid value: ${n}.`); - continue; - } - const [c] = o; - if (!c[Nr](this.datasets)) { - warn("XFA - Invalid value: must be a datasets child."); - continue; - } - const C = createText(g[en]()), - h = createText(c[en]()); - i[Xs](C); - i.text.push(C); - a[Xs](h); - a.text.push(h); + } + for (const { ref, target, connection } of formNode.setProperty.children) { + if (connection) { + continue; + } + if (!ref) { + continue; + } + const nodes = searchNode(this.root, dataNode, ref, false, false); + if (!nodes) { + warn(`XFA - Invalid reference: ${ref}.`); + continue; + } + const [node] = nodes; + if (!node[$isDescendent](this.data)) { + warn(`XFA - Invalid node: must be a data node.`); + continue; + } + const targetNodes = searchNode(this.root, formNode, target, false, false); + if (!targetNodes) { + warn(`XFA - Invalid target: ${target}.`); + continue; + } + const [targetNode] = targetNodes; + if (!targetNode[$isDescendent](formNode)) { + warn(`XFA - Invalid target: must be a property or subproperty.`); + continue; + } + const targetParent = targetNode[$getParent](); + if ( + targetNode instanceof SetProperty || + targetParent instanceof SetProperty + ) { + warn( + `XFA - Invalid target: cannot be a setProperty or one of its properties.`, + ); + continue; + } + if ( + targetNode instanceof BindItems || + targetParent instanceof BindItems + ) { + warn( + `XFA - Invalid target: cannot be a bindItems or one of its properties.`, + ); + continue; + } + const content = node[$text](); + const name = targetNode[$nodeName]; + if (targetNode instanceof XFAAttribute) { + const attrs = Object.create(null); + attrs[name] = content; + const obj = Reflect.construct( + Object.getPrototypeOf(targetParent).constructor, + [attrs], + ); + targetParent[name] = obj[name]; + continue; + } + if (!targetNode.hasOwnProperty($content)) { + warn(`XFA - Invalid node to use in setProperty`); + continue; + } + targetNode[$data] = node; + targetNode[$content] = content; + targetNode[$finalize](); + } + } + _bindItems(formNode, dataNode) { + if ( + !formNode.hasOwnProperty("items") || + !formNode.hasOwnProperty("bindItems") || + formNode.bindItems.isEmpty() + ) { + return; + } + for (const item of formNode.items.children) { + formNode[$removeChild](item); + } + formNode.items.clear(); + const labels = new Items({}); + const values = new Items({}); + formNode[$appendChild](labels); + formNode.items.push(labels); + formNode[$appendChild](values); + formNode.items.push(values); + for (const { ref, labelRef, valueRef, connection } of formNode.bindItems + .children) { + if (connection) { + continue; + } + if (!ref) { + continue; + } + const nodes = searchNode(this.root, dataNode, ref, false, false); + if (!nodes) { + warn(`XFA - Invalid reference: ${ref}.`); + continue; + } + for (const node of nodes) { + if (!node[$isDescendent](this.datasets)) { + warn(`XFA - Invalid ref (${ref}): must be a datasets child.`); + continue; } - else warn(`XFA - Invalid reference: ${s}.`); - } - } - _bindOccurrences(e, t, i) { - let a; - if (t.length > 1) { - a = e[$s](); - a[jr](a.occur); - a.occur = null; - } - this._bindValue(e, t[0], i); - this._setProperties(e, t[0]); - this._bindItems(e, t[0]); - if (1 === t.length) return; - const s = e[pr](), - r = e[Yr], - n = s[br](e); - for (let e = 1, g = t.length; e < g; e++) { - const g = t[e], - o = a[$s](); - s[r].push(o); - s[Fr](n + e, o); - this._bindValue(o, g, i); - this._setProperties(o, g); - this._bindItems(o, g); - } - } - _createOccurrences(e) { - if (!this.emptyMerge) return; - const { occur: t } = e; - if (!t || t.initial <= 1) return; - const i = e[pr](), - a = e[Yr]; - if (!(i[a] instanceof XFAObjectArray)) return; - let s; - s = e.name - ? i[a].children.filter((t) => t.name === e.name).length - : i[a].children.length; - const r = i[br](e) + 1, - n = t.initial - s; - if (n) { - const t = e[$s](); - t[jr](t.occur); - t.occur = null; - i[a].push(t); - i[Fr](r, t); - for (let e = 1; e < n; e++) { - const s = t[$s](); - i[a].push(s); - i[Fr](r + e, s); + const labelNodes = searchNode(this.root, node, labelRef, true, false); + if (!labelNodes) { + warn(`XFA - Invalid label: ${labelRef}.`); + continue; + } + const [labelNode] = labelNodes; + if (!labelNode[$isDescendent](this.datasets)) { + warn(`XFA - Invalid label: must be a datasets child.`); + continue; + } + const valueNodes = searchNode(this.root, node, valueRef, true, false); + if (!valueNodes) { + warn(`XFA - Invalid value: ${valueRef}.`); + continue; + } + const [valueNode] = valueNodes; + if (!valueNode[$isDescendent](this.datasets)) { + warn(`XFA - Invalid value: must be a datasets child.`); + continue; + } + const label = createText(labelNode[$text]()); + const value = createText(valueNode[$text]()); + labels[$appendChild](label); + labels.text.push(label); + values[$appendChild](value); + values.text.push(value); } } } - _getOccurInfo(e) { - const { name: t, occur: i } = e; - if (!i || !t) return [1, 1]; - const a = -1 === i.max ? 1 / 0 : i.max; - return [i.min, a]; + _bindOccurrences(formNode, matches, picture) { + let baseClone; + if (matches.length > 1) { + baseClone = formNode[$clone](); + baseClone[$removeChild](baseClone.occur); + baseClone.occur = null; + } + this._bindValue(formNode, matches[0], picture); + this._setProperties(formNode, matches[0]); + this._bindItems(formNode, matches[0]); + if (matches.length === 1) { + return; + } + const parent = formNode[$getParent](); + const name = formNode[$nodeName]; + const pos = parent[$indexOf](formNode); + for (let i = 1, ii = matches.length; i < ii; i++) { + const match = matches[i]; + const clone = baseClone[$clone](); + parent[name].push(clone); + parent[$insertAt](pos + i, clone); + this._bindValue(clone, match, picture); + this._setProperties(clone, match); + this._bindItems(clone, match); + } } - _setAndBind(e, t) { - this._setProperties(e, t); - this._bindItems(e, t); - this._bindElement(e, t); + _createOccurrences(formNode) { + if (!this.emptyMerge) { + return; + } + const { occur } = formNode; + if (!occur || occur.initial <= 1) { + return; + } + const parent = formNode[$getParent](); + const name = formNode[$nodeName]; + if (!(parent[name] instanceof XFAObjectArray)) { + return; + } + let currentNumber; + if (formNode.name) { + currentNumber = parent[name].children.filter( + (e) => e.name === formNode.name, + ).length; + } else { + currentNumber = parent[name].children.length; + } + const pos = parent[$indexOf](formNode) + 1; + const ii = occur.initial - currentNumber; + if (ii) { + const nodeClone = formNode[$clone](); + nodeClone[$removeChild](nodeClone.occur); + nodeClone.occur = null; + parent[name].push(nodeClone); + parent[$insertAt](pos, nodeClone); + for (let i = 1; i < ii; i++) { + const clone = nodeClone[$clone](); + parent[name].push(clone); + parent[$insertAt](pos + i, clone); + } + } } - _bindElement(e, t) { - const i = []; - this._createOccurrences(e); - for (const a of e[Er]()) { - if (a[tr]) continue; - if (void 0 === this._mergeMode && "subform" === a[Yr]) { - this._mergeMode = "consumeData" === a.mergeMode; - const e = t[Er](); - if (e.length > 0) this._bindOccurrences(a, [e[0]], null); - else if (this.emptyMerge) { - const e = t[Jr] === Tn ? -1 : t[Jr], - i = (a[tr] = new XmlObject(e, a.name || "root")); - t[Xs](i); - this._bindElement(a, i); + _getOccurInfo(formNode) { + const { name, occur } = formNode; + if (!occur || !name) { + return [1, 1]; + } + const max = occur.max === -1 ? Infinity : occur.max; + return [occur.min, max]; + } + _setAndBind(formNode, dataNode) { + this._setProperties(formNode, dataNode); + this._bindItems(formNode, dataNode); + this._bindElement(formNode, dataNode); + } + _bindElement(formNode, dataNode) { + const uselessNodes = []; + this._createOccurrences(formNode); + for (const child of formNode[$getChildren]()) { + if (child[$data]) { + continue; + } + if (this._mergeMode === undefined && child[$nodeName] === "subform") { + this._mergeMode = child.mergeMode === "consumeData"; + const dataChildren = dataNode[$getChildren](); + if (dataChildren.length > 0) { + this._bindOccurrences(child, [dataChildren[0]], null); + } else if (this.emptyMerge) { + const nsId = + dataNode[$namespaceId] === bind_NS_DATASETS + ? -1 + : dataNode[$namespaceId]; + const dataChild = (child[$data] = new XmlObject( + nsId, + child.name || "root", + )); + dataNode[$appendChild](dataChild); + this._bindElement(child, dataChild); } continue; } - if (!a[kr]()) continue; - let e = !1, - s = null, - r = null, - n = null; - if (a.bind) { - switch (a.bind.match) { + if (!child[$isBindable]()) { + continue; + } + let global = false; + let picture = null; + let ref = null; + let match = null; + if (child.bind) { + switch (child.bind.match) { case "none": - this._setAndBind(a, t); + this._setAndBind(child, dataNode); continue; case "global": - e = !0; + global = true; break; case "dataRef": - if (!a.bind.ref) { - warn(`XFA - ref is empty in node ${a[Yr]}.`); - this._setAndBind(a, t); + if (!child.bind.ref) { + warn(`XFA - ref is empty in node ${child[$nodeName]}.`); + this._setAndBind(child, dataNode); continue; } - r = a.bind.ref; + ref = child.bind.ref; + break; + default: + break; + } + if (child.bind.picture) { + picture = child.bind.picture[$content]; } - a.bind.picture && (s = a.bind.picture[er]); } - const [g, o] = this._getOccurInfo(a); - if (r) { - n = searchNode(this.root, t, r, !0, !1); - if (null === n) { - n = createDataNode(this.data, t, r); - if (!n) continue; - this._isConsumeData() && (n[Ar] = !0); - this._setAndBind(a, n); + const [min, max] = this._getOccurInfo(child); + if (ref) { + match = searchNode(this.root, dataNode, ref, true, false); + if (match === null) { + match = createDataNode(this.data, dataNode, ref); + if (!match) { + continue; + } + if (this._isConsumeData()) { + match[$consumed] = true; + } + this._setAndBind(child, match); continue; + } else { + if (this._isConsumeData()) { + match = match.filter((node) => !node[$consumed]); + } + if (match.length > max) { + match = match.slice(0, max); + } else if (match.length === 0) { + match = null; + } + if (match && this._isConsumeData()) { + match.forEach((node) => { + node[$consumed] = true; + }); + } } - this._isConsumeData() && (n = n.filter((e) => !e[Ar])); - n.length > o ? (n = n.slice(0, o)) : 0 === n.length && (n = null); - n && - this._isConsumeData() && - n.forEach((e) => { - e[Ar] = !0; - }); } else { - if (!a.name) { - this._setAndBind(a, t); + if (!child.name) { + this._setAndBind(child, dataNode); continue; } if (this._isConsumeData()) { - const i = []; - for (; i.length < o; ) { - const s = this._findDataByNameToConsume(a.name, a[wr](), t, e); - if (!s) break; - s[Ar] = !0; - i.push(s); + const matches = []; + while (matches.length < max) { + const found = this._findDataByNameToConsume( + child.name, + child[$hasSettableValue](), + dataNode, + global, + ); + if (!found) { + break; + } + found[$consumed] = true; + matches.push(found); } - n = i.length > 0 ? i : null; + match = matches.length > 0 ? matches : null; } else { - n = t[Qr](a.name, !1, this.emptyMerge).next().value; - if (!n) { - if (0 === g) { - i.push(a); + match = dataNode[$getRealChildrenByNameIt]( + child.name, + false, + this.emptyMerge, + ).next().value; + if (!match) { + if (min === 0) { + uselessNodes.push(child); continue; } - const e = t[Jr] === Tn ? -1 : t[Jr]; - n = a[tr] = new XmlObject(e, a.name); - this.emptyMerge && (n[Ar] = !0); - t[Xs](n); - this._setAndBind(a, n); + const nsId = + dataNode[$namespaceId] === bind_NS_DATASETS + ? -1 + : dataNode[$namespaceId]; + match = child[$data] = new XmlObject(nsId, child.name); + if (this.emptyMerge) { + match[$consumed] = true; + } + dataNode[$appendChild](match); + this._setAndBind(child, match); continue; } - this.emptyMerge && (n[Ar] = !0); - n = [n]; + if (this.emptyMerge) { + match[$consumed] = true; + } + match = [match]; } } - n - ? this._bindOccurrences(a, n, s) - : g > 0 - ? this._setAndBind(a, t) - : i.push(a); + if (match) { + this._bindOccurrences(child, match, picture); + } else if (min > 0) { + this._setAndBind(child, dataNode); + } else { + uselessNodes.push(child); + } } - i.forEach((e) => e[pr]()[jr](e)); + uselessNodes.forEach((node) => node[$getParent]()[$removeChild](node)); } -} +} // ./src/core/xfa/data.js + class DataHandler { - constructor(e, t) { - this.data = t; - this.dataset = e.datasets || null; + constructor(root, data) { + this.data = data; + this.dataset = root.datasets || null; } - serialize(e) { - const t = [[-1, this.data[Er]()]]; - for (; t.length > 0; ) { - const i = t.at(-1), - [a, s] = i; - if (a + 1 === s.length) { - t.pop(); + serialize(storage) { + const stack = [[-1, this.data[$getChildren]()]]; + while (stack.length > 0) { + const last = stack.at(-1); + const [i, children] = last; + if (i + 1 === children.length) { + stack.pop(); continue; } - const r = s[++i[0]], - n = e.get(r[nn]); - if (n) r[$r](n); - else { - const t = r[gr](); - for (const i of t.values()) { - const t = e.get(i[nn]); - if (t) { - i[$r](t); + const child = children[++last[0]]; + const storageEntry = storage.get(child[$uid]); + if (storageEntry) { + child[$setValue](storageEntry); + } else { + const attributes = child[$getAttributes](); + for (const value of attributes.values()) { + const entry = storage.get(value[$uid]); + if (entry) { + value[$setValue](entry); break; } } } - const g = r[Er](); - g.length > 0 && t.push([-1, g]); + const nodes = child[$getChildren](); + if (nodes.length > 0) { + stack.push([-1, nodes]); + } } - const i = [ - '', + const buf = [ + ``, ]; - if (this.dataset) - for (const e of this.dataset[Er]()) "data" !== e[Yr] && e[sn](i); - this.data[sn](i); - i.push(""); - return i.join(""); + if (this.dataset) { + for (const child of this.dataset[$getChildren]()) { + if (child[$nodeName] !== "data") { + child[$toString](buf); + } + } + } + this.data[$toString](buf); + buf.push(""); + return buf.join(""); } -} -const qn = on.config.id; +} // ./src/core/xfa/config.js + +const CONFIG_NS_ID = NamespaceIds.config.id; class Acrobat extends XFAObject { - constructor(e) { - super(qn, "acrobat", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "acrobat", true); this.acrobat7 = null; this.autoSave = null; this.common = null; @@ -48482,67 +58565,67 @@ class Acrobat extends XFAObject { } } class Acrobat7 extends XFAObject { - constructor(e) { - super(qn, "acrobat7", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "acrobat7", true); this.dynamicRender = null; } } class ADBE_JSConsole extends OptionObject { - constructor(e) { - super(qn, "ADBE_JSConsole", ["delegate", "Enable", "Disable"]); + constructor(attributes) { + super(CONFIG_NS_ID, "ADBE_JSConsole", ["delegate", "Enable", "Disable"]); } } class ADBE_JSDebugger extends OptionObject { - constructor(e) { - super(qn, "ADBE_JSDebugger", ["delegate", "Enable", "Disable"]); + constructor(attributes) { + super(CONFIG_NS_ID, "ADBE_JSDebugger", ["delegate", "Enable", "Disable"]); } } class AddSilentPrint extends Option01 { - constructor(e) { - super(qn, "addSilentPrint"); + constructor(attributes) { + super(CONFIG_NS_ID, "addSilentPrint"); } } class AddViewerPreferences extends Option01 { - constructor(e) { - super(qn, "addViewerPreferences"); + constructor(attributes) { + super(CONFIG_NS_ID, "addViewerPreferences"); } } class AdjustData extends Option10 { - constructor(e) { - super(qn, "adjustData"); + constructor(attributes) { + super(CONFIG_NS_ID, "adjustData"); } } class AdobeExtensionLevel extends IntegerObject { - constructor(e) { - super(qn, "adobeExtensionLevel", 0, (e) => e >= 1 && e <= 8); + constructor(attributes) { + super(CONFIG_NS_ID, "adobeExtensionLevel", 0, (n) => n >= 1 && n <= 8); } } class Agent extends XFAObject { - constructor(e) { - super(qn, "agent", !0); - this.name = e.name ? e.name.trim() : ""; + constructor(attributes) { + super(CONFIG_NS_ID, "agent", true); + this.name = attributes.name ? attributes.name.trim() : ""; this.common = new XFAObjectArray(); } } class AlwaysEmbed extends ContentObject { - constructor(e) { - super(qn, "alwaysEmbed"); + constructor(attributes) { + super(CONFIG_NS_ID, "alwaysEmbed"); } } class Amd extends StringObject { - constructor(e) { - super(qn, "amd"); + constructor(attributes) { + super(CONFIG_NS_ID, "amd"); } } class config_Area extends XFAObject { - constructor(e) { - super(qn, "area"); + constructor(attributes) { + super(CONFIG_NS_ID, "area"); this.level = getInteger({ - data: e.level, + data: attributes.level, defaultValue: 0, - validate: (e) => e >= 1 && e <= 3, + validate: (n) => n >= 1 && n <= 3, }); - this.name = getStringOption(e.name, [ + this.name = getStringOption(attributes.name, [ "", "barcode", "coreinit", @@ -48559,24 +58642,24 @@ class config_Area extends XFAObject { } } class Attributes extends OptionObject { - constructor(e) { - super(qn, "attributes", ["preserve", "delegate", "ignore"]); + constructor(attributes) { + super(CONFIG_NS_ID, "attributes", ["preserve", "delegate", "ignore"]); } } class AutoSave extends OptionObject { - constructor(e) { - super(qn, "autoSave", ["disabled", "enabled"]); + constructor(attributes) { + super(CONFIG_NS_ID, "autoSave", ["disabled", "enabled"]); } } class Base extends StringObject { - constructor(e) { - super(qn, "base"); + constructor(attributes) { + super(CONFIG_NS_ID, "base"); } } class BatchOutput extends XFAObject { - constructor(e) { - super(qn, "batchOutput"); - this.format = getStringOption(e.format, [ + constructor(attributes) { + super(CONFIG_NS_ID, "batchOutput"); + this.format = getStringOption(attributes.format, [ "none", "concat", "zip", @@ -48585,33 +58668,33 @@ class BatchOutput extends XFAObject { } } class BehaviorOverride extends ContentObject { - constructor(e) { - super(qn, "behaviorOverride"); + constructor(attributes) { + super(CONFIG_NS_ID, "behaviorOverride"); } - [sr]() { - this[er] = new Map( - this[er] + [$finalize]() { + this[$content] = new Map( + this[$content] .trim() .split(/\s+/) - .filter((e) => e.includes(":")) - .map((e) => e.split(":", 2)), + .filter((x) => x.includes(":")) + .map((x) => x.split(":", 2)), ); } } class Cache extends XFAObject { - constructor(e) { - super(qn, "cache", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "cache", true); this.templateCache = null; } } class Change extends Option01 { - constructor(e) { - super(qn, "change"); + constructor(attributes) { + super(CONFIG_NS_ID, "change"); } } class Common extends XFAObject { - constructor(e) { - super(qn, "common", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "common", true); this.data = null; this.locale = null; this.localeSet = null; @@ -48624,24 +58707,24 @@ class Common extends XFAObject { } } class Compress extends XFAObject { - constructor(e) { - super(qn, "compress"); - this.scope = getStringOption(e.scope, ["imageOnly", "document"]); + constructor(attributes) { + super(CONFIG_NS_ID, "compress"); + this.scope = getStringOption(attributes.scope, ["imageOnly", "document"]); } } class CompressLogicalStructure extends Option01 { - constructor(e) { - super(qn, "compressLogicalStructure"); + constructor(attributes) { + super(CONFIG_NS_ID, "compressLogicalStructure"); } } class CompressObjectStream extends Option10 { - constructor(e) { - super(qn, "compressObjectStream"); + constructor(attributes) { + super(CONFIG_NS_ID, "compressObjectStream"); } } class Compression extends XFAObject { - constructor(e) { - super(qn, "compression", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "compression", true); this.compressLogicalStructure = null; this.compressObjectStream = null; this.level = null; @@ -48649,8 +58732,8 @@ class Compression extends XFAObject { } } class Config extends XFAObject { - constructor(e) { - super(qn, "config", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "config", true); this.acrobat = null; this.present = null; this.trace = null; @@ -48658,33 +58741,33 @@ class Config extends XFAObject { } } class Conformance extends OptionObject { - constructor(e) { - super(qn, "conformance", ["A", "B"]); + constructor(attributes) { + super(CONFIG_NS_ID, "conformance", ["A", "B"]); } } class ContentCopy extends Option01 { - constructor(e) { - super(qn, "contentCopy"); + constructor(attributes) { + super(CONFIG_NS_ID, "contentCopy"); } } class Copies extends IntegerObject { - constructor(e) { - super(qn, "copies", 1, (e) => e >= 1); + constructor(attributes) { + super(CONFIG_NS_ID, "copies", 1, (n) => n >= 1); } } class Creator extends StringObject { - constructor(e) { - super(qn, "creator"); + constructor(attributes) { + super(CONFIG_NS_ID, "creator"); } } class CurrentPage extends IntegerObject { - constructor(e) { - super(qn, "currentPage", 0, (e) => e >= 0); + constructor(attributes) { + super(CONFIG_NS_ID, "currentPage", 0, (n) => n >= 0); } } class Data extends XFAObject { - constructor(e) { - super(qn, "data", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "data", true); this.adjustData = null; this.attributes = null; this.incrementalLoad = null; @@ -48700,15 +58783,15 @@ class Data extends XFAObject { } } class Debug extends XFAObject { - constructor(e) { - super(qn, "debug", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "debug", true); this.uri = null; } } class DefaultTypeface extends ContentObject { - constructor(e) { - super(qn, "defaultTypeface"); - this.writingScript = getStringOption(e.writingScript, [ + constructor(attributes) { + super(CONFIG_NS_ID, "defaultTypeface"); + this.writingScript = getStringOption(attributes.writingScript, [ "*", "Arabic", "Cyrillic", @@ -48726,26 +58809,32 @@ class DefaultTypeface extends ContentObject { } } class Destination extends OptionObject { - constructor(e) { - super(qn, "destination", ["pdf", "pcl", "ps", "webClient", "zpl"]); + constructor(attributes) { + super(CONFIG_NS_ID, "destination", [ + "pdf", + "pcl", + "ps", + "webClient", + "zpl", + ]); } } class DocumentAssembly extends Option01 { - constructor(e) { - super(qn, "documentAssembly"); + constructor(attributes) { + super(CONFIG_NS_ID, "documentAssembly"); } } class Driver extends XFAObject { - constructor(e) { - super(qn, "driver", !0); - this.name = e.name ? e.name.trim() : ""; + constructor(attributes) { + super(CONFIG_NS_ID, "driver", true); + this.name = attributes.name ? attributes.name.trim() : ""; this.fontInfo = null; this.xdc = null; } } class DuplexOption extends OptionObject { - constructor(e) { - super(qn, "duplexOption", [ + constructor(attributes) { + super(CONFIG_NS_ID, "duplexOption", [ "simplex", "duplexFlipLongEdge", "duplexFlipShortEdge", @@ -48753,86 +58842,91 @@ class DuplexOption extends OptionObject { } } class DynamicRender extends OptionObject { - constructor(e) { - super(qn, "dynamicRender", ["forbidden", "required"]); + constructor(attributes) { + super(CONFIG_NS_ID, "dynamicRender", ["forbidden", "required"]); } } class Embed extends Option01 { - constructor(e) { - super(qn, "embed"); + constructor(attributes) { + super(CONFIG_NS_ID, "embed"); } } class config_Encrypt extends Option01 { - constructor(e) { - super(qn, "encrypt"); + constructor(attributes) { + super(CONFIG_NS_ID, "encrypt"); } } class config_Encryption extends XFAObject { - constructor(e) { - super(qn, "encryption", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "encryption", true); this.encrypt = null; this.encryptionLevel = null; this.permissions = null; } } class EncryptionLevel extends OptionObject { - constructor(e) { - super(qn, "encryptionLevel", ["40bit", "128bit"]); + constructor(attributes) { + super(CONFIG_NS_ID, "encryptionLevel", ["40bit", "128bit"]); } } class Enforce extends StringObject { - constructor(e) { - super(qn, "enforce"); + constructor(attributes) { + super(CONFIG_NS_ID, "enforce"); } } class Equate extends XFAObject { - constructor(e) { - super(qn, "equate"); + constructor(attributes) { + super(CONFIG_NS_ID, "equate"); this.force = getInteger({ - data: e.force, + data: attributes.force, defaultValue: 1, - validate: (e) => 0 === e, + validate: (n) => n === 0, }); - this.from = e.from || ""; - this.to = e.to || ""; + this.from = attributes.from || ""; + this.to = attributes.to || ""; } } class EquateRange extends XFAObject { - constructor(e) { - super(qn, "equateRange"); - this.from = e.from || ""; - this.to = e.to || ""; - this._unicodeRange = e.unicodeRange || ""; + constructor(attributes) { + super(CONFIG_NS_ID, "equateRange"); + this.from = attributes.from || ""; + this.to = attributes.to || ""; + this._unicodeRange = attributes.unicodeRange || ""; } get unicodeRange() { - const e = [], - t = /U\+([0-9a-fA-F]+)/, - i = this._unicodeRange; - for (let a of i + const ranges = []; + const unicodeRegex = /U\+([0-9a-fA-F]+)/; + const unicodeRange = this._unicodeRange; + for (let range of unicodeRange .split(",") - .map((e) => e.trim()) - .filter((e) => !!e)) { - a = a.split("-", 2).map((e) => { - const i = e.match(t); - return i ? parseInt(i[1], 16) : 0; + .map((x) => x.trim()) + .filter((x) => !!x)) { + range = range.split("-", 2).map((x) => { + const found = x.match(unicodeRegex); + if (!found) { + return 0; + } + return parseInt(found[1], 16); }); - 1 === a.length && a.push(a[0]); - e.push(a); + if (range.length === 1) { + range.push(range[0]); + } + ranges.push(range); } - return shadow(this, "unicodeRange", e); + return shadow(this, "unicodeRange", ranges); } } class Exclude extends ContentObject { - constructor(e) { - super(qn, "exclude"); + constructor(attributes) { + super(CONFIG_NS_ID, "exclude"); } - [sr]() { - this[er] = this[er] + [$finalize]() { + this[$content] = this[$content] .trim() .split(/\s+/) .filter( - (e) => - e && + (x) => + x && [ "calculate", "close", @@ -48841,23 +58935,23 @@ class Exclude extends ContentObject { "initialize", "ready", "validate", - ].includes(e), + ].includes(x), ); } } class ExcludeNS extends StringObject { - constructor(e) { - super(qn, "excludeNS"); + constructor(attributes) { + super(CONFIG_NS_ID, "excludeNS"); } } class FlipLabel extends OptionObject { - constructor(e) { - super(qn, "flipLabel", ["usePrinterSetting", "on", "off"]); + constructor(attributes) { + super(CONFIG_NS_ID, "flipLabel", ["usePrinterSetting", "on", "off"]); } } class config_FontInfo extends XFAObject { - constructor(e) { - super(qn, "fontInfo", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "fontInfo", true); this.embed = null; this.map = null; this.subsetBelow = null; @@ -48867,49 +58961,54 @@ class config_FontInfo extends XFAObject { } } class FormFieldFilling extends Option01 { - constructor(e) { - super(qn, "formFieldFilling"); + constructor(attributes) { + super(CONFIG_NS_ID, "formFieldFilling"); } } class GroupParent extends StringObject { - constructor(e) { - super(qn, "groupParent"); + constructor(attributes) { + super(CONFIG_NS_ID, "groupParent"); } } class IfEmpty extends OptionObject { - constructor(e) { - super(qn, "ifEmpty", ["dataValue", "dataGroup", "ignore", "remove"]); + constructor(attributes) { + super(CONFIG_NS_ID, "ifEmpty", [ + "dataValue", + "dataGroup", + "ignore", + "remove", + ]); } } class IncludeXDPContent extends StringObject { - constructor(e) { - super(qn, "includeXDPContent"); + constructor(attributes) { + super(CONFIG_NS_ID, "includeXDPContent"); } } class IncrementalLoad extends OptionObject { - constructor(e) { - super(qn, "incrementalLoad", ["none", "forwardOnly"]); + constructor(attributes) { + super(CONFIG_NS_ID, "incrementalLoad", ["none", "forwardOnly"]); } } class IncrementalMerge extends Option01 { - constructor(e) { - super(qn, "incrementalMerge"); + constructor(attributes) { + super(CONFIG_NS_ID, "incrementalMerge"); } } class Interactive extends Option01 { - constructor(e) { - super(qn, "interactive"); + constructor(attributes) { + super(CONFIG_NS_ID, "interactive"); } } class Jog extends OptionObject { - constructor(e) { - super(qn, "jog", ["usePrinterSetting", "none", "pageSet"]); + constructor(attributes) { + super(CONFIG_NS_ID, "jog", ["usePrinterSetting", "none", "pageSet"]); } } class LabelPrinter extends XFAObject { - constructor(e) { - super(qn, "labelPrinter", !0); - this.name = getStringOption(e.name, ["zpl", "dpl", "ipl", "tcpl"]); + constructor(attributes) { + super(CONFIG_NS_ID, "labelPrinter", true); + this.name = getStringOption(attributes.name, ["zpl", "dpl", "ipl", "tcpl"]); this.batchOutput = null; this.flipLabel = null; this.fontInfo = null; @@ -48917,33 +59016,33 @@ class LabelPrinter extends XFAObject { } } class Layout extends OptionObject { - constructor(e) { - super(qn, "layout", ["paginate", "panel"]); + constructor(attributes) { + super(CONFIG_NS_ID, "layout", ["paginate", "panel"]); } } class Level extends IntegerObject { - constructor(e) { - super(qn, "level", 0, (e) => e > 0); + constructor(attributes) { + super(CONFIG_NS_ID, "level", 0, (n) => n > 0); } } class Linearized extends Option01 { - constructor(e) { - super(qn, "linearized"); + constructor(attributes) { + super(CONFIG_NS_ID, "linearized"); } } class Locale extends StringObject { - constructor(e) { - super(qn, "locale"); + constructor(attributes) { + super(CONFIG_NS_ID, "locale"); } } class LocaleSet extends StringObject { - constructor(e) { - super(qn, "localeSet"); + constructor(attributes) { + super(CONFIG_NS_ID, "localeSet"); } } class Log extends XFAObject { - constructor(e) { - super(qn, "log", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "log", true); this.mode = null; this.threshold = null; this.to = null; @@ -48951,142 +59050,150 @@ class Log extends XFAObject { } } class MapElement extends XFAObject { - constructor(e) { - super(qn, "map", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "map", true); this.equate = new XFAObjectArray(); this.equateRange = new XFAObjectArray(); } } class MediumInfo extends XFAObject { - constructor(e) { - super(qn, "mediumInfo", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "mediumInfo", true); this.map = null; } } class config_Message extends XFAObject { - constructor(e) { - super(qn, "message", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "message", true); this.msgId = null; this.severity = null; } } class Messaging extends XFAObject { - constructor(e) { - super(qn, "messaging", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "messaging", true); this.message = new XFAObjectArray(); } } class Mode extends OptionObject { - constructor(e) { - super(qn, "mode", ["append", "overwrite"]); + constructor(attributes) { + super(CONFIG_NS_ID, "mode", ["append", "overwrite"]); } } class ModifyAnnots extends Option01 { - constructor(e) { - super(qn, "modifyAnnots"); + constructor(attributes) { + super(CONFIG_NS_ID, "modifyAnnots"); } } class MsgId extends IntegerObject { - constructor(e) { - super(qn, "msgId", 1, (e) => e >= 1); + constructor(attributes) { + super(CONFIG_NS_ID, "msgId", 1, (n) => n >= 1); } } class NameAttr extends StringObject { - constructor(e) { - super(qn, "nameAttr"); + constructor(attributes) { + super(CONFIG_NS_ID, "nameAttr"); } } class NeverEmbed extends ContentObject { - constructor(e) { - super(qn, "neverEmbed"); + constructor(attributes) { + super(CONFIG_NS_ID, "neverEmbed"); } } class NumberOfCopies extends IntegerObject { - constructor(e) { - super(qn, "numberOfCopies", null, (e) => e >= 2 && e <= 5); + constructor(attributes) { + super(CONFIG_NS_ID, "numberOfCopies", null, (n) => n >= 2 && n <= 5); } } class OpenAction extends XFAObject { - constructor(e) { - super(qn, "openAction", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "openAction", true); this.destination = null; } } class Output extends XFAObject { - constructor(e) { - super(qn, "output", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "output", true); this.to = null; this.type = null; this.uri = null; } } class OutputBin extends StringObject { - constructor(e) { - super(qn, "outputBin"); + constructor(attributes) { + super(CONFIG_NS_ID, "outputBin"); } } class OutputXSL extends XFAObject { - constructor(e) { - super(qn, "outputXSL", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "outputXSL", true); this.uri = null; } } class Overprint extends OptionObject { - constructor(e) { - super(qn, "overprint", ["none", "both", "draw", "field"]); + constructor(attributes) { + super(CONFIG_NS_ID, "overprint", ["none", "both", "draw", "field"]); } } class Packets extends StringObject { - constructor(e) { - super(qn, "packets"); + constructor(attributes) { + super(CONFIG_NS_ID, "packets"); } - [sr]() { - "*" !== this[er] && - (this[er] = this[er] - .trim() - .split(/\s+/) - .filter((e) => - ["config", "datasets", "template", "xfdf", "xslt"].includes(e), - )); + [$finalize]() { + if (this[$content] === "*") { + return; + } + this[$content] = this[$content] + .trim() + .split(/\s+/) + .filter((x) => + ["config", "datasets", "template", "xfdf", "xslt"].includes(x), + ); } } class PageOffset extends XFAObject { - constructor(e) { - super(qn, "pageOffset"); + constructor(attributes) { + super(CONFIG_NS_ID, "pageOffset"); this.x = getInteger({ - data: e.x, + data: attributes.x, defaultValue: "useXDCSetting", - validate: (e) => !0, + validate: (n) => true, }); this.y = getInteger({ - data: e.y, + data: attributes.y, defaultValue: "useXDCSetting", - validate: (e) => !0, + validate: (n) => true, }); } } class PageRange extends StringObject { - constructor(e) { - super(qn, "pageRange"); + constructor(attributes) { + super(CONFIG_NS_ID, "pageRange"); } - [sr]() { - const e = this[er] - .trim() - .split(/\s+/) - .map((e) => parseInt(e, 10)), - t = []; - for (let i = 0, a = e.length; i < a; i += 2) t.push(e.slice(i, i + 2)); - this[er] = t; + [$finalize]() { + const numbers = this[$content] + .trim() + .split(/\s+/) + .map((x) => parseInt(x, 10)); + const ranges = []; + for (let i = 0, ii = numbers.length; i < ii; i += 2) { + ranges.push(numbers.slice(i, i + 2)); + } + this[$content] = ranges; } } class Pagination extends OptionObject { - constructor(e) { - super(qn, "pagination", ["simplex", "duplexShortEdge", "duplexLongEdge"]); + constructor(attributes) { + super(CONFIG_NS_ID, "pagination", [ + "simplex", + "duplexShortEdge", + "duplexLongEdge", + ]); } } class PaginationOverride extends OptionObject { - constructor(e) { - super(qn, "paginationOverride", [ + constructor(attributes) { + super(CONFIG_NS_ID, "paginationOverride", [ "none", "forceDuplex", "forceDuplexLongEdge", @@ -49096,14 +59203,14 @@ class PaginationOverride extends OptionObject { } } class Part extends IntegerObject { - constructor(e) { - super(qn, "part", 1, (e) => !1); + constructor(attributes) { + super(CONFIG_NS_ID, "part", 1, (n) => false); } } class Pcl extends XFAObject { - constructor(e) { - super(qn, "pcl", !0); - this.name = e.name || ""; + constructor(attributes) { + super(CONFIG_NS_ID, "pcl", true); + this.name = attributes.name || ""; this.batchOutput = null; this.fontInfo = null; this.jog = null; @@ -49115,9 +59222,9 @@ class Pcl extends XFAObject { } } class Pdf extends XFAObject { - constructor(e) { - super(qn, "pdf", !0); - this.name = e.name || ""; + constructor(attributes) { + super(CONFIG_NS_ID, "pdf", true); + this.name = attributes.name || ""; this.adobeExtensionLevel = null; this.batchOutput = null; this.compression = null; @@ -49140,8 +59247,8 @@ class Pdf extends XFAObject { } } class Pdfa extends XFAObject { - constructor(e) { - super(qn, "pdfa", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "pdfa", true); this.amd = null; this.conformance = null; this.includeXDPContent = null; @@ -49149,8 +59256,8 @@ class Pdfa extends XFAObject { } } class Permissions extends XFAObject { - constructor(e) { - super(qn, "permissions", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "permissions", true); this.accessibleContent = null; this.change = null; this.contentCopy = null; @@ -49163,23 +59270,23 @@ class Permissions extends XFAObject { } } class PickTrayByPDFSize extends Option01 { - constructor(e) { - super(qn, "pickTrayByPDFSize"); + constructor(attributes) { + super(CONFIG_NS_ID, "pickTrayByPDFSize"); } } class config_Picture extends StringObject { - constructor(e) { - super(qn, "picture"); + constructor(attributes) { + super(CONFIG_NS_ID, "picture"); } } class PlaintextMetadata extends Option01 { - constructor(e) { - super(qn, "plaintextMetadata"); + constructor(attributes) { + super(CONFIG_NS_ID, "plaintextMetadata"); } } class Presence extends OptionObject { - constructor(e) { - super(qn, "presence", [ + constructor(attributes) { + super(CONFIG_NS_ID, "presence", [ "preserve", "dissolve", "dissolveStructure", @@ -49189,8 +59296,8 @@ class Presence extends OptionObject { } } class Present extends XFAObject { - constructor(e) { - super(qn, "present", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "present", true); this.behaviorOverride = null; this.cache = null; this.common = null; @@ -49216,34 +59323,34 @@ class Present extends XFAObject { } } class Print extends Option01 { - constructor(e) { - super(qn, "print"); + constructor(attributes) { + super(CONFIG_NS_ID, "print"); } } class PrintHighQuality extends Option01 { - constructor(e) { - super(qn, "printHighQuality"); + constructor(attributes) { + super(CONFIG_NS_ID, "printHighQuality"); } } class PrintScaling extends OptionObject { - constructor(e) { - super(qn, "printScaling", ["appdefault", "noScaling"]); + constructor(attributes) { + super(CONFIG_NS_ID, "printScaling", ["appdefault", "noScaling"]); } } class PrinterName extends StringObject { - constructor(e) { - super(qn, "printerName"); + constructor(attributes) { + super(CONFIG_NS_ID, "printerName"); } } class Producer extends StringObject { - constructor(e) { - super(qn, "producer"); + constructor(attributes) { + super(CONFIG_NS_ID, "producer"); } } class Ps extends XFAObject { - constructor(e) { - super(qn, "ps", !0); - this.name = e.name || ""; + constructor(attributes) { + super(CONFIG_NS_ID, "ps", true); + this.name = attributes.name || ""; this.batchOutput = null; this.fontInfo = null; this.jog = null; @@ -49254,76 +59361,83 @@ class Ps extends XFAObject { } } class Range extends ContentObject { - constructor(e) { - super(qn, "range"); + constructor(attributes) { + super(CONFIG_NS_ID, "range"); } - [sr]() { - this[er] = this[er] + [$finalize]() { + this[$content] = this[$content] .trim() .split(/\s*,\s*/, 2) - .map((e) => e.split("-").map((e) => parseInt(e.trim(), 10))) - .filter((e) => e.every((e) => !isNaN(e))) - .map((e) => { - 1 === e.length && e.push(e[0]); - return e; + .map((range) => range.split("-").map((x) => parseInt(x.trim(), 10))) + .filter((range) => range.every((x) => !isNaN(x))) + .map((range) => { + if (range.length === 1) { + range.push(range[0]); + } + return range; }); } } class Record extends ContentObject { - constructor(e) { - super(qn, "record"); + constructor(attributes) { + super(CONFIG_NS_ID, "record"); } - [sr]() { - this[er] = this[er].trim(); - const e = parseInt(this[er], 10); - !isNaN(e) && e >= 0 && (this[er] = e); + [$finalize]() { + this[$content] = this[$content].trim(); + const n = parseInt(this[$content], 10); + if (!isNaN(n) && n >= 0) { + this[$content] = n; + } } } class Relevant extends ContentObject { - constructor(e) { - super(qn, "relevant"); + constructor(attributes) { + super(CONFIG_NS_ID, "relevant"); } - [sr]() { - this[er] = this[er].trim().split(/\s+/); + [$finalize]() { + this[$content] = this[$content].trim().split(/\s+/); } } class Rename extends ContentObject { - constructor(e) { - super(qn, "rename"); + constructor(attributes) { + super(CONFIG_NS_ID, "rename"); } - [sr]() { - this[er] = this[er].trim(); - (this[er].toLowerCase().startsWith("xml") || - new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*", "u").test(this[er])) && + [$finalize]() { + this[$content] = this[$content].trim(); + if ( + this[$content].toLowerCase().startsWith("xml") || + new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*", "u").test(this[$content]) + ) { warn("XFA - Rename: invalid XFA name"); + } } } class RenderPolicy extends OptionObject { - constructor(e) { - super(qn, "renderPolicy", ["server", "client"]); + constructor(attributes) { + super(CONFIG_NS_ID, "renderPolicy", ["server", "client"]); } } class RunScripts extends OptionObject { - constructor(e) { - super(qn, "runScripts", ["both", "client", "none", "server"]); + constructor(attributes) { + super(CONFIG_NS_ID, "runScripts", ["both", "client", "none", "server"]); } } class config_Script extends XFAObject { - constructor(e) { - super(qn, "script", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "script", true); this.currentPage = null; this.exclude = null; this.runScripts = null; } } class ScriptModel extends OptionObject { - constructor(e) { - super(qn, "scriptModel", ["XFA", "none"]); + constructor(attributes) { + super(CONFIG_NS_ID, "scriptModel", ["XFA", "none"]); } } class Severity extends OptionObject { - constructor(e) { - super(qn, "severity", [ + constructor(attributes) { + super(CONFIG_NS_ID, "severity", [ "ignore", "error", "information", @@ -49333,56 +59447,66 @@ class Severity extends OptionObject { } } class SilentPrint extends XFAObject { - constructor(e) { - super(qn, "silentPrint", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "silentPrint", true); this.addSilentPrint = null; this.printerName = null; } } class Staple extends XFAObject { - constructor(e) { - super(qn, "staple"); - this.mode = getStringOption(e.mode, ["usePrinterSetting", "on", "off"]); + constructor(attributes) { + super(CONFIG_NS_ID, "staple"); + this.mode = getStringOption(attributes.mode, [ + "usePrinterSetting", + "on", + "off", + ]); } } class StartNode extends StringObject { - constructor(e) { - super(qn, "startNode"); + constructor(attributes) { + super(CONFIG_NS_ID, "startNode"); } } class StartPage extends IntegerObject { - constructor(e) { - super(qn, "startPage", 0, (e) => !0); + constructor(attributes) { + super(CONFIG_NS_ID, "startPage", 0, (n) => true); } } class SubmitFormat extends OptionObject { - constructor(e) { - super(qn, "submitFormat", ["html", "delegate", "fdf", "xml", "pdf"]); + constructor(attributes) { + super(CONFIG_NS_ID, "submitFormat", [ + "html", + "delegate", + "fdf", + "xml", + "pdf", + ]); } } class SubmitUrl extends StringObject { - constructor(e) { - super(qn, "submitUrl"); + constructor(attributes) { + super(CONFIG_NS_ID, "submitUrl"); } } class SubsetBelow extends IntegerObject { - constructor(e) { - super(qn, "subsetBelow", 100, (e) => e >= 0 && e <= 100); + constructor(attributes) { + super(CONFIG_NS_ID, "subsetBelow", 100, (n) => n >= 0 && n <= 100); } } class SuppressBanner extends Option01 { - constructor(e) { - super(qn, "suppressBanner"); + constructor(attributes) { + super(CONFIG_NS_ID, "suppressBanner"); } } class Tagged extends Option01 { - constructor(e) { - super(qn, "tagged"); + constructor(attributes) { + super(CONFIG_NS_ID, "tagged"); } } class config_Template extends XFAObject { - constructor(e) { - super(qn, "template", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "template", true); this.base = null; this.relevant = null; this.startPage = null; @@ -49391,34 +59515,46 @@ class config_Template extends XFAObject { } } class Threshold extends OptionObject { - constructor(e) { - super(qn, "threshold", ["trace", "error", "information", "warning"]); + constructor(attributes) { + super(CONFIG_NS_ID, "threshold", [ + "trace", + "error", + "information", + "warning", + ]); } } class To extends OptionObject { - constructor(e) { - super(qn, "to", ["null", "memory", "stderr", "stdout", "system", "uri"]); + constructor(attributes) { + super(CONFIG_NS_ID, "to", [ + "null", + "memory", + "stderr", + "stdout", + "system", + "uri", + ]); } } class TemplateCache extends XFAObject { - constructor(e) { - super(qn, "templateCache"); + constructor(attributes) { + super(CONFIG_NS_ID, "templateCache"); this.maxEntries = getInteger({ - data: e.maxEntries, + data: attributes.maxEntries, defaultValue: 5, - validate: (e) => e >= 0, + validate: (n) => n >= 0, }); } } class Trace extends XFAObject { - constructor(e) { - super(qn, "trace", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "trace", true); this.area = new XFAObjectArray(); } } class Transform extends XFAObject { - constructor(e) { - super(qn, "transform", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "transform", true); this.groupParent = null; this.ifEmpty = null; this.nameAttr = null; @@ -49429,8 +59565,8 @@ class Transform extends XFAObject { } } class Type extends OptionObject { - constructor(e) { - super(qn, "type", [ + constructor(attributes) { + super(CONFIG_NS_ID, "type", [ "none", "ascii85", "asciiHex", @@ -49445,29 +59581,34 @@ class Type extends OptionObject { } } class Uri extends StringObject { - constructor(e) { - super(qn, "uri"); + constructor(attributes) { + super(CONFIG_NS_ID, "uri"); } } class config_Validate extends OptionObject { - constructor(e) { - super(qn, "validate", ["preSubmit", "prePrint", "preExecute", "preSave"]); + constructor(attributes) { + super(CONFIG_NS_ID, "validate", [ + "preSubmit", + "prePrint", + "preExecute", + "preSave", + ]); } } class ValidateApprovalSignatures extends ContentObject { - constructor(e) { - super(qn, "validateApprovalSignatures"); + constructor(attributes) { + super(CONFIG_NS_ID, "validateApprovalSignatures"); } - [sr]() { - this[er] = this[er] + [$finalize]() { + this[$content] = this[$content] .trim() .split(/\s+/) - .filter((e) => ["docReady", "postSign"].includes(e)); + .filter((x) => ["docReady", "postSign"].includes(x)); } } class ValidationMessaging extends OptionObject { - constructor(e) { - super(qn, "validationMessaging", [ + constructor(attributes) { + super(CONFIG_NS_ID, "validationMessaging", [ "allMessagesIndividually", "allMessagesTogether", "firstMessageOnly", @@ -49476,25 +59617,31 @@ class ValidationMessaging extends OptionObject { } } class Version extends OptionObject { - constructor(e) { - super(qn, "version", ["1.7", "1.6", "1.5", "1.4", "1.3", "1.2"]); + constructor(attributes) { + super(CONFIG_NS_ID, "version", ["1.7", "1.6", "1.5", "1.4", "1.3", "1.2"]); } } class VersionControl extends XFAObject { - constructor(e) { - super(qn, "VersionControl"); - this.outputBelow = getStringOption(e.outputBelow, [ + constructor(attributes) { + super(CONFIG_NS_ID, "VersionControl"); + this.outputBelow = getStringOption(attributes.outputBelow, [ "warn", "error", "update", ]); - this.sourceAbove = getStringOption(e.sourceAbove, ["warn", "error"]); - this.sourceBelow = getStringOption(e.sourceBelow, ["update", "maintain"]); + this.sourceAbove = getStringOption(attributes.sourceAbove, [ + "warn", + "error", + ]); + this.sourceBelow = getStringOption(attributes.sourceBelow, [ + "update", + "maintain", + ]); } } class ViewerPreferences extends XFAObject { - constructor(e) { - super(qn, "viewerPreferences", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "viewerPreferences", true); this.ADBE_JSConsole = null; this.ADBE_JSDebugger = null; this.addViewerPreferences = null; @@ -49507,16 +59654,16 @@ class ViewerPreferences extends XFAObject { } } class WebClient extends XFAObject { - constructor(e) { - super(qn, "webClient", !0); - this.name = e.name ? e.name.trim() : ""; + constructor(attributes) { + super(CONFIG_NS_ID, "webClient", true); + this.name = attributes.name ? attributes.name.trim() : ""; this.fontInfo = null; this.xdc = null; } } class Whitespace extends OptionObject { - constructor(e) { - super(qn, "whitespace", [ + constructor(attributes) { + super(CONFIG_NS_ID, "whitespace", [ "preserve", "ltrim", "normalize", @@ -49526,45 +59673,48 @@ class Whitespace extends OptionObject { } } class Window extends ContentObject { - constructor(e) { - super(qn, "window"); + constructor(attributes) { + super(CONFIG_NS_ID, "window"); } - [sr]() { - const e = this[er] + [$finalize]() { + const pair = this[$content] .trim() .split(/\s*,\s*/, 2) - .map((e) => parseInt(e, 10)); - if (e.some((e) => isNaN(e))) this[er] = [0, 0]; - else { - 1 === e.length && e.push(e[0]); - this[er] = e; + .map((x) => parseInt(x, 10)); + if (pair.some((x) => isNaN(x))) { + this[$content] = [0, 0]; + return; } + if (pair.length === 1) { + pair.push(pair[0]); + } + this[$content] = pair; } } class Xdc extends XFAObject { - constructor(e) { - super(qn, "xdc", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "xdc", true); this.uri = new XFAObjectArray(); this.xsl = new XFAObjectArray(); } } class Xdp extends XFAObject { - constructor(e) { - super(qn, "xdp", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "xdp", true); this.packets = null; } } class Xsl extends XFAObject { - constructor(e) { - super(qn, "xsl", !0); + constructor(attributes) { + super(CONFIG_NS_ID, "xsl", true); this.debug = null; this.uri = null; } } class Zpl extends XFAObject { - constructor(e) { - super(qn, "zpl", !0); - this.name = e.name ? e.name.trim() : ""; + constructor(attributes) { + super(CONFIG_NS_ID, "zpl", true); + this.name = attributes.name ? attributes.name.trim() : ""; this.batchOutput = null; this.flipLabel = null; this.fontInfo = null; @@ -49572,515 +59722,519 @@ class Zpl extends XFAObject { } } class ConfigNamespace { - static [gn](e, t) { - if (ConfigNamespace.hasOwnProperty(e)) return ConfigNamespace[e](t); + static [$buildXFAObject](name, attributes) { + if (ConfigNamespace.hasOwnProperty(name)) { + return ConfigNamespace[name](attributes); + } + return undefined; } - static acrobat(e) { - return new Acrobat(e); + static acrobat(attrs) { + return new Acrobat(attrs); } - static acrobat7(e) { - return new Acrobat7(e); + static acrobat7(attrs) { + return new Acrobat7(attrs); } - static ADBE_JSConsole(e) { - return new ADBE_JSConsole(e); + static ADBE_JSConsole(attrs) { + return new ADBE_JSConsole(attrs); } - static ADBE_JSDebugger(e) { - return new ADBE_JSDebugger(e); + static ADBE_JSDebugger(attrs) { + return new ADBE_JSDebugger(attrs); } - static addSilentPrint(e) { - return new AddSilentPrint(e); + static addSilentPrint(attrs) { + return new AddSilentPrint(attrs); } - static addViewerPreferences(e) { - return new AddViewerPreferences(e); + static addViewerPreferences(attrs) { + return new AddViewerPreferences(attrs); } - static adjustData(e) { - return new AdjustData(e); + static adjustData(attrs) { + return new AdjustData(attrs); } - static adobeExtensionLevel(e) { - return new AdobeExtensionLevel(e); + static adobeExtensionLevel(attrs) { + return new AdobeExtensionLevel(attrs); } - static agent(e) { - return new Agent(e); + static agent(attrs) { + return new Agent(attrs); } - static alwaysEmbed(e) { - return new AlwaysEmbed(e); + static alwaysEmbed(attrs) { + return new AlwaysEmbed(attrs); } - static amd(e) { - return new Amd(e); + static amd(attrs) { + return new Amd(attrs); } - static area(e) { - return new config_Area(e); + static area(attrs) { + return new config_Area(attrs); } - static attributes(e) { - return new Attributes(e); + static attributes(attrs) { + return new Attributes(attrs); } - static autoSave(e) { - return new AutoSave(e); + static autoSave(attrs) { + return new AutoSave(attrs); } - static base(e) { - return new Base(e); + static base(attrs) { + return new Base(attrs); } - static batchOutput(e) { - return new BatchOutput(e); + static batchOutput(attrs) { + return new BatchOutput(attrs); } - static behaviorOverride(e) { - return new BehaviorOverride(e); + static behaviorOverride(attrs) { + return new BehaviorOverride(attrs); } - static cache(e) { - return new Cache(e); + static cache(attrs) { + return new Cache(attrs); } - static change(e) { - return new Change(e); + static change(attrs) { + return new Change(attrs); } - static common(e) { - return new Common(e); + static common(attrs) { + return new Common(attrs); } - static compress(e) { - return new Compress(e); + static compress(attrs) { + return new Compress(attrs); } - static compressLogicalStructure(e) { - return new CompressLogicalStructure(e); + static compressLogicalStructure(attrs) { + return new CompressLogicalStructure(attrs); } - static compressObjectStream(e) { - return new CompressObjectStream(e); + static compressObjectStream(attrs) { + return new CompressObjectStream(attrs); } - static compression(e) { - return new Compression(e); + static compression(attrs) { + return new Compression(attrs); } - static config(e) { - return new Config(e); + static config(attrs) { + return new Config(attrs); } - static conformance(e) { - return new Conformance(e); + static conformance(attrs) { + return new Conformance(attrs); } - static contentCopy(e) { - return new ContentCopy(e); + static contentCopy(attrs) { + return new ContentCopy(attrs); } - static copies(e) { - return new Copies(e); + static copies(attrs) { + return new Copies(attrs); } - static creator(e) { - return new Creator(e); + static creator(attrs) { + return new Creator(attrs); } - static currentPage(e) { - return new CurrentPage(e); + static currentPage(attrs) { + return new CurrentPage(attrs); } - static data(e) { - return new Data(e); + static data(attrs) { + return new Data(attrs); } - static debug(e) { - return new Debug(e); + static debug(attrs) { + return new Debug(attrs); } - static defaultTypeface(e) { - return new DefaultTypeface(e); + static defaultTypeface(attrs) { + return new DefaultTypeface(attrs); } - static destination(e) { - return new Destination(e); + static destination(attrs) { + return new Destination(attrs); } - static documentAssembly(e) { - return new DocumentAssembly(e); + static documentAssembly(attrs) { + return new DocumentAssembly(attrs); } - static driver(e) { - return new Driver(e); + static driver(attrs) { + return new Driver(attrs); } - static duplexOption(e) { - return new DuplexOption(e); + static duplexOption(attrs) { + return new DuplexOption(attrs); } - static dynamicRender(e) { - return new DynamicRender(e); + static dynamicRender(attrs) { + return new DynamicRender(attrs); } - static embed(e) { - return new Embed(e); + static embed(attrs) { + return new Embed(attrs); } - static encrypt(e) { - return new config_Encrypt(e); + static encrypt(attrs) { + return new config_Encrypt(attrs); } - static encryption(e) { - return new config_Encryption(e); + static encryption(attrs) { + return new config_Encryption(attrs); } - static encryptionLevel(e) { - return new EncryptionLevel(e); + static encryptionLevel(attrs) { + return new EncryptionLevel(attrs); } - static enforce(e) { - return new Enforce(e); + static enforce(attrs) { + return new Enforce(attrs); } - static equate(e) { - return new Equate(e); + static equate(attrs) { + return new Equate(attrs); } - static equateRange(e) { - return new EquateRange(e); + static equateRange(attrs) { + return new EquateRange(attrs); } - static exclude(e) { - return new Exclude(e); + static exclude(attrs) { + return new Exclude(attrs); } - static excludeNS(e) { - return new ExcludeNS(e); + static excludeNS(attrs) { + return new ExcludeNS(attrs); } - static flipLabel(e) { - return new FlipLabel(e); + static flipLabel(attrs) { + return new FlipLabel(attrs); } - static fontInfo(e) { - return new config_FontInfo(e); + static fontInfo(attrs) { + return new config_FontInfo(attrs); } - static formFieldFilling(e) { - return new FormFieldFilling(e); + static formFieldFilling(attrs) { + return new FormFieldFilling(attrs); } - static groupParent(e) { - return new GroupParent(e); + static groupParent(attrs) { + return new GroupParent(attrs); } - static ifEmpty(e) { - return new IfEmpty(e); + static ifEmpty(attrs) { + return new IfEmpty(attrs); } - static includeXDPContent(e) { - return new IncludeXDPContent(e); + static includeXDPContent(attrs) { + return new IncludeXDPContent(attrs); } - static incrementalLoad(e) { - return new IncrementalLoad(e); + static incrementalLoad(attrs) { + return new IncrementalLoad(attrs); } - static incrementalMerge(e) { - return new IncrementalMerge(e); + static incrementalMerge(attrs) { + return new IncrementalMerge(attrs); } - static interactive(e) { - return new Interactive(e); + static interactive(attrs) { + return new Interactive(attrs); } - static jog(e) { - return new Jog(e); + static jog(attrs) { + return new Jog(attrs); } - static labelPrinter(e) { - return new LabelPrinter(e); + static labelPrinter(attrs) { + return new LabelPrinter(attrs); } - static layout(e) { - return new Layout(e); + static layout(attrs) { + return new Layout(attrs); } - static level(e) { - return new Level(e); + static level(attrs) { + return new Level(attrs); } - static linearized(e) { - return new Linearized(e); + static linearized(attrs) { + return new Linearized(attrs); } - static locale(e) { - return new Locale(e); + static locale(attrs) { + return new Locale(attrs); } - static localeSet(e) { - return new LocaleSet(e); + static localeSet(attrs) { + return new LocaleSet(attrs); } - static log(e) { - return new Log(e); + static log(attrs) { + return new Log(attrs); } - static map(e) { - return new MapElement(e); + static map(attrs) { + return new MapElement(attrs); } - static mediumInfo(e) { - return new MediumInfo(e); + static mediumInfo(attrs) { + return new MediumInfo(attrs); } - static message(e) { - return new config_Message(e); + static message(attrs) { + return new config_Message(attrs); } - static messaging(e) { - return new Messaging(e); + static messaging(attrs) { + return new Messaging(attrs); } - static mode(e) { - return new Mode(e); + static mode(attrs) { + return new Mode(attrs); } - static modifyAnnots(e) { - return new ModifyAnnots(e); + static modifyAnnots(attrs) { + return new ModifyAnnots(attrs); } - static msgId(e) { - return new MsgId(e); + static msgId(attrs) { + return new MsgId(attrs); } - static nameAttr(e) { - return new NameAttr(e); + static nameAttr(attrs) { + return new NameAttr(attrs); } - static neverEmbed(e) { - return new NeverEmbed(e); + static neverEmbed(attrs) { + return new NeverEmbed(attrs); } - static numberOfCopies(e) { - return new NumberOfCopies(e); + static numberOfCopies(attrs) { + return new NumberOfCopies(attrs); } - static openAction(e) { - return new OpenAction(e); + static openAction(attrs) { + return new OpenAction(attrs); } - static output(e) { - return new Output(e); + static output(attrs) { + return new Output(attrs); } - static outputBin(e) { - return new OutputBin(e); + static outputBin(attrs) { + return new OutputBin(attrs); } - static outputXSL(e) { - return new OutputXSL(e); + static outputXSL(attrs) { + return new OutputXSL(attrs); } - static overprint(e) { - return new Overprint(e); + static overprint(attrs) { + return new Overprint(attrs); } - static packets(e) { - return new Packets(e); + static packets(attrs) { + return new Packets(attrs); } - static pageOffset(e) { - return new PageOffset(e); + static pageOffset(attrs) { + return new PageOffset(attrs); } - static pageRange(e) { - return new PageRange(e); + static pageRange(attrs) { + return new PageRange(attrs); } - static pagination(e) { - return new Pagination(e); + static pagination(attrs) { + return new Pagination(attrs); } - static paginationOverride(e) { - return new PaginationOverride(e); + static paginationOverride(attrs) { + return new PaginationOverride(attrs); } - static part(e) { - return new Part(e); + static part(attrs) { + return new Part(attrs); } - static pcl(e) { - return new Pcl(e); + static pcl(attrs) { + return new Pcl(attrs); } - static pdf(e) { - return new Pdf(e); + static pdf(attrs) { + return new Pdf(attrs); } - static pdfa(e) { - return new Pdfa(e); + static pdfa(attrs) { + return new Pdfa(attrs); } - static permissions(e) { - return new Permissions(e); + static permissions(attrs) { + return new Permissions(attrs); } - static pickTrayByPDFSize(e) { - return new PickTrayByPDFSize(e); + static pickTrayByPDFSize(attrs) { + return new PickTrayByPDFSize(attrs); } - static picture(e) { - return new config_Picture(e); + static picture(attrs) { + return new config_Picture(attrs); } - static plaintextMetadata(e) { - return new PlaintextMetadata(e); + static plaintextMetadata(attrs) { + return new PlaintextMetadata(attrs); } - static presence(e) { - return new Presence(e); + static presence(attrs) { + return new Presence(attrs); } - static present(e) { - return new Present(e); + static present(attrs) { + return new Present(attrs); } - static print(e) { - return new Print(e); + static print(attrs) { + return new Print(attrs); } - static printHighQuality(e) { - return new PrintHighQuality(e); + static printHighQuality(attrs) { + return new PrintHighQuality(attrs); } - static printScaling(e) { - return new PrintScaling(e); + static printScaling(attrs) { + return new PrintScaling(attrs); } - static printerName(e) { - return new PrinterName(e); + static printerName(attrs) { + return new PrinterName(attrs); } - static producer(e) { - return new Producer(e); + static producer(attrs) { + return new Producer(attrs); } - static ps(e) { - return new Ps(e); + static ps(attrs) { + return new Ps(attrs); } - static range(e) { - return new Range(e); + static range(attrs) { + return new Range(attrs); } - static record(e) { - return new Record(e); + static record(attrs) { + return new Record(attrs); } - static relevant(e) { - return new Relevant(e); + static relevant(attrs) { + return new Relevant(attrs); } - static rename(e) { - return new Rename(e); + static rename(attrs) { + return new Rename(attrs); } - static renderPolicy(e) { - return new RenderPolicy(e); + static renderPolicy(attrs) { + return new RenderPolicy(attrs); } - static runScripts(e) { - return new RunScripts(e); + static runScripts(attrs) { + return new RunScripts(attrs); } - static script(e) { - return new config_Script(e); + static script(attrs) { + return new config_Script(attrs); } - static scriptModel(e) { - return new ScriptModel(e); + static scriptModel(attrs) { + return new ScriptModel(attrs); } - static severity(e) { - return new Severity(e); + static severity(attrs) { + return new Severity(attrs); } - static silentPrint(e) { - return new SilentPrint(e); + static silentPrint(attrs) { + return new SilentPrint(attrs); } - static staple(e) { - return new Staple(e); + static staple(attrs) { + return new Staple(attrs); } - static startNode(e) { - return new StartNode(e); + static startNode(attrs) { + return new StartNode(attrs); } - static startPage(e) { - return new StartPage(e); + static startPage(attrs) { + return new StartPage(attrs); } - static submitFormat(e) { - return new SubmitFormat(e); + static submitFormat(attrs) { + return new SubmitFormat(attrs); } - static submitUrl(e) { - return new SubmitUrl(e); + static submitUrl(attrs) { + return new SubmitUrl(attrs); } - static subsetBelow(e) { - return new SubsetBelow(e); + static subsetBelow(attrs) { + return new SubsetBelow(attrs); } - static suppressBanner(e) { - return new SuppressBanner(e); + static suppressBanner(attrs) { + return new SuppressBanner(attrs); } - static tagged(e) { - return new Tagged(e); + static tagged(attrs) { + return new Tagged(attrs); } - static template(e) { - return new config_Template(e); + static template(attrs) { + return new config_Template(attrs); } - static templateCache(e) { - return new TemplateCache(e); + static templateCache(attrs) { + return new TemplateCache(attrs); } - static threshold(e) { - return new Threshold(e); + static threshold(attrs) { + return new Threshold(attrs); } - static to(e) { - return new To(e); + static to(attrs) { + return new To(attrs); } - static trace(e) { - return new Trace(e); + static trace(attrs) { + return new Trace(attrs); } - static transform(e) { - return new Transform(e); + static transform(attrs) { + return new Transform(attrs); } - static type(e) { - return new Type(e); + static type(attrs) { + return new Type(attrs); } - static uri(e) { - return new Uri(e); + static uri(attrs) { + return new Uri(attrs); } - static validate(e) { - return new config_Validate(e); + static validate(attrs) { + return new config_Validate(attrs); } - static validateApprovalSignatures(e) { - return new ValidateApprovalSignatures(e); + static validateApprovalSignatures(attrs) { + return new ValidateApprovalSignatures(attrs); } - static validationMessaging(e) { - return new ValidationMessaging(e); + static validationMessaging(attrs) { + return new ValidationMessaging(attrs); } - static version(e) { - return new Version(e); + static version(attrs) { + return new Version(attrs); } - static versionControl(e) { - return new VersionControl(e); + static versionControl(attrs) { + return new VersionControl(attrs); } - static viewerPreferences(e) { - return new ViewerPreferences(e); + static viewerPreferences(attrs) { + return new ViewerPreferences(attrs); } - static webClient(e) { - return new WebClient(e); + static webClient(attrs) { + return new WebClient(attrs); } - static whitespace(e) { - return new Whitespace(e); + static whitespace(attrs) { + return new Whitespace(attrs); } - static window(e) { - return new Window(e); + static window(attrs) { + return new Window(attrs); } - static xdc(e) { - return new Xdc(e); + static xdc(attrs) { + return new Xdc(attrs); } - static xdp(e) { - return new Xdp(e); + static xdp(attrs) { + return new Xdp(attrs); } - static xsl(e) { - return new Xsl(e); + static xsl(attrs) { + return new Xsl(attrs); } - static zpl(e) { - return new Zpl(e); + static zpl(attrs) { + return new Zpl(attrs); } -} -const On = on.connectionSet.id; +} // ./src/core/xfa/connection_set.js + +const CONNECTION_SET_NS_ID = NamespaceIds.connectionSet.id; class ConnectionSet extends XFAObject { - constructor(e) { - super(On, "connectionSet", !0); + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "connectionSet", true); this.wsdlConnection = new XFAObjectArray(); this.xmlConnection = new XFAObjectArray(); this.xsdConnection = new XFAObjectArray(); } } class EffectiveInputPolicy extends XFAObject { - constructor(e) { - super(On, "effectiveInputPolicy"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "effectiveInputPolicy"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class EffectiveOutputPolicy extends XFAObject { - constructor(e) { - super(On, "effectiveOutputPolicy"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "effectiveOutputPolicy"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class Operation extends StringObject { - constructor(e) { - super(On, "operation"); - this.id = e.id || ""; - this.input = e.input || ""; - this.name = e.name || ""; - this.output = e.output || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "operation"); + this.id = attributes.id || ""; + this.input = attributes.input || ""; + this.name = attributes.name || ""; + this.output = attributes.output || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class RootElement extends StringObject { - constructor(e) { - super(On, "rootElement"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "rootElement"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class SoapAction extends StringObject { - constructor(e) { - super(On, "soapAction"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "soapAction"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class SoapAddress extends StringObject { - constructor(e) { - super(On, "soapAddress"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "soapAddress"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class connection_set_Uri extends StringObject { - constructor(e) { - super(On, "uri"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "uri"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class WsdlAddress extends StringObject { - constructor(e) { - super(On, "wsdlAddress"); - this.id = e.id || ""; - this.name = e.name || ""; - this.use = e.use || ""; - this.usehref = e.usehref || ""; + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "wsdlAddress"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; } } class WsdlConnection extends XFAObject { - constructor(e) { - super(On, "wsdlConnection", !0); - this.dataDescription = e.dataDescription || ""; - this.name = e.name || ""; + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "wsdlConnection", true); + this.dataDescription = attributes.dataDescription || ""; + this.name = attributes.name || ""; this.effectiveInputPolicy = null; this.effectiveOutputPolicy = null; this.operation = null; @@ -50090,102 +60244,113 @@ class WsdlConnection extends XFAObject { } } class XmlConnection extends XFAObject { - constructor(e) { - super(On, "xmlConnection", !0); - this.dataDescription = e.dataDescription || ""; - this.name = e.name || ""; + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "xmlConnection", true); + this.dataDescription = attributes.dataDescription || ""; + this.name = attributes.name || ""; this.uri = null; } } class XsdConnection extends XFAObject { - constructor(e) { - super(On, "xsdConnection", !0); - this.dataDescription = e.dataDescription || ""; - this.name = e.name || ""; + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "xsdConnection", true); + this.dataDescription = attributes.dataDescription || ""; + this.name = attributes.name || ""; this.rootElement = null; this.uri = null; } } class ConnectionSetNamespace { - static [gn](e, t) { - if (ConnectionSetNamespace.hasOwnProperty(e)) - return ConnectionSetNamespace[e](t); + static [$buildXFAObject](name, attributes) { + if (ConnectionSetNamespace.hasOwnProperty(name)) { + return ConnectionSetNamespace[name](attributes); + } + return undefined; } - static connectionSet(e) { - return new ConnectionSet(e); + static connectionSet(attrs) { + return new ConnectionSet(attrs); } - static effectiveInputPolicy(e) { - return new EffectiveInputPolicy(e); + static effectiveInputPolicy(attrs) { + return new EffectiveInputPolicy(attrs); } - static effectiveOutputPolicy(e) { - return new EffectiveOutputPolicy(e); + static effectiveOutputPolicy(attrs) { + return new EffectiveOutputPolicy(attrs); } - static operation(e) { - return new Operation(e); + static operation(attrs) { + return new Operation(attrs); } - static rootElement(e) { - return new RootElement(e); + static rootElement(attrs) { + return new RootElement(attrs); } - static soapAction(e) { - return new SoapAction(e); + static soapAction(attrs) { + return new SoapAction(attrs); } - static soapAddress(e) { - return new SoapAddress(e); + static soapAddress(attrs) { + return new SoapAddress(attrs); } - static uri(e) { - return new connection_set_Uri(e); + static uri(attrs) { + return new connection_set_Uri(attrs); } - static wsdlAddress(e) { - return new WsdlAddress(e); + static wsdlAddress(attrs) { + return new WsdlAddress(attrs); } - static wsdlConnection(e) { - return new WsdlConnection(e); + static wsdlConnection(attrs) { + return new WsdlConnection(attrs); } - static xmlConnection(e) { - return new XmlConnection(e); + static xmlConnection(attrs) { + return new XmlConnection(attrs); } - static xsdConnection(e) { - return new XsdConnection(e); + static xsdConnection(attrs) { + return new XsdConnection(attrs); } -} -const Pn = on.datasets.id; +} // ./src/core/xfa/datasets.js + +const DATASETS_NS_ID = NamespaceIds.datasets.id; class datasets_Data extends XmlObject { - constructor(e) { - super(Pn, "data", e); + constructor(attributes) { + super(DATASETS_NS_ID, "data", attributes); } - [Gr]() { - return !0; + [$isNsAgnostic]() { + return true; } } class Datasets extends XFAObject { - constructor(e) { - super(Pn, "datasets", !0); + constructor(attributes) { + super(DATASETS_NS_ID, "datasets", true); this.data = null; this.Signature = null; } - [Kr](e) { - const t = e[Yr]; - (("data" === t && e[Jr] === Pn) || - ("Signature" === t && e[Jr] === on.signature.id)) && - (this[t] = e); - this[Xs](e); + [$onChild](child) { + const name = child[$nodeName]; + if ( + (name === "data" && child[$namespaceId] === DATASETS_NS_ID) || + (name === "Signature" && + child[$namespaceId] === NamespaceIds.signature.id) + ) { + this[name] = child; + } + this[$appendChild](child); } } class DatasetsNamespace { - static [gn](e, t) { - if (DatasetsNamespace.hasOwnProperty(e)) return DatasetsNamespace[e](t); + static [$buildXFAObject](name, attributes) { + if (DatasetsNamespace.hasOwnProperty(name)) { + return DatasetsNamespace[name](attributes); + } + return undefined; } - static datasets(e) { - return new Datasets(e); + static datasets(attributes) { + return new Datasets(attributes); } - static data(e) { - return new datasets_Data(e); + static data(attributes) { + return new datasets_Data(attributes); } -} -const Wn = on.localeSet.id; +} // ./src/core/xfa/locale_set.js + +const LOCALE_SET_NS_ID = NamespaceIds.localeSet.id; class CalendarSymbols extends XFAObject { - constructor(e) { - super(Wn, "calendarSymbols", !0); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "calendarSymbols", true); this.name = "gregorian"; this.dayNames = new XFAObjectArray(2); this.eraNames = null; @@ -50194,65 +60359,74 @@ class CalendarSymbols extends XFAObject { } } class CurrencySymbol extends StringObject { - constructor(e) { - super(Wn, "currencySymbol"); - this.name = getStringOption(e.name, ["symbol", "isoname", "decimal"]); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "currencySymbol"); + this.name = getStringOption(attributes.name, [ + "symbol", + "isoname", + "decimal", + ]); } } class CurrencySymbols extends XFAObject { - constructor(e) { - super(Wn, "currencySymbols", !0); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "currencySymbols", true); this.currencySymbol = new XFAObjectArray(3); } } class DatePattern extends StringObject { - constructor(e) { - super(Wn, "datePattern"); - this.name = getStringOption(e.name, ["full", "long", "med", "short"]); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "datePattern"); + this.name = getStringOption(attributes.name, [ + "full", + "long", + "med", + "short", + ]); } } class DatePatterns extends XFAObject { - constructor(e) { - super(Wn, "datePatterns", !0); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "datePatterns", true); this.datePattern = new XFAObjectArray(4); } } class DateTimeSymbols extends ContentObject { - constructor(e) { - super(Wn, "dateTimeSymbols"); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "dateTimeSymbols"); } } class Day extends StringObject { - constructor(e) { - super(Wn, "day"); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "day"); } } class DayNames extends XFAObject { - constructor(e) { - super(Wn, "dayNames", !0); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "dayNames", true); this.abbr = getInteger({ - data: e.abbr, + data: attributes.abbr, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); this.day = new XFAObjectArray(7); } } class Era extends StringObject { - constructor(e) { - super(Wn, "era"); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "era"); } } class EraNames extends XFAObject { - constructor(e) { - super(Wn, "eraNames", !0); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "eraNames", true); this.era = new XFAObjectArray(2); } } class locale_set_Locale extends XFAObject { - constructor(e) { - super(Wn, "locale", !0); - this.desc = e.desc || ""; + constructor(attributes) { + super(LOCALE_SET_NS_ID, "locale", true); + this.desc = attributes.desc || ""; this.name = "isoname"; this.calendarSymbols = null; this.currencySymbols = null; @@ -50265,54 +60439,59 @@ class locale_set_Locale extends XFAObject { } } class locale_set_LocaleSet extends XFAObject { - constructor(e) { - super(Wn, "localeSet", !0); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "localeSet", true); this.locale = new XFAObjectArray(); } } class Meridiem extends StringObject { - constructor(e) { - super(Wn, "meridiem"); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "meridiem"); } } class MeridiemNames extends XFAObject { - constructor(e) { - super(Wn, "meridiemNames", !0); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "meridiemNames", true); this.meridiem = new XFAObjectArray(2); } } class Month extends StringObject { - constructor(e) { - super(Wn, "month"); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "month"); } } class MonthNames extends XFAObject { - constructor(e) { - super(Wn, "monthNames", !0); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "monthNames", true); this.abbr = getInteger({ - data: e.abbr, + data: attributes.abbr, defaultValue: 0, - validate: (e) => 1 === e, + validate: (x) => x === 1, }); this.month = new XFAObjectArray(12); } } class NumberPattern extends StringObject { - constructor(e) { - super(Wn, "numberPattern"); - this.name = getStringOption(e.name, ["full", "long", "med", "short"]); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberPattern"); + this.name = getStringOption(attributes.name, [ + "full", + "long", + "med", + "short", + ]); } } class NumberPatterns extends XFAObject { - constructor(e) { - super(Wn, "numberPatterns", !0); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberPatterns", true); this.numberPattern = new XFAObjectArray(4); } } class NumberSymbol extends StringObject { - constructor(e) { - super(Wn, "numberSymbol"); - this.name = getStringOption(e.name, [ + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberSymbol"); + this.name = getStringOption(attributes.name, [ "decimal", "grouping", "percent", @@ -50322,146 +60501,163 @@ class NumberSymbol extends StringObject { } } class NumberSymbols extends XFAObject { - constructor(e) { - super(Wn, "numberSymbols", !0); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberSymbols", true); this.numberSymbol = new XFAObjectArray(5); } } class TimePattern extends StringObject { - constructor(e) { - super(Wn, "timePattern"); - this.name = getStringOption(e.name, ["full", "long", "med", "short"]); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "timePattern"); + this.name = getStringOption(attributes.name, [ + "full", + "long", + "med", + "short", + ]); } } class TimePatterns extends XFAObject { - constructor(e) { - super(Wn, "timePatterns", !0); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "timePatterns", true); this.timePattern = new XFAObjectArray(4); } } class TypeFace extends XFAObject { - constructor(e) { - super(Wn, "typeFace", !0); - this.name = "" | e.name; + constructor(attributes) { + super(LOCALE_SET_NS_ID, "typeFace", true); + this.name = attributes.name | ""; } } class TypeFaces extends XFAObject { - constructor(e) { - super(Wn, "typeFaces", !0); + constructor(attributes) { + super(LOCALE_SET_NS_ID, "typeFaces", true); this.typeFace = new XFAObjectArray(); } } class LocaleSetNamespace { - static [gn](e, t) { - if (LocaleSetNamespace.hasOwnProperty(e)) return LocaleSetNamespace[e](t); + static [$buildXFAObject](name, attributes) { + if (LocaleSetNamespace.hasOwnProperty(name)) { + return LocaleSetNamespace[name](attributes); + } + return undefined; } - static calendarSymbols(e) { - return new CalendarSymbols(e); + static calendarSymbols(attrs) { + return new CalendarSymbols(attrs); } - static currencySymbol(e) { - return new CurrencySymbol(e); + static currencySymbol(attrs) { + return new CurrencySymbol(attrs); } - static currencySymbols(e) { - return new CurrencySymbols(e); + static currencySymbols(attrs) { + return new CurrencySymbols(attrs); } - static datePattern(e) { - return new DatePattern(e); + static datePattern(attrs) { + return new DatePattern(attrs); } - static datePatterns(e) { - return new DatePatterns(e); + static datePatterns(attrs) { + return new DatePatterns(attrs); } - static dateTimeSymbols(e) { - return new DateTimeSymbols(e); + static dateTimeSymbols(attrs) { + return new DateTimeSymbols(attrs); } - static day(e) { - return new Day(e); + static day(attrs) { + return new Day(attrs); } - static dayNames(e) { - return new DayNames(e); + static dayNames(attrs) { + return new DayNames(attrs); } - static era(e) { - return new Era(e); + static era(attrs) { + return new Era(attrs); } - static eraNames(e) { - return new EraNames(e); + static eraNames(attrs) { + return new EraNames(attrs); } - static locale(e) { - return new locale_set_Locale(e); + static locale(attrs) { + return new locale_set_Locale(attrs); } - static localeSet(e) { - return new locale_set_LocaleSet(e); + static localeSet(attrs) { + return new locale_set_LocaleSet(attrs); } - static meridiem(e) { - return new Meridiem(e); + static meridiem(attrs) { + return new Meridiem(attrs); } - static meridiemNames(e) { - return new MeridiemNames(e); + static meridiemNames(attrs) { + return new MeridiemNames(attrs); } - static month(e) { - return new Month(e); + static month(attrs) { + return new Month(attrs); } - static monthNames(e) { - return new MonthNames(e); + static monthNames(attrs) { + return new MonthNames(attrs); } - static numberPattern(e) { - return new NumberPattern(e); + static numberPattern(attrs) { + return new NumberPattern(attrs); } - static numberPatterns(e) { - return new NumberPatterns(e); + static numberPatterns(attrs) { + return new NumberPatterns(attrs); } - static numberSymbol(e) { - return new NumberSymbol(e); + static numberSymbol(attrs) { + return new NumberSymbol(attrs); } - static numberSymbols(e) { - return new NumberSymbols(e); + static numberSymbols(attrs) { + return new NumberSymbols(attrs); } - static timePattern(e) { - return new TimePattern(e); + static timePattern(attrs) { + return new TimePattern(attrs); } - static timePatterns(e) { - return new TimePatterns(e); + static timePatterns(attrs) { + return new TimePatterns(attrs); } - static typeFace(e) { - return new TypeFace(e); + static typeFace(attrs) { + return new TypeFace(attrs); } - static typeFaces(e) { - return new TypeFaces(e); + static typeFaces(attrs) { + return new TypeFaces(attrs); } -} -const jn = on.signature.id; +} // ./src/core/xfa/signature.js + +const SIGNATURE_NS_ID = NamespaceIds.signature.id; class signature_Signature extends XFAObject { - constructor(e) { - super(jn, "signature", !0); + constructor(attributes) { + super(SIGNATURE_NS_ID, "signature", true); } } class SignatureNamespace { - static [gn](e, t) { - if (SignatureNamespace.hasOwnProperty(e)) return SignatureNamespace[e](t); + static [$buildXFAObject](name, attributes) { + if (SignatureNamespace.hasOwnProperty(name)) { + return SignatureNamespace[name](attributes); + } + return undefined; } - static signature(e) { - return new signature_Signature(e); + static signature(attributes) { + return new signature_Signature(attributes); } -} -const Xn = on.stylesheet.id; +} // ./src/core/xfa/stylesheet.js + +const STYLESHEET_NS_ID = NamespaceIds.stylesheet.id; class Stylesheet extends XFAObject { - constructor(e) { - super(Xn, "stylesheet", !0); + constructor(attributes) { + super(STYLESHEET_NS_ID, "stylesheet", true); } } class StylesheetNamespace { - static [gn](e, t) { - if (StylesheetNamespace.hasOwnProperty(e)) return StylesheetNamespace[e](t); + static [$buildXFAObject](name, attributes) { + if (StylesheetNamespace.hasOwnProperty(name)) { + return StylesheetNamespace[name](attributes); + } + return undefined; } - static stylesheet(e) { - return new Stylesheet(e); + static stylesheet(attributes) { + return new Stylesheet(attributes); } -} -const Zn = on.xdp.id; +} // ./src/core/xfa/xdp.js + +const XDP_NS_ID = NamespaceIds.xdp.id; class xdp_Xdp extends XFAObject { - constructor(e) { - super(Zn, "xdp", !0); - this.uuid = e.uuid || ""; - this.timeStamp = e.timeStamp || ""; + constructor(attributes) { + super(XDP_NS_ID, "xdp", true); + this.uuid = attributes.uuid || ""; + this.timeStamp = attributes.timeStamp || ""; this.config = null; this.connectionSet = null; this.datasets = null; @@ -50469,414 +60665,510 @@ class xdp_Xdp extends XFAObject { this.stylesheet = new XFAObjectArray(); this.template = null; } - [Tr](e) { - const t = on[e[Yr]]; - return t && e[Jr] === t.id; + [$onChildCheck](child) { + const ns = NamespaceIds[child[$nodeName]]; + return ns && child[$namespaceId] === ns.id; } } class XdpNamespace { - static [gn](e, t) { - if (XdpNamespace.hasOwnProperty(e)) return XdpNamespace[e](t); + static [$buildXFAObject](name, attributes) { + if (XdpNamespace.hasOwnProperty(name)) { + return XdpNamespace[name](attributes); + } + return undefined; } - static xdp(e) { - return new xdp_Xdp(e); + static xdp(attributes) { + return new xdp_Xdp(attributes); } -} -const Vn = on.xhtml.id, - zn = Symbol(), - _n = new Set([ - "color", - "font", - "font-family", - "font-size", - "font-stretch", - "font-style", - "font-weight", - "margin", - "margin-bottom", - "margin-left", - "margin-right", - "margin-top", - "letter-spacing", - "line-height", - "orphans", - "page-break-after", - "page-break-before", - "page-break-inside", - "tab-interval", - "tab-stop", - "text-align", - "text-decoration", - "text-indent", - "vertical-align", - "widows", - "kerning-mode", +} // ./src/core/xfa/xhtml.js + +const XHTML_NS_ID = NamespaceIds.xhtml.id; +const $richText = Symbol(); +const VALID_STYLES = new Set([ + "color", + "font", + "font-family", + "font-size", + "font-stretch", + "font-style", + "font-weight", + "margin", + "margin-bottom", + "margin-left", + "margin-right", + "margin-top", + "letter-spacing", + "line-height", + "orphans", + "page-break-after", + "page-break-before", + "page-break-inside", + "tab-interval", + "tab-stop", + "text-align", + "text-decoration", + "text-indent", + "vertical-align", + "widows", + "kerning-mode", + "xfa-font-horizontal-scale", + "xfa-font-vertical-scale", + "xfa-spacerun", + "xfa-tab-stops", +]); +const StyleMapping = new Map([ + ["page-break-after", "breakAfter"], + ["page-break-before", "breakBefore"], + ["page-break-inside", "breakInside"], + ["kerning-mode", (value) => (value === "none" ? "none" : "normal")], + [ "xfa-font-horizontal-scale", + (value) => + `scaleX(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`, + ], + [ "xfa-font-vertical-scale", - "xfa-spacerun", - "xfa-tab-stops", - ]), - $n = new Map([ - ["page-break-after", "breakAfter"], - ["page-break-before", "breakBefore"], - ["page-break-inside", "breakInside"], - ["kerning-mode", (e) => ("none" === e ? "none" : "normal")], - [ - "xfa-font-horizontal-scale", - (e) => `scaleX(${Math.max(0, Math.min(parseInt(e) / 100)).toFixed(2)})`, - ], - [ - "xfa-font-vertical-scale", - (e) => `scaleY(${Math.max(0, Math.min(parseInt(e) / 100)).toFixed(2)})`, - ], - ["xfa-spacerun", ""], - ["xfa-tab-stops", ""], - [ - "font-size", - (e, t) => measureToString(0.99 * (e = t.fontSize = getMeasurement(e))), - ], - ["letter-spacing", (e) => measureToString(getMeasurement(e))], - ["line-height", (e) => measureToString(getMeasurement(e))], - ["margin", (e) => measureToString(getMeasurement(e))], - ["margin-bottom", (e) => measureToString(getMeasurement(e))], - ["margin-left", (e) => measureToString(getMeasurement(e))], - ["margin-right", (e) => measureToString(getMeasurement(e))], - ["margin-top", (e) => measureToString(getMeasurement(e))], - ["text-indent", (e) => measureToString(getMeasurement(e))], - ["font-family", (e) => e], - ["vertical-align", (e) => measureToString(getMeasurement(e))], - ]), - Ag = /\s+/g, - eg = /[\r\n]+/g, - tg = /\r\n?/g; -function mapStyle(e, t, i) { - const a = Object.create(null); - if (!e) return a; - const s = Object.create(null); - for (const [t, i] of e.split(";").map((e) => e.split(":", 2))) { - const e = $n.get(t); - if ("" === e) continue; - let r = i; - e && (r = "string" == typeof e ? e : e(i, s)); - t.endsWith("scale") - ? (a.transform = a.transform ? `${a[t]} ${r}` : r) - : (a[t.replaceAll(/-([a-zA-Z])/g, (e, t) => t.toUpperCase())] = r); + (value) => + `scaleY(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`, + ], + ["xfa-spacerun", ""], + ["xfa-tab-stops", ""], + [ + "font-size", + (value, original) => { + value = original.fontSize = getMeasurement(value); + return measureToString(0.99 * value); + }, + ], + ["letter-spacing", (value) => measureToString(getMeasurement(value))], + ["line-height", (value) => measureToString(getMeasurement(value))], + ["margin", (value) => measureToString(getMeasurement(value))], + ["margin-bottom", (value) => measureToString(getMeasurement(value))], + ["margin-left", (value) => measureToString(getMeasurement(value))], + ["margin-right", (value) => measureToString(getMeasurement(value))], + ["margin-top", (value) => measureToString(getMeasurement(value))], + ["text-indent", (value) => measureToString(getMeasurement(value))], + ["font-family", (value) => value], + ["vertical-align", (value) => measureToString(getMeasurement(value))], +]); +const spacesRegExp = /\s+/g; +const crlfRegExp = /[\r\n]+/g; +const crlfForRichTextRegExp = /\r\n?/g; +function mapStyle(styleStr, node, richText) { + const style = Object.create(null); + if (!styleStr) { + return style; } - a.fontFamily && + const original = Object.create(null); + for (const [key, value] of styleStr.split(";").map((s) => s.split(":", 2))) { + const mapping = StyleMapping.get(key); + if (mapping === "") { + continue; + } + let newValue = value; + if (mapping) { + newValue = + typeof mapping === "string" ? mapping : mapping(value, original); + } + if (key.endsWith("scale")) { + style.transform = style.transform + ? `${style[key]} ${newValue}` + : newValue; + } else { + style[key.replaceAll(/-([a-zA-Z])/g, (_, x) => x.toUpperCase())] = + newValue; + } + } + if (style.fontFamily) { setFontFamily( { - typeface: a.fontFamily, - weight: a.fontWeight || "normal", - posture: a.fontStyle || "normal", - size: s.fontSize || 0, + typeface: style.fontFamily, + weight: style.fontWeight || "normal", + posture: style.fontStyle || "normal", + size: original.fontSize || 0, }, - t, - t[yr].fontFinder, - a, - ); - if (i && a.verticalAlign && "0px" !== a.verticalAlign && a.fontSize) { - const e = 0.583, - t = 0.333, - i = getMeasurement(a.fontSize); - a.fontSize = measureToString(i * e); - a.verticalAlign = measureToString( - Math.sign(getMeasurement(a.verticalAlign)) * i * t, + node, + node[$globalData].fontFinder, + style, ); } - i && a.fontSize && (a.fontSize = `calc(${a.fontSize} * var(--scale-factor))`); - fixTextIndent(a); - return a; + if ( + richText && + style.verticalAlign && + style.verticalAlign !== "0px" && + style.fontSize + ) { + const SUB_SUPER_SCRIPT_FACTOR = 0.583; + const VERTICAL_FACTOR = 0.333; + const fontSize = getMeasurement(style.fontSize); + style.fontSize = measureToString(fontSize * SUB_SUPER_SCRIPT_FACTOR); + style.verticalAlign = measureToString( + Math.sign(getMeasurement(style.verticalAlign)) * + fontSize * + VERTICAL_FACTOR, + ); + } + if (richText && style.fontSize) { + style.fontSize = `calc(${style.fontSize} * var(--scale-factor))`; + } + fixTextIndent(style); + return style; } -const ig = new Set(["body", "html"]); +function checkStyle(node) { + if (!node.style) { + return ""; + } + return node.style + .trim() + .split(/\s*;\s*/) + .filter((s) => !!s) + .map((s) => s.split(/\s*:\s*/, 2)) + .filter(([key, value]) => { + if (key === "font-family") { + node[$globalData].usedTypefaces.add(value); + } + return VALID_STYLES.has(key); + }) + .map((kv) => kv.join(":")) + .join(";"); +} +const NoWhites = new Set(["body", "html"]); class XhtmlObject extends XmlObject { - constructor(e, t) { - super(Vn, t); - this[zn] = !1; - this.style = e.style || ""; + constructor(attributes, name) { + super(XHTML_NS_ID, name); + this[$richText] = false; + this.style = attributes.style || ""; } - [Vs](e) { - super[Vs](e); - this.style = (function checkStyle(e) { - return e.style - ? e.style - .trim() - .split(/\s*;\s*/) - .filter((e) => !!e) - .map((e) => e.split(/\s*:\s*/, 2)) - .filter(([t, i]) => { - "font-family" === t && e[yr].usedTypefaces.add(i); - return _n.has(t); - }) - .map((e) => e.join(":")) - .join(";") - : ""; - })(this); + [$clean](builder) { + super[$clean](builder); + this.style = checkStyle(this); } - [Ws]() { - return !ig.has(this[Yr]); + [$acceptWhitespace]() { + return !NoWhites.has(this[$nodeName]); } - [qr](e, t = !1) { - if (t) this[zn] = !0; - else { - e = e.replaceAll(eg, ""); - this.style.includes("xfa-spacerun:yes") || (e = e.replaceAll(Ag, " ")); + [$onText](str, richText = false) { + if (!richText) { + str = str.replaceAll(crlfRegExp, ""); + if (!this.style.includes("xfa-spacerun:yes")) { + str = str.replaceAll(spacesRegExp, " "); + } + } else { + this[$richText] = true; + } + if (str) { + this[$content] += str; } - e && (this[er] += e); } - [Or](e, t = !0) { - const i = Object.create(null), - a = { top: NaN, bottom: NaN, left: NaN, right: NaN }; - let s = null; - for (const [e, t] of this.style.split(";").map((e) => e.split(":", 2))) - switch (e) { + [$pushGlyphs](measure, mustPop = true) { + const xfaFont = Object.create(null); + const margin = { + top: NaN, + bottom: NaN, + left: NaN, + right: NaN, + }; + let lineHeight = null; + for (const [key, value] of this.style + .split(";") + .map((s) => s.split(":", 2))) { + switch (key) { case "font-family": - i.typeface = stripQuotes(t); + xfaFont.typeface = stripQuotes(value); break; case "font-size": - i.size = getMeasurement(t); + xfaFont.size = getMeasurement(value); break; case "font-weight": - i.weight = t; + xfaFont.weight = value; break; case "font-style": - i.posture = t; + xfaFont.posture = value; break; case "letter-spacing": - i.letterSpacing = getMeasurement(t); + xfaFont.letterSpacing = getMeasurement(value); break; case "margin": - const e = t.split(/ \t/).map((e) => getMeasurement(e)); - switch (e.length) { + const values = value.split(/ \t/).map((x) => getMeasurement(x)); + switch (values.length) { case 1: - a.top = a.bottom = a.left = a.right = e[0]; + margin.top = + margin.bottom = + margin.left = + margin.right = + values[0]; break; case 2: - a.top = a.bottom = e[0]; - a.left = a.right = e[1]; + margin.top = margin.bottom = values[0]; + margin.left = margin.right = values[1]; break; case 3: - a.top = e[0]; - a.bottom = e[2]; - a.left = a.right = e[1]; + margin.top = values[0]; + margin.bottom = values[2]; + margin.left = margin.right = values[1]; break; case 4: - a.top = e[0]; - a.left = e[1]; - a.bottom = e[2]; - a.right = e[3]; + margin.top = values[0]; + margin.left = values[1]; + margin.bottom = values[2]; + margin.right = values[3]; + break; } break; case "margin-top": - a.top = getMeasurement(t); + margin.top = getMeasurement(value); break; case "margin-bottom": - a.bottom = getMeasurement(t); + margin.bottom = getMeasurement(value); break; case "margin-left": - a.left = getMeasurement(t); + margin.left = getMeasurement(value); break; case "margin-right": - a.right = getMeasurement(t); + margin.right = getMeasurement(value); break; case "line-height": - s = getMeasurement(t); + lineHeight = getMeasurement(value); + break; } - e.pushData(i, a, s); - if (this[er]) e.addString(this[er]); - else - for (const t of this[Er]()) - "#text" !== t[Yr] ? t[Or](e) : e.addString(t[er]); - t && e.popFont(); + } + measure.pushData(xfaFont, margin, lineHeight); + if (this[$content]) { + measure.addString(this[$content]); + } else { + for (const child of this[$getChildren]()) { + if (child[$nodeName] === "#text") { + measure.addString(child[$content]); + continue; + } + child[$pushGlyphs](measure); + } + } + if (mustPop) { + measure.popFont(); + } } - [an](e) { - const t = []; - this[ar] = { children: t }; - this[Zs]({}); - if (0 === t.length && !this[er]) return HTMLResult.EMPTY; - let i; - i = this[zn] - ? this[er] - ? this[er].replaceAll(tg, "\n") - : void 0 - : this[er] || void 0; + [$toHTML](availableSpace) { + const children = []; + this[$extra] = { + children, + }; + this[$childrenToHTML]({}); + if (children.length === 0 && !this[$content]) { + return HTMLResult.EMPTY; + } + let value; + if (this[$richText]) { + value = this[$content] + ? this[$content].replaceAll(crlfForRichTextRegExp, "\n") + : undefined; + } else { + value = this[$content] || undefined; + } return HTMLResult.success({ - name: this[Yr], + name: this[$nodeName], attributes: { href: this.href, - style: mapStyle(this.style, this, this[zn]), + style: mapStyle(this.style, this, this[$richText]), }, - children: t, - value: i, + children, + value, }); } } class A extends XhtmlObject { - constructor(e) { - super(e, "a"); - this.href = fixURL(e.href) || ""; + constructor(attributes) { + super(attributes, "a"); + this.href = fixURL(attributes.href) || ""; } } class B extends XhtmlObject { - constructor(e) { - super(e, "b"); + constructor(attributes) { + super(attributes, "b"); } - [Or](e) { - e.pushFont({ weight: "bold" }); - super[Or](e); - e.popFont(); + [$pushGlyphs](measure) { + measure.pushFont({ + weight: "bold", + }); + super[$pushGlyphs](measure); + measure.popFont(); } } class Body extends XhtmlObject { - constructor(e) { - super(e, "body"); + constructor(attributes) { + super(attributes, "body"); } - [an](e) { - const t = super[an](e), - { html: i } = t; - if (!i) return HTMLResult.EMPTY; - i.name = "div"; - i.attributes.class = ["xfaRich"]; - return t; + [$toHTML](availableSpace) { + const res = super[$toHTML](availableSpace); + const { html } = res; + if (!html) { + return HTMLResult.EMPTY; + } + html.name = "div"; + html.attributes.class = ["xfaRich"]; + return res; } } class Br extends XhtmlObject { - constructor(e) { - super(e, "br"); + constructor(attributes) { + super(attributes, "br"); } - [en]() { + [$text]() { return "\n"; } - [Or](e) { - e.addString("\n"); + [$pushGlyphs](measure) { + measure.addString("\n"); } - [an](e) { - return HTMLResult.success({ name: "br" }); + [$toHTML](availableSpace) { + return HTMLResult.success({ + name: "br", + }); } } class Html extends XhtmlObject { - constructor(e) { - super(e, "html"); + constructor(attributes) { + super(attributes, "html"); } - [an](e) { - const t = []; - this[ar] = { children: t }; - this[Zs]({}); - if (0 === t.length) + [$toHTML](availableSpace) { + const children = []; + this[$extra] = { + children, + }; + this[$childrenToHTML]({}); + if (children.length === 0) { return HTMLResult.success({ name: "div", - attributes: { class: ["xfaRich"], style: {} }, - value: this[er] || "", + attributes: { + class: ["xfaRich"], + style: {}, + }, + value: this[$content] || "", }); - if (1 === t.length) { - const e = t[0]; - if (e.attributes?.class.includes("xfaRich")) return HTMLResult.success(e); + } + if (children.length === 1) { + const child = children[0]; + if (child.attributes?.class.includes("xfaRich")) { + return HTMLResult.success(child); + } } return HTMLResult.success({ name: "div", - attributes: { class: ["xfaRich"], style: {} }, - children: t, + attributes: { + class: ["xfaRich"], + style: {}, + }, + children, }); } } class I extends XhtmlObject { - constructor(e) { - super(e, "i"); + constructor(attributes) { + super(attributes, "i"); } - [Or](e) { - e.pushFont({ posture: "italic" }); - super[Or](e); - e.popFont(); + [$pushGlyphs](measure) { + measure.pushFont({ + posture: "italic", + }); + super[$pushGlyphs](measure); + measure.popFont(); } } class Li extends XhtmlObject { - constructor(e) { - super(e, "li"); + constructor(attributes) { + super(attributes, "li"); } } class Ol extends XhtmlObject { - constructor(e) { - super(e, "ol"); + constructor(attributes) { + super(attributes, "ol"); } } class P extends XhtmlObject { - constructor(e) { - super(e, "p"); + constructor(attributes) { + super(attributes, "p"); } - [Or](e) { - super[Or](e, !1); - e.addString("\n"); - e.addPara(); - e.popFont(); + [$pushGlyphs](measure) { + super[$pushGlyphs](measure, false); + measure.addString("\n"); + measure.addPara(); + measure.popFont(); } - [en]() { - return this[pr]()[Er]().at(-1) === this ? super[en]() : super[en]() + "\n"; + [$text]() { + const siblings = this[$getParent]()[$getChildren](); + if (siblings.at(-1) === this) { + return super[$text](); + } + return super[$text]() + "\n"; } } class Span extends XhtmlObject { - constructor(e) { - super(e, "span"); + constructor(attributes) { + super(attributes, "span"); } } class Sub extends XhtmlObject { - constructor(e) { - super(e, "sub"); + constructor(attributes) { + super(attributes, "sub"); } } class Sup extends XhtmlObject { - constructor(e) { - super(e, "sup"); + constructor(attributes) { + super(attributes, "sup"); } } class Ul extends XhtmlObject { - constructor(e) { - super(e, "ul"); + constructor(attributes) { + super(attributes, "ul"); } } class XhtmlNamespace { - static [gn](e, t) { - if (XhtmlNamespace.hasOwnProperty(e)) return XhtmlNamespace[e](t); + static [$buildXFAObject](name, attributes) { + if (XhtmlNamespace.hasOwnProperty(name)) { + return XhtmlNamespace[name](attributes); + } + return undefined; } - static a(e) { - return new A(e); + static a(attributes) { + return new A(attributes); } - static b(e) { - return new B(e); + static b(attributes) { + return new B(attributes); } - static body(e) { - return new Body(e); + static body(attributes) { + return new Body(attributes); } - static br(e) { - return new Br(e); + static br(attributes) { + return new Br(attributes); } - static html(e) { - return new Html(e); + static html(attributes) { + return new Html(attributes); } - static i(e) { - return new I(e); + static i(attributes) { + return new I(attributes); } - static li(e) { - return new Li(e); + static li(attributes) { + return new Li(attributes); } - static ol(e) { - return new Ol(e); + static ol(attributes) { + return new Ol(attributes); } - static p(e) { - return new P(e); + static p(attributes) { + return new P(attributes); } - static span(e) { - return new Span(e); + static span(attributes) { + return new Span(attributes); } - static sub(e) { - return new Sub(e); + static sub(attributes) { + return new Sub(attributes); } - static sup(e) { - return new Sup(e); + static sup(attributes) { + return new Sup(attributes); } - static ul(e) { - return new Ul(e); + static ul(attributes) { + return new Ul(attributes); } -} -const ag = { +} // ./src/core/xfa/setup.js + +const NamespaceSetUp = { config: ConfigNamespace, connection: ConnectionSetNamespace, datasets: DatasetsNamespace, @@ -50886,31 +61178,33 @@ const ag = { template: TemplateNamespace, xdp: XdpNamespace, xhtml: XhtmlNamespace, -}; +}; // ./src/core/xfa/unknown.js + class UnknownNamespace { - constructor(e) { - this.namespaceId = e; + constructor(nsId) { + this.namespaceId = nsId; } - [gn](e, t) { - return new XmlObject(this.namespaceId, e, t); + [$buildXFAObject](name, attributes) { + return new XmlObject(this.namespaceId, name, attributes); } -} +} // ./src/core/xfa/builder.js + class Root extends XFAObject { - constructor(e) { + constructor(ids) { super(-1, "root", Object.create(null)); this.element = null; - this[Dr] = e; + this[$ids] = ids; } - [Kr](e) { - this.element = e; - return !0; + [$onChild](child) { + this.element = child; + return true; } - [sr]() { - super[sr](); + [$finalize]() { + super[$finalize](); if (this.element.template instanceof Template) { - this[Dr].set(Xr, this.element); - this.element.template[Zr](this[Dr]); - this.element.template[Dr] = this[Dr]; + this[$ids].set($root, this.element); + this.element.template[$resolvePrototypes](this[$ids]); + this.element.template[$ids] = this[$ids]; } } } @@ -50918,199 +61212,266 @@ class Empty extends XFAObject { constructor() { super(-1, "", Object.create(null)); } - [Kr](e) { - return !1; + [$onChild](_) { + return false; } } class Builder { - constructor(e = null) { + constructor(rootNameSpace = null) { this._namespaceStack = []; this._nsAgnosticLevel = 0; this._namespacePrefixes = new Map(); this._namespaces = new Map(); - this._nextNsId = Math.max(...Object.values(on).map(({ id: e }) => e)); - this._currentNamespace = e || new UnknownNamespace(++this._nextNsId); + this._nextNsId = Math.max( + ...Object.values(NamespaceIds).map(({ id }) => id), + ); + this._currentNamespace = + rootNameSpace || new UnknownNamespace(++this._nextNsId); } - buildRoot(e) { - return new Root(e); + buildRoot(ids) { + return new Root(ids); } - build({ nsPrefix: e, name: t, attributes: i, namespace: a, prefixes: s }) { - const r = null !== a; - if (r) { + build({ nsPrefix, name, attributes, namespace, prefixes }) { + const hasNamespaceDef = namespace !== null; + if (hasNamespaceDef) { this._namespaceStack.push(this._currentNamespace); - this._currentNamespace = this._searchNamespace(a); + this._currentNamespace = this._searchNamespace(namespace); } - s && this._addNamespacePrefix(s); - if (i.hasOwnProperty(vr)) { - const e = ag.datasets, - t = i[vr]; - let a = null; - for (const [i, s] of Object.entries(t)) { - if (this._getNamespaceToUse(i) === e) { - a = { xfa: s }; + if (prefixes) { + this._addNamespacePrefix(prefixes); + } + if (attributes.hasOwnProperty($nsAttributes)) { + const dataTemplate = NamespaceSetUp.datasets; + const nsAttrs = attributes[$nsAttributes]; + let xfaAttrs = null; + for (const [ns, attrs] of Object.entries(nsAttrs)) { + const nsToUse = this._getNamespaceToUse(ns); + if (nsToUse === dataTemplate) { + xfaAttrs = { + xfa: attrs, + }; break; } } - a ? (i[vr] = a) : delete i[vr]; + if (xfaAttrs) { + attributes[$nsAttributes] = xfaAttrs; + } else { + delete attributes[$nsAttributes]; + } } - const n = this._getNamespaceToUse(e), - g = n?.[gn](t, i) || new Empty(); - g[Gr]() && this._nsAgnosticLevel++; - (r || s || g[Gr]()) && - (g[_s] = { hasNamespace: r, prefixes: s, nsAgnostic: g[Gr]() }); - return g; + const namespaceToUse = this._getNamespaceToUse(nsPrefix); + const node = + namespaceToUse?.[$buildXFAObject](name, attributes) || new Empty(); + if (node[$isNsAgnostic]()) { + this._nsAgnosticLevel++; + } + if (hasNamespaceDef || prefixes || node[$isNsAgnostic]()) { + node[$cleanup] = { + hasNamespace: hasNamespaceDef, + prefixes, + nsAgnostic: node[$isNsAgnostic](), + }; + } + return node; } isNsAgnostic() { return this._nsAgnosticLevel > 0; } - _searchNamespace(e) { - let t = this._namespaces.get(e); - if (t) return t; - for (const [i, { check: a }] of Object.entries(on)) - if (a(e)) { - t = ag[i]; - if (t) { - this._namespaces.set(e, t); - return t; + _searchNamespace(nsName) { + let ns = this._namespaces.get(nsName); + if (ns) { + return ns; + } + for (const [name, { check }] of Object.entries(NamespaceIds)) { + if (check(nsName)) { + ns = NamespaceSetUp[name]; + if (ns) { + this._namespaces.set(nsName, ns); + return ns; } break; } - t = new UnknownNamespace(++this._nextNsId); - this._namespaces.set(e, t); - return t; + } + ns = new UnknownNamespace(++this._nextNsId); + this._namespaces.set(nsName, ns); + return ns; } - _addNamespacePrefix(e) { - for (const { prefix: t, value: i } of e) { - const e = this._searchNamespace(i); - let a = this._namespacePrefixes.get(t); - if (!a) { - a = []; - this._namespacePrefixes.set(t, a); + _addNamespacePrefix(prefixes) { + for (const { prefix, value } of prefixes) { + const namespace = this._searchNamespace(value); + let prefixStack = this._namespacePrefixes.get(prefix); + if (!prefixStack) { + prefixStack = []; + this._namespacePrefixes.set(prefix, prefixStack); } - a.push(e); + prefixStack.push(namespace); } } - _getNamespaceToUse(e) { - if (!e) return this._currentNamespace; - const t = this._namespacePrefixes.get(e); - if (t?.length > 0) return t.at(-1); - warn(`Unknown namespace prefix: ${e}.`); + _getNamespaceToUse(prefix) { + if (!prefix) { + return this._currentNamespace; + } + const prefixStack = this._namespacePrefixes.get(prefix); + if (prefixStack?.length > 0) { + return prefixStack.at(-1); + } + warn(`Unknown namespace prefix: ${prefix}.`); return null; } - clean(e) { - const { hasNamespace: t, prefixes: i, nsAgnostic: a } = e; - t && (this._currentNamespace = this._namespaceStack.pop()); - i && - i.forEach(({ prefix: e }) => { - this._namespacePrefixes.get(e).pop(); + clean(data) { + const { hasNamespace, prefixes, nsAgnostic } = data; + if (hasNamespace) { + this._currentNamespace = this._namespaceStack.pop(); + } + if (prefixes) { + prefixes.forEach(({ prefix }) => { + this._namespacePrefixes.get(prefix).pop(); }); - a && this._nsAgnosticLevel--; + } + if (nsAgnostic) { + this._nsAgnosticLevel--; + } } -} +} // ./src/core/xfa/parser.js + class XFAParser extends XMLParserBase { - constructor(e = null, t = !1) { + constructor(rootNameSpace = null, richText = false) { super(); - this._builder = new Builder(e); + this._builder = new Builder(rootNameSpace); this._stack = []; - this._globalData = { usedTypefaces: new Set() }; + this._globalData = { + usedTypefaces: new Set(), + }; this._ids = new Map(); this._current = this._builder.buildRoot(this._ids); - this._errorCode = Rs; + this._errorCode = XMLParserErrorCode.NoError; this._whiteRegex = /^\s+$/; this._nbsps = /\xa0+/g; - this._richText = t; + this._richText = richText; } - parse(e) { - this.parseXml(e); - if (this._errorCode === Rs) { - this._current[sr](); - return this._current.element; + parse(data) { + this.parseXml(data); + if (this._errorCode !== XMLParserErrorCode.NoError) { + return undefined; } + this._current[$finalize](); + return this._current.element; } - onText(e) { - e = e.replace(this._nbsps, (e) => e.slice(1) + " "); - this._richText || this._current[Ws]() - ? this._current[qr](e, this._richText) - : this._whiteRegex.test(e) || this._current[qr](e.trim()); + onText(text) { + text = text.replace(this._nbsps, (match) => match.slice(1) + " "); + if (this._richText || this._current[$acceptWhitespace]()) { + this._current[$onText](text, this._richText); + return; + } + if (this._whiteRegex.test(text)) { + return; + } + this._current[$onText](text.trim()); } - onCdata(e) { - this._current[qr](e); + onCdata(text) { + this._current[$onText](text); } - _mkAttributes(e, t) { - let i = null, - a = null; - const s = Object.create({}); - for (const { name: r, value: n } of e) - if ("xmlns" === r) - i ? warn(`XFA - multiple namespace definition in <${t}>`) : (i = n); - else if (r.startsWith("xmlns:")) { - const e = r.substring(6); - a || (a = []); - a.push({ prefix: e, value: n }); + _mkAttributes(attributes, tagName) { + let namespace = null; + let prefixes = null; + const attributeObj = Object.create({}); + for (const { name, value } of attributes) { + if (name === "xmlns") { + if (!namespace) { + namespace = value; + } else { + warn(`XFA - multiple namespace definition in <${tagName}>`); + } + } else if (name.startsWith("xmlns:")) { + const prefix = name.substring("xmlns:".length); + if (!prefixes) { + prefixes = []; + } + prefixes.push({ + prefix, + value, + }); } else { - const e = r.indexOf(":"); - if (-1 === e) s[r] = n; - else { - let t = s[vr]; - t || (t = s[vr] = Object.create(null)); - const [i, a] = [r.slice(0, e), r.slice(e + 1)]; - (t[i] ||= Object.create(null))[a] = n; + const i = name.indexOf(":"); + if (i === -1) { + attributeObj[name] = value; + } else { + let nsAttrs = attributeObj[$nsAttributes]; + if (!nsAttrs) { + nsAttrs = attributeObj[$nsAttributes] = Object.create(null); + } + const [ns, attrName] = [name.slice(0, i), name.slice(i + 1)]; + const attrs = (nsAttrs[ns] ||= Object.create(null)); + attrs[attrName] = value; } } - return [i, a, s]; - } - _getNameAndPrefix(e, t) { - const i = e.indexOf(":"); - return -1 === i - ? [e, null] - : [e.substring(i + 1), t ? "" : e.substring(0, i)]; - } - onBeginElement(e, t, i) { - const [a, s, r] = this._mkAttributes(t, e), - [n, g] = this._getNameAndPrefix(e, this._builder.isNsAgnostic()), - o = this._builder.build({ - nsPrefix: g, - name: n, - attributes: r, - namespace: a, - prefixes: s, - }); - o[yr] = this._globalData; - if (i) { - o[sr](); - this._current[Kr](o) && o[zr](this._ids); - o[Vs](this._builder); - } else { - this._stack.push(this._current); - this._current = o; } + return [namespace, prefixes, attributeObj]; } - onEndElement(e) { - const t = this._current; - if (t[Sr]() && "string" == typeof t[er]) { - const e = new XFAParser(); - e._globalData = this._globalData; - const i = e.parse(t[er]); - t[er] = null; - t[Kr](i); + _getNameAndPrefix(name, nsAgnostic) { + const i = name.indexOf(":"); + if (i === -1) { + return [name, null]; } - t[sr](); + return [name.substring(i + 1), nsAgnostic ? "" : name.substring(0, i)]; + } + onBeginElement(tagName, attributes, isEmpty) { + const [namespace, prefixes, attributesObj] = this._mkAttributes( + attributes, + tagName, + ); + const [name, nsPrefix] = this._getNameAndPrefix( + tagName, + this._builder.isNsAgnostic(), + ); + const node = this._builder.build({ + nsPrefix, + name, + attributes: attributesObj, + namespace, + prefixes, + }); + node[$globalData] = this._globalData; + if (isEmpty) { + node[$finalize](); + if (this._current[$onChild](node)) { + node[$setId](this._ids); + } + node[$clean](this._builder); + return; + } + this._stack.push(this._current); + this._current = node; + } + onEndElement(name) { + const node = this._current; + if (node[$isCDATAXml]() && typeof node[$content] === "string") { + const parser = new XFAParser(); + parser._globalData = this._globalData; + const root = parser.parse(node[$content]); + node[$content] = null; + node[$onChild](root); + } + node[$finalize](); this._current = this._stack.pop(); - this._current[Kr](t) && t[zr](this._ids); - t[Vs](this._builder); + if (this._current[$onChild](node)) { + node[$setId](this._ids); + } + node[$clean](this._builder); } - onError(e) { - this._errorCode = e; + onError(code) { + this._errorCode = code; } -} +} // ./src/core/xfa/factory.js + class XFAFactory { - constructor(e) { + constructor(data) { try { - this.root = new XFAParser().parse(XFAFactory._createDocument(e)); - const t = new Binder(this.root); - this.form = t.bind(); - this.dataHandler = new DataHandler(this.root, t.getData()); - this.form[yr].template = this.form; + this.root = new XFAParser().parse(XFAFactory._createDocument(data)); + const binder = new Binder(this.root); + this.form = binder.bind(); + this.dataHandler = new DataHandler(this.root, binder.getData()); + this.form[$globalData].template = this.form; } catch (e) { warn(`XFA - an error occurred during parsing and binding: ${e}`); } @@ -51119,14 +61480,18 @@ class XFAFactory { return this.root && this.form; } _createPagesHelper() { - const e = this.form[tn](); - return new Promise((t, i) => { + const iterator = this.form[$toPages](); + return new Promise((resolve, reject) => { const nextIteration = () => { try { - const i = e.next(); - i.done ? t(i.value) : setTimeout(nextIteration, 0); + const value = iterator.next(); + if (value.done) { + resolve(value.value); + } else { + setTimeout(nextIteration, 0); + } } catch (e) { - i(e); + reject(e); } }; setTimeout(nextIteration, 0); @@ -51135,404 +61500,595 @@ class XFAFactory { async _createPages() { try { this.pages = await this._createPagesHelper(); - this.dims = this.pages.children.map((e) => { - const { width: t, height: i } = e.attributes.style; - return [0, 0, parseInt(t), parseInt(i)]; + this.dims = this.pages.children.map((c) => { + const { width, height } = c.attributes.style; + return [0, 0, parseInt(width), parseInt(height)]; }); } catch (e) { warn(`XFA - an error occurred during layout: ${e}`); } } - getBoundingBox(e) { - return this.dims[e]; + getBoundingBox(pageIndex) { + return this.dims[pageIndex]; } async getNumPages() { - this.pages || (await this._createPages()); + if (!this.pages) { + await this._createPages(); + } return this.dims.length; } - setImages(e) { - this.form[yr].images = e; + setImages(images) { + this.form[$globalData].images = images; } - setFonts(e) { - this.form[yr].fontFinder = new FontFinder(e); - const t = []; - for (let e of this.form[yr].usedTypefaces) { - e = stripQuotes(e); - this.form[yr].fontFinder.find(e) || t.push(e); + setFonts(fonts) { + this.form[$globalData].fontFinder = new FontFinder(fonts); + const missingFonts = []; + for (let typeface of this.form[$globalData].usedTypefaces) { + typeface = stripQuotes(typeface); + const font = this.form[$globalData].fontFinder.find(typeface); + if (!font) { + missingFonts.push(typeface); + } } - return t.length > 0 ? t : null; + if (missingFonts.length > 0) { + return missingFonts; + } + return null; } - appendFonts(e, t) { - this.form[yr].fontFinder.add(e, t); + appendFonts(fonts, reallyMissingFonts) { + this.form[$globalData].fontFinder.add(fonts, reallyMissingFonts); } async getPages() { - this.pages || (await this._createPages()); - const e = this.pages; + if (!this.pages) { + await this._createPages(); + } + const pages = this.pages; this.pages = null; - return e; + return pages; } - serializeData(e) { - return this.dataHandler.serialize(e); + serializeData(storage) { + return this.dataHandler.serialize(storage); } - static _createDocument(e) { - return e["/xdp:xdp"] ? Object.values(e).join("") : e["xdp:xdp"]; + static _createDocument(data) { + if (!data["/xdp:xdp"]) { + return data["xdp:xdp"]; + } + return Object.values(data).join(""); } - static getRichTextAsHtml(e) { - if (!e || "string" != typeof e) return null; + static getRichTextAsHtml(rc) { + if (!rc || typeof rc !== "string") { + return null; + } try { - let t = new XFAParser(XhtmlNamespace, !0).parse(e); - if (!["body", "xhtml"].includes(t[Yr])) { - const e = XhtmlNamespace.body({}); - e[Xs](t); - t = e; + let root = new XFAParser(XhtmlNamespace, true).parse(rc); + if (!["body", "xhtml"].includes(root[$nodeName])) { + const newRoot = XhtmlNamespace.body({}); + newRoot[$appendChild](root); + root = newRoot; } - const i = t[an](); - if (!i.success) return null; - const { html: a } = i, - { attributes: s } = a; - if (s) { - s.class && (s.class = s.class.filter((e) => !e.startsWith("xfa"))); - s.dir = "auto"; + const result = root[$toHTML](); + if (!result.success) { + return null; } - return { html: a, str: t[en]() }; + const { html } = result; + const { attributes } = html; + if (attributes) { + if (attributes.class) { + attributes.class = attributes.class.filter( + (attr) => !attr.startsWith("xfa"), + ); + } + attributes.dir = "auto"; + } + return { + html, + str: root[$text](), + }; } catch (e) { warn(`XFA - an error occurred during parsing of rich text: ${e}`); } return null; } -} +} // ./src/core/annotation.js + class AnnotationFactory { - static createGlobals(e) { + static createGlobals(pdfManager) { return Promise.all([ - e.ensureCatalog("acroForm"), - e.ensureDoc("xfaDatasets"), - e.ensureCatalog("structTreeRoot"), - e.ensureCatalog("baseUrl"), - e.ensureCatalog("attachments"), + pdfManager.ensureCatalog("acroForm"), + pdfManager.ensureDoc("xfaDatasets"), + pdfManager.ensureCatalog("structTreeRoot"), + pdfManager.ensureCatalog("baseUrl"), + pdfManager.ensureCatalog("attachments"), ]).then( - ([t, i, a, s, r]) => ({ - pdfManager: e, - acroForm: t instanceof Dict ? t : Dict.empty, - xfaDatasets: i, - structTreeRoot: a, - baseUrl: s, - attachments: r, - }), - (e) => { - warn(`createGlobals: "${e}".`); + ([acroForm, xfaDatasets, structTreeRoot, baseUrl, attachments]) => { + return { + pdfManager, + acroForm: acroForm instanceof Dict ? acroForm : Dict.empty, + xfaDatasets, + structTreeRoot, + baseUrl, + attachments, + }; + }, + (reason) => { + warn(`createGlobals: "${reason}".`); return null; }, ); } - static async create(e, t, i, a, s, r) { - const n = s ? await this._getPageIndex(e, t, i.pdfManager) : null; - return i.pdfManager.ensure(this, "_create", [e, t, i, a, s, n, r]); + static async create( + xref, + ref, + annotationGlobals, + idFactory, + collectFields, + orphanFields, + pageRef, + ) { + const pageIndex = collectFields + ? await this._getPageIndex(xref, ref, annotationGlobals.pdfManager) + : null; + return annotationGlobals.pdfManager.ensure(this, "_create", [ + xref, + ref, + annotationGlobals, + idFactory, + collectFields, + orphanFields, + pageIndex, + pageRef, + ]); } - static _create(e, t, i, a, s = !1, r = null, n = null) { - const g = e.fetchIfRef(t); - if (!(g instanceof Dict)) return; - const { acroForm: o, pdfManager: c } = i, - C = t instanceof Ref ? t.toString() : `annot_${a.createObjId()}`; - let h = g.get("Subtype"); - h = h instanceof Name ? h.name : null; - const l = { - xref: e, - ref: t, - dict: g, - subtype: h, - id: C, - annotationGlobals: i, - collectFields: s, - needAppearances: !s && !0 === o.get("NeedAppearances"), - pageIndex: r, - evaluatorOptions: c.evaluatorOptions, - pageRef: n, + static _create( + xref, + ref, + annotationGlobals, + idFactory, + collectFields = false, + orphanFields = null, + pageIndex = null, + pageRef = null, + ) { + const dict = xref.fetchIfRef(ref); + if (!(dict instanceof Dict)) { + return undefined; + } + const { acroForm, pdfManager } = annotationGlobals; + const id = + ref instanceof Ref ? ref.toString() : `annot_${idFactory.createObjId()}`; + let subtype = dict.get("Subtype"); + subtype = subtype instanceof Name ? subtype.name : null; + const parameters = { + xref, + ref, + dict, + subtype, + id, + annotationGlobals, + collectFields, + orphanFields, + needAppearances: + !collectFields && acroForm.get("NeedAppearances") === true, + pageIndex, + evaluatorOptions: pdfManager.evaluatorOptions, + pageRef, }; - switch (h) { + switch (subtype) { case "Link": - return new LinkAnnotation(l); + return new LinkAnnotation(parameters); case "Text": - return new TextAnnotation(l); + return new TextAnnotation(parameters); case "Widget": - let e = getInheritableProperty({ dict: g, key: "FT" }); - e = e instanceof Name ? e.name : null; - switch (e) { + let fieldType = getInheritableProperty({ + dict, + key: "FT", + }); + fieldType = fieldType instanceof Name ? fieldType.name : null; + switch (fieldType) { case "Tx": - return new TextWidgetAnnotation(l); + return new TextWidgetAnnotation(parameters); case "Btn": - return new ButtonWidgetAnnotation(l); + return new ButtonWidgetAnnotation(parameters); case "Ch": - return new ChoiceWidgetAnnotation(l); + return new ChoiceWidgetAnnotation(parameters); case "Sig": - return new SignatureWidgetAnnotation(l); + return new SignatureWidgetAnnotation(parameters); } warn( - `Unimplemented widget field type "${e}", falling back to base field type.`, + `Unimplemented widget field type "${fieldType}", ` + + "falling back to base field type.", ); - return new WidgetAnnotation(l); + return new WidgetAnnotation(parameters); case "Popup": - return new PopupAnnotation(l); + return new PopupAnnotation(parameters); case "FreeText": - return new FreeTextAnnotation(l); + return new FreeTextAnnotation(parameters); case "Line": - return new LineAnnotation(l); + return new LineAnnotation(parameters); case "Square": - return new SquareAnnotation(l); + return new SquareAnnotation(parameters); case "Circle": - return new CircleAnnotation(l); + return new CircleAnnotation(parameters); case "PolyLine": - return new PolylineAnnotation(l); + return new PolylineAnnotation(parameters); case "Polygon": - return new PolygonAnnotation(l); + return new PolygonAnnotation(parameters); case "Caret": - return new CaretAnnotation(l); + return new CaretAnnotation(parameters); case "Ink": - return new InkAnnotation(l); + return new InkAnnotation(parameters); case "Highlight": - return new HighlightAnnotation(l); + return new HighlightAnnotation(parameters); case "Underline": - return new UnderlineAnnotation(l); + return new UnderlineAnnotation(parameters); case "Squiggly": - return new SquigglyAnnotation(l); + return new SquigglyAnnotation(parameters); case "StrikeOut": - return new StrikeOutAnnotation(l); + return new StrikeOutAnnotation(parameters); case "Stamp": - return new StampAnnotation(l); + return new StampAnnotation(parameters); case "FileAttachment": - return new FileAttachmentAnnotation(l); + return new FileAttachmentAnnotation(parameters); default: - s || - warn( - h - ? `Unimplemented annotation type "${h}", falling back to base annotation.` - : "Annotation is missing the required /Subtype.", - ); - return new Annotation(l); + if (!collectFields) { + if (!subtype) { + warn("Annotation is missing the required /Subtype."); + } else { + warn( + `Unimplemented annotation type "${subtype}", ` + + "falling back to base annotation.", + ); + } + } + return new Annotation(parameters); } } - static async _getPageIndex(e, t, i) { + static async _getPageIndex(xref, ref, pdfManager) { try { - const a = await e.fetchIfRefAsync(t); - if (!(a instanceof Dict)) return -1; - const s = a.getRaw("P"); - if (s instanceof Ref) - try { - return await i.ensureCatalog("getPageIndex", [s]); - } catch (e) { - info(`_getPageIndex -- not a valid page reference: "${e}".`); - } - if (a.has("Kids")) return -1; - const r = await i.ensureDoc("numPages"); - for (let e = 0; e < r; e++) { - const a = await i.getPage(e), - s = await i.ensure(a, "annotations"); - for (const i of s) if (i instanceof Ref && isRefsEqual(i, t)) return e; + const annotDict = await xref.fetchIfRefAsync(ref); + if (!(annotDict instanceof Dict)) { + return -1; } - } catch (e) { - warn(`_getPageIndex: "${e}".`); + const pageRef = annotDict.getRaw("P"); + if (pageRef instanceof Ref) { + try { + const pageIndex = await pdfManager.ensureCatalog("getPageIndex", [ + pageRef, + ]); + return pageIndex; + } catch (ex) { + info(`_getPageIndex -- not a valid page reference: "${ex}".`); + } + } + if (annotDict.has("Kids")) { + return -1; + } + const numPages = await pdfManager.ensureDoc("numPages"); + for (let pageIndex = 0; pageIndex < numPages; pageIndex++) { + const page = await pdfManager.getPage(pageIndex); + const annotations = await pdfManager.ensure(page, "annotations"); + for (const annotRef of annotations) { + if (annotRef instanceof Ref && isRefsEqual(annotRef, ref)) { + return pageIndex; + } + } + } + } catch (ex) { + warn(`_getPageIndex: "${ex}".`); } return -1; } - static generateImages(e, t, i) { - if (!i) { + static generateImages(annotations, xref, isOffscreenCanvasSupported) { + if (!isOffscreenCanvasSupported) { warn( "generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images.", ); return null; } - let a; - for (const { bitmapId: i, bitmap: s } of e) - if (s) { - a ||= new Map(); - a.set(i, StampAnnotation.createImage(s, t)); + let imagePromises; + for (const { bitmapId, bitmap } of annotations) { + if (!bitmap) { + continue; } - return a; + imagePromises ||= new Map(); + imagePromises.set(bitmapId, StampAnnotation.createImage(bitmap, xref)); + } + return imagePromises; } - static async saveNewAnnotations(e, t, i, a) { - const s = e.xref; - let r; - const n = [], - g = [], - { isOffscreenCanvasSupported: o } = e.options; - for (const c of i) - if (!c.deleted) - switch (c.annotationType) { - case u: - if (!r) { - const e = new Dict(s); - e.set("BaseFont", Name.get("Helvetica")); - e.set("Type", Name.get("Font")); - e.set("Subtype", Name.get("Type1")); - e.set("Encoding", Name.get("WinAnsiEncoding")); - const t = []; - r = s.getNewTemporaryRef(); - await writeObject(r, e, t, s); - n.push({ ref: r, data: t.join("") }); - } - g.push( - FreeTextAnnotation.createNewAnnotation(s, c, n, { - evaluator: e, - task: t, - baseFontRef: r, - }), + static async saveNewAnnotations(evaluator, task, annotations, imagePromises) { + const xref = evaluator.xref; + let baseFontRef; + const dependencies = []; + const promises = []; + const { isOffscreenCanvasSupported } = evaluator.options; + for (const annotation of annotations) { + if (annotation.deleted) { + continue; + } + switch (annotation.annotationType) { + case AnnotationEditorType.FREETEXT: + if (!baseFontRef) { + const baseFont = new Dict(xref); + baseFont.set("BaseFont", Name.get("Helvetica")); + baseFont.set("Type", Name.get("Font")); + baseFont.set("Subtype", Name.get("Type1")); + baseFont.set("Encoding", Name.get("WinAnsiEncoding")); + const buffer = []; + baseFontRef = xref.getNewTemporaryRef(); + await writeObject(baseFontRef, baseFont, buffer, xref); + dependencies.push({ + ref: baseFontRef, + data: buffer.join(""), + }); + } + promises.push( + FreeTextAnnotation.createNewAnnotation( + xref, + annotation, + dependencies, + { + evaluator, + task, + baseFontRef, + }, + ), + ); + break; + case AnnotationEditorType.HIGHLIGHT: + if (annotation.quadPoints) { + promises.push( + HighlightAnnotation.createNewAnnotation( + xref, + annotation, + dependencies, + ), ); - break; - case d: - c.quadPoints - ? g.push(HighlightAnnotation.createNewAnnotation(s, c, n)) - : g.push(InkAnnotation.createNewAnnotation(s, c, n)); - break; - case p: - g.push(InkAnnotation.createNewAnnotation(s, c, n)); - break; - case f: - if (!o) break; - const i = await a.get(c.bitmapId); - if (i.imageStream) { - const { imageStream: e, smaskStream: t } = i, - a = []; - if (t) { - const i = s.getNewTemporaryRef(); - await writeObject(i, t, a, s); - n.push({ ref: i, data: a.join("") }); - e.dict.set("SMask", i); - a.length = 0; - } - const r = (i.imageRef = s.getNewTemporaryRef()); - await writeObject(r, e, a, s); - n.push({ ref: r, data: a.join("") }); - i.imageStream = i.smaskStream = null; + } else { + promises.push( + InkAnnotation.createNewAnnotation(xref, annotation, dependencies), + ); + } + break; + case AnnotationEditorType.INK: + promises.push( + InkAnnotation.createNewAnnotation(xref, annotation, dependencies), + ); + break; + case AnnotationEditorType.STAMP: + const image = isOffscreenCanvasSupported + ? await imagePromises?.get(annotation.bitmapId) + : null; + if (image?.imageStream) { + const { imageStream, smaskStream } = image; + const buffer = []; + if (smaskStream) { + const smaskRef = xref.getNewTemporaryRef(); + await writeObject(smaskRef, smaskStream, buffer, xref); + dependencies.push({ + ref: smaskRef, + data: buffer.join(""), + }); + imageStream.dict.set("SMask", smaskRef); + buffer.length = 0; } - g.push(StampAnnotation.createNewAnnotation(s, c, n, { image: i })); - } - return { annotations: await Promise.all(g), dependencies: n }; + const imageRef = (image.imageRef = xref.getNewTemporaryRef()); + await writeObject(imageRef, imageStream, buffer, xref); + dependencies.push({ + ref: imageRef, + data: buffer.join(""), + }); + image.imageStream = image.smaskStream = null; + } + promises.push( + StampAnnotation.createNewAnnotation( + xref, + annotation, + dependencies, + { + image, + }, + ), + ); + break; + } + } + return { + annotations: await Promise.all(promises), + dependencies, + }; } - static async printNewAnnotations(e, t, i, a, s) { - if (!a) return null; - const { options: r, xref: n } = t, - g = []; - for (const o of a) - if (!o.deleted) - switch (o.annotationType) { - case u: - g.push( - FreeTextAnnotation.createNewPrintAnnotation(e, n, o, { - evaluator: t, - task: i, - evaluatorOptions: r, - }), + static async printNewAnnotations( + annotationGlobals, + evaluator, + task, + annotations, + imagePromises, + ) { + if (!annotations) { + return null; + } + const { options, xref } = evaluator; + const promises = []; + for (const annotation of annotations) { + if (annotation.deleted) { + continue; + } + switch (annotation.annotationType) { + case AnnotationEditorType.FREETEXT: + promises.push( + FreeTextAnnotation.createNewPrintAnnotation( + annotationGlobals, + xref, + annotation, + { + evaluator, + task, + evaluatorOptions: options, + }, + ), + ); + break; + case AnnotationEditorType.HIGHLIGHT: + if (annotation.quadPoints) { + promises.push( + HighlightAnnotation.createNewPrintAnnotation( + annotationGlobals, + xref, + annotation, + { + evaluatorOptions: options, + }, + ), ); - break; - case d: - o.quadPoints - ? g.push( - HighlightAnnotation.createNewPrintAnnotation(e, n, o, { - evaluatorOptions: r, - }), - ) - : g.push( - InkAnnotation.createNewPrintAnnotation(e, n, o, { - evaluatorOptions: r, - }), - ); - break; - case p: - g.push( - InkAnnotation.createNewPrintAnnotation(e, n, o, { - evaluatorOptions: r, - }), + } else { + promises.push( + InkAnnotation.createNewPrintAnnotation( + annotationGlobals, + xref, + annotation, + { + evaluatorOptions: options, + }, + ), ); - break; - case f: - if (!r.isOffscreenCanvasSupported) break; - const a = await s.get(o.bitmapId); - if (a.imageStream) { - const { imageStream: e, smaskStream: t } = a; - t && e.dict.set("SMask", t); - a.imageRef = new JpegStream(e, e.length); - a.imageStream = a.smaskStream = null; + } + break; + case AnnotationEditorType.INK: + promises.push( + InkAnnotation.createNewPrintAnnotation( + annotationGlobals, + xref, + annotation, + { + evaluatorOptions: options, + }, + ), + ); + break; + case AnnotationEditorType.STAMP: + const image = options.isOffscreenCanvasSupported + ? await imagePromises?.get(annotation.bitmapId) + : null; + if (image?.imageStream) { + const { imageStream, smaskStream } = image; + if (smaskStream) { + imageStream.dict.set("SMask", smaskStream); } - g.push( - StampAnnotation.createNewPrintAnnotation(e, n, o, { - image: a, - evaluatorOptions: r, - }), - ); - } - return Promise.all(g); + image.imageRef = new JpegStream(imageStream, imageStream.length); + image.imageStream = image.smaskStream = null; + } + promises.push( + StampAnnotation.createNewPrintAnnotation( + annotationGlobals, + xref, + annotation, + { + image, + evaluatorOptions: options, + }, + ), + ); + break; + } + } + return Promise.all(promises); } } -function getRgbColor(e, t = new Uint8ClampedArray(3)) { - if (!Array.isArray(e)) return t; - const i = t || new Uint8ClampedArray(3); - switch (e.length) { +function getRgbColor(color, defaultColor = new Uint8ClampedArray(3)) { + if (!Array.isArray(color)) { + return defaultColor; + } + const rgbColor = defaultColor || new Uint8ClampedArray(3); + switch (color.length) { case 0: return null; case 1: - ColorSpace.singletons.gray.getRgbItem(e, 0, i, 0); - return i; + ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0); + return rgbColor; case 3: - ColorSpace.singletons.rgb.getRgbItem(e, 0, i, 0); - return i; + ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0); + return rgbColor; case 4: - ColorSpace.singletons.cmyk.getRgbItem(e, 0, i, 0); - return i; + ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0); + return rgbColor; default: - return t; + return defaultColor; } } -function getPdfColorArray(e) { - return Array.from(e, (e) => e / 255); +function getPdfColorArray(color) { + return Array.from(color, (c) => c / 255); } -function getQuadPoints(e, t) { - const i = e.getArray("QuadPoints"); - if (!isNumberArray(i, null) || 0 === i.length || i.length % 8 > 0) +function getQuadPoints(dict, rect) { + const quadPoints = dict.getArray("QuadPoints"); + if ( + !isNumberArray(quadPoints, null) || + quadPoints.length === 0 || + quadPoints.length % 8 > 0 + ) { return null; - const a = new Float32Array(i.length); - for (let e = 0, s = i.length; e < s; e += 8) { - const [s, r, n, g, o, c, C, h] = i.slice(e, e + 8), - l = Math.min(s, n, o, C), - Q = Math.max(s, n, o, C), - E = Math.min(r, g, c, h), - u = Math.max(r, g, c, h); - if (null !== t && (l < t[0] || Q > t[2] || E < t[1] || u > t[3])) - return null; - a.set([l, u, Q, u, l, E, Q, E], e); } - return a; + const newQuadPoints = new Float32Array(quadPoints.length); + for (let i = 0, ii = quadPoints.length; i < ii; i += 8) { + const [x1, y1, x2, y2, x3, y3, x4, y4] = quadPoints.slice(i, i + 8); + const minX = Math.min(x1, x2, x3, x4); + const maxX = Math.max(x1, x2, x3, x4); + const minY = Math.min(y1, y2, y3, y4); + const maxY = Math.max(y1, y2, y3, y4); + if ( + rect !== null && + (minX < rect[0] || maxX > rect[2] || minY < rect[1] || maxY > rect[3]) + ) { + return null; + } + newQuadPoints.set([minX, maxY, maxX, maxY, minX, minY, maxX, minY], i); + } + return newQuadPoints; } -function getTransformMatrix(e, t, i) { - const [a, s, r, n] = Util.getAxialAlignedBoundingBox(t, i); - if (a === r || s === n) return [1, 0, 0, 1, e[0], e[1]]; - const g = (e[2] - e[0]) / (r - a), - o = (e[3] - e[1]) / (n - s); - return [g, 0, 0, o, e[0] - a * g, e[1] - s * o]; +function getTransformMatrix(rect, bbox, matrix) { + const [minX, minY, maxX, maxY] = Util.getAxialAlignedBoundingBox( + bbox, + matrix, + ); + if (minX === maxX || minY === maxY) { + return [1, 0, 0, 1, rect[0], rect[1]]; + } + const xRatio = (rect[2] - rect[0]) / (maxX - minX); + const yRatio = (rect[3] - rect[1]) / (maxY - minY); + return [ + xRatio, + 0, + 0, + yRatio, + rect[0] - minX * xRatio, + rect[1] - minY * yRatio, + ]; } class Annotation { - constructor(e) { - const { dict: t, xref: i, annotationGlobals: a } = e; - this.setTitle(t.get("T")); - this.setContents(t.get("Contents")); - this.setModificationDate(t.get("M")); - this.setFlags(t.get("F")); - this.setRectangle(t.getArray("Rect")); - this.setColor(t.getArray("C")); - this.setBorderStyle(t); - this.setAppearance(t); - this.setOptionalContent(t); - const s = t.get("MK"); - this.setBorderAndBackgroundColors(s); - this.setRotation(s, t); - this.ref = e.ref instanceof Ref ? e.ref : null; - this._streams = []; - this.appearance && this._streams.push(this.appearance); - const r = !!(this.flags & AA), - n = !!(this.flags & eA); - if (a.structTreeRoot) { - let i = t.get("StructParent"); - i = Number.isInteger(i) && i >= 0 ? i : -1; - a.structTreeRoot.addAnnotationIdToPage(e.pageRef, i); + constructor(params) { + const { dict, xref, annotationGlobals, ref, orphanFields } = params; + const parentRef = orphanFields?.get(ref); + if (parentRef) { + dict.set("Parent", parentRef); } + this.setTitle(dict.get("T")); + this.setContents(dict.get("Contents")); + this.setModificationDate(dict.get("M")); + this.setFlags(dict.get("F")); + this.setRectangle(dict.getArray("Rect")); + this.setColor(dict.getArray("C")); + this.setBorderStyle(dict); + this.setAppearance(dict); + this.setOptionalContent(dict); + const MK = dict.get("MK"); + this.setBorderAndBackgroundColors(MK); + this.setRotation(MK, dict); + this.ref = params.ref instanceof Ref ? params.ref : null; + this._streams = []; + if (this.appearance) { + this._streams.push(this.appearance); + } + const isLocked = !!(this.flags & AnnotationFlag.LOCKED); + const isContentLocked = !!(this.flags & AnnotationFlag.LOCKEDCONTENTS); this.data = { annotationFlags: this.flags, borderStyle: this.borderStyle, @@ -51542,104 +62098,182 @@ class Annotation { rotation: this.rotation, contentsObj: this._contents, hasAppearance: !!this.appearance, - id: e.id, + id: params.id, modificationDate: this.modificationDate, rect: this.rectangle, - subtype: e.subtype, - hasOwnCanvas: !1, - noRotate: !!(this.flags & _), - noHTML: r && n, + subtype: params.subtype, + hasOwnCanvas: false, + noRotate: !!(this.flags & AnnotationFlag.NOROTATE), + noHTML: isLocked && isContentLocked, + isEditable: false, + structParent: -1, }; - if (e.collectFields) { - const a = t.get("Kids"); - if (Array.isArray(a)) { - const e = []; - for (const t of a) t instanceof Ref && e.push(t.toString()); - 0 !== e.length && (this.data.kidIds = e); + if (annotationGlobals.structTreeRoot) { + let structParent = dict.get("StructParent"); + this.data.structParent = structParent = + Number.isInteger(structParent) && structParent >= 0 ? structParent : -1; + annotationGlobals.structTreeRoot.addAnnotationIdToPage( + params.pageRef, + structParent, + ); + } + if (params.collectFields) { + const kids = dict.get("Kids"); + if (Array.isArray(kids)) { + const kidIds = []; + for (const kid of kids) { + if (kid instanceof Ref) { + kidIds.push(kid.toString()); + } + } + if (kidIds.length !== 0) { + this.data.kidIds = kidIds; + } } - this.data.actions = collectActions(i, t, uA); - this.data.fieldName = this._constructFieldName(t); - this.data.pageIndex = e.pageIndex; + this.data.actions = collectActions(xref, dict, AnnotationActionEventType); + this.data.fieldName = this._constructFieldName(dict); + this.data.pageIndex = params.pageIndex; + } + const it = dict.get("IT"); + if (it instanceof Name) { + this.data.it = it.name; } this._isOffscreenCanvasSupported = - e.evaluatorOptions.isOffscreenCanvasSupported; + params.evaluatorOptions.isOffscreenCanvasSupported; this._fallbackFontDict = null; - this._needAppearances = !1; + this._needAppearances = false; } - _hasFlag(e, t) { - return !!(e & t); + _hasFlag(flags, flag) { + return !!(flags & flag); } - _isViewable(e) { - return !this._hasFlag(e, Z) && !this._hasFlag(e, $); + _buildFlags(noView, noPrint) { + let { flags } = this; + if (noView === undefined) { + if (noPrint === undefined) { + return undefined; + } + if (noPrint) { + return flags & ~AnnotationFlag.PRINT; + } + return (flags & ~AnnotationFlag.HIDDEN) | AnnotationFlag.PRINT; + } + if (noView) { + flags |= AnnotationFlag.PRINT; + if (noPrint) { + return (flags & ~AnnotationFlag.NOVIEW) | AnnotationFlag.HIDDEN; + } + return (flags & ~AnnotationFlag.HIDDEN) | AnnotationFlag.NOVIEW; + } + flags &= ~(AnnotationFlag.HIDDEN | AnnotationFlag.NOVIEW); + if (noPrint) { + return flags & ~AnnotationFlag.PRINT; + } + return flags | AnnotationFlag.PRINT; } - _isPrintable(e) { - return this._hasFlag(e, z) && !this._hasFlag(e, V) && !this._hasFlag(e, Z); + _isViewable(flags) { + return ( + !this._hasFlag(flags, AnnotationFlag.INVISIBLE) && + !this._hasFlag(flags, AnnotationFlag.NOVIEW) + ); } - mustBeViewed(e, t) { - const i = e?.get(this.data.id)?.noView; - return void 0 !== i ? !i : this.viewable && !this._hasFlag(this.flags, V); + _isPrintable(flags) { + return ( + this._hasFlag(flags, AnnotationFlag.PRINT) && + !this._hasFlag(flags, AnnotationFlag.HIDDEN) && + !this._hasFlag(flags, AnnotationFlag.INVISIBLE) + ); } - mustBePrinted(e) { - const t = e?.get(this.data.id)?.noPrint; - return void 0 !== t ? !t : this.printable; + mustBeViewed(annotationStorage, _renderForms) { + const noView = annotationStorage?.get(this.data.id)?.noView; + if (noView !== undefined) { + return !noView; + } + return this.viewable && !this._hasFlag(this.flags, AnnotationFlag.HIDDEN); + } + mustBePrinted(annotationStorage) { + const noPrint = annotationStorage?.get(this.data.id)?.noPrint; + if (noPrint !== undefined) { + return !noPrint; + } + return this.printable; + } + mustBeViewedWhenEditing(isEditing, modifiedIds = null) { + return isEditing ? !this.data.isEditable : !modifiedIds?.has(this.data.id); } get viewable() { - return ( - null !== this.data.quadPoints && - (0 === this.flags || this._isViewable(this.flags)) - ); + if (this.data.quadPoints === null) { + return false; + } + if (this.flags === 0) { + return true; + } + return this._isViewable(this.flags); } get printable() { - return ( - null !== this.data.quadPoints && - 0 !== this.flags && - this._isPrintable(this.flags) - ); + if (this.data.quadPoints === null) { + return false; + } + if (this.flags === 0) { + return false; + } + return this._isPrintable(this.flags); } - _parseStringHelper(e) { - const t = "string" == typeof e ? stringToPDFString(e) : ""; - return { str: t, dir: t && "rtl" === bidi(t).dir ? "rtl" : "ltr" }; + _parseStringHelper(data) { + const str = typeof data === "string" ? stringToPDFString(data) : ""; + const dir = str && bidi(str).dir === "rtl" ? "rtl" : "ltr"; + return { + str, + dir, + }; } - setDefaultAppearance(e) { - const { dict: t, annotationGlobals: i } = e, - a = - getInheritableProperty({ dict: t, key: "DA" }) || i.acroForm.get("DA"); - this._defaultAppearance = "string" == typeof a ? a : ""; + setDefaultAppearance(params) { + const { dict, annotationGlobals } = params; + const defaultAppearance = + getInheritableProperty({ + dict, + key: "DA", + }) || annotationGlobals.acroForm.get("DA"); + this._defaultAppearance = + typeof defaultAppearance === "string" ? defaultAppearance : ""; this.data.defaultAppearanceData = parseDefaultAppearance( this._defaultAppearance, ); } - setTitle(e) { - this._title = this._parseStringHelper(e); + setTitle(title) { + this._title = this._parseStringHelper(title); } - setContents(e) { - this._contents = this._parseStringHelper(e); + setContents(contents) { + this._contents = this._parseStringHelper(contents); } - setModificationDate(e) { - this.modificationDate = "string" == typeof e ? e : null; + setModificationDate(modificationDate) { + this.modificationDate = + typeof modificationDate === "string" ? modificationDate : null; } - setFlags(e) { - this.flags = Number.isInteger(e) && e > 0 ? e : 0; - this.flags & Z && - "Annotation" !== this.constructor.name && - (this.flags ^= Z); + setFlags(flags) { + this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0; + if ( + this.flags & AnnotationFlag.INVISIBLE && + this.constructor.name !== "Annotation" + ) { + this.flags ^= AnnotationFlag.INVISIBLE; + } } - hasFlag(e) { - return this._hasFlag(this.flags, e); + hasFlag(flag) { + return this._hasFlag(this.flags, flag); } - setRectangle(e) { - this.rectangle = lookupNormalRect(e, [0, 0, 0, 0]); + setRectangle(rectangle) { + this.rectangle = lookupNormalRect(rectangle, [0, 0, 0, 0]); } - setColor(e) { - this.color = getRgbColor(e); + setColor(color) { + this.color = getRgbColor(color); } - setLineEndings(e) { + setLineEndings(lineEndings) { this.lineEndings = ["None", "None"]; - if (Array.isArray(e) && 2 === e.length) - for (let t = 0; t < 2; t++) { - const i = e[t]; - if (i instanceof Name) - switch (i.name) { + if (Array.isArray(lineEndings) && lineEndings.length === 2) { + for (let i = 0; i < 2; i++) { + const obj = lineEndings[i]; + if (obj instanceof Name) { + switch (obj.name) { case "None": continue; case "Square": @@ -51651,965 +62285,1477 @@ class Annotation { case "ROpenArrow": case "RClosedArrow": case "Slash": - this.lineEndings[t] = i.name; + this.lineEndings[i] = obj.name; continue; } - warn(`Ignoring invalid lineEnding: ${i}`); + } + warn(`Ignoring invalid lineEnding: ${obj}`); } - } - setRotation(e, t) { - this.rotation = 0; - let i = e instanceof Dict ? e.get("R") || 0 : t.get("Rotate") || 0; - if (Number.isInteger(i) && 0 !== i) { - i %= 360; - i < 0 && (i += 360); - i % 90 == 0 && (this.rotation = i); } } - setBorderAndBackgroundColors(e) { - if (e instanceof Dict) { - this.borderColor = getRgbColor(e.getArray("BC"), null); - this.backgroundColor = getRgbColor(e.getArray("BG"), null); - } else this.borderColor = this.backgroundColor = null; + setRotation(mk, dict) { + this.rotation = 0; + let angle = mk instanceof Dict ? mk.get("R") || 0 : dict.get("Rotate") || 0; + if (Number.isInteger(angle) && angle !== 0) { + angle %= 360; + if (angle < 0) { + angle += 360; + } + if (angle % 90 === 0) { + this.rotation = angle; + } + } } - setBorderStyle(e) { + setBorderAndBackgroundColors(mk) { + if (mk instanceof Dict) { + this.borderColor = getRgbColor(mk.getArray("BC"), null); + this.backgroundColor = getRgbColor(mk.getArray("BG"), null); + } else { + this.borderColor = this.backgroundColor = null; + } + } + setBorderStyle(borderStyle) { this.borderStyle = new AnnotationBorderStyle(); - if (e instanceof Dict) - if (e.has("BS")) { - const t = e.get("BS"); - if (t instanceof Dict) { - const e = t.get("Type"); - if (!e || isName(e, "Border")) { - this.borderStyle.setWidth(t.get("W"), this.rectangle); - this.borderStyle.setStyle(t.get("S")); - this.borderStyle.setDashArray(t.getArray("D")); - } - } - } else if (e.has("Border")) { - const t = e.getArray("Border"); - if (Array.isArray(t) && t.length >= 3) { - this.borderStyle.setHorizontalCornerRadius(t[0]); - this.borderStyle.setVerticalCornerRadius(t[1]); - this.borderStyle.setWidth(t[2], this.rectangle); - 4 === t.length && this.borderStyle.setDashArray(t[3], !0); - } - } else this.borderStyle.setWidth(0); - } - setAppearance(e) { - this.appearance = null; - const t = e.get("AP"); - if (!(t instanceof Dict)) return; - const i = t.get("N"); - if (i instanceof BaseStream) { - this.appearance = i; + if (!(borderStyle instanceof Dict)) { return; } - if (!(i instanceof Dict)) return; - const a = e.get("AS"); - if (!(a instanceof Name && i.has(a.name))) return; - const s = i.get(a.name); - s instanceof BaseStream && (this.appearance = s); + if (borderStyle.has("BS")) { + const dict = borderStyle.get("BS"); + if (dict instanceof Dict) { + const dictType = dict.get("Type"); + if (!dictType || isName(dictType, "Border")) { + this.borderStyle.setWidth(dict.get("W"), this.rectangle); + this.borderStyle.setStyle(dict.get("S")); + this.borderStyle.setDashArray(dict.getArray("D")); + } + } + } else if (borderStyle.has("Border")) { + const array = borderStyle.getArray("Border"); + if (Array.isArray(array) && array.length >= 3) { + this.borderStyle.setHorizontalCornerRadius(array[0]); + this.borderStyle.setVerticalCornerRadius(array[1]); + this.borderStyle.setWidth(array[2], this.rectangle); + if (array.length === 4) { + this.borderStyle.setDashArray(array[3], true); + } + } + } else { + this.borderStyle.setWidth(0); + } } - setOptionalContent(e) { + setAppearance(dict) { + this.appearance = null; + const appearanceStates = dict.get("AP"); + if (!(appearanceStates instanceof Dict)) { + return; + } + const normalAppearanceState = appearanceStates.get("N"); + if (normalAppearanceState instanceof BaseStream) { + this.appearance = normalAppearanceState; + return; + } + if (!(normalAppearanceState instanceof Dict)) { + return; + } + const as = dict.get("AS"); + if (!(as instanceof Name) || !normalAppearanceState.has(as.name)) { + return; + } + const appearance = normalAppearanceState.get(as.name); + if (appearance instanceof BaseStream) { + this.appearance = appearance; + } + } + setOptionalContent(dict) { this.oc = null; - const t = e.get("OC"); - t instanceof Name - ? warn("setOptionalContent: Support for /Name-entry is not implemented.") - : t instanceof Dict && (this.oc = t); + const oc = dict.get("OC"); + if (oc instanceof Name) { + warn("setOptionalContent: Support for /Name-entry is not implemented."); + } else if (oc instanceof Dict) { + this.oc = oc; + } } - loadResources(e, t) { - return t.dict.getAsync("Resources").then((t) => { - if (!t) return; - return new ObjectLoader(t, e, t.xref).load().then(function () { - return t; + loadResources(keys, appearance) { + return appearance.dict.getAsync("Resources").then((resources) => { + if (!resources) { + return undefined; + } + const objectLoader = new ObjectLoader(resources, keys, resources.xref); + return objectLoader.load().then(function () { + return resources; }); }); } - async getOperatorList(e, t, a, s, r) { - const { hasOwnCanvas: n, id: g, rect: c } = this.data; - let C = this.appearance; - const h = !!(n && a & o); - if (h && (c[0] === c[2] || c[1] === c[3])) { - this.data.hasOwnCanvas = !1; + async getOperatorList(evaluator, task, intent, annotationStorage) { + const { hasOwnCanvas, id, rect } = this.data; + let appearance = this.appearance; + const isUsingOwnCanvas = !!( + hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY + ); + if (isUsingOwnCanvas && (rect[0] === rect[2] || rect[1] === rect[3])) { + this.data.hasOwnCanvas = false; return { opList: new OperatorList(), - separateForm: !1, - separateCanvas: !1, + separateForm: false, + separateCanvas: false, }; } - if (!C) { - if (!h) + if (!appearance) { + if (!isUsingOwnCanvas) { return { opList: new OperatorList(), - separateForm: !1, - separateCanvas: !1, + separateForm: false, + separateCanvas: false, }; - C = new StringStream(""); - C.dict = new Dict(); + } + appearance = new StringStream(""); + appearance.dict = new Dict(); } - const l = C.dict, - Q = await this.loadResources( - ["ExtGState", "ColorSpace", "Pattern", "Shading", "XObject", "Font"], - C, - ), - E = lookupRect(l.getArray("BBox"), [0, 0, 1, 1]), - u = lookupMatrix(l.getArray("Matrix"), i), - d = getTransformMatrix(c, E, u), - f = new OperatorList(); - let p; - this.oc && (p = await e.parseMarkedContentProps(this.oc, null)); - void 0 !== p && f.addOp(Je, ["OC", p]); - f.addOp(We, [g, c, d, u, h]); - await e.getOperatorList({ - stream: C, - task: t, - resources: Q, - operatorList: f, + const appearanceDict = appearance.dict; + const resources = await this.loadResources( + ["ExtGState", "ColorSpace", "Pattern", "Shading", "XObject", "Font"], + appearance, + ); + const bbox = lookupRect(appearanceDict.getArray("BBox"), [0, 0, 1, 1]); + const matrix = lookupMatrix( + appearanceDict.getArray("Matrix"), + IDENTITY_MATRIX, + ); + const transform = getTransformMatrix(rect, bbox, matrix); + const opList = new OperatorList(); + let optionalContent; + if (this.oc) { + optionalContent = await evaluator.parseMarkedContentProps(this.oc, null); + } + if (optionalContent !== undefined) { + opList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); + } + opList.addOp(OPS.beginAnnotation, [ + id, + rect, + transform, + matrix, + isUsingOwnCanvas, + ]); + await evaluator.getOperatorList({ + stream: appearance, + task, + resources, + operatorList: opList, fallbackFontDict: this._fallbackFontDict, }); - f.addOp(je, []); - void 0 !== p && f.addOp(Ye, []); + opList.addOp(OPS.endAnnotation, []); + if (optionalContent !== undefined) { + opList.addOp(OPS.endMarkedContent, []); + } this.reset(); - return { opList: f, separateForm: !1, separateCanvas: h }; + return { + opList, + separateForm: false, + separateCanvas: isUsingOwnCanvas, + }; } - async save(e, t, i) { + async save(evaluator, task, annotationStorage) { return null; } get hasTextContent() { - return !1; + return false; } - async extractTextContent(e, t, i) { - if (!this.appearance) return; - const a = await this.loadResources( - ["ExtGState", "Font", "Properties", "XObject"], - this.appearance, - ), - s = [], - r = []; - let n = null; - const g = { + async extractTextContent(evaluator, task, viewBox) { + if (!this.appearance) { + return; + } + const resources = await this.loadResources( + ["ExtGState", "Font", "Properties", "XObject"], + this.appearance, + ); + const text = []; + const buffer = []; + let firstPosition = null; + const sink = { desiredSize: Math.Infinity, - ready: !0, - enqueue(e, t) { - for (const t of e.items) - if (void 0 !== t.str) { - n ||= t.transform.slice(-2); - r.push(t.str); - if (t.hasEOL) { - s.push(r.join("").trimEnd()); - r.length = 0; - } + ready: true, + enqueue(chunk, size) { + for (const item of chunk.items) { + if (item.str === undefined) { + continue; } + firstPosition ||= item.transform.slice(-2); + buffer.push(item.str); + if (item.hasEOL) { + text.push(buffer.join("").trimEnd()); + buffer.length = 0; + } + } }, }; - await e.getTextContent({ + await evaluator.getTextContent({ stream: this.appearance, - task: t, - resources: a, - includeMarkedContent: !0, - keepWhiteSpace: !0, - sink: g, - viewBox: i, + task, + resources, + includeMarkedContent: true, + keepWhiteSpace: true, + sink, + viewBox, }); this.reset(); - r.length && s.push(r.join("").trimEnd()); - if (s.length > 1 || s[0]) { - const e = this.appearance.dict, - t = lookupRect(e.getArray("BBox"), null), - i = lookupMatrix(e.getArray("Matrix"), null); - this.data.textPosition = this._transformPoint(n, t, i); - this.data.textContent = s; + if (buffer.length) { + text.push(buffer.join("").trimEnd()); + } + if (text.length > 1 || text[0]) { + const appearanceDict = this.appearance.dict; + const bbox = lookupRect(appearanceDict.getArray("BBox"), null); + const matrix = lookupMatrix(appearanceDict.getArray("Matrix"), null); + this.data.textPosition = this._transformPoint( + firstPosition, + bbox, + matrix, + ); + this.data.textContent = text; } } - _transformPoint(e, t, i) { - const { rect: a } = this.data; - t ||= [0, 0, 1, 1]; - i ||= [1, 0, 0, 1, 0, 0]; - const s = getTransformMatrix(a, t, i); - s[4] -= a[0]; - s[5] -= a[1]; - e = Util.applyTransform(e, s); - return Util.applyTransform(e, i); + _transformPoint(coords, bbox, matrix) { + const { rect } = this.data; + bbox ||= [0, 0, 1, 1]; + matrix ||= [1, 0, 0, 1, 0, 0]; + const transform = getTransformMatrix(rect, bbox, matrix); + transform[4] -= rect[0]; + transform[5] -= rect[1]; + coords = Util.applyTransform(coords, transform); + return Util.applyTransform(coords, matrix); } getFieldObject() { - return this.data.kidIds - ? { - id: this.data.id, - actions: this.data.actions, - name: this.data.fieldName, - strokeColor: this.data.borderColor, - fillColor: this.data.backgroundColor, - type: "", - kidIds: this.data.kidIds, - page: this.data.pageIndex, - rotation: this.rotation, - } - : null; + if (this.data.kidIds) { + return { + id: this.data.id, + actions: this.data.actions, + name: this.data.fieldName, + strokeColor: this.data.borderColor, + fillColor: this.data.backgroundColor, + type: "", + kidIds: this.data.kidIds, + page: this.data.pageIndex, + rotation: this.rotation, + }; + } + return null; } reset() { - for (const e of this._streams) e.reset(); + for (const stream of this._streams) { + stream.reset(); + } } - _constructFieldName(e) { - if (!e.has("T") && !e.has("Parent")) { + _constructFieldName(dict) { + if (!dict.has("T") && !dict.has("Parent")) { warn("Unknown field name, falling back to empty field name."); return ""; } - if (!e.has("Parent")) return stringToPDFString(e.get("T")); - const t = []; - e.has("T") && t.unshift(stringToPDFString(e.get("T"))); - let i = e; - const a = new RefSet(); - e.objId && a.put(e.objId); - for (; i.has("Parent"); ) { - i = i.get("Parent"); - if (!(i instanceof Dict) || (i.objId && a.has(i.objId))) break; - i.objId && a.put(i.objId); - i.has("T") && t.unshift(stringToPDFString(i.get("T"))); + if (!dict.has("Parent")) { + return stringToPDFString(dict.get("T")); } - return t.join("."); + const fieldName = []; + if (dict.has("T")) { + fieldName.unshift(stringToPDFString(dict.get("T"))); + } + let loopDict = dict; + const visited = new RefSet(); + if (dict.objId) { + visited.put(dict.objId); + } + while (loopDict.has("Parent")) { + loopDict = loopDict.get("Parent"); + if ( + !(loopDict instanceof Dict) || + (loopDict.objId && visited.has(loopDict.objId)) + ) { + break; + } + if (loopDict.objId) { + visited.put(loopDict.objId); + } + if (loopDict.has("T")) { + fieldName.unshift(stringToPDFString(loopDict.get("T"))); + } + } + return fieldName.join("."); } } class AnnotationBorderStyle { constructor() { this.width = 1; - this.style = hA; + this.rawWidth = 1; + this.style = AnnotationBorderStyleType.SOLID; this.dashArray = [3]; this.horizontalCornerRadius = 0; this.verticalCornerRadius = 0; } - setWidth(e, t = [0, 0, 0, 0]) { - if (e instanceof Name) this.width = 0; - else if ("number" == typeof e) { - if (e > 0) { - const i = (t[2] - t[0]) / 2, - a = (t[3] - t[1]) / 2; - if (i > 0 && a > 0 && (e > i || e > a)) { - warn(`AnnotationBorderStyle.setWidth - ignoring width: ${e}`); - e = 1; + setWidth(width, rect = [0, 0, 0, 0]) { + if (width instanceof Name) { + this.width = 0; + return; + } + if (typeof width === "number") { + if (width > 0) { + this.rawWidth = width; + const maxWidth = (rect[2] - rect[0]) / 2; + const maxHeight = (rect[3] - rect[1]) / 2; + if ( + maxWidth > 0 && + maxHeight > 0 && + (width > maxWidth || width > maxHeight) + ) { + warn(`AnnotationBorderStyle.setWidth - ignoring width: ${width}`); + width = 1; } } - this.width = e; + this.width = width; } } - setStyle(e) { - if (e instanceof Name) - switch (e.name) { - case "S": - this.style = hA; - break; - case "D": - this.style = BA; - break; - case "B": - this.style = lA; - break; - case "I": - this.style = QA; - break; - case "U": - this.style = EA; - } + setStyle(style) { + if (!(style instanceof Name)) { + return; + } + switch (style.name) { + case "S": + this.style = AnnotationBorderStyleType.SOLID; + break; + case "D": + this.style = AnnotationBorderStyleType.DASHED; + break; + case "B": + this.style = AnnotationBorderStyleType.BEVELED; + break; + case "I": + this.style = AnnotationBorderStyleType.INSET; + break; + case "U": + this.style = AnnotationBorderStyleType.UNDERLINE; + break; + default: + break; + } } - setDashArray(e, t = !1) { - if (Array.isArray(e)) { - let i = !0, - a = !0; - for (const t of e) { - if (!(+t >= 0)) { - i = !1; + setDashArray(dashArray, forceStyle = false) { + if (Array.isArray(dashArray)) { + let isValid = true; + let allZeros = true; + for (const element of dashArray) { + const validNumber = +element >= 0; + if (!validNumber) { + isValid = false; break; + } else if (element > 0) { + allZeros = false; } - t > 0 && (a = !1); } - if (0 === e.length || (i && !a)) { - this.dashArray = e; - t && this.setStyle(Name.get("D")); - } else this.width = 0; - } else e && (this.width = 0); + if (dashArray.length === 0 || (isValid && !allZeros)) { + this.dashArray = dashArray; + if (forceStyle) { + this.setStyle(Name.get("D")); + } + } else { + this.width = 0; + } + } else if (dashArray) { + this.width = 0; + } } - setHorizontalCornerRadius(e) { - Number.isInteger(e) && (this.horizontalCornerRadius = e); + setHorizontalCornerRadius(radius) { + if (Number.isInteger(radius)) { + this.horizontalCornerRadius = radius; + } } - setVerticalCornerRadius(e) { - Number.isInteger(e) && (this.verticalCornerRadius = e); + setVerticalCornerRadius(radius) { + if (Number.isInteger(radius)) { + this.verticalCornerRadius = radius; + } } } class MarkupAnnotation extends Annotation { - constructor(e) { - super(e); - const { dict: t } = e; - if (t.has("IRT")) { - const e = t.getRaw("IRT"); - this.data.inReplyTo = e instanceof Ref ? e.toString() : null; - const i = t.get("RT"); - this.data.replyType = i instanceof Name ? i.name : X; + constructor(params) { + super(params); + const { dict } = params; + if (dict.has("IRT")) { + const rawIRT = dict.getRaw("IRT"); + this.data.inReplyTo = rawIRT instanceof Ref ? rawIRT.toString() : null; + const rt = dict.get("RT"); + this.data.replyType = + rt instanceof Name ? rt.name : AnnotationReplyType.REPLY; } - let i = null; - if (this.data.replyType === j) { - const e = t.get("IRT"); - this.setTitle(e.get("T")); + let popupRef = null; + if (this.data.replyType === AnnotationReplyType.GROUP) { + const parent = dict.get("IRT"); + this.setTitle(parent.get("T")); this.data.titleObj = this._title; - this.setContents(e.get("Contents")); + this.setContents(parent.get("Contents")); this.data.contentsObj = this._contents; - if (e.has("CreationDate")) { - this.setCreationDate(e.get("CreationDate")); + if (!parent.has("CreationDate")) { + this.data.creationDate = null; + } else { + this.setCreationDate(parent.get("CreationDate")); this.data.creationDate = this.creationDate; - } else this.data.creationDate = null; - if (e.has("M")) { - this.setModificationDate(e.get("M")); + } + if (!parent.has("M")) { + this.data.modificationDate = null; + } else { + this.setModificationDate(parent.get("M")); this.data.modificationDate = this.modificationDate; - } else this.data.modificationDate = null; - i = e.getRaw("Popup"); - if (e.has("C")) { - this.setColor(e.getArray("C")); + } + popupRef = parent.getRaw("Popup"); + if (!parent.has("C")) { + this.data.color = null; + } else { + this.setColor(parent.getArray("C")); this.data.color = this.color; - } else this.data.color = null; + } } else { this.data.titleObj = this._title; - this.setCreationDate(t.get("CreationDate")); + this.setCreationDate(dict.get("CreationDate")); this.data.creationDate = this.creationDate; - i = t.getRaw("Popup"); - t.has("C") || (this.data.color = null); + popupRef = dict.getRaw("Popup"); + if (!dict.has("C")) { + this.data.color = null; + } + } + this.data.popupRef = popupRef instanceof Ref ? popupRef.toString() : null; + if (dict.has("RC")) { + this.data.richText = XFAFactory.getRichTextAsHtml(dict.get("RC")); } - this.data.popupRef = i instanceof Ref ? i.toString() : null; - t.has("RC") && - (this.data.richText = XFAFactory.getRichTextAsHtml(t.get("RC"))); } - setCreationDate(e) { - this.creationDate = "string" == typeof e ? e : null; + setCreationDate(creationDate) { + this.creationDate = typeof creationDate === "string" ? creationDate : null; } _setDefaultAppearance({ - xref: e, - extra: t, - strokeColor: i, - fillColor: a, - blendMode: s, - strokeAlpha: r, - fillAlpha: n, - pointsCallback: g, + xref, + extra, + strokeColor, + fillColor, + blendMode, + strokeAlpha, + fillAlpha, + pointsCallback, }) { - let o = Number.MAX_VALUE, - c = Number.MAX_VALUE, - C = Number.MIN_VALUE, - h = Number.MIN_VALUE; - const l = ["q"]; - t && l.push(t); - i && l.push(`${i[0]} ${i[1]} ${i[2]} RG`); - a && l.push(`${a[0]} ${a[1]} ${a[2]} rg`); - let Q = this.data.quadPoints; - Q || - (Q = Float32Array.from([ - this.rectangle[0], - this.rectangle[3], - this.rectangle[2], - this.rectangle[3], - this.rectangle[0], - this.rectangle[1], - this.rectangle[2], - this.rectangle[1], - ])); - for (let e = 0, t = Q.length; e < t; e += 8) { - const [t, i, a, s] = g(l, Q.subarray(e, e + 8)); - o = Math.min(o, t); - C = Math.max(C, i); - c = Math.min(c, a); - h = Math.max(h, s); + let minX = Number.MAX_VALUE; + let minY = Number.MAX_VALUE; + let maxX = Number.MIN_VALUE; + let maxY = Number.MIN_VALUE; + const buffer = ["q"]; + if (extra) { + buffer.push(extra); } - l.push("Q"); - const E = new Dict(e), - u = new Dict(e); - u.set("Subtype", Name.get("Form")); - const d = new StringStream(l.join(" ")); - d.dict = u; - E.set("Fm0", d); - const f = new Dict(e); - s && f.set("BM", Name.get(s)); - "number" == typeof r && f.set("CA", r); - "number" == typeof n && f.set("ca", n); - const p = new Dict(e); - p.set("GS0", f); - const m = new Dict(e); - m.set("ExtGState", p); - m.set("XObject", E); - const y = new Dict(e); - y.set("Resources", m); - const w = (this.data.rect = [o, c, C, h]); - y.set("BBox", w); + if (strokeColor) { + buffer.push(`${strokeColor[0]} ${strokeColor[1]} ${strokeColor[2]} RG`); + } + if (fillColor) { + buffer.push(`${fillColor[0]} ${fillColor[1]} ${fillColor[2]} rg`); + } + let pointsArray = this.data.quadPoints; + if (!pointsArray) { + pointsArray = Float32Array.from([ + this.rectangle[0], + this.rectangle[3], + this.rectangle[2], + this.rectangle[3], + this.rectangle[0], + this.rectangle[1], + this.rectangle[2], + this.rectangle[1], + ]); + } + for (let i = 0, ii = pointsArray.length; i < ii; i += 8) { + const [mX, MX, mY, MY] = pointsCallback( + buffer, + pointsArray.subarray(i, i + 8), + ); + minX = Math.min(minX, mX); + maxX = Math.max(maxX, MX); + minY = Math.min(minY, mY); + maxY = Math.max(maxY, MY); + } + buffer.push("Q"); + const formDict = new Dict(xref); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("Subtype", Name.get("Form")); + const appearanceStream = new StringStream(buffer.join(" ")); + appearanceStream.dict = appearanceStreamDict; + formDict.set("Fm0", appearanceStream); + const gsDict = new Dict(xref); + if (blendMode) { + gsDict.set("BM", Name.get(blendMode)); + } + if (typeof strokeAlpha === "number") { + gsDict.set("CA", strokeAlpha); + } + if (typeof fillAlpha === "number") { + gsDict.set("ca", fillAlpha); + } + const stateDict = new Dict(xref); + stateDict.set("GS0", gsDict); + const resources = new Dict(xref); + resources.set("ExtGState", stateDict); + resources.set("XObject", formDict); + const appearanceDict = new Dict(xref); + appearanceDict.set("Resources", resources); + const bbox = (this.data.rect = [minX, minY, maxX, maxY]); + appearanceDict.set("BBox", bbox); this.appearance = new StringStream("/GS0 gs /Fm0 Do"); - this.appearance.dict = y; - this._streams.push(this.appearance, d); + this.appearance.dict = appearanceDict; + this._streams.push(this.appearance, appearanceStream); } - static async createNewAnnotation(e, t, i, a) { - const s = (t.ref ||= e.getNewTemporaryRef()), - r = await this.createNewAppearanceStream(t, e, a), - n = []; - let g; - if (r) { - const a = e.getNewTemporaryRef(); - g = this.createNewDict(t, e, { apRef: a }); - await writeObject(a, r, n, e); - i.push({ ref: a, data: n.join("") }); - } else g = this.createNewDict(t, e, {}); - Number.isInteger(t.parentTreeId) && g.set("StructParent", t.parentTreeId); - n.length = 0; - await writeObject(s, g, n, e); - return { ref: s, data: n.join("") }; - } - static async createNewPrintAnnotation(e, t, i, a) { - const s = await this.createNewAppearanceStream(i, t, a), - r = this.createNewDict(i, t, { ap: s }), - n = new this.prototype.constructor({ - dict: r, - xref: t, - annotationGlobals: e, - evaluatorOptions: a.evaluatorOptions, + static async createNewAnnotation(xref, annotation, dependencies, params) { + if (!annotation.ref) { + annotation.ref = xref.getNewTemporaryRef(); + } + const annotationRef = annotation.ref; + const ap = await this.createNewAppearanceStream(annotation, xref, params); + const buffer = []; + let annotationDict; + if (ap) { + const apRef = xref.getNewTemporaryRef(); + annotationDict = this.createNewDict(annotation, xref, { + apRef, }); - i.ref && (n.ref = n.refToReplace = i.ref); - return n; + await writeObject(apRef, ap, buffer, xref); + dependencies.push({ + ref: apRef, + data: buffer.join(""), + }); + } else { + annotationDict = this.createNewDict(annotation, xref, {}); + } + if (Number.isInteger(annotation.parentTreeId)) { + annotationDict.set("StructParent", annotation.parentTreeId); + } + buffer.length = 0; + await writeObject(annotationRef, annotationDict, buffer, xref); + return { + ref: annotationRef, + data: buffer.join(""), + }; + } + static async createNewPrintAnnotation( + annotationGlobals, + xref, + annotation, + params, + ) { + const ap = await this.createNewAppearanceStream(annotation, xref, params); + const annotationDict = this.createNewDict( + annotation, + xref, + ap + ? { + ap, + } + : {}, + ); + const newAnnotation = new this.prototype.constructor({ + dict: annotationDict, + xref, + annotationGlobals, + evaluatorOptions: params.evaluatorOptions, + }); + if (annotation.ref) { + newAnnotation.ref = newAnnotation.refToReplace = annotation.ref; + } + return newAnnotation; } } class WidgetAnnotation extends Annotation { - constructor(e) { - super(e); - const { dict: t, xref: i, annotationGlobals: a } = e, - s = this.data; - this._needAppearances = e.needAppearances; - s.annotationType = W; - void 0 === s.fieldName && (s.fieldName = this._constructFieldName(t)); - void 0 === s.actions && (s.actions = collectActions(i, t, uA)); - let r = getInheritableProperty({ dict: t, key: "V", getArray: !0 }); - s.fieldValue = this._decodeFormValue(r); - const n = getInheritableProperty({ dict: t, key: "DV", getArray: !0 }); - s.defaultFieldValue = this._decodeFormValue(n); - if (void 0 === r && a.xfaDatasets) { - const e = this._title.str; - if (e) { - this._hasValueFromXFA = !0; - s.fieldValue = r = a.xfaDatasets.getValue(e); + constructor(params) { + super(params); + const { dict, xref, annotationGlobals } = params; + const data = this.data; + this._needAppearances = params.needAppearances; + data.annotationType = AnnotationType.WIDGET; + if (data.fieldName === undefined) { + data.fieldName = this._constructFieldName(dict); + } + if (data.actions === undefined) { + data.actions = collectActions(xref, dict, AnnotationActionEventType); + } + let fieldValue = getInheritableProperty({ + dict, + key: "V", + getArray: true, + }); + data.fieldValue = this._decodeFormValue(fieldValue); + const defaultFieldValue = getInheritableProperty({ + dict, + key: "DV", + getArray: true, + }); + data.defaultFieldValue = this._decodeFormValue(defaultFieldValue); + if (fieldValue === undefined && annotationGlobals.xfaDatasets) { + const path = this._title.str; + if (path) { + this._hasValueFromXFA = true; + data.fieldValue = fieldValue = + annotationGlobals.xfaDatasets.getValue(path); } } - void 0 === r && - null !== s.defaultFieldValue && - (s.fieldValue = s.defaultFieldValue); - s.alternativeText = stringToPDFString(t.get("TU") || ""); - this.setDefaultAppearance(e); - s.hasAppearance ||= - this._needAppearances && void 0 !== s.fieldValue && null !== s.fieldValue; - const g = getInheritableProperty({ dict: t, key: "FT" }); - s.fieldType = g instanceof Name ? g.name : null; - const o = getInheritableProperty({ dict: t, key: "DR" }), - c = a.acroForm.get("DR"), - C = this.appearance?.dict.get("Resources"); + if (fieldValue === undefined && data.defaultFieldValue !== null) { + data.fieldValue = data.defaultFieldValue; + } + data.alternativeText = stringToPDFString(dict.get("TU") || ""); + this.setDefaultAppearance(params); + data.hasAppearance ||= + this._needAppearances && + data.fieldValue !== undefined && + data.fieldValue !== null; + const fieldType = getInheritableProperty({ + dict, + key: "FT", + }); + data.fieldType = fieldType instanceof Name ? fieldType.name : null; + const localResources = getInheritableProperty({ + dict, + key: "DR", + }); + const acroFormResources = annotationGlobals.acroForm.get("DR"); + const appearanceResources = this.appearance?.dict.get("Resources"); this._fieldResources = { - localResources: o, - acroFormResources: c, - appearanceResources: C, + localResources, + acroFormResources, + appearanceResources, mergedResources: Dict.merge({ - xref: i, - dictArray: [o, C, c], - mergeSubDicts: !0, + xref, + dictArray: [localResources, appearanceResources, acroFormResources], + mergeSubDicts: true, }), }; - s.fieldFlags = getInheritableProperty({ dict: t, key: "Ff" }); - (!Number.isInteger(s.fieldFlags) || s.fieldFlags < 0) && (s.fieldFlags = 0); - s.readOnly = this.hasFieldFlag(tA); - s.required = this.hasFieldFlag(iA); - s.hidden = - this._hasFlag(s.annotationFlags, V) || - this._hasFlag(s.annotationFlags, $); + data.fieldFlags = getInheritableProperty({ + dict, + key: "Ff", + }); + if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) { + data.fieldFlags = 0; + } + data.readOnly = this.hasFieldFlag(AnnotationFieldFlag.READONLY); + data.required = this.hasFieldFlag(AnnotationFieldFlag.REQUIRED); + data.hidden = + this._hasFlag(data.annotationFlags, AnnotationFlag.HIDDEN) || + this._hasFlag(data.annotationFlags, AnnotationFlag.NOVIEW); } - _decodeFormValue(e) { - return Array.isArray(e) - ? e.filter((e) => "string" == typeof e).map((e) => stringToPDFString(e)) - : e instanceof Name - ? stringToPDFString(e.name) - : "string" == typeof e - ? stringToPDFString(e) - : null; + _decodeFormValue(formValue) { + if (Array.isArray(formValue)) { + return formValue + .filter((item) => typeof item === "string") + .map((item) => stringToPDFString(item)); + } else if (formValue instanceof Name) { + return stringToPDFString(formValue.name); + } else if (typeof formValue === "string") { + return stringToPDFString(formValue); + } + return null; } - hasFieldFlag(e) { - return !!(this.data.fieldFlags & e); + hasFieldFlag(flag) { + return !!(this.data.fieldFlags & flag); } - _isViewable(e) { - return !0; + _isViewable(flags) { + return true; } - mustBeViewed(e, t) { - return t - ? this.viewable - : super.mustBeViewed(e, t) && !this._hasFlag(this.flags, $); - } - getRotationMatrix(e) { - let t = e?.get(this.data.id)?.rotation; - void 0 === t && (t = this.rotation); - if (0 === t) return i; - return getRotationMatrix( - t, - this.data.rect[2] - this.data.rect[0], - this.data.rect[3] - this.data.rect[1], + mustBeViewed(annotationStorage, renderForms) { + if (renderForms) { + return this.viewable; + } + return ( + super.mustBeViewed(annotationStorage, renderForms) && + !this._hasFlag(this.flags, AnnotationFlag.NOVIEW) ); } - getBorderAndBackgroundAppearances(e) { - let t = e?.get(this.data.id)?.rotation; - void 0 === t && (t = this.rotation); - if (!this.backgroundColor && !this.borderColor) return ""; - const i = this.data.rect[2] - this.data.rect[0], - a = this.data.rect[3] - this.data.rect[1], - s = 0 === t || 180 === t ? `0 0 ${i} ${a} re` : `0 0 ${a} ${i} re`; - let r = ""; - this.backgroundColor && - (r = `${getPdfColor(this.backgroundColor, !0)} ${s} f `); - if (this.borderColor) { - r += `${this.borderStyle.width || 1} w ${getPdfColor(this.borderColor, !1)} ${s} S `; + getRotationMatrix(annotationStorage) { + let rotation = annotationStorage?.get(this.data.id)?.rotation; + if (rotation === undefined) { + rotation = this.rotation; } - return r; + if (rotation === 0) { + return IDENTITY_MATRIX; + } + const width = this.data.rect[2] - this.data.rect[0]; + const height = this.data.rect[3] - this.data.rect[1]; + return getRotationMatrix(rotation, width, height); } - async getOperatorList(e, t, i, a, s) { + getBorderAndBackgroundAppearances(annotationStorage) { + let rotation = annotationStorage?.get(this.data.id)?.rotation; + if (rotation === undefined) { + rotation = this.rotation; + } + if (!this.backgroundColor && !this.borderColor) { + return ""; + } + const width = this.data.rect[2] - this.data.rect[0]; + const height = this.data.rect[3] - this.data.rect[1]; + const rect = + rotation === 0 || rotation === 180 + ? `0 0 ${width} ${height} re` + : `0 0 ${height} ${width} re`; + let str = ""; + if (this.backgroundColor) { + str = `${getPdfColor(this.backgroundColor, true)} ${rect} f `; + } + if (this.borderColor) { + const borderWidth = this.borderStyle.width || 1; + str += `${borderWidth} w ${getPdfColor(this.borderColor, false)} ${rect} S `; + } + return str; + } + async getOperatorList(evaluator, task, intent, annotationStorage) { if ( - a && + intent & RenderingIntentFlag.ANNOTATIONS_FORMS && !(this instanceof SignatureWidgetAnnotation) && !this.data.noHTML && !this.data.hasOwnCanvas - ) + ) { return { opList: new OperatorList(), - separateForm: !0, - separateCanvas: !1, + separateForm: true, + separateCanvas: false, }; - if (!this._hasText) return super.getOperatorList(e, t, i, a, s); - const r = await this._getAppearance(e, t, i, s); - if (this.appearance && null === r) - return super.getOperatorList(e, t, i, a, s); - const n = new OperatorList(); - if (!this._defaultAppearance || null === r) - return { opList: n, separateForm: !1, separateCanvas: !1 }; - const g = !!(this.data.hasOwnCanvas && i & o), - c = [ - 0, - 0, - this.data.rect[2] - this.data.rect[0], - this.data.rect[3] - this.data.rect[1], - ], - C = getTransformMatrix(this.data.rect, c, [1, 0, 0, 1, 0, 0]); - let h; - this.oc && (h = await e.parseMarkedContentProps(this.oc, null)); - void 0 !== h && n.addOp(Je, ["OC", h]); - n.addOp(We, [ + } + if (!this._hasText) { + return super.getOperatorList(evaluator, task, intent, annotationStorage); + } + const content = await this._getAppearance( + evaluator, + task, + intent, + annotationStorage, + ); + if (this.appearance && content === null) { + return super.getOperatorList(evaluator, task, intent, annotationStorage); + } + const opList = new OperatorList(); + if (!this._defaultAppearance || content === null) { + return { + opList, + separateForm: false, + separateCanvas: false, + }; + } + const isUsingOwnCanvas = !!( + this.data.hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY + ); + const matrix = [1, 0, 0, 1, 0, 0]; + const bbox = [ + 0, + 0, + this.data.rect[2] - this.data.rect[0], + this.data.rect[3] - this.data.rect[1], + ]; + const transform = getTransformMatrix(this.data.rect, bbox, matrix); + let optionalContent; + if (this.oc) { + optionalContent = await evaluator.parseMarkedContentProps(this.oc, null); + } + if (optionalContent !== undefined) { + opList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); + } + opList.addOp(OPS.beginAnnotation, [ this.data.id, this.data.rect, - C, - this.getRotationMatrix(s), - g, + transform, + this.getRotationMatrix(annotationStorage), + isUsingOwnCanvas, ]); - const l = new StringStream(r); - await e.getOperatorList({ - stream: l, - task: t, + const stream = new StringStream(content); + await evaluator.getOperatorList({ + stream, + task, resources: this._fieldResources.mergedResources, - operatorList: n, + operatorList: opList, }); - n.addOp(je, []); - void 0 !== h && n.addOp(Ye, []); - return { opList: n, separateForm: !1, separateCanvas: g }; + opList.addOp(OPS.endAnnotation, []); + if (optionalContent !== undefined) { + opList.addOp(OPS.endMarkedContent, []); + } + return { + opList, + separateForm: false, + separateCanvas: isUsingOwnCanvas, + }; } - _getMKDict(e) { - const t = new Dict(null); - e && t.set("R", e); - this.borderColor && t.set("BC", getPdfColorArray(this.borderColor)); - this.backgroundColor && t.set("BG", getPdfColorArray(this.backgroundColor)); - return t.size > 0 ? t : null; + _getMKDict(rotation) { + const mk = new Dict(null); + if (rotation) { + mk.set("R", rotation); + } + if (this.borderColor) { + mk.set("BC", getPdfColorArray(this.borderColor)); + } + if (this.backgroundColor) { + mk.set("BG", getPdfColorArray(this.backgroundColor)); + } + return mk.size > 0 ? mk : null; } - amendSavedDict(e, t) {} - async save(e, t, a) { - const s = a?.get(this.data.id); - let r = s?.value, - n = s?.rotation; - if (r === this.data.fieldValue || void 0 === r) { - if (!this._hasValueFromXFA && void 0 === n) return null; - r ||= this.data.fieldValue; + amendSavedDict(annotationStorage, dict) {} + async save(evaluator, task, annotationStorage) { + const storageEntry = annotationStorage?.get(this.data.id); + const flags = this._buildFlags(storageEntry?.noView, storageEntry?.noPrint); + let value = storageEntry?.value, + rotation = storageEntry?.rotation; + if (value === this.data.fieldValue || value === undefined) { + if ( + !this._hasValueFromXFA && + rotation === undefined && + flags === undefined + ) { + return null; + } + value ||= this.data.fieldValue; } if ( - void 0 === n && + rotation === undefined && !this._hasValueFromXFA && - Array.isArray(r) && + Array.isArray(value) && Array.isArray(this.data.fieldValue) && - r.length === this.data.fieldValue.length && - r.every((e, t) => e === this.data.fieldValue[t]) - ) + isArrayEqual(value, this.data.fieldValue) && + flags === undefined + ) { return null; - void 0 === n && (n = this.rotation); - let g = null; + } + if (rotation === undefined) { + rotation = this.rotation; + } + let appearance = null; if (!this._needAppearances) { - g = await this._getAppearance(e, t, C, a); - if (null === g) return null; + appearance = await this._getAppearance( + evaluator, + task, + RenderingIntentFlag.SAVE, + annotationStorage, + ); + if (appearance === null && flags === undefined) { + return null; + } + } else { } - let o = !1; - if (g?.needAppearances) { - o = !0; - g = null; + let needAppearances = false; + if (appearance?.needAppearances) { + needAppearances = true; + appearance = null; } - const { xref: c } = e, - h = c.fetchIfRef(this.ref); - if (!(h instanceof Dict)) return null; - const l = new Dict(c); - for (const e of h.getKeys()) "AP" !== e && l.set(e, h.getRaw(e)); - const Q = { path: this.data.fieldName, value: r }, - encoder = (e) => (isAscii(e) ? e : stringToUTF16String(e, !0)); - l.set("V", Array.isArray(r) ? r.map(encoder) : encoder(r)); - this.amendSavedDict(a, l); - const E = this._getMKDict(n); - E && l.set("MK", E); - const u = [], - d = [{ ref: this.ref, data: "", xfa: Q, needAppearances: o }]; - if (null !== g) { - const e = c.getNewTemporaryRef(), - t = new Dict(c); - l.set("AP", t); - t.set("N", e); - const s = this._getSaveFieldResources(c), - r = new StringStream(g), - n = (r.dict = new Dict(c)); - n.set("Subtype", Name.get("Form")); - n.set("Resources", s); - n.set("BBox", [ + const { xref } = evaluator; + const originalDict = xref.fetchIfRef(this.ref); + if (!(originalDict instanceof Dict)) { + return null; + } + const dict = new Dict(xref); + for (const key of originalDict.getKeys()) { + if (key !== "AP") { + dict.set(key, originalDict.getRaw(key)); + } + } + if (flags !== undefined) { + dict.set("F", flags); + if (appearance === null && !needAppearances) { + const ap = originalDict.getRaw("AP"); + if (ap) { + dict.set("AP", ap); + } + } + } + const xfa = { + path: this.data.fieldName, + value, + }; + dict.set( + "V", + Array.isArray(value) + ? value.map(stringToAsciiOrUTF16BE) + : stringToAsciiOrUTF16BE(value), + ); + this.amendSavedDict(annotationStorage, dict); + const maybeMK = this._getMKDict(rotation); + if (maybeMK) { + dict.set("MK", maybeMK); + } + const buffer = []; + const changes = [ + { + ref: this.ref, + data: "", + xfa, + needAppearances, + }, + ]; + if (appearance !== null) { + const newRef = xref.getNewTemporaryRef(); + const AP = new Dict(xref); + dict.set("AP", AP); + AP.set("N", newRef); + const resources = this._getSaveFieldResources(xref); + const appearanceStream = new StringStream(appearance); + const appearanceDict = (appearanceStream.dict = new Dict(xref)); + appearanceDict.set("Subtype", Name.get("Form")); + appearanceDict.set("Resources", resources); + appearanceDict.set("BBox", [ 0, 0, this.data.rect[2] - this.data.rect[0], this.data.rect[3] - this.data.rect[1], ]); - const o = this.getRotationMatrix(a); - o !== i && n.set("Matrix", o); - await writeObject(e, r, u, c); - d.push({ ref: e, data: u.join(""), xfa: null, needAppearances: !1 }); - u.length = 0; + const rotationMatrix = this.getRotationMatrix(annotationStorage); + if (rotationMatrix !== IDENTITY_MATRIX) { + appearanceDict.set("Matrix", rotationMatrix); + } + await writeObject(newRef, appearanceStream, buffer, xref); + changes.push({ + ref: newRef, + data: buffer.join(""), + xfa: null, + needAppearances: false, + }); + buffer.length = 0; } - l.set("M", `D:${getModificationDate()}`); - await writeObject(this.ref, l, u, c); - d[0].data = u.join(""); - return d; + dict.set("M", `D:${getModificationDate()}`); + await writeObject(this.ref, dict, buffer, xref); + changes[0].data = buffer.join(""); + return changes; } - async _getAppearance(e, t, i, a) { - if (this.hasFieldFlag(sA)) return null; - const s = a?.get(this.data.id); - let r, g; - if (s) { - r = s.formattedValue || s.value; - g = s.rotation; + async _getAppearance(evaluator, task, intent, annotationStorage) { + const isPassword = this.hasFieldFlag(AnnotationFieldFlag.PASSWORD); + if (isPassword) { + return null; + } + const storageEntry = annotationStorage?.get(this.data.id); + let value, rotation; + if (storageEntry) { + value = storageEntry.formattedValue || storageEntry.value; + rotation = storageEntry.rotation; } if ( - void 0 === g && - void 0 === r && - !this._needAppearances && - (!this._hasValueFromXFA || this.appearance) - ) - return null; - const o = this.getBorderAndBackgroundAppearances(a); - if (void 0 === r) { - r = this.data.fieldValue; - if (!r) return `/Tx BMC q ${o}Q EMC`; + rotation === undefined && + value === undefined && + !this._needAppearances + ) { + if (!this._hasValueFromXFA || this.appearance) { + return null; + } } - Array.isArray(r) && 1 === r.length && (r = r[0]); - assert("string" == typeof r, "Expected `value` to be a string."); - r = r.trim(); + const colors = this.getBorderAndBackgroundAppearances(annotationStorage); + if (value === undefined) { + value = this.data.fieldValue; + if (!value) { + return `/Tx BMC q ${colors}Q EMC`; + } + } + if (Array.isArray(value) && value.length === 1) { + value = value[0]; + } + assert(typeof value === "string", "Expected `value` to be a string."); + value = value.trimEnd(); if (this.data.combo) { - const e = this.data.options.find(({ exportValue: e }) => r === e); - r = e?.displayValue || r; + const option = this.data.options.find( + ({ exportValue }) => value === exportValue, + ); + value = option?.displayValue || value; } - if ("" === r) return `/Tx BMC q ${o}Q EMC`; - void 0 === g && (g = this.rotation); - let c, - h = -1; + if (value === "") { + return `/Tx BMC q ${colors}Q EMC`; + } + if (rotation === undefined) { + rotation = this.rotation; + } + let lineCount = -1; + let lines; if (this.data.multiLine) { - c = r.split(/\r\n?|\n/).map((e) => e.normalize("NFC")); - h = c.length; - } else c = [r.replace(/\r\n?|\n/, "").normalize("NFC")]; - let l = this.data.rect[3] - this.data.rect[1], - Q = this.data.rect[2] - this.data.rect[0]; - (90 !== g && 270 !== g) || ([Q, l] = [l, Q]); - this._defaultAppearance || - (this.data.defaultAppearanceData = parseDefaultAppearance( - (this._defaultAppearance = "/Helvetica 0 Tf 0 g"), - )); - let E, - u, - d, - f = await WidgetAnnotation._getFontData( - e, - t, - this.data.defaultAppearanceData, - this._fieldResources.mergedResources, - ); - const p = []; - let m = !1; - for (const e of c) { - const t = f.encodeString(e); - t.length > 1 && (m = !0); - p.push(t.join("")); + lines = value.split(/\r\n?|\n/).map((line) => line.normalize("NFC")); + lineCount = lines.length; + } else { + lines = [value.replace(/\r\n?|\n/, "").normalize("NFC")]; } - if (m && i & C) return { needAppearances: !0 }; - if (m && this._isOffscreenCanvasSupported) { - const i = this.data.comb ? "monospace" : "sans-serif", - a = new FakeUnicodeFont(e.xref, i), - s = a.createFontResources(c.join("")), - n = s.getRaw("Font"); - if (this._fieldResources.mergedResources.has("Font")) { - const e = this._fieldResources.mergedResources.get("Font"); - for (const t of n.getKeys()) e.set(t, n.getRaw(t)); - } else this._fieldResources.mergedResources.set("Font", n); - const g = a.fontName.name; - f = await WidgetAnnotation._getFontData( - e, - t, - { fontName: g, fontSize: 0 }, - s, + const defaultPadding = 1; + const defaultHPadding = 2; + let totalHeight = this.data.rect[3] - this.data.rect[1]; + let totalWidth = this.data.rect[2] - this.data.rect[0]; + if (rotation === 90 || rotation === 270) { + [totalWidth, totalHeight] = [totalHeight, totalWidth]; + } + if (!this._defaultAppearance) { + this.data.defaultAppearanceData = parseDefaultAppearance( + (this._defaultAppearance = "/Helvetica 0 Tf 0 g"), ); - for (let e = 0, t = p.length; e < t; e++) - p[e] = stringToUTF16String(c[e]); - const o = Object.assign( + } + let font = await WidgetAnnotation._getFontData( + evaluator, + task, + this.data.defaultAppearanceData, + this._fieldResources.mergedResources, + ); + let defaultAppearance, fontSize, lineHeight; + const encodedLines = []; + let encodingError = false; + for (const line of lines) { + const encodedString = font.encodeString(line); + if (encodedString.length > 1) { + encodingError = true; + } + encodedLines.push(encodedString.join("")); + } + if (encodingError && intent & RenderingIntentFlag.SAVE) { + return { + needAppearances: true, + }; + } + if (encodingError && this._isOffscreenCanvasSupported) { + const fontFamily = this.data.comb ? "monospace" : "sans-serif"; + const fakeUnicodeFont = new FakeUnicodeFont(evaluator.xref, fontFamily); + const resources = fakeUnicodeFont.createFontResources(lines.join("")); + const newFont = resources.getRaw("Font"); + if (this._fieldResources.mergedResources.has("Font")) { + const oldFont = this._fieldResources.mergedResources.get("Font"); + for (const key of newFont.getKeys()) { + oldFont.set(key, newFont.getRaw(key)); + } + } else { + this._fieldResources.mergedResources.set("Font", newFont); + } + const fontName = fakeUnicodeFont.fontName.name; + font = await WidgetAnnotation._getFontData( + evaluator, + task, + { + fontName, + fontSize: 0, + }, + resources, + ); + for (let i = 0, ii = encodedLines.length; i < ii; i++) { + encodedLines[i] = stringToUTF16String(lines[i]); + } + const savedDefaultAppearance = Object.assign( Object.create(null), this.data.defaultAppearanceData, ); this.data.defaultAppearanceData.fontSize = 0; - this.data.defaultAppearanceData.fontName = g; - [E, u, d] = this._computeFontSize(l - 2, Q - 4, r, f, h); - this.data.defaultAppearanceData = o; + this.data.defaultAppearanceData.fontName = fontName; + [defaultAppearance, fontSize, lineHeight] = this._computeFontSize( + totalHeight - 2 * defaultPadding, + totalWidth - 2 * defaultHPadding, + value, + font, + lineCount, + ); + this.data.defaultAppearanceData = savedDefaultAppearance; } else { - this._isOffscreenCanvasSupported || + if (!this._isOffscreenCanvasSupported) { warn( "_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly.", ); - [E, u, d] = this._computeFontSize(l - 2, Q - 4, r, f, h); - } - let y = f.descent; - y = isNaN(y) ? n * d : Math.max(n * d, Math.abs(y) * u); - const w = Math.min(Math.floor((l - u) / 2), 1), - D = this.data.textAlignment; - if (this.data.multiLine) - return this._getMultilineAppearance(E, p, f, u, Q, l, D, 2, w, y, d, a); - if (this.data.comb) - return this._getCombAppearance(E, f, p[0], u, Q, l, 2, w, y, d, a); - const b = w + y; - if (0 === D || D > 2) - return ( - `/Tx BMC q ${o}BT ` + - E + - ` 1 0 0 1 ${numberToString(2)} ${numberToString(b)} Tm (${escapeString(p[0])}) Tj ET Q EMC` + } + [defaultAppearance, fontSize, lineHeight] = this._computeFontSize( + totalHeight - 2 * defaultPadding, + totalWidth - 2 * defaultHPadding, + value, + font, + lineCount, ); + } + let descent = font.descent; + if (isNaN(descent)) { + descent = BASELINE_FACTOR * lineHeight; + } else { + descent = Math.max( + BASELINE_FACTOR * lineHeight, + Math.abs(descent) * fontSize, + ); + } + const defaultVPadding = Math.min( + Math.floor((totalHeight - fontSize) / 2), + defaultPadding, + ); + const alignment = this.data.textAlignment; + if (this.data.multiLine) { + return this._getMultilineAppearance( + defaultAppearance, + encodedLines, + font, + fontSize, + totalWidth, + totalHeight, + alignment, + defaultHPadding, + defaultVPadding, + descent, + lineHeight, + annotationStorage, + ); + } + if (this.data.comb) { + return this._getCombAppearance( + defaultAppearance, + font, + encodedLines[0], + fontSize, + totalWidth, + totalHeight, + defaultHPadding, + defaultVPadding, + descent, + lineHeight, + annotationStorage, + ); + } + const bottomPadding = defaultVPadding + descent; + if (alignment === 0 || alignment > 2) { + return ( + `/Tx BMC q ${colors}BT ` + + defaultAppearance + + ` 1 0 0 1 ${numberToString(defaultHPadding)} ${numberToString(bottomPadding)} Tm (${escapeString(encodedLines[0])}) Tj` + + " ET Q EMC" + ); + } + const prevInfo = { + shift: 0, + }; + const renderedText = this._renderText( + encodedLines[0], + font, + fontSize, + totalWidth, + alignment, + prevInfo, + defaultHPadding, + bottomPadding, + ); return ( - `/Tx BMC q ${o}BT ` + - E + - ` 1 0 0 1 0 0 Tm ${this._renderText(p[0], f, u, Q, D, { shift: 0 }, 2, b)} ET Q EMC` + `/Tx BMC q ${colors}BT ` + + defaultAppearance + + ` 1 0 0 1 0 0 Tm ${renderedText}` + + " ET Q EMC" ); } - static async _getFontData(e, t, i, a) { - const s = new OperatorList(), - r = { - font: null, - clone() { - return this; - }, + static async _getFontData(evaluator, task, appearanceData, resources) { + const operatorList = new OperatorList(); + const initialState = { + font: null, + clone() { + return this; }, - { fontName: n, fontSize: g } = i; - await e.handleSetFont(a, [n && Name.get(n), g], null, s, t, r, null); - return r.font; + }; + const { fontName, fontSize } = appearanceData; + await evaluator.handleSetFont( + resources, + [fontName && Name.get(fontName), fontSize], + null, + operatorList, + task, + initialState, + null, + ); + return initialState.font; } - _getTextWidth(e, t) { - return t.charsToGlyphs(e).reduce((e, t) => e + t.width, 0) / 1e3; + _getTextWidth(text, font) { + return ( + font + .charsToGlyphs(text) + .reduce((width, glyph) => width + glyph.width, 0) / 1000 + ); } - _computeFontSize(e, t, i, a, r) { - let { fontSize: n } = this.data.defaultAppearanceData, - g = (n || 12) * s, - o = Math.round(e / g); - if (!n) { - const roundWithTwoDigits = (e) => Math.floor(100 * e) / 100; - if (-1 === r) { - const r = this._getTextWidth(i, a); - n = roundWithTwoDigits(Math.min(e / s, r > t ? t / r : 1 / 0)); - o = 1; + _computeFontSize(height, width, text, font, lineCount) { + let { fontSize } = this.data.defaultAppearanceData; + let lineHeight = (fontSize || 12) * LINE_FACTOR, + numberOfLines = Math.round(height / lineHeight); + if (!fontSize) { + const roundWithTwoDigits = (x) => Math.floor(x * 100) / 100; + if (lineCount === -1) { + const textWidth = this._getTextWidth(text, font); + fontSize = roundWithTwoDigits( + Math.min(height / LINE_FACTOR, width / textWidth), + ); + numberOfLines = 1; } else { - const c = i.split(/\r\n?|\n/), - C = []; - for (const e of c) { - const t = a.encodeString(e).join(""), - i = a.charsToGlyphs(t), - s = a.getCharPositions(t); - C.push({ line: t, glyphs: i, positions: s }); + const lines = text.split(/\r\n?|\n/); + const cachedLines = []; + for (const line of lines) { + const encoded = font.encodeString(line).join(""); + const glyphs = font.charsToGlyphs(encoded); + const positions = font.getCharPositions(encoded); + cachedLines.push({ + line: encoded, + glyphs, + positions, + }); } - const isTooBig = (i) => { - let s = 0; - for (const r of C) { - s += this._splitLine(null, a, i, t, r).length * i; - if (s > e) return !0; + const isTooBig = (fsize) => { + let totalHeight = 0; + for (const cache of cachedLines) { + const chunks = this._splitLine(null, font, fsize, width, cache); + totalHeight += chunks.length * fsize; + if (totalHeight > height) { + return true; + } } - return !1; + return false; }; - o = Math.max(o, r); - for (;;) { - g = e / o; - n = roundWithTwoDigits(g / s); - if (!isTooBig(n)) break; - o++; + numberOfLines = Math.max(numberOfLines, lineCount); + while (true) { + lineHeight = height / numberOfLines; + fontSize = roundWithTwoDigits(lineHeight / LINE_FACTOR); + if (isTooBig(fontSize)) { + numberOfLines++; + continue; + } + break; } } - const { fontName: c, fontColor: C } = this.data.defaultAppearanceData; - this._defaultAppearance = (function createDefaultAppearance({ - fontSize: e, - fontName: t, - fontColor: i, - }) { - return `/${escapePDFName(t)} ${e} Tf ${getPdfColor(i, !0)}`; - })({ fontSize: n, fontName: c, fontColor: C }); + const { fontName, fontColor } = this.data.defaultAppearanceData; + this._defaultAppearance = createDefaultAppearance({ + fontSize, + fontName, + fontColor, + }); } - return [this._defaultAppearance, n, e / o]; + return [this._defaultAppearance, fontSize, height / numberOfLines]; } - _renderText(e, t, i, a, s, r, n, g) { - let o; - if (1 === s) { - o = (a - this._getTextWidth(e, t) * i) / 2; - } else if (2 === s) { - o = a - this._getTextWidth(e, t) * i - n; - } else o = n; - const c = numberToString(o - r.shift); - r.shift = o; - return `${c} ${(g = numberToString(g))} Td (${escapeString(e)}) Tj`; + _renderText( + text, + font, + fontSize, + totalWidth, + alignment, + prevInfo, + hPadding, + vPadding, + ) { + let shift; + if (alignment === 1) { + const width = this._getTextWidth(text, font) * fontSize; + shift = (totalWidth - width) / 2; + } else if (alignment === 2) { + const width = this._getTextWidth(text, font) * fontSize; + shift = totalWidth - width - hPadding; + } else { + shift = hPadding; + } + const shiftStr = numberToString(shift - prevInfo.shift); + prevInfo.shift = shift; + vPadding = numberToString(vPadding); + return `${shiftStr} ${vPadding} Td (${escapeString(text)}) Tj`; } - _getSaveFieldResources(e) { - const { - localResources: t, - appearanceResources: i, - acroFormResources: a, - } = this._fieldResources, - s = this.data.defaultAppearanceData?.fontName; - if (!s) return t || Dict.empty; - for (const e of [t, i]) - if (e instanceof Dict) { - const t = e.get("Font"); - if (t instanceof Dict && t.has(s)) return e; - } - if (a instanceof Dict) { - const i = a.get("Font"); - if (i instanceof Dict && i.has(s)) { - const a = new Dict(e); - a.set(s, i.getRaw(s)); - const r = new Dict(e); - r.set("Font", a); - return Dict.merge({ xref: e, dictArray: [r, t], mergeSubDicts: !0 }); + _getSaveFieldResources(xref) { + const { localResources, appearanceResources, acroFormResources } = + this._fieldResources; + const fontName = this.data.defaultAppearanceData?.fontName; + if (!fontName) { + return localResources || Dict.empty; + } + for (const resources of [localResources, appearanceResources]) { + if (resources instanceof Dict) { + const localFont = resources.get("Font"); + if (localFont instanceof Dict && localFont.has(fontName)) { + return resources; + } } } - return t || Dict.empty; + if (acroFormResources instanceof Dict) { + const acroFormFont = acroFormResources.get("Font"); + if (acroFormFont instanceof Dict && acroFormFont.has(fontName)) { + const subFontDict = new Dict(xref); + subFontDict.set(fontName, acroFormFont.getRaw(fontName)); + const subResourcesDict = new Dict(xref); + subResourcesDict.set("Font", subFontDict); + return Dict.merge({ + xref, + dictArray: [subResourcesDict, localResources], + mergeSubDicts: true, + }); + } + } + return localResources || Dict.empty; } getFieldObject() { return null; } } class TextWidgetAnnotation extends WidgetAnnotation { - constructor(e) { - super(e); - const { dict: t } = e; - if (t.has("PMD")) { - this.flags |= V; - this.data.hidden = !0; + constructor(params) { + super(params); + const { dict } = params; + if (dict.has("PMD")) { + this.flags |= AnnotationFlag.HIDDEN; + this.data.hidden = true; warn("Barcodes are not supported"); } this.data.hasOwnCanvas = this.data.readOnly && !this.data.noHTML; - this._hasText = !0; - "string" != typeof this.data.fieldValue && (this.data.fieldValue = ""); - let i = getInheritableProperty({ dict: t, key: "Q" }); - (!Number.isInteger(i) || i < 0 || i > 2) && (i = null); - this.data.textAlignment = i; - let a = getInheritableProperty({ dict: t, key: "MaxLen" }); - (!Number.isInteger(a) || a < 0) && (a = 0); - this.data.maxLen = a; - this.data.multiLine = this.hasFieldFlag(aA); + this._hasText = true; + if (typeof this.data.fieldValue !== "string") { + this.data.fieldValue = ""; + } + let alignment = getInheritableProperty({ + dict, + key: "Q", + }); + if (!Number.isInteger(alignment) || alignment < 0 || alignment > 2) { + alignment = null; + } + this.data.textAlignment = alignment; + let maximumLength = getInheritableProperty({ + dict, + key: "MaxLen", + }); + if (!Number.isInteger(maximumLength) || maximumLength < 0) { + maximumLength = 0; + } + this.data.maxLen = maximumLength; + this.data.multiLine = this.hasFieldFlag(AnnotationFieldFlag.MULTILINE); this.data.comb = - this.hasFieldFlag(CA) && - !this.hasFieldFlag(aA) && - !this.hasFieldFlag(sA) && - !this.hasFieldFlag(oA) && - 0 !== this.data.maxLen; - this.data.doNotScroll = this.hasFieldFlag(cA); + this.hasFieldFlag(AnnotationFieldFlag.COMB) && + !this.hasFieldFlag(AnnotationFieldFlag.MULTILINE) && + !this.hasFieldFlag(AnnotationFieldFlag.PASSWORD) && + !this.hasFieldFlag(AnnotationFieldFlag.FILESELECT) && + this.data.maxLen !== 0; + this.data.doNotScroll = this.hasFieldFlag(AnnotationFieldFlag.DONOTSCROLL); } get hasTextContent() { return !!this.appearance && !this._needAppearances; } - _getCombAppearance(e, t, i, a, s, r, n, g, o, c, C) { - const h = s / this.data.maxLen, - l = this.getBorderAndBackgroundAppearances(C), - Q = [], - E = t.getCharPositions(i); - for (const [e, t] of E) Q.push(`(${escapeString(i.substring(e, t))}) Tj`); - const u = Q.join(` ${numberToString(h)} 0 Td `); + _getCombAppearance( + defaultAppearance, + font, + text, + fontSize, + width, + height, + hPadding, + vPadding, + descent, + lineHeight, + annotationStorage, + ) { + const combWidth = width / this.data.maxLen; + const colors = this.getBorderAndBackgroundAppearances(annotationStorage); + const buf = []; + const positions = font.getCharPositions(text); + for (const [start, end] of positions) { + buf.push(`(${escapeString(text.substring(start, end))}) Tj`); + } + const renderedComb = buf.join(` ${numberToString(combWidth)} 0 Td `); return ( - `/Tx BMC q ${l}BT ` + - e + - ` 1 0 0 1 ${numberToString(n)} ${numberToString(g + o)} Tm ${u} ET Q EMC` + `/Tx BMC q ${colors}BT ` + + defaultAppearance + + ` 1 0 0 1 ${numberToString(hPadding)} ${numberToString(vPadding + descent)} Tm ${renderedComb}` + + " ET Q EMC" ); } - _getMultilineAppearance(e, t, i, a, s, r, n, g, o, c, C, h) { - const l = [], - Q = s - 2 * g, - E = { shift: 0 }; - for (let e = 0, r = t.length; e < r; e++) { - const r = t[e], - h = this._splitLine(r, i, a, Q); - for (let t = 0, r = h.length; t < r; t++) { - const r = h[t], - Q = 0 === e && 0 === t ? -o - (C - c) : -C; - l.push(this._renderText(r, i, a, s, n, E, g, Q)); + _getMultilineAppearance( + defaultAppearance, + lines, + font, + fontSize, + width, + height, + alignment, + hPadding, + vPadding, + descent, + lineHeight, + annotationStorage, + ) { + const buf = []; + const totalWidth = width - 2 * hPadding; + const prevInfo = { + shift: 0, + }; + for (let i = 0, ii = lines.length; i < ii; i++) { + const line = lines[i]; + const chunks = this._splitLine(line, font, fontSize, totalWidth); + for (let j = 0, jj = chunks.length; j < jj; j++) { + const chunk = chunks[j]; + const vShift = + i === 0 && j === 0 ? -vPadding - (lineHeight - descent) : -lineHeight; + buf.push( + this._renderText( + chunk, + font, + fontSize, + width, + alignment, + prevInfo, + hPadding, + vShift, + ), + ); } } - const u = this.getBorderAndBackgroundAppearances(h), - d = l.join("\n"); + const colors = this.getBorderAndBackgroundAppearances(annotationStorage); + const renderedText = buf.join("\n"); return ( - `/Tx BMC q ${u}BT ` + - e + - ` 1 0 0 1 0 ${numberToString(r)} Tm ${d} ET Q EMC` + `/Tx BMC q ${colors}BT ` + + defaultAppearance + + ` 1 0 0 1 0 ${numberToString(height)} Tm ${renderedText}` + + " ET Q EMC" ); } - _splitLine(e, t, i, a, s = {}) { - e = s.line || e; - const r = s.glyphs || t.charsToGlyphs(e); - if (r.length <= 1) return [e]; - const n = s.positions || t.getCharPositions(e), - g = i / 1e3, - o = []; - let c = -1, - C = -1, - h = -1, - l = 0, - Q = 0; - for (let t = 0, i = r.length; t < i; t++) { - const [i, s] = n[t], - E = r[t], - u = E.width * g; - if (" " === E.unicode) - if (Q + u > a) { - o.push(e.substring(l, i)); - l = i; - Q = u; - c = -1; - h = -1; - } else { - Q += u; - c = i; - C = s; - h = t; - } - else if (Q + u > a) - if (-1 !== c) { - o.push(e.substring(l, C)); - l = C; - t = h + 1; - c = -1; - Q = 0; - } else { - o.push(e.substring(l, i)); - l = i; - Q = u; - } - else Q += u; + _splitLine(line, font, fontSize, width, cache = {}) { + line = cache.line || line; + const glyphs = cache.glyphs || font.charsToGlyphs(line); + if (glyphs.length <= 1) { + return [line]; + } + const positions = cache.positions || font.getCharPositions(line); + const scale = fontSize / 1000; + const chunks = []; + let lastSpacePosInStringStart = -1, + lastSpacePosInStringEnd = -1, + lastSpacePos = -1, + startChunk = 0, + currentWidth = 0; + for (let i = 0, ii = glyphs.length; i < ii; i++) { + const [start, end] = positions[i]; + const glyph = glyphs[i]; + const glyphWidth = glyph.width * scale; + if (glyph.unicode === " ") { + if (currentWidth + glyphWidth > width) { + chunks.push(line.substring(startChunk, start)); + startChunk = start; + currentWidth = glyphWidth; + lastSpacePosInStringStart = -1; + lastSpacePos = -1; + } else { + currentWidth += glyphWidth; + lastSpacePosInStringStart = start; + lastSpacePosInStringEnd = end; + lastSpacePos = i; + } + } else if (currentWidth + glyphWidth > width) { + if (lastSpacePosInStringStart !== -1) { + chunks.push(line.substring(startChunk, lastSpacePosInStringEnd)); + startChunk = lastSpacePosInStringEnd; + i = lastSpacePos + 1; + lastSpacePosInStringStart = -1; + currentWidth = 0; + } else { + chunks.push(line.substring(startChunk, start)); + startChunk = start; + currentWidth = glyphWidth; + } + } else { + currentWidth += glyphWidth; + } + } + if (startChunk < line.length) { + chunks.push(line.substring(startChunk, line.length)); + } + return chunks; + } + async extractTextContent(evaluator, task, viewBox) { + await super.extractTextContent(evaluator, task, viewBox); + const text = this.data.textContent; + if (!text) { + return; + } + const allText = text.join("\n"); + if (allText === this.data.fieldValue) { + return; + } + const regex = allText.replaceAll(/([.*+?^${}()|[\]\\])|(\s+)/g, (_m, p1) => + p1 ? `\\${p1}` : "\\s+", + ); + if (new RegExp(`^\\s*${regex}\\s*$`).test(this.data.fieldValue)) { + this.data.textContent = this.data.fieldValue.split("\n"); } - l < e.length && o.push(e.substring(l, e.length)); - return o; } getFieldObject() { return { @@ -52617,7 +63763,7 @@ class TextWidgetAnnotation extends WidgetAnnotation { value: this.data.fieldValue, defaultValue: this.data.defaultFieldValue || "", multiline: this.data.multiLine, - password: this.hasFieldFlag(sA), + password: this.hasFieldFlag(AnnotationFieldFlag.PASSWORD), charLimit: this.data.maxLen, comb: this.data.comb, editable: !this.data.readOnly, @@ -52634,243 +63780,394 @@ class TextWidgetAnnotation extends WidgetAnnotation { } } class ButtonWidgetAnnotation extends WidgetAnnotation { - constructor(e) { - super(e); + constructor(params) { + super(params); this.checkedAppearance = null; this.uncheckedAppearance = null; - this.data.checkBox = !this.hasFieldFlag(rA) && !this.hasFieldFlag(nA); - this.data.radioButton = this.hasFieldFlag(rA) && !this.hasFieldFlag(nA); - this.data.pushButton = this.hasFieldFlag(nA); - this.data.isTooltipOnly = !1; - if (this.data.checkBox) this._processCheckBox(e); - else if (this.data.radioButton) this._processRadioButton(e); - else if (this.data.pushButton) { - this.data.hasOwnCanvas = !0; - this.data.noHTML = !1; - this._processPushButton(e); - } else warn("Invalid field flags for button widget annotation"); - } - async getOperatorList(e, t, a, s, r) { - if (this.data.pushButton) return super.getOperatorList(e, t, a, !1, r); - let n = null, - g = null; - if (r) { - const e = r.get(this.data.id); - n = e ? e.value : null; - g = e ? e.rotation : null; + this.data.checkBox = + !this.hasFieldFlag(AnnotationFieldFlag.RADIO) && + !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON); + this.data.radioButton = + this.hasFieldFlag(AnnotationFieldFlag.RADIO) && + !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON); + this.data.pushButton = this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON); + this.data.isTooltipOnly = false; + if (this.data.checkBox) { + this._processCheckBox(params); + } else if (this.data.radioButton) { + this._processRadioButton(params); + } else if (this.data.pushButton) { + this.data.hasOwnCanvas = true; + this.data.noHTML = false; + this._processPushButton(params); + } else { + warn("Invalid field flags for button widget annotation"); } - if (null === n && this.appearance) - return super.getOperatorList(e, t, a, s, r); - null == n && - (n = this.data.checkBox + } + async getOperatorList(evaluator, task, intent, annotationStorage) { + if (this.data.pushButton) { + return super.getOperatorList( + evaluator, + task, + intent, + false, + annotationStorage, + ); + } + let value = null; + let rotation = null; + if (annotationStorage) { + const storageEntry = annotationStorage.get(this.data.id); + value = storageEntry ? storageEntry.value : null; + rotation = storageEntry ? storageEntry.rotation : null; + } + if (value === null && this.appearance) { + return super.getOperatorList(evaluator, task, intent, annotationStorage); + } + if (value === null || value === undefined) { + value = this.data.checkBox ? this.data.fieldValue === this.data.exportValue - : this.data.fieldValue === this.data.buttonValue); - const o = n ? this.checkedAppearance : this.uncheckedAppearance; - if (o) { - const n = this.appearance, - c = lookupMatrix(o.dict.getArray("Matrix"), i); - g && o.dict.set("Matrix", this.getRotationMatrix(r)); - this.appearance = o; - const C = super.getOperatorList(e, t, a, s, r); - this.appearance = n; - o.dict.set("Matrix", c); - return C; + : this.data.fieldValue === this.data.buttonValue; } - return { opList: new OperatorList(), separateForm: !1, separateCanvas: !1 }; - } - async save(e, t, i) { - return this.data.checkBox - ? this._saveCheckbox(e, t, i) - : this.data.radioButton - ? this._saveRadioButton(e, t, i) - : null; - } - async _saveCheckbox(e, t, i) { - if (!i) return null; - const a = i.get(this.data.id); - let s = a?.rotation, - r = a?.value; - if (void 0 === s) { - if (void 0 === r) return null; - if ((this.data.fieldValue === this.data.exportValue) === r) return null; + const appearance = value + ? this.checkedAppearance + : this.uncheckedAppearance; + if (appearance) { + const savedAppearance = this.appearance; + const savedMatrix = lookupMatrix( + appearance.dict.getArray("Matrix"), + IDENTITY_MATRIX, + ); + if (rotation) { + appearance.dict.set( + "Matrix", + this.getRotationMatrix(annotationStorage), + ); + } + this.appearance = appearance; + const operatorList = super.getOperatorList( + evaluator, + task, + intent, + annotationStorage, + ); + this.appearance = savedAppearance; + appearance.dict.set("Matrix", savedMatrix); + return operatorList; } - const n = e.xref.fetchIfRef(this.ref); - if (!(n instanceof Dict)) return null; - void 0 === s && (s = this.rotation); - void 0 === r && (r = this.data.fieldValue === this.data.exportValue); - const g = { - path: this.data.fieldName, - value: r ? this.data.exportValue : "", + return { + opList: new OperatorList(), + separateForm: false, + separateCanvas: false, + }; + } + async save(evaluator, task, annotationStorage) { + if (this.data.checkBox) { + return this._saveCheckbox(evaluator, task, annotationStorage); + } + if (this.data.radioButton) { + return this._saveRadioButton(evaluator, task, annotationStorage); + } + return null; + } + async _saveCheckbox(evaluator, task, annotationStorage) { + if (!annotationStorage) { + return null; + } + const storageEntry = annotationStorage.get(this.data.id); + const flags = this._buildFlags(storageEntry?.noView, storageEntry?.noPrint); + let rotation = storageEntry?.rotation, + value = storageEntry?.value; + if (rotation === undefined && flags === undefined) { + if (value === undefined) { + return null; + } + const defaultValue = this.data.fieldValue === this.data.exportValue; + if (defaultValue === value) { + return null; + } + } + let dict = evaluator.xref.fetchIfRef(this.ref); + if (!(dict instanceof Dict)) { + return null; + } + dict = dict.clone(); + if (rotation === undefined) { + rotation = this.rotation; + } + if (value === undefined) { + value = this.data.fieldValue === this.data.exportValue; + } + const xfa = { + path: this.data.fieldName, + value: value ? this.data.exportValue : "", + }; + const name = Name.get(value ? this.data.exportValue : "Off"); + dict.set("V", name); + dict.set("AS", name); + dict.set("M", `D:${getModificationDate()}`); + if (flags !== undefined) { + dict.set("F", flags); + } + const maybeMK = this._getMKDict(rotation); + if (maybeMK) { + dict.set("MK", maybeMK); + } + const buffer = []; + await writeObject(this.ref, dict, buffer, evaluator.xref); + return [ + { + ref: this.ref, + data: buffer.join(""), + xfa, }, - o = Name.get(r ? this.data.exportValue : "Off"); - n.set("V", o); - n.set("AS", o); - n.set("M", `D:${getModificationDate()}`); - const c = this._getMKDict(s); - c && n.set("MK", c); - const C = []; - await writeObject(this.ref, n, C, e.xref); - return [{ ref: this.ref, data: C.join(""), xfa: g }]; + ]; } - async _saveRadioButton(e, t, i) { - if (!i) return null; - const a = i.get(this.data.id); - let s = a?.rotation, - r = a?.value; - if (void 0 === s) { - if (void 0 === r) return null; - if ((this.data.fieldValue === this.data.buttonValue) === r) return null; + async _saveRadioButton(evaluator, task, annotationStorage) { + if (!annotationStorage) { + return null; } - const n = e.xref.fetchIfRef(this.ref); - if (!(n instanceof Dict)) return null; - void 0 === r && (r = this.data.fieldValue === this.data.buttonValue); - void 0 === s && (s = this.rotation); - const g = { - path: this.data.fieldName, - value: r ? this.data.buttonValue : "", - }, - o = Name.get(r ? this.data.buttonValue : "Off"), - c = []; - let C = null; - if (r) + const storageEntry = annotationStorage.get(this.data.id); + const flags = this._buildFlags(storageEntry?.noView, storageEntry?.noPrint); + let rotation = storageEntry?.rotation, + value = storageEntry?.value; + if (rotation === undefined && flags === undefined) { + if (value === undefined) { + return null; + } + const defaultValue = this.data.fieldValue === this.data.buttonValue; + if (defaultValue === value) { + return null; + } + } + let dict = evaluator.xref.fetchIfRef(this.ref); + if (!(dict instanceof Dict)) { + return null; + } + dict = dict.clone(); + if (value === undefined) { + value = this.data.fieldValue === this.data.buttonValue; + } + if (rotation === undefined) { + rotation = this.rotation; + } + const xfa = { + path: this.data.fieldName, + value: value ? this.data.buttonValue : "", + }; + const name = Name.get(value ? this.data.buttonValue : "Off"); + const buffer = []; + let parentData = null; + if (value) { if (this.parent instanceof Ref) { - const t = e.xref.fetch(this.parent); - t.set("V", o); - await writeObject(this.parent, t, c, e.xref); - C = c.join(""); - c.length = 0; - } else this.parent instanceof Dict && this.parent.set("V", o); - n.set("AS", o); - n.set("M", `D:${getModificationDate()}`); - const h = this._getMKDict(s); - h && n.set("MK", h); - await writeObject(this.ref, n, c, e.xref); - const l = [{ ref: this.ref, data: c.join(""), xfa: g }]; - C && l.push({ ref: this.parent, data: C, xfa: null }); - return l; + const parent = evaluator.xref.fetch(this.parent); + parent.set("V", name); + await writeObject(this.parent, parent, buffer, evaluator.xref); + parentData = buffer.join(""); + buffer.length = 0; + } else if (this.parent instanceof Dict) { + this.parent.set("V", name); + } + } + if (!this.parent) { + dict.set("V", name); + } + dict.set("AS", name); + dict.set("M", `D:${getModificationDate()}`); + if (flags !== undefined) { + dict.set("F", flags); + } + const maybeMK = this._getMKDict(rotation); + if (maybeMK) { + dict.set("MK", maybeMK); + } + await writeObject(this.ref, dict, buffer, evaluator.xref); + const newRefs = [ + { + ref: this.ref, + data: buffer.join(""), + xfa, + }, + ]; + if (parentData) { + newRefs.push({ + ref: this.parent, + data: parentData, + xfa: null, + }); + } + return newRefs; } - _getDefaultCheckedAppearance(e, t) { - const i = this.data.rect[2] - this.data.rect[0], - a = this.data.rect[3] - this.data.rect[1], - s = [0, 0, i, a], - r = 0.8 * Math.min(i, a); - let n, g; - if ("check" === t) { - n = { width: 0.755 * r, height: 0.705 * r }; - g = "3"; - } else if ("disc" === t) { - n = { width: 0.791 * r, height: 0.705 * r }; - g = "l"; - } else unreachable(`_getDefaultCheckedAppearance - unsupported type: ${t}`); - const o = `q BT /PdfJsZaDb ${r} Tf 0 g ${numberToString((i - n.width) / 2)} ${numberToString((a - n.height) / 2)} Td (${g}) Tj ET Q`, - c = new Dict(e.xref); - c.set("FormType", 1); - c.set("Subtype", Name.get("Form")); - c.set("Type", Name.get("XObject")); - c.set("BBox", s); - c.set("Matrix", [1, 0, 0, 1, 0, 0]); - c.set("Length", o.length); - const C = new Dict(e.xref), - h = new Dict(e.xref); - h.set("PdfJsZaDb", this.fallbackFontDict); - C.set("Font", h); - c.set("Resources", C); - this.checkedAppearance = new StringStream(o); - this.checkedAppearance.dict = c; + _getDefaultCheckedAppearance(params, type) { + const width = this.data.rect[2] - this.data.rect[0]; + const height = this.data.rect[3] - this.data.rect[1]; + const bbox = [0, 0, width, height]; + const FONT_RATIO = 0.8; + const fontSize = Math.min(width, height) * FONT_RATIO; + let metrics, char; + if (type === "check") { + metrics = { + width: 0.755 * fontSize, + height: 0.705 * fontSize, + }; + char = "\x33"; + } else if (type === "disc") { + metrics = { + width: 0.791 * fontSize, + height: 0.705 * fontSize, + }; + char = "\x6C"; + } else { + unreachable(`_getDefaultCheckedAppearance - unsupported type: ${type}`); + } + const xShift = numberToString((width - metrics.width) / 2); + const yShift = numberToString((height - metrics.height) / 2); + const appearance = `q BT /PdfJsZaDb ${fontSize} Tf 0 g ${xShift} ${yShift} Td (${char}) Tj ET Q`; + const appearanceStreamDict = new Dict(params.xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", bbox); + appearanceStreamDict.set("Matrix", [1, 0, 0, 1, 0, 0]); + appearanceStreamDict.set("Length", appearance.length); + const resources = new Dict(params.xref); + const font = new Dict(params.xref); + font.set("PdfJsZaDb", this.fallbackFontDict); + resources.set("Font", font); + appearanceStreamDict.set("Resources", resources); + this.checkedAppearance = new StringStream(appearance); + this.checkedAppearance.dict = appearanceStreamDict; this._streams.push(this.checkedAppearance); } - _processCheckBox(e) { - const t = e.dict.get("AP"); - if (!(t instanceof Dict)) return; - const i = t.get("N"); - if (!(i instanceof Dict)) return; - const a = this._decodeFormValue(e.dict.get("AS")); - "string" == typeof a && (this.data.fieldValue = a); - const s = - null !== this.data.fieldValue && "Off" !== this.data.fieldValue - ? this.data.fieldValue - : "Yes", - r = i.getKeys(); - if (0 === r.length) r.push("Off", s); - else if (1 === r.length) "Off" === r[0] ? r.push(s) : r.unshift("Off"); - else if (r.includes(s)) { - r.length = 0; - r.push("Off", s); + _processCheckBox(params) { + const customAppearance = params.dict.get("AP"); + if (!(customAppearance instanceof Dict)) { + return; + } + const normalAppearance = customAppearance.get("N"); + if (!(normalAppearance instanceof Dict)) { + return; + } + const asValue = this._decodeFormValue(params.dict.get("AS")); + if (typeof asValue === "string") { + this.data.fieldValue = asValue; + } + const yes = + this.data.fieldValue !== null && this.data.fieldValue !== "Off" + ? this.data.fieldValue + : "Yes"; + const exportValues = normalAppearance.getKeys(); + if (exportValues.length === 0) { + exportValues.push("Off", yes); + } else if (exportValues.length === 1) { + if (exportValues[0] === "Off") { + exportValues.push(yes); + } else { + exportValues.unshift("Off"); + } + } else if (exportValues.includes(yes)) { + exportValues.length = 0; + exportValues.push("Off", yes); } else { - const e = r.find((e) => "Off" !== e); - r.length = 0; - r.push("Off", e); + const otherYes = exportValues.find((v) => v !== "Off"); + exportValues.length = 0; + exportValues.push("Off", otherYes); + } + if (!exportValues.includes(this.data.fieldValue)) { + this.data.fieldValue = "Off"; + } + this.data.exportValue = exportValues[1]; + const checkedAppearance = normalAppearance.get(this.data.exportValue); + this.checkedAppearance = + checkedAppearance instanceof BaseStream ? checkedAppearance : null; + const uncheckedAppearance = normalAppearance.get("Off"); + this.uncheckedAppearance = + uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null; + if (this.checkedAppearance) { + this._streams.push(this.checkedAppearance); + } else { + this._getDefaultCheckedAppearance(params, "check"); + } + if (this.uncheckedAppearance) { + this._streams.push(this.uncheckedAppearance); } - r.includes(this.data.fieldValue) || (this.data.fieldValue = "Off"); - this.data.exportValue = r[1]; - const n = i.get(this.data.exportValue); - this.checkedAppearance = n instanceof BaseStream ? n : null; - const g = i.get("Off"); - this.uncheckedAppearance = g instanceof BaseStream ? g : null; - this.checkedAppearance - ? this._streams.push(this.checkedAppearance) - : this._getDefaultCheckedAppearance(e, "check"); - this.uncheckedAppearance && this._streams.push(this.uncheckedAppearance); this._fallbackFontDict = this.fallbackFontDict; - null === this.data.defaultFieldValue && - (this.data.defaultFieldValue = "Off"); - } - _processRadioButton(e) { - this.data.buttonValue = null; - const t = e.dict.get("Parent"); - if (t instanceof Dict) { - this.parent = e.dict.getRaw("Parent"); - const i = t.get("V"); - i instanceof Name && (this.data.fieldValue = this._decodeFormValue(i)); + if (this.data.defaultFieldValue === null) { + this.data.defaultFieldValue = "Off"; } - const i = e.dict.get("AP"); - if (!(i instanceof Dict)) return; - const a = i.get("N"); - if (!(a instanceof Dict)) return; - for (const e of a.getKeys()) - if ("Off" !== e) { - this.data.buttonValue = this._decodeFormValue(e); + } + _processRadioButton(params) { + this.data.buttonValue = null; + const fieldParent = params.dict.get("Parent"); + if (fieldParent instanceof Dict) { + this.parent = params.dict.getRaw("Parent"); + const fieldParentValue = fieldParent.get("V"); + if (fieldParentValue instanceof Name) { + this.data.fieldValue = this._decodeFormValue(fieldParentValue); + } + } + const appearanceStates = params.dict.get("AP"); + if (!(appearanceStates instanceof Dict)) { + return; + } + const normalAppearance = appearanceStates.get("N"); + if (!(normalAppearance instanceof Dict)) { + return; + } + for (const key of normalAppearance.getKeys()) { + if (key !== "Off") { + this.data.buttonValue = this._decodeFormValue(key); break; } - const s = a.get(this.data.buttonValue); - this.checkedAppearance = s instanceof BaseStream ? s : null; - const r = a.get("Off"); - this.uncheckedAppearance = r instanceof BaseStream ? r : null; - this.checkedAppearance - ? this._streams.push(this.checkedAppearance) - : this._getDefaultCheckedAppearance(e, "disc"); - this.uncheckedAppearance && this._streams.push(this.uncheckedAppearance); + } + const checkedAppearance = normalAppearance.get(this.data.buttonValue); + this.checkedAppearance = + checkedAppearance instanceof BaseStream ? checkedAppearance : null; + const uncheckedAppearance = normalAppearance.get("Off"); + this.uncheckedAppearance = + uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null; + if (this.checkedAppearance) { + this._streams.push(this.checkedAppearance); + } else { + this._getDefaultCheckedAppearance(params, "disc"); + } + if (this.uncheckedAppearance) { + this._streams.push(this.uncheckedAppearance); + } this._fallbackFontDict = this.fallbackFontDict; - null === this.data.defaultFieldValue && - (this.data.defaultFieldValue = "Off"); + if (this.data.defaultFieldValue === null) { + this.data.defaultFieldValue = "Off"; + } } - _processPushButton(e) { - const { dict: t, annotationGlobals: i } = e; - if (t.has("A") || t.has("AA") || this.data.alternativeText) { - this.data.isTooltipOnly = !t.has("A") && !t.has("AA"); - Catalog.parseDestDictionary({ - destDict: t, - resultObj: this.data, - docBaseUrl: i.baseUrl, - docAttachments: i.attachments, - }); - } else warn("Push buttons without action dictionaries are not supported"); + _processPushButton(params) { + const { dict, annotationGlobals } = params; + if (!dict.has("A") && !dict.has("AA") && !this.data.alternativeText) { + warn("Push buttons without action dictionaries are not supported"); + return; + } + this.data.isTooltipOnly = !dict.has("A") && !dict.has("AA"); + Catalog.parseDestDictionary({ + destDict: dict, + resultObj: this.data, + docBaseUrl: annotationGlobals.baseUrl, + docAttachments: annotationGlobals.attachments, + }); } getFieldObject() { - let e, - t = "button"; + let type = "button"; + let exportValues; if (this.data.checkBox) { - t = "checkbox"; - e = this.data.exportValue; + type = "checkbox"; + exportValues = this.data.exportValue; } else if (this.data.radioButton) { - t = "radiobutton"; - e = this.data.buttonValue; + type = "radiobutton"; + exportValues = this.data.buttonValue; } return { id: this.data.id, value: this.data.fieldValue || "Off", defaultValue: this.data.defaultFieldValue, - exportValues: e, + exportValues, editable: !this.data.readOnly, name: this.data.fieldName, rect: this.data.rect, @@ -52880,57 +64177,69 @@ class ButtonWidgetAnnotation extends WidgetAnnotation { strokeColor: this.data.borderColor, fillColor: this.data.backgroundColor, rotation: this.rotation, - type: t, + type, }; } get fallbackFontDict() { - const e = new Dict(); - e.set("BaseFont", Name.get("ZapfDingbats")); - e.set("Type", Name.get("FallbackType")); - e.set("Subtype", Name.get("FallbackType")); - e.set("Encoding", Name.get("ZapfDingbatsEncoding")); - return shadow(this, "fallbackFontDict", e); + const dict = new Dict(); + dict.set("BaseFont", Name.get("ZapfDingbats")); + dict.set("Type", Name.get("FallbackType")); + dict.set("Subtype", Name.get("FallbackType")); + dict.set("Encoding", Name.get("ZapfDingbatsEncoding")); + return shadow(this, "fallbackFontDict", dict); } } class ChoiceWidgetAnnotation extends WidgetAnnotation { - constructor(e) { - super(e); - const { dict: t, xref: i } = e; - this.indices = t.getArray("I"); + constructor(params) { + super(params); + const { dict, xref } = params; + this.indices = dict.getArray("I"); this.hasIndices = Array.isArray(this.indices) && this.indices.length > 0; this.data.options = []; - const a = getInheritableProperty({ dict: t, key: "Opt" }); - if (Array.isArray(a)) - for (let e = 0, t = a.length; e < t; e++) { - const t = i.fetchIfRef(a[e]), - s = Array.isArray(t); - this.data.options[e] = { - exportValue: this._decodeFormValue(s ? i.fetchIfRef(t[0]) : t), - displayValue: this._decodeFormValue(s ? i.fetchIfRef(t[1]) : t), + const options = getInheritableProperty({ + dict, + key: "Opt", + }); + if (Array.isArray(options)) { + for (let i = 0, ii = options.length; i < ii; i++) { + const option = xref.fetchIfRef(options[i]); + const isOptionArray = Array.isArray(option); + this.data.options[i] = { + exportValue: this._decodeFormValue( + isOptionArray ? xref.fetchIfRef(option[0]) : option, + ), + displayValue: this._decodeFormValue( + isOptionArray ? xref.fetchIfRef(option[1]) : option, + ), }; } - if (this.hasIndices) { + } + if (!this.hasIndices) { + if (typeof this.data.fieldValue === "string") { + this.data.fieldValue = [this.data.fieldValue]; + } else if (!this.data.fieldValue) { + this.data.fieldValue = []; + } + } else { this.data.fieldValue = []; - const e = this.data.options.length; - for (const t of this.indices) - Number.isInteger(t) && - t >= 0 && - t < e && - this.data.fieldValue.push(this.data.options[t].exportValue); - } else - "string" == typeof this.data.fieldValue - ? (this.data.fieldValue = [this.data.fieldValue]) - : this.data.fieldValue || (this.data.fieldValue = []); - this.data.combo = this.hasFieldFlag(gA); - this.data.multiSelect = this.hasFieldFlag(IA); - this._hasText = !0; + const ii = this.data.options.length; + for (const i of this.indices) { + if (Number.isInteger(i) && i >= 0 && i < ii) { + this.data.fieldValue.push(this.data.options[i].exportValue); + } + } + } + this.data.combo = this.hasFieldFlag(AnnotationFieldFlag.COMBO); + this.data.multiSelect = this.hasFieldFlag(AnnotationFieldFlag.MULTISELECT); + this._hasText = true; } getFieldObject() { - const e = this.data.combo ? "combobox" : "listbox", - t = this.data.fieldValue.length > 0 ? this.data.fieldValue[0] : null; + const type = this.data.combo ? "combobox" : "listbox"; + const value = + this.data.fieldValue.length > 0 ? this.data.fieldValue[0] : null; return { id: this.data.id, - value: t, + value, defaultValue: this.data.defaultFieldValue, editable: !this.data.readOnly, name: this.data.fieldName, @@ -52944,98 +64253,149 @@ class ChoiceWidgetAnnotation extends WidgetAnnotation { strokeColor: this.data.borderColor, fillColor: this.data.backgroundColor, rotation: this.rotation, - type: e, + type, }; } - amendSavedDict(e, t) { - if (!this.hasIndices) return; - let i = e?.get(this.data.id)?.value; - Array.isArray(i) || (i = [i]); - const a = [], - { options: s } = this.data; - for (let e = 0, t = 0, r = s.length; e < r; e++) - if (s[e].exportValue === i[t]) { - a.push(e); - t += 1; + amendSavedDict(annotationStorage, dict) { + if (!this.hasIndices) { + return; + } + let values = annotationStorage?.get(this.data.id)?.value; + if (!Array.isArray(values)) { + values = [values]; + } + const indices = []; + const { options } = this.data; + for (let i = 0, j = 0, ii = options.length; i < ii; i++) { + if (options[i].exportValue === values[j]) { + indices.push(i); + j += 1; } - t.set("I", a); + } + dict.set("I", indices); } - async _getAppearance(e, t, i, a) { - if (this.data.combo) return super._getAppearance(e, t, i, a); - let r, n; - const g = a?.get(this.data.id); - if (g) { - n = g.rotation; - r = g.value; + async _getAppearance(evaluator, task, intent, annotationStorage) { + if (this.data.combo) { + return super._getAppearance(evaluator, task, intent, annotationStorage); } - if (void 0 === n && void 0 === r && !this._needAppearances) return null; - void 0 === r ? (r = this.data.fieldValue) : Array.isArray(r) || (r = [r]); - let o = this.data.rect[3] - this.data.rect[1], - c = this.data.rect[2] - this.data.rect[0]; - (90 !== n && 270 !== n) || ([c, o] = [o, c]); - const C = this.data.options.length, - h = []; - for (let e = 0; e < C; e++) { - const { exportValue: t } = this.data.options[e]; - r.includes(t) && h.push(e); + let exportedValue, rotation; + const storageEntry = annotationStorage?.get(this.data.id); + if (storageEntry) { + rotation = storageEntry.rotation; + exportedValue = storageEntry.value; } - this._defaultAppearance || - (this.data.defaultAppearanceData = parseDefaultAppearance( + if ( + rotation === undefined && + exportedValue === undefined && + !this._needAppearances + ) { + return null; + } + if (exportedValue === undefined) { + exportedValue = this.data.fieldValue; + } else if (!Array.isArray(exportedValue)) { + exportedValue = [exportedValue]; + } + const defaultPadding = 1; + const defaultHPadding = 2; + let totalHeight = this.data.rect[3] - this.data.rect[1]; + let totalWidth = this.data.rect[2] - this.data.rect[0]; + if (rotation === 90 || rotation === 270) { + [totalWidth, totalHeight] = [totalHeight, totalWidth]; + } + const lineCount = this.data.options.length; + const valueIndices = []; + for (let i = 0; i < lineCount; i++) { + const { exportValue } = this.data.options[i]; + if (exportedValue.includes(exportValue)) { + valueIndices.push(i); + } + } + if (!this._defaultAppearance) { + this.data.defaultAppearanceData = parseDefaultAppearance( (this._defaultAppearance = "/Helvetica 0 Tf 0 g"), - )); - const l = await WidgetAnnotation._getFontData( - e, - t, + ); + } + const font = await WidgetAnnotation._getFontData( + evaluator, + task, this.data.defaultAppearanceData, this._fieldResources.mergedResources, ); - let Q, - { fontSize: E } = this.data.defaultAppearanceData; - if (E) Q = this._defaultAppearance; - else { - const e = (o - 1) / C; - let t, - i = -1; - for (const { displayValue: e } of this.data.options) { - const a = this._getTextWidth(e, l); - if (a > i) { - i = a; - t = e; + let defaultAppearance; + let { fontSize } = this.data.defaultAppearanceData; + if (!fontSize) { + const lineHeight = (totalHeight - defaultPadding) / lineCount; + let lineWidth = -1; + let value; + for (const { displayValue } of this.data.options) { + const width = this._getTextWidth(displayValue, font); + if (width > lineWidth) { + lineWidth = width; + value = displayValue; } } - [Q, E] = this._computeFontSize(e, c - 4, t, l, -1); + [defaultAppearance, fontSize] = this._computeFontSize( + lineHeight, + totalWidth - 2 * defaultHPadding, + value, + font, + -1, + ); + } else { + defaultAppearance = this._defaultAppearance; } - const u = E * s, - d = (u - E) / 2, - f = Math.floor(o / u); - let p = 0; - if (h.length > 0) { - const e = Math.min(...h), - t = Math.max(...h); - p = Math.max(0, t - f + 1); - p > e && (p = e); + const lineHeight = fontSize * LINE_FACTOR; + const vPadding = (lineHeight - fontSize) / 2; + const numberOfVisibleLines = Math.floor(totalHeight / lineHeight); + let firstIndex = 0; + if (valueIndices.length > 0) { + const minIndex = Math.min(...valueIndices); + const maxIndex = Math.max(...valueIndices); + firstIndex = Math.max(0, maxIndex - numberOfVisibleLines + 1); + if (firstIndex > minIndex) { + firstIndex = minIndex; + } } - const m = Math.min(p + f + 1, C), - y = ["/Tx BMC q", `1 1 ${c} ${o} re W n`]; - if (h.length) { - y.push("0.600006 0.756866 0.854904 rg"); - for (const e of h) - p <= e && e < m && y.push(`1 ${o - (e - p + 1) * u} ${c} ${u} re f`); + const end = Math.min(firstIndex + numberOfVisibleLines + 1, lineCount); + const buf = ["/Tx BMC q", `1 1 ${totalWidth} ${totalHeight} re W n`]; + if (valueIndices.length) { + buf.push("0.600006 0.756866 0.854904 rg"); + for (const index of valueIndices) { + if (firstIndex <= index && index < end) { + buf.push( + `1 ${totalHeight - (index - firstIndex + 1) * lineHeight} ${totalWidth} ${lineHeight} re f`, + ); + } + } } - y.push("BT", Q, `1 0 0 1 0 ${o} Tm`); - const w = { shift: 0 }; - for (let e = p; e < m; e++) { - const { displayValue: t } = this.data.options[e], - i = e === p ? d : 0; - y.push(this._renderText(t, l, E, c, 0, w, 2, -u + i)); + buf.push("BT", defaultAppearance, `1 0 0 1 0 ${totalHeight} Tm`); + const prevInfo = { + shift: 0, + }; + for (let i = firstIndex; i < end; i++) { + const { displayValue } = this.data.options[i]; + const vpadding = i === firstIndex ? vPadding : 0; + buf.push( + this._renderText( + displayValue, + font, + fontSize, + totalWidth, + 0, + prevInfo, + defaultHPadding, + -lineHeight + vpadding, + ), + ); } - y.push("ET Q EMC"); - return y.join("\n"); + buf.push("ET Q EMC"); + return buf.join("\n"); } } class SignatureWidgetAnnotation extends WidgetAnnotation { - constructor(e) { - super(e); + constructor(params) { + super(params); this.data.fieldValue = null; this.data.hasOwnCanvas = this.data.noRotate; this.data.noHTML = !this.data.hasOwnCanvas; @@ -53050,22 +64410,24 @@ class SignatureWidgetAnnotation extends WidgetAnnotation { } } class TextAnnotation extends MarkupAnnotation { - constructor(e) { - super(e); - this.data.noRotate = !0; + constructor(params) { + const DEFAULT_ICON_SIZE = 22; + super(params); + this.data.noRotate = true; this.data.hasOwnCanvas = this.data.noRotate; - this.data.noHTML = !1; - const { dict: t } = e; - this.data.annotationType = S; - if (this.data.hasAppearance) this.data.name = "NoIcon"; - else { - this.data.rect[1] = this.data.rect[3] - 22; - this.data.rect[2] = this.data.rect[0] + 22; - this.data.name = t.has("Name") ? t.get("Name").name : "Note"; + this.data.noHTML = false; + const { dict } = params; + this.data.annotationType = AnnotationType.TEXT; + if (this.data.hasAppearance) { + this.data.name = "NoIcon"; + } else { + this.data.rect[1] = this.data.rect[3] - DEFAULT_ICON_SIZE; + this.data.rect[2] = this.data.rect[0] + DEFAULT_ICON_SIZE; + this.data.name = dict.has("Name") ? dict.get("Name").name : "Note"; } - if (t.has("State")) { - this.data.state = t.get("State") || null; - this.data.stateModel = t.get("StateModel") || null; + if (dict.has("State")) { + this.data.state = dict.get("State") || null; + this.data.stateModel = dict.get("StateModel") || null; } else { this.data.state = null; this.data.stateModel = null; @@ -53073,937 +64435,1117 @@ class TextAnnotation extends MarkupAnnotation { } } class LinkAnnotation extends Annotation { - constructor(e) { - super(e); - const { dict: t, annotationGlobals: i } = e; - this.data.annotationType = k; - this.data.noHTML = !1; - const a = getQuadPoints(t, this.rectangle); - a && (this.data.quadPoints = a); + constructor(params) { + super(params); + const { dict, annotationGlobals } = params; + this.data.annotationType = AnnotationType.LINK; + this.data.noHTML = false; + const quadPoints = getQuadPoints(dict, this.rectangle); + if (quadPoints) { + this.data.quadPoints = quadPoints; + } this.data.borderColor ||= this.data.color; Catalog.parseDestDictionary({ - destDict: t, + destDict: dict, resultObj: this.data, - docBaseUrl: i.baseUrl, - docAttachments: i.attachments, + docBaseUrl: annotationGlobals.baseUrl, + docAttachments: annotationGlobals.attachments, }); } } class PopupAnnotation extends Annotation { - constructor(e) { - super(e); - const { dict: t } = e; - this.data.annotationType = q; - this.data.noHTML = !1; - (this.data.rect[0] !== this.data.rect[2] && - this.data.rect[1] !== this.data.rect[3]) || - (this.data.rect = null); - let i = t.get("Parent"); - if (!i) { + constructor(params) { + super(params); + const { dict } = params; + this.data.annotationType = AnnotationType.POPUP; + this.data.noHTML = false; + if ( + this.data.rect[0] === this.data.rect[2] || + this.data.rect[1] === this.data.rect[3] + ) { + this.data.rect = null; + } + let parentItem = dict.get("Parent"); + if (!parentItem) { warn("Popup annotation has a missing or invalid parent annotation."); return; } - this.data.parentRect = lookupNormalRect(i.getArray("Rect"), null); - isName(i.get("RT"), j) && (i = i.get("IRT")); - if (i.has("M")) { - this.setModificationDate(i.get("M")); - this.data.modificationDate = this.modificationDate; - } else this.data.modificationDate = null; - if (i.has("C")) { - this.setColor(i.getArray("C")); - this.data.color = this.color; - } else this.data.color = null; - if (!this.viewable) { - const e = i.get("F"); - this._isViewable(e) && this.setFlags(e); + this.data.parentRect = lookupNormalRect(parentItem.getArray("Rect"), null); + const rt = parentItem.get("RT"); + if (isName(rt, AnnotationReplyType.GROUP)) { + parentItem = parentItem.get("IRT"); } - this.setTitle(i.get("T")); + if (!parentItem.has("M")) { + this.data.modificationDate = null; + } else { + this.setModificationDate(parentItem.get("M")); + this.data.modificationDate = this.modificationDate; + } + if (!parentItem.has("C")) { + this.data.color = null; + } else { + this.setColor(parentItem.getArray("C")); + this.data.color = this.color; + } + if (!this.viewable) { + const parentFlags = parentItem.get("F"); + if (this._isViewable(parentFlags)) { + this.setFlags(parentFlags); + } + } + this.setTitle(parentItem.get("T")); this.data.titleObj = this._title; - this.setContents(i.get("Contents")); + this.setContents(parentItem.get("Contents")); this.data.contentsObj = this._contents; - i.has("RC") && - (this.data.richText = XFAFactory.getRichTextAsHtml(i.get("RC"))); - this.data.open = !!t.get("Open"); + if (parentItem.has("RC")) { + this.data.richText = XFAFactory.getRichTextAsHtml(parentItem.get("RC")); + } + this.data.open = !!dict.get("Open"); } } class FreeTextAnnotation extends MarkupAnnotation { - constructor(e) { - super(e); - this.data.hasOwnCanvas = !this.data.noHTML; - this.data.noHTML = !1; - const { evaluatorOptions: t, xref: i } = e; - this.data.annotationType = R; - this.setDefaultAppearance(e); + constructor(params) { + super(params); + this.data.hasOwnCanvas = this.data.noRotate; + this.data.isEditable = !this.data.noHTML; + this.data.noHTML = false; + const { evaluatorOptions, xref } = params; + this.data.annotationType = AnnotationType.FREETEXT; + this.setDefaultAppearance(params); this._hasAppearance = !!this.appearance; if (this._hasAppearance) { - const { fontColor: e, fontSize: a } = (function parseAppearanceStream( - e, - t, - i, - ) { - return new AppearanceStreamEvaluator(e, t, i).parse(); - })(this.appearance, t, i); - this.data.defaultAppearanceData.fontColor = e; - this.data.defaultAppearanceData.fontSize = a || 10; + const { fontColor, fontSize } = parseAppearanceStream( + this.appearance, + evaluatorOptions, + xref, + ); + this.data.defaultAppearanceData.fontColor = fontColor; + this.data.defaultAppearanceData.fontSize = fontSize || 10; } else { this.data.defaultAppearanceData.fontSize ||= 10; - const { fontColor: t, fontSize: a } = this.data.defaultAppearanceData; + const { fontColor, fontSize } = this.data.defaultAppearanceData; if (this._contents.str) { this.data.textContent = this._contents.str .split(/\r\n?|\n/) - .map((e) => e.trimEnd()); - const { - coords: e, - bbox: t, - matrix: i, - } = FakeUnicodeFont.getFirstPositionInfo( + .map((line) => line.trimEnd()); + const { coords, bbox, matrix } = FakeUnicodeFont.getFirstPositionInfo( this.rectangle, this.rotation, - a, + fontSize, ); - this.data.textPosition = this._transformPoint(e, t, i); + this.data.textPosition = this._transformPoint(coords, bbox, matrix); } if (this._isOffscreenCanvasSupported) { - const s = e.dict.get("CA"), - r = new FakeUnicodeFont(i, "sans-serif"); - this.appearance = r.createAppearance( + const strokeAlpha = params.dict.get("CA"); + const fakeUnicodeFont = new FakeUnicodeFont(xref, "sans-serif"); + this.appearance = fakeUnicodeFont.createAppearance( this._contents.str, this.rectangle, this.rotation, - a, - t, - s, + fontSize, + fontColor, + strokeAlpha, ); this._streams.push(this.appearance); - } else + } else { warn( "FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.", ); + } } } get hasTextContent() { return this._hasAppearance; } - static createNewDict(e, t, { apRef: i, ap: a }) { - const { - color: s, - fontSize: r, - rect: n, - rotation: g, - user: o, - value: c, - } = e, - C = new Dict(t); - C.set("Type", Name.get("Annot")); - C.set("Subtype", Name.get("FreeText")); - C.set("CreationDate", `D:${getModificationDate()}`); - C.set("Rect", n); - const h = `/Helv ${r} Tf ${getPdfColor(s, !0)}`; - C.set("DA", h); - C.set("Contents", isAscii(c) ? c : stringToUTF16String(c, !0)); - C.set("F", 4); - C.set("Border", [0, 0, 0]); - C.set("Rotate", g); - o && C.set("T", isAscii(o) ? o : stringToUTF16String(o, !0)); - if (i || a) { - const e = new Dict(t); - C.set("AP", e); - i ? e.set("N", i) : e.set("N", a); + static createNewDict(annotation, xref, { apRef, ap }) { + const { color, fontSize, oldAnnotation, rect, rotation, user, value } = + annotation; + const freetext = oldAnnotation || new Dict(xref); + freetext.set("Type", Name.get("Annot")); + freetext.set("Subtype", Name.get("FreeText")); + if (oldAnnotation) { + freetext.set("M", `D:${getModificationDate()}`); + freetext.delete("RC"); + } else { + freetext.set("CreationDate", `D:${getModificationDate()}`); } - return C; + freetext.set("Rect", rect); + const da = `/Helv ${fontSize} Tf ${getPdfColor(color, true)}`; + freetext.set("DA", da); + freetext.set("Contents", stringToAsciiOrUTF16BE(value)); + freetext.set("F", 4); + freetext.set("Border", [0, 0, 0]); + freetext.set("Rotate", rotation); + if (user) { + freetext.set("T", stringToAsciiOrUTF16BE(user)); + } + if (apRef || ap) { + const n = new Dict(xref); + freetext.set("AP", n); + if (apRef) { + n.set("N", apRef); + } else { + n.set("N", ap); + } + } + return freetext; } - static async createNewAppearanceStream(e, t, i) { - const { baseFontRef: a, evaluator: r, task: n } = i, - { color: g, fontSize: o, rect: c, rotation: C, value: h } = e, - l = new Dict(t), - Q = new Dict(t); - if (a) Q.set("Helv", a); - else { - const e = new Dict(t); - e.set("BaseFont", Name.get("Helvetica")); - e.set("Type", Name.get("Font")); - e.set("Subtype", Name.get("Type1")); - e.set("Encoding", Name.get("WinAnsiEncoding")); - Q.set("Helv", e); + static async createNewAppearanceStream(annotation, xref, params) { + const { baseFontRef, evaluator, task } = params; + const { color, fontSize, rect, rotation, value } = annotation; + const resources = new Dict(xref); + const font = new Dict(xref); + if (baseFontRef) { + font.set("Helv", baseFontRef); + } else { + const baseFont = new Dict(xref); + baseFont.set("BaseFont", Name.get("Helvetica")); + baseFont.set("Type", Name.get("Font")); + baseFont.set("Subtype", Name.get("Type1")); + baseFont.set("Encoding", Name.get("WinAnsiEncoding")); + font.set("Helv", baseFont); } - l.set("Font", Q); - const E = await WidgetAnnotation._getFontData( - r, - n, - { fontName: "Helv", fontSize: o }, - l, - ), - [u, d, f, p] = c; - let m = f - u, - y = p - d; - C % 180 != 0 && ([m, y] = [y, m]); - const w = h.split("\n"), - D = o / 1e3; - let b = -1 / 0; - const F = []; - for (let e of w) { - const t = E.encodeString(e); - if (t.length > 1) return null; - e = t.join(""); - F.push(e); - let i = 0; - const a = E.charsToGlyphs(e); - for (const e of a) i += e.width * D; - b = Math.max(b, i); + resources.set("Font", font); + const helv = await WidgetAnnotation._getFontData( + evaluator, + task, + { + fontName: "Helv", + fontSize, + }, + resources, + ); + const [x1, y1, x2, y2] = rect; + let w = x2 - x1; + let h = y2 - y1; + if (rotation % 180 !== 0) { + [w, h] = [h, w]; } - let S = 1; - b > m && (S = m / b); - let k = 1; - const R = s * o, - N = 1 * o, - G = R * w.length; - G > y && (k = y / G); - const x = o * Math.min(S, k); - let U, M, L; - switch (C) { + const lines = value.split("\n"); + const scale = fontSize / 1000; + let totalWidth = -Infinity; + const encodedLines = []; + for (let line of lines) { + const encoded = helv.encodeString(line); + if (encoded.length > 1) { + return null; + } + line = encoded.join(""); + encodedLines.push(line); + let lineWidth = 0; + const glyphs = helv.charsToGlyphs(line); + for (const glyph of glyphs) { + lineWidth += glyph.width * scale; + } + totalWidth = Math.max(totalWidth, lineWidth); + } + let hscale = 1; + if (totalWidth > w) { + hscale = w / totalWidth; + } + let vscale = 1; + const lineHeight = LINE_FACTOR * fontSize; + const lineAscent = (LINE_FACTOR - LINE_DESCENT_FACTOR) * fontSize; + const totalHeight = lineHeight * lines.length; + if (totalHeight > h) { + vscale = h / totalHeight; + } + const fscale = Math.min(hscale, vscale); + const newFontSize = fontSize * fscale; + let firstPoint, clipBox, matrix; + switch (rotation) { case 0: - L = [1, 0, 0, 1]; - M = [c[0], c[1], m, y]; - U = [c[0], c[3] - N]; + matrix = [1, 0, 0, 1]; + clipBox = [rect[0], rect[1], w, h]; + firstPoint = [rect[0], rect[3] - lineAscent]; break; case 90: - L = [0, 1, -1, 0]; - M = [c[1], -c[2], m, y]; - U = [c[1], -c[0] - N]; + matrix = [0, 1, -1, 0]; + clipBox = [rect[1], -rect[2], w, h]; + firstPoint = [rect[1], -rect[0] - lineAscent]; break; case 180: - L = [-1, 0, 0, -1]; - M = [-c[2], -c[3], m, y]; - U = [-c[2], -c[1] - N]; + matrix = [-1, 0, 0, -1]; + clipBox = [-rect[2], -rect[3], w, h]; + firstPoint = [-rect[2], -rect[1] - lineAscent]; break; case 270: - L = [0, -1, 1, 0]; - M = [-c[3], c[0], m, y]; - U = [-c[3], c[2] - N]; + matrix = [0, -1, 1, 0]; + clipBox = [-rect[3], rect[0], w, h]; + firstPoint = [-rect[3], rect[2] - lineAscent]; + break; } - const H = [ + const buffer = [ "q", - `${L.join(" ")} 0 0 cm`, - `${M.join(" ")} re W n`, - "BT", - `${getPdfColor(g, !0)}`, - `0 Tc /Helv ${numberToString(x)} Tf`, + `${matrix.join(" ")} 0 0 cm`, + `${clipBox.join(" ")} re W n`, + `BT`, + `${getPdfColor(color, true)}`, + `0 Tc /Helv ${numberToString(newFontSize)} Tf`, ]; - H.push(`${U.join(" ")} Td (${escapeString(F[0])}) Tj`); - const J = numberToString(R); - for (let e = 1, t = F.length; e < t; e++) { - const t = F[e]; - H.push(`0 -${J} Td (${escapeString(t)}) Tj`); + buffer.push( + `${firstPoint.join(" ")} Td (${escapeString(encodedLines[0])}) Tj`, + ); + const vShift = numberToString(lineHeight); + for (let i = 1, ii = encodedLines.length; i < ii; i++) { + const line = encodedLines[i]; + buffer.push(`0 -${vShift} Td (${escapeString(line)}) Tj`); } - H.push("ET", "Q"); - const Y = H.join("\n"), - v = new Dict(t); - v.set("FormType", 1); - v.set("Subtype", Name.get("Form")); - v.set("Type", Name.get("XObject")); - v.set("BBox", c); - v.set("Resources", l); - v.set("Matrix", [1, 0, 0, 1, -c[0], -c[1]]); - const K = new StringStream(Y); - K.dict = v; - return K; + buffer.push("ET", "Q"); + const appearance = buffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Resources", resources); + appearanceStreamDict.set("Matrix", [1, 0, 0, 1, -rect[0], -rect[1]]); + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; } } class LineAnnotation extends MarkupAnnotation { - constructor(e) { - super(e); - const { dict: t, xref: i } = e; - this.data.annotationType = N; + constructor(params) { + super(params); + const { dict, xref } = params; + this.data.annotationType = AnnotationType.LINE; this.data.hasOwnCanvas = this.data.noRotate; - this.data.noHTML = !1; - const a = lookupRect(t.getArray("L"), [0, 0, 0, 0]); - this.data.lineCoordinates = Util.normalizeRect(a); - this.setLineEndings(t.getArray("LE")); + this.data.noHTML = false; + const lineCoordinates = lookupRect(dict.getArray("L"), [0, 0, 0, 0]); + this.data.lineCoordinates = Util.normalizeRect(lineCoordinates); + this.setLineEndings(dict.getArray("LE")); this.data.lineEndings = this.lineEndings; if (!this.appearance) { - const e = this.color ? getPdfColorArray(this.color) : [0, 0, 0], - s = t.get("CA"), - r = getRgbColor(t.getArray("IC"), null), - n = r ? getPdfColorArray(r) : null, - g = n ? s : null, - o = this.borderStyle.width || 1, - c = 2 * o, - C = [ - this.data.lineCoordinates[0] - c, - this.data.lineCoordinates[1] - c, - this.data.lineCoordinates[2] + c, - this.data.lineCoordinates[3] + c, - ]; - Util.intersect(this.rectangle, C) || (this.rectangle = C); + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + const interiorColor = getRgbColor(dict.getArray("IC"), null); + const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null; + const fillAlpha = fillColor ? strokeAlpha : null; + const borderWidth = this.borderStyle.width || 1, + borderAdjust = 2 * borderWidth; + const bbox = [ + this.data.lineCoordinates[0] - borderAdjust, + this.data.lineCoordinates[1] - borderAdjust, + this.data.lineCoordinates[2] + borderAdjust, + this.data.lineCoordinates[3] + borderAdjust, + ]; + if (!Util.intersect(this.rectangle, bbox)) { + this.rectangle = bbox; + } this._setDefaultAppearance({ - xref: i, - extra: `${o} w`, - strokeColor: e, - fillColor: n, - strokeAlpha: s, - fillAlpha: g, - pointsCallback: (e, t) => { - e.push(`${a[0]} ${a[1]} m`, `${a[2]} ${a[3]} l`, "S"); - return [t[0] - o, t[2] + o, t[7] - o, t[3] + o]; + xref, + extra: `${borderWidth} w`, + strokeColor, + fillColor, + strokeAlpha, + fillAlpha, + pointsCallback: (buffer, points) => { + buffer.push( + `${lineCoordinates[0]} ${lineCoordinates[1]} m`, + `${lineCoordinates[2]} ${lineCoordinates[3]} l`, + "S", + ); + return [ + points[0] - borderWidth, + points[2] + borderWidth, + points[7] - borderWidth, + points[3] + borderWidth, + ]; }, }); } } } class SquareAnnotation extends MarkupAnnotation { - constructor(e) { - super(e); - const { dict: t, xref: i } = e; - this.data.annotationType = G; + constructor(params) { + super(params); + const { dict, xref } = params; + this.data.annotationType = AnnotationType.SQUARE; this.data.hasOwnCanvas = this.data.noRotate; - this.data.noHTML = !1; + this.data.noHTML = false; if (!this.appearance) { - const e = this.color ? getPdfColorArray(this.color) : [0, 0, 0], - a = t.get("CA"), - s = getRgbColor(t.getArray("IC"), null), - r = s ? getPdfColorArray(s) : null, - n = r ? a : null; - if (0 === this.borderStyle.width && !r) return; + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + const interiorColor = getRgbColor(dict.getArray("IC"), null); + const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null; + const fillAlpha = fillColor ? strokeAlpha : null; + if (this.borderStyle.width === 0 && !fillColor) { + return; + } this._setDefaultAppearance({ - xref: i, + xref, extra: `${this.borderStyle.width} w`, - strokeColor: e, - fillColor: r, - strokeAlpha: a, - fillAlpha: n, - pointsCallback: (e, t) => { - const i = t[4] + this.borderStyle.width / 2, - a = t[5] + this.borderStyle.width / 2, - s = t[6] - t[4] - this.borderStyle.width, - n = t[3] - t[7] - this.borderStyle.width; - e.push(`${i} ${a} ${s} ${n} re`); - r ? e.push("B") : e.push("S"); - return [t[0], t[2], t[7], t[3]]; + strokeColor, + fillColor, + strokeAlpha, + fillAlpha, + pointsCallback: (buffer, points) => { + const x = points[4] + this.borderStyle.width / 2; + const y = points[5] + this.borderStyle.width / 2; + const width = points[6] - points[4] - this.borderStyle.width; + const height = points[3] - points[7] - this.borderStyle.width; + buffer.push(`${x} ${y} ${width} ${height} re`); + if (fillColor) { + buffer.push("B"); + } else { + buffer.push("S"); + } + return [points[0], points[2], points[7], points[3]]; }, }); } } } class CircleAnnotation extends MarkupAnnotation { - constructor(e) { - super(e); - const { dict: t, xref: i } = e; - this.data.annotationType = x; + constructor(params) { + super(params); + const { dict, xref } = params; + this.data.annotationType = AnnotationType.CIRCLE; if (!this.appearance) { - const e = this.color ? getPdfColorArray(this.color) : [0, 0, 0], - a = t.get("CA"), - s = getRgbColor(t.getArray("IC"), null), - r = s ? getPdfColorArray(s) : null, - n = r ? a : null; - if (0 === this.borderStyle.width && !r) return; - const g = (4 / 3) * Math.tan(Math.PI / 8); + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + const interiorColor = getRgbColor(dict.getArray("IC"), null); + const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null; + const fillAlpha = fillColor ? strokeAlpha : null; + if (this.borderStyle.width === 0 && !fillColor) { + return; + } + const controlPointsDistance = (4 / 3) * Math.tan(Math.PI / (2 * 4)); this._setDefaultAppearance({ - xref: i, + xref, extra: `${this.borderStyle.width} w`, - strokeColor: e, - fillColor: r, - strokeAlpha: a, - fillAlpha: n, - pointsCallback: (e, t) => { - const i = t[0] + this.borderStyle.width / 2, - a = t[1] - this.borderStyle.width / 2, - s = t[6] - this.borderStyle.width / 2, - n = t[7] + this.borderStyle.width / 2, - o = i + (s - i) / 2, - c = a + (n - a) / 2, - C = ((s - i) / 2) * g, - h = ((n - a) / 2) * g; - e.push( - `${o} ${n} m`, - `${o + C} ${n} ${s} ${c + h} ${s} ${c} c`, - `${s} ${c - h} ${o + C} ${a} ${o} ${a} c`, - `${o - C} ${a} ${i} ${c - h} ${i} ${c} c`, - `${i} ${c + h} ${o - C} ${n} ${o} ${n} c`, + strokeColor, + fillColor, + strokeAlpha, + fillAlpha, + pointsCallback: (buffer, points) => { + const x0 = points[0] + this.borderStyle.width / 2; + const y0 = points[1] - this.borderStyle.width / 2; + const x1 = points[6] - this.borderStyle.width / 2; + const y1 = points[7] + this.borderStyle.width / 2; + const xMid = x0 + (x1 - x0) / 2; + const yMid = y0 + (y1 - y0) / 2; + const xOffset = ((x1 - x0) / 2) * controlPointsDistance; + const yOffset = ((y1 - y0) / 2) * controlPointsDistance; + buffer.push( + `${xMid} ${y1} m`, + `${xMid + xOffset} ${y1} ${x1} ${yMid + yOffset} ${x1} ${yMid} c`, + `${x1} ${yMid - yOffset} ${xMid + xOffset} ${y0} ${xMid} ${y0} c`, + `${xMid - xOffset} ${y0} ${x0} ${yMid - yOffset} ${x0} ${yMid} c`, + `${x0} ${yMid + yOffset} ${xMid - xOffset} ${y1} ${xMid} ${y1} c`, "h", ); - r ? e.push("B") : e.push("S"); - return [t[0], t[2], t[7], t[3]]; + if (fillColor) { + buffer.push("B"); + } else { + buffer.push("S"); + } + return [points[0], points[2], points[7], points[3]]; }, }); } } } class PolylineAnnotation extends MarkupAnnotation { - constructor(e) { - super(e); - const { dict: t, xref: i } = e; - this.data.annotationType = M; + constructor(params) { + super(params); + const { dict, xref } = params; + this.data.annotationType = AnnotationType.POLYLINE; this.data.hasOwnCanvas = this.data.noRotate; - this.data.noHTML = !1; + this.data.noHTML = false; this.data.vertices = null; if (!(this instanceof PolygonAnnotation)) { - this.setLineEndings(t.getArray("LE")); + this.setLineEndings(dict.getArray("LE")); this.data.lineEndings = this.lineEndings; } - const a = t.getArray("Vertices"); - if (!isNumberArray(a, null)) return; - const s = (this.data.vertices = Float32Array.from(a)); + const rawVertices = dict.getArray("Vertices"); + if (!isNumberArray(rawVertices, null)) { + return; + } + const vertices = (this.data.vertices = Float32Array.from(rawVertices)); if (!this.appearance) { - const e = this.color ? getPdfColorArray(this.color) : [0, 0, 0], - a = t.get("CA"), - r = this.borderStyle.width || 1, - n = 2 * r, - g = [1 / 0, 1 / 0, -1 / 0, -1 / 0]; - for (let e = 0, t = s.length; e < t; e += 2) { - g[0] = Math.min(g[0], s[e] - n); - g[1] = Math.min(g[1], s[e + 1] - n); - g[2] = Math.max(g[2], s[e] + n); - g[3] = Math.max(g[3], s[e + 1] + n); + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + const borderWidth = this.borderStyle.width || 1, + borderAdjust = 2 * borderWidth; + const bbox = [Infinity, Infinity, -Infinity, -Infinity]; + for (let i = 0, ii = vertices.length; i < ii; i += 2) { + bbox[0] = Math.min(bbox[0], vertices[i] - borderAdjust); + bbox[1] = Math.min(bbox[1], vertices[i + 1] - borderAdjust); + bbox[2] = Math.max(bbox[2], vertices[i] + borderAdjust); + bbox[3] = Math.max(bbox[3], vertices[i + 1] + borderAdjust); + } + if (!Util.intersect(this.rectangle, bbox)) { + this.rectangle = bbox; } - Util.intersect(this.rectangle, g) || (this.rectangle = g); this._setDefaultAppearance({ - xref: i, - extra: `${r} w`, - strokeColor: e, - strokeAlpha: a, - pointsCallback: (e, t) => { - for (let t = 0, i = s.length; t < i; t += 2) - e.push(`${s[t]} ${s[t + 1]} ${0 === t ? "m" : "l"}`); - e.push("S"); - return [t[0], t[2], t[7], t[3]]; + xref, + extra: `${borderWidth} w`, + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + for (let i = 0, ii = vertices.length; i < ii; i += 2) { + buffer.push( + `${vertices[i]} ${vertices[i + 1]} ${i === 0 ? "m" : "l"}`, + ); + } + buffer.push("S"); + return [points[0], points[2], points[7], points[3]]; }, }); } } } class PolygonAnnotation extends PolylineAnnotation { - constructor(e) { - super(e); - this.data.annotationType = U; + constructor(params) { + super(params); + this.data.annotationType = AnnotationType.POLYGON; } } class CaretAnnotation extends MarkupAnnotation { - constructor(e) { - super(e); - this.data.annotationType = K; + constructor(params) { + super(params); + this.data.annotationType = AnnotationType.CARET; } } class InkAnnotation extends MarkupAnnotation { - constructor(e) { - super(e); + constructor(params) { + super(params); this.data.hasOwnCanvas = this.data.noRotate; - this.data.noHTML = !1; - const { dict: t, xref: i } = e; - this.data.annotationType = T; + this.data.noHTML = false; + const { dict, xref } = params; + this.data.annotationType = AnnotationType.INK; this.data.inkLists = []; - const a = t.getArray("InkList"); - if (Array.isArray(a)) { - for (let e = 0, t = a.length; e < t; ++e) { - if (!Array.isArray(a[e])) continue; - const t = new Float32Array(a[e].length); - this.data.inkLists.push(t); - for (let s = 0, r = a[e].length; s < r; s += 2) { - const r = i.fetchIfRef(a[e][s]), - n = i.fetchIfRef(a[e][s + 1]); - if ("number" == typeof r && "number" == typeof n) { - t[s] = r; - t[s + 1] = n; - } + this.data.isEditable = !this.data.noHTML && this.data.it === "InkHighlight"; + this.data.noHTML = false; + this.data.opacity = dict.get("CA") || 1; + const rawInkLists = dict.getArray("InkList"); + if (!Array.isArray(rawInkLists)) { + return; + } + for (let i = 0, ii = rawInkLists.length; i < ii; ++i) { + if (!Array.isArray(rawInkLists[i])) { + continue; + } + const inkList = new Float32Array(rawInkLists[i].length); + this.data.inkLists.push(inkList); + for (let j = 0, jj = rawInkLists[i].length; j < jj; j += 2) { + const x = xref.fetchIfRef(rawInkLists[i][j]), + y = xref.fetchIfRef(rawInkLists[i][j + 1]); + if (typeof x === "number" && typeof y === "number") { + inkList[j] = x; + inkList[j + 1] = y; } } - if (!this.appearance) { - const e = this.color ? getPdfColorArray(this.color) : [0, 0, 0], - a = t.get("CA"), - s = this.borderStyle.width || 1, - r = 2 * s, - n = [1 / 0, 1 / 0, -1 / 0, -1 / 0]; - for (const e of this.data.inkLists) - for (let t = 0, i = e.length; t < i; t += 2) { - n[0] = Math.min(n[0], e[t] - r); - n[1] = Math.min(n[1], e[t + 1] - r); - n[2] = Math.max(n[2], e[t] + r); - n[3] = Math.max(n[3], e[t + 1] + r); - } - Util.intersect(this.rectangle, n) || (this.rectangle = n); - this._setDefaultAppearance({ - xref: i, - extra: `${s} w`, - strokeColor: e, - strokeAlpha: a, - pointsCallback: (e, t) => { - for (const t of this.data.inkLists) { - for (let i = 0, a = t.length; i < a; i += 2) - e.push(`${t[i]} ${t[i + 1]} ${0 === i ? "m" : "l"}`); - e.push("S"); - } - return [t[0], t[2], t[7], t[3]]; - }, - }); + } + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + const borderWidth = this.borderStyle.width || 1, + borderAdjust = 2 * borderWidth; + const bbox = [Infinity, Infinity, -Infinity, -Infinity]; + for (const inkList of this.data.inkLists) { + for (let i = 0, ii = inkList.length; i < ii; i += 2) { + bbox[0] = Math.min(bbox[0], inkList[i] - borderAdjust); + bbox[1] = Math.min(bbox[1], inkList[i + 1] - borderAdjust); + bbox[2] = Math.max(bbox[2], inkList[i] + borderAdjust); + bbox[3] = Math.max(bbox[3], inkList[i + 1] + borderAdjust); + } } + if (!Util.intersect(this.rectangle, bbox)) { + this.rectangle = bbox; + } + this._setDefaultAppearance({ + xref, + extra: `${borderWidth} w`, + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + for (const inkList of this.data.inkLists) { + for (let i = 0, ii = inkList.length; i < ii; i += 2) { + buffer.push( + `${inkList[i]} ${inkList[i + 1]} ${i === 0 ? "m" : "l"}`, + ); + } + buffer.push("S"); + } + return [points[0], points[2], points[7], points[3]]; + }, + }); } } - static createNewDict(e, t, { apRef: i, ap: a }) { - const { - color: s, - opacity: r, - paths: n, - outlines: g, - rect: o, - rotation: c, - thickness: C, - } = e, - h = new Dict(t); - h.set("Type", Name.get("Annot")); - h.set("Subtype", Name.get("Ink")); - h.set("CreationDate", `D:${getModificationDate()}`); - h.set("Rect", o); - h.set("InkList", g?.points || n.map((e) => e.points)); - h.set("F", 4); - h.set("Rotate", c); - g && h.set("IT", Name.get("InkHighlight")); - const l = new Dict(t); - h.set("BS", l); - l.set("W", C); - h.set( + static createNewDict(annotation, xref, { apRef, ap }) { + const { color, opacity, paths, outlines, rect, rotation, thickness } = + annotation; + const ink = new Dict(xref); + ink.set("Type", Name.get("Annot")); + ink.set("Subtype", Name.get("Ink")); + ink.set("CreationDate", `D:${getModificationDate()}`); + ink.set("Rect", rect); + ink.set("InkList", outlines?.points || paths.map((p) => p.points)); + ink.set("F", 4); + ink.set("Rotate", rotation); + if (outlines) { + ink.set("IT", Name.get("InkHighlight")); + } + const bs = new Dict(xref); + ink.set("BS", bs); + bs.set("W", thickness); + ink.set( "C", - Array.from(s, (e) => e / 255), + Array.from(color, (c) => c / 255), ); - h.set("CA", r); - const Q = new Dict(t); - h.set("AP", Q); - i ? Q.set("N", i) : Q.set("N", a); - return h; + ink.set("CA", opacity); + const n = new Dict(xref); + ink.set("AP", n); + if (apRef) { + n.set("N", apRef); + } else { + n.set("N", ap); + } + return ink; } - static async createNewAppearanceStream(e, t, i) { - if (e.outlines) return this.createNewAppearanceStreamForHighlight(e, t, i); - const { color: a, rect: s, paths: r, thickness: n, opacity: g } = e, - o = [`${n} w 1 J 1 j`, `${getPdfColor(a, !1)}`]; - 1 !== g && o.push("/R0 gs"); - const c = []; - for (const { bezier: e } of r) { - c.length = 0; - c.push(`${numberToString(e[0])} ${numberToString(e[1])} m`); - if (2 === e.length) - c.push(`${numberToString(e[0])} ${numberToString(e[1])} l S`); - else { - for (let t = 2, i = e.length; t < i; t += 6) { - const i = e - .slice(t, t + 6) + static async createNewAppearanceStream(annotation, xref, params) { + if (annotation.outlines) { + return this.createNewAppearanceStreamForHighlight( + annotation, + xref, + params, + ); + } + const { color, rect, paths, thickness, opacity } = annotation; + const appearanceBuffer = [ + `${thickness} w 1 J 1 j`, + `${getPdfColor(color, false)}`, + ]; + if (opacity !== 1) { + appearanceBuffer.push("/R0 gs"); + } + const buffer = []; + for (const { bezier } of paths) { + buffer.length = 0; + buffer.push( + `${numberToString(bezier[0])} ${numberToString(bezier[1])} m`, + ); + if (bezier.length === 2) { + buffer.push( + `${numberToString(bezier[0])} ${numberToString(bezier[1])} l S`, + ); + } else { + for (let i = 2, ii = bezier.length; i < ii; i += 6) { + const curve = bezier + .slice(i, i + 6) .map(numberToString) .join(" "); - c.push(`${i} c`); + buffer.push(`${curve} c`); } - c.push("S"); + buffer.push("S"); } - o.push(c.join("\n")); + appearanceBuffer.push(buffer.join("\n")); } - const C = o.join("\n"), - h = new Dict(t); - h.set("FormType", 1); - h.set("Subtype", Name.get("Form")); - h.set("Type", Name.get("XObject")); - h.set("BBox", s); - h.set("Length", C.length); - if (1 !== g) { - const e = new Dict(t), - i = new Dict(t), - a = new Dict(t); - a.set("CA", g); - a.set("Type", Name.get("ExtGState")); - i.set("R0", a); - e.set("ExtGState", i); - h.set("Resources", e); + const appearance = appearanceBuffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Length", appearance.length); + if (opacity !== 1) { + const resources = new Dict(xref); + const extGState = new Dict(xref); + const r0 = new Dict(xref); + r0.set("CA", opacity); + r0.set("Type", Name.get("ExtGState")); + extGState.set("R0", r0); + resources.set("ExtGState", extGState); + appearanceStreamDict.set("Resources", resources); } - const l = new StringStream(C); - l.dict = h; - return l; + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; } - static async createNewAppearanceStreamForHighlight(e, t, i) { + static async createNewAppearanceStreamForHighlight(annotation, xref, params) { const { - color: a, - rect: s, - outlines: { outline: r }, - opacity: n, - } = e, - g = [`${getPdfColor(a, !0)}`, "/R0 gs"]; - g.push(`${numberToString(r[4])} ${numberToString(r[5])} m`); - for (let e = 6, t = r.length; e < t; e += 6) - if (isNaN(r[e]) || null === r[e]) - g.push(`${numberToString(r[e + 4])} ${numberToString(r[e + 5])} l`); - else { - const t = r - .slice(e, e + 6) + color, + rect, + outlines: { outline }, + opacity, + } = annotation; + const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"]; + appearanceBuffer.push( + `${numberToString(outline[4])} ${numberToString(outline[5])} m`, + ); + for (let i = 6, ii = outline.length; i < ii; i += 6) { + if (isNaN(outline[i]) || outline[i] === null) { + appearanceBuffer.push( + `${numberToString(outline[i + 4])} ${numberToString(outline[i + 5])} l`, + ); + } else { + const curve = outline + .slice(i, i + 6) .map(numberToString) .join(" "); - g.push(`${t} c`); + appearanceBuffer.push(`${curve} c`); } - g.push("h f"); - const o = g.join("\n"), - c = new Dict(t); - c.set("FormType", 1); - c.set("Subtype", Name.get("Form")); - c.set("Type", Name.get("XObject")); - c.set("BBox", s); - c.set("Length", o.length); - const C = new Dict(t), - h = new Dict(t); - C.set("ExtGState", h); - c.set("Resources", C); - const l = new Dict(t); - h.set("R0", l); - l.set("BM", Name.get("Multiply")); - if (1 !== n) { - l.set("ca", n); - l.set("Type", Name.get("ExtGState")); } - const Q = new StringStream(o); - Q.dict = c; - return Q; + appearanceBuffer.push("h f"); + const appearance = appearanceBuffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Length", appearance.length); + const resources = new Dict(xref); + const extGState = new Dict(xref); + resources.set("ExtGState", extGState); + appearanceStreamDict.set("Resources", resources); + const r0 = new Dict(xref); + extGState.set("R0", r0); + r0.set("BM", Name.get("Multiply")); + if (opacity !== 1) { + r0.set("ca", opacity); + r0.set("Type", Name.get("ExtGState")); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; } } class HighlightAnnotation extends MarkupAnnotation { - constructor(e) { - super(e); - const { dict: t, xref: i } = e; - this.data.annotationType = L; - if ((this.data.quadPoints = getQuadPoints(t, null))) { - const e = this.appearance?.dict.get("Resources"); - if (!this.appearance || !e?.has("ExtGState")) { - this.appearance && + constructor(params) { + super(params); + const { dict, xref } = params; + this.data.annotationType = AnnotationType.HIGHLIGHT; + this.data.isEditable = !this.data.noHTML; + this.data.noHTML = false; + this.data.opacity = dict.get("CA") || 1; + const quadPoints = (this.data.quadPoints = getQuadPoints(dict, null)); + if (quadPoints) { + const resources = this.appearance?.dict.get("Resources"); + if (!this.appearance || !resources?.has("ExtGState")) { + if (this.appearance) { warn("HighlightAnnotation - ignoring built-in appearance stream."); - const e = this.color ? getPdfColorArray(this.color) : [1, 1, 0], - a = t.get("CA"); + } + const fillColor = this.color ? getPdfColorArray(this.color) : [1, 1, 0]; + const fillAlpha = dict.get("CA"); this._setDefaultAppearance({ - xref: i, - fillColor: e, + xref, + fillColor, blendMode: "Multiply", - fillAlpha: a, - pointsCallback: (e, t) => { - e.push( - `${t[0]} ${t[1]} m`, - `${t[2]} ${t[3]} l`, - `${t[6]} ${t[7]} l`, - `${t[4]} ${t[5]} l`, + fillAlpha, + pointsCallback: (buffer, points) => { + buffer.push( + `${points[0]} ${points[1]} m`, + `${points[2]} ${points[3]} l`, + `${points[6]} ${points[7]} l`, + `${points[4]} ${points[5]} l`, "f", ); - return [t[0], t[2], t[7], t[3]]; + return [points[0], points[2], points[7], points[3]]; }, }); } - } else this.data.popupRef = null; + } else { + this.data.popupRef = null; + } } - static createNewDict(e, t, { apRef: i, ap: a }) { - const { - color: s, - opacity: r, - rect: n, - rotation: g, - user: o, - quadPoints: c, - } = e, - C = new Dict(t); - C.set("Type", Name.get("Annot")); - C.set("Subtype", Name.get("Highlight")); - C.set("CreationDate", `D:${getModificationDate()}`); - C.set("Rect", n); - C.set("F", 4); - C.set("Border", [0, 0, 0]); - C.set("Rotate", g); - C.set("QuadPoints", c); - C.set( - "C", - Array.from(s, (e) => e / 255), + static createNewDict(annotation, xref, { apRef, ap }) { + const { color, oldAnnotation, opacity, rect, rotation, user, quadPoints } = + annotation; + const highlight = oldAnnotation || new Dict(xref); + highlight.set("Type", Name.get("Annot")); + highlight.set("Subtype", Name.get("Highlight")); + highlight.set( + oldAnnotation ? "M" : "CreationDate", + `D:${getModificationDate()}`, ); - C.set("CA", r); - o && C.set("T", isAscii(o) ? o : stringToUTF16String(o, !0)); - if (i || a) { - const e = new Dict(t); - C.set("AP", e); - e.set("N", i || a); + highlight.set("CreationDate", `D:${getModificationDate()}`); + highlight.set("Rect", rect); + highlight.set("F", 4); + highlight.set("Border", [0, 0, 0]); + highlight.set("Rotate", rotation); + highlight.set("QuadPoints", quadPoints); + highlight.set( + "C", + Array.from(color, (c) => c / 255), + ); + highlight.set("CA", opacity); + if (user) { + highlight.set("T", stringToAsciiOrUTF16BE(user)); } - return C; + if (apRef || ap) { + const n = new Dict(xref); + highlight.set("AP", n); + n.set("N", apRef || ap); + } + return highlight; } - static async createNewAppearanceStream(e, t, i) { - const { color: a, rect: s, outlines: r, opacity: n } = e, - g = [`${getPdfColor(a, !0)}`, "/R0 gs"], - o = []; - for (const e of r) { - o.length = 0; - o.push(`${numberToString(e[0])} ${numberToString(e[1])} m`); - for (let t = 2, i = e.length; t < i; t += 2) - o.push(`${numberToString(e[t])} ${numberToString(e[t + 1])} l`); - o.push("h"); - g.push(o.join("\n")); + static async createNewAppearanceStream(annotation, xref, params) { + const { color, rect, outlines, opacity } = annotation; + const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"]; + const buffer = []; + for (const outline of outlines) { + buffer.length = 0; + buffer.push( + `${numberToString(outline[0])} ${numberToString(outline[1])} m`, + ); + for (let i = 2, ii = outline.length; i < ii; i += 2) { + buffer.push( + `${numberToString(outline[i])} ${numberToString(outline[i + 1])} l`, + ); + } + buffer.push("h"); + appearanceBuffer.push(buffer.join("\n")); } - g.push("f*"); - const c = g.join("\n"), - C = new Dict(t); - C.set("FormType", 1); - C.set("Subtype", Name.get("Form")); - C.set("Type", Name.get("XObject")); - C.set("BBox", s); - C.set("Length", c.length); - const h = new Dict(t), - l = new Dict(t); - h.set("ExtGState", l); - C.set("Resources", h); - const Q = new Dict(t); - l.set("R0", Q); - Q.set("BM", Name.get("Multiply")); - if (1 !== n) { - Q.set("ca", n); - Q.set("Type", Name.get("ExtGState")); + appearanceBuffer.push("f*"); + const appearance = appearanceBuffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Length", appearance.length); + const resources = new Dict(xref); + const extGState = new Dict(xref); + resources.set("ExtGState", extGState); + appearanceStreamDict.set("Resources", resources); + const r0 = new Dict(xref); + extGState.set("R0", r0); + r0.set("BM", Name.get("Multiply")); + if (opacity !== 1) { + r0.set("ca", opacity); + r0.set("Type", Name.get("ExtGState")); } - const E = new StringStream(c); - E.dict = C; - return E; + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; } } class UnderlineAnnotation extends MarkupAnnotation { - constructor(e) { - super(e); - const { dict: t, xref: i } = e; - this.data.annotationType = H; - if ((this.data.quadPoints = getQuadPoints(t, null))) { + constructor(params) { + super(params); + const { dict, xref } = params; + this.data.annotationType = AnnotationType.UNDERLINE; + const quadPoints = (this.data.quadPoints = getQuadPoints(dict, null)); + if (quadPoints) { if (!this.appearance) { - const e = this.color ? getPdfColorArray(this.color) : [0, 0, 0], - a = t.get("CA"); + const strokeColor = this.color + ? getPdfColorArray(this.color) + : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); this._setDefaultAppearance({ - xref: i, + xref, extra: "[] 0 d 0.571 w", - strokeColor: e, - strokeAlpha: a, - pointsCallback: (e, t) => { - e.push(`${t[4]} ${t[5] + 1.3} m`, `${t[6]} ${t[7] + 1.3} l`, "S"); - return [t[0], t[2], t[7], t[3]]; + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + buffer.push( + `${points[4]} ${points[5] + 1.3} m`, + `${points[6]} ${points[7] + 1.3} l`, + "S", + ); + return [points[0], points[2], points[7], points[3]]; }, }); } - } else this.data.popupRef = null; + } else { + this.data.popupRef = null; + } } } class SquigglyAnnotation extends MarkupAnnotation { - constructor(e) { - super(e); - const { dict: t, xref: i } = e; - this.data.annotationType = J; - if ((this.data.quadPoints = getQuadPoints(t, null))) { + constructor(params) { + super(params); + const { dict, xref } = params; + this.data.annotationType = AnnotationType.SQUIGGLY; + const quadPoints = (this.data.quadPoints = getQuadPoints(dict, null)); + if (quadPoints) { if (!this.appearance) { - const e = this.color ? getPdfColorArray(this.color) : [0, 0, 0], - a = t.get("CA"); + const strokeColor = this.color + ? getPdfColorArray(this.color) + : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); this._setDefaultAppearance({ - xref: i, + xref, extra: "[] 0 d 1 w", - strokeColor: e, - strokeAlpha: a, - pointsCallback: (e, t) => { - const i = (t[1] - t[5]) / 6; - let a = i, - s = t[4]; - const r = t[5], - n = t[6]; - e.push(`${s} ${r + a} m`); + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + const dy = (points[1] - points[5]) / 6; + let shift = dy; + let x = points[4]; + const y = points[5]; + const xEnd = points[6]; + buffer.push(`${x} ${y + shift} m`); do { - s += 2; - a = 0 === a ? i : 0; - e.push(`${s} ${r + a} l`); - } while (s < n); - e.push("S"); - return [t[4], n, r - 2 * i, r + 2 * i]; + x += 2; + shift = shift === 0 ? dy : 0; + buffer.push(`${x} ${y + shift} l`); + } while (x < xEnd); + buffer.push("S"); + return [points[4], xEnd, y - 2 * dy, y + 2 * dy]; }, }); } - } else this.data.popupRef = null; + } else { + this.data.popupRef = null; + } } } class StrikeOutAnnotation extends MarkupAnnotation { - constructor(e) { - super(e); - const { dict: t, xref: i } = e; - this.data.annotationType = Y; - if ((this.data.quadPoints = getQuadPoints(t, null))) { + constructor(params) { + super(params); + const { dict, xref } = params; + this.data.annotationType = AnnotationType.STRIKEOUT; + const quadPoints = (this.data.quadPoints = getQuadPoints(dict, null)); + if (quadPoints) { if (!this.appearance) { - const e = this.color ? getPdfColorArray(this.color) : [0, 0, 0], - a = t.get("CA"); + const strokeColor = this.color + ? getPdfColorArray(this.color) + : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); this._setDefaultAppearance({ - xref: i, + xref, extra: "[] 0 d 1 w", - strokeColor: e, - strokeAlpha: a, - pointsCallback: (e, t) => { - e.push( - (t[0] + t[4]) / 2 + " " + (t[1] + t[5]) / 2 + " m", - (t[2] + t[6]) / 2 + " " + (t[3] + t[7]) / 2 + " l", + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + buffer.push( + `${(points[0] + points[4]) / 2} ` + + `${(points[1] + points[5]) / 2} m`, + `${(points[2] + points[6]) / 2} ` + + `${(points[3] + points[7]) / 2} l`, "S", ); - return [t[0], t[2], t[7], t[3]]; + return [points[0], points[2], points[7], points[3]]; }, }); } - } else this.data.popupRef = null; + } else { + this.data.popupRef = null; + } } } class StampAnnotation extends MarkupAnnotation { - constructor(e) { - super(e); - this.data.annotationType = v; - this.data.hasOwnCanvas = this.data.noRotate; - this.data.noHTML = !1; + #savedHasOwnCanvas; + constructor(params) { + super(params); + this.data.annotationType = AnnotationType.STAMP; + this.#savedHasOwnCanvas = this.data.hasOwnCanvas = this.data.noRotate; + this.data.isEditable = !this.data.noHTML; + this.data.noHTML = false; } - static async createImage(e, t) { - const { width: i, height: a } = e, - s = new OffscreenCanvas(i, a), - r = s.getContext("2d", { alpha: !0 }); - r.drawImage(e, 0, 0); - const n = r.getImageData(0, 0, i, a).data, - g = new Uint32Array(n.buffer), - o = g.some( - FeatureTest.isLittleEndian - ? (e) => e >>> 24 != 255 - : (e) => 255 != (255 & e), - ); - if (o) { - r.fillStyle = "white"; - r.fillRect(0, 0, i, a); - r.drawImage(e, 0, 0); + mustBeViewedWhenEditing(isEditing, modifiedIds = null) { + if (isEditing) { + if (!this.data.isEditable) { + return false; + } + this.#savedHasOwnCanvas = this.data.hasOwnCanvas; + this.data.hasOwnCanvas = true; + return true; } - const c = s - .convertToBlob({ type: "image/jpeg", quality: 1 }) - .then((e) => e.arrayBuffer()), - C = Name.get("XObject"), - h = Name.get("Image"), - l = new Dict(t); - l.set("Type", C); - l.set("Subtype", h); - l.set("BitsPerComponent", 8); - l.set("ColorSpace", Name.get("DeviceRGB")); - l.set("Filter", Name.get("DCTDecode")); - l.set("BBox", [0, 0, i, a]); - l.set("Width", i); - l.set("Height", a); - let Q = null; - if (o) { - const e = new Uint8Array(g.length); - if (FeatureTest.isLittleEndian) - for (let t = 0, i = g.length; t < i; t++) e[t] = g[t] >>> 24; - else for (let t = 0, i = g.length; t < i; t++) e[t] = 255 & g[t]; - const s = new Dict(t); - s.set("Type", C); - s.set("Subtype", h); - s.set("BitsPerComponent", 8); - s.set("ColorSpace", Name.get("DeviceGray")); - s.set("Width", i); - s.set("Height", a); - Q = new Stream(e, 0, 0, s); + this.data.hasOwnCanvas = this.#savedHasOwnCanvas; + return !modifiedIds?.has(this.data.id); + } + static async createImage(bitmap, xref) { + const { width, height } = bitmap; + const canvas = new OffscreenCanvas(width, height); + const ctx = canvas.getContext("2d", { + alpha: true, + }); + ctx.drawImage(bitmap, 0, 0); + const data = ctx.getImageData(0, 0, width, height).data; + const buf32 = new Uint32Array(data.buffer); + const hasAlpha = buf32.some( + FeatureTest.isLittleEndian + ? (x) => x >>> 24 !== 0xff + : (x) => (x & 0xff) !== 0xff, + ); + if (hasAlpha) { + ctx.fillStyle = "white"; + ctx.fillRect(0, 0, width, height); + ctx.drawImage(bitmap, 0, 0); } + const jpegBufferPromise = canvas + .convertToBlob({ + type: "image/jpeg", + quality: 1, + }) + .then((blob) => blob.arrayBuffer()); + const xobjectName = Name.get("XObject"); + const imageName = Name.get("Image"); + const image = new Dict(xref); + image.set("Type", xobjectName); + image.set("Subtype", imageName); + image.set("BitsPerComponent", 8); + image.set("ColorSpace", Name.get("DeviceRGB")); + image.set("Filter", Name.get("DCTDecode")); + image.set("BBox", [0, 0, width, height]); + image.set("Width", width); + image.set("Height", height); + let smaskStream = null; + if (hasAlpha) { + const alphaBuffer = new Uint8Array(buf32.length); + if (FeatureTest.isLittleEndian) { + for (let i = 0, ii = buf32.length; i < ii; i++) { + alphaBuffer[i] = buf32[i] >>> 24; + } + } else { + for (let i = 0, ii = buf32.length; i < ii; i++) { + alphaBuffer[i] = buf32[i] & 0xff; + } + } + const smask = new Dict(xref); + smask.set("Type", xobjectName); + smask.set("Subtype", imageName); + smask.set("BitsPerComponent", 8); + smask.set("ColorSpace", Name.get("DeviceGray")); + smask.set("Width", width); + smask.set("Height", height); + smaskStream = new Stream(alphaBuffer, 0, 0, smask); + } + const imageStream = new Stream(await jpegBufferPromise, 0, 0, image); return { - imageStream: new Stream(await c, 0, 0, l), - smaskStream: Q, - width: i, - height: a, + imageStream, + smaskStream, + width, + height, }; } - static createNewDict(e, t, { apRef: i, ap: a }) { - const { rect: s, rotation: r, user: n } = e, - g = new Dict(t); - g.set("Type", Name.get("Annot")); - g.set("Subtype", Name.get("Stamp")); - g.set("CreationDate", `D:${getModificationDate()}`); - g.set("Rect", s); - g.set("F", 4); - g.set("Border", [0, 0, 0]); - g.set("Rotate", r); - n && g.set("T", isAscii(n) ? n : stringToUTF16String(n, !0)); - if (i || a) { - const e = new Dict(t); - g.set("AP", e); - i ? e.set("N", i) : e.set("N", a); + static createNewDict(annotation, xref, { apRef, ap }) { + const { oldAnnotation, rect, rotation, user } = annotation; + const stamp = oldAnnotation || new Dict(xref); + stamp.set("Type", Name.get("Annot")); + stamp.set("Subtype", Name.get("Stamp")); + stamp.set( + oldAnnotation ? "M" : "CreationDate", + `D:${getModificationDate()}`, + ); + stamp.set("CreationDate", `D:${getModificationDate()}`); + stamp.set("Rect", rect); + stamp.set("F", 4); + stamp.set("Border", [0, 0, 0]); + stamp.set("Rotate", rotation); + if (user) { + stamp.set("T", stringToAsciiOrUTF16BE(user)); } - return g; + if (apRef || ap) { + const n = new Dict(xref); + stamp.set("AP", n); + if (apRef) { + n.set("N", apRef); + } else { + n.set("N", ap); + } + } + return stamp; } - static async createNewAppearanceStream(e, t, i) { - const { rotation: a } = e, - { imageRef: s, width: r, height: n } = i.image, - g = new Dict(t), - o = new Dict(t); - g.set("XObject", o); - o.set("Im0", s); - const c = `q ${r} 0 0 ${n} 0 0 cm /Im0 Do Q`, - C = new Dict(t); - C.set("FormType", 1); - C.set("Subtype", Name.get("Form")); - C.set("Type", Name.get("XObject")); - C.set("BBox", [0, 0, r, n]); - C.set("Resources", g); - if (a) { - const e = getRotationMatrix(a, r, n); - C.set("Matrix", e); + static async createNewAppearanceStream(annotation, xref, params) { + if (annotation.oldAnnotation) { + return null; } - const h = new StringStream(c); - h.dict = C; - return h; + const { rotation } = annotation; + const { imageRef, width, height } = params.image; + const resources = new Dict(xref); + const xobject = new Dict(xref); + resources.set("XObject", xobject); + xobject.set("Im0", imageRef); + const appearance = `q ${width} 0 0 ${height} 0 0 cm /Im0 Do Q`; + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", [0, 0, width, height]); + appearanceStreamDict.set("Resources", resources); + if (rotation) { + const matrix = getRotationMatrix(rotation, width, height); + appearanceStreamDict.set("Matrix", matrix); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; } } class FileAttachmentAnnotation extends MarkupAnnotation { - constructor(e) { - super(e); - const { dict: t, xref: i } = e, - a = new FileSpec(t.get("FS"), i); - this.data.annotationType = O; + constructor(params) { + super(params); + const { dict, xref } = params; + const file = new FileSpec(dict.get("FS"), xref); + this.data.annotationType = AnnotationType.FILEATTACHMENT; this.data.hasOwnCanvas = this.data.noRotate; - this.data.noHTML = !1; - this.data.file = a.serializable; - const s = t.get("Name"); - this.data.name = s instanceof Name ? stringToPDFString(s.name) : "PushPin"; - const r = t.get("ca"); - this.data.fillAlpha = "number" == typeof r && r >= 0 && r <= 1 ? r : null; + this.data.noHTML = false; + this.data.file = file.serializable; + const name = dict.get("Name"); + this.data.name = + name instanceof Name ? stringToPDFString(name.name) : "PushPin"; + const fillAlpha = dict.get("ca"); + this.data.fillAlpha = + typeof fillAlpha === "number" && fillAlpha >= 0 && fillAlpha <= 1 + ? fillAlpha + : null; } -} -function decodeString(e) { +} // ./src/core/dataset_reader.js + +function decodeString(str) { try { - return stringToUTF8String(e); - } catch (t) { - warn(`UTF-8 decoding failed: "${t}".`); - return e; + return stringToUTF8String(str); + } catch (ex) { + warn(`UTF-8 decoding failed: "${ex}".`); + return str; } } class DatasetXMLParser extends SimpleXMLParser { - constructor(e) { - super(e); + constructor(options) { + super(options); this.node = null; } - onEndElement(e) { - const t = super.onEndElement(e); - if (t && "xfa:datasets" === e) { - this.node = t; + onEndElement(name) { + const node = super.onEndElement(name); + if (node && name === "xfa:datasets") { + this.node = node; throw new Error("Aborting DatasetXMLParser."); } } } class DatasetReader { - constructor(e) { - if (e.datasets) - this.node = new SimpleXMLParser({ hasAttributes: !0 }).parseFromString( - e.datasets, - ).documentElement; - else { - const t = new DatasetXMLParser({ hasAttributes: !0 }); + constructor(data) { + if (data.datasets) { + this.node = new SimpleXMLParser({ + hasAttributes: true, + }).parseFromString(data.datasets).documentElement; + } else { + const parser = new DatasetXMLParser({ + hasAttributes: true, + }); try { - t.parseFromString(e["xdp:xdp"]); + parser.parseFromString(data["xdp:xdp"]); } catch {} - this.node = t.node; + this.node = parser.node; } } - getValue(e) { - if (!this.node || !e) return ""; - const t = this.node.searchNode(parseXFAPath(e), 0); - if (!t) return ""; - const i = t.firstChild; - return "value" === i?.nodeName - ? t.children.map((e) => decodeString(e.textContent)) - : decodeString(t.textContent); + getValue(path) { + if (!this.node || !path) { + return ""; + } + const node = this.node.searchNode(parseXFAPath(path), 0); + if (!node) { + return ""; + } + const first = node.firstChild; + if (first?.nodeName === "value") { + return node.children.map((child) => decodeString(child.textContent)); + } + return decodeString(node.textContent); } -} +} // ./src/core/xref.js + class XRef { - #K = null; - constructor(e, t) { - this.stream = e; - this.pdfManager = t; + #firstXRefStmPos = null; + constructor(stream, pdfManager) { + this.stream = stream; + this.pdfManager = pdfManager; this.entries = []; this._xrefStms = new Set(); this._cacheMap = new Map(); @@ -54012,25 +65554,26 @@ class XRef { this._newTemporaryRefNum = null; this._persistentRefsCache = null; } - getNewPersistentRef(e) { - null === this._newPersistentRefNum && - (this._newPersistentRefNum = this.entries.length || 1); - const t = this._newPersistentRefNum++; - this._cacheMap.set(t, e); - return Ref.get(t, 0); + getNewPersistentRef(obj) { + if (this._newPersistentRefNum === null) { + this._newPersistentRefNum = this.entries.length || 1; + } + const num = this._newPersistentRefNum++; + this._cacheMap.set(num, obj); + return Ref.get(num, 0); } getNewTemporaryRef() { - if (null === this._newTemporaryRefNum) { + if (this._newTemporaryRefNum === null) { this._newTemporaryRefNum = this.entries.length || 1; if (this._newPersistentRefNum) { this._persistentRefsCache = new Map(); for ( - let e = this._newTemporaryRefNum; - e < this._newPersistentRefNum; - e++ + let i = this._newTemporaryRefNum; + i < this._newPersistentRefNum; + i++ ) { - this._persistentRefsCache.set(e, this._cacheMap.get(e)); - this._cacheMap.delete(e); + this._persistentRefsCache.set(i, this._cacheMap.get(i)); + this._cacheMap.delete(i); } } } @@ -54038,636 +65581,849 @@ class XRef { } resetNewTemporaryRef() { this._newTemporaryRefNum = null; - if (this._persistentRefsCache) - for (const [e, t] of this._persistentRefsCache) this._cacheMap.set(e, t); + if (this._persistentRefsCache) { + for (const [num, obj] of this._persistentRefsCache) { + this._cacheMap.set(num, obj); + } + } this._persistentRefsCache = null; } - setStartXRef(e) { - this.startXRefQueue = [e]; + setStartXRef(startXRef) { + this.startXRefQueue = [startXRef]; } - parse(e = !1) { - let t, i, a; - if (e) { + parse(recoveryMode = false) { + let trailerDict; + if (!recoveryMode) { + trailerDict = this.readXRef(); + } else { warn("Indexing all PDF objects"); - t = this.indexObjects(); - } else t = this.readXRef(); - t.assignXref(this); - this.trailer = t; + trailerDict = this.indexObjects(); + } + trailerDict.assignXref(this); + this.trailer = trailerDict; + let encrypt; try { - i = t.get("Encrypt"); - } catch (e) { - if (e instanceof MissingDataException) throw e; - warn(`XRef.parse - Invalid "Encrypt" reference: "${e}".`); + encrypt = trailerDict.get("Encrypt"); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`XRef.parse - Invalid "Encrypt" reference: "${ex}".`); } - if (i instanceof Dict) { - const e = t.get("ID"), - a = e?.length ? e[0] : ""; - i.suppressEncryption = !0; - this.encrypt = new CipherTransformFactory(i, a, this.pdfManager.password); + if (encrypt instanceof Dict) { + const ids = trailerDict.get("ID"); + const fileId = ids?.length ? ids[0] : ""; + encrypt.suppressEncryption = true; + this.encrypt = new CipherTransformFactory( + encrypt, + fileId, + this.pdfManager.password, + ); } + let root; try { - a = t.get("Root"); - } catch (e) { - if (e instanceof MissingDataException) throw e; - warn(`XRef.parse - Invalid "Root" reference: "${e}".`); + root = trailerDict.get("Root"); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`XRef.parse - Invalid "Root" reference: "${ex}".`); } - if (a instanceof Dict) + if (root instanceof Dict) { try { - if (a.get("Pages") instanceof Dict) { - this.root = a; + const pages = root.get("Pages"); + if (pages instanceof Dict) { + this.root = root; return; } - } catch (e) { - if (e instanceof MissingDataException) throw e; - warn(`XRef.parse - Invalid "Pages" reference: "${e}".`); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`XRef.parse - Invalid "Pages" reference: "${ex}".`); } - if (!e) throw new XRefParseException(); + } + if (!recoveryMode) { + throw new XRefParseException(); + } throw new InvalidPDFException("Invalid Root reference."); } - processXRefTable(e) { - "tableState" in this || - (this.tableState = { + processXRefTable(parser) { + if (!("tableState" in this)) { + this.tableState = { entryNum: 0, - streamPos: e.lexer.stream.pos, - parserBuf1: e.buf1, - parserBuf2: e.buf2, - }); - if (!isCmd(this.readXRefTable(e), "trailer")) + streamPos: parser.lexer.stream.pos, + parserBuf1: parser.buf1, + parserBuf2: parser.buf2, + }; + } + const obj = this.readXRefTable(parser); + if (!isCmd(obj, "trailer")) { throw new FormatError( "Invalid XRef table: could not find trailer dictionary", ); - let t = e.getObj(); - t instanceof Dict || !t.dict || (t = t.dict); - if (!(t instanceof Dict)) + } + let dict = parser.getObj(); + if (!(dict instanceof Dict) && dict.dict) { + dict = dict.dict; + } + if (!(dict instanceof Dict)) { throw new FormatError( "Invalid XRef table: could not parse trailer dictionary", ); + } delete this.tableState; - return t; + return dict; } - readXRefTable(e) { - const t = e.lexer.stream, - i = this.tableState; - t.pos = i.streamPos; - e.buf1 = i.parserBuf1; - e.buf2 = i.parserBuf2; - let a; - for (;;) { - if (!("firstEntryNum" in i) || !("entryCount" in i)) { - if (isCmd((a = e.getObj()), "trailer")) break; - i.firstEntryNum = a; - i.entryCount = e.getObj(); + readXRefTable(parser) { + const stream = parser.lexer.stream; + const tableState = this.tableState; + stream.pos = tableState.streamPos; + parser.buf1 = tableState.parserBuf1; + parser.buf2 = tableState.parserBuf2; + let obj; + while (true) { + if (!("firstEntryNum" in tableState) || !("entryCount" in tableState)) { + if (isCmd((obj = parser.getObj()), "trailer")) { + break; + } + tableState.firstEntryNum = obj; + tableState.entryCount = parser.getObj(); } - let s = i.firstEntryNum; - const r = i.entryCount; - if (!Number.isInteger(s) || !Number.isInteger(r)) + let first = tableState.firstEntryNum; + const count = tableState.entryCount; + if (!Number.isInteger(first) || !Number.isInteger(count)) { throw new FormatError( "Invalid XRef table: wrong types in subsection header", ); - for (let a = i.entryNum; a < r; a++) { - i.streamPos = t.pos; - i.entryNum = a; - i.parserBuf1 = e.buf1; - i.parserBuf2 = e.buf2; - const n = {}; - n.offset = e.getObj(); - n.gen = e.getObj(); - const g = e.getObj(); - if (g instanceof Cmd) - switch (g.cmd) { + } + for (let i = tableState.entryNum; i < count; i++) { + tableState.streamPos = stream.pos; + tableState.entryNum = i; + tableState.parserBuf1 = parser.buf1; + tableState.parserBuf2 = parser.buf2; + const entry = {}; + entry.offset = parser.getObj(); + entry.gen = parser.getObj(); + const type = parser.getObj(); + if (type instanceof Cmd) { + switch (type.cmd) { case "f": - n.free = !0; + entry.free = true; break; case "n": - n.uncompressed = !0; + entry.uncompressed = true; + break; } + } if ( - !Number.isInteger(n.offset) || - !Number.isInteger(n.gen) || - (!n.free && !n.uncompressed) - ) - throw new FormatError(`Invalid entry in XRef subsection: ${s}, ${r}`); - 0 === a && n.free && 1 === s && (s = 0); - this.entries[a + s] || (this.entries[a + s] = n); + !Number.isInteger(entry.offset) || + !Number.isInteger(entry.gen) || + !(entry.free || entry.uncompressed) + ) { + throw new FormatError( + `Invalid entry in XRef subsection: ${first}, ${count}`, + ); + } + if (i === 0 && entry.free && first === 1) { + first = 0; + } + if (!this.entries[i + first]) { + this.entries[i + first] = entry; + } } - i.entryNum = 0; - i.streamPos = t.pos; - i.parserBuf1 = e.buf1; - i.parserBuf2 = e.buf2; - delete i.firstEntryNum; - delete i.entryCount; + tableState.entryNum = 0; + tableState.streamPos = stream.pos; + tableState.parserBuf1 = parser.buf1; + tableState.parserBuf2 = parser.buf2; + delete tableState.firstEntryNum; + delete tableState.entryCount; } - if (this.entries[0] && !this.entries[0].free) + if (this.entries[0] && !this.entries[0].free) { throw new FormatError("Invalid XRef table: unexpected first object"); - return a; + } + return obj; } - processXRefStream(e) { + processXRefStream(stream) { if (!("streamState" in this)) { - const t = e.dict, - i = t.get("W"); - let a = t.get("Index"); - a || (a = [0, t.get("Size")]); + const streamParameters = stream.dict; + const byteWidths = streamParameters.get("W"); + let range = streamParameters.get("Index"); + if (!range) { + range = [0, streamParameters.get("Size")]; + } this.streamState = { - entryRanges: a, - byteWidths: i, + entryRanges: range, + byteWidths, entryNum: 0, - streamPos: e.pos, + streamPos: stream.pos, }; } - this.readXRefStream(e); + this.readXRefStream(stream); delete this.streamState; - return e.dict; + return stream.dict; } - readXRefStream(e) { - const t = this.streamState; - e.pos = t.streamPos; - const [i, a, s] = t.byteWidths, - r = t.entryRanges; - for (; r.length > 0; ) { - const [n, g] = r; - if (!Number.isInteger(n) || !Number.isInteger(g)) - throw new FormatError(`Invalid XRef range fields: ${n}, ${g}`); - if (!Number.isInteger(i) || !Number.isInteger(a) || !Number.isInteger(s)) - throw new FormatError(`Invalid XRef entry fields length: ${n}, ${g}`); - for (let r = t.entryNum; r < g; ++r) { - t.entryNum = r; - t.streamPos = e.pos; - let g = 0, - o = 0, - c = 0; - for (let t = 0; t < i; ++t) { - const t = e.getByte(); - if (-1 === t) + readXRefStream(stream) { + const streamState = this.streamState; + stream.pos = streamState.streamPos; + const [typeFieldWidth, offsetFieldWidth, generationFieldWidth] = + streamState.byteWidths; + const entryRanges = streamState.entryRanges; + while (entryRanges.length > 0) { + const [first, n] = entryRanges; + if (!Number.isInteger(first) || !Number.isInteger(n)) { + throw new FormatError(`Invalid XRef range fields: ${first}, ${n}`); + } + if ( + !Number.isInteger(typeFieldWidth) || + !Number.isInteger(offsetFieldWidth) || + !Number.isInteger(generationFieldWidth) + ) { + throw new FormatError( + `Invalid XRef entry fields length: ${first}, ${n}`, + ); + } + for (let i = streamState.entryNum; i < n; ++i) { + streamState.entryNum = i; + streamState.streamPos = stream.pos; + let type = 0, + offset = 0, + generation = 0; + for (let j = 0; j < typeFieldWidth; ++j) { + const typeByte = stream.getByte(); + if (typeByte === -1) { throw new FormatError("Invalid XRef byteWidths 'type'."); - g = (g << 8) | t; + } + type = (type << 8) | typeByte; } - 0 === i && (g = 1); - for (let t = 0; t < a; ++t) { - const t = e.getByte(); - if (-1 === t) + if (typeFieldWidth === 0) { + type = 1; + } + for (let j = 0; j < offsetFieldWidth; ++j) { + const offsetByte = stream.getByte(); + if (offsetByte === -1) { throw new FormatError("Invalid XRef byteWidths 'offset'."); - o = (o << 8) | t; + } + offset = (offset << 8) | offsetByte; } - for (let t = 0; t < s; ++t) { - const t = e.getByte(); - if (-1 === t) + for (let j = 0; j < generationFieldWidth; ++j) { + const generationByte = stream.getByte(); + if (generationByte === -1) { throw new FormatError("Invalid XRef byteWidths 'generation'."); - c = (c << 8) | t; + } + generation = (generation << 8) | generationByte; } - const C = {}; - C.offset = o; - C.gen = c; - switch (g) { + const entry = {}; + entry.offset = offset; + entry.gen = generation; + switch (type) { case 0: - C.free = !0; + entry.free = true; break; case 1: - C.uncompressed = !0; + entry.uncompressed = true; break; case 2: break; default: - throw new FormatError(`Invalid XRef entry type: ${g}`); + throw new FormatError(`Invalid XRef entry type: ${type}`); + } + if (!this.entries[first + i]) { + this.entries[first + i] = entry; } - this.entries[n + r] || (this.entries[n + r] = C); } - t.entryNum = 0; - t.streamPos = e.pos; - r.splice(0, 2); + streamState.entryNum = 0; + streamState.streamPos = stream.pos; + entryRanges.splice(0, 2); } } indexObjects() { - function readToken(e, t) { - let i = "", - a = e[t]; - for (; 10 !== a && 13 !== a && 60 !== a && !(++t >= e.length); ) { - i += String.fromCharCode(a); - a = e[t]; + const TAB = 0x9, + LF = 0xa, + CR = 0xd, + SPACE = 0x20; + const PERCENT = 0x25, + LT = 0x3c; + function readToken(data, offset) { + let token = "", + ch = data[offset]; + while (ch !== LF && ch !== CR && ch !== LT) { + if (++offset >= data.length) { + break; + } + token += String.fromCharCode(ch); + ch = data[offset]; } - return i; + return token; } - function skipUntil(e, t, i) { - const a = i.length, - s = e.length; - let r = 0; - for (; t < s; ) { - let s = 0; - for (; s < a && e[t + s] === i[s]; ) ++s; - if (s >= a) break; - t++; - r++; + function skipUntil(data, offset, what) { + const length = what.length, + dataLength = data.length; + let skipped = 0; + while (offset < dataLength) { + let i = 0; + while (i < length && data[offset + i] === what[i]) { + ++i; + } + if (i >= length) { + break; + } + offset++; + skipped++; } - return r; + return skipped; } - const e = /\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g, - t = /\b(startxref|\d+\s+\d+\s+obj)\b/g, - i = /^(\d+)\s+(\d+)\s+obj\b/, - a = new Uint8Array([116, 114, 97, 105, 108, 101, 114]), - s = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]), - r = new Uint8Array([47, 88, 82, 101, 102]); + const gEndobjRegExp = /\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g; + const gStartxrefRegExp = /\b(startxref|\d+\s+\d+\s+obj)\b/g; + const objRegExp = /^(\d+)\s+(\d+)\s+obj\b/; + const trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]); + const startxrefBytes = new Uint8Array([ + 115, 116, 97, 114, 116, 120, 114, 101, 102, + ]); + const xrefBytes = new Uint8Array([47, 88, 82, 101, 102]); this.entries.length = 0; this._cacheMap.clear(); - const n = this.stream; - n.pos = 0; - const g = n.getBytes(), - o = bytesToString(g), - c = g.length; - let C = n.start; - const h = [], - l = []; - for (; C < c; ) { - let Q = g[C]; - if (9 === Q || 10 === Q || 13 === Q || 32 === Q) { - ++C; + const stream = this.stream; + stream.pos = 0; + const buffer = stream.getBytes(), + bufferStr = bytesToString(buffer), + length = buffer.length; + let position = stream.start; + const trailers = [], + xrefStms = []; + while (position < length) { + let ch = buffer[position]; + if (ch === TAB || ch === LF || ch === CR || ch === SPACE) { + ++position; continue; } - if (37 === Q) { + if (ch === PERCENT) { do { - ++C; - if (C >= c) break; - Q = g[C]; - } while (10 !== Q && 13 !== Q); + ++position; + if (position >= length) { + break; + } + ch = buffer[position]; + } while (ch !== LF && ch !== CR); continue; } - const E = readToken(g, C); - let u; - if (E.startsWith("xref") && (4 === E.length || /\s/.test(E[4]))) { - C += skipUntil(g, C, a); - h.push(C); - C += skipUntil(g, C, s); - } else if ((u = i.exec(E))) { - const t = 0 | u[1], - i = 0 | u[2], - a = C + E.length; - let s, - h = !1; - if (this.entries[t]) { - if (this.entries[t].gen === i) - try { - new Parser({ lexer: new Lexer(n.makeSubStream(a)) }).getObj(); - h = !0; - } catch (e) { - e instanceof ParserEOFException - ? warn(`indexObjects -- checking object (${E}): "${e}".`) - : (h = !0); - } - } else h = !0; - h && - (this.entries[t] = { offset: C - n.start, gen: i, uncompressed: !0 }); - e.lastIndex = a; - const Q = e.exec(o); - if (Q) { - s = e.lastIndex + 1 - C; - if ("endobj" !== Q[1]) { - warn( - `indexObjects: Found "${Q[1]}" inside of another "obj", caused by missing "endobj" -- trying to recover.`, - ); - s -= Q[1].length + 1; - } - } else s = c - C; - const d = g.subarray(C, C + s), - f = skipUntil(d, 0, r); - if (f < s && d[f + 5] < 64) { - l.push(C - n.start); - this._xrefStms.add(C - n.start); - } - C += s; - } else if ( - E.startsWith("trailer") && - (7 === E.length || /\s/.test(E[7])) + const token = readToken(buffer, position); + let m; + if ( + token.startsWith("xref") && + (token.length === 4 || /\s/.test(token[4])) ) { - h.push(C); - const e = C + E.length; - let i; - t.lastIndex = e; - const a = t.exec(o); - if (a) { - i = t.lastIndex + 1 - C; - if ("startxref" !== a[1]) { - warn( - `indexObjects: Found "${a[1]}" after "trailer", caused by missing "startxref" -- trying to recover.`, - ); - i -= a[1].length + 1; + position += skipUntil(buffer, position, trailerBytes); + trailers.push(position); + position += skipUntil(buffer, position, startxrefBytes); + } else if ((m = objRegExp.exec(token))) { + const num = m[1] | 0, + gen = m[2] | 0; + const startPos = position + token.length; + let contentLength, + updateEntries = false; + if (!this.entries[num]) { + updateEntries = true; + } else if (this.entries[num].gen === gen) { + try { + const parser = new Parser({ + lexer: new Lexer(stream.makeSubStream(startPos)), + }); + parser.getObj(); + updateEntries = true; + } catch (ex) { + if (ex instanceof ParserEOFException) { + warn(`indexObjects -- checking object (${token}): "${ex}".`); + } else { + updateEntries = true; + } } - } else i = c - C; - C += i; - } else C += E.length + 1; + } + if (updateEntries) { + this.entries[num] = { + offset: position - stream.start, + gen, + uncompressed: true, + }; + } + gEndobjRegExp.lastIndex = startPos; + const match = gEndobjRegExp.exec(bufferStr); + if (match) { + const endPos = gEndobjRegExp.lastIndex + 1; + contentLength = endPos - position; + if (match[1] !== "endobj") { + warn( + `indexObjects: Found "${match[1]}" inside of another "obj", ` + + 'caused by missing "endobj" -- trying to recover.', + ); + contentLength -= match[1].length + 1; + } + } else { + contentLength = length - position; + } + const content = buffer.subarray(position, position + contentLength); + const xrefTagOffset = skipUntil(content, 0, xrefBytes); + if (xrefTagOffset < contentLength && content[xrefTagOffset + 5] < 64) { + xrefStms.push(position - stream.start); + this._xrefStms.add(position - stream.start); + } + position += contentLength; + } else if ( + token.startsWith("trailer") && + (token.length === 7 || /\s/.test(token[7])) + ) { + trailers.push(position); + const startPos = position + token.length; + let contentLength; + gStartxrefRegExp.lastIndex = startPos; + const match = gStartxrefRegExp.exec(bufferStr); + if (match) { + const endPos = gStartxrefRegExp.lastIndex + 1; + contentLength = endPos - position; + if (match[1] !== "startxref") { + warn( + `indexObjects: Found "${match[1]}" after "trailer", ` + + 'caused by missing "startxref" -- trying to recover.', + ); + contentLength -= match[1].length + 1; + } + } else { + contentLength = length - position; + } + position += contentLength; + } else { + position += token.length + 1; + } } - for (const e of l) { - this.startXRefQueue.push(e); - this.readXRef(!0); + for (const xrefStm of xrefStms) { + this.startXRefQueue.push(xrefStm); + this.readXRef(true); } - const Q = []; - let E, - u, - d = !1; - for (const e of h) { - n.pos = e; - const t = new Parser({ - lexer: new Lexer(n), + const trailerDicts = []; + let isEncrypted = false; + for (const trailer of trailers) { + stream.pos = trailer; + const parser = new Parser({ + lexer: new Lexer(stream), xref: this, - allowStreams: !0, - recoveryMode: !0, + allowStreams: true, + recoveryMode: true, }); - if (!isCmd(t.getObj(), "trailer")) continue; - const i = t.getObj(); - if (i instanceof Dict) { - Q.push(i); - i.has("Encrypt") && (d = !0); - } - } - for (const e of [...Q, "genFallback", ...Q]) { - if ("genFallback" === e) { - if (!u) break; - this._generationFallback = !0; + const obj = parser.getObj(); + if (!isCmd(obj, "trailer")) { continue; } - let t = !1; + const dict = parser.getObj(); + if (!(dict instanceof Dict)) { + continue; + } + trailerDicts.push(dict); + if (dict.has("Encrypt")) { + isEncrypted = true; + } + } + let trailerDict, trailerError; + for (const dict of [...trailerDicts, "genFallback", ...trailerDicts]) { + if (dict === "genFallback") { + if (!trailerError) { + break; + } + this._generationFallback = true; + continue; + } + let validPagesDict = false; try { - const i = e.get("Root"); - if (!(i instanceof Dict)) continue; - const a = i.get("Pages"); - if (!(a instanceof Dict)) continue; - const s = a.get("Count"); - Number.isInteger(s) && (t = !0); - } catch (e) { - u = e; + const rootDict = dict.get("Root"); + if (!(rootDict instanceof Dict)) { + continue; + } + const pagesDict = rootDict.get("Pages"); + if (!(pagesDict instanceof Dict)) { + continue; + } + const pagesCount = pagesDict.get("Count"); + if (Number.isInteger(pagesCount)) { + validPagesDict = true; + } + } catch (ex) { + trailerError = ex; continue; } - if (t && (!d || e.has("Encrypt")) && e.has("ID")) return e; - E = e; + if ( + validPagesDict && + (!isEncrypted || dict.has("Encrypt")) && + dict.has("ID") + ) { + return dict; + } + trailerDict = dict; + } + if (trailerDict) { + return trailerDict; + } + if (this.topDict) { + return this.topDict; } - if (E) return E; - if (this.topDict) return this.topDict; throw new InvalidPDFException("Invalid PDF structure."); } - readXRef(e = !1) { - const t = this.stream, - i = new Set(); - for (; this.startXRefQueue.length; ) { + readXRef(recoveryMode = false) { + const stream = this.stream; + const startXRefParsedCache = new Set(); + while (this.startXRefQueue.length) { try { - const e = this.startXRefQueue[0]; - if (i.has(e)) { + const startXRef = this.startXRefQueue[0]; + if (startXRefParsedCache.has(startXRef)) { warn("readXRef - skipping XRef table since it was already parsed."); this.startXRefQueue.shift(); continue; } - i.add(e); - t.pos = e + t.start; - const a = new Parser({ - lexer: new Lexer(t), + startXRefParsedCache.add(startXRef); + stream.pos = startXRef + stream.start; + const parser = new Parser({ + lexer: new Lexer(stream), xref: this, - allowStreams: !0, + allowStreams: true, }); - let s, - r = a.getObj(); - if (isCmd(r, "xref")) { - s = this.processXRefTable(a); - this.topDict || (this.topDict = s); - r = s.get("XRefStm"); - if (Number.isInteger(r) && !this._xrefStms.has(r)) { - this._xrefStms.add(r); - this.startXRefQueue.push(r); - this.#K ??= r; + let obj = parser.getObj(); + let dict; + if (isCmd(obj, "xref")) { + dict = this.processXRefTable(parser); + if (!this.topDict) { + this.topDict = dict; + } + obj = dict.get("XRefStm"); + if (Number.isInteger(obj) && !this._xrefStms.has(obj)) { + this._xrefStms.add(obj); + this.startXRefQueue.push(obj); + this.#firstXRefStmPos ??= obj; + } + } else if (Number.isInteger(obj)) { + if ( + !Number.isInteger(parser.getObj()) || + !isCmd(parser.getObj(), "obj") || + !((obj = parser.getObj()) instanceof BaseStream) + ) { + throw new FormatError("Invalid XRef stream"); + } + dict = this.processXRefStream(obj); + if (!this.topDict) { + this.topDict = dict; + } + if (!dict) { + throw new FormatError("Failed to read XRef stream"); } } else { - if (!Number.isInteger(r)) - throw new FormatError("Invalid XRef stream header"); - if ( - !( - Number.isInteger(a.getObj()) && - isCmd(a.getObj(), "obj") && - (r = a.getObj()) instanceof BaseStream - ) - ) - throw new FormatError("Invalid XRef stream"); - s = this.processXRefStream(r); - this.topDict || (this.topDict = s); - if (!s) throw new FormatError("Failed to read XRef stream"); + throw new FormatError("Invalid XRef stream header"); + } + obj = dict.get("Prev"); + if (Number.isInteger(obj)) { + this.startXRefQueue.push(obj); + } else if (obj instanceof Ref) { + this.startXRefQueue.push(obj.num); } - r = s.get("Prev"); - Number.isInteger(r) - ? this.startXRefQueue.push(r) - : r instanceof Ref && this.startXRefQueue.push(r.num); } catch (e) { - if (e instanceof MissingDataException) throw e; + if (e instanceof MissingDataException) { + throw e; + } info("(while reading XRef): " + e); } this.startXRefQueue.shift(); } - if (this.topDict) return this.topDict; - if (!e) throw new XRefParseException(); + if (this.topDict) { + return this.topDict; + } + if (recoveryMode) { + return undefined; + } + throw new XRefParseException(); } get lastXRefStreamPos() { return ( - this.#K ?? (this._xrefStms.size > 0 ? Math.max(...this._xrefStms) : null) + this.#firstXRefStmPos ?? + (this._xrefStms.size > 0 ? Math.max(...this._xrefStms) : null) ); } - getEntry(e) { - const t = this.entries[e]; - return t && !t.free && t.offset ? t : null; + getEntry(i) { + const xrefEntry = this.entries[i]; + if (xrefEntry && !xrefEntry.free && xrefEntry.offset) { + return xrefEntry; + } + return null; } - fetchIfRef(e, t = !1) { - return e instanceof Ref ? this.fetch(e, t) : e; + fetchIfRef(obj, suppressEncryption = false) { + if (obj instanceof Ref) { + return this.fetch(obj, suppressEncryption); + } + return obj; } - fetch(e, t = !1) { - if (!(e instanceof Ref)) throw new Error("ref object is not a reference"); - const i = e.num, - a = this._cacheMap.get(i); - if (void 0 !== a) { - a instanceof Dict && !a.objId && (a.objId = e.toString()); - return a; + fetch(ref, suppressEncryption = false) { + if (!(ref instanceof Ref)) { + throw new Error("ref object is not a reference"); } - let s = this.getEntry(i); - if (null === s) { - this._cacheMap.set(i, s); - return s; + const num = ref.num; + const cacheEntry = this._cacheMap.get(num); + if (cacheEntry !== undefined) { + if (cacheEntry instanceof Dict && !cacheEntry.objId) { + cacheEntry.objId = ref.toString(); + } + return cacheEntry; } - if (this._pendingRefs.has(e)) { - this._pendingRefs.remove(e); - warn(`Ignoring circular reference: ${e}.`); - return ft; + let xrefEntry = this.getEntry(num); + if (xrefEntry === null) { + this._cacheMap.set(num, xrefEntry); + return xrefEntry; } - this._pendingRefs.put(e); + if (this._pendingRefs.has(ref)) { + this._pendingRefs.remove(ref); + warn(`Ignoring circular reference: ${ref}.`); + return CIRCULAR_REF; + } + this._pendingRefs.put(ref); try { - s = s.uncompressed - ? this.fetchUncompressed(e, s, t) - : this.fetchCompressed(e, s, t); - this._pendingRefs.remove(e); - } catch (t) { - this._pendingRefs.remove(e); - throw t; + xrefEntry = xrefEntry.uncompressed + ? this.fetchUncompressed(ref, xrefEntry, suppressEncryption) + : this.fetchCompressed(ref, xrefEntry, suppressEncryption); + this._pendingRefs.remove(ref); + } catch (ex) { + this._pendingRefs.remove(ref); + throw ex; } - s instanceof Dict - ? (s.objId = e.toString()) - : s instanceof BaseStream && (s.dict.objId = e.toString()); - return s; + if (xrefEntry instanceof Dict) { + xrefEntry.objId = ref.toString(); + } else if (xrefEntry instanceof BaseStream) { + xrefEntry.dict.objId = ref.toString(); + } + return xrefEntry; } - fetchUncompressed(e, t, i = !1) { - const a = e.gen; - let s = e.num; - if (t.gen !== a) { - const r = `Inconsistent generation in XRef: ${e}`; - if (this._generationFallback && t.gen < a) { - warn(r); - return this.fetchUncompressed(Ref.get(s, t.gen), t, i); + fetchUncompressed(ref, xrefEntry, suppressEncryption = false) { + const gen = ref.gen; + let num = ref.num; + if (xrefEntry.gen !== gen) { + const msg = `Inconsistent generation in XRef: ${ref}`; + if (this._generationFallback && xrefEntry.gen < gen) { + warn(msg); + return this.fetchUncompressed( + Ref.get(num, xrefEntry.gen), + xrefEntry, + suppressEncryption, + ); } - throw new XRefEntryException(r); + throw new XRefEntryException(msg); } - const r = this.stream.makeSubStream(t.offset + this.stream.start), - n = new Parser({ lexer: new Lexer(r), xref: this, allowStreams: !0 }), - g = n.getObj(), - o = n.getObj(), - c = n.getObj(); - if (g !== s || o !== a || !(c instanceof Cmd)) - throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${e}`); - if ("obj" !== c.cmd) { - if (c.cmd.startsWith("obj")) { - s = parseInt(c.cmd.substring(3), 10); - if (!Number.isNaN(s)) return s; + const stream = this.stream.makeSubStream( + xrefEntry.offset + this.stream.start, + ); + const parser = new Parser({ + lexer: new Lexer(stream), + xref: this, + allowStreams: true, + }); + const obj1 = parser.getObj(); + const obj2 = parser.getObj(); + const obj3 = parser.getObj(); + if (obj1 !== num || obj2 !== gen || !(obj3 instanceof Cmd)) { + throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`); + } + if (obj3.cmd !== "obj") { + if (obj3.cmd.startsWith("obj")) { + num = parseInt(obj3.cmd.substring(3), 10); + if (!Number.isNaN(num)) { + return num; + } } - throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${e}`); + throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`); } - (t = - this.encrypt && !i - ? n.getObj(this.encrypt.createCipherTransform(s, a)) - : n.getObj()) instanceof BaseStream || this._cacheMap.set(s, t); - return t; + xrefEntry = + this.encrypt && !suppressEncryption + ? parser.getObj(this.encrypt.createCipherTransform(num, gen)) + : parser.getObj(); + if (!(xrefEntry instanceof BaseStream)) { + this._cacheMap.set(num, xrefEntry); + } + return xrefEntry; } - fetchCompressed(e, t, i = !1) { - const a = t.offset, - s = this.fetch(Ref.get(a, 0)); - if (!(s instanceof BaseStream)) throw new FormatError("bad ObjStm stream"); - const r = s.dict.get("First"), - n = s.dict.get("N"); - if (!Number.isInteger(r) || !Number.isInteger(n)) + fetchCompressed(ref, xrefEntry, suppressEncryption = false) { + const tableOffset = xrefEntry.offset; + const stream = this.fetch(Ref.get(tableOffset, 0)); + if (!(stream instanceof BaseStream)) { + throw new FormatError("bad ObjStm stream"); + } + const first = stream.dict.get("First"); + const n = stream.dict.get("N"); + if (!Number.isInteger(first) || !Number.isInteger(n)) { throw new FormatError("invalid first and n parameters for ObjStm stream"); - let g = new Parser({ lexer: new Lexer(s), xref: this, allowStreams: !0 }); - const o = new Array(n), - c = new Array(n); - for (let e = 0; e < n; ++e) { - const t = g.getObj(); - if (!Number.isInteger(t)) - throw new FormatError( - `invalid object number in the ObjStm stream: ${t}`, - ); - const i = g.getObj(); - if (!Number.isInteger(i)) - throw new FormatError( - `invalid object offset in the ObjStm stream: ${i}`, - ); - o[e] = t; - c[e] = i; } - const C = (s.start || 0) + r, - h = new Array(n); - for (let e = 0; e < n; ++e) { - const t = e < n - 1 ? c[e + 1] - c[e] : void 0; - if (t < 0) throw new FormatError("Invalid offset in the ObjStm stream."); - g = new Parser({ - lexer: new Lexer(s.makeSubStream(C + c[e], t, s.dict)), + let parser = new Parser({ + lexer: new Lexer(stream), + xref: this, + allowStreams: true, + }); + const nums = new Array(n); + const offsets = new Array(n); + for (let i = 0; i < n; ++i) { + const num = parser.getObj(); + if (!Number.isInteger(num)) { + throw new FormatError( + `invalid object number in the ObjStm stream: ${num}`, + ); + } + const offset = parser.getObj(); + if (!Number.isInteger(offset)) { + throw new FormatError( + `invalid object offset in the ObjStm stream: ${offset}`, + ); + } + nums[i] = num; + offsets[i] = offset; + } + const start = (stream.start || 0) + first; + const entries = new Array(n); + for (let i = 0; i < n; ++i) { + const length = i < n - 1 ? offsets[i + 1] - offsets[i] : undefined; + if (length < 0) { + throw new FormatError("Invalid offset in the ObjStm stream."); + } + parser = new Parser({ + lexer: new Lexer( + stream.makeSubStream(start + offsets[i], length, stream.dict), + ), xref: this, - allowStreams: !0, + allowStreams: true, }); - const i = g.getObj(); - h[e] = i; - if (i instanceof BaseStream) continue; - const r = o[e], - l = this.entries[r]; - l && l.offset === a && l.gen === e && this._cacheMap.set(r, i); + const obj = parser.getObj(); + entries[i] = obj; + if (obj instanceof BaseStream) { + continue; + } + const num = nums[i], + entry = this.entries[num]; + if (entry && entry.offset === tableOffset && entry.gen === i) { + this._cacheMap.set(num, obj); + } } - if (void 0 === (t = h[t.gen])) - throw new XRefEntryException(`Bad (compressed) XRef entry: ${e}`); - return t; + xrefEntry = entries[xrefEntry.gen]; + if (xrefEntry === undefined) { + throw new XRefEntryException(`Bad (compressed) XRef entry: ${ref}`); + } + return xrefEntry; } - async fetchIfRefAsync(e, t) { - return e instanceof Ref ? this.fetchAsync(e, t) : e; + async fetchIfRefAsync(obj, suppressEncryption) { + if (obj instanceof Ref) { + return this.fetchAsync(obj, suppressEncryption); + } + return obj; } - async fetchAsync(e, t) { + async fetchAsync(ref, suppressEncryption) { try { - return this.fetch(e, t); - } catch (i) { - if (!(i instanceof MissingDataException)) throw i; - await this.pdfManager.requestRange(i.begin, i.end); - return this.fetchAsync(e, t); + return this.fetch(ref, suppressEncryption); + } catch (ex) { + if (!(ex instanceof MissingDataException)) { + throw ex; + } + await this.pdfManager.requestRange(ex.begin, ex.end); + return this.fetchAsync(ref, suppressEncryption); } } getCatalogObj() { return this.root; } -} -const sg = [0, 0, 612, 792]; +} // ./src/core/document.js + +const DEFAULT_USER_UNIT = 1.0; +const LETTER_SIZE_MEDIABOX = [0, 0, 612, 792]; class Page { constructor({ - pdfManager: e, - xref: t, - pageIndex: i, - pageDict: a, - ref: s, - globalIdFactory: r, - fontCache: n, - builtInCMapCache: g, - standardFontDataCache: o, - globalImageCache: c, - systemFontCache: C, - nonBlendModesSet: h, - xfaFactory: l, + pdfManager, + xref, + pageIndex, + pageDict, + ref, + globalIdFactory, + fontCache, + builtInCMapCache, + standardFontDataCache, + globalImageCache, + systemFontCache, + nonBlendModesSet, + xfaFactory, }) { - this.pdfManager = e; - this.pageIndex = i; - this.pageDict = a; - this.xref = t; - this.ref = s; - this.fontCache = n; - this.builtInCMapCache = g; - this.standardFontDataCache = o; - this.globalImageCache = c; - this.systemFontCache = C; - this.nonBlendModesSet = h; - this.evaluatorOptions = e.evaluatorOptions; + this.pdfManager = pdfManager; + this.pageIndex = pageIndex; + this.pageDict = pageDict; + this.xref = xref; + this.ref = ref; + this.fontCache = fontCache; + this.builtInCMapCache = builtInCMapCache; + this.standardFontDataCache = standardFontDataCache; + this.globalImageCache = globalImageCache; + this.systemFontCache = systemFontCache; + this.nonBlendModesSet = nonBlendModesSet; + this.evaluatorOptions = pdfManager.evaluatorOptions; this.resourcesPromise = null; - this.xfaFactory = l; - const Q = { obj: 0 }; - this._localIdFactory = class extends r { + this.xfaFactory = xfaFactory; + const idCounters = { + obj: 0, + }; + this._localIdFactory = class extends globalIdFactory { static createObjId() { - return `p${i}_${++Q.obj}`; + return `p${pageIndex}_${++idCounters.obj}`; } static getPageObjId() { - return `p${s.toString()}`; + return `p${ref.toString()}`; } }; } - _getInheritableProperty(e, t = !1) { - const i = getInheritableProperty({ + _getInheritableProperty(key, getArray = false) { + const value = getInheritableProperty({ dict: this.pageDict, - key: e, - getArray: t, - stopWhenFound: !1, + key, + getArray, + stopWhenFound: false, + }); + if (!Array.isArray(value)) { + return value; + } + if (value.length === 1 || !(value[0] instanceof Dict)) { + return value[0]; + } + return Dict.merge({ + xref: this.xref, + dictArray: value, }); - return Array.isArray(i) - ? 1 !== i.length && i[0] instanceof Dict - ? Dict.merge({ xref: this.xref, dictArray: i }) - : i[0] - : i; } get content() { return this.pageDict.getArray("Contents"); } get resources() { - const e = this._getInheritableProperty("Resources"); - return shadow(this, "resources", e instanceof Dict ? e : Dict.empty); + const resources = this._getInheritableProperty("Resources"); + return shadow( + this, + "resources", + resources instanceof Dict ? resources : Dict.empty, + ); } - _getBoundingBox(e) { - if (this.xfaData) return this.xfaData.bbox; - const t = lookupNormalRect(this._getInheritableProperty(e, !0), null); - if (t) { - if (t[2] - t[0] > 0 && t[3] - t[1] > 0) return t; - warn(`Empty, or invalid, /${e} entry.`); + _getBoundingBox(name) { + if (this.xfaData) { + return this.xfaData.bbox; + } + const box = lookupNormalRect( + this._getInheritableProperty(name, true), + null, + ); + if (box) { + if (box[2] - box[0] > 0 && box[3] - box[1] > 0) { + return box; + } + warn(`Empty, or invalid, /${name} entry.`); } return null; } get mediaBox() { - return shadow(this, "mediaBox", this._getBoundingBox("MediaBox") || sg); + return shadow( + this, + "mediaBox", + this._getBoundingBox("MediaBox") || LETTER_SIZE_MEDIABOX, + ); } get cropBox() { return shadow( @@ -54677,106 +66433,111 @@ class Page { ); } get userUnit() { - let e = this.pageDict.get("UserUnit"); - ("number" != typeof e || e <= 0) && (e = 1); - return shadow(this, "userUnit", e); + let obj = this.pageDict.get("UserUnit"); + if (typeof obj !== "number" || obj <= 0) { + obj = DEFAULT_USER_UNIT; + } + return shadow(this, "userUnit", obj); } get view() { - const { cropBox: e, mediaBox: t } = this; - if (e !== t && !isArrayEqual(e, t)) { - const i = Util.intersect(e, t); - if (i && i[2] - i[0] > 0 && i[3] - i[1] > 0) - return shadow(this, "view", i); + const { cropBox, mediaBox } = this; + if (cropBox !== mediaBox && !isArrayEqual(cropBox, mediaBox)) { + const box = Util.intersect(cropBox, mediaBox); + if (box && box[2] - box[0] > 0 && box[3] - box[1] > 0) { + return shadow(this, "view", box); + } warn("Empty /CropBox and /MediaBox intersection."); } - return shadow(this, "view", t); + return shadow(this, "view", mediaBox); } get rotate() { - let e = this._getInheritableProperty("Rotate") || 0; - e % 90 != 0 - ? (e = 0) - : e >= 360 - ? (e %= 360) - : e < 0 && (e = ((e % 360) + 360) % 360); - return shadow(this, "rotate", e); + let rotate = this._getInheritableProperty("Rotate") || 0; + if (rotate % 90 !== 0) { + rotate = 0; + } else if (rotate >= 360) { + rotate %= 360; + } else if (rotate < 0) { + rotate = ((rotate % 360) + 360) % 360; + } + return shadow(this, "rotate", rotate); } - _onSubStreamError(e, t) { - if (!this.evaluatorOptions.ignoreErrors) throw e; - warn(`getContentStream - ignoring sub-stream (${t}): "${e}".`); + _onSubStreamError(reason, objId) { + if (this.evaluatorOptions.ignoreErrors) { + warn(`getContentStream - ignoring sub-stream (${objId}): "${reason}".`); + return; + } + throw reason; } getContentStream() { - return this.pdfManager - .ensure(this, "content") - .then((e) => - e instanceof BaseStream - ? e - : Array.isArray(e) - ? new StreamsSequenceStream(e, this._onSubStreamError.bind(this)) - : new NullStream(), - ); + return this.pdfManager.ensure(this, "content").then((content) => { + if (content instanceof BaseStream) { + return content; + } + if (Array.isArray(content)) { + return new StreamsSequenceStream( + content, + this._onSubStreamError.bind(this), + ); + } + return new NullStream(); + }); } get xfaData() { return shadow( this, "xfaData", this.xfaFactory - ? { bbox: this.xfaFactory.getBoundingBox(this.pageIndex) } + ? { + bbox: this.xfaFactory.getBoundingBox(this.pageIndex), + } : null, ); } - #T(e, t, i) { - for (const a of e) - if (a.id) { - const e = Ref.fromString(a.id); - if (!e) { - warn(`A non-linked annotation cannot be modified: ${a.id}`); + async #replaceIdByRef(annotations, deletedAnnotations, existingAnnotations) { + const promises = []; + for (const annotation of annotations) { + if (annotation.id) { + const ref = Ref.fromString(annotation.id); + if (!ref) { + warn(`A non-linked annotation cannot be modified: ${annotation.id}`); continue; } - if (a.deleted) { - t.put(e, e); + if (annotation.deleted) { + deletedAnnotations.put(ref, ref); + if (annotation.popupRef) { + const popupRef = Ref.fromString(annotation.popupRef); + if (popupRef) { + deletedAnnotations.put(popupRef, popupRef); + } + } continue; } - i?.put(e); - a.ref = e; - delete a.id; + existingAnnotations?.put(ref); + annotation.ref = ref; + promises.push( + this.xref.fetchAsync(ref).then( + (obj) => { + if (obj instanceof Dict) { + annotation.oldAnnotation = obj.clone(); + } + }, + () => { + warn(`Cannot fetch \`oldAnnotation\` for: ${ref}.`); + }, + ), + ); + delete annotation.id; } + } + await Promise.all(promises); } - async saveNewAnnotations(e, t, i, a) { - if (this.xfaFactory) throw new Error("XFA: Cannot save new annotations."); - const s = new PartialEvaluator({ - xref: this.xref, - handler: e, - pageIndex: this.pageIndex, - idFactory: this._localIdFactory, - fontCache: this.fontCache, - builtInCMapCache: this.builtInCMapCache, - standardFontDataCache: this.standardFontDataCache, - globalImageCache: this.globalImageCache, - systemFontCache: this.systemFontCache, - options: this.evaluatorOptions, - }), - r = new RefSetCache(), - n = new RefSet(); - this.#T(i, r, n); - const g = this.pageDict, - o = this.annotations.filter((e) => !(e instanceof Ref && r.has(e))), - c = await AnnotationFactory.saveNewAnnotations(s, t, i, a); - for (const { ref: e } of c.annotations) - e instanceof Ref && !n.has(e) && o.push(e); - const C = g.get("Annots"); - g.set("Annots", o); - const h = []; - await writeObject(this.ref, g, h, this.xref); - C && g.set("Annots", C); - const l = c.dependencies; - l.push({ ref: this.ref, data: h.join("") }, ...c.annotations); - for (const e of r) l.push({ ref: e, data: null }); - return l; - } - save(e, t, i) { - const a = new PartialEvaluator({ + async saveNewAnnotations(handler, task, annotations, imagePromises) { + if (this.xfaFactory) { + throw new Error("XFA: Cannot save new annotations."); + } + const partialEvaluator = new PartialEvaluator({ xref: this.xref, - handler: e, + handler, pageIndex: this.pageIndex, idFactory: this._localIdFactory, fontCache: this.fontCache, @@ -54786,166 +66547,312 @@ class Page { systemFontCache: this.systemFontCache, options: this.evaluatorOptions, }); - return this._parsedAnnotations.then(function (e) { - const s = []; - for (const r of e) - r.mustBePrinted(i) && - s.push( - r.save(a, t, i).catch(function (e) { + const deletedAnnotations = new RefSetCache(); + const existingAnnotations = new RefSet(); + await this.#replaceIdByRef( + annotations, + deletedAnnotations, + existingAnnotations, + ); + const pageDict = this.pageDict; + const annotationsArray = this.annotations.filter( + (a) => !(a instanceof Ref && deletedAnnotations.has(a)), + ); + const newData = await AnnotationFactory.saveNewAnnotations( + partialEvaluator, + task, + annotations, + imagePromises, + ); + for (const { ref } of newData.annotations) { + if (ref instanceof Ref && !existingAnnotations.has(ref)) { + annotationsArray.push(ref); + } + } + const savedDict = pageDict.get("Annots"); + pageDict.set("Annots", annotationsArray); + const buffer = []; + await writeObject(this.ref, pageDict, buffer, this.xref); + if (savedDict) { + pageDict.set("Annots", savedDict); + } + const objects = newData.dependencies; + objects.push( + { + ref: this.ref, + data: buffer.join(""), + }, + ...newData.annotations, + ); + for (const deletedRef of deletedAnnotations) { + objects.push({ + ref: deletedRef, + data: null, + }); + } + return objects; + } + save(handler, task, annotationStorage) { + const partialEvaluator = new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: this.pageIndex, + idFactory: this._localIdFactory, + fontCache: this.fontCache, + builtInCMapCache: this.builtInCMapCache, + standardFontDataCache: this.standardFontDataCache, + globalImageCache: this.globalImageCache, + systemFontCache: this.systemFontCache, + options: this.evaluatorOptions, + }); + return this._parsedAnnotations.then(function (annotations) { + const newRefsPromises = []; + for (const annotation of annotations) { + newRefsPromises.push( + annotation + .save(partialEvaluator, task, annotationStorage) + .catch(function (reason) { warn( - `save - ignoring annotation data during "${t.name}" task: "${e}".`, + "save - ignoring annotation data during " + + `"${task.name}" task: "${reason}".`, ); return null; }), - ); - return Promise.all(s).then(function (e) { - return e.filter((e) => !!e); + ); + } + return Promise.all(newRefsPromises).then(function (newRefs) { + return newRefs.filter((newRef) => !!newRef); }); }); } - loadResources(e) { + loadResources(keys) { this.resourcesPromise ||= this.pdfManager.ensure(this, "resources"); - return this.resourcesPromise.then(() => - new ObjectLoader(this.resources, e, this.xref).load(), - ); + return this.resourcesPromise.then(() => { + const objectLoader = new ObjectLoader(this.resources, keys, this.xref); + return objectLoader.load(); + }); } getOperatorList({ - handler: e, - sink: t, - task: i, - intent: a, - cacheKey: s, - annotationStorage: r = null, + handler, + sink, + task, + intent, + cacheKey, + annotationStorage = null, + modifiedIds = null, }) { - const n = this.getContentStream(), - C = this.loadResources([ - "ColorSpace", - "ExtGState", - "Font", - "Pattern", - "Properties", - "Shading", - "XObject", - ]), - Q = new PartialEvaluator({ - xref: this.xref, - handler: e, - pageIndex: this.pageIndex, - idFactory: this._localIdFactory, - fontCache: this.fontCache, - builtInCMapCache: this.builtInCMapCache, - standardFontDataCache: this.standardFontDataCache, - globalImageCache: this.globalImageCache, - systemFontCache: this.systemFontCache, - options: this.evaluatorOptions, - }), - u = this.xfaFactory ? null : getNewAnnotationsMap(r), - d = u?.get(this.pageIndex); - let f = Promise.resolve(null), - p = null; - if (d) { - const e = this.pdfManager.ensureDoc("annotationGlobals"); - let t; - const a = new Set(); - for (const { bitmapId: e, bitmap: t } of d) - !e || t || a.has(e) || a.add(e); - const { isOffscreenCanvasSupported: s } = this.evaluatorOptions; - if (a.size > 0) { - const e = d.slice(); - for (const [t, i] of r) - t.startsWith(E) && i.bitmap && a.has(i.bitmapId) && e.push(i); - t = AnnotationFactory.generateImages(e, this.xref, s); - } else t = AnnotationFactory.generateImages(d, this.xref, s); - p = new RefSet(); - this.#T(d, p, null); - f = e.then((e) => - e ? AnnotationFactory.printNewAnnotations(e, Q, i, d, t) : null, - ); - } - const m = Promise.all([n, C]).then(([r]) => { - const n = new OperatorList(a, t); - e.send("StartRenderPage", { - transparency: Q.hasBlendModes(this.resources, this.nonBlendModesSet), - pageIndex: this.pageIndex, - cacheKey: s, - }); - return Q.getOperatorList({ - stream: r, - task: i, - resources: this.resources, - operatorList: n, - }).then(function () { - return n; - }); + const contentStreamPromise = this.getContentStream(); + const resourcesPromise = this.loadResources([ + "ColorSpace", + "ExtGState", + "Font", + "Pattern", + "Properties", + "Shading", + "XObject", + ]); + const partialEvaluator = new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: this.pageIndex, + idFactory: this._localIdFactory, + fontCache: this.fontCache, + builtInCMapCache: this.builtInCMapCache, + standardFontDataCache: this.standardFontDataCache, + globalImageCache: this.globalImageCache, + systemFontCache: this.systemFontCache, + options: this.evaluatorOptions, }); - return Promise.all([m, this._parsedAnnotations, f]).then(function ([ - e, - t, - s, - ]) { - if (s) { - t = t.filter((e) => !(e.ref && p.has(e.ref))); - for (let e = 0, i = s.length; e < i; e++) { - const a = s[e]; - if (a.refToReplace) { - const r = t.findIndex( - (e) => e.ref && isRefsEqual(e.ref, a.refToReplace), + const newAnnotsByPage = !this.xfaFactory + ? getNewAnnotationsMap(annotationStorage) + : null; + const newAnnots = newAnnotsByPage?.get(this.pageIndex); + let newAnnotationsPromise = Promise.resolve(null); + let deletedAnnotations = null; + if (newAnnots) { + const annotationGlobalsPromise = + this.pdfManager.ensureDoc("annotationGlobals"); + let imagePromises; + const missingBitmaps = new Set(); + for (const { bitmapId, bitmap } of newAnnots) { + if (bitmapId && !bitmap && !missingBitmaps.has(bitmapId)) { + missingBitmaps.add(bitmapId); + } + } + const { isOffscreenCanvasSupported } = this.evaluatorOptions; + if (missingBitmaps.size > 0) { + const annotationWithBitmaps = newAnnots.slice(); + for (const [key, annotation] of annotationStorage) { + if (!key.startsWith(AnnotationEditorPrefix)) { + continue; + } + if (annotation.bitmap && missingBitmaps.has(annotation.bitmapId)) { + annotationWithBitmaps.push(annotation); + } + } + imagePromises = AnnotationFactory.generateImages( + annotationWithBitmaps, + this.xref, + isOffscreenCanvasSupported, + ); + } else { + imagePromises = AnnotationFactory.generateImages( + newAnnots, + this.xref, + isOffscreenCanvasSupported, + ); + } + deletedAnnotations = new RefSet(); + newAnnotationsPromise = Promise.all([ + annotationGlobalsPromise, + this.#replaceIdByRef(newAnnots, deletedAnnotations, null), + ]).then(([annotationGlobals]) => { + if (!annotationGlobals) { + return null; + } + return AnnotationFactory.printNewAnnotations( + annotationGlobals, + partialEvaluator, + task, + newAnnots, + imagePromises, + ); + }); + } + const pageListPromise = Promise.all([ + contentStreamPromise, + resourcesPromise, + ]).then(([contentStream]) => { + const opList = new OperatorList(intent, sink); + handler.send("StartRenderPage", { + transparency: partialEvaluator.hasBlendModes( + this.resources, + this.nonBlendModesSet, + ), + pageIndex: this.pageIndex, + cacheKey, + }); + return partialEvaluator + .getOperatorList({ + stream: contentStream, + task, + resources: this.resources, + operatorList: opList, + }) + .then(function () { + return opList; + }); + }); + return Promise.all([ + pageListPromise, + this._parsedAnnotations, + newAnnotationsPromise, + ]).then(function ([pageOpList, annotations, newAnnotations]) { + if (newAnnotations) { + annotations = annotations.filter( + (a) => !(a.ref && deletedAnnotations.has(a.ref)), + ); + for (let i = 0, ii = newAnnotations.length; i < ii; i++) { + const newAnnotation = newAnnotations[i]; + if (newAnnotation.refToReplace) { + const j = annotations.findIndex( + (a) => a.ref && isRefsEqual(a.ref, newAnnotation.refToReplace), ); - if (r >= 0) { - t.splice(r, 1, a); - s.splice(e--, 1); - i--; + if (j >= 0) { + annotations.splice(j, 1, newAnnotation); + newAnnotations.splice(i--, 1); + ii--; } } } - t = t.concat(s); + annotations = annotations.concat(newAnnotations); } - if (0 === t.length || a & l) { - e.flush(!0); - return { length: e.totalLength }; + if ( + annotations.length === 0 || + intent & RenderingIntentFlag.ANNOTATIONS_DISABLE + ) { + pageOpList.flush(true); + return { + length: pageOpList.totalLength, + }; } - const n = !!(a & h), - C = !!(a & g), - E = !!(a & o), - u = !!(a & c), - d = []; - for (const e of t) - (C || (E && e.mustBeViewed(r, n)) || (u && e.mustBePrinted(r))) && - d.push( - e.getOperatorList(Q, i, a, n, r).catch(function (e) { - warn( - `getOperatorList - ignoring annotation data during "${i.name}" task: "${e}".`, - ); - return { opList: null, separateForm: !1, separateCanvas: !1 }; - }), + const renderForms = !!(intent & RenderingIntentFlag.ANNOTATIONS_FORMS), + isEditing = !!(intent & RenderingIntentFlag.IS_EDITING), + intentAny = !!(intent & RenderingIntentFlag.ANY), + intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY), + intentPrint = !!(intent & RenderingIntentFlag.PRINT); + const opListPromises = []; + for (const annotation of annotations) { + if ( + intentAny || + (intentDisplay && + annotation.mustBeViewed(annotationStorage, renderForms) && + annotation.mustBeViewedWhenEditing(isEditing, modifiedIds)) || + (intentPrint && annotation.mustBePrinted(annotationStorage)) + ) { + opListPromises.push( + annotation + .getOperatorList( + partialEvaluator, + task, + intent, + annotationStorage, + ) + .catch(function (reason) { + warn( + "getOperatorList - ignoring annotation data during " + + `"${task.name}" task: "${reason}".`, + ); + return { + opList: null, + separateForm: false, + separateCanvas: false, + }; + }), ); - return Promise.all(d).then(function (t) { - let i = !1, - a = !1; - for (const { opList: s, separateForm: r, separateCanvas: n } of t) { - e.addOpList(s); - i ||= r; - a ||= n; } - e.flush(!0, { form: i, canvas: a }); - return { length: e.totalLength }; + } + return Promise.all(opListPromises).then(function (opLists) { + let form = false, + canvas = false; + for (const { opList, separateForm, separateCanvas } of opLists) { + pageOpList.addOpList(opList); + form ||= separateForm; + canvas ||= separateCanvas; + } + pageOpList.flush(true, { + form, + canvas, + }); + return { + length: pageOpList.totalLength, + }; }); }); } async extractTextContent({ - handler: e, - task: t, - includeMarkedContent: i, - disableNormalization: a, - sink: s, + handler, + task, + includeMarkedContent, + disableNormalization, + sink, }) { - const r = this.getContentStream(), - n = this.loadResources(["ExtGState", "Font", "Properties", "XObject"]), - g = this.pdfManager.ensureCatalog("lang"), - [o, , c] = await Promise.all([r, n, g]); - return new PartialEvaluator({ + const contentStreamPromise = this.getContentStream(); + const resourcesPromise = this.loadResources([ + "ExtGState", + "Font", + "Properties", + "XObject", + ]); + const langPromise = this.pdfManager.ensureCatalog("lang"); + const [contentStream, , lang] = await Promise.all([ + contentStreamPromise, + resourcesPromise, + langPromise, + ]); + const partialEvaluator = new PartialEvaluator({ xref: this.xref, - handler: e, + handler, pageIndex: this.pageIndex, idFactory: this._localIdFactory, fontCache: this.fontCache, @@ -54954,45 +66861,55 @@ class Page { globalImageCache: this.globalImageCache, systemFontCache: this.systemFontCache, options: this.evaluatorOptions, - }).getTextContent({ - stream: o, - task: t, + }); + return partialEvaluator.getTextContent({ + stream: contentStream, + task, resources: this.resources, - includeMarkedContent: i, - disableNormalization: a, - sink: s, + includeMarkedContent, + disableNormalization, + sink, viewBox: this.view, - lang: c, + lang, }); } async getStructTree() { - const e = await this.pdfManager.ensureCatalog("structTreeRoot"); - if (!e) return null; + const structTreeRoot = + await this.pdfManager.ensureCatalog("structTreeRoot"); + if (!structTreeRoot) { + return null; + } await this._parsedAnnotations; - return (await this.pdfManager.ensure(this, "_parseStructTree", [e])) - .serializable; + const structTree = await this.pdfManager.ensure(this, "_parseStructTree", [ + structTreeRoot, + ]); + return this.pdfManager.ensure(structTree, "serializable"); } - _parseStructTree(e) { - const t = new StructTreePage(e, this.pageDict); - t.parse(this.ref); - return t; + _parseStructTree(structTreeRoot) { + const tree = new StructTreePage(structTreeRoot, this.pageDict); + tree.parse(this.ref); + return tree; } - async getAnnotationsData(e, t, i) { - const a = await this._parsedAnnotations; - if (0 === a.length) return a; - const s = [], - r = []; - let n; - const C = !!(i & g), - h = !!(i & o), - l = !!(i & c); - for (const i of a) { - const a = C || (h && i.viewable); - (a || (l && i.printable)) && s.push(i.data); - if (i.hasTextContent && a) { - n ||= new PartialEvaluator({ + async getAnnotationsData(handler, task, intent) { + const annotations = await this._parsedAnnotations; + if (annotations.length === 0) { + return annotations; + } + const annotationsData = [], + textContentPromises = []; + let partialEvaluator; + const intentAny = !!(intent & RenderingIntentFlag.ANY), + intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY), + intentPrint = !!(intent & RenderingIntentFlag.PRINT); + for (const annotation of annotations) { + const isVisible = intentAny || (intentDisplay && annotation.viewable); + if (isVisible || (intentPrint && annotation.printable)) { + annotationsData.push(annotation.data); + } + if (annotation.hasTextContent && isVisible) { + partialEvaluator ||= new PartialEvaluator({ xref: this.xref, - handler: e, + handler, pageIndex: this.pageIndex, idFactory: this._localIdFactory, fontCache: this.fontCache, @@ -55002,122 +66919,162 @@ class Page { systemFontCache: this.systemFontCache, options: this.evaluatorOptions, }); - r.push( - i - .extractTextContent(n, t, [-1 / 0, -1 / 0, 1 / 0, 1 / 0]) - .catch(function (e) { + textContentPromises.push( + annotation + .extractTextContent(partialEvaluator, task, [ + -Infinity, + -Infinity, + Infinity, + Infinity, + ]) + .catch(function (reason) { warn( - `getAnnotationsData - ignoring textContent during "${t.name}" task: "${e}".`, + `getAnnotationsData - ignoring textContent during "${task.name}" task: "${reason}".`, ); }), ); } } - await Promise.all(r); - return s; + await Promise.all(textContentPromises); + return annotationsData; } get annotations() { - const e = this._getInheritableProperty("Annots"); - return shadow(this, "annotations", Array.isArray(e) ? e : []); + const annots = this._getInheritableProperty("Annots"); + return shadow(this, "annotations", Array.isArray(annots) ? annots : []); } get _parsedAnnotations() { - return shadow( - this, - "_parsedAnnotations", - this.pdfManager.ensure(this, "annotations").then(async (e) => { - if (0 === e.length) return e; - const t = await this.pdfManager.ensureDoc("annotationGlobals"); - if (!t) return []; - const i = []; - for (const a of e) - i.push( + const promise = this.pdfManager + .ensure(this, "annotations") + .then(async (annots) => { + if (annots.length === 0) { + return annots; + } + const [annotationGlobals, fieldObjects] = await Promise.all([ + this.pdfManager.ensureDoc("annotationGlobals"), + this.pdfManager.ensureDoc("fieldObjects"), + ]); + if (!annotationGlobals) { + return []; + } + const orphanFields = fieldObjects?.orphanFields; + const annotationPromises = []; + for (const annotationRef of annots) { + annotationPromises.push( AnnotationFactory.create( this.xref, - a, - t, + annotationRef, + annotationGlobals, this._localIdFactory, - !1, + false, + orphanFields, this.ref, - ).catch(function (e) { - warn(`_parsedAnnotations: "${e}".`); + ).catch(function (reason) { + warn(`_parsedAnnotations: "${reason}".`); return null; }), ); - const a = []; - let s, r; - for (const e of await Promise.all(i)) - e && - (e instanceof WidgetAnnotation - ? (r ||= []).push(e) - : e instanceof PopupAnnotation - ? (s ||= []).push(e) - : a.push(e)); - r && a.push(...r); - s && a.push(...s); - return a; - }), - ); + } + const sortedAnnotations = []; + let popupAnnotations, widgetAnnotations; + for (const annotation of await Promise.all(annotationPromises)) { + if (!annotation) { + continue; + } + if (annotation instanceof WidgetAnnotation) { + (widgetAnnotations ||= []).push(annotation); + continue; + } + if (annotation instanceof PopupAnnotation) { + (popupAnnotations ||= []).push(annotation); + continue; + } + sortedAnnotations.push(annotation); + } + if (widgetAnnotations) { + sortedAnnotations.push(...widgetAnnotations); + } + if (popupAnnotations) { + sortedAnnotations.push(...popupAnnotations); + } + return sortedAnnotations; + }); + return shadow(this, "_parsedAnnotations", promise); } get jsActions() { - return shadow( - this, - "jsActions", - collectActions(this.xref, this.pageDict, fA), + const actions = collectActions( + this.xref, + this.pageDict, + PageActionEventType, ); + return shadow(this, "jsActions", actions); } } -const rg = new Uint8Array([37, 80, 68, 70, 45]), - ng = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]), - gg = new Uint8Array([101, 110, 100, 111, 98, 106]); -function find(e, t, i = 1024, a = !1) { - const s = t.length, - r = e.peekBytes(i), - n = r.length - s; - if (n <= 0) return !1; - if (a) { - const i = s - 1; - let a = r.length - 1; - for (; a >= i; ) { - let n = 0; - for (; n < s && r[a - n] === t[i - n]; ) n++; - if (n >= s) { - e.pos += a - i; - return !0; +const PDF_HEADER_SIGNATURE = new Uint8Array([0x25, 0x50, 0x44, 0x46, 0x2d]); +const STARTXREF_SIGNATURE = new Uint8Array([ + 0x73, 0x74, 0x61, 0x72, 0x74, 0x78, 0x72, 0x65, 0x66, +]); +const ENDOBJ_SIGNATURE = new Uint8Array([0x65, 0x6e, 0x64, 0x6f, 0x62, 0x6a]); +function find(stream, signature, limit = 1024, backwards = false) { + const signatureLength = signature.length; + const scanBytes = stream.peekBytes(limit); + const scanLength = scanBytes.length - signatureLength; + if (scanLength <= 0) { + return false; + } + if (backwards) { + const signatureEnd = signatureLength - 1; + let pos = scanBytes.length - 1; + while (pos >= signatureEnd) { + let j = 0; + while ( + j < signatureLength && + scanBytes[pos - j] === signature[signatureEnd - j] + ) { + j++; } - a--; + if (j >= signatureLength) { + stream.pos += pos - signatureEnd; + return true; + } + pos--; } } else { - let i = 0; - for (; i <= n; ) { - let a = 0; - for (; a < s && r[i + a] === t[a]; ) a++; - if (a >= s) { - e.pos += i; - return !0; + let pos = 0; + while (pos <= scanLength) { + let j = 0; + while (j < signatureLength && scanBytes[pos + j] === signature[j]) { + j++; } - i++; + if (j >= signatureLength) { + stream.pos += pos; + return true; + } + pos++; } } - return !1; + return false; } class PDFDocument { - constructor(e, t) { - if (t.length <= 0) + constructor(pdfManager, stream) { + if (stream.length <= 0) { throw new InvalidPDFException( "The PDF file is empty, i.e. its size is zero bytes.", ); - this.pdfManager = e; - this.stream = t; - this.xref = new XRef(t, e); + } + this.pdfManager = pdfManager; + this.stream = stream; + this.xref = new XRef(stream, pdfManager); this._pagePromises = new Map(); this._version = null; - const i = { font: 0 }; + const idCounters = { + font: 0, + }; this._globalIdFactory = class { static getDocId() { - return `g_${e.docId}`; + return `g_${pdfManager.docId}`; } static createFontId() { - return "f" + ++i.font; + return `f${++idCounters.font}`; } static createObjId() { unreachable("Abstract method `createObjId` called."); @@ -55127,320 +67084,447 @@ class PDFDocument { } }; } - parse(e) { - this.xref.parse(e); + parse(recoveryMode) { + this.xref.parse(recoveryMode); this.catalog = new Catalog(this.pdfManager, this.xref); } get linearization() { - let e = null; + let linearization = null; try { - e = Linearization.create(this.stream); - } catch (e) { - if (e instanceof MissingDataException) throw e; - info(e); + linearization = Linearization.create(this.stream); + } catch (err) { + if (err instanceof MissingDataException) { + throw err; + } + info(err); } - return shadow(this, "linearization", e); + return shadow(this, "linearization", linearization); } get startXRef() { - const e = this.stream; - let t = 0; + const stream = this.stream; + let startXRef = 0; if (this.linearization) { - e.reset(); - if (find(e, gg)) { - e.skip(6); - let i = e.peekByte(); - for (; isWhiteSpace(i); ) { - e.pos++; - i = e.peekByte(); + stream.reset(); + if (find(stream, ENDOBJ_SIGNATURE)) { + stream.skip(6); + let ch = stream.peekByte(); + while (isWhiteSpace(ch)) { + stream.pos++; + ch = stream.peekByte(); } - t = e.pos - e.start; + startXRef = stream.pos - stream.start; } } else { - const i = 1024, - a = ng.length; - let s = !1, - r = e.end; - for (; !s && r > 0; ) { - r -= i - a; - r < 0 && (r = 0); - e.pos = r; - s = find(e, ng, i, !0); - } - if (s) { - e.skip(9); - let i; - do { - i = e.getByte(); - } while (isWhiteSpace(i)); - let a = ""; - for (; i >= 32 && i <= 57; ) { - a += String.fromCharCode(i); - i = e.getByte(); + const step = 1024; + const startXRefLength = STARTXREF_SIGNATURE.length; + let found = false, + pos = stream.end; + while (!found && pos > 0) { + pos -= step - startXRefLength; + if (pos < 0) { + pos = 0; + } + stream.pos = pos; + found = find(stream, STARTXREF_SIGNATURE, step, true); + } + if (found) { + stream.skip(9); + let ch; + do { + ch = stream.getByte(); + } while (isWhiteSpace(ch)); + let str = ""; + while (ch >= 0x20 && ch <= 0x39) { + str += String.fromCharCode(ch); + ch = stream.getByte(); + } + startXRef = parseInt(str, 10); + if (isNaN(startXRef)) { + startXRef = 0; } - t = parseInt(a, 10); - isNaN(t) && (t = 0); } } - return shadow(this, "startXRef", t); + return shadow(this, "startXRef", startXRef); } checkHeader() { - const e = this.stream; - e.reset(); - if (!find(e, rg)) return; - e.moveStart(); - e.skip(rg.length); - let t, - i = ""; - for (; (t = e.getByte()) > 32 && i.length < 7; ) - i += String.fromCharCode(t); - bt.test(i) ? (this._version = i) : warn(`Invalid PDF header version: ${i}`); + const stream = this.stream; + stream.reset(); + if (!find(stream, PDF_HEADER_SIGNATURE)) { + return; + } + stream.moveStart(); + stream.skip(PDF_HEADER_SIGNATURE.length); + let version = "", + ch; + while ((ch = stream.getByte()) > 0x20 && version.length < 7) { + version += String.fromCharCode(ch); + } + if (PDF_VERSION_REGEXP.test(version)) { + this._version = version; + } else { + warn(`Invalid PDF header version: ${version}`); + } } parseStartXRef() { this.xref.setStartXRef(this.startXRef); } get numPages() { - let e = 0; - e = this.catalog.hasActualNumPages - ? this.catalog.numPages - : this.xfaFactory - ? this.xfaFactory.getNumPages() - : this.linearization - ? this.linearization.numPages - : this.catalog.numPages; - return shadow(this, "numPages", e); + let num = 0; + if (this.catalog.hasActualNumPages) { + num = this.catalog.numPages; + } else if (this.xfaFactory) { + num = this.xfaFactory.getNumPages(); + } else if (this.linearization) { + num = this.linearization.numPages; + } else { + num = this.catalog.numPages; + } + return shadow(this, "numPages", num); } - _hasOnlyDocumentSignatures(e, t = 0) { - return ( - !!Array.isArray(e) && - e.every((e) => { - if (!((e = this.xref.fetchIfRef(e)) instanceof Dict)) return !1; - if (e.has("Kids")) { - if (++t > 10) { - warn("_hasOnlyDocumentSignatures: maximum recursion depth reached"); - return !1; - } - return this._hasOnlyDocumentSignatures(e.get("Kids"), t); + _hasOnlyDocumentSignatures(fields, recursionDepth = 0) { + const RECURSION_LIMIT = 10; + if (!Array.isArray(fields)) { + return false; + } + return fields.every((field) => { + field = this.xref.fetchIfRef(field); + if (!(field instanceof Dict)) { + return false; + } + if (field.has("Kids")) { + if (++recursionDepth > RECURSION_LIMIT) { + warn("_hasOnlyDocumentSignatures: maximum recursion depth reached"); + return false; } - const i = isName(e.get("FT"), "Sig"), - a = e.get("Rect"), - s = Array.isArray(a) && a.every((e) => 0 === e); - return i && s; - }) - ); + return this._hasOnlyDocumentSignatures( + field.get("Kids"), + recursionDepth, + ); + } + const isSignature = isName(field.get("FT"), "Sig"); + const rectangle = field.get("Rect"); + const isInvisible = + Array.isArray(rectangle) && rectangle.every((value) => value === 0); + return isSignature && isInvisible; + }); } get _xfaStreams() { - const e = this.catalog.acroForm; - if (!e) return null; - const t = e.get("XFA"), - i = { - "xdp:xdp": "", - template: "", - datasets: "", - config: "", - connectionSet: "", - localeSet: "", - stylesheet: "", - "/xdp:xdp": "", - }; - if (t instanceof BaseStream && !t.isEmpty) { - i["xdp:xdp"] = t; - return i; + const acroForm = this.catalog.acroForm; + if (!acroForm) { + return null; } - if (!Array.isArray(t) || 0 === t.length) return null; - for (let e = 0, a = t.length; e < a; e += 2) { - let s; - s = 0 === e ? "xdp:xdp" : e === a - 2 ? "/xdp:xdp" : t[e]; - if (!i.hasOwnProperty(s)) continue; - const r = this.xref.fetchIfRef(t[e + 1]); - r instanceof BaseStream && !r.isEmpty && (i[s] = r); + const xfa = acroForm.get("XFA"); + const entries = { + "xdp:xdp": "", + template: "", + datasets: "", + config: "", + connectionSet: "", + localeSet: "", + stylesheet: "", + "/xdp:xdp": "", + }; + if (xfa instanceof BaseStream && !xfa.isEmpty) { + entries["xdp:xdp"] = xfa; + return entries; } - return i; + if (!Array.isArray(xfa) || xfa.length === 0) { + return null; + } + for (let i = 0, ii = xfa.length; i < ii; i += 2) { + let name; + if (i === 0) { + name = "xdp:xdp"; + } else if (i === ii - 2) { + name = "/xdp:xdp"; + } else { + name = xfa[i]; + } + if (!entries.hasOwnProperty(name)) { + continue; + } + const data = this.xref.fetchIfRef(xfa[i + 1]); + if (!(data instanceof BaseStream) || data.isEmpty) { + continue; + } + entries[name] = data; + } + return entries; } get xfaDatasets() { - const e = this._xfaStreams; - if (!e) return shadow(this, "xfaDatasets", null); - for (const t of ["datasets", "xdp:xdp"]) { - const i = e[t]; - if (i) - try { - const e = stringToUTF8String(i.getString()); - return shadow(this, "xfaDatasets", new DatasetReader({ [t]: e })); - } catch { - warn("XFA - Invalid utf-8 string."); - break; - } + const streams = this._xfaStreams; + if (!streams) { + return shadow(this, "xfaDatasets", null); + } + for (const key of ["datasets", "xdp:xdp"]) { + const stream = streams[key]; + if (!stream) { + continue; + } + try { + const str = stringToUTF8String(stream.getString()); + const data = { + [key]: str, + }; + return shadow(this, "xfaDatasets", new DatasetReader(data)); + } catch { + warn("XFA - Invalid utf-8 string."); + break; + } } return shadow(this, "xfaDatasets", null); } get xfaData() { - const e = this._xfaStreams; - if (!e) return null; - const t = Object.create(null); - for (const [i, a] of Object.entries(e)) - if (a) - try { - t[i] = stringToUTF8String(a.getString()); - } catch { - warn("XFA - Invalid utf-8 string."); - return null; - } - return t; + const streams = this._xfaStreams; + if (!streams) { + return null; + } + const data = Object.create(null); + for (const [key, stream] of Object.entries(streams)) { + if (!stream) { + continue; + } + try { + data[key] = stringToUTF8String(stream.getString()); + } catch { + warn("XFA - Invalid utf-8 string."); + return null; + } + } + return data; } get xfaFactory() { - let e; - this.pdfManager.enableXfa && + let data; + if ( + this.pdfManager.enableXfa && this.catalog.needsRendering && this.formInfo.hasXfa && - !this.formInfo.hasAcroForm && - (e = this.xfaData); - return shadow(this, "xfaFactory", e ? new XFAFactory(e) : null); + !this.formInfo.hasAcroForm + ) { + data = this.xfaData; + } + return shadow(this, "xfaFactory", data ? new XFAFactory(data) : null); } get isPureXfa() { - return !!this.xfaFactory && this.xfaFactory.isValid(); + return this.xfaFactory ? this.xfaFactory.isValid() : false; } get htmlForXfa() { return this.xfaFactory ? this.xfaFactory.getPages() : null; } async loadXfaImages() { - const e = await this.pdfManager.ensureCatalog("xfaImages"); - if (!e) return; - const t = e.getKeys(), - i = new ObjectLoader(e, t, this.xref); - await i.load(); - const a = new Map(); - for (const i of t) { - const t = e.get(i); - t instanceof BaseStream && a.set(i, t.getBytes()); + const xfaImagesDict = await this.pdfManager.ensureCatalog("xfaImages"); + if (!xfaImagesDict) { + return; } - this.xfaFactory.setImages(a); + const keys = xfaImagesDict.getKeys(); + const objectLoader = new ObjectLoader(xfaImagesDict, keys, this.xref); + await objectLoader.load(); + const xfaImages = new Map(); + for (const key of keys) { + const stream = xfaImagesDict.get(key); + if (stream instanceof BaseStream) { + xfaImages.set(key, stream.getBytes()); + } + } + this.xfaFactory.setImages(xfaImages); } - async loadXfaFonts(e, t) { - const i = await this.pdfManager.ensureCatalog("acroForm"); - if (!i) return; - const a = await i.getAsync("DR"); - if (!(a instanceof Dict)) return; - const s = new ObjectLoader(a, ["Font"], this.xref); - await s.load(); - const r = a.get("Font"); - if (!(r instanceof Dict)) return; - const n = Object.assign( + async loadXfaFonts(handler, task) { + const acroForm = await this.pdfManager.ensureCatalog("acroForm"); + if (!acroForm) { + return; + } + const resources = await acroForm.getAsync("DR"); + if (!(resources instanceof Dict)) { + return; + } + const objectLoader = new ObjectLoader(resources, ["Font"], this.xref); + await objectLoader.load(); + const fontRes = resources.get("Font"); + if (!(fontRes instanceof Dict)) { + return; + } + const options = Object.assign( Object.create(null), this.pdfManager.evaluatorOptions, ); - n.useSystemFonts = !1; - const g = new PartialEvaluator({ - xref: this.xref, - handler: e, - pageIndex: -1, - idFactory: this._globalIdFactory, - fontCache: this.catalog.fontCache, - builtInCMapCache: this.catalog.builtInCMapCache, - standardFontDataCache: this.catalog.standardFontDataCache, - options: n, - }), - o = new OperatorList(), - c = [], - C = { - get font() { - return c.at(-1); - }, - set font(e) { - c.push(e); - }, - clone() { - return this; - }, - }, - h = new Map(); - r.forEach((e, t) => { - h.set(e, t); + options.useSystemFonts = false; + const partialEvaluator = new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: -1, + idFactory: this._globalIdFactory, + fontCache: this.catalog.fontCache, + builtInCMapCache: this.catalog.builtInCMapCache, + standardFontDataCache: this.catalog.standardFontDataCache, + options, }); - const l = []; - for (const [e, i] of h) { - const s = i.get("FontDescriptor"); - if (!(s instanceof Dict)) continue; - let r = s.get("FontFamily"); - r = r.replaceAll(/[ ]+(\d)/g, "$1"); - const n = { - fontFamily: r, - fontWeight: s.get("FontWeight"), - italicAngle: -s.get("ItalicAngle"), + const operatorList = new OperatorList(); + const pdfFonts = []; + const initialState = { + get font() { + return pdfFonts.at(-1); + }, + set font(font) { + pdfFonts.push(font); + }, + clone() { + return this; + }, + }; + const fonts = new Map(); + fontRes.forEach((fontName, font) => { + fonts.set(fontName, font); + }); + const promises = []; + for (const [fontName, font] of fonts) { + const descriptor = font.get("FontDescriptor"); + if (!(descriptor instanceof Dict)) { + continue; + } + let fontFamily = descriptor.get("FontFamily"); + fontFamily = fontFamily.replaceAll(/[ ]+(\d)/g, "$1"); + const fontWeight = descriptor.get("FontWeight"); + const italicAngle = -descriptor.get("ItalicAngle"); + const cssFontInfo = { + fontFamily, + fontWeight, + italicAngle, }; - validateCSSFont(n) && - l.push( - g - .handleSetFont(a, [Name.get(e), 1], null, o, t, C, null, n) - .catch(function (e) { - warn(`loadXfaFonts: "${e}".`); + if (!validateCSSFont(cssFontInfo)) { + continue; + } + promises.push( + partialEvaluator + .handleSetFont( + resources, + [Name.get(fontName), 1], + null, + operatorList, + task, + initialState, + null, + cssFontInfo, + ) + .catch(function (reason) { + warn(`loadXfaFonts: "${reason}".`); + return null; + }), + ); + } + await Promise.all(promises); + const missingFonts = this.xfaFactory.setFonts(pdfFonts); + if (!missingFonts) { + return; + } + options.ignoreErrors = true; + promises.length = 0; + pdfFonts.length = 0; + const reallyMissingFonts = new Set(); + for (const missing of missingFonts) { + if (!getXfaFontName(`${missing}-Regular`)) { + reallyMissingFonts.add(missing); + } + } + if (reallyMissingFonts.size) { + missingFonts.push("PdfJS-Fallback"); + } + for (const missing of missingFonts) { + if (reallyMissingFonts.has(missing)) { + continue; + } + for (const fontInfo of [ + { + name: "Regular", + fontWeight: 400, + italicAngle: 0, + }, + { + name: "Bold", + fontWeight: 700, + italicAngle: 0, + }, + { + name: "Italic", + fontWeight: 400, + italicAngle: 12, + }, + { + name: "BoldItalic", + fontWeight: 700, + italicAngle: 12, + }, + ]) { + const name = `${missing}-${fontInfo.name}`; + const dict = getXfaFontDict(name); + promises.push( + partialEvaluator + .handleSetFont( + resources, + [Name.get(name), 1], + null, + operatorList, + task, + initialState, + dict, + { + fontFamily: missing, + fontWeight: fontInfo.fontWeight, + italicAngle: fontInfo.italicAngle, + }, + ) + .catch(function (reason) { + warn(`loadXfaFonts: "${reason}".`); return null; }), ); + } } - await Promise.all(l); - const Q = this.xfaFactory.setFonts(c); - if (!Q) return; - n.ignoreErrors = !0; - l.length = 0; - c.length = 0; - const E = new Set(); - for (const e of Q) getXfaFontName(`${e}-Regular`) || E.add(e); - E.size && Q.push("PdfJS-Fallback"); - for (const e of Q) - if (!E.has(e)) - for (const i of [ - { name: "Regular", fontWeight: 400, italicAngle: 0 }, - { name: "Bold", fontWeight: 700, italicAngle: 0 }, - { name: "Italic", fontWeight: 400, italicAngle: 12 }, - { name: "BoldItalic", fontWeight: 700, italicAngle: 12 }, - ]) { - const s = `${e}-${i.name}`, - r = getXfaFontDict(s); - l.push( - g - .handleSetFont(a, [Name.get(s), 1], null, o, t, C, r, { - fontFamily: e, - fontWeight: i.fontWeight, - italicAngle: i.italicAngle, - }) - .catch(function (e) { - warn(`loadXfaFonts: "${e}".`); - return null; - }), - ); - } - await Promise.all(l); - this.xfaFactory.appendFonts(c, E); + await Promise.all(promises); + this.xfaFactory.appendFonts(pdfFonts, reallyMissingFonts); } - async serializeXfaData(e) { - return this.xfaFactory ? this.xfaFactory.serializeData(e) : null; + async serializeXfaData(annotationStorage) { + return this.xfaFactory + ? this.xfaFactory.serializeData(annotationStorage) + : null; } get version() { return this.catalog.version || this._version; } get formInfo() { - const e = { hasFields: !1, hasAcroForm: !1, hasXfa: !1, hasSignatures: !1 }, - t = this.catalog.acroForm; - if (!t) return shadow(this, "formInfo", e); - try { - const i = t.get("Fields"), - a = Array.isArray(i) && i.length > 0; - e.hasFields = a; - const s = t.get("XFA"); - e.hasXfa = - (Array.isArray(s) && s.length > 0) || - (s instanceof BaseStream && !s.isEmpty); - const r = !!(1 & t.get("SigFlags")), - n = r && this._hasOnlyDocumentSignatures(i); - e.hasAcroForm = a && !n; - e.hasSignatures = r; - } catch (e) { - if (e instanceof MissingDataException) throw e; - warn(`Cannot fetch form information: "${e}".`); + const formInfo = { + hasFields: false, + hasAcroForm: false, + hasXfa: false, + hasSignatures: false, + }; + const acroForm = this.catalog.acroForm; + if (!acroForm) { + return shadow(this, "formInfo", formInfo); } - return shadow(this, "formInfo", e); + try { + const fields = acroForm.get("Fields"); + const hasFields = Array.isArray(fields) && fields.length > 0; + formInfo.hasFields = hasFields; + const xfa = acroForm.get("XFA"); + formInfo.hasXfa = + (Array.isArray(xfa) && xfa.length > 0) || + (xfa instanceof BaseStream && !xfa.isEmpty); + const sigFlags = acroForm.get("SigFlags"); + const hasSignatures = !!(sigFlags & 0x1); + const hasOnlyDocumentSignatures = + hasSignatures && this._hasOnlyDocumentSignatures(fields); + formInfo.hasAcroForm = hasFields && !hasOnlyDocumentSignatures; + formInfo.hasSignatures = hasSignatures; + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`Cannot fetch form information: "${ex}".`); + } + return shadow(this, "formInfo", formInfo); } get documentInfo() { - const e = { + const docInfo = { PDFFormatVersion: this.version, Language: this.catalog.lang, EncryptFilterName: this.xref.encrypt @@ -55452,17 +67536,21 @@ class PDFDocument { IsCollectionPresent: !!this.catalog.collection, IsSignaturesPresent: this.formInfo.hasSignatures, }; - let t; + let infoDict; try { - t = this.xref.trailer.get("Info"); - } catch (e) { - if (e instanceof MissingDataException) throw e; + infoDict = this.xref.trailer.get("Info"); + } catch (err) { + if (err instanceof MissingDataException) { + throw err; + } info("The document information dictionary is invalid."); } - if (!(t instanceof Dict)) return shadow(this, "documentInfo", e); - for (const i of t.getKeys()) { - const a = t.get(i); - switch (i) { + if (!(infoDict instanceof Dict)) { + return shadow(this, "documentInfo", docInfo); + } + for (const key of infoDict.getKeys()) { + const value = infoDict.get(key); + switch (key) { case "Title": case "Author": case "Subject": @@ -55471,295 +67559,396 @@ class PDFDocument { case "Producer": case "CreationDate": case "ModDate": - if ("string" == typeof a) { - e[i] = stringToPDFString(a); + if (typeof value === "string") { + docInfo[key] = stringToPDFString(value); continue; } break; case "Trapped": - if (a instanceof Name) { - e[i] = a; + if (value instanceof Name) { + docInfo[key] = value; continue; } break; default: - let t; - switch (typeof a) { + let customValue; + switch (typeof value) { case "string": - t = stringToPDFString(a); + customValue = stringToPDFString(value); break; case "number": case "boolean": - t = a; + customValue = value; break; default: - a instanceof Name && (t = a); + if (value instanceof Name) { + customValue = value; + } + break; } - if (void 0 === t) { - warn(`Bad value, for custom key "${i}", in Info: ${a}.`); + if (customValue === undefined) { + warn(`Bad value, for custom key "${key}", in Info: ${value}.`); continue; } - e.Custom || (e.Custom = Object.create(null)); - e.Custom[i] = t; + if (!docInfo.Custom) { + docInfo.Custom = Object.create(null); + } + docInfo.Custom[key] = customValue; continue; } - warn(`Bad value, for key "${i}", in Info: ${a}.`); + warn(`Bad value, for key "${key}", in Info: ${value}.`); } - return shadow(this, "documentInfo", e); + return shadow(this, "documentInfo", docInfo); } get fingerprints() { - function validate(e) { + const FINGERPRINT_FIRST_BYTES = 1024; + const EMPTY_FINGERPRINT = "\x00".repeat(16); + function validate(data) { return ( - "string" == typeof e && - e.length > 0 && - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" !== e + typeof data === "string" && + data.length === 16 && + data !== EMPTY_FINGERPRINT ); } - function hexString(e) { - const t = []; - for (const i of e) { - const e = i.toString(16); - t.push(e.padStart(2, "0")); + const id = this.xref.trailer.get("ID"); + let hashOriginal, hashModified; + if (Array.isArray(id) && validate(id[0])) { + hashOriginal = stringToBytes(id[0]); + if (id[1] !== id[0] && validate(id[1])) { + hashModified = stringToBytes(id[1]); } - return t.join(""); + } else { + hashOriginal = calculateMD5( + this.stream.getByteRange(0, FINGERPRINT_FIRST_BYTES), + 0, + FINGERPRINT_FIRST_BYTES, + ); } - const e = this.xref.trailer.get("ID"); - let t, i; - if (Array.isArray(e) && validate(e[0])) { - t = stringToBytes(e[0]); - e[1] !== e[0] && validate(e[1]) && (i = stringToBytes(e[1])); - } else t = Hs(this.stream.getByteRange(0, 1024), 0, 1024); return shadow(this, "fingerprints", [ - hexString(t), - i ? hexString(i) : null, + toHexUtil(hashOriginal), + hashModified ? toHexUtil(hashModified) : null, ]); } - async _getLinearizationPage(e) { - const { catalog: t, linearization: i, xref: a } = this, - s = Ref.get(i.objectNumberFirst, 0); + async _getLinearizationPage(pageIndex) { + const { catalog, linearization, xref } = this; + const ref = Ref.get(linearization.objectNumberFirst, 0); try { - const e = await a.fetchAsync(s); - if (e instanceof Dict) { - let i = e.getRaw("Type"); - i instanceof Ref && (i = await a.fetchAsync(i)); + const obj = await xref.fetchAsync(ref); + if (obj instanceof Dict) { + let type = obj.getRaw("Type"); + if (type instanceof Ref) { + type = await xref.fetchAsync(type); + } if ( - isName(i, "Page") || - (!e.has("Type") && !e.has("Kids") && e.has("Contents")) + isName(type, "Page") || + (!obj.has("Type") && !obj.has("Kids") && obj.has("Contents")) ) { - t.pageKidsCountCache.has(s) || t.pageKidsCountCache.put(s, 1); - t.pageIndexCache.has(s) || t.pageIndexCache.put(s, 0); - return [e, s]; + if (!catalog.pageKidsCountCache.has(ref)) { + catalog.pageKidsCountCache.put(ref, 1); + } + if (!catalog.pageIndexCache.has(ref)) { + catalog.pageIndexCache.put(ref, 0); + } + return [obj, ref]; } } throw new FormatError( "The Linearization dictionary doesn't point to a valid Page dictionary.", ); - } catch (i) { - warn(`_getLinearizationPage: "${i.message}".`); - return t.getPageDict(e); + } catch (reason) { + warn(`_getLinearizationPage: "${reason.message}".`); + return catalog.getPageDict(pageIndex); } } - getPage(e) { - const t = this._pagePromises.get(e); - if (t) return t; - const { catalog: i, linearization: a, xfaFactory: s } = this; - let r; - r = s - ? Promise.resolve([Dict.empty, null]) - : a?.pageFirst === e - ? this._getLinearizationPage(e) - : i.getPageDict(e); - r = r.then( - ([t, a]) => - new Page({ - pdfManager: this.pdfManager, - xref: this.xref, - pageIndex: e, - pageDict: t, - ref: a, - globalIdFactory: this._globalIdFactory, - fontCache: i.fontCache, - builtInCMapCache: i.builtInCMapCache, - standardFontDataCache: i.standardFontDataCache, - globalImageCache: i.globalImageCache, - systemFontCache: i.systemFontCache, - nonBlendModesSet: i.nonBlendModesSet, - xfaFactory: s, - }), - ); - this._pagePromises.set(e, r); - return r; + getPage(pageIndex) { + const cachedPromise = this._pagePromises.get(pageIndex); + if (cachedPromise) { + return cachedPromise; + } + const { catalog, linearization, xfaFactory } = this; + let promise; + if (xfaFactory) { + promise = Promise.resolve([Dict.empty, null]); + } else if (linearization?.pageFirst === pageIndex) { + promise = this._getLinearizationPage(pageIndex); + } else { + promise = catalog.getPageDict(pageIndex); + } + promise = promise.then(([pageDict, ref]) => { + return new Page({ + pdfManager: this.pdfManager, + xref: this.xref, + pageIndex, + pageDict, + ref, + globalIdFactory: this._globalIdFactory, + fontCache: catalog.fontCache, + builtInCMapCache: catalog.builtInCMapCache, + standardFontDataCache: catalog.standardFontDataCache, + globalImageCache: catalog.globalImageCache, + systemFontCache: catalog.systemFontCache, + nonBlendModesSet: catalog.nonBlendModesSet, + xfaFactory, + }); + }); + this._pagePromises.set(pageIndex, promise); + return promise; } - async checkFirstPage(e = !1) { - if (!e) - try { - await this.getPage(0); - } catch (e) { - if (e instanceof XRefEntryException) { - this._pagePromises.delete(0); - await this.cleanup(); - throw new XRefParseException(); - } + async checkFirstPage(recoveryMode = false) { + if (recoveryMode) { + return; + } + try { + await this.getPage(0); + } catch (reason) { + if (reason instanceof XRefEntryException) { + this._pagePromises.delete(0); + await this.cleanup(); + throw new XRefParseException(); } + } } - async checkLastPage(e = !1) { - const { catalog: t, pdfManager: i } = this; - t.setActualNumPages(); - let a; + async checkLastPage(recoveryMode = false) { + const { catalog, pdfManager } = this; + catalog.setActualNumPages(); + let numPages; try { await Promise.all([ - i.ensureDoc("xfaFactory"), - i.ensureDoc("linearization"), - i.ensureCatalog("numPages"), + pdfManager.ensureDoc("xfaFactory"), + pdfManager.ensureDoc("linearization"), + pdfManager.ensureCatalog("numPages"), ]); - if (this.xfaFactory) return; - a = this.linearization ? this.linearization.numPages : t.numPages; - if (!Number.isInteger(a)) + if (this.xfaFactory) { + return; + } else if (this.linearization) { + numPages = this.linearization.numPages; + } else { + numPages = catalog.numPages; + } + if (!Number.isInteger(numPages)) { throw new FormatError("Page count is not an integer."); - if (a <= 1) return; - await this.getPage(a - 1); - } catch (s) { - this._pagePromises.delete(a - 1); - await this.cleanup(); - if (s instanceof XRefEntryException && !e) throw new XRefParseException(); - warn(`checkLastPage - invalid /Pages tree /Count: ${a}.`); - let r; - try { - r = await t.getAllPageDicts(e); - } catch (i) { - if (i instanceof XRefEntryException && !e) - throw new XRefParseException(); - t.setActualNumPages(1); + } else if (numPages <= 1) { return; } - for (const [e, [a, s]] of r) { - let r; - if (a instanceof Error) { - r = Promise.reject(a); - r.catch(() => {}); - } else - r = Promise.resolve( + await this.getPage(numPages - 1); + } catch (reason) { + this._pagePromises.delete(numPages - 1); + await this.cleanup(); + if (reason instanceof XRefEntryException && !recoveryMode) { + throw new XRefParseException(); + } + warn(`checkLastPage - invalid /Pages tree /Count: ${numPages}.`); + let pagesTree; + try { + pagesTree = await catalog.getAllPageDicts(recoveryMode); + } catch (reasonAll) { + if (reasonAll instanceof XRefEntryException && !recoveryMode) { + throw new XRefParseException(); + } + catalog.setActualNumPages(1); + return; + } + for (const [pageIndex, [pageDict, ref]] of pagesTree) { + let promise; + if (pageDict instanceof Error) { + promise = Promise.reject(pageDict); + promise.catch(() => {}); + } else { + promise = Promise.resolve( new Page({ - pdfManager: i, + pdfManager, xref: this.xref, - pageIndex: e, - pageDict: a, - ref: s, + pageIndex, + pageDict, + ref, globalIdFactory: this._globalIdFactory, - fontCache: t.fontCache, - builtInCMapCache: t.builtInCMapCache, - standardFontDataCache: t.standardFontDataCache, - globalImageCache: t.globalImageCache, - systemFontCache: t.systemFontCache, - nonBlendModesSet: t.nonBlendModesSet, + fontCache: catalog.fontCache, + builtInCMapCache: catalog.builtInCMapCache, + standardFontDataCache: catalog.standardFontDataCache, + globalImageCache: catalog.globalImageCache, + systemFontCache: catalog.systemFontCache, + nonBlendModesSet: catalog.nonBlendModesSet, xfaFactory: null, }), ); - this._pagePromises.set(e, r); + } + this._pagePromises.set(pageIndex, promise); } - t.setActualNumPages(r.size); + catalog.setActualNumPages(pagesTree.size); } } - fontFallback(e, t) { - return this.catalog.fontFallback(e, t); + fontFallback(id, handler) { + return this.catalog.fontFallback(id, handler); } - async cleanup(e = !1) { - return this.catalog ? this.catalog.cleanup(e) : clearGlobalCaches(); + async cleanup(manuallyTriggered = false) { + return this.catalog + ? this.catalog.cleanup(manuallyTriggered) + : clearGlobalCaches(); } - async #q(e, t, i, a, s) { - const { xref: r } = this; - if (!(t instanceof Ref) || s.has(t)) return; - s.put(t); - const n = await r.fetchAsync(t); - if (!(n instanceof Dict)) return; - if (n.has("T")) { - const t = stringToPDFString(await n.getAsync("T")); - e = "" === e ? t : `${e}.${t}`; + async #collectFieldObjects( + name, + parentRef, + fieldRef, + promises, + annotationGlobals, + visitedRefs, + orphanFields, + ) { + const { xref } = this; + if (!(fieldRef instanceof Ref) || visitedRefs.has(fieldRef)) { + return; + } + visitedRefs.put(fieldRef); + const field = await xref.fetchAsync(fieldRef); + if (!(field instanceof Dict)) { + return; + } + if (field.has("T")) { + const partName = stringToPDFString(await field.getAsync("T")); + name = name === "" ? partName : `${name}.${partName}`; } else { - let t = n; - for (;;) { - t = t.getRaw("Parent"); - if (t instanceof Ref) { - if (s.has(t)) break; - t = await r.fetchAsync(t); + let obj = field; + while (true) { + obj = obj.getRaw("Parent") || parentRef; + if (obj instanceof Ref) { + if (visitedRefs.has(obj)) { + break; + } + obj = await xref.fetchAsync(obj); } - if (!(t instanceof Dict)) break; - if (t.has("T")) { - const i = stringToPDFString(await t.getAsync("T")); - e = "" === e ? i : `${e}.${i}`; + if (!(obj instanceof Dict)) { + break; + } + if (obj.has("T")) { + const partName = stringToPDFString(await obj.getAsync("T")); + name = name === "" ? partName : `${name}.${partName}`; break; } } } - i.has(e) || i.set(e, []); - i.get(e).push( - AnnotationFactory.create(r, t, a, null, !0, null) - .then((e) => e?.getFieldObject()) - .catch(function (e) { - warn(`#collectFieldObjects: "${e}".`); + if ( + parentRef && + !field.has("Parent") && + isName(field.get("Subtype"), "Widget") + ) { + orphanFields.put(fieldRef, parentRef); + } + if (!promises.has(name)) { + promises.set(name, []); + } + promises.get(name).push( + AnnotationFactory.create( + xref, + fieldRef, + annotationGlobals, + null, + true, + orphanFields, + null, + ) + .then((annotation) => annotation?.getFieldObject()) + .catch(function (reason) { + warn(`#collectFieldObjects: "${reason}".`); return null; }), ); - if (!n.has("Kids")) return; - const g = await n.getAsync("Kids"); - if (Array.isArray(g)) for (const t of g) await this.#q(e, t, i, a, s); + if (!field.has("Kids")) { + return; + } + const kids = await field.getAsync("Kids"); + if (Array.isArray(kids)) { + for (const kid of kids) { + await this.#collectFieldObjects( + name, + fieldRef, + kid, + promises, + annotationGlobals, + visitedRefs, + orphanFields, + ); + } + } } get fieldObjects() { - if (!this.formInfo.hasFields) - return shadow(this, "fieldObjects", Promise.resolve(null)); - return shadow( - this, - "fieldObjects", - Promise.all([ - this.pdfManager.ensureDoc("annotationGlobals"), - this.pdfManager.ensureCatalog("acroForm"), - ]).then(async ([e, t]) => { - if (!e) return null; - const i = new RefSet(), - a = Object.create(null), - s = new Map(); - for (const a of await t.getAsync("Fields")) - await this.#q("", a, s, e, i); - const r = []; - for (const [e, t] of s) - r.push( - Promise.all(t).then((t) => { - (t = t.filter((e) => !!e)).length > 0 && (a[e] = t); + const promise = this.pdfManager + .ensureDoc("formInfo") + .then(async (formInfo) => { + if (!formInfo.hasFields) { + return null; + } + const [annotationGlobals, acroForm] = await Promise.all([ + this.pdfManager.ensureDoc("annotationGlobals"), + this.pdfManager.ensureCatalog("acroForm"), + ]); + if (!annotationGlobals) { + return null; + } + const visitedRefs = new RefSet(); + const allFields = Object.create(null); + const fieldPromises = new Map(); + const orphanFields = new RefSetCache(); + for (const fieldRef of await acroForm.getAsync("Fields")) { + await this.#collectFieldObjects( + "", + null, + fieldRef, + fieldPromises, + annotationGlobals, + visitedRefs, + orphanFields, + ); + } + const allPromises = []; + for (const [name, promises] of fieldPromises) { + allPromises.push( + Promise.all(promises).then((fields) => { + fields = fields.filter((field) => !!field); + if (fields.length > 0) { + allFields[name] = fields; + } }), ); - await Promise.all(r); - return a; - }), - ); + } + await Promise.all(allPromises); + return { + allFields, + orphanFields, + }; + }); + return shadow(this, "fieldObjects", promise); } get hasJSActions() { - return shadow( - this, - "hasJSActions", - this.pdfManager.ensureDoc("_parseHasJSActions"), - ); + const promise = this.pdfManager.ensureDoc("_parseHasJSActions"); + return shadow(this, "hasJSActions", promise); } async _parseHasJSActions() { - const [e, t] = await Promise.all([ + const [catalogJsActions, fieldObjects] = await Promise.all([ this.pdfManager.ensureCatalog("jsActions"), this.pdfManager.ensureDoc("fieldObjects"), ]); - return ( - !!e || - (!!t && Object.values(t).some((e) => e.some((e) => null !== e.actions))) - ); + if (catalogJsActions) { + return true; + } + if (fieldObjects) { + return Object.values(fieldObjects.allFields).some((fieldObject) => + fieldObject.some((object) => object.actions !== null), + ); + } + return false; } get calculationOrderIds() { - const e = this.catalog.acroForm; - if (!e?.has("CO")) return shadow(this, "calculationOrderIds", null); - const t = e.get("CO"); - if (!Array.isArray(t) || 0 === t.length) + const calculationOrder = this.catalog.acroForm?.get("CO"); + if (!Array.isArray(calculationOrder) || calculationOrder.length === 0) { return shadow(this, "calculationOrderIds", null); - const i = []; - for (const e of t) e instanceof Ref && i.push(e.toString()); - return 0 === i.length - ? shadow(this, "calculationOrderIds", null) - : shadow(this, "calculationOrderIds", i); + } + const ids = []; + for (const id of calculationOrder) { + if (id instanceof Ref) { + ids.push(id.toString()); + } + } + return shadow(this, "calculationOrderIds", ids.length ? ids : null); } get annotationGlobals() { return shadow( @@ -55768,25 +67957,27 @@ class PDFDocument { AnnotationFactory.createGlobals(this.pdfManager), ); } +} // ./src/core/pdf_manager.js + +function parseDocBaseUrl(url) { + if (url) { + const absoluteUrl = createValidAbsoluteUrl(url); + if (absoluteUrl) { + return absoluteUrl.href; + } + warn(`Invalid absolute docBaseUrl: "${url}".`); + } + return null; } class BasePdfManager { - constructor(e) { - this.constructor === BasePdfManager && - unreachable("Cannot initialize BasePdfManager."); - this._docBaseUrl = (function parseDocBaseUrl(e) { - if (e) { - const t = createValidAbsoluteUrl(e); - if (t) return t.href; - warn(`Invalid absolute docBaseUrl: "${e}".`); - } - return null; - })(e.docBaseUrl); - this._docId = e.docId; - this._password = e.password; - this.enableXfa = e.enableXfa; - e.evaluatorOptions.isOffscreenCanvasSupported &&= + constructor(args) { + this._docBaseUrl = parseDocBaseUrl(args.docBaseUrl); + this._docId = args.docId; + this._password = args.password; + this.enableXfa = args.enableXfa; + args.evaluatorOptions.isOffscreenCanvasSupported &&= FeatureTest.isOffscreenCanvasSupported; - this.evaluatorOptions = Object.freeze(e.evaluatorOptions); + this.evaluatorOptions = Object.freeze(args.evaluatorOptions); } get docId() { return this._docId; @@ -55800,495 +67991,562 @@ class BasePdfManager { get catalog() { return this.pdfDocument.catalog; } - ensureDoc(e, t) { - return this.ensure(this.pdfDocument, e, t); + ensureDoc(prop, args) { + return this.ensure(this.pdfDocument, prop, args); } - ensureXRef(e, t) { - return this.ensure(this.pdfDocument.xref, e, t); + ensureXRef(prop, args) { + return this.ensure(this.pdfDocument.xref, prop, args); } - ensureCatalog(e, t) { - return this.ensure(this.pdfDocument.catalog, e, t); + ensureCatalog(prop, args) { + return this.ensure(this.pdfDocument.catalog, prop, args); } - getPage(e) { - return this.pdfDocument.getPage(e); + getPage(pageIndex) { + return this.pdfDocument.getPage(pageIndex); } - fontFallback(e, t) { - return this.pdfDocument.fontFallback(e, t); + fontFallback(id, handler) { + return this.pdfDocument.fontFallback(id, handler); } - loadXfaFonts(e, t) { - return this.pdfDocument.loadXfaFonts(e, t); + loadXfaFonts(handler, task) { + return this.pdfDocument.loadXfaFonts(handler, task); } loadXfaImages() { return this.pdfDocument.loadXfaImages(); } - serializeXfaData(e) { - return this.pdfDocument.serializeXfaData(e); + serializeXfaData(annotationStorage) { + return this.pdfDocument.serializeXfaData(annotationStorage); } - cleanup(e = !1) { - return this.pdfDocument.cleanup(e); + cleanup(manuallyTriggered = false) { + return this.pdfDocument.cleanup(manuallyTriggered); } - async ensure(e, t, i) { + async ensure(obj, prop, args) { unreachable("Abstract method `ensure` called"); } - requestRange(e, t) { + requestRange(begin, end) { unreachable("Abstract method `requestRange` called"); } - requestLoadedStream(e = !1) { + requestLoadedStream(noFetch = false) { unreachable("Abstract method `requestLoadedStream` called"); } - sendProgressiveData(e) { + sendProgressiveData(chunk) { unreachable("Abstract method `sendProgressiveData` called"); } - updatePassword(e) { - this._password = e; + updatePassword(password) { + this._password = password; } - terminate(e) { + terminate(reason) { unreachable("Abstract method `terminate` called"); } } class LocalPdfManager extends BasePdfManager { - constructor(e) { - super(e); - const t = new Stream(e.source); - this.pdfDocument = new PDFDocument(this, t); - this._loadedStreamPromise = Promise.resolve(t); + constructor(args) { + super(args); + const stream = new Stream(args.source); + this.pdfDocument = new PDFDocument(this, stream); + this._loadedStreamPromise = Promise.resolve(stream); } - async ensure(e, t, i) { - const a = e[t]; - return "function" == typeof a ? a.apply(e, i) : a; + async ensure(obj, prop, args) { + const value = obj[prop]; + if (typeof value === "function") { + return value.apply(obj, args); + } + return value; } - requestRange(e, t) { + requestRange(begin, end) { return Promise.resolve(); } - requestLoadedStream(e = !1) { + requestLoadedStream(noFetch = false) { return this._loadedStreamPromise; } - terminate(e) {} + terminate(reason) {} } class NetworkPdfManager extends BasePdfManager { - constructor(e) { - super(e); - this.streamManager = new ChunkedStreamManager(e.source, { - msgHandler: e.handler, - length: e.length, - disableAutoFetch: e.disableAutoFetch, - rangeChunkSize: e.rangeChunkSize, + constructor(args) { + super(args); + this.streamManager = new ChunkedStreamManager(args.source, { + msgHandler: args.handler, + length: args.length, + disableAutoFetch: args.disableAutoFetch, + rangeChunkSize: args.rangeChunkSize, }); this.pdfDocument = new PDFDocument(this, this.streamManager.getStream()); } - async ensure(e, t, i) { + async ensure(obj, prop, args) { try { - const a = e[t]; - return "function" == typeof a ? a.apply(e, i) : a; - } catch (a) { - if (!(a instanceof MissingDataException)) throw a; - await this.requestRange(a.begin, a.end); - return this.ensure(e, t, i); + const value = obj[prop]; + if (typeof value === "function") { + return value.apply(obj, args); + } + return value; + } catch (ex) { + if (!(ex instanceof MissingDataException)) { + throw ex; + } + await this.requestRange(ex.begin, ex.end); + return this.ensure(obj, prop, args); } } - requestRange(e, t) { - return this.streamManager.requestRange(e, t); + requestRange(begin, end) { + return this.streamManager.requestRange(begin, end); } - requestLoadedStream(e = !1) { - return this.streamManager.requestAllChunks(e); + requestLoadedStream(noFetch = false) { + return this.streamManager.requestAllChunks(noFetch); } - sendProgressiveData(e) { - this.streamManager.onReceiveData({ chunk: e }); + sendProgressiveData(chunk) { + this.streamManager.onReceiveData({ + chunk, + }); } - terminate(e) { - this.streamManager.abort(e); + terminate(reason) { + this.streamManager.abort(reason); } -} -const og = 1, - Ig = 2, - cg = 1, - Cg = 2, - hg = 3, - Bg = 4, - lg = 5, - Qg = 6, - Eg = 7, - ug = 8; -function wrapReason(e) { - e instanceof Error || - ("object" == typeof e && null !== e) || +} // ./src/shared/message_handler.js + +const CallbackKind = { + UNKNOWN: 0, + DATA: 1, + ERROR: 2, +}; +const StreamKind = { + UNKNOWN: 0, + CANCEL: 1, + CANCEL_COMPLETE: 2, + CLOSE: 3, + ENQUEUE: 4, + ERROR: 5, + PULL: 6, + PULL_COMPLETE: 7, + START_COMPLETE: 8, +}; +function wrapReason(reason) { + if ( + !( + reason instanceof Error || + (typeof reason === "object" && reason !== null) + ) + ) { unreachable( 'wrapReason: Expected "reason" to be a (possibly cloned) Error.', ); - switch (e.name) { + } + switch (reason.name) { case "AbortException": - return new AbortException(e.message); + return new AbortException(reason.message); case "MissingPDFException": - return new MissingPDFException(e.message); + return new MissingPDFException(reason.message); case "PasswordException": - return new PasswordException(e.message, e.code); + return new PasswordException(reason.message, reason.code); case "UnexpectedResponseException": - return new UnexpectedResponseException(e.message, e.status); + return new UnexpectedResponseException(reason.message, reason.status); case "UnknownErrorException": - return new UnknownErrorException(e.message, e.details); + return new UnknownErrorException(reason.message, reason.details); default: - return new UnknownErrorException(e.message, e.toString()); + return new UnknownErrorException(reason.message, reason.toString()); } } class MessageHandler { - constructor(e, t, i) { - this.sourceName = e; - this.targetName = t; - this.comObj = i; + #messageAC = new AbortController(); + constructor(sourceName, targetName, comObj) { + this.sourceName = sourceName; + this.targetName = targetName; + this.comObj = comObj; this.callbackId = 1; this.streamId = 1; this.streamSinks = Object.create(null); this.streamControllers = Object.create(null); this.callbackCapabilities = Object.create(null); this.actionHandler = Object.create(null); - this._onComObjOnMessage = (e) => { - const t = e.data; - if (t.targetName !== this.sourceName) return; - if (t.stream) { - this.#O(t); - return; - } - if (t.callback) { - const e = t.callbackId, - i = this.callbackCapabilities[e]; - if (!i) throw new Error(`Cannot resolve callback ${e}`); - delete this.callbackCapabilities[e]; - if (t.callback === og) i.resolve(t.data); - else { - if (t.callback !== Ig) throw new Error("Unexpected callback case"); - i.reject(wrapReason(t.reason)); - } - return; - } - const a = this.actionHandler[t.action]; - if (!a) throw new Error(`Unknown action from worker: ${t.action}`); - if (t.callbackId) { - const e = this.sourceName, - s = t.sourceName; - new Promise(function (e) { - e(a(t.data)); - }).then( - function (a) { - i.postMessage({ - sourceName: e, - targetName: s, - callback: og, - callbackId: t.callbackId, - data: a, - }); - }, - function (a) { - i.postMessage({ - sourceName: e, - targetName: s, - callback: Ig, - callbackId: t.callbackId, - reason: wrapReason(a), - }); - }, - ); - } else t.streamId ? this.#P(t) : a(t.data); - }; - i.addEventListener("message", this._onComObjOnMessage); + comObj.addEventListener("message", this.#onMessage.bind(this), { + signal: this.#messageAC.signal, + }); } - on(e, t) { - const i = this.actionHandler; - if (i[e]) throw new Error(`There is already an actionName called "${e}"`); - i[e] = t; + #onMessage({ data }) { + if (data.targetName !== this.sourceName) { + return; + } + if (data.stream) { + this.#processStreamMessage(data); + return; + } + if (data.callback) { + const callbackId = data.callbackId; + const capability = this.callbackCapabilities[callbackId]; + if (!capability) { + throw new Error(`Cannot resolve callback ${callbackId}`); + } + delete this.callbackCapabilities[callbackId]; + if (data.callback === CallbackKind.DATA) { + capability.resolve(data.data); + } else if (data.callback === CallbackKind.ERROR) { + capability.reject(wrapReason(data.reason)); + } else { + throw new Error("Unexpected callback case"); + } + return; + } + const action = this.actionHandler[data.action]; + if (!action) { + throw new Error(`Unknown action from worker: ${data.action}`); + } + if (data.callbackId) { + const sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + new Promise(function (resolve) { + resolve(action(data.data)); + }).then( + function (result) { + comObj.postMessage({ + sourceName, + targetName, + callback: CallbackKind.DATA, + callbackId: data.callbackId, + data: result, + }); + }, + function (reason) { + comObj.postMessage({ + sourceName, + targetName, + callback: CallbackKind.ERROR, + callbackId: data.callbackId, + reason: wrapReason(reason), + }); + }, + ); + return; + } + if (data.streamId) { + this.#createStreamSink(data); + return; + } + action(data.data); } - send(e, t, i) { + on(actionName, handler) { + const ah = this.actionHandler; + if (ah[actionName]) { + throw new Error(`There is already an actionName called "${actionName}"`); + } + ah[actionName] = handler; + } + send(actionName, data, transfers) { this.comObj.postMessage( { sourceName: this.sourceName, targetName: this.targetName, - action: e, - data: t, + action: actionName, + data, }, - i, + transfers, ); } - sendWithPromise(e, t, i) { - const a = this.callbackId++, - s = Promise.withResolvers(); - this.callbackCapabilities[a] = s; + sendWithPromise(actionName, data, transfers) { + const callbackId = this.callbackId++; + const capability = Promise.withResolvers(); + this.callbackCapabilities[callbackId] = capability; try { this.comObj.postMessage( { sourceName: this.sourceName, targetName: this.targetName, - action: e, - callbackId: a, - data: t, + action: actionName, + callbackId, + data, }, - i, + transfers, ); - } catch (e) { - s.reject(e); + } catch (ex) { + capability.reject(ex); } - return s.promise; + return capability.promise; } - sendWithStream(e, t, i, a) { - const s = this.streamId++, - r = this.sourceName, - n = this.targetName, - g = this.comObj; + sendWithStream(actionName, data, queueingStrategy, transfers) { + const streamId = this.streamId++, + sourceName = this.sourceName, + targetName = this.targetName, + comObj = this.comObj; return new ReadableStream( { - start: (i) => { - const o = Promise.withResolvers(); - this.streamControllers[s] = { - controller: i, - startCall: o, + start: (controller) => { + const startCapability = Promise.withResolvers(); + this.streamControllers[streamId] = { + controller, + startCall: startCapability, pullCall: null, cancelCall: null, - isClosed: !1, + isClosed: false, }; - g.postMessage( + comObj.postMessage( { - sourceName: r, - targetName: n, - action: e, - streamId: s, - data: t, - desiredSize: i.desiredSize, + sourceName, + targetName, + action: actionName, + streamId, + data, + desiredSize: controller.desiredSize, }, - a, + transfers, ); - return o.promise; + return startCapability.promise; }, - pull: (e) => { - const t = Promise.withResolvers(); - this.streamControllers[s].pullCall = t; - g.postMessage({ - sourceName: r, - targetName: n, - stream: Qg, - streamId: s, - desiredSize: e.desiredSize, + pull: (controller) => { + const pullCapability = Promise.withResolvers(); + this.streamControllers[streamId].pullCall = pullCapability; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL, + streamId, + desiredSize: controller.desiredSize, }); - return t.promise; + return pullCapability.promise; }, - cancel: (e) => { - assert(e instanceof Error, "cancel must have a valid reason"); - const t = Promise.withResolvers(); - this.streamControllers[s].cancelCall = t; - this.streamControllers[s].isClosed = !0; - g.postMessage({ - sourceName: r, - targetName: n, - stream: cg, - streamId: s, - reason: wrapReason(e), + cancel: (reason) => { + assert(reason instanceof Error, "cancel must have a valid reason"); + const cancelCapability = Promise.withResolvers(); + this.streamControllers[streamId].cancelCall = cancelCapability; + this.streamControllers[streamId].isClosed = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL, + streamId, + reason: wrapReason(reason), }); - return t.promise; + return cancelCapability.promise; }, }, - i, + queueingStrategy, ); } - #P(e) { - const t = e.streamId, - i = this.sourceName, - a = e.sourceName, - s = this.comObj, - r = this, - n = this.actionHandler[e.action], - g = { - enqueue(e, r = 1, n) { - if (this.isCancelled) return; - const g = this.desiredSize; - this.desiredSize -= r; - if (g > 0 && this.desiredSize <= 0) { - this.sinkCapability = Promise.withResolvers(); - this.ready = this.sinkCapability.promise; - } - s.postMessage( - { sourceName: i, targetName: a, stream: Bg, streamId: t, chunk: e }, - n, - ); - }, - close() { - if (!this.isCancelled) { - this.isCancelled = !0; - s.postMessage({ - sourceName: i, - targetName: a, - stream: hg, - streamId: t, - }); - delete r.streamSinks[t]; - } - }, - error(e) { - assert(e instanceof Error, "error must have a valid reason"); - if (!this.isCancelled) { - this.isCancelled = !0; - s.postMessage({ - sourceName: i, - targetName: a, - stream: lg, - streamId: t, - reason: wrapReason(e), - }); - } - }, - sinkCapability: Promise.withResolvers(), - onPull: null, - onCancel: null, - isCancelled: !1, - desiredSize: e.desiredSize, - ready: null, - }; - g.sinkCapability.resolve(); - g.ready = g.sinkCapability.promise; - this.streamSinks[t] = g; - new Promise(function (t) { - t(n(e.data, g)); + #createStreamSink(data) { + const streamId = data.streamId, + sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + const self = this, + action = this.actionHandler[data.action]; + const streamSink = { + enqueue(chunk, size = 1, transfers) { + if (this.isCancelled) { + return; + } + const lastDesiredSize = this.desiredSize; + this.desiredSize -= size; + if (lastDesiredSize > 0 && this.desiredSize <= 0) { + this.sinkCapability = Promise.withResolvers(); + this.ready = this.sinkCapability.promise; + } + comObj.postMessage( + { + sourceName, + targetName, + stream: StreamKind.ENQUEUE, + streamId, + chunk, + }, + transfers, + ); + }, + close() { + if (this.isCancelled) { + return; + } + this.isCancelled = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CLOSE, + streamId, + }); + delete self.streamSinks[streamId]; + }, + error(reason) { + assert(reason instanceof Error, "error must have a valid reason"); + if (this.isCancelled) { + return; + } + this.isCancelled = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.ERROR, + streamId, + reason: wrapReason(reason), + }); + }, + sinkCapability: Promise.withResolvers(), + onPull: null, + onCancel: null, + isCancelled: false, + desiredSize: data.desiredSize, + ready: null, + }; + streamSink.sinkCapability.resolve(); + streamSink.ready = streamSink.sinkCapability.promise; + this.streamSinks[streamId] = streamSink; + new Promise(function (resolve) { + resolve(action(data.data, streamSink)); }).then( function () { - s.postMessage({ - sourceName: i, - targetName: a, - stream: ug, - streamId: t, - success: !0, + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.START_COMPLETE, + streamId, + success: true, }); }, - function (e) { - s.postMessage({ - sourceName: i, - targetName: a, - stream: ug, - streamId: t, - reason: wrapReason(e), + function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.START_COMPLETE, + streamId, + reason: wrapReason(reason), }); }, ); } - #O(e) { - const t = e.streamId, - i = this.sourceName, - a = e.sourceName, - s = this.comObj, - r = this.streamControllers[t], - n = this.streamSinks[t]; - switch (e.stream) { - case ug: - e.success - ? r.startCall.resolve() - : r.startCall.reject(wrapReason(e.reason)); + #processStreamMessage(data) { + const streamId = data.streamId, + sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + const streamController = this.streamControllers[streamId], + streamSink = this.streamSinks[streamId]; + switch (data.stream) { + case StreamKind.START_COMPLETE: + if (data.success) { + streamController.startCall.resolve(); + } else { + streamController.startCall.reject(wrapReason(data.reason)); + } break; - case Eg: - e.success - ? r.pullCall.resolve() - : r.pullCall.reject(wrapReason(e.reason)); + case StreamKind.PULL_COMPLETE: + if (data.success) { + streamController.pullCall.resolve(); + } else { + streamController.pullCall.reject(wrapReason(data.reason)); + } break; - case Qg: - if (!n) { - s.postMessage({ - sourceName: i, - targetName: a, - stream: Eg, - streamId: t, - success: !0, + case StreamKind.PULL: + if (!streamSink) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + success: true, }); break; } - n.desiredSize <= 0 && e.desiredSize > 0 && n.sinkCapability.resolve(); - n.desiredSize = e.desiredSize; - new Promise(function (e) { - e(n.onPull?.()); + if (streamSink.desiredSize <= 0 && data.desiredSize > 0) { + streamSink.sinkCapability.resolve(); + } + streamSink.desiredSize = data.desiredSize; + new Promise(function (resolve) { + resolve(streamSink.onPull?.()); }).then( function () { - s.postMessage({ - sourceName: i, - targetName: a, - stream: Eg, - streamId: t, - success: !0, + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + success: true, }); }, - function (e) { - s.postMessage({ - sourceName: i, - targetName: a, - stream: Eg, - streamId: t, - reason: wrapReason(e), + function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + reason: wrapReason(reason), }); }, ); break; - case Bg: - assert(r, "enqueue should have stream controller"); - if (r.isClosed) break; - r.controller.enqueue(e.chunk); + case StreamKind.ENQUEUE: + assert(streamController, "enqueue should have stream controller"); + if (streamController.isClosed) { + break; + } + streamController.controller.enqueue(data.chunk); break; - case hg: - assert(r, "close should have stream controller"); - if (r.isClosed) break; - r.isClosed = !0; - r.controller.close(); - this.#W(r, t); + case StreamKind.CLOSE: + assert(streamController, "close should have stream controller"); + if (streamController.isClosed) { + break; + } + streamController.isClosed = true; + streamController.controller.close(); + this.#deleteStreamController(streamController, streamId); break; - case lg: - assert(r, "error should have stream controller"); - r.controller.error(wrapReason(e.reason)); - this.#W(r, t); + case StreamKind.ERROR: + assert(streamController, "error should have stream controller"); + streamController.controller.error(wrapReason(data.reason)); + this.#deleteStreamController(streamController, streamId); break; - case Cg: - e.success - ? r.cancelCall.resolve() - : r.cancelCall.reject(wrapReason(e.reason)); - this.#W(r, t); + case StreamKind.CANCEL_COMPLETE: + if (data.success) { + streamController.cancelCall.resolve(); + } else { + streamController.cancelCall.reject(wrapReason(data.reason)); + } + this.#deleteStreamController(streamController, streamId); break; - case cg: - if (!n) break; - new Promise(function (t) { - t(n.onCancel?.(wrapReason(e.reason))); + case StreamKind.CANCEL: + if (!streamSink) { + break; + } + new Promise(function (resolve) { + resolve(streamSink.onCancel?.(wrapReason(data.reason))); }).then( function () { - s.postMessage({ - sourceName: i, - targetName: a, - stream: Cg, - streamId: t, - success: !0, + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL_COMPLETE, + streamId, + success: true, }); }, - function (e) { - s.postMessage({ - sourceName: i, - targetName: a, - stream: Cg, - streamId: t, - reason: wrapReason(e), + function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL_COMPLETE, + streamId, + reason: wrapReason(reason), }); }, ); - n.sinkCapability.reject(wrapReason(e.reason)); - n.isCancelled = !0; - delete this.streamSinks[t]; + streamSink.sinkCapability.reject(wrapReason(data.reason)); + streamSink.isCancelled = true; + delete this.streamSinks[streamId]; break; default: throw new Error("Unexpected stream case"); } } - async #W(e, t) { + async #deleteStreamController(streamController, streamId) { await Promise.allSettled([ - e.startCall?.promise, - e.pullCall?.promise, - e.cancelCall?.promise, + streamController.startCall?.promise, + streamController.pullCall?.promise, + streamController.cancelCall?.promise, ]); - delete this.streamControllers[t]; + delete this.streamControllers[streamId]; } destroy() { - this.comObj.removeEventListener("message", this._onComObjOnMessage); + this.#messageAC?.abort(); + this.#messageAC = null; } -} +} // ./src/core/worker_stream.js + class PDFWorkerStream { - constructor(e) { - this._msgHandler = e; + constructor(msgHandler) { + this._msgHandler = msgHandler; this._contentLength = null; this._fullRequestReader = null; this._rangeRequestReaders = []; @@ -56301,31 +68559,33 @@ class PDFWorkerStream { this._fullRequestReader = new PDFWorkerStreamReader(this._msgHandler); return this._fullRequestReader; } - getRangeReader(e, t) { - const i = new PDFWorkerStreamRangeReader(e, t, this._msgHandler); - this._rangeRequestReaders.push(i); - return i; + getRangeReader(begin, end) { + const reader = new PDFWorkerStreamRangeReader(begin, end, this._msgHandler); + this._rangeRequestReaders.push(reader); + return reader; } - cancelAllRequests(e) { - this._fullRequestReader?.cancel(e); - for (const t of this._rangeRequestReaders.slice(0)) t.cancel(e); + cancelAllRequests(reason) { + this._fullRequestReader?.cancel(reason); + for (const reader of this._rangeRequestReaders.slice(0)) { + reader.cancel(reason); + } } } class PDFWorkerStreamReader { - constructor(e) { - this._msgHandler = e; + constructor(msgHandler) { + this._msgHandler = msgHandler; this.onProgress = null; this._contentLength = null; - this._isRangeSupported = !1; - this._isStreamingSupported = !1; - const t = this._msgHandler.sendWithStream("GetReader"); - this._reader = t.getReader(); + this._isRangeSupported = false; + this._isStreamingSupported = false; + const readableStream = this._msgHandler.sendWithStream("GetReader"); + this._reader = readableStream.getReader(); this._headersReady = this._msgHandler .sendWithPromise("ReaderHeadersReady") - .then((e) => { - this._isStreamingSupported = e.isStreamingSupported; - this._isRangeSupported = e.isRangeSupported; - this._contentLength = e.contentLength; + .then((data) => { + this._isStreamingSupported = data.isStreamingSupported; + this._isRangeSupported = data.isRangeSupported; + this._contentLength = data.contentLength; }); } get headersReady() { @@ -56341,38 +68601,57 @@ class PDFWorkerStreamReader { return this._isRangeSupported; } async read() { - const { value: e, done: t } = await this._reader.read(); - return t ? { value: void 0, done: !0 } : { value: e.buffer, done: !1 }; + const { value, done } = await this._reader.read(); + if (done) { + return { + value: undefined, + done: true, + }; + } + return { + value: value.buffer, + done: false, + }; } - cancel(e) { - this._reader.cancel(e); + cancel(reason) { + this._reader.cancel(reason); } } class PDFWorkerStreamRangeReader { - constructor(e, t, i) { - this._msgHandler = i; + constructor(begin, end, msgHandler) { + this._msgHandler = msgHandler; this.onProgress = null; - const a = this._msgHandler.sendWithStream("GetRangeReader", { - begin: e, - end: t, + const readableStream = this._msgHandler.sendWithStream("GetRangeReader", { + begin, + end, }); - this._reader = a.getReader(); + this._reader = readableStream.getReader(); } get isStreamingSupported() { - return !1; + return false; } async read() { - const { value: e, done: t } = await this._reader.read(); - return t ? { value: void 0, done: !0 } : { value: e.buffer, done: !1 }; + const { value, done } = await this._reader.read(); + if (done) { + return { + value: undefined, + done: true, + }; + } + return { + value: value.buffer, + done: false, + }; } - cancel(e) { - this._reader.cancel(e); + cancel(reason) { + this._reader.cancel(reason); } -} +} // ./src/core/worker.js + class WorkerTask { - constructor(e) { - this.name = e; - this.terminated = !1; + constructor(name) { + this.name = name; + this.terminated = false; this._capability = Promise.withResolvers(); } get finished() { @@ -56382,609 +68661,702 @@ class WorkerTask { this._capability.resolve(); } terminate() { - this.terminated = !0; + this.terminated = true; } ensureNotTerminated() { - if (this.terminated) throw new Error("Worker task was terminated"); + if (this.terminated) { + throw new Error("Worker task was terminated"); + } } } class WorkerMessageHandler { - static setup(e, t) { - let i = !1; - e.on("test", function (t) { - if (!i) { - i = !0; - e.send("test", t instanceof Uint8Array); + static setup(handler, port) { + let testMessageProcessed = false; + handler.on("test", function (data) { + if (testMessageProcessed) { + return; } + testMessageProcessed = true; + handler.send("test", data instanceof Uint8Array); }); - e.on("configure", function (e) { - !(function setVerbosityLevel(e) { - Number.isInteger(e) && (st = e); - })(e.verbosity); + handler.on("configure", function (data) { + setVerbosityLevel(data.verbosity); }); - e.on("GetDocRequest", function (e) { - return WorkerMessageHandler.createDocumentHandler(e, t); + handler.on("GetDocRequest", function (data) { + return WorkerMessageHandler.createDocumentHandler(data, port); }); } - static createDocumentHandler(e, t) { - let i, - a = !1, - s = null; - const r = new Set(), - n = getVerbosityLevel(), - { docId: g, apiVersion: o } = e, - c = "4.4.168"; - if (o !== c) + static createDocumentHandler(docParams, port) { + let pdfManager; + let terminated = false; + let cancelXHRs = null; + const WorkerTasks = new Set(); + const verbosity = getVerbosityLevel(); + const { docId, apiVersion } = docParams; + const workerVersion = "4.8.69"; + if (apiVersion !== workerVersion) { throw new Error( - `The API version "${o}" does not match the Worker version "${c}".`, + `The API version "${apiVersion}" does not match ` + + `the Worker version "${workerVersion}".`, ); - const C = []; - for (const e in []) C.push(e); - if (C.length) + } + const enumerableProperties = []; + for (const property in []) { + enumerableProperties.push(property); + } + if (enumerableProperties.length) { throw new Error( "The `Array.prototype` contains unexpected enumerable properties: " + - C.join(", ") + + enumerableProperties.join(", ") + "; thus breaking e.g. `for...in` iteration of `Array`s.", ); - const h = g + "_worker"; - let l = new MessageHandler(h, g, t); + } + const workerHandlerName = docId + "_worker"; + let handler = new MessageHandler(workerHandlerName, docId, port); function ensureNotTerminated() { - if (a) throw new Error("Worker was terminated"); + if (terminated) { + throw new Error("Worker was terminated"); + } } - function startWorkerTask(e) { - r.add(e); + function startWorkerTask(task) { + WorkerTasks.add(task); } - function finishWorkerTask(e) { - e.finish(); - r.delete(e); + function finishWorkerTask(task) { + task.finish(); + WorkerTasks.delete(task); } - async function loadDocument(e) { - await i.ensureDoc("checkHeader"); - await i.ensureDoc("parseStartXRef"); - await i.ensureDoc("parse", [e]); - await i.ensureDoc("checkFirstPage", [e]); - await i.ensureDoc("checkLastPage", [e]); - const t = await i.ensureDoc("isPureXfa"); - if (t) { - const e = new WorkerTask("loadXfaFonts"); - startWorkerTask(e); + async function loadDocument(recoveryMode) { + await pdfManager.ensureDoc("checkHeader"); + await pdfManager.ensureDoc("parseStartXRef"); + await pdfManager.ensureDoc("parse", [recoveryMode]); + await pdfManager.ensureDoc("checkFirstPage", [recoveryMode]); + await pdfManager.ensureDoc("checkLastPage", [recoveryMode]); + const isPureXfa = await pdfManager.ensureDoc("isPureXfa"); + if (isPureXfa) { + const task = new WorkerTask("loadXfaFonts"); + startWorkerTask(task); await Promise.all([ - i - .loadXfaFonts(l, e) - .catch((e) => {}) - .then(() => finishWorkerTask(e)), - i.loadXfaImages(), + pdfManager + .loadXfaFonts(handler, task) + .catch((reason) => {}) + .then(() => finishWorkerTask(task)), + pdfManager.loadXfaImages(), ]); } - const [a, s] = await Promise.all([ - i.ensureDoc("numPages"), - i.ensureDoc("fingerprints"), + const [numPages, fingerprints] = await Promise.all([ + pdfManager.ensureDoc("numPages"), + pdfManager.ensureDoc("fingerprints"), ]); + const htmlForXfa = isPureXfa + ? await pdfManager.ensureDoc("htmlForXfa") + : null; return { - numPages: a, - fingerprints: s, - htmlForXfa: t ? await i.ensureDoc("htmlForXfa") : null, + numPages, + fingerprints, + htmlForXfa, }; } function getPdfManager({ - data: e, - password: t, - disableAutoFetch: i, - rangeChunkSize: a, - length: r, - docBaseUrl: n, - enableXfa: o, - evaluatorOptions: c, + data, + password, + disableAutoFetch, + rangeChunkSize, + length, + docBaseUrl, + enableXfa, + evaluatorOptions, }) { - const C = { - source: null, - disableAutoFetch: i, - docBaseUrl: n, - docId: g, - enableXfa: o, - evaluatorOptions: c, - handler: l, - length: r, - password: t, - rangeChunkSize: a, - }, - h = Promise.withResolvers(); - let Q; - if (e) { + const pdfManagerArgs = { + source: null, + disableAutoFetch, + docBaseUrl, + docId, + enableXfa, + evaluatorOptions, + handler, + length, + password, + rangeChunkSize, + }; + const pdfManagerCapability = Promise.withResolvers(); + let newPdfManager; + if (data) { try { - C.source = e; - Q = new LocalPdfManager(C); - h.resolve(Q); - } catch (e) { - h.reject(e); + pdfManagerArgs.source = data; + newPdfManager = new LocalPdfManager(pdfManagerArgs); + pdfManagerCapability.resolve(newPdfManager); + } catch (ex) { + pdfManagerCapability.reject(ex); } - return h.promise; + return pdfManagerCapability.promise; } - let E, - u = []; + let pdfStream, + cachedChunks = [], + loaded = 0; try { - E = new PDFWorkerStream(l); - } catch (e) { - h.reject(e); - return h.promise; + pdfStream = new PDFWorkerStream(handler); + } catch (ex) { + pdfManagerCapability.reject(ex); + return pdfManagerCapability.promise; } - const d = E.getFullReader(); - d.headersReady + const fullRequest = pdfStream.getFullReader(); + fullRequest.headersReady .then(function () { - if (d.isRangeSupported) { - C.source = E; - C.length = d.contentLength; - C.disableAutoFetch ||= d.isStreamingSupported; - Q = new NetworkPdfManager(C); - for (const e of u) Q.sendProgressiveData(e); - u = []; - h.resolve(Q); - s = null; + if (!fullRequest.isRangeSupported) { + return; } + pdfManagerArgs.source = pdfStream; + pdfManagerArgs.length = fullRequest.contentLength; + pdfManagerArgs.disableAutoFetch ||= fullRequest.isStreamingSupported; + newPdfManager = new NetworkPdfManager(pdfManagerArgs); + for (const chunk of cachedChunks) { + newPdfManager.sendProgressiveData(chunk); + } + cachedChunks = []; + pdfManagerCapability.resolve(newPdfManager); + cancelXHRs = null; }) - .catch(function (e) { - h.reject(e); - s = null; + .catch(function (reason) { + pdfManagerCapability.reject(reason); + cancelXHRs = null; }); - let f = 0; - new Promise(function (e, t) { - const readChunk = function ({ value: e, done: i }) { + new Promise(function (resolve, reject) { + const readChunk = function ({ value, done }) { try { ensureNotTerminated(); - if (i) { - Q || - (function () { - const e = arrayBuffersToBytes(u); - r && - e.length !== r && - warn("reported HTTP length is different from actual"); - try { - C.source = e; - Q = new LocalPdfManager(C); - h.resolve(Q); - } catch (e) { - h.reject(e); - } - u = []; - })(); - s = null; + if (done) { + if (!newPdfManager) { + const pdfFile = arrayBuffersToBytes(cachedChunks); + cachedChunks = []; + if (length && pdfFile.length !== length) { + warn("reported HTTP length is different from actual"); + } + pdfManagerArgs.source = pdfFile; + newPdfManager = new LocalPdfManager(pdfManagerArgs); + pdfManagerCapability.resolve(newPdfManager); + } + cancelXHRs = null; return; } - f += e.byteLength; - d.isStreamingSupported || - l.send("DocProgress", { - loaded: f, - total: Math.max(f, d.contentLength || 0), + loaded += value.byteLength; + if (!fullRequest.isStreamingSupported) { + handler.send("DocProgress", { + loaded, + total: Math.max(loaded, fullRequest.contentLength || 0), }); - Q ? Q.sendProgressiveData(e) : u.push(e); - d.read().then(readChunk, t); + } + if (newPdfManager) { + newPdfManager.sendProgressiveData(value); + } else { + cachedChunks.push(value); + } + fullRequest.read().then(readChunk, reject); } catch (e) { - t(e); + reject(e); } }; - d.read().then(readChunk, t); + fullRequest.read().then(readChunk, reject); }).catch(function (e) { - h.reject(e); - s = null; + pdfManagerCapability.reject(e); + cancelXHRs = null; }); - s = function (e) { - E.cancelAllRequests(e); + cancelXHRs = function (reason) { + pdfStream.cancelAllRequests(reason); }; - return h.promise; + return pdfManagerCapability.promise; } - l.on("GetPage", function (e) { - return i.getPage(e.pageIndex).then(function (e) { + function setupDoc(data) { + function onSuccess(doc) { + ensureNotTerminated(); + handler.send("GetDoc", { + pdfInfo: doc, + }); + } + function onFailure(ex) { + ensureNotTerminated(); + if (ex instanceof PasswordException) { + const task = new WorkerTask(`PasswordException: response ${ex.code}`); + startWorkerTask(task); + handler + .sendWithPromise("PasswordRequest", ex) + .then(function ({ password }) { + finishWorkerTask(task); + pdfManager.updatePassword(password); + pdfManagerReady(); + }) + .catch(function () { + finishWorkerTask(task); + handler.send("DocException", ex); + }); + } else if ( + ex instanceof InvalidPDFException || + ex instanceof MissingPDFException || + ex instanceof UnexpectedResponseException || + ex instanceof UnknownErrorException + ) { + handler.send("DocException", ex); + } else { + handler.send( + "DocException", + new UnknownErrorException(ex.message, ex.toString()), + ); + } + } + function pdfManagerReady() { + ensureNotTerminated(); + loadDocument(false).then(onSuccess, function (reason) { + ensureNotTerminated(); + if (!(reason instanceof XRefParseException)) { + onFailure(reason); + return; + } + pdfManager.requestLoadedStream().then(function () { + ensureNotTerminated(); + loadDocument(true).then(onSuccess, onFailure); + }); + }); + } + ensureNotTerminated(); + getPdfManager(data) + .then(function (newPdfManager) { + if (terminated) { + newPdfManager.terminate( + new AbortException("Worker was terminated."), + ); + throw new Error("Worker was terminated"); + } + pdfManager = newPdfManager; + pdfManager.requestLoadedStream(true).then((stream) => { + handler.send("DataLoaded", { + length: stream.bytes.byteLength, + }); + }); + }) + .then(pdfManagerReady, onFailure); + } + handler.on("GetPage", function (data) { + return pdfManager.getPage(data.pageIndex).then(function (page) { return Promise.all([ - i.ensure(e, "rotate"), - i.ensure(e, "ref"), - i.ensure(e, "userUnit"), - i.ensure(e, "view"), - ]).then(function ([e, t, i, a]) { + pdfManager.ensure(page, "rotate"), + pdfManager.ensure(page, "ref"), + pdfManager.ensure(page, "userUnit"), + pdfManager.ensure(page, "view"), + ]).then(function ([rotate, ref, userUnit, view]) { return { - rotate: e, - ref: t, - refStr: t?.toString() ?? null, - userUnit: i, - view: a, + rotate, + ref, + refStr: ref?.toString() ?? null, + userUnit, + view, }; }); }); }); - l.on("GetPageIndex", function (e) { - const t = Ref.get(e.num, e.gen); - return i.ensureCatalog("getPageIndex", [t]); + handler.on("GetPageIndex", function (data) { + const pageRef = Ref.get(data.num, data.gen); + return pdfManager.ensureCatalog("getPageIndex", [pageRef]); }); - l.on("GetDestinations", function (e) { - return i.ensureCatalog("destinations"); + handler.on("GetDestinations", function (data) { + return pdfManager.ensureCatalog("destinations"); }); - l.on("GetDestination", function (e) { - return i.ensureCatalog("getDestination", [e.id]); + handler.on("GetDestination", function (data) { + return pdfManager.ensureCatalog("getDestination", [data.id]); }); - l.on("GetPageLabels", function (e) { - return i.ensureCatalog("pageLabels"); + handler.on("GetPageLabels", function (data) { + return pdfManager.ensureCatalog("pageLabels"); }); - l.on("GetPageLayout", function (e) { - return i.ensureCatalog("pageLayout"); + handler.on("GetPageLayout", function (data) { + return pdfManager.ensureCatalog("pageLayout"); }); - l.on("GetPageMode", function (e) { - return i.ensureCatalog("pageMode"); + handler.on("GetPageMode", function (data) { + return pdfManager.ensureCatalog("pageMode"); }); - l.on("GetViewerPreferences", function (e) { - return i.ensureCatalog("viewerPreferences"); + handler.on("GetViewerPreferences", function (data) { + return pdfManager.ensureCatalog("viewerPreferences"); }); - l.on("GetOpenAction", function (e) { - return i.ensureCatalog("openAction"); + handler.on("GetOpenAction", function (data) { + return pdfManager.ensureCatalog("openAction"); }); - l.on("GetAttachments", function (e) { - return i.ensureCatalog("attachments"); + handler.on("GetAttachments", function (data) { + return pdfManager.ensureCatalog("attachments"); }); - l.on("GetDocJSActions", function (e) { - return i.ensureCatalog("jsActions"); + handler.on("GetDocJSActions", function (data) { + return pdfManager.ensureCatalog("jsActions"); }); - l.on("GetPageJSActions", function ({ pageIndex: e }) { - return i.getPage(e).then(function (e) { - return i.ensure(e, "jsActions"); + handler.on("GetPageJSActions", function ({ pageIndex }) { + return pdfManager.getPage(pageIndex).then(function (page) { + return pdfManager.ensure(page, "jsActions"); }); }); - l.on("GetOutline", function (e) { - return i.ensureCatalog("documentOutline"); + handler.on("GetOutline", function (data) { + return pdfManager.ensureCatalog("documentOutline"); }); - l.on("GetOptionalContentConfig", function (e) { - return i.ensureCatalog("optionalContentConfig"); + handler.on("GetOptionalContentConfig", function (data) { + return pdfManager.ensureCatalog("optionalContentConfig"); }); - l.on("GetPermissions", function (e) { - return i.ensureCatalog("permissions"); + handler.on("GetPermissions", function (data) { + return pdfManager.ensureCatalog("permissions"); }); - l.on("GetMetadata", function (e) { + handler.on("GetMetadata", function (data) { return Promise.all([ - i.ensureDoc("documentInfo"), - i.ensureCatalog("metadata"), + pdfManager.ensureDoc("documentInfo"), + pdfManager.ensureCatalog("metadata"), ]); }); - l.on("GetMarkInfo", function (e) { - return i.ensureCatalog("markInfo"); + handler.on("GetMarkInfo", function (data) { + return pdfManager.ensureCatalog("markInfo"); }); - l.on("GetData", function (e) { - return i.requestLoadedStream().then(function (e) { - return e.bytes; + handler.on("GetData", function (data) { + return pdfManager.requestLoadedStream().then(function (stream) { + return stream.bytes; }); }); - l.on("GetAnnotations", function ({ pageIndex: e, intent: t }) { - return i.getPage(e).then(function (i) { - const a = new WorkerTask(`GetAnnotations: page ${e}`); - startWorkerTask(a); - return i.getAnnotationsData(l, a, t).then( - (e) => { - finishWorkerTask(a); - return e; + handler.on("GetAnnotations", function ({ pageIndex, intent }) { + return pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask(`GetAnnotations: page ${pageIndex}`); + startWorkerTask(task); + return page.getAnnotationsData(handler, task, intent).then( + (data) => { + finishWorkerTask(task); + return data; }, - (e) => { - finishWorkerTask(a); - throw e; + (reason) => { + finishWorkerTask(task); + throw reason; }, ); }); }); - l.on("GetFieldObjects", function (e) { - return i.ensureDoc("fieldObjects"); + handler.on("GetFieldObjects", function (data) { + return pdfManager + .ensureDoc("fieldObjects") + .then((fieldObjects) => fieldObjects?.allFields || null); }); - l.on("HasJSActions", function (e) { - return i.ensureDoc("hasJSActions"); + handler.on("HasJSActions", function (data) { + return pdfManager.ensureDoc("hasJSActions"); }); - l.on("GetCalculationOrderIds", function (e) { - return i.ensureDoc("calculationOrderIds"); + handler.on("GetCalculationOrderIds", function (data) { + return pdfManager.ensureDoc("calculationOrderIds"); }); - l.on( + handler.on( "SaveDocument", - async function ({ - isPureXfa: e, - numPages: t, - annotationStorage: a, - filename: s, - }) { - const r = [ - i.requestLoadedStream(), - i.ensureCatalog("acroForm"), - i.ensureCatalog("acroFormRef"), - i.ensureDoc("startXRef"), - i.ensureDoc("xref"), - i.ensureDoc("linearization"), - i.ensureCatalog("structTreeRoot"), - ], - n = [], - g = e ? null : getNewAnnotationsMap(a), - [o, c, C, h, Q, E, u] = await Promise.all(r), - d = Q.trailer.getRaw("Root") || null; - let f; - if (g) { - u - ? (await u.canUpdateStructTree({ - pdfManager: i, - xref: Q, - newAnnotationsByPage: g, - })) && (f = u) - : (await StructTreeRoot.canCreateStructureTree({ - catalogRef: d, - pdfManager: i, - newAnnotationsByPage: g, - })) && (f = null); - const e = AnnotationFactory.generateImages( - a.values(), - Q, - i.evaluatorOptions.isOffscreenCanvasSupported, - ), - t = void 0 === f ? n : []; - for (const [a, s] of g) - t.push( - i.getPage(a).then((t) => { - const i = new WorkerTask(`Save (editor): page ${a}`); - return t.saveNewAnnotations(l, i, s, e).finally(function () { - finishWorkerTask(i); - }); - }), - ); - null === f - ? n.push( - Promise.all(t).then(async (e) => { - await StructTreeRoot.createStructureTree({ - newAnnotationsByPage: g, - xref: Q, - catalogRef: d, - pdfManager: i, - newRefs: e, - }); - return e; - }), - ) - : f && - n.push( - Promise.all(t).then(async (e) => { - await f.updateStructureTree({ - newAnnotationsByPage: g, - pdfManager: i, - newRefs: e, - }); - return e; - }), - ); - } - if (e) n.push(i.serializeXfaData(a)); - else - for (let e = 0; e < t; e++) - n.push( - i.getPage(e).then(function (t) { - const i = new WorkerTask(`Save: page ${e}`); - return t.save(l, i, a).finally(function () { - finishWorkerTask(i); - }); - }), - ); - const p = await Promise.all(n); - let m = [], - y = null; - if (e) { - y = p[0]; - if (!y) return o.bytes; - } else { - m = p.flat(2); - if (0 === m.length) return o.bytes; - } - const w = C && c instanceof Dict && m.some((e) => e.needAppearances), - D = (c instanceof Dict && c.get("XFA")) || null; - let b = null, - F = !1; - if (Array.isArray(D)) { - for (let e = 0, t = D.length; e < t; e += 2) - if ("datasets" === D[e]) { - b = D[e + 1]; - F = !0; + async function ({ isPureXfa, numPages, annotationStorage, filename }) { + const globalPromises = [ + pdfManager.requestLoadedStream(), + pdfManager.ensureCatalog("acroForm"), + pdfManager.ensureCatalog("acroFormRef"), + pdfManager.ensureDoc("startXRef"), + pdfManager.ensureDoc("xref"), + pdfManager.ensureDoc("linearization"), + pdfManager.ensureCatalog("structTreeRoot"), + ]; + const promises = []; + const newAnnotationsByPage = !isPureXfa + ? getNewAnnotationsMap(annotationStorage) + : null; + const [ + stream, + acroForm, + acroFormRef, + startXRef, + xref, + linearization, + _structTreeRoot, + ] = await Promise.all(globalPromises); + const catalogRef = xref.trailer.getRaw("Root") || null; + let structTreeRoot; + if (newAnnotationsByPage) { + if (!_structTreeRoot) { + if ( + await StructTreeRoot.canCreateStructureTree({ + catalogRef, + pdfManager, + newAnnotationsByPage, + }) + ) { + structTreeRoot = null; } - null === b && (b = Q.getNewTemporaryRef()); - } else D && warn("Unsupported XFA type."); - let S = Object.create(null); - if (Q.trailer) { - const e = Object.create(null), - t = Q.trailer.get("Info") || null; - t instanceof Dict && - t.forEach((t, i) => { - "string" == typeof i && (e[t] = stringToPDFString(i)); + } else if ( + await _structTreeRoot.canUpdateStructTree({ + pdfManager, + xref, + newAnnotationsByPage, + }) + ) { + structTreeRoot = _structTreeRoot; + } + const imagePromises = AnnotationFactory.generateImages( + annotationStorage.values(), + xref, + pdfManager.evaluatorOptions.isOffscreenCanvasSupported, + ); + const newAnnotationPromises = + structTreeRoot === undefined ? promises : []; + for (const [pageIndex, annotations] of newAnnotationsByPage) { + newAnnotationPromises.push( + pdfManager.getPage(pageIndex).then((page) => { + const task = new WorkerTask(`Save (editor): page ${pageIndex}`); + return page + .saveNewAnnotations(handler, task, annotations, imagePromises) + .finally(function () { + finishWorkerTask(task); + }); + }), + ); + } + if (structTreeRoot === null) { + promises.push( + Promise.all(newAnnotationPromises).then(async (newRefs) => { + await StructTreeRoot.createStructureTree({ + newAnnotationsByPage, + xref, + catalogRef, + pdfManager, + newRefs, + }); + return newRefs; + }), + ); + } else if (structTreeRoot) { + promises.push( + Promise.all(newAnnotationPromises).then(async (newRefs) => { + await structTreeRoot.updateStructureTree({ + newAnnotationsByPage, + pdfManager, + newRefs, + }); + return newRefs; + }), + ); + } + } + if (isPureXfa) { + promises.push(pdfManager.serializeXfaData(annotationStorage)); + } else { + for (let pageIndex = 0; pageIndex < numPages; pageIndex++) { + promises.push( + pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask(`Save: page ${pageIndex}`); + return page + .save(handler, task, annotationStorage) + .finally(function () { + finishWorkerTask(task); + }); + }), + ); + } + } + const refs = await Promise.all(promises); + let newRefs = []; + let xfaData = null; + if (isPureXfa) { + xfaData = refs[0]; + if (!xfaData) { + return stream.bytes; + } + } else { + newRefs = refs.flat(2); + if (newRefs.length === 0) { + return stream.bytes; + } + } + const needAppearances = + acroFormRef && + acroForm instanceof Dict && + newRefs.some((ref) => ref.needAppearances); + const xfa = (acroForm instanceof Dict && acroForm.get("XFA")) || null; + let xfaDatasetsRef = null; + let hasXfaDatasetsEntry = false; + if (Array.isArray(xfa)) { + for (let i = 0, ii = xfa.length; i < ii; i += 2) { + if (xfa[i] === "datasets") { + xfaDatasetsRef = xfa[i + 1]; + hasXfaDatasetsEntry = true; + } + } + if (xfaDatasetsRef === null) { + xfaDatasetsRef = xref.getNewTemporaryRef(); + } + } else if (xfa) { + warn("Unsupported XFA type."); + } + let newXrefInfo = Object.create(null); + if (xref.trailer) { + const infoObj = Object.create(null); + const xrefInfo = xref.trailer.get("Info") || null; + if (xrefInfo instanceof Dict) { + xrefInfo.forEach((key, value) => { + if (typeof value === "string") { + infoObj[key] = stringToPDFString(value); + } }); - S = { - rootRef: d, - encryptRef: Q.trailer.getRaw("Encrypt") || null, - newRef: Q.getNewTemporaryRef(), - infoRef: Q.trailer.getRaw("Info") || null, - info: e, - fileIds: Q.trailer.get("ID") || null, - startXRef: E ? h : (Q.lastXRefStreamPos ?? h), - filename: s, + } + newXrefInfo = { + rootRef: catalogRef, + encryptRef: xref.trailer.getRaw("Encrypt") || null, + newRef: xref.getNewTemporaryRef(), + infoRef: xref.trailer.getRaw("Info") || null, + info: infoObj, + fileIds: xref.trailer.get("ID") || null, + startXRef: linearization + ? startXRef + : (xref.lastXRefStreamPos ?? startXRef), + filename, }; } return incrementalUpdate({ - originalData: o.bytes, - xrefInfo: S, - newRefs: m, - xref: Q, - hasXfa: !!D, - xfaDatasetsRef: b, - hasXfaDatasetsEntry: F, - needAppearances: w, - acroFormRef: C, - acroForm: c, - xfaData: y, - useXrefStream: isDict(Q.topDict, "XRef"), + originalData: stream.bytes, + xrefInfo: newXrefInfo, + newRefs, + xref, + hasXfa: !!xfa, + xfaDatasetsRef, + hasXfaDatasetsEntry, + needAppearances, + acroFormRef, + acroForm, + xfaData, + useXrefStream: isDict(xref.topDict, "XRef"), }).finally(() => { - Q.resetNewTemporaryRef(); + xref.resetNewTemporaryRef(); }); }, ); - l.on("GetOperatorList", function (e, t) { - const a = e.pageIndex; - i.getPage(a).then(function (i) { - const s = new WorkerTask(`GetOperatorList: page ${a}`); - startWorkerTask(s); - const r = n >= pA.INFOS ? Date.now() : 0; - i.getOperatorList({ - handler: l, - sink: t, - task: s, - intent: e.intent, - cacheKey: e.cacheKey, - annotationStorage: e.annotationStorage, - }).then( - function (e) { - finishWorkerTask(s); - r && - info( - `page=${a + 1} - getOperatorList: time=${Date.now() - r}ms, len=${e.length}`, - ); - t.close(); - }, - function (e) { - finishWorkerTask(s); - s.terminated || t.error(e); - }, - ); - }); - }); - l.on("GetTextContent", function (e, t) { - const { - pageIndex: a, - includeMarkedContent: s, - disableNormalization: r, - } = e; - i.getPage(a).then(function (e) { - const i = new WorkerTask("GetTextContent: page " + a); - startWorkerTask(i); - const g = n >= pA.INFOS ? Date.now() : 0; - e.extractTextContent({ - handler: l, - task: i, - sink: t, - includeMarkedContent: s, - disableNormalization: r, - }).then( - function () { - finishWorkerTask(i); - g && - info( - `page=${a + 1} - getTextContent: time=` + - (Date.now() - g) + - "ms", - ); - t.close(); - }, - function (e) { - finishWorkerTask(i); - i.terminated || t.error(e); - }, - ); - }); - }); - l.on("GetStructTree", function (e) { - return i.getPage(e.pageIndex).then(function (e) { - return i.ensure(e, "getStructTree"); - }); - }); - l.on("FontFallback", function (e) { - return i.fontFallback(e.id, l); - }); - l.on("Cleanup", function (e) { - return i.cleanup(!0); - }); - l.on("Terminate", function (e) { - a = !0; - const t = []; - if (i) { - i.terminate(new AbortException("Worker was terminated.")); - const e = i.cleanup(); - t.push(e); - i = null; - } else clearGlobalCaches(); - s && s(new AbortException("Worker was terminated.")); - for (const e of r) { - t.push(e.finished); - e.terminate(); - } - return Promise.all(t).then(function () { - l.destroy(); - l = null; - }); - }); - l.on("Ready", function (t) { - !(function setupDoc(e) { - function onSuccess(e) { - ensureNotTerminated(); - l.send("GetDoc", { pdfInfo: e }); - } - function onFailure(e) { - ensureNotTerminated(); - if (e instanceof PasswordException) { - const t = new WorkerTask(`PasswordException: response ${e.code}`); - startWorkerTask(t); - l.sendWithPromise("PasswordRequest", e) - .then(function ({ password: e }) { - finishWorkerTask(t); - i.updatePassword(e); - pdfManagerReady(); - }) - .catch(function () { - finishWorkerTask(t); - l.send("DocException", e); - }); - } else - e instanceof InvalidPDFException || - e instanceof MissingPDFException || - e instanceof UnexpectedResponseException || - e instanceof UnknownErrorException - ? l.send("DocException", e) - : l.send( - "DocException", - new UnknownErrorException(e.message, e.toString()), - ); - } - function pdfManagerReady() { - ensureNotTerminated(); - loadDocument(!1).then(onSuccess, function (e) { - ensureNotTerminated(); - e instanceof XRefParseException - ? i.requestLoadedStream().then(function () { - ensureNotTerminated(); - loadDocument(!0).then(onSuccess, onFailure); - }) - : onFailure(e); - }); - } - ensureNotTerminated(); - getPdfManager(e) - .then(function (e) { - if (a) { - e.terminate(new AbortException("Worker was terminated.")); - throw new Error("Worker was terminated"); - } - i = e; - i.requestLoadedStream(!0).then((e) => { - l.send("DataLoaded", { length: e.bytes.byteLength }); - }); + handler.on("GetOperatorList", function (data, sink) { + const pageIndex = data.pageIndex; + pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask(`GetOperatorList: page ${pageIndex}`); + startWorkerTask(task); + const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0; + page + .getOperatorList({ + handler, + sink, + task, + intent: data.intent, + cacheKey: data.cacheKey, + annotationStorage: data.annotationStorage, + modifiedIds: data.modifiedIds, }) - .then(pdfManagerReady, onFailure); - })(e); - e = null; + .then( + function (operatorListInfo) { + finishWorkerTask(task); + if (start) { + info( + `page=${pageIndex + 1} - getOperatorList: time=` + + `${Date.now() - start}ms, len=${operatorListInfo.length}`, + ); + } + sink.close(); + }, + function (reason) { + finishWorkerTask(task); + if (task.terminated) { + return; + } + sink.error(reason); + }, + ); + }); }); - return h; + handler.on("GetTextContent", function (data, sink) { + const { pageIndex, includeMarkedContent, disableNormalization } = data; + pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask("GetTextContent: page " + pageIndex); + startWorkerTask(task); + const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0; + page + .extractTextContent({ + handler, + task, + sink, + includeMarkedContent, + disableNormalization, + }) + .then( + function () { + finishWorkerTask(task); + if (start) { + info( + `page=${pageIndex + 1} - getTextContent: time=` + + `${Date.now() - start}ms`, + ); + } + sink.close(); + }, + function (reason) { + finishWorkerTask(task); + if (task.terminated) { + return; + } + sink.error(reason); + }, + ); + }); + }); + handler.on("GetStructTree", function (data) { + return pdfManager.getPage(data.pageIndex).then(function (page) { + return pdfManager.ensure(page, "getStructTree"); + }); + }); + handler.on("FontFallback", function (data) { + return pdfManager.fontFallback(data.id, handler); + }); + handler.on("Cleanup", function (data) { + return pdfManager.cleanup(true); + }); + handler.on("Terminate", function (data) { + terminated = true; + const waitOn = []; + if (pdfManager) { + pdfManager.terminate(new AbortException("Worker was terminated.")); + const cleanupPromise = pdfManager.cleanup(); + waitOn.push(cleanupPromise); + pdfManager = null; + } else { + clearGlobalCaches(); + } + cancelXHRs?.(new AbortException("Worker was terminated.")); + for (const task of WorkerTasks) { + waitOn.push(task.finished); + task.terminate(); + } + return Promise.all(waitOn).then(function () { + handler.destroy(); + handler = null; + }); + }); + handler.on("Ready", function (data) { + setupDoc(docParams); + docParams = null; + }); + return workerHandlerName; } - static initializeFromPort(e) { - const t = new MessageHandler("worker", "main", e); - WorkerMessageHandler.setup(t, e); - t.send("ready", null); + static initializeFromPort(port) { + const handler = new MessageHandler("worker", "main", port); + WorkerMessageHandler.setup(handler, port); + handler.send("ready", null); } } -"undefined" == typeof window && - !t && - "undefined" != typeof self && - (function isMessagePort(e) { - return "function" == typeof e.postMessage && "onmessage" in e; - })(self) && +function isMessagePort(maybePort) { + return ( + typeof maybePort.postMessage === "function" && "onmessage" in maybePort + ); +} +if ( + typeof window === "undefined" && + !isNodeJS && + typeof self !== "undefined" && + isMessagePort(self) +) { WorkerMessageHandler.initializeFromPort(self); -var dg = __webpack_exports__.WorkerMessageHandler; -export { dg as WorkerMessageHandler }; +} // ./src/pdf.worker.js + +const pdfjsVersion = "4.8.69"; +const pdfjsBuild = "3634dab10"; + +var __webpack_exports__WorkerMessageHandler = + __webpack_exports__.WorkerMessageHandler; +export { __webpack_exports__WorkerMessageHandler as WorkerMessageHandler }; + +//# sourceMappingURL=pdf.worker.mjs.map diff --git a/web-app/build/static/css/main.e60e4760.css.map b/web-app/build/static/css/main.e60e4760.css.map index 81cdbb9f4..9de7e5444 100644 --- a/web-app/build/static/css/main.e60e4760.css.map +++ b/web-app/build/static/css/main.e60e4760.css.map @@ -1 +1 @@ -{"version":3,"file":"static/css/main.e60e4760.css","mappings":"AAwBA,oCACE,eAAgB,CAChB,wBAIF,CACA,kEAFE,kBAAmB,CAFnB,YAAa,CACb,kBAOF,CAEA,8CACE,oBAAqB,CACrB,cAAe,CAGf,eAAgB,CADhB,sBAAuB,CADvB,kBAGF,CAEA,2EAEE,iBAAkB,CAClB,WACF,CACA,oCACE,sBAAuB,CACvB,kBACF,CAEA,uGAEE,gBACF,CACA,+CACE,cACF,CAEA,sDAEE,kBAAmB,CADnB,YAEF,CACA,6CAIE,iBAAkB,CAHlB,aAAc,CACd,UAAW,CACX,SAEF,CCxEA,KAGE,kCAAmC,CACnC,iCAAkC,CAFlC,4BAAgC,CADhC,QAIF,CAEA,KACE,uEAEF,CAGA,0LAIE,uBAAwB,CACxB,QACF,CAGA,iEAEE,yBACF","sources":["../node_modules/react-virtualized/source/styles.css","index.css"],"sourcesContent":["/* Collection default theme */\n\n.ReactVirtualized__Collection {\n}\n\n.ReactVirtualized__Collection__innerScrollContainer {\n}\n\n/* Grid default theme */\n\n.ReactVirtualized__Grid {\n}\n\n.ReactVirtualized__Grid__innerScrollContainer {\n}\n\n/* Table default theme */\n\n.ReactVirtualized__Table {\n}\n\n.ReactVirtualized__Table__Grid {\n}\n\n.ReactVirtualized__Table__headerRow {\n font-weight: 700;\n text-transform: uppercase;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ReactVirtualized__Table__row {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.ReactVirtualized__Table__headerTruncatedText {\n display: inline-block;\n max-width: 100%;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.ReactVirtualized__Table__headerColumn,\n.ReactVirtualized__Table__rowColumn {\n margin-right: 10px;\n min-width: 0px;\n}\n.ReactVirtualized__Table__rowColumn {\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.ReactVirtualized__Table__headerColumn:first-of-type,\n.ReactVirtualized__Table__rowColumn:first-of-type {\n margin-left: 10px;\n}\n.ReactVirtualized__Table__sortableHeaderColumn {\n cursor: pointer;\n}\n\n.ReactVirtualized__Table__sortableHeaderIconContainer {\n display: flex;\n align-items: center;\n}\n.ReactVirtualized__Table__sortableHeaderIcon {\n flex: 0 0 24px;\n height: 1em;\n width: 1em;\n fill: currentColor;\n}\n\n/* List default theme */\n\n.ReactVirtualized__List {\n}\n","body {\n margin: 0;\n font-family: \"Inter\", sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n}\n\n/* Chrome, Safari, Edge, Opera */\ninput.removeArrows::-webkit-outer-spin-button,\ninput.removeArrows::-webkit-inner-spin-button,\n.removeArrows input::-webkit-outer-spin-button,\n.removeArrows input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n/* Firefox */\ninput.removeArrows[type=\"number\"],\n.removeArrows input[type=\"number\"] {\n -moz-appearance: textfield;\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"static/css/main.e60e4760.css","mappings":"AAwBA,oCACE,eAAgB,CAChB,wBAIF,CACA,kEAFE,kBAAmB,CAFnB,YAAa,CACb,kBAOF,CAEA,8CACE,oBAAqB,CACrB,cAAe,CAGf,eAAgB,CADhB,sBAAuB,CADvB,kBAGF,CAEA,2EAEE,iBAAkB,CAClB,WACF,CACA,oCACE,sBAAuB,CACvB,kBACF,CAEA,uGAEE,gBACF,CACA,+CACE,cACF,CAEA,sDAEE,kBAAmB,CADnB,YAEF,CACA,6CAIE,iBAAkB,CAHlB,aAAc,CACd,UAAW,CACX,SAEF,CCxEA,KAGE,kCAAmC,CACnC,iCAAkC,CAFlC,4BAAgC,CADhC,QAIF,CAEA,KACE,uEAEF,CAGA,0LAIE,uBAAwB,CACxB,QACF,CAGA,iEAEE,yBACF","sources":["../node_modules/react-virtualized/source/styles.css","index.css"],"sourcesContent":["/* Collection default theme */\n\n.ReactVirtualized__Collection {\n}\n\n.ReactVirtualized__Collection__innerScrollContainer {\n}\n\n/* Grid default theme */\n\n.ReactVirtualized__Grid {\n}\n\n.ReactVirtualized__Grid__innerScrollContainer {\n}\n\n/* Table default theme */\n\n.ReactVirtualized__Table {\n}\n\n.ReactVirtualized__Table__Grid {\n}\n\n.ReactVirtualized__Table__headerRow {\n font-weight: 700;\n text-transform: uppercase;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ReactVirtualized__Table__row {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.ReactVirtualized__Table__headerTruncatedText {\n display: inline-block;\n max-width: 100%;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.ReactVirtualized__Table__headerColumn,\n.ReactVirtualized__Table__rowColumn {\n margin-right: 10px;\n min-width: 0px;\n}\n.ReactVirtualized__Table__rowColumn {\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.ReactVirtualized__Table__headerColumn:first-of-type,\n.ReactVirtualized__Table__rowColumn:first-of-type {\n margin-left: 10px;\n}\n.ReactVirtualized__Table__sortableHeaderColumn {\n cursor: pointer;\n}\n\n.ReactVirtualized__Table__sortableHeaderIconContainer {\n display: flex;\n align-items: center;\n}\n.ReactVirtualized__Table__sortableHeaderIcon {\n flex: 0 0 24px;\n height: 1em;\n width: 1em;\n fill: currentColor;\n}\n\n/* List default theme */\n\n.ReactVirtualized__List {\n}\n","body {\n margin: 0;\n font-family: \"Inter\", sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family:\n source-code-pro, Menlo, Monaco, Consolas, \"Courier New\", monospace;\n}\n\n/* Chrome, Safari, Edge, Opera */\ninput.removeArrows::-webkit-outer-spin-button,\ninput.removeArrows::-webkit-inner-spin-button,\n.removeArrows input::-webkit-outer-spin-button,\n.removeArrows input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n/* Firefox */\ninput.removeArrows[type=\"number\"],\n.removeArrows input[type=\"number\"] {\n -moz-appearance: textfield;\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/1011.75fdf45e.chunk.js b/web-app/build/static/js/1011.75fdf45e.chunk.js deleted file mode 100644 index 186dbb3c2..000000000 --- a/web-app/build/static/js/1011.75fdf45e.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[1011],{99956:(e,t,o)=>{"use strict";o.d(t,{X:()=>i});o(65043);var n=o(24241),r=o(70579);const i=[{label:"Access Key",elementKey:"accessKey"},{label:"Expiry",elementKey:"expiration",renderFunction:e=>{if("1970-01-01T00:00:00Z"!==e){const t=n.c9.fromISO(e).toUTC().toFormat("y/M/d hh:mm:ss z");return(0,r.jsx)("span",{title:t,children:t})}return(0,r.jsx)("span",{children:"no-expiry"})}},{label:"Status",elementKey:"accountStatus",renderFunction:e=>"off"===e?"Disabled":"Enabled"},{label:"Name",elementKey:"name"},{label:"Description",elementKey:"description"}]},10158:(e,t,o)=>{"use strict";o.d(t,{A:()=>m});var n=o(65043),r=o(89923),i=o(56629),a=o(53518),l=o(41206),c=o(21383),s=o(64159),u=o(94141),p=o(77403),d=o(24241),f=o(70579);const m=e=>{let{open:t,selectedAccessKey:o,closeModalAndRefresh:m}=e;const y=(0,c.jL)(),[h,b]=(0,n.useState)(!1),[g,x]=(0,n.useState)(""),[v,C]=(0,n.useState)(""),[S,w]=(0,n.useState)(""),[j,k]=(0,n.useState)(),[E,_]=(0,n.useState)("enabled");(0,n.useEffect)((()=>{h||""===o||(b(!0),i.F.serviceAccounts.getServiceAccount(o||"").then((e=>{b(!1);const t=e.data;C((null===t||void 0===t?void 0:t.name)||""),null!==t&&void 0!==t&&t.expiration&&k(d.c9.fromISO(null===t||void 0===t?void 0:t.expiration)),w((null===t||void 0===t?void 0:t.description)||""),_(t.accountStatus),x(t.policy||"")})).catch((e=>{b(!1),y((0,s.Dy)((0,a.S)(e)))})))}),[o]);return(0,f.jsx)(u.A,{title:`Edit details of - ${o}`,modalOpen:t,onClose:()=>{m()},titleIcon:(0,f.jsx)(r.uYH,{}),children:(0,f.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{var t;t=g,e.preventDefault(),i.F.serviceAccounts.updateServiceAccount(o||"",{policy:t,description:S,expiry:j,name:v,status:E}).then((()=>{m()})).catch((async e=>{const t=await e.json();y((0,s.C9)((0,a.S)(t)))}))},children:(0,f.jsxs)(r.xA9,{container:!0,children:[(0,f.jsx)(r.xA9,{item:!0,xs:12,children:(0,f.jsx)(l.A,{label:"Access Key Policy",value:g,onChange:e=>{x(e)},editorHeight:"350px",helptip:(0,f.jsx)(n.Fragment,{children:(0,f.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/kubernetes/upstream/administration/identity-access-management/policy-based-access-control.html#policy-document-structure",children:"Guide to access policy structure"})})})}),(0,f.jsx)(r.azJ,{sx:{marginBottom:"15px",marginTop:"15px",display:"flex",width:"100%","& label":{width:"195px"}},children:(0,f.jsx)(r.e8j,{noLabelMinWidth:!0,value:j,onChange:e=>{k(e)},id:"expiryTime",label:"Expiry",timeFormat:"24h",secondsSelector:!1})}),(0,f.jsx)(r.xA9,{xs:12,sx:{marginBottom:"15px"},children:(0,f.jsx)(r.cl_,{value:v,size:120,label:"Name",id:"name",name:"name",type:"text",placeholder:"Enter a name",onChange:e=>{C(e.target.value)}})}),(0,f.jsx)(r.xA9,{xs:12,sx:{marginBottom:"15px"},children:(0,f.jsx)(r.cl_,{size:120,value:S,label:"Description",id:"description",name:"description",type:"text",placeholder:"Enter a description",onChange:e=>{w(e.target.value)}})}),(0,f.jsxs)(r.xA9,{xs:12,sx:{display:"flex",alignItems:"center",justifyContent:"start",fontWeight:600,color:"rgb(7, 25, 62)",gap:2,marginBottom:"15px"},children:[(0,f.jsx)("label",{style:{width:"150px"},children:"Status"}),(0,f.jsx)(r.azJ,{sx:{padding:"2px"},children:(0,f.jsx)(r.dOG,{style:{gap:"115px"},indicatorLabels:["Enabled","Disabled"],checked:"on"===E,id:"saStatus",name:"saStatus",label:"",onChange:e=>{_(e.target.checked?"on":"off")},value:"yes"})})]}),(0,f.jsxs)(r.xA9,{item:!0,xs:12,sx:p.Uz.modalButtonBar,children:[(0,f.jsx)(r.$nd,{id:"cancel-sa-policy",type:"button",variant:"regular",onClick:()=>{m()},disabled:h,label:"Cancel"}),(0,f.jsx)(r.$nd,{id:"save-sa-policy",type:"submit",variant:"callAction",color:"primary",disabled:h,label:"Update"})]})]})})})}},72237:(e,t,o)=>{"use strict";o.d(t,{A:()=>i});var n=o(65043),r=o(70579);const i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(o){return(0,r.jsx)(n.Suspense,{fallback:t,children:(0,r.jsx)(e,{...o})})}}},41206:(e,t,o)=>{"use strict";o.d(t,{A:()=>s});var n=o(65043),r=o(89923),i=o(61476),a=o.n(i),l=o(6681),c=o(70579);const s=e=>{let{value:t,label:o="",tooltip:i="",mode:s="json",onChange:u,editorHeight:p=250,helptip:d}=e;return(0,c.jsx)(r.BYM,{value:t,onChange:e=>u(e),mode:s,tooltip:i,editorHeight:p,label:o,helpTools:(0,c.jsx)(n.Fragment,{children:(0,c.jsx)(l.A,{tooltip:"Copy to Clipboard",children:(0,c.jsx)(a(),{text:t,children:(0,c.jsx)(r.$nd,{type:"button",id:"copy-code-mirror",icon:(0,c.jsx)(r.TdU,{}),color:"primary",variant:"regular"})})})}),helpTip:d,helpTipPlacement:"right"})}},94141:(e,t,o)=>{"use strict";o.d(t,{A:()=>u});var n=o(65043),r=o(22166),i=o(89923),a=o(21383),l=o(64159),c=o(49555),s=o(70579);const u=e=>{let{onClose:t,modalOpen:o,title:u,children:p,wideLimit:d=!0,titleIcon:f=null,iconColor:m="default",sx:y}=e;const h=(0,a.jL)(),[b,g]=(0,n.useState)(!1),x=(0,r.d4)((e=>e.system.modalSnackBar));(0,n.useEffect)((()=>{h((0,l.h0)(""))}),[h]),(0,n.useEffect)((()=>{if(x){if(""===x.message)return void g(!1);"error"!==x.type&&g(!0)}}),[x]);let v="";return x&&(v=x.detailedErrorMsg,(""===v||v&&v.length<5)&&(v=x.message)),(0,s.jsxs)(i.ngX,{onClose:t,open:o,title:u,titleIcon:f,widthLimit:d,sx:y,iconColor:m,children:[(0,s.jsx)(c.A,{isModal:!0}),(0,s.jsx)(i.qb_,{onClose:()=>{g(!1),h((0,l.h0)(""))},open:b,message:v,mode:"inline",variant:"error"===x.type?"error":"default",autoHideDuration:"error"===x.type?10:5,condensed:!0}),p]})}},45479:(e,t,o)=>{"use strict";o.d(t,{Ck:()=>i,PE:()=>a,Qm:()=>c,Xm:()=>l,uu:()=>s});o(65043);var n=o(89923),r=o(70579);const i=[{icon:(0,r.jsx)(n.DzZ,{}),configuration_id:"region",configuration_label:"Region"},{icon:(0,r.jsx)(n.MZJ,{}),configuration_id:"compression",configuration_label:"Compression"},{icon:(0,r.jsx)(n.loI,{}),configuration_id:"api",configuration_label:"API"},{icon:(0,r.jsx)(n.qm4,{}),configuration_id:"heal",configuration_label:"Heal"},{icon:(0,r.jsx)(n.Pq3,{}),configuration_id:"scanner",configuration_label:"Scanner"},{icon:(0,r.jsx)(n.RYV,{}),configuration_id:"etcd",configuration_label:"Etcd"},{icon:(0,r.jsx)(n.D0K,{}),configuration_id:"logger_webhook",configuration_label:"Logger Webhook"},{icon:(0,r.jsx)(n.rBG,{}),configuration_id:"audit_webhook",configuration_label:"Audit Webhook"},{icon:(0,r.jsx)(n.Dk$,{}),configuration_id:"audit_kafka",configuration_label:"Audit Kafka"}],a={region:[{name:"name",required:!0,label:"Server Location",tooltip:'Name of the location of the server e.g. "us-west-rack2"',type:"string",placeholder:"e.g. us-west-rack-2"},{name:"comment",required:!1,label:"Comment",tooltip:"You can add a comment to this setting",type:"comment",placeholder:"Enter custom notes if any"}],compression:[{name:"extensions",required:!1,label:"Extensions",tooltip:'Extensions to compress e.g. ".txt", ".log" or ".csv" - you can write one per field',type:"csv",placeholder:"Enter an Extension",withBorder:!0},{name:"mime_types",required:!1,label:"Mime Types",tooltip:'Mime types e.g. "text/*", "application/json" or "application/xml" - you can write one per field',type:"csv",placeholder:"Enter a Mime Type",withBorder:!0}],api:[{name:"requests_max",required:!1,label:"Requests Max",tooltip:"Maximum number of concurrent requests, e.g. '1600'",type:"number",placeholder:"Enter Requests Max"},{name:"cors_allow_origin",required:!1,label:"Cors Allow Origin",tooltip:"List of origins allowed for CORS requests",type:"csv",placeholder:"Enter allowed origin e.g. https://example.com"},{name:"replication_workers",required:!1,label:"Replication Workers",tooltip:"Number of replication workers, defaults to 100",type:"number",placeholder:"Enter Replication Workers"},{name:"replication_failed_workers",required:!1,label:"Replication Failed Workers",tooltip:"Number of replication workers for recently failed replicas, defaults to 4",type:"number",placeholder:"Enter Replication Failed Workers"}],heal:[{name:"bitrotscan",required:!1,label:"Bitrot Scan",tooltip:"Perform bitrot scan on disks when checking objects during scanner",type:"on|off"},{name:"max_sleep",required:!1,label:"Max Sleep",tooltip:"Maximum sleep duration between objects to slow down heal operation, e.g. 2s",type:"duration",placeholder:"Enter Max Sleep Duration"},{name:"max_io",required:!1,label:"Max IO",tooltip:"Maximum IO requests allowed between objects to slow down heal operation, e.g. 3",type:"number",placeholder:"Enter Max IO"}],scanner:[{name:"delay",required:!1,label:"Delay Multiplier",tooltip:"Scanner delay multiplier, defaults to '10.0'",type:"number",placeholder:"Enter Delay"},{name:"max_wait",required:!1,label:"Max Wait",tooltip:"Maximum wait time between operations, defaults to '15s'",type:"duration",placeholder:"Enter Max Wait"},{name:"cycle",required:!1,label:"Cycle",tooltip:"Time duration between scanner cycles, defaults to '1m'",type:"duration",placeholder:"Enter Cycle"}],etcd:[{name:"endpoints",required:!0,label:"Endpoints",tooltip:'List of etcd endpoints e.g. "http://localhost:2379" - you can write one per field',type:"csv",placeholder:"Enter Endpoint"},{name:"path_prefix",required:!1,label:"Path Prefix",tooltip:'Namespace prefix to isolate tenants e.g. "customer1/"',type:"string",placeholder:"Enter Path Prefix"},{name:"coredns_path",required:!1,label:"Coredns Path",tooltip:'Shared bucket DNS records, default is "/skydns"',type:"string",placeholder:"Enter Coredns Path"},{name:"client_cert",required:!1,label:"Client Cert",tooltip:"Client cert for mTLS authentication",type:"string",placeholder:"Enter Client Cert"},{name:"client_cert_key",required:!1,label:"Client Cert Key",tooltip:"Client cert key for mTLS authentication",type:"string",placeholder:"Enter Client Cert Key"},{name:"comment",required:!1,label:"Comment",tooltip:"You can add a comment to this setting",type:"comment",multiline:!0,placeholder:"Enter custom notes if any"}],logger_webhook:[{name:"endpoint",required:!0,label:"Endpoint",type:"string",placeholder:"Enter Endpoint"},{name:"auth_token",required:!0,label:"Auth Token",type:"string",placeholder:"Enter Auth Token"}],audit_webhook:[{name:"endpoint",required:!0,label:"Endpoint",type:"string",placeholder:"Enter Endpoint"},{name:"auth_token",required:!0,label:"Auth Token",type:"string",placeholder:"Enter Auth Token"}],audit_kafka:[{name:"enable",required:!1,label:"Enable",tooltip:"Enable audit_kafka target",type:"on|off",customValueProcess:e=>""===e||"on"===e?"on":"off"},{name:"brokers",required:!0,label:"Brokers",type:"csv",placeholder:"Enter Kafka Broker"},{name:"topic",required:!1,label:"Topic",type:"string",placeholder:"Enter Kafka Topic",tooltip:"Kafka topic used for bucket notifications"},{name:"sasl",required:!1,label:"Use SASL",tooltip:"Enable SASL (Simple Authentication and Security Layer) authentication",type:"on|off"},{name:"sasl_username",required:!1,label:"SASL Username",type:"string",placeholder:"Enter SASL Username",tooltip:"Username for SASL/PLAIN or SASL/SCRAM authentication"},{name:"sasl_password",required:!1,label:"SASL Password",type:"password",placeholder:"Enter SASL Password",tooltip:"Password for SASL/PLAIN or SASL/SCRAM authentication"},{name:"sasl_mechanism",required:!1,label:"SASL Mechanism",type:"string",placeholder:"Enter SASL Mechanism",tooltip:"SASL authentication mechanism"},{name:"tls",required:!1,label:"Use TLS",tooltip:"Enable TLS (Transport Layer Security)",type:"on|off"},{name:"tls_skip_verify",required:!1,label:"Skip TLS Verification",tooltip:"Trust server TLS without verification",type:"on|off"},{name:"client_tls_cert",required:!1,label:"Client Cert",tooltip:"Client cert for mTLS authentication",type:"string",placeholder:"Enter Client Cert"},{name:"client_tls_key",required:!1,label:"Client Cert Key",tooltip:"Client cert key for mTLS authentication",type:"string",placeholder:"Enter Client Cert Key"},{name:"tls_client_auth",required:!1,label:"TLS Client Auth",tooltip:"ClientAuth determines the Kafka server's policy for TLS client authorization",type:"string"},{name:"version",required:!1,label:"Version",tooltip:"Specify the version of the Kafka cluster",type:"string"}]},l=e=>e.filter((e=>""!==e.value)),c=(e,t,o)=>{const n=e.target,r=n.value;let i=[...o];return n.checked?i.push(r):i=i.filter((e=>e!==r)),t(i),i},s=e=>{let t={};return e.forEach((e=>{if(e.env_override){const o={value:e.env_override.value||"",overrideEnv:e.env_override.name||""};t={...t,[e.key]:o}}})),t}},68045:(e,t,o)=>{"use strict";o.d(t,{A:()=>p});var n=o(65043),r=o(89923),i=o(58661),a=o(64159),l=o(21383),c=o(56629),s=o(53518),u=o(70579);const p=e=>{let{closeDeleteModalAndRefresh:t,deleteOpen:o,selectedSAs:p}=e;const d=(0,l.jL)(),[f,m]=(0,n.useState)(!1);if(!p)return null;return(0,u.jsx)(i.A,{title:"Delete Access Keys",confirmText:"Delete",isOpen:o,titleIcon:(0,u.jsx)(r.xWY,{}),isLoading:f,onConfirm:()=>{m(!0),c.F.serviceAccounts.deleteMultipleServiceAccounts(p).then((e=>{t(!0)})).catch((async e=>{const o=await e.json();d((0,a.C9)((0,s.S)(o))),t(!1)})).finally((()=>m(!1)))},onClose:()=>t(!1),confirmationContent:(0,u.jsxs)(n.Fragment,{children:["Are you sure you want to delete the selected ",p.length," ","Access Keys?"," "]})})}},8185:(e,t,o)=>{"use strict";o.d(t,{Hw:()=>r,LA:()=>n,SO:()=>i,rY:()=>a});const n=(e,t)=>{if(e.accessKey&&t.accessKey){if(e.accessKey>t.accessKey)return 1;if(e.accessKeye.name>t.name?1:e.namee>t?1:ee.policy>t.policy?1:e.policy{"use strict";var n=o(40139),r={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var o,i,a,l,c,s,u=!1;t||(t={}),o=t.debug||!1;try{if(a=n(),l=document.createRange(),c=document.getSelection(),(s=document.createElement("span")).textContent=e,s.ariaHidden="true",s.style.all="unset",s.style.position="fixed",s.style.top=0,s.style.clip="rect(0, 0, 0, 0)",s.style.whiteSpace="pre",s.style.webkitUserSelect="text",s.style.MozUserSelect="text",s.style.msUserSelect="text",s.style.userSelect="text",s.addEventListener("copy",(function(n){if(n.stopPropagation(),t.format)if(n.preventDefault(),"undefined"===typeof n.clipboardData){o&&console.warn("unable to use e.clipboardData"),o&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=r[t.format]||r.default;window.clipboardData.setData(i,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e);t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))})),document.body.appendChild(s),l.selectNodeContents(s),c.addRange(l),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(p){o&&console.error("unable to copy using execCommand: ",p),o&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(p){o&&console.error("unable to copy using clipboardData: ",p),o&&console.error("falling back to prompt"),i=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(i,e)}}finally{c&&("function"==typeof c.removeRange?c.removeRange(l):c.removeAllRanges()),s&&document.body.removeChild(s),a()}return u}},24480:(e,t,o)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var r=l(o(65043)),i=l(o(75270)),a=["text","onCopy","options","children"];function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function s(e){for(var t=1;t=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function p(e,t){for(var o=0;o{"use strict";var n=o(24480).CopyToClipboard;n.CopyToClipboard=n,e.exports=n},40139:e=>{e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,o=[],n=0;n.\n\nimport React from \"react\";\nimport { DateTime } from \"luxon\";\n\nexport const ACCOUNT_TABLE_COLUMNS = [\n { label: \"Access Key\", elementKey: \"accessKey\" },\n {\n label: \"Expiry\",\n elementKey: \"expiration\",\n renderFunction: (expTime: string) => {\n if (expTime !== \"1970-01-01T00:00:00Z\") {\n const fmtDate = DateTime.fromISO(expTime)\n .toUTC()\n .toFormat(\"y/M/d hh:mm:ss z\");\n\n return {fmtDate};\n } else {\n return no-expiry;\n }\n },\n },\n {\n label: \"Status\",\n elementKey: \"accountStatus\",\n renderFunction: (status: string) => {\n if (status === \"off\") {\n return \"Disabled\";\n } else {\n return \"Enabled\";\n }\n },\n },\n { label: \"Name\", elementKey: \"name\" },\n { label: \"Description\", elementKey: \"description\" },\n];\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState, Fragment } from \"react\";\nimport {\n Box,\n Button,\n ChangeAccessPolicyIcon,\n DateTimeInput,\n Grid,\n InputBox,\n Switch,\n} from \"mds\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport CodeMirrorWrapper from \"../Common/FormComponents/CodeMirrorWrapper/CodeMirrorWrapper\";\nimport { ApiError } from \"api/consoleApi\";\nimport { useAppDispatch } from \"store\";\nimport { setErrorSnackMessage, setModalErrorSnackMessage } from \"systemSlice\";\nimport ModalWrapper from \"../Common/ModalWrapper/ModalWrapper\";\nimport { modalStyleUtils } from \"../Common/FormComponents/common/styleLibrary\";\nimport { DateTime } from \"luxon\";\n\ninterface IServiceAccountPolicyProps {\n open: boolean;\n selectedAccessKey: string | null;\n closeModalAndRefresh: () => void;\n}\n\nconst EditServiceAccount = ({\n open,\n selectedAccessKey,\n closeModalAndRefresh,\n}: IServiceAccountPolicyProps) => {\n const dispatch = useAppDispatch();\n const [loading, setLoading] = useState(false);\n const [policyDefinition, setPolicyDefinition] = useState(\"\");\n\n const [name, setName] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [expiry, setExpiry] = useState();\n const [status, setStatus] = useState(\"enabled\");\n\n useEffect(() => {\n if (!loading && selectedAccessKey !== \"\") {\n setLoading(true);\n api.serviceAccounts\n .getServiceAccount(selectedAccessKey || \"\")\n .then((res) => {\n setLoading(false);\n const saInfo = res.data;\n\n setName(saInfo?.name || \"\");\n\n if (saInfo?.expiration) {\n setExpiry(DateTime.fromISO(saInfo?.expiration));\n }\n\n setDescription(saInfo?.description || \"\");\n setStatus(saInfo.accountStatus);\n\n setPolicyDefinition(saInfo.policy || \"\");\n })\n .catch((err) => {\n setLoading(false);\n dispatch(setModalErrorSnackMessage(errorToHandler(err)));\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedAccessKey]);\n\n const setPolicy = (event: React.FormEvent, newPolicy: string) => {\n event.preventDefault();\n api.serviceAccounts\n .updateServiceAccount(selectedAccessKey || \"\", {\n policy: newPolicy,\n description: description,\n expiry: expiry,\n name: name,\n status: status,\n })\n .then(() => {\n closeModalAndRefresh();\n })\n .catch(async (res) => {\n const err = (await res.json()) as ApiError;\n dispatch(setErrorSnackMessage(errorToHandler(err)));\n });\n };\n\n return (\n {\n closeModalAndRefresh();\n }}\n titleIcon={}\n >\n ) => {\n setPolicy(e, policyDefinition);\n }}\n >\n \n \n {\n setPolicyDefinition(value);\n }}\n editorHeight={\"350px\"}\n helptip={\n \n \n Guide to access policy structure\n \n \n }\n />\n \n \n {\n setExpiry(e);\n }}\n id=\"expiryTime\"\n label={\"Expiry\"}\n timeFormat={\"24h\"}\n secondsSelector={false}\n />\n \n \n {\n setName(e.target.value);\n }}\n />\n \n \n {\n setDescription(e.target.value);\n }}\n />\n \n \n \n \n {\n setStatus(e.target.checked ? \"on\" : \"off\");\n }}\n value=\"yes\"\n />\n \n \n \n {\n closeModalAndRefresh();\n }}\n disabled={loading}\n label={\"Cancel\"}\n />\n \n \n \n \n \n );\n};\n\nexport default EditServiceAccount;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { ComponentType, Suspense, SuspenseProps } from \"react\";\n\nfunction withSuspense

(\n WrappedComponent: ComponentType

,\n fallback: SuspenseProps[\"fallback\"] = null,\n) {\n function ComponentWithSuspense(props: P) {\n return (\n \n \n \n );\n }\n\n return ComponentWithSuspense;\n}\n\nexport default withSuspense;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport { Button, CodeEditor, CopyIcon } from \"mds\";\nimport CopyToClipboard from \"react-copy-to-clipboard\";\nimport TooltipWrapper from \"../../TooltipWrapper/TooltipWrapper\";\n\ninterface ICodeWrapper {\n value: string;\n label?: string;\n mode?: string;\n tooltip?: string;\n onChange: (value: string) => any;\n editorHeight?: string | number;\n helptip?: any;\n}\n\nconst CodeMirrorWrapper = ({\n value,\n label = \"\",\n tooltip = \"\",\n mode = \"json\",\n onChange,\n editorHeight = 250,\n helptip,\n}: ICodeWrapper) => {\n return (\n onChange(value)}\n mode={mode}\n tooltip={tooltip}\n editorHeight={editorHeight}\n label={label}\n helpTools={\n \n \n \n }\n color={\"primary\"}\n variant={\"regular\"}\n />\n \n \n \n }\n helpTip={helptip}\n helpTipPlacement=\"right\"\n />\n );\n};\n\nexport default CodeMirrorWrapper;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { ModalBox, Snackbar } from \"mds\";\nimport { CSSObject } from \"styled-components\";\nimport { AppState, useAppDispatch } from \"../../../../store\";\nimport { setModalSnackMessage } from \"../../../../systemSlice\";\nimport MainError from \"../MainError/MainError\";\n\ninterface IModalProps {\n onClose: () => void;\n modalOpen: boolean;\n title: string | React.ReactNode;\n children: any;\n wideLimit?: boolean;\n titleIcon?: React.ReactNode;\n iconColor?: \"default\" | \"delete\" | \"accept\";\n sx?: CSSObject;\n}\n\nconst ModalWrapper = ({\n onClose,\n modalOpen,\n title,\n children,\n wideLimit = true,\n titleIcon = null,\n iconColor = \"default\",\n sx,\n}: IModalProps) => {\n const dispatch = useAppDispatch();\n const [openSnackbar, setOpenSnackbar] = useState(false);\n\n const modalSnackMessage = useSelector(\n (state: AppState) => state.system.modalSnackBar,\n );\n\n useEffect(() => {\n dispatch(setModalSnackMessage(\"\"));\n }, [dispatch]);\n\n useEffect(() => {\n if (modalSnackMessage) {\n if (modalSnackMessage.message === \"\") {\n setOpenSnackbar(false);\n return;\n }\n // Open SnackBar\n if (modalSnackMessage.type !== \"error\") {\n setOpenSnackbar(true);\n }\n }\n }, [modalSnackMessage]);\n\n const closeSnackBar = () => {\n setOpenSnackbar(false);\n dispatch(setModalSnackMessage(\"\"));\n };\n\n let message = \"\";\n\n if (modalSnackMessage) {\n message = modalSnackMessage.detailedErrorMsg;\n if (message === \"\" || (message && message.length < 5)) {\n message = modalSnackMessage.message;\n }\n }\n\n return (\n \n \n \n {children}\n \n );\n};\n\nexport default ModalWrapper;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\nimport React from \"react\";\nimport { IElement, IElementValue, IOverrideEnv, OverrideValue } from \"./types\";\nimport {\n CodeIcon,\n CompressIcon,\n ConsoleIcon,\n FindReplaceIcon,\n FirstAidIcon,\n KeyIcon,\n LogsIcon,\n PendingItemsIcon,\n PublicIcon,\n} from \"mds\";\n\nexport const configurationElements: IElement[] = [\n {\n icon: ,\n configuration_id: \"region\",\n configuration_label: \"Region\",\n },\n {\n icon: ,\n configuration_id: \"compression\",\n configuration_label: \"Compression\",\n },\n {\n icon: ,\n configuration_id: \"api\",\n configuration_label: \"API\",\n },\n {\n icon: ,\n configuration_id: \"heal\",\n configuration_label: \"Heal\",\n },\n {\n icon: ,\n configuration_id: \"scanner\",\n configuration_label: \"Scanner\",\n },\n {\n icon: ,\n configuration_id: \"etcd\",\n configuration_label: \"Etcd\",\n },\n {\n icon: ,\n configuration_id: \"logger_webhook\",\n configuration_label: \"Logger Webhook\",\n },\n {\n icon: ,\n configuration_id: \"audit_webhook\",\n configuration_label: \"Audit Webhook\",\n },\n {\n icon: ,\n configuration_id: \"audit_kafka\",\n configuration_label: \"Audit Kafka\",\n },\n];\n\nexport const fieldsConfigurations: any = {\n region: [\n {\n name: \"name\",\n required: true,\n label: \"Server Location\",\n tooltip: 'Name of the location of the server e.g. \"us-west-rack2\"',\n type: \"string\",\n placeholder: \"e.g. us-west-rack-2\",\n },\n {\n name: \"comment\",\n required: false,\n label: \"Comment\",\n tooltip: \"You can add a comment to this setting\",\n type: \"comment\",\n placeholder: \"Enter custom notes if any\",\n },\n ],\n compression: [\n {\n name: \"extensions\",\n required: false,\n label: \"Extensions\",\n tooltip:\n 'Extensions to compress e.g. \".txt\", \".log\" or \".csv\" - you can write one per field',\n type: \"csv\",\n placeholder: \"Enter an Extension\",\n withBorder: true,\n },\n {\n name: \"mime_types\",\n required: false,\n label: \"Mime Types\",\n tooltip:\n 'Mime types e.g. \"text/*\", \"application/json\" or \"application/xml\" - you can write one per field',\n type: \"csv\",\n placeholder: \"Enter a Mime Type\",\n withBorder: true,\n },\n ],\n api: [\n {\n name: \"requests_max\",\n required: false,\n label: \"Requests Max\",\n tooltip: \"Maximum number of concurrent requests, e.g. '1600'\",\n type: \"number\",\n placeholder: \"Enter Requests Max\",\n },\n {\n name: \"cors_allow_origin\",\n required: false,\n label: \"Cors Allow Origin\",\n tooltip: \"List of origins allowed for CORS requests\",\n type: \"csv\",\n placeholder: \"Enter allowed origin e.g. https://example.com\",\n },\n {\n name: \"replication_workers\",\n required: false,\n label: \"Replication Workers\",\n tooltip: \"Number of replication workers, defaults to 100\",\n type: \"number\",\n placeholder: \"Enter Replication Workers\",\n },\n {\n name: \"replication_failed_workers\",\n required: false,\n label: \"Replication Failed Workers\",\n tooltip:\n \"Number of replication workers for recently failed replicas, defaults to 4\",\n type: \"number\",\n placeholder: \"Enter Replication Failed Workers\",\n },\n ],\n heal: [\n {\n name: \"bitrotscan\",\n required: false,\n label: \"Bitrot Scan\",\n tooltip:\n \"Perform bitrot scan on disks when checking objects during scanner\",\n type: \"on|off\",\n },\n {\n name: \"max_sleep\",\n required: false,\n label: \"Max Sleep\",\n tooltip:\n \"Maximum sleep duration between objects to slow down heal operation, e.g. 2s\",\n type: \"duration\",\n placeholder: \"Enter Max Sleep Duration\",\n },\n {\n name: \"max_io\",\n required: false,\n label: \"Max IO\",\n tooltip:\n \"Maximum IO requests allowed between objects to slow down heal operation, e.g. 3\",\n type: \"number\",\n placeholder: \"Enter Max IO\",\n },\n ],\n scanner: [\n {\n name: \"delay\",\n required: false,\n label: \"Delay Multiplier\",\n tooltip: \"Scanner delay multiplier, defaults to '10.0'\",\n type: \"number\",\n placeholder: \"Enter Delay\",\n },\n {\n name: \"max_wait\",\n required: false,\n label: \"Max Wait\",\n tooltip: \"Maximum wait time between operations, defaults to '15s'\",\n type: \"duration\",\n placeholder: \"Enter Max Wait\",\n },\n {\n name: \"cycle\",\n required: false,\n label: \"Cycle\",\n tooltip: \"Time duration between scanner cycles, defaults to '1m'\",\n type: \"duration\",\n placeholder: \"Enter Cycle\",\n },\n ],\n etcd: [\n {\n name: \"endpoints\",\n required: true,\n label: \"Endpoints\",\n tooltip:\n 'List of etcd endpoints e.g. \"http://localhost:2379\" - you can write one per field',\n type: \"csv\",\n placeholder: \"Enter Endpoint\",\n },\n {\n name: \"path_prefix\",\n required: false,\n label: \"Path Prefix\",\n tooltip: 'Namespace prefix to isolate tenants e.g. \"customer1/\"',\n type: \"string\",\n placeholder: \"Enter Path Prefix\",\n },\n {\n name: \"coredns_path\",\n required: false,\n label: \"Coredns Path\",\n tooltip: 'Shared bucket DNS records, default is \"/skydns\"',\n type: \"string\",\n placeholder: \"Enter Coredns Path\",\n },\n {\n name: \"client_cert\",\n required: false,\n label: \"Client Cert\",\n tooltip: \"Client cert for mTLS authentication\",\n type: \"string\",\n placeholder: \"Enter Client Cert\",\n },\n {\n name: \"client_cert_key\",\n required: false,\n label: \"Client Cert Key\",\n tooltip: \"Client cert key for mTLS authentication\",\n type: \"string\",\n placeholder: \"Enter Client Cert Key\",\n },\n {\n name: \"comment\",\n required: false,\n label: \"Comment\",\n tooltip: \"You can add a comment to this setting\",\n type: \"comment\",\n multiline: true,\n placeholder: \"Enter custom notes if any\",\n },\n ],\n logger_webhook: [\n {\n name: \"endpoint\",\n required: true,\n label: \"Endpoint\",\n type: \"string\",\n placeholder: \"Enter Endpoint\",\n },\n {\n name: \"auth_token\",\n required: true,\n label: \"Auth Token\",\n type: \"string\",\n placeholder: \"Enter Auth Token\",\n },\n ],\n audit_webhook: [\n {\n name: \"endpoint\",\n required: true,\n label: \"Endpoint\",\n type: \"string\",\n placeholder: \"Enter Endpoint\",\n },\n {\n name: \"auth_token\",\n required: true,\n label: \"Auth Token\",\n type: \"string\",\n placeholder: \"Enter Auth Token\",\n },\n ],\n audit_kafka: [\n {\n name: \"enable\",\n required: false,\n label: \"Enable\",\n tooltip: \"Enable audit_kafka target\",\n type: \"on|off\",\n customValueProcess: (origValue: string) => {\n return origValue === \"\" || origValue === \"on\" ? \"on\" : \"off\";\n },\n },\n {\n name: \"brokers\",\n required: true,\n label: \"Brokers\",\n type: \"csv\",\n placeholder: \"Enter Kafka Broker\",\n },\n {\n name: \"topic\",\n required: false,\n label: \"Topic\",\n type: \"string\",\n placeholder: \"Enter Kafka Topic\",\n tooltip: \"Kafka topic used for bucket notifications\",\n },\n {\n name: \"sasl\",\n required: false,\n label: \"Use SASL\",\n tooltip:\n \"Enable SASL (Simple Authentication and Security Layer) authentication\",\n type: \"on|off\",\n },\n {\n name: \"sasl_username\",\n required: false,\n label: \"SASL Username\",\n type: \"string\",\n placeholder: \"Enter SASL Username\",\n tooltip: \"Username for SASL/PLAIN or SASL/SCRAM authentication\",\n },\n {\n name: \"sasl_password\",\n required: false,\n label: \"SASL Password\",\n type: \"password\",\n placeholder: \"Enter SASL Password\",\n tooltip: \"Password for SASL/PLAIN or SASL/SCRAM authentication\",\n },\n {\n name: \"sasl_mechanism\",\n required: false,\n label: \"SASL Mechanism\",\n type: \"string\",\n placeholder: \"Enter SASL Mechanism\",\n tooltip: \"SASL authentication mechanism\",\n },\n {\n name: \"tls\",\n required: false,\n label: \"Use TLS\",\n tooltip: \"Enable TLS (Transport Layer Security)\",\n type: \"on|off\",\n },\n {\n name: \"tls_skip_verify\",\n required: false,\n label: \"Skip TLS Verification\",\n tooltip: \"Trust server TLS without verification\",\n type: \"on|off\",\n },\n {\n name: \"client_tls_cert\",\n required: false,\n label: \"Client Cert\",\n tooltip: \"Client cert for mTLS authentication\",\n type: \"string\",\n placeholder: \"Enter Client Cert\",\n },\n {\n name: \"client_tls_key\",\n required: false,\n label: \"Client Cert Key\",\n tooltip: \"Client cert key for mTLS authentication\",\n type: \"string\",\n placeholder: \"Enter Client Cert Key\",\n },\n {\n name: \"tls_client_auth\",\n required: false,\n label: \"TLS Client Auth\",\n tooltip:\n \"ClientAuth determines the Kafka server's policy for TLS client authorization\",\n type: \"string\",\n },\n {\n name: \"version\",\n required: false,\n label: \"Version\",\n tooltip: \"Specify the version of the Kafka cluster\",\n type: \"string\",\n },\n ],\n};\n\nexport const removeEmptyFields = (formFields: IElementValue[]) => {\n const nonEmptyFields = formFields.filter((field) => field.value !== \"\");\n\n return nonEmptyFields;\n};\n\nexport const selectSAs = (\n e: React.ChangeEvent,\n setSelectedSAs: Function,\n selectedSAs: string[],\n) => {\n const targetD = e.target;\n const value = targetD.value;\n const checked = targetD.checked;\n\n let elements: string[] = [...selectedSAs]; // We clone the selectedSAs array\n if (checked) {\n // If the user has checked this field we need to push this to selectedSAs\n elements.push(value);\n } else {\n // User has unchecked this field, we need to remove it from the list\n elements = elements.filter((element) => element !== value);\n }\n setSelectedSAs(elements);\n return elements;\n};\n\nexport const overrideFields = (formFields: IElementValue[]): IOverrideEnv => {\n let overrideReturn: IOverrideEnv = {};\n\n formFields.forEach((envItem) => {\n // it has override values, we construct the value\n if (envItem.env_override) {\n const value: OverrideValue = {\n value: envItem.env_override.value || \"\",\n overrideEnv: envItem.env_override.name || \"\",\n };\n\n overrideReturn = { ...overrideReturn, [envItem.key]: value };\n }\n });\n\n return overrideReturn;\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useState } from \"react\";\nimport { ConfirmDeleteIcon } from \"mds\";\nimport ConfirmDialog from \"../../../screens/Console/Common/ModalWrapper/ConfirmDialog\";\nimport { setErrorSnackMessage } from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\nimport { api } from \"api\";\nimport { ApiError, HttpResponse } from \"api/consoleApi\";\nimport { errorToHandler } from \"api/errors\";\n\ninterface IDeleteMultiSAsProps {\n closeDeleteModalAndRefresh: (refresh: boolean) => void;\n deleteOpen: boolean;\n selectedSAs: string[];\n}\n\nconst DeleteMultipleSAs = ({\n closeDeleteModalAndRefresh,\n deleteOpen,\n selectedSAs,\n}: IDeleteMultiSAsProps) => {\n const dispatch = useAppDispatch();\n const onClose = () => closeDeleteModalAndRefresh(false);\n const [loadingDelete, setLoadingDelete] = useState(false);\n\n if (!selectedSAs) {\n return null;\n }\n const onConfirmDelete = () => {\n setLoadingDelete(true);\n api.serviceAccounts\n .deleteMultipleServiceAccounts(selectedSAs)\n .then((_) => {\n closeDeleteModalAndRefresh(true);\n })\n .catch(async (res: HttpResponse) => {\n const err = (await res.json()) as ApiError;\n dispatch(setErrorSnackMessage(errorToHandler(err)));\n closeDeleteModalAndRefresh(false);\n })\n .finally(() => setLoadingDelete(false));\n };\n return (\n }\n isLoading={loadingDelete}\n onConfirm={onConfirmDelete}\n onClose={onClose}\n confirmationContent={\n \n Are you sure you want to delete the selected {selectedSAs.length}{\" \"}\n Access Keys?{\" \"}\n \n }\n />\n );\n};\n\nexport default DeleteMultipleSAs;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport { Policy, User } from \"api/consoleApi\";\n\ninterface policyDetailsInterface {\n policy: string;\n}\n\nexport const usersSort = (a: User, b: User) => {\n if (a.accessKey && b.accessKey) {\n if (a.accessKey > b.accessKey) {\n return 1;\n }\n if (a.accessKey < b.accessKey) {\n return -1;\n }\n }\n // a must be equal to b\n return 0;\n};\n\nexport const policySort = (a: Policy, b: Policy) => {\n if (a.name! > b.name!) {\n return 1;\n }\n if (a.name! < b.name!) {\n return -1;\n }\n // a must be equal to b\n return 0;\n};\n\nexport const stringSort = (a: string, b: string) => {\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n // a must be equal to b\n return 0;\n};\n\nexport const policyDetailsSort = (\n a: policyDetailsInterface,\n b: policyDetailsInterface,\n) => {\n if (a.policy > b.policy) {\n return 1;\n }\n if (a.policy < b.policy) {\n return -1;\n }\n // a must be equal to b\n return 0;\n};\n","\"use strict\";\n\nvar deselectCurrent = require(\"toggle-selection\");\n\nvar clipboardToIE11Formatting = {\n \"text/plain\": \"Text\",\n \"text/html\": \"Url\",\n \"default\": \"Text\"\n}\n\nvar defaultMessage = \"Copy to clipboard: #{key}, Enter\";\n\nfunction format(message) {\n var copyKey = (/mac os x/i.test(navigator.userAgent) ? \"⌘\" : \"Ctrl\") + \"+C\";\n return message.replace(/#{\\s*key\\s*}/g, copyKey);\n}\n\nfunction copy(text, options) {\n var debug,\n message,\n reselectPrevious,\n range,\n selection,\n mark,\n success = false;\n if (!options) {\n options = {};\n }\n debug = options.debug || false;\n try {\n reselectPrevious = deselectCurrent();\n\n range = document.createRange();\n selection = document.getSelection();\n\n mark = document.createElement(\"span\");\n mark.textContent = text;\n // avoid screen readers from reading out loud the text\n mark.ariaHidden = \"true\"\n // reset user styles for span element\n mark.style.all = \"unset\";\n // prevents scrolling to the end of the page\n mark.style.position = \"fixed\";\n mark.style.top = 0;\n mark.style.clip = \"rect(0, 0, 0, 0)\";\n // used to preserve spaces and line breaks\n mark.style.whiteSpace = \"pre\";\n // do not inherit user-select (it may be `none`)\n mark.style.webkitUserSelect = \"text\";\n mark.style.MozUserSelect = \"text\";\n mark.style.msUserSelect = \"text\";\n mark.style.userSelect = \"text\";\n mark.addEventListener(\"copy\", function(e) {\n e.stopPropagation();\n if (options.format) {\n e.preventDefault();\n if (typeof e.clipboardData === \"undefined\") { // IE 11\n debug && console.warn(\"unable to use e.clipboardData\");\n debug && console.warn(\"trying IE specific stuff\");\n window.clipboardData.clearData();\n var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting[\"default\"]\n window.clipboardData.setData(format, text);\n } else { // all other browsers\n e.clipboardData.clearData();\n e.clipboardData.setData(options.format, text);\n }\n }\n if (options.onCopy) {\n e.preventDefault();\n options.onCopy(e.clipboardData);\n }\n });\n\n document.body.appendChild(mark);\n\n range.selectNodeContents(mark);\n selection.addRange(range);\n\n var successful = document.execCommand(\"copy\");\n if (!successful) {\n throw new Error(\"copy command was unsuccessful\");\n }\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using execCommand: \", err);\n debug && console.warn(\"trying IE specific stuff\");\n try {\n window.clipboardData.setData(options.format || \"text\", text);\n options.onCopy && options.onCopy(window.clipboardData);\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using clipboardData: \", err);\n debug && console.error(\"falling back to prompt\");\n message = format(\"message\" in options ? options.message : defaultMessage);\n window.prompt(message, text);\n }\n } finally {\n if (selection) {\n if (typeof selection.removeRange == \"function\") {\n selection.removeRange(range);\n } else {\n selection.removeAllRanges();\n }\n }\n\n if (mark) {\n document.body.removeChild(mark);\n }\n reselectPrevious();\n }\n\n return success;\n}\n\nmodule.exports = copy;\n","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.CopyToClipboard = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _copyToClipboard = _interopRequireDefault(require(\"copy-to-clipboard\"));\n\nvar _excluded = [\"text\", \"onCopy\", \"options\", \"children\"];\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar CopyToClipboard = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(CopyToClipboard, _React$PureComponent);\n\n var _super = _createSuper(CopyToClipboard);\n\n function CopyToClipboard() {\n var _this;\n\n _classCallCheck(this, CopyToClipboard);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"onClick\", function (event) {\n var _this$props = _this.props,\n text = _this$props.text,\n onCopy = _this$props.onCopy,\n children = _this$props.children,\n options = _this$props.options;\n\n var elem = _react[\"default\"].Children.only(children);\n\n var result = (0, _copyToClipboard[\"default\"])(text, options);\n\n if (onCopy) {\n onCopy(text, result);\n } // Bypass onClick if it was present\n\n\n if (elem && elem.props && typeof elem.props.onClick === 'function') {\n elem.props.onClick(event);\n }\n });\n\n return _this;\n }\n\n _createClass(CopyToClipboard, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n _text = _this$props2.text,\n _onCopy = _this$props2.onCopy,\n _options = _this$props2.options,\n children = _this$props2.children,\n props = _objectWithoutProperties(_this$props2, _excluded);\n\n var elem = _react[\"default\"].Children.only(children);\n\n return /*#__PURE__*/_react[\"default\"].cloneElement(elem, _objectSpread(_objectSpread({}, props), {}, {\n onClick: this.onClick\n }));\n }\n }]);\n\n return CopyToClipboard;\n}(_react[\"default\"].PureComponent);\n\nexports.CopyToClipboard = CopyToClipboard;\n\n_defineProperty(CopyToClipboard, \"defaultProps\", {\n onCopy: undefined,\n options: undefined\n});","\"use strict\";\n\nvar _require = require('./Component'),\n CopyToClipboard = _require.CopyToClipboard;\n\nCopyToClipboard.CopyToClipboard = CopyToClipboard;\nmodule.exports = CopyToClipboard;","\nmodule.exports = function () {\n var selection = document.getSelection();\n if (!selection.rangeCount) {\n return function () {};\n }\n var active = document.activeElement;\n\n var ranges = [];\n for (var i = 0; i < selection.rangeCount; i++) {\n ranges.push(selection.getRangeAt(i));\n }\n\n switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n case 'INPUT':\n case 'TEXTAREA':\n active.blur();\n break;\n\n default:\n active = null;\n break;\n }\n\n selection.removeAllRanges();\n return function () {\n selection.type === 'Caret' &&\n selection.removeAllRanges();\n\n if (!selection.rangeCount) {\n ranges.forEach(function(range) {\n selection.addRange(range);\n });\n }\n\n active &&\n active.focus();\n };\n};\n"],"names":["ACCOUNT_TABLE_COLUMNS","label","elementKey","renderFunction","expTime","fmtDate","DateTime","fromISO","toUTC","toFormat","_jsx","title","children","status","_ref","open","selectedAccessKey","closeModalAndRefresh","dispatch","useAppDispatch","loading","setLoading","useState","policyDefinition","setPolicyDefinition","name","setName","description","setDescription","expiry","setExpiry","setStatus","useEffect","api","serviceAccounts","getServiceAccount","then","res","saInfo","data","expiration","accountStatus","policy","catch","err","setModalErrorSnackMessage","errorToHandler","ModalWrapper","modalOpen","onClose","titleIcon","ChangeAccessPolicyIcon","noValidate","autoComplete","onSubmit","e","setPolicy","newPolicy","preventDefault","updateServiceAccount","async","json","setErrorSnackMessage","_jsxs","Grid","container","item","xs","CodeMirrorWrapper","value","onChange","editorHeight","helptip","Fragment","target","href","Box","sx","marginBottom","marginTop","display","width","DateTimeInput","noLabelMinWidth","id","timeFormat","secondsSelector","InputBox","size","type","placeholder","alignItems","justifyContent","fontWeight","color","gap","style","padding","Switch","indicatorLabels","checked","modalStyleUtils","modalButtonBar","Button","variant","onClick","disabled","WrappedComponent","fallback","arguments","length","undefined","props","Suspense","tooltip","mode","CodeEditor","helpTools","TooltipWrapper","CopyToClipboard","text","icon","CopyIcon","helpTip","helpTipPlacement","wideLimit","iconColor","openSnackbar","setOpenSnackbar","modalSnackMessage","useSelector","state","system","modalSnackBar","setModalSnackMessage","message","detailedErrorMsg","ModalBox","widthLimit","MainError","isModal","Snackbar","closeSnackBar","autoHideDuration","condensed","configurationElements","PublicIcon","configuration_id","configuration_label","CompressIcon","CodeIcon","FirstAidIcon","FindReplaceIcon","KeyIcon","ConsoleIcon","PendingItemsIcon","LogsIcon","fieldsConfigurations","region","required","compression","withBorder","heal","scanner","etcd","multiline","logger_webhook","audit_webhook","audit_kafka","customValueProcess","origValue","removeEmptyFields","formFields","filter","field","selectSAs","setSelectedSAs","selectedSAs","targetD","elements","push","element","overrideFields","overrideReturn","forEach","envItem","env_override","overrideEnv","key","closeDeleteModalAndRefresh","deleteOpen","loadingDelete","setLoadingDelete","ConfirmDialog","confirmText","isOpen","ConfirmDeleteIcon","isLoading","onConfirm","onConfirmDelete","deleteMultipleServiceAccounts","_","finally","confirmationContent","usersSort","a","b","accessKey","policySort","stringSort","policyDetailsSort","deselectCurrent","require","clipboardToIE11Formatting","module","exports","options","debug","reselectPrevious","range","selection","mark","success","document","createRange","getSelection","createElement","textContent","ariaHidden","all","position","top","clip","whiteSpace","webkitUserSelect","MozUserSelect","msUserSelect","userSelect","addEventListener","stopPropagation","format","clipboardData","console","warn","window","clearData","setData","onCopy","body","appendChild","selectNodeContents","addRange","execCommand","Error","error","copyKey","test","navigator","userAgent","replace","prompt","removeRange","removeAllRanges","removeChild","_typeof","obj","Symbol","iterator","constructor","prototype","Object","defineProperty","_react","_interopRequireDefault","_copyToClipboard","_excluded","__esModule","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","sym","getOwnPropertyDescriptor","enumerable","apply","_objectSpread","i","source","_defineProperty","getOwnPropertyDescriptors","defineProperties","_objectWithoutProperties","excluded","sourceKeys","indexOf","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","call","_defineProperties","descriptor","configurable","writable","_setPrototypeOf","o","p","setPrototypeOf","__proto__","_createSuper","Derived","hasNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","valueOf","_isNativeReflectConstruct","result","Super","_getPrototypeOf","NewTarget","this","self","TypeError","_assertThisInitialized","_possibleConstructorReturn","ReferenceError","getPrototypeOf","_React$PureComponent","subClass","superClass","create","_inherits","Constructor","protoProps","staticProps","_super","_this","instance","_classCallCheck","_len","args","Array","_key","concat","event","_this$props","elem","Children","only","_this$props2","cloneElement","PureComponent","rangeCount","active","activeElement","ranges","getRangeAt","tagName","toUpperCase","blur","focus"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/12.fcd89e94.chunk.js b/web-app/build/static/js/12.fcd89e94.chunk.js deleted file mode 100644 index 776f95c43..000000000 --- a/web-app/build/static/js/12.fcd89e94.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[12],{40012:(e,s,t)=>{t.r(s),t.d(s,{default:()=>R});var i=t(65043),n=t(33097),l=t.n(n),a=t(22166),r=t(73216),c=t(56629),o=t(53518),d=t(89923),u=t(77403),x=t(99161),h=t(77938),m=t(64159),p=t(39947),j=t(21383),f=t(25903),b=t(70579);const S=e=>{var s,t;let{versioningState:i={}}=e;return(0,b.jsxs)(d.azJ,{sx:{display:"flex",flexDirection:"column",gap:2},children:[(0,b.jsx)(d.azJ,{sx:{fontWeight:"medium",display:"flex",gap:2},children:i.excludeFolders?(0,b.jsx)(f.A,{icon:i.excludeFolders?(0,b.jsx)(d.xhy,{style:{color:"green"}}):(0,b.jsx)(d.aaC,{}),label:(0,b.jsx)("label",{style:{textDecoration:"normal"},children:"Exclude Folders"})}):null}),null!==(s=i.excludedPrefixes)&&void 0!==s&&s.length?(0,b.jsxs)(d.azJ,{sx:{fontWeight:"medium",display:"flex",justifyItems:"end",placeItems:"flex-start",flexDirection:"column",gap:1},children:[(0,b.jsx)(d.azJ,{children:"Excluded Prefixes :"}),(0,b.jsx)("div",{style:{maxHeight:"200px",overflowY:"auto",placeItems:"flex-start",justifyItems:"end",flexDirection:"column",display:"flex"},children:null===(t=i.excludedPrefixes)||void 0===t?void 0:t.map((e=>(0,b.jsx)("div",{children:(0,b.jsx)("strong",{children:e.prefix})})))})]}):null]})};var g=t(72237);const T=e=>{let{disabled:s,onClick:t,...i}=e;return(0,b.jsx)(d.K0,{size:"small",disabled:s,onClick:t,...i,children:(0,b.jsx)(d.qUP,{})})},_=e=>{let{resourceName:s,iamScopes:t,secureCmpProps:i={},children:n}=e;return(0,b.jsx)(h.R,{scopes:t,resource:s,errorProps:{disabled:!0},...i,children:n})},O=e=>{let{isLoading:s=!0,resourceName:t="",iamScopes:i,secureCmpProps:n={},property:l=null,value:a=null,onEdit:r,disabled:c=!1,helpTip:o}=e;return(0,b.jsxs)(d.azJ,{sx:{display:"flex",alignItems:"baseline",justifyContent:"flex-start",gap:10},children:[(0,b.jsx)(d.mZW,{label:l,value:o?(0,b.jsx)(_,{resourceName:t,iamScopes:i,secureCmpProps:n,children:(0,b.jsx)(d.V7x,{placement:"left",content:o,children:(0,b.jsx)(d.t53,{isLoading:s,onClick:r,label:a,sx:{fontWeight:"bold",textTransform:"capitalize"},disabled:c})})}):(0,b.jsx)(_,{resourceName:t,iamScopes:i,secureCmpProps:n,children:(0,b.jsx)(d.t53,{isLoading:s,onClick:r,label:a,sx:{fontWeight:"bold",textTransform:"capitalize"},disabled:c})})}),(0,b.jsx)(_,{resourceName:t,iamScopes:i,secureCmpProps:n,children:(0,b.jsx)(T,{onClick:r,sx:{background:"#f8f8f8",marginLeft:"3px",top:3,"& .min-icon":{width:"16px",height:"16px"}},disabled:c})})]})};var E=t(56483);const C=e=>{let{bucketSize:s}=e;return(0,b.jsxs)(d.azJ,{sx:{display:"flex",alignItems:"center","& .min-icon":{height:37,width:37}},children:[(0,b.jsx)(d.fRK,{}),(0,b.jsxs)(d.azJ,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"center",flexFlow:"column",marginLeft:"20px",fontSize:"19px"},children:[(0,b.jsx)("label",{style:{fontWeight:600},children:"Reported Usage:"}),(0,b.jsx)("label",{children:(0,E.nO)(s)})]})]})},y=e=>{let{quota:s}=e;return(0,b.jsxs)(d.azJ,{sx:{display:"flex",alignItems:"center","& .min-icon":{height:37,width:37}},children:[(0,b.jsx)(d.rod,{}),(0,b.jsxs)(d.azJ,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"center",flexFlow:"column",marginLeft:"20px",fontSize:"19px"},children:[(0,b.jsxs)("label",{style:{fontWeight:600,textTransform:"capitalize"},children:[null===s||void 0===s?void 0:s.type," Quota"]}),(0,b.jsxs)("label",{children:[" ",(0,E.nO)(`${null===s||void 0===s?void 0:s.quota}`,!0)]})]})]})},I=(0,g.A)(i.lazy((()=>t.e(7659).then(t.bind(t,97659))))),N=(0,g.A)(i.lazy((()=>t.e(7515).then(t.bind(t,67515))))),k=(0,g.A)(i.lazy((()=>t.e(6654).then(t.bind(t,36654))))),A=(0,g.A)(i.lazy((()=>t.e(5311).then(t.bind(t,5311))))),v=(0,g.A)(i.lazy((()=>t.e(5809).then(t.bind(t,5809))))),z=(0,g.A)(i.lazy((()=>t.e(7264).then(t.bind(t,47264))))),R=()=>{var e;const s=(0,j.jL)(),t=(0,r.g)(),n=(0,a.d4)(p.Nx),g=(0,a.d4)(p.fT),T=(0,a.d4)(m.Rq),[_,E]=(0,i.useState)(null),[R,V]=(0,i.useState)("0"),[B,U]=(0,i.useState)(!1),[P,G]=(0,i.useState)(!1),[w,J]=(0,i.useState)(!1),[F,L]=(0,i.useState)(!0),[K,M]=(0,i.useState)(!0),[D,W]=(0,i.useState)(!0),[q,Y]=(0,i.useState)(!0),[Z,Q]=(0,i.useState)(!0),[$,H]=(0,i.useState)(!0),[X,ee]=(0,i.useState)(!0),[se,te]=(0,i.useState)(!0),[ie,ne]=(0,i.useState)(),[le,ae]=(0,i.useState)(!1),[re,ce]=(0,i.useState)(null),[oe,de]=(0,i.useState)(!1),[ue,xe]=(0,i.useState)(!1),[he,me]=(0,i.useState)(null),[pe,je]=(0,i.useState)(!1),[fe,be]=(0,i.useState)(!1),[Se,ge]=(0,i.useState)(!1),[Te,_e]=(0,i.useState)(!1);(0,i.useEffect)((()=>{s((0,m.ph)("bucket_detail_summary"))}),[]);const Oe=t.bucketName||"";let Ee="PRIVATE",Ce="";null!==g&&g.access&&g.definition&&(Ee=g.access,Ce=g.definition);const ye=(0,h._)(Oe,[x.OV.S3_GET_BUCKET_OBJECT_LOCK_CONFIGURATION,x.OV.S3_GET_ACTIONS]),Ie=(0,h._)(Oe,[x.OV.S3_GET_BUCKET_ENCRYPTION_CONFIGURATION,x.OV.S3_GET_ACTIONS]),Ne=(0,h._)(Oe,[x.OV.ADMIN_GET_BUCKET_QUOTA]);(0,i.useEffect)((()=>{W(!!n)}),[n,W]),(0,i.useEffect)((()=>{q&&(Ie?c.F.buckets.getBucketEncryptionInfo(Oe).then((e=>{e.data.algorithm&&(de(!0),E(e.data)),Y(!1)})).catch((e=>{"The server side encryption configuration was not found"===(e=(0,o.S)(e.error)).errorMessage&&(de(!1),E(null)),Y(!1)})):(de(!1),E(null),Y(!1)))}),[q,Oe,Ie]),(0,i.useEffect)((()=>{Z&&T&&c.F.buckets.getBucketVersioning(Oe).then((e=>{ne(e.data),Q(!1)})).catch((e=>{s((0,m.C9)((0,o.S)(e.error))),Q(!1)}))}),[Z,s,Oe,T]),(0,i.useEffect)((()=>{$&&T&&(Ne?c.F.buckets.getBucketQuota(Oe).then((e=>{ce(e.data),e.data.quota?ae(!0):ae(!1),H(!1)})).catch((e=>{s((0,m.C9)((0,o.S)(e.error))),ae(!1),H(!1)})):(ae(!1),H(!1)))}),[$,Q,s,Oe,T,Ne]),(0,i.useEffect)((()=>{Z&&T&&(ye?c.F.buckets.getBucketObjectLockingStatus(Oe).then((e=>{U(e.data.object_locking_enabled),L(!1)})).catch((e=>{s((0,m.C9)((0,o.S)(e.error))),L(!1)})):L(!1))}),[F,s,Oe,Z,T,ye]),(0,i.useEffect)((()=>{K&&c.F.buckets.listBuckets().then((e=>{const s=l()(e.data,"buckets",[]).find((e=>e.name===Oe)),t=l()(s,"size","0");M(!1),V(t)})).catch((e=>{M(!1),s((0,m.C9)((0,o.S)(e.error)))}))}),[K,s,Oe]),(0,i.useEffect)((()=>{X&&T&&c.F.buckets.getBucketReplication(Oe).then((e=>{const s=e.data.rules?e.data.rules:[];J(s.length>0),ee(!1)})).catch((e=>{s((0,m.C9)((0,o.S)(e.error))),ee(!1)}))}),[X,s,Oe,T]),(0,i.useEffect)((()=>{se&&B&&c.F.buckets.getBucketRetentionConfig(Oe).then((e=>{te(!1),xe(!0),me(e.data)})).catch((e=>{xe(!1),te(!1),me(null)}))}),[se,B,Oe]);const ke=()=>{s((0,p.ZU)(!0)),W(!0),M(!0),Q(!0),Y(!0),te(!0)};let Ae=null===ie||void 0===ie?void 0:ie.status,ve="Unversioned (Default)";return"Enabled"===Ae?ve="Versioned":"Suspended"===Ae&&(ve="Suspended"),(0,b.jsxs)(i.Fragment,{children:[fe&&(0,b.jsx)(k,{open:fe,selectedBucket:Oe,encryptionEnabled:oe,encryptionCfg:_,closeModalAndRefresh:()=>{be(!1),Y(!0)}}),Se&&(0,b.jsx)(z,{open:Se,selectedBucket:Oe,enabled:le,cfg:re,closeModalAndRefresh:()=>{ge(!1),H(!0)}}),P&&(0,b.jsx)(I,{bucketName:Oe,open:P,actualPolicy:Ee,actualDefinition:Ce,closeModalAndRefresh:()=>{G(!1),ke()}}),pe&&(0,b.jsx)(N,{bucketName:Oe,open:pe,closeModalAndRefresh:()=>{je(!1),ke()}}),Te&&(0,b.jsx)(A,{closeVersioningModalAndRefresh:e=>{_e(!1),e&&ke()},modalOpen:Te,selectedBucket:Oe,versioningInfo:ie,objectLockingEnabled:!!B}),(0,b.jsx)(d._xt,{separator:!0,sx:{marginBottom:15},children:"Summary"}),(0,b.jsxs)(d.xA9,{container:!0,children:[(0,b.jsx)(h.R,{scopes:[x.OV.S3_GET_BUCKET_POLICY,x.OV.S3_GET_ACTIONS],resource:Oe,children:(0,b.jsx)(d.xA9,{item:!0,xs:12,children:(0,b.jsxs)(d.azJ,{sx:u.mA,children:[(0,b.jsxs)(d.azJ,{sx:u.mA,children:[(0,b.jsx)(h.R,{scopes:[x.OV.S3_GET_BUCKET_POLICY,x.OV.S3_GET_ACTIONS],resource:Oe,children:(0,b.jsx)(O,{iamScopes:[x.OV.S3_PUT_BUCKET_POLICY,x.OV.S3_PUT_ACTIONS],resourceName:Oe,property:"Access Policy:",value:Ee.toLowerCase(),onEdit:()=>{G(!0)},isLoading:D,helpTip:(0,b.jsxs)(i.Fragment,{children:[(0,b.jsx)("strong",{children:"Private"})," policy limits access to credentialled accounts with appropriate permissions",(0,b.jsx)("br",{}),(0,b.jsx)("strong",{children:"Public"})," policy anyone will be able to upload, download and delete files from this Bucket once logged in",(0,b.jsx)("br",{}),(0,b.jsx)("strong",{children:"Custom"})," policy can be written to define which accounts are authorized to access this Bucket",(0,b.jsx)("br",{}),(0,b.jsx)("br",{}),"To allow Bucket access without credentials, use the"," ",(0,b.jsx)("a",{href:`/buckets/${Oe}/admin/prefix`,children:"Anonymous"})," ","setting"]})})}),(0,b.jsx)(h.R,{scopes:[x.OV.S3_GET_BUCKET_ENCRYPTION_CONFIGURATION,x.OV.S3_GET_ACTIONS],resource:Oe,children:(0,b.jsx)(O,{iamScopes:[x.OV.S3_PUT_BUCKET_ENCRYPTION_CONFIGURATION,x.OV.S3_PUT_ACTIONS],resourceName:Oe,property:"Encryption:",value:oe?"Enabled":"Disabled",onEdit:()=>{be(!0)},isLoading:q,helpTip:(0,b.jsxs)(i.Fragment,{children:["MinIO supports enabling automatic"," ",(0,b.jsx)("a",{href:"https://min.io/docs/minio/kubernetes/upstream/administration/server-side-encryption/server-side-encryption-sse-kms.html",target:"blank",children:"SSE-KMS"})," ","and"," ",(0,b.jsx)("a",{href:"https://min.io/docs/minio/kubernetes/upstream/administration/server-side-encryption/server-side-encryption-sse-s3.html",target:"blank",children:"SSE-S3"})," ","encryption of all objects written to a bucket using a specific External Key (EK) stored on the external KMS."]})})}),(0,b.jsx)(h.R,{scopes:[x.OV.S3_GET_REPLICATION_CONFIGURATION,x.OV.S3_GET_ACTIONS],resource:Oe,children:(0,b.jsx)(d.mZW,{label:"Replication:",value:(0,b.jsx)(f.A,{icon:w?(0,b.jsx)(d.xhy,{}):(0,b.jsx)(d.aaC,{}),label:(0,b.jsx)("label",{className:"muted",children:w?"Enabled":"Disabled"})})})}),(0,b.jsx)(h.R,{scopes:[x.OV.S3_GET_BUCKET_OBJECT_LOCK_CONFIGURATION,x.OV.S3_GET_ACTIONS],resource:Oe,children:(0,b.jsx)(d.mZW,{label:"Object Locking:",value:(0,b.jsx)(f.A,{icon:B?(0,b.jsx)(d.xhy,{}):(0,b.jsx)(d.aaC,{}),label:(0,b.jsx)("label",{className:"muted",children:B?"Enabled":"Disabled"})})})}),(0,b.jsx)(d.azJ,{children:(0,b.jsx)(d.mZW,{label:"Tags:",value:(0,b.jsx)(v,{bucketName:Oe})})}),(0,b.jsx)(O,{iamScopes:[x.OV.ADMIN_SET_BUCKET_QUOTA],resourceName:Oe,property:"Quota:",value:le?"Enabled":"Disabled",onEdit:()=>{ge(!0)},isLoading:$,helpTip:(0,b.jsxs)(i.Fragment,{children:["Setting a"," ",(0,b.jsx)("a",{href:"https://min.io/docs/minio/linux/reference/minio-mc/mc-quota-set.html",target:"blank",children:"quota"})," ","assigns a hard limit to a bucket beyond which MinIO does not allow writes."]})})]}),(0,b.jsxs)(d.azJ,{sx:{display:"grid",gridTemplateColumns:"1fr",alignItems:"flex-start"},children:[(0,b.jsx)(C,{bucketSize:`${R}`}),le&&re?(0,b.jsx)(y,{quota:re}):null]})]})})}),T&&(0,b.jsx)(h.R,{scopes:[x.OV.S3_GET_BUCKET_VERSIONING,x.OV.S3_GET_ACTIONS],resource:Oe,children:(0,b.jsxs)(d.xA9,{item:!0,xs:12,sx:{marginTop:5},children:[(0,b.jsx)(d._xt,{separator:!0,sx:{marginBottom:15},children:"Versioning"}),(0,b.jsx)(d.azJ,{sx:u.mA,children:(0,b.jsxs)(d.azJ,{sx:u.mA,children:[(0,b.jsx)(O,{iamScopes:[x.OV.S3_PUT_BUCKET_VERSIONING,x.OV.S3_PUT_ACTIONS],resourceName:Oe,property:"Current Status:",value:(0,b.jsx)(d.azJ,{sx:{display:"flex",flexDirection:"column",textDecorationStyle:"initial",placeItems:"flex-start",justifyItems:"flex-start",gap:3},children:(0,b.jsxs)("div",{children:[" ",ve]})}),onEdit:()=>{_e(!0)},isLoading:Z,disabled:B}),"Enabled"===(null===ie||void 0===ie?void 0:ie.status)?(0,b.jsx)(S,{versioningState:ie}):null]})})]})}),B&&(0,b.jsx)(h.R,{scopes:[x.OV.S3_GET_OBJECT_RETENTION,x.OV.S3_GET_ACTIONS],resource:Oe,children:(0,b.jsxs)(d.xA9,{item:!0,xs:12,sx:{marginTop:5},children:[(0,b.jsx)(d._xt,{separator:!0,sx:{marginBottom:15},children:"Retention"}),(0,b.jsx)(d.azJ,{sx:u.mA,children:(0,b.jsxs)(d.azJ,{sx:u.mA,children:[(0,b.jsx)(O,{iamScopes:[x.OV.ADMIN_SET_BUCKET_QUOTA],resourceName:Oe,property:"Retention:",value:ue?"Enabled":"Disabled",onEdit:()=>{je(!0)},isLoading:se,helpTip:(0,b.jsxs)(i.Fragment,{children:["MinIO"," ",(0,b.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/macos/administration/object-management.html#object-retention",children:"Object Locking"})," ","enforces Write-Once Read-Many (WORM) immutability to protect versioned objects from deletion."]})}),(0,b.jsx)(d.mZW,{label:"Mode:",value:(0,b.jsx)("label",{className:"muted",style:{textTransform:"capitalize"},children:he&&he.mode?he.mode:"-"})}),(0,b.jsx)(d.mZW,{label:"Validity:",value:(0,b.jsxs)("label",{className:"muted",style:{textTransform:"capitalize"},children:[he&&he.validity," ",he&&(1===he.validity?null===(e=he.unit)||void 0===e?void 0:e.slice(0,-1):he.unit)]})})]})})]})})]})]})}},25903:(e,s,t)=>{t.d(s,{A:()=>l});t(65043);var i=t(89923),n=t(70579);const l=e=>{let{icon:s=null,label:t=null}=e;return(0,n.jsxs)(i.azJ,{sx:{display:"flex",alignItems:"center",gap:5,marginTop:3},children:[(0,n.jsx)(i.azJ,{sx:{height:16,width:16,display:"flex",alignItems:"center"},children:s}),(0,n.jsx)(i.azJ,{children:t})]})}}}]); -//# sourceMappingURL=12.fcd89e94.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/12.fcd89e94.chunk.js.map b/web-app/build/static/js/12.fcd89e94.chunk.js.map deleted file mode 100644 index adbccd059..000000000 --- a/web-app/build/static/js/12.fcd89e94.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"static/js/12.fcd89e94.chunk.js","mappings":"iTAqBA,MAiEA,EAjEuBA,IAIhB,IAADC,EAAAC,EAAA,IAJkB,gBACtBC,EAAkB,CAAC,GAGpBH,EACC,OACEI,EAAAA,EAAAA,MAACC,EAAAA,IAAG,CACFC,GAAI,CACFC,QAAS,OACTC,cAAe,SACfC,IAAK,GACLC,SAAA,EAEFC,EAAAA,EAAAA,KAACN,EAAAA,IAAG,CAACC,GAAI,CAAEM,WAAY,SAAUL,QAAS,OAAQE,IAAK,GAAIC,SACxDP,EAAgBU,gBACfF,EAAAA,E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QACX1M,MAAO,CAAEyC,cAAe,cAAehD,SAEtCuH,IAAmBA,GAAgBuG,KAChCvG,GAAgBuG,KAChB,SAIV7N,EAAAA,EAAAA,KAAC0C,EAAAA,IAAS,CACRjC,MAAO,YACP4B,OACE5C,EAAAA,EAAAA,MAAA,SACEuN,UAAW,QACX1M,MAAO,CAAEyC,cAAe,cAAehD,SAAA,CAEtCuH,IAAmBA,GAAgBwG,SAAU,IAC7CxG,KAC+B,IAA7BA,GAAgBwG,SACO,QADOvJ,EAC3B+C,GAAgByG,YAAI,IAAAxJ,OAAA,EAApBA,EAAsByJ,MAAM,GAAI,GAChC1G,GAAgByG,0BAU/B,C,sEC1rBf,MAyBA,EAzBsB1O,IAAwD,IAAvD,KAAEe,EAAO,KAAI,MAAEK,EAAQ,MAA0BpB,EACtE,OACEI,EAAAA,EAAAA,MAACC,EAAAA,IAAG,CACFC,GAAI,CACFC,QAAS,OACT4C,WAAY,SACZ1C,IAAK,EACLyN,UAAW,GACXxN,SAAA,EAEFC,EAAAA,EAAAA,KAACN,EAAAA,IAAG,CACFC,GAAI,CACF0D,OAAQ,GACRD,MAAO,GACPxD,QAAS,OACT4C,WAAY,UACZzC,SAEDK,KAEHJ,EAAAA,EAAAA,KAACN,EAAAA,IAAG,CAAAK,SAAEU,MACF,C","sources":["screens/Console/Buckets/VersioningInfo.tsx","screens/Console/Buckets/BucketDetails/SummaryItems/EditActionButton.tsx","screens/Console/Buckets/BucketDetails/SummaryItems/EditablePropertyItem.tsx","screens/Console/Buckets/BucketDetails/SummaryItems/ReportedUsage.tsx","screens/Console/Buckets/BucketDetails/SummaryItems/BucketQuotaSize.tsx","screens/Console/Buckets/BucketDetails/BucketSummaryPanel.tsx","screens/Console/Buckets/BucketDetails/SummaryItems/LabelWithIcon.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2023 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { DisabledIcon, EnabledIcon, Box } from \"mds\";\nimport { BucketVersioningResponse } from \"api/consoleApi\";\nimport LabelWithIcon from \"./BucketDetails/SummaryItems/LabelWithIcon\";\n\nconst VersioningInfo = ({\n versioningState = {},\n}: {\n versioningState?: BucketVersioningResponse;\n}) => {\n return (\n \n \n {versioningState.excludeFolders ? (\n \n ) : (\n \n )\n }\n label={\n \n }\n />\n ) : null}\n \n {versioningState.excludedPrefixes?.length ? (\n \n Excluded Prefixes :\n \n {versioningState.excludedPrefixes?.map((it) => (\n

\n {it.prefix}\n
\n ))}\n \n \n ) : null}\n \n );\n};\n\nexport default VersioningInfo;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { EditIcon, IconButton } from \"mds\";\n\ntype EditActionButtonProps = {\n disabled?: boolean;\n onClick: () => void | any;\n [x: string]: any;\n};\n\nconst EditActionButton = ({\n disabled,\n onClick,\n ...restProps\n}: EditActionButtonProps) => {\n return (\n \n \n \n );\n};\n\nexport default EditActionButton;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { ActionLink, Box, HelpTip, ValuePair } from \"mds\";\nimport { SecureComponent } from \"../../../../../common/SecureComponent\";\n\nimport EditActionButton from \"./EditActionButton\";\n\ntype EditablePropertyItemProps = {\n isLoading: boolean;\n resourceName: string;\n iamScopes: string[];\n property: any;\n value: any;\n onEdit: () => void;\n secureCmpProps?: Record;\n disabled?: boolean;\n helpTip?: any;\n};\n\nconst SecureAction = ({\n resourceName,\n iamScopes,\n secureCmpProps = {},\n children,\n}: {\n resourceName: string;\n iamScopes: string[];\n children: any;\n secureCmpProps?: Record;\n}) => {\n return (\n \n {children}\n \n );\n};\n\nconst EditablePropertyItem = ({\n isLoading = true,\n resourceName = \"\",\n iamScopes,\n secureCmpProps = {},\n property = null,\n value = null,\n onEdit,\n disabled = false,\n helpTip,\n}: EditablePropertyItemProps) => {\n return (\n \n \n \n \n \n \n ) : (\n \n \n \n )\n }\n />\n \n \n \n \n );\n};\n\nexport default EditablePropertyItem;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { ReportedUsageFullIcon, Box } from \"mds\";\nimport { niceBytes } from \"../../../../../common/utils\";\n\nconst ReportedUsage = ({ bucketSize }: { bucketSize: string }) => {\n return (\n \n \n\n \n \n Reported Usage:\n \n \n \n \n );\n};\n\nexport default ReportedUsage;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { HardBucketQuotaIcon, Box } from \"mds\";\nimport { niceBytes } from \"../../../../../common/utils\";\n\nconst BucketQuotaSize = ({ quota }: { quota: any }) => {\n return (\n \n \n \n \n {quota?.type} Quota\n \n \n \n \n );\n};\n\nexport default BucketQuotaSize;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\n\nimport get from \"lodash/get\";\nimport { useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom\";\nimport { api } from \"api\";\nimport {\n BucketEncryptionInfo,\n BucketQuota,\n BucketVersioningResponse,\n GetBucketRetentionConfig,\n} from \"api/consoleApi\";\nimport { errorToHandler } from \"api/errors\";\nimport {\n Box,\n DisabledIcon,\n EnabledIcon,\n Grid,\n SectionTitle,\n ValuePair,\n} from \"mds\";\nimport { twoColCssGridLayoutConfig } from \"../../Common/FormComponents/common/styleLibrary\";\nimport { IAM_SCOPES } from \"../../../../common/SecureComponent/permissions\";\nimport {\n hasPermission,\n SecureComponent,\n} from \"../../../../common/SecureComponent\";\nimport {\n selDistSet,\n setErrorSnackMessage,\n setHelpName,\n} from \"../../../../systemSlice\";\nimport {\n selBucketDetailsInfo,\n selBucketDetailsLoading,\n setBucketDetailsLoad,\n} from \"./bucketDetailsSlice\";\nimport { useAppDispatch } from \"../../../../store\";\nimport VersioningInfo from \"../VersioningInfo\";\nimport withSuspense from \"../../Common/Components/withSuspense\";\nimport LabelWithIcon from \"./SummaryItems/LabelWithIcon\";\nimport EditablePropertyItem from \"./SummaryItems/EditablePropertyItem\";\nimport ReportedUsage from \"./SummaryItems/ReportedUsage\";\nimport BucketQuotaSize from \"./SummaryItems/BucketQuotaSize\";\n\nconst SetAccessPolicy = withSuspense(\n React.lazy(() => import(\"./SetAccessPolicy\")),\n);\nconst SetRetentionConfig = withSuspense(\n React.lazy(() => import(\"./SetRetentionConfig\")),\n);\nconst EnableBucketEncryption = withSuspense(\n React.lazy(() => import(\"./EnableBucketEncryption\")),\n);\nconst EnableVersioningModal = withSuspense(\n React.lazy(() => import(\"./EnableVersioningModal\")),\n);\nconst BucketTags = withSuspense(\n React.lazy(() => import(\"./SummaryItems/BucketTags\")),\n);\nconst EnableQuota = withSuspense(React.lazy(() => import(\"./EnableQuota\")));\n\nconst BucketSummary = () => {\n const dispatch = useAppDispatch();\n const params = useParams();\n\n const loadingBucket = useSelector(selBucketDetailsLoading);\n const bucketInfo = useSelector(selBucketDetailsInfo);\n const distributedSetup = useSelector(selDistSet);\n\n const [encryptionCfg, setEncryptionCfg] =\n useState(null);\n const [bucketSize, setBucketSize] = useState(\"0\");\n const [hasObjectLocking, setHasObjectLocking] = useState(\n false,\n );\n const [accessPolicyScreenOpen, setAccessPolicyScreenOpen] =\n useState(false);\n const [replicationRules, setReplicationRules] = useState(false);\n const [loadingObjectLocking, setLoadingLocking] = useState(true);\n const [loadingSize, setLoadingSize] = useState(true);\n const [bucketLoading, setBucketLoading] = useState(true);\n const [loadingEncryption, setLoadingEncryption] = useState(true);\n const [loadingVersioning, setLoadingVersioning] = useState(true);\n const [loadingQuota, setLoadingQuota] = useState(true);\n const [loadingReplication, setLoadingReplication] = useState(true);\n const [loadingRetention, setLoadingRetention] = useState(true);\n const [versioningInfo, setVersioningInfo] =\n useState();\n const [quotaEnabled, setQuotaEnabled] = useState(false);\n const [quota, setQuota] = useState(null);\n const [encryptionEnabled, setEncryptionEnabled] = useState(false);\n const [retentionEnabled, setRetentionEnabled] = useState(false);\n const [retentionConfig, setRetentionConfig] =\n useState(null);\n const [retentionConfigOpen, setRetentionConfigOpen] =\n useState(false);\n const [enableEncryptionScreenOpen, setEnableEncryptionScreenOpen] =\n useState(false);\n const [enableQuotaScreenOpen, setEnableQuotaScreenOpen] =\n useState(false);\n const [enableVersioningOpen, setEnableVersioningOpen] =\n useState(false);\n useEffect(() => {\n dispatch(setHelpName(\"bucket_detail_summary\"));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const bucketName = params.bucketName || \"\";\n\n let accessPolicy = \"PRIVATE\";\n let policyDefinition = \"\";\n\n if (bucketInfo !== null && bucketInfo.access && bucketInfo.definition) {\n accessPolicy = bucketInfo.access;\n policyDefinition = bucketInfo.definition;\n }\n\n const displayGetBucketObjectLockConfiguration = hasPermission(bucketName, [\n IAM_SCOPES.S3_GET_BUCKET_OBJECT_LOCK_CONFIGURATION,\n IAM_SCOPES.S3_GET_ACTIONS,\n ]);\n\n const displayGetBucketEncryptionConfiguration = hasPermission(bucketName, [\n IAM_SCOPES.S3_GET_BUCKET_ENCRYPTION_CONFIGURATION,\n IAM_SCOPES.S3_GET_ACTIONS,\n ]);\n\n const displayGetBucketQuota = hasPermission(bucketName, [\n IAM_SCOPES.ADMIN_GET_BUCKET_QUOTA,\n ]);\n\n useEffect(() => {\n if (loadingBucket) {\n setBucketLoading(true);\n } else {\n setBucketLoading(false);\n }\n }, [loadingBucket, setBucketLoading]);\n\n useEffect(() => {\n if (loadingEncryption) {\n if (displayGetBucketEncryptionConfiguration) {\n api.buckets\n .getBucketEncryptionInfo(bucketName)\n .then((res) => {\n if (res.data.algorithm) {\n setEncryptionEnabled(true);\n setEncryptionCfg(res.data);\n }\n setLoadingEncryption(false);\n })\n .catch((err) => {\n err = errorToHandler(err.error);\n if (\n err.errorMessage ===\n \"The server side encryption configuration was not found\"\n ) {\n setEncryptionEnabled(false);\n setEncryptionCfg(null);\n }\n setLoadingEncryption(false);\n });\n } else {\n setEncryptionEnabled(false);\n setEncryptionCfg(null);\n setLoadingEncryption(false);\n }\n }\n }, [loadingEncryption, bucketName, displayGetBucketEncryptionConfiguration]);\n\n useEffect(() => {\n if (loadingVersioning && distributedSetup) {\n api.buckets\n .getBucketVersioning(bucketName)\n .then((res) => {\n setVersioningInfo(res.data);\n setLoadingVersioning(false);\n })\n .catch((err) => {\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n setLoadingVersioning(false);\n });\n }\n }, [loadingVersioning, dispatch, bucketName, distributedSetup]);\n\n useEffect(() => {\n if (loadingQuota && distributedSetup) {\n if (displayGetBucketQuota) {\n api.buckets\n .getBucketQuota(bucketName)\n .then((res) => {\n setQuota(res.data);\n if (res.data.quota) {\n setQuotaEnabled(true);\n } else {\n setQuotaEnabled(false);\n }\n setLoadingQuota(false);\n })\n .catch((err) => {\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n setQuotaEnabled(false);\n setLoadingQuota(false);\n });\n } else {\n setQuotaEnabled(false);\n setLoadingQuota(false);\n }\n }\n }, [\n loadingQuota,\n setLoadingVersioning,\n dispatch,\n bucketName,\n distributedSetup,\n displayGetBucketQuota,\n ]);\n\n useEffect(() => {\n if (loadingVersioning && distributedSetup) {\n if (displayGetBucketObjectLockConfiguration) {\n api.buckets\n .getBucketObjectLockingStatus(bucketName)\n .then((res) => {\n setHasObjectLocking(res.data.object_locking_enabled);\n setLoadingLocking(false);\n })\n .catch((err) => {\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n setLoadingLocking(false);\n });\n } else {\n setLoadingLocking(false);\n }\n }\n }, [\n loadingObjectLocking,\n dispatch,\n bucketName,\n loadingVersioning,\n distributedSetup,\n displayGetBucketObjectLockConfiguration,\n ]);\n\n useEffect(() => {\n if (loadingSize) {\n api.buckets\n .listBuckets()\n .then((res) => {\n const resBuckets = get(res.data, \"buckets\", []);\n\n const bucketInfo = resBuckets.find(\n (bucket) => bucket.name === bucketName,\n );\n\n const size = get(bucketInfo, \"size\", \"0\");\n\n setLoadingSize(false);\n setBucketSize(size);\n })\n .catch((err) => {\n setLoadingSize(false);\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n });\n }\n }, [loadingSize, dispatch, bucketName]);\n\n useEffect(() => {\n if (loadingReplication && distributedSetup) {\n api.buckets\n .getBucketReplication(bucketName)\n .then((res) => {\n const r = res.data.rules ? res.data.rules : [];\n setReplicationRules(r.length > 0);\n setLoadingReplication(false);\n })\n .catch((err) => {\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n setLoadingReplication(false);\n });\n }\n }, [loadingReplication, dispatch, bucketName, distributedSetup]);\n\n useEffect(() => {\n if (loadingRetention && hasObjectLocking) {\n api.buckets\n .getBucketRetentionConfig(bucketName)\n .then((res) => {\n setLoadingRetention(false);\n setRetentionEnabled(true);\n setRetentionConfig(res.data);\n })\n .catch((err) => {\n setRetentionEnabled(false);\n setLoadingRetention(false);\n setRetentionConfig(null);\n });\n }\n }, [loadingRetention, hasObjectLocking, bucketName]);\n\n const loadAllBucketData = () => {\n dispatch(setBucketDetailsLoad(true));\n setBucketLoading(true);\n setLoadingSize(true);\n setLoadingVersioning(true);\n setLoadingEncryption(true);\n setLoadingRetention(true);\n };\n\n const setBucketVersioning = () => {\n setEnableVersioningOpen(true);\n };\n const setBucketQuota = () => {\n setEnableQuotaScreenOpen(true);\n };\n\n const closeEnableBucketEncryption = () => {\n setEnableEncryptionScreenOpen(false);\n setLoadingEncryption(true);\n };\n const closeEnableBucketQuota = () => {\n setEnableQuotaScreenOpen(false);\n setLoadingQuota(true);\n };\n\n const closeSetAccessPolicy = () => {\n setAccessPolicyScreenOpen(false);\n loadAllBucketData();\n };\n\n const closeRetentionConfig = () => {\n setRetentionConfigOpen(false);\n loadAllBucketData();\n };\n\n const closeEnableVersioning = (refresh: boolean) => {\n setEnableVersioningOpen(false);\n if (refresh) {\n loadAllBucketData();\n }\n };\n\n let versioningStatus = versioningInfo?.status;\n let versioningText = \"Unversioned (Default)\";\n if (versioningStatus === \"Enabled\") {\n versioningText = \"Versioned\";\n } else if (versioningStatus === \"Suspended\") {\n versioningText = \"Suspended\";\n }\n\n return (\n \n {enableEncryptionScreenOpen && (\n \n )}\n {enableQuotaScreenOpen && (\n \n )}\n {accessPolicyScreenOpen && (\n \n )}\n {retentionConfigOpen && (\n \n )}\n {enableVersioningOpen && (\n \n )}\n\n \n Summary\n \n \n \n \n \n \n \n {\n setAccessPolicyScreenOpen(true);\n }}\n isLoading={bucketLoading}\n helpTip={\n \n Private policy limits access to\n credentialled accounts with appropriate permissions\n
\n Public policy anyone will be able to\n upload, download and delete files from this Bucket once\n logged in\n
\n Custom policy can be written to define\n which accounts are authorized to access this Bucket\n
\n
\n To allow Bucket access without credentials, use the{\" \"}\n \n Anonymous\n {\" \"}\n setting\n
\n }\n />\n \n\n \n {\n setEnableEncryptionScreenOpen(true);\n }}\n isLoading={loadingEncryption}\n helpTip={\n \n MinIO supports enabling automatic{\" \"}\n \n SSE-KMS\n {\" \"}\n and{\" \"}\n \n SSE-S3\n {\" \"}\n encryption of all objects written to a bucket using a\n specific External Key (EK) stored on the external KMS.\n \n }\n />\n \n\n \n : \n }\n label={\n \n }\n />\n }\n />\n \n\n \n : \n }\n label={\n \n }\n />\n }\n />\n \n \n }\n />\n \n \n Setting a{\" \"}\n \n quota\n {\" \"}\n assigns a hard limit to a bucket beyond which MinIO does\n not allow writes.\n
\n }\n />\n \n \n \n {quotaEnabled && quota ? (\n \n ) : null}\n \n \n \n \n\n {distributedSetup && (\n \n \n \n Versioning\n \n\n \n \n \n
{versioningText}
\n
\n }\n onEdit={setBucketVersioning}\n isLoading={loadingVersioning}\n disabled={hasObjectLocking}\n />\n\n {versioningInfo?.status === \"Enabled\" ? (\n \n ) : null}\n
\n \n
\n \n )}\n\n {hasObjectLocking && (\n \n \n \n Retention\n \n\n \n \n {\n setRetentionConfigOpen(true);\n }}\n isLoading={loadingRetention}\n helpTip={\n \n MinIO{\" \"}\n \n Object Locking\n {\" \"}\n enforces Write-Once Read-Many (WORM) immutability to\n protect versioned objects from deletion.\n \n }\n />\n\n \n {retentionConfig && retentionConfig.mode\n ? retentionConfig.mode\n : \"-\"}\n \n }\n />\n \n {retentionConfig && retentionConfig.validity}{\" \"}\n {retentionConfig &&\n (retentionConfig.validity === 1\n ? retentionConfig.unit?.slice(0, -1)\n : retentionConfig.unit)}\n \n }\n />\n \n \n \n \n )}\n \n \n );\n};\n\nexport default BucketSummary;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Box } from \"mds\";\n\ntype LabelWithIconProps = {\n icon: React.ReactNode | null;\n label: React.ReactNode | null;\n};\n\nconst LabelWithIcon = ({ icon = null, label = null }: LabelWithIconProps) => {\n return (\n \n \n {icon}\n \n {label}\n \n );\n};\n\nexport default LabelWithIcon;\n"],"names":["_ref","_versioningState$excl","_versioningState$excl2","versioningState","_jsxs","Box","sx","display","flexDirection","gap","children","_jsx","fontWeight","excludeFolders","LabelWithIcon","icon","EnabledIcon","style","color","DisabledIcon","label","textDecoration","excludedPrefixes","length","justifyItems","placeItems","maxHeight","overflowY","map","it","prefix","disabled","onClick","restProps","IconButton","size","EditIcon","SecureAction","resourceName","iamScopes","secureCmpProps","SecureComponent","scopes","resource","errorProps","_ref2","isLoading","property","value","onEdit","helpTip","alignItems","justifyContent","ValuePair","HelpTip","placement","content","ActionLink","textTransform","EditActionButton","background","marginLeft","top","width","height","bucketSize","ReportedUsageFullIcon","flexFlow","fontSize","niceBytes","quota","HardBucketQuotaIcon","type","SetAccessPolicy","withSuspense","React","SetRetentionConfig","EnableBucketEncryption","EnableVersioningModal","BucketTags","EnableQuota","BucketSummary","_retentionConfig$unit","dispatch","useAppDispatch","params","useParams","loadingBucket","useSelector","selBucketDetailsLoading","bucketInfo","selBucketDetailsInfo","distributedSetup","selDistSet","encryptionCfg","setEncryptionCfg","useState","setBucketSize","hasObjectLocking","setHasObjectLocking","accessPolicyScreenOpen","setAccessPolicyScreenOpen","replicationRules","setReplicationRules","loadingObjectLocking","setLoadingLocking","loadingSize","setLoadingSize","bucketLoading","setBucketLoading","loadingEncryption","setLoadingEncryption","loadingVersioning","setLoadingVersioning","loadingQuota","setLoadingQuota","loadingReplication","setLoadingReplication","loadingRetention","setLoadingRetention","versioningInfo","setVersioningInfo","quotaEnabled","setQuotaEnabled","setQuota","encryptionEnabled","setEncryptionEnabled","retentionEnabled","setRetentionEnabled","retentionConfig","setRetentionConfig","retentionConfigOpen","setRetentionConfigOpen","enableEncryptionScreenOpen","setEnableEncryptionScreenOpen","enableQuotaScreenOpen","setEnableQuotaScreenOpen","enableVersioningOpen","setEnableVersioningOpen","useEffect","setHelpName","bucketName","accessPolicy","policyDefinition","access","definition","displayGetBucketObjectLockConfiguration","hasPermission","IAM_SCOPES","S3_GET_BUCKET_OBJECT_LOCK_CONFIGURATION","S3_GET_ACTIONS","displayGetBucketEncryptionConfiguration","S3_GET_BUCKET_ENCRYPTION_CONFIGURATION","displayGetBucketQuota","ADMIN_GET_BUCKET_QUOTA","api","buckets","getBucketEncryptionInfo","then","res","data","algorithm","catch","err","errorToHandler","error","errorMessage","getBucketVersioning","setErrorSnackMessage","getBucketQuota","getBucketObjectLockingStatus","object_locking_enabled","listBuckets","get","find","bucket","name","getBucketReplication","r","rules","getBucketRetentionConfig","loadAllBucketData","setBucketDetailsLoad","versioningStatus","status","versioningText","Fragment","open","selectedBucket","closeModalAndRefresh","closeEnableBucketEncryption","enabled","cfg","closeEnableBucketQuota","actualPolicy","actualDefinition","closeSetAccessPolicy","closeRetentionConfig","closeVersioningModalAndRefresh","refresh","modalOpen","objectLockingEnabled","SectionTitle","separator","marginBottom","Grid","container","S3_GET_BUCKET_POLICY","item","xs","twoColCssGridLayoutConfig","EditablePropertyItem","S3_PUT_BUCKET_POLICY","S3_PUT_ACTIONS","toLowerCase","href","S3_PUT_BUCKET_ENCRYPTION_CONFIGURATION","target","S3_GET_REPLICATION_CONFIGURATION","className","ADMIN_SET_BUCKET_QUOTA","setBucketQuota","gridTemplateColumns","ReportedUsage","BucketQuotaSize","S3_GET_BUCKET_VERSIONING","marginTop","S3_PUT_BUCKET_VERSIONING","textDecorationStyle","setBucketVersioning","VersioningInfo","S3_GET_OBJECT_RETENTION","mode","validity","unit","slice"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/1303.6fa13ab4.chunk.js b/web-app/build/static/js/1303.6fa13ab4.chunk.js deleted file mode 100644 index 512e717bf..000000000 --- a/web-app/build/static/js/1303.6fa13ab4.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[1303],{1303:(e,t,a)=>{a.r(t),a.d(t,{default:()=>g});var n=a(65043),l=a(89923),r=a(77403),s=a(94141),o=a(64159),i=a(21383),d=a(56629),c=a(53518),u=a(70579);const g=e=>{let{modalOpen:t,currentTags:a,onCloseAndUpdate:g,bucketName:m}=e;const p=(0,i.jL)(),[b,h]=(0,n.useState)(""),[x,w]=(0,n.useState)(""),[j,C]=(0,n.useState)(!1);return(0,u.jsx)(s.A,{modalOpen:t,title:"Add New Tag ",onClose:()=>{g(!1)},titleIcon:(0,u.jsx)(l.b_$,{}),children:(0,u.jsxs)(l.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,u.jsxs)(l.azJ,{sx:{marginBottom:15},children:[(0,u.jsx)("strong",{children:"Bucket"}),": ",m]}),(0,u.jsx)(l.cl_,{value:b,label:"New Tag Key",id:"newTagKey",name:"newTagKey",placeholder:"Enter New Tag Key",onChange:e=>{h(e.target.value)}}),(0,u.jsx)(l.cl_,{value:x,label:"New Tag Label",id:"newTagLabel",name:"newTagLabel",placeholder:"Enter New Tag Label",onChange:e=>{w(e.target.value)}}),(0,u.jsxs)(l.xA9,{item:!0,xs:12,sx:r.Uz.modalButtonBar,children:[(0,u.jsx)(l.$nd,{id:"clear",type:"button",variant:"regular",onClick:()=>{w(""),h("")},label:"Clear"}),(0,u.jsx)(l.$nd,{id:"save-add-bucket-tag",type:"submit",variant:"callAction",color:"primary",disabled:""===x.trim()||""===b.trim()||j,onClick:()=>{C(!0);const e={};e[b]=x;const t={...a,...e};d.F.buckets.putBucketTags(m,{tags:t}).then((()=>{C(!1),g(!0)})).catch((e=>{p((0,o.Dy)((0,c.S)(e.error))),C(!1)}))},label:"Save"})]})]})})}},94141:(e,t,a)=>{a.d(t,{A:()=>c});var n=a(65043),l=a(22166),r=a(89923),s=a(21383),o=a(64159),i=a(49555),d=a(70579);const c=e=>{let{onClose:t,modalOpen:a,title:c,children:u,wideLimit:g=!0,titleIcon:m=null,iconColor:p="default",sx:b}=e;const h=(0,s.jL)(),[x,w]=(0,n.useState)(!1),j=(0,l.d4)((e=>e.system.modalSnackBar));(0,n.useEffect)((()=>{h((0,o.h0)(""))}),[h]),(0,n.useEffect)((()=>{if(j){if(""===j.message)return void w(!1);"error"!==j.type&&w(!0)}}),[j]);let C="";return j&&(C=j.detailedErrorMsg,(""===C||C&&C.length<5)&&(C=j.message)),(0,d.jsxs)(r.ngX,{onClose:t,open:a,title:c,titleIcon:m,widthLimit:g,sx:b,iconColor:p,children:[(0,d.jsx)(i.A,{isModal:!0}),(0,d.jsx)(r.qb_,{onClose:()=>{w(!1),h((0,o.h0)(""))},open:x,message:C,mode:"inline",variant:"error"===j.type?"error":"default",autoHideDuration:"error"===j.type?10:5,condensed:!0}),u]})}}}]); -//# sourceMappingURL=1303.6fa13ab4.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/1303.6fa13ab4.chunk.js.map b/web-app/build/static/js/1303.6fa13ab4.chunk.js.map deleted file mode 100644 index f1fa175a5..000000000 --- a/web-app/build/static/js/1303.6fa13ab4.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"static/js/1303.6fa13ab4.chunk.js","mappings":"uOAgCA,MA+FA,EA/F0BA,IAKF,IALG,UACzBC,EAAS,YACTC,EAAW,iBACXC,EAAgB,WAChBC,GACgBJ,EAChB,MAAMK,GAAWC,EAAAA,EAAAA,OACVC,EAAQC,IAAaC,EAAAA,EAAAA,UAAiB,KACtCC,EAAUC,IAAeF,EAAAA,EAAAA,UAAiB,KAC1CG,EAAWC,IAAgBJ,EAAAA,EAAAA,WAAkB,GA4BpD,OACEK,EAAAA,EAAAA,KAACC,EAAAA,EAAY,CACXd,UAAWA,EACXe,MAAO,eACPC,QAASA,KACPd,GAAiB,EAAM,EAEzBe,WAAWJ,EAAAA,EAAAA,KAACK,EAAAA,IAAa,IAAIC,UAE7BC,EAAAA,EAAAA,MAACC,EAAAA,IAAU,CAACC,aAAa,EAAOC,kBAAkB,EAAMJ,SAAA,EACtDC,EAAAA,EAAAA,MAACI,EAAAA,IAAG,CAACC,GAAI,CAAEC,aAAc,IAAKP,SAAA,EAC5BN,EAAAA,EAAAA,KAAA,UAAAM,SAAQ,WAAe,KAAGhB,MAE5BU,EAAAA,E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Y1B,EACZ,MAAMK,GAAWC,EAAAA,EAAAA,OACV0D,EAAcC,IAAmBxD,EAAAA,EAAAA,WAAkB,GAEpDyD,GAAoBC,EAAAA,EAAAA,KACvBC,GAAoBA,EAAMC,OAAOC,iBAGpCC,EAAAA,EAAAA,YAAU,KACRlE,GAASmE,EAAAA,EAAAA,IAAqB,IAAI,GACjC,CAACnE,KAEJkE,EAAAA,EAAAA,YAAU,KACR,GAAIL,EAAmB,CACrB,GAAkC,KAA9BA,EAAkBO,QAEpB,YADAR,GAAgB,GAIa,UAA3BC,EAAkBvB,MACpBsB,GAAgB,EAEpB,IACC,CAACC,IAOJ,IAAIO,EAAU,GASd,OAPIP,IACFO,EAAUP,EAAkBQ,kBACZ,KAAZD,GAAmBA,GAAWA,EAAQE,OAAS,KACjDF,EAAUP,EAAkBO,WAK9BpD,EAAAA,EAAAA,MAACuD,EAAAA,IAAQ,CACP3D,QAASA,EACT4D,KAAM5E,EACNe,MAAOA,EACPE,UAAWA,EACX4D,WAAYhB,EACZpC,GAAIA,EACJqC,UAAWA,EAAU3C,SAAA,EAErBN,EAAAA,EAAAA,KAACiE,EAAAA,EAAS,CAACC,SAAS,KACpBlE,EAAAA,EAAAA,KAACmE,EAAAA,IAAQ,CACPhE,QA1BgBiE,KACpBjB,GAAgB,GAChB5D,GAASmE,EAAAA,EAAAA,IAAqB,IAAI,EAyB9BK,KAAMb,EACNS,QAASA,EACTU,KAAM,SACNvC,QAAoC,UAA3BsB,EAAkBvB,KAAmB,QAAU,UACxDyC,iBAA6C,UAA3BlB,EAAkBvB,KAAmB,GAAK,EAC5D0C,WAAS,IAEVjE,IACQ,C","sources":["screens/Console/Buckets/BucketDetails/AddBucketTagModal.tsx","screens/Console/Common/ModalWrapper/ModalWrapper.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useState } from \"react\";\nimport { AddNewTagIcon, Box, Button, FormLayout, Grid, InputBox } from \"mds\";\nimport { modalStyleUtils } from \"../../Common/FormComponents/common/styleLibrary\";\nimport ModalWrapper from \"../../Common/ModalWrapper/ModalWrapper\";\nimport { setModalErrorSnackMessage } from \"../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../store\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\n\ninterface IBucketTagModal {\n modalOpen: boolean;\n currentTags: any;\n bucketName: string;\n onCloseAndUpdate: (refresh: boolean) => void;\n}\n\nconst AddBucketTagModal = ({\n modalOpen,\n currentTags,\n onCloseAndUpdate,\n bucketName,\n}: IBucketTagModal) => {\n const dispatch = useAppDispatch();\n const [newKey, setNewKey] = useState(\"\");\n const [newLabel, setNewLabel] = useState(\"\");\n const [isSending, setIsSending] = useState(false);\n\n const resetForm = () => {\n setNewLabel(\"\");\n setNewKey(\"\");\n };\n\n const addTagProcess = () => {\n setIsSending(true);\n const newTag: any = {};\n\n newTag[newKey] = newLabel;\n const newTagList = { ...currentTags, ...newTag };\n\n api.buckets\n .putBucketTags(bucketName, {\n tags: newTagList,\n })\n .then(() => {\n setIsSending(false);\n onCloseAndUpdate(true);\n })\n .catch((error) => {\n dispatch(setModalErrorSnackMessage(errorToHandler(error.error)));\n setIsSending(false);\n });\n };\n\n return (\n {\n onCloseAndUpdate(false);\n }}\n titleIcon={}\n >\n \n \n Bucket: {bucketName}\n \n {\n setNewKey(e.target.value);\n }}\n />\n {\n setNewLabel(e.target.value);\n }}\n />\n \n \n \n \n \n \n );\n};\n\nexport default AddBucketTagModal;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { ModalBox, Snackbar } from \"mds\";\nimport { CSSObject } from \"styled-components\";\nimport { AppState, useAppDispatch } from \"../../../../store\";\nimport { setModalSnackMessage } from \"../../../../systemSlice\";\nimport MainError from \"../MainError/MainError\";\n\ninterface IModalProps {\n onClose: () => void;\n modalOpen: boolean;\n title: string | React.ReactNode;\n children: any;\n wideLimit?: boolean;\n titleIcon?: React.ReactNode;\n iconColor?: \"default\" | \"delete\" | \"accept\";\n sx?: CSSObject;\n}\n\nconst ModalWrapper = ({\n onClose,\n modalOpen,\n title,\n children,\n wideLimit = true,\n titleIcon = null,\n iconColor = \"default\",\n sx,\n}: IModalProps) => {\n const dispatch = useAppDispatch();\n const [openSnackbar, setOpenSnackbar] = useState(false);\n\n const modalSnackMessage = useSelector(\n (state: AppState) => state.system.modalSnackBar,\n );\n\n useEffect(() => {\n dispatch(setModalSnackMessage(\"\"));\n }, [dispatch]);\n\n useEffect(() => {\n if (modalSnackMessage) {\n if (modalSnackMessage.message === \"\") {\n setOpenSnackbar(false);\n return;\n }\n // Open SnackBar\n if (modalSnackMessage.type !== \"error\") {\n setOpenSnackbar(true);\n }\n }\n }, [modalSnackMessage]);\n\n const closeSnackBar = () => {\n setOpenSnackbar(false);\n dispatch(setModalSnackMessage(\"\"));\n };\n\n let message = \"\";\n\n if (modalSnackMessage) {\n message = modalSnackMessage.detailedErrorMsg;\n if (message === \"\" || (message && message.length < 5)) {\n message = modalSnackMessage.message;\n }\n }\n\n return (\n \n \n \n {children}\n \n );\n};\n\nexport default ModalWrapper;\n"],"names":["_ref","modalOpen","currentTags","onCloseAndUpdate","bucketName","dispatch","useAppDispatch","newKey","setNewKey","useState","newLabel","setNewLabel","isSending","setIsSending","_jsx","ModalWrapper","title","onClose","titleIcon","AddNewTagIcon","children","_jsxs","FormLayout","withBorders","containerPadding","Box","sx","marginBottom","InputBox","value","label","id","name","placeholder","onChange","e","target","Grid","item","xs","modalStyleUtils","modalButtonBar","Button","type","variant","onClick","resetForm","color","disabled","trim","addTagProcess","newTag","newTagList","api","buckets","putBucketTags","tags","then","catch","error","setModalErrorSnackMessage","errorToHandler","wideLimit","iconColor","openSnackbar","setOpenSnackbar","modalSnackMessage","useSelector","state","system","modalSnackBar","useEffect","setModalSnackMessage","message","detailedErrorMsg","length","ModalBox","open","widthLimit","MainError","isModal","Snackbar","closeSnackBar","mode","autoHideDuration","condensed"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/1324.b4c459ae.chunk.js b/web-app/build/static/js/1324.b4c459ae.chunk.js deleted file mode 100644 index 6c22d76a7..000000000 --- a/web-app/build/static/js/1324.b4c459ae.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[1324,4705,5851],{94141:(e,s,t)=>{t.d(s,{A:()=>d});var l=t(65043),n=t(22166),i=t(89923),o=t(21383),r=t(64159),c=t(49555),a=t(70579);const d=e=>{let{onClose:s,modalOpen:t,title:d,children:u,wideLimit:p=!0,titleIcon:x=null,iconColor:h="default",sx:m}=e;const j=(0,o.jL)(),[g,b]=(0,l.useState)(!1),y=(0,n.d4)((e=>e.system.modalSnackBar));(0,l.useEffect)((()=>{j((0,r.h0)(""))}),[j]),(0,l.useEffect)((()=>{if(y){if(""===y.message)return void b(!1);"error"!==y.type&&b(!0)}}),[y]);let f="";return y&&(f=y.detailedErrorMsg,(""===f||f&&f.length<5)&&(f=y.message)),(0,a.jsxs)(i.ngX,{onClose:s,open:t,title:d,titleIcon:x,widthLimit:p,sx:m,iconColor:h,children:[(0,a.jsx)(c.A,{isModal:!0}),(0,a.jsx)(i.qb_,{onClose:()=>{b(!1),j((0,r.h0)(""))},open:g,message:f,mode:"inline",variant:"error"===y.type?"error":"default",autoHideDuration:"error"===y.type?10:5,condensed:!0}),u]})}},85851:(e,s,t)=>{t.r(s),t.d(s,{default:()=>u});var l=t(65043),n=t(89923),i=t(64159),o=t(21383),r=t(58661),c=t(56629),a=t(53518),d=t(70579);const u=e=>{let{selectedGroups:s,deleteOpen:t,closeDeleteModalAndRefresh:u}=e;const p=(0,o.jL)(),[x,h]=(0,l.useState)(!1);if(!s)return null;const m=s.map((e=>(0,d.jsx)("div",{children:(0,d.jsx)("b",{children:e})},e)));return(0,d.jsx)(r.A,{title:"Delete Group"+(s.length>1?"s":""),confirmText:"Delete",isOpen:t,titleIcon:(0,d.jsx)(n.xWY,{}),isLoading:x,onConfirm:()=>{for(let e of s)h(!0),c.F.group.removeGroup(e).then((e=>{u(!0)})).catch((async e=>{const s=await e.json();p((0,i.C9)((0,a.S)(s))),u(!1)})).finally((()=>h(!1)))},onClose:()=>u(!1),confirmationContent:(0,d.jsxs)(l.Fragment,{children:["Are you sure you want to delete the following"," ",1===s.length?"":s.length," group",s.length>1?"s?":"?",m]})})}},91324:(e,s,t)=>{t.r(s),t.d(s,{default:()=>C});var l=t(65043),n=t(73216),i=t(89923),o=t(56629),r=t(53518),c=t(99161),a=t(77938),d=t(64159),u=t(21383),p=t(62560),x=t(74705),h=t(77403),m=t(22923),j=t(94141),g=t(70579);const b=e=>{let{title:s="",groupStatus:t="enabled",preSelectedUsers:n=[],selectedGroup:c="",open:a,onClose:p}=e;const x=(0,u.jL)(),[b,y]=(0,l.useState)(n);return(0,g.jsxs)(j.A,{modalOpen:a,onClose:p,title:s,titleIcon:(0,g.jsx)(i.WC,{}),children:[(0,g.jsxs)(i.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,g.jsx)(i.EmB,{label:"Selected Group",sx:{width:"100%"},children:c}),(0,g.jsx)(m.A,{selectedUsers:b,setSelectedUsers:y,editMode:!c})]}),(0,g.jsxs)(i.xA9,{item:!0,xs:12,sx:h.Uz.modalButtonBar,children:[(0,g.jsx)(i.$nd,{id:"reset-add-group-member",type:"button",variant:"regular",onClick:()=>{y(n)},label:"Reset"}),(0,g.jsx)(i.$nd,{id:"save-add-group-member",type:"button",variant:"callAction",onClick:()=>{o.F.group.updateGroup(c,{members:b,status:t}).then((()=>{p()})).catch((e=>{p(),x((0,d.Dy)((0,r.S)(e.error)))}))},label:"Save"})]})]})};var y=t(85851),f=t(64681),v=t(6681),A=t(88617),S=t(48793);const C=()=>{const e=(0,u.jL)(),s=(0,n.Zp)(),t=(0,n.g)(),[h,m]=(0,l.useState)({}),[j,C]=(0,l.useState)(!1),[P,G]=(0,l.useState)(!1),[M,U]=(0,l.useState)(!1),[k,w]=(0,l.useState)(""),[E,L]=(0,l.useState)("members"),{members:z=[],policy:D="",status:I}=h,N=z.filter((e=>e.includes(k))),R=(0,a._)(c.Ms,c.Ld,!0);(0,l.useEffect)((()=>{e((0,d.ph)("group_details"))}),[]),(0,l.useEffect)((()=>{t.groupName&&J()}),[t.groupName]);const F=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.length<=0?[]:e.split(",")}(D),B="enabled"===I,K=z.length>0?"Edit Members":"Add Members",_=(0,a._)(c.Ms,c.Oh),O=(0,a._)(c.Ms,c.Hr,!0),$=(0,a._)(c.Ms,c.QR,!0),H=(0,a._)(c.Ms,c.yv,!0);function J(){_&&o.F.group.groupInfo(t.groupName||"").then((e=>{m(e.data)})).catch((s=>{e((0,d.Dy)((0,r.S)(s.error))),m({})}))}const T=(0,g.jsxs)(i.azJ,{onMouseMove:()=>{e((0,d.ph)("groups_members"))},children:[(0,g.jsx)(i._xt,{separator:!0,sx:{marginBottom:15},actions:(0,g.jsxs)(i.azJ,{sx:{display:"flex",gap:10},children:[(0,g.jsx)(f.A,{placeholder:"Search members",onChange:e=>{w(e)},value:k,sx:{maxWidth:280}}),(0,g.jsx)(a.R,{resource:c.Ms,scopes:c.BD,errorProps:{disabled:!0},children:(0,g.jsx)(v.A,{tooltip:O?K:(0,c.vj)(c.k1,"edit Group membership"),children:(0,g.jsx)(i.$nd,{id:"add-user-group",label:K,variant:"callAction",icon:(0,g.jsx)(i.REV,{}),onClick:()=>{G(!0)},disabled:!O})})})]}),children:"Members"}),(0,g.jsx)(i.xA9,{item:!0,xs:12,children:(0,g.jsx)(a.R,{resource:c.Ms,scopes:c.x6,errorProps:{disabled:!0},children:(0,g.jsx)(v.A,{tooltip:R?"":(0,c.vj)(c.Ld,"view User details"),children:(0,g.jsx)(i.bQt,{itemActions:[{type:"view",onClick:e=>{s(`${c.zZ.USERS}/${encodeURIComponent(e)}`)},isDisabled:!R}],columns:[{label:"Access Key"}],selectedItems:[],isLoading:!1,records:N,entityName:"Users"})})})})]}),Q=(0,g.jsxs)(l.Fragment,{children:[(0,g.jsx)(i.azJ,{onMouseMove:()=>{e((0,d.ph)("groups_policies"))},children:(0,g.jsx)(i._xt,{separator:!0,sx:{marginBottom:15},actions:(0,g.jsx)(v.A,{tooltip:$?"Set Policies":(0,c.vj)(c.QR,"assign Policies"),children:(0,g.jsx)(i.$nd,{id:"set-policies",label:"Set Policies",variant:"callAction",icon:(0,g.jsx)(i.n$X,{}),onClick:()=>{C(!0)},disabled:!$})}),children:"Policies"})}),(0,g.jsx)(i.xA9,{item:!0,xs:12,children:(0,g.jsx)(v.A,{tooltip:H?"":(0,c.vj)(c.yv,"view Policy details"),children:(0,g.jsx)(i.bQt,{itemActions:[{type:"view",onClick:e=>{s(`${c.zZ.POLICIES}/${encodeURIComponent(e)}`)},isDisabled:!H}],columns:[{label:"Policy"}],isLoading:!1,records:F,entityName:"Policies"})})})]});return(0,g.jsxs)(l.Fragment,{children:[j?(0,g.jsx)(x.default,{open:j,selectedGroups:[t.groupName||""],selectedUser:null,closeModalAndRefresh:()=>{C(!1),J(),e((0,p.Gy)([]))}}):null,P?(0,g.jsx)(b,{selectedGroup:t.groupName,onSaveClick:()=>{},title:K,groupStatus:I,preSelectedUsers:z,open:P,onClose:()=>{G(!1),J()}}):null,M&&(0,g.jsx)(y.default,{deleteOpen:M,selectedGroups:[t.groupName||""],closeDeleteModalAndRefresh:e=>{U(!1),e&&s(c.zZ.GROUPS)}}),(0,g.jsx)(S.A,{label:(0,g.jsx)(l.Fragment,{children:(0,g.jsx)(i.EGL,{label:"Groups",onClick:()=>s(c.zZ.GROUPS)})}),actions:(0,g.jsx)(A.A,{})}),(0,g.jsxs)(i.Mxu,{children:[(0,g.jsx)(i.xA9,{item:!0,xs:12,children:(0,g.jsx)(i.lcx,{icon:(0,g.jsx)(l.Fragment,{children:(0,g.jsx)(i.YXz,{width:40})}),title:t.groupName||"",subTitle:null,bottomBorder:!0,actions:(0,g.jsxs)(i.azJ,{sx:{display:"flex",fontSize:14,alignItems:"center",gap:15},children:[(0,g.jsx)("span",{children:"Group Status:"}),(0,g.jsx)("span",{id:"group-status-label",style:{fontWeight:"bold"},children:B?"Enabled":"Disabled"}),(0,g.jsx)(v.A,{tooltip:(0,a._)(c.Ms,c.pf,!0)?"":(0,c.vj)(c.pf,"enable or disable Groups"),children:(0,g.jsx)(a.R,{resource:c.Ms,scopes:c.pf,errorProps:{disabled:!0},matchAll:!0,children:(0,g.jsx)(i.dOG,{indicatorLabels:["Enabled","Disabled"],checked:B,value:"group_enabled",id:"group-status",name:"group-status",onChange:()=>{var s;s=!B,o.F.group.updateGroup(t.groupName||"",{members:z,status:s?"enabled":"disabled"}).then((()=>{J()})).catch((s=>{e((0,d.Dy)((0,r.S)(s.error)))}))},switchOnly:!0})})}),(0,g.jsx)(v.A,{tooltip:"Delete Group",children:(0,g.jsx)(i.$nd,{id:"delete-user-group",variant:"secondary",icon:(0,g.jsx)(i.ucK,{}),onClick:()=>{U(!0)}})})]}),sx:{marginBottom:15}})}),(0,g.jsx)(i.xA9,{item:!0,xs:12,children:(0,g.jsx)(i.tUM,{options:[{tabConfig:{id:"members",label:"Members"},content:T},{tabConfig:{id:"policies",label:"Policies"},content:Q}],currentTabOrPath:E,onTabClick:L})})]})]})}},22923:(e,s,t)=>{t.d(s,{A:()=>h});var l=t(65043),n=t(33097),i=t.n(n),o=t(56629),r=t(53518),c=t(89923),a=t(8185),d=t(64159),u=t(21383),p=t(64681),x=t(70579);const h=e=>{let{selectedUsers:s,setSelectedUsers:t,editMode:n=!1}=e;const h=(0,u.jL)(),[m,j]=(0,l.useState)([]),[g,b]=(0,l.useState)(!1),[y,f]=(0,l.useState)(""),v=(0,l.useCallback)((()=>{o.F.users.listUsers().then((e=>{let s=i()(e.data,"users",[]);s||(s=[]),j(s.sort(a.LA)),b(!1)})).catch((e=>{h((0,d.Dy)((0,r.S)(e.error))),b(!1)}))}),[h]);(0,l.useEffect)((()=>{b(!0)}),[]),(0,l.useEffect)((()=>{g&&v()}),[g,v]);const A=s||[],S=m.filter((e=>e.accessKey.includes(y)));return(0,x.jsx)(c.xA9,{item:!0,xs:12,className:"inputItem",children:(0,x.jsxs)(c.azJ,{children:[g&&(0,x.jsx)(c.z21,{}),(null===m||void 0===m?void 0:m.length)>0?(0,x.jsxs)(l.Fragment,{children:[(0,x.jsx)(c.xA9,{item:!0,xs:12,className:"inputItem",children:(0,x.jsx)(p.A,{label:n?"Edit Members":"Assign Users",placeholder:"Filter Users",onChange:f,value:y})}),(0,x.jsx)(c.bQt,{columns:[{label:"Access Key",elementKey:"accessKey"}],onSelect:e=>{const s=e.target,l=s.value,n=s.checked;let i=[...A];return n?i.push(l):i=i.filter((e=>e!==l)),t(i),i},selectedItems:A,isLoading:g,records:S,entityName:"Users",idField:"accessKey",customPaperHeight:"200px"})]}):(0,x.jsx)(c.azJ,{sx:{textAlign:"center",padding:"10px 0"},children:"No Users to display"})]})})}},42967:(e,s,t)=>{t.d(s,{A:()=>x});var l=t(65043),n=t(89923),i=t(8185),o=t(64681),r=t(64159),c=t(21383),a=t(62560),d=t(22166),u=t(56629),p=t(70579);const x=e=>{let{noTitle:s=!1}=e;const t=(0,c.jL)(),[x,h]=(0,l.useState)([]),[m,j]=(0,l.useState)(!1),[g,b]=(0,l.useState)(""),y=(0,d.d4)((e=>e.createUser.selectedPolicies)),f=(0,l.useCallback)((()=>{j(!0),u.F.policies.listPolicies().then((e=>{var s;const t=null!==(s=e.data.policies)&&void 0!==s?s:[];j(!1),h(t.sort(i.Hw))})).catch((e=>{j(!1),t((0,r.Dy)(e))}))}),[t]);(0,l.useEffect)((()=>{j(!0)}),[]),(0,l.useEffect)((()=>{m&&f()}),[m,f]);const v=x.filter((e=>e.name.includes(g)));return(0,p.jsxs)(n.xA9,{item:!0,xs:12,className:"inputItem",children:[m&&(0,p.jsx)(n.z21,{}),x.length>0?(0,p.jsxs)(l.Fragment,{children:[(0,p.jsx)(n.xA9,{item:!0,xs:12,className:"inputItem",children:(0,p.jsx)(o.A,{placeholder:"Start typing to search for a Policy",onChange:e=>{b(e)},value:g,label:s?"":"Assign Policies"})}),(0,p.jsx)(n.bQt,{columns:[{label:"Policy",elementKey:"name"}],onSelect:e=>{const s=e.target,l=s.value,n=s.checked;let i=[...y];n?i.push(l):i=i.filter((e=>e!==l)),i=i.filter((e=>""!==e)),t((0,a.Gy)(i))},selectedItems:y,isLoading:m,records:v,entityName:"Policies",idField:"name",customPaperHeight:"200px"})]}):(0,p.jsx)(n.azJ,{sx:{textAlign:"center",padding:"10px 0"},children:"No Policies Available"})]})}},74705:(e,s,t)=>{t.r(s),t.d(s,{default:()=>j});var l=t(65043),n=t(33097),i=t.n(n),o=t(22166),r=t(89923),c=t(64159),a=t(21383),d=t(77403),u=t(62560),p=t(94141),x=t(42967),h=t(20649),m=t(70579);const j=e=>{let{closeModalAndRefresh:s,selectedUser:t,selectedGroups:n,open:j}=e;const g=(0,a.jL)(),[b,y]=(0,l.useState)(!1),[f,v]=(0,l.useState)([]),[A,S]=(0,l.useState)([]),C=(0,o.d4)((e=>e.createUser.selectedPolicies));(0,l.useEffect)((()=>{if(j){if(1===(null===n||void 0===n?void 0:n.length))return void(1===(null===n||void 0===n?void 0:n.length)&&h.A.invoke("GET",`/api/v1/group/${encodeURIComponent(n[0])}`).then((e=>{const s=i()(e,"policy","");v(s.split(",")),S(s.split(",")),g((0,u.Gy)(s.split(",")))})).catch((e=>{g((0,c.Dy)(e)),y(!1)})));const e=i()(t,"policy",[]);v(e),S(e),g((0,u.Gy)(e))}}),[j,null===n||void 0===n?void 0:n.length,t]);const P=i()(t,"accessKey","");return(0,m.jsxs)(p.A,{onClose:()=>{s()},modalOpen:j,title:"Set Policies",children:[(0,m.jsxs)(r.Hbc,{withBorders:!1,containerPadding:!1,children:[(1===(null===n||void 0===n?void 0:n.length)||null!=t)&&(0,m.jsxs)(l.Fragment,{children:[(0,m.jsx)(r.EmB,{label:"Selected "+(null!==n?"Group":"User"),sx:{width:"100%"},children:null!==n?n[0]:P}),(0,m.jsx)(r.EmB,{label:"Current Policy",sx:{width:"100%"},children:f.join(", ")})]}),n&&(null===n||void 0===n?void 0:n.length)>1&&(0,m.jsx)(r.EmB,{label:"Selected Groups",sx:{width:"100%"},children:n.join(", ")}),(0,m.jsx)(r.xA9,{item:!0,xs:12,children:(0,m.jsx)(x.A,{selectedPolicy:A})})]}),(0,m.jsxs)(r.xA9,{item:!0,xs:12,sx:d.Uz.modalButtonBar,children:[(0,m.jsx)(r.$nd,{id:"reset",type:"button",variant:"regular",onClick:()=>{S(f),g((0,u.Gy)(f))},label:"Reset"}),(0,m.jsx)(r.$nd,{id:"save",type:"button",variant:"callAction",color:"primary",disabled:b,onClick:()=>{let e=null,l=null;null!==n?l=n:(e=[" "],null!==t&&(e=[t.accessKey])),y(!0),h.A.invoke("PUT","/api/v1/set-policy-multi",{name:C,groups:l,users:e}).then((()=>{y(!1),s()})).catch((e=>{y(!1),g((0,c.Dy)(e))}))},label:"Save"})]}),b&&(0,m.jsx)(r.xA9,{item:!0,xs:12,children:(0,m.jsx)(r.z21,{})})]})}},8185:(e,s,t)=>{t.d(s,{Hw:()=>n,LA:()=>l,SO:()=>i,rY:()=>o});const l=(e,s)=>{if(e.accessKey&&s.accessKey){if(e.accessKey>s.accessKey)return 1;if(e.accessKeye.name>s.name?1:e.namee>s?1:ee.policy>s.policy?1:e.policy.\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { ModalBox, Snackbar } from \"mds\";\nimport { CSSObject } from \"styled-components\";\nimport { AppState, useAppDispatch } from \"../../../../store\";\nimport { setModalSnackMessage } from \"../../../../systemSlice\";\nimport MainError from \"../MainError/MainError\";\n\ninterface IModalProps {\n onClose: () => void;\n modalOpen: boolean;\n title: string | React.ReactNode;\n children: any;\n wideLimit?: boolean;\n titleIcon?: React.ReactNode;\n iconColor?: \"default\" | \"delete\" | \"accept\";\n sx?: CSSObject;\n}\n\nconst ModalWrapper = ({\n onClose,\n modalOpen,\n title,\n children,\n wideLimit = true,\n titleIcon = null,\n iconColor = \"default\",\n sx,\n}: IModalProps) => {\n const dispatch = useAppDispatch();\n const [openSnackbar, setOpenSnackbar] = useState(false);\n\n const modalSnackMessage = useSelector(\n (state: AppState) => state.system.modalSnackBar,\n );\n\n useEffect(() => {\n dispatch(setModalSnackMessage(\"\"));\n }, [dispatch]);\n\n useEffect(() => {\n if (modalSnackMessage) {\n if (modalSnackMessage.message === \"\") {\n setOpenSnackbar(false);\n return;\n }\n // Open SnackBar\n if (modalSnackMessage.type !== \"error\") {\n setOpenSnackbar(true);\n }\n }\n }, [modalSnackMessage]);\n\n const closeSnackBar = () => {\n setOpenSnackbar(false);\n dispatch(setModalSnackMessage(\"\"));\n };\n\n let message = \"\";\n\n if (modalSnackMessage) {\n message = modalSnackMessage.detailedErrorMsg;\n if (message === \"\" || (message && message.length < 5)) {\n message = modalSnackMessage.message;\n }\n }\n\n return (\n \n \n \n {children}\n \n );\n};\n\nexport default ModalWrapper;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useState } from \"react\";\nimport { ConfirmDeleteIcon } from \"mds\";\nimport { setErrorSnackMessage } from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\nimport ConfirmDialog from \"../Common/ModalWrapper/ConfirmDialog\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport { ApiError, HttpResponse } from \"api/consoleApi\";\n\ninterface IDeleteGroup {\n selectedGroups: string[];\n deleteOpen: boolean;\n closeDeleteModalAndRefresh: any;\n}\n\nconst DeleteGroup = ({\n selectedGroups,\n deleteOpen,\n closeDeleteModalAndRefresh,\n}: IDeleteGroup) => {\n const dispatch = useAppDispatch();\n const onClose = () => closeDeleteModalAndRefresh(false);\n const [loadingDelete, setLoadingDelete] = useState(false);\n\n if (!selectedGroups) {\n return null;\n }\n const onDeleteGroups = () => {\n for (let group of selectedGroups) {\n setLoadingDelete(true);\n api.group\n .removeGroup(group)\n .then((_) => {\n closeDeleteModalAndRefresh(true);\n })\n .catch(async (res: HttpResponse) => {\n const err = (await res.json()) as ApiError;\n dispatch(setErrorSnackMessage(errorToHandler(err)));\n closeDeleteModalAndRefresh(false);\n })\n .finally(() => setLoadingDelete(false));\n }\n };\n\n const renderGroups = selectedGroups.map((group) => (\n
\n {group}\n
\n ));\n\n return (\n 1 ? \"s\" : \"\"}`}\n confirmText={\"Delete\"}\n isOpen={deleteOpen}\n titleIcon={}\n isLoading={loadingDelete}\n onConfirm={onDeleteGroups}\n onClose={onClose}\n confirmationContent={\n \n Are you sure you want to delete the following{\" \"}\n {selectedGroups.length === 1 ? \"\" : selectedGroups.length} group\n {selectedGroups.length > 1 ? \"s?\" : \"?\"}\n {renderGroups}\n \n }\n />\n );\n};\n\nexport default DeleteGroup;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2023 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useState } from \"react\";\nimport { AddMembersToGroupIcon, Button, FormLayout, Grid, ReadBox } from \"mds\";\nimport { modalStyleUtils } from \"../Common/FormComponents/common/styleLibrary\";\nimport { setModalErrorSnackMessage } from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport UsersSelectors from \"./UsersSelectors\";\nimport ModalWrapper from \"../Common/ModalWrapper/ModalWrapper\";\n\ntype UserPickerModalProps = {\n title?: string;\n preSelectedUsers?: string[];\n selectedGroup?: string;\n open: boolean;\n onClose: () => void;\n onSaveClick: () => void;\n groupStatus?: string;\n};\n\nconst AddGroupMember = ({\n title = \"\",\n groupStatus = \"enabled\",\n preSelectedUsers = [],\n selectedGroup = \"\",\n open,\n onClose,\n}: UserPickerModalProps) => {\n const dispatch = useAppDispatch();\n const [selectedUsers, setSelectedUsers] = useState(preSelectedUsers);\n\n function addMembersToGroup() {\n return api.group\n .updateGroup(selectedGroup, {\n members: selectedUsers,\n status: groupStatus,\n })\n .then(() => {\n onClose();\n })\n .catch((err) => {\n onClose();\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n });\n }\n\n return (\n }\n >\n \n \n {selectedGroup}\n \n \n \n \n {\n setSelectedUsers(preSelectedUsers);\n }}\n label={\"Reset\"}\n />\n\n {\n addMembersToGroup();\n }}\n label={\"Save\"}\n />\n \n \n );\n};\n\nexport default AddGroupMember;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2023 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useNavigate, useParams } from \"react-router-dom\";\nimport {\n AddIcon,\n BackLink,\n Box,\n Button,\n DataTable,\n Grid,\n GroupsIcon,\n IAMPoliciesIcon,\n PageLayout,\n ScreenTitle,\n SectionTitle,\n Switch,\n Tabs,\n TrashIcon,\n} from \"mds\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport { Group } from \"api/consoleApi\";\nimport {\n addUserToGroupPermissions,\n CONSOLE_UI_RESOURCE,\n createGroupPermissions,\n editGroupMembersPermissions,\n enableDisableGroupPermissions,\n getGroupPermissions,\n IAM_PAGES,\n listUsersPermissions,\n permissionTooltipHelper,\n setGroupPoliciesPermissions,\n viewPolicyPermissions,\n viewUserPermissions,\n} from \"../../../common/SecureComponent/permissions\";\nimport {\n hasPermission,\n SecureComponent,\n} from \"../../../common/SecureComponent\";\nimport { setHelpName, setModalErrorSnackMessage } from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\nimport { setSelectedPolicies } from \"../Users/AddUsersSlice\";\nimport SetPolicy from \"../Policies/SetPolicy\";\nimport AddGroupMember from \"./AddGroupMember\";\nimport DeleteGroup from \"./DeleteGroup\";\nimport SearchBox from \"../Common/SearchBox\";\nimport TooltipWrapper from \"../Common/TooltipWrapper/TooltipWrapper\";\nimport HelpMenu from \"../HelpMenu\";\nimport PageHeaderWrapper from \"../Common/PageHeaderWrapper/PageHeaderWrapper\";\n\nconst formatPolicy = (policy: string = \"\"): string[] => {\n if (policy.length <= 0) return [];\n return policy.split(\",\");\n};\n\nconst GroupsDetails = () => {\n const dispatch = useAppDispatch();\n const navigate = useNavigate();\n const params = useParams();\n\n const [groupDetails, setGroupDetails] = useState({});\n const [policyOpen, setPolicyOpen] = useState(false);\n const [usersOpen, setUsersOpen] = useState(false);\n const [deleteOpen, setDeleteOpen] = useState(false);\n const [memberFilter, setMemberFilter] = useState(\"\");\n const [currentTab, setCurrentTab] = useState(\"members\");\n\n const { members = [], policy = \"\", status: groupEnabled } = groupDetails;\n\n const filteredMembers = members.filter((elementItem) =>\n elementItem.includes(memberFilter),\n );\n\n const viewUser = hasPermission(\n CONSOLE_UI_RESOURCE,\n viewUserPermissions,\n true,\n );\n\n useEffect(() => {\n dispatch(setHelpName(\"group_details\"));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n if (params.groupName) {\n fetchGroupInfo();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [params.groupName]);\n\n const groupPolicies = formatPolicy(policy);\n const isGroupEnabled = groupEnabled === \"enabled\";\n const memberActionText = members.length > 0 ? \"Edit Members\" : \"Add Members\";\n\n const getGroupDetails = hasPermission(\n CONSOLE_UI_RESOURCE,\n getGroupPermissions,\n );\n\n const canEditGroupMembers = hasPermission(\n CONSOLE_UI_RESOURCE,\n editGroupMembersPermissions,\n true,\n );\n\n const canSetPolicies = hasPermission(\n CONSOLE_UI_RESOURCE,\n setGroupPoliciesPermissions,\n true,\n );\n\n const canViewPolicy = hasPermission(\n CONSOLE_UI_RESOURCE,\n viewPolicyPermissions,\n true,\n );\n\n function fetchGroupInfo() {\n if (getGroupDetails) {\n api.group\n .groupInfo(params.groupName || \"\")\n .then((res) => {\n setGroupDetails(res.data);\n })\n .catch((err) => {\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n setGroupDetails({});\n });\n }\n }\n\n function toggleGroupStatus(nextStatus: boolean) {\n return api.group\n .updateGroup(params.groupName || \"\", {\n members: members,\n status: nextStatus ? \"enabled\" : \"disabled\",\n })\n .then(() => {\n fetchGroupInfo();\n })\n .catch((err) => {\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n });\n }\n\n const groupsTabContent = (\n {\n dispatch(setHelpName(\"groups_members\"));\n }}\n >\n \n {\n setMemberFilter(searchText);\n }}\n value={memberFilter}\n sx={{\n maxWidth: 280,\n }}\n />\n \n \n }\n onClick={() => {\n setUsersOpen(true);\n }}\n disabled={!canEditGroupMembers}\n />\n \n \n \n }\n >\n Members\n \n \n \n \n {\n navigate(\n `${IAM_PAGES.USERS}/${encodeURIComponent(userName)}`,\n );\n },\n isDisabled: !viewUser,\n },\n ]}\n columns={[{ label: \"Access Key\" }]}\n selectedItems={[]}\n isLoading={false}\n records={filteredMembers}\n entityName=\"Users\"\n />\n \n \n \n \n );\n\n const policiesTabContent = (\n \n {\n dispatch(setHelpName(\"groups_policies\"));\n }}\n >\n \n }\n onClick={() => {\n setPolicyOpen(true);\n }}\n disabled={!canSetPolicies}\n />\n \n }\n >\n Policies\n \n \n \n \n {\n navigate(\n `${IAM_PAGES.POLICIES}/${encodeURIComponent(policy)}`,\n );\n },\n isDisabled: !canViewPolicy,\n },\n ]}\n columns={[{ label: \"Policy\" }]}\n isLoading={false}\n records={groupPolicies}\n entityName=\"Policies\"\n />\n \n \n \n );\n\n return (\n \n {policyOpen ? (\n {\n setPolicyOpen(false);\n fetchGroupInfo();\n dispatch(setSelectedPolicies([]));\n }}\n />\n ) : null}\n\n {usersOpen ? (\n {}}\n title={memberActionText}\n groupStatus={groupEnabled}\n preSelectedUsers={members}\n open={usersOpen}\n onClose={() => {\n setUsersOpen(false);\n fetchGroupInfo();\n }}\n />\n ) : null}\n\n {deleteOpen && (\n {\n setDeleteOpen(false);\n if (isDelSuccess) {\n navigate(IAM_PAGES.GROUPS);\n }\n }}\n />\n )}\n \n navigate(IAM_PAGES.GROUPS)}\n />\n \n }\n actions={}\n />\n \n \n \n \n \n }\n title={params.groupName || \"\"}\n subTitle={null}\n bottomBorder\n actions={\n \n Group Status:\n \n {isGroupEnabled ? \"Enabled\" : \"Disabled\"}\n \n \n \n {\n toggleGroupStatus(!isGroupEnabled);\n }}\n switchOnly\n />\n \n \n\n \n }\n onClick={() => {\n setDeleteOpen(true);\n }}\n />\n \n \n }\n sx={{ marginBottom: 15 }}\n />\n \n\n \n \n \n \n \n );\n};\n\nexport default GroupsDetails;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useCallback, useEffect, useState, Fragment } from \"react\";\nimport get from \"lodash/get\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport { Box, DataTable, Grid, ProgressBar } from \"mds\";\n\nimport { usersSort } from \"../../../utils/sortFunctions\";\nimport { setModalErrorSnackMessage } from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\nimport SearchBox from \"../Common/SearchBox\";\n\ninterface IGroupsProps {\n selectedUsers: string[];\n setSelectedUsers: any;\n editMode?: boolean;\n}\n\nconst UsersSelectors = ({\n selectedUsers,\n setSelectedUsers,\n editMode = false,\n}: IGroupsProps) => {\n const dispatch = useAppDispatch();\n //Local States\n const [records, setRecords] = useState([]);\n const [loading, isLoading] = useState(false);\n const [filter, setFilter] = useState(\"\");\n\n const fetchUsers = useCallback(() => {\n api.users\n .listUsers()\n .then((res) => {\n let users = get(res.data, \"users\", []);\n\n if (!users) {\n users = [];\n }\n\n setRecords(users.sort(usersSort));\n isLoading(false);\n })\n .catch((err) => {\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n isLoading(false);\n });\n }, [dispatch]);\n\n //Effects\n useEffect(() => {\n isLoading(true);\n }, []);\n\n useEffect(() => {\n if (loading) {\n fetchUsers();\n }\n }, [loading, fetchUsers]);\n\n const selUsers = !selectedUsers ? [] : selectedUsers;\n\n //Fetch Actions\n const selectionChanged = (e: React.ChangeEvent) => {\n const targetD = e.target;\n const value = targetD.value;\n const checked = targetD.checked;\n\n let elements: string[] = [...selUsers]; // We clone the selectedGroups array\n\n if (checked) {\n // If the user has checked this field we need to push this to selectedGroupsList\n elements.push(value);\n } else {\n // User has unchecked this field, we need to remove it from the list\n elements = elements.filter((element) => element !== value);\n }\n setSelectedUsers(elements);\n\n return elements;\n };\n\n const filteredRecords = records.filter((elementItem) =>\n elementItem.accessKey.includes(filter),\n );\n\n return (\n \n \n {loading && }\n {records?.length > 0 ? (\n \n \n \n \n \n \n ) : (\n \n No Users to display\n \n )}\n \n \n );\n};\n\nexport default UsersSelectors;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useCallback, useEffect, useState } from \"react\";\n\nimport { Box, DataTable, Grid, ProgressBar } from \"mds\";\nimport { policySort } from \"../../../utils/sortFunctions\";\nimport { ErrorResponseHandler } from \"../../../common/types\";\nimport SearchBox from \"../Common/SearchBox\";\nimport { setModalErrorSnackMessage } from \"../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../store\";\nimport { setSelectedPolicies } from \"../Users/AddUsersSlice\";\nimport { useSelector } from \"react-redux\";\nimport { api } from \"../../../api\";\n\ninterface ISelectPolicyProps {\n selectedPolicy?: string[];\n noTitle?: boolean;\n}\n\nconst PolicySelectors = ({ noTitle = false }: ISelectPolicyProps) => {\n const dispatch = useAppDispatch();\n // Local State\n const [records, setRecords] = useState([]);\n const [loading, isLoading] = useState(false);\n const [filter, setFilter] = useState(\"\");\n\n const currentPolicies = useSelector(\n (state: AppState) => state.createUser.selectedPolicies,\n );\n\n const fetchPolicies = useCallback(() => {\n isLoading(true);\n\n api.policies\n .listPolicies()\n .then((res) => {\n const policies = res.data.policies ?? [];\n isLoading(false);\n setRecords(policies.sort(policySort));\n })\n .catch((err: ErrorResponseHandler) => {\n isLoading(false);\n dispatch(setModalErrorSnackMessage(err));\n });\n }, [dispatch]);\n\n //Effects\n useEffect(() => {\n isLoading(true);\n }, []);\n\n useEffect(() => {\n if (loading) {\n fetchPolicies();\n }\n }, [loading, fetchPolicies]);\n\n const selectionChanged = (e: React.ChangeEvent) => {\n const targetD = e.target;\n const value = targetD.value;\n const checked = targetD.checked;\n\n let elements: string[] = [...currentPolicies]; // We clone the checkedUsers array\n\n if (checked) {\n // If the user has checked this field we need to push this to checkedUsersList\n elements.push(value);\n } else {\n // User has unchecked this field, we need to remove it from the list\n elements = elements.filter((element) => element !== value);\n }\n // remove empty values\n elements = elements.filter((element) => element !== \"\");\n\n dispatch(setSelectedPolicies(elements));\n };\n\n const filteredRecords = records.filter((elementItem) =>\n elementItem.name.includes(filter),\n );\n\n return (\n \n {loading && }\n {records.length > 0 ? (\n \n \n {\n setFilter(value);\n }}\n value={filter}\n label={!noTitle ? \"Assign Policies\" : \"\"}\n />\n \n\n \n \n ) : (\n \n No Policies Available\n \n )}\n \n );\n};\n\nexport default PolicySelectors;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport get from \"lodash/get\";\nimport { useSelector } from \"react-redux\";\nimport { Button, FormLayout, ReadBox, Grid, ProgressBar } from \"mds\";\n\nimport { ErrorResponseHandler } from \"../../../common/types\";\nimport { setModalErrorSnackMessage } from \"../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../store\";\nimport { modalStyleUtils } from \"../Common/FormComponents/common/styleLibrary\";\nimport { User } from \"../Users/types\";\nimport { setSelectedPolicies } from \"../Users/AddUsersSlice\";\nimport ModalWrapper from \"../Common/ModalWrapper/ModalWrapper\";\nimport PolicySelectors from \"./PolicySelectors\";\nimport api from \"../../../common/api\";\n\ninterface ISetPolicyProps {\n closeModalAndRefresh: () => void;\n selectedUser: User | null;\n selectedGroups: string[] | null;\n open: boolean;\n}\n\nconst SetPolicy = ({\n closeModalAndRefresh,\n selectedUser,\n selectedGroups,\n open,\n}: ISetPolicyProps) => {\n const dispatch = useAppDispatch();\n //Local States\n const [loading, setLoading] = useState(false);\n const [actualPolicy, setActualPolicy] = useState([]);\n const [selectedPolicy, setSelectedPolicy] = useState([]);\n const currentPolicies = useSelector(\n (state: AppState) => state.createUser.selectedPolicies,\n );\n const setPolicyAction = () => {\n let users = null;\n let groups = null;\n if (selectedGroups !== null) {\n groups = selectedGroups;\n } else {\n users = [\" \"];\n\n if (selectedUser !== null) {\n users = [selectedUser.accessKey];\n }\n }\n\n setLoading(true);\n\n api\n .invoke(\"PUT\", `/api/v1/set-policy-multi`, {\n name: currentPolicies,\n groups: groups,\n users: users,\n })\n .then(() => {\n setLoading(false);\n closeModalAndRefresh();\n })\n .catch((err: ErrorResponseHandler) => {\n setLoading(false);\n dispatch(setModalErrorSnackMessage(err));\n });\n };\n\n const fetchGroupInformation = () => {\n if (selectedGroups?.length === 1) {\n api\n .invoke(\"GET\", `/api/v1/group/${encodeURIComponent(selectedGroups[0])}`)\n .then((res: any) => {\n const groupPolicy: String = get(res, \"policy\", \"\");\n setActualPolicy(groupPolicy.split(\",\"));\n setSelectedPolicy(groupPolicy.split(\",\"));\n dispatch(setSelectedPolicies(groupPolicy.split(\",\")));\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setModalErrorSnackMessage(err));\n setLoading(false);\n });\n }\n };\n\n const resetSelection = () => {\n setSelectedPolicy(actualPolicy);\n dispatch(setSelectedPolicies(actualPolicy));\n };\n\n useEffect(() => {\n if (open) {\n if (selectedGroups?.length === 1) {\n fetchGroupInformation();\n return;\n }\n\n const userPolicy: string[] = get(selectedUser, \"policy\", []);\n setActualPolicy(userPolicy);\n setSelectedPolicy(userPolicy);\n dispatch(setSelectedPolicies(userPolicy));\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, selectedGroups?.length, selectedUser]);\n\n const userName = get(selectedUser, \"accessKey\", \"\");\n\n return (\n {\n closeModalAndRefresh();\n }}\n modalOpen={open}\n title=\"Set Policies\"\n >\n \n {(selectedGroups?.length === 1 || selectedUser != null) && (\n \n \n {selectedGroups !== null ? selectedGroups[0] : userName}\n \n \n {actualPolicy.join(\", \")}\n \n \n )}\n {selectedGroups && selectedGroups?.length > 1 && (\n \n {selectedGroups.join(\", \")}\n \n )}\n \n \n \n \n \n \n \n \n {loading && (\n \n \n \n )}\n \n );\n};\n\nexport default SetPolicy;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport { Policy, User } from \"api/consoleApi\";\n\ninterface policyDetailsInterface {\n policy: string;\n}\n\nexport const usersSort = (a: User, b: User) => {\n if (a.accessKey && b.accessKey) {\n if (a.accessKey > b.accessKey) {\n return 1;\n }\n if (a.accessKey < b.accessKey) {\n return -1;\n }\n }\n // a must be equal to b\n return 0;\n};\n\nexport const policySort = (a: Policy, b: Policy) => {\n if (a.name! > b.name!) {\n return 1;\n }\n if (a.name! < b.name!) {\n return -1;\n }\n // a must be equal to b\n return 0;\n};\n\nexport const stringSort = (a: string, b: string) => {\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n // a must be equal to b\n return 0;\n};\n\nexport const policyDetailsSort = (\n a: policyDetailsInterface,\n b: policyDetailsInterface,\n) => {\n if (a.policy > b.policy) {\n return 1;\n }\n if (a.policy < b.policy) {\n return -1;\n }\n // a must be equal to b\n return 0;\n};\n"],"names":["_ref","onClose","modalOpen","title","children","wideLimit","titleIcon","iconColor","sx","dispatch","useAppDispatch","openSnackbar","setOpenSnackbar","useState","modalSnackMessage","useSelector","state","system","modalSnackBar","useEffect","setModalSnackMessage","message","type","detailedErrorMsg","length","_jsxs","ModalBox","open","widthLimit","_jsx","MainError","isModal","Snackbar","closeSnackBar","mode","variant","autoHideDuration","condensed","selectedGroups","deleteOpen","closeDeleteModalAndRefresh","loadingDelete","setLoadingDelete","renderGroups","map","group","ConfirmDialog","confirmText","isOpen","ConfirmDeleteIcon","isLoading","onConfirm","onDeleteGroups","api","removeGroup","then","_","catch","async","err","res","json","setErrorSnackMessage","errorToHandler","finally","confirmationContent","Fragment","groupStatus","preSelectedUsers","selectedGroup","selectedUsers","setSelectedUsers","ModalWrapper","AddMembersToGroupIcon","FormLayout","withBorders","containerPadding","ReadBox","label","width","UsersSelectors","editMode","Grid","item","xs","modalStyleUtils","modalButtonBar","Button","id","onClick","updateGroup","members","status","setModalErrorSnackMessage","error","GroupsDetails","navigate","useNavigate","params","useParams","groupDetails","setGroupDetails","policyOpen","setPolicyOpen","usersOpen","setUsersOpen","setDeleteOpen","memberFilter","setMemberFilter","currentTab","setCurrentTab","policy","groupEnabled","filteredMembers","filter","elementItem","includes","viewUser","hasPermission","CONSOLE_UI_RESOURCE","viewUserPermissions","setHelpName","groupName","fetchGroupInfo","groupPolicies","arguments","undefined","split","formatPolicy","isGroupEnabled","memberActionText","getGroupDetails","getGroupPermissions","canEditGroupMembers","editGroupMembersPermissions","canSetPolicies","setGroupPoliciesPermissions","canViewPolicy","viewPolicyPermissions","groupInfo","data","groupsTabContent","Box","onMouseMove","SectionTitle","separator","marginBottom","actions","display","gap","SearchBox","placeholder","onChange","searchText","value","maxWidth","SecureComponent","resource","scopes","addUserToGroupPermissions","errorProps","disabled","TooltipWrapper","tooltip","permissionTooltipHelper","createGroupPermissions","icon","AddIcon","listUsersPermissions","DataTable","itemActions","userName","IAM_PAGES","USERS","encodeURIComponent","isDisabled","columns","selectedItems","records","entityName","policiesTabContent","IAMPoliciesIcon","POLICIES","SetPolicy","selectedUser","closeModalAndRefresh","setSelectedPolicies","AddGroupMember","onSaveClick","DeleteGroup","isDelSuccess","GROUPS","PageHeaderWrapper","BackLink","HelpMenu","PageLayout","ScreenTitle","GroupsIcon","subTitle","bottomBorder","fontSize","alignItems","style","fontWeight","enableDisableGroupPermissions","matchAll","Switch","indicatorLabels","checked","name","nextStatus","switchOnly","TrashIcon","Tabs","options","tabConfig","content","currentTabOrPath","onTabClick","setRecords","loading","setFilter","fetchUsers","useCallback","users","listUsers","get","sort","usersSort","selUsers","filteredRecords","accessKey","className","ProgressBar","elementKey","onSelect","e","targetD","target","elements","push","element","idField","customPaperHeight","textAlign","padding","noTitle","currentPolicies","createUser","selectedPolicies","fetchPolicies","policies","listPolicies","_res$data$policies","policySort","setLoading","actualPolicy","setActualPolicy","selectedPolicy","setSelectedPolicy","invoke","groupPolicy","userPolicy","join","PolicySelectors","resetSelection","color","setPolicyAction","groups","a","b","stringSort","policyDetailsSort"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/1370.7d88b85a.chunk.js b/web-app/build/static/js/1370.7d88b85a.chunk.js deleted file mode 100644 index ef5a4cc5d..000000000 --- a/web-app/build/static/js/1370.7d88b85a.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[1370],{41206:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(65043),o=r(89923),i=r(61476),s=r.n(i),a=r(6681),l=r(70579);const c=e=>{let{value:t,label:r="",tooltip:i="",mode:c="json",onChange:d,editorHeight:p=250,helptip:u}=e;return(0,l.jsx)(o.BYM,{value:t,onChange:e=>d(e),mode:c,tooltip:i,editorHeight:p,label:r,helpTools:(0,l.jsx)(n.Fragment,{children:(0,l.jsx)(a.A,{tooltip:"Copy to Clipboard",children:(0,l.jsx)(s(),{text:t,children:(0,l.jsx)(o.$nd,{type:"button",id:"copy-code-mirror",icon:(0,l.jsx)(o.TdU,{}),color:"primary",variant:"regular"})})})}),helpTip:u,helpTipPlacement:"right"})}},71435:(e,t,r)=>{"use strict";r.d(t,{CS:()=>s,Ez:()=>n,WJ:()=>o,Zb:()=>i});const n={RED:"#C83B51",GREEN:"#4CCB92",YELLOW:"#FFBD62"},o=(e,t)=>e<=t/2?"bad":2!==t&&e===t/2+1?"warn":e===t?"good":void 0,i=e=>{switch(e){case"offline":return"bad";case"online":return"good";default:return"warn"}},s=(e,t)=>e<=t/2?"bad":e===t/2+1?"warn":e===t?"good":void 0},81370:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>O});var n=r(65043),o=r(22166),i=r(73216),s=r(89923),a=r(77403),l=r(41206),c=r(99161),d=r(77938),p=r(72237),u=r(64681),x=r(71435),h=r(70579);const f={display:"grid",gridTemplateColumns:"70px 1fr",gap:15},m=e=>{let{search:t="",children:r=""}=e;const n=new RegExp(`(${function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}(t)})`,"i"),o=String(r).split(n);return t?o.map(((e,t)=>n.test(e)?(0,h.jsx)("mark",{children:e},t):e)):r},y=e=>{let{policyStatements:t}=e;const[r,o]=(0,n.useState)("");return(0,h.jsxs)(s.xA9,{container:!0,children:[(0,h.jsx)(s.xA9,{item:!0,xs:12,children:(0,h.jsxs)(s.xA9,{container:!0,sx:{display:"flex",alignItems:"center"},children:[(0,h.jsx)(s.V7x,{content:(0,h.jsxs)(n.Fragment,{children:["Define which actions are permitted on a specified resource. Learn more about"," ",(0,h.jsx)("a",{target:"blank",href:"https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html",children:"IAM conditional statements"}),"."]}),placement:"right",children:(0,h.jsx)(s.xA9,{item:!0,xs:12,sm:6,sx:{fontWeight:"bold"},children:"Statements"})}),(0,h.jsx)(s.xA9,{item:!0,xs:12,sm:6,sx:{display:"flex",justifyContent:"flex-end"},children:(0,h.jsx)(u.A,{placeholder:"Search",onChange:o,value:r,sx:{maxWidth:380}})})]})}),!t&&(0,h.jsx)(n.Fragment,{children:"Policy has no statements"}),t&&(0,h.jsx)(s.xA9,{item:!0,xs:12,sx:{"& .policy-row":{borderBottom:"1px solid #eaeaea"},"& .policy-row:first-child":{borderTop:"1px solid #eaeaea"},"& .policy-row:last-child":{borderBottom:"0px"},paddingTop:"15px","& mark":{color:"#000000",fontWeight:500}},children:t.map(((e,t)=>{const n=e.Effect,o="Allow"===n;return(0,h.jsxs)(s.azJ,{className:"policy-row",sx:{display:"grid",gridTemplateColumns:"1fr",gap:"15px",fontSize:"14px",padding:"10px 0 10px 0","& .label":{fontWeight:600}},children:[(0,h.jsxs)(s.azJ,{sx:f,children:[(0,h.jsx)(s.azJ,{className:"label",children:"Effect:"}),(0,h.jsxs)(s.azJ,{sx:{display:"flex",alignItems:"center","& .min-icon":{marginRight:"5px",fill:o?x.Ez.GREEN:x.Ez.RED,height:"14px",width:"14px"}},children:[o?(0,h.jsx)(s.xhy,{}):(0,h.jsx)(s.aaC,{}),n]})]}),(0,h.jsxs)(s.xA9,{container:!0,sx:{gap:15},children:[(0,h.jsxs)(s.xA9,{item:!0,xs:12,sm:6,sx:f,children:[(0,h.jsx)(s.azJ,{className:"label",children:"Actions:"}),(0,h.jsx)(s.azJ,{children:e.Action&&e.Action.map(((e,n)=>(0,h.jsx)("div",{children:(0,h.jsx)(m,{search:r,children:e})},`${t}-r-${n}`)))})]}),(0,h.jsxs)(s.xA9,{item:!0,xs:12,sm:6,sx:f,children:[(0,h.jsx)(s.azJ,{className:"label",children:"Resources:"}),(0,h.jsx)(s.azJ,{children:e.Resource&&e.Resource.map(((e,n)=>(0,h.jsxs)("div",{children:[" ",(0,h.jsx)(m,{search:r,children:e})]},`${t}-r-${n}`)))})]})]})]},`${t}`)}))})]})};var b=r(64159),g=r(46537),j=r(21383),v=r(6681),C=r(48793),w=r(56629),A=r(88617);const P=(0,p.A)(n.lazy((()=>r.e(4676).then(r.bind(r,4676))))),O=()=>{const e=(0,j.jL)(),t=(0,i.Zp)(),r=(0,i.g)(),p=(0,o.d4)(g.s$),[x,f]=(0,n.useState)(null),[m,O]=(0,n.useState)([]),[S,_]=(0,n.useState)([]),[E,R]=(0,n.useState)([]),[k,D]=(0,n.useState)(!1),M=r.policyName||"",[T,F]=(0,n.useState)(""),[z,I]=(0,n.useState)(!0),[N,$]=(0,n.useState)(""),[U,B]=(0,n.useState)(!0),[J,L]=(0,n.useState)(""),[G,H]=(0,n.useState)(!0),[W,Z]=(0,n.useState)(!1),[V,Y]=(0,n.useState)("summary"),K=p&&p.includes("ldap-idp")||!1,Q=(0,d._)(c.Ms,c.qA,!0),X=(0,d._)(c.Ms,c.Oh,!0),q=(0,d._)(c.Ms,c.x6,!0),ee=(0,d._)(c.Ms,c.Ld,!0),te=(0,d._)(c.Ms,c.yv,!0),re=(0,d._)(c.Ms,c.uA,!0),ne=(0,d._)(c.Ms,c.nr,!0);(0,n.useEffect)((()=>{z&&(z&&(te?w.F.policy.policyInfo(M).then((e=>{if(e.data){var t,r;f(e.data),F(e?JSON.stringify(JSON.parse(null===(t=e.data)||void 0===t?void 0:t.policy),null,4):"");const n=JSON.parse(null===(r=e.data)||void 0===r?void 0:r.policy);O(n.Statement)}I(!1)})).catch((t=>{e((0,b.C9)(t)),I(!1)})):I(!1)),U&&(q&&!K?w.F.policies.listUsersForPolicy(M).then((e=>{var t;_(null!==(t=e.data)&&void 0!==t?t:[]),B(!1)})).catch((t=>{e((0,b.C9)(t)),B(!1)})):B(!1)),G&&(Q&&!K?w.F.policies.listGroupsForPolicy(M).then((e=>{var t;R(null!==(t=e.data)&&void 0!==t?t:[]),H(!1)})).catch((t=>{e((0,b.C9)(t)),H(!1)})):H(!1)))}),[M,z,U,G,_,R,F,f,B,H,q,Q,te,K,e]);const oe=""!==M.trim(),ie=[{type:"view",onClick:e=>{t(`${c.zZ.USERS}/${encodeURIComponent(e)}`)},disableButtonFunction:()=>!ee}],se=S.filter((e=>e.includes(N))),ae=[{type:"view",onClick:e=>{t(`${c.zZ.GROUPS}/${encodeURIComponent(e)}`)},disableButtonFunction:()=>!X}],le=E.filter((e=>e.includes(J))),ce=()=>{B(!0),H(!0),I(!0)};return(0,n.useEffect)((()=>{e((0,b.ph)("policy_details_summary"))}),[]),(0,h.jsxs)(n.Fragment,{children:[W&&(0,h.jsx)(P,{deleteOpen:W,selectedPolicy:M,closeDeleteModalAndRefresh:e=>{Z(!1),t(c.zZ.POLICIES)}}),(0,h.jsx)(C.A,{label:(0,h.jsx)(n.Fragment,{children:(0,h.jsx)(s.EGL,{label:"Policy",onClick:()=>t(c.zZ.POLICIES)})}),actions:(0,h.jsx)(A.A,{})}),(0,h.jsxs)(s.Mxu,{children:[(0,h.jsx)(s.lcx,{icon:(0,h.jsx)(s.n$X,{width:40}),title:M,subTitle:(0,h.jsx)(n.Fragment,{children:"IAM Policy"}),actions:(0,h.jsxs)(n.Fragment,{children:[(0,h.jsx)(d.R,{scopes:[c.OV.ADMIN_DELETE_POLICY],resource:c.Ms,errorProps:{disabled:!0},children:(0,h.jsx)(v.A,{tooltip:re?"":(0,c.vj)(c.uA,"delete Policies"),children:(0,h.jsx)(s.$nd,{id:"delete-policy",label:"Delete Policy",variant:"secondary",icon:(0,h.jsx)(s.ucK,{}),onClick:()=>{Z(!0)},disabled:!re})})}),(0,h.jsx)(v.A,{tooltip:"Refresh",children:(0,h.jsx)(s.$nd,{id:"refresh-policy",label:"Refresh",variant:"regular",icon:(0,h.jsx)(s.fNY,{}),onClick:()=>{ce()}})})]}),sx:{marginBottom:15}}),(0,h.jsx)(s.azJ,{children:(0,h.jsx)(s.tUM,{options:[{tabConfig:{label:"Summary",disabled:!te,id:"summary"},content:(0,h.jsx)(n.Fragment,{children:(0,h.jsxs)(s.xA9,{onMouseMove:()=>e((0,b.ph)("policy_details_summary")),children:[(0,h.jsx)(s._xt,{separator:!0,sx:{marginBottom:15},children:"Policy Summary"}),(0,h.jsx)(s.azJ,{withBorders:!0,children:(0,h.jsx)(y,{policyStatements:m})})]})})},{tabConfig:{label:"Users",disabled:!q||K,id:"users"},content:(0,h.jsx)(n.Fragment,{children:(0,h.jsxs)(s.xA9,{onMouseMove:()=>e((0,b.ph)("policy_details_users")),children:[(0,h.jsx)(s._xt,{separator:!0,sx:{marginBottom:15},children:"Users"}),(0,h.jsxs)(s.xA9,{container:!0,children:[S.length>0&&(0,h.jsx)(s.xA9,{item:!0,xs:12,sx:{...a._0.actionsTray,marginBottom:15},children:(0,h.jsx)(u.A,{value:N,placeholder:"Search Users",id:"search-resource",onChange:e=>{$(e)}})}),(0,h.jsx)(s.bQt,{itemActions:ie,columns:[{label:"Name",elementKey:"name"}],isLoading:U,records:se,entityName:"Users with this Policy associated",idField:"name",customPaperHeight:"500px"})]})]})})},{tabConfig:{label:"Groups",disabled:!Q||K,id:"groups"},content:(0,h.jsx)(n.Fragment,{children:(0,h.jsxs)(s.xA9,{onMouseMove:()=>e((0,b.ph)("policy_details_groups")),children:[(0,h.jsx)(s._xt,{separator:!0,sx:{marginBottom:15},children:"Groups"}),(0,h.jsxs)(s.xA9,{container:!0,children:[E.length>0&&(0,h.jsx)(s.xA9,{item:!0,xs:12,sx:{...a._0.actionsTray,marginBottom:15},children:(0,h.jsx)(u.A,{value:N,placeholder:"Search Groups",id:"search-resource",onChange:e=>{L(e)}})}),(0,h.jsx)(s.bQt,{itemActions:ae,columns:[{label:"Name",elementKey:"name"}],isLoading:G,records:le,entityName:"Groups with this Policy associated",idField:"name",customPaperHeight:"500px"})]})]})})},{tabConfig:{label:"Raw Policy",disabled:!te,id:"raw-policy"},content:(0,h.jsx)(n.Fragment,{children:(0,h.jsxs)(s.xA9,{onMouseMove:()=>e((0,b.ph)("policy_details_policy")),children:[(0,h.jsx)(s.V7x,{content:(0,h.jsx)(n.Fragment,{children:(0,h.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/kubernetes/upstream/administration/identity-access-management/policy-based-access-control.html#policy-document-structure",children:"Guide to access policy structure"})}),placement:"right",children:(0,h.jsx)(s._xt,{children:"Raw Policy"})}),(0,h.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:t=>{t.preventDefault(),k||(D(!0),ne?w.F.policies.addPolicy({name:M,policy:T}).then((t=>{D(!1),e((0,b.Hk)("Policy successfully updated")),ce()})).catch((t=>{D(!1),e((0,b.C9)({errorMessage:"There was an error updating the Policy ",detailedError:"There was an error updating the Policy: "+(t.error.detailedMessage||"")+". Please check Policy syntax."}))})):D(!1))},children:(0,h.jsxs)(s.xA9,{container:!0,children:[(0,h.jsx)(s.xA9,{item:!0,xs:12,children:(0,h.jsx)(l.A,{value:T,onChange:e=>{ne&&F(e)},editorHeight:"350px",helptip:(0,h.jsx)(n.Fragment,{children:(0,h.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/kubernetes/upstream/administration/identity-access-management/policy-based-access-control.html#policy-document-structure",children:"Guide to access policy structure"})})})}),(0,h.jsxs)(s.xA9,{item:!0,xs:12,sx:{display:"flex",justifyContent:"flex-end",paddingTop:16,gap:8},children:[!x&&(0,h.jsx)(s.$nd,{type:"button",variant:"regular",id:"clear-policy",onClick:()=>{F("{}")},children:"Clear"}),(0,h.jsx)(d.R,{scopes:[c.OV.ADMIN_CREATE_POLICY],resource:c.Ms,errorProps:{disabled:!0},children:(0,h.jsx)(v.A,{tooltip:ne?"":(0,c.vj)(c.nr,"edit a Policy"),children:(0,h.jsx)(s.$nd,{id:"save",type:"submit",variant:"callAction",color:"primary",disabled:k||!oe||!ne,label:"Save"})})})]}),k&&(0,h.jsx)(s.xA9,{item:!0,xs:12,children:(0,h.jsx)(s.z21,{})})]})})]})})}],currentTabOrPath:V,onTabClick:e=>Y(e)})})]})]})}},75270:(e,t,r)=>{"use strict";var n=r(40139),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var r,i,s,a,l,c,d=!1;t||(t={}),r=t.debug||!1;try{if(s=n(),a=document.createRange(),l=document.getSelection(),(c=document.createElement("span")).textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(n){if(n.stopPropagation(),t.format)if(n.preventDefault(),"undefined"===typeof n.clipboardData){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=o[t.format]||o.default;window.clipboardData.setData(i,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e);t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))})),document.body.appendChild(c),a.selectNodeContents(c),l.addRange(a),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");d=!0}catch(p){r&&console.error("unable to copy using execCommand: ",p),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),d=!0}catch(p){r&&console.error("unable to copy using clipboardData: ",p),r&&console.error("falling back to prompt"),i=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(i,e)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(a):l.removeAllRanges()),c&&document.body.removeChild(c),s()}return d}},24480:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var o=a(r(65043)),i=a(r(75270)),s=["text","onCopy","options","children"];function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function p(e,t){for(var r=0;r{"use strict";var n=r(24480).CopyToClipboard;n.CopyToClipboard=n,e.exports=n},40139:e=>{e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n.\n\nimport React, { Fragment } from \"react\";\nimport { Button, CodeEditor, CopyIcon } from \"mds\";\nimport CopyToClipboard from \"react-copy-to-clipboard\";\nimport TooltipWrapper from \"../../TooltipWrapper/TooltipWrapper\";\n\ninterface ICodeWrapper {\n value: string;\n label?: string;\n mode?: string;\n tooltip?: string;\n onChange: (value: string) => any;\n editorHeight?: string | number;\n helptip?: any;\n}\n\nconst CodeMirrorWrapper = ({\n value,\n label = \"\",\n tooltip = \"\",\n mode = \"json\",\n onChange,\n editorHeight = 250,\n helptip,\n}: ICodeWrapper) => {\n return (\n onChange(value)}\n mode={mode}\n tooltip={tooltip}\n editorHeight={editorHeight}\n label={label}\n helpTools={\n \n \n \n }\n color={\"primary\"}\n variant={\"regular\"}\n />\n \n \n \n }\n helpTip={helptip}\n helpTipPlacement=\"right\"\n />\n );\n};\n\nexport default CodeMirrorWrapper;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nexport const STATUS_COLORS = {\n RED: \"#C83B51\",\n GREEN: \"#4CCB92\",\n YELLOW: \"#FFBD62\",\n};\n\nexport const getDriveStatusColor = (\n activeDisks: number,\n totalDrives: number,\n) => {\n if (activeDisks <= totalDrives / 2) {\n return \"bad\";\n }\n if (totalDrives !== 2 && activeDisks === totalDrives / 2 + 1) {\n return \"warn\";\n }\n if (activeDisks === totalDrives) {\n return \"good\";\n }\n};\n\nexport const serverStatusColor = (health_status: string) => {\n switch (health_status) {\n case \"offline\":\n return \"bad\";\n case \"online\":\n return \"good\";\n default:\n return \"warn\";\n }\n};\nexport const getNetworkStatusColor = (\n activeNetwork: number,\n networkTotal: number,\n) => {\n if (activeNetwork <= networkTotal / 2) {\n return \"bad\";\n }\n if (activeNetwork === networkTotal / 2 + 1) {\n return \"warn\";\n }\n if (activeNetwork === networkTotal) {\n return \"good\";\n }\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useState } from \"react\";\nimport { DisabledIcon, EnabledIcon, Box, Grid, HelpTip } from \"mds\";\nimport SearchBox from \"../Common/SearchBox\";\nimport { STATUS_COLORS } from \"../Dashboard/BasicDashboard/Utils\";\nimport { IAMStatement } from \"./types\";\n\nconst rowGridStyle = {\n display: \"grid\",\n gridTemplateColumns: \"70px 1fr\",\n gap: 15,\n};\n\nconst escapeRegExp = (str = \"\") =>\n str.replace(/([.?*+^$[\\]\\\\(){}|-])/g, \"\\\\$1\");\n\nconst Highlight = ({ search = \"\", children = \"\" }): any => {\n const txtParts = new RegExp(`(${escapeRegExp(search)})`, \"i\");\n const parts = String(children).split(txtParts);\n\n if (search) {\n return parts.map((part, index) =>\n txtParts.test(part) ? {part} : part,\n );\n } else {\n return children;\n }\n};\n\nconst PolicyView = ({\n policyStatements,\n}: {\n policyStatements: IAMStatement[];\n}) => {\n const [filter, setFilter] = useState(\"\");\n\n return (\n \n \n \n \n Define which actions are permitted on a specified resource.\n Learn more about{\" \"}\n \n IAM conditional statements\n \n .\n \n }\n placement=\"right\"\n >\n \n Statements\n \n \n \n \n \n \n \n {!policyStatements && Policy has no statements}\n {policyStatements && (\n \n {policyStatements.map((stmt, i) => {\n const effect = stmt.Effect;\n const isAllow = effect === \"Allow\";\n return (\n \n \n Effect:\n \n {isAllow ? : }\n {effect}\n \n \n \n \n Actions:\n \n {stmt.Action &&\n stmt.Action.map((act, actIndex) => (\n
\n {act}\n
\n ))}\n
\n
\n \n Resources:\n \n {stmt.Resource &&\n stmt.Resource.map((res, resIndex) => (\n
\n {\" \"}\n {res}\n
\n ))}\n
\n
\n
\n \n );\n })}\n \n )}\n \n );\n};\n\nexport default PolicyView;\n","// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { IAMPolicy, IAMStatement } from \"./types\";\nimport { useSelector } from \"react-redux\";\nimport { useNavigate, useParams } from \"react-router-dom\";\nimport {\n BackLink,\n Box,\n Button,\n DataTable,\n Grid,\n IAMPoliciesIcon,\n PageLayout,\n ProgressBar,\n RefreshIcon,\n ScreenTitle,\n SectionTitle,\n Tabs,\n TrashIcon,\n HelpTip,\n} from \"mds\";\nimport { actionsTray } from \"../Common/FormComponents/common/styleLibrary\";\n\nimport { ErrorResponseHandler } from \"../../../common/types\";\nimport CodeMirrorWrapper from \"../Common/FormComponents/CodeMirrorWrapper/CodeMirrorWrapper\";\n\nimport {\n CONSOLE_UI_RESOURCE,\n createPolicyPermissions,\n deletePolicyPermissions,\n getGroupPermissions,\n IAM_PAGES,\n IAM_SCOPES,\n listGroupPermissions,\n listUsersPermissions,\n permissionTooltipHelper,\n viewPolicyPermissions,\n viewUserPermissions,\n} from \"../../../common/SecureComponent/permissions\";\nimport {\n hasPermission,\n SecureComponent,\n} from \"../../../common/SecureComponent\";\n\nimport withSuspense from \"../Common/Components/withSuspense\";\n\nimport PolicyView from \"./PolicyView\";\nimport {\n setErrorSnackMessage,\n setHelpName,\n setSnackBarMessage,\n} from \"../../../systemSlice\";\nimport { selFeatures } from \"../consoleSlice\";\nimport { useAppDispatch } from \"../../../store\";\nimport TooltipWrapper from \"../Common/TooltipWrapper/TooltipWrapper\";\nimport PageHeaderWrapper from \"../Common/PageHeaderWrapper/PageHeaderWrapper\";\nimport { Policy } from \"../../../api/consoleApi\";\nimport { api } from \"../../../api\";\nimport HelpMenu from \"../HelpMenu\";\nimport SearchBox from \"../Common/SearchBox\";\n\nconst DeletePolicy = withSuspense(React.lazy(() => import(\"./DeletePolicy\")));\n\nconst PolicyDetails = () => {\n const dispatch = useAppDispatch();\n const navigate = useNavigate();\n const params = useParams();\n\n const features = useSelector(selFeatures);\n\n const [policy, setPolicy] = useState(null);\n const [policyStatements, setPolicyStatements] = useState([]);\n const [userList, setUserList] = useState([]);\n const [groupList, setGroupList] = useState([]);\n const [addLoading, setAddLoading] = useState(false);\n\n const policyName = params.policyName || \"\";\n\n const [policyDefinition, setPolicyDefinition] = useState(\"\");\n const [loadingPolicy, setLoadingPolicy] = useState(true);\n const [filterUsers, setFilterUsers] = useState(\"\");\n const [loadingUsers, setLoadingUsers] = useState(true);\n const [filterGroups, setFilterGroups] = useState(\"\");\n const [loadingGroups, setLoadingGroups] = useState(true);\n const [deleteOpen, setDeleteOpen] = useState(false);\n const [selectedTab, setSelectedTab] = useState(\"summary\");\n\n const ldapIsEnabled = (features && features.includes(\"ldap-idp\")) || false;\n\n const displayGroups = hasPermission(\n CONSOLE_UI_RESOURCE,\n listGroupPermissions,\n true,\n );\n\n const viewGroup = hasPermission(\n CONSOLE_UI_RESOURCE,\n getGroupPermissions,\n true,\n );\n\n const displayUsers = hasPermission(\n CONSOLE_UI_RESOURCE,\n listUsersPermissions,\n true,\n );\n\n const viewUser = hasPermission(\n CONSOLE_UI_RESOURCE,\n viewUserPermissions,\n true,\n );\n\n const displayPolicy = hasPermission(\n CONSOLE_UI_RESOURCE,\n viewPolicyPermissions,\n true,\n );\n\n const canDeletePolicy = hasPermission(\n CONSOLE_UI_RESOURCE,\n deletePolicyPermissions,\n true,\n );\n\n const canEditPolicy = hasPermission(\n CONSOLE_UI_RESOURCE,\n createPolicyPermissions,\n true,\n );\n\n const saveRecord = (event: React.FormEvent) => {\n event.preventDefault();\n if (addLoading) {\n return;\n }\n setAddLoading(true);\n if (canEditPolicy) {\n api.policies\n .addPolicy({\n name: policyName,\n policy: policyDefinition,\n })\n .then((_) => {\n setAddLoading(false);\n dispatch(setSnackBarMessage(\"Policy successfully updated\"));\n refreshPolicyDetails();\n })\n .catch((err) => {\n setAddLoading(false);\n dispatch(\n setErrorSnackMessage({\n errorMessage: \"There was an error updating the Policy \",\n detailedError:\n \"There was an error updating the Policy: \" +\n (err.error.detailedMessage || \"\") +\n \". Please check Policy syntax.\",\n }),\n );\n });\n } else {\n setAddLoading(false);\n }\n };\n\n useEffect(() => {\n const loadUsersForPolicy = () => {\n if (loadingUsers) {\n if (displayUsers && !ldapIsEnabled) {\n api.policies\n .listUsersForPolicy(policyName)\n .then((result) => {\n setUserList(result.data ?? []);\n setLoadingUsers(false);\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(err));\n setLoadingUsers(false);\n });\n } else {\n setLoadingUsers(false);\n }\n }\n };\n\n const loadGroupsForPolicy = () => {\n if (loadingGroups) {\n if (displayGroups && !ldapIsEnabled) {\n api.policies\n .listGroupsForPolicy(policyName)\n .then((result) => {\n setGroupList(result.data ?? []);\n setLoadingGroups(false);\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(err));\n setLoadingGroups(false);\n });\n } else {\n setLoadingGroups(false);\n }\n }\n };\n const loadPolicyDetails = () => {\n if (loadingPolicy) {\n if (displayPolicy) {\n api.policy\n .policyInfo(policyName)\n .then((result) => {\n if (result.data) {\n setPolicy(result.data);\n setPolicyDefinition(\n result\n ? JSON.stringify(JSON.parse(result.data?.policy!), null, 4)\n : \"\",\n );\n const pol: IAMPolicy = JSON.parse(result.data?.policy!);\n setPolicyStatements(pol.Statement);\n }\n setLoadingPolicy(false);\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(err));\n setLoadingPolicy(false);\n });\n } else {\n setLoadingPolicy(false);\n }\n }\n };\n\n if (loadingPolicy) {\n loadPolicyDetails();\n loadUsersForPolicy();\n loadGroupsForPolicy();\n }\n }, [\n policyName,\n loadingPolicy,\n loadingUsers,\n loadingGroups,\n setUserList,\n setGroupList,\n setPolicyDefinition,\n setPolicy,\n setLoadingUsers,\n setLoadingGroups,\n displayUsers,\n displayGroups,\n displayPolicy,\n ldapIsEnabled,\n dispatch,\n ]);\n\n const resetForm = () => {\n setPolicyDefinition(\"{}\");\n };\n\n const validSave = policyName.trim() !== \"\";\n\n const deletePolicy = () => {\n setDeleteOpen(true);\n };\n\n const closeDeleteModalAndRefresh = (refresh: boolean) => {\n setDeleteOpen(false);\n navigate(IAM_PAGES.POLICIES);\n };\n\n const userViewAction = (user: any) => {\n navigate(`${IAM_PAGES.USERS}/${encodeURIComponent(user)}`);\n };\n const userTableActions = [\n {\n type: \"view\",\n onClick: userViewAction,\n disableButtonFunction: () => !viewUser,\n },\n ];\n\n const filteredUsers = userList.filter((elementItem) =>\n elementItem.includes(filterUsers),\n );\n\n const groupViewAction = (group: any) => {\n navigate(`${IAM_PAGES.GROUPS}/${encodeURIComponent(group)}`);\n };\n\n const groupTableActions = [\n {\n type: \"view\",\n onClick: groupViewAction,\n disableButtonFunction: () => !viewGroup,\n },\n ];\n\n const filteredGroups = groupList.filter((elementItem) =>\n elementItem.includes(filterGroups),\n );\n\n const refreshPolicyDetails = () => {\n setLoadingUsers(true);\n setLoadingGroups(true);\n setLoadingPolicy(true);\n };\n\n useEffect(() => {\n dispatch(setHelpName(\"policy_details_summary\"));\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n \n {deleteOpen && (\n \n )}\n \n navigate(IAM_PAGES.POLICIES)}\n />\n \n }\n actions={}\n />\n \n }\n title={policyName}\n subTitle={IAM Policy}\n actions={\n \n \n \n }\n onClick={deletePolicy}\n disabled={!canDeletePolicy}\n />\n \n \n\n \n }\n onClick={() => {\n refreshPolicyDetails();\n }}\n />\n \n \n }\n sx={{ marginBottom: 15 }}\n />\n \n \n \n dispatch(setHelpName(\"policy_details_summary\"))\n }\n >\n \n Policy Summary\n \n \n \n \n \n \n ),\n },\n {\n tabConfig: {\n label: \"Users\",\n disabled: !displayUsers || ldapIsEnabled,\n id: \"users\",\n },\n content: (\n \n \n dispatch(setHelpName(\"policy_details_users\"))\n }\n >\n \n Users\n \n \n {userList.length > 0 && (\n \n {\n setFilterUsers(val);\n }}\n />\n \n )}\n \n \n \n \n ),\n },\n {\n tabConfig: {\n label: \"Groups\",\n disabled: !displayGroups || ldapIsEnabled,\n id: \"groups\",\n },\n content: (\n \n \n dispatch(setHelpName(\"policy_details_groups\"))\n }\n >\n \n Groups\n \n \n {groupList.length > 0 && (\n \n {\n setFilterGroups(val);\n }}\n />\n \n )}\n \n \n \n \n ),\n },\n {\n tabConfig: {\n label: \"Raw Policy\",\n disabled: !displayPolicy,\n id: \"raw-policy\",\n },\n content: (\n \n \n dispatch(setHelpName(\"policy_details_policy\"))\n }\n >\n \n \n Guide to access policy structure\n \n \n }\n placement=\"right\"\n >\n Raw Policy\n \n ) => {\n saveRecord(e);\n }}\n >\n \n \n {\n if (canEditPolicy) {\n setPolicyDefinition(value);\n }\n }}\n editorHeight={\"350px\"}\n helptip={\n \n \n Guide to access policy structure\n \n \n }\n />\n \n \n {!policy && (\n {\n resetForm();\n }}\n >\n Clear\n \n )}\n \n \n \n \n \n \n {addLoading && (\n \n \n \n )}\n \n \n \n \n ),\n },\n ]}\n currentTabOrPath={selectedTab}\n onTabClick={(tab) => setSelectedTab(tab)}\n />\n \n \n \n );\n};\n\nexport default PolicyDetails;\n","\"use strict\";\n\nvar deselectCurrent = require(\"toggle-selection\");\n\nvar clipboardToIE11Formatting = {\n \"text/plain\": \"Text\",\n \"text/html\": \"Url\",\n \"default\": \"Text\"\n}\n\nvar defaultMessage = \"Copy to clipboard: #{key}, Enter\";\n\nfunction format(message) {\n var copyKey = (/mac os x/i.test(navigator.userAgent) ? \"⌘\" : \"Ctrl\") + \"+C\";\n return message.replace(/#{\\s*key\\s*}/g, copyKey);\n}\n\nfunction copy(text, options) {\n var debug,\n message,\n reselectPrevious,\n range,\n selection,\n mark,\n success = false;\n if (!options) {\n options = {};\n }\n debug = options.debug || false;\n try {\n reselectPrevious = deselectCurrent();\n\n range = document.createRange();\n selection = document.getSelection();\n\n mark = document.createElement(\"span\");\n mark.textContent = text;\n // avoid screen readers from reading out loud the text\n mark.ariaHidden = \"true\"\n // reset user styles for span element\n mark.style.all = \"unset\";\n // prevents scrolling to the end of the page\n mark.style.position = \"fixed\";\n mark.style.top = 0;\n mark.style.clip = \"rect(0, 0, 0, 0)\";\n // used to preserve spaces and line breaks\n mark.style.whiteSpace = \"pre\";\n // do not inherit user-select (it may be `none`)\n mark.style.webkitUserSelect = \"text\";\n mark.style.MozUserSelect = \"text\";\n mark.style.msUserSelect = \"text\";\n mark.style.userSelect = \"text\";\n mark.addEventListener(\"copy\", function(e) {\n e.stopPropagation();\n if (options.format) {\n e.preventDefault();\n if (typeof e.clipboardData === \"undefined\") { // IE 11\n debug && console.warn(\"unable to use e.clipboardData\");\n debug && console.warn(\"trying IE specific stuff\");\n window.clipboardData.clearData();\n var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting[\"default\"]\n window.clipboardData.setData(format, text);\n } else { // all other browsers\n e.clipboardData.clearData();\n e.clipboardData.setData(options.format, text);\n }\n }\n if (options.onCopy) {\n e.preventDefault();\n options.onCopy(e.clipboardData);\n }\n });\n\n document.body.appendChild(mark);\n\n range.selectNodeContents(mark);\n selection.addRange(range);\n\n var successful = document.execCommand(\"copy\");\n if (!successful) {\n throw new Error(\"copy command was unsuccessful\");\n }\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using execCommand: \", err);\n debug && console.warn(\"trying IE specific stuff\");\n try {\n window.clipboardData.setData(options.format || \"text\", text);\n options.onCopy && options.onCopy(window.clipboardData);\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using clipboardData: \", err);\n debug && console.error(\"falling back to prompt\");\n message = format(\"message\" in options ? options.message : defaultMessage);\n window.prompt(message, text);\n }\n } finally {\n if (selection) {\n if (typeof selection.removeRange == \"function\") {\n selection.removeRange(range);\n } else {\n selection.removeAllRanges();\n }\n }\n\n if (mark) {\n document.body.removeChild(mark);\n }\n reselectPrevious();\n }\n\n return success;\n}\n\nmodule.exports = copy;\n","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.CopyToClipboard = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _copyToClipboard = _interopRequireDefault(require(\"copy-to-clipboard\"));\n\nvar _excluded = [\"text\", \"onCopy\", \"options\", \"children\"];\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar CopyToClipboard = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(CopyToClipboard, _React$PureComponent);\n\n var _super = _createSuper(CopyToClipboard);\n\n function CopyToClipboard() {\n var _this;\n\n _classCallCheck(this, CopyToClipboard);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"onClick\", function (event) {\n var _this$props = _this.props,\n text = _this$props.text,\n onCopy = _this$props.onCopy,\n children = _this$props.children,\n options = _this$props.options;\n\n var elem = _react[\"default\"].Children.only(children);\n\n var result = (0, _copyToClipboard[\"default\"])(text, options);\n\n if (onCopy) {\n onCopy(text, result);\n } // Bypass onClick if it was present\n\n\n if (elem && elem.props && typeof elem.props.onClick === 'function') {\n elem.props.onClick(event);\n }\n });\n\n return _this;\n }\n\n _createClass(CopyToClipboard, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n _text = _this$props2.text,\n _onCopy = _this$props2.onCopy,\n _options = _this$props2.options,\n children = _this$props2.children,\n props = _objectWithoutProperties(_this$props2, _excluded);\n\n var elem = _react[\"default\"].Children.only(children);\n\n return /*#__PURE__*/_react[\"default\"].cloneElement(elem, _objectSpread(_objectSpread({}, props), {}, {\n onClick: this.onClick\n }));\n }\n }]);\n\n return CopyToClipboard;\n}(_react[\"default\"].PureComponent);\n\nexports.CopyToClipboard = CopyToClipboard;\n\n_defineProperty(CopyToClipboard, \"defaultProps\", {\n onCopy: undefined,\n options: undefined\n});","\"use strict\";\n\nvar _require = require('./Component'),\n CopyToClipboard = _require.CopyToClipboard;\n\nCopyToClipboard.CopyToClipboard = CopyToClipboard;\nmodule.exports = CopyToClipboard;","\nmodule.exports = function () {\n var selection = document.getSelection();\n if (!selection.rangeCount) {\n return function () {};\n }\n var active = document.activeElement;\n\n var ranges = [];\n for (var i = 0; i < selection.rangeCount; i++) {\n ranges.push(selection.getRangeAt(i));\n }\n\n switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n case 'INPUT':\n case 'TEXTAREA':\n active.blur();\n break;\n\n default:\n active = null;\n break;\n }\n\n selection.removeAllRanges();\n return function () {\n selection.type === 'Caret' &&\n selection.removeAllRanges();\n\n if (!selection.rangeCount) {\n ranges.forEach(function(range) {\n selection.addRange(range);\n });\n }\n\n active &&\n active.focus();\n };\n};\n"],"names":["_ref","value","label","tooltip","mode","onChange","editorHeight","helptip","_jsx","CodeEditor","helpTools","Fragment","children","TooltipWrapper","CopyToClipboard","text","Button","type","id","icon","CopyIcon","color","variant","helpTip","helpTipPlacement","STATUS_COLORS","RED","GREEN","YELLOW","getDriveStatusColor","activeDisks","totalDrives","serverStatusColor","health_status","getNetworkStatusColor","activeNetwork","networkTotal","rowGridStyle","display","gridTemplateColumns","gap","Highlight","search","txtParts","RegExp","arguments","length","undefined","replace","escapeRegExp","parts","String","split","map","part","index","test","_ref2","policyStatements","filter","setFilter","useState","_jsxs","Grid","container","item","xs","sx","alignItems","HelpTip","content","target","href","placement","sm","fontWeight","justifyContent","SearchBox","placeholder","maxWidth","borderBottom","borderTop","paddingTop","stmt","i","effect","Effect","isAllow","Box","className","fontSize","padding","marginRight","fill","height","width","EnabledIcon","DisabledIcon","Action","act","actIndex","Resource","res","resIndex","DeletePolicy","withSuspense","React","PolicyDetails","dispatch","useAppDispatch","navigate","useNavigate","params","useParams","features","useSelector","selFeatures","policy","setPolicy","setPolicyStatements","userList","setUserList","groupList","setGroupList","addLoading","setAddLoading","policyName","policyDefinition","setPolicyDefinition","loadingPolicy","setLoadingPolicy","filterUsers","setFilterUsers","loadingUsers","setLoadingUsers","filterGroups","setFilterGroups","loadingGroups","setLoadingGroups","deleteOpen","setDeleteOpen","selectedTab","setSelectedTab","ldapIsEnabled","includes","displayGroups","hasPermission","CONSOLE_UI_RESOURCE","listGroupPermissions","viewGroup","getGroupPermissions","displayUsers","listUsersPermissions","viewUser","viewUserPermissions","displayPolicy","viewPolicyPermissions","canDeletePolicy","deletePolicyPermissions","canEditPolicy","createPolicyPermissions","useEffect","api","policyInfo","then","result","data","_result$data3","_result$data4","JSON","stringify","parse","pol","Statement","catch","err","setErrorSnackMessage","policies","listUsersForPolicy","_result$data","listGroupsForPolicy","_result$data2","validSave","trim","userTableActions","onClick","user","IAM_PAGES","USERS","encodeURIComponent","disableButtonFunction","filteredUsers","elementItem","groupTableActions","group","GROUPS","filteredGroups","refreshPolicyDetails","setHelpName","selectedPolicy","closeDeleteModalAndRefresh","refresh","POLICIES","PageHeaderWrapper","BackLink","actions","HelpMenu","PageLayout","ScreenTitle","IAMPoliciesIcon","title","subTitle","SecureComponent","scopes","IAM_SCOPES","ADMIN_DELETE_POLICY","resource","errorProps","disabled","permissionTooltipHelper","TrashIcon","deletePolicy","RefreshIcon","marginBottom","Tabs","options","tabConfig","onMouseMove","SectionTitle","separator","withBorders","PolicyView","actionsTray","val","DataTable","itemActions","columns","elementKey","isLoading","records","entityName","idField","customPaperHeight","noValidate","autoComplete","onSubmit","e","preventDefault","addPolicy","name","_","setSnackBarMessage","errorMessage","detailedError","error","detailedMessage","CodeMirrorWrapper","ADMIN_CREATE_POLICY","ProgressBar","currentTabOrPath","onTabClick","tab","deselectCurrent","require","clipboardToIE11Formatting","module","exports","debug","message","reselectPrevious","range","selection","mark","success","document","createRange","getSelection","createElement","textContent","ariaHidden","style","all","position","top","clip","whiteSpace","webkitUserSelect","MozUserSelect","msUserSelect","userSelect","addEventListener","stopPropagation","format","clipboardData","console","warn","window","clearData","setData","onCopy","body","appendChild","selectNodeContents","addRange","execCommand","Error","copyKey","navigator","userAgent","prompt","removeRange","removeAllRanges","removeChild","_typeof","obj","Symbol","iterator","constructor","prototype","Object","defineProperty","_react","_interopRequireDefault","_copyToClipboard","_excluded","__esModule","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","source","forEach","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","_objectWithoutProperties","excluded","sourceKeys","indexOf","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","call","_defineProperties","props","descriptor","configurable","writable","_setPrototypeOf","o","p","setPrototypeOf","__proto__","_createSuper","Derived","hasNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","valueOf","_isNativeReflectConstruct","Super","_getPrototypeOf","NewTarget","this","self","TypeError","_assertThisInitialized","_possibleConstructorReturn","ReferenceError","getPrototypeOf","_React$PureComponent","subClass","superClass","create","_inherits","Constructor","protoProps","staticProps","_super","_this","instance","_classCallCheck","_len","args","Array","_key","concat","event","_this$props","elem","Children","only","_this$props2","cloneElement","PureComponent","rangeCount","active","activeElement","ranges","getRangeAt","tagName","toUpperCase","blur","focus"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/144.a307e795.chunk.js b/web-app/build/static/js/144.a307e795.chunk.js deleted file mode 100644 index 27c3210d4..000000000 --- a/web-app/build/static/js/144.a307e795.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[144],{40144:(e,s,t)=>{t.r(s),t.d(s,{default:()=>j});var i=t(65043),a=t(73216),o=t(77403),n=t(89923),r=t(56629),l=t(53518),c=t(99161),d=t(64159),p=t(21383),x=t(70579);const u=e=>{let{icon:s,description:t}=e;return(0,x.jsxs)(n.azJ,{sx:{display:"flex","& .min-icon":{marginRight:"10px",height:"23px",width:"23px",marginBottom:"10px"}},children:[s," ",(0,x.jsx)("div",{style:{fontSize:"14px",fontStyle:"italic",color:"#5E5E5E"},children:t})]})},m=()=>(0,x.jsxs)(n.azJ,{sx:{flex:1,border:"1px solid #eaeaea",borderRadius:"2px",display:"flex",flexFlow:"column",padding:"20px",marginTop:0},children:[(0,x.jsxs)(n.azJ,{sx:{fontSize:"16px",fontWeight:600,display:"flex",alignItems:"center",marginBottom:"16px","& .min-icon":{height:"21px",width:"21px",marginRight:"15px"}},children:[(0,x.jsx)(n.nag,{}),(0,x.jsx)("div",{children:"Learn more about Groups"})]}),(0,x.jsxs)(n.azJ,{sx:{fontSize:"14px",marginBottom:"15px"},children:["Adding groups lets you assign IAM policies to multiple users at once.",(0,x.jsx)(n.azJ,{sx:{paddingTop:"20px",paddingBottom:"10px"},children:"Users inherit access permissions to data and resources through the groups they belong to."}),(0,x.jsx)(n.azJ,{sx:{paddingTop:"10px",paddingBottom:"10px"},children:"A user can be a member of multiple groups."}),(0,x.jsx)(n.azJ,{sx:{paddingTop:"10px",paddingBottom:"10px"},children:"Groups provide a simplified method for managing shared permissions among users with common access patterns and workloads. Client\u2019s cannot authenticate to a MinIO deployment using a group as an identity."})]}),(0,x.jsxs)(n.azJ,{sx:{display:"flex",flexFlow:"column"},children:[(0,x.jsx)(u,{icon:(0,x.jsx)(n.YXz,{}),description:"Add Users to Group"}),(0,x.jsx)(n.azJ,{sx:{paddingTop:"10px",paddingBottom:"10px"},children:"Select from the list of displayed users to assign users to the new group at creation. These users inherit the policies assigned to the group."}),(0,x.jsx)(u,{icon:(0,x.jsx)(n.n$X,{}),description:"Assign Custom IAM Policies for Group"}),(0,x.jsx)(n.azJ,{sx:{paddingTop:"10px",paddingBottom:"10px"},children:"You can add policies to the group by selecting it from the Groups view after creation. The Policy view lets you manage the assigned policies for the group."})]})]});var h=t(22923),g=t(48793),f=t(88617);const j=()=>{const e=(0,p.jL)(),s=(0,a.Zp)(),[t,u]=(0,i.useState)(""),[j,y]=(0,i.useState)(!1),[b,S]=(0,i.useState)([]),[z,A]=(0,i.useState)(!1);(0,i.useEffect)((()=>{A(""!==t.trim())}),[t,b]),(0,i.useEffect)((()=>{if(j){(()=>{r.F.groups.addGroup({group:t,members:b}).then((e=>{y(!1),s(`${c.zZ.GROUPS}`)})).catch((s=>{y(!1),e((0,d.C9)((0,l.S)(s.error)))}))})()}}),[j,t,b,e,s]);return(0,i.useEffect)((()=>{e((0,d.ph)("add_group"))}),[]),(0,x.jsxs)(i.Fragment,{children:[(0,x.jsx)(g.A,{label:(0,x.jsx)(n.EGL,{label:"Groups",onClick:()=>s(c.zZ.GROUPS)}),actions:(0,x.jsx)(f.A,{})}),(0,x.jsx)(n.Mxu,{children:(0,x.jsx)(n.Hbc,{title:"Create Group",icon:(0,x.jsx)(n.lwR,{}),helpBox:(0,x.jsx)(m,{}),children:(0,x.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{e.preventDefault(),y(!0)},children:[(0,x.jsx)(n.cl_,{id:"group-name",name:"group-name",label:"Group Name",autoFocus:!0,value:t,onChange:e=>{u(e.target.value)}}),(0,x.jsx)(h.A,{selectedUsers:b,setSelectedUsers:S,editMode:!0}),(0,x.jsxs)(n.xA9,{item:!0,xs:12,sx:o.Uz.modalButtonBar,children:[(0,x.jsx)(n.$nd,{id:"clear-group",type:"button",variant:"regular",onClick:()=>{u(""),S([])},label:"Clear"}),(0,x.jsx)(n.$nd,{id:"save-group",type:"submit",variant:"callAction",disabled:j||!z,label:"Save"})]}),j&&(0,x.jsx)(n.xA9,{item:!0,xs:12,children:(0,x.jsx)(n.z21,{})})]})})})]})}},22923:(e,s,t)=>{t.d(s,{A:()=>m});var i=t(65043),a=t(33097),o=t.n(a),n=t(56629),r=t(53518),l=t(89923),c=t(8185),d=t(64159),p=t(21383),x=t(64681),u=t(70579);const m=e=>{let{selectedUsers:s,setSelectedUsers:t,editMode:a=!1}=e;const m=(0,p.jL)(),[h,g]=(0,i.useState)([]),[f,j]=(0,i.useState)(!1),[y,b]=(0,i.useState)(""),S=(0,i.useCallback)((()=>{n.F.users.listUsers().then((e=>{let s=o()(e.data,"users",[]);s||(s=[]),g(s.sort(c.LA)),j(!1)})).catch((e=>{m((0,d.Dy)((0,r.S)(e.error))),j(!1)}))}),[m]);(0,i.useEffect)((()=>{j(!0)}),[]),(0,i.useEffect)((()=>{f&&S()}),[f,S]);const z=s||[],A=h.filter((e=>e.accessKey.includes(y)));return(0,u.jsx)(l.xA9,{item:!0,xs:12,className:"inputItem",children:(0,u.jsxs)(l.azJ,{children:[f&&(0,u.jsx)(l.z21,{}),(null===h||void 0===h?void 0:h.length)>0?(0,u.jsxs)(i.Fragment,{children:[(0,u.jsx)(l.xA9,{item:!0,xs:12,className:"inputItem",children:(0,u.jsx)(x.A,{label:a?"Edit Members":"Assign Users",placeholder:"Filter Users",onChange:b,value:y})}),(0,u.jsx)(l.bQt,{columns:[{label:"Access Key",elementKey:"accessKey"}],onSelect:e=>{const s=e.target,i=s.value,a=s.checked;let o=[...z];return a?o.push(i):o=o.filter((e=>e!==i)),t(o),o},selectedItems:z,isLoading:f,records:A,entityName:"Users",idField:"accessKey",customPaperHeight:"200px"})]}):(0,u.jsx)(l.azJ,{sx:{textAlign:"center",padding:"10px 0"},children:"No Users to display"})]})})}},8185:(e,s,t)=>{t.d(s,{Hw:()=>a,LA:()=>i,SO:()=>o,rY:()=>n});const i=(e,s)=>{if(e.accessKey&&s.accessKey){if(e.accessKey>s.accessKey)return 1;if(e.accessKeye.name>s.name?1:e.namee>s?1:ee.policy>s.policy?1:e.policy.\nimport React from \"react\";\n\nimport { Box, GroupsIcon, HelpIconFilled, IAMPoliciesIcon } from \"mds\";\n\nconst FeatureItem = ({\n icon,\n description,\n}: {\n icon: any;\n description: string;\n}) => {\n return (\n \n {icon}{\" \"}\n
\n {description}\n
\n \n );\n};\nconst AddGroupHelpBox = () => {\n return (\n \n \n \n
Learn more about Groups
\n \n \n Adding groups lets you assign IAM policies to multiple users at once.\n \n Users inherit access permissions to data and resources through the\n groups they belong to.\n \n \n A user can be a member of multiple groups.\n \n \n Groups provide a simplified method for managing shared permissions\n among users with common access patterns and workloads. Client’s cannot\n authenticate to a MinIO deployment using a group as an identity.\n \n \n\n \n } description={`Add Users to Group`} />\n \n Select from the list of displayed users to assign users to the new\n group at creation. These users inherit the policies assigned to the\n group.\n \n }\n description={`Assign Custom IAM Policies for Group`}\n />\n \n You can add policies to the group by selecting it from the Groups view\n after creation. The Policy view lets you manage the assigned policies\n for the group.\n \n \n \n );\n};\n\nexport default AddGroupHelpBox;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport { modalStyleUtils } from \"../Common/FormComponents/common/styleLibrary\";\n\nimport {\n BackLink,\n Button,\n CreateGroupIcon,\n FormLayout,\n Grid,\n InputBox,\n PageLayout,\n ProgressBar,\n} from \"mds\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport { IAM_PAGES } from \"../../../common/SecureComponent/permissions\";\nimport { setErrorSnackMessage, setHelpName } from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\nimport AddGroupHelpBox from \"./AddGroupHelpBox\";\nimport UsersSelectors from \"./UsersSelectors\";\nimport PageHeaderWrapper from \"../Common/PageHeaderWrapper/PageHeaderWrapper\";\nimport HelpMenu from \"../HelpMenu\";\n\nconst AddGroupScreen = () => {\n const dispatch = useAppDispatch();\n const navigate = useNavigate();\n const [groupName, setGroupName] = useState(\"\");\n const [saving, isSaving] = useState(false);\n const [selectedUsers, setSelectedUsers] = useState([]);\n const [validGroup, setValidGroup] = useState(false);\n\n useEffect(() => {\n setValidGroup(groupName.trim() !== \"\");\n }, [groupName, selectedUsers]);\n\n useEffect(() => {\n if (saving) {\n const saveRecord = () => {\n api.groups\n .addGroup({\n group: groupName,\n members: selectedUsers,\n })\n .then((res) => {\n isSaving(false);\n navigate(`${IAM_PAGES.GROUPS}`);\n })\n .catch((err) => {\n isSaving(false);\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n });\n };\n\n saveRecord();\n }\n }, [saving, groupName, selectedUsers, dispatch, navigate]);\n\n //Fetch Actions\n const setSaving = (event: React.FormEvent) => {\n event.preventDefault();\n\n isSaving(true);\n };\n\n const resetForm = () => {\n setGroupName(\"\");\n setSelectedUsers([]);\n };\n\n useEffect(() => {\n dispatch(setHelpName(\"add_group\"));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n \n navigate(IAM_PAGES.GROUPS)}\n />\n }\n actions={}\n />\n \n }\n helpBox={}\n >\n
\n ) => {\n setGroupName(e.target.value);\n }}\n />\n \n \n \n\n \n \n {saving && (\n \n \n \n )}\n \n \n
\n
\n );\n};\n\nexport default AddGroupScreen;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useCallback, useEffect, useState, Fragment } from \"react\";\nimport get from \"lodash/get\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport { Box, DataTable, Grid, ProgressBar } from \"mds\";\n\nimport { usersSort } from \"../../../utils/sortFunctions\";\nimport { setModalErrorSnackMessage } from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\nimport SearchBox from \"../Common/SearchBox\";\n\ninterface IGroupsProps {\n selectedUsers: string[];\n setSelectedUsers: any;\n editMode?: boolean;\n}\n\nconst UsersSelectors = ({\n selectedUsers,\n setSelectedUsers,\n editMode = false,\n}: IGroupsProps) => {\n const dispatch = useAppDispatch();\n //Local States\n const [records, setRecords] = useState([]);\n const [loading, isLoading] = useState(false);\n const [filter, setFilter] = useState(\"\");\n\n const fetchUsers = useCallback(() => {\n api.users\n .listUsers()\n .then((res) => {\n let users = get(res.data, \"users\", []);\n\n if (!users) {\n users = [];\n }\n\n setRecords(users.sort(usersSort));\n isLoading(false);\n })\n .catch((err) => {\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n isLoading(false);\n });\n }, [dispatch]);\n\n //Effects\n useEffect(() => {\n isLoading(true);\n }, []);\n\n useEffect(() => {\n if (loading) {\n fetchUsers();\n }\n }, [loading, fetchUsers]);\n\n const selUsers = !selectedUsers ? [] : selectedUsers;\n\n //Fetch Actions\n const selectionChanged = (e: React.ChangeEvent) => {\n const targetD = e.target;\n const value = targetD.value;\n const checked = targetD.checked;\n\n let elements: string[] = [...selUsers]; // We clone the selectedGroups array\n\n if (checked) {\n // If the user has checked this field we need to push this to selectedGroupsList\n elements.push(value);\n } else {\n // User has unchecked this field, we need to remove it from the list\n elements = elements.filter((element) => element !== value);\n }\n setSelectedUsers(elements);\n\n return elements;\n };\n\n const filteredRecords = records.filter((elementItem) =>\n elementItem.accessKey.includes(filter),\n );\n\n return (\n \n \n {loading && }\n {records?.length > 0 ? (\n \n \n \n \n \n \n ) : (\n \n No Users to display\n \n )}\n \n \n );\n};\n\nexport default UsersSelectors;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport { Policy, User } from \"api/consoleApi\";\n\ninterface policyDetailsInterface {\n policy: string;\n}\n\nexport const usersSort = (a: User, b: User) => {\n if (a.accessKey && b.accessKey) {\n if (a.accessKey > b.accessKey) {\n return 1;\n }\n if (a.accessKey < b.accessKey) {\n return -1;\n }\n }\n // a must be equal to b\n return 0;\n};\n\nexport const policySort = (a: Policy, b: Policy) => {\n if (a.name! > b.name!) {\n return 1;\n }\n if (a.name! < b.name!) {\n return -1;\n }\n // a must be equal to b\n return 0;\n};\n\nexport const stringSort = (a: string, b: string) => {\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n // a must be equal to b\n return 0;\n};\n\nexport const policyDetailsSort = (\n a: policyDetailsInterface,\n b: policyDetailsInterface,\n) => {\n if (a.policy > b.policy) {\n return 1;\n }\n if (a.policy < b.policy) {\n return -1;\n }\n // a must be equal to b\n return 0;\n};\n"],"names":["FeatureItem","_ref","icon","description","_jsxs","Box","sx","display","marginRight","height","width","marginBottom","children","_jsx","style","fontSize","fontStyle","color","AddGroupHelpBox","flex","border","borderRadius","flexFlow","padding","marginTop","fontWeight","alignItems","HelpIconFilled","paddingTop","paddingBottom","GroupsIcon","IAMPoliciesIcon","AddGroupScreen","dispatch","useAppDispatch","navigate","useNavigate","groupName","setGroupName","useState","saving","isSaving","selectedUsers","setSelectedUsers","validGroup","setValidGroup","useEffect","trim","saveRecord","api","groups","addGroup","group","members","then","res","IAM_PAGES","GROUPS","catch","err","setErrorSnackMessage","errorToHandler","error","setHelpName","Fragment","PageHeaderWrapper","label","BackLink","onClick","actions","HelpMenu","PageLayout","FormLayout","title","CreateGroupIcon","helpBox","noValidate","autoComplete","onSubmit","event","preventDefault","InputBox","id","name","autoFocus","value","onChange","e","target","UsersSelectors","editMode","Grid","item","xs","modalStyleUtils","modalButtonBar","Button","type","variant","resetForm","disabled","ProgressBar","records","setRecords","loading","isLoading","filter","setFilter","fetchUsers","useCallback","users","listUsers","get","data","sort","usersSort","setModalErrorSnackMessage","selUsers","filteredRecords","elementItem","accessKey","includes","className","length","SearchBox","placeholder","DataTable","columns","elementKey","onSelect","targetD","checked","elements","push","element","selectedItems","entityName","idField","customPaperHeight","textAlign","a","b","policySort","stringSort","policyDetailsSort","policy"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/153.0edba926.chunk.js b/web-app/build/static/js/153.0edba926.chunk.js new file mode 100644 index 000000000..a79e3ba36 --- /dev/null +++ b/web-app/build/static/js/153.0edba926.chunk.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[153],{5153:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var o=n(5043),r=n(9923),a=n(6969),l=n(4574),i=n(3097),s=n.n(i),c=n(579);const p=e=>(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"min-icon",fill:"currentcolor",...e,children:(0,c.jsx)("polygon",{points:"8.5 16.5 21.5 3.6 23.4 5.5 8.5 20.4 .6 12.5 2.5 10.5 8.5 16.5"})}),d=l.Ay.div((e=>{let{theme:t}=e;return{display:"grid",gridTemplateColumns:"repeat(3, minmax(350px, 400px))",justifyContent:"flex-start",marginTop:30,marginLeft:30,"& > div":{borderBottom:`${s()(t,"borderColor","#EAEAEA")} 1px solid`,padding:"25px 40px",justifyContent:"center","&.openSource":{borderRight:"#002562 2px solid",borderLeft:"#002562 2px solid",position:"relative","&.first:before":{content:"' '",width:"calc(100% + 4px)",height:16,display:"block",backgroundColor:"#001F55",position:"absolute",top:-14,left:-2,border:"#002562 2px solid",borderBottom:0,borderTopLeftRadius:12,borderTopRightRadius:12},"&.last":{paddingBottom:30,"&:after":{content:"' '",width:"calc(100% + 4px)",height:16,display:"block",position:"absolute",bottom:-14,left:-2,border:"#002562 2px solid",borderTop:0,borderBottomLeftRadius:12,borderBottomRightRadius:12}}},"&.feature-information":{textAlign:"center"},"&.feature-label":{paddingLeft:5},"&.noBorderBottom":{borderBottom:0}},"& .planName":{fontWeight:600,fontSize:32,marginBottom:24,textAlign:"center",marginTop:8},"& .planIcon":{height:100,display:"flex",alignItems:"flex-start",justifyContent:"center","& svg":{height:80},"&.commercial":{"& svg":{height:70}}},"& .planDescription":{display:"flex",justifyContent:"center"}}})),m=()=>{const e=(e,t,n)=>{let o=e;return(0,c.jsx)(r.$nd,{id:`license-action-${e}`,variant:n,sx:{marginTop:"12px",width:"80%",height:"55px"},onClick:e=>{e.preventDefault(),window.open(`${o}?ref=con`,"_blank")},label:t})},t=e=>e?(0,c.jsxs)(o.Fragment,{children:[e.content,e.isCheck&&(0,c.jsx)(p,{style:{width:16,height:16}})]}):(0,c.jsx)(o.Fragment,{});return(0,c.jsx)(o.Fragment,{children:(0,c.jsxs)(d,{children:[[null,...a.qZ].map(((e,t)=>(0,c.jsx)(r.azJ,{className:""+(1===t?"openSource first":""),children:null!==e&&(0,c.jsxs)(r.azJ,{children:[(0,c.jsx)(r.azJ,{className:"planName",children:e.planName}),(0,c.jsx)(r.azJ,{className:"planIcon "+("commercial"===e.planType?"commercial":""),children:null===e||void 0===e?void 0:e.planIcon}),(0,c.jsx)(r.azJ,{className:"planDescription",children:null===e||void 0===e?void 0:e.planDescription})]})}))),a.c_.map(((e,n)=>{const l=n===a.c_.length-1?"noBorderBottom":"";return(0,c.jsxs)(o.Fragment,{children:[(0,c.jsx)(r.azJ,{className:`feature-label ${l}`,children:e.featureLabel}),(0,c.jsx)(r.azJ,{className:`feature-information openSource ${l}`,children:t(e.featurePlans.openSource||null)}),(0,c.jsx)(r.azJ,{className:`feature-information ${l}`,children:t(e.featurePlans.eosPlus||null)})]})})),[null,...a.qZ].map(((t,n)=>(0,c.jsx)(r.azJ,{className:(1===n?"openSource last":"")+" noBorderBottom",sx:{display:"flex",justifyContent:"center"},children:t&&e("https://min.io/signup","commercial"===t.planType?"Upgrade":"Join Slack","commercial"===t.planType?"callAction":"regular")})))]})})};var u=n(8793),x=n(4159),h=n(3635);const f=()=>{const e=(0,h.j)();return(0,o.useEffect)((()=>{e((0,x.ph)("license"))}),[]),(0,c.jsxs)(o.Fragment,{children:[(0,c.jsx)(u.A,{label:"MinIO License and Support Plan"}),(0,c.jsx)(r.Mxu,{children:(0,c.jsx)(m,{})})]})}}}]); +//# sourceMappingURL=153.0edba926.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/153.0edba926.chunk.js.map b/web-app/build/static/js/153.0edba926.chunk.js.map new file mode 100644 index 000000000..617e51f6b --- /dev/null +++ b/web-app/build/static/js/153.0edba926.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"static/js/153.0edba926.chunk.js","mappings":"uMAmBA,MAYA,EAZmBA,IACjBC,EAAAA,EAAAA,KAAA,OACEC,MAAM,6BAC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AAAA,IAAG,CAACjE,UAAW,iBAAiBwE,IAAWtE,SACzCqE,EAAQG,gBAEX7E,EAAAA,EAAAA,KAACoE,EAAAA,IAAG,CAACjE,UAAW,mCAAmCwE,IAAWtE,SAC3DqD,EACCgB,EAAQI,aAAaC,YAAc,SAGvC/E,EAAAA,EAAAA,KAACoE,EAAAA,IAAG,CAACjE,UAAW,uBAAuBwE,IAAWtE,SAC/CqD,EAAyBgB,EAAQI,aAAaE,SAAW,UAEnD,IAGd,CAAC,QAAShB,EAAAA,IAA2BC,KAAI,CAACC,EAASC,KAEhDnE,EAAAA,EAAAA,KAACoE,EAAAA,IAAG,CACFjE,WACY,IAAVgE,EAAc,kBAAoB,IADzB,kBAGXhB,GAAI,CACFvC,QAAS,OACTE,eAAgB,UAChBT,SAED6D,GACCtB,EACE,wBACqB,eAArBsB,EAAQI,SAA4B,UAAY,aAC3B,eAArBJ,EAAQI,SAA4B,aAAe,mBAMtD,E,kCCxLf,MAiBA,EAjBgBW,KACd,MAAMC,GAAWC,EAAAA,EAAAA,KAMjB,OALAC,EAAAA,EAAAA,YAAU,KACRF,GAASG,EAAAA,EAAAA,IAAY,WAAW,GAE/B,KAGD1B,EAAAA,EAAAA,MAACC,EAAAA,SAAQ,CAAAvD,SAAA,EACPL,EAAAA,EAAAA,KAACsF,EAAAA,EAAiB,CAAC7B,MAAM,oCACzBzD,EAAAA,EAAAA,KAACuF,EAAAA,IAAU,CAAAlF,UACTL,EAAAA,EAAAA,KAAC2C,EAAY,QAEN,C","sources":["screens/Console/License/CheckIcon.tsx","screens/Console/License/LicensePlans.tsx","screens/Console/License/License.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2024 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport * as React from \"react\";\nimport { SVGProps } from \"react\";\n\nconst CheckIcon = (props: SVGProps) => (\n \n \n \n);\n\nexport default CheckIcon;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport { Box, Button } from \"mds\";\nimport { FEATURE_ITEMS, FeatureItem, LICENSE_PLANS_INFORMATION } from \"./utils\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport CheckIcon from \"./CheckIcon\";\n\nconst LicensesInformation = styled.div(({ theme }) => ({\n display: \"grid\",\n gridTemplateColumns: \"repeat(3, minmax(350px, 400px))\",\n justifyContent: \"flex-start\",\n marginTop: 30,\n marginLeft: 30,\n \"& > div\": {\n borderBottom: `${get(theme, \"borderColor\", \"#EAEAEA\")} 1px solid`,\n padding: \"25px 40px\",\n justifyContent: \"center\",\n \"&.openSource\": {\n borderRight: `#002562 2px solid`,\n borderLeft: `#002562 2px solid`,\n position: \"relative\",\n \"&.first:before\": {\n content: \"' '\",\n width: \"calc(100% + 4px)\",\n height: 16,\n display: \"block\",\n backgroundColor: \"#001F55\",\n position: \"absolute\",\n top: -14,\n left: -2,\n border: `#002562 2px solid`,\n borderBottom: 0,\n borderTopLeftRadius: 12,\n borderTopRightRadius: 12,\n },\n \"&.last\": {\n paddingBottom: 30,\n \"&:after\": {\n content: \"' '\",\n width: \"calc(100% + 4px)\",\n height: 16,\n display: \"block\",\n position: \"absolute\",\n bottom: -14,\n left: -2,\n border: `#002562 2px solid`,\n borderTop: 0,\n borderBottomLeftRadius: 12,\n borderBottomRightRadius: 12,\n },\n },\n },\n \"&.feature-information\": {\n textAlign: \"center\",\n },\n \"&.feature-label\": {\n paddingLeft: 5,\n },\n \"&.noBorderBottom\": {\n borderBottom: 0,\n },\n },\n \"& .planName\": {\n fontWeight: 600,\n fontSize: 32,\n marginBottom: 24,\n textAlign: \"center\",\n marginTop: 8,\n },\n \"& .planIcon\": {\n height: 100,\n display: \"flex\",\n alignItems: \"flex-start\",\n justifyContent: \"center\",\n \"& svg\": {\n height: 80,\n },\n \"&.commercial\": {\n \"& svg\": {\n height: 70,\n },\n },\n },\n \"& .planDescription\": {\n display: \"flex\",\n justifyContent: \"center\",\n },\n}));\n\nconst LicensePlans = () => {\n let currentPlan = \"community\";\n\n const getButton = (link: string, btnText: string, variant: any) => {\n let linkToNav =\n currentPlan !== \"community\" ? \"https://subnet.min.io\" : link;\n return (\n {\n e.preventDefault();\n\n window.open(`${linkToNav}?ref=con`, \"_blank\");\n }}\n label={btnText}\n />\n );\n };\n\n const renderFeatureInformation = (content: FeatureItem | null) => {\n if (content) {\n return (\n \n {content.content}\n {content.isCheck && }\n \n );\n }\n return ;\n };\n\n return (\n \n \n {[null, ...LICENSE_PLANS_INFORMATION].map((element, index) => {\n return (\n \n {element !== null && (\n \n {element.planName}\n \n {element?.planIcon}\n \n \n {element?.planDescription}\n \n \n )}\n \n );\n })}\n {FEATURE_ITEMS.map((feature, index) => {\n const lastItem =\n index === FEATURE_ITEMS.length - 1 ? \"noBorderBottom\" : \"\";\n\n return (\n \n \n {feature.featureLabel}\n \n \n {renderFeatureInformation(\n feature.featurePlans.openSource || null,\n )}\n \n \n {renderFeatureInformation(feature.featurePlans.eosPlus || null)}\n \n \n );\n })}\n {[null, ...LICENSE_PLANS_INFORMATION].map((element, index) => {\n return (\n \n {element &&\n getButton(\n `https://min.io/signup`,\n element.planType === \"commercial\" ? \"Upgrade\" : \"Join Slack\",\n element.planType === \"commercial\" ? \"callAction\" : \"regular\",\n )}\n \n );\n })}\n \n \n );\n};\n\nexport default LicensePlans;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect } from \"react\";\nimport { PageLayout } from \"mds\";\nimport LicensePlans from \"./LicensePlans\";\nimport PageHeaderWrapper from \"../Common/PageHeaderWrapper/PageHeaderWrapper\";\nimport { setHelpName } from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\n\nconst License = () => {\n const dispatch = useAppDispatch();\n useEffect(() => {\n dispatch(setHelpName(\"license\"));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n \n \n \n \n \n \n );\n};\n\nexport default License;\n"],"names":["props","_jsx","xmlns","viewBox","className","fill","children","points","LicensesInformation","styled","div","_ref","theme","display","gridTemplateColumns","justifyContent","marginTop","marginLeft","borderBottom","get","padding","borderRight","borderLeft","position","content","width","height","backgroundColor","top","left","border","borderTopLeftRadius","borderTopRightRadius","paddingBottom","bottom","borderTop","borderBottomLeftRadius","borderBottomRightRadius","textAlign","paddingLeft","fontWeight","fontSize","marginBottom","alignItems","LicensePlans","getButton","link","btnText","variant","linkToNav","Button","id","sx","onClick","e","preventDefault","window","open","label","renderFeatureInformation","_jsxs","Fragment","isCheck","CheckIcon","style","LICENSE_PLANS_INFORMATION","map","element","index","Box","planName","planType","planIcon","planDescription","FEATURE_ITEMS","feature","lastItem","length","featureLabel","featurePlans","openSource","eosPlus","License","dispatch","useAppDispatch","useEffect","setHelpName","PageHeaderWrapper","PageLayout"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/182.6e133743.chunk.js b/web-app/build/static/js/182.6e133743.chunk.js deleted file mode 100644 index 9691dd1c6..000000000 --- a/web-app/build/static/js/182.6e133743.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[182,614],{30614:(e,t,n)=>{n.r(t),n.d(t,{default:()=>h});var s=n(65043),o=n(94141),i=n(89923),a=n(56629),l=n(53518),r=n(77403),d=n(64159),c=n(21383),u=n(70579);const h=e=>{let{modalOpen:t,onClose:n,bucket:h,prefilledRoute:m}=e;const x=(0,c.jL)(),[p,j]=(0,s.useState)(""),[b,g]=(0,s.useState)("readonly");(0,s.useEffect)((()=>{m&&j(m)}),[m]);return(0,u.jsx)(o.A,{modalOpen:t,title:"Add Anonymous Access Rule",onClose:n,titleIcon:(0,u.jsx)(i.No_,{}),children:(0,u.jsxs)(i.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,u.jsx)(i.cl_,{value:p,label:"Prefix",id:"prefix",name:"prefix",placeholder:"Enter Prefix",onChange:e=>{j(e.target.value)},tooltip:"Enter '/' to apply the rule to all prefixes and objects at the bucket root. Do not include the wildcard asterisk '*' as part of the prefix *unless* it is an explicit part of the prefix name. The Console automatically appends an asterisk to the appropriate sections of the resulting IAM policy."}),(0,u.jsx)(i.l6P,{id:"access",name:"Access",onChange:e=>{g(e)},label:"Access",value:b,options:[{label:"readonly",value:"readonly"},{label:"writeonly",value:"writeonly"},{label:"readwrite",value:"readwrite"}],disabled:!1,helpTip:(0,u.jsx)(s.Fragment,{children:"Select the desired level of access available to unauthenticated Users"}),helpTipPlacement:"right"}),(0,u.jsxs)(i.xA9,{item:!0,xs:12,sx:r.Uz.modalButtonBar,children:[(0,u.jsx)(i.$nd,{id:"clear",type:"button",variant:"regular",onClick:()=>{j(""),g("readonly")},label:"Clear"}),(0,u.jsx)(i.$nd,{id:"add-access-save",type:"submit",variant:"callAction",disabled:""===p.trim(),onClick:()=>{a.F.bucket.setAccessRuleWithBucket(h,{prefix:p,access:b}).then((e=>{x((0,d.Hk)("Access Rule added successfully")),n()})).catch((e=>{x((0,d.C9)((0,l.S)(e.error))),n()}))},label:"Save"})]})]})})}},182:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ge});var s=n(65043),o=n(22166),i=n(73216),a=n(56629),l=n(21383),r=n(99161),d=n(6035),c=n(33097),u=n.n(c),h=n(89923),m=n(53518),x=n(68424),p=n(24241),j=n(56483),b=n(61476),g=n.n(b),f=n(94574),v=n(35475),_=n(77938),S=n(72237),O=n(64159);const w=e=>(e.match(/\.([^.]*?)(?=\?|#|$)/)||[])[1],T=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const s=Object.keys(e).reduce(((n,s)=>(w(s)&&s.includes(t)&&(n[s]=e[s]),n)),{});return Object.keys(s).filter((e=>{const o=s[e].some((e=>n.find((t=>{let n=!1;if(-1!==t.indexOf("*")){const s=t.substring(0,t.length-1);n=e.includes(s)}return n||e===t})))),i=e.substring(0,e.indexOf("/*."));return o&&(i===`arn:aws:s3:::${t}`&&"arn:aws:s3:::*"!==e)}))};var C=n(70579);const y=(0,S.A)(s.lazy((()=>n.e(7774).then(n.bind(n,97774))))),E=f.Ay.div((()=>({display:"flex","& .additionalOptions":{paddingRight:"10px",display:"flex",alignItems:"center",[`@media (max-width: ${h.nmC.lg}px)`]:{display:"none"}},"& .slashSpacingStyle":{margin:"0 5px"}}))),I=e=>{let{bucketName:t,internalPaths:n,hidePathButton:a,additionalOptions:c}=e;const u=(0,l.jL)(),m=(0,i.Zp)(),x=(0,o.d4)((e=>e.objectBrowser.rewind.rewindEnabled)),p=(0,o.d4)((e=>e.objectBrowser.versionsMode)),b=(0,o.d4)((e=>e.objectBrowser.versionedFile)),f=(0,o.d4)((e=>e.system.anonymousMode)),[S,w]=(0,s.useState)(!1),[I,A]=(0,s.useState)(!1),N=[r.OV.S3_PUT_OBJECT,r.OV.S3_PUT_ACTIONS],k=(0,o.d4)((e=>e.console.session&&e.console.session.permissions||{}));let B=n;""!==n&&(B=`/${n}`);const F=B.split("/").filter((e=>""!==e)),L=F.length-1,V=t+B||t,D=T(k,V,N);(0,s.useEffect)((()=>{A(!1),Object.keys(k).forEach((e=>{e.includes(V)&&e.includes("/*")&&A(!0)}))}),[V,n,k]);const R=(0,_._)([V,...D],N)||f||I;let P=F.map(((e,n)=>{const o=`${F.slice(0,n+1).join("/")}/`,i=`/browser/${encodeURIComponent(t)}/${o?`${encodeURIComponent(o)}`:""}`;return n===L&&e===b?null:(0,C.jsxs)(s.Fragment,{children:[(0,C.jsx)("span",{className:"slashSpacingStyle",children:"/"}),n===L?(0,C.jsx)("span",{style:{cursor:"default",whiteSpace:"pre"},children:(0,j.Tw)(e)}):(0,C.jsx)(v.N_,{style:{whiteSpace:"pre"},to:i,onClick:()=>{u((0,d.cQ)({status:!1,objectName:""}))},children:(0,j.Tw)(e)})]},`breadcrumbs-${n.toString()}`)})),$=[];p&&($=[(0,C.jsx)(s.Fragment,{children:(0,C.jsxs)("span",{children:[(0,C.jsx)("span",{className:"slashSpacingStyle",children:"/"}),b," - Versions"]})},"breadcrumbs-versionedItem")]);const U=[(0,C.jsx)(s.Fragment,{children:(0,C.jsx)(v.N_,{to:`/browser/${t}`,onClick:()=>{u((0,d.cQ)({status:!1,objectName:""}))},children:t})},"breadcrumbs-root-path"),...P,...$];return(0,C.jsxs)(s.Fragment,{children:[(0,C.jsxs)(E,{children:[S&&(0,C.jsx)(y,{modalOpen:S,bucketName:t,folderName:n,onClose:()=>{w(!1)},limitedSubPath:I&&!((0,_._)([V,...D],N)||f)}),(0,C.jsx)(h.BIu,{sx:{whiteSpace:"pre"},goBackFunction:()=>{if(p)u((0,d.cQ)({status:!1,objectName:""}));else{if(0===F.length)return void m("/browser");const e=F.slice(0,-1);m(`/browser/${t}${e.length>0?`/${encodeURIComponent(`${e.join("/")}/`)}`:""}`)}},additionalOptions:(0,C.jsxs)(s.Fragment,{children:[(0,C.jsx)(g(),{text:`${t}/${F.join("/")}`,children:(0,C.jsx)(h.$nd,{id:"copy-path",icon:(0,C.jsx)(h.TdU,{style:{width:"12px",height:"12px",fill:"#969FA8",marginTop:-1}}),variant:"regular",onClick:()=>{u((0,O.Hk)("Path copied to clipboard"))},style:{width:"28px",height:"28px",color:"#969FA8",border:"#969FA8 1px solid",marginRight:5}})}),(0,C.jsx)(h.azJ,{className:"additionalOptions",children:c})]}),children:U}),!a&&(0,C.jsx)(h.m_M,{tooltip:R?"Choose or create a new path":(0,r.vj)([r.OV.S3_PUT_OBJECT,r.OV.S3_PUT_ACTIONS],"create a new path"),children:(0,C.jsx)(h.$nd,{id:"new-path",onClick:()=>{w(!0)},disabled:!f&&(x||!R),icon:(0,C.jsx)(h.pj3,{style:{fill:"#969FA8"}}),style:{whiteSpace:"nowrap"},variant:"regular",label:"Create new path"})})]}),(0,C.jsx)(h.azJ,{sx:{display:"none",marginTop:15,marginBottom:5,justifyContent:"flex-start","& > div":{fontSize:12,fontWeight:"normal",flexDirection:"row",flexWrap:"nowrap"},[`@media (max-width: ${h.nmC.lg}px)`]:{display:"flex"}},children:c})]})};var A=n(93445);const N=e=>"Enabled"===e||"Suspended"===e;var k=n(37414),B=n(39947),F=n(81708),L=n(6681);const V=e=>{let{uploadPath:t,bucketName:n,forceDisable:i=!1,uploadFileFunction:a,uploadFolderFunction:l,overrideStyles:d={}}=e;const[c,u]=(0,s.useState)(null),[m,x]=(0,s.useState)(!1),p=(0,o.d4)((e=>e.system.anonymousMode)),j=(0,o.d4)((e=>e.console.session&&e.console.session.permissions||{})),b=[r.OV.S3_PUT_OBJECT,r.OV.S3_PUT_ACTIONS],g=T(j,t,b),f=Boolean(c),v=()=>{u(null)},S=(0,_._)([t,...g],b)||p,O=(0,_._)([n,...g],b,!1,!0),w=S||O;return(0,C.jsxs)(s.Fragment,{children:[(0,C.jsx)(L.A,{tooltip:w?"Upload Files":(0,r.vj)([r.OV.S3_PUT_OBJECT,r.OV.S3_PUT_ACTIONS],"upload files to this bucket"),children:(0,C.jsx)(h.$nd,{id:"upload-main","aria-controls":"upload-main-menu","aria-haspopup":"true","aria-expanded":f?"true":void 0,onClick:e=>{x(!m),u(e.currentTarget)},label:"Upload",icon:(0,C.jsx)(h.JMY,{}),variant:"callAction",disabled:i||!w,sx:d})}),(0,C.jsx)(h.Vey,{id:"upload-main-menu",options:[{label:"Upload File",icon:(0,C.jsx)(h.JMY,{}),value:"file",disabled:!S||i},{label:"Upload Folder",icon:(0,C.jsx)(h.nDF,{}),value:"folder",disabled:!O||i}],selectedOption:"",onSelect:e=>{"folder"!==e?a(v):l(v)},hideTriggerAction:()=>{x(!1)},open:m,anchorEl:c,anchorOrigin:"end",useAnchorWidth:!0})]})},D=e=>{let{open:t,closePanel:n,className:s="",children:o}=e;return(0,C.jsxs)(h.azJ,{id:"details-panel",sx:{borderColor:"#EAEDEE",borderWidth:0,borderStyle:"solid",borderRadius:3,borderBottomLeftRadius:0,borderBottomRightRadius:0,width:0,transitionDuration:"0.3s",overflowX:"hidden",overflowY:"auto",position:"relative",opacity:0,marginLeft:-1,"&.open":{width:300,minWidth:300,borderLeftWidth:1,opacity:1},"@media (max-width: 799px)":{"&.open":{width:"100%",minWidth:"100%",borderLeftWidth:0}}},className:`${t?"open":""} ${s}`,children:[(0,C.jsx)(h.$nd,{variant:"text",id:"close-details-list",onClick:n,icon:(0,C.jsx)(h._FR,{}),sx:{position:"absolute",right:5,top:18,padding:0,height:14,"&:hover:not(:disabled)":{backgroundColor:"transparent"}}}),o]})};var R=n(48245);const P=e=>{let{icon:t,strings:n}=e;return(0,C.jsxs)(h.azJ,{sx:{display:"flex",alignItems:"center","& .min-icon":{width:16,height:16,marginRight:4,minWidth:16,minHeight:16},"& .fileNameText":{whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis"}},children:[t,(0,C.jsx)("span",{className:"fileNameText",children:(0,j.qf)(n[n.length-1])})]})},$=[{icon:(0,C.jsx)(h.FRZ,{}),extensions:["mp4","mov","avi","mpeg","mpg"]},{icon:(0,C.jsx)(h.jCy,{}),extensions:["mp3","m4a","aac"]},{icon:(0,C.jsx)(h.yTC,{}),extensions:["pdf"]},{icon:(0,C.jsx)(h.QvW,{}),extensions:["ppt","pptx"]},{icon:(0,C.jsx)(h.z9t,{}),extensions:["xls","xlsx"]},{icon:(0,C.jsx)(h.VSs,{}),extensions:["cer","crt","pem"]},{icon:(0,C.jsx)(h.bM2,{}),extensions:["html","xml","css","py","go","php","cpp","h","java"]},{icon:(0,C.jsx)(h.qM2,{}),extensions:["cfg","yaml"]},{icon:(0,C.jsx)(h.ITz,{}),extensions:["sql"]},{icon:(0,C.jsx)(h.PcO,{}),extensions:["ttf","otf"]},{icon:(0,C.jsx)(h.yEV,{}),extensions:["doc","docx","txt","rtf"]},{icon:(0,C.jsx)(h.j_m,{}),extensions:["zip","rar","tar","gz"]},{icon:(0,C.jsx)(h.DUd,{}),extensions:["epub","mobi","azw","azw3"]},{icon:(0,C.jsx)(h.nLN,{}),extensions:["jpeg","jpg","gif","tiff","png","heic","dng"]}],U=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e,s=(0,C.jsx)(h.KlI,{});e.endsWith("/")&&(s=(0,C.jsx)(h.kez,{}),n=e.slice(0,-1));const o=e.toLowerCase();for(const a of $)for(const e of a.extensions)o.endsWith(`.${e}`)&&(s=a.icon);!e.endsWith("/")&&e.indexOf(".")<0&&(s=(0,C.jsx)(h.YJK,{}));const i=n.split("/");return t?s:(0,C.jsx)(P,{icon:s,strings:i})};var z=n(37524);const G=e=>{let{metaData:t}=e;const n=Object.keys(t);return(0,C.jsx)(s.Fragment,{children:n.map(((e,n)=>{const s=(e=>Array.isArray(e)?e.map(j.Tw).join(", "):(0,j.Tw)(e))(t[e]);return(0,C.jsxs)(h.azJ,{sx:{marginBottom:15,fontSize:14,maxHeight:180,overflowY:"auto"},children:[(0,C.jsx)("strong",{children:e}),(0,C.jsx)("br",{}),s]},`box-meta-${e}-${n.toString()}`)}))})};var M=n(30718),J=n(85330),K=n(77403);const W=[{value:"01",label:"January"},{value:"02",label:"February"},{value:"03",label:"March"},{value:"04",label:"April"},{value:"05",label:"May"},{value:"06",label:"June"},{value:"07",label:"July"},{value:"08",label:"August"},{value:"09",label:"September"},{value:"10",label:"October"},{value:"11",label:"November"},{value:"12",label:"December"}],H=Array.from(Array(31),((e,t)=>({value:(t+1).toString(),label:(t+1).toString()}))),Y=(new Date).getFullYear(),Z=Array.from(Array(50),((e,t)=>({value:(t+Y).toString(),label:(t+Y).toString()})));var q=n(94141);const Q=(0,s.forwardRef)(((e,t)=>{let{id:n,label:o,disableOptions:i=!1,tooltip:a="",borderBottom:l=!1,onDateChange:r,value:d=""}=e;(0,s.useImperativeHandle)(t,(()=>({resetDate:b})));const[c,u]=(0,s.useState)(""),[m,x]=(0,s.useState)(""),[p,j]=(0,s.useState)("");(0,s.useEffect)((()=>{if(""!==d){const e=d.split("-");j(e[0]),u(e[1]),x(`${parseInt(e[2])}`)}}),[d]),(0,s.useEffect)((()=>{const[e,t]=((e,t,n)=>{const s=Date.parse(`${e}-${t}-${n}`);if(isNaN(s))return[!1,""];const o=parseInt(t),i=parseInt(n),a=`${e}-${o<10?`0${o}`:o}-${i<10?`0${i}`:i}`;return[new Date(s).toISOString().split("T")[0]===a,a]})(p,c,m);r(t,e)}),[c,m,p,r]);const b=()=>{u(""),x(""),j("")},g=()=>i||!1,f=[{value:"",label:""},...W],v=[{value:"",label:""},...H],_=[{value:"",label:""},...Z];return(0,C.jsxs)(h.azJ,{className:"inputItem",children:[(0,C.jsx)(h.azJ,{sx:{display:"flex",alignItems:"center",gap:5,marginBottom:5},children:(0,C.jsxs)(h.l1Y,{htmlFor:n,children:[(0,C.jsx)("span",{children:o}),""!==a&&(0,C.jsx)(h.azJ,{sx:{marginLeft:5,display:"flex",alignItems:"center","& .min-icon":{width:13}},children:(0,C.jsx)(h.m_M,{tooltip:a,placement:"top",children:(0,C.jsx)(h.azJ,{sx:{"& .min-icon":{width:13}},children:(0,C.jsx)(h.NTw,{})})})})]})}),(0,C.jsxs)(h.azJ,{sx:{display:"flex",gap:12},children:[(0,C.jsx)(h.l6P,{id:`${n}-month`,name:`${n}-month`,value:c,onChange:e=>{u(e)},options:f,label:"",disabled:g()}),(0,C.jsx)(h.l6P,{id:`${n}-day`,name:`${n}-day`,value:m,onChange:e=>{x(e)},options:v,label:"",disabled:g()}),(0,C.jsx)(h.l6P,{id:`${n}-year`,name:`${n}-year`,value:p,onChange:e=>{j(e)},options:_,label:"",disabled:g(),sx:{marginBottom:12}})]})]})})),X=e=>{let{open:t,closeModalAndRefresh:n,objectName:i,objectInfo:r,bucketName:d}=e;const c=(0,l.jL)(),u=(0,o.d4)((e=>e.objectBrowser.retentionConfig)),[x,p]=(0,s.useState)(!0),[j,b]=(0,s.useState)(""),[g,f]=(0,s.useState)(""),[v,_]=(0,s.useState)(!1),[S,w]=(0,s.useState)(!1),[T,y]=(0,s.useState)(!1);(0,s.useEffect)((()=>{if(r.retention_mode&&(b((null===u||void 0===u?void 0:u.mode)||J.BT.Governance),y(!0)),r.retention_until_date){const t=new Date(r.retention_until_date);if("Invalid Date"!==t.toString()){const n=t.getFullYear(),s=(e=t.getMonth()+1)<10?`0${e}`:`${e}`,o=t.getDate();isNaN(o)||"NaN"===s||isNaN(n)||f(`${n}-${s}-${o}`)}y(!0)}var e}),[r,null===u||void 0===u?void 0:u.mode]);const E=(0,s.useRef)(null),I=()=>{p(!1),b(J.BT.Governance),E.current&&E.current.resetDate()},A=T&&("governance"===j||""===j);return(0,C.jsx)(q.A,{title:"Set Retention Policy",modalOpen:t,onClose:()=>{I(),n(!1)},children:(0,C.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{(e=>{e.preventDefault()})(e)},children:(0,C.jsxs)(h.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,C.jsxs)(h.azJ,{className:"inputItem",children:[(0,C.jsx)("strong",{children:"Selected Object"}),": ",i]}),A&&(0,C.jsx)(h.dOG,{value:"status",id:"status",name:"status",checked:x,onChange:e=>{p(!x)},label:"Status",indicatorLabels:["Enabled","Disabled"]}),(0,C.jsx)(h.z6M,{currentValue:j,id:"type",name:"type",label:"Type",disableOptions:!x||T&&""!==j,onChange:e=>{b(e.target.value)},selectorOptions:[{label:"Governance",value:J.BT.Governance},{label:"Compliance",value:J.BT.Compliance}]}),(0,C.jsx)(Q,{id:"date",label:"Date",disableOptions:!(x&&("governance"===j||"compliance"===j)),ref:E,value:g,borderBottom:!0,onDateChange:(e,t)=>{_(t),t&&f(e)}}),(0,C.jsxs)(h.xA9,{item:!0,xs:12,sx:K.Uz.modalButtonBar,children:[(0,C.jsx)(h.$nd,{id:"reset",type:"button",variant:"regular",onClick:I,label:"Reset"}),(0,C.jsx)(h.$nd,{id:"save",type:"submit",variant:"callAction",disabled:x&&""===j||x&&!v||S,onClick:()=>{w(!0);const e=r.name||"",t=r.version_id||null;x||"governance"!==j?((e,t,s)=>{a.F.buckets.putObjectRetention(d,{prefix:e,version_id:t||""},{expires:s,mode:j}).then((()=>{w(!1),n(!0)})).catch((e=>{c((0,O.Dy)((0,m.S)(e.error))),w(!1)}))})(e,t,x||"governance"!==j?`${g}T23:59:59Z`:""):((e,t)=>{a.F.buckets.deleteObjectRetention(d,{prefix:e,version_id:t||""}).then((()=>{w(!1),n(!0)})).catch((e=>{c((0,O.Dy)((0,m.S)(e.error))),w(!1)}))})(e,t)},label:"Save"})]})]})})})};var ee=n(58661),te=n(25448);const ne=e=>{let{closeDeleteModalAndRefresh:t,deleteOpen:n,selectedBucket:i,selectedObject:a,versioningInfo:d,selectedVersion:c=""}=e;const u=(0,l.jL)(),[m,x]=(0,te.A)((()=>t(!0)),(e=>{u((0,O.C9)(e)),"Access Denied."===e.detailedError&&t(!0)})),[p,j]=(0,s.useState)(!1),[b,g]=(0,s.useState)(!1),f=(0,o.d4)((e=>e.objectBrowser.retentionConfig)),v=(0,_._)([i],[r.OV.S3_BYPASS_GOVERNANCE_RETENTION])&&"governance"===(null===f||void 0===f?void 0:f.mode);if(!a)return null;return(0,C.jsx)(ee.A,{title:"Delete Object",confirmText:"Delete",isOpen:n,titleIcon:(0,C.jsx)(h.xWY,{}),isLoading:m,onConfirm:()=>{const e=a.endsWith("/");x("DELETE",`/api/v1/buckets/${encodeURIComponent(i)}/objects?prefix=${encodeURIComponent(a)}${""!==c?`&version_id=${encodeURIComponent(c)}`:`&recursive=${e}&all_versions=${p}`}${b?"&bypass=true":""}`)},onClose:()=>t(!1),confirmationContent:(0,C.jsxs)(s.Fragment,{children:["Are you sure you want to delete: ",(0,C.jsx)("br",{}),(0,C.jsx)("b",{children:a})," ",""!==c?(0,C.jsxs)(s.Fragment,{children:[(0,C.jsx)("br",{}),(0,C.jsx)("br",{}),"Version ID:",(0,C.jsx)("br",{}),(0,C.jsx)("strong",{children:c})]}):"","? ",(0,C.jsx)("br",{}),(0,C.jsx)("br",{}),N(null===d||void 0===d?void 0:d.status)&&""===c&&(0,C.jsx)(s.Fragment,{children:(0,C.jsx)(h.dOG,{label:"Delete All Versions",indicatorLabels:["Yes","No"],checked:p,value:"delete_versions",id:"delete-versions",name:"delete-versions",onChange:e=>{j(!p)},description:""})}),v&&(p||""!==c)&&(0,C.jsx)(s.Fragment,{children:(0,C.jsx)("div",{style:{marginTop:10},children:(0,C.jsx)(h.dOG,{label:"Bypass Governance Mode",indicatorLabels:["Yes","No"],checked:b,value:"bypass_governance",id:"bypass_governance",name:"bypass_governance",onChange:e=>{g(!b)},description:""})})}),p&&(0,C.jsxs)(s.Fragment,{children:[(0,C.jsxs)("div",{style:{marginTop:10,border:"#c83b51 1px solid",borderRadius:3,padding:5,backgroundColor:"#c83b5120",color:"#c83b51"},children:["This will remove the object as well as all of its versions,"," ",(0,C.jsx)("br",{}),"This action is irreversible."]}),(0,C.jsx)("br",{}),"Are you sure you want to continue?"]})]})})},se=e=>{let{open:t,closeModalAndRefresh:n,objectName:o,bucketName:i,actualInfo:r}=e;const d=(0,l.jL)(),[c,x]=(0,s.useState)(!1),[p,j]=(0,s.useState)(!1),b=r.version_id;(0,s.useEffect)((()=>{const e=u()(r,"legal_hold_status","OFF");x("ON"===e)}),[r]);const g=()=>{x(!1)};return(0,C.jsx)(q.A,{title:"Set Legal Hold",modalOpen:t,onClose:()=>{g(),n(!1)},children:(0,C.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{(e=>{e.preventDefault(),j(!0),a.F.buckets.putObjectLegalHold(i,{prefix:o,version_id:b||""},{status:c?J.SW.Enabled:J.SW.Disabled}).then((()=>{j(!1),n(!0)})).catch((e=>{d((0,O.Dy)((0,m.S)(e.error))),j(!1)}))})(e)},children:(0,C.jsxs)(h.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,C.jsxs)(h.azJ,{className:"inputItem",children:[(0,C.jsx)("strong",{children:"Object"}),": ",i+"/"+o]}),(0,C.jsx)(h.dOG,{value:"legalhold",id:"legalhold",name:"legalhold",checked:c,onChange:e=>{x(!c)},label:"Legal Hold Status",indicatorLabels:["Enabled","Disabled"],tooltip:"To enable this feature you need to enable versioning on the bucket before creation"}),(0,C.jsxs)(h.xA9,{item:!0,xs:12,sx:K.Uz.modalButtonBar,children:[(0,C.jsx)(h.$nd,{id:"clear",type:"button",variant:"regular",onClick:g,label:"Clear"}),(0,C.jsx)(h.$nd,{id:"save",type:"submit",variant:"callAction",disabled:p,label:" Save"})]})]})})})},oe=f.Ay.b((e=>{let{theme:t}=e;return{color:u()(t,"signalColors.danger","#C83B51"),marginLeft:5}})),ie=e=>{var t;let{modalOpen:n,onCloseAndUpdate:i,bucketName:d,actualInfo:c}=e;const x=(0,l.jL)(),p=(0,o.d4)(O.Rq),[j,b]=(0,s.useState)(""),[g,f]=(0,s.useState)(""),[v,S]=(0,s.useState)(!1),[w,T]=(0,s.useState)(!1),[y,E]=(0,s.useState)(""),[I,A]=(0,s.useState)(""),N=c.tags,k=Object.keys(N||{}),B=null===(t=c.name)||void 0===t?void 0:t.split("/"),F=(null===B||void 0===B?void 0:B.pop())||"",L=e=>(0,C.jsxs)(h.azJ,{sx:{fontSize:16,margin:"20px 0 30px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%"},children:["Tag",e?"s":""," for: ",(0,C.jsx)("strong",{children:F})]});return(0,C.jsx)(s.Fragment,{children:(0,C.jsx)(q.A,{modalOpen:n,title:w?"Delete Tag":"Edit Tags",onClose:()=>{i(!0)},iconColor:w?"delete":"default",titleIcon:w?(0,C.jsx)(h.aaC,{}):(0,C.jsx)(h.cGQ,{}),children:w?(0,C.jsx)(s.Fragment,{children:(0,C.jsxs)(h.xA9,{container:!0,children:[L(!1),"Are you sure you want to delete the tag"," ",(0,C.jsxs)(oe,{children:[y," : ",I]})," ","?",(0,C.jsxs)(h.xA9,{item:!0,xs:12,sx:K.Uz.modalButtonBar,children:[(0,C.jsx)(h.$nd,{id:"cancel",type:"button",variant:"regular",onClick:()=>{E(""),A(""),T(!1)},label:"Cancel"}),(0,C.jsx)(h.$nd,{type:"submit",variant:"secondary",onClick:()=>{const e={...N};delete e[y];const t=p?c.version_id||"":"null";a.F.buckets.putObjectTags(d,{prefix:c.name||"",version_id:t},{tags:e}).then((()=>{i(!0),S(!1)})).catch((e=>{x((0,O.Dy)((0,m.S)(e.error))),S(!1)}))},id:"deleteTag",label:"Delete Tag"})]})]})}):(0,C.jsxs)(h.azJ,{children:[(0,C.jsx)(_.R,{scopes:[r.OV.S3_GET_OBJECT_TAGGING,r.OV.S3_GET_ACTIONS],resource:d,children:(0,C.jsxs)(h.azJ,{sx:{display:"flex",flexFlow:"column",width:"100%"},children:[L(!0),(0,C.jsxs)(h.azJ,{sx:{fontSize:14,fontWeight:"normal"},children:["Current Tags:",(0,C.jsx)("br",{}),0===k.length?(0,C.jsx)("span",{className:"muted",children:"There are no tags for this object"}):(0,C.jsx)(s.Fragment,{}),(0,C.jsx)(h.azJ,{sx:{marginTop:"5px",marginBottom:"15px"},children:k.map(((e,t)=>{const n=u()(N,`${e}`,"");return""!==n?(0,C.jsx)(_.R,{scopes:[r.OV.S3_DELETE_OBJECT_TAGGING],resource:d,errorProps:{deleteIcon:null,onDelete:null},children:(0,C.jsx)(h.vwO,{id:`${e} : ${n}`,label:`${e} : ${n}`,variant:"regular",color:"default",onDelete:()=>{((e,t)=>{E(e),A(t),T(!0)})(e,n)}})},`chip-${t}`):null}))})]})]})}),(0,C.jsx)(_.R,{scopes:[r.OV.S3_PUT_OBJECT_TAGGING,r.OV.S3_PUT_ACTIONS],resource:d,errorProps:{disabled:!0,onClick:null},children:(0,C.jsxs)(h.azJ,{children:[(0,C.jsx)(h._xt,{icon:(0,C.jsx)(h.b_$,{}),separator:!1,children:"Add New Tag"}),(0,C.jsxs)(h.Hbc,{containerPadding:!1,withBorders:!1,children:[(0,C.jsx)(h.cl_,{value:j,label:"Tag Key",id:"newTagKey",name:"newTagKey",placeholder:"Enter Tag Key",onChange:e=>{b(e.target.value)}}),(0,C.jsx)(h.cl_,{value:g,label:"Tag Label",id:"newTagLabel",name:"newTagLabel",placeholder:"Enter Tag Label",onChange:e=>{f(e.target.value)}}),(0,C.jsxs)(h.xA9,{item:!0,xs:12,sx:K.Uz.modalButtonBar,children:[(0,C.jsx)(h.$nd,{id:"clear",type:"button",variant:"regular",color:"primary",onClick:()=>{f(""),b("")},label:"Clear"}),(0,C.jsx)(h.$nd,{type:"submit",variant:"callAction",disabled:""===g.trim()||""===j.trim()||v,onClick:()=>{S(!0);const e={};e[j]=g;const t={...N,...e},n=p?c.version_id||"":"null";a.F.buckets.putObjectTags(d,{prefix:c.name||"",version_id:n},{tags:t}).then((()=>{i(!0),S(!1)})).catch((e=>{x((0,O.Dy)((0,m.S)(e.error))),S(!1)}))},id:"saveTag",label:"Save"})]})]})]})})]})})})},ae=e=>{let{value:t}=e;const[n,o]=(0,s.useState)(!1);return(0,C.jsxs)(h.azJ,{sx:{display:"flex",alignItems:"center",flexFlow:"row",[`@media (max-width: ${h.nmC.sm}px)`]:{flexFlow:"column"}},children:[(0,C.jsx)(h.cl_,{id:"inspect-dec-key",name:"inspect-dec-key",placeholder:"",label:"",type:n?"text":"password",onChange:()=>{},value:t,overlayIcon:(0,C.jsx)(h.TdU,{}),readOnly:!0,overlayAction:()=>navigator.clipboard.writeText(t)}),(0,C.jsx)(h.$nd,{id:"show-hide-key",style:{marginLeft:"10px"},variant:"callAction",onClick:()=>o(!n),label:"Show/Hide"})]})},le=e=>{let{closeInspectModalAndRefresh:t,inspectOpen:n,inspectPath:o,volumeName:i}=e;const a=(0,l.jL)(),r=()=>t(!1),[d,c]=(0,s.useState)(!0),[u,m]=(0,s.useState)(""),[x,p]=(0,s.useState)("");if(!o)return null;return(0,C.jsxs)(s.Fragment,{children:[!u&&(0,C.jsx)(q.A,{modalOpen:n,titleIcon:(0,C.jsx)(h.nTF,{}),title:"Inspect Object",onClose:r,children:(0,C.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{(e=>{e.preventDefault()})(e)},children:["Would you like to encrypt ",(0,C.jsx)("b",{children:o}),"? ",(0,C.jsx)("br",{}),(0,C.jsx)(h.dOG,{label:"Encrypt",indicatorLabels:["Yes","No"],checked:d,value:"encrypt",id:"encrypt",name:"encrypt",onChange:e=>{c(!d)},description:""}),(0,C.jsx)(h.xA9,{item:!0,xs:12,sx:K.Uz.modalButtonBar,children:(0,C.jsx)(h.$nd,{id:"inspect",type:"submit",variant:"callAction",color:"primary",onClick:async()=>{let e=document.baseURI.replace(window.location.origin,"");(async e=>await fetch(e,{method:"GET"}))(`${window.location.origin}${e}/api/v1/admin/inspect?volume=${encodeURIComponent(i)}&file=${encodeURIComponent(o+"/xl.meta")}&encrypt=${d}`).then((async e=>{if(!e.ok){const t=await e.json();a((0,O.C9)({errorMessage:t.message,detailedError:t.code}))}const t=await e.blob(),n=e.headers.get("content-disposition").split('"')[1],s=(0,j.UM)(n)||"";(0,j.OT)(t,n),p(n),""!==s?m(s):r()})).catch((e=>{a((0,O.C9)(e))}))},label:"Inspect"})})]})}),u?(0,C.jsxs)(q.A,{modalOpen:n,title:"Inspect Decryption Key",onClose:()=>{(0,j.Yj)(x),r(),m("")},titleIcon:(0,C.jsx)(h.aJN,{}),children:[(0,C.jsxs)(h.azJ,{children:["This will be displayed only once. It cannot be recovered.",(0,C.jsx)("br",{}),"Use secure medium to share this key."]}),(0,C.jsx)(h.azJ,{children:(0,C.jsx)(ae,{value:u})})]}):null]})},re=e=>{let{open:t,closeModal:n,currentItem:o,internalPaths:i,actualInfo:a,bucketName:r}=e;const d=(0,l.jL)(),[c,u]=(0,s.useState)(o),[m,x]=(0,s.useState)(!1);return(0,C.jsxs)(q.A,{title:"Rename Download",modalOpen:t,onClose:n,titleIcon:(0,C.jsx)(h.qUP,{}),children:[(0,C.jsxs)("div",{children:["The file you are trying to download has a long name.",(0,C.jsx)("br",{}),"This can cause issues on Windows Systems by trimming the file name after download.",(0,C.jsx)("br",{}),(0,C.jsx)("br",{})," We recommend to rename the file download"]}),(0,C.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{(e=>{e.preventDefault(),(0,R._)(d,r,i,a),n()})(e)},children:(0,C.jsxs)(h.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,C.jsx)(h.cl_,{id:"download-filename",name:"download-filename",onChange:e=>{u(e.target.value)},label:"",type:"text",value:c,error:c.length>200&&!m?"Filename should be less than 200 characters long.":""}),(0,C.jsx)(h.dOG,{value:"acceptLongName",id:"acceptLongName",name:"acceptLongName",checked:m,onChange:e=>{x(e.target.checked),e.target.checked&&u(o)},label:"Use Original Name"}),(0,C.jsx)(h.xA9,{item:!0,xs:12,sx:K.Uz.modalButtonBar,children:(0,C.jsx)(h.$nd,{id:"download-file",type:"submit",variant:"callAction",color:"primary",disabled:c.length>200&&!m,label:"Download File"})})]})})]})},de={is_latest:!0,last_modified:"",legal_hold_status:"",name:"",retention_mode:"",retention_until_date:"",size:0,tags:{},version_id:void 0},ce=e=>{let{internalPaths:t,bucketName:n,versioningInfo:i,locking:c,onClosePanel:m}=e;const x=(0,l.jL)(),p=(0,o.d4)(O.Rq),b=(0,o.d4)((e=>e.objectBrowser.versionsMode)),g=(0,o.d4)((e=>e.objectBrowser.selectedVersion)),f=(0,o.d4)((e=>e.objectBrowser.loadingObjectInfo)),[v,S]=(0,s.useState)(!1),[w,T]=(0,s.useState)(!1),[y,E]=(0,s.useState)(!1),[I,N]=(0,s.useState)(!1),[k,B]=(0,s.useState)(!1),[F,V]=(0,s.useState)(null),[D,P]=(0,s.useState)([]),[$,J]=(0,s.useState)(null),[K,W]=(0,s.useState)([]),[H,Y]=(0,s.useState)(!1),[Z,q]=(0,s.useState)(!1),[Q,ee]=(0,s.useState)(0),[te,oe]=(0,s.useState)(!1),[ae,ce]=(0,s.useState)(null),[ue,he]=(0,s.useState)(!1),me=(t||"").split("/").pop()||"";let xe=[];F&&F.name&&(xe=F.name.split("/")),(0,s.useEffect)((()=>{if(p&&D&&D.length>=1){let e=D.find((e=>e.is_latest))||de;""!==g&&(e=D.find((e=>e.version_id===g))||de),e.is_delete_marker||he(!0),V(e)}}),[g,p,D]),(0,s.useEffect)((()=>{f&&""!==t&&a.F.buckets.listObjects(n,{prefix:t,with_versions:p}).then((e=>{const t=e.data.objects||[];if(p){P(t),W(t);const e=t.reduce(((e,t)=>null!==t&&void 0!==t&&t.size?e+t.size:e),0);ee(e)}else{const e=t[0];V(e),W([]),e.is_delete_marker||he(!0)}x((0,d.oe)(!1))})).catch((e=>{console.error("Error loading object details",e.error),x((0,d.oe)(!1))}))}),[f,n,t,x,p,g]),(0,s.useEffect)((()=>{ue&&""!==t&&a.F.buckets.getObjectMetadata(n,{prefix:t,versionID:(null===F||void 0===F?void 0:F.version_id)||""}).then((e=>{let t=u()(e.data,"objectMetadata",{});ce(t),he(!1)})).catch((e=>{console.error("Error Getting Metadata Status: ",e.detailedError),he(!1)}))}),[n,t,ue,null===F||void 0===F?void 0:F.version_id]);let pe=[];F&&F.tags&&(pe=Object.keys(F.tags));const je=(0,C.jsx)("div",{style:{textAlign:"center",marginTop:35},children:(0,C.jsx)(h.aHM,{})});if(!F)return f?je:null;const be=xe.length>0?xe[xe.length-1]:F.name,ge=[n,me,[n,F.name].join("/")],fe=(0,_._)(n,[r.OV.S3_PUT_OBJECT_LEGAL_HOLD,r.OV.S3_PUT_ACTIONS]),ve=(0,_._)(ge,[r.OV.S3_PUT_OBJECT_TAGGING,r.OV.S3_PUT_ACTIONS]),_e=(0,_._)(ge,[r.OV.S3_GET_OBJECT_RETENTION,r.OV.S3_PUT_OBJECT_RETENTION,r.OV.S3_GET_ACTIONS,r.OV.S3_PUT_ACTIONS],!0),Se=(0,_._)(ge,[r.OV.ADMIN_INSPECT_DATA]),Oe=(0,_._)(ge,[r.OV.S3_GET_BUCKET_VERSIONING,r.OV.S3_PUT_BUCKET_VERSIONING,r.OV.S3_GET_OBJECT_VERSION,r.OV.S3_GET_ACTIONS,r.OV.S3_PUT_ACTIONS]),we=(0,_._)(ge,[r.OV.S3_GET_OBJECT,r.OV.S3_GET_ACTIONS]),Te=(0,_._)([n,me,[n,F.name].join("/")],[r.OV.S3_DELETE_OBJECT]);let Ce=(0,A.IZ)(ae,me);const ye=[{action:()=>{(0,R._)(x,n,t,F)},label:"Download",disabled:!!F.is_delete_marker||!we,icon:(0,C.jsx)(h.s3U,{}),tooltip:we?"Download this Object":(0,r.vj)([r.OV.S3_GET_OBJECT,r.OV.S3_GET_ACTIONS],"download this object")},{action:()=>{S(!0)},label:"Share",disabled:!!F.is_delete_marker||!we,icon:(0,C.jsx)(h.liv,{}),tooltip:we?"Share this File":(0,r.vj)([r.OV.S3_GET_OBJECT,r.OV.S3_GET_ACTIONS],"share this object")},{action:()=>{q(!0)},label:"Preview",disabled:!!F.is_delete_marker||"none"===Ce&&!we,icon:(0,C.jsx)(h.cyn,{}),tooltip:we?"Preview this File":(0,r.vj)([r.OV.S3_GET_OBJECT,r.OV.S3_GET_ACTIONS],"preview this object")},{action:()=>{N(!0)},label:"Legal Hold",disabled:!c||!p||!!F.is_delete_marker||!fe||""!==g,icon:(0,C.jsx)(h.ODz,{}),tooltip:fe?c?"Change Legal Hold rules for this File":"Object Locking must be enabled on this bucket in order to set Legal Hold":(0,r.vj)([r.OV.S3_PUT_OBJECT_LEGAL_HOLD,r.OV.S3_PUT_ACTIONS],"change legal hold settings for this object")},{action:()=>{T(!0)},label:"Retention",disabled:!p||!!F.is_delete_marker||!_e||""!==g||!c,icon:(0,C.jsx)(h.gn6,{}),tooltip:_e?c?"Change Retention rules for this File":"Object Locking must be enabled on this bucket in order to set Retention Rules":(0,r.vj)([r.OV.S3_GET_OBJECT_RETENTION,r.OV.S3_PUT_OBJECT_RETENTION,r.OV.S3_GET_ACTIONS,r.OV.S3_PUT_ACTIONS],"change Retention Rules for this object")},{action:()=>{E(!0)},label:"Tags",disabled:!!F.is_delete_marker||""!==g||!ve,icon:(0,C.jsx)(h.P3Z,{}),tooltip:ve?"Change Tags for this File":(0,r.vj)([r.OV.S3_PUT_OBJECT_TAGGING,r.OV.S3_GET_OBJECT_TAGGING,r.OV.S3_GET_ACTIONS,r.OV.S3_PUT_ACTIONS],"set Tags on this object")},{action:()=>{B(!0)},label:"Inspect",disabled:!p||!!F.is_delete_marker||""!==g||!Se,icon:(0,C.jsx)(h.nTF,{}),tooltip:Se?"Inspect this file":(0,r.vj)([r.OV.ADMIN_INSPECT_DATA],"inspect this file")},{action:()=>{x((0,d.cQ)({status:!b,objectName:be}))},label:b?"Hide Object Versions":"Display Object Versions",icon:(0,C.jsx)(h.j1U,{}),disabled:!p||!(F.version_id&&"null"!==F.version_id)||!Oe,tooltip:Oe?F.version_id&&"null"!==F.version_id?"Display Versions for this file":"":(0,r.vj)([r.OV.S3_GET_BUCKET_VERSIONING,r.OV.S3_PUT_BUCKET_VERSIONING,r.OV.S3_GET_OBJECT_VERSION,r.OV.S3_GET_ACTIONS,r.OV.S3_PUT_ACTIONS],"display all versions of this object")}];return(0,C.jsxs)(s.Fragment,{children:[v&&F&&(0,C.jsx)(M.default,{open:v,closeModalAndRefresh:()=>{J(null),S(!1)},bucketName:n,dataObject:$||F}),w&&F&&(0,C.jsx)(X,{open:w,closeModalAndRefresh:e=>{T(!1),e&&x((0,d.oe)(!0))},objectName:me,objectInfo:F,bucketName:n}),H&&(0,C.jsx)(ne,{deleteOpen:H,selectedBucket:n,selectedObject:t,closeDeleteModalAndRefresh:e=>{Y(!1),e&&""===g?m(!0):(x((0,d.SK)(!0)),x((0,d.Ai)("")),x((0,d.oe)(!0)))},versioningInfo:p?i:void 0,selectedVersion:g}),I&&F&&(0,C.jsx)(se,{open:I,closeModalAndRefresh:e=>{N(!1),e&&x((0,d.oe)(!0))},objectName:F.name||"",bucketName:n,actualInfo:F}),Z&&F&&(0,C.jsx)(z.default,{open:Z,bucketName:n,actualInfo:F,onClosePreview:()=>{q(!1)}}),y&&F&&(0,C.jsx)(ie,{modalOpen:y,bucketName:n,actualInfo:F,onCloseAndUpdate:e=>{E(!1),e&&x((0,d.oe)(!0))}}),k&&F&&(0,C.jsx)(le,{inspectOpen:k,volumeName:n,inspectPath:F.name||"",closeInspectModalAndRefresh:e=>{B(!1),e&&x((0,d.oe)(!0))}}),te&&F&&(0,C.jsx)(re,{open:te,closeModal:()=>{oe(!1)},currentItem:me,bucketName:n,internalPaths:t,actualInfo:F}),f?(0,C.jsx)(s.Fragment,{children:je}):(0,C.jsxs)(h.azJ,{sx:{"& .ObjectDetailsTitle":{display:"flex",alignItems:"center","& .min-icon":{width:26,height:26,minWidth:26,minHeight:26}},"& .objectNameContainer":{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",alignItems:"center",marginLeft:10},"& .capitalizeFirst":{textTransform:"capitalize"},"& .detailContainer":{padding:"0 22px",marginBottom:10,fontSize:14}},children:[(0,C.jsx)(h.Smc,{title:(0,C.jsxs)("div",{className:"ObjectDetailsTitle",children:[U(be||"",!0),(0,C.jsx)("span",{className:"objectNameContainer",children:be})]}),items:ye}),(0,C.jsx)(L.A,{tooltip:Te?"":(0,r.vj)([r.OV.S3_DELETE_OBJECT],"delete this object"),children:(0,C.jsx)(h.xA9,{item:!0,xs:12,sx:{justifyContent:"center",display:"flex"},children:(0,C.jsx)(_.R,{resource:[n,me,[n,F.name].join("/")],scopes:[r.OV.S3_DELETE_OBJECT],errorProps:{disabled:!0},children:(0,C.jsx)(h.$nd,{id:"delete-element-click",icon:(0,C.jsx)(h.d7y,{}),iconLocation:"start",fullWidth:!0,variant:"secondary",onClick:()=>{Y(!0)},disabled:""===g&&F.is_delete_marker,sx:{width:"calc(100% - 44px)",margin:"8px 0"},label:"Delete"+(""!==g?" version":"")})})})}),(0,C.jsx)(h.kCK,{icon:(0,C.jsx)(h.Hch,{}),label:"Object Info"}),(0,C.jsxs)(h.azJ,{className:"detailContainer",children:[(0,C.jsx)("strong",{children:"Name:"}),(0,C.jsx)("br",{}),(0,C.jsx)("div",{style:{overflowWrap:"break-word"},children:be})]}),""!==g&&(0,C.jsxs)(h.azJ,{className:"detailContainer",children:[(0,C.jsx)("strong",{children:"Version ID:"}),(0,C.jsx)("br",{}),g]}),(0,C.jsxs)(h.azJ,{className:"detailContainer",children:[(0,C.jsx)("strong",{children:"Size:"}),(0,C.jsx)("br",{}),(0,j.nO)(`${F.size||"0"}`)]}),F.version_id&&"null"!==F.version_id&&""===g&&(0,C.jsxs)(h.azJ,{className:"detailContainer",children:[(0,C.jsx)("strong",{children:"Versions:"}),(0,C.jsx)("br",{}),K.length," version",1!==K.length?"s":"",","," ",(0,j.qO)(Q)]}),""===g&&(0,C.jsxs)(h.azJ,{className:"detailContainer",children:[(0,C.jsx)("strong",{children:"Last Modified:"}),(0,C.jsx)("br",{}),(e=>{const t=new Date,n=new Date(e),s=t.getTime()-n.getTime(),o=(0,j.eQ)(s,"ms");return""!==o.trim()?`${o} ago`:"Just now"})(F.last_modified||"")]}),(0,C.jsxs)(h.azJ,{className:"detailContainer",children:[(0,C.jsx)("strong",{children:"ETAG:"}),(0,C.jsx)("br",{}),F.etag||"N/A"]}),(0,C.jsxs)(h.azJ,{className:"detailContainer",children:[(0,C.jsx)("strong",{children:"Tags:"}),(0,C.jsx)("br",{}),0===pe.length?"N/A":pe.map(((e,t)=>(0,C.jsxs)("span",{children:[e,":",u()(F,`tags.${e}`,""),t{let{versionToRestore:t,bucketName:n,objectPath:o,restoreOpen:i,onCloseAndUpdate:r}=e;const c=(0,l.jL)(),[u,x]=(0,s.useState)(!1);return(0,C.jsx)(ee.A,{title:"Restore File Version",confirmText:"Restore",isOpen:i,isLoading:u,titleIcon:(0,C.jsx)(h.YkU,{}),onConfirm:()=>{x(!0),a.F.buckets.putObjectRestore(n,{prefix:o,version_id:t.version_id||""}).then((()=>{x(!1),r(!0),c((0,d.NV)({prefix:o,objectInfo:t}))})).catch((e=>{c((0,O.C9)((0,m.S)(e.error))),x(!1)}))},confirmButtonProps:{variant:"secondary",disabled:u},onClose:()=>{r(!1)},confirmationContent:(0,C.jsxs)(h.azJ,{id:"alert-dialog-description",children:["Are you sure you want to restore ",(0,C.jsx)("br",{}),(0,C.jsx)("b",{children:o})," ",(0,C.jsx)("br",{})," with Version ID:",(0,C.jsx)("br",{}),(0,C.jsx)("b",{children:t.version_id}),"?"]})})},he=e=>{let{type:t}=e,n="#000",s="";switch(t){case"null":n="#07193E",s="NULL VERSION";break;case"deleted":n="#868686",s="DELETED";break;default:n="#174551",s="CURRENT VERSION"}return(0,C.jsx)("span",{style:{backgroundColor:n,padding:"0 5px",display:"inline-block",color:"#FFF",fontWeight:"bold",fontSize:12,borderRadius:2,whiteSpace:"nowrap",margin:"0 10px"},children:s})},me=f.Ay.div((e=>{let{theme:t}=e;return{"&:before":{content:"' '",display:"block",position:"absolute",width:"2px",height:"calc(100% + 2px)",backgroundColor:u()(t,"borderColor","#F8F8F8"),left:"24px"},"& .mainFileVersionItem":{borderBottom:`${u()(t,"borderColor","#F8F8F8")} 1px solid`,padding:"1rem 0",margin:"0 0.5rem 0 2.5rem",cursor:"pointer","&.deleted":{color:"#868686"}},"& .intermediateLayer":{margin:"0 1.5rem 0 1.5rem","&:hover, &.selected":{backgroundColor:u()(t,"boxBackground","#F8F8F8"),"& > div":{borderBottomColor:u()(t,"boxBackground","#F8F8F8")}}},"& .versionContainer":{fontSize:16,fontWeight:"bold",display:"flex",alignItems:"center","& svg.min-icon":{width:18,height:18,minWidth:18,minHeight:18,marginRight:10}},"& .buttonContainer":{textAlign:"right","& button":{marginLeft:"1.5rem"}},"& .versionID":{fontSize:"12px",margin:"2px 0",whiteSpace:"nowrap",textOverflow:"ellipsis",maxWidth:"95%",overflow:"hidden"},"& .versionData":{marginRight:"10px",fontSize:12,color:"#868686"},"@media (max-width: 600px)":{"& .buttonContainer":{"& button":{marginLeft:"5px"}}},"@media (max-width: 799px)":{"&:before":{display:"none"},"& .mainFileVersionItem":{padding:"5px 0px",margin:0},"& .intermediateLayer":{margin:0,"&:hover, &.selected":{backgroundColor:"transparent","& > div":{borderBottomColor:u()(t,"boxBackground","#F8F8F8")}}},"& .versionContainer":{fontSize:14,"& svg.min-icon":{display:"none"}},"& .versionData":{textOverflow:"ellipsis",maxWidth:"95%",overflow:"hidden",whiteSpace:"nowrap"},"& .collapsableInfo":{display:"flex",flexDirection:"column"},"& .versionItem":{display:"none"}}}})),xe=e=>{let{fileName:t,versionInfo:n,isSelected:s,checkable:o,isChecked:i,onCheck:a,onShare:l,onDownload:r,onRestore:d,onPreview:c,globalClick:u,index:m,key:x,style:b}=e;const g=n.is_delete_marker,f=[{icon:(0,C.jsx)(h.cyn,{}),action:c,tooltip:"Preview"},{icon:(0,C.jsx)(h.s3U,{}),action:r,tooltip:"Download this version"},{icon:(0,C.jsx)(h.liv,{}),action:l,tooltip:"Share this version"},{icon:(0,C.jsx)(h.YkU,{}),action:d,tooltip:"Restore this version"}];let v=null;n.is_delete_marker?v="deleted":n.is_latest?v="current":"null"===n.version_id&&(v="null");let _=p.c9.now();return n.last_modified&&(_=p.c9.fromISO(n.last_modified)),(0,C.jsx)(me,{children:(0,C.jsx)(h.xA9,{container:!0,className:"ctrItem",onClick:()=>{u(n)},style:b,children:(0,C.jsx)(h.xA9,{item:!0,xs:12,className:"intermediateLayer "+(s?"selected":""),children:(0,C.jsxs)(h.xA9,{item:!0,xs:!0,className:"mainFileVersionItem "+(n.is_delete_marker?"deleted":""),children:[(0,C.jsx)(h.xA9,{item:!0,xs:12,children:(0,C.jsxs)(h.xA9,{container:!0,children:[(0,C.jsxs)(h.xA9,{item:!0,xs:!0,md:4,className:"versionContainer",children:[o&&(0,C.jsx)(h.Sc0,{checked:i,id:`select-${n.version_id}`,name:`select-${n.version_id}`,onChange:e=>{e.stopPropagation(),a(n.version_id||"")},value:n.version_id||"",disabled:n.is_delete_marker,sx:{width:"initial"}}),U(t,!0)," v",m.toString(),(0,C.jsx)("span",{className:"versionItem",children:v&&(0,C.jsx)(he,{type:v})})]}),(0,C.jsx)(h.xA9,{item:!0,xs:10,md:8,className:"buttonContainer",children:f.map(((e,t)=>(0,C.jsx)(h.m_M,{tooltip:e.tooltip,children:(0,C.jsx)(h.K0,{size:"small",id:`version-action-${e.tooltip}-${t.toString()}`,className:"spacing "+(g?"buttonDisabled":""),disabled:g,onClick:t=>{t.stopPropagation(),g?t.preventDefault():e.action(n)},sx:{backgroundColor:"#F8F8F8",borderRadius:"100%",width:"28px",height:"28px",padding:"5px","& .min-icon":{width:"14px",height:"14px"}},children:e.icon})},`version-action-${e.tooltip}-${t.toString()}`)))})]})}),(0,C.jsx)(h.xA9,{item:!0,xs:12,className:"versionID",children:"null"!==n.version_id?n.version_id:"-"}),(0,C.jsxs)(h.xA9,{item:!0,xs:12,className:"collapsableInfo",children:[(0,C.jsxs)("span",{className:"versionData",children:[(0,C.jsx)("strong",{children:"Last modified:"})," ",_.toFormat("ccc, LLL dd yyyy HH:mm:ss (ZZZZ)")]}),(0,C.jsxs)("span",{className:"versionData",children:[(0,C.jsx)("strong",{children:"Size:"})," ",(0,j.nO)(`${n.size||"0"}`)]})]})]})})},x)})},pe=e=>{let{closeDeleteModalAndRefresh:t,deleteOpen:n,selectedBucket:i,selectedObject:d}=e;const c=(0,l.jL)(),[u,x]=(0,s.useState)(!1),[p,j]=(0,s.useState)(""),[b,g]=(0,s.useState)(!1),f=(0,o.d4)((e=>e.objectBrowser.retentionConfig)),v=(0,_._)([i],[r.OV.S3_BYPASS_GOVERNANCE_RETENTION])&&"governance"===(null===f||void 0===f?void 0:f.mode);if((0,s.useEffect)((()=>{u&&a.F.buckets.deleteObject(i,{prefix:d,non_current_versions:!0,bypass:b}).then((()=>{t(!0)})).catch((e=>{c((0,O.C9)((0,m.S)(e.error))),x(!1)}))}),[u,t,c,d,i,b]),!d)return null;return(0,C.jsx)(ee.A,{title:"Delete Non-Current versions",confirmText:"Delete",isOpen:n,titleIcon:(0,C.jsx)(h.xWY,{}),isLoading:u,onConfirm:()=>{x(!0)},onClose:()=>t(!1),confirmButtonProps:{disabled:"YES, PROCEED"!==p||u},confirmationContent:(0,C.jsxs)(s.Fragment,{children:["Are you sure you want to delete all the non-current versions for:"," ",(0,C.jsx)("b",{children:d}),"? ",(0,C.jsx)("br",{}),v&&(0,C.jsx)(s.Fragment,{children:(0,C.jsx)("div",{style:{marginTop:10},children:(0,C.jsx)(h.dOG,{label:"Bypass Governance Mode",indicatorLabels:["Yes","No"],checked:b,value:"bypass_governance",id:"bypass_governance",name:"bypass_governance",onChange:e=>{g(!b)},description:""})})}),(0,C.jsx)("br",{}),"To continue please type ",(0,C.jsx)("b",{children:"YES, PROCEED"})," in the box.",(0,C.jsx)("br",{}),(0,C.jsx)("br",{}),(0,C.jsx)(h.xA9,{item:!0,xs:12,children:(0,C.jsx)(h.cl_,{id:"type-confirm",name:"retype-tenant",onChange:e=>{j(e.target.value)},label:"",value:p})})]})})},je=e=>{let{closeDeleteModalAndRefresh:t,deleteOpen:n,selectedBucket:i,selectedVersions:d,selectedObject:c}=e;const u=(0,l.jL)(),[x,p]=(0,s.useState)(!1),[j,b]=(0,s.useState)(!1),g=(0,o.d4)((e=>e.objectBrowser.retentionConfig)),f=(0,_._)([i],[r.OV.S3_BYPASS_GOVERNANCE_RETENTION])&&"governance"===(null===g||void 0===g?void 0:g.mode);return(0,s.useEffect)((()=>{if(x){const e=d.map((e=>({path:c,versionID:e,recursive:!1})));e.length>0&&a.F.buckets.deleteMultipleObjects(i,e,{all_versions:!1,bypass:j}).then((()=>{p(!1),t(!0)})).catch((e=>{u((0,O.C9)((0,m.S)(e.error))),p(!1)}))}}),[x,t,i,c,d,j,u]),d?(0,C.jsx)(ee.A,{title:"Delete Selected Versions",confirmText:"Delete",isOpen:n,titleIcon:(0,C.jsx)(h.xWY,{}),isLoading:x,onConfirm:()=>{p(!0)},onClose:()=>t(!1),confirmationContent:(0,C.jsxs)(s.Fragment,{children:["Are you sure you want to delete the selected ",d.length," ","versions for ",(0,C.jsx)("strong",{children:c}),"?",f&&(0,C.jsx)(s.Fragment,{children:(0,C.jsx)("div",{style:{marginTop:10},children:(0,C.jsx)(h.dOG,{label:"Bypass Governance Mode",indicatorLabels:["Yes","No"],checked:j,value:"bypass_governance",id:"bypass_governance",name:"bypass_governance",onChange:e=>{b(!j)},description:""})})})]})}):null};var be=n(95098);const ge={is_latest:!0,last_modified:"",legal_hold_status:"",name:"",retention_mode:"",retention_until_date:"",size:0,tags:{},version_id:void 0},fe=e=>{let{internalPaths:t,bucketName:n}=e;const i=(0,l.jL)(),r=(0,o.d4)((e=>e.objectBrowser.searchVersions)),c=(0,o.d4)((e=>e.objectBrowser.loadingVersions)),x=(0,o.d4)((e=>e.objectBrowser.selectedVersion)),p=(0,o.d4)(O.Rq),[b,g]=(0,s.useState)(!1),[f,v]=(0,s.useState)(null),[_,S]=(0,s.useState)(null),[w,T]=(0,s.useState)([]),[y,E]=(0,s.useState)(!1),[A,N]=(0,s.useState)(null),[k,B]=(0,s.useState)("date"),[F,V]=(0,s.useState)(!1),[D,P]=(0,s.useState)(!1),[$,U]=(0,s.useState)(!1),[G,J]=(0,s.useState)([]),[K,W]=(0,s.useState)(!1);let H=[];f&&f.name&&(H=f.name.split("/")),(0,s.useEffect)((()=>{c||f||i((0,d.SK)(!0))}),[c,f,i]),(0,s.useEffect)((()=>{c&&""!==t&&a.F.buckets.listObjects(n,{prefix:t,with_versions:p}).then((e=>{const n=u()(e.data,"objects",[]).filter((e=>e.name===t));p?(v(n.find((e=>e.is_latest))||ge),T(n)):(v(n[0]),T([])),i((0,d.SK)(!1))})).catch((e=>{i((0,O.C9)((0,m.S)(e.error))),i((0,d.SK)(!1))}))}),[c,n,t,i,p]);const Y=e=>{S(e),g(!0)},Z=e=>{S(e),V(!0)},q=e=>{N(e),E(!0)},Q=e=>{(0,R._)(i,n,t,e)},X=e=>{i((0,d.Ai)(e.version_id||""))},ee=w.filter((e=>!!e.version_id&&e.version_id.includes(r))),te=w.reduce(((e,t)=>t.size?e+t.size:e),0);ee.sort(((e,t)=>{if("size"===k)return e.size&&t.size?e.sizet.size?1:0:0;{const n=new Date(e.last_modified||"").getTime(),s=new Date(t.last_modified||"").getTime();return ns?-1:0}}));const ne=e=>{if(G.includes(e)){const t=G.filter((t=>t!==e));return void J(t)}const t=[...G];t.push(e),J(t)};return(0,C.jsxs)(s.Fragment,{children:[b&&f&&(0,C.jsx)(M.default,{open:b,closeModalAndRefresh:()=>{S(null),g(!1),V(!1)},bucketName:n,dataObject:_||f}),y&&f&&A&&(0,C.jsx)(ue,{restoreOpen:y,bucketName:n,versionToRestore:A,objectPath:f.name||"",onCloseAndUpdate:e=>{E(!1),N(null),e&&(i((0,d.SK)(!0)),i((0,d.oe)(!0)))}}),F&&f&&(0,C.jsx)(z.default,{open:F,bucketName:n,actualInfo:{name:f.name||"",version_id:_&&_.version_id?_.version_id:"null",size:_&&_.size?_.size:0,content_type:"",last_modified:f.last_modified||""},onClosePreview:()=>{V(!1)}}),D&&(0,C.jsx)(pe,{deleteOpen:D,closeDeleteModalAndRefresh:e=>{P(!1),e&&(i((0,d.SK)(!0)),i((0,d.Ai)("")),i((0,d.oe)(!0)))},selectedBucket:n,selectedObject:t}),K&&(0,C.jsx)(je,{selectedBucket:n,selectedObject:t,deleteOpen:K,selectedVersions:G,closeDeleteModalAndRefresh:e=>{W(!1),e&&(i((0,d.SK)(!0)),i((0,d.Ai)("")),i((0,d.oe)(!0)),J([]))}}),(0,C.jsxs)(h.xA9,{container:!0,sx:{width:"100%",padding:10,"@media (max-width: 799px)":{minHeight:800}},children:[!f&&(0,C.jsx)(h.xA9,{item:!0,xs:12,children:(0,C.jsx)(h.z21,{})}),f&&(0,C.jsxs)(s.Fragment,{children:[(0,C.jsx)(h.xA9,{item:!0,xs:12,children:(0,C.jsx)(I,{bucketName:n,internalPaths:t,hidePathButton:!0})}),(0,C.jsx)(h.xA9,{item:!0,xs:12,sx:{position:"relative","& .detailsSpacer":{marginRight:18,"@media (max-width: 600px)":{marginRight:0}},[`@media (max-width: ${h.nmC.md}px)`]:{"&::before":{display:"none"}}},children:(0,C.jsx)(h.lcx,{icon:(0,C.jsx)("span",{style:{display:"block",marginTop:"-10px"},children:(0,C.jsx)(h.j1U,{style:{width:20,height:20}})}),title:`${H.length>0?H[H.length-1]:f.name} Versions`,subTitle:(0,C.jsxs)(s.Fragment,{children:[(0,C.jsx)("span",{className:"detailsSpacer",children:(0,C.jsxs)("strong",{children:[w.length," Version",1===w.length?"":"s","\xa0\xa0\xa0"]})}),(0,C.jsx)("span",{className:"detailsSpacer",children:(0,C.jsx)("strong",{children:(0,j.qO)(te)})})]}),actions:(0,C.jsxs)(s.Fragment,{children:[(0,C.jsx)(L.A,{tooltip:"Select Multiple Versions",children:(0,C.jsx)(h.$nd,{id:"select-multiple-versions",onClick:()=>{U(!$)},icon:(0,C.jsx)(h.IN,{}),variant:$?"callAction":"regular",style:{marginRight:8}})}),$&&(0,C.jsx)(L.A,{tooltip:"Delete Selected Versions",children:(0,C.jsx)(h.$nd,{id:"delete-multiple-versions",onClick:()=>{W(!0)},icon:(0,C.jsx)(h.d7y,{}),variant:"secondary",style:{marginRight:8},disabled:0===G.length})}),(0,C.jsx)(L.A,{tooltip:"Delete Non Current Versions",children:(0,C.jsx)(h.$nd,{id:"delete-non-current",onClick:()=>{P(!0)},icon:(0,C.jsx)(h.rgY,{}),variant:"secondary",style:{marginRight:15},disabled:w.length<=1})}),(0,C.jsx)(h.l6P,{id:"sort-by",options:[{label:"Date",value:"date"},{label:"Size",value:"size"}],value:k,label:"Sort by",onChange:e=>{B(e)},noLabelMinWidth:!0})]}),bottomBorder:!1})}),(0,C.jsx)(h.xA9,{item:!0,xs:12,sx:{flexGrow:1,height:"calc(100% - 120px)",overflow:"auto",[`@media (max-width: ${h.nmC.md}px)`]:{height:600}},children:f.version_id&&"null"!==f.version_id&&(0,C.jsx)(be.B8,{style:{width:"100%"},containerStyle:{width:"100%",maxWidth:"100%"},width:1,height:800,rowCount:ee.length,rowHeight:108,rowRenderer:e=>{let{key:t,index:n,isScrolling:s,isVisible:o,style:i}=e;const a=w.length-n;return(0,C.jsx)(xe,{style:i,fileName:(null===f||void 0===f?void 0:f.name)||"",versionInfo:ee[n],index:a,onDownload:Q,onRestore:q,onShare:Y,onPreview:Z,globalClick:X,isSelected:x===ee[n].version_id,checkable:$,onCheck:ne,isChecked:G.includes(ee[n].version_id||"")},t)}})})]})]})]})},ve=e=>{if(e.name.endsWith("/"))return"";const t=p.c9.now(),n=p.c9.fromISO(e.last_modified);return t.hasSame(n,"day")&&t.hasSame(n,"month")&&t.hasSame(n,"year")?`Today, ${n.toFormat("HH:mm")}`:n.toFormat("ccc, LLL dd yyyy HH:mm (ZZZZ)")},_e=e=>e.name.endsWith("/")||!e.size?"-":(0,j.nO)(String(e.size)),Se=[{label:"Name",elementKey:"name",renderFunction:U,enableSort:!0},{label:"Last Modified",elementKey:"last_modified",renderFunction:ve,renderFullObject:!0,enableSort:!0},{label:"Size",elementKey:"size",renderFunction:_e,renderFullObject:!0,width:100,enableSort:!0}],Oe=[{label:"Name",elementKey:"name",renderFunction:U,enableSort:!0},{label:"Object Date",elementKey:"last_modified",renderFunction:ve,renderFullObject:!0,enableSort:!0},{label:"Size",elementKey:"size",renderFunction:_e,renderFullObject:!0,width:100,enableSort:!0},{label:"Deleted",elementKey:"delete_flag",renderFunction:e=>e?"Yes":"No",width:60}];var we=n(46537);const Te=()=>{const e=(0,l.jL)(),t=(0,i.g)(),n=(0,i.Zp)(),[a,c]=(0,s.useState)("ASC"),[m,x]=(0,s.useState)("name"),p=t.bucketName||"",j=(0,o.d4)((e=>e.objectBrowser.objectDetailsOpen)),b=(0,o.d4)((e=>e.objectBrowser.requestInProgress)),g=(0,o.d4)(we.s$),f=!(null===g||void 0===g||!g.includes("object-browser-only")),v=(0,o.d4)((e=>e.objectBrowser.rewind.rewindEnabled)),S=(0,o.d4)((e=>e.objectBrowser.records)),O=(0,o.d4)((e=>e.objectBrowser.searchObjects)),w=(0,o.d4)((e=>e.objectBrowser.selectedObjects)),T=(0,o.d4)((e=>e.objectBrowser.connectionError)),y=(0,o.d4)((e=>e.system.anonymousMode)),E=(0,_._)(p,[r.OV.S3_LIST_BUCKET,r.OV.S3_ALL_LIST_BUCKET]),I=S.filter((e=>{if(""===O)return!0;return e.name.toLowerCase().indexOf(O.toLowerCase())>=0})).sort((0,A.$w)(m));let N=[];N="ASC"===a?I:I.reverse();const k=[{type:"view",tooltip:"View",onClick:t=>{var s;const o=t.name||"",i=`/browser/${encodeURIComponent(p)}${o?`/${encodeURIComponent(o)}`:""}`;!y||null!==(s=t.name)&&void 0!==s&&s.endsWith("/")?(e((0,d.KX)([])),n(i),y||(e((0,d.TO)(!0)),e((0,d.SK)(!0))),e((0,d.A7)(o))):(0,R._)(e,p,o,t)},sendOnlyId:!1}];let B=E||y?"This location is empty"+(v?"":", please try uploading a new file"):(0,r.vj)([r.OV.S3_LIST_BUCKET,r.OV.S3_ALL_LIST_BUCKET],"view Objects in this bucket");T&&(B="Objects List unavailable. Please review your WebSockets configuration and try again");let F="calc(100vh - 290px)";return f&&(F="calc(100vh - 315px)"),(0,C.jsx)(h.bQt,{itemActions:k,columns:v?Oe:Se,isLoading:b,entityName:"Objects",idField:"name",records:N,customPaperHeight:F,selectedItems:w,onSelect:y?void 0:t=>{const n=t.target,s=n.value,o=n.checked;let i=[...w];return o?i.push(s):i=i.filter((e=>e!==s)),e((0,d.KX)(i)),e((0,d.A7)(null)),i},customEmptyMessage:B,sortEnabled:{currentSort:m,currentDirection:a,onSortClick:t=>{const n=u()(t,"sortDirection","DESC");x(t.sortBy),c(n),e((0,d.Yw)(!0))}},onSelectAll:()=>{if(e((0,d.A7)(null)),w.length===N.length)return void e((0,d.KX)([]));const t=N.map((e=>e.name));e((0,d.KX)(t))},rowStyle:e=>{var t;let{index:n}=e;return null!==(t=N[n])&&void 0!==t&&t.delete_flag?"deleted":""},sx:{minHeight:j?"100%":"initial"},noBackground:!0})};var Ce=n(64681);const ye=()=>{const e=(0,l.jL)(),t=(0,o.d4)((e=>e.objectBrowser.searchObjects));return(0,C.jsx)(Ce.A,{placeholder:"Start typing to filter objects in the bucket",onChange:t=>{e((0,d.$X)(t))},value:t})};var Ee=n(30614);const Ie=(0,S.A)(s.lazy((()=>n.e(5941).then(n.bind(n,65941))))),Ae=(0,S.A)(s.lazy((()=>Promise.resolve().then(n.bind(n,30718))))),Ne=(0,S.A)(s.lazy((()=>n.e(2704).then(n.bind(n,32704))))),ke=(0,S.A)(s.lazy((()=>Promise.resolve().then(n.bind(n,37524))))),Be={borderWidth:2,borderRadius:2,borderColor:"transparent",outline:"none"},Fe={borderStyle:"dashed",backgroundColor:"transparent",borderColor:"#2196f3"},Le={borderStyle:"dashed",backgroundColor:"transparent",borderColor:"#00e676"},Ve=()=>{var e;const t=(0,l.jL)(),n=(0,i.g)(),c=(0,i.Zp)(),b=(0,i.zy)(),g=(0,o.d4)((e=>e.objectBrowser.rewind.rewindEnabled)),f=(0,o.d4)((e=>e.objectBrowser.rewind.bucketToRewind)),v=(0,o.d4)((e=>e.objectBrowser.versionsMode)),S=(0,o.d4)((e=>e.objectBrowser.showDeleted)),y=(0,o.d4)((e=>e.objectBrowser.objectDetailsOpen)),E=(0,o.d4)((e=>e.objectBrowser.selectedInternalPaths)),R=(0,o.d4)((e=>e.objectBrowser.requestInProgress)),P=(0,o.d4)((e=>e.objectBrowser.simplePath)),$=(0,o.d4)((e=>e.objectBrowser.versionInfo)),U=(0,o.d4)((e=>e.objectBrowser.lockingEnabled)),z=(0,o.d4)((e=>e.objectBrowser.downloadRenameModal)),G=(0,o.d4)((e=>e.objectBrowser.selectedPreview)),M=(0,o.d4)((e=>e.objectBrowser.shareFileModalOpen)),J=(0,o.d4)((e=>e.objectBrowser.previewOpen)),K=(0,o.d4)((e=>e.objectBrowser.selectedBucket)),W=(0,o.d4)((e=>e.system.anonymousMode)),H=(0,o.d4)((e=>e.objectBrowser.anonymousAccessOpen)),Y=(0,o.d4)((e=>{var t;return(null===(t=e.objectBrowser)||void 0===t?void 0:t.records)||[]})),Z=(0,o.d4)(B.Nx),q=(0,o.d4)(B.fT),[Q,X]=(0,s.useState)(!1),[ee,te]=(0,s.useState)(!1),[ne,se]=(0,s.useState)(!1),[oe,ie]=(0,s.useState)(!1),[ae,le]=(0,s.useState)(!1),[de,ue]=(0,s.useState)(null),[he,me]=(0,s.useState)(null),[xe,pe]=(0,s.useState)(!1),je=N($.status),be=n.bucketName||"",ge=b.pathname.split(`/browser/${be}/`),ve=2===ge.length?decodeURIComponent(ge[1]):"",_e=ve.split("/").filter((e=>""!==e));let Se=[be];_e.length>0&&(Se=Se.concat(_e));const Oe=(0,s.useRef)(null),we=(0,s.useRef)(null),Ce=(0,o.d4)((e=>e.console.session&&e.console.session.permissions||{})),Ve=[r.OV.S3_PUT_OBJECT,r.OV.S3_PUT_ACTIONS],De=Se.join("/"),Re=function(e,t){const n=T(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]).reduce(((e,t)=>{const n=w(t);return n&&e.push(`.${n}`),e}),[]);return[...new Set(n)].join(",")}(Ce,De,Ve),Pe=T(Ce,De,Ve),$e=(0,_._)([De,...Pe],[r.OV.S3_GET_OBJECT,r.OV.S3_GET_ACTIONS]),Ue=(0,_._)(be,[r.OV.S3_GET_OBJECT,r.OV.S3_GET_ACTIONS,r.OV.S3_GET_BUCKET_VERSIONING]),ze=(0,_._)([De,...Pe],[r.OV.S3_DELETE_OBJECT]),Ge=(0,_._)([De,...Pe],Ve)||W,Me=(0,_._)(be,[r.OV.S3_GET_BUCKET_POLICY,r.OV.S3_PUT_BUCKET_POLICY,r.OV.S3_GET_ACTIONS,r.OV.S3_PUT_ACTIONS]),Je=(0,o.d4)((e=>e.objectBrowser.selectedObjects)),Ke=(()=>{let e=!1;if(1===Je.length){e=!!Y.find((e=>e.name===`${Je[0]}`&&e.delete_flag))}return e})(),We=(0,s.useCallback)((()=>{const e=Je[0];!xe&&e&&a.F.buckets.getObjectMetadata(be,{prefix:e}).then((e=>{let t=u()(e.data,"objectMetadata",{});pe(!0),me(t)})).catch((e=>{console.error("Error Getting Metadata Status: ",e,null===e||void 0===e?void 0:e.detailedError),pe(!0)}))}),[be,Je,xe]);(0,s.useEffect)((()=>{be&&!Ke&&We()}),[be,Je,We,Ke]),(0,s.useEffect)((()=>{g&&f!==be&&t((0,d.rS)())}),[g,f,be,t]),(0,s.useEffect)((()=>{null!==we.current&&(we.current.setAttribute("directory",""),we.current.setAttribute("webkitdirectory",""))}),[we]),(0,s.useEffect)((()=>{if(1===Je.length){const e=Je[0],t=e.endsWith("/");let n=(0,A.IZ)(he,e);le(!("none"===n||!$e)),ie(!(!$e||t))}else ie(!1),le(!1)}),[Je,$e,he]),(0,s.useEffect)((()=>{de||W||a.F.buckets.getBucketQuota(be).then((e=>{let t=null;e.data.quota&&(t=e.data),ue(t)})).catch((e=>{console.error("Error Getting Quota Status: ",e.error.detailedMessage),ue(null)}))}),[de,be,W]),(0,s.useEffect)((()=>{Je.length>0?t((0,d.TO)(!0)):0!==Je.length||null!==E||R||t((0,d.TO)(!1))}),[Je,E,t,R]),(0,s.useEffect)((()=>{ne||(t((0,B.ZU)(!0)),se(!0))}),[ne,t,se]),(0,s.useEffect)((()=>{!R&&!Z||W||a.F.buckets.bucketInfo(be).then((e=>{t((0,B.ZU)(!1)),t((0,B.$T)(e.data))})).catch((e=>{t((0,B.ZU)(!1)),t((0,O.C9)((0,m.S)(e)))}))}),[be,Z,t,W,R]),(0,s.useEffect)((()=>{""!==K&&a.F.buckets.getBucketRetentionConfig(K).then((e=>{t((0,d.PJ)(e.data))})).catch((()=>{t((0,d.PJ)(null))}))}),[K,t]);const He=e=>{if(null!==e&&void 0!==e&&null!==e.target.files&&void 0!==e.target.files){e.preventDefault();var t=[];for(let n=0;n{let s="";P&&(s=P.endsWith("/")?P:P+"/");((e,n,s,o)=>{let i=i=>new Promise(((a,l)=>{let r=`api/v1/buckets/${n}/objects/upload`;const c=i.name,h=new Blob([i],{type:i.type}),m=(e=>e.replace(/(^|\/)\.\//g,"/"))(u()(i,"path","")),x=u()(i,"webkitRelativePath","");let p=o;const j=(0,k.E0)(8);""!==m?p=m:""!==x&&(p=x);let b="";if(""!==s||""!==p){const e=p.split("/").slice(0,-1).join("/"),t=s.endsWith("/")?s.slice(0,-1):s;b=`${t}${t.endsWith("/")||""===e||e.startsWith("/")?"":"/"}${e}${!e.endsWith("/")||""===e.trim()&&!s.endsWith("/")?"/":""}`}r=""!==b?`${r}?prefix=${encodeURIComponent(b+c)}`:`${r}?prefix=${encodeURIComponent(c)}`;const g=encodeURIComponent(`${n}-${b}-${(new Date).getTime()}-${Math.random()}`);let f=new XMLHttpRequest;f.open("POST",r,!0),W&&f.setRequestHeader("X-Anonymous","1");let v=`An error occurred while uploading the file${e.length>1?"s":""}.`;const _={413:"Error - File size too large"};f.withCredentials=!1,f.onload=function(){if(f.status>=200&&f.status<300)t((0,d.rx)(g)),a({status:f.status}),(0,k.vy)(j);else{if(_[f.status])v=_[f.status];else if(f.response)try{const e=JSON.parse(f.response);v=e.detailedMessage}catch(e){v="something went wrong"}t((0,d.iL)({instanceID:g,msg:v})),l({status:f.status,message:v}),(0,k.vy)(j)}},f.upload.addEventListener("error",(()=>{l(v),t((0,d.iL)({instanceID:g,msg:"A network error occurred."}))})),f.upload.addEventListener("progress",(e=>{const n=Math.floor(100*e.loaded/e.total);t((0,d.DW)({instanceID:g,progress:n}))})),f.onerror=()=>{l(v),t((0,d.iL)({instanceID:g,msg:"A network error occurred."}))},f.onloadend=()=>{0===e.length&&t((0,d.Yw)(!0))},f.onabort=()=>{t((0,d.Dm)(g))};const S=new FormData;void 0!==i.size&&(S.append(i.size.toString(),h,c),(0,k.FP)(j,f),t((0,d.cP)({ID:j,bucketName:n,done:!1,instanceID:g,percentage:0,prefix:`${b}${c}`,type:"upload",waitingForFile:!1,failed:!1,cancelled:!1,errorMessage:""})),(0,k.vx)(j,S))}));const a=[];t((0,d.Nu)());for(let t=0;t{const n=e.filter((e=>"rejected"===e.status));if(n.length>0){const e=a.length,s={errorMessage:"There were some errors during file upload",detailedError:`Uploaded files ${a.length-n.length}/${e}`};t((0,O.C9)(s))}t((0,d.Yw)(!0))}))})(e,be,s,n)}),[be,t,P,W]),Ze=(0,s.useCallback)((e=>{if(e&&e.length>0&&Ge){let n=e[0].path,s=e;Re.length>0&&(s=e.filter((e=>{const t=w(e.name);return Re.includes(t)}))),s.length?(Ye(s,n),console.log(`${s.length} Allowed Files Processed out of ${e.length}.`,De,...Pe),s.length!==e.length&&t((0,O.C9)({errorMessage:"Upload is restricted.",detailedError:(0,r.vj)([r.OV.S3_PUT_OBJECT,r.OV.S3_PUT_ACTIONS],"upload objects to this location")}))):(t((0,O.C9)({errorMessage:"Could not process drag and drop.",detailedError:(0,r.vj)([r.OV.S3_PUT_OBJECT,r.OV.S3_PUT_ACTIONS],"upload objects to this location")})),console.error("Could not process drag and drop . upload may be restricted.",De,...Pe))}Ge||t((0,O.C9)({errorMessage:"Upload not allowed",detailedError:(0,r.vj)([r.OV.S3_PUT_OBJECT,r.OV.S3_PUT_ACTIONS],"upload objects to this location")}))}),[Ye]),{getRootProps:qe,getInputProps:Qe,isDragActive:Xe,isDragAccept:et}=(0,x.VB)({noClick:!0,onDrop:Ze}),tt=(0,s.useMemo)((()=>({...Be,...Xe?Fe:{},...et?Le:{}})),[Xe,et]),nt=e=>{if(t((0,d.A7)(null)),t((0,d.cQ)({status:!1})),y&&null!==E){const e=ve.split("/");e.pop();let t="";e&&e.length>0&&(t=`${e.join("/")}/`),c(`/browser/${encodeURIComponent(be)}/${encodeURIComponent(t)}`)}t((0,d.TO)(!1)),e&&t((0,d.Yw)(!0))};let st=p.c9.now();null!==q&&void 0!==q&&q.creation_date&&(st=p.c9.fromISO(q.creation_date));const ot=(null===Je||void 0===Je?void 0:Je.length)<=1?"Download Selected":" Download selected objects as Zip. Any Deleted objects in the selection would be skipped from download.",it=[{action:()=>{t((0,F.op)(be))},label:"Download",disabled:!$e||Ke,icon:(0,C.jsx)(h.s3U,{}),tooltip:$e?ot:(0,r.vj)([r.OV.S3_GET_OBJECT,r.OV.S3_GET_ACTIONS],"download objects from this bucket")},{action:()=>{t((0,F.mS)())},label:"Share",disabled:1!==Je.length||!oe||Ke,icon:(0,C.jsx)(h.liv,{}),tooltip:oe?"Share Selected File":"Sharing unavailable"},{action:()=>{t((0,F.HS)())},label:"Preview",disabled:1!==Je.length||!ae||Ke,icon:(0,C.jsx)(h.cyn,{}),tooltip:ae?"Preview Selected File":"Preview unavailable"},{action:()=>{t((0,F.oz)())},label:"Anonymous Access",disabled:1!==Je.length||!Je[0].endsWith("/")||!Me,icon:(0,C.jsx)(h._kf,{}),tooltip:1===Je.length&&Je[0].endsWith("/")?"Set Anonymous Access to this Folder":"Anonymous Access unavailable"},{action:()=>{X(!0)},label:"Delete",icon:(0,C.jsx)(h.d7y,{}),disabled:!ze||0===Je.length,tooltip:ze?"Delete Selected Files":(0,r.vj)([r.OV.S3_DELETE_OBJECT],"delete objects in this bucket")}];return(0,C.jsxs)(s.Fragment,{children:[M&&G&&(0,C.jsx)(Ae,{open:M,closeModalAndRefresh:()=>{t((0,d.Lf)(!1)),t((0,d.go)(null))},bucketName:be,dataObject:{name:G.name,last_modified:"",version_id:G.version_id}}),Q&&(0,C.jsx)(Ie,{deleteOpen:Q,selectedBucket:be,selectedObjects:Je,closeDeleteModalAndRefresh:e=>{X(!1),e&&(t((0,O.Hk)("Objects deleted successfully.")),t((0,d.KX)([])),t((0,d.Yw)(!0)))},versioning:$}),ee&&(0,C.jsx)(Ne,{open:ee,closeModalAndRefresh:()=>{te(!1)},bucketName:be}),J&&G&&(0,C.jsx)(ke,{open:J,bucketName:be,actualInfo:{name:G.name||"",last_modified:"",version_id:G.version_id||"",size:G.size||0},onClosePreview:()=>{t((0,d.xE)(!1)),t((0,d.go)(null))}}),!!z&&(0,C.jsx)(re,{open:!!z,closeModal:()=>{t((0,d.Ew)(null))},currentItem:(null===(e=z.name.split("/"))||void 0===e?void 0:e.pop())||"",bucketName:be,internalPaths:ve,actualInfo:{name:z.name,last_modified:"",version_id:z.version_id,size:z.size}}),H&&(0,C.jsx)(Ee.default,{onClose:()=>{t((0,d.I8)(!1))},bucket:be,modalOpen:H,prefilledRoute:`${Je[0]}*`}),(0,C.jsxs)(h.Mxu,{variant:"full",children:[W&&(0,C.jsx)("div",{style:{paddingBottom:16},children:(0,C.jsx)(ye,{})}),(0,C.jsx)(h.azJ,{withBorders:!0,sx:{padding:"0 5px"},children:(0,C.jsx)(h.lcx,{icon:(0,C.jsx)("span",{children:(0,C.jsx)(h.brV,{style:{width:30}})}),title:be,subTitle:W?null:(0,C.jsxs)(h.azJ,{sx:{"& .detailsSpacer":{marginRight:18,"@media (max-width: 600px)":{marginRight:0}}},children:[(0,C.jsxs)("span",{className:"detailsSpacer",children:["Created on:\xa0",(0,C.jsx)("strong",{children:null!==q&&void 0!==q&&q.creation_date?st.toFormat("ccc, LLL dd yyyy HH:mm:ss (ZZZZ)"):""})]}),(0,C.jsxs)("span",{className:"detailsSpacer",children:["Access:\xa0\xa0",(0,C.jsx)("strong",{children:(null===q||void 0===q?void 0:q.access)||""})]}),q&&(0,C.jsx)(s.Fragment,{children:(0,C.jsxs)("span",{className:"detailsSpacer",children:[q.size&&(0,C.jsx)(s.Fragment,{children:(0,j.qO)(q.size)}),q.size&&de&&(0,C.jsxs)(s.Fragment,{children:[" ","/ ",(0,j.qO)(de.quota||0)]}),q.size&&q.objects?" - ":"",q.objects&&(0,C.jsxs)(s.Fragment,{children:[q.objects,"\xa0Object",q.objects&&1!==q.objects?"s":""]})]})})]}),actions:(0,C.jsxs)(s.Fragment,{children:[!W&&(0,C.jsx)(L.A,{tooltip:Ue?"Rewind Bucket":(0,r.vj)([r.OV.S3_GET_OBJECT,r.OV.S3_GET_ACTIONS,r.OV.S3_GET_BUCKET_VERSIONING],"apply rewind in this bucket"),children:(0,C.jsx)(h.$nd,{id:"rewind-objects-list",label:"Rewind",icon:(0,C.jsx)(h.Exy,{color:"alert",dotOnly:!0,invisible:!g,children:(0,C.jsx)(h.osr,{style:{minWidth:16,minHeight:16,width:16,height:16,marginTop:-3}})}),variant:"regular",onClick:()=>{te(!0)},disabled:!je||!Ue})}),(0,C.jsx)(L.A,{tooltip:"Reload List",children:(0,C.jsx)(h.$nd,{id:"refresh-objects-list",label:"Refresh",icon:(0,C.jsx)(h.fNY,{}),variant:"regular",onClick:()=>{v?t((0,d.SK)(!0)):(t((0,d.A3)()),t((0,d.Yw)(!0)))},disabled:!W&&(!(0,_._)(be,[r.OV.S3_LIST_BUCKET,r.OV.S3_ALL_LIST_BUCKET])||g)})}),(0,C.jsx)("input",{type:"file",multiple:!0,accept:Re||void 0,onChange:He,style:{display:"none"},ref:Oe}),(0,C.jsx)("input",{type:"file",multiple:!0,onChange:He,style:{display:"none"},ref:we}),(0,C.jsx)(V,{bucketName:be,uploadPath:De,uploadFileFunction:e=>{Oe&&Oe.current&&Oe.current.click(),e()},uploadFolderFunction:e=>{we&&we.current&&we.current.click(),e()}})]}),bottomBorder:!1})}),(0,C.jsxs)("div",{id:"object-list-wrapper",...qe({style:{...tt}}),children:[(0,C.jsx)("input",{...Qe()}),(0,C.jsxs)(h.azJ,{withBorders:!0,sx:{display:"flex",borderTop:0,padding:0,"& .hideListOnSmall":{"@media (max-width: 799px)":{display:"none"}}},children:[v?(0,C.jsx)(s.Fragment,{children:null!==E&&(0,C.jsx)(fe,{internalPaths:E,bucketName:be})}):(0,C.jsx)(_.R,{scopes:[r.OV.S3_LIST_BUCKET,r.OV.S3_ALL_LIST_BUCKET],resource:be,errorProps:{disabled:!0},children:(0,C.jsxs)(h.xA9,{item:!0,xs:12,sx:{width:"100%",position:"relative","&.detailsOpen":{"@media (max-width: 799px)":{display:"none"}}},className:y?"detailsOpen":"",children:[!W&&(0,C.jsx)(h.xA9,{item:!0,xs:12,sx:{padding:"12px 14px 5px"},children:(0,C.jsx)(I,{bucketName:be,internalPaths:ve,additionalOptions:!je||g?null:(0,C.jsx)(h.Sc0,{name:"deleted_objects",id:"showDeletedObjects",value:"deleted_on",label:"Show deleted objects",onChange:()=>{t((0,d.A3)()),t((0,d.lA)(!S)),nt(!0)},checked:S,sx:{marginLeft:5,"@media (max-width: 600px)":{marginLeft:0,flexDirection:"row"}}}),hidePathButton:!1})}),(0,C.jsx)(Te,{})]})}),!W&&(0,C.jsx)(_.R,{scopes:[r.OV.S3_LIST_BUCKET,r.OV.S3_ALL_LIST_BUCKET],resource:be,errorProps:{disabled:!0},children:(0,C.jsxs)(D,{open:y,closePanel:()=>{nt(!1)},className:""+(v?"hideListOnSmall":""),children:[Je.length>0&&(0,C.jsx)(h.Smc,{items:it,title:"Selected Objects:"}),null!==E&&(0,C.jsx)(ce,{internalPaths:E,bucketName:be,onClosePanel:nt,versioningInfo:$,locking:U})]})})]})]})]})]})};var De=n(18218),Re=n(69772),Pe=n(48793),$e=n(59707),Ue=n(88617);const ze=e=>{let{bucketName:t}=e;const n=(0,l.jL)(),a=(0,o.d4)(we.s$),c=(0,o.d4)((e=>e.objectBrowser.versionsMode)),u=(0,o.d4)((e=>e.objectBrowser.versionedFile)),m=(0,o.d4)((e=>e.objectBrowser.searchVersions)),x=!(null===a||void 0===a||!a.includes("object-browser-only")),p=(0,i.Zp)(),j=(0,De.A)(t,[r.OV.S3_GET_BUCKET_POLICY,r.OV.S3_PUT_BUCKET_POLICY,r.OV.S3_GET_BUCKET_VERSIONING,r.OV.S3_PUT_BUCKET_VERSIONING,r.OV.S3_GET_BUCKET_ENCRYPTION_CONFIGURATION,r.OV.S3_PUT_BUCKET_ENCRYPTION_CONFIGURATION,r.OV.S3_DELETE_BUCKET,r.OV.S3_GET_BUCKET_NOTIFICATIONS,r.OV.S3_PUT_BUCKET_NOTIFICATIONS,r.OV.S3_GET_REPLICATION_CONFIGURATION,r.OV.S3_PUT_REPLICATION_CONFIGURATION,r.OV.ADMIN_GET_BUCKET_QUOTA,r.OV.ADMIN_SET_BUCKET_QUOTA,r.OV.S3_PUT_BUCKET_TAGGING,r.OV.S3_GET_BUCKET_TAGGING,r.OV.S3_LIST_BUCKET_VERSIONS,r.OV.S3_GET_BUCKET_POLICY_STATUS,r.OV.S3_DELETE_BUCKET_POLICY,r.OV.S3_GET_ACTIONS,r.OV.S3_PUT_ACTIONS]),b=(0,C.jsx)(s.Fragment,{children:c?(0,C.jsx)(s.Fragment,{children:(0,C.jsx)(Ce.A,{placeholder:`Start typing to filter versions of ${u}`,onChange:e=>{n((0,d.aj)(e))},value:m})}):(0,C.jsx)(_.R,{scopes:[r.OV.S3_LIST_BUCKET,r.OV.S3_ALL_LIST_BUCKET],resource:t,errorProps:{disabled:!0},children:(0,C.jsx)(ye,{})})});return(0,s.useEffect)((()=>{n((0,O.ph)("object_browser"))}),[]),(0,C.jsx)(s.Fragment,{children:x?(0,C.jsxs)(h.xA9,{container:!0,sx:{padding:"20px 32px 0"},children:[(0,C.jsx)(h.xA9,{children:(0,C.jsx)(Re.A,{marginRight:30,marginTop:10})}),(0,C.jsxs)(h.xA9,{item:!0,xs:!0,sx:{display:"flex",gap:10},children:[b,(0,C.jsx)($e.A,{})]})]}):(0,C.jsx)(Pe.A,{label:(0,C.jsx)(h.EGL,{label:"Object Browser",onClick:()=>{p(r.zZ.OBJECT_BROWSER_VIEW)}}),actions:(0,C.jsxs)(s.Fragment,{children:[(0,C.jsx)(_.R,{scopes:r.pC[r.ac.BUCKET_ADMIN],resource:t,errorProps:{disabled:!0},children:(0,C.jsx)(L.A,{tooltip:j?"Configure Bucket":"You do not have the required permissions to configure this bucket. Please contact your MinIO administrator to request "+r.ac.BUCKET_ADMIN+" permisions.",children:(0,C.jsx)(h.$nd,{id:"configure-bucket-main",color:"primary","aria-label":"Configure Bucket",onClick:()=>p(`/buckets/${t}/admin`),icon:(0,C.jsx)(h.Zes,{style:{width:20,height:20,marginTop:-3}}),style:{padding:"0 10px"}})})}),(0,C.jsx)(Ue.A,{})]}),middleComponent:b})})},Ge=()=>{const e=(0,l.jL)(),t=(0,i.g)(),n=(0,i.zy)(),c=(0,o.d4)((e=>e.objectBrowser.loadingVersioning)),u=(0,o.d4)((e=>e.objectBrowser.rewind.rewindEnabled)),h=(0,o.d4)((e=>e.objectBrowser.rewind.dateToRewind)),m=(0,o.d4)((e=>e.objectBrowser.showDeleted)),x=(0,o.d4)((e=>e.objectBrowser.requestInProgress)),p=(0,o.d4)((e=>e.objectBrowser.loadingLocking)),j=(0,o.d4)((e=>e.objectBrowser.reloadObjectsList)),b=(0,o.d4)((e=>e.objectBrowser.simplePath)),g=(0,o.d4)((e=>e.system.anonymousMode)),f=(0,o.d4)((e=>e.objectBrowser.selectedBucket)),v=(0,o.d4)((e=>e.objectBrowser.records)),_=t.bucketName||"",S=n.pathname.split(`/browser/${encodeURIComponent(_)}/`),O=2===S.length?decodeURIComponent(S[1]):"",w=(0,s.useCallback)((t=>{let n=(new Date).toISOString();null!==h&&u&&(n=h);e({type:"socket/OBRequest",payload:{bucketName:_,path:t,rewindMode:u||m,date:n}})}),[_,m,h,u,e]),T=(0,s.useCallback)((function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e((0,d.cQ)({status:!1}));let n=O;O.endsWith("/")||""===O||(n=`${O.split("/").slice(0,-1).join("/")}/`),"/"===n&&(n=""),(n!==b||_!==f||t)&&(e((0,d.u)(!0)),w(n))}),[O,e,b,f,_,w]);(0,s.useEffect)((()=>()=>{e({type:"socket/OBCancelLast"})}),[e]),(0,s.useEffect)((()=>{e((0,d.vn)(!0)),O.endsWith("/")||""===O?(e((0,d.TO)(!1)),e((0,d.A7)(null)),e((0,d.Qy)(!0))):(e((0,d.oe)(!0)),e((0,d.TO)(!0)),e((0,d.SK)(!0)),e((0,d.A7)(O||"")))}),[_,O,h,u,e]),(0,s.useEffect)((()=>{T(!1)}),[T]),(0,s.useEffect)((()=>{j&&0===v.length&&!x&&T(!0)}),[j,v,x,T]);const y=(0,De.A)(_,[r.OV.S3_LIST_BUCKET,r.OV.S3_ALL_LIST_BUCKET])||g;return(0,s.useEffect)((()=>{c&&!g&&(y?a.F.buckets.getBucketVersioning(_).then((t=>{e((0,d.AP)(t.data)),e((0,d.vn)(!1))})).catch((t=>{console.error("Error Getting Object Versioning Status: ",t.error.detailedMessage),e((0,d.vn)(!1))})):(e((0,d.vn)(!1)),e((0,d.A3)())))}),[_,c,e,y,g]),(0,s.useEffect)((()=>{p&&(y?a.F.buckets.getBucketObjectLockingStatus(_).then((t=>{e((0,d.xW)(t.data.object_locking_enabled)),e((0,d.Qy)(!1))})).catch((t=>{console.error("Error Getting Object Locking Status: ",t.error.detailedMessage),e((0,d.Qy)(!1))})):(e((0,d.A3)()),e((0,d.Qy)(!1))))}),[_,p,e,y]),(0,C.jsxs)(s.Fragment,{children:[!g&&(0,C.jsx)(ze,{bucketName:_}),(0,C.jsx)(Ve,{})]})}},30718:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_});var s=n(65043),o=n(22166),i=n(89923),a=n(61476),l=n.n(a),r=n(94141),d=n(24241),c=n(70579);const u=e=>{let{id:t,label:n,maxSeconds:o,entity:a,onChange:l}=e;const r=Math.floor(o/86400),u=Math.floor(o%86400/3600),h=Math.floor(o%3600/60),[m,x]=(0,s.useState)(0),[p,j]=(0,s.useState)(0),[b,g]=(0,s.useState)(0),[f,v]=(0,s.useState)(!0),[_,S]=(0,s.useState)(null);(0,s.useEffect)((()=>{x(r),j(u),g(h)}),[r,u,h]),(0,s.useEffect)((()=>{var e,t,n;isNaN(p)||isNaN(m)||isNaN(b)||S((e=m,t=p,n=b,d.c9.now().plus({hours:t+24*e,minutes:n}).toISO()))}),[m,p,b]),(0,s.useEffect)((()=>{if(f&&_){const e=d.c9.fromISO(_).toFormat("yyyy-MM-dd HH:mm:ss");l(e.split(" ").join("T"),!0)}else l("0000-00-00",!1)}),[_,l,f]),(0,s.useEffect)((()=>{let e=!0;(m<0||m>7||m>r||isNaN(m))&&(e=!1),(p<0||p>23||isNaN(p))&&(e=!1),(b<0||b>59||isNaN(b))&&(e=!1),m===r&&(p>u&&(e=!1),p===u&&b>h&&(e=!1)),m<=0&&p<=0&&b<=0&&(e=!1),v(e)}),[_,r,u,h,l,m,p,b]);const O={"& .textBoxContainer":{minWidth:0},"& input":{textAlign:"center",paddingRight:10,paddingLeft:10,width:40}};return(0,c.jsxs)(i.azJ,{className:"inputItem",children:[(0,c.jsx)(i.azJ,{sx:{display:"flex",alignItems:"center",marginBottom:5},children:(0,c.jsx)(i.l1Y,{htmlFor:t,children:n})}),(0,c.jsxs)(i.azJ,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-evenly",gap:10,"& .reverseInput":{flexFlow:"row-reverse","& > label":{fontWeight:400,marginLeft:15,marginRight:25}}},children:[(0,c.jsx)(i.azJ,{children:(0,c.jsx)(i.cl_,{id:t,className:"reverseInput removeArrows",type:"number",min:"0",max:"7",label:"Days",name:t,onChange:e=>{x(parseInt(e.target.value))},value:m.toString(),sx:O,noLabelMinWidth:!0})}),(0,c.jsx)(i.azJ,{children:(0,c.jsx)(i.cl_,{id:t,className:"reverseInput removeArrows",type:"number",min:"0",max:"23",label:"Hours",name:t,onChange:e=>{j(parseInt(e.target.value))},value:p.toString(),sx:O,noLabelMinWidth:!0})}),(0,c.jsx)(i.azJ,{children:(0,c.jsx)(i.cl_,{id:t,className:"reverseInput removeArrows",type:"number",min:"0",max:"59",label:"Minutes",name:t,onChange:e=>{g(parseInt(e.target.value))},value:b.toString(),sx:O,noLabelMinWidth:!0})})]}),(0,c.jsx)(i.azJ,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",marginTop:25,marginLeft:10,marginBottom:15,"& .validityText":{fontSize:14,marginTop:15,display:"flex",alignItems:"center",justifyContent:"center","@media (max-width: 900px)":{flexFlow:"column"},"& > .min-icon":{color:"#5E5E5E",width:15,height:15,marginRight:10}},"& .validTill":{fontWeight:"bold",marginLeft:15},"& .invalidDurationText":{marginTop:15,display:"flex",color:"red",fontSize:11}},children:f&&_?(0,c.jsxs)("div",{className:"validityText",children:[(0,c.jsx)(i.qYV,{}),(0,c.jsxs)("div",{children:[a," will be available until:"]})," ",(0,c.jsx)("div",{className:"validTill",children:d.c9.fromISO(_).toFormat("MM/dd/yyyy HH:mm:ss ZZZZ")})]}):(0,c.jsx)("div",{className:"invalidDurationText",children:"Please select a valid duration."})})]})};var h=n(56483),m=n(64159),x=n(21383),p=n(56629),j=n(53518),b=n(81708),g=n(6035),f=n(93950),v=n.n(f);const _=e=>{let{open:t,closeModalAndRefresh:n,bucketName:a,dataObject:d}=e;const f=(0,x.jL)(),_=(0,o.d4)(m.Rq),S=(0,o.d4)(g.yL),[O,w]=(0,s.useState)(""),[T,C]=(0,s.useState)(!0),[y,E]=(0,s.useState)(!1),[I,A]=(0,s.useState)(""),[N,k]=(0,s.useState)(!0),[B,F]=(0,s.useState)("null"),L=v()(((e,t)=>{k(t),t?A(e):(A(""),w(""))}),300);return(0,s.useEffect)((()=>{f((0,b.Ex)())}),[f]),(0,s.useEffect)((()=>{if(void 0===d.version_id)return _?(p.F.buckets.listObjects(a,{prefix:d.name||"",with_versions:_}).then((e=>{const t=(e.data.objects||[]).find((e=>e.is_latest));F(t?`${t.version_id}`:"null")})).catch((e=>{f((0,m.Dy)((0,j.S)(e.error)))})),void C(!1)):(F("null"),void C(!1));F(d.version_id||"null"),C(!1)}),[a,d,_,f]),(0,s.useEffect)((()=>{if(N&&!T){E(!0),w("");const e=new Date(`${I}`),t=new Date,n=Math.ceil((e.getTime()-t.getTime())/1e3);n>0&&p.F.buckets.shareObject(a,{prefix:d.name||"",version_id:B,expires:""!==I?`${n}s`:""}).then((e=>{w(e.data),E(!1)})).catch((e=>{f((0,m.Dy)((0,j.S)(e.error))),w(""),E(!1)}))}}),[d,I,a,N,w,f,_,T,B]),(0,c.jsx)(s.Fragment,{children:(0,c.jsxs)(r.A,{title:"Share File",titleIcon:(0,c.jsx)(i.liv,{style:{fill:"#4CCB92"}}),modalOpen:t,onClose:()=>{n()},children:[T&&(0,c.jsx)(i.xA9,{item:!0,xs:12,children:(0,c.jsx)(i.z21,{})}),!T&&(0,c.jsxs)(s.Fragment,{children:[(0,c.jsx)(i.xA9,{item:!0,xs:12,sx:{fontSize:14,fontWeight:400},children:(0,c.jsx)(i.m_M,{placement:"right",tooltip:(0,c.jsxs)("span",{children:["You can reset your session by logging out and logging back in to the web UI. ",(0,c.jsx)("br",{})," ",(0,c.jsx)("br",{}),"You can increase the maximum configuration time by setting the MINIO_STS_DURATION environment variable on all your nodes. ",(0,c.jsx)("br",{})," ",(0,c.jsx)("br",{}),"You can use ",(0,c.jsx)("b",{children:"mc share"})," as an alternative to this UI, where the session length does not limit the URL validity."]}),children:(0,c.jsxs)("span",{children:["The following URL lets you share this object without requiring a login. ",(0,c.jsx)("br",{}),"The URL expires automatically at the earlier of your configured time (",(0,h.K7)(S),") or the expiration of your current web session."]})})}),(0,c.jsx)("br",{}),(0,c.jsx)(i.xA9,{item:!0,xs:12,children:(0,c.jsx)(u,{id:"date",label:"Active for",maxSeconds:S,onChange:L,entity:"Link"})}),(0,c.jsx)(i.xA9,{item:!0,xs:12,sx:{marginBottom:10},children:(0,c.jsx)(i.EmB,{actionButton:(0,c.jsx)(l(),{text:O,children:(0,c.jsx)(i.$nd,{id:"copy-path",variant:"regular",onClick:()=>{f((0,m.h0)("Share URL Copied to clipboard"))},disabled:""===O||y,style:{width:"28px",height:"28px",padding:"0px"},icon:(0,c.jsx)(i.TdU,{})})}),children:O})})]})]})})}},37524:(e,t,n)=>{n.r(t),n.d(t,{default:()=>g});var s=n(65043),o=n(94141),i=n(89923),a=n(33097),l=n.n(a),r=n(93445),d=n(56629),c=n(79355),u=n(97806),h=n(6584),m=n(70579);c.EA.workerSrc="./scripts/pdf.worker.min.mjs";const x=e=>{let{path:t,loading:n,onLoad:o,downloadFile:a}=e;const[l,r]=(0,s.useState)(!1),[d,c]=(0,s.useState)(0);if(!t)return null;const x=d>5?5:d,p=Array.from(Array(x).keys());return(0,m.jsxs)(s.Fragment,{children:[l&&0===d&&(0,m.jsx)(i.Wei,{variant:"error",title:"Error",message:(0,m.jsxs)(s.Fragment,{children:["File preview couldn't be displayed, Please try Download instead.",(0,m.jsx)(i.azJ,{sx:{display:"flex",justifyContent:"center",marginTop:12},children:(0,m.jsx)(i.$nd,{id:"download-preview",onClick:a,variant:"callAction",children:"Download File"})})]}),sx:{marginBottom:10}}),!n&&!l&&(0,m.jsx)(i.Wei,{variant:"warning",title:"File Preview",message:(0,m.jsxs)(s.Fragment,{children:["This is a File Preview for the first ",p.length," pages of the document, if you wish to work with the full document please download instead.",(0,m.jsx)(i.azJ,{sx:{display:"flex",justifyContent:"center",marginTop:12},children:(0,m.jsx)(i.$nd,{id:"download-preview",onClick:a,variant:"callAction",children:"Download File"})})]}),sx:{marginBottom:10}}),!l&&(0,m.jsx)(i.azJ,{sx:{overflowY:"auto","& .react-pdf__Page__canvas":{margin:"0 auto",backgroundColor:"transparent"}},children:(0,m.jsx)(u.A,{file:t,onLoadSuccess:e=>{let{_pdfInfo:t}=e;c(t.numPages||0),r(!1),o()},onLoadError:e=>{r(!0),o(),console.error(e)},children:p.map((e=>(0,m.jsx)(h.A,{pageNumber:e+1,renderAnnotationLayer:!1,renderTextLayer:!1,renderForms:!1},`render-page-${e}`)))})})]})};var p=n(48245),j=n(21383);const b=e=>{let{bucketName:t,actualInfo:n,isFullscreen:o=!1}=e;const a=(0,j.jL)(),[c,u]=(0,s.useState)(!0),[h,b]=(0,s.useState)(null),[g,f]=(0,s.useState)(!1),v=(null===n||void 0===n?void 0:n.name)||"",_=(0,s.useCallback)((()=>{g||d.F.buckets.getObjectMetadata(t,{prefix:v,versionID:n.version_id||""}).then((e=>{let t=l()(e.data,"objectMetadata",{});f(!0),b(t)})).catch((e=>{console.error("Error Getting Metadata Status: ",e,null===e||void 0===e?void 0:e.detailedError),f(!0)}))}),[t,v,g,n.version_id]);(0,s.useEffect)((()=>{t&&v&&_()}),[t,v,_]);let S="";if(n){let e=document.baseURI.replace(window.location.origin,"");S=`${window.location.origin}${e}api/v1/buckets/${encodeURIComponent(t)}/objects/download?preview=true&prefix=${encodeURIComponent(n.name||"")}`,n.version_id&&(S=S.concat(`&version_id=${n.version_id}`))}let O=(0,r.IZ)(h,v);const w=()=>{u(!1)};return(0,m.jsxs)(s.Fragment,{children:["none"!==O&&c&&(0,m.jsx)(i.xA9,{item:!0,xs:12,children:(0,m.jsx)(i.z21,{})}),g?(0,m.jsxs)(i.azJ,{sx:{textAlign:"center","& .iframeContainer":{border:"0px",flex:"1 1 auto",width:"100%",height:250,backgroundColor:"transparent",borderRadius:5,"&.image":{height:500},"&.audio":{height:150},"&.video":{height:350},"&.fullHeight":{height:"calc(100vh - 185px)"}},"& .iframeBase":{backgroundColor:"#fff"},"& .iframeHidden":{display:"none"}},children:["video"===O&&(0,m.jsx)("video",{style:{width:"auto",height:"auto",maxWidth:"calc(100vw - 100px)",maxHeight:"calc(100vh - 200px)"},autoPlay:!0,controls:!0,muted:!1,playsInline:!0,onPlay:w,children:(0,m.jsx)("source",{src:S,type:"video/mp4"})}),"audio"===O&&(0,m.jsx)("audio",{style:{width:"100%",height:"auto"},autoPlay:!0,controls:!0,muted:!1,playsInline:!0,onPlay:w,children:(0,m.jsx)("source",{src:S,type:"audio/mpeg"})}),"image"===O&&(0,m.jsx)("img",{style:{width:"auto",height:"auto",maxWidth:"100vw",maxHeight:"100vh"},src:S,alt:"preview",onLoad:w}),"pdf"===O&&(0,m.jsx)(s.Fragment,{children:(0,m.jsx)(x,{path:S,onLoad:w,loading:c,downloadFile:()=>(0,p._)(a,t,S,n)})}),"none"===O&&(0,m.jsx)("div",{children:(0,m.jsx)(i.Wei,{message:" File couldn't be previewed using file extension or mime type. Please try Download instead",title:"Preview unavailable",sx:{margin:"15px 0"}})}),"none"!==O&&"video"!==O&&"audio"!==O&&"image"!==O&&"pdf"!==O&&(0,m.jsx)("div",{className:"iframeBase "+(c?"iframeHidden":""),children:(0,m.jsx)("iframe",{src:S,title:"File Preview",allowTransparency:!0,className:`iframeContainer ${o?"fullHeight":O}`,onLoad:w,children:"File couldn't be loaded. Please try Download instead"})})]}):null]})},g=e=>{let{open:t,bucketName:n,actualInfo:a,onClosePreview:l}=e;return(0,m.jsx)(s.Fragment,{children:(0,m.jsx)(o.A,{modalOpen:t,title:`Preview - ${null===a||void 0===a?void 0:a.name}`,onClose:l,wideLimit:!1,titleIcon:(0,m.jsx)(i.jG,{}),children:(0,m.jsx)(b,{bucketName:n,actualInfo:a})})})}},72237:(e,t,n)=>{n.d(t,{A:()=>i});var s=n(65043),o=n(70579);const i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n){return(0,o.jsx)(s.Suspense,{fallback:t,children:(0,o.jsx)(e,{...n})})}}},25448:(e,t,n)=>{n.d(t,{A:()=>i});var s=n(65043),o=n(20649);const i=(e,t)=>{const[n,i]=(0,s.useState)(!1);return[n,(n,s,a,l)=>{i(!0),o.A.invoke(n,s,a,l).then((t=>{i(!1),e(t)})).catch((e=>{i(!1),t(e)}))}]}},94141:(e,t,n)=>{n.d(t,{A:()=>c});var s=n(65043),o=n(22166),i=n(89923),a=n(21383),l=n(64159),r=n(49555),d=n(70579);const c=e=>{let{onClose:t,modalOpen:n,title:c,children:u,wideLimit:h=!0,titleIcon:m=null,iconColor:x="default",sx:p}=e;const j=(0,a.jL)(),[b,g]=(0,s.useState)(!1),f=(0,o.d4)((e=>e.system.modalSnackBar));(0,s.useEffect)((()=>{j((0,l.h0)(""))}),[j]),(0,s.useEffect)((()=>{if(f){if(""===f.message)return void g(!1);"error"!==f.type&&g(!0)}}),[f]);let v="";return f&&(v=f.detailedErrorMsg,(""===v||v&&v.length<5)&&(v=f.message)),(0,d.jsxs)(i.ngX,{onClose:t,open:n,title:c,titleIcon:m,widthLimit:h,sx:p,iconColor:x,children:[(0,d.jsx)(r.A,{isModal:!0}),(0,d.jsx)(i.qb_,{onClose:()=>{g(!1),j((0,l.h0)(""))},open:b,message:v,mode:"inline",variant:"error"===f.type?"error":"default",autoHideDuration:"error"===f.type?10:5,condensed:!0}),u]})}},81708:(e,t,n)=>{n.d(t,{Ex:()=>p,HS:()=>h,mS:()=>m,op:()=>u,oz:()=>x});var s=n(80907),o=n(56483),i=n(37414),a=n(93445),l=n(6035),r=n(64159),d=n(24241),c=n(56629);const u=(0,s.zD)("objectBrowser/downloadSelected",(async(e,t)=>{let{getState:n,rejectWithValue:s,dispatch:c}=t;const u=n(),h=t=>{const n=encodeURIComponent(`${e}-${t.name}-${(new Date).getTime()}-${Math.random()}`),s=(0,i.E0)(8),o=(0,a.RG)(e,t.name,t.version_id,t.size,null,s,(e=>{c((0,l.DW)({instanceID:n,progress:e}))}),(()=>{c((0,l.rx)(n))}),(e=>{c((0,l.iL)({instanceID:n,msg:e}))}),(()=>{c((0,l.Dm)(n))}),(()=>{c((0,r.Hk)("File download will be handled directly by the browser."))}));(0,i.FP)(s,o),c((0,l.cP)({ID:s,bucketName:e,done:!1,instanceID:n,percentage:0,prefix:t.name,type:"download",waitingForFile:!0,failed:!1,cancelled:!1,errorMessage:""}))};if(0!==u.objectBrowser.selectedObjects.length){let t=[];const n=e=>u.objectBrowser.selectedObjects.includes(e.name);if(t=u.objectBrowser.records.filter(n),1===t.length){if(t[0].name.length>200&&(0,o.oK)().toLowerCase().includes("win"))return void c((0,l.Ew)(t[0]));h(t[0])}else if(1===t.length)h(t[0]);else if(t.length>1){const n=`${d.c9.now().toFormat("LL-dd-yyyy-HH-mm-ss")}_files_list.zip`,s=t.reduce(((e,t)=>{const n=null===t||void 0===t?void 0:t.delete_flag;return t&&!n?e.push(t.name):console.log(`Skipping ${null===t||void 0===t?void 0:t.name} from download.`),e}),[]);return void await(0,a.Fj)(e,s,n)}}})),h=(0,s.zD)("objectBrowser/openPreview",(async(e,t)=>{let{getState:n,rejectWithValue:s,dispatch:o}=t;const i=n();if(1===i.objectBrowser.selectedObjects.length){let e;const t=e=>i.objectBrowser.selectedObjects.includes(e.name);e=i.objectBrowser.records.find(t),e&&(o((0,l.go)(e)),o((0,l.xE)(!0)))}})),m=(0,s.zD)("objectBrowser/openShare",(async(e,t)=>{let{getState:n,rejectWithValue:s,dispatch:o}=t;const i=n();if(1===i.objectBrowser.selectedObjects.length){let e;const t=e=>i.objectBrowser.selectedObjects.includes(e.name);e=i.objectBrowser.records.find(t),e&&(o((0,l.go)(e)),o((0,l.Lf)(!0)))}})),x=(0,s.zD)("objectBrowser/openAnonymousAccess",(async(e,t)=>{let{getState:n,dispatch:s}=t;const o=n();1===o.objectBrowser.selectedObjects.length&&o.objectBrowser.selectedObjects[0].endsWith("/")&&s((0,l.I8)(!0))})),p=(0,s.zD)("objectBrowser/maxShareLinkExpTime",(async(e,t)=>{let{rejectWithValue:n,dispatch:s}=t;return c.F.buckets.getMaxShareLinkExp().then((e=>{s((0,l.QV)(e.data.exp))})).catch((async e=>n(e.error)))}))},48245:(e,t,n)=>{n.d(t,{_:()=>r});var s=n(56483),o=n(37414),i=n(93445),a=n(6035),l=n(64159);const r=(e,t,n,r)=>{var d;const c=encodeURIComponent(`${t}-${r.name}-${(new Date).getTime()}-${Math.random()}`),u=(0,s.oK)().toLowerCase().includes("win");if(((null===(d=r.name)||void 0===d?void 0:d.length)||0)>200&&u)return void e((0,a.Jl)(!0));const h=(0,o.E0)(8),m=(0,i.RG)(t,n,r.version_id,r.size||0,null,h,(t=>{e((0,a.DW)({instanceID:c,progress:t}))}),(()=>{e((0,a.rx)(c))}),(t=>{e((0,a.iL)({instanceID:c,msg:t}))}),(()=>{e((0,a.Dm)(c))}),(()=>{e((0,l.Hk)("File download will be handled directly by the browser."))}));(0,o.FP)(h,m),e((0,a.cP)({ID:h,bucketName:t,done:!1,instanceID:c,percentage:0,prefix:r.name||"",type:"download",waitingForFile:!0,failed:!1,cancelled:!1,errorMessage:""}))}}}]); -//# sourceMappingURL=182.6e133743.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/182.6e133743.chunk.js.map b/web-app/build/static/js/182.6e133743.chunk.js.map deleted file mode 100644 index ca3cacbbd..000000000 --- a/web-app/build/static/js/182.6e133743.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"static/js/182.6e133743.chunk.js","mappings":"2OA0CA,MA0GA,EA1GsBA,IAKC,IALA,UACrBC,EAAS,QACTC,EAAO,OACPC,EAAM,eACNC,GACeJ,EACf,MAAMK,GAAWC,EAAAA,EAAAA,OAEVC,EAAQC,IAAaC,EAAAA,EAAAA,UAAS,KAC9BC,EAAgBC,IAAqBF,EAAAA,EAAAA,UAAc,aAE1DG,EAAAA,EAAAA,YAAU,KACJR,GACFI,EAAUJ,EACZ,GACC,CAACA,IA6BJ,OACES,EAAAA,EAAAA,KAACC,EAAAA,EAAY,CACXb,UAAWA,EACXc,MAAM,4BACNb,QAASA,EACTc,WAAWH,EAAAA,EAAAA,KAACI,EAAAA,IAAiB,IAAIC,UAEjCC,EAAAA,EAAAA,MAACC,EAAAA,IAAU,CAACC,aAAa,EA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,QAAO,IAE7D,KACEt6B,GAASg7B,EAAAA,EAAAA,IAAmBiP,GAAkB,IAEhD,KACEjqC,GACEoD,EAAAA,EAAAA,IACE,0DAEH,KAILg4B,EAAAA,EAAAA,IAAyBnC,EAAIiR,GAC7BlqC,GACEq7B,EAAAA,EAAAA,IAAa,CACXpC,KACA/yB,aACAo1B,MAAM,EACNjB,WAAY4P,EACZ1O,WAAY,EACZr7B,OAAQ4uB,EAAOxtB,MAAQ,GACvBmB,KAAM,WACN+4B,gBAAgB,EAChBC,QAAQ,EACRC,WAAW,EACX3c,aAAc,KAEjB,C","sources":["screens/Console/Buckets/BucketDetails/AddAccessRule.tsx","screens/Console/Buckets/ListBuckets/UploadPermissionUtils.ts","screens/Console/ObjectBrowser/BrowserBreadcrumbs.tsx","utils/validationFunctions.ts","screens/Console/Buckets/ListBuckets/UploadFilesButton.tsx","screens/Console/Buckets/ListBuckets/Objects/ListObjects/DetailsListPanel.tsx","screens/Console/Buckets/ListBuckets/Objects/ListObjects/IconWithLabel.tsx","screens/Console/Buckets/ListBuckets/Objects/ListObjects/utils.tsx","screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/ObjectMetaData.tsx","screens/Console/Common/FormComponents/DateSelector/utils.ts","screens/Console/Common/FormComponents/DateSelector/DateSelector.tsx","screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/SetRetention.tsx","screens/Console/Buckets/ListBuckets/Objects/ListObjects/DeleteObject.tsx","screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/SetLegalHoldModal.tsx","screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/TagsModal.tsx","screens/Console/Tools/KeyRevealer.tsx","screens/Console/Buckets/ListBuckets/Objects/ListObjects/InspectObject.tsx","screens/Console/ObjectBrowser/RenameLongFilename.tsx","screens/Console/Buckets/ListBuckets/Objects/ListObjects/ObjectDetailPanel.tsx","screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/RestoreFileVersion.tsx","screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/SpecificVersionPill.tsx","screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/FileVersionItem.tsx","screens/Console/Buckets/ListBuckets/Objects/ListObjects/DeleteNonCurrent.tsx","screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/DeleteSelectedVersions.tsx","screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/VersionsNavigator.tsx","screens/Console/Buckets/ListBuckets/Objects/ListObjects/ListObjectsHelpers.tsx","screens/Console/Buckets/ListBuckets/Objects/ListObjects/ListObjectsTable.tsx","screens/Console/ObjectBrowser/FilterObjectsSB.tsx","screens/Console/Buckets/ListBuckets/Objects/ListObjects/ListObjects.tsx","screens/Console/ObjectBrowser/OBHeader.tsx","screens/Console/Buckets/BucketDetails/BrowserHandler.tsx","screens/Console/Common/FormComponents/DaysSelector/DaysSelector.tsx","screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/ShareFile.tsx","screens/Console/Buckets/ListBuckets/Objects/Preview/PreviewPDF.tsx","screens/Console/Buckets/ListBuckets/Objects/Preview/PreviewFileContent.tsx","screens/Console/Buckets/ListBuckets/Objects/Preview/PreviewFileModal.tsx","screens/Console/Common/Components/withSuspense.tsx","screens/Console/Common/Hooks/useApi.tsx","screens/Console/Common/ModalWrapper/ModalWrapper.tsx","screens/Console/ObjectBrowser/objectBrowserThunks.ts","screens/Console/ObjectBrowser/utils.ts"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState, Fragment } from \"react\";\nimport ModalWrapper from \"../../Common/ModalWrapper/ModalWrapper\";\nimport {\n AddAccessRuleIcon,\n Button,\n FormLayout,\n Grid,\n InputBox,\n Select,\n} from \"mds\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport { modalStyleUtils } from \"../../Common/FormComponents/common/styleLibrary\";\nimport {\n setErrorSnackMessage,\n setSnackBarMessage,\n} from \"../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../store\";\n\ninterface IAddAccessRule {\n modalOpen: boolean;\n onClose: () => any;\n bucket: string;\n prefilledRoute?: string;\n}\n\nconst AddAccessRule = ({\n modalOpen,\n onClose,\n bucket,\n prefilledRoute,\n}: IAddAccessRule) => {\n const dispatch = useAppDispatch();\n\n const [prefix, setPrefix] = useState(\"\");\n const [selectedAccess, setSelectedAccess] = useState(\"readonly\");\n\n useEffect(() => {\n if (prefilledRoute) {\n setPrefix(prefilledRoute);\n }\n }, [prefilledRoute]);\n\n const accessOptions = [\n { label: \"readonly\", value: \"readonly\" },\n { label: \"writeonly\", value: \"writeonly\" },\n { label: \"readwrite\", value: \"readwrite\" },\n ];\n\n const resetForm = () => {\n setPrefix(\"\");\n setSelectedAccess(\"readonly\");\n };\n\n const createProcess = () => {\n api.bucket\n .setAccessRuleWithBucket(bucket, {\n prefix: prefix,\n access: selectedAccess,\n })\n .then((res: any) => {\n dispatch(setSnackBarMessage(\"Access Rule added successfully\"));\n onClose();\n })\n .catch((res) => {\n dispatch(setErrorSnackMessage(errorToHandler(res.error)));\n onClose();\n });\n };\n\n return (\n }\n >\n \n {\n setPrefix(e.target.value);\n }}\n tooltip={\n \"Enter '/' to apply the rule to all prefixes and objects at the bucket root. Do not include the wildcard asterisk '*' as part of the prefix *unless* it is an explicit part of the prefix name. The Console automatically appends an asterisk to the appropriate sections of the resulting IAM policy.\"\n }\n />\n {\n setSelectedAccess(value);\n }}\n label=\"Access\"\n value={selectedAccess}\n options={accessOptions}\n disabled={false}\n helpTip={\n \n Select the desired level of access available to unauthenticated\n Users\n \n }\n helpTipPlacement=\"right\"\n />\n \n \n\n \n \n \n \n );\n};\n\nexport default AddAccessRule;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2023 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nexport const extractFileExtn = (resourceStr: string) => {\n //file extensions may contain query string. so exclude query strings !\n return (resourceStr.match(/\\.([^.]*?)(?=\\?|#|$)/) || [])[1];\n};\nexport const getPolicyAllowedFileExtensions = (\n sessionGrants: Record,\n uploadPath: string,\n scopes: string[] = [],\n) => {\n const sessionGrantWildCards = getSessionGrantsWildCard(\n sessionGrants,\n uploadPath,\n scopes,\n );\n\n //get acceptable files if any in the policy.\n const allowedFileExtensions = sessionGrantWildCards.reduce(\n (acc: string[], cv: string) => {\n const extension: string = extractFileExtn(cv);\n if (extension) {\n acc.push(`.${extension}`); //strict extension matching.\n }\n return acc;\n },\n [],\n );\n\n const uniqueExtensions = [...new Set(allowedFileExtensions)];\n return uniqueExtensions.join(\",\");\n};\n\n// The resource should not have the extensions (*.ext) for the hasPermission to work.\n// so sanitize this and also use to extract the allowed extensions outside of permission check.\nexport const getSessionGrantsWildCard = (\n sessionGrants: Record,\n uploadPath: string,\n scopes: string[] = [],\n) => {\n //get only the path matching grants to reduce processing.\n const grantsWithExtension = Object.keys(sessionGrants).reduce(\n (acc: Record, grantKey: string) => {\n if (extractFileExtn(grantKey) && grantKey.includes(uploadPath)) {\n acc[grantKey] = sessionGrants[grantKey];\n }\n return acc;\n },\n {},\n );\n\n const checkPathsForPermission = (sessionGrantKey: string) => {\n const grantActions = grantsWithExtension[sessionGrantKey];\n const hasScope = grantActions.some((actionKey) =>\n scopes.find((scopeKey) => {\n let wildCardMatch = false;\n const hasWildCard = scopeKey.indexOf(\"*\") !== -1;\n if (hasWildCard) {\n const scopeActionKey = scopeKey.substring(0, scopeKey.length - 1);\n\n wildCardMatch = actionKey.includes(scopeActionKey);\n }\n\n return wildCardMatch || actionKey === scopeKey;\n }),\n );\n\n const sessionGrantKeyPath = sessionGrantKey.substring(\n 0,\n sessionGrantKey.indexOf(\"/*.\"), //start of extension part.\n );\n const isUploadPathMatching =\n sessionGrantKeyPath === `arn:aws:s3:::${uploadPath}`;\n\n const hasGrant =\n isUploadPathMatching && sessionGrantKey !== \"arn:aws:s3:::*\";\n\n return hasScope && hasGrant;\n };\n\n return Object.keys(grantsWithExtension).filter(checkPathsForPermission);\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport CopyToClipboard from \"react-copy-to-clipboard\";\nimport styled from \"styled-components\";\nimport { Link, useNavigate } from \"react-router-dom\";\nimport { safeDecodeURIComponent } from \"../../../common/utils\";\nimport {\n Button,\n CopyIcon,\n NewPathIcon,\n Tooltip,\n Breadcrumbs,\n breakPoints,\n Box,\n} from \"mds\";\nimport { hasPermission } from \"../../../common/SecureComponent\";\nimport {\n IAM_SCOPES,\n permissionTooltipHelper,\n} from \"../../../common/SecureComponent/permissions\";\nimport withSuspense from \"../Common/Components/withSuspense\";\nimport { setSnackBarMessage } from \"../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../store\";\nimport { setVersionsModeEnabled } from \"./objectBrowserSlice\";\nimport { getSessionGrantsWildCard } from \"../Buckets/ListBuckets/UploadPermissionUtils\";\n\nconst CreatePathModal = withSuspense(\n React.lazy(\n () => import(\"../Buckets/ListBuckets/Objects/ListObjects/CreatePathModal\"),\n ),\n);\n\nconst BreadcrumbsMain = styled.div(() => ({\n display: \"flex\",\n \"& .additionalOptions\": {\n paddingRight: \"10px\",\n display: \"flex\",\n alignItems: \"center\",\n [`@media (max-width: ${breakPoints.lg}px)`]: {\n display: \"none\",\n },\n },\n \"& .slashSpacingStyle\": {\n margin: \"0 5px\",\n },\n}));\n\ninterface IObjectBrowser {\n bucketName: string;\n internalPaths: string;\n hidePathButton?: boolean;\n additionalOptions?: React.ReactNode;\n}\n\nconst BrowserBreadcrumbs = ({\n bucketName,\n internalPaths,\n hidePathButton,\n additionalOptions,\n}: IObjectBrowser) => {\n const dispatch = useAppDispatch();\n const navigate = useNavigate();\n\n const rewindEnabled = useSelector(\n (state: AppState) => state.objectBrowser.rewind.rewindEnabled,\n );\n const versionsMode = useSelector(\n (state: AppState) => state.objectBrowser.versionsMode,\n );\n const versionedFile = useSelector(\n (state: AppState) => state.objectBrowser.versionedFile,\n );\n const anonymousMode = useSelector(\n (state: AppState) => state.system.anonymousMode,\n );\n\n const [createFolderOpen, setCreateFolderOpen] = useState(false);\n const [canCreateSubpath, setCanCreateSubpath] = useState(false);\n\n const putObjectPermScopes = [\n IAM_SCOPES.S3_PUT_OBJECT,\n IAM_SCOPES.S3_PUT_ACTIONS,\n ];\n\n const sessionGrants = useSelector((state: AppState) =>\n state.console.session ? state.console.session.permissions || {} : {},\n );\n\n let paths = internalPaths;\n\n if (internalPaths !== \"\") {\n paths = `/${internalPaths}`;\n }\n\n const splitPaths = paths.split(\"/\").filter((path) => path !== \"\");\n const lastBreadcrumbsIndex = splitPaths.length - 1;\n\n const pathToCheckPerms = bucketName + paths || bucketName;\n const sessionGrantWildCards = getSessionGrantsWildCard(\n sessionGrants,\n pathToCheckPerms,\n putObjectPermScopes,\n );\n\n useEffect(() => {\n setCanCreateSubpath(false);\n Object.keys(sessionGrants).forEach((grant) => {\n grant.includes(pathToCheckPerms) &&\n grant.includes(\"/*\") &&\n setCanCreateSubpath(true);\n });\n }, [pathToCheckPerms, internalPaths, sessionGrants]);\n\n const canCreatePath =\n hasPermission(\n [pathToCheckPerms, ...sessionGrantWildCards],\n putObjectPermScopes,\n ) ||\n anonymousMode ||\n canCreateSubpath;\n\n let breadcrumbsMap = splitPaths.map((objectItem: string, index: number) => {\n const subSplit = `${splitPaths.slice(0, index + 1).join(\"/\")}/`;\n const route = `/browser/${encodeURIComponent(bucketName)}/${\n subSplit ? `${encodeURIComponent(subSplit)}` : ``\n }`;\n\n if (index === lastBreadcrumbsIndex && objectItem === versionedFile) {\n return null;\n }\n\n return (\n \n /\n {index === lastBreadcrumbsIndex ? (\n \n {safeDecodeURIComponent(objectItem) /*Only for display*/}\n \n ) : (\n {\n dispatch(\n setVersionsModeEnabled({ status: false, objectName: \"\" }),\n );\n }}\n >\n {\n safeDecodeURIComponent(\n objectItem,\n ) /*Only for display to preserve */\n }\n \n )}\n \n );\n });\n\n let versionsItem: any[] = [];\n\n if (versionsMode) {\n versionsItem = [\n \n \n /\n {versionedFile} - Versions\n \n ,\n ];\n }\n\n const listBreadcrumbs: any[] = [\n \n {\n dispatch(setVersionsModeEnabled({ status: false, objectName: \"\" }));\n }}\n >\n {bucketName}\n \n ,\n ...breadcrumbsMap,\n ...versionsItem,\n ];\n\n const closeAddFolderModal = () => {\n setCreateFolderOpen(false);\n };\n\n const goBackFunction = () => {\n if (versionsMode) {\n dispatch(setVersionsModeEnabled({ status: false, objectName: \"\" }));\n } else {\n if (splitPaths.length === 0) {\n navigate(\"/browser\");\n\n return;\n }\n\n const prevPath = splitPaths.slice(0, -1);\n\n navigate(\n `/browser/${bucketName}${\n prevPath.length > 0\n ? `/${encodeURIComponent(`${prevPath.join(\"/\")}/`)}`\n : \"\"\n }`,\n );\n }\n };\n\n return (\n \n \n {createFolderOpen && (\n \n )}\n \n \n \n }\n variant={\"regular\"}\n onClick={() => {\n dispatch(setSnackBarMessage(\"Path copied to clipboard\"));\n }}\n style={{\n width: \"28px\",\n height: \"28px\",\n color: \"#969FA8\",\n border: \"#969FA8 1px solid\",\n marginRight: 5,\n }}\n />\n \n {additionalOptions}\n \n }\n >\n {listBreadcrumbs}\n \n {!hidePathButton && (\n \n {\n setCreateFolderOpen(true);\n }}\n disabled={anonymousMode ? false : rewindEnabled || !canCreatePath}\n icon={}\n style={{\n whiteSpace: \"nowrap\",\n }}\n variant={\"regular\"}\n label={\"Create new path\"}\n />\n \n )}\n \n div\": {\n fontSize: 12,\n fontWeight: \"normal\",\n flexDirection: \"row\",\n flexWrap: \"nowrap\",\n },\n [`@media (max-width: ${breakPoints.lg}px)`]: {\n display: \"flex\",\n },\n }}\n >\n {additionalOptions}\n \n \n );\n};\n\nexport default BrowserBreadcrumbs;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nexport const isVersionedMode = (status: string | undefined) => {\n return status === \"Enabled\" || status === \"Suspended\";\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useState } from \"react\";\nimport { CSSObject } from \"styled-components\";\nimport { Button, DropdownSelector, UploadFolderIcon, UploadIcon } from \"mds\";\nimport {\n IAM_SCOPES,\n permissionTooltipHelper,\n} from \"../../../../common/SecureComponent/permissions\";\nimport { hasPermission } from \"../../../../common/SecureComponent\";\nimport TooltipWrapper from \"../../Common/TooltipWrapper/TooltipWrapper\";\nimport { useSelector } from \"react-redux\";\nimport { AppState } from \"../../../../store\";\nimport { getSessionGrantsWildCard } from \"./UploadPermissionUtils\";\n\ninterface IUploadFilesButton {\n uploadPath: string;\n bucketName: string;\n forceDisable?: boolean;\n uploadFileFunction: (closeFunction: () => void) => void;\n uploadFolderFunction: (closeFunction: () => void) => void;\n overrideStyles?: CSSObject;\n}\n\nconst UploadFilesButton = ({\n uploadPath,\n bucketName,\n forceDisable = false,\n uploadFileFunction,\n uploadFolderFunction,\n overrideStyles = {},\n}: IUploadFilesButton) => {\n const [anchorEl, setAnchorEl] = useState(null);\n const [uploadOptionsOpen, uploadOptionsSetOpen] = useState(false);\n\n const anonymousMode = useSelector(\n (state: AppState) => state.system.anonymousMode,\n );\n\n const sessionGrants = useSelector((state: AppState) =>\n state.console.session ? state.console.session.permissions || {} : {},\n );\n\n const putObjectPermScopes = [\n IAM_SCOPES.S3_PUT_OBJECT,\n IAM_SCOPES.S3_PUT_ACTIONS,\n ];\n\n const sessionGrantWildCards = getSessionGrantsWildCard(\n sessionGrants,\n uploadPath,\n putObjectPermScopes,\n );\n\n const openUploadMenu = Boolean(anchorEl);\n const handleClick = (event: React.MouseEvent) => {\n uploadOptionsSetOpen(!uploadOptionsOpen);\n setAnchorEl(event.currentTarget);\n };\n const handleCloseUpload = () => {\n setAnchorEl(null);\n };\n\n const uploadObjectAllowed =\n hasPermission(\n [uploadPath, ...sessionGrantWildCards],\n putObjectPermScopes,\n ) || anonymousMode;\n\n const uploadFolderAllowed = hasPermission(\n [bucketName, ...sessionGrantWildCards],\n putObjectPermScopes,\n false,\n true,\n );\n\n const uploadFolderAction = (action: string) => {\n if (action === \"folder\") {\n uploadFolderFunction(handleCloseUpload);\n return;\n }\n\n uploadFileFunction(handleCloseUpload);\n };\n\n const uploadEnabled: boolean = uploadObjectAllowed || uploadFolderAllowed;\n\n return (\n \n \n }\n variant={\"callAction\"}\n disabled={forceDisable || !uploadEnabled}\n sx={overrideStyles}\n />\n \n ,\n value: \"file\",\n disabled: !uploadObjectAllowed || forceDisable,\n },\n {\n label: \"Upload Folder\",\n icon: ,\n value: \"folder\",\n disabled: !uploadFolderAllowed || forceDisable,\n },\n ]}\n selectedOption={\"\"}\n onSelect={(nValue) => uploadFolderAction(nValue)}\n hideTriggerAction={() => {\n uploadOptionsSetOpen(false);\n }}\n open={uploadOptionsOpen}\n anchorEl={anchorEl}\n anchorOrigin={\"end\"}\n useAnchorWidth\n />\n \n );\n};\n\nexport default UploadFilesButton;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Box, Button, ClosePanelIcon } from \"mds\";\n\ninterface IDetailsListPanel {\n open: boolean;\n className?: string;\n closePanel: () => void;\n children: React.ReactNode;\n}\n\nconst DetailsListPanel = ({\n open,\n closePanel,\n className = \"\",\n children,\n}: IDetailsListPanel) => {\n return (\n \n }\n sx={{\n position: \"absolute\",\n right: 5,\n top: 18,\n padding: 0,\n height: 14,\n \"&:hover:not(:disabled)\": {\n backgroundColor: \"transparent\",\n },\n }}\n />\n {children}\n \n );\n};\n\nexport default DetailsListPanel;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\n// This object contains variables that will be used across form components.\n\nimport React from \"react\";\nimport { Box } from \"mds\";\nimport { replaceUnicodeChar } from \"../../../../../../common/utils\";\n\ninterface IIconWithLabel {\n icon: React.ReactNode;\n strings: string[];\n}\n\nconst IconWithLabel = ({ icon, strings }: IIconWithLabel) => {\n return (\n \n {icon}\n \n {replaceUnicodeChar(strings[strings.length - 1])}\n \n \n );\n};\n\nexport default IconWithLabel;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\n\nimport {\n FileBookIcon,\n FileCodeIcon,\n FileConfigIcon,\n FileDbIcon,\n FileFontIcon,\n FileImageIcon,\n FileLockIcon,\n FileMissingIcon,\n FileMusicIcon,\n FileNonType,\n FilePdfIcon,\n FilePptIcon,\n FileTxtIcon,\n FileVideoIcon,\n FileXlsIcon,\n FileZipIcon,\n FolderBrowserIcon,\n} from \"mds\";\nimport IconWithLabel from \"./IconWithLabel\";\n\ninterface IExtToIcon {\n icon: any;\n extensions: string[];\n}\n\nconst extensionToIcon: IExtToIcon[] = [\n {\n icon: ,\n extensions: [\"mp4\", \"mov\", \"avi\", \"mpeg\", \"mpg\"],\n },\n {\n icon: ,\n extensions: [\"mp3\", \"m4a\", \"aac\"],\n },\n {\n icon: ,\n extensions: [\"pdf\"],\n },\n {\n icon: ,\n extensions: [\"ppt\", \"pptx\"],\n },\n {\n icon: ,\n extensions: [\"xls\", \"xlsx\"],\n },\n {\n icon: ,\n extensions: [\"cer\", \"crt\", \"pem\"],\n },\n {\n icon: ,\n extensions: [\"html\", \"xml\", \"css\", \"py\", \"go\", \"php\", \"cpp\", \"h\", \"java\"],\n },\n {\n icon: ,\n extensions: [\"cfg\", \"yaml\"],\n },\n {\n icon: ,\n extensions: [\"sql\"],\n },\n {\n icon: ,\n extensions: [\"ttf\", \"otf\"],\n },\n {\n icon: ,\n extensions: [\"doc\", \"docx\", \"txt\", \"rtf\"],\n },\n {\n icon: ,\n extensions: [\"zip\", \"rar\", \"tar\", \"gz\"],\n },\n {\n icon: ,\n extensions: [\"epub\", \"mobi\", \"azw\", \"azw3\"],\n },\n {\n icon: ,\n extensions: [\"jpeg\", \"jpg\", \"gif\", \"tiff\", \"png\", \"heic\", \"dng\"],\n },\n];\n\nexport const displayFileIconName = (\n element: string,\n returnOnlyIcon: boolean = false,\n) => {\n let elementString = element;\n let icon = ;\n // Element is a folder\n if (element.endsWith(\"/\")) {\n icon = ;\n elementString = element.slice(0, -1);\n }\n\n const lowercaseElement = element.toLowerCase();\n for (const etc of extensionToIcon) {\n for (const ext of etc.extensions) {\n if (lowercaseElement.endsWith(`.${ext}`)) {\n icon = etc.icon;\n }\n }\n }\n\n if (!element.endsWith(\"/\") && element.indexOf(\".\") < 0) {\n icon = ;\n }\n\n const splitItem = elementString.split(\"/\");\n\n if (returnOnlyIcon) {\n return icon;\n }\n\n return ;\n};\n\nexport const sanitizeFilePath = (filePath: string) => {\n // Replace `./` at the start of the path or preceded by `/` - happens when drag drop upload of files (not folders !) in chrome\n return filePath.replace(/(^|\\/)\\.\\//g, \"/\");\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport { Box } from \"mds\";\nimport { safeDecodeURIComponent } from \"../../../../../../common/utils\";\n\ninterface IObjectMetadata {\n metaData: any;\n}\n\nconst itemRendererFn = (element: any) => {\n return Array.isArray(element)\n ? element.map(safeDecodeURIComponent).join(\", \")\n : safeDecodeURIComponent(element);\n};\n\nconst ObjectMetaData = ({ metaData }: IObjectMetadata) => {\n const metaKeys = Object.keys(metaData);\n\n return (\n \n {metaKeys.map((element: string, index: number) => {\n const renderItem = itemRendererFn(metaData[element]);\n return (\n \n {element}\n
\n {renderItem}\n \n );\n })}\n
\n );\n};\n\nexport default ObjectMetaData;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nexport const months = [\n { value: \"01\", label: \"January\" },\n { value: \"02\", label: \"February\" },\n { value: \"03\", label: \"March\" },\n { value: \"04\", label: \"April\" },\n { value: \"05\", label: \"May\" },\n { value: \"06\", label: \"June\" },\n { value: \"07\", label: \"July\" },\n { value: \"08\", label: \"August\" },\n { value: \"09\", label: \"September\" },\n { value: \"10\", label: \"October\" },\n { value: \"11\", label: \"November\" },\n { value: \"12\", label: \"December\" },\n];\n\nexport const days = Array.from(Array(31), (_, num) => ({\n value: (num + 1).toString(),\n label: (num + 1).toString(),\n}));\n\nconst currentYear = new Date().getFullYear();\n\nexport const years = Array.from(Array(50), (_, numYear) => ({\n value: (numYear + currentYear).toString(),\n label: (numYear + currentYear).toString(),\n}));\n\nexport const validDate = (year: string, month: string, day: string): any[] => {\n const currentDate = Date.parse(`${year}-${month}-${day}`);\n\n if (isNaN(currentDate)) {\n return [false, \"\"];\n }\n\n const parsedMonth = parseInt(month);\n const parsedDay = parseInt(day);\n\n const monthForString = parsedMonth < 10 ? `0${parsedMonth}` : parsedMonth;\n const dayForString = parsedDay < 10 ? `0${parsedDay}` : parsedDay;\n\n const parsedDate = new Date(currentDate).toISOString().split(\"T\")[0];\n const dateString = `${year}-${monthForString}-${dayForString}`;\n\n return [parsedDate === dateString, dateString];\n};\n\n// twoDigitDate gets a two digit string number used for months or days\n// returns \"NaN\" if number is NaN\nexport const twoDigitDate = (num: number): string => {\n return num < 10 ? `0${num}` : `${num}`;\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useState,\n} from \"react\";\nimport { Box, HelpIcon, InputLabel, Select, Tooltip } from \"mds\";\nimport { days, months, validDate, years } from \"./utils\";\n\ninterface IDateSelectorProps {\n id: string;\n label: string;\n disableOptions?: boolean;\n tooltip?: string;\n borderBottom?: boolean;\n value?: string;\n onDateChange: (date: string, isValid: boolean) => any;\n}\n\nconst DateSelector = forwardRef(\n (\n {\n id,\n label,\n disableOptions = false,\n tooltip = \"\",\n borderBottom = false,\n onDateChange,\n value = \"\",\n }: IDateSelectorProps,\n ref: any,\n ) => {\n useImperativeHandle(ref, () => ({ resetDate }));\n\n const [month, setMonth] = useState(\"\");\n const [day, setDay] = useState(\"\");\n const [year, setYear] = useState(\"\");\n\n useEffect(() => {\n // verify if there is a current value\n // assume is in the format \"2021-12-30\"\n if (value !== \"\") {\n const valueSplit = value.split(\"-\");\n\n setYear(valueSplit[0]);\n setMonth(valueSplit[1]);\n // Turn to single digit to be displayed on dropdown buttons\n setDay(`${parseInt(valueSplit[2])}`);\n }\n }, [value]);\n\n useEffect(() => {\n const [isValid, dateString] = validDate(year, month, day);\n onDateChange(dateString, isValid);\n }, [month, day, year, onDateChange]);\n\n const resetDate = () => {\n setMonth(\"\");\n setDay(\"\");\n setYear(\"\");\n };\n\n const isDateDisabled = () => {\n if (disableOptions) {\n return disableOptions;\n } else {\n return false;\n }\n };\n\n const monthForDropDown = [{ value: \"\", label: \"\" }, ...months];\n const daysForDrop = [{ value: \"\", label: \"\" }, ...days];\n const yearsForDrop = [{ value: \"\", label: \"\" }, ...years];\n\n return (\n \n \n \n {label}\n {tooltip !== \"\" && (\n \n \n \n \n \n \n \n )}\n \n \n \n {\n setMonth(newValue);\n }}\n options={monthForDropDown}\n label={\"\"}\n disabled={isDateDisabled()}\n />\n\n {\n setDay(newValue);\n }}\n options={daysForDrop}\n label={\"\"}\n disabled={isDateDisabled()}\n />\n\n {\n setYear(newValue);\n }}\n options={yearsForDrop}\n label={\"\"}\n disabled={isDateDisabled()}\n sx={{\n marginBottom: 12,\n }}\n />\n \n \n );\n },\n);\n\nexport default DateSelector;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { Box, Button, FormLayout, Grid, RadioGroup, Switch } from \"mds\";\nimport { useSelector } from \"react-redux\";\nimport { BucketObject, ObjectRetentionMode } from \"api/consoleApi\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport { modalStyleUtils } from \"../../../../Common/FormComponents/common/styleLibrary\";\nimport { twoDigitDate } from \"../../../../Common/FormComponents/DateSelector/utils\";\nimport { setModalErrorSnackMessage } from \"../../../../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../../../../store\";\nimport ModalWrapper from \"../../../../Common/ModalWrapper/ModalWrapper\";\nimport DateSelector from \"../../../../Common/FormComponents/DateSelector/DateSelector\";\n\ninterface ISetRetentionProps {\n open: boolean;\n closeModalAndRefresh: (updateInfo: boolean) => void;\n objectName: string;\n bucketName: string;\n objectInfo: BucketObject;\n}\n\ninterface IRefObject {\n resetDate: () => void;\n}\n\nconst SetRetention = ({\n open,\n closeModalAndRefresh,\n objectName,\n objectInfo,\n bucketName,\n}: ISetRetentionProps) => {\n const dispatch = useAppDispatch();\n const retentionConfig = useSelector(\n (state: AppState) => state.objectBrowser.retentionConfig,\n );\n\n const [statusEnabled, setStatusEnabled] = useState(true);\n const [type, setType] = useState(\"\");\n const [date, setDate] = useState(\"\");\n const [isDateValid, setIsDateValid] = useState(false);\n const [isSaving, setIsSaving] = useState(false);\n const [alreadyConfigured, setAlreadyConfigured] = useState(false);\n\n useEffect(() => {\n if (objectInfo.retention_mode) {\n setType(retentionConfig?.mode || ObjectRetentionMode.Governance);\n setAlreadyConfigured(true);\n }\n // get retention_until_date if defined\n if (objectInfo.retention_until_date) {\n const valueDate = new Date(objectInfo.retention_until_date);\n if (valueDate.toString() !== \"Invalid Date\") {\n const year = valueDate.getFullYear();\n const month = twoDigitDate(valueDate.getMonth() + 1);\n const day = valueDate.getDate();\n if (!isNaN(day) && month !== \"NaN\" && !isNaN(year)) {\n setDate(`${year}-${month}-${day}`);\n }\n }\n setAlreadyConfigured(true);\n }\n }, [objectInfo, retentionConfig?.mode]);\n\n const dateElement = useRef(null);\n\n const dateFieldDisabled = () => {\n return !(statusEnabled && (type === \"governance\" || type === \"compliance\"));\n };\n\n const onSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n };\n\n const resetForm = () => {\n setStatusEnabled(false);\n setType(ObjectRetentionMode.Governance);\n if (dateElement.current) {\n dateElement.current.resetDate();\n }\n };\n\n const addRetention = (\n selectedObject: string,\n versionId: string | null,\n expireDate: string,\n ) => {\n api.buckets\n .putObjectRetention(\n bucketName,\n {\n prefix: selectedObject,\n version_id: versionId || \"\",\n },\n {\n expires: expireDate,\n mode: type as ObjectRetentionMode,\n },\n )\n .then(() => {\n setIsSaving(false);\n closeModalAndRefresh(true);\n })\n .catch((err) => {\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n setIsSaving(false);\n });\n };\n\n const disableRetention = (\n selectedObject: string,\n versionId: string | null,\n ) => {\n api.buckets\n .deleteObjectRetention(bucketName, {\n prefix: selectedObject,\n version_id: versionId || \"\",\n })\n .then(() => {\n setIsSaving(false);\n closeModalAndRefresh(true);\n })\n .catch((err) => {\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n setIsSaving(false);\n });\n };\n\n const saveNewRetentionPolicy = () => {\n setIsSaving(true);\n const selectedObject = objectInfo.name || \"\";\n const versionId = objectInfo.version_id || null;\n\n const expireDate =\n !statusEnabled && type === \"governance\" ? \"\" : `${date}T23:59:59Z`;\n\n if (!statusEnabled && type === \"governance\") {\n disableRetention(selectedObject, versionId);\n\n return;\n }\n\n addRetention(selectedObject, versionId, expireDate);\n };\n\n const showSwitcher =\n alreadyConfigured && (type === \"governance\" || type === \"\");\n\n return (\n {\n resetForm();\n closeModalAndRefresh(false);\n }}\n >\n ) => {\n onSubmit(e);\n }}\n >\n \n \n Selected Object: {objectName}\n \n {showSwitcher && (\n ) => {\n setStatusEnabled(!statusEnabled);\n }}\n label={\"Status\"}\n indicatorLabels={[\"Enabled\", \"Disabled\"]}\n />\n )}\n {\n setType(e.target.value as ObjectRetentionMode);\n }}\n selectorOptions={[\n { label: \"Governance\", value: ObjectRetentionMode.Governance },\n { label: \"Compliance\", value: ObjectRetentionMode.Compliance },\n ]}\n />\n {\n setIsDateValid(isValid);\n if (isValid) {\n setDate(date);\n }\n }}\n />\n \n \n \n \n \n \n \n );\n};\n\nexport default SetRetention;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useState } from \"react\";\nimport { ErrorResponseHandler } from \"../../../../../../common/types\";\nimport ConfirmDialog from \"../../../../Common/ModalWrapper/ConfirmDialog\";\nimport useApi from \"../../../../Common/Hooks/useApi\";\nimport { ConfirmDeleteIcon, Switch } from \"mds\";\nimport { setErrorSnackMessage } from \"../../../../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../../../../store\";\nimport { hasPermission } from \"../../../../../../common/SecureComponent\";\nimport { IAM_SCOPES } from \"../../../../../../common/SecureComponent/permissions\";\nimport { useSelector } from \"react-redux\";\nimport { isVersionedMode } from \"../../../../../../utils/validationFunctions\";\nimport { BucketVersioningResponse } from \"api/consoleApi\";\n\ninterface IDeleteObjectProps {\n closeDeleteModalAndRefresh: (refresh: boolean) => void;\n deleteOpen: boolean;\n selectedObject: string;\n selectedBucket: string;\n\n versioningInfo: BucketVersioningResponse | undefined;\n selectedVersion?: string;\n}\n\nconst DeleteObject = ({\n closeDeleteModalAndRefresh,\n deleteOpen,\n selectedBucket,\n selectedObject,\n versioningInfo,\n selectedVersion = \"\",\n}: IDeleteObjectProps) => {\n const dispatch = useAppDispatch();\n const onDelSuccess = () => closeDeleteModalAndRefresh(true);\n const onDelError = (err: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(err));\n\n // We close the modal box on access denied.\n if (err.detailedError === \"Access Denied.\") {\n closeDeleteModalAndRefresh(true);\n }\n };\n const onClose = () => closeDeleteModalAndRefresh(false);\n\n const [deleteLoading, invokeDeleteApi] = useApi(onDelSuccess, onDelError);\n const [deleteVersions, setDeleteVersions] = useState(false);\n const [bypassGovernance, setBypassGovernance] = useState(false);\n\n const retentionConfig = useSelector(\n (state: AppState) => state.objectBrowser.retentionConfig,\n );\n\n const canBypass =\n hasPermission(\n [selectedBucket],\n [IAM_SCOPES.S3_BYPASS_GOVERNANCE_RETENTION],\n ) && retentionConfig?.mode === \"governance\";\n\n if (!selectedObject) {\n return null;\n }\n const onConfirmDelete = () => {\n const recursive = selectedObject.endsWith(\"/\");\n invokeDeleteApi(\n \"DELETE\",\n `/api/v1/buckets/${encodeURIComponent(selectedBucket)}/objects?prefix=${encodeURIComponent(selectedObject)}${\n selectedVersion !== \"\"\n ? `&version_id=${encodeURIComponent(selectedVersion)}`\n : `&recursive=${recursive}&all_versions=${deleteVersions}`\n }${bypassGovernance ? \"&bypass=true\" : \"\"}`,\n );\n };\n\n return (\n }\n isLoading={deleteLoading}\n onConfirm={onConfirmDelete}\n onClose={onClose}\n confirmationContent={\n \n Are you sure you want to delete:
\n {selectedObject}{\" \"}\n {selectedVersion !== \"\" ? (\n \n
\n
\n Version ID:\n
\n {selectedVersion}\n
\n ) : (\n \"\"\n )}\n ?
\n
\n {isVersionedMode(versioningInfo?.status) &&\n selectedVersion === \"\" && (\n \n {\n setDeleteVersions(!deleteVersions);\n }}\n description=\"\"\n />\n \n )}\n {canBypass && (deleteVersions || selectedVersion !== \"\") && (\n \n \n {\n setBypassGovernance(!bypassGovernance);\n }}\n description=\"\"\n />\n \n \n )}\n {deleteVersions && (\n \n \n This will remove the object as well as all of its versions,{\" \"}\n
\n This action is irreversible.\n \n
\n Are you sure you want to continue?\n
\n )}\n
\n }\n />\n );\n};\n\nexport default DeleteObject;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState } from \"react\";\nimport get from \"lodash/get\";\nimport { Box, Button, FormLayout, Grid, Switch } from \"mds\";\nimport { BucketObject, ObjectLegalHoldStatus } from \"api/consoleApi\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport { modalStyleUtils } from \"../../../../Common/FormComponents/common/styleLibrary\";\nimport { setModalErrorSnackMessage } from \"../../../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../../../store\";\nimport ModalWrapper from \"../../../../Common/ModalWrapper/ModalWrapper\";\n\ninterface ISetRetentionProps {\n open: boolean;\n closeModalAndRefresh: (reload: boolean) => void;\n objectName: string;\n bucketName: string;\n actualInfo: BucketObject;\n}\n\nconst SetLegalHoldModal = ({\n open,\n closeModalAndRefresh,\n objectName,\n bucketName,\n actualInfo,\n}: ISetRetentionProps) => {\n const dispatch = useAppDispatch();\n const [legalHoldEnabled, setLegalHoldEnabled] = useState(false);\n const [isSaving, setIsSaving] = useState(false);\n const versionId = actualInfo.version_id;\n\n useEffect(() => {\n const status = get(actualInfo, \"legal_hold_status\", \"OFF\");\n setLegalHoldEnabled(status === \"ON\");\n }, [actualInfo]);\n\n const onSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n setIsSaving(true);\n\n api.buckets\n .putObjectLegalHold(\n bucketName,\n {\n prefix: objectName,\n version_id: versionId || \"\",\n },\n {\n status: legalHoldEnabled\n ? ObjectLegalHoldStatus.Enabled\n : ObjectLegalHoldStatus.Disabled,\n },\n )\n .then(() => {\n setIsSaving(false);\n closeModalAndRefresh(true);\n })\n .catch((err) => {\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n setIsSaving(false);\n });\n };\n\n const resetForm = () => {\n setLegalHoldEnabled(false);\n };\n\n return (\n {\n resetForm();\n closeModalAndRefresh(false);\n }}\n >\n ) => {\n onSubmit(e);\n }}\n >\n \n \n Object: {bucketName + \"/\" + objectName}\n \n ) => {\n setLegalHoldEnabled(!legalHoldEnabled);\n }}\n label={\"Legal Hold Status\"}\n indicatorLabels={[\"Enabled\", \"Disabled\"]}\n tooltip={\n \"To enable this feature you need to enable versioning on the bucket before creation\"\n }\n />\n \n \n \n \n \n \n \n );\n};\n\nexport default SetLegalHoldModal;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useState } from \"react\";\nimport get from \"lodash/get\";\nimport styled from \"styled-components\";\nimport {\n AddNewTagIcon,\n Button,\n DisabledIcon,\n EditTagIcon,\n InputBox,\n SectionTitle,\n Box,\n Grid,\n Tag,\n FormLayout,\n} from \"mds\";\nimport { BucketObject } from \"api/consoleApi\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport { useSelector } from \"react-redux\";\nimport ModalWrapper from \"../../../../Common/ModalWrapper/ModalWrapper\";\nimport { modalStyleUtils } from \"../../../../Common/FormComponents/common/styleLibrary\";\nimport { IAM_SCOPES } from \"../../../../../../common/SecureComponent/permissions\";\nimport { SecureComponent } from \"../../../../../../common/SecureComponent\";\nimport {\n selDistSet,\n setModalErrorSnackMessage,\n} from \"../../../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../../../store\";\n\ninterface ITagModal {\n modalOpen: boolean;\n bucketName: string;\n actualInfo: BucketObject;\n onCloseAndUpdate: (refresh: boolean) => void;\n}\n\nconst DeleteTag = styled.b(({ theme }) => ({\n color: get(theme, \"signalColors.danger\", \"#C83B51\"),\n marginLeft: 5,\n}));\n\nconst AddTagModal = ({\n modalOpen,\n onCloseAndUpdate,\n bucketName,\n actualInfo,\n}: ITagModal) => {\n const dispatch = useAppDispatch();\n const distributedSetup = useSelector(selDistSet);\n const [newKey, setNewKey] = useState(\"\");\n const [newLabel, setNewLabel] = useState(\"\");\n const [isSending, setIsSending] = useState(false);\n const [deleteEnabled, setDeleteEnabled] = useState(false);\n const [deleteKey, setDeleteKey] = useState(\"\");\n const [deleteLabel, setDeleteLabel] = useState(\"\");\n\n const currentTags = actualInfo.tags;\n const currTagKeys = Object.keys(currentTags || {});\n\n const allPathData = actualInfo.name?.split(\"/\");\n const currentItem = allPathData?.pop() || \"\";\n\n const resetForm = () => {\n setNewLabel(\"\");\n setNewKey(\"\");\n };\n\n const addTagProcess = () => {\n setIsSending(true);\n const newTag: any = {};\n\n newTag[newKey] = newLabel;\n const newTagList = { ...currentTags, ...newTag };\n\n const verID = distributedSetup ? actualInfo.version_id || \"\" : \"null\";\n\n api.buckets\n .putObjectTags(\n bucketName,\n { prefix: actualInfo.name || \"\", version_id: verID },\n { tags: newTagList },\n )\n .then(() => {\n onCloseAndUpdate(true);\n setIsSending(false);\n })\n .catch((err) => {\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n setIsSending(false);\n });\n };\n\n const deleteTagProcess = () => {\n const cleanObject: any = { ...currentTags };\n delete cleanObject[deleteKey];\n\n const verID = distributedSetup ? actualInfo.version_id || \"\" : \"null\";\n\n api.buckets\n .putObjectTags(\n bucketName,\n { prefix: actualInfo.name || \"\", version_id: verID },\n { tags: cleanObject },\n )\n .then(() => {\n onCloseAndUpdate(true);\n setIsSending(false);\n })\n .catch((err) => {\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n setIsSending(false);\n });\n };\n\n const onDeleteTag = (tagKey: string, tag: string) => {\n setDeleteKey(tagKey);\n setDeleteLabel(tag);\n setDeleteEnabled(true);\n };\n\n const cancelDelete = () => {\n setDeleteKey(\"\");\n setDeleteLabel(\"\");\n setDeleteEnabled(false);\n };\n\n const tagsFor = (plural: boolean) => (\n \n Tag{plural ? \"s\" : \"\"} for: {currentItem}\n \n );\n\n return (\n \n {\n onCloseAndUpdate(true);\n }}\n iconColor={deleteEnabled ? \"delete\" : \"default\"}\n titleIcon={deleteEnabled ? : }\n >\n {deleteEnabled ? (\n \n \n {tagsFor(false)}\n Are you sure you want to delete the tag{\" \"}\n \n {deleteKey} : {deleteLabel}\n {\" \"}\n ?\n \n \n \n \n \n \n ) : (\n \n \n \n {tagsFor(true)}\n \n Current Tags:\n
\n {currTagKeys.length === 0 ? (\n \n There are no tags for this object\n \n ) : (\n \n )}\n \n {currTagKeys.map((tagKey: string, index: number) => {\n const tag = get(currentTags, `${tagKey}`, \"\");\n if (tag !== \"\") {\n return (\n \n {\n onDeleteTag(tagKey, tag);\n }}\n />\n \n );\n }\n return null;\n })}\n \n
\n \n \n \n \n } separator={false}>\n Add New Tag\n \n \n {\n setNewKey(e.target.value);\n }}\n />\n {\n setNewLabel(e.target.value);\n }}\n />\n \n \n \n \n \n \n \n \n )}\n \n
\n );\n};\n\nexport default AddTagModal;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useState } from \"react\";\nimport { Button, CopyIcon, InputBox, Box, breakPoints } from \"mds\";\n\nconst KeyRevealer = ({ value }: { value: string }) => {\n const [shown, setShown] = useState(false);\n\n return (\n \n {}}\n value={value}\n overlayIcon={}\n readOnly={true}\n overlayAction={() => navigator.clipboard.writeText(value)}\n />\n\n setShown(!shown)}\n label={\"Show/Hide\"}\n />\n \n );\n};\n\nexport default KeyRevealer;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useState } from \"react\";\nimport {\n Button,\n InspectMenuIcon,\n PasswordKeyIcon,\n Switch,\n Grid,\n Box,\n} from \"mds\";\nimport {\n deleteCookie,\n getCookieValue,\n performDownload,\n} from \"../../../../../../common/utils\";\nimport ModalWrapper from \"../../../../Common/ModalWrapper/ModalWrapper\";\nimport { modalStyleUtils } from \"../../../../Common/FormComponents/common/styleLibrary\";\nimport KeyRevealer from \"../../../../Tools/KeyRevealer\";\nimport { setErrorSnackMessage } from \"../../../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../../../store\";\n\ninterface IInspectObjectProps {\n closeInspectModalAndRefresh: (refresh: boolean) => void;\n inspectOpen: boolean;\n inspectPath: string;\n volumeName: string;\n}\n\nconst InspectObject = ({\n closeInspectModalAndRefresh,\n inspectOpen,\n inspectPath,\n volumeName,\n}: IInspectObjectProps) => {\n const dispatch = useAppDispatch();\n const onClose = () => closeInspectModalAndRefresh(false);\n const [isEncrypt, setIsEncrypt] = useState(true);\n const [decryptionKey, setDecryptionKey] = useState(\"\");\n const [insFileName, setInsFileName] = useState(\"\");\n\n if (!inspectPath) {\n return null;\n }\n const makeRequest = async (url: string) => {\n return await fetch(url, { method: \"GET\" });\n };\n\n const performInspect = async () => {\n let basename = document.baseURI.replace(window.location.origin, \"\");\n const urlOfInspectApi = `${window.location.origin}${basename}/api/v1/admin/inspect?volume=${encodeURIComponent(volumeName)}&file=${encodeURIComponent(inspectPath + \"/xl.meta\")}&encrypt=${isEncrypt}`;\n\n makeRequest(urlOfInspectApi)\n .then(async (res) => {\n if (!res.ok) {\n const resErr: any = await res.json();\n\n dispatch(\n setErrorSnackMessage({\n errorMessage: resErr.message,\n detailedError: resErr.code,\n }),\n );\n }\n const blob: Blob = await res.blob();\n\n //@ts-ignore\n const filename = res.headers.get(\"content-disposition\").split('\"')[1];\n const decryptKey = getCookieValue(filename) || \"\";\n\n performDownload(blob, filename);\n setInsFileName(filename);\n if (decryptKey === \"\") {\n onClose();\n return;\n }\n setDecryptionKey(decryptKey);\n })\n .catch((err) => {\n dispatch(setErrorSnackMessage(err));\n });\n };\n\n const onCloseDecKeyModal = () => {\n deleteCookie(insFileName);\n onClose();\n setDecryptionKey(\"\");\n };\n\n const onSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n };\n\n return (\n \n {!decryptionKey && (\n }\n title={`Inspect Object`}\n onClose={onClose}\n >\n ) => {\n onSubmit(e);\n }}\n >\n Would you like to encrypt {inspectPath}?
\n {\n setIsEncrypt(!isEncrypt);\n }}\n description=\"\"\n />\n \n \n \n \n \n )}\n {decryptionKey ? (\n }\n >\n \n This will be displayed only once. It cannot be recovered.\n
\n Use secure medium to share this key.\n
\n \n \n \n \n ) : null}\n
\n );\n};\n\nexport default InspectObject;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useState } from \"react\";\nimport { Button, EditIcon, FormLayout, Grid, InputBox, Switch } from \"mds\";\nimport { modalStyleUtils } from \"../Common/FormComponents/common/styleLibrary\";\nimport { useAppDispatch } from \"../../../store\";\nimport { downloadObject } from \"./utils\";\nimport { BucketObject } from \"api/consoleApi\";\nimport ModalWrapper from \"../Common/ModalWrapper/ModalWrapper\";\n\ninterface IRenameLongFilename {\n open: boolean;\n bucketName: string;\n internalPaths: string;\n currentItem: string;\n actualInfo: BucketObject;\n closeModal: () => void;\n}\n\nconst RenameLongFileName = ({\n open,\n closeModal,\n currentItem,\n internalPaths,\n actualInfo,\n bucketName,\n}: IRenameLongFilename) => {\n const dispatch = useAppDispatch();\n\n const [newFileName, setNewFileName] = useState(currentItem);\n const [acceptLongName, setAcceptLongName] = useState(false);\n\n const doDownload = (e: React.FormEvent) => {\n e.preventDefault();\n downloadObject(dispatch, bucketName, internalPaths, actualInfo);\n closeModal();\n };\n\n return (\n }\n >\n
\n The file you are trying to download has a long name.\n
\n This can cause issues on Windows Systems by trimming the file name after\n download.\n
\n
We recommend to rename the file download\n
\n ) => {\n doDownload(e);\n }}\n >\n \n ) => {\n setNewFileName(event.target.value);\n }}\n label=\"\"\n type={\"text\"}\n value={newFileName}\n error={\n newFileName.length > 200 && !acceptLongName\n ? \"Filename should be less than 200 characters long.\"\n : \"\"\n }\n />\n ) => {\n setAcceptLongName(event.target.checked);\n if (event.target.checked) {\n setNewFileName(currentItem);\n }\n }}\n label={\"Use Original Name\"}\n />\n \n 200 && !acceptLongName}\n label={\"Download File\"}\n />\n \n \n \n \n );\n};\n\nexport default RenameLongFileName;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport get from \"lodash/get\";\nimport { useSelector } from \"react-redux\";\nimport {\n ActionsList,\n Box,\n Button,\n DeleteIcon,\n DownloadIcon,\n Grid,\n InspectMenuIcon,\n LegalHoldIcon,\n Loader,\n MetadataIcon,\n ObjectInfoIcon,\n PreviewIcon,\n RetentionIcon,\n ShareIcon,\n SimpleHeader,\n TagsIcon,\n VersionsIcon,\n} from \"mds\";\nimport { api } from \"api\";\nimport { downloadObject } from \"../../../../ObjectBrowser/utils\";\nimport { BucketObject, BucketVersioningResponse } from \"api/consoleApi\";\nimport { AllowedPreviews, previewObjectType } from \"../utils\";\nimport {\n niceBytes,\n niceBytesInt,\n niceDaysInt,\n} from \"../../../../../../common/utils\";\nimport {\n IAM_SCOPES,\n permissionTooltipHelper,\n} from \"../../../../../../common/SecureComponent/permissions\";\nimport { AppState, useAppDispatch } from \"../../../../../../store\";\nimport {\n hasPermission,\n SecureComponent,\n} from \"../../../../../../common/SecureComponent\";\nimport { selDistSet } from \"../../../../../../systemSlice\";\nimport {\n setLoadingObjectInfo,\n setLoadingVersions,\n setSelectedVersion,\n setVersionsModeEnabled,\n} from \"../../../../ObjectBrowser/objectBrowserSlice\";\nimport { displayFileIconName } from \"./utils\";\nimport PreviewFileModal from \"../Preview/PreviewFileModal\";\nimport ObjectMetaData from \"../ObjectDetails/ObjectMetaData\";\nimport ShareFile from \"../ObjectDetails/ShareFile\";\nimport SetRetention from \"../ObjectDetails/SetRetention\";\nimport DeleteObject from \"../ListObjects/DeleteObject\";\nimport SetLegalHoldModal from \"../ObjectDetails/SetLegalHoldModal\";\nimport TagsModal from \"../ObjectDetails/TagsModal\";\nimport InspectObject from \"./InspectObject\";\nimport RenameLongFileName from \"../../../../ObjectBrowser/RenameLongFilename\";\nimport TooltipWrapper from \"../../../../Common/TooltipWrapper/TooltipWrapper\";\n\nconst emptyFile: BucketObject = {\n is_latest: true,\n last_modified: \"\",\n legal_hold_status: \"\",\n name: \"\",\n retention_mode: \"\",\n retention_until_date: \"\",\n size: 0,\n tags: {},\n version_id: undefined,\n};\n\ninterface IObjectDetailPanelProps {\n internalPaths: string;\n bucketName: string;\n versioningInfo: BucketVersioningResponse;\n locking: boolean | undefined;\n onClosePanel: (hardRefresh: boolean) => void;\n}\n\nconst ObjectDetailPanel = ({\n internalPaths,\n bucketName,\n versioningInfo,\n locking,\n onClosePanel,\n}: IObjectDetailPanelProps) => {\n const dispatch = useAppDispatch();\n\n const distributedSetup = useSelector(selDistSet);\n const versionsMode = useSelector(\n (state: AppState) => state.objectBrowser.versionsMode,\n );\n const selectedVersion = useSelector(\n (state: AppState) => state.objectBrowser.selectedVersion,\n );\n const loadingObjectInfo = useSelector(\n (state: AppState) => state.objectBrowser.loadingObjectInfo,\n );\n\n const [shareFileModalOpen, setShareFileModalOpen] = useState(false);\n const [retentionModalOpen, setRetentionModalOpen] = useState(false);\n const [tagModalOpen, setTagModalOpen] = useState(false);\n const [legalholdOpen, setLegalholdOpen] = useState(false);\n const [inspectModalOpen, setInspectModalOpen] = useState(false);\n const [actualInfo, setActualInfo] = useState(null);\n const [allInfoElements, setAllInfoElements] = useState([]);\n const [objectToShare, setObjectToShare] = useState(null);\n const [versions, setVersions] = useState([]);\n const [deleteOpen, setDeleteOpen] = useState(false);\n const [previewOpen, setPreviewOpen] = useState(false);\n const [totalVersionsSize, setTotalVersionsSize] = useState(0);\n const [longFileOpen, setLongFileOpen] = useState(false);\n const [metaData, setMetaData] = useState(null);\n const [loadMetadata, setLoadingMetadata] = useState(false);\n\n const internalPathsDecoded = internalPaths || \"\";\n const allPathData = internalPathsDecoded.split(\"/\");\n const currentItem = allPathData.pop() || \"\";\n\n // calculate object name to display\n let objectNameArray: string[] = [];\n if (actualInfo && actualInfo.name) {\n objectNameArray = actualInfo.name.split(\"/\");\n }\n\n useEffect(() => {\n if (distributedSetup && allInfoElements && allInfoElements.length >= 1) {\n let infoElement =\n allInfoElements.find((el: BucketObject) => el.is_latest) || emptyFile;\n\n if (selectedVersion !== \"\") {\n infoElement =\n allInfoElements.find(\n (el: BucketObject) => el.version_id === selectedVersion,\n ) || emptyFile;\n }\n\n if (!infoElement.is_delete_marker) {\n setLoadingMetadata(true);\n }\n\n setActualInfo(infoElement);\n }\n }, [selectedVersion, distributedSetup, allInfoElements]);\n\n useEffect(() => {\n if (loadingObjectInfo && internalPaths !== \"\") {\n api.buckets\n .listObjects(bucketName, {\n prefix: internalPaths,\n with_versions: distributedSetup,\n })\n .then((res) => {\n const result: BucketObject[] = res.data.objects || [];\n if (distributedSetup) {\n setAllInfoElements(result);\n setVersions(result);\n\n const tVersionSize = result.reduce(\n (acc: number, currValue: BucketObject): number => {\n if (currValue?.size) {\n return acc + currValue.size;\n }\n return acc;\n },\n 0,\n );\n\n setTotalVersionsSize(tVersionSize);\n } else {\n const resInfo = result[0];\n\n setActualInfo(resInfo);\n setVersions([]);\n\n if (!resInfo.is_delete_marker) {\n setLoadingMetadata(true);\n }\n }\n\n dispatch(setLoadingObjectInfo(false));\n })\n .catch((err) => {\n console.error(\"Error loading object details\", err.error);\n dispatch(setLoadingObjectInfo(false));\n });\n }\n }, [\n loadingObjectInfo,\n bucketName,\n internalPaths,\n dispatch,\n distributedSetup,\n selectedVersion,\n ]);\n\n useEffect(() => {\n if (loadMetadata && internalPaths !== \"\") {\n api.buckets\n .getObjectMetadata(bucketName, {\n prefix: internalPaths,\n versionID: actualInfo?.version_id || \"\",\n })\n .then((res) => {\n let metadata = get(res.data, \"objectMetadata\", {});\n\n setMetaData(metadata);\n setLoadingMetadata(false);\n })\n .catch((err) => {\n console.error(\"Error Getting Metadata Status: \", err.detailedError);\n setLoadingMetadata(false);\n });\n }\n }, [bucketName, internalPaths, loadMetadata, actualInfo?.version_id]);\n\n let tagKeys: string[] = [];\n\n if (actualInfo && actualInfo.tags) {\n tagKeys = Object.keys(actualInfo.tags);\n }\n\n const openRetentionModal = () => {\n setRetentionModalOpen(true);\n };\n\n const closeRetentionModal = (updateInfo: boolean) => {\n setRetentionModalOpen(false);\n if (updateInfo) {\n dispatch(setLoadingObjectInfo(true));\n }\n };\n\n const shareObject = () => {\n setShareFileModalOpen(true);\n };\n\n const closeShareModal = () => {\n setObjectToShare(null);\n setShareFileModalOpen(false);\n };\n\n const closeFileOpen = () => {\n setLongFileOpen(false);\n };\n\n const closeDeleteModal = (closeAndReload: boolean) => {\n setDeleteOpen(false);\n\n if (closeAndReload && selectedVersion === \"\") {\n onClosePanel(true);\n } else {\n dispatch(setLoadingVersions(true));\n dispatch(setSelectedVersion(\"\"));\n dispatch(setLoadingObjectInfo(true));\n }\n };\n\n const closeAddTagModal = (reloadObjectData: boolean) => {\n setTagModalOpen(false);\n if (reloadObjectData) {\n dispatch(setLoadingObjectInfo(true));\n }\n };\n\n const closeInspectModal = (reloadObjectData: boolean) => {\n setInspectModalOpen(false);\n if (reloadObjectData) {\n dispatch(setLoadingObjectInfo(true));\n }\n };\n\n const closeLegalholdModal = (reload: boolean) => {\n setLegalholdOpen(false);\n if (reload) {\n dispatch(setLoadingObjectInfo(true));\n }\n };\n\n const loaderForContainer = (\n
\n \n
\n );\n\n if (!actualInfo) {\n if (loadingObjectInfo) {\n return loaderForContainer;\n }\n\n return null;\n }\n\n const objectName =\n objectNameArray.length > 0\n ? objectNameArray[objectNameArray.length - 1]\n : actualInfo.name;\n\n const objectResources = [\n bucketName,\n currentItem,\n [bucketName, actualInfo.name].join(\"/\"),\n ];\n const canSetLegalHold = hasPermission(bucketName, [\n IAM_SCOPES.S3_PUT_OBJECT_LEGAL_HOLD,\n IAM_SCOPES.S3_PUT_ACTIONS,\n ]);\n const canSetTags = hasPermission(objectResources, [\n IAM_SCOPES.S3_PUT_OBJECT_TAGGING,\n IAM_SCOPES.S3_PUT_ACTIONS,\n ]);\n\n const canChangeRetention = hasPermission(\n objectResources,\n [\n IAM_SCOPES.S3_GET_OBJECT_RETENTION,\n IAM_SCOPES.S3_PUT_OBJECT_RETENTION,\n IAM_SCOPES.S3_GET_ACTIONS,\n IAM_SCOPES.S3_PUT_ACTIONS,\n ],\n true,\n );\n const canInspect = hasPermission(objectResources, [\n IAM_SCOPES.ADMIN_INSPECT_DATA,\n ]);\n const canChangeVersioning = hasPermission(objectResources, [\n IAM_SCOPES.S3_GET_BUCKET_VERSIONING,\n IAM_SCOPES.S3_PUT_BUCKET_VERSIONING,\n IAM_SCOPES.S3_GET_OBJECT_VERSION,\n IAM_SCOPES.S3_GET_ACTIONS,\n IAM_SCOPES.S3_PUT_ACTIONS,\n ]);\n const canGetObject = hasPermission(objectResources, [\n IAM_SCOPES.S3_GET_OBJECT,\n IAM_SCOPES.S3_GET_ACTIONS,\n ]);\n const canDelete = hasPermission(\n [bucketName, currentItem, [bucketName, actualInfo.name].join(\"/\")],\n [IAM_SCOPES.S3_DELETE_OBJECT],\n );\n\n let objectType: AllowedPreviews = previewObjectType(metaData, currentItem);\n\n const multiActionButtons = [\n {\n action: () => {\n downloadObject(dispatch, bucketName, internalPaths, actualInfo);\n },\n label: \"Download\",\n disabled: !!actualInfo.is_delete_marker || !canGetObject,\n icon: ,\n tooltip: canGetObject\n ? \"Download this Object\"\n : permissionTooltipHelper(\n [IAM_SCOPES.S3_GET_OBJECT, IAM_SCOPES.S3_GET_ACTIONS],\n \"download this object\",\n ),\n },\n {\n action: () => {\n shareObject();\n },\n label: \"Share\",\n disabled: !!actualInfo.is_delete_marker || !canGetObject,\n icon: ,\n tooltip: canGetObject\n ? \"Share this File\"\n : permissionTooltipHelper(\n [IAM_SCOPES.S3_GET_OBJECT, IAM_SCOPES.S3_GET_ACTIONS],\n \"share this object\",\n ),\n },\n {\n action: () => {\n setPreviewOpen(true);\n },\n label: \"Preview\",\n disabled:\n !!actualInfo.is_delete_marker ||\n (objectType === \"none\" && !canGetObject),\n icon: ,\n tooltip: canGetObject\n ? \"Preview this File\"\n : permissionTooltipHelper(\n [IAM_SCOPES.S3_GET_OBJECT, IAM_SCOPES.S3_GET_ACTIONS],\n \"preview this object\",\n ),\n },\n {\n action: () => {\n setLegalholdOpen(true);\n },\n label: \"Legal Hold\",\n disabled:\n !locking ||\n !distributedSetup ||\n !!actualInfo.is_delete_marker ||\n !canSetLegalHold ||\n selectedVersion !== \"\",\n icon: ,\n tooltip: canSetLegalHold\n ? locking\n ? \"Change Legal Hold rules for this File\"\n : \"Object Locking must be enabled on this bucket in order to set Legal Hold\"\n : permissionTooltipHelper(\n [IAM_SCOPES.S3_PUT_OBJECT_LEGAL_HOLD, IAM_SCOPES.S3_PUT_ACTIONS],\n \"change legal hold settings for this object\",\n ),\n },\n {\n action: openRetentionModal,\n label: \"Retention\",\n disabled:\n !distributedSetup ||\n !!actualInfo.is_delete_marker ||\n !canChangeRetention ||\n selectedVersion !== \"\" ||\n !locking,\n icon: ,\n tooltip: canChangeRetention\n ? locking\n ? \"Change Retention rules for this File\"\n : \"Object Locking must be enabled on this bucket in order to set Retention Rules\"\n : permissionTooltipHelper(\n [\n IAM_SCOPES.S3_GET_OBJECT_RETENTION,\n IAM_SCOPES.S3_PUT_OBJECT_RETENTION,\n IAM_SCOPES.S3_GET_ACTIONS,\n IAM_SCOPES.S3_PUT_ACTIONS,\n ],\n \"change Retention Rules for this object\",\n ),\n },\n {\n action: () => {\n setTagModalOpen(true);\n },\n label: \"Tags\",\n disabled:\n !!actualInfo.is_delete_marker || selectedVersion !== \"\" || !canSetTags,\n icon: ,\n tooltip: canSetTags\n ? \"Change Tags for this File\"\n : permissionTooltipHelper(\n [\n IAM_SCOPES.S3_PUT_OBJECT_TAGGING,\n IAM_SCOPES.S3_GET_OBJECT_TAGGING,\n IAM_SCOPES.S3_GET_ACTIONS,\n IAM_SCOPES.S3_PUT_ACTIONS,\n ],\n \"set Tags on this object\",\n ),\n },\n {\n action: () => {\n setInspectModalOpen(true);\n },\n label: \"Inspect\",\n disabled:\n !distributedSetup ||\n !!actualInfo.is_delete_marker ||\n selectedVersion !== \"\" ||\n !canInspect,\n icon: ,\n tooltip: canInspect\n ? \"Inspect this file\"\n : permissionTooltipHelper(\n [IAM_SCOPES.ADMIN_INSPECT_DATA],\n \"inspect this file\",\n ),\n },\n {\n action: () => {\n dispatch(\n setVersionsModeEnabled({\n status: !versionsMode,\n objectName: objectName,\n }),\n );\n },\n label: versionsMode ? \"Hide Object Versions\" : \"Display Object Versions\",\n icon: ,\n disabled:\n !distributedSetup ||\n !(actualInfo.version_id && actualInfo.version_id !== \"null\") ||\n !canChangeVersioning,\n tooltip: canChangeVersioning\n ? actualInfo.version_id && actualInfo.version_id !== \"null\"\n ? \"Display Versions for this file\"\n : \"\"\n : permissionTooltipHelper(\n [\n IAM_SCOPES.S3_GET_BUCKET_VERSIONING,\n IAM_SCOPES.S3_PUT_BUCKET_VERSIONING,\n IAM_SCOPES.S3_GET_OBJECT_VERSION,\n IAM_SCOPES.S3_GET_ACTIONS,\n IAM_SCOPES.S3_PUT_ACTIONS,\n ],\n \"display all versions of this object\",\n ),\n },\n ];\n\n const calculateLastModifyTime = (lastModified: string) => {\n const currentTime = new Date();\n const modifiedTime = new Date(lastModified);\n\n const difTime = currentTime.getTime() - modifiedTime.getTime();\n\n const formatTime = niceDaysInt(difTime, \"ms\");\n\n return formatTime.trim() !== \"\" ? `${formatTime} ago` : \"Just now\";\n };\n\n return (\n \n {shareFileModalOpen && actualInfo && (\n \n )}\n {retentionModalOpen && actualInfo && (\n \n )}\n {deleteOpen && (\n \n )}\n {legalholdOpen && actualInfo && (\n \n )}\n {previewOpen && actualInfo && (\n {\n setPreviewOpen(false);\n }}\n />\n )}\n {tagModalOpen && actualInfo && (\n \n )}\n {inspectModalOpen && actualInfo && (\n \n )}\n {longFileOpen && actualInfo && (\n \n )}\n\n {loadingObjectInfo ? (\n {loaderForContainer}\n ) : (\n \n \n {displayFileIconName(objectName || \"\", true)}\n {objectName}\n \n }\n items={multiActionButtons}\n />\n \n \n \n }\n iconLocation={\"start\"}\n fullWidth\n variant={\"secondary\"}\n onClick={() => {\n setDeleteOpen(true);\n }}\n disabled={\n selectedVersion === \"\" && actualInfo.is_delete_marker\n }\n sx={{\n width: \"calc(100% - 44px)\",\n margin: \"8px 0\",\n }}\n label={`Delete${selectedVersion !== \"\" ? \" version\" : \"\"}`}\n />\n \n \n \n } label={\"Object Info\"} />\n \n Name:\n
\n
{objectName}
\n
\n {selectedVersion !== \"\" && (\n \n Version ID:\n
\n {selectedVersion}\n
\n )}\n \n Size:\n
\n {niceBytes(`${actualInfo.size || \"0\"}`)}\n
\n {actualInfo.version_id &&\n actualInfo.version_id !== \"null\" &&\n selectedVersion === \"\" && (\n \n Versions:\n
\n {versions.length} version{versions.length !== 1 ? \"s\" : \"\"},{\" \"}\n {niceBytesInt(totalVersionsSize)}\n
\n )}\n {selectedVersion === \"\" && (\n \n Last Modified:\n
\n {calculateLastModifyTime(actualInfo.last_modified || \"\")}\n
\n )}\n \n ETAG:\n
\n {actualInfo.etag || \"N/A\"}\n
\n \n Tags:\n
\n {tagKeys.length === 0\n ? \"N/A\"\n : tagKeys.map((tagKey, index) => {\n return (\n \n {tagKey}:{get(actualInfo, `tags.${tagKey}`, \"\")}\n {index < tagKeys.length - 1 ? \", \" : \"\"}\n \n );\n })}\n
\n \n \n \n Legal Hold:\n
\n {actualInfo.legal_hold_status ? \"On\" : \"Off\"}\n
\n \n
\n \n \n \n Retention Policy:\n
\n \n {actualInfo.version_id && actualInfo.version_id !== \"null\" ? (\n \n {actualInfo.retention_mode\n ? actualInfo.retention_mode.toLowerCase()\n : \"None\"}\n \n ) : (\n \n {actualInfo.retention_mode\n ? actualInfo.retention_mode.toLowerCase()\n : \"None\"}\n \n )}\n \n
\n \n
\n {!actualInfo.is_delete_marker && (\n \n } />\n \n {actualInfo && metaData ? (\n \n ) : null}\n \n \n )}\n \n )}\n
\n );\n};\n\nexport default ObjectDetailPanel;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useState } from \"react\";\nimport { Box, RecoverIcon } from \"mds\";\nimport { BucketObject } from \"api/consoleApi\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport ConfirmDialog from \"../../../../Common/ModalWrapper/ConfirmDialog\";\nimport { setErrorSnackMessage } from \"../../../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../../../store\";\nimport { restoreLocalObjectList } from \"../../../../ObjectBrowser/objectBrowserSlice\";\n\ninterface IRestoreFileVersion {\n restoreOpen: boolean;\n bucketName: string;\n versionToRestore: BucketObject;\n objectPath: string;\n onCloseAndUpdate: (refresh: boolean) => void;\n}\n\nconst RestoreFileVersion = ({\n versionToRestore,\n bucketName,\n objectPath,\n restoreOpen,\n onCloseAndUpdate,\n}: IRestoreFileVersion) => {\n const dispatch = useAppDispatch();\n const [restoreLoading, setRestoreLoading] = useState(false);\n\n const restoreVersion = () => {\n setRestoreLoading(true);\n\n api.buckets\n .putObjectRestore(bucketName, {\n prefix: objectPath,\n version_id: versionToRestore.version_id || \"\",\n })\n .then(() => {\n setRestoreLoading(false);\n onCloseAndUpdate(true);\n dispatch(\n restoreLocalObjectList({\n prefix: objectPath,\n objectInfo: versionToRestore,\n }),\n );\n })\n .catch((err) => {\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n setRestoreLoading(false);\n });\n };\n\n return (\n }\n onConfirm={restoreVersion}\n confirmButtonProps={{\n variant: \"secondary\",\n disabled: restoreLoading,\n }}\n onClose={() => {\n onCloseAndUpdate(false);\n }}\n confirmationContent={\n \n Are you sure you want to restore
\n {objectPath}
with Version ID:\n
\n {versionToRestore.version_id}?\n
\n }\n />\n );\n};\n\nexport default RestoreFileVersion;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\n\ninterface ISpecificVersionPillProps {\n type: \"null\" | \"current\" | \"deleted\";\n}\n\nconst SpecificVersionPill = ({ type }: ISpecificVersionPillProps) => {\n let bgColor = \"#000\";\n let message = \"\";\n\n switch (type) {\n case \"null\":\n bgColor = \"#07193E\";\n message = \"NULL VERSION\";\n break;\n case \"deleted\":\n bgColor = \"#868686\";\n message = \"DELETED\";\n break;\n default:\n bgColor = \"#174551\";\n message = \"CURRENT VERSION\";\n }\n\n return (\n \n {message}\n \n );\n};\n\nexport default SpecificVersionPill;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { DateTime } from \"luxon\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport { displayFileIconName } from \"../ListObjects/utils\";\nimport {\n DownloadIcon,\n PreviewIcon,\n RecoverIcon,\n ShareIcon,\n IconButton,\n Tooltip,\n Grid,\n Checkbox,\n} from \"mds\";\nimport { niceBytes } from \"../../../../../../common/utils\";\nimport SpecificVersionPill from \"./SpecificVersionPill\";\nimport { BucketObject } from \"api/consoleApi\";\n\ninterface IFileVersionItem {\n fileName: string;\n versionInfo: BucketObject;\n index: number;\n isSelected?: boolean;\n checkable: boolean;\n isChecked: boolean;\n onCheck: (versionID: string) => void;\n onShare: (versionInfo: BucketObject) => void;\n onDownload: (versionInfo: BucketObject) => void;\n onRestore: (versionInfo: BucketObject) => void;\n onPreview: (versionInfo: BucketObject) => void;\n globalClick: (versionInfo: BucketObject) => void;\n key: any;\n style: any;\n}\n\nconst FileVersionStyled = styled.div(({ theme }) => {\n return {\n \"&:before\": {\n content: \"' '\",\n display: \"block\",\n position: \"absolute\",\n width: \"2px\",\n height: \"calc(100% + 2px)\",\n backgroundColor: get(theme, \"borderColor\", \"#F8F8F8\"),\n left: \"24px\",\n },\n \"& .mainFileVersionItem\": {\n borderBottom: `${get(theme, \"borderColor\", \"#F8F8F8\")} 1px solid`,\n padding: \"1rem 0\",\n margin: \"0 0.5rem 0 2.5rem\",\n cursor: \"pointer\",\n \"&.deleted\": {\n color: \"#868686\",\n },\n },\n \"& .intermediateLayer\": {\n margin: \"0 1.5rem 0 1.5rem\",\n \"&:hover, &.selected\": {\n backgroundColor: get(theme, \"boxBackground\", \"#F8F8F8\"),\n \"& > div\": {\n borderBottomColor: get(theme, \"boxBackground\", \"#F8F8F8\"),\n },\n },\n },\n \"& .versionContainer\": {\n fontSize: 16,\n fontWeight: \"bold\",\n display: \"flex\",\n alignItems: \"center\",\n \"& svg.min-icon\": {\n width: 18,\n height: 18,\n minWidth: 18,\n minHeight: 18,\n marginRight: 10,\n },\n },\n \"& .buttonContainer\": {\n textAlign: \"right\",\n \"& button\": {\n marginLeft: \"1.5rem\",\n },\n },\n \"& .versionID\": {\n fontSize: \"12px\",\n margin: \"2px 0\",\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n maxWidth: \"95%\",\n overflow: \"hidden\",\n },\n \"& .versionData\": {\n marginRight: \"10px\",\n fontSize: 12,\n color: \"#868686\",\n },\n \"@media (max-width: 600px)\": {\n \"& .buttonContainer\": {\n \"& button\": {\n marginLeft: \"5px\",\n },\n },\n },\n \"@media (max-width: 799px)\": {\n \"&:before\": {\n display: \"none\",\n },\n \"& .mainFileVersionItem\": {\n padding: \"5px 0px\",\n margin: 0,\n },\n \"& .intermediateLayer\": {\n margin: 0,\n \"&:hover, &.selected\": {\n backgroundColor: \"transparent\",\n \"& > div\": {\n borderBottomColor: get(theme, \"boxBackground\", \"#F8F8F8\"),\n },\n },\n },\n \"& .versionContainer\": {\n fontSize: 14,\n \"& svg.min-icon\": {\n display: \"none\",\n },\n },\n \"& .versionData\": {\n textOverflow: \"ellipsis\",\n maxWidth: \"95%\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n },\n \"& .collapsableInfo\": {\n display: \"flex\",\n flexDirection: \"column\",\n },\n \"& .versionItem\": {\n display: \"none\",\n },\n },\n };\n});\n\nconst FileVersionItem = ({\n fileName,\n versionInfo,\n isSelected,\n checkable,\n isChecked,\n onCheck,\n onShare,\n onDownload,\n onRestore,\n onPreview,\n globalClick,\n index,\n key,\n style,\n}: IFileVersionItem) => {\n const disableButtons = versionInfo.is_delete_marker;\n\n const versionItemButtons = [\n {\n icon: ,\n action: onPreview,\n tooltip: \"Preview\",\n },\n {\n icon: ,\n action: onDownload,\n tooltip: \"Download this version\",\n },\n {\n icon: ,\n action: onShare,\n tooltip: \"Share this version\",\n },\n {\n icon: ,\n action: onRestore,\n tooltip: \"Restore this version\",\n },\n ];\n\n let pill: \"deleted\" | \"current\" | \"null\" | null = null;\n\n if (versionInfo.is_delete_marker) {\n pill = \"deleted\";\n } else if (versionInfo.is_latest) {\n pill = \"current\";\n } else if (versionInfo.version_id === \"null\") {\n pill = \"null\";\n }\n\n let lastModified = DateTime.now();\n\n if (versionInfo.last_modified) {\n lastModified = DateTime.fromISO(\n versionInfo.last_modified,\n ) as DateTime;\n }\n\n return (\n \n {\n globalClick(versionInfo);\n }}\n key={key}\n style={style}\n >\n \n \n \n \n \n {checkable && (\n {\n e.stopPropagation();\n onCheck(versionInfo.version_id || \"\");\n }}\n value={versionInfo.version_id || \"\"}\n disabled={versionInfo.is_delete_marker}\n sx={{\n width: \"initial\",\n }}\n />\n )}\n {displayFileIconName(fileName, true)} v{index.toString()}\n \n {pill && }\n \n \n \n {versionItemButtons.map((button, index) => {\n return (\n \n {\n e.stopPropagation();\n if (!disableButtons) {\n button.action(versionInfo);\n } else {\n e.preventDefault();\n }\n }}\n sx={{\n backgroundColor: \"#F8F8F8\",\n borderRadius: \"100%\",\n width: \"28px\",\n height: \"28px\",\n padding: \"5px\",\n \"& .min-icon\": {\n width: \"14px\",\n height: \"14px\",\n },\n }}\n >\n {button.icon}\n \n \n );\n })}\n \n \n \n \n {versionInfo.version_id !== \"null\" ? versionInfo.version_id : \"-\"}\n \n \n \n Last modified:{\" \"}\n {lastModified.toFormat(\"ccc, LLL dd yyyy HH:mm:ss (ZZZZ)\")}\n \n \n Size: {niceBytes(`${versionInfo.size || \"0\"}`)}\n \n \n \n \n \n \n );\n};\n\nexport default FileVersionItem;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\n\nimport { ConfirmDeleteIcon, Switch, Grid, InputBox } from \"mds\";\nimport ConfirmDialog from \"../../../../Common/ModalWrapper/ConfirmDialog\";\nimport { setErrorSnackMessage } from \"../../../../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../../../../store\";\nimport { hasPermission } from \"../../../../../../common/SecureComponent\";\nimport { IAM_SCOPES } from \"../../../../../../common/SecureComponent/permissions\";\nimport { useSelector } from \"react-redux\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\n\ninterface IDeleteNonCurrentProps {\n closeDeleteModalAndRefresh: (refresh: boolean) => void;\n deleteOpen: boolean;\n selectedObject: string;\n selectedBucket: string;\n}\n\nconst DeleteNonCurrentVersions = ({\n closeDeleteModalAndRefresh,\n deleteOpen,\n selectedBucket,\n selectedObject,\n}: IDeleteNonCurrentProps) => {\n const dispatch = useAppDispatch();\n const [deleteLoading, setDeleteLoading] = useState(false);\n const [typeConfirm, setTypeConfirm] = useState(\"\");\n const [bypassGovernance, setBypassGovernance] = useState(false);\n\n const retentionConfig = useSelector(\n (state: AppState) => state.objectBrowser.retentionConfig,\n );\n\n const canBypass =\n hasPermission(\n [selectedBucket],\n [IAM_SCOPES.S3_BYPASS_GOVERNANCE_RETENTION],\n ) && retentionConfig?.mode === \"governance\";\n\n useEffect(() => {\n if (deleteLoading) {\n api.buckets\n .deleteObject(selectedBucket, {\n prefix: selectedObject,\n non_current_versions: true,\n bypass: bypassGovernance,\n })\n .then(() => {\n closeDeleteModalAndRefresh(true);\n })\n .catch((err) => {\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n setDeleteLoading(false);\n });\n }\n }, [\n deleteLoading,\n closeDeleteModalAndRefresh,\n dispatch,\n selectedObject,\n selectedBucket,\n bypassGovernance,\n ]);\n\n if (!selectedObject) {\n return null;\n }\n const onConfirmDelete = () => {\n setDeleteLoading(true);\n };\n\n return (\n }\n isLoading={deleteLoading}\n onConfirm={onConfirmDelete}\n onClose={() => closeDeleteModalAndRefresh(false)}\n confirmButtonProps={{\n disabled: typeConfirm !== \"YES, PROCEED\" || deleteLoading,\n }}\n confirmationContent={\n \n Are you sure you want to delete all the non-current versions for:{\" \"}\n {selectedObject}?
\n {canBypass && (\n \n \n {\n setBypassGovernance(!bypassGovernance);\n }}\n description=\"\"\n />\n \n \n )}\n
\n To continue please type YES, PROCEED in the box.\n
\n
\n \n ) => {\n setTypeConfirm(event.target.value);\n }}\n label=\"\"\n value={typeConfirm}\n />\n \n
\n }\n />\n );\n};\n\nexport default DeleteNonCurrentVersions;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport ConfirmDialog from \"../../../../Common/ModalWrapper/ConfirmDialog\";\nimport { ConfirmDeleteIcon, Switch } from \"mds\";\nimport { setErrorSnackMessage } from \"../../../../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../../../../store\";\nimport { hasPermission } from \"../../../../../../common/SecureComponent\";\nimport { IAM_SCOPES } from \"../../../../../../common/SecureComponent/permissions\";\nimport { useSelector } from \"react-redux\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\n\ninterface IDeleteSelectedVersionsProps {\n closeDeleteModalAndRefresh: (refresh: boolean) => void;\n deleteOpen: boolean;\n selectedVersions: string[];\n selectedObject: string;\n selectedBucket: string;\n}\n\nconst DeleteObject = ({\n closeDeleteModalAndRefresh,\n deleteOpen,\n selectedBucket,\n selectedVersions,\n selectedObject,\n}: IDeleteSelectedVersionsProps) => {\n const dispatch = useAppDispatch();\n const [deleteLoading, setDeleteLoading] = useState(false);\n const [bypassGovernance, setBypassGovernance] = useState(false);\n\n const retentionConfig = useSelector(\n (state: AppState) => state.objectBrowser.retentionConfig,\n );\n\n const canBypass =\n hasPermission(\n [selectedBucket],\n [IAM_SCOPES.S3_BYPASS_GOVERNANCE_RETENTION],\n ) && retentionConfig?.mode === \"governance\";\n\n const onClose = () => closeDeleteModalAndRefresh(false);\n const onConfirmDelete = () => {\n setDeleteLoading(true);\n };\n\n useEffect(() => {\n if (deleteLoading) {\n const selectedObjectsRequest = selectedVersions.map((versionID) => {\n return {\n path: selectedObject,\n versionID: versionID,\n recursive: false,\n };\n });\n\n if (selectedObjectsRequest.length > 0) {\n api.buckets\n .deleteMultipleObjects(selectedBucket, selectedObjectsRequest, {\n all_versions: false,\n bypass: bypassGovernance,\n })\n .then(() => {\n setDeleteLoading(false);\n closeDeleteModalAndRefresh(true);\n })\n .catch((err) => {\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n setDeleteLoading(false);\n });\n }\n }\n }, [\n deleteLoading,\n closeDeleteModalAndRefresh,\n selectedBucket,\n selectedObject,\n selectedVersions,\n bypassGovernance,\n dispatch,\n ]);\n\n if (!selectedVersions) {\n return null;\n }\n\n return (\n }\n isLoading={deleteLoading}\n onConfirm={onConfirmDelete}\n onClose={onClose}\n confirmationContent={\n \n Are you sure you want to delete the selected {selectedVersions.length}{\" \"}\n versions for {selectedObject}?\n {canBypass && (\n \n \n {\n setBypassGovernance(!bypassGovernance);\n }}\n description=\"\"\n />\n \n \n )}\n \n }\n />\n );\n};\n\nexport default DeleteObject;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport get from \"lodash/get\";\nimport { useSelector } from \"react-redux\";\nimport {\n breakPoints,\n Button,\n DeleteIcon,\n DeleteNonCurrentIcon,\n Grid,\n ProgressBar,\n ScreenTitle,\n Select,\n SelectMultipleIcon,\n VersionsIcon,\n} from \"mds\";\nimport ShareFile from \"./ShareFile\";\n\nimport { niceBytesInt } from \"../../../../../../common/utils\";\nimport RestoreFileVersion from \"./RestoreFileVersion\";\n\nimport { AppState, useAppDispatch } from \"../../../../../../store\";\nimport FileVersionItem from \"./FileVersionItem\";\nimport PreviewFileModal from \"../Preview/PreviewFileModal\";\nimport DeleteNonCurrent from \"../ListObjects/DeleteNonCurrent\";\nimport BrowserBreadcrumbs from \"../../../../ObjectBrowser/BrowserBreadcrumbs\";\nimport DeleteSelectedVersions from \"./DeleteSelectedVersions\";\nimport {\n selDistSet,\n setErrorSnackMessage,\n} from \"../../../../../../systemSlice\";\nimport {\n setLoadingObjectInfo,\n setLoadingVersions,\n setSelectedVersion,\n} from \"../../../../ObjectBrowser/objectBrowserSlice\";\nimport { List, ListRowProps } from \"react-virtualized\";\nimport TooltipWrapper from \"../../../../Common/TooltipWrapper/TooltipWrapper\";\nimport { downloadObject } from \"../../../../ObjectBrowser/utils\";\nimport { BucketObject } from \"api/consoleApi\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\n\ninterface IVersionsNavigatorProps {\n internalPaths: string;\n bucketName: string;\n}\n\nconst emptyFile: BucketObject = {\n is_latest: true,\n last_modified: \"\",\n legal_hold_status: \"\",\n name: \"\",\n retention_mode: \"\",\n retention_until_date: \"\",\n size: 0,\n tags: {},\n version_id: undefined,\n};\n\nconst VersionsNavigator = ({\n internalPaths,\n bucketName,\n}: IVersionsNavigatorProps) => {\n const dispatch = useAppDispatch();\n\n const searchVersions = useSelector(\n (state: AppState) => state.objectBrowser.searchVersions,\n );\n const loadingVersions = useSelector(\n (state: AppState) => state.objectBrowser.loadingVersions,\n );\n const selectedVersion = useSelector(\n (state: AppState) => state.objectBrowser.selectedVersion,\n );\n\n const distributedSetup = useSelector(selDistSet);\n const [shareFileModalOpen, setShareFileModalOpen] = useState(false);\n const [actualInfo, setActualInfo] = useState(null);\n const [objectToShare, setObjectToShare] = useState(null);\n const [versions, setVersions] = useState([]);\n const [restoreVersionOpen, setRestoreVersionOpen] = useState(false);\n const [restoreVersion, setRestoreVersion] = useState(\n null,\n );\n const [sortValue, setSortValue] = useState(\"date\");\n const [previewOpen, setPreviewOpen] = useState(false);\n const [deleteNonCurrentOpen, setDeleteNonCurrentOpen] =\n useState(false);\n const [selectEnabled, setSelectEnabled] = useState(false);\n const [selectedItems, setSelectedItems] = useState([]);\n const [delSelectedVOpen, setDelSelectedVOpen] = useState(false);\n\n // calculate object name to display\n let objectNameArray: string[] = [];\n if (actualInfo && actualInfo.name) {\n objectNameArray = actualInfo.name.split(\"/\");\n }\n\n useEffect(() => {\n if (!loadingVersions && !actualInfo) {\n dispatch(setLoadingVersions(true));\n }\n }, [loadingVersions, actualInfo, dispatch]);\n\n useEffect(() => {\n if (loadingVersions && internalPaths !== \"\") {\n api.buckets\n .listObjects(bucketName, {\n prefix: internalPaths,\n with_versions: distributedSetup,\n })\n .then((res) => {\n const result = get(res.data, \"objects\", []);\n\n // Filter the results prefixes as API can return more files than expected.\n const filteredPrefixes = result.filter(\n (item: BucketObject) => item.name === internalPaths,\n );\n\n if (distributedSetup) {\n setActualInfo(\n filteredPrefixes.find((el: BucketObject) => el.is_latest) ||\n emptyFile,\n );\n setVersions(filteredPrefixes);\n } else {\n setActualInfo(filteredPrefixes[0]);\n setVersions([]);\n }\n\n dispatch(setLoadingVersions(false));\n })\n .catch((err) => {\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n dispatch(setLoadingVersions(false));\n });\n }\n }, [loadingVersions, bucketName, internalPaths, dispatch, distributedSetup]);\n\n const shareObject = () => {\n setShareFileModalOpen(true);\n };\n\n const closeShareModal = () => {\n setObjectToShare(null);\n setShareFileModalOpen(false);\n setPreviewOpen(false);\n };\n\n const onShareItem = (item: BucketObject) => {\n setObjectToShare(item);\n shareObject();\n };\n\n const onPreviewItem = (item: BucketObject) => {\n setObjectToShare(item);\n setPreviewOpen(true);\n };\n\n const onRestoreItem = (item: BucketObject) => {\n setRestoreVersion(item);\n setRestoreVersionOpen(true);\n };\n\n const onDownloadItem = (item: BucketObject) => {\n downloadObject(dispatch, bucketName, internalPaths, item);\n };\n\n const onGlobalClick = (item: BucketObject) => {\n dispatch(setSelectedVersion(item.version_id || \"\"));\n };\n\n const filteredRecords = versions.filter((version) => {\n if (version.version_id) {\n return version.version_id.includes(searchVersions);\n }\n return false;\n });\n\n const closeRestoreModal = (reloadObjectData: boolean) => {\n setRestoreVersionOpen(false);\n setRestoreVersion(null);\n\n if (reloadObjectData) {\n dispatch(setLoadingVersions(true));\n dispatch(setLoadingObjectInfo(true));\n }\n };\n\n const closeDeleteNonCurrent = (reloadAfterDelete: boolean) => {\n setDeleteNonCurrentOpen(false);\n\n if (reloadAfterDelete) {\n dispatch(setLoadingVersions(true));\n dispatch(setSelectedVersion(\"\"));\n dispatch(setLoadingObjectInfo(true));\n }\n };\n\n const closeSelectedVersions = (reloadOnComplete: boolean) => {\n setDelSelectedVOpen(false);\n\n if (reloadOnComplete) {\n dispatch(setLoadingVersions(true));\n dispatch(setSelectedVersion(\"\"));\n dispatch(setLoadingObjectInfo(true));\n setSelectedItems([]);\n }\n };\n\n const totalSpace = versions.reduce((acc: number, currValue: BucketObject) => {\n if (currValue.size) {\n return acc + currValue.size;\n }\n return acc;\n }, 0);\n\n filteredRecords.sort((a, b) => {\n switch (sortValue) {\n case \"size\":\n if (a.size && b.size) {\n if (a.size < b.size) {\n return -1;\n }\n if (a.size > b.size) {\n return 1;\n }\n return 0;\n }\n return 0;\n default:\n const dateA = new Date(a.last_modified || \"\").getTime();\n const dateB = new Date(b.last_modified || \"\").getTime();\n\n if (dateA < dateB) {\n return 1;\n }\n if (dateA > dateB) {\n return -1;\n }\n return 0;\n }\n });\n\n const onCheckVersion = (selectedVersion: string) => {\n if (selectedItems.includes(selectedVersion)) {\n const filteredItems = selectedItems.filter(\n (element) => element !== selectedVersion,\n );\n\n setSelectedItems(filteredItems);\n\n return;\n }\n\n const cloneState = [...selectedItems];\n cloneState.push(selectedVersion);\n\n setSelectedItems(cloneState);\n };\n\n const rowRenderer = ({\n key, // Unique key within array of rows\n index, // Index of row within collection\n isScrolling, // The List is currently being scrolled\n isVisible, // This row is visible within the List (eg it is not an overscanned row)\n style, // Style object to be applied to row (to position it)\n }: ListRowProps) => {\n const versOrd = versions.length - index;\n return (\n \n );\n };\n\n return (\n \n {shareFileModalOpen && actualInfo && (\n \n )}\n {restoreVersionOpen && actualInfo && restoreVersion && (\n \n )}\n {previewOpen && actualInfo && (\n {\n setPreviewOpen(false);\n }}\n />\n )}\n {deleteNonCurrentOpen && (\n \n )}\n {delSelectedVOpen && (\n \n )}\n \n {!actualInfo && (\n \n \n \n )}\n\n {actualInfo && (\n \n \n \n \n \n \n \n \n }\n title={`${\n objectNameArray.length > 0\n ? objectNameArray[objectNameArray.length - 1]\n : actualInfo.name\n } Versions`}\n subTitle={\n \n \n \n {versions.length} Version\n {versions.length === 1 ? \"\" : \"s\"}   \n \n \n \n {niceBytesInt(totalSpace)}\n \n \n }\n actions={\n \n \n {\n setSelectEnabled(!selectEnabled);\n }}\n icon={}\n variant={selectEnabled ? \"callAction\" : \"regular\"}\n style={{ marginRight: 8 }}\n />\n \n {selectEnabled && (\n \n {\n setDelSelectedVOpen(true);\n }}\n icon={}\n variant={\"secondary\"}\n style={{ marginRight: 8 }}\n disabled={selectedItems.length === 0}\n />\n \n )}\n \n {\n setDeleteNonCurrentOpen(true);\n }}\n icon={}\n variant={\"secondary\"}\n style={{ marginRight: 15 }}\n disabled={versions.length <= 1}\n />\n \n {\n setSortValue(newValue);\n }}\n noLabelMinWidth\n />\n \n }\n bottomBorder={false}\n />\n \n \n {actualInfo.version_id && actualInfo.version_id !== \"null\" && (\n // @ts-ignore\n \n )}\n \n \n )}\n \n \n );\n};\n\nexport default VersionsNavigator;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport { DateTime } from \"luxon\";\nimport { BucketObjectItem } from \"./types\";\nimport { niceBytes } from \"../../../../../../common/utils\";\nimport { displayFileIconName } from \"./utils\";\n\n// Functions\n\nconst displayParsedDate = (object: BucketObjectItem) => {\n if (object.name.endsWith(\"/\")) {\n return \"\";\n }\n\n const currTime = DateTime.now();\n const objectTime = DateTime.fromISO(object.last_modified);\n\n const isToday =\n currTime.hasSame(objectTime, \"day\") &&\n currTime.hasSame(objectTime, \"month\") &&\n currTime.hasSame(objectTime, \"year\");\n\n if (isToday) {\n return `Today, ${objectTime.toFormat(\"HH:mm\")}`;\n }\n\n return objectTime.toFormat(\"ccc, LLL dd yyyy HH:mm (ZZZZ)\");\n};\n\nconst displayNiceBytes = (object: BucketObjectItem) => {\n if (object.name.endsWith(\"/\") || !object.size) {\n return \"-\";\n }\n return niceBytes(String(object.size));\n};\n\nconst displayDeleteFlag = (state: boolean) => {\n return state ? \"Yes\" : \"No\";\n};\n\n// Table Props\n\nexport const listModeColumns = [\n {\n label: \"Name\",\n elementKey: \"name\",\n renderFunction: displayFileIconName,\n enableSort: true,\n },\n {\n label: \"Last Modified\",\n elementKey: \"last_modified\",\n renderFunction: displayParsedDate,\n renderFullObject: true,\n enableSort: true,\n },\n {\n label: \"Size\",\n elementKey: \"size\",\n renderFunction: displayNiceBytes,\n renderFullObject: true,\n width: 100,\n enableSort: true,\n },\n];\n\nexport const rewindModeColumns = [\n {\n label: \"Name\",\n elementKey: \"name\",\n renderFunction: displayFileIconName,\n enableSort: true,\n },\n {\n label: \"Object Date\",\n elementKey: \"last_modified\",\n renderFunction: displayParsedDate,\n renderFullObject: true,\n enableSort: true,\n },\n {\n label: \"Size\",\n elementKey: \"size\",\n renderFunction: displayNiceBytes,\n renderFullObject: true,\n width: 100,\n enableSort: true,\n },\n {\n label: \"Deleted\",\n elementKey: \"delete_flag\",\n renderFunction: displayDeleteFlag,\n width: 60,\n },\n];\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useState } from \"react\";\nimport { listModeColumns, rewindModeColumns } from \"./ListObjectsHelpers\";\nimport { useSelector } from \"react-redux\";\nimport { AppState, useAppDispatch } from \"../../../../../../store\";\nimport { selFeatures } from \"../../../../consoleSlice\";\nimport {\n setLoadingVersions,\n setObjectDetailsView,\n setReloadObjectsList,\n setSelectedObjects,\n setSelectedObjectView,\n} from \"../../../../ObjectBrowser/objectBrowserSlice\";\nimport { useNavigate, useParams } from \"react-router-dom\";\nimport get from \"lodash/get\";\nimport { sortListObjects } from \"../utils\";\nimport { BucketObjectItem } from \"./types\";\nimport {\n IAM_SCOPES,\n permissionTooltipHelper,\n} from \"../../../../../../common/SecureComponent/permissions\";\nimport { hasPermission } from \"../../../../../../common/SecureComponent\";\nimport { downloadObject } from \"../../../../ObjectBrowser/utils\";\nimport { DataTable, ItemActions } from \"mds\";\nimport { BucketObject } from \"api/consoleApi\";\n\nconst ListObjectsTable = () => {\n const dispatch = useAppDispatch();\n const params = useParams();\n const navigate = useNavigate();\n\n const [sortDirection, setSortDirection] = useState<\n \"ASC\" | \"DESC\" | undefined\n >(\"ASC\");\n const [currentSortField, setCurrentSortField] = useState(\"name\");\n\n const bucketName = params.bucketName || \"\";\n\n const detailsOpen = useSelector(\n (state: AppState) => state.objectBrowser.objectDetailsOpen,\n );\n\n const requestInProgress = useSelector(\n (state: AppState) => state.objectBrowser.requestInProgress,\n );\n\n const features = useSelector(selFeatures);\n const obOnly = !!features?.includes(\"object-browser-only\");\n\n const rewindEnabled = useSelector(\n (state: AppState) => state.objectBrowser.rewind.rewindEnabled,\n );\n const records = useSelector((state: AppState) => state.objectBrowser.records);\n const searchObjects = useSelector(\n (state: AppState) => state.objectBrowser.searchObjects,\n );\n const selectedObjects = useSelector(\n (state: AppState) => state.objectBrowser.selectedObjects,\n );\n const connectionError = useSelector(\n (state: AppState) => state.objectBrowser.connectionError,\n );\n const anonymousMode = useSelector(\n (state: AppState) => state.system.anonymousMode,\n );\n\n const displayListObjects = hasPermission(bucketName, [\n IAM_SCOPES.S3_LIST_BUCKET,\n IAM_SCOPES.S3_ALL_LIST_BUCKET,\n ]);\n\n const plSelect = records.filter((b: BucketObjectItem) => {\n if (searchObjects === \"\") {\n return true;\n } else {\n const objectName = b.name.toLowerCase();\n return objectName.indexOf(searchObjects.toLowerCase()) >= 0;\n }\n });\n const sortASC = plSelect.sort(sortListObjects(currentSortField));\n\n let payload: BucketObjectItem[] = [];\n\n if (sortDirection === \"ASC\") {\n payload = sortASC;\n } else {\n payload = sortASC.reverse();\n }\n\n const openPath = (object: BucketObject) => {\n const idElement = object.name || \"\";\n const newPath = `/browser/${encodeURIComponent(bucketName)}${\n idElement ? `/${encodeURIComponent(idElement)}` : ``\n }`;\n\n // for anonymous start download\n if (anonymousMode && !object.name?.endsWith(\"/\")) {\n downloadObject(dispatch, bucketName, idElement, object);\n return;\n }\n dispatch(setSelectedObjects([]));\n\n navigate(newPath);\n\n if (!anonymousMode) {\n dispatch(setObjectDetailsView(true));\n dispatch(setLoadingVersions(true));\n }\n dispatch(setSelectedObjectView(idElement));\n };\n const tableActions: ItemActions[] = [\n {\n type: \"view\",\n tooltip: \"View\",\n onClick: openPath,\n sendOnlyId: false,\n },\n ];\n\n const sortChange = (sortData: any) => {\n const newSortDirection = get(sortData, \"sortDirection\", \"DESC\");\n setCurrentSortField(sortData.sortBy);\n setSortDirection(newSortDirection);\n dispatch(setReloadObjectsList(true));\n };\n\n const selectAllItems = () => {\n dispatch(setSelectedObjectView(null));\n\n if (selectedObjects.length === payload.length) {\n dispatch(setSelectedObjects([]));\n return;\n }\n\n const elements = payload.map((item) => item.name);\n dispatch(setSelectedObjects(elements));\n };\n\n const selectListObjects = (e: React.ChangeEvent) => {\n const targetD = e.target;\n const value = targetD.value;\n const checked = targetD.checked;\n\n let elements: string[] = [...selectedObjects]; // We clone the selectedBuckets array\n\n if (checked) {\n // If the user has checked this field we need to push this to selectedBucketsList\n elements.push(value);\n } else {\n // User has unchecked this field, we need to remove it from the list\n elements = elements.filter((element) => element !== value);\n }\n dispatch(setSelectedObjects(elements));\n dispatch(setSelectedObjectView(null));\n\n return elements;\n };\n\n let errorMessage =\n !displayListObjects && !anonymousMode\n ? permissionTooltipHelper(\n [IAM_SCOPES.S3_LIST_BUCKET, IAM_SCOPES.S3_ALL_LIST_BUCKET],\n \"view Objects in this bucket\",\n )\n : `This location is empty${\n !rewindEnabled ? \", please try uploading a new file\" : \"\"\n }`;\n\n if (connectionError) {\n errorMessage =\n \"Objects List unavailable. Please review your WebSockets configuration and try again\";\n }\n\n let customPaperHeight = \"calc(100vh - 290px)\";\n\n if (obOnly) {\n customPaperHeight = \"calc(100vh - 315px)\";\n }\n\n return (\n {\n if (payload[index]?.delete_flag) {\n return \"deleted\";\n }\n\n return \"\";\n }}\n sx={{\n minHeight: detailsOpen ? \"100%\" : \"initial\",\n }}\n noBackground\n />\n );\n};\nexport default ListObjectsTable;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2023 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { setSearchObjects } from \"./objectBrowserSlice\";\nimport SearchBox from \"../Common/SearchBox\";\nimport { AppState, useAppDispatch } from \"../../../store\";\nimport { useSelector } from \"react-redux\";\n\nconst FilterObjectsSB = () => {\n const dispatch = useAppDispatch();\n\n const searchObjects = useSelector(\n (state: AppState) => state.objectBrowser.searchObjects,\n );\n return (\n {\n dispatch(setSearchObjects(value));\n }}\n value={searchObjects}\n />\n );\n};\nexport default FilterObjectsSB;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, {\n Fragment,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport get from \"lodash/get\";\nimport {\n AccessRuleIcon,\n ActionsList,\n Badge,\n Box,\n BucketsIcon,\n Button,\n Checkbox,\n DeleteIcon,\n DownloadIcon,\n Grid,\n HistoryIcon,\n PageLayout,\n PreviewIcon,\n RefreshIcon,\n ScreenTitle,\n ShareIcon,\n} from \"mds\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport { BucketQuota } from \"api/consoleApi\";\nimport { useSelector } from \"react-redux\";\nimport { useLocation, useNavigate, useParams } from \"react-router-dom\";\nimport { useDropzone } from \"react-dropzone\";\nimport { DateTime } from \"luxon\";\nimport { niceBytesInt } from \"../../../../../../common/utils\";\nimport BrowserBreadcrumbs from \"../../../../ObjectBrowser/BrowserBreadcrumbs\";\nimport { AllowedPreviews, previewObjectType } from \"../utils\";\nimport { ErrorResponseHandler } from \"../../../../../../common/types\";\nimport { AppState, useAppDispatch } from \"../../../../../../store\";\nimport {\n IAM_SCOPES,\n permissionTooltipHelper,\n} from \"../../../../../../common/SecureComponent/permissions\";\nimport {\n hasPermission,\n SecureComponent,\n} from \"../../../../../../common/SecureComponent\";\nimport {\n setErrorSnackMessage,\n setSnackBarMessage,\n} from \"../../../../../../systemSlice\";\nimport { isVersionedMode } from \"../../../../../../utils/validationFunctions\";\nimport {\n extractFileExtn,\n getPolicyAllowedFileExtensions,\n getSessionGrantsWildCard,\n} from \"../../UploadPermissionUtils\";\nimport {\n makeid,\n removeTrace,\n storeCallForObjectWithID,\n storeFormDataWithID,\n} from \"../../../../ObjectBrowser/transferManager\";\nimport {\n cancelObjectInList,\n completeObject,\n failObject,\n openList,\n resetMessages,\n resetRewind,\n setAnonymousAccessOpen,\n setDownloadRenameModal,\n setLoadingVersions,\n setNewObject,\n setObjectDetailsView,\n setPreviewOpen,\n setReloadObjectsList,\n setRetentionConfig,\n setSelectedObjects,\n setSelectedObjectView,\n setSelectedPreview,\n setShareFileModalOpen,\n setShowDeletedObjects,\n setVersionsModeEnabled,\n updateProgress,\n} from \"../../../../ObjectBrowser/objectBrowserSlice\";\nimport {\n selBucketDetailsInfo,\n selBucketDetailsLoading,\n setBucketDetailsLoad,\n setBucketInfo,\n} from \"../../../BucketDetails/bucketDetailsSlice\";\nimport {\n downloadSelected,\n openAnonymousAccess,\n openPreview,\n openShare,\n} from \"../../../../ObjectBrowser/objectBrowserThunks\";\nimport withSuspense from \"../../../../Common/Components/withSuspense\";\nimport UploadFilesButton from \"../../UploadFilesButton\";\nimport DetailsListPanel from \"./DetailsListPanel\";\nimport ObjectDetailPanel from \"./ObjectDetailPanel\";\nimport VersionsNavigator from \"../ObjectDetails/VersionsNavigator\";\nimport RenameLongFileName from \"../../../../ObjectBrowser/RenameLongFilename\";\nimport TooltipWrapper from \"../../../../Common/TooltipWrapper/TooltipWrapper\";\nimport ListObjectsTable from \"./ListObjectsTable\";\nimport FilterObjectsSB from \"../../../../ObjectBrowser/FilterObjectsSB\";\nimport AddAccessRule from \"../../../BucketDetails/AddAccessRule\";\nimport { sanitizeFilePath } from \"./utils\";\n\nconst DeleteMultipleObjects = withSuspense(\n React.lazy(() => import(\"./DeleteMultipleObjects\")),\n);\nconst ShareFile = withSuspense(\n React.lazy(() => import(\"../ObjectDetails/ShareFile\")),\n);\nconst RewindEnable = withSuspense(React.lazy(() => import(\"./RewindEnable\")));\nconst PreviewFileModal = withSuspense(\n React.lazy(() => import(\"../Preview/PreviewFileModal\")),\n);\n\nconst baseDnDStyle = {\n borderWidth: 2,\n borderRadius: 2,\n borderColor: \"transparent\",\n outline: \"none\",\n};\n\nconst activeDnDStyle = {\n borderStyle: \"dashed\",\n backgroundColor: \"transparent\",\n borderColor: \"#2196f3\",\n};\n\nconst acceptDnDStyle = {\n borderStyle: \"dashed\",\n backgroundColor: \"transparent\",\n borderColor: \"#00e676\",\n};\n\nconst ListObjects = () => {\n const dispatch = useAppDispatch();\n const params = useParams();\n const navigate = useNavigate();\n const location = useLocation();\n\n const rewindEnabled = useSelector(\n (state: AppState) => state.objectBrowser.rewind.rewindEnabled,\n );\n const bucketToRewind = useSelector(\n (state: AppState) => state.objectBrowser.rewind.bucketToRewind,\n );\n const versionsMode = useSelector(\n (state: AppState) => state.objectBrowser.versionsMode,\n );\n const showDeleted = useSelector(\n (state: AppState) => state.objectBrowser.showDeleted,\n );\n const detailsOpen = useSelector(\n (state: AppState) => state.objectBrowser.objectDetailsOpen,\n );\n const selectedInternalPaths = useSelector(\n (state: AppState) => state.objectBrowser.selectedInternalPaths,\n );\n const requestInProgress = useSelector(\n (state: AppState) => state.objectBrowser.requestInProgress,\n );\n const simplePath = useSelector(\n (state: AppState) => state.objectBrowser.simplePath,\n );\n const versioningConfig = useSelector(\n (state: AppState) => state.objectBrowser.versionInfo,\n );\n const lockingEnabled = useSelector(\n (state: AppState) => state.objectBrowser.lockingEnabled,\n );\n const downloadRenameModal = useSelector(\n (state: AppState) => state.objectBrowser.downloadRenameModal,\n );\n const selectedPreview = useSelector(\n (state: AppState) => state.objectBrowser.selectedPreview,\n );\n const shareFileModalOpen = useSelector(\n (state: AppState) => state.objectBrowser.shareFileModalOpen,\n );\n const previewOpen = useSelector(\n (state: AppState) => state.objectBrowser.previewOpen,\n );\n const selectedBucket = useSelector(\n (state: AppState) => state.objectBrowser.selectedBucket,\n );\n const anonymousMode = useSelector(\n (state: AppState) => state.system.anonymousMode,\n );\n const anonymousAccessOpen = useSelector(\n (state: AppState) => state.objectBrowser.anonymousAccessOpen,\n );\n\n const records = useSelector(\n (state: AppState) => state.objectBrowser?.records || [],\n );\n\n const loadingBucket = useSelector(selBucketDetailsLoading);\n const bucketInfo = useSelector(selBucketDetailsInfo);\n\n const [deleteMultipleOpen, setDeleteMultipleOpen] = useState(false);\n const [rewindSelect, setRewindSelect] = useState(false);\n const [iniLoad, setIniLoad] = useState(false);\n const [canShareFile, setCanShareFile] = useState(false);\n const [canPreviewFile, setCanPreviewFile] = useState(false);\n const [quota, setQuota] = useState(null);\n const [metaData, setMetaData] = useState(null);\n const [isMetaDataLoaded, setIsMetaDataLoaded] = useState(false);\n\n const isVersioningApplied = isVersionedMode(versioningConfig.status);\n\n const bucketName = params.bucketName || \"\";\n const pathSegment = location.pathname.split(`/browser/${bucketName}/`);\n const internalPaths =\n pathSegment.length === 2 ? decodeURIComponent(pathSegment[1]) : \"\";\n\n const currentPath = internalPaths.split(\"/\").filter((i: string) => i !== \"\");\n\n let uploadPath = [bucketName];\n if (currentPath.length > 0) {\n uploadPath = uploadPath.concat(currentPath);\n }\n\n const fileUpload = useRef(null);\n const folderUpload = useRef(null);\n\n const sessionGrants = useSelector((state: AppState) =>\n state.console.session ? state.console.session.permissions || {} : {},\n );\n\n const putObjectPermScopes = [\n IAM_SCOPES.S3_PUT_OBJECT,\n IAM_SCOPES.S3_PUT_ACTIONS,\n ];\n\n const pathAsResourceInPolicy = uploadPath.join(\"/\");\n const allowedFileExtensions = getPolicyAllowedFileExtensions(\n sessionGrants,\n pathAsResourceInPolicy,\n putObjectPermScopes,\n );\n\n const sessionGrantWildCards = getSessionGrantsWildCard(\n sessionGrants,\n pathAsResourceInPolicy,\n putObjectPermScopes,\n );\n\n const canDownload = hasPermission(\n [pathAsResourceInPolicy, ...sessionGrantWildCards],\n [IAM_SCOPES.S3_GET_OBJECT, IAM_SCOPES.S3_GET_ACTIONS],\n );\n const canRewind = hasPermission(bucketName, [\n IAM_SCOPES.S3_GET_OBJECT,\n IAM_SCOPES.S3_GET_ACTIONS,\n IAM_SCOPES.S3_GET_BUCKET_VERSIONING,\n ]);\n const canDelete = hasPermission(\n [pathAsResourceInPolicy, ...sessionGrantWildCards],\n [IAM_SCOPES.S3_DELETE_OBJECT],\n );\n const canUpload =\n hasPermission(\n [pathAsResourceInPolicy, ...sessionGrantWildCards],\n putObjectPermScopes,\n ) || anonymousMode;\n\n const canSetAnonymousAccess = hasPermission(bucketName, [\n IAM_SCOPES.S3_GET_BUCKET_POLICY,\n IAM_SCOPES.S3_PUT_BUCKET_POLICY,\n IAM_SCOPES.S3_GET_ACTIONS,\n IAM_SCOPES.S3_PUT_ACTIONS,\n ]);\n\n const selectedObjects = useSelector(\n (state: AppState) => state.objectBrowser.selectedObjects,\n );\n\n const checkForDelMarker = (): boolean => {\n let isObjDelMarker = false;\n if (selectedObjects.length === 1) {\n let matchingRec = records.find((obj) => {\n return obj.name === `${selectedObjects[0]}` && obj.delete_flag;\n });\n\n isObjDelMarker = !!matchingRec;\n }\n return isObjDelMarker;\n };\n\n const isSelObjectDelMarker = checkForDelMarker();\n\n const fetchMetadata = useCallback(() => {\n const objectName = selectedObjects[0];\n\n if (!isMetaDataLoaded && objectName) {\n api.buckets\n .getObjectMetadata(bucketName, {\n prefix: objectName,\n })\n .then((res) => {\n let metadata = get(res.data, \"objectMetadata\", {});\n setIsMetaDataLoaded(true);\n setMetaData(metadata);\n })\n .catch((err) => {\n console.error(\n \"Error Getting Metadata Status: \",\n err,\n err?.detailedError,\n );\n setIsMetaDataLoaded(true);\n });\n }\n }, [bucketName, selectedObjects, isMetaDataLoaded]);\n\n useEffect(() => {\n if (bucketName && !isSelObjectDelMarker) {\n fetchMetadata();\n }\n }, [bucketName, selectedObjects, fetchMetadata, isSelObjectDelMarker]);\n\n useEffect(() => {\n if (rewindEnabled) {\n if (bucketToRewind !== bucketName) {\n dispatch(resetRewind());\n return;\n }\n }\n }, [rewindEnabled, bucketToRewind, bucketName, dispatch]);\n\n useEffect(() => {\n if (folderUpload.current !== null) {\n folderUpload.current.setAttribute(\"directory\", \"\");\n folderUpload.current.setAttribute(\"webkitdirectory\", \"\");\n }\n }, [folderUpload]);\n\n useEffect(() => {\n if (selectedObjects.length === 1) {\n const objectName = selectedObjects[0];\n const isPrefix = objectName.endsWith(\"/\");\n\n let objectType: AllowedPreviews = previewObjectType(metaData, objectName);\n\n if (objectType !== \"none\" && canDownload) {\n setCanPreviewFile(true);\n } else {\n setCanPreviewFile(false);\n }\n\n if (canDownload && !isPrefix) {\n setCanShareFile(true);\n } else {\n setCanShareFile(false);\n }\n } else {\n setCanShareFile(false);\n setCanPreviewFile(false);\n }\n }, [selectedObjects, canDownload, metaData]);\n\n useEffect(() => {\n if (!quota && !anonymousMode) {\n api.buckets\n .getBucketQuota(bucketName)\n .then((res) => {\n let quotaVals = null;\n\n if (res.data.quota) {\n quotaVals = res.data;\n }\n\n setQuota(quotaVals);\n })\n .catch((err) => {\n console.error(\n \"Error Getting Quota Status: \",\n err.error.detailedMessage,\n );\n setQuota(null);\n });\n }\n }, [quota, bucketName, anonymousMode]);\n\n useEffect(() => {\n if (selectedObjects.length > 0) {\n dispatch(setObjectDetailsView(true));\n return;\n }\n\n if (\n selectedObjects.length === 0 &&\n selectedInternalPaths === null &&\n !requestInProgress\n ) {\n dispatch(setObjectDetailsView(false));\n }\n }, [selectedObjects, selectedInternalPaths, dispatch, requestInProgress]);\n\n useEffect(() => {\n if (!iniLoad) {\n dispatch(setBucketDetailsLoad(true));\n setIniLoad(true);\n }\n }, [iniLoad, dispatch, setIniLoad]);\n\n // bucket info\n useEffect(() => {\n if ((requestInProgress || loadingBucket) && !anonymousMode) {\n api.buckets\n .bucketInfo(bucketName)\n .then((res) => {\n dispatch(setBucketDetailsLoad(false));\n dispatch(setBucketInfo(res.data));\n })\n .catch((err) => {\n dispatch(setBucketDetailsLoad(false));\n dispatch(setErrorSnackMessage(errorToHandler(err)));\n });\n }\n }, [bucketName, loadingBucket, dispatch, anonymousMode, requestInProgress]);\n\n // Load retention Config\n\n useEffect(() => {\n if (selectedBucket !== \"\") {\n api.buckets\n .getBucketRetentionConfig(selectedBucket)\n .then((res) => {\n dispatch(setRetentionConfig(res.data));\n })\n .catch(() => {\n dispatch(setRetentionConfig(null));\n });\n }\n }, [selectedBucket, dispatch]);\n\n const closeDeleteMultipleModalAndRefresh = (refresh: boolean) => {\n setDeleteMultipleOpen(false);\n\n if (refresh) {\n dispatch(setSnackBarMessage(`Objects deleted successfully.`));\n dispatch(setSelectedObjects([]));\n dispatch(setReloadObjectsList(true));\n }\n };\n\n const handleUploadButton = (e: any) => {\n if (\n e === null ||\n e === undefined ||\n e.target.files === null ||\n e.target.files === undefined\n ) {\n return;\n }\n e.preventDefault();\n var newFiles: File[] = [];\n\n for (let i = 0; i < e.target.files.length; i++) {\n newFiles.push(e.target.files[i]);\n }\n uploadObject(newFiles, \"\");\n\n e.target.value = \"\";\n };\n\n const uploadObject = useCallback(\n (files: File[], folderPath: string): void => {\n let pathPrefix = \"\";\n if (simplePath) {\n pathPrefix = simplePath.endsWith(\"/\") ? simplePath : simplePath + \"/\";\n }\n\n const upload = (\n files: File[],\n bucketName: string,\n path: string,\n folderPath: string,\n ) => {\n let uploadPromise = (file: File) => {\n return new Promise((resolve, reject) => {\n let uploadUrl = `api/v1/buckets/${bucketName}/objects/upload`;\n const fileName = file.name;\n\n const blobFile = new Blob([file], { type: file.type });\n\n const filePath = sanitizeFilePath(get(file, \"path\", \"\"));\n const fileWebkitRelativePath = get(file, \"webkitRelativePath\", \"\");\n\n let relativeFolderPath = folderPath;\n const ID = makeid(8);\n\n // File was uploaded via drag & drop\n if (filePath !== \"\") {\n relativeFolderPath = filePath;\n } else if (fileWebkitRelativePath !== \"\") {\n // File was uploaded using upload button\n relativeFolderPath = fileWebkitRelativePath;\n }\n\n let prefixPath = \"\";\n\n if (path !== \"\" || relativeFolderPath !== \"\") {\n const finalFolderPath = relativeFolderPath\n .split(\"/\")\n .slice(0, -1)\n .join(\"/\");\n\n const pathClean = path.endsWith(\"/\") ? path.slice(0, -1) : path;\n\n prefixPath = `${pathClean}${\n !pathClean.endsWith(\"/\") &&\n finalFolderPath !== \"\" &&\n !finalFolderPath.startsWith(\"/\")\n ? \"/\"\n : \"\"\n }${finalFolderPath}${\n !finalFolderPath.endsWith(\"/\") ||\n (finalFolderPath.trim() === \"\" && !path.endsWith(\"/\"))\n ? \"/\"\n : \"\"\n }`;\n }\n\n if (prefixPath !== \"\") {\n uploadUrl = `${uploadUrl}?prefix=${encodeURIComponent(\n prefixPath + fileName,\n )}`;\n } else {\n uploadUrl = `${uploadUrl}?prefix=${encodeURIComponent(fileName)}`;\n }\n\n const identity = encodeURIComponent(\n `${bucketName}-${prefixPath}-${new Date().getTime()}-${Math.random()}`,\n );\n\n let xhr = new XMLHttpRequest();\n xhr.open(\"POST\", uploadUrl, true);\n if (anonymousMode) {\n xhr.setRequestHeader(\"X-Anonymous\", \"1\");\n }\n // xhr.setRequestHeader(\"X-Anonymous\", \"1\");\n\n const areMultipleFiles = files.length > 1;\n let errorMessage = `An error occurred while uploading the file${\n areMultipleFiles ? \"s\" : \"\"\n }.`;\n\n const errorMessages: any = {\n 413: \"Error - File size too large\",\n };\n\n xhr.withCredentials = false;\n xhr.onload = function () {\n // resolve promise only when HTTP code is ok\n if (xhr.status >= 200 && xhr.status < 300) {\n dispatch(completeObject(identity));\n resolve({ status: xhr.status });\n\n removeTrace(ID);\n } else {\n // reject promise if there was a server error\n if (errorMessages[xhr.status]) {\n errorMessage = errorMessages[xhr.status];\n } else if (xhr.response) {\n try {\n const err = JSON.parse(xhr.response);\n errorMessage = err.detailedMessage;\n } catch (e) {\n errorMessage = \"something went wrong\";\n }\n }\n\n dispatch(\n failObject({\n instanceID: identity,\n msg: errorMessage,\n }),\n );\n reject({ status: xhr.status, message: errorMessage });\n\n removeTrace(ID);\n }\n };\n\n xhr.upload.addEventListener(\"error\", () => {\n reject(errorMessage);\n dispatch(\n failObject({\n instanceID: identity,\n msg: \"A network error occurred.\",\n }),\n );\n return;\n });\n\n xhr.upload.addEventListener(\"progress\", (event) => {\n const progress = Math.floor((event.loaded * 100) / event.total);\n\n dispatch(\n updateProgress({\n instanceID: identity,\n progress: progress,\n }),\n );\n });\n\n xhr.onerror = () => {\n reject(errorMessage);\n dispatch(\n failObject({\n instanceID: identity,\n msg: \"A network error occurred.\",\n }),\n );\n return;\n };\n xhr.onloadend = () => {\n if (files.length === 0) {\n dispatch(setReloadObjectsList(true));\n }\n };\n xhr.onabort = () => {\n dispatch(cancelObjectInList(identity));\n };\n\n const formData = new FormData();\n if (file.size !== undefined) {\n formData.append(file.size.toString(), blobFile, fileName);\n storeCallForObjectWithID(ID, xhr);\n dispatch(\n setNewObject({\n ID,\n bucketName,\n done: false,\n instanceID: identity,\n percentage: 0,\n prefix: `${prefixPath}${fileName}`,\n type: \"upload\",\n waitingForFile: false,\n failed: false,\n cancelled: false,\n errorMessage: \"\",\n }),\n );\n storeFormDataWithID(ID, formData);\n }\n });\n };\n\n const uploadFilePromises: any = [];\n // open object manager\n dispatch(openList());\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n uploadFilePromises.push(uploadPromise(file));\n }\n Promise.allSettled(uploadFilePromises).then((results: Array) => {\n const errors = results.filter(\n (result) => result.status === \"rejected\",\n );\n if (errors.length > 0) {\n const totalFiles = uploadFilePromises.length;\n const successUploadedFiles =\n uploadFilePromises.length - errors.length;\n const err: ErrorResponseHandler = {\n errorMessage: \"There were some errors during file upload\",\n detailedError: `Uploaded files ${successUploadedFiles}/${totalFiles}`,\n };\n dispatch(setErrorSnackMessage(err));\n }\n // We force objects list reload after all promises were handled\n dispatch(setReloadObjectsList(true));\n });\n };\n\n upload(files, bucketName, pathPrefix, folderPath);\n },\n [bucketName, dispatch, simplePath, anonymousMode],\n );\n\n const onDrop = useCallback(\n (acceptedFiles: any[]) => {\n if (acceptedFiles && acceptedFiles.length > 0 && canUpload) {\n let newFolderPath: string = acceptedFiles[0].path;\n //Should we filter by allowed file extensions if any?.\n let allowedFiles = acceptedFiles;\n\n if (allowedFileExtensions.length > 0) {\n allowedFiles = acceptedFiles.filter((file) => {\n const fileExtn = extractFileExtn(file.name);\n return allowedFileExtensions.includes(fileExtn);\n });\n }\n\n if (allowedFiles.length) {\n uploadObject(allowedFiles, newFolderPath);\n console.log(\n `${allowedFiles.length} Allowed Files Processed out of ${acceptedFiles.length}.`,\n pathAsResourceInPolicy,\n ...sessionGrantWildCards,\n );\n\n if (allowedFiles.length !== acceptedFiles.length) {\n dispatch(\n setErrorSnackMessage({\n errorMessage: \"Upload is restricted.\",\n detailedError: permissionTooltipHelper(\n [IAM_SCOPES.S3_PUT_OBJECT, IAM_SCOPES.S3_PUT_ACTIONS],\n \"upload objects to this location\",\n ),\n }),\n );\n }\n } else {\n dispatch(\n setErrorSnackMessage({\n errorMessage: \"Could not process drag and drop.\",\n detailedError: permissionTooltipHelper(\n [IAM_SCOPES.S3_PUT_OBJECT, IAM_SCOPES.S3_PUT_ACTIONS],\n \"upload objects to this location\",\n ),\n }),\n );\n\n console.error(\n \"Could not process drag and drop . upload may be restricted.\",\n pathAsResourceInPolicy,\n ...sessionGrantWildCards,\n );\n }\n }\n if (!canUpload) {\n dispatch(\n setErrorSnackMessage({\n errorMessage: \"Upload not allowed\",\n detailedError: permissionTooltipHelper(\n [IAM_SCOPES.S3_PUT_OBJECT, IAM_SCOPES.S3_PUT_ACTIONS],\n \"upload objects to this location\",\n ),\n }),\n );\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [uploadObject],\n );\n\n const { getRootProps, getInputProps, isDragActive, isDragAccept } =\n useDropzone({\n noClick: true,\n onDrop,\n });\n\n const dndStyles = useMemo(\n () => ({\n ...baseDnDStyle,\n ...(isDragActive ? activeDnDStyle : {}),\n ...(isDragAccept ? acceptDnDStyle : {}),\n }),\n [isDragActive, isDragAccept],\n );\n\n const closeShareModal = () => {\n dispatch(setShareFileModalOpen(false));\n dispatch(setSelectedPreview(null));\n };\n\n const rewindCloseModal = () => {\n setRewindSelect(false);\n };\n\n const closePreviewWindow = () => {\n dispatch(setPreviewOpen(false));\n dispatch(setSelectedPreview(null));\n };\n\n const onClosePanel = (forceRefresh: boolean) => {\n dispatch(setSelectedObjectView(null));\n dispatch(setVersionsModeEnabled({ status: false }));\n if (detailsOpen && selectedInternalPaths !== null) {\n // We change URL to be the contained folder\n\n const splitURLS = internalPaths.split(\"/\");\n\n // We remove the last section of the URL as it should be a file\n splitURLS.pop();\n\n let URLItem = \"\";\n\n if (splitURLS && splitURLS.length > 0) {\n URLItem = `${splitURLS.join(\"/\")}/`;\n }\n\n navigate(\n `/browser/${encodeURIComponent(bucketName)}/${encodeURIComponent(URLItem)}`,\n );\n }\n\n dispatch(setObjectDetailsView(false));\n\n if (forceRefresh) {\n dispatch(setReloadObjectsList(true));\n }\n };\n\n const setDeletedAction = () => {\n dispatch(resetMessages());\n dispatch(setShowDeletedObjects(!showDeleted));\n onClosePanel(true);\n };\n\n const closeRenameModal = () => {\n dispatch(setDownloadRenameModal(null));\n };\n\n const closeAddAccessRule = () => {\n dispatch(setAnonymousAccessOpen(false));\n };\n\n let createdTime = DateTime.now();\n\n if (bucketInfo?.creation_date) {\n createdTime = DateTime.fromISO(bucketInfo.creation_date) as DateTime;\n }\n\n const downloadToolTip =\n selectedObjects?.length <= 1\n ? \"Download Selected\"\n : ` Download selected objects as Zip. Any Deleted objects in the selection would be skipped from download.`;\n\n const multiActionButtons = [\n {\n action: () => {\n dispatch(downloadSelected(bucketName));\n },\n label: \"Download\",\n disabled: !canDownload || isSelObjectDelMarker,\n icon: ,\n tooltip: canDownload\n ? downloadToolTip\n : permissionTooltipHelper(\n [IAM_SCOPES.S3_GET_OBJECT, IAM_SCOPES.S3_GET_ACTIONS],\n \"download objects from this bucket\",\n ),\n },\n {\n action: () => {\n dispatch(openShare());\n },\n label: \"Share\",\n disabled:\n selectedObjects.length !== 1 || !canShareFile || isSelObjectDelMarker,\n icon: ,\n tooltip: canShareFile ? \"Share Selected File\" : \"Sharing unavailable\",\n },\n {\n action: () => {\n dispatch(openPreview());\n },\n label: \"Preview\",\n disabled:\n selectedObjects.length !== 1 || !canPreviewFile || isSelObjectDelMarker,\n icon: ,\n tooltip: canPreviewFile ? \"Preview Selected File\" : \"Preview unavailable\",\n },\n {\n action: () => {\n dispatch(openAnonymousAccess());\n },\n label: \"Anonymous Access\",\n disabled:\n selectedObjects.length !== 1 ||\n !selectedObjects[0].endsWith(\"/\") ||\n !canSetAnonymousAccess,\n icon: ,\n tooltip:\n selectedObjects.length === 1 && selectedObjects[0].endsWith(\"/\")\n ? \"Set Anonymous Access to this Folder\"\n : \"Anonymous Access unavailable\",\n },\n {\n action: () => {\n setDeleteMultipleOpen(true);\n },\n label: \"Delete\",\n icon: ,\n disabled: !canDelete || selectedObjects.length === 0,\n tooltip: canDelete\n ? \"Delete Selected Files\"\n : permissionTooltipHelper(\n [IAM_SCOPES.S3_DELETE_OBJECT],\n \"delete objects in this bucket\",\n ),\n },\n ];\n\n return (\n \n {shareFileModalOpen && selectedPreview && (\n \n )}\n {deleteMultipleOpen && (\n \n )}\n {rewindSelect && (\n \n )}\n {previewOpen && selectedPreview && (\n \n )}\n {!!downloadRenameModal && (\n \n )}\n {anonymousAccessOpen && (\n \n )}\n\n \n {anonymousMode && (\n
\n \n
\n )}\n \n \n \n \n }\n title={bucketName}\n subTitle={\n !anonymousMode ? (\n \n \n Created on: \n \n {bucketInfo?.creation_date\n ? createdTime.toFormat(\n \"ccc, LLL dd yyyy HH:mm:ss (ZZZZ)\",\n )\n : \"\"}\n \n \n \n Access:  \n {bucketInfo?.access || \"\"}\n \n {bucketInfo && (\n \n \n {bucketInfo.size && (\n {niceBytesInt(bucketInfo.size)}\n )}\n {bucketInfo.size && quota && (\n \n {\" \"}\n / {niceBytesInt(quota.quota || 0)}\n \n )}\n {bucketInfo.size && bucketInfo.objects ? \" - \" : \"\"}\n {bucketInfo.objects && (\n \n {bucketInfo.objects} Object\n {bucketInfo.objects && bucketInfo.objects !== 1\n ? \"s\"\n : \"\"}\n \n )}\n \n \n )}\n \n ) : null\n }\n actions={\n \n {!anonymousMode && (\n \n \n \n \n }\n variant={\"regular\"}\n onClick={() => {\n setRewindSelect(true);\n }}\n disabled={!isVersioningApplied || !canRewind}\n />\n \n )}\n \n }\n variant={\"regular\"}\n onClick={() => {\n if (versionsMode) {\n dispatch(setLoadingVersions(true));\n } else {\n dispatch(resetMessages());\n dispatch(setReloadObjectsList(true));\n }\n }}\n disabled={\n anonymousMode\n ? false\n : !hasPermission(bucketName, [\n IAM_SCOPES.S3_LIST_BUCKET,\n IAM_SCOPES.S3_ALL_LIST_BUCKET,\n ]) || rewindEnabled\n }\n />\n \n \n \n {\n if (fileUpload && fileUpload.current) {\n fileUpload.current.click();\n }\n closeMenu();\n }}\n uploadFolderFunction={(closeMenu) => {\n if (folderUpload && folderUpload.current) {\n folderUpload.current.click();\n }\n closeMenu();\n }}\n />\n \n }\n bottomBorder={false}\n />\n \n \n \n \n {versionsMode ? (\n \n {selectedInternalPaths !== null && (\n \n )}\n \n ) : (\n \n \n {!anonymousMode && (\n \n \n )\n }\n hidePathButton={false}\n />\n \n )}\n \n \n \n )}\n {!anonymousMode && (\n \n {\n onClosePanel(false);\n }}\n className={`${versionsMode ? \"hideListOnSmall\" : \"\"}`}\n >\n {selectedObjects.length > 0 && (\n \n )}\n {selectedInternalPaths !== null && (\n \n )}\n \n \n )}\n \n \n
\n
\n );\n};\n\nexport default ListObjects;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2023 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect } from \"react\";\nimport {\n IAM_PAGES,\n IAM_PERMISSIONS,\n IAM_ROLES,\n IAM_SCOPES,\n} from \"../../../common/SecureComponent/permissions\";\nimport { SecureComponent } from \"../../../common/SecureComponent\";\nimport TooltipWrapper from \"../Common/TooltipWrapper/TooltipWrapper\";\nimport { BackLink, Button, SettingsIcon, Grid } from \"mds\";\nimport AutoColorIcon from \"../Common/Components/AutoColorIcon\";\nimport { useSelector } from \"react-redux\";\nimport { selFeatures } from \"../consoleSlice\";\nimport hasPermission from \"../../../common/SecureComponent/accessControl\";\nimport { useNavigate } from \"react-router-dom\";\nimport SearchBox from \"../Common/SearchBox\";\nimport { setSearchVersions } from \"./objectBrowserSlice\";\nimport { AppState, useAppDispatch } from \"../../../store\";\nimport FilterObjectsSB from \"./FilterObjectsSB\";\nimport PageHeaderWrapper from \"../Common/PageHeaderWrapper/PageHeaderWrapper\";\nimport ObjectManagerButton from \"../Common/ObjectManager/ObjectManagerButton\";\nimport HelpMenu from \"../HelpMenu\";\nimport { setHelpName } from \"../../../systemSlice\";\n\ninterface IOBHeader {\n bucketName: string;\n}\n\nconst OBHeader = ({ bucketName }: IOBHeader) => {\n const dispatch = useAppDispatch();\n const features = useSelector(selFeatures);\n\n const versionsMode = useSelector(\n (state: AppState) => state.objectBrowser.versionsMode,\n );\n const versionedFile = useSelector(\n (state: AppState) => state.objectBrowser.versionedFile,\n );\n const searchVersions = useSelector(\n (state: AppState) => state.objectBrowser.searchVersions,\n );\n\n const obOnly = !!features?.includes(\"object-browser-only\");\n\n const navigate = useNavigate();\n\n const configureBucketAllowed = hasPermission(bucketName, [\n IAM_SCOPES.S3_GET_BUCKET_POLICY,\n IAM_SCOPES.S3_PUT_BUCKET_POLICY,\n IAM_SCOPES.S3_GET_BUCKET_VERSIONING,\n IAM_SCOPES.S3_PUT_BUCKET_VERSIONING,\n IAM_SCOPES.S3_GET_BUCKET_ENCRYPTION_CONFIGURATION,\n IAM_SCOPES.S3_PUT_BUCKET_ENCRYPTION_CONFIGURATION,\n IAM_SCOPES.S3_DELETE_BUCKET,\n IAM_SCOPES.S3_GET_BUCKET_NOTIFICATIONS,\n IAM_SCOPES.S3_PUT_BUCKET_NOTIFICATIONS,\n IAM_SCOPES.S3_GET_REPLICATION_CONFIGURATION,\n IAM_SCOPES.S3_PUT_REPLICATION_CONFIGURATION,\n IAM_SCOPES.ADMIN_GET_BUCKET_QUOTA,\n IAM_SCOPES.ADMIN_SET_BUCKET_QUOTA,\n IAM_SCOPES.S3_PUT_BUCKET_TAGGING,\n IAM_SCOPES.S3_GET_BUCKET_TAGGING,\n IAM_SCOPES.S3_LIST_BUCKET_VERSIONS,\n IAM_SCOPES.S3_GET_BUCKET_POLICY_STATUS,\n IAM_SCOPES.S3_DELETE_BUCKET_POLICY,\n IAM_SCOPES.S3_GET_ACTIONS,\n IAM_SCOPES.S3_PUT_ACTIONS,\n ]);\n\n const searchBar = (\n \n {!versionsMode ? (\n \n \n \n ) : (\n \n {\n dispatch(setSearchVersions(value));\n }}\n value={searchVersions}\n />\n \n )}\n \n );\n\n useEffect(() => {\n dispatch(setHelpName(\"object_browser\"));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n \n {!obOnly ? (\n {\n navigate(IAM_PAGES.OBJECT_BROWSER_VIEW);\n }}\n />\n }\n actions={\n \n \n \n navigate(`/buckets/${bucketName}/admin`)}\n icon={\n \n }\n style={{\n padding: \"0 10px\",\n }}\n />\n \n \n \n \n }\n middleComponent={searchBar}\n />\n ) : (\n \n \n \n \n \n {searchBar}\n \n \n \n )}\n \n );\n};\n\nexport default OBHeader;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useCallback, useEffect } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { useLocation, useParams } from \"react-router-dom\";\nimport { api } from \"api\";\nimport { AppState, useAppDispatch } from \"../../../../store\";\nimport { IAM_SCOPES } from \"../../../../common/SecureComponent/permissions\";\nimport {\n resetMessages,\n setIsVersioned,\n setLoadingLocking,\n setLoadingObjectInfo,\n setLoadingVersioning,\n setLoadingVersions,\n setLockingEnabled,\n setObjectDetailsView,\n setRequestInProgress,\n setSelectedObjectView,\n setVersionsModeEnabled,\n} from \"../../ObjectBrowser/objectBrowserSlice\";\nimport ListObjects from \"../ListBuckets/Objects/ListObjects/ListObjects\";\nimport hasPermission from \"../../../../common/SecureComponent/accessControl\";\nimport OBHeader from \"../../ObjectBrowser/OBHeader\";\n\nconst BrowserHandler = () => {\n const dispatch = useAppDispatch();\n const params = useParams();\n const location = useLocation();\n\n const loadingVersioning = useSelector(\n (state: AppState) => state.objectBrowser.loadingVersioning,\n );\n\n const rewindEnabled = useSelector(\n (state: AppState) => state.objectBrowser.rewind.rewindEnabled,\n );\n const rewindDate = useSelector(\n (state: AppState) => state.objectBrowser.rewind.dateToRewind,\n );\n const showDeleted = useSelector(\n (state: AppState) => state.objectBrowser.showDeleted,\n );\n const requestInProgress = useSelector(\n (state: AppState) => state.objectBrowser.requestInProgress,\n );\n const loadingLocking = useSelector(\n (state: AppState) => state.objectBrowser.loadingLocking,\n );\n const reloadObjectsList = useSelector(\n (state: AppState) => state.objectBrowser.reloadObjectsList,\n );\n const simplePath = useSelector(\n (state: AppState) => state.objectBrowser.simplePath,\n );\n const anonymousMode = useSelector(\n (state: AppState) => state.system.anonymousMode,\n );\n const selectedBucket = useSelector(\n (state: AppState) => state.objectBrowser.selectedBucket,\n );\n const records = useSelector((state: AppState) => state.objectBrowser.records);\n\n const bucketName = params.bucketName || \"\";\n const pathSegment = location.pathname.split(\n `/browser/${encodeURIComponent(bucketName)}/`,\n );\n const internalPaths =\n pathSegment.length === 2 ? decodeURIComponent(pathSegment[1]) : \"\";\n\n const initWSRequest = useCallback(\n (path: string) => {\n let currDate = new Date();\n\n let date = currDate.toISOString();\n\n if (rewindDate !== null && rewindEnabled) {\n date = rewindDate;\n }\n\n const payloadData = {\n bucketName,\n path,\n rewindMode: rewindEnabled || showDeleted,\n date: date,\n };\n\n dispatch({ type: \"socket/OBRequest\", payload: payloadData });\n },\n [bucketName, showDeleted, rewindDate, rewindEnabled, dispatch],\n );\n\n // Common path load\n const pathLoad = useCallback(\n (forceLoad: boolean = false) => {\n // We exit Versions mode in case of path change\n dispatch(setVersionsModeEnabled({ status: false }));\n\n let searchPath = internalPaths;\n\n if (!internalPaths.endsWith(\"/\") && internalPaths !== \"\") {\n searchPath = `${internalPaths.split(\"/\").slice(0, -1).join(\"/\")}/`;\n }\n\n if (searchPath === \"/\") {\n searchPath = \"\";\n }\n\n // If the path is different of the actual path or reload objects list is requested, then we initialize a new request to load a new record set.\n if (\n searchPath !== simplePath ||\n bucketName !== selectedBucket ||\n forceLoad\n ) {\n dispatch(setRequestInProgress(true));\n initWSRequest(searchPath);\n }\n },\n [\n internalPaths,\n dispatch,\n simplePath,\n selectedBucket,\n bucketName,\n initWSRequest,\n ],\n );\n\n useEffect(() => {\n return () => {\n dispatch({ type: \"socket/OBCancelLast\" });\n };\n }, [dispatch]);\n\n // Object Details handler\n useEffect(() => {\n dispatch(setLoadingVersioning(true));\n\n if (internalPaths.endsWith(\"/\") || internalPaths === \"\") {\n dispatch(setObjectDetailsView(false));\n dispatch(setSelectedObjectView(null));\n dispatch(setLoadingLocking(true));\n } else {\n dispatch(setLoadingObjectInfo(true));\n dispatch(setObjectDetailsView(true));\n dispatch(setLoadingVersions(true));\n dispatch(setSelectedObjectView(internalPaths || \"\"));\n }\n }, [bucketName, internalPaths, rewindDate, rewindEnabled, dispatch]);\n\n // Navigation Listing Request\n useEffect(() => {\n pathLoad(false);\n }, [pathLoad]);\n\n // Reload Handler\n useEffect(() => {\n if (reloadObjectsList && records.length === 0 && !requestInProgress) {\n pathLoad(true);\n }\n }, [reloadObjectsList, records, requestInProgress, pathLoad]);\n\n const displayListObjects =\n hasPermission(bucketName, [\n IAM_SCOPES.S3_LIST_BUCKET,\n IAM_SCOPES.S3_ALL_LIST_BUCKET,\n ]) || anonymousMode;\n\n useEffect(() => {\n if (loadingVersioning && !anonymousMode) {\n if (displayListObjects) {\n api.buckets\n .getBucketVersioning(bucketName)\n .then((res) => {\n dispatch(setIsVersioned(res.data));\n dispatch(setLoadingVersioning(false));\n })\n .catch((err) => {\n console.error(\n \"Error Getting Object Versioning Status: \",\n err.error.detailedMessage,\n );\n dispatch(setLoadingVersioning(false));\n });\n } else {\n dispatch(setLoadingVersioning(false));\n dispatch(resetMessages());\n }\n }\n }, [\n bucketName,\n loadingVersioning,\n dispatch,\n displayListObjects,\n anonymousMode,\n ]);\n\n useEffect(() => {\n if (loadingLocking) {\n if (displayListObjects) {\n api.buckets\n .getBucketObjectLockingStatus(bucketName)\n .then((res) => {\n dispatch(setLockingEnabled(res.data.object_locking_enabled));\n dispatch(setLoadingLocking(false));\n })\n .catch((err) => {\n console.error(\n \"Error Getting Object Locking Status: \",\n err.error.detailedMessage,\n );\n dispatch(setLoadingLocking(false));\n });\n } else {\n dispatch(resetMessages());\n dispatch(setLoadingLocking(false));\n }\n }\n }, [bucketName, loadingLocking, dispatch, displayListObjects]);\n\n return (\n \n {!anonymousMode && }\n \n \n );\n};\n\nexport default BrowserHandler;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState } from \"react\";\nimport { DateTime } from \"luxon\";\nimport { Box, InputBox, InputLabel, LinkIcon } from \"mds\";\n\nconst DAY_SECONDS = 86400;\nconst HOUR_SECONDS = 3600;\nconst HOUR_MINUTES = 60;\n\ninterface IDaysSelector {\n id: string;\n maxSeconds: number;\n label: string;\n entity: string;\n onChange: (newDate: string, isValid: boolean) => void;\n}\n\nconst calculateNewTime = (days: number, hours: number, minutes: number) => {\n return DateTime.now()\n .plus({\n hours: hours + days * 24,\n minutes,\n })\n .toISO(); // Lump days into hours to avoid daylight savings causing issues\n};\n\nconst DaysSelector = ({\n id,\n label,\n maxSeconds,\n entity,\n onChange,\n}: IDaysSelector) => {\n const maxDays = Math.floor(maxSeconds / DAY_SECONDS);\n const maxHours = Math.floor((maxSeconds % DAY_SECONDS) / HOUR_SECONDS);\n const maxMinutes = Math.floor((maxSeconds % HOUR_SECONDS) / HOUR_MINUTES);\n\n const [selectedDays, setSelectedDays] = useState(0);\n const [selectedHours, setSelectedHours] = useState(0);\n const [selectedMinutes, setSelectedMinutes] = useState(0);\n const [validDate, setValidDate] = useState(true);\n const [dateSelected, setDateSelected] = useState(null);\n\n // Set initial values\n useEffect(() => {\n setSelectedDays(maxDays);\n setSelectedHours(maxHours);\n setSelectedMinutes(maxMinutes);\n }, [maxDays, maxHours, maxMinutes]);\n\n useEffect(() => {\n if (\n !isNaN(selectedHours) &&\n !isNaN(selectedDays) &&\n !isNaN(selectedMinutes)\n ) {\n setDateSelected(\n calculateNewTime(selectedDays, selectedHours, selectedMinutes),\n );\n }\n }, [selectedDays, selectedHours, selectedMinutes]);\n\n useEffect(() => {\n if (validDate && dateSelected) {\n const formattedDate = DateTime.fromISO(dateSelected).toFormat(\n \"yyyy-MM-dd HH:mm:ss\",\n );\n onChange(formattedDate.split(\" \").join(\"T\"), true);\n } else {\n onChange(\"0000-00-00\", false);\n }\n }, [dateSelected, onChange, validDate]);\n\n // Basic validation for inputs\n useEffect(() => {\n let valid = true;\n\n if (\n selectedDays < 0 ||\n selectedDays > 7 ||\n selectedDays > maxDays ||\n isNaN(selectedDays)\n ) {\n valid = false;\n }\n\n if (selectedHours < 0 || selectedHours > 23 || isNaN(selectedHours)) {\n valid = false;\n }\n\n if (selectedMinutes < 0 || selectedMinutes > 59 || isNaN(selectedMinutes)) {\n valid = false;\n }\n\n if (selectedDays === maxDays) {\n if (selectedHours > maxHours) {\n valid = false;\n }\n\n if (selectedHours === maxHours) {\n if (selectedMinutes > maxMinutes) {\n valid = false;\n }\n }\n }\n\n if (selectedDays <= 0 && selectedHours <= 0 && selectedMinutes <= 0) {\n valid = false;\n }\n\n setValidDate(valid);\n }, [\n dateSelected,\n maxDays,\n maxHours,\n maxMinutes,\n onChange,\n selectedDays,\n selectedHours,\n selectedMinutes,\n ]);\n\n const extraStyles = {\n \"& .textBoxContainer\": {\n minWidth: 0,\n },\n \"& input\": {\n textAlign: \"center\" as const,\n paddingRight: 10,\n paddingLeft: 10,\n width: 40,\n },\n };\n\n return (\n \n \n {label}\n \n label\": {\n fontWeight: 400,\n marginLeft: 15,\n marginRight: 25,\n },\n },\n }}\n >\n \n {\n setSelectedDays(parseInt(e.target.value));\n }}\n value={selectedDays.toString()}\n sx={extraStyles}\n noLabelMinWidth\n />\n \n \n {\n setSelectedHours(parseInt(e.target.value));\n }}\n value={selectedHours.toString()}\n sx={extraStyles}\n noLabelMinWidth\n />\n \n \n {\n setSelectedMinutes(parseInt(e.target.value));\n }}\n value={selectedMinutes.toString()}\n sx={extraStyles}\n noLabelMinWidth\n />\n \n \n .min-icon\": {\n color: \"#5E5E5E\",\n width: 15,\n height: 15,\n marginRight: 10,\n },\n },\n \"& .validTill\": {\n fontWeight: \"bold\",\n marginLeft: 15,\n },\n \"& .invalidDurationText\": {\n marginTop: 15,\n display: \"flex\",\n color: \"red\",\n fontSize: 11,\n },\n }}\n >\n {validDate && dateSelected ? (\n
\n \n
{entity} will be available until:
{\" \"}\n
\n {DateTime.fromISO(dateSelected).toFormat(\n \"MM/dd/yyyy HH:mm:ss ZZZZ\",\n )}\n
\n
\n ) : (\n
\n Please select a valid duration.\n
\n )}\n \n \n );\n};\n\nexport default DaysSelector;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport {\n Button,\n CopyIcon,\n ReadBox,\n ShareIcon,\n Grid,\n ProgressBar,\n Tooltip,\n} from \"mds\";\nimport CopyToClipboard from \"react-copy-to-clipboard\";\nimport ModalWrapper from \"../../../../Common/ModalWrapper/ModalWrapper\";\nimport DaysSelector from \"../../../../Common/FormComponents/DaysSelector/DaysSelector\";\nimport { niceTimeFromSeconds } from \"../../../../../../common/utils\";\nimport {\n selDistSet,\n setModalErrorSnackMessage,\n setModalSnackMessage,\n} from \"../../../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../../../store\";\nimport { BucketObject } from \"api/consoleApi\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport { getMaxShareLinkExpTime } from \"screens/Console/ObjectBrowser/objectBrowserThunks\";\nimport { maxShareLinkExpTime } from \"screens/Console/ObjectBrowser/objectBrowserSlice\";\nimport debounce from \"lodash/debounce\";\n\ninterface IShareFileProps {\n open: boolean;\n bucketName: string;\n dataObject: BucketObject;\n closeModalAndRefresh: () => void;\n}\n\nconst ShareFile = ({\n open,\n closeModalAndRefresh,\n bucketName,\n dataObject,\n}: IShareFileProps) => {\n const dispatch = useAppDispatch();\n const distributedSetup = useSelector(selDistSet);\n const maxShareLinkExpTimeVal = useSelector(maxShareLinkExpTime);\n const [shareURL, setShareURL] = useState(\"\");\n const [isLoadingVersion, setIsLoadingVersion] = useState(true);\n const [isLoadingFile, setIsLoadingFile] = useState(false);\n const [selectedDate, setSelectedDate] = useState(\"\");\n const [dateValid, setDateValid] = useState(true);\n const [versionID, setVersionID] = useState(\"null\");\n\n const debouncedDateChange = debounce((newDate: string, isValid: boolean) => {\n setDateValid(isValid);\n if (isValid) {\n setSelectedDate(newDate);\n return;\n }\n setSelectedDate(\"\");\n setShareURL(\"\");\n }, 300);\n\n useEffect(() => {\n dispatch(getMaxShareLinkExpTime());\n }, [dispatch]);\n\n useEffect(() => {\n // In case version is undefined, we get the latest version of the object\n if (dataObject.version_id === undefined) {\n // In case it is not distributed setup, then we default to \"null\";\n if (distributedSetup) {\n api.buckets\n .listObjects(bucketName, {\n prefix: dataObject.name || \"\",\n with_versions: distributedSetup,\n })\n .then((res) => {\n const result: BucketObject[] = res.data.objects || [];\n\n const latestVersion: BucketObject | undefined = result.find(\n (elem: BucketObject) => elem.is_latest,\n );\n\n if (latestVersion) {\n setVersionID(`${latestVersion.version_id}`);\n return;\n }\n\n // Version couldn't be retrieved, we default\n setVersionID(\"null\");\n })\n .catch((err) => {\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n });\n\n setIsLoadingVersion(false);\n return;\n }\n setVersionID(\"null\");\n setIsLoadingVersion(false);\n return;\n }\n setVersionID(dataObject.version_id || \"null\");\n setIsLoadingVersion(false);\n }, [bucketName, dataObject, distributedSetup, dispatch]);\n\n useEffect(() => {\n if (dateValid && !isLoadingVersion) {\n setIsLoadingFile(true);\n setShareURL(\"\");\n\n const slDate = new Date(`${selectedDate}`);\n const currDate = new Date();\n\n const diffDate = Math.ceil(\n (slDate.getTime() - currDate.getTime()) / 1000,\n );\n\n if (diffDate > 0) {\n api.buckets\n .shareObject(bucketName, {\n prefix: dataObject.name || \"\",\n version_id: versionID,\n expires: selectedDate !== \"\" ? `${diffDate}s` : \"\",\n })\n .then((res) => {\n setShareURL(res.data);\n setIsLoadingFile(false);\n })\n .catch((err) => {\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n setShareURL(\"\");\n setIsLoadingFile(false);\n });\n }\n }\n }, [\n dataObject,\n selectedDate,\n bucketName,\n dateValid,\n setShareURL,\n dispatch,\n distributedSetup,\n isLoadingVersion,\n versionID,\n ]);\n\n return (\n \n }\n modalOpen={open}\n onClose={() => {\n closeModalAndRefresh();\n }}\n >\n {isLoadingVersion && (\n \n \n \n )}\n {!isLoadingVersion && (\n \n \n \n You can reset your session by logging out and logging back\n in to the web UI.

\n You can increase the maximum configuration time by setting\n the MINIO_STS_DURATION environment variable on all your\n nodes.

\n You can use mc share as an alternative to this UI,\n where the session length does not limit the URL validity.\n \n }\n >\n \n The following URL lets you share this object without requiring\n a login.
\n The URL expires automatically at the earlier of your\n configured time ({niceTimeFromSeconds(maxShareLinkExpTimeVal)}\n ) or the expiration of your current web session.\n
\n \n \n
\n \n \n \n \n \n {\n dispatch(\n setModalSnackMessage(\"Share URL Copied to clipboard\"),\n );\n }}\n disabled={shareURL === \"\" || isLoadingFile}\n style={{\n width: \"28px\",\n height: \"28px\",\n padding: \"0px\",\n }}\n icon={}\n />\n \n }\n >\n {shareURL}\n \n \n
\n )}\n \n
\n );\n};\n\nexport default ShareFile;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2023 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useState } from \"react\";\nimport { Document, Page, pdfjs } from \"react-pdf\";\nimport { Box, Button, InformativeMessage } from \"mds\";\n\npdfjs.GlobalWorkerOptions.workerSrc = \"./scripts/pdf.worker.min.mjs\";\n\ninterface IPreviewPDFProps {\n path: string;\n loading: boolean;\n onLoad: () => void;\n downloadFile: () => void;\n}\n\nconst PreviewPDF = ({\n path,\n loading,\n onLoad,\n downloadFile,\n}: IPreviewPDFProps) => {\n const [errorState, setErrorState] = useState(false);\n const [totalPages, setTotalPages] = useState(0);\n\n if (!path) {\n return null;\n }\n\n const renderPages = totalPages > 5 ? 5 : totalPages;\n const arrayCreate = Array.from(Array(renderPages).keys());\n\n return (\n \n {errorState && totalPages === 0 && (\n \n File preview couldn't be displayed, Please try Download instead.\n \n \n Download File\n \n \n \n }\n sx={{ marginBottom: 10 }}\n />\n )}\n {!loading && !errorState && (\n \n This is a File Preview for the first {arrayCreate.length} pages of\n the document, if you wish to work with the full document please\n download instead.\n \n \n Download File\n \n \n \n }\n sx={{ marginBottom: 10 }}\n />\n )}\n {!errorState && (\n \n {\n setTotalPages(_pdfInfo.numPages || 0);\n setErrorState(false);\n onLoad();\n }}\n onLoadError={(error) => {\n setErrorState(true);\n onLoad();\n console.error(error);\n }}\n >\n {arrayCreate.map((item) => (\n \n ))}\n \n \n )}\n \n );\n};\n\nexport default PreviewPDF;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useCallback, useEffect, useState } from \"react\";\nimport { ProgressBar, Grid, Box, InformativeMessage } from \"mds\";\nimport get from \"lodash/get\";\nimport { AllowedPreviews, previewObjectType } from \"../utils\";\nimport { api } from \"../../../../../../api\";\nimport PreviewPDF from \"./PreviewPDF\";\nimport { downloadObject } from \"../../../../ObjectBrowser/utils\";\nimport { useAppDispatch } from \"../../../../../../store\";\nimport { BucketObject } from \"../../../../../../api/consoleApi\";\n\ninterface IPreviewFileProps {\n bucketName: string;\n actualInfo: BucketObject;\n isFullscreen?: boolean;\n}\n\nconst PreviewFile = ({\n bucketName,\n actualInfo,\n isFullscreen = false,\n}: IPreviewFileProps) => {\n const dispatch = useAppDispatch();\n\n const [loading, setLoading] = useState(true);\n\n const [metaData, setMetaData] = useState(null);\n const [isMetaDataLoaded, setIsMetaDataLoaded] = useState(false);\n\n const objectName = actualInfo?.name || \"\";\n\n const fetchMetadata = useCallback(() => {\n if (!isMetaDataLoaded) {\n api.buckets\n .getObjectMetadata(bucketName, {\n prefix: objectName,\n versionID: actualInfo.version_id || \"\",\n })\n .then((res) => {\n let metadata = get(res.data, \"objectMetadata\", {});\n setIsMetaDataLoaded(true);\n setMetaData(metadata);\n })\n .catch((err) => {\n console.error(\n \"Error Getting Metadata Status: \",\n err,\n err?.detailedError,\n );\n setIsMetaDataLoaded(true);\n });\n }\n }, [bucketName, objectName, isMetaDataLoaded, actualInfo.version_id]);\n\n useEffect(() => {\n if (bucketName && objectName) {\n fetchMetadata();\n }\n }, [bucketName, objectName, fetchMetadata]);\n\n let path = \"\";\n\n if (actualInfo) {\n let basename = document.baseURI.replace(window.location.origin, \"\");\n path = `${window.location.origin}${basename}api/v1/buckets/${encodeURIComponent(bucketName)}/objects/download?preview=true&prefix=${encodeURIComponent(actualInfo.name || \"\")}`;\n if (actualInfo.version_id) {\n path = path.concat(`&version_id=${actualInfo.version_id}`);\n }\n }\n\n let objectType: AllowedPreviews = previewObjectType(metaData, objectName);\n\n const iframeLoaded = () => {\n setLoading(false);\n };\n\n return (\n \n {objectType !== \"none\" && loading && (\n \n \n \n )}\n {isMetaDataLoaded ? (\n \n {objectType === \"video\" && (\n \n \n \n )}\n {objectType === \"audio\" && (\n \n \n \n )}\n {objectType === \"image\" && (\n \n )}\n {objectType === \"pdf\" && (\n \n \n downloadObject(dispatch, bucketName, path, actualInfo)\n }\n />\n \n )}\n {objectType === \"none\" && (\n
\n \n
\n )}\n {objectType !== \"none\" &&\n objectType !== \"video\" &&\n objectType !== \"audio\" &&\n objectType !== \"image\" &&\n objectType !== \"pdf\" && (\n
\n \n File couldn't be loaded. Please try Download instead\n \n
\n )}\n \n ) : null}\n
\n );\n};\nexport default PreviewFile;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport ModalWrapper from \"../../../../Common/ModalWrapper/ModalWrapper\";\nimport PreviewFileContent from \"./PreviewFileContent\";\nimport { ObjectPreviewIcon } from \"mds\";\nimport { BucketObject } from \"../../../../../../api/consoleApi\";\n\ninterface IPreviewFileProps {\n open: boolean;\n bucketName: string;\n actualInfo: BucketObject;\n onClosePreview: () => void;\n}\n\nconst PreviewFileModal = ({\n open,\n bucketName,\n actualInfo,\n onClosePreview,\n}: IPreviewFileProps) => {\n return (\n \n }\n >\n \n \n \n );\n};\n\nexport default PreviewFileModal;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { ComponentType, Suspense, SuspenseProps } from \"react\";\n\nfunction withSuspense

(\n WrappedComponent: ComponentType

,\n fallback: SuspenseProps[\"fallback\"] = null,\n) {\n function ComponentWithSuspense(props: P) {\n return (\n \n \n \n );\n }\n\n return ComponentWithSuspense;\n}\n\nexport default withSuspense;\n","import { useState } from \"react\";\nimport api from \"../../../../common/api\";\nimport { ErrorResponseHandler } from \"../../../../common/types\";\n\ntype NoReturnFunction = (param?: any) => void;\ntype ApiMethodToInvoke = (method: string, url: string, data?: any) => void;\ntype IsApiInProgress = boolean;\n\nconst useApi = (\n onSuccess: NoReturnFunction,\n onError: NoReturnFunction,\n): [IsApiInProgress, ApiMethodToInvoke] => {\n const [isLoading, setIsLoading] = useState(false);\n\n const callApi = (method: string, url: string, data?: any, headers?: any) => {\n setIsLoading(true);\n api\n .invoke(method, url, data, headers)\n .then((res: any) => {\n setIsLoading(false);\n onSuccess(res);\n })\n .catch((err: ErrorResponseHandler) => {\n setIsLoading(false);\n onError(err);\n });\n };\n\n return [isLoading, callApi];\n};\n\nexport default useApi;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { ModalBox, Snackbar } from \"mds\";\nimport { CSSObject } from \"styled-components\";\nimport { AppState, useAppDispatch } from \"../../../../store\";\nimport { setModalSnackMessage } from \"../../../../systemSlice\";\nimport MainError from \"../MainError/MainError\";\n\ninterface IModalProps {\n onClose: () => void;\n modalOpen: boolean;\n title: string | React.ReactNode;\n children: any;\n wideLimit?: boolean;\n titleIcon?: React.ReactNode;\n iconColor?: \"default\" | \"delete\" | \"accept\";\n sx?: CSSObject;\n}\n\nconst ModalWrapper = ({\n onClose,\n modalOpen,\n title,\n children,\n wideLimit = true,\n titleIcon = null,\n iconColor = \"default\",\n sx,\n}: IModalProps) => {\n const dispatch = useAppDispatch();\n const [openSnackbar, setOpenSnackbar] = useState(false);\n\n const modalSnackMessage = useSelector(\n (state: AppState) => state.system.modalSnackBar,\n );\n\n useEffect(() => {\n dispatch(setModalSnackMessage(\"\"));\n }, [dispatch]);\n\n useEffect(() => {\n if (modalSnackMessage) {\n if (modalSnackMessage.message === \"\") {\n setOpenSnackbar(false);\n return;\n }\n // Open SnackBar\n if (modalSnackMessage.type !== \"error\") {\n setOpenSnackbar(true);\n }\n }\n }, [modalSnackMessage]);\n\n const closeSnackBar = () => {\n setOpenSnackbar(false);\n dispatch(setModalSnackMessage(\"\"));\n };\n\n let message = \"\";\n\n if (modalSnackMessage) {\n message = modalSnackMessage.detailedErrorMsg;\n if (message === \"\" || (message && message.length < 5)) {\n message = modalSnackMessage.message;\n }\n }\n\n return (\n \n \n \n {children}\n \n );\n};\n\nexport default ModalWrapper;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport { createAsyncThunk } from \"@reduxjs/toolkit\";\nimport { AppState } from \"../../../store\";\nimport { getClientOS } from \"../../../common/utils\";\nimport { BucketObjectItem } from \"../Buckets/ListBuckets/Objects/ListObjects/types\";\nimport { makeid, storeCallForObjectWithID } from \"./transferManager\";\nimport {\n download,\n downloadSelectedAsZip,\n} from \"../Buckets/ListBuckets/Objects/utils\";\nimport {\n cancelObjectInList,\n completeObject,\n failObject,\n setAnonymousAccessOpen,\n setDownloadRenameModal,\n setMaxShareLinkExpTime,\n setNewObject,\n setPreviewOpen,\n setSelectedPreview,\n setShareFileModalOpen,\n updateProgress,\n} from \"./objectBrowserSlice\";\nimport { setSnackBarMessage } from \"../../../systemSlice\";\nimport { DateTime } from \"luxon\";\nimport { api } from \"api\";\n\nexport const downloadSelected = createAsyncThunk(\n \"objectBrowser/downloadSelected\",\n async (bucketName: string, { getState, rejectWithValue, dispatch }) => {\n const state = getState() as AppState;\n\n const downloadObject = (object: BucketObjectItem) => {\n const identityDownload = encodeURIComponent(\n `${bucketName}-${object.name}-${new Date().getTime()}-${Math.random()}`,\n );\n\n const ID = makeid(8);\n\n const downloadCall = download(\n bucketName,\n object.name,\n object.version_id,\n object.size,\n null,\n ID,\n (progress) => {\n dispatch(\n updateProgress({\n instanceID: identityDownload,\n progress: progress,\n }),\n );\n },\n () => {\n dispatch(completeObject(identityDownload));\n },\n (msg: string) => {\n dispatch(failObject({ instanceID: identityDownload, msg }));\n },\n () => {\n dispatch(cancelObjectInList(identityDownload));\n },\n () => {\n dispatch(\n setSnackBarMessage(\n \"File download will be handled directly by the browser.\",\n ),\n );\n },\n );\n storeCallForObjectWithID(ID, downloadCall);\n dispatch(\n setNewObject({\n ID,\n bucketName,\n done: false,\n instanceID: identityDownload,\n percentage: 0,\n prefix: object.name,\n type: \"download\",\n waitingForFile: true,\n failed: false,\n cancelled: false,\n errorMessage: \"\",\n }),\n );\n };\n\n if (state.objectBrowser.selectedObjects.length !== 0) {\n let itemsToDownload: BucketObjectItem[] = [];\n\n const filterFunction = (currValue: BucketObjectItem) =>\n state.objectBrowser.selectedObjects.includes(currValue.name);\n\n itemsToDownload = state.objectBrowser.records.filter(filterFunction);\n\n // In case just one element is selected, then we trigger download modal validation.\n if (itemsToDownload.length === 1) {\n if (\n itemsToDownload[0].name.length > 200 &&\n getClientOS().toLowerCase().includes(\"win\")\n ) {\n dispatch(setDownloadRenameModal(itemsToDownload[0]));\n return;\n } else {\n downloadObject(itemsToDownload[0]);\n }\n } else {\n if (itemsToDownload.length === 1) {\n downloadObject(itemsToDownload[0]);\n } else if (itemsToDownload.length > 1) {\n const fileName = `${DateTime.now().toFormat(\n \"LL-dd-yyyy-HH-mm-ss\",\n )}_files_list.zip`;\n\n // We are enforcing zip download when multiple files are selected for better user experience\n const multiObjList = itemsToDownload.reduce((dwList: any[], bi) => {\n // Download objects/prefixes(recursively) as zip\n // Skip any deleted files selected via \"Show deleted objects\" in selection and log for debugging\n const isDeleted = bi?.delete_flag;\n if (bi && !isDeleted) {\n dwList.push(bi.name);\n } else {\n console.log(`Skipping ${bi?.name} from download.`);\n }\n return dwList;\n }, []);\n\n await downloadSelectedAsZip(bucketName, multiObjList, fileName);\n return;\n }\n }\n }\n },\n);\n\nexport const openPreview = createAsyncThunk(\n \"objectBrowser/openPreview\",\n async (_, { getState, rejectWithValue, dispatch }) => {\n const state = getState() as AppState;\n\n if (state.objectBrowser.selectedObjects.length === 1) {\n let fileObject: BucketObjectItem | undefined;\n\n const findFunction = (currValue: BucketObjectItem) =>\n state.objectBrowser.selectedObjects.includes(currValue.name);\n\n fileObject = state.objectBrowser.records.find(findFunction);\n\n if (fileObject) {\n dispatch(setSelectedPreview(fileObject));\n dispatch(setPreviewOpen(true));\n }\n }\n },\n);\n\nexport const openShare = createAsyncThunk(\n \"objectBrowser/openShare\",\n async (_, { getState, rejectWithValue, dispatch }) => {\n const state = getState() as AppState;\n\n if (state.objectBrowser.selectedObjects.length === 1) {\n let fileObject: BucketObjectItem | undefined;\n\n const findFunction = (currValue: BucketObjectItem) =>\n state.objectBrowser.selectedObjects.includes(currValue.name);\n\n fileObject = state.objectBrowser.records.find(findFunction);\n\n if (fileObject) {\n dispatch(setSelectedPreview(fileObject));\n dispatch(setShareFileModalOpen(true));\n }\n }\n },\n);\n\nexport const openAnonymousAccess = createAsyncThunk(\n \"objectBrowser/openAnonymousAccess\",\n async (_, { getState, dispatch }) => {\n const state = getState() as AppState;\n\n if (\n state.objectBrowser.selectedObjects.length === 1 &&\n state.objectBrowser.selectedObjects[0].endsWith(\"/\")\n ) {\n dispatch(setAnonymousAccessOpen(true));\n }\n },\n);\n\nexport const getMaxShareLinkExpTime = createAsyncThunk(\n \"objectBrowser/maxShareLinkExpTime\",\n async (_, { rejectWithValue, dispatch }) => {\n return api.buckets\n .getMaxShareLinkExp()\n .then((res) => {\n dispatch(setMaxShareLinkExpTime(res.data.exp));\n })\n .catch(async (res) => {\n return rejectWithValue(res.error);\n });\n },\n);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2023 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport { getClientOS } from \"../../../common/utils\";\nimport { makeid, storeCallForObjectWithID } from \"./transferManager\";\nimport { download } from \"../Buckets/ListBuckets/Objects/utils\";\nimport {\n cancelObjectInList,\n completeObject,\n failObject,\n setLongFileOpen,\n setNewObject,\n updateProgress,\n} from \"./objectBrowserSlice\";\nimport { AppDispatch } from \"../../../store\";\nimport { setSnackBarMessage } from \"../../../systemSlice\";\nimport { BucketObject } from \"api/consoleApi\";\n\nexport const downloadObject = (\n dispatch: AppDispatch,\n bucketName: string,\n internalPaths: string,\n object: BucketObject,\n) => {\n const identityDownload = encodeURIComponent(\n `${bucketName}-${object.name}-${new Date().getTime()}-${Math.random()}`,\n );\n\n const isWinOs = getClientOS().toLowerCase().includes(\"win\");\n\n if ((object.name?.length || 0) > 200 && isWinOs) {\n dispatch(setLongFileOpen(true));\n return;\n }\n\n const ID = makeid(8);\n\n const downloadCall = download(\n bucketName,\n internalPaths,\n object.version_id,\n object.size || 0,\n null,\n ID,\n (progress) => {\n dispatch(\n updateProgress({\n instanceID: identityDownload,\n progress: progress,\n }),\n );\n },\n () => {\n dispatch(completeObject(identityDownload));\n },\n (msg: string) => {\n dispatch(failObject({ instanceID: identityDownload, msg }));\n },\n () => {\n dispatch(cancelObjectInList(identityDownload));\n },\n () => {\n dispatch(\n setSnackBarMessage(\n \"File download will be handled directly by the browser.\",\n ),\n );\n },\n );\n\n storeCallForObjectWithID(ID, downloadCall);\n dispatch(\n setNewObject({\n ID,\n bucketName,\n done: false,\n instanceID: identityDownload,\n percentage: 0,\n prefix: object.name || \"\",\n type: \"download\",\n waitingForFile: true,\n failed: false,\n cancelled: false,\n errorMessage: \"\",\n }),\n );\n};\n"],"names":["_ref","modalOpen","onClose","bucket","prefilledRoute","dispatch","useAppDispatch","prefix","setPrefix","useState","selectedAccess","setSelectedAccess","useEffect","_jsx","ModalWrapper","title","titleIcon","AddAccessRuleIcon","children","_jsxs","FormLayout","withBorders","containerPadding","InputBox","value","label","id","name","placeholder","onChange","e","target","tooltip","Select","options","disabled","helpTip","Fragment","helpTipPlacement","Grid","item","xs","sx","modalStyleUtils","modalButtonBar","Button","type","variant","onClick","resetForm","trim","createProcess","api","setAccessRuleWithBucket","access","then","res","setSnackBarMessage","catch","setErrorSnackMessage","errorToHandler","error","extractFileExtn","resourceStr","match","getSessionGrantsWildCard","sessionGrants","uploadPath","scopes","arguments","length","undefined","grantsWithExtension","Object","keys","reduce","acc","grantKey","includes","filter","sessionGrantKey","hasScope","some","actionKey","find","scopeKey","wildCardMatch","indexOf","scopeActionKey","substring","sessionGrantKeyPath","CreatePathModal","withSuspense","React","BreadcrumbsMain","styled","div","display","paddingRight","alignItems","breakPoints","lg","margin","bucketName","internalPaths","hidePathButton","additionalOptions","navigate","useNavigate","rewindEnabled","useSelector","state","objectBrowser","rewind","versionsMode","versionedFile","anonymousMode","system","createFolderOpen","setCreateFolderOpen","canCreateSubpath","setCanCreateSubpath","putObjectPermScopes","IAM_SCOPES","S3_PUT_OBJECT","S3_PUT_ACTIONS","console","session","permissions","paths","splitPaths","split","path","lastBreadcrumbsIndex","pathToCheckPerms","sessionGrantWildCards","forEach","grant","canCreatePath","hasPermission","breadcrumbsMap","map","objectItem","index","subSplit","slice","join","route","encodeURIComponent","className","style","cursor","whiteSpace","safeDecodeURIComponent","Link","to","setVersionsModeEnabled","status","objectName","toString","versionsItem","listBreadcrumbs","folderName","closeAddFolderModal","limitedSubPath","Breadcrumbs","goBackFunction","prevPath","CopyToClipboard","text","icon","CopyIcon","width","height","fill","marginTop","color","border","marginRight","Box","Tooltip","permissionTooltipHelper","NewPathIcon","marginBottom","justifyContent","fontSize","fontWeight","flexDirection","flexWrap","isVersionedMode","forceDisable","uploadFileFunction","uploadFolderFunction","overrideStyles","anchorEl","setAnchorEl","uploadOptionsOpen","uploadOptionsSetOpen","openUploadMenu","Boolean","handleCloseUpload","uploadObjectAllowed","uploadFolderAllowed","uploadEnabled","TooltipWrapper","event","currentTarget","UploadIcon","DropdownSelector","UploadFolderIcon","selectedOption","onSelect","nValue","hideTriggerAction","open","anchorOrigin","useAnchorWidth","closePanel","borderColor","borderWidth","borderStyle","borderRadius","borderBottomLeftRadius","borderBottomRightRadius","transitionDuration","overflowX","overflowY","position","opacity","marginLeft","minWidth","borderLeftWidth","ClosePanelIcon","right","top","padding","backgroundColor","strings","minHeight","overflow","textOverflow","replaceUnicodeChar","extensionToIcon","FileVideoIcon","extensions","FileMusicIcon","FilePdfIcon","FilePptIcon","FileXlsIcon","FileLockIcon","FileCodeIcon","FileConfigIcon","FileDbIcon","FileFontIcon","FileTxtIcon","FileZipIcon","FileBookIcon","FileImageIcon","displayFileIconName","element","returnOnlyIcon","elementString","FileNonType","endsWith","FolderBrowserIcon","lowercaseElement","toLowerCase","etc","ext","FileMissingIcon","splitItem","IconWithLabel","metaData","metaKeys","renderItem","Array","isArray","itemRendererFn","maxHeight","months","days","from","_","num","currentYear","Date","getFullYear","years","numYear","forwardRef","ref","disableOptions","borderBottom","onDateChange","useImperativeHandle","resetDate","month","setMonth","day","setDay","year","setYear","valueSplit","parseInt","isValid","dateString","validDate","currentDate","parse","isNaN","parsedMonth","parsedDay","toISOString","isDateDisabled","monthForDropDown","daysForDrop","yearsForDrop","gap","InputLabel","htmlFor","placement","HelpIcon","newValue","closeModalAndRefresh","objectInfo","retentionConfig","statusEnabled","setStatusEnabled","setType","date","setDate","isDateValid","setIsDateValid","isSaving","setIsSaving","alreadyConfigured","setAlreadyConfigured","retention_mode","mode","ObjectRetentionMode","Governance","retention_until_date","valueDate","getMonth","getDate","dateElement","useRef","current","showSwitcher","noValidate","autoComplete","onSubmit","preventDefault","Switch","checked","indicatorLabels","RadioGroup","currentValue","selectorOptions","Compliance","DateSelector","saveNewRetentionPolicy","selectedObject","versionId","version_id","addRetention","expireDate","buckets","putObjectRetention","expires","err","setModalErrorSnackMessage","disableRetention","deleteObjectRetention","closeDeleteModalAndRefresh","deleteOpen","selectedBucket","versioningInfo","selectedVersion","deleteLoading","invokeDeleteApi","useApi","onDelSuccess","detailedError","deleteVersions","setDeleteVersions","bypassGovernance","setBypassGovernance","canBypass","S3_BYPASS_GOVERNANCE_RETENTION","ConfirmDialog","confirmText","isOpen","ConfirmDeleteIcon","isLoading","onConfirm","onConfirmDelete","recursive","confirmationContent","description","actualInfo","legalHoldEnabled","setLegalHoldEnabled","get","putObjectLegalHold","ObjectLegalHoldStatus","Enabled","Disabled","DeleteTag","b","theme","_ref2","_actualInfo$name","onCloseAndUpdate","distributedSetup","selDistSet","newKey","setNewKey","newLabel","setNewLabel","isSending","setIsSending","deleteEnabled","setDeleteEnabled","deleteKey","setDeleteKey","deleteLabel","setDeleteLabel","currentTags","tags","currTagKeys","allPathData","currentItem","pop","tagsFor","plural","iconColor","DisabledIcon","EditTagIcon","container","cancelDelete","deleteTagProcess","cleanObject","verID","putObjectTags","SecureComponent","S3_GET_OBJECT_TAGGING","S3_GET_ACTIONS","resource","flexFlow","tagKey","tag","S3_DELETE_OBJECT_TAGGING","errorProps","deleteIcon","onDelete","Tag","onDeleteTag","S3_PUT_OBJECT_TAGGING","SectionTitle","AddNewTagIcon","separator","addTagProcess","newTag","newTagList","shown","setShown","sm","overlayIcon","readOnly","overlayAction","navigator","clipboard","writeText","closeInspectModalAndRefresh","inspectOpen","inspectPath","volumeName","isEncrypt","setIsEncrypt","decryptionKey","setDecryptionKey","insFileName","setInsFileName","InspectMenuIcon","async","basename","document","baseURI","replace","window","location","origin","fetch","url","method","makeRequest","ok","resErr","json","errorMessage","message","code","blob","filename","headers","decryptKey","getCookieValue","performDownload","onCloseDecKeyModal","deleteCookie","PasswordKeyIcon","KeyRevealer","closeModal","newFileName","setNewFileName","acceptLongName","setAcceptLongName","EditIcon","downloadObject","doDownload","emptyFile","is_latest","last_modified","legal_hold_status","size","locking","onClosePanel","loadingObjectInfo","shareFileModalOpen","setShareFileModalOpen","retentionModalOpen","setRetentionModalOpen","tagModalOpen","setTagModalOpen","legalholdOpen","setLegalholdOpen","inspectModalOpen","setInspectModalOpen","setActualInfo","allInfoElements","setAllInfoElements","objectToShare","setObjectToShare","versions","setVersions","setDeleteOpen","previewOpen","setPreviewOpen","totalVersionsSize","setTotalVersionsSize","longFileOpen","setLongFileOpen","setMetaData","loadMetadata","setLoadingMetadata","objectNameArray","infoElement","el","is_delete_marker","listObjects","with_versions","result","data","objects","tVersionSize","currValue","resInfo","setLoadingObjectInfo","getObjectMetadata","versionID","metadata","tagKeys","loaderForContainer","textAlign","Loader","objectResources","canSetLegalHold","S3_PUT_OBJECT_LEGAL_HOLD","canSetTags","canChangeRetention","S3_GET_OBJECT_RETENTION","S3_PUT_OBJECT_RETENTION","canInspect","ADMIN_INSPECT_DATA","canChangeVersioning","S3_GET_BUCKET_VERSIONING","S3_PUT_BUCKET_VERSIONING","S3_GET_OBJECT_VERSION","canGetObject","S3_GET_OBJECT","canDelete","S3_DELETE_OBJECT","objectType","previewObjectType","multiActionButtons","action","DownloadIcon","ShareIcon","PreviewIcon","LegalHoldIcon","openRetentionModal","RetentionIcon","TagsIcon","VersionsIcon","ShareFile","closeShareModal","dataObject","SetRetention","updateInfo","DeleteObject","closeAndReload","setLoadingVersions","setSelectedVersion","SetLegalHoldModal","reload","PreviewFileModal","onClosePreview","TagsModal","reloadObjectData","InspectObject","RenameLongFileName","closeFileOpen","textTransform","ActionsList","items","DeleteIcon","iconLocation","fullWidth","SimpleHeader","ObjectInfoIcon","overflowWrap","niceBytes","niceBytesInt","lastModified","currentTime","modifiedTime","difTime","getTime","formatTime","niceDaysInt","calculateLastModifyTime","etag","S3_GET_OBJECT_LEGAL_HOLD","MetadataIcon","ObjectMetaData","versionToRestore","objectPath","restoreOpen","restoreLoading","setRestoreLoading","RecoverIcon","restoreVersion","putObjectRestore","restoreLocalObjectList","confirmButtonProps","bgColor","FileVersionStyled","content","left","borderBottomColor","maxWidth","fileName","versionInfo","isSelected","checkable","isChecked","onCheck","onShare","onDownload","onRestore","onPreview","globalClick","key","disableButtons","versionItemButtons","pill","DateTime","now","fromISO","md","Checkbox","stopPropagation","SpecificVersionPill","button","IconButton","toFormat","setDeleteLoading","typeConfirm","setTypeConfirm","deleteObject","non_current_versions","bypass","selectedVersions","selectedObjectsRequest","deleteMultipleObjects","all_versions","searchVersions","loadingVersions","restoreVersionOpen","setRestoreVersionOpen","setRestoreVersion","sortValue","setSortValue","deleteNonCurrentOpen","setDeleteNonCurrentOpen","selectEnabled","setSelectEnabled","selectedItems","setSelectedItems","delSelectedVOpen","setDelSelectedVOpen","filteredPrefixes","onShareItem","onPreviewItem","onRestoreItem","onDownloadItem","onGlobalClick","filteredRecords","version","totalSpace","sort","a","dateA","dateB","onCheckVersion","filteredItems","cloneState","push","RestoreFileVersion","content_type","DeleteNonCurrent","reloadAfterDelete","DeleteSelectedVersions","reloadOnComplete","ProgressBar","BrowserBreadcrumbs","ScreenTitle","subTitle","actions","SelectMultipleIcon","DeleteNonCurrentIcon","noLabelMinWidth","bottomBorder","flexGrow","List","containerStyle","rowCount","rowHeight","rowRenderer","isScrolling","isVisible","versOrd","FileVersionItem","displayParsedDate","object","currTime","objectTime","hasSame","displayNiceBytes","String","listModeColumns","elementKey","renderFunction","enableSort","renderFullObject","rewindModeColumns","ListObjectsTable","params","useParams","sortDirection","setSortDirection","currentSortField","setCurrentSortField","detailsOpen","objectDetailsOpen","requestInProgress","features","selFeatures","obOnly","records","searchObjects","selectedObjects","connectionError","displayListObjects","S3_LIST_BUCKET","S3_ALL_LIST_BUCKET","sortASC","sortListObjects","payload","reverse","tableActions","_object$name","idElement","newPath","setSelectedObjects","setObjectDetailsView","setSelectedObjectView","sendOnlyId","customPaperHeight","DataTable","itemActions","columns","entityName","idField","targetD","elements","customEmptyMessage","sortEnabled","currentSort","currentDirection","onSortClick","sortData","newSortDirection","sortBy","setReloadObjectsList","onSelectAll","selectAllItems","rowStyle","_payload$index","delete_flag","noBackground","FilterObjectsSB","SearchBox","setSearchObjects","DeleteMultipleObjects","RewindEnable","baseDnDStyle","outline","activeDnDStyle","acceptDnDStyle","ListObjects","_downloadRenameModal$","useLocation","bucketToRewind","showDeleted","selectedInternalPaths","simplePath","versioningConfig","lockingEnabled","downloadRenameModal","selectedPreview","anonymousAccessOpen","_state$objectBrowser","loadingBucket","selBucketDetailsLoading","bucketInfo","selBucketDetailsInfo","deleteMultipleOpen","setDeleteMultipleOpen","rewindSelect","setRewindSelect","iniLoad","setIniLoad","canShareFile","setCanShareFile","canPreviewFile","setCanPreviewFile","quota","setQuota","isMetaDataLoaded","setIsMetaDataLoaded","isVersioningApplied","pathSegment","pathname","decodeURIComponent","currentPath","i","concat","fileUpload","folderUpload","pathAsResourceInPolicy","allowedFileExtensions","cv","extension","Set","getPolicyAllowedFileExtensions","canDownload","canRewind","canUpload","canSetAnonymousAccess","S3_GET_BUCKET_POLICY","S3_PUT_BUCKET_POLICY","isSelObjectDelMarker","checkForDelMarker","isObjDelMarker","obj","fetchMetadata","useCallback","resetRewind","setAttribute","isPrefix","getBucketQuota","quotaVals","detailedMessage","setBucketDetailsLoad","setBucketInfo","getBucketRetentionConfig","setRetentionConfig","handleUploadButton","files","newFiles","uploadObject","folderPath","pathPrefix","upload","uploadPromise","file","Promise","resolve","reject","uploadUrl","blobFile","Blob","filePath","sanitizeFilePath","fileWebkitRelativePath","relativeFolderPath","ID","makeid","prefixPath","finalFolderPath","pathClean","startsWith","identity","Math","random","xhr","XMLHttpRequest","setRequestHeader","errorMessages","withCredentials","onload","completeObject","removeTrace","response","JSON","failObject","instanceID","msg","addEventListener","progress","floor","loaded","total","updateProgress","onerror","onloadend","onabort","cancelObjectInList","formData","FormData","append","storeCallForObjectWithID","setNewObject","done","percentage","waitingForFile","failed","cancelled","storeFormDataWithID","uploadFilePromises","openList","allSettled","results","errors","totalFiles","onDrop","acceptedFiles","newFolderPath","allowedFiles","fileExtn","log","getRootProps","getInputProps","isDragActive","isDragAccept","useDropzone","noClick","dndStyles","useMemo","forceRefresh","splitURLS","URLItem","createdTime","creation_date","downloadToolTip","downloadSelected","openShare","openPreview","openAnonymousAccess","AccessRuleIcon","setSelectedPreview","refresh","versioning","rewindCloseModal","closePreviewWindow","closeRenameModal","setDownloadRenameModal","AddAccessRule","closeAddAccessRule","setAnonymousAccessOpen","PageLayout","paddingBottom","BucketsIcon","Badge","dotOnly","invisible","HistoryIcon","RefreshIcon","resetMessages","multiple","accept","UploadFilesButton","closeMenu","click","borderTop","VersionsNavigator","setDeletedAction","setShowDeletedObjects","DetailsListPanel","ObjectDetailPanel","configureBucketAllowed","S3_GET_BUCKET_ENCRYPTION_CONFIGURATION","S3_PUT_BUCKET_ENCRYPTION_CONFIGURATION","S3_DELETE_BUCKET","S3_GET_BUCKET_NOTIFICATIONS","S3_PUT_BUCKET_NOTIFICATIONS","S3_GET_REPLICATION_CONFIGURATION","S3_PUT_REPLICATION_CONFIGURATION","ADMIN_GET_BUCKET_QUOTA","ADMIN_SET_BUCKET_QUOTA","S3_PUT_BUCKET_TAGGING","S3_GET_BUCKET_TAGGING","S3_LIST_BUCKET_VERSIONS","S3_GET_BUCKET_POLICY_STATUS","S3_DELETE_BUCKET_POLICY","searchBar","setSearchVersions","setHelpName","AutoColorIcon","ObjectManagerButton","PageHeaderWrapper","BackLink","IAM_PAGES","OBJECT_BROWSER_VIEW","IAM_PERMISSIONS","IAM_ROLES","BUCKET_ADMIN","SettingsIcon","HelpMenu","middleComponent","BrowserHandler","loadingVersioning","rewindDate","dateToRewind","loadingLocking","reloadObjectsList","initWSRequest","rewindMode","pathLoad","forceLoad","searchPath","setRequestInProgress","setLoadingVersioning","setLoadingLocking","getBucketVersioning","setIsVersioned","getBucketObjectLockingStatus","setLockingEnabled","object_locking_enabled","OBHeader","maxSeconds","entity","maxDays","maxHours","maxMinutes","selectedDays","setSelectedDays","selectedHours","setSelectedHours","selectedMinutes","setSelectedMinutes","setValidDate","dateSelected","setDateSelected","calculateNewTime","hours","minutes","plus","toISO","formattedDate","valid","extraStyles","paddingLeft","min","max","LinkIcon","maxShareLinkExpTimeVal","maxShareLinkExpTime","shareURL","setShareURL","isLoadingVersion","setIsLoadingVersion","isLoadingFile","setIsLoadingFile","selectedDate","setSelectedDate","dateValid","setDateValid","setVersionID","debouncedDateChange","debounce","newDate","getMaxShareLinkExpTime","latestVersion","elem","slDate","currDate","diffDate","ceil","shareObject","niceTimeFromSeconds","DaysSelector","ReadBox","actionButton","setModalSnackMessage","pdfjs","workerSrc","loading","onLoad","downloadFile","errorState","setErrorState","totalPages","setTotalPages","renderPages","arrayCreate","InformativeMessage","Document","onLoadSuccess","_pdfInfo","numPages","onLoadError","Page","pageNumber","renderAnnotationLayer","renderTextLayer","renderForms","isFullscreen","setLoading","iframeLoaded","flex","autoPlay","controls","muted","playsInline","onPlay","src","alt","PreviewPDF","allowTransparency","wideLimit","ObjectPreviewIcon","PreviewFileContent","WrappedComponent","fallback","props","Suspense","onSuccess","onError","setIsLoading","callApi","invoke","openSnackbar","setOpenSnackbar","modalSnackMessage","modalSnackBar","detailedErrorMsg","ModalBox","widthLimit","MainError","isModal","Snackbar","closeSnackBar","autoHideDuration","condensed","createAsyncThunk","getState","rejectWithValue","identityDownload","downloadCall","download","itemsToDownload","filterFunction","getClientOS","multiObjList","dwList","bi","isDeleted","downloadSelectedAsZip","fileObject","findFunction","_ref3","_ref4","_ref5","getMaxShareLinkExp","setMaxShareLinkExpTime","exp","isWinOs"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/2033.a048316b.chunk.js b/web-app/build/static/js/2033.a048316b.chunk.js deleted file mode 100644 index eda0c82b2..000000000 --- a/web-app/build/static/js/2033.a048316b.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[2033],{22033:(e,t,o)=>{o.r(t),o.d(t,{default:()=>k});var a=o(65043),r=o(73216),n=o(89923),i=o(67433),l=o(77403),s=o(99161),p=o(70579);const c=()=>(0,p.jsx)(n.lVp,{iconComponent:(0,p.jsx)(n.jm5,{}),title:"What are Event Destinations?",help:(0,p.jsx)(n.azJ,{sx:{paddingTop:"20px"},children:"MinIO bucket notifications allow administrators to send notifications to supported external services on certain object or bucket events. MinIO supports bucket and object-level S3 events similar to the Amazon S3 Event Notifications."})});var d=o(48793),g=o(33097),u=o.n(g);const m=o(94574).Ay.button((e=>{let{theme:t}=e;return{background:u()(t,"boxBackground","#FFF"),border:`${u()(t,"borderColor","#E2E2E2")} 1px solid`,borderRadius:5,width:250,height:80,display:"flex",alignItems:"center",justifyContent:"start",marginBottom:16,marginRight:8,cursor:"pointer",overflow:"hidden","&:hover":{backgroundColor:u()(t,"buttons.regular.hover.background","#ebebeb")},"& .imageContainer":{width:80,"& .logoButton":{maxWidth:46,maxHeight:46,filter:"drop-shadow(1px 1px 8px #fff)"}},"& .lambdaNotifTitle":{color:u()(t,"buttons.callAction.enabled.background","#07193E"),fontSize:16,fontFamily:"Inter,sans-serif",paddingLeft:18,fontWeight:"bold"}}})),h=e=>{let{destinationType:t,srcImage:o,title:a}=e;const n=(0,r.Zp)();return(0,p.jsxs)(m,{onClick:()=>{n(`${s.zZ.EVENT_DESTINATIONS_ADD}/${t}`)},children:[(0,p.jsx)("span",{className:"imageContainer",children:(0,p.jsx)("img",{src:o,className:"logoButton",alt:a})}),(0,p.jsx)("span",{className:"lambdaNotifTitle",children:a})]})};var y=o(88617),f=o(21383),b=o(64159);const T=i.bo.filter((e=>""!==e.logo)),S=T.filter((e=>e.category===i.D3.DB)),v=T.filter((e=>e.category===i.D3.Queue)),_=T.filter((e=>e.category===i.D3.Func)),k=()=>{const e=(0,r.Zp)(),t=(0,f.jL)();return(0,a.useEffect)((()=>{t((0,b.ph)("notification_type_selector"))}),[]),(0,p.jsxs)(a.Fragment,{children:[(0,p.jsx)(d.A,{label:(0,p.jsx)(a.Fragment,{children:(0,p.jsx)(n.EGL,{label:"Event Destinations",onClick:()=>e(s.zZ.EVENT_DESTINATIONS)})}),actions:(0,p.jsx)(y.A,{})}),(0,p.jsx)(n.Mxu,{children:(0,p.jsx)(n.Hbc,{helpBox:(0,p.jsx)(c,{}),children:(0,p.jsxs)(n.azJ,{children:[(0,p.jsx)(n.azJ,{sx:{fontSize:16,fontWeight:600,paddingBottom:15},children:"Queue"}),(0,p.jsx)(n.azJ,{sx:{...l.AF.iconContainer},children:v.map((e=>(0,p.jsx)(h,{destinationType:e.actionTrigger,srcImage:e.logo,title:e.targetTitle},`icon-${e.targetTitle}`)))}),(0,p.jsx)(n.azJ,{sx:{fontSize:16,fontWeight:600,paddingBottom:15},children:"Database"}),(0,p.jsx)(n.azJ,{sx:{...l.AF.iconContainer},children:S.map((e=>(0,p.jsx)(h,{destinationType:e.actionTrigger,srcImage:e.logo,title:e.targetTitle},`icon-${e.targetTitle}`)))}),(0,p.jsx)(n.azJ,{sx:{fontSize:16,fontWeight:600,paddingBottom:15},children:"Functions"}),(0,p.jsx)(n.azJ,{sx:{...l.AF.iconContainer},children:_.map((e=>(0,p.jsx)(h,{destinationType:e.actionTrigger,srcImage:e.logo,title:e.targetTitle},`icon-${e.targetTitle}`)))})]})})})]})}},67433:(e,t,o)=>{o.d(t,{AU:()=>r,D3:()=>m,Es:()=>u,P4:()=>a,Xm:()=>b,bo:()=>y,fx:()=>T,h4:()=>v});const a="notify_postgres",r="notify_mysql",n="notify_kafka",i="notify_amqp",l="notify_mqtt",s="notify_redis",p="notify_nats",c="notify_elasticsearch",d="notify_webhook",g="notify_nsq",u=e=>e.map((e=>({service_name:`${e.service}:${e.account_id}`,name:e.service,account_id:e.account_id,status:e.status})));class m{}m.DB="database",m.Queue="queue",m.Func="functions";const h=()=>`${document.baseURI}`,y=[{actionTrigger:a,targetTitle:"PostgreSQL",logo:`${h()}postgres-logo.svg`,category:m.DB},{actionTrigger:n,targetTitle:"Kafka",logo:`${h()}kafka-logo.svg`,category:m.Queue},{actionTrigger:i,targetTitle:"AMQP",logo:`${h()}amqp-logo.svg`,category:m.Queue},{actionTrigger:l,targetTitle:"MQTT",logo:`${h()}mqtt-logo.svg`,category:m.Queue},{actionTrigger:s,targetTitle:"Redis",logo:`${h()}redis-logo.svg`,category:m.Queue},{actionTrigger:p,targetTitle:"NATS",logo:`${h()}nats-logo.svg`,category:m.Queue},{actionTrigger:r,targetTitle:"Mysql",logo:`${h()}mysql-logo.svg`,category:m.DB},{actionTrigger:c,targetTitle:"Elastic Search",logo:`${h()}elasticsearch-logo.svg`,category:m.DB},{actionTrigger:d,targetTitle:"Webhook",logo:`${h()}webhooks-logo.svg`,category:m.Func},{actionTrigger:g,targetTitle:"NSQ",logo:`${h()}nsq-logo.svg`,category:m.Queue}],f=[{name:"queue_dir",label:"Queue Directory",required:!1,tooltip:"Staging directory for undelivered messages e.g. '/home/events'",type:"string",placeholder:"Enter Queue Directory"},{name:"queue_limit",label:"Queue Limit",required:!1,tooltip:"Maximum limit for undelivered messages, defaults to '10000'",type:"number",placeholder:"Enter Queue Limit"},{name:"comment",label:"Comment",required:!1,type:"comment",placeholder:"Enter custom notes if any"}],b=e=>e.filter((e=>""!==e.value)),T={[n]:[{name:"brokers",label:"Brokers",required:!0,tooltip:"Comma separated list of Kafka broker addresses",type:"string",placeholder:"Enter Brokers"},{name:"topic",label:"Topic",tooltip:"Kafka topic used for bucket notifications",type:"string",placeholder:"Enter Topic"},{name:"sasl_username",label:"SASL Username",tooltip:"Username for SASL/PLAIN or SASL/SCRAM authentication",type:"string",placeholder:"Enter SASL Username"},{name:"sasl_password",label:"SASL Password",tooltip:"Password for SASL/PLAIN or SASL/SCRAM authentication",type:"string",placeholder:"Enter SASL Password"},{name:"sasl_mechanism",label:"SASL Mechanism",tooltip:"SASL authentication mechanism, default 'PLAIN'",type:"string"},{name:"tls_client_auth",label:"TLS Client Auth",tooltip:"Client Auth determines the Kafka server's policy for TLS client authorization",type:"string",placeholder:"Enter TLS Client Auth"},{name:"sasl",label:"SASL",tooltip:"Set to 'on' to enable SASL authentication",type:"on|off"},{name:"tls",label:"TLS",tooltip:"Set to 'on' to enable TLS",type:"on|off"},{name:"tls_skip_verify",label:"TLS skip verify",tooltip:'Trust server TLS without verification, defaults to "on" (verify)',type:"on|off"},{name:"client_tls_cert",label:"client TLS cert",tooltip:"Path to client certificate for mTLS authorization",type:"path",placeholder:"Enter TLS Client Cert"},{name:"client_tls_key",label:"client TLS key",tooltip:"Path to client key for mTLS authorization",type:"path",placeholder:"Enter TLS Client Key"},{name:"version",label:"Version",tooltip:"Specify the version of the Kafka cluster e.g '2.2.0'",type:"string",placeholder:"Enter Kafka Version"},...f],[i]:[{name:"url",required:!0,label:"URL",tooltip:"AMQP server endpoint e.g. `amqp://myuser:mypassword@localhost:5672`",type:"url"},{name:"exchange",label:"Exchange",tooltip:"Name of the AMQP exchange",type:"string",placeholder:"Enter Exchange"},{name:"exchange_type",label:"Exchange Type",tooltip:"AMQP exchange type",type:"string",placeholder:"Enter Exchange Type"},{name:"routing_key",label:"Routing Key",tooltip:"Routing key for publishing",type:"string",placeholder:"Enter Routing Key"},{name:"mandatory",label:"Mandatory",tooltip:"Quietly ignore undelivered messages when set to 'off', default is 'on'",type:"on|off"},{name:"durable",label:"Durable",tooltip:"Persist queue across broker restarts when set to 'on', default is 'off'",type:"on|off"},{name:"no_wait",label:"No Wait",tooltip:"Non-blocking message delivery when set to 'on', default is 'off'",type:"on|off"},{name:"internal",label:"Internal",tooltip:"Set to 'on' for exchange to be not used directly by publishers, but only when bound to other exchanges",type:"on|off"},{name:"auto_deleted",label:"Auto Deleted",tooltip:"Auto delete queue when set to 'on', when there are no consumers",type:"on|off"},{name:"delivery_mode",label:"Delivery Mode",tooltip:"Set to '1' for non-persistent or '2' for persistent queue",type:"number",placeholder:"Enter Delivery Mode"},...f],[s]:[{name:"address",required:!0,label:"Address",tooltip:"Redis server's address e.g. `localhost:6379`",type:"address",placeholder:"Enter Address"},{name:"key",required:!0,label:"Key",tooltip:"Redis key to store/update events, key is auto-created",type:"string",placeholder:"Enter Key"},{name:"password",label:"Password",tooltip:"Redis server password",type:"string",placeholder:"Enter Password"},...f],[l]:[{name:"broker",required:!0,label:"Broker",tooltip:"MQTT server endpoint e.g. `tcp://localhost:1883`",type:"uri",placeholder:"Enter Brokers"},{name:"topic",required:!0,label:"Topic",tooltip:"Name of the MQTT topic to publish",type:"string",placeholder:"Enter Topic"},{name:"username",label:"Username",tooltip:"MQTT username",type:"string",placeholder:"Enter Username"},{name:"password",label:"Password",tooltip:"MQTT password",type:"string",placeholder:"Enter Password"},{name:"qos",label:"QOS",tooltip:"Set the quality of service priority, defaults to '0'",type:"number",placeholder:"Enter QOS"},{name:"keep_alive_interval",label:"Keep Alive Interval",tooltip:"Keep-alive interval for MQTT connections in s,m,h,d",type:"duration",placeholder:"Enter Keep Alive Interval"},{name:"reconnect_interval",label:"Reconnect Interval",tooltip:"Reconnect interval for MQTT connections in s,m,h,d",type:"duration",placeholder:"Enter Reconnect Interval"},...f],[p]:[{name:"address",required:!0,label:"Address",tooltip:"NATS server address e.g. '0.0.0.0:4222'",type:"address",placeholder:"Enter Address"},{name:"subject",required:!0,label:"Subject",tooltip:"NATS subscription subject",type:"string",placeholder:"Enter NATS Subject"},{name:"username",label:"Username",tooltip:"NATS username",type:"string",placeholder:"Enter NATS Username"},{name:"password",label:"Password",tooltip:"NATS password",type:"string",placeholder:"Enter NATS password"},{name:"token",label:"Token",tooltip:"NATS token",type:"string",placeholder:"Enter NATS token"},{name:"tls",label:"TLS",tooltip:"Set to 'on' to enable TLS",type:"on|off"},{name:"tls_skip_verify",label:"TLS Skip Verify",tooltip:'Trust server TLS without verification, defaults to "on" (verify)',type:"on|off"},{name:"ping_interval",label:"Ping Interval",tooltip:"Client ping commands interval in s,m,h,d. Disabled by default",type:"duration",placeholder:"Enter Ping Interval"},{name:"streaming",label:"Streaming",tooltip:"Set to 'on' to use streaming NATS server",type:"on|off"},{name:"streaming_async",label:"Streaming async",tooltip:"Set to 'on' to enable asynchronous publish",type:"on|off"},{name:"streaming_max_pub_acks_in_flight",label:"Streaming max publish ACKS in flight",tooltip:"Number of messages to publish without waiting for ACKs",type:"number",placeholder:"Enter Streaming in flight value"},{name:"streaming_cluster_id",label:"Streaming Cluster ID",tooltip:"Unique ID for NATS streaming cluster",type:"string",placeholder:"Enter Streaming Cluster ID"},{name:"cert_authority",label:"Cert Authority",tooltip:"Path to certificate chain of the target NATS server",type:"string",placeholder:"Enter Cert Authority"},{name:"client_cert",label:"Client Cert",tooltip:"Client cert for NATS mTLS auth",type:"string",placeholder:"Enter Client Cert"},{name:"client_key",label:"Client Key",tooltip:"Client cert key for NATS mTLS authorization",type:"string",placeholder:"Enter Client Key"},...f],[c]:[{name:"url",required:!0,label:"URL",tooltip:"Elasticsearch server's address, with optional authentication info",type:"url",placeholder:"Enter URL"},{name:"index",required:!0,label:"Index",tooltip:"Elasticsearch index to store/update events, index is auto-created",type:"string",placeholder:"Enter Index"},{name:"format",required:!0,label:"Format",tooltip:"'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'namespace'",type:"enum",placeholder:"Enter Format"},...f],[d]:[{name:"endpoint",required:!0,label:"Endpoint",tooltip:"Webhook server endpoint e.g. http://localhost:8080/minio/events",type:"url",placeholder:"Enter Endpoint"},{name:"auth_token",label:"Auth Token",tooltip:"Opaque string or JWT authorization token",type:"string",placeholder:"Enter auth_token"},...f],[g]:[{name:"nsqd_address",required:!0,label:"NSQD Address",tooltip:"NSQ server address e.g. '127.0.0.1:4150'",type:"address",placeholder:"Enter nsqd_address"},{name:"topic",required:!0,label:"Topic",tooltip:"NSQ topic",type:"string",placeholder:"Enter Topic"},{name:"tls",label:"TLS",tooltip:"Set to 'on' to enable TLS",type:"on|off"},{name:"tls_skip_verify",label:"TLS Skip Verify",tooltip:'Trust server TLS without verification, defaults to "on" (verify)',type:"on|off"},...f]},S={webhook:"notify_webhook",amqp:"notify_amqp",kafka:"notify_kafka",mqtt:"notify_mqtt",nats:"notify_nats",nsq:"notify_nsq",mysql:"notify_mysql",postgresql:"notify_postgres",elasticsearch:"notify_elasticsearch",redis:"notify_redis"},v=e=>S[e]}}]); -//# sourceMappingURL=2033.a048316b.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/2033.a048316b.chunk.js.map b/web-app/build/static/js/2033.a048316b.chunk.js.map deleted file mode 100644 index 1cbc91f05..000000000 --- a/web-app/build/static/js/2033.a048316b.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KAAM,SACNC,YAAa,eAEf,CACET,KAAM,gBACNhC,MAAO,gBACPuC,QAAS,uDACTC,KAAM,SACNC,YAAa,uBAEf,CACET,KAAM,gBACNhC,MAAO,gBACPuC,QAAS,uDACTC,KAAM,SACNC,YAAa,uBAEf,CACET,KAAM,iBACNhC,MAAO,iBACPuC,QAAS,iDACTC,KAAM,UAER,CACER,KAAM,kBACNhC,MAAO,kBACPuC,QACE,gFACFC,KAAM,SACNC,YAAa,yBAEf,CACET,KAAM,OACNhC,MAAO,OACPuC,QAAS,4CACTC,KAAM,UAER,CACER,KAAM,MACNhC,MAAO,MACPuC,QAAS,4BACTC,KAAM,UAER,CACER,KAAM,kBACNhC,MAAO,kBACPuC,QACE,mEACFC,KAAM,UAER,CACER,KAAM,kBACNhC,MAAO,kBACPuC,QAAS,oDACTC,KAAM,OACNC,YAAa,yBAEf,CACET,KAAM,iBACNhC,MAAO,iBACPuC,QAAS,4CACTC,KAAM,OACNC,YAAa,wBAEf,CACET,KAAM,UACNhC,MAAO,UACPuC,QAAS,uDACTC,KAAM,SACNC,YAAa,0BAEZJ,GAEL,CAAClB,GAAa,CACZ,CACEa,KAAM,MACNM,UAAU,EACVtC,MAAO,MACPuC,QACE,sEACFC,KAAM,OAER,CACER,KAAM,WACNhC,MAAO,WACPuC,QAAS,4BACTC,KAAM,SACNC,YAAa,kBAEf,CACET,KAAM,gBACNhC,MAAO,gBACPuC,QAAS,qBACTC,KAAM,SACNC,YAAa,uBAEf,CACET,KAAM,cACNhC,MAAO,cACPuC,QAAS,6BACTC,KAAM,SACNC,YAAa,qBAEf,CACET,KAAM,YACNhC,MAAO,YACPuC,QACE,yEACFC,KAAM,UAER,CACER,KAAM,UACNhC,MAAO,UACPuC,QACE,0EACFC,KAAM,UAER,CACER,KAAM,UACNhC,MAAO,UACPuC,QACE,mEACFC,KAAM,UAER,CACER,KAAM,WACNhC,MAAO,WACPuC,QACE,yGACFC,KAAM,UAER,CACER,KAAM,eACNhC,MAAO,eACPuC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ACET,KAAM,QACNhC,MAAO,QACPuC,QAAS,aACTC,KAAM,SACNC,YAAa,oBAEf,CACET,KAAM,MACNhC,MAAO,MACPuC,QAAS,4BACTC,KAAM,UAER,CACER,KAAM,kBACNhC,MAAO,kBACPuC,QACE,mEACFC,KAAM,UAER,CACER,KAAM,gBACNhC,MAAO,gBACPuC,QAAS,gEACTC,KAAM,WACNC,YAAa,uBAEf,CACET,KAAM,YACNhC,MAAO,YACPuC,QAAS,2CACTC,KAAM,UAER,CACER,KAAM,kBACNhC,MAAO,kBACPuC,QAAS,6CACTC,KAAM,UAER,CACER,KAAM,mCACNhC,MAAO,uCACPuC,QAAS,yDACTC,KAAM,SACNC,YAAa,mCAEf,CACET,KAAM,uBACNhC,MAAO,uBACPuC,QAAS,uCACTC,KAAM,SACNC,YAAa,8BAEf,CACET,KAAM,iBACNhC,MAAO,iBACPuC,QAAS,sDACTC,KAAM,SACNC,YAAa,wBAEf,CACET,KAAM,cACNhC,MAAO,cACPuC,QAAS,iCACTC,KAAM,SACNC,YAAa,qBAEf,CACET,KAAM,aACNhC,MAAO,aACPuC,QAAS,8CACTC,KAAM,SACNC,YAAa,uBAEZJ,GAEL,CAACd,GAAsB,CACrB,CACES,KAAM,MACNM,UAAU,EACVtC,MAAO,MACPuC,QACE,oEACFC,KAAM,MACNC,YAAa,aAEf,CACET,KAAM,QACNM,UAAU,EACVtC,MAAO,QACPuC,QACE,oEACFC,KAAM,SACNC,YAAa,eAEf,CACET,KAAM,SACNM,UAAU,EACVtC,MAAO,SACPuC,QACE,gIACFC,KAAM,OACNC,YAAa,mBAEZJ,GAEL,CAACb,GAAiB,CAChB,CACEQ,KAAM,WACNM,UAAU,EACVtC,MAAO,WACPuC,QACE,kEACFC,KAAM,MACNC,YAAa,kBAEf,CACET,KAAM,aACNhC,MAAO,aACPuC,QAAS,2CACTC,KAAM,SACNC,YAAa,uBAEZJ,GAEL,CAACZ,GAAY,CACX,CACEO,KAAM,eACNM,UAAU,EACVtC,MAAO,eACPuC,QAAS,2CACTC,KAAM,UACNC,YAAa,sBAEf,CACET,KAAM,QACNM,UAAU,EACVtC,MAAO,QACPuC,QAAS,YACTC,KAAM,SACNC,YAAa,eAEf,CACET,KAAM,MACNhC,MAAO,MACPuC,QAAS,4BACTC,KAAM,UAER,CACER,KAAM,kBACNhC,MAAO,kBACPuC,QACE,mEACFC,KAAM,aAELH,IAIDU,EAA6C,CACjDC,QAAS,iBACTC,KAAM,cACNC,MAAO,eACPC,KAAM,cACNC,KAAM,cACNC,IAAK,aACLC,MAAO,eACPC,WAAY,kBACZC,cAAe,uBACfC,MAAO,gBAGIC,EAA4BC,GAChCZ,EAAmBY,E","sources":["screens/Console/Account/NotificationEndpointTypeSelectorHelpBox.tsx","screens/Console/EventDestinations/DestinationButton.tsx","screens/Console/EventDestinations/EventTypeSelector.tsx","screens/Console/EventDestinations/utils.ts"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\nimport React from \"react\";\n\nimport { HelpBox, LambdaNotificationsIcon, Box } from \"mds\";\n\nconst NotificationEndpointTypeSelectorHelpBox = () => {\n return (\n }\n title={\"What are Event Destinations?\"}\n help={\n \n MinIO bucket notifications allow administrators to send notifications\n to supported external services on certain object or bucket events.\n MinIO supports bucket and object-level S3 events similar to the Amazon\n S3 Event Notifications.\n \n }\n />\n );\n};\n\nexport default NotificationEndpointTypeSelectorHelpBox;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2023 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport get from \"lodash/get\";\nimport { useNavigate } from \"react-router-dom\";\nimport styled from \"styled-components\";\nimport { IAM_PAGES } from \"../../../common/SecureComponent/permissions\";\n\ninterface IDestinationButton {\n destinationType: string;\n srcImage: string;\n title: string;\n}\n\nconst DestinationButtonBase = styled.button(({ theme }) => ({\n background: get(theme, \"boxBackground\", \"#FFF\"),\n border: `${get(theme, \"borderColor\", \"#E2E2E2\")} 1px solid`,\n borderRadius: 5,\n width: 250,\n height: 80,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"start\",\n marginBottom: 16,\n marginRight: 8,\n cursor: \"pointer\",\n overflow: \"hidden\",\n \"&:hover\": {\n backgroundColor: get(theme, \"buttons.regular.hover.background\", \"#ebebeb\"),\n },\n \"& .imageContainer\": {\n width: 80,\n \"& .logoButton\": {\n maxWidth: 46,\n maxHeight: 46,\n filter: \"drop-shadow(1px 1px 8px #fff)\",\n },\n },\n \"& .lambdaNotifTitle\": {\n color: get(theme, \"buttons.callAction.enabled.background\", \"#07193E\"),\n fontSize: 16,\n fontFamily: \"Inter,sans-serif\",\n paddingLeft: 18,\n fontWeight: \"bold\",\n },\n}));\n\nconst DestinationButton = ({\n destinationType,\n srcImage,\n title,\n}: IDestinationButton) => {\n const navigate = useNavigate();\n\n return (\n {\n navigate(`${IAM_PAGES.EVENT_DESTINATIONS_ADD}/${destinationType}`);\n }}\n >\n \n {title}\n \n {title}\n \n );\n};\n\nexport default DestinationButton;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport { BackLink, Box, FormLayout, PageLayout } from \"mds\";\nimport { destinationList, DestType } from \"./utils\";\nimport { typesSelection } from \"../Common/FormComponents/common/styleLibrary\";\nimport { IAM_PAGES } from \"../../../common/SecureComponent/permissions\";\nimport NotificationEndpointTypeSelectorHelpBox from \"../Account/NotificationEndpointTypeSelectorHelpBox\";\nimport PageHeaderWrapper from \"../Common/PageHeaderWrapper/PageHeaderWrapper\";\nimport DestinationButton from \"./DestinationButton\";\n\nimport HelpMenu from \"../HelpMenu\";\nimport { useAppDispatch } from \"../../../store\";\nimport { setHelpName } from \"../../../systemSlice\";\n\nconst withLogos = destinationList.filter((elService) => elService.logo !== \"\");\nconst database = withLogos.filter(\n (elService) => elService.category === DestType.DB,\n);\nconst queue = withLogos.filter(\n (elService) => elService.category === DestType.Queue,\n);\nconst functions = withLogos.filter(\n (elService) => elService.category === DestType.Func,\n);\n\nconst EventTypeSelector = () => {\n const navigate = useNavigate();\n const dispatch = useAppDispatch();\n useEffect(() => {\n dispatch(setHelpName(\"notification_type_selector\"));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n return (\n \n \n navigate(IAM_PAGES.EVENT_DESTINATIONS)}\n />\n \n }\n actions={}\n />\n \n }>\n \n \n Queue\n \n \n {queue.map((item) => {\n return (\n \n );\n })}\n \n \n Database\n \n \n {database.map((item) => {\n return (\n \n );\n })}\n \n \n Functions\n \n \n {functions.map((item) => {\n return (\n \n );\n })}\n \n \n \n \n \n );\n};\n\nexport default EventTypeSelector;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport { NotificationEndpointItem } from \"api/consoleApi\";\nimport { IElementValue } from \"../Configurations/types\";\nimport { TransformedEndpointItem } from \"./types\";\n\nexport const notifyPostgres = \"notify_postgres\";\nexport const notifyMysql = \"notify_mysql\";\nconst notifyKafka = \"notify_kafka\";\nconst notifyAmqp = \"notify_amqp\";\nconst notifyMqtt = \"notify_mqtt\";\nconst notifyRedis = \"notify_redis\";\nconst notifyNats = \"notify_nats\";\nconst notifyElasticsearch = \"notify_elasticsearch\";\nconst notifyWebhooks = \"notify_webhook\";\nconst notifyNsq = \"notify_nsq\";\nexport const notificationTransform = (\n notificationElements: NotificationEndpointItem[],\n) => {\n return notificationElements.map((element) => {\n return {\n service_name: `${element.service}:${element.account_id}`,\n name: element.service,\n account_id: element.account_id,\n status: element.status,\n };\n }) as TransformedEndpointItem[];\n};\n\nexport class DestType {\n static DB: string = \"database\";\n static Queue: string = \"queue\";\n static Func: string = \"functions\";\n}\n\nconst getImgBaseURL = () => {\n return `${document.baseURI}`;\n};\n\nexport const destinationList = [\n {\n actionTrigger: notifyPostgres,\n targetTitle: \"PostgreSQL\",\n logo: `${getImgBaseURL()}postgres-logo.svg`,\n category: DestType.DB,\n },\n {\n actionTrigger: notifyKafka,\n targetTitle: \"Kafka\",\n logo: `${getImgBaseURL()}kafka-logo.svg`,\n category: DestType.Queue,\n },\n {\n actionTrigger: notifyAmqp,\n targetTitle: \"AMQP\",\n logo: `${getImgBaseURL()}amqp-logo.svg`,\n category: DestType.Queue,\n },\n {\n actionTrigger: notifyMqtt,\n targetTitle: \"MQTT\",\n logo: `${getImgBaseURL()}mqtt-logo.svg`,\n category: DestType.Queue,\n },\n {\n actionTrigger: notifyRedis,\n targetTitle: \"Redis\",\n logo: `${getImgBaseURL()}redis-logo.svg`,\n category: DestType.Queue,\n },\n {\n actionTrigger: notifyNats,\n targetTitle: \"NATS\",\n logo: `${getImgBaseURL()}nats-logo.svg`,\n category: DestType.Queue,\n },\n {\n actionTrigger: notifyMysql,\n targetTitle: \"Mysql\",\n logo: `${getImgBaseURL()}mysql-logo.svg`,\n category: DestType.DB,\n },\n {\n actionTrigger: notifyElasticsearch,\n targetTitle: \"Elastic Search\",\n logo: `${getImgBaseURL()}elasticsearch-logo.svg`,\n category: DestType.DB,\n },\n {\n actionTrigger: notifyWebhooks,\n targetTitle: \"Webhook\",\n logo: `${getImgBaseURL()}webhooks-logo.svg`,\n category: DestType.Func,\n },\n {\n actionTrigger: notifyNsq,\n targetTitle: \"NSQ\",\n logo: `${getImgBaseURL()}nsq-logo.svg`,\n category: DestType.Queue,\n },\n];\n\nconst commonFields = [\n {\n name: \"queue_dir\",\n label: \"Queue Directory\",\n required: false,\n\n tooltip: \"Staging directory for undelivered messages e.g. '/home/events'\",\n type: \"string\",\n placeholder: \"Enter Queue Directory\",\n },\n {\n name: \"queue_limit\",\n label: \"Queue Limit\",\n required: false,\n\n tooltip: \"Maximum limit for undelivered messages, defaults to '10000'\",\n type: \"number\",\n placeholder: \"Enter Queue Limit\",\n },\n {\n name: \"comment\",\n label: \"Comment\",\n required: false,\n type: \"comment\",\n placeholder: \"Enter custom notes if any\",\n },\n];\n\nexport const removeEmptyFields = (formFields: IElementValue[]) => {\n const nonEmptyFields = formFields.filter((field) => field.value !== \"\");\n\n return nonEmptyFields;\n};\n\nexport const notificationEndpointsFields: any = {\n [notifyKafka]: [\n {\n name: \"brokers\",\n label: \"Brokers\",\n required: true,\n\n tooltip: \"Comma separated list of Kafka broker addresses\",\n type: \"string\",\n placeholder: \"Enter Brokers\",\n },\n {\n name: \"topic\",\n label: \"Topic\",\n tooltip: \"Kafka topic used for bucket notifications\",\n type: \"string\",\n placeholder: \"Enter Topic\",\n },\n {\n name: \"sasl_username\",\n label: \"SASL Username\",\n tooltip: \"Username for SASL/PLAIN or SASL/SCRAM authentication\",\n type: \"string\",\n placeholder: \"Enter SASL Username\",\n },\n {\n name: \"sasl_password\",\n label: \"SASL Password\",\n tooltip: \"Password for SASL/PLAIN or SASL/SCRAM authentication\",\n type: \"string\",\n placeholder: \"Enter SASL Password\",\n },\n {\n name: \"sasl_mechanism\",\n label: \"SASL Mechanism\",\n tooltip: \"SASL authentication mechanism, default 'PLAIN'\",\n type: \"string\",\n },\n {\n name: \"tls_client_auth\",\n label: \"TLS Client Auth\",\n tooltip:\n \"Client Auth determines the Kafka server's policy for TLS client authorization\",\n type: \"string\",\n placeholder: \"Enter TLS Client Auth\",\n },\n {\n name: \"sasl\",\n label: \"SASL\",\n tooltip: \"Set to 'on' to enable SASL authentication\",\n type: \"on|off\",\n },\n {\n name: \"tls\",\n label: \"TLS\",\n tooltip: \"Set to 'on' to enable TLS\",\n type: \"on|off\",\n },\n {\n name: \"tls_skip_verify\",\n label: \"TLS skip verify\",\n tooltip:\n 'Trust server TLS without verification, defaults to \"on\" (verify)',\n type: \"on|off\",\n },\n {\n name: \"client_tls_cert\",\n label: \"client TLS cert\",\n tooltip: \"Path to client certificate for mTLS authorization\",\n type: \"path\",\n placeholder: \"Enter TLS Client Cert\",\n },\n {\n name: \"client_tls_key\",\n label: \"client TLS key\",\n tooltip: \"Path to client key for mTLS authorization\",\n type: \"path\",\n placeholder: \"Enter TLS Client Key\",\n },\n {\n name: \"version\",\n label: \"Version\",\n tooltip: \"Specify the version of the Kafka cluster e.g '2.2.0'\",\n type: \"string\",\n placeholder: \"Enter Kafka Version\",\n },\n ...commonFields,\n ],\n [notifyAmqp]: [\n {\n name: \"url\",\n required: true,\n label: \"URL\",\n tooltip:\n \"AMQP server endpoint e.g. `amqp://myuser:mypassword@localhost:5672`\",\n type: \"url\",\n },\n {\n name: \"exchange\",\n label: \"Exchange\",\n tooltip: \"Name of the AMQP exchange\",\n type: \"string\",\n placeholder: \"Enter Exchange\",\n },\n {\n name: \"exchange_type\",\n label: \"Exchange Type\",\n tooltip: \"AMQP exchange type\",\n type: \"string\",\n placeholder: \"Enter Exchange Type\",\n },\n {\n name: \"routing_key\",\n label: \"Routing Key\",\n tooltip: \"Routing key for publishing\",\n type: \"string\",\n placeholder: \"Enter Routing Key\",\n },\n {\n name: \"mandatory\",\n label: \"Mandatory\",\n tooltip:\n \"Quietly ignore undelivered messages when set to 'off', default is 'on'\",\n type: \"on|off\",\n },\n {\n name: \"durable\",\n label: \"Durable\",\n tooltip:\n \"Persist queue across broker restarts when set to 'on', default is 'off'\",\n type: \"on|off\",\n },\n {\n name: \"no_wait\",\n label: \"No Wait\",\n tooltip:\n \"Non-blocking message delivery when set to 'on', default is 'off'\",\n type: \"on|off\",\n },\n {\n name: \"internal\",\n label: \"Internal\",\n tooltip:\n \"Set to 'on' for exchange to be not used directly by publishers, but only when bound to other exchanges\",\n type: \"on|off\",\n },\n {\n name: \"auto_deleted\",\n label: \"Auto Deleted\",\n tooltip:\n \"Auto delete queue when set to 'on', when there are no consumers\",\n type: \"on|off\",\n },\n {\n name: \"delivery_mode\",\n label: \"Delivery Mode\",\n tooltip: \"Set to '1' for non-persistent or '2' for persistent queue\",\n type: \"number\",\n placeholder: \"Enter Delivery Mode\",\n },\n ...commonFields,\n ],\n [notifyRedis]: [\n {\n name: \"address\",\n required: true,\n label: \"Address\",\n tooltip: \"Redis server's address e.g. `localhost:6379`\",\n type: \"address\",\n placeholder: \"Enter Address\",\n },\n {\n name: \"key\",\n required: true,\n label: \"Key\",\n tooltip: \"Redis key to store/update events, key is auto-created\",\n type: \"string\",\n placeholder: \"Enter Key\",\n },\n {\n name: \"password\",\n label: \"Password\",\n tooltip: \"Redis server password\",\n type: \"string\",\n placeholder: \"Enter Password\",\n },\n ...commonFields,\n ],\n [notifyMqtt]: [\n {\n name: \"broker\",\n required: true,\n label: \"Broker\",\n tooltip: \"MQTT server endpoint e.g. `tcp://localhost:1883`\",\n type: \"uri\",\n placeholder: \"Enter Brokers\",\n },\n {\n name: \"topic\",\n required: true,\n label: \"Topic\",\n tooltip: \"Name of the MQTT topic to publish\",\n type: \"string\",\n placeholder: \"Enter Topic\",\n },\n {\n name: \"username\",\n label: \"Username\",\n tooltip: \"MQTT username\",\n type: \"string\",\n placeholder: \"Enter Username\",\n },\n {\n name: \"password\",\n label: \"Password\",\n tooltip: \"MQTT password\",\n type: \"string\",\n placeholder: \"Enter Password\",\n },\n {\n name: \"qos\",\n label: \"QOS\",\n tooltip: \"Set the quality of service priority, defaults to '0'\",\n type: \"number\",\n placeholder: \"Enter QOS\",\n },\n {\n name: \"keep_alive_interval\",\n label: \"Keep Alive Interval\",\n tooltip: \"Keep-alive interval for MQTT connections in s,m,h,d\",\n type: \"duration\",\n placeholder: \"Enter Keep Alive Interval\",\n },\n {\n name: \"reconnect_interval\",\n label: \"Reconnect Interval\",\n tooltip: \"Reconnect interval for MQTT connections in s,m,h,d\",\n type: \"duration\",\n placeholder: \"Enter Reconnect Interval\",\n },\n ...commonFields,\n ],\n [notifyNats]: [\n {\n name: \"address\",\n required: true,\n label: \"Address\",\n tooltip: \"NATS server address e.g. '0.0.0.0:4222'\",\n type: \"address\",\n placeholder: \"Enter Address\",\n },\n {\n name: \"subject\",\n required: true,\n label: \"Subject\",\n tooltip: \"NATS subscription subject\",\n type: \"string\",\n placeholder: \"Enter NATS Subject\",\n },\n {\n name: \"username\",\n label: \"Username\",\n tooltip: \"NATS username\",\n type: \"string\",\n placeholder: \"Enter NATS Username\",\n },\n {\n name: \"password\",\n label: \"Password\",\n tooltip: \"NATS password\",\n type: \"string\",\n placeholder: \"Enter NATS password\",\n },\n {\n name: \"token\",\n label: \"Token\",\n tooltip: \"NATS token\",\n type: \"string\",\n placeholder: \"Enter NATS token\",\n },\n {\n name: \"tls\",\n label: \"TLS\",\n tooltip: \"Set to 'on' to enable TLS\",\n type: \"on|off\",\n },\n {\n name: \"tls_skip_verify\",\n label: \"TLS Skip Verify\",\n tooltip:\n 'Trust server TLS without verification, defaults to \"on\" (verify)',\n type: \"on|off\",\n },\n {\n name: \"ping_interval\",\n label: \"Ping Interval\",\n tooltip: \"Client ping commands interval in s,m,h,d. Disabled by default\",\n type: \"duration\",\n placeholder: \"Enter Ping Interval\",\n },\n {\n name: \"streaming\",\n label: \"Streaming\",\n tooltip: \"Set to 'on' to use streaming NATS server\",\n type: \"on|off\",\n },\n {\n name: \"streaming_async\",\n label: \"Streaming async\",\n tooltip: \"Set to 'on' to enable asynchronous publish\",\n type: \"on|off\",\n },\n {\n name: \"streaming_max_pub_acks_in_flight\",\n label: \"Streaming max publish ACKS in flight\",\n tooltip: \"Number of messages to publish without waiting for ACKs\",\n type: \"number\",\n placeholder: \"Enter Streaming in flight value\",\n },\n {\n name: \"streaming_cluster_id\",\n label: \"Streaming Cluster ID\",\n tooltip: \"Unique ID for NATS streaming cluster\",\n type: \"string\",\n placeholder: \"Enter Streaming Cluster ID\",\n },\n {\n name: \"cert_authority\",\n label: \"Cert Authority\",\n tooltip: \"Path to certificate chain of the target NATS server\",\n type: \"string\",\n placeholder: \"Enter Cert Authority\",\n },\n {\n name: \"client_cert\",\n label: \"Client Cert\",\n tooltip: \"Client cert for NATS mTLS auth\",\n type: \"string\",\n placeholder: \"Enter Client Cert\",\n },\n {\n name: \"client_key\",\n label: \"Client Key\",\n tooltip: \"Client cert key for NATS mTLS authorization\",\n type: \"string\",\n placeholder: \"Enter Client Key\",\n },\n ...commonFields,\n ],\n [notifyElasticsearch]: [\n {\n name: \"url\",\n required: true,\n label: \"URL\",\n tooltip:\n \"Elasticsearch server's address, with optional authentication info\",\n type: \"url\",\n placeholder: \"Enter URL\",\n },\n {\n name: \"index\",\n required: true,\n label: \"Index\",\n tooltip:\n \"Elasticsearch index to store/update events, index is auto-created\",\n type: \"string\",\n placeholder: \"Enter Index\",\n },\n {\n name: \"format\",\n required: true,\n label: \"Format\",\n tooltip:\n \"'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'namespace'\",\n type: \"enum\",\n placeholder: \"Enter Format\",\n },\n ...commonFields,\n ],\n [notifyWebhooks]: [\n {\n name: \"endpoint\",\n required: true,\n label: \"Endpoint\",\n tooltip:\n \"Webhook server endpoint e.g. http://localhost:8080/minio/events\",\n type: \"url\",\n placeholder: \"Enter Endpoint\",\n },\n {\n name: \"auth_token\",\n label: \"Auth Token\",\n tooltip: \"Opaque string or JWT authorization token\",\n type: \"string\",\n placeholder: \"Enter auth_token\",\n },\n ...commonFields,\n ],\n [notifyNsq]: [\n {\n name: \"nsqd_address\",\n required: true,\n label: \"NSQD Address\",\n tooltip: \"NSQ server address e.g. '127.0.0.1:4150'\",\n type: \"address\",\n placeholder: \"Enter nsqd_address\",\n },\n {\n name: \"topic\",\n required: true,\n label: \"Topic\",\n tooltip: \"NSQ topic\",\n type: \"string\",\n placeholder: \"Enter Topic\",\n },\n {\n name: \"tls\",\n label: \"TLS\",\n tooltip: \"Set to 'on' to enable TLS\",\n type: \"on|off\",\n },\n {\n name: \"tls_skip_verify\",\n label: \"TLS Skip Verify\",\n tooltip:\n 'Trust server TLS without verification, defaults to \"on\" (verify)',\n type: \"on|off\",\n },\n ...commonFields,\n ],\n};\n\nconst serviceToConfigMap: Record = {\n webhook: \"notify_webhook\",\n amqp: \"notify_amqp\",\n kafka: \"notify_kafka\",\n mqtt: \"notify_mqtt\",\n nats: \"notify_nats\",\n nsq: \"notify_nsq\",\n mysql: \"notify_mysql\",\n postgresql: \"notify_postgres\", //looks different in server response(postgresql as opposed to postgres) from api/admin_notification_endpoints.go\n elasticsearch: \"notify_elasticsearch\",\n redis: \"notify_redis\",\n};\n\nexport const getNotificationConfigKey = (serviceName: string) => {\n return serviceToConfigMap[serviceName];\n};\n"],"names":["NotificationEndpointTypeSelectorHelpBox","_jsx","HelpBox","iconComponent","LambdaNotificationsIcon","title","help","Box","sx","paddingTop","children","DestinationButtonBase","styled","button","_ref","theme","background","get","border","borderRadius","width","height","display","alignItems","justifyContent","marginBottom","marginRight","cursor","overflow","backgroundColor","maxWidth","maxHeight","filter","color","fontSize","fontFamily","paddingLeft","fontWeight","_ref2","destinationType","srcImage","navigate","useNavigate","_jsxs","onClick","IAM_PAGES","EVENT_DESTINATIONS_ADD","className","src","alt","withLogos","destinationList","elService","logo","database","category","DestType","DB","queue","Queue","functions","Func","EventTypeSelector","dispatch","useAppDispatch","useEffect","setHelpName","Fragment","PageHeaderWrapper","label","BackLink","EVENT_DESTINATIONS","actions","HelpMenu","PageLayout","FormLayout","helpBox","paddingBottom","typesSelection","iconContainer","map","item","DestinationButton","actionTrigger","targetTitle","notifyPostgres","notifyMysql","notifyKafka","notifyAmqp","notifyMqtt","notifyRedis","notifyNats","notifyElasticsearch","notifyWebhooks","notifyNsq","notificationTransform","notificationElements","element","service_name","service","account_id","name","status","getImgBaseURL","document","baseURI","commonFields","required","tooltip","type","placeholder","removeEmptyFields","formFields","field","value","notificationEndpointsFields","serviceToConfigMap","webhook","amqp","kafka","mqtt","nats","nsq","mysql","postgresql","elasticsearch","redis","getNotificationConfigKey","serviceName"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/2138.a8c39913.chunk.js b/web-app/build/static/js/2138.a8c39913.chunk.js deleted file mode 100644 index a91bf1c42..000000000 --- a/web-app/build/static/js/2138.a8c39913.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[2138],{48967:(e,i,t)=>{t.d(i,{A:()=>p});var r=t(65043),s=t(56629),n=t(53518),l=t(58661),a=t(89923),o=t(64159),d=t(21383),c=t(70579);const p=e=>{let{configurationName:i,closeResetModalAndRefresh:t,resetOpen:p}=e;const x=(0,d.jL)(),[u,h]=(0,r.useState)(!1);(0,r.useEffect)((()=>{u&&s.F.configs.resetConfig(i).then((()=>{h(!1),t(!0)})).catch((e=>{h(!1),x((0,o.C9)((0,n.S)(e.error)))}))}),[t,i,u,x]);return(0,c.jsx)(l.A,{title:"Restore Defaults",confirmText:"Yes, Reset Configuration",isOpen:p,titleIcon:(0,c.jsx)(a.xWY,{}),isLoading:u,onConfirm:()=>{h(!0)},onClose:()=>{t(!1)},confirmationContent:(0,c.jsxs)(r.Fragment,{children:[u&&(0,c.jsx)(a.z21,{}),(0,c.jsxs)(r.Fragment,{children:["Are you sure you want to restore these configurations to default values?",(0,c.jsx)("br",{}),(0,c.jsx)("b",{style:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},children:"Please note that this may cause your system to not be accessible"})]})]})})}},38392:(e,i,t)=>{t.d(i,{A:()=>a});var r=t(65043),s=t(89923),n=t(70579);const l=e=>{let{icon:i,description:t}=e;return(0,n.jsxs)(s.azJ,{sx:{display:"flex","& .min-icon":{marginRight:"10px",height:"23px",width:"23px",marginBottom:"10px"}},children:[i," ",(0,n.jsx)("div",{style:{fontSize:"14px",fontStyle:"italic",color:"#5E5E5E"},children:t})]})},a=e=>{let{helpText:i,docLink:t,docText:a,contents:o}=e;return(0,n.jsxs)(s.azJ,{sx:{flex:1,border:"1px solid #eaeaea",borderRadius:"2px",display:"flex",flexFlow:"column",padding:"20px"},children:[(0,n.jsxs)(s.azJ,{sx:{fontSize:"16px",fontWeight:600,display:"flex",alignItems:"center",marginBottom:"16px",paddingBottom:"20px","& .min-icon":{height:"21px",width:"21px",marginRight:"15px"}},children:[(0,n.jsx)(s.nag,{}),(0,n.jsx)("div",{children:i})]}),(0,n.jsxs)(s.azJ,{sx:{fontSize:"14px",marginBottom:"15px"},children:[o.map(((e,i)=>(0,n.jsxs)(r.Fragment,{children:[e.icon&&(0,n.jsx)(s.azJ,{sx:{paddingBottom:"20px"},children:(0,n.jsx)(l,{icon:e.icon,description:e.iconDescription})}),(0,n.jsx)(s.azJ,{sx:{paddingBottom:"20px"},children:e.text})]},`feature-item-${i}`))),(0,n.jsx)(s.azJ,{sx:{paddingBottom:"20px"},children:(0,n.jsx)("a",{href:t,target:"_blank",rel:"noopener",children:a})})]})]})}},2138:(e,i,t)=>{t.r(i),t.d(i,{default:()=>D});var r=t(65043),s=t(89923),n=t(56629),l=t(53518),a=t(21383),o=t(64159),d=t(42349),c=t(48793),p=t(38392),x=t(22166),u=t(24241),h=t(70579);const m=e=>{let{name:i}=e;return(0,h.jsxs)("h4",{children:[(0,h.jsx)(s.FUY,{style:{transform:"rotateZ(90deg)"}}),i]})},g=e=>{let{blockName:i,results:t}=e;return(0,h.jsxs)(r.Fragment,{children:[(0,h.jsxs)("strong",{children:[i,":"]}),(0,h.jsx)("ul",{children:t.map(((e,t)=>(0,h.jsx)("li",{children:e},`policy-${i}-${t}`)))})]})},f=e=>{var i,t,n,l,a,o;let{entityName:d,results:c}=e,p=0;switch(d){case"Group":p=(null===(i=c.groups)||void 0===i?void 0:i.length)||0;break;case"Policy":p=(null===(t=c.policies)||void 0===t?void 0:t.length)||0;break;case"User":p=(null===(n=c.users)||void 0===n?void 0:n.length)||0}return(0,h.jsxs)(s.azJ,{className:"resultElement",sx:{marginTop:50,"&:first-of-type":{marginTop:0}},children:[(0,h.jsxs)(s._xt,{separator:!0,sx:{fontSize:12},icon:(0,h.jsx)(s.Xk0,{style:{width:17,height:17}}),actions:(0,h.jsxs)(s.azJ,{sx:{fontSize:14},children:[(0,h.jsx)("strong",{children:p})," Entit",1===p?"y":"ies"," Found"]}),children:[d," Mappings"]}),(0,h.jsxs)(s.azJ,{className:"resultsList",sx:{h4:{borderBottom:"#e2e2e2 1px solid",padding:"12px 0",margin:0,marginBottom:15,display:"flex",alignItems:"center","& svg":{marginRight:10,fill:"#3C77A7"}}},children:["Group"===d&&(null===(l=c.groups)||void 0===l?void 0:l.map(((e,i)=>(0,h.jsxs)(r.Fragment,{children:[(0,h.jsx)(m,{name:e.group||""}),e.policies&&(0,h.jsx)(g,{blockName:"Policies",results:e.policies})]},`policy-res-${i}`)))),"User"===d&&(null===(a=c.users)||void 0===a?void 0:a.map(((e,i)=>(0,h.jsxs)(r.Fragment,{children:[(0,h.jsx)(m,{name:e.user||""}),e.policies&&(0,h.jsx)(g,{blockName:"Policies",results:e.policies})]},`users-res-${i}`)))),"Policy"===d&&(null===(o=c.policies)||void 0===o?void 0:o.map(((e,i)=>(0,h.jsxs)(r.Fragment,{children:[(0,h.jsx)(m,{name:e.policy||""}),e.groups&&(0,h.jsx)(g,{blockName:"Groups",results:e.groups}),e.users&&(0,h.jsx)(g,{blockName:"Users",results:e.users})]},`policy-map-${i}`))))]})]})};var y=t(42967);const j=()=>{const e=(0,a.jL)(),[i,t]=(0,r.useState)(!1),[d,c]=(0,r.useState)([""]),[p,m]=(0,r.useState)([""]),[g,j]=(0,r.useState)(null),b=(0,x.d4)((e=>e.createUser.selectedPolicies));return(0,h.jsxs)(s.azJ,{sx:{marginTop:15,paddingTop:0},children:[(0,h.jsxs)(s.xA9,{container:!0,sx:{marginTop:5},children:[(0,h.jsxs)(s.xA9,{item:!0,sm:12,md:6,lg:5,sx:{padding:10,paddingTop:0},children:[(0,h.jsx)(s._xt,{children:"Query Filters"}),(0,h.jsxs)(s.azJ,{sx:{padding:"0 10px",display:"flex",flexDirection:"column",gap:40},children:[(0,h.jsxs)(s.azJ,{sx:{padding:"10px 26px"},withBorders:!0,children:[(0,h.jsx)(s.azJ,{sx:{display:"flex"},children:(0,h.jsx)("h4",{style:{margin:0,marginBottom:10,fontSize:14},children:"Users"})}),(0,h.jsx)(s.azJ,{sx:{overflowY:"auto",minHeight:50,maxHeight:250,"& > div > div":{width:"100%"}},children:d.map(((e,i)=>(0,h.jsx)(s.cl_,{id:`search-user-${i}`,value:e,onChange:e=>{const t=[...d];t[i]=e.target.value,c(t)},overlayIcon:d.length===i+1?(0,h.jsx)(s.REV,{}):(0,h.jsx)(s.YPx,{}),overlayAction:()=>{((e,i)=>{if(e){const e=[...d,""];return void c(e)}const t=d.filter(((e,t)=>t!==i));c(t)})(d.length===i+1,i)}},`search-user-${i}`)))})]}),(0,h.jsxs)(s.azJ,{sx:{padding:"10px 26px"},withBorders:!0,children:[(0,h.jsx)("h4",{style:{margin:0,marginBottom:10,fontSize:14},children:"Groups"}),(0,h.jsx)(s.azJ,{sx:{overflowY:"auto",minHeight:50,maxHeight:"calc(100vh - 340px)","& > div > div":{width:"100%"}},children:p.map(((e,i)=>(0,h.jsx)(s.cl_,{id:`search-group-${i}`,value:e,onChange:e=>{const t=[...p];t[i]=e.target.value,m(t)},overlayIcon:p.length===i+1?(0,h.jsx)(s.REV,{}):(0,h.jsx)(s.YPx,{}),overlayAction:()=>{((e,i)=>{if(e){const e=[...p,""];return void m(e)}const t=p.filter(((e,t)=>t!==i));m(t)})(p.length===i+1,i)}},`search-group-${i}`)))})]}),(0,h.jsxs)(s.azJ,{sx:{padding:"10px 26px"},withBorders:!0,children:[(0,h.jsx)("h4",{style:{margin:0,marginBottom:10,fontSize:14},children:"Policies"}),(0,h.jsx)(s.azJ,{sx:{minHeight:265,maxHeight:"calc(100vh - 740px)"},children:(0,h.jsx)(y.A,{selectedPolicy:b,noTitle:!0})})]})]})]}),(0,h.jsx)(s.xA9,{item:!0,sm:12,md:6,lg:7,sx:{padding:10,paddingTop:0,display:"flex",flexDirection:"column"},children:i?(0,h.jsx)(s.azJ,{sx:{textAlign:"center"},children:(0,h.jsx)(s.aHM,{})}):(0,h.jsxs)(r.Fragment,{children:[(0,h.jsx)(s._xt,{actions:(0,h.jsx)(s.azJ,{sx:{display:"flex",flexDirection:"row",alignItems:"center",fontSize:14},children:null!==g&&void 0!==g&&g.timestamp?(0,h.jsxs)(r.Fragment,{children:[(0,h.jsx)(s.b1c,{style:{width:14,height:14,marginRight:5,fill:"#BEBFBF"}}),u.c9.fromISO(g.timestamp).toFormat("D HH:mm:ss")]}):""}),children:"Query Results"}),g?(0,h.jsxs)(s.azJ,{sx:{backgroundColor:"#FBFAFA",padding:"8px 22px",flexGrow:1,overflowY:"auto"},children:[!g.groups&&!g.users&&!g.policies&&(0,h.jsx)(s.azJ,{sx:{textAlign:"center"},children:(0,h.jsx)("h4",{children:"No Results Available"})}),!!g.groups&&(0,h.jsx)(f,{results:g,entityName:"Group"}),!!g.users&&(0,h.jsx)(f,{results:g,entityName:"User"}),!!g.policies&&(0,h.jsx)(f,{results:g,entityName:"Policy"})]}):(0,h.jsx)(s.azJ,{sx:{textAlign:"center"},children:"No query results yet"})]})})]}),(0,h.jsx)(s.xA9,{container:!0,children:(0,h.jsx)(s.xA9,{item:!0,xs:12,sx:{display:"flex",justifyContent:"flex-start",marginTop:45,padding:"0 20px"},children:(0,h.jsx)(s.$nd,{id:"search-entity",type:"button",variant:"callAction",onClick:()=>{t(!0);let i={},r=b.filter((e=>""!==e)),s=d.filter((e=>""!==e)),a=p.filter((e=>""!==e));r.length>0&&(i.policies=r),s.length>0&&(i.users=s),a.length>0&&(i.groups=a),n.F.ldapEntities.getLdapEntities(i).then((e=>{j(e.data),t(!1)})).catch((i=>{e((0,o.C9)((0,l.S)(i.error))),t(!1)}))},icon:(0,h.jsx)(s.WIv,{}),children:"Search"})})})]})};var b=t(48967),v=t(88617);const C=["server_addr","lookup_bind_dn","user_dn_search_base_dn","user_dn_search_filter"],D=()=>{const e=(0,a.jL)(),i=d.Lq,[t,x]=(0,r.useState)(!0),[u,m]=(0,r.useState)(!1),[g,f]=(0,r.useState)(!1),[y,D]=(0,r.useState)({}),[_,A]=(0,r.useState)({}),[k,S]=(0,r.useState)(void 0),[w,P]=(0,r.useState)(!1),[E,I]=(0,r.useState)(!1),[O,z]=(0,r.useState)("configuration"),[L,F]=(0,r.useState)(!1),N=()=>{w&&k&&q(k),P(!w)},q=e=>{let i={},t={};if(e&&e.length>0){const r=e.find((e=>"enable"===e.key));let s=0,n=0;e.forEach((e=>{e.env_override?(i[e.key]=e.env_override.value,t[e.key]=e.env_override.name):i[e.key]=e.value,C.includes(e.key)&&(e.value&&""!==e.value&&"off"!==e.value||e.env_override&&""!==e.env_override.value&&"off"!==e.env_override.value)&&s++,C.includes(e.key)&&e.env_override&&n++}));const l=0!==s;l&&(r&&"off"!==r.value||!r)?m(!0):m(!1),0!==n&&F(!0),f(l)}A(t),D(i)};(0,r.useEffect)((()=>{t&&n.F.configs.configInfo("identity_ldap").then((e=>{e.data.length>0&&(S(e.data[0].key_values),q(e.data[0].key_values||[])),x(!1)})).catch((i=>{x(!1),e((0,o.C9)((0,l.S)(i.error)))}))}),[e,t]);return(0,r.useEffect)((()=>{e((0,o.ph)("LDAP"))}),[]),(0,h.jsxs)(s.xA9,{item:!0,xs:12,children:[E&&(0,h.jsx)(b.A,{configurationName:"identity_ldap",closeResetModalAndRefresh:async i=>{I(!1),i&&(e((0,o.YR)(i)),S(void 0),D({}),m(!1),f(!1),P(!1))},resetOpen:E}),(0,h.jsx)(c.A,{label:"LDAP",actions:(0,h.jsx)(v.A,{})}),(0,h.jsx)(s.Mxu,{variant:"constrained",children:(0,h.jsx)(s.tUM,{horizontal:!0,options:[{tabConfig:{id:"configuration",label:"Configuration"},content:(0,h.jsxs)(r.Fragment,{children:[(0,h.jsx)(s.lcx,{icon:null,title:w?"Edit Configuration":"",actions:w?null:(0,h.jsxs)(r.Fragment,{children:[(0,h.jsx)(s.m_M,{tooltip:L?"Configuration cannot be edited in this module as LDAP environment variables are set for this MinIO instance.":"",children:(0,h.jsx)(s.$nd,{id:"edit",type:"button",variant:"callAction",icon:(0,h.jsx)(s.qUP,{}),onClick:N,label:"Edit Configuration",disabled:t||L})}),g&&(0,h.jsx)(s.m_M,{tooltip:L?"Configuration cannot be disabled / enabled in this module as LDAP environment variables are set for this MinIO instance.":"",children:(0,h.jsx)(s.$nd,{id:"is-configuration-enabled",onClick:()=>(i=>{const t={key_values:[{key:"enable",value:i?"on":"off"}]};n.F.configs.setConfig("identity_ldap",t).then((i=>{m(!u),e((0,o.YR)(i.data.restart||!1)),i.data.restart||e((0,o.Hk)("Configuration saved successfully"))})).catch((i=>{e((0,o.C9)((0,l.S)(i.error)))}))})(!u),label:u?"Disable LDAP":"Enable LDAP",variant:u?"secondary":"regular",disabled:L})}),(0,h.jsx)(s.$nd,{id:"refresh-idp-config",onClick:()=>x(!0),label:"Refresh",icon:(0,h.jsx)(s.fNY,{})})]})}),(0,h.jsx)("br",{}),t?(0,h.jsx)(s.azJ,{sx:{display:"flex",justifyContent:"center",marginTop:10},children:(0,h.jsx)(s.aHM,{})}):(0,h.jsx)(r.Fragment,{children:w?(0,h.jsx)(r.Fragment,{children:(0,h.jsxs)(s.Hbc,{helpBox:(0,h.jsx)(p.A,{helpText:"Learn more about LDAP Configurations",contents:d.iT,docLink:"https://min.io/docs/minio/linux/operations/external-iam.html?ref=con#minio-external-iam-ad-ldap",docText:"Learn more about LDAP Configurations"}),children:[w&&g?(0,h.jsx)(s.azJ,{sx:{marginBottom:15},children:(0,h.jsx)(s.lVp,{title:(0,h.jsx)(s.azJ,{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexGrow:1},children:"Lookup Bind Password must be re-entered to change LDAP configurations"}),iconComponent:(0,h.jsx)(s.cJw,{}),help:null})}):null,Object.entries(i).map((e=>{let[i,t]=e;return((e,i)=>"toggle"===i.type?(0,h.jsx)(s.dOG,{indicatorLabels:["Enabled","Disabled"],checked:"on"===y[e],value:"is-field-enabled",id:"is-field-enabled",name:"is-field-enabled",label:i.label,tooltip:i.tooltip,onChange:i=>D({...y,[e]:i.target.checked?"on":"off"}),description:"",disabled:!w},e):(0,h.jsx)(s.cl_,{id:e,required:i.required,name:e,label:i.label,tooltip:i.tooltip,error:i.hasError(y[e],w),value:y[e]?y[e]:"",onChange:i=>D({...y,[e]:i.target.value}),placeholder:i.placeholder,disabled:!w,type:i.type},e))(i,t)})),(0,h.jsxs)(s.azJ,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",marginTop:"20px",gap:"15px"},children:[w&&g&&(0,h.jsx)(s.$nd,{id:"clear",type:"button",variant:"secondary",onClick:()=>I(!0),label:"Reset Configuration"}),(0,h.jsx)(s.$nd,{id:"cancel",type:"button",variant:"regular",onClick:N,label:"Cancel"}),(0,h.jsx)(s.$nd,{id:"save-key",type:"submit",variant:"callAction",color:"primary",disabled:t||!(()=>{for(const[e,t]of Object.entries(i))if(t.required&&(void 0===y[e]||null===y[e]||""===y[e]))return!1;return!0})(),label:"Save",onClick:()=>{const t=Object.keys(i).map((e=>({key:e,value:y[e]})));n.F.configs.setConfig("identity_ldap",{key_values:t}).then((i=>{P(!1),S(t),q(t),e((0,o.YR)(i.data.restart||!1)),D({...y,lookup_bind_password:""}),i.data.restart||e((0,o.Hk)("Configuration saved successfully"))})).catch((i=>{e((0,o.C9)((0,l.S)(i.error)))}))}})]})]})}):(0,h.jsx)(r.Fragment,{children:(0,h.jsxs)(s.azJ,{sx:{display:"grid",gridTemplateColumns:"1fr",gridAutoFlow:"dense",gap:3,padding:"15px",border:"1px solid #eaeaea","@media (min-width: 576px)":{gridTemplateColumns:"2fr 1fr",gridAutoFlow:"row"}},children:[(0,h.jsx)(s.mZW,{label:"LDAP Enabled",value:u?"Yes":"No"}),g&&(0,h.jsx)(r.Fragment,{children:Object.entries(i).map((e=>{let[i,t]=e;if(!t.editOnly){let e=t.label,r=y[i]?y[i]:"";return _[i]&&(e=(0,h.jsxs)(s.azJ,{sx:{display:"flex",alignItems:"center",gap:5,"& .min-icon":{height:20,width:20},"& span":{height:20,display:"flex",alignItems:"center"}},children:[(0,h.jsx)("span",{children:t.label}),(0,h.jsx)(s.m_M,{tooltip:`This value is set from the ${_[i]} environment variable`,placement:"right",children:(0,h.jsx)("span",{className:"muted",children:(0,h.jsx)(s.D0K,{})})})]}),r=(0,h.jsx)("i",{children:(0,h.jsx)("span",{className:"muted",children:r})})),(0,h.jsx)(s.mZW,{label:e,value:r},i)}return null}))})]})})})]})},{tabConfig:{id:"entities",label:"Entities",disabled:!g||!u},content:(0,h.jsx)(r.Fragment,{children:g&&(0,h.jsx)(s.azJ,{children:(0,h.jsx)(j,{})})})}],currentTabOrPath:O,onTabClick:e=>{z(e),P(!1)}})})]})}},42349:(e,i,t)=>{t.d(i,{G5:()=>l,Lq:()=>o,Vb:()=>a,iT:()=>n});var r=t(89923),s=t(70579);const n=[{text:"MinIO supports using an Active Directory or LDAP (AD/LDAP) service for external management of user identities. Configuring an external IDentity Provider (IDP) enables Single-Sign On (SSO) workflows, where applications authenticate against the external IDP before accessing MinIO.",icon:(0,s.jsx)(r.Tir,{}),iconDescription:"Create Configurations"},{text:"MinIO queries the configured Active Directory / LDAP server to verify the credentials specified by the application and optionally return a list of groups in which the user has membership. MinIO supports two modes (Lookup-Bind Mode and Username-Bind Mode) for performing these queries",icon:null,iconDescription:""},{text:"MinIO recommends using Lookup-Bind mode as the preferred method for verifying AD/LDAP credentials. Username-Bind mode is a legacy method retained for backwards compatibility only.",icon:null,iconDescription:""}],l=[{text:"MinIO supports using an OpenID Connect (OIDC) compatible IDentity Provider (IDP) such as Okta, KeyCloak, Dex, Google, or Facebook for external management of user identities.",icon:(0,s.jsx)(r.XAi,{}),iconDescription:"Create Configurations"},{text:"Configuring an external IDP enables Single-Sign On workflows, where applications authenticate against the external IDP before accessing MinIO.",icon:null,iconDescription:""}],a={config_url:{required:!0,hasError:(e,i)=>!e&&i?"Config URL is required":"",label:"Config URL",tooltip:"Config URL for identity provider configuration",placeholder:"https://identity-provider-url/.well-known/openid-configuration",type:"text",editOnly:!1},client_id:{required:!0,hasError:(e,i)=>!e&&i?"Client ID is required":"",label:"Client ID",tooltip:"Identity provider Client ID",placeholder:"Enter Client ID",type:"text",editOnly:!1},client_secret:{required:!0,hasError:(e,i)=>!e&&i?"Client Secret is required":"",label:"Client Secret",tooltip:"Identity provider Client Secret",placeholder:"Enter Client Secret",type:"password",editOnly:!0},claim_name:{required:!1,label:"Claim Name",tooltip:"Claim from which MinIO will read the policy or role to use",placeholder:"Enter Claim Name",type:"text",hasError:(e,i)=>"",editOnly:!1},display_name:{required:!1,label:"Display Name",tooltip:"",placeholder:"Enter Display Name",type:"text",hasError:(e,i)=>"",editOnly:!1},claim_prefix:{required:!1,label:"Claim Prefix",tooltip:"",placeholder:"Enter Claim Prefix",type:"text",hasError:(e,i)=>"",editOnly:!1},scopes:{required:!1,label:"Scopes",tooltip:"",placeholder:"openid,profile,email",type:"text",hasError:(e,i)=>"",editOnly:!1},redirect_uri:{required:!1,label:"Redirect URI",tooltip:"",placeholder:"https://console-endpoint-url/oauth_callback",type:"text",hasError:(e,i)=>"",editOnly:!1},role_policy:{required:!1,label:"Role Policy",tooltip:"",placeholder:"readonly",type:"text",hasError:(e,i)=>"",editOnly:!1},claim_userinfo:{required:!1,label:"Claim User Info",tooltip:"",placeholder:"Claim User Info",type:"toggle",hasError:(e,i)=>"",editOnly:!1},redirect_uri_dynamic:{required:!1,label:"Redirect URI Dynamic",tooltip:"",placeholder:"Redirect URI Dynamic",type:"toggle",hasError:(e,i)=>"",editOnly:!1}},o={server_insecure:{required:!0,hasError:(e,i)=>!e&&i?"Server Address is required":"",label:"Server Insecure",tooltip:"Disable SSL certificate verification ",placeholder:"myldapserver.com:636",type:"toggle",editOnly:!1},server_addr:{required:!0,hasError:(e,i)=>!e&&i?"Server Address is required":"",label:"Server Address",tooltip:'AD/LDAP server address e.g. "myldapserver.com:636"',placeholder:"myldapserver.com:636",type:"text",editOnly:!1},lookup_bind_dn:{required:!0,hasError:(e,i)=>!e&&i?"Lookup Bind DN is required":"",label:"Lookup Bind DN",tooltip:"DN (Distinguished Name) for LDAP read-only service account used to perform DN and group lookups",placeholder:"cn=admin,dc=min,dc=io",type:"text",editOnly:!1},lookup_bind_password:{required:!0,hasError:(e,i)=>!e&&i?"Lookup Bind Password is required":"",label:"Lookup Bind Password",tooltip:"Password for LDAP read-only service account used to perform DN and group lookups",placeholder:"admin",type:"password",editOnly:!0},user_dn_search_base_dn:{required:!0,hasError:(e,i)=>!e&&i?"User DN Search Base DN is required":"",label:"User DN Search Base",tooltip:"",placeholder:"DC=example,DC=net",type:"text",editOnly:!1},user_dn_search_filter:{required:!0,hasError:(e,i)=>!e&&i?"User DN Search Filter is required":"",label:"User DN Search Filter",tooltip:"",placeholder:"(sAMAccountName=%s)",type:"text",editOnly:!1},group_search_base_dn:{required:!1,hasError:(e,i)=>"",label:"Group Search Base DN",tooltip:"",placeholder:"ou=swengg,dc=min,dc=io",type:"text",editOnly:!1},group_search_filter:{required:!1,hasError:(e,i)=>"",label:"Group Search Filter",tooltip:"",placeholder:"(&(objectclass=groupofnames)(member=%d))",type:"text",editOnly:!1}}},42967:(e,i,t)=>{t.d(i,{A:()=>u});var r=t(65043),s=t(89923),n=t(8185),l=t(64681),a=t(64159),o=t(21383),d=t(62560),c=t(22166),p=t(56629),x=t(70579);const u=e=>{let{noTitle:i=!1}=e;const t=(0,o.jL)(),[u,h]=(0,r.useState)([]),[m,g]=(0,r.useState)(!1),[f,y]=(0,r.useState)(""),j=(0,c.d4)((e=>e.createUser.selectedPolicies)),b=(0,r.useCallback)((()=>{g(!0),p.F.policies.listPolicies().then((e=>{var i;const t=null!==(i=e.data.policies)&&void 0!==i?i:[];g(!1),h(t.sort(n.Hw))})).catch((e=>{g(!1),t((0,a.Dy)(e))}))}),[t]);(0,r.useEffect)((()=>{g(!0)}),[]),(0,r.useEffect)((()=>{m&&b()}),[m,b]);const v=u.filter((e=>e.name.includes(f)));return(0,x.jsxs)(s.xA9,{item:!0,xs:12,className:"inputItem",children:[m&&(0,x.jsx)(s.z21,{}),u.length>0?(0,x.jsxs)(r.Fragment,{children:[(0,x.jsx)(s.xA9,{item:!0,xs:12,className:"inputItem",children:(0,x.jsx)(l.A,{placeholder:"Start typing to search for a Policy",onChange:e=>{y(e)},value:f,label:i?"":"Assign Policies"})}),(0,x.jsx)(s.bQt,{columns:[{label:"Policy",elementKey:"name"}],onSelect:e=>{const i=e.target,r=i.value,s=i.checked;let n=[...j];s?n.push(r):n=n.filter((e=>e!==r)),n=n.filter((e=>""!==e)),t((0,d.Gy)(n))},selectedItems:j,isLoading:m,records:v,entityName:"Policies",idField:"name",customPaperHeight:"200px"})]}):(0,x.jsx)(s.azJ,{sx:{textAlign:"center",padding:"10px 0"},children:"No Policies Available"})]})}},8185:(e,i,t)=>{t.d(i,{Hw:()=>s,LA:()=>r,SO:()=>n,rY:()=>l});const r=(e,i)=>{if(e.accessKey&&i.accessKey){if(e.accessKey>i.accessKey)return 1;if(e.accessKeye.name>i.name?1:e.namee>i?1:ee.policy>i.policy?1:e.policy.\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport ConfirmDialog from \"../../Common/ModalWrapper/ConfirmDialog\";\n\nimport { ConfirmDeleteIcon, ProgressBar } from \"mds\";\nimport { setErrorSnackMessage } from \"../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../store\";\n\ninterface IResetConfiguration {\n configurationName: string;\n closeResetModalAndRefresh: (reloadConfiguration: boolean) => void;\n resetOpen: boolean;\n}\n\nconst ResetConfigurationModal = ({\n configurationName,\n closeResetModalAndRefresh,\n resetOpen,\n}: IResetConfiguration) => {\n const dispatch = useAppDispatch();\n const [resetLoading, setResetLoading] = useState(false);\n\n useEffect(() => {\n if (resetLoading) {\n api.configs\n .resetConfig(configurationName)\n .then(() => {\n setResetLoading(false);\n closeResetModalAndRefresh(true);\n })\n .catch((err) => {\n setResetLoading(false);\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n });\n }\n }, [closeResetModalAndRefresh, configurationName, resetLoading, dispatch]);\n\n const resetConfiguration = () => {\n setResetLoading(true);\n };\n\n return (\n }\n isLoading={resetLoading}\n onConfirm={resetConfiguration}\n onClose={() => {\n closeResetModalAndRefresh(false);\n }}\n confirmationContent={\n \n {resetLoading && }\n \n Are you sure you want to restore these configurations to default\n values?\n
\n \n Please note that this may cause your system to not be accessible\n \n
\n
\n }\n />\n );\n};\n\nexport default ResetConfigurationModal;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2023 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport { HelpIconFilled, Box } from \"mds\";\n\ninterface IContent {\n icon: React.ReactNode;\n text: string;\n iconDescription: string;\n}\n\ninterface IAddIDPConfigurationHelpBoxProps {\n helpText: string;\n docLink: string;\n docText: string;\n contents: IContent[];\n}\n\nconst FeatureItem = ({\n icon,\n description,\n}: {\n icon: any;\n description: string;\n}) => {\n return (\n \n {icon}{\" \"}\n

\n {description}\n
\n \n );\n};\n\nconst AddIDPConfigurationHelpBox = ({\n helpText,\n docLink,\n docText,\n contents,\n}: IAddIDPConfigurationHelpBoxProps) => {\n return (\n \n \n \n
{helpText}
\n \n \n {contents.map((content, index) => (\n \n {content.icon && (\n \n \n \n )}\n {content.text}\n \n ))}\n \n \n {docText}\n \n \n \n \n );\n};\n\nexport default AddIDPConfigurationHelpBox;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2023 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport { Box, CollapseCaret, GroupsMenuIcon, SectionTitle } from \"mds\";\nimport { LdapEntities } from \"api/consoleApi\";\n\ninterface IResultBlock {\n entityName: \"Group\" | \"User\" | \"Policy\";\n results: LdapEntities;\n}\n\ninterface IEntityResultName {\n name: string;\n}\n\ninterface IEntityResultItem {\n blockName: \"Policies\" | \"Groups\" | \"Users\";\n results: string[];\n}\n\nconst EntityResultTitle = ({ name }: IEntityResultName) => {\n return (\n

\n \n {name}\n

\n );\n};\n\nconst EntityResultItems = ({ blockName, results }: IEntityResultItem) => {\n return (\n \n {blockName}:\n
    \n {results.map((res, index) => (\n
  • {res}
  • \n ))}\n
\n
\n );\n};\n\nconst LDAPResultsBlock = ({ entityName, results }: IResultBlock) => {\n let entityLength = 0;\n\n switch (entityName) {\n case \"Group\":\n entityLength = results.groups?.length || 0;\n break;\n case \"Policy\":\n entityLength = results.policies?.length || 0;\n break;\n case \"User\":\n entityLength = results.users?.length || 0;\n break;\n }\n\n return (\n \n }\n actions={\n \n {entityLength} Entit\n {entityLength === 1 ? \"y\" : \"ies\"} Found\n \n }\n >\n {entityName} Mappings\n \n \n {entityName === \"Group\" &&\n results.groups?.map((groupData, index) => {\n return (\n \n \n {groupData.policies && (\n \n )}\n \n );\n })}\n {entityName === \"User\" &&\n results.users?.map((groupData, index) => {\n return (\n \n \n {groupData.policies && (\n \n )}\n \n );\n })}\n {entityName === \"Policy\" &&\n results.policies?.map((groupData, index) => {\n return (\n \n \n {groupData.groups && (\n \n )}\n {groupData.users && (\n \n )}\n \n );\n })}\n \n \n );\n};\n\nexport default LDAPResultsBlock;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2023 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useState } from \"react\";\nimport {\n AddIcon,\n Box,\n Button,\n Grid,\n InputBox,\n Loader,\n RemoveIcon,\n SearchIcon,\n SectionTitle,\n TimeIcon,\n} from \"mds\";\nimport { useSelector } from \"react-redux\";\nimport { DateTime } from \"luxon\";\nimport { api } from \"api\";\nimport { errorToHandler } from \"api/errors\";\nimport { LdapEntities } from \"api/consoleApi\";\nimport { setErrorSnackMessage } from \"../../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../../store\";\nimport LDAPResultsBlock from \"./LDAPResultsBlock\";\nimport PolicySelectors from \"../../Policies/PolicySelectors\";\n\nconst LDAPEntitiesQuery = () => {\n const dispatch = useAppDispatch();\n\n const [loading, setLoading] = useState(false);\n const [users, setUsers] = useState([\"\"]);\n const [groups, setGroups] = useState([\"\"]);\n const [results, setResults] = useState(null);\n\n const selectedPolicies = useSelector(\n (state: AppState) => state.createUser.selectedPolicies,\n );\n\n const searchEntities = () => {\n setLoading(true);\n\n let data: any = {};\n\n let cleanPolicies = selectedPolicies.filter((pol) => pol !== \"\");\n let cleanUsers = users.filter((usr) => usr !== \"\");\n let cleanGroups = groups.filter((grp) => grp !== \"\");\n\n if (cleanPolicies.length > 0) {\n data[\"policies\"] = cleanPolicies;\n }\n\n if (cleanUsers.length > 0) {\n data[\"users\"] = cleanUsers;\n }\n\n if (cleanGroups.length > 0) {\n data[\"groups\"] = cleanGroups;\n }\n\n api.ldapEntities\n .getLdapEntities(data)\n .then((result) => {\n setResults(result.data);\n setLoading(false);\n })\n .catch((err) => {\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n setLoading(false);\n });\n };\n\n const alterUsersList = (addItem: boolean, index: number) => {\n if (addItem) {\n const alterUsers = [...users, \"\"];\n setUsers(alterUsers);\n\n return;\n }\n\n const filteredUsers = users.filter((_, indx) => indx !== index);\n\n setUsers(filteredUsers);\n };\n\n const alterGroupsList = (addItem: boolean, index: number) => {\n if (addItem) {\n const alterGroups = [...groups, \"\"];\n setGroups(alterGroups);\n\n return;\n }\n\n const filteredGroups = groups.filter((_, indx) => indx !== index);\n\n setGroups(filteredGroups);\n };\n\n return (\n \n \n \n Query Filters\n\n \n \n \n

\n Users\n

\n
\n div > div\": {\n width: \"100%\",\n },\n }}\n >\n {users.map((userDat, index) => {\n return (\n ) => {\n const usersElements = [...users];\n usersElements[index] = e.target.value;\n setUsers(usersElements);\n }}\n overlayIcon={\n users.length === index + 1 ? (\n \n ) : (\n \n )\n }\n overlayAction={() => {\n alterUsersList(users.length === index + 1, index);\n }}\n />\n );\n })}\n
\n
\n \n

\n Groups\n

\n div > div\": {\n width: \"100%\",\n },\n }}\n >\n {groups.map((groupDat, index) => {\n return (\n ) => {\n const groupsElements = [...groups];\n groupsElements[index] = e.target.value;\n setGroups(groupsElements);\n }}\n overlayIcon={\n groups.length === index + 1 ? (\n \n ) : (\n \n )\n }\n overlayAction={() => {\n alterGroupsList(groups.length === index + 1, index);\n }}\n />\n );\n })}\n
\n \n \n

\n Policies\n

\n \n \n
\n \n \n \n \n {loading ? (\n \n \n \n ) : (\n \n \n {results?.timestamp ? (\n \n \n {DateTime.fromISO(results.timestamp).toFormat(\n \"D HH:mm:ss\",\n )}\n \n ) : (\n \"\"\n )}\n \n }\n >\n Query Results\n \n {results ? (\n \n {!results.groups && !results.users && !results.policies && (\n \n

No Results Available

\n
\n )}\n {!!results.groups && (\n \n )}\n {!!results.users && (\n \n )}\n {!!results.policies && (\n \n )}\n \n ) : (\n No query results yet\n )}\n
\n )}\n \n \n \n \n }\n >\n Search\n \n \n \n \n );\n};\n\nexport default LDAPEntitiesQuery;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2023 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport {\n Box,\n Button,\n ConsoleIcon,\n EditIcon,\n FormLayout,\n Grid,\n HelpBox,\n InputBox,\n Loader,\n PageLayout,\n RefreshIcon,\n Switch,\n Tabs,\n Tooltip,\n ValuePair,\n WarnIcon,\n ScreenTitle,\n} from \"mds\";\nimport { api } from \"api\";\nimport { ConfigurationKV } from \"api/consoleApi\";\nimport { errorToHandler } from \"api/errors\";\nimport { useAppDispatch } from \"../../../../store\";\nimport {\n setErrorSnackMessage,\n setHelpName,\n setServerNeedsRestart,\n setSnackBarMessage,\n} from \"../../../../systemSlice\";\nimport { ldapFormFields, ldapHelpBoxContents } from \"../utils\";\nimport PageHeaderWrapper from \"../../Common/PageHeaderWrapper/PageHeaderWrapper\";\nimport AddIDPConfigurationHelpBox from \"../AddIDPConfigurationHelpbox\";\nimport LDAPEntitiesQuery from \"./LDAPEntitiesQuery\";\nimport ResetConfigurationModal from \"../../EventDestinations/CustomForms/ResetConfigurationModal\";\nimport HelpMenu from \"../../HelpMenu\";\n\nconst enabledConfigLDAP = [\n \"server_addr\",\n \"lookup_bind_dn\",\n \"user_dn_search_base_dn\",\n \"user_dn_search_filter\",\n];\n\nconst IDPLDAPConfigurationDetails = () => {\n const dispatch = useAppDispatch();\n\n const formFields = ldapFormFields;\n\n const [loading, setLoading] = useState(true);\n const [isEnabled, setIsEnabled] = useState(false);\n const [hasConfiguration, setHasConfiguration] = useState(false);\n const [fields, setFields] = useState({});\n const [overrideFields, setOverrideFields] = useState({});\n const [record, setRecord] = useState(\n undefined,\n );\n const [editMode, setEditMode] = useState(false);\n const [resetOpen, setResetOpen] = useState(false);\n const [curTab, setCurTab] = useState(\"configuration\");\n const [envOverride, setEnvOverride] = useState(false);\n\n const toggleEditMode = () => {\n if (editMode && record) {\n parseFields(record);\n }\n setEditMode(!editMode);\n };\n\n const parseFields = (record: ConfigurationKV[]) => {\n let fields: any = {};\n let ovrFlds: any = {};\n if (record && record.length > 0) {\n const enabled = record.find((item: any) => item.key === \"enable\");\n\n let totalCoincidences = 0;\n let totalOverride = 0;\n\n record.forEach((item: any) => {\n if (item.env_override) {\n fields[item.key] = item.env_override.value;\n ovrFlds[item.key] = item.env_override.name;\n } else {\n fields[item.key] = item.value;\n }\n\n if (\n enabledConfigLDAP.includes(item.key) &&\n ((item.value && item.value !== \"\" && item.value !== \"off\") ||\n (item.env_override &&\n item.env_override.value !== \"\" &&\n item.env_override.value !== \"off\"))\n ) {\n totalCoincidences++;\n }\n\n if (enabledConfigLDAP.includes(item.key) && item.env_override) {\n totalOverride++;\n }\n });\n\n const hasConfig = totalCoincidences !== 0;\n\n if (hasConfig && ((enabled && enabled.value !== \"off\") || !enabled)) {\n setIsEnabled(true);\n } else {\n setIsEnabled(false);\n }\n\n if (totalOverride !== 0) {\n setEnvOverride(true);\n }\n\n setHasConfiguration(hasConfig);\n }\n setOverrideFields(ovrFlds);\n setFields(fields);\n };\n\n useEffect(() => {\n const loadRecord = () => {\n api.configs\n .configInfo(\"identity_ldap\")\n .then((res) => {\n if (res.data.length > 0) {\n setRecord(res.data[0].key_values);\n parseFields(res.data[0].key_values || []);\n }\n setLoading(false);\n })\n .catch((err) => {\n setLoading(false);\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n });\n };\n\n if (loading) {\n loadRecord();\n }\n }, [dispatch, loading]);\n\n const validSave = () => {\n for (const [key, value] of Object.entries(formFields)) {\n if (\n value.required &&\n !(\n fields[key] !== undefined &&\n fields[key] !== null &&\n fields[key] !== \"\"\n )\n ) {\n return false;\n }\n }\n return true;\n };\n\n const saveRecord = () => {\n const keyVals = Object.keys(formFields).map((key) => {\n return {\n key,\n value: fields[key],\n };\n });\n\n api.configs\n .setConfig(\"identity_ldap\", {\n key_values: keyVals,\n })\n .then((res) => {\n setEditMode(false);\n setRecord(keyVals);\n parseFields(keyVals);\n dispatch(setServerNeedsRestart(res.data.restart || false));\n setFields({ ...fields, lookup_bind_password: \"\" });\n\n if (!res.data.restart) {\n dispatch(setSnackBarMessage(\"Configuration saved successfully\"));\n }\n })\n .catch((err) => {\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n });\n };\n\n const closeDeleteModalAndRefresh = async (refresh: boolean) => {\n setResetOpen(false);\n\n if (refresh) {\n dispatch(setServerNeedsRestart(refresh));\n setRecord(undefined);\n setFields({});\n setIsEnabled(false);\n setHasConfiguration(false);\n setEditMode(false);\n }\n };\n\n const toggleConfiguration = (value: boolean) => {\n const payload = {\n key_values: [\n {\n key: \"enable\",\n value: value ? \"on\" : \"off\",\n },\n ],\n };\n\n api.configs\n .setConfig(\"identity_ldap\", payload)\n .then((res) => {\n setIsEnabled(!isEnabled);\n dispatch(setServerNeedsRestart(res.data.restart || false));\n if (!res.data.restart) {\n dispatch(setSnackBarMessage(\"Configuration saved successfully\"));\n }\n })\n .catch((err) => {\n dispatch(setErrorSnackMessage(errorToHandler(err.error)));\n });\n };\n\n const renderFormField = (key: string, value: any) => {\n switch (value.type) {\n case \"toggle\":\n return (\n \n setFields({ ...fields, [key]: e.target.checked ? \"on\" : \"off\" })\n }\n description=\"\"\n disabled={!editMode}\n />\n );\n default:\n return (\n ) =>\n setFields({ ...fields, [key]: e.target.value })\n }\n placeholder={value.placeholder}\n disabled={!editMode}\n type={value.type}\n />\n );\n }\n };\n\n useEffect(() => {\n dispatch(setHelpName(\"LDAP\"));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n \n {resetOpen && (\n \n )}\n } />\n \n \n \n \n }\n onClick={toggleEditMode}\n label={\"Edit Configuration\"}\n disabled={loading || envOverride}\n />\n \n {hasConfiguration && (\n \n toggleConfiguration(!isEnabled)}\n label={\n isEnabled ? \"Disable LDAP\" : \"Enable LDAP\"\n }\n variant={isEnabled ? \"secondary\" : \"regular\"}\n disabled={envOverride}\n />\n \n )}\n setLoading(true)}\n label={\"Refresh\"}\n icon={}\n />\n \n ) : null\n }\n />\n
\n {loading ? (\n \n \n \n ) : (\n \n {editMode ? (\n \n \n }\n >\n {editMode && hasConfiguration ? (\n \n \n Lookup Bind Password must be re-entered to\n change LDAP configurations\n \n }\n iconComponent={}\n help={null}\n />\n \n ) : null}\n {Object.entries(formFields).map(([key, value]) =>\n renderFormField(key, value),\n )}\n \n {editMode && hasConfiguration && (\n setResetOpen(true)}\n label={\"Reset Configuration\"}\n />\n )}\n \n \n \n \n \n ) : (\n \n \n \n {hasConfiguration && (\n \n {Object.entries(formFields).map(\n ([key, value]) => {\n if (!value.editOnly) {\n let label: React.ReactNode = value.label;\n let val: React.ReactNode = fields[key]\n ? fields[key]\n : \"\";\n\n if (overrideFields[key]) {\n label = (\n \n {value.label}\n \n \n \n \n \n \n );\n\n val = (\n \n \n {val}\n \n \n );\n }\n return (\n \n );\n }\n return null;\n },\n )}\n \n )}\n \n \n )}\n \n )}\n \n ),\n },\n {\n tabConfig: {\n id: \"entities\",\n label: \"Entities\",\n disabled: !hasConfiguration || !isEnabled,\n },\n content: (\n \n {hasConfiguration && (\n \n \n \n )}\n \n ),\n },\n ]}\n currentTabOrPath={curTab}\n onTabClick={(newTab) => {\n setCurTab(newTab);\n setEditMode(false);\n }}\n />\n
\n
\n );\n};\n\nexport default IDPLDAPConfigurationDetails;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport { LockIcon, LoginIcon } from \"mds\";\n\nexport const ldapHelpBoxContents = [\n {\n text: \"MinIO supports using an Active Directory or LDAP (AD/LDAP) service for external management of user identities. Configuring an external IDentity Provider (IDP) enables Single-Sign On (SSO) workflows, where applications authenticate against the external IDP before accessing MinIO.\",\n icon: ,\n iconDescription: \"Create Configurations\",\n },\n {\n text: \"MinIO queries the configured Active Directory / LDAP server to verify the credentials specified by the application and optionally return a list of groups in which the user has membership. MinIO supports two modes (Lookup-Bind Mode and Username-Bind Mode) for performing these queries\",\n icon: null,\n iconDescription: \"\",\n },\n {\n text: \"MinIO recommends using Lookup-Bind mode as the preferred method for verifying AD/LDAP credentials. Username-Bind mode is a legacy method retained for backwards compatibility only.\",\n icon: null,\n iconDescription: \"\",\n },\n];\n\nexport const openIDHelpBoxContents = [\n {\n text: \"MinIO supports using an OpenID Connect (OIDC) compatible IDentity Provider (IDP) such as Okta, KeyCloak, Dex, Google, or Facebook for external management of user identities.\",\n icon: ,\n iconDescription: \"Create Configurations\",\n },\n {\n text: \"Configuring an external IDP enables Single-Sign On workflows, where applications authenticate against the external IDP before accessing MinIO.\",\n icon: null,\n iconDescription: \"\",\n },\n];\n\nexport const openIDFormFields = {\n config_url: {\n required: true,\n hasError: (s: string, editMode: boolean) => {\n return !s && editMode ? \"Config URL is required\" : \"\";\n },\n label: \"Config URL\",\n tooltip: \"Config URL for identity provider configuration\",\n placeholder:\n \"https://identity-provider-url/.well-known/openid-configuration\",\n type: \"text\",\n editOnly: false,\n },\n client_id: {\n required: true,\n hasError: (s: string, editMode: boolean) => {\n return !s && editMode ? \"Client ID is required\" : \"\";\n },\n label: \"Client ID\",\n tooltip: \"Identity provider Client ID\",\n placeholder: \"Enter Client ID\",\n type: \"text\",\n editOnly: false,\n },\n client_secret: {\n required: true,\n hasError: (s: string, editMode: boolean) => {\n return !s && editMode ? \"Client Secret is required\" : \"\";\n },\n label: \"Client Secret\",\n tooltip: \"Identity provider Client Secret\",\n placeholder: \"Enter Client Secret\",\n type: \"password\",\n editOnly: true,\n },\n claim_name: {\n required: false,\n label: \"Claim Name\",\n tooltip: \"Claim from which MinIO will read the policy or role to use\",\n placeholder: \"Enter Claim Name\",\n type: \"text\",\n hasError: (s: string, editMode: boolean) => \"\",\n editOnly: false,\n },\n display_name: {\n required: false,\n label: \"Display Name\",\n tooltip: \"\",\n placeholder: \"Enter Display Name\",\n type: \"text\",\n hasError: (s: string, editMode: boolean) => \"\",\n editOnly: false,\n },\n claim_prefix: {\n required: false,\n label: \"Claim Prefix\",\n tooltip: \"\",\n placeholder: \"Enter Claim Prefix\",\n type: \"text\",\n hasError: (s: string, editMode: boolean) => \"\",\n editOnly: false,\n },\n scopes: {\n required: false,\n label: \"Scopes\",\n tooltip: \"\",\n placeholder: \"openid,profile,email\",\n type: \"text\",\n hasError: (s: string, editMode: boolean) => \"\",\n editOnly: false,\n },\n redirect_uri: {\n required: false,\n label: \"Redirect URI\",\n tooltip: \"\",\n placeholder: \"https://console-endpoint-url/oauth_callback\",\n type: \"text\",\n hasError: (s: string, editMode: boolean) => \"\",\n editOnly: false,\n },\n role_policy: {\n required: false,\n label: \"Role Policy\",\n tooltip: \"\",\n placeholder: \"readonly\",\n type: \"text\",\n hasError: (s: string, editMode: boolean) => \"\",\n editOnly: false,\n },\n claim_userinfo: {\n required: false,\n label: \"Claim User Info\",\n tooltip: \"\",\n placeholder: \"Claim User Info\",\n type: \"toggle\",\n hasError: (s: string, editMode: boolean) => \"\",\n editOnly: false,\n },\n redirect_uri_dynamic: {\n required: false,\n label: \"Redirect URI Dynamic\",\n tooltip: \"\",\n placeholder: \"Redirect URI Dynamic\",\n type: \"toggle\",\n hasError: (s: string, editMode: boolean) => \"\",\n editOnly: false,\n },\n};\n\nexport const ldapFormFields = {\n server_insecure: {\n required: true,\n hasError: (s: string, editMode: boolean) => {\n return !s && editMode ? \"Server Address is required\" : \"\";\n },\n label: \"Server Insecure\",\n tooltip: \"Disable SSL certificate verification \",\n placeholder: \"myldapserver.com:636\",\n type: \"toggle\",\n editOnly: false,\n },\n server_addr: {\n required: true,\n hasError: (s: string, editMode: boolean) => {\n return !s && editMode ? \"Server Address is required\" : \"\";\n },\n label: \"Server Address\",\n tooltip: 'AD/LDAP server address e.g. \"myldapserver.com:636\"',\n placeholder: \"myldapserver.com:636\",\n type: \"text\",\n editOnly: false,\n },\n lookup_bind_dn: {\n required: true,\n hasError: (s: string, editMode: boolean) => {\n return !s && editMode ? \"Lookup Bind DN is required\" : \"\";\n },\n label: \"Lookup Bind DN\",\n tooltip:\n \"DN (Distinguished Name) for LDAP read-only service account used to perform DN and group lookups\",\n placeholder: \"cn=admin,dc=min,dc=io\",\n type: \"text\",\n editOnly: false,\n },\n lookup_bind_password: {\n required: true,\n hasError: (s: string, editMode: boolean) => {\n return !s && editMode ? \"Lookup Bind Password is required\" : \"\";\n },\n label: \"Lookup Bind Password\",\n tooltip:\n \"Password for LDAP read-only service account used to perform DN and group lookups\",\n placeholder: \"admin\",\n type: \"password\",\n editOnly: true,\n },\n user_dn_search_base_dn: {\n required: true,\n hasError: (s: string, editMode: boolean) => {\n return !s && editMode ? \"User DN Search Base DN is required\" : \"\";\n },\n label: \"User DN Search Base\",\n tooltip: \"\",\n placeholder: \"DC=example,DC=net\",\n type: \"text\",\n editOnly: false,\n },\n user_dn_search_filter: {\n required: true,\n hasError: (s: string, editMode: boolean) => {\n return !s && editMode ? \"User DN Search Filter is required\" : \"\";\n },\n label: \"User DN Search Filter\",\n tooltip: \"\",\n placeholder: \"(sAMAccountName=%s)\",\n type: \"text\",\n editOnly: false,\n },\n group_search_base_dn: {\n required: false,\n hasError: (s: string, editMode: boolean) => \"\",\n label: \"Group Search Base DN\",\n tooltip: \"\",\n placeholder: \"ou=swengg,dc=min,dc=io\",\n type: \"text\",\n editOnly: false,\n },\n group_search_filter: {\n required: false,\n hasError: (s: string, editMode: boolean) => \"\",\n label: \"Group Search Filter\",\n tooltip: \"\",\n placeholder: \"(&(objectclass=groupofnames)(member=%d))\",\n type: \"text\",\n editOnly: false,\n },\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useCallback, useEffect, useState } from \"react\";\n\nimport { Box, DataTable, Grid, ProgressBar } from \"mds\";\nimport { policySort } from \"../../../utils/sortFunctions\";\nimport { ErrorResponseHandler } from \"../../../common/types\";\nimport SearchBox from \"../Common/SearchBox\";\nimport { setModalErrorSnackMessage } from \"../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../store\";\nimport { setSelectedPolicies } from \"../Users/AddUsersSlice\";\nimport { useSelector } from \"react-redux\";\nimport { api } from \"../../../api\";\n\ninterface ISelectPolicyProps {\n selectedPolicy?: string[];\n noTitle?: boolean;\n}\n\nconst PolicySelectors = ({ noTitle = false }: ISelectPolicyProps) => {\n const dispatch = useAppDispatch();\n // Local State\n const [records, setRecords] = useState([]);\n const [loading, isLoading] = useState(false);\n const [filter, setFilter] = useState(\"\");\n\n const currentPolicies = useSelector(\n (state: AppState) => state.createUser.selectedPolicies,\n );\n\n const fetchPolicies = useCallback(() => {\n isLoading(true);\n\n api.policies\n .listPolicies()\n .then((res) => {\n const policies = res.data.policies ?? [];\n isLoading(false);\n setRecords(policies.sort(policySort));\n })\n .catch((err: ErrorResponseHandler) => {\n isLoading(false);\n dispatch(setModalErrorSnackMessage(err));\n });\n }, [dispatch]);\n\n //Effects\n useEffect(() => {\n isLoading(true);\n }, []);\n\n useEffect(() => {\n if (loading) {\n fetchPolicies();\n }\n }, [loading, fetchPolicies]);\n\n const selectionChanged = (e: React.ChangeEvent) => {\n const targetD = e.target;\n const value = targetD.value;\n const checked = targetD.checked;\n\n let elements: string[] = [...currentPolicies]; // We clone the checkedUsers array\n\n if (checked) {\n // If the user has checked this field we need to push this to checkedUsersList\n elements.push(value);\n } else {\n // User has unchecked this field, we need to remove it from the list\n elements = elements.filter((element) => element !== value);\n }\n // remove empty values\n elements = elements.filter((element) => element !== \"\");\n\n dispatch(setSelectedPolicies(elements));\n };\n\n const filteredRecords = records.filter((elementItem) =>\n elementItem.name.includes(filter),\n );\n\n return (\n \n {loading && }\n {records.length > 0 ? (\n \n \n {\n setFilter(value);\n }}\n value={filter}\n label={!noTitle ? \"Assign Policies\" : \"\"}\n />\n \n\n \n \n ) : (\n \n No Policies Available\n \n )}\n \n );\n};\n\nexport default PolicySelectors;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport { Policy, User } from \"api/consoleApi\";\n\ninterface policyDetailsInterface {\n policy: string;\n}\n\nexport const usersSort = (a: User, b: User) => {\n if (a.accessKey && b.accessKey) {\n if (a.accessKey > b.accessKey) {\n return 1;\n }\n if (a.accessKey < b.accessKey) {\n return -1;\n }\n }\n // a must be equal to b\n return 0;\n};\n\nexport const policySort = (a: Policy, b: Policy) => {\n if (a.name! > b.name!) {\n return 1;\n }\n if (a.name! < b.name!) {\n return -1;\n }\n // a must be equal to b\n return 0;\n};\n\nexport const stringSort = (a: string, b: string) => {\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n // a must be equal to b\n return 0;\n};\n\nexport const policyDetailsSort = (\n a: policyDetailsInterface,\n b: policyDetailsInterface,\n) => {\n if (a.policy > b.policy) {\n return 1;\n }\n if (a.policy < b.policy) {\n return -1;\n }\n // a must be equal to b\n return 0;\n};\n"],"names":["_ref","configurationName","closeResetModalAndRefresh","resetOpen","dispatch","useAppDispatch","resetLoading","setResetLoading","useState","useEffect","api","configs","resetConfig","then","catch","err","setErrorSnackMessage","errorToHandler","error","_jsx","ConfirmDialog","title","confirmText","isOpen","titleIcon","ConfirmDeleteIcon","isLoading","onConfirm","resetConfiguration","onClose","confirmationContent","_jsxs","Fragment","children","ProgressBar","style","maxWidth","whiteSpace","wordWrap","FeatureItem","icon","description","Box","sx","display","marginRight","height","width","marginBottom","fontSize","fontStyle","color","_ref2","helpText","docLink","docText","contents","flex","border","borderRadius","flexFlow","padding","fontWeight","alignItems","paddingBottom","HelpIconFilled","map","content","index","iconDescription","text","href","target","rel","EntityResultTitle","name","CollapseCaret","transform","EntityResultItems","blockName","results","res","_ref3","_results$groups","_results$policies","_results$users","_results$groups2","_results$users2","_results$policies2","entityName","entityLength","groups","length","policies","users","className","marginTop","SectionTitle","separator","GroupsMenuIcon","actions","h4","borderBottom","margin","fill","groupData","group","user","policy","LDAPEntitiesQuery","loading","setLoading","setUsers","setGroups","setResults","selectedPolicies","useSelector","state","createUser","paddingTop","Grid","container","item","sm","md","lg","flexDirection","gap","withBorders","overflowY","minHeight","maxHeight","userDat","InputBox","id","value","onChange","e","usersElements","overlayIcon","AddIcon","RemoveIcon","overlayAction","alterUsersList","addItem","alterUsers","filteredUsers","filter","_","indx","groupDat","groupsElements","alterGroupsList","alterGroups","filteredGroups","PolicySelectors","selectedPolicy","noTitle","textAlign","Loader","timestamp","TimeIcon","DateTime","fromISO","toFormat","backgroundColor","flexGrow","LDAPResultsBlock","xs","justifyContent","Button","type","variant","onClick","searchEntities","data","cleanPolicies","pol","cleanUsers","usr","cleanGroups","grp","ldapEntities","getLdapEntities","result","SearchIcon","enabledConfigLDAP","IDPLDAPConfigurationDetails","formFields","ldapFormFields","isEnabled","setIsEnabled","hasConfiguration","setHasConfiguration","fields","setFields","overrideFields","setOverrideFields","record","setRecord","undefined","editMode","setEditMode","setResetOpen","curTab","setCurTab","envOverride","setEnvOverride","toggleEditMode","parseFields","ovrFlds","enabled","find","key","totalCoincidences","totalOverride","forEach","env_override","includes","hasConfig","configInfo","key_values","setHelpName","ResetConfigurationModal","async","refresh","setServerNeedsRestart","PageHeaderWrapper","label","HelpMenu","PageLayout","Tabs","horizontal","options","tabConfig","ScreenTitle","Tooltip","tooltip","EditIcon","disabled","payload","setConfig","restart","setSnackBarMessage","toggleConfiguration","RefreshIcon","FormLayout","helpBox","AddIDPConfigurationHelpBox","ldapHelpBoxContents","HelpBox","iconComponent","WarnIcon","help","Object","entries","renderFormField","Switch","indicatorLabels","checked","required","hasError","placeholder","validSave","saveRecord","keyVals","keys","lookup_bind_password","gridTemplateColumns","gridAutoFlow","ValuePair","editOnly","val","placement","ConsoleIcon","currentTabOrPath","onTabClick","newTab","LoginIcon","openIDHelpBoxContents","LockIcon","openIDFormFields","config_url","s","client_id","client_secret","claim_name","display_name","claim_prefix","scopes","redirect_uri","role_policy","claim_userinfo","redirect_uri_dynamic","server_insecure","server_addr","lookup_bind_dn","user_dn_search_base_dn","user_dn_search_filter","group_search_base_dn","group_search_filter","records","setRecords","setFilter","currentPolicies","fetchPolicies","useCallback","listPolicies","_res$data$policies","sort","policySort","setModalErrorSnackMessage","filteredRecords","elementItem","SearchBox","DataTable","columns","elementKey","onSelect","targetD","elements","push","element","setSelectedPolicies","selectedItems","idField","customPaperHeight","usersSort","a","b","accessKey","stringSort","policyDetailsSort"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/2209.3b0ca7fa.chunk.js b/web-app/build/static/js/2209.3b0ca7fa.chunk.js deleted file mode 100644 index 0f61a8d82..000000000 --- a/web-app/build/static/js/2209.3b0ca7fa.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[2209],{72237:(e,n,s)=>{s.d(n,{A:()=>a});var t=s(65043),l=s(70579);const a=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(s){return(0,l.jsx)(t.Suspense,{fallback:n,children:(0,l.jsx)(e,{...s})})}}},12209:(e,n,s)=>{s.r(n),s.d(n,{default:()=>r});var t=s(65043),l=s(73216),a=s(39808),h=s(72237),c=s(70579);const p=(0,h.A)(t.lazy((()=>s.e(985).then(s.bind(s,10985))))),u=(0,h.A)(t.lazy((()=>s.e(1370).then(s.bind(s,81370))))),r=()=>(0,c.jsxs)(l.BV,{children:[(0,c.jsx)(l.qh,{path:"/",element:(0,c.jsx)(p,{})}),(0,c.jsx)(l.qh,{path:":policyName",element:(0,c.jsx)(u,{})}),(0,c.jsx)(l.qh,{element:(0,c.jsx)(a.A,{})})]})}}]); -//# sourceMappingURL=2209.3b0ca7fa.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/2209.3b0ca7fa.chunk.js.map b/web-app/build/static/js/2209.3b0ca7fa.chunk.js.map deleted file mode 100644 index 5d2596a2f..000000000 --- a/web-app/build/static/js/2209.3b0ca7fa.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"static/js/2209.3b0ca7fa.chunk.js","mappings":"8IAiCA,QAfA,SACEA,GAEC,IADDC,EAAmCC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,KAUtC,OARA,SAA+BG,GAC7B,OACEC,EAAAA,EAAAA,KAACC,EAAAA,SAAQ,CAACN,SAAUA,EAASO,UAC3BF,EAAAA,EAAAA,KAACN,EAAgB,IAAMK,KAG7B,CAGF,C,2GCtBA,MAAMI,GAAeC,EAAAA,EAAAA,GAAaC,EAAAA,MAAW,IAAM,kCAC7CC,GAAgBF,EAAAA,EAAAA,GAAaC,EAAAA,MAAW,IAAM,mCAYpD,EAViBE,KAEbC,EAAAA,EAAAA,MAACC,EAAAA,GAAM,CAAAP,SAAA,EACLF,EAAAA,EAAAA,KAACU,EAAAA,GAAK,CAACC,KAAM,IAAKC,SAASZ,EAAAA,EAAAA,KAACG,EAAY,OACxCH,EAAAA,EAAAA,KAACU,EAAAA,GAAK,CAACC,KAAM,cAAeC,SAASZ,EAAAA,EAAAA,KAACM,EAAa,OACnDN,EAAAA,EAAAA,KAACU,EAAAA,GAAK,CAACE,SAASZ,EAAAA,EAAAA,KAACa,EAAAA,EAAY,Q","sources":["screens/Console/Common/Components/withSuspense.tsx","screens/Console/Policies/Policies.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { ComponentType, Suspense, SuspenseProps } from \"react\";\n\nfunction withSuspense

(\n WrappedComponent: ComponentType

,\n fallback: SuspenseProps[\"fallback\"] = null,\n) {\n function ComponentWithSuspense(props: P) {\n return (\n \n \n \n );\n }\n\n return ComponentWithSuspense;\n}\n\nexport default withSuspense;\n","// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Route, Routes } from \"react-router-dom\";\n\nimport NotFoundPage from \"../../NotFoundPage\";\nimport withSuspense from \"../Common/Components/withSuspense\";\n\nconst ListPolicies = withSuspense(React.lazy(() => import(\"./ListPolicies\")));\nconst PolicyDetails = withSuspense(React.lazy(() => import(\"./PolicyDetails\")));\n\nconst Policies = () => {\n return (\n \n } />\n } />\n } />\n \n );\n};\n\nexport default Policies;\n"],"names":["WrappedComponent","fallback","arguments","length","undefined","props","_jsx","Suspense","children","ListPolicies","withSuspense","React","PolicyDetails","Policies","_jsxs","Routes","Route","path","element","NotFoundPage"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/2372.6b4933ca.chunk.js b/web-app/build/static/js/2372.6b4933ca.chunk.js deleted file mode 100644 index 472c9c34c..000000000 --- a/web-app/build/static/js/2372.6b4933ca.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[2372],{71102:(e,t,n)=>{n.d(t,{A:()=>l});var s=n(65043),i=n(89923),a=n(70579);const l=e=>{let{timeStart:t,setTimeStart:n,timeEnd:l,setTimeEnd:o,triggerSync:r,label:c="Filter:",startLabel:d="Start Time:",endLabel:m="End Time:"}=e;return(0,a.jsx)(i.xA9,{item:!0,xs:12,sx:{"& .filter-date-input-label, .end-time-input-label":{display:"none"},"& .MuiInputBase-adornedEnd.filter-date-date-time-input":{width:"100%",border:"1px solid #eaeaea",paddingLeft:"8px",paddingRight:"8px",borderRadius:"1px"},"& .MuiInputAdornment-root button":{height:"20px",width:"20px",marginRight:"5px"},"& .filter-date-input-wrapper":{height:"30px",width:"100%","& .MuiTextField-root":{height:"30px",width:"90%","& input.Mui-disabled":{color:"#000000",WebkitTextFillColor:"#101010"}}}},children:(0,a.jsxs)(i.azJ,{sx:{display:"grid",height:40,alignItems:"center",gridTemplateColumns:"auto 2fr auto",padding:0,[`@media (max-width: ${i.nmC.sm}px)`]:{padding:5},[`@media (max-width: ${i.nmC.md}px)`]:{gridTemplateColumns:"1fr",height:"auto"},gap:"5px"},children:[(0,a.jsx)(i.azJ,{sx:{fontSize:"14px",fontWeight:500,marginRight:"5px"},className:"muted",children:c}),(0,a.jsxs)(i.azJ,{customBorderPadding:"0px",sx:{display:"grid",height:40,alignItems:"center",gridTemplateColumns:"1fr 1fr",gap:"8px",paddingLeft:"8px",paddingRight:"8px",[`@media (max-width: ${i.nmC.md}px)`]:{height:"auto",gridTemplateColumns:"1fr"}},children:[(0,a.jsx)(i.e8j,{value:t,onChange:n,id:"stTime",secondsSelector:!1,pickerStartComponent:(0,a.jsxs)(s.Fragment,{children:[(0,a.jsx)(i.b1c,{}),(0,a.jsx)("span",{children:d})]})}),(0,a.jsx)(i.e8j,{value:l,onChange:o,id:"endTime",secondsSelector:!1,pickerStartComponent:(0,a.jsxs)(s.Fragment,{children:[(0,a.jsx)(i.b1c,{}),(0,a.jsx)("span",{children:m})]})})]}),r&&(0,a.jsx)(i.azJ,{sx:{alignItems:"flex-end",display:"flex",justifyContent:"flex-end"},children:(0,a.jsx)(i.$nd,{id:"sync",type:"button",variant:"callAction",onClick:r,icon:(0,a.jsx)(i.Fjq,{}),label:"Sync"})})]})})}},94141:(e,t,n)=>{n.d(t,{A:()=>d});var s=n(65043),i=n(22166),a=n(89923),l=n(21383),o=n(64159),r=n(49555),c=n(70579);const d=e=>{let{onClose:t,modalOpen:n,title:d,children:m,wideLimit:u=!0,titleIcon:x=null,iconColor:p="default",sx:h}=e;const g=(0,l.jL)(),[j,b]=(0,s.useState)(!1),f=(0,i.d4)((e=>e.system.modalSnackBar));(0,s.useEffect)((()=>{g((0,o.h0)(""))}),[g]),(0,s.useEffect)((()=>{if(f){if(""===f.message)return void b(!1);"error"!==f.type&&b(!0)}}),[f]);let _="";return f&&(_=f.detailedErrorMsg,(""===_||_&&_.length<5)&&(_=f.message)),(0,c.jsxs)(a.ngX,{onClose:t,open:n,title:d,titleIcon:x,widthLimit:u,sx:h,iconColor:p,children:[(0,c.jsx)(r.A,{isModal:!0}),(0,c.jsx)(a.qb_,{onClose:()=>{b(!1),g((0,o.h0)(""))},open:j,message:_,mode:"inline",variant:"error"===f.type?"error":"default",autoHideDuration:"error"===f.type?10:5,condensed:!0}),m]})}},52372:(e,t,n)=>{n.r(t),n.d(t,{default:()=>A});var s=n(65043),i=n(33097),a=n.n(i),l=n(22166),o=n(89923),r=n(56483);const c={time:"Timestamp",api_name:"API Name",access_key:"Access Key",bucket:"Bucket",object:"Object",remote_host:"Remote Host",request_id:"Request ID",user_agent:"User Agent",response_status:"Response Status",response_status_code:"Response Status Code",request_content_length:"Request Content Length",response_content_length:"Response Content Length",time_to_response_ns:"Time to Response NS"};var d=n(99161),m=n(64159),u=n(46537),x=n(21383),p=n(77938),h=n(20649),g=n(70579);const j=e=>{let{label:t,onChange:n,value:i,placeholder:a="",id:l,name:r}=e;return(0,g.jsx)(s.Fragment,{children:(0,g.jsxs)(o.azJ,{sx:{flexGrow:1,margin:"0 15px"},children:[(0,g.jsx)(o.l1Y,{children:t}),(0,g.jsx)(o.cl_,{placeholder:a,id:l,name:r,label:"",onChange:e=>{n(e.target.value)},sx:{"& input":{height:30}},value:i})]})})};var b=n(94141);const f=e=>{let{modalOpen:t,logSearchElement:n,onClose:i}=e;const l=Object.keys(n);return(0,g.jsx)(s.Fragment,{children:(0,g.jsx)(b.A,{modalOpen:t,title:"Full Log Information",onClose:()=>{i()},children:(0,g.jsxs)(o.xA9,{container:!0,children:[(0,g.jsx)(o.xA9,{item:!0,xs:12,children:(0,g.jsx)("table",{children:(0,g.jsx)("tbody",{children:l.map(((e,t)=>(0,g.jsxs)("tr",{children:[(0,g.jsx)("th",{style:{fontWeight:700,paddingRight:"10px",textAlign:"left"},children:a()(c,e,`${e}`)}),(0,g.jsx)("td",{children:a()(n,e,"")})]},`logSearch-${t.toString()}`)))})})}),(0,g.jsx)(o.xA9,{item:!0,xs:12,sx:{display:"flex",justifyContent:"flex-end"},children:(0,g.jsx)(o.$nd,{id:"close-log-search",variant:"callAction",color:"primary",onClick:i,label:"Close"})})]})})})};var _=n(71102);const C=e=>{let{iconComponent:t,entity:n,documentationLink:i}=e;return(0,g.jsx)(o.xA9,{container:!0,sx:{justifyContent:"center",alignContent:"center",alignItems:"center"},children:(0,g.jsx)(o.xA9,{item:!0,xs:8,children:(0,g.jsx)(o.lVp,{title:`${n} not available`,iconComponent:t,help:(0,g.jsxs)(s.Fragment,{children:["This feature is not available.",(0,g.jsx)("br",{}),"Please configure"," ",(0,g.jsx)("a",{href:i,target:"_blank",rel:"noopener",children:n})," ","first to use this feature."]})})})})};var y=n(48793),S=n(88617);const k={display:"flex",justifyContent:"space-between",marginBottom:12},A=()=>{const e=(0,x.jL)(),t=(0,l.d4)(u.s$),[n,i]=(0,s.useState)(!0),[b,A]=(0,s.useState)(null),[v,$]=(0,s.useState)(null),[w,E]=(0,s.useState)(!1),[T,F]=(0,s.useState)([]),[I,L]=(0,s.useState)(""),[q,R]=(0,s.useState)(""),[z,K]=(0,s.useState)(""),[O,J]=(0,s.useState)(""),[B,M]=(0,s.useState)(""),[D,N]=(0,s.useState)(""),[P,H]=(0,s.useState)(""),[W,U]=(0,s.useState)("DESC"),[G,Y]=(0,s.useState)(["time","api_name","access_key","bucket","object","remote_host","request_id","user_agent","response_status"]),[V,Q]=(0,s.useState)(0),[X,Z]=(0,s.useState)(!1),[ee,te]=(0,s.useState)(!1),[ne,se]=(0,s.useState)(null);let ie=null;const ae=t&&t.includes("log-search"),le=(0,s.useCallback)((()=>{if(!X&&ae){Z(!0);let t=`${""!==I?`&fp=bucket:${I}`:""}${""!==B?`&fp=object:${B}`:""}${""!==q?`&fp=api_name:${q}`:""}${""!==z?`&fp=access_key:${z}`:""}${""!==D?`&fp=request_id:${D}`:""}${""!==O?`&fp=user_agent:${O}`:""}${""!==P?`&fp=response_status:${P}`:""}`;t=t.trim(),t.endsWith(",")&&(t=t.slice(0,-1)),h.A.invoke("GET",`/api/v1/logs/search?q=reqinfo${""!==t?`${t}`:""}&pageSize=100&pageNo=${V}&order=${"DESC"===W?"timeDesc":"timeAsc"}${null!==b?`&timeStart=${b.toUTC().toISO()}`:""}${null!==v?`&timeEnd=${v.toUTC().toISO()}`:""}`).then((e=>{const t=e.results||[];i(!1),Z(!1),F(t),Q(V+1),null!==ie&&ie()})).catch((t=>{i(!1),Z(!1),e((0,m.C9)(t))}))}else i(!1),Z(!1)}),[X,ae,I,B,q,z,D,O,P,V,W,b,v,ie,e]);(0,s.useEffect)((()=>{n&&(F([]),le())}),[n,W,le]);return(0,s.useEffect)((()=>{e((0,m.ph)("audit_logs"))}),[]),(0,g.jsxs)(s.Fragment,{children:[ee&&null!==ne&&(0,g.jsx)(f,{logSearchElement:ne,modalOpen:ee,onClose:()=>{se(null),te(!1)}}),(0,g.jsx)(y.A,{label:"Audit Logs",actions:(0,g.jsx)(S.A,{})}),(0,g.jsx)(o.Mxu,{children:ae?(0,g.jsxs)(s.Fragment,{children:[" ",(0,g.jsxs)(o.azJ,{withBorders:!0,sx:{marginBottom:15},children:[(0,g.jsxs)(o.xA9,{item:!0,xs:12,sx:{display:"flex",padding:15,[`@media (max-width: ${o.nmC.lg}px)`]:{flexFlow:"column"}},children:[(0,g.jsx)(o.azJ,{children:(0,g.jsx)(_.A,{setTimeEnd:e=>$(e),setTimeStart:e=>A(e),timeEnd:v,timeStart:b})}),(0,g.jsx)(o.azJ,{sx:{display:"flex",alignItems:"center"},children:(0,g.jsx)(o.J2w,{label:(w?"Hide":"Show")+" advanced Filters",open:w,onClick:()=>{E(!w)}})})]}),(0,g.jsxs)(o.xA9,{item:!0,xs:12,sx:{display:w?"block":"none",overflowY:"hidden",marginBottom:w?12:0},children:[(0,g.jsxs)(o.azJ,{sx:{marginLeft:15,marginBottom:15,fontSize:12,color:"#9C9C9C"},children:["Enable your preferred options to get filtered records.",(0,g.jsx)("br",{}),"You can use '*' to match any character, '.' to signify a single character or '\\' to scape an special character (E.g. mybucket-*)"]}),(0,g.jsxs)(o.azJ,{sx:k,children:[(0,g.jsx)(j,{onChange:L,value:I,label:"Bucket",id:"bucket",name:"bucket"}),(0,g.jsx)(j,{onChange:R,value:q,label:"API Name",id:"api_name",name:"api_name"}),(0,g.jsx)(j,{onChange:K,value:z,label:"Access Key",id:"access_key",name:"access_key"}),(0,g.jsx)(j,{onChange:J,value:O,label:"User Agent",id:"user_agent",name:"user_agent"})]}),(0,g.jsxs)(o.azJ,{sx:k,children:[(0,g.jsx)(j,{onChange:M,value:B,label:"Object",id:"object",name:"object"}),(0,g.jsx)(j,{onChange:N,value:D,label:"Request ID",id:"request_id",name:"request_id"}),(0,g.jsx)(j,{onChange:H,value:P,label:"Response Status",id:"response_status",name:"response_status"})]})]}),(0,g.jsx)(o.xA9,{item:!0,xs:12,sx:{marginBottom:15,padding:"0 15px 0 15px",display:"flex",alignItems:"center",justifyContent:"flex-end"},children:(0,g.jsx)(o.$nd,{id:"get-information",type:"button",variant:"callAction",onClick:()=>{Q(0),i(!0)},label:"Get Information"})})]}),(0,g.jsx)(o.xA9,{item:!0,xs:12,children:(0,g.jsx)(p.R,{scopes:[d.OV.ADMIN_HEALTH_INFO],resource:d.Ms,errorProps:{disabled:!0},children:(0,g.jsx)(o.bQt,{columns:[{label:c.time,elementKey:"time",enableSort:!0},{label:c.api_name,elementKey:"api_name"},{label:c.access_key,elementKey:"access_key"},{label:c.bucket,elementKey:"bucket"},{label:c.object,elementKey:"object"},{label:c.remote_host,elementKey:"remote_host"},{label:c.request_id,elementKey:"request_id"},{label:c.user_agent,elementKey:"user_agent"},{label:c.response_status,elementKey:"response_status",renderFunction:e=>(0,g.jsx)(s.Fragment,{children:(0,g.jsxs)("span",{children:[e.response_status_code," (",e.response_status,")"]})}),renderFullObject:!0},{label:c.request_content_length,elementKey:"request_content_length",renderFunction:r.nO},{label:c.response_content_length,elementKey:"response_content_length",renderFunction:r.nO},{label:c.time_to_response_ns,elementKey:"time_to_response_ns",renderFunction:r.Wi,contentTextAlign:"right"}],isLoading:n,records:T,entityName:"Logs",customEmptyMessage:"There is no information with this criteria",idField:"request_id",columnsSelector:!0,columnsShown:G,onColumnChange:e=>{let t;t=G.findIndex((t=>t===e))>=0?G.filter((t=>t!==e)):[...G,e],Y(t)},customPaperHeight:w?"calc(100vh - 520px)":"calc(100vh - 320px)",sortEnabled:{currentSort:"time",currentDirection:W,onSortClick:e=>{const t=a()(e,"sortDirection","DESC");U(t),Q(0),i(!0)}},infiniteScrollConfig:{recordsCount:1e6,loadMoreRecords:e=>(le(),new Promise((e=>{ie=e})))},itemActions:[{type:"view",onClick:e=>{se(e),te(!0)}}],textSelectable:!0})})})]}):(0,g.jsx)(C,{entity:"Audit Logs",iconComponent:(0,g.jsx)(o.WIv,{}),documentationLink:"https://min.io/docs/minio/windows/operations/monitoring/minio-logging.html?ref=con"})})]})}}}]); -//# sourceMappingURL=2372.6b4933ca.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/2372.6b4933ca.chunk.js.map b/web-app/build/static/js/2372.6b4933ca.chunk.js.map deleted file mode 100644 index cc87fe791..000000000 --- a/web-app/build/static/js/2372.6b4933ca.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"static/js/2372.6b4933ca.chunk.js","mappings":"yJAuCA,MAuIA,EAvI0BA,IASC,IATA,UACzBC,EAAS,aACTC,EAAY,QACZC,EAAO,WACPC,EAAU,YACVC,EAAW,MACXC,EAAQ,UAAS,WACjBC,EAAa,cAAa,SAC1BC,EAAW,aACQR,EACnB,OACES,EAAAA,EAAAA,KAACC,EAAAA,IAAI,CACHC,MAAI,EACJC,GAAI,GACJC,GAAI,CACF,oDAAqD,CACnDC,QAAS,QAEX,yDAA0D,CACxDC,MAAO,OACPC,OAAQ,oBACRC,YAAa,MACbC,aAAc,MACdC,aAAc,OAGhB,mCAAoC,CAClCC,OAAQ,OACRL,MAAO,OACPM,YAAa,OAEf,+BAAgC,CAC9BD,OAAQ,OACRL,MAAO,OAEP,uBAAwB,CACtBK,OAAQ,OACRL,MAAO,MAEP,uBAAwB,CACtBO,MAAO,UACPC,oBAAqB,cAI3BC,UAEFC,EAAAA,EAAAA,MAACC,EAAAA,IAAG,CACFb,GAAI,CACFC,QAAS,OACTM,OAAQ,GACRO,WAAY,SACZC,oBAAqB,gBACrBC,QAAS,EACT,CAAC,sBAAsBC,EAAAA,IAAYC,SAAU,CAC3CF,QAAS,GAEX,CAAC,sBAAsBC,EAAAA,IAAYE,SAAU,CAC3CJ,oBAAqB,MACrBR,OAAQ,QAEVa,IAAK,OACLT,SAAA,EAEFf,EAAAA,EAAAA,KA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7E,EAAY,GACZtB,GAAW,EAAK,GAuQFoG,qBAAsB,CACpBC,aAAc,IACdC,gBAtQOC,IACvBvE,KACO,IAAIwE,SAASC,IAClB5E,GAAc4E,CAAO,MAqQTC,YAAa,CACX,CACE/L,KAAM,OACNE,QApQUvC,IAC5BsJ,GAAgBtJ,GAChBoJ,IAAuB,EAAK,IAqQdiF,gBAAc,YA1OtBvO,EAAAA,EAAAA,KAACwO,EAAkB,CACjBzH,OAAQ,aACRD,eAAe9G,EAAAA,EAAAA,KAACyO,EAAAA,IAAU,IAC1BzH,kBAAkB,2FA8Of,C","sources":["screens/Console/Common/FormComponents/DateRangeSelector/DateRangeSelector.tsx","screens/Console/Common/ModalWrapper/ModalWrapper.tsx","screens/Console/Logs/LogSearch/utils.ts","screens/Console/Common/FormComponents/FilterInputWrapper/FilterInputWrapper.tsx","screens/Console/Logs/LogSearch/LogSearchFullModal.tsx","screens/Console/Common/MissingIntegration/MissingIntegration.tsx","screens/Console/Logs/LogSearch/LogsSearchMain.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport {\n Button,\n SyncIcon,\n Grid,\n Box,\n breakPoints,\n TimeIcon,\n DateTimeInput,\n} from \"mds\";\nimport { DateTime } from \"luxon\";\n\ninterface IDateRangeSelector {\n timeStart: DateTime | null;\n setTimeStart: (value: DateTime | null) => void;\n timeEnd: DateTime | null;\n setTimeEnd: (value: DateTime | null) => void;\n triggerSync?: () => void;\n label?: string;\n startLabel?: string;\n endLabel?: string;\n}\n\nconst DateRangeSelector = ({\n timeStart,\n setTimeStart,\n timeEnd,\n setTimeEnd,\n triggerSync,\n label = \"Filter:\",\n startLabel = \"Start Time:\",\n endLabel = \"End Time:\",\n}: IDateRangeSelector) => {\n return (\n \n \n \n {label}\n \n \n \n \n {startLabel}\n \n }\n />\n \n \n {endLabel}\n \n }\n />\n \n\n {triggerSync && (\n \n }\n label={\"Sync\"}\n />\n \n )}\n \n \n );\n};\n\nexport default DateRangeSelector;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { ModalBox, Snackbar } from \"mds\";\nimport { CSSObject } from \"styled-components\";\nimport { AppState, useAppDispatch } from \"../../../../store\";\nimport { setModalSnackMessage } from \"../../../../systemSlice\";\nimport MainError from \"../MainError/MainError\";\n\ninterface IModalProps {\n onClose: () => void;\n modalOpen: boolean;\n title: string | React.ReactNode;\n children: any;\n wideLimit?: boolean;\n titleIcon?: React.ReactNode;\n iconColor?: \"default\" | \"delete\" | \"accept\";\n sx?: CSSObject;\n}\n\nconst ModalWrapper = ({\n onClose,\n modalOpen,\n title,\n children,\n wideLimit = true,\n titleIcon = null,\n iconColor = \"default\",\n sx,\n}: IModalProps) => {\n const dispatch = useAppDispatch();\n const [openSnackbar, setOpenSnackbar] = useState(false);\n\n const modalSnackMessage = useSelector(\n (state: AppState) => state.system.modalSnackBar,\n );\n\n useEffect(() => {\n dispatch(setModalSnackMessage(\"\"));\n }, [dispatch]);\n\n useEffect(() => {\n if (modalSnackMessage) {\n if (modalSnackMessage.message === \"\") {\n setOpenSnackbar(false);\n return;\n }\n // Open SnackBar\n if (modalSnackMessage.type !== \"error\") {\n setOpenSnackbar(true);\n }\n }\n }, [modalSnackMessage]);\n\n const closeSnackBar = () => {\n setOpenSnackbar(false);\n dispatch(setModalSnackMessage(\"\"));\n };\n\n let message = \"\";\n\n if (modalSnackMessage) {\n message = modalSnackMessage.detailedErrorMsg;\n if (message === \"\" || (message && message.length < 5)) {\n message = modalSnackMessage.message;\n }\n }\n\n return (\n \n \n \n {children}\n \n );\n};\n\nexport default ModalWrapper;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nexport const LogSearchColumnLabels = {\n time: \"Timestamp\",\n api_name: \"API Name\",\n access_key: \"Access Key\",\n bucket: \"Bucket\",\n object: \"Object\",\n remote_host: \"Remote Host\",\n request_id: \"Request ID\",\n user_agent: \"User Agent\",\n response_status: \"Response Status\",\n response_status_code: \"Response Status Code\",\n request_content_length: \"Request Content Length\",\n response_content_length: \"Response Content Length\",\n time_to_response_ns: \"Time to Response NS\",\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport { InputBox, InputLabel, Box } from \"mds\";\n\ninterface IFilterInputWrapper {\n value: string;\n onChange: (txtVar: string) => any;\n label: string;\n placeholder?: string;\n id: string;\n name: string;\n}\n\nconst FilterInputWrapper = ({\n label,\n onChange,\n value,\n placeholder = \"\",\n id,\n name,\n}: IFilterInputWrapper) => {\n return (\n \n \n {label}\n {\n onChange(val.target.value);\n }}\n sx={{\n \"& input\": {\n height: 30,\n },\n }}\n value={value}\n />\n \n \n );\n};\n\nexport default FilterInputWrapper;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport { Button, Grid } from \"mds\";\nimport get from \"lodash/get\";\nimport ModalWrapper from \"../../Common/ModalWrapper/ModalWrapper\";\nimport { IReqInfoSearchResults } from \"./types\";\nimport { LogSearchColumnLabels } from \"./utils\";\n\ninterface ILogSearchFullModal {\n modalOpen: boolean;\n logSearchElement: IReqInfoSearchResults;\n onClose: () => void;\n}\n\nconst LogSearchFullModal = ({\n modalOpen,\n logSearchElement,\n onClose,\n}: ILogSearchFullModal) => {\n const jsonItems = Object.keys(logSearchElement);\n\n return (\n \n {\n onClose();\n }}\n >\n \n \n \n \n {jsonItems.map((objectKey: string, index: number) => (\n \n \n {get(LogSearchColumnLabels, objectKey, `${objectKey}`)}\n \n \n \n ))}\n \n
{get(logSearchElement, objectKey, \"\")}
\n
\n \n \n
\n \n \n
\n );\n};\n\nexport default LogSearchFullModal;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport { HelpBox, Grid } from \"mds\";\n\ninterface IMissingIntegration {\n iconComponent: any;\n entity: string;\n documentationLink: string;\n}\n\nconst MissingIntegration = ({\n iconComponent,\n entity,\n documentationLink,\n}: IMissingIntegration) => {\n return (\n \n \n \n This feature is not available.\n
\n Please configure{\" \"}\n \n {entity}\n {\" \"}\n first to use this feature.\n \n }\n />\n
\n \n );\n};\n\nexport default MissingIntegration;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useCallback, useEffect, useState } from \"react\";\nimport get from \"lodash/get\";\nimport { useSelector } from \"react-redux\";\nimport { CSSObject } from \"styled-components\";\nimport {\n Box,\n breakPoints,\n Button,\n DataTable,\n ExpandOptionsButton,\n Grid,\n PageLayout,\n SearchIcon,\n} from \"mds\";\nimport { DateTime } from \"luxon\";\nimport { IReqInfoSearchResults, ISearchResponse } from \"./types\";\nimport { niceBytes, nsToSeconds } from \"../../../../common/utils\";\nimport { ErrorResponseHandler } from \"../../../../common/types\";\nimport { LogSearchColumnLabels } from \"./utils\";\nimport {\n CONSOLE_UI_RESOURCE,\n IAM_SCOPES,\n} from \"../../../../common/SecureComponent/permissions\";\nimport { setErrorSnackMessage, setHelpName } from \"../../../../systemSlice\";\nimport { selFeatures } from \"../../consoleSlice\";\nimport { useAppDispatch } from \"../../../../store\";\nimport { SecureComponent } from \"../../../../common/SecureComponent\";\nimport api from \"../../../../common/api\";\nimport FilterInputWrapper from \"../../Common/FormComponents/FilterInputWrapper/FilterInputWrapper\";\nimport LogSearchFullModal from \"./LogSearchFullModal\";\nimport DateRangeSelector from \"../../Common/FormComponents/DateRangeSelector/DateRangeSelector\";\nimport MissingIntegration from \"../../Common/MissingIntegration/MissingIntegration\";\nimport PageHeaderWrapper from \"../../Common/PageHeaderWrapper/PageHeaderWrapper\";\nimport HelpMenu from \"../../HelpMenu\";\n\nconst filtersContainer: CSSObject = {\n display: \"flex\",\n justifyContent: \"space-between\",\n marginBottom: 12,\n};\n\nconst LogsSearchMain = () => {\n const dispatch = useAppDispatch();\n const features = useSelector(selFeatures);\n\n const [loading, setLoading] = useState(true);\n const [timeStart, setTimeStart] = useState(null);\n const [timeEnd, setTimeEnd] = useState(null);\n const [filterOpen, setFilterOpen] = useState(false);\n const [records, setRecords] = useState([]);\n const [bucket, setBucket] = useState(\"\");\n const [apiName, setApiName] = useState(\"\");\n const [accessKey, setAccessKey] = useState(\"\");\n const [userAgent, setUserAgent] = useState(\"\");\n const [object, setObject] = useState(\"\");\n const [requestID, setRequestID] = useState(\"\");\n const [responseStatus, setResponseStatus] = useState(\"\");\n const [sortOrder, setSortOrder] = useState<\"ASC\" | \"DESC\" | undefined>(\n \"DESC\",\n );\n const [columnsShown, setColumnsShown] = useState([\n \"time\",\n \"api_name\",\n \"access_key\",\n \"bucket\",\n \"object\",\n \"remote_host\",\n \"request_id\",\n \"user_agent\",\n \"response_status\",\n ]);\n const [nextPage, setNextPage] = useState(0);\n const [alreadyFetching, setAlreadyFetching] = useState(false);\n const [logSearchExtrasOpen, setLogSearchExtrasOpen] =\n useState(false);\n const [selectedItem, setSelectedItem] =\n useState(null);\n\n let recordsResp: any = null;\n const logSearchEnabled = features && features.includes(\"log-search\");\n\n const fetchRecords = useCallback(() => {\n if (!alreadyFetching && logSearchEnabled) {\n setAlreadyFetching(true);\n let queryParams = `${bucket !== \"\" ? `&fp=bucket:${bucket}` : \"\"}${\n object !== \"\" ? `&fp=object:${object}` : \"\"\n }${apiName !== \"\" ? `&fp=api_name:${apiName}` : \"\"}${\n accessKey !== \"\" ? `&fp=access_key:${accessKey}` : \"\"\n }${requestID !== \"\" ? `&fp=request_id:${requestID}` : \"\"}${\n userAgent !== \"\" ? `&fp=user_agent:${userAgent}` : \"\"\n }${responseStatus !== \"\" ? `&fp=response_status:${responseStatus}` : \"\"}`;\n\n queryParams = queryParams.trim();\n\n if (queryParams.endsWith(\",\")) {\n queryParams = queryParams.slice(0, -1);\n }\n\n api\n .invoke(\n \"GET\",\n `/api/v1/logs/search?q=reqinfo${\n queryParams !== \"\" ? `${queryParams}` : \"\"\n }&pageSize=100&pageNo=${nextPage}&order=${\n sortOrder === \"DESC\" ? \"timeDesc\" : \"timeAsc\"\n }${\n timeStart !== null ? `&timeStart=${timeStart.toUTC().toISO()}` : \"\"\n }${timeEnd !== null ? `&timeEnd=${timeEnd.toUTC().toISO()}` : \"\"}`,\n )\n .then((res: ISearchResponse) => {\n const fetchedResults = res.results || [];\n\n setLoading(false);\n setAlreadyFetching(false);\n setRecords(fetchedResults);\n setNextPage(nextPage + 1);\n\n if (recordsResp !== null) {\n recordsResp();\n }\n })\n .catch((err: ErrorResponseHandler) => {\n setLoading(false);\n setAlreadyFetching(false);\n dispatch(setErrorSnackMessage(err));\n });\n } else {\n setLoading(false);\n setAlreadyFetching(false);\n }\n }, [\n alreadyFetching,\n logSearchEnabled,\n bucket,\n object,\n apiName,\n accessKey,\n requestID,\n userAgent,\n responseStatus,\n nextPage,\n sortOrder,\n timeStart,\n timeEnd,\n recordsResp,\n dispatch,\n ]);\n\n useEffect(() => {\n if (loading) {\n setRecords([]);\n fetchRecords();\n }\n }, [loading, sortOrder, fetchRecords]);\n\n const triggerLoad = () => {\n setNextPage(0);\n setLoading(true);\n };\n\n const selectColumn = (colID: string) => {\n let newArray: string[];\n\n const columnShown = columnsShown.findIndex((item) => item === colID);\n\n // Column Exist, We remove from Array\n if (columnShown >= 0) {\n newArray = columnsShown.filter((element) => element !== colID);\n } else {\n // Column not visible, we include it in the array\n newArray = [...columnsShown, colID];\n }\n\n setColumnsShown(newArray);\n };\n\n const sortChange = (sortData: any) => {\n const newSortDirection = get(sortData, \"sortDirection\", \"DESC\");\n setSortOrder(newSortDirection);\n setNextPage(0);\n setLoading(true);\n };\n\n const loadMoreRecords = (_: { startIndex: number; stopIndex: number }) => {\n fetchRecords();\n return new Promise((resolve) => {\n recordsResp = resolve;\n });\n };\n\n const openExtraInformation = (item: IReqInfoSearchResults) => {\n setSelectedItem(item);\n setLogSearchExtrasOpen(true);\n };\n\n const closeViewExtraInformation = () => {\n setSelectedItem(null);\n setLogSearchExtrasOpen(false);\n };\n\n useEffect(() => {\n dispatch(setHelpName(\"audit_logs\"));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n \n {logSearchExtrasOpen && selectedItem !== null && (\n \n )}\n\n } />\n\n \n {!logSearchEnabled ? (\n }\n documentationLink=\"https://min.io/docs/minio/windows/operations/monitoring/minio-logging.html?ref=con\"\n />\n ) : (\n \n {\" \"}\n \n \n \n setTimeEnd(time)}\n setTimeStart={(time) => setTimeStart(time)}\n timeEnd={timeEnd}\n timeStart={timeStart}\n />\n \n \n {\n setFilterOpen(!filterOpen);\n }}\n />\n \n \n \n \n Enable your preferred options to get filtered records.\n
\n You can use '*' to match any character, '.' to signify a\n single character or '\\' to scape an special character (E.g.\n mybucket-*)\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n (\n \n \n {element.response_status_code} (\n {element.response_status})\n \n \n ),\n renderFullObject: true,\n },\n {\n label: LogSearchColumnLabels.request_content_length,\n elementKey: \"request_content_length\",\n renderFunction: niceBytes,\n },\n {\n label: LogSearchColumnLabels.response_content_length,\n elementKey: \"response_content_length\",\n renderFunction: niceBytes,\n },\n {\n label: LogSearchColumnLabels.time_to_response_ns,\n elementKey: \"time_to_response_ns\",\n renderFunction: nsToSeconds,\n contentTextAlign: \"right\",\n },\n ]}\n isLoading={loading}\n records={records}\n entityName=\"Logs\"\n customEmptyMessage={\n \"There is no information with this criteria\"\n }\n idField=\"request_id\"\n columnsSelector\n columnsShown={columnsShown}\n onColumnChange={selectColumn}\n customPaperHeight={\n filterOpen ? \"calc(100vh - 520px)\" : \"calc(100vh - 320px)\"\n }\n sortEnabled={{\n currentSort: \"time\",\n currentDirection: sortOrder,\n onSortClick: sortChange,\n }}\n infiniteScrollConfig={{\n recordsCount: 1000000,\n loadMoreRecords: loadMoreRecords,\n }}\n itemActions={[\n {\n type: \"view\",\n onClick: openExtraInformation,\n },\n ]}\n textSelectable\n />\n \n \n
\n )}\n
\n
\n );\n};\n\nexport default LogsSearchMain;\n"],"names":["_ref","timeStart","setTimeStart","timeEnd","setTimeEnd","triggerSync","label","startLabel","endLabel","_jsx","Grid","item","xs","sx","display","width","border","paddingLeft","paddingRight","borderRadius","height","marginRight","color","WebkitTextFillColor","children","_jsxs","Box","alignItems","gridTemplateColumns","padding","breakPoints","sm","md","gap","fontSize","fontWeight","className","customBorderPadding","DateTimeInput","value","onChange","id","secondsSelector","pickerStartComponent","Fragment","TimeIcon","justifyContent","Button","type","variant","onClick","icon","SyncIcon","onClose","modalOpen","title","wideLimit","titleIcon","iconColor","dispatch","useAppDispatch","openSnackbar","setOpenSnackbar","useState","modalSnackMessage","useSelector","state","system","modalSnackBar","useEffect","setModalSnackMessage","message","detailedErrorMsg","length","ModalBox","open","widthLimit","MainError","isModal","Snackbar","closeSnackBar","mode","autoHideDuration","condensed","LogSearchColumnLabels","time","api_name","access_key","bucket","object","remote_host","request_id","user_agent","response_status","response_status_code","request_content_length","response_content_length","time_to_response_ns","placeholder","name","flexGrow","margin","InputLabel","InputBox","val","target","logSearchElement","jsonItems","Object","keys","ModalWrapper","container","map","objectKey","index","style","textAlign","get","toString","iconComponent","entity","documentationLink","alignContent","HelpBox","help","href","rel","filtersContainer","marginBottom","LogsSearchMain","features","selFeatures","loading","setLoading","filterOpen","setFilterOpen","records","setRecords","setBucket","apiName","setApiName","accessKey","setAccessKey","userAgent","setUserAgent","setObject","requestID","setRequestID","responseStatus","setResponseStatus","sortOrder","setSortOrder","columnsShown","setColumnsShown","nextPage","setNextPage","alreadyFetching","setAlreadyFetching","logSearchExtrasOpen","setLogSearchExtrasOpen","selectedItem","setSelectedItem","recordsResp","logSearchEnabled","includes","fetchRecords","useCallback","queryParams","trim","endsWith","slice","api","invoke","toUTC","toISO","then","res","fetchedResults","results","catch","err","setErrorSnackMessage","setHelpName","LogSearchFullModal","closeViewExtraInformation","PageHeaderWrapper","actions","HelpMenu","PageLayout","withBorders","lg","flexFlow","DateRangeSelector","ExpandOptionsButton","overflowY","marginLeft","FilterInputWrapper","triggerLoad","SecureComponent","scopes","IAM_SCOPES","ADMIN_HEALTH_INFO","resource","CONSOLE_UI_RESOURCE","errorProps","disabled","DataTable","columns","elementKey","enableSort","renderFunction","element","renderFullObject","niceBytes","nsToSeconds","contentTextAlign","isLoading","entityName","customEmptyMessage","idField","columnsSelector","onColumnChange","colID","newArray","findIndex","filter","customPaperHeight","sortEnabled","currentSort","currentDirection","onSortClick","sortData","newSortDirection","infiniteScrollConfig","recordsCount","loadMoreRecords","_","Promise","resolve","itemActions","textSelectable","MissingIntegration","SearchIcon"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/24.e576918a.chunk.js b/web-app/build/static/js/24.e576918a.chunk.js deleted file mode 100644 index e8df8f7c7..000000000 --- a/web-app/build/static/js/24.e576918a.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[24],{60024:(e,s,t)=>{t.r(s),t.d(s,{default:()=>h});var r=t(65043),l=t(89923),a=t(77403),n=t(20649),o=t(13109),d=t(94141),i=t(64159),c=t(21383),u=t(70579);const h=e=>{let{open:s,checkedUsers:t,closeModalAndRefresh:h}=e;const p=(0,c.jL)(),[x,j]=(0,r.useState)(!1),[b,g]=(0,r.useState)(!1),[m,f]=(0,r.useState)([]);(0,r.useEffect)((()=>{x&&(m.length>0?n.A.invoke("PUT","/api/v1/users-groups-bulk",{groups:m,users:t}).then((()=>{j(!1),g(!0)})).catch((e=>{j(!1),p((0,i.Dy)(e))})):(j(!1),p((0,i.Dy)({errorMessage:"You need to select at least one group to assign",detailedError:""}))))}),[x,j,h,m,t,p]);return(0,u.jsx)(d.A,{modalOpen:s,onClose:()=>{h(b)},title:b?"The selected users were added to the following groups.":"Add Users to Group",titleIcon:(0,u.jsx)(l.WC,{}),children:b?(0,u.jsx)(r.Fragment,{children:(0,u.jsxs)(l.Hbc,{withBorders:!1,containerPadding:!1,sx:{margin:"30px 0"},children:[(0,u.jsx)(l.EmB,{label:"Groups",sx:{width:"100%"},children:m.join(", ")}),(0,u.jsxs)(l.EmB,{label:"Users",sx:{width:"100%"},children:[" ",t.join(", ")," "]})]})}):(0,u.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{e.preventDefault(),j(!0)},children:[(0,u.jsxs)(l.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,u.jsx)(l.EmB,{label:"Selected Users",sx:{width:"100%"},children:t.join(", ")}),(0,u.jsx)(o.A,{selectedGroups:m,setSelectedGroups:f})]}),(0,u.jsxs)(l.xA9,{item:!0,xs:12,sx:a.Uz.modalButtonBar,children:[(0,u.jsx)(l.$nd,{id:"clear-bulk-add-group",type:"button",variant:"regular",color:"primary",onClick:()=>{f([])},label:"Clear"}),(0,u.jsx)(l.$nd,{id:"save-add-group",type:"submit",variant:"callAction",disabled:x||m.length<1,label:"Save"})]}),x&&(0,u.jsx)(l.xA9,{item:!0,xs:12,children:(0,u.jsx)(l.z21,{})})]})})}}}]); -//# sourceMappingURL=24.e576918a.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/24.e576918a.chunk.js.map b/web-app/build/static/js/24.e576918a.chunk.js.map deleted file mode 100644 index 0b4c37ccf..000000000 --- a/web-app/build/static/js/24.e576918a.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"static/js/24.e576918a.chunk.js","mappings":"sOAwCA,MA8HA,EA9HuBA,IAIH,IAJI,KACtBC,EAAI,aACJC,EAAY,qBACZC,GACYH,EACZ,MAAMI,GAAWC,EAAAA,EAAAA,OAEVC,EAAQC,IAAYC,EAAAA,EAAAA,WAAkB,IACtCC,EAAUC,IAAeF,EAAAA,EAAAA,WAAkB,IAC3CG,EAAgBC,IAAqBJ,EAAAA,EAAAA,UAAmB,KAG/DK,EAAAA,EAAAA,YAAU,KACJP,IACEK,EAAeG,OAAS,EAC1BC,EAAAA,EACGC,OAAO,MAAO,4BAA6B,CAC1CC,OAAQN,EACRO,MAAOhB,IAERiB,MAAK,KACJZ,GAAS,GACTG,GAAY,EAAK,IAElBU,OAAOC,IACNd,GAAS,GACTH,GAASkB,EAAAA,EAAAA,IAA0BD,GAAK,KAG5Cd,GAAS,GACTH,GACEkB,EAAAA,EAAAA,IAA0B,CACxBC,aAAc,kDACdC,cAAe,OAIvB,GACC,CACDlB,EACAC,EACAJ,EACAQ,EACAT,EACAE,IAcF,OACEqB,EAAAA,EAAAA,KAACC,EAAAA,EAAY,CACXC,UAAW1B,EACX2B,QAASA,KACPzB,EAAqBM,EAAS,EAEhCoB,MACEpB,EACI,yDACA,qBAENqB,WAAWL,EAAAA,EAAAA,KAACM,EAAAA,GAAqB,IAAIC,SAEpCvB,GACCgB,EAAAA,EAAAA,KAACQ,EAAAA,SAAc,CA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sC,EAAAA,IAAW,UAKP,C","sources":["screens/Console/Users/BulkAddToGroup.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState } from \"react\";\nimport {\n AddMembersToGroupIcon,\n Button,\n FormLayout,\n Grid,\n ProgressBar,\n ReadBox,\n} from \"mds\";\n\nimport { modalStyleUtils } from \"../Common/FormComponents/common/styleLibrary\";\nimport { ErrorResponseHandler } from \"../../../common/types\";\nimport api from \"../../../common/api\";\nimport GroupsSelectors from \"./GroupsSelectors\";\nimport ModalWrapper from \"../Common/ModalWrapper/ModalWrapper\";\nimport { setModalErrorSnackMessage } from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\n\ninterface IAddToGroup {\n open: boolean;\n checkedUsers: any;\n closeModalAndRefresh: any;\n}\n\nconst BulkAddToGroup = ({\n open,\n checkedUsers,\n closeModalAndRefresh,\n}: IAddToGroup) => {\n const dispatch = useAppDispatch();\n //Local States\n const [saving, isSaving] = useState(false);\n const [accepted, setAccepted] = useState(false);\n const [selectedGroups, setSelectedGroups] = useState([]);\n\n //Effects\n useEffect(() => {\n if (saving) {\n if (selectedGroups.length > 0) {\n api\n .invoke(\"PUT\", \"/api/v1/users-groups-bulk\", {\n groups: selectedGroups,\n users: checkedUsers,\n })\n .then(() => {\n isSaving(false);\n setAccepted(true);\n })\n .catch((err: ErrorResponseHandler) => {\n isSaving(false);\n dispatch(setModalErrorSnackMessage(err));\n });\n } else {\n isSaving(false);\n dispatch(\n setModalErrorSnackMessage({\n errorMessage: \"You need to select at least one group to assign\",\n detailedError: \"\",\n }),\n );\n }\n }\n }, [\n saving,\n isSaving,\n closeModalAndRefresh,\n selectedGroups,\n checkedUsers,\n dispatch,\n ]);\n\n //Fetch Actions\n const setSaving = (event: React.FormEvent) => {\n event.preventDefault();\n\n isSaving(true);\n };\n\n const resetForm = () => {\n setSelectedGroups([]);\n };\n\n return (\n {\n closeModalAndRefresh(accepted);\n }}\n title={\n accepted\n ? \"The selected users were added to the following groups.\"\n : \"Add Users to Group\"\n }\n titleIcon={}\n >\n {accepted ? (\n \n \n \n {selectedGroups.join(\", \")}\n \n \n {\" \"}\n {checkedUsers.join(\", \")}{\" \"}\n \n \n \n ) : (\n

\n \n \n {checkedUsers.join(\", \")}\n \n \n \n \n \n \n \n {saving && (\n \n \n \n )}\n
\n )}\n \n );\n};\n\nexport default BulkAddToGroup;\n"],"names":["_ref","open","checkedUsers","closeModalAndRefresh","dispatch","useAppDispatch","saving","isSaving","useState","accepted","setAccepted","selectedGroups","setSelectedGroups","useEffect","length","api","invoke","groups","users","then","catch","err","setModalErrorSnackMessage","errorMessage","detailedError","_jsx","ModalWrapper","modalOpen","onClose","title","titleIcon","AddMembersToGroupIcon","children","React","_jsxs","FormLayout","withBorders","containerPadding","sx","margin","ReadBox","label","width","join","noValidate","autoComplete","onSubmit","event","preventDefault","GroupsSelectors","Grid","item","xs","modalStyleUtils","modalButtonBar","Button","id","type","variant","color","onClick","resetForm","disabled","ProgressBar"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/2491.b81bd18c.chunk.js b/web-app/build/static/js/2491.b81bd18c.chunk.js deleted file mode 100644 index cca0a5826..000000000 --- a/web-app/build/static/js/2491.b81bd18c.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[2491],{71102:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(65043),a=i(89923),l=i(70579);const s=e=>{let{timeStart:t,setTimeStart:i,timeEnd:s,setTimeEnd:r,triggerSync:o,label:d="Filter:",startLabel:x="Start Time:",endLabel:c="End Time:"}=e;return(0,l.jsx)(a.xA9,{item:!0,xs:12,sx:{"& .filter-date-input-label, .end-time-input-label":{display:"none"},"& .MuiInputBase-adornedEnd.filter-date-date-time-input":{width:"100%",border:"1px solid #eaeaea",paddingLeft:"8px",paddingRight:"8px",borderRadius:"1px"},"& .MuiInputAdornment-root button":{height:"20px",width:"20px",marginRight:"5px"},"& .filter-date-input-wrapper":{height:"30px",width:"100%","& .MuiTextField-root":{height:"30px",width:"90%","& input.Mui-disabled":{color:"#000000",WebkitTextFillColor:"#101010"}}}},children:(0,l.jsxs)(a.azJ,{sx:{display:"grid",height:40,alignItems:"center",gridTemplateColumns:"auto 2fr auto",padding:0,[`@media (max-width: ${a.nmC.sm}px)`]:{padding:5},[`@media (max-width: ${a.nmC.md}px)`]:{gridTemplateColumns:"1fr",height:"auto"},gap:"5px"},children:[(0,l.jsx)(a.azJ,{sx:{fontSize:"14px",fontWeight:500,marginRight:"5px"},className:"muted",children:d}),(0,l.jsxs)(a.azJ,{customBorderPadding:"0px",sx:{display:"grid",height:40,alignItems:"center",gridTemplateColumns:"1fr 1fr",gap:"8px",paddingLeft:"8px",paddingRight:"8px",[`@media (max-width: ${a.nmC.md}px)`]:{height:"auto",gridTemplateColumns:"1fr"}},children:[(0,l.jsx)(a.e8j,{value:t,onChange:i,id:"stTime",secondsSelector:!1,pickerStartComponent:(0,l.jsxs)(n.Fragment,{children:[(0,l.jsx)(a.b1c,{}),(0,l.jsx)("span",{children:x})]})}),(0,l.jsx)(a.e8j,{value:s,onChange:r,id:"endTime",secondsSelector:!1,pickerStartComponent:(0,l.jsxs)(n.Fragment,{children:[(0,l.jsx)(a.b1c,{}),(0,l.jsx)("span",{children:c})]})})]}),o&&(0,l.jsx)(a.azJ,{sx:{alignItems:"flex-end",display:"flex",justifyContent:"flex-end"},children:(0,l.jsx)(a.$nd,{id:"sync",type:"button",variant:"callAction",onClick:o,icon:(0,l.jsx)(a.Fjq,{}),label:"Sync"})})]})})}},94141:(e,t,i)=>{i.d(t,{A:()=>x});var n=i(65043),a=i(22166),l=i(89923),s=i(21383),r=i(64159),o=i(49555),d=i(70579);const x=e=>{let{onClose:t,modalOpen:i,title:x,children:c,wideLimit:m=!0,titleIcon:p=null,iconColor:g="default",sx:h}=e;const u=(0,s.jL)(),[f,j]=(0,n.useState)(!1),C=(0,a.d4)((e=>e.system.modalSnackBar));(0,n.useEffect)((()=>{u((0,r.h0)(""))}),[u]),(0,n.useEffect)((()=>{if(C){if(""===C.message)return void j(!1);"error"!==C.type&&j(!0)}}),[C]);let y="";return C&&(y=C.detailedErrorMsg,(""===y||y&&y.length<5)&&(y=C.message)),(0,d.jsxs)(l.ngX,{onClose:t,open:i,title:x,titleIcon:p,widthLimit:m,sx:h,iconColor:g,children:[(0,d.jsx)(o.A,{isModal:!0}),(0,d.jsx)(l.qb_,{onClose:()=>{j(!1),u((0,r.h0)(""))},open:f,message:y,mode:"inline",variant:"error"===C.type?"error":"default",autoHideDuration:"error"===C.type?10:5,condensed:!0}),c]})}},71435:(e,t,i)=>{i.d(t,{CS:()=>s,Ez:()=>n,WJ:()=>a,Zb:()=>l});const n={RED:"#C83B51",GREEN:"#4CCB92",YELLOW:"#FFBD62"},a=(e,t)=>e<=t/2?"bad":2!==t&&e===t/2+1?"warn":e===t?"good":void 0,l=e=>{switch(e){case"offline":return"bad";case"online":return"good";default:return"warn"}},s=(e,t)=>e<=t/2?"bad":e===t/2+1?"warn":e===t?"good":void 0},42491:(e,t,i)=>{i.r(t),i.d(t,{default:()=>lt});var n=i(65043),a=i(22166),l=i(21383),s=i(39820),r=i(46537),o=i(64159),d=i(89923),x=i(33097),c=i.n(x);let m=function(e){return e.singleValue="singleValue",e.linearGraph="linearGraph",e.areaGraph="areaGraph",e.barChart="barChart",e.pieChart="pieChart",e.singleRep="singleRep",e.simpleWidget="simpleWidget",e}({});var p=i(56483),g=i(70579);const h=["#C4D4E9","#DCD1EE","#D1EEE7","#EEDED1","#AAF38F","#F9E6C5","#C83B51","#F4CECE","#D6D6D6"],u=e=>(0,p.hr)(e,"ns"),f=e=>parseInt(e).toString(10),j=[{id:1,title:"Uptime",data:"N/A",type:m.simpleWidget,widgetIcon:(0,g.jsx)(d.Owo,{}),labelDisplayFunction:p.hr},{id:50,title:"Capacity",data:[],dataOuter:[{name:"outer",value:100}],widgetConfiguration:{outerChart:{colorList:["#9c9c9c"],innerRadius:0,outerRadius:0,startAngle:0,endAngle:0},innerChart:{colorList:h,innerRadius:20,outerRadius:50,startAngle:90,endAngle:-200}},type:m.pieChart,innerLabel:"N/A",labelDisplayFunction:p.nO},{id:51,title:"Usable Capacity",data:[],dataOuter:[{name:"outer",value:100}],widgetConfiguration:{outerChart:{colorList:["#9c9c9c"],innerRadius:0,outerRadius:0,startAngle:0,endAngle:0},innerChart:{colorList:h,innerRadius:20,outerRadius:50,startAngle:90,endAngle:-200}},type:m.pieChart,innerLabel:"N/A",labelDisplayFunction:p.nO},{id:68,title:"Data Usage Growth",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.areaGraph,yAxisFormatter:p.nO,xAxisFormatter:p.yz},{id:52,title:"Object size distribution",data:[],widgetConfiguration:[{dataKey:"a",color:"#2781B0",background:{fill:"#EEF1F4"},greatestColor:"#081C42"}],customStructure:[{originTag:"LESS_THAN_1024_B",displayTag:"Less than 1024B"},{originTag:"BETWEEN_1024_B_AND_1_MB",displayTag:"Between 1024B and 1MB"},{originTag:"BETWEEN_1_MB_AND_10_MB",displayTag:"Between 1MB and 10MB"},{originTag:"BETWEEN_10_MB_AND_64_MB",displayTag:"Between 10MB and 64MB"},{originTag:"BETWEEN_64_MB_AND_128_MB",displayTag:"Between 64MB and 128MB"},{originTag:"BETWEEN_128_MB_AND_512_MB",displayTag:"Between 128MB and 512MB"},{originTag:"GREATER_THAN_512_MB",displayTag:"Greater than 512MB"}],type:m.barChart},{id:66,title:"Buckets",data:[],innerLabel:"N/A",type:m.singleRep,color:"#0071BC",fillColor:"#ADD5E0"},{id:44,title:"Objects",data:[],innerLabel:"N/A",type:m.singleRep,color:"#0071BC",fillColor:"#ADD5E0"},{id:63,title:"API Data Received Rate",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000",strokeWidth:3}],type:m.linearGraph,xAxisFormatter:p.yz,yAxisFormatter:p.nO},{id:61,title:"Total Open FDs",data:[],innerLabel:"N/A",type:m.singleRep,color:"#22B573",fillColor:"#A6E8C4"},{id:62,title:"Total Goroutines",data:[],innerLabel:"N/A",type:m.singleRep,color:"#F7655E",fillColor:"#F4CECE"},{id:77,title:"Node CPU Usage",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,yAxisFormatter:f,xAxisFormatter:p.yz},{id:60,title:"API Request Rate",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,yAxisFormatter:f,xAxisFormatter:p.yz},{id:70,title:"API Data Sent Rate",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,xAxisFormatter:p.yz,yAxisFormatter:p.nO},{id:17,title:"Internode Data Transfer",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,yAxisFormatter:p.nO,xAxisFormatter:p.yz},{id:73,title:"Node IO",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,yAxisFormatter:p.nO,xAxisFormatter:p.yz},{id:80,title:"Time Since Last Heal Activity",data:"N/A",type:m.simpleWidget,widgetIcon:(0,g.jsx)(d.Sdx,{}),labelDisplayFunction:u},{id:81,title:"Time Since Last Scan Activity",data:"N/A",type:m.simpleWidget,widgetIcon:(0,g.jsx)(d.KLX,{}),labelDisplayFunction:u},{id:71,title:"API Request Error Rate",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,xAxisFormatter:p.yz},{id:76,title:"Node Memory Usage",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,xAxisFormatter:p.yz,yAxisFormatter:p.nO},{id:74,title:"Drive Used Capacity",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,xAxisFormatter:p.yz,yAxisFormatter:p.nO},{id:82,title:"Drives Free Inodes",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,disableYAxis:!0,xAxisFormatter:p.yz},{id:11,title:"Node Syscalls",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,yAxisFormatter:f,xAxisFormatter:p.yz},{id:8,title:"Node File Descriptors",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,yAxisFormatter:f,xAxisFormatter:p.yz},{id:500,mergedPanels:[{id:53,title:"Online",data:"N/A",type:m.singleValue},{id:69,title:"Offline",data:"N/A",type:m.singleValue}],title:"Servers"},{id:501,mergedPanels:[{id:9,title:"Online",data:"N/A",type:m.singleValue},{id:78,title:"Offline",data:"N/A",type:m.singleValue}],title:"Drives"},{id:502,mergedPanels:[{id:65,title:"Upload",data:"N/A",type:m.singleValue,labelDisplayFunction:p.nO},{id:64,title:"Download",data:"N/A",type:m.singleValue,labelDisplayFunction:p.nO}],title:"Network"}],C=(e,t)=>{if(0===e.length)return["","0"];if("mean"===t){const t=e.reduce(((e,t)=>e+parseFloat(t[1])),0);return["",Math.floor(t/e.length).toString()]}{const t=e.sort(((e,t)=>e[0]-t[0]));return t[t.length-1]}},y=(e,t)=>{if(!e)return t;const i=e.type;switch(t.type){case m.singleValue:case m.simpleWidget:if("stat"===i||"singlestat"===i){let i=c()(e,"targets[0].result[0].values",[]);null===i&&(i=[]);const n=c()(e,"options.reduceOptions.calcs[0]","lastNotNull"),a=C(i,n),l=t.labelDisplayFunction?t.labelDisplayFunction(a[1]):a[1];return{...t,data:l}}break;case m.pieChart:if("gauge"===i){const i=c()(e,"options.reduceOptions.calcs[0]","lastNotNull");let n=c()(e,"targets",[]).filter((e=>null!==e));const a=n.map((e=>(e.result&&Array.isArray(e.result)?e.result:[]).map((t=>{const i=c()(t,"values",[]),n=Object.keys(t.metric),a=i.sort(((e,t)=>parseInt(e[0][1])-parseInt(t[0][1]))),l=t.metric[n[0]],s=a[a.length-1];return{name:l,value:parseInt(s[1]),legend:e.legendFormat}})))),l=n[0].result&&n[0].result.length>0?n[0].result[0].values:[],s=C(l,i),r=t.labelDisplayFunction?t.labelDisplayFunction(s[1]):s[1];return{...t,data:a,innerLabel:r}}break;case m.linearGraph:case m.areaGraph:if("graph"===i){let i=c()(e,"targets",[]);null===i&&(i=[]);const n=[],a=[];i.forEach(((e,t)=>{let i=c()(e,"result",[]);const l=e.legendFormat;null===i&&(i=[]),i.forEach((e=>{const i=((e,t)=>{const i=Object.keys(e),n=new RegExp(`{{(${i.join("|")})}}`,"g");let a=t.replace(n,(t=>{const i=t.replace(/({{|}})/g,"");return e[i]}));const l=(a.match(/{{/g)||[]).length,s=(a.match(/}}/g)||[]).length;let r=a.replace(/{{(.*?)}}/g,"");return l===s&&0!==l&&0!==s&&(i.forEach((t=>{a=a.replace(t,e[t])})),r=a),r})(e.metric,l),s=`key_${t}${i}`;n.push({dataKey:s,keyLabel:i,lineColor:"",fillColor:""});let r=c()(e,"values",[]);null===r&&(r=[]),r.forEach((e=>{const t=a.findIndex((t=>t.name===e[0]));if(-1===t){let t={name:e[0]};t[s]=e[1],a.push(t)}else a[t][s]=e[1]}))}))}));const l=n.sort(((e,t)=>e.keyLabelt.keyLabel?1:0)).map(((e,t)=>({...e,lineColor:h[t]||(0,p.h4)(e.keyLabel),fillColor:h[t]||(0,p.h4)(e.keyLabel)}))),s=a.sort(((e,t)=>e.name-t.name));return{...t,widgetConfiguration:l,data:s}}break;case m.barChart:if("bargauge"===i){let i=c()(e,"targets[0].result",[]);null===i&&(i=[]);const n=(e,t)=>e[0]-t[0];let a=[];return a=t.customStructure?t.customStructure.map((e=>{const t=i.find((t=>t.metric.range===e.originTag)),a=c()(t,"values",[]).sort(n),l=a[a.length-1]||["","0"];return{name:e.displayTag,a:parseInt(l[1])}})):i.map((e=>{const t=Object.keys(e.metric),i=e.metric[t[0]],a=c()(e,"values",[]).sort(n),l=a[a.length-1]||["","0"];return{name:i,a:parseInt(l[1])}})),{...t,data:a}}break;case m.singleRep:if("stat"===i){let i=c()(e,"targets[0].result[0].values",[]);null===i&&(i=[]);const n=c()(e,"options.reduceOptions.calcs[0]","lastNotNull"),a=C(i,n),l=i.sort(((e,t)=>e[0]-t[0]));let s=[];1===l.length&&s.push({value:0}),l.forEach((e=>{s.push({value:parseInt(e[1])})}));const r=t.labelDisplayFunction?t.labelDisplayFunction(a[1]):a[1];return{...t,data:s,innerLabel:r}}}return t},v=e=>{const t=e.split(" "),i=()=>{let t=e;return isNaN(parseFloat(e))||(t=(0,p.dq)(parseFloat(e))),(0,g.jsx)(n.Fragment,{children:t})};return 2!==t.length?i():p.MD.includes(t[1])?(0,g.jsxs)("span",{className:"commonValue",children:[t[0],(0,g.jsx)("span",{className:"unitText",children:t[1]})]}):i()};var w=i(94574),b=i(50108),z=i(82291),S=i(52185),A=i(6026),I=i(38643),T=i(17869),J=i(86150),F=i(77403),N=i(47027);const $=e=>{let{panelItem:t}=e;const i=(0,l.jL)();return(0,g.jsx)(d.azJ,{sx:{alignItems:"right",gap:"10px","& .link-text":{color:"#2781B0",fontSize:"12px",fontWeight:600},"& .zoom-graph-icon":{backgroundColor:"transparent",border:0,padding:0,cursor:"pointer","& svg":{color:"#D0D0D0",height:16},"&:hover":{"& svg":{color:"#404143"}}}},children:(0,g.jsx)("button",{onClick:()=>{i((0,N.ZQ)(t))},className:"zoom-graph-icon",children:(0,g.jsx)(d.mSu,{})})})};var E=i(72663);const L=e=>{let{title:t,componentRef:i,data:a}=e;const[s,r]=n.useState(null),x=Boolean(s),c=(0,l.jL)(),m=()=>{if(null!==a&&a.length>0)((e,t)=>{let i=document.createElement("a");i.setAttribute("href","data:text/plain;charset=utf-8,"+t),i.setAttribute("download",e),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)})(null!==t?(t+"_"+Date.now().toString()+".csv").replace(/\s+/g,"").trim().toLowerCase():"widgetData_"+Date.now().toString()+".csv",(e=a,[Object.keys(e[0])].concat(e).map((e=>Object.values(e).toString())).join("\n")));else{let e;e={errorMessage:"Unable to download widget data",detailedError:"Unable to download widget data - data not available"},(e=>{c((0,o.C9)(e))})(e)}var e},p=e=>{"csv"===e?m():"png"===e&&(()=>{if(null!==t){const e=(t+"_"+Date.now().toString()+".png").replace(/\s+/g,"").trim().toLowerCase();(0,E.exportComponentAsPNG)(i,{fileName:e})}else{const e="widgetData_"+Date.now().toString()+".png";(0,E.exportComponentAsPNG)(i,{fileName:e})}})()};return(0,g.jsx)(n.Fragment,{children:(0,g.jsxs)(d.azJ,{sx:{justifyItems:"center","& .download-icon":{backgroundColor:"transparent",border:0,padding:0,cursor:"pointer","& svg":{color:"#D0D0D0",height:16},"&:hover":{"& svg":{color:"#404143"}}}},children:[(0,g.jsx)("button",{className:"download-icon",onClick:e=>{r(e.currentTarget)},children:(0,g.jsx)(d.s3U,{})}),(0,g.jsx)(d.Vey,{id:"download-widget-main-menu",options:[{label:"Download as CSV",value:"csv"},{label:"Download as PNG",value:"png"}],selectedOption:"",onSelect:e=>p(e),hideTriggerAction:()=>{r(null)},open:x,anchorEl:s,anchorOrigin:"end"})]})})},k=e=>{let{active:t,payload:i,label:n,barChartConfiguration:a}=e;return t?(0,g.jsxs)(d.azJ,{sx:F.VI.customTooltip,children:[(0,g.jsx)(d.azJ,{sx:F.VI.timeStampTitle,children:n}),i&&i.map(((e,t)=>(0,g.jsxs)(d.azJ,{sx:F.VI.labelContainer,children:[(0,g.jsx)(d.azJ,{sx:F.VI.labelColor,style:{backgroundColor:a[t].color}}),(0,g.jsx)(d.azJ,{sx:{...F.VI.itemValue,"& span.valueContainer":{...F.VI.valueContainer}},children:(0,g.jsx)("span",{className:"valueContainer",children:e.value})})]},`pltiem-${t}-${n}`)))]}):null};var W=i(20649);const B=w.Ay.div((e=>{let{theme:t}=e;return{...(0,F.yE)(t),loadingAlign:{width:"100%",paddingTop:"15px",textAlign:"center",margin:"auto"}}})),D=e=>{let{y:t,payload:i}=e;return(0,g.jsx)("text",{width:50,fontSize:"69.7%",textAnchor:"start",fill:"#333",transform:`translate(5,${t})`,fontWeight:400,dy:3,children:i.value})},R=e=>{let{title:t,panelItem:i,timeStart:s,timeEnd:r,apiPrefix:x,zoomActivated:c=!1}=e;const m=(0,l.jL)(),[p,h]=(0,n.useState)(!1),[u,f]=(0,n.useState)([]),[j,C]=(0,n.useState)(null),[v,w]=(0,n.useState)(!1),[F,N]=(0,n.useState)(window.innerWidth>=d.nmC.md),E=(0,n.useRef)(),R=(0,a.d4)((e=>e.dashboard.widgetLoadVersion));(0,n.useEffect)((()=>{h(!0)}),[R]),(0,n.useEffect)((()=>{const e=()=>{let e=!1;window.innerWidth>=d.nmC.md&&(e=!0),N(e)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),(0,n.useEffect)((()=>{if(p){let e=0;if(null!==s&&null!==r){const t=r.toUnixInteger()-s.toUnixInteger(),i=Math.floor(t/60);e=i<1?15:i}W.A.invoke("GET",`/api/v1/${x}/info/widgets/${i.id}/?step=${e}&${null!==s?`&start=${s.toUnixInteger()}`:""}${null!==s&&null!==r?"&":""}${null!==r?`end=${r.toUnixInteger()}`:""}`).then((e=>{const t=y(e,i);f(t.data),C(t),h(!1)})).catch((e=>{m((0,o.C9)(e)),h(!1)}))}}),[p,i,r,s,m,x]);const M=j?j.widgetConfiguration:[];let O=0,U=0;if(1===M.length){const e=M[0];u.forEach(((t,i)=>{t[e.dataKey]>U&&(U=t[e.dataKey],O=i)}))}return(0,g.jsx)(B,{children:(0,g.jsxs)(d.azJ,{className:c?"":"singleValueContainer",onMouseOver:()=>{w(!0)},onMouseLeave:()=>{w(!1)},children:[!c&&(0,g.jsxs)(d.xA9,{container:!0,children:[(0,g.jsx)(d.xA9,{item:!0,xs:10,sx:{alignItems:"start",justifyItems:"start"},children:(0,g.jsx)("div",{className:"titleContainer",children:t})}),(0,g.jsx)(d.xA9,{item:!0,xs:1,sx:{display:"flex",justifyContent:"flex-end"},children:v&&(0,g.jsx)($,{panelItem:i})}),(0,g.jsx)(d.xA9,{item:!0,xs:1,sx:{display:"flex",justifyContent:"flex-end"},children:(0,g.jsx)(L,{title:t,componentRef:E,data:u})})]}),p&&(0,g.jsx)(d.azJ,{className:"loadingAlign",children:(0,g.jsx)(d.aHM,{})}),!p&&(0,g.jsx)("div",{ref:E,className:c?"zoomChartCont":"contentContainer",children:(0,g.jsx)(b.u,{width:"99%",children:(0,g.jsxs)(z.E,{data:u,layout:"vertical",barCategoryGap:1,children:[(0,g.jsx)(S.W,{type:"number",hide:!0}),(0,g.jsx)(A.h,{dataKey:"name",type:"category",interval:0,tick:(0,g.jsx)(D,{}),tickLine:!1,axisLine:!1,width:150,hide:!F,style:{fontSize:"12px",fontWeight:100}}),M.map((e=>(0,g.jsx)(I.y,{dataKey:e.dataKey,fill:e.color,background:e.background,barSize:c?25:12,children:1===M.length?(0,g.jsx)(n.Fragment,{children:u.map(((t,i)=>(0,g.jsx)(T.f,{fill:i===O?e.greatestColor:e.color},`chart-bar-${i.toString()}`)))}):null},`bar-${e.dataKey}`))),(0,g.jsx)(J.m,{cursor:{fill:"rgba(255, 255, 255, 0.3)"},content:(0,g.jsx)(k,{barChartConfiguration:M})})]})})})]})})};var M=i(877),O=i(87734),U=i(13839);const V=e=>{let{active:t,payload:i,label:n,linearConfiguration:a,yAxisFormatter:l}=e;return t?(0,g.jsxs)(d.azJ,{sx:F.VI.customTooltip,children:[(0,g.jsx)(d.azJ,{sx:F.VI.timeStampTitle,children:(0,p.yz)(n,!0)}),i&&i.map(((e,t)=>(0,g.jsxs)(d.azJ,{sx:F.VI.labelContainer,children:[(0,g.jsx)(d.azJ,{sx:F.VI.labelColor,style:{backgroundColor:a[t].lineColor}}),(0,g.jsx)(d.azJ,{sx:{...F.VI.itemValue,"& span.valueContainer":{...F.VI.valueContainer}},children:(0,g.jsxs)("span",{className:"valueContainer",children:[a[t].keyLabel,":"," ",l(e.value)]})})]},`lbPl-${t}-${a[t].keyLabel}`)))]}):null},P=w.Ay.div((e=>{let{theme:t}=e;return{...(0,F.yE)(t),"& .chartCont":{position:"relative",height:140,width:"100%"},"& .legendChart":{display:"flex",flexDirection:"column",flex:"0 1 auto",maxHeight:130,margin:0,overflowY:"auto",position:"relative",textAlign:"center",width:"100%",justifyContent:"flex-start",color:c()(t,"mutedText","#87888d"),fontWeight:"bold",fontSize:12,[`@media (max-width: ${d.nmC.md}px)`]:{display:"none"}},"& .loadingAlign":{width:40,height:40,textAlign:"center",margin:"15px auto"}}})),G=e=>{let{title:t,timeStart:i,timeEnd:s,panelItem:r,apiPrefix:x,hideYAxis:c=!1,areaWidget:m=!1,yAxisFormatter:p=e=>e,xAxisFormatter:h=(e,t,i)=>e,zoomActivated:u=!1}=e;const f=(0,l.jL)(),[j,C]=(0,n.useState)(!1),[v,w]=(0,n.useState)(!1),[z,I]=(0,n.useState)([]),[T,F]=(0,n.useState)([]),[N,E]=(0,n.useState)(0),[k,B]=(0,n.useState)(null),D=(0,a.d4)((e=>e.dashboard.widgetLoadVersion)),R=(0,n.useRef)(null);(0,n.useEffect)((()=>{C(!0)}),[D]),(0,n.useEffect)((()=>{if(j){let e=0;if(null!==i&&null!==s){const t=s.toUnixInteger()-i.toUnixInteger(),n=Math.floor(t/60);e=n<1?15:n}W.A.invoke("GET",`/api/v1/${x}/info/widgets/${r.id}/?step=${e}&${null!==i?`&start=${i.toUnixInteger()}`:""}${null!==i&&null!==s?"&":""}${null!==s?`end=${s.toUnixInteger()}`:""}`).then((e=>{const t=y(e,r);I(t.data),B(t),C(!1);let i=0;for(const n of t.data)for(const e in n){if("name"===e)continue;let t=parseInt(n[e]);isNaN(t)&&(t=0),i{f((0,o.C9)(e)),C(!1)}))}}),[j,r,s,i,f,x]);let G=Math.floor(z.length/5);(0,n.useEffect)((()=>{const e=z.map((e=>{const t=new Date(1e3*(null===e||void 0===e?void 0:e.name));return{...e,name:t}}));F(e)}),[z]);const _=k?null===k||void 0===k?void 0:k.widgetConfiguration:[],K=e=>{const{cx:t,cy:i,index:n}=e;return n%3!==0?null:(0,g.jsx)("circle",{cx:t,cy:i,r:3,strokeWidth:0,fill:"#07264A"})};let H=!1;return u&&(H=!0),(0,g.jsx)(P,{children:(0,g.jsxs)(d.azJ,{className:u?"":"singleValueContainer",onMouseOver:()=>{w(!0)},onMouseLeave:()=>{w(!1)},children:[!u&&(0,g.jsxs)(d.xA9,{container:!0,children:[(0,g.jsx)(d.xA9,{item:!0,xs:10,sx:{alignItems:"start"},children:(0,g.jsx)(d.azJ,{className:"titleContainer",children:t})}),(0,g.jsx)(d.xA9,{item:!0,xs:1,sx:{display:"flex",justifyContent:"flex-end",alignContent:"flex-end"},children:v&&(0,g.jsx)($,{panelItem:r})}),(0,g.jsx)(d.xA9,{item:!0,xs:1,sx:{display:"flex",justifyContent:"flex-end"},children:null!==R&&(0,g.jsx)(L,{title:t,componentRef:R,data:T})})]}),(0,g.jsx)("div",{ref:R,children:(0,g.jsxs)(d.azJ,{sx:u?{flexDirection:"column"}:{height:"100%",display:"grid",gridTemplateColumns:"1fr 1fr",[`@media (max-width: ${d.nmC.md}px)`]:{gridTemplateColumns:"1fr"}},style:m?{gridTemplateColumns:"1fr"}:{},children:[j&&(0,g.jsx)(d.aHM,{className:"loadingAlign"}),!j&&(0,g.jsxs)(n.Fragment,{children:[(0,g.jsx)(d.azJ,{className:u?"zoomChartCont":"chartCont",children:(0,g.jsx)(b.u,{width:"99%",children:(0,g.jsxs)(M.Q,{data:z,margin:{top:5,right:20,left:c?20:5,bottom:0},children:[m&&(0,g.jsx)("defs",{children:(0,g.jsxs)("linearGradient",{id:"colorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,g.jsx)("stop",{offset:"0%",stopColor:"#2781B0",stopOpacity:1}),(0,g.jsx)("stop",{offset:"100%",stopColor:"#ffffff",stopOpacity:0}),(0,g.jsx)("stop",{offset:"95%",stopColor:"#ffffff",stopOpacity:.8})]})}),(0,g.jsx)(O.d,{strokeDasharray:m?"2 2":"5 5",strokeWidth:1,strokeOpacity:1,stroke:"#eee0e0",vertical:!m}),(0,g.jsx)(S.W,{dataKey:"name",tickFormatter:e=>h(e,H,!0),interval:G,tick:{fontSize:"68%",fontWeight:"normal",color:"#404143"},tickCount:10,stroke:"#082045"}),(0,g.jsx)(A.h,{type:"number",domain:[0,1.1*N],hide:c,tickFormatter:e=>p(e),tick:{fontSize:"68%",fontWeight:"normal",color:"#404143"},stroke:"#082045"}),_.map(((e,t)=>(0,g.jsx)(U.G,{type:"monotone",dataKey:e.dataKey,isAnimationActive:!1,stroke:m?"#D7E5F8":e.lineColor,fill:m?"url(#colorUv)":e.fillColor,fillOpacity:m?.65:0,strokeWidth:m?0:3,strokeLinecap:"round",dot:!!m&&(0,g.jsx)(K,{})},`area-${e.dataKey}-${t.toString()}`))),(0,g.jsx)(J.m,{content:(0,g.jsx)(V,{linearConfiguration:_,yAxisFormatter:p}),wrapperStyle:{zIndex:5e3}})]})})}),!m&&(0,g.jsxs)(n.Fragment,{children:[u&&(0,g.jsxs)(n.Fragment,{children:[(0,g.jsx)("strong",{children:"Series"}),(0,g.jsx)("br",{}),(0,g.jsx)("br",{})]}),(0,g.jsx)(d.azJ,{className:"legendChart",children:_.map(((e,t)=>(0,g.jsxs)(d.azJ,{className:"singleLegendContainer",children:[(0,g.jsx)(d.azJ,{className:"colorContainer",style:{backgroundColor:e.lineColor}}),(0,g.jsx)(d.azJ,{className:"legendLabel",children:e.keyLabel})]},`legend-${e.keyLabel}-${t.toString()}`)))})]})]})]})})]})})};var _=i(60163),K=i(4240);const H=w.Ay.div((e=>{let{theme:t}=e;return{...(0,F.yE)(t),"& .loadingAlign":{width:"100%",paddingTop:"15px",textAlign:"center",margin:"auto"},"& .pieChartLabel":{fontSize:60,color:c()(t,"signalColors.main","#07193E"),fontWeight:"bold",width:"100%","& .unitText":{color:c()(t,"mutedText","#87888d"),fontSize:12}},"& .chartContainer":{width:"100%",height:140}}})),Q=e=>{let{title:t,panelItem:i,timeStart:s,timeEnd:r,apiPrefix:x}=e;const m=(0,l.jL)(),[p,h]=(0,n.useState)(!1),[u,f]=(0,n.useState)([]),[j,C]=(0,n.useState)([]),[w,z]=(0,n.useState)(null),S=(0,a.d4)((e=>e.dashboard.widgetLoadVersion));(0,n.useEffect)((()=>{h(!0)}),[S]),(0,n.useEffect)((()=>{if(p){let e=0;if(null!==s&&null!==r){const t=r.toUnixInteger()-s.toUnixInteger(),i=Math.floor(t/60);e=i<1?15:i}W.A.invoke("GET",`/api/v1/${x}/info/widgets/${i.id}/?step=${e}&${null!==s?`&start=${s.toUnixInteger()}`:""}${null!==s&&null!==r?"&":""}${null!==r?`end=${r.toUnixInteger()}`:""}`).then((e=>{const t=y(e,i);f(t.data),C(t.dataOuter),z(t),h(!1)})).catch((e=>{m((0,o.C9)(e)),h(!1)}))}}),[p,i,r,s,m,x]);const A=w?w.widgetConfiguration:[],I=null===w||void 0===w?void 0:w.innerLabel,J=c()(A,"innerChart.colorList",[]),F=c()(A,"outerChart.colorList",[]);return(0,g.jsx)(H,{children:(0,g.jsxs)(d.azJ,{className:"singleValueContainer",children:[(0,g.jsx)(d.azJ,{className:"titleContainer",children:t}),p&&(0,g.jsx)(d.azJ,{className:"loadingAlign",children:(0,g.jsx)(d.aHM,{})}),!p&&(0,g.jsxs)(d.azJ,{className:"contentContainer",children:[(0,g.jsx)("span",{className:"pieChartLabel",children:I&&v(I)}),(0,g.jsx)(d.azJ,{className:"chartContainer",children:(0,g.jsx)(b.u,{width:"99%",children:(0,g.jsxs)(_.r,{margin:{top:5,bottom:5},children:[j&&(0,g.jsx)(K.F,{data:j,cx:"50%",cy:"50%",dataKey:"value",innerRadius:c()(A,"outerChart.innerRadius",0),outerRadius:c()(A,"outerChart.outerRadius","80%"),startAngle:c()(A,"outerChart.startAngle",0),endAngle:c()(A,"outerChart.endAngle",360),fill:"#201763",children:j.map(((e,t)=>(0,g.jsx)(T.f,{fill:"undefined"===typeof F[t]?"#393939":F[t]},`cellOuter-${t}`)))}),u&&(0,g.jsx)(K.F,{data:u,dataKey:"value",cx:"50%",cy:"50%",innerRadius:c()(A,"innerChart.innerRadius",0),outerRadius:c()(A,"innerChart.outerRadius","80%"),startAngle:c()(A,"innerChart.startAngle",0),endAngle:c()(A,"innerChart.endAngle",360),fill:"#201763",children:u.map(((e,t)=>(0,g.jsx)(T.f,{fill:"undefined"===typeof J[t]?"#393939":J[t]},`cell-${t}`)))})]})})})]})]})})},q=w.Ay.span((e=>{let{theme:t}=e;return{display:"inline-flex",color:c()(t,"signalColors.main","#07193E"),alignItems:"center","& .icon":{color:c()(t,"signalColors.main","#07193E"),fill:c()(t,"signalColors.main","#07193E"),marginRight:5,marginLeft:12},"& .widgetLabel":{fontWeight:"bold",textTransform:"uppercase",marginRight:10},"& .widgetValue":{marginRight:25}}})),Y=e=>{let{iconWidget:t,title:i,panelItem:s,timeStart:r,timeEnd:x,apiPrefix:c,renderFn:m}=e;const p=(0,l.jL)(),[h,u]=(0,n.useState)(!1),[f,j]=(0,n.useState)(""),C=(0,a.d4)((e=>e.dashboard.widgetLoadVersion));return(0,n.useEffect)((()=>{u(!0)}),[C]),(0,n.useEffect)((()=>{if(h){let e=0;if(null!==r&&null!==x){const t=x.toUnixInteger()-r.toUnixInteger(),i=Math.floor(t/60);e=i<1?15:i}W.A.invoke("GET",`/api/v1/${c}/info/widgets/${s.id}/?step=${e}&${null!==r?`&start=${r.toUnixInteger()}`:""}${null!==r&&null!==x?"&":""}${null!==x?`end=${x.toUnixInteger()}`:""}`).then((e=>{const t=y(e,s);j(t.data),u(!1)})).catch((e=>{p((0,o.C9)(e)),u(!1)}))}}),[h,s,x,r,p,c]),m?m({valueToRender:f,loading:h,title:i,id:s.id,iconWidget:t}):(0,g.jsxs)(n.Fragment,{children:[h&&(0,g.jsx)("div",{className:"loadingAlign",children:(0,g.jsx)(d.aHM,{})}),!h&&(0,g.jsxs)(q,{children:[(0,g.jsx)("span",{className:"icon",children:t||null}),(0,g.jsxs)("span",{className:"widgetLabel",children:[i,": "]}),(0,g.jsx)("span",{className:"widgetValue",children:f})]})]})},X=e=>{let{children:t}=e;return(0,g.jsx)(d.azJ,{withBorders:!0,sx:{borderRadius:"3px",padding:15,height:136,maxWidth:"100%",[`@media (max-width: ${d.nmC.sm}px)`]:{padding:5,height:"auto"},[`@media (max-width: ${d.nmC.md}px)`]:{display:"flex",flexFlow:"column",maxWidth:"initial"}},children:t})},Z=w.Ay.div((e=>{let{theme:t}=e;return{fontFamily:"Inter,sans-serif",color:c()(t,"signalColors.main","#07193E"),maxWidth:"300px",display:"flex",marginLeft:"auto",marginRight:"auto",cursor:"default",position:"relative",width:"100%"}})),ee=e=>{let{value:t,label:i="",icon:n=null,loading:a=!1}=e;return(0,g.jsx)(Z,{children:(0,g.jsxs)(d.azJ,{sx:{flex:1,display:"flex",width:"100%",padding:"0 8px 0 8px",[`@media (max-width: ${d.nmC.sm}px)`]:{padding:"0 10px 0 10px"}},children:[(0,g.jsxs)(d.azJ,{sx:{flex:1,display:"flex",flexFlow:"column",marginTop:"12px",zIndex:10,overflow:"hidden"},children:[(0,g.jsx)(d.azJ,{sx:{fontSize:"16px",fontWeight:600},children:i}),(0,g.jsx)(d.m_M,{tooltip:t,placement:"bottom",children:(0,g.jsx)(d.azJ,{sx:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",maxWidth:187,flexFlow:"row",fontSize:55,[`@media (max-width: ${d.nmC.sm}px)`]:{fontSize:35,maxWidth:200,flexFlow:"column"},[`@media (max-width: ${d.nmC.md}px)`]:{fontSize:35},[`@media (max-width: ${d.nmC.lg}px)`]:{fontSize:36},[`@media (max-width: ${d.nmC.xl}px)`]:{fontSize:50}},children:t})})]}),(0,g.jsx)(d.azJ,{sx:{display:"flex",flexFlow:"column",alignItems:"center",justifyContent:"flex-start",marginTop:"8px",maxWidth:"26px","& .min-icon":{width:"16px",height:"16px"}},children:a?(0,g.jsx)(d.aHM,{style:{width:"16px",height:"16px"}}):n})]})})},te=e=>{let{title:t,value:i,loading:n}=e;return(0,g.jsx)(ee,{label:t,icon:(0,g.jsx)(d.brV,{}),value:i,loading:n})},ie=e=>{let{title:t,value:i,loading:n}=e;return(0,g.jsx)(ee,{label:t,icon:(0,g.jsx)(d.Sxe,{}),value:i,loading:n})},ne=(0,a.Ng)(null,{setErrorSnackMessage:o.C9})((e=>{let{title:t,panelItem:i,timeStart:s,timeEnd:r,propLoading:d,apiPrefix:x}=e;const c=(0,l.jL)(),[m,h]=(0,n.useState)(!1),[u,f]=(0,n.useState)(null),j=(0,a.d4)((e=>e.dashboard.widgetLoadVersion));(0,n.useEffect)((()=>{h(!0)}),[j]),(0,n.useEffect)((()=>{if(m){let e=0;if(null!==s&&null!==r){const t=r.toUnixInteger()-s.toUnixInteger(),i=Math.floor(t/60);e=i<1?15:i}W.A.invoke("GET",`/api/v1/${x}/info/widgets/${i.id}/?step=${e}&${null!==s?`&start=${s.toUnixInteger()}`:""}${null!==s&&null!==r?"&":""}${null!==r?`end=${r.toUnixInteger()}`:""}`).then((e=>{const t=y(e,i);f(t),h(!1)})).catch((e=>{c((0,o.C9)(e)),h(!1)}))}}),[m,i,r,s,c,x]);let C="";if(u){const e=parseInt(u.innerLabel||"0");C=isNaN(e)?"0":(0,p.dq)(e)}return 66===(v=i.id)?(0,g.jsx)(X,{children:(0,g.jsx)(te,{loading:m,title:t,value:u?C:""})}):44===v?(0,g.jsx)(X,{children:(0,g.jsx)(ie,{loading:m,title:t,value:u?C:""})}):null;var v})),ae=w.Ay.div((e=>{let{theme:t}=e;return{display:"flex",height:140,flexDirection:"column",justifyContent:"center","& .unitText":{color:c()(t,"mutedText","#87888d"),fontSize:12},"& .loadingAlign":{width:"100%",textAlign:"center",margin:"auto"},"& .metric":{fontSize:60,lineHeight:1,color:c()(t,"signalColors.main","#07193E"),fontWeight:700},"& .titleElement":{fontSize:10,color:c()(t,"mutedText","#87888d"),fontWeight:700},...(0,F.yE)(t)}})),le=e=>{let{title:t,panelItem:i,timeStart:s,timeEnd:r,apiPrefix:x,renderFn:c}=e;const m=(0,l.jL)(),[p,h]=(0,n.useState)(!1),[u,f]=(0,n.useState)(""),j=(0,a.d4)((e=>e.dashboard.widgetLoadVersion));(0,n.useEffect)((()=>{h(!0)}),[j]),(0,n.useEffect)((()=>{if(p){let e=0;if(null!==s&&null!==r){const t=r.toUnixInteger()-s.toUnixInteger(),i=Math.floor(t/60);e=i<1?15:i}W.A.invoke("GET",`/api/v1/${x}/info/widgets/${i.id}/?step=${e}&${null!==s?`&start=${s.toUnixInteger()}`:""}${null!==s&&null!==r?"&":""}${null!==r?`end=${r.toUnixInteger()}`:""}`).then((e=>{const t=y(e,i);f(t.data),h(!1)})).catch((e=>{m((0,o.C9)(e)),h(!1)}))}}),[p,i,r,s,m,x]);const C=v(u);return c?c({valueToRender:C,loading:p,title:t,id:i.id}):(0,g.jsxs)(ae,{children:[p&&(0,g.jsx)(d.azJ,{className:"loadingAlign",children:(0,g.jsx)(d.aHM,{})}),!p&&(0,g.jsxs)(n.Fragment,{children:[(0,g.jsx)(d.azJ,{className:"metric",children:v(u)}),(0,g.jsx)(d.azJ,{className:"titleElement",children:t})]})]})},se=w.Ay.div((e=>{let{theme:t}=e;return{flex:1,display:"flex",alignItems:"center",flexFlow:"row","& .usableLabel":{color:c()(t,"mutedText","#87888d"),fontSize:"10px",display:"flex",flexFlow:"column",alignItems:"center",textAlign:"center"},"& .usedLabel":{color:c()(t,"mutedText","#87888d"),fontWeight:"bold",fontSize:"14px"},"& .totalUsed":{display:"flex","& .value":{fontSize:"50px",fontFamily:"Inter",fontWeight:600,alignSelf:"flex-end",lineHeight:1},"& .unit":{color:c()(t,"mutedText","#87888d"),fontWeight:"bold",fontSize:"14px",marginLeft:"12px",alignSelf:"flex-end"}},"& .ofUsed":{marginTop:"5px","& .value":{color:c()(t,"mutedText","#87888d"),fontWeight:"bold",fontSize:"14px",textAlign:"right"}},[`@media (max-width: ${d.nmC.sm}px)`]:{flexFlow:"column"}}})),re=e=>{let{value:t,timeStart:i,timeEnd:s,apiPrefix:r}=e;const x=(0,l.jL)(),[c,m]=(0,n.useState)(!1),[h,u]=(0,n.useState)(0),[f,j]=(0,n.useState)(0),[C,v]=(0,n.useState)(0),[w,b]=(0,n.useState)(0),z=(0,a.d4)((e=>e.dashboard.widgetLoadVersion));(0,n.useEffect)((()=>{m(!0)}),[z]),(0,n.useEffect)((()=>{if(c){let e=0;if(null!==i&&null!==s){const t=s.toUnixInteger()-i.toUnixInteger(),n=Math.floor(t/60);e=n<1?15:n}W.A.invoke("GET",`/api/v1/${r}/info/widgets/${t.id}/?step=${e}&${null!==i?`&start=${i.toUnixInteger()}`:""}${null!==i&&null!==s?"&":""}${null!==s?`end=${s.toUnixInteger()}`:""}`).then((e=>{const i=y(e,t);let n=0,a=0,l=0;i.data.forEach((e=>{e.forEach((e=>{switch(e.legend){case"Total Usable":n+=e.value;break;case"Used Space":a+=e.value;break;case"Usable Free":l+=e.value}}))}));const s=Math.round(l/n*100);u(l),j(s),v(a),b(n),m(!1)})).catch((e=>{x((0,o.C9)(e)),m(!1)}))}}),[c,t,s,i,x,r]);const S=(0,p.GT)(C,!0,!1),A=[{value:h,color:"#D6D6D6",label:"Usable Available Space"},{value:C,color:(0,p.zv)(C,w),label:"Used Space"}];return(0,g.jsxs)(se,{children:[(0,g.jsx)(d.azJ,{sx:{fontSize:"16px",fontWeight:600,[`@media (max-width: ${d.nmC.sm}px)`]:{alignSelf:"flex-start"}},children:"Capacity"}),(0,g.jsxs)(d.azJ,{sx:{position:"relative",width:110,height:110,marginLeft:"auto",[`@media (max-width: ${d.nmC.sm}px)`]:{marginLeft:""}},children:[(0,g.jsxs)(d.azJ,{sx:{position:"absolute",display:"flex",flexFlow:"column",alignItems:"center",top:"50%",left:"50%",transform:"translate(-50%, -50%)",fontWeight:"bold",fontSize:12},children:[`${f}%`,(0,g.jsx)("br",{}),(0,g.jsx)(d.azJ,{className:"usableLabel",children:"Free"})]}),(0,g.jsx)(_.r,{width:110,height:110,children:(0,g.jsx)(K.F,{data:A,cx:"50%",cy:"50%",dataKey:"value",outerRadius:50,innerRadius:40,startAngle:-70,endAngle:360,animationDuration:1,children:A.map(((e,t)=>(0,g.jsx)(T.f,{fill:e.color},`cellCapacity-${t}`)))})})]}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",alignItems:"center",marginLeft:"auto",[`@media (max-width: ${d.nmC.sm}px)`]:{marginLeft:""}},children:[(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{className:"usedLabel",children:"Used:"}),(0,g.jsxs)(d.azJ,{className:"totalUsed",children:[(0,g.jsx)("div",{className:"value",children:S.total}),(0,g.jsx)("div",{className:"unit",children:S.unit})]}),(0,g.jsx)(d.azJ,{className:"ofUsed",children:(0,g.jsxs)("div",{className:"value",children:["Of: ",(0,p.qO)(w)]})})]}),(0,g.jsx)(d.azJ,{sx:{marginLeft:"15px",height:"100%",display:"flex",alignItems:"flex-start"},children:(0,g.jsx)(d.azJ,{children:c?(0,g.jsx)(d.aHM,{style:{width:"26px",height:"26px"}}):(0,g.jsx)(d.wNL,{})})})]})]})},oe=w.Ay.div((e=>{let{theme:t}=e;return{display:"grid",alignItems:"center",gap:8,height:33,paddingLeft:15,gridTemplateColumns:"20px 1.5fr .5fr 20px",background:c()(t,"boxBackground","#FBFAFA"),"& .min-icon":{height:"12px",width:"12px",fill:c()(t,"signalColors.good","#4CCB92")},"& .ok-icon":{height:"8px",width:"8px",fill:c()(t,"signalColors.good","#4CCB92"),color:c()(t,"signalColors.good","#4CCB92")},"& .timeStatLabel":{fontSize:"12px",color:c()(t,"signalColors.good","#4CCB92"),fontWeight:600},"& .timeStatValue":{fontSize:"12px",color:c()(t,"signalColors.good","#4CCB92")}}})),de=e=>{let{icon:t,label:i,value:n,loading:a=!1}=e;return(0,g.jsxs)(oe,{className:"dashboard-time-stat-item",children:[a?(0,g.jsx)(d.aHM,{style:{width:10,height:10}}):t,(0,g.jsx)(d.azJ,{className:"timeStatLabel",children:i}),(0,g.jsx)(d.azJ,{className:"timeStatValue",children:n}),"n/a"!==n?(0,g.jsx)(d.BK0,{className:"ok-icon"}):null]})},xe=e=>{let{valueToRender:t="",loading:i=!1,iconWidget:n=null}=e;return(0,g.jsx)(d.azJ,{sx:{display:"flex",height:"47px",borderRadius:"2px","& .dashboard-time-stat-item":{height:"100%",width:"100%"}},children:(0,g.jsx)(de,{loading:i,icon:n,label:(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{sx:{display:"inline",[`@media (max-width: ${d.nmC.sm}px)`]:{display:"none"}},children:"Time since last"})," ","Heal Activity"]}),value:t})})},ce=e=>{let{valueToRender:t="",loading:i=!1,iconWidget:n=null}=e;return(0,g.jsx)(d.azJ,{sx:{display:"flex",height:"47px",borderRadius:"2px","& .dashboard-time-stat-item":{height:"100%",width:"100%"}},children:(0,g.jsx)(de,{loading:i,icon:n,label:(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{sx:{display:"inline",[`@media (max-width: ${d.nmC.sm}px)`]:{display:"none"}},children:"Time since last"})," ","Scan Activity"]}),value:t})})},me=e=>{let{valueToRender:t="",loading:i=!1,iconWidget:n=null}=e;return(0,g.jsx)(d.azJ,{sx:{display:"flex",height:47,borderRadius:2,"& .dashboard-time-stat-item":{height:"100%",width:"100%"}},children:(0,g.jsx)(de,{loading:i,icon:n,label:(0,g.jsx)(d.azJ,{children:"Uptime"}),value:t})})},pe=function(e,t,i,n,a){let l=arguments.length>5&&void 0!==arguments[5]&&arguments[5];switch(e.type){case m.singleValue:return(0,g.jsx)(le,{title:e.title,panelItem:e,timeStart:t,timeEnd:i,apiPrefix:a});case m.simpleWidget:let s,r=null;return 80===e.id?r=xe:81===e.id?r=ce:1===e.id&&(r=me),[80,81,1].includes(e.id)&&(s=e=>{let{valueToRender:t,loading:i,title:n,id:a,iconWidget:l}=e;return(0,g.jsx)(r,{valueToRender:t,loading:i,title:n,id:a,iconWidget:l})}),(0,g.jsx)(Y,{title:e.title,panelItem:e,timeStart:t,timeEnd:i,apiPrefix:a,iconWidget:e.widgetIcon,renderFn:s});case m.pieChart:return 50===e.id?(0,g.jsx)(X,{children:(0,g.jsx)(re,{value:e,timeStart:t,timeEnd:i,apiPrefix:a})}):(0,g.jsx)(Q,{title:e.title,panelItem:e,timeStart:t,timeEnd:i,apiPrefix:a});case m.linearGraph:case m.areaGraph:return(0,g.jsx)(G,{title:e.title,panelItem:e,timeStart:t,timeEnd:i,hideYAxis:e.disableYAxis,xAxisFormatter:e.xAxisFormatter,yAxisFormatter:e.yAxisFormatter,apiPrefix:a,areaWidget:e.type===m.areaGraph,zoomActivated:l});case m.barChart:return(0,g.jsx)(R,{title:e.title,panelItem:e,timeStart:t,timeEnd:i,apiPrefix:a,zoomActivated:l});case m.singleRep:const o=e.fillColor?e.fillColor:e.color;return(0,g.jsx)(ne,{title:e.title,panelItem:e,timeStart:t,timeEnd:i,propLoading:n,color:e.color,fillColor:o,apiPrefix:a});default:return null}},ge=[{sx:{minWidth:0,display:"grid",gap:"30px",gridTemplateColumns:"1fr 1fr 1fr 1fr",[`@media (max-width: ${d.nmC.sm}px)`]:{gridTemplateColumns:"1fr"},[`@media (max-width: ${d.nmC.md}px)`]:{gridTemplateColumns:"1fr 1fr"}},columns:[{componentId:66},{componentId:44},{componentId:500},{componentId:501}]},{sx:{display:"grid",minWidth:0,gap:"30px",gridTemplateColumns:"1fr 1fr",[`@media (max-width: ${d.nmC.md}px)`]:{gridTemplateColumns:"1fr"}},columns:[{componentId:50},{componentId:502}]},{sx:{display:"grid",minWidth:0,gap:"30px",gridTemplateColumns:"1fr 1fr 1fr",[`@media (max-width: ${d.nmC.md}px)`]:{gridTemplateColumns:"1fr"}},columns:[{componentId:80},{componentId:81},{componentId:1}]},{sx:{display:"grid",minWidth:0,gap:"30px",gridTemplateColumns:"1fr 1fr",[`@media (max-width: ${d.nmC.md}px)`]:{gridTemplateColumns:"1fr"}},columns:[{componentId:68},{componentId:52}]},{sx:{display:"grid",minWidth:0,gap:"30px",gridTemplateColumns:"1fr 1fr",[`@media (max-width: ${d.nmC.md}px)`]:{gridTemplateColumns:"1fr"}},columns:[{componentId:63},{componentId:70}]}],he=[{sx:{display:"grid",gridTemplateColumns:"1fr",gap:"30px"},columns:[{componentId:60}]},{sx:{display:"grid",minWidth:0,gap:"30px",gridTemplateColumns:"1fr 1fr",[`@media (max-width: ${d.nmC.md}px)`]:{gridTemplateColumns:"1fr"}},columns:[{componentId:71,sx:{flex:1,width:"50%",flexShrink:0}},{componentId:17,sx:{flex:1,width:"50%",flexShrink:0}}]},{sx:{display:"grid",gridTemplateColumns:"1fr",gap:"30px"},columns:[{componentId:73}]}],ue=[{sx:{display:"grid",minWidth:0,gridTemplateColumns:"1fr 1fr",gap:"30px"},columns:[{componentId:76},{componentId:77}]},{sx:{display:"grid",minWidth:0,gridTemplateColumns:"1fr 1fr",gap:"30px"},columns:[{componentId:82},{componentId:74}]}],fe=[{sx:{display:"grid",minWidth:0,gridTemplateColumns:"1fr 1fr",gap:"30px"},columns:[{componentId:11},{componentId:8}]}],je=e=>{let{children:t}=e;return(0,g.jsx)(d.azJ,{sx:{display:"grid",gridTemplateColumns:"1fr",gap:"30px"},children:t})};var Ce=i(94141);const ye=e=>{let{value:t,modalOpen:i,timeStart:a,timeEnd:s,apiPrefix:r}=e;const o=(0,l.jL)();return t?(0,g.jsx)(Ce.A,{title:t.title,onClose:()=>{o((0,N.Nv)())},modalOpen:i,wideLimit:!1,sx:{padding:0},children:(0,g.jsx)(n.Fragment,{children:pe(t,a,s,!0,r,!0)})}):null};var ve=i(71102),we=i(35475);const be=w.Ay.div((e=>{let{theme:t}=e;return{...(0,F.yE)(t),"& .metricText":{fontSize:70,lineHeight:1.1,color:c()(t,"signalColors.main","#07193E"),fontWeight:"bold"},"& .unitText":{fontSize:10,color:c()(t,"mutedText","#87888d"),fontWeight:"normal"},"& .subHeaderContainer":{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},"& .subMessage":{fontSize:10,color:c()(t,"mutedText","#87888d"),"&.bold":{fontWeight:"bold"}},"& .headerContainer":{display:"flex",justifyContent:"space-between"},"& .viewAll":{fontSize:10,color:c()(t,"signalColors.danger","#C83B51"),textTransform:"capitalize","& a, & a:hover, & a:visited, & a:active":{color:c()(t,"signalColors.danger","#C83B51")}}}})),ze=e=>{let{title:t,metricValue:i,metricUnit:a,subMessage:l,moreLink:s,rightComponent:r,extraMargin:o=!1}=e;const x=()=>(0,g.jsx)(n.Fragment,{children:(0,g.jsxs)("div",{className:"subHeaderContainer",children:[(0,g.jsxs)("div",{className:"leftSide",children:[(0,g.jsx)("div",{children:(0,g.jsxs)("span",{className:"metricText",children:[i,(0,g.jsx)("span",{className:"unitText",children:a})]})}),l&&(0,g.jsx)(d.azJ,{sx:{fontWeight:l.fontWeight||"normal"},children:l.message})]}),(0,g.jsx)("div",{className:"rightSide",children:r})]})}),c=()=>(0,g.jsx)(n.Fragment,{children:(0,g.jsxs)("div",{className:"headerContainer",children:[(0,g.jsx)("span",{className:"titleContainer",children:t}),s&&(0,g.jsx)(n.Fragment,{children:(0,g.jsx)("span",{className:"viewAll",children:(0,g.jsx)(we.N_,{to:s,children:"View All"})})})]})});return(0,g.jsx)(n.Fragment,{children:(0,g.jsx)(d.azJ,{withBorders:!0,sx:{height:200,padding:16,margin:o?"10px 20px 10px 0":""},children:""!==i&&(0,g.jsxs)(be,{children:[(0,g.jsx)(c,{}),(0,g.jsx)(x,{})]})})})},Se=e=>{let{title:t,leftComponent:i,rightComponent:a}=e;return(0,g.jsx)(n.Fragment,{children:(0,g.jsx)(ze,{title:t,metricValue:i,rightComponent:a})})},Ae=e=>{let{panelItem:t,timeStart:i,timeEnd:s,apiPrefix:r,statLabel:x}=e;const c=(0,l.jL)(),[m,p]=(0,n.useState)(!1),[h,u]=(0,n.useState)(""),f=(0,a.d4)((e=>e.dashboard.widgetLoadVersion));return(0,n.useEffect)((()=>{p(!0)}),[f]),(0,n.useEffect)((()=>{if(m){let e=0;if(null!==i&&null!==s){const t=s.toUnixInteger()-i.toUnixInteger(),n=Math.floor(t/60);e=n<1?15:n}W.A.invoke("GET",`/api/v1/${r}/info/widgets/${t.id}/?step=${e}&${null!==i?`&start=${i.toUnixInteger()}`:""}${null!==i&&null!==s?"&":""}${null!==s?`end=${s.toUnixInteger()}`:""}`).then((e=>{const i=y(e,t);u(i.data),p(!1)})).catch((e=>{c((0,o.C9)(e)),p(!1)}))}}),[m,t,s,i,c,r]),m?(0,g.jsx)(d.azJ,{sx:{width:"100%",paddingTop:"5px",textAlign:"center",margin:"auto"},children:(0,g.jsx)(d.aHM,{style:{width:12,height:12}})}):(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{className:"stat-value",children:h}),x]})},Ie=w.Ay.div((e=>{let{theme:t}=e;return{fontFamily:"Inter,sans-serif",color:c()(t,"signalColors.main","#07193E"),maxWidth:"321px",display:"flex",marginLeft:"auto",marginRight:"auto",cursor:"default","& .stat-text":{color:c()(t,"mutedText","#87888d"),fontSize:"12px",marginTop:"8px"}}})),Te=e=>{let{statItemLeft:t=null,statItemRight:i=null,icon:n=null,label:a=""}=e;return(0,g.jsx)(Ie,{children:(0,g.jsxs)(d.azJ,{sx:{flex:1,display:"flex",padding:"0 8px 0 8px",[`@media (max-width: ${d.nmC.sm}px)`]:{padding:"0 10px 0 10px"}},children:[(0,g.jsxs)(d.azJ,{sx:{flex:1,display:"flex",flexFlow:"column"},children:[(0,g.jsx)(d.azJ,{sx:{fontSize:"16px",fontWeight:600},children:a}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",alignItems:"center",gap:5,justifyContent:"space-between",paddingBottom:0,fontSize:55,flexFlow:"row",fontWeight:600,"& .stat-value":{textAlign:"center",height:"50px"},"& .min-icon":{marginRight:"8px",marginTop:"8px",height:"10px",width:"10px"},[`@media (max-width: ${d.nmC.sm}px)`]:{fontSize:35},[`@media (max-width: ${d.nmC.lg}px)`]:{fontSize:45},[`@media (max-width: ${d.nmC.xl}px)`]:{fontSize:50}},children:[t,i]})]}),(0,g.jsx)(d.azJ,{sx:{width:"20px",height:"20px",marginTop:"8px",maxWidth:"26px","& .min-icon":{width:"16px",height:"16px"}},children:n})]})})},Je=w.Ay.div((e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",marginTop:"5px",gap:8,"&.online":{"& .min-icon":{margin:0,fill:c()(t,"signalColors.good","#4CCB92")}},"&.offline":{"& .min-icon":{margin:0,fill:c()(t,"signalColors.danger","#C51B3F")}},"& .indicatorText":{color:c()(t,"mutedText","#C51B3F"),fontSize:12}}})),Fe=e=>{let{info:t,timeStart:i,timeEnd:n,apiPrefix:a}=e;const{mergedPanels:l=[],id:s}=t,[r,o]=l,x=(0,g.jsx)(Ae,{panelItem:r,timeStart:i,timeEnd:n,apiPrefix:a,statLabel:(0,g.jsxs)(Je,{className:"online",children:[(0,g.jsx)(d.GQ2,{}),(0,g.jsx)(d.azJ,{className:"indicatorText",children:"Online"})]})}),c=(0,g.jsx)(Ae,{panelItem:o,timeStart:i,timeEnd:n,apiPrefix:a,statLabel:(0,g.jsxs)(Je,{className:"offline",children:[(0,g.jsx)(d.GQ2,{}),(0,g.jsx)(d.azJ,{className:"indicatorText",children:"Offline"})]})});let m=null,p="";return 500===s?(m=(0,g.jsx)(d.WXN,{}),p="Servers"):501===s&&(m=(0,g.jsx)(d.JUN,{}),p="Drives"),(0,g.jsx)(Te,{statItemLeft:x,statItemRight:c,icon:m,label:p})},Ne=w.Ay.div((e=>{let{theme:t}=e;return{"& .putLabel":{display:"flex",gap:10,alignItems:"center",marginTop:"10px","& .min-icon":{height:15,width:15,fill:c()(t,"signalColors.good","#4CCB92")},"& .getText":{fontSize:"18px",color:c()(t,"mutedText","#87888d"),fontWeight:"bold"},"& .valueText":{fontSize:50,fontFamily:"Inter",fontWeight:600}}}})),$e=e=>{let{value:t,loading:i}=e;return(0,g.jsxs)(Ne,{children:[(0,g.jsxs)(d.azJ,{className:"putLabel",children:[(0,g.jsx)(d.azJ,{className:"getText",children:"GET"}),i?(0,g.jsx)(d.aHM,{style:{width:"15px",height:"15px"}}):(0,g.jsx)(d.OFF,{})]}),(0,g.jsx)(d.azJ,{className:"valueText",children:t})]})},Ee=w.Ay.div((e=>{let{theme:t}=e;return{"& .putLabel":{display:"flex",gap:10,alignItems:"center",marginTop:"10px","& .min-icon":{height:15,width:15,fill:c()(t,"signalColors.info","#2781B0")},"& .putText":{fontSize:"18px",color:c()(t,"mutedText","#87888d"),fontWeight:"bold"},"& .valueText":{fontSize:50,fontFamily:"Inter",fontWeight:600}}}})),Le=e=>{let{value:t,loading:i}=e;return(0,g.jsxs)(Ee,{children:[(0,g.jsxs)(d.azJ,{className:"putLabel",children:[(0,g.jsx)(d.azJ,{className:"putText",children:"PUT"}),i?(0,g.jsx)(d.aHM,{style:{width:"15px",height:"15px"}}):(0,g.jsx)(d.z8D,{})]}),(0,g.jsx)(d.azJ,{className:"valueText",children:t})]})},ke=w.Ay.div((e=>{let{theme:t}=e;return{flex:1,display:"flex",alignItems:"center",flexFlow:"row",gap:"15px","& .unitText":{fontSize:"14px",color:c()(t,"mutedText","#87888d"),marginLeft:"5px"},"& .unit":{color:c()(t,"mutedText","#87888d"),fontSize:"18px",marginLeft:"12px",marginTop:"10px"},[`@media (max-width: ${d.nmC.sm}px)`]:{flexFlow:"column"}}})),We=e=>{let{value:t,timeStart:i,timeEnd:n,apiPrefix:a}=e;const{mergedPanels:l=[]}=t,[s,r]=l,o=(0,g.jsx)(le,{title:t.title,panelItem:s,timeStart:i,timeEnd:n,apiPrefix:a,renderFn:e=>{let{valueToRender:t,loading:i,title:n,id:a}=e;return(0,g.jsx)(Le,{value:t,loading:i,title:n,id:a})}}),x=(0,g.jsx)(le,{title:t.title,panelItem:r,timeStart:i,timeEnd:n,apiPrefix:a,renderFn:e=>{let{valueToRender:t,loading:i,title:n,id:a}=e;return(0,g.jsx)($e,{value:t,loading:i,title:n,id:a})}});return(0,g.jsxs)(ke,{children:[(0,g.jsx)(d.azJ,{sx:{fontSize:"16px",fontWeight:600},children:"Network"}),(0,g.jsx)(d.azJ,{sx:{position:"relative",width:110,height:110,marginLeft:"auto",[`@media (max-width: ${d.nmC.sm}px)`]:{marginLeft:"0"}},children:(0,g.jsx)(d.azJ,{sx:{position:"absolute",display:"flex",flexFlow:"column",alignItems:"center",top:"50%",left:"50%",transform:"translate(-50%, -50%)",fontWeight:"bold",fontSize:12},children:x})}),(0,g.jsx)(d.azJ,{sx:{display:"flex",alignItems:"center",marginLeft:"auto",[`@media (max-width: ${d.nmC.sm}px)`]:{marginLeft:"0"}},children:(0,g.jsx)(d.azJ,{sx:{display:"flex",alignItems:"center","& .value":{fontSize:"50px",fontFamily:"Inter"}},children:o})}),(0,g.jsx)(d.azJ,{sx:{marginLeft:"15px",height:"100%",display:"flex",alignItems:"flex-start","& .min-icon":{height:"15px",width:"15px"}},children:(0,g.jsx)(d.vhL,{})})]})},Be=e=>{let{info:t,timeStart:i,timeEnd:n,loading:a,apiPrefix:l}=e;const{mergedPanels:s=[],title:r="",id:o}=t,[d,x]=s;return[500,501].includes(o)?(0,g.jsx)(X,{children:(0,g.jsx)(Fe,{info:t,timeStart:i,timeEnd:n,apiPrefix:l})}):502===o?(0,g.jsx)(X,{children:(0,g.jsx)(We,{apiPrefix:l,timeEnd:n,timeStart:i,value:t})}):(0,g.jsx)(Se,{title:r,leftComponent:pe(d,i,n,a,l),rightComponent:pe(x,i,n,a,l)})},De=w.Ay.div((e=>{let{theme:t}=e;return{fontFamily:"Inter,sans-serif",maxWidth:"321px",display:"flex",marginLeft:"auto",marginRight:"auto",cursor:"default",color:c()(t,"signalColors.main","#07193E"),"& .mainBox":{flex:1,display:"flex",padding:"0 8px 0 8px",[`@media (max-width: ${d.nmC.sm}px)`]:{padding:"0 10px 0 10px"},"& .indicatorIcon":{width:"20px",height:"20px",marginTop:"8px",maxWidth:"26px","& .min-icon":{width:"16px",height:"16px"}},"& .indicatorContainer":{flex:1,display:"flex",flexFlow:"column","& .indicatorLabel":{fontSize:"16px",fontWeight:600},"& .counterIndicator":{display:"flex",alignItems:"center",gap:"5px",justifyContent:"space-between",paddingBottom:0,fontSize:"55px",[`@media (max-width: ${d.nmC.sm}px)`]:{paddingBottom:10,fontSize:"35px"},[`@media (max-width: ${d.nmC.lg}px)`]:{fontSize:"45px"},[`@media (max-width: ${d.nmC.xl}px)`]:{fontSize:"50px"},flexFlow:"row",fontWeight:600,"& .stat-text":{color:c()(t,"mutedText","#87888D"),fontSize:"12px",marginTop:"8px"},"& .stat-value":{textAlign:"center",height:"50px"},"& .min-icon":{marginRight:"8px",marginTop:"8px",height:"10px",width:"10px"}},"& .onlineCounter":{display:"flex",alignItems:"center",marginTop:"5px","& .min-icon":{fill:c()(t,"signalColors.good","#4CCB92")}},"& .offlineCount":{display:"flex",alignItems:"center",marginTop:"8px","& .min-icon":{fill:c()(t,"signalColors.danger","#C51B3F")}}}}}})),Re=e=>{let{onlineCount:t=0,offlineCount:i=0,icon:n=null,label:a="",okStatusText:l="Online",notOkStatusText:s="Offline"}=e;return(0,g.jsx)(De,{children:(0,g.jsxs)(d.azJ,{className:"mainBox",children:[(0,g.jsxs)(d.azJ,{className:"indicatorContainer",children:[(0,g.jsx)(d.azJ,{className:"indicatorLabel",children:a}),(0,g.jsxs)(d.azJ,{className:"counterIndicator",children:[(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{className:"stat-value",children:t}),(0,g.jsxs)(d.azJ,{className:"onlineCounter",children:[(0,g.jsx)(d.GQ2,{}),(0,g.jsx)("div",{className:"stat-text",children:l})]})]}),(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{className:"stat-value",children:i}),(0,g.jsxs)(d.azJ,{className:"offlineCount",children:[(0,g.jsx)(d.GQ2,{})," ",(0,g.jsx)("div",{className:"stat-text",children:s})]})]})]})]}),(0,g.jsx)(d.azJ,{className:"indicatorIcon",children:n})]})})};var Me=i(39835),Oe=i.n(Me),Ue=i(71435);const Ve=w.Ay.div((e=>{let{theme:t}=e;return{alignItems:"baseline",padding:"5px",display:"flex",gap:"5px","& .StatBox":{display:"flex",alignItems:"center",justifyContent:"center",flexFlow:"column","& .stat-text":{color:c()(t,"mutedText","#87888d"),fontSize:"12px"},"& .stat-value":{fontSize:"18px",color:c()(t,"signalColors.main","#07193E"),display:"flex",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& .stat-container":{display:"flex",alignItems:"center",justifyContent:"center",flexFlow:"column",marginLeft:"5px",maxWidth:"40px","&:first-of-type(svg)":{fill:c()(t,"mutedText","#87888d")},"& .stat-indicator":{marginRight:"0px",justifyContent:"center",alignItems:"center",textAlign:"center","& svg.min-icon":{width:"10px",height:"10px"},"&.good":{"& svg.min-icon":{fill:c()(t,"signalColors.good","#4CCB92")}},"&.warn":{"& svg.min-icon":{fill:c()(t,"signalColors.warning","#FFBD62")}},"&.bad":{"& svg.min-icon":{fill:c()(t,"signalColors.danger","#C51B3F")}}}}}}}})),Pe=w.Ay.div((e=>{let{theme:t}=e;return{display:"flex",alignItems:"flex-start",flexFlow:"column",flex:1,"& .server-state":{marginLeft:"8px","& .min-icon":{height:"14px",width:"14px"},"&.good":{"& svg.min-icon":{fill:c()(t,"signalColors.good","#4CCB92")}},"&.warn":{"& svg.min-icon":{fill:c()(t,"signalColors.warning","#FFBD62")}},"&.bad":{"& svg.min-icon":{fill:c()(t,"signalColors.danger","#C51B3F")}}}}})),Ge=e=>{let{label:t="",value:i="",statusColor:n="warn",hasStatus:a=!1}=e;return(0,g.jsx)(Ve,{children:(0,g.jsxs)(d.azJ,{className:"StatBox",children:[(0,g.jsxs)("div",{className:"stat-value",children:[i," ",(0,g.jsx)(d.azJ,{className:"stat-container",children:a?(0,g.jsx)(d.azJ,{className:`stat-indicator ${n}`,children:(0,g.jsx)(d.GQ2,{})}):(0,g.jsx)(d.azJ,{sx:{width:"12px",height:"12px"}})})]}),(0,g.jsx)("div",{className:"stat-text",children:t})]})})},_e=e=>{let{server:t}=e;const i=Object.keys(c()(t,"network",{})),n=i.length,a=t.drives?t.drives.length:0,l=i.reduce(((e,i)=>"online"===(t.network?t.network[i]:"")?e+1:e),0),s=t.drives?t.drives.filter((e=>"ok"===e.state)).length:0;return(0,g.jsx)(Pe,{children:(0,g.jsxs)(d.azJ,{sx:{display:"flex",alignItems:"center",padding:"3px",gap:"15px",justifyContent:"space-between",width:"100%",paddingLeft:"20px",flexFlow:"row",[`@media (max-width: ${d.nmC.md}px)`]:{flexFlow:"column"}},children:[(0,g.jsxs)(d.azJ,{sx:{display:"flex",alignItems:"center"},children:[(0,g.jsx)(d.azJ,{sx:{fontWeight:600,textTransform:"none"},children:t.endpoint||""}),(null===t||void 0===t?void 0:t.state)&&(0,g.jsx)(d.azJ,{className:`server-state ${(0,Ue.Zb)(t.state)}`,children:(0,g.jsx)(d.GQ2,{})})]}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:"1.5",gap:"5%"},children:[(0,g.jsx)(Ge,{statusColor:(0,Ue.WJ)(s,a),label:"Drives",hasStatus:!0,value:`${s}/${a}`}),(0,g.jsx)(Ge,{statusColor:(0,Ue.CS)(l,n),label:"Network",hasStatus:!0,value:`${l}/${n}`}),(0,g.jsx)(Ge,{statusColor:"good",label:"Up time",value:null!==t&&void 0!==t&&t.uptime?(0,p.hr)(`${t.uptime}`):"N/A"})]}),(0,g.jsx)(Ge,{statusColor:"good",label:"",value:(0,g.jsxs)(d.azJ,{sx:{background:"rgb(235, 236, 237)",color:"#000000",paddingLeft:"10px",paddingRight:"10px",borderRadius:"2px",fontSize:"12px",marginTop:"5px","& .label":{fontWeight:600,marginRight:"3px"}},children:[(0,g.jsx)("span",{className:"label",children:"Version:"}),t.version?t.version:"N/A"]})})]})})},Ke=e=>{var t,i,a,l;let{drive:s}=e;const r=(0,w.DP)(),o=null!==(t=s.totalSpace)&&void 0!==t?t:0,x=null!==(i=s.usedSpace)&&void 0!==i?i:0,m=0!==o?Math.max(x/o*100,0):0,h=null!==(a=s.availableSpace)&&void 0!==a?a:0,u=0!==o?Math.max(h/o*100,0):0,f=(0,n.useMemo)((()=>{switch(s.state){case"offline":return Ue.Ez.RED;case"ok":return Ue.Ez.GREEN;default:return Ue.Ez.YELLOW}}),[s.state]),j=(0,n.useMemo)((()=>{switch(s.state){case"offline":return"Offline Drive";case"ok":return"Online Drive";default:return"Unknown"}}),[s.state]);return(0,g.jsxs)(d.azJ,{withBorders:!0,sx:{display:"flex",flexFlow:"row",padding:12,gap:24,alignItems:"center",[`@media (max-width: ${d.nmC.xs}px)`]:{flexFlow:"column",alignItems:"start"},"& .info-label":{color:c()(r,"mutedText","#87888d"),fontSize:12},"& .info-value":{fontSize:18,color:c()(r,"signalColors.main","#07193E"),display:"flex",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"& .drive-endpoint":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",wordBreak:"break-all",fontWeight:600,fontSize:16,[`@media (max-width: ${d.nmC.sm}px)`]:{fontSize:10}},"& .percentage-row":{display:"flex",gap:4,alignItems:"center",fontSize:12,"& .percentage-value":{fontWeight:700}}},children:[(0,g.jsx)(d.cNv,{chartLabel:"Used Capacity",label:!0,usedBytes:x,totalBytes:o,width:"153",height:"153"}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"column",gap:12,flex:1},children:[(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"row",gap:8,[`@media (max-width: ${d.nmC.xs}px)`]:{flexFlow:"column"}},children:[(0,g.jsxs)(d.azJ,{sx:{flex:"1 1 60%",[`@media (max-width: ${d.nmC.xs}px)`]:{flex:"1 1 100%"}},children:[(0,g.jsx)("label",{className:"info-label",children:"Drive Name"}),(0,g.jsx)(d.azJ,{className:"drive-endpoint",children:null!==(l=s.endpoint)&&void 0!==l?l:""})]}),(0,g.jsxs)(d.azJ,{sx:{flex:"1 1 20%",[`@media (max-width: ${d.nmC.xs}px)`]:{flex:"1 1 100%"}},children:[(0,g.jsx)("label",{className:"info-label",children:"Drive Status"}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"row",alignItems:"center",fontSize:12,fontWeight:600,gap:4,color:f,"& .min-icon":{height:8,width:8,flexShrink:0}},children:[(0,g.jsx)(d.GQ2,{}),j]})]})]}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"row",gap:36},children:[(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"column"},children:[(0,g.jsx)("label",{className:"info-label",children:"Used Capacity"}),(0,g.jsx)(d.azJ,{className:"info-value",children:(0,p.nO)(x.toString())}),(0,g.jsxs)(d.azJ,{className:"percentage-row",children:[(0,g.jsxs)(d.azJ,{className:"percentage-value",children:[m.toFixed(2),"%"]}),(0,g.jsxs)(d.azJ,{children:["of ",(0,p.nO)(o.toString())]})]})]}),(0,g.jsx)(d.azJ,{sx:{width:1,backgroundColor:c()(r,"borderColor","#BBBBBB")}}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"column"},children:[(0,g.jsx)("label",{className:"info-label",children:"Available Capacity"}),(0,g.jsx)(d.azJ,{className:"info-value",children:(0,p.nO)(h.toString())}),(0,g.jsxs)(d.azJ,{className:"percentage-row",children:[(0,g.jsxs)(d.azJ,{className:"percentage-value",children:[u.toFixed(2),"%"]}),(0,g.jsxs)(d.azJ,{children:["of ",(0,p.nO)(o.toString())]})]})]})]})]})]})},He=e=>{let{data:t}=e;const[i,a]=n.useState(t.length>1?"":t[0].endpoint+"-0"),l=e=>{a(e)};return(0,g.jsxs)(d.azJ,{children:[(0,g.jsxs)(d.azJ,{sx:{fontSize:18,lineHeight:2,fontWeight:700},children:["Servers (",t.length,")"]}),(0,g.jsx)(d.azJ,{children:t.map(((e,t)=>{var n,a;const s=`${e.endpoint}-${t}`,r=i===s;return(0,g.jsxs)(d.nD3,{expanded:r,onTitleClick:()=>{l(r?"":s)},id:"key",title:(0,g.jsx)(_e,{server:e,index:t}),sx:{marginBottom:15},children:[(0,g.jsxs)(d.azJ,{useBackground:!0,sx:{padding:"10px 30px",fontWeight:"bold"},children:["Drives (",null===(n=e.drives)||void 0===n?void 0:n.length,")"]}),(0,g.jsx)(d.azJ,{sx:{flex:1,display:"flex",flexDirection:"column",padding:"15px 30px",gap:15,[`@media (max-width: ${d.nmC.sm}px)`]:{padding:"10px 10px"}},children:null===(a=e.drives)||void 0===a?void 0:a.map(((e,t)=>(0,g.jsx)(Ke,{drive:e},`${e.endpoint}-${t}`)))})]},s)}))})]})},Qe=w.Ay.div((e=>{let{theme:t}=e;return{fontFamily:"Inter,sans-serif",color:c()(t,"signalColors.main","#07193E"),maxWidth:"300px",display:"flex",marginLeft:"auto",marginRight:"auto",cursor:"default",position:"relative",width:"100%"}})),qe=e=>{let{counterValue:t,label:i="",icon:n=null,actions:a=null}=e;return(0,g.jsx)(Qe,{children:(0,g.jsxs)(d.azJ,{sx:{flex:1,display:"flex",width:"100%",padding:"0 8px 0 8px",position:"absolute",[`@media (max-width: ${d.nmC.md}px)`]:{padding:"0 10px 0 10px"}},children:[(0,g.jsxs)(d.azJ,{sx:{flex:1,display:"flex",flexFlow:"column",marginTop:"8px",zIndex:10,overflow:"hidden"},children:[(0,g.jsx)(d.azJ,{sx:{fontSize:"16px",fontWeight:600},children:i}),(0,g.jsx)(d.m_M,{tooltip:t,placement:"bottom",children:(0,g.jsx)(d.azJ,{sx:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",maxWidth:187,flexFlow:"row",fontSize:t.toString().length>=5?50:55,[`@media (max-width: ${d.nmC.sm}px)`]:{flexFlow:"column",maxWidth:200,fontSize:t.toString().length>=5?20:35},[`@media (max-width: ${d.nmC.md}px)`]:{fontSize:t.toString().length>=5?28:35},[`@media (max-width: ${d.nmC.lg}px)`]:{fontSize:t.toString().length>=5?28:36},[`@media (max-width: ${d.nmC.xl}px)`]:{fontSize:t.toString().length>=5?45:50}},children:t})})]}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"column",alignItems:"center",justifyContent:"flex-start",marginTop:"8px",maxWidth:"26px","& .min-icon":{width:"16px",height:"16px"}},children:[n,(0,g.jsx)(d.azJ,{sx:{display:"flex"},children:a})]})]})})};var Ye=i(80882),Xe=i(99161),Ze=i(6681);const et=e=>{let{children:t}=e;return(0,g.jsx)(d.azJ,{withBorders:!0,sx:{padding:15,height:"136px",maxWidth:"100%",[`@media (max-width: ${d.nmC.sm}px)`]:{padding:5,maxWidth:"initial"}},children:t})},tt=e=>{var t,i,n,a,l,s,r,o,x,c;let{usage:m}=e;const h=m&&m.usage?m.usage.toString():"0",u=(e=>void 0===e?{total:"0",unit:"Mi"}:(0,p.GT)(e))(h),{lastScan:f="n/a",lastHeal:j="n/a",upTime:C="n/a"}={},y=(e=>e&&e.servers?[...e.servers].sort((function(e,t){var i,n;const a=(null===(i=e.endpoint)||void 0===i?void 0:i.toLowerCase())||"",l=(null===(n=t.endpoint)||void 0===n?void 0:n.toLowerCase())||"";return al?1:0})):[])(m);let v=[];y.forEach((e=>{var t;const i=null===(t=e.drives)||void 0===t?void 0:t.map((e=>e));i&&(v=[...v,...i])}));const w=Oe()(y,"state"),{offline:b=[],online:z=[]}=w,S=Oe()(v,"state"),{offline:A=[],ok:I=[]}=S;return(0,g.jsx)(d.azJ,{children:(0,g.jsxs)(d.azJ,{sx:{display:"grid",gridTemplateRows:"1fr",gridTemplateColumns:"1fr",gap:27,marginBottom:40},children:[(0,g.jsxs)(d.azJ,{sx:{display:"grid",gridTemplateColumns:"1fr",gap:"40px"},children:[(0,g.jsxs)(d.azJ,{sx:{display:"grid",gridTemplateRows:"136px",gridTemplateColumns:"1fr 1fr 1fr",gap:20,[`@media (max-width: ${d.nmC.sm}px)`]:{gridTemplateColumns:"1fr"},[`@media (max-width: ${d.nmC.md}px)`]:{marginBottom:0}},children:[(0,g.jsx)(et,{children:(0,g.jsx)(qe,{label:"Buckets",icon:(0,g.jsx)(d.brV,{}),counterValue:m?(0,p.dq)(m.buckets):0,actions:(0,g.jsx)(we.N_,{to:Xe.zZ.BUCKETS,style:{zIndex:3,textDecoration:"none",top:"40px",position:"relative",marginRight:"75px"},children:(0,g.jsx)(Ze.A,{tooltip:"Browse",children:(0,g.jsx)(d.$nd,{id:"browse-dashboard",onClick:()=>{},label:"Browse",icon:(0,g.jsx)(d.flY,{}),variant:"regular",style:{padding:5,height:30,fontSize:14,marginTop:20}})})})})}),(0,g.jsx)(et,{children:(0,g.jsx)(qe,{label:"Objects",icon:(0,g.jsx)(d.Sxe,{}),counterValue:m?(0,p.dq)(m.objects):0})}),(0,g.jsx)(et,{children:(0,g.jsx)(Re,{onlineCount:z.length,offlineCount:b.length,label:"Servers",icon:(0,g.jsx)(d.WXN,{})})}),(0,g.jsx)(et,{children:(0,g.jsx)(Re,{offlineCount:(null===m||void 0===m||null===(t=m.backend)||void 0===t?void 0:t.offlineDrives)||A.length,onlineCount:(null===m||void 0===m||null===(i=m.backend)||void 0===i?void 0:i.onlineDrives)||I.length,label:"Drives",icon:(0,g.jsx)(d.JUN,{})})}),(0,g.jsxs)(d.azJ,{withBorders:!0,sx:{gridRowStart:"1",gridRowEnd:"3",gridColumnStart:"3",padding:15,display:"grid",justifyContent:"stretch"},children:[(0,g.jsx)(Ye.A,{usageValue:h,total:u.total,unit:u.unit}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"column",gap:"14px"},children:[(0,g.jsx)(de,{icon:(0,g.jsx)(d.Sdx,{}),label:(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{sx:{display:"inline",[`@media (max-width: ${d.nmC.sm}px)`]:{display:"none"}},children:"Time since last"})," ","Heal Activity"]}),value:j}),(0,g.jsx)(de,{icon:(0,g.jsx)(d.Zui,{}),label:(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{sx:{display:"inline",[`@media (max-width: ${d.nmC.sm}px)`]:{display:"none"}},children:"Time since last"})," ","Scan Activity"]}),value:f}),(0,g.jsx)(de,{icon:(0,g.jsx)(d.Owo,{}),label:"Uptime",value:C})]})]})]}),(0,g.jsxs)(d.azJ,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"14px",[`@media (max-width: ${d.nmC.lg}px)`]:{gridTemplateColumns:"1fr"}},children:[(0,g.jsx)(de,{icon:(0,g.jsx)(d.NBP,{}),label:"Backend type",value:null!==(n=null===m||void 0===m||null===(a=m.backend)||void 0===a?void 0:a.backendType)&&void 0!==n?n:"Unknown"}),(0,g.jsx)(de,{icon:(0,g.jsx)(d.eXQ,{}),label:"Standard storage class parity",value:null!==(l=null===m||void 0===m||null===(s=m.backend)||void 0===s||null===(r=s.standardSCParity)||void 0===r?void 0:r.toString())&&void 0!==l?l:"n/a"}),(0,g.jsx)(de,{icon:(0,g.jsx)(d.eXQ,{}),label:"Reduced redundancy storage class parity",value:null!==(o=null===m||void 0===m||null===(x=m.backend)||void 0===x||null===(c=x.rrSCParity)||void 0===c?void 0:c.toString())&&void 0!==o?o:"n/a"})]}),(0,g.jsx)(d.azJ,{sx:{display:"grid",gridTemplateRows:"auto",gridTemplateColumns:"1fr",gap:"auto"},children:(0,g.jsx)(He,{data:y})})]}),"not configured"===(null===m||void 0===m?void 0:m.advancedMetricsStatus)&&(0,g.jsx)(d.azJ,{children:(0,g.jsx)(d.lVp,{iconComponent:(0,g.jsx)(d.uMc,{}),title:"We can\u2019t retrieve advanced metrics at this time.",help:(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{sx:{fontSize:"14px"},children:"MinIO Dashboard will display basic metrics as we couldn\u2019t connect to Prometheus successfully. Please try again in a few minutes. If the problem persists, you can review your configuration and confirm that Prometheus server is up and running."}),(0,g.jsx)(d.azJ,{sx:{paddingTop:20,fontSize:14},children:(0,g.jsx)("a",{href:"https://min.io/docs/minio/linux/operations/monitoring/collect-minio-metrics-using-prometheus.html",target:"_blank",rel:"noopener",children:"Read more about Prometheus on our Docs site."})})]})})})]})})},it=e=>{let{apiPrefix:t="admin",usage:i}=e;const a=(0,l.jL)(),o=(0,l.GV)((e=>e.dashboard.status)),x=(0,l.GV)((e=>e.dashboard.zoom.openZoom)),c=(0,l.GV)((e=>e.dashboard.zoom.widgetRender)),m=(0,l.GV)(r.s$),p=!(null===m||void 0===m||!m.includes("object-browser-only"));let h=!1;(null!==m&&void 0!==m&&m.includes("hide-menu")||p)&&(h=!0);const[u,f]=(0,n.useState)(null),[C,y]=(0,n.useState)(null),v=j,[w,b]=(0,n.useState)("info"),z=e=>e.reduce(((e,i,a)=>{const{columns:l=[]}=i,s=l.map(((e,i)=>{var l;return((e,i)=>(0,g.jsx)(n.Fragment,{children:e?(0,g.jsx)(n.Fragment,{children:(0,g.jsx)(d.azJ,{children:e.mergedPanels?(0,g.jsx)(Be,{info:e,timeStart:u,timeEnd:C,loading:!0,apiPrefix:t}):pe(e,u,C,!0,t,x)})}):null},`widget-${i}`))((l=e.componentId,v.find((e=>e.id===l))),`${a}-${i}`)}));return[...e,(0,g.jsx)(d.azJ,{sx:i.sx,children:s},`layout-row-${a}`)]}),[]),S="not configured"===(null===i||void 0===i?void 0:i.advancedMetricsStatus),A=(0,g.jsx)(d.azJ,{sx:{marginBottom:20},children:"info"===w?(0,g.jsxs)(d.xA9,{container:!0,children:[(0,g.jsx)(d.xA9,{item:!0,children:(0,g.jsx)(d.azJ,{sx:{fontSize:18,lineHeight:2,fontWeight:700},children:"Server Information"})}),(0,g.jsx)(d.xA9,{item:!0,xs:!0,children:(0,g.jsx)(d.xA9,{container:!0,direction:"row-reverse",children:(0,g.jsx)(d.xA9,{item:!0,children:(0,g.jsx)(d.$nd,{id:"sync",type:"button",variant:"callAction",onClick:()=>{a((0,s.i)())},disabled:"loading"===o,icon:(0,g.jsx)(d.Fjq,{}),label:"Sync"})})})})]}):(0,g.jsx)(ve.A,{timeStart:u,setTimeStart:f,timeEnd:C,setTimeEnd:y,triggerSync:()=>{a((0,N.pA)())}})});let I=[{tabConfig:{label:"Info",id:"info",disabled:!1},content:(0,g.jsxs)(n.Fragment,{children:[(!i||"loading"===o)&&(0,g.jsx)(d.z21,{}),i&&"idle"===o&&(0,g.jsxs)(n.Fragment,{children:[A,(0,g.jsx)(tt,{usage:i})]})]})},...[{tabConfig:{label:"Usage",id:"usage",disabled:S},content:(0,g.jsxs)(n.Fragment,{children:[A,(0,g.jsxs)(je,{children:["unavailable"===(null===i||void 0===i?void 0:i.advancedMetricsStatus)&&(0,g.jsx)(d.lVp,{iconComponent:(0,g.jsx)(d.uMc,{}),title:"We can\u2019t retrieve advanced metrics at this time.",help:(0,g.jsx)(d.azJ,{sx:{fontSize:"14px"},children:"It looks like Prometheus is not available or reachable at the moment."})}),v.length?z(ge):null]})]})},{tabConfig:{label:"Traffic",id:"traffic",disabled:S},content:(0,g.jsxs)(n.Fragment,{children:[A,(0,g.jsxs)(je,{children:["unavailable"===(null===i||void 0===i?void 0:i.advancedMetricsStatus)&&(0,g.jsx)(d.lVp,{iconComponent:(0,g.jsx)(d.uMc,{}),title:"We can\u2019t retrieve advanced metrics at this time.",help:(0,g.jsx)(d.azJ,{sx:{fontSize:"14px"},children:"It looks like Prometheus is not available or reachable at the moment."})}),v.length?z(he):null]})]})},{tabConfig:{label:"Resources",id:"resources",disabled:S},content:(0,g.jsxs)(n.Fragment,{children:[A,(0,g.jsxs)(je,{children:["unavailable"===(null===i||void 0===i?void 0:i.advancedMetricsStatus)&&(0,g.jsx)(d.lVp,{iconComponent:(0,g.jsx)(d.uMc,{}),title:"We can\u2019t retrieve advanced metrics at this time.",help:(0,g.jsx)(d.azJ,{sx:{fontSize:"14px"},children:"It looks like Prometheus is not available or reachable at the moment."})}),v.length?z(ue):null,(0,g.jsx)("h2",{style:{margin:0,borderBottom:"1px solid #dedede"},children:"Advanced"}),v.length?z(fe):null]})]})}]];return(0,g.jsxs)(d.Mxu,{sx:{padding:h?0:"2rem"},children:[x&&(0,g.jsx)(ye,{modalOpen:x,timeStart:u,timeEnd:C,widgetRender:0,value:c,apiPrefix:t}),(0,g.jsx)(d.tUM,{horizontal:!0,options:I,currentTabOrPath:w,onTabClick:e=>{b(e)}})]})};var nt=i(48793),at=i(88617);const lt=()=>{const e=(0,l.jL)(),[t,i]=(0,n.useState)(!1),d=(0,a.d4)((e=>e.dashboard.usage)),x=(0,a.d4)(r.s$),c=!(null===x||void 0===x||!x.includes("object-browser-only"));let m=!1;return(null!==x&&void 0!==x&&x.includes("hide-menu")||c)&&(m=!0),(0,n.useEffect)((()=>{t||(i(!0),e((0,s.i)()))}),[t,e]),(0,n.useEffect)((()=>{e((0,o.ph)("metrics"))}),[e]),(0,g.jsxs)(n.Fragment,{children:[!m&&(0,g.jsx)(nt.A,{label:"Metrics",actions:(0,g.jsx)(at.A,{})}),(0,g.jsx)(it,{usage:d})]})}}}]); -//# sourceMappingURL=2491.b81bd18c.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/2491.b81bd18c.chunk.js.map b/web-app/build/static/js/2491.b81bd18c.chunk.js.map deleted file mode 100644 index 5126f83bb..000000000 --- a/web-app/build/static/js/2491.b81bd18c.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"static/js/2491.b81bd18c.chunk.js","mappings":"yJAuCA,MAuIA,EAvI0BA,IASC,IATA,UACzBC,EAAS,aACTC,EAAY,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C,GAAoBA,EAAMyQ,UAAUwT,QACzDiE,GAAWnoB,EAAAA,EAAAA,IAAYooB,EAAAA,IACvBC,IAAmB,OAARF,QAAQ,IAARA,IAAAA,EAAUrd,SAAS,wBACpC,IAAIwd,GAAW,EAkBf,OAjBY,OAARH,QAAQ,IAARA,GAAAA,EAAUrd,SAAS,cAEZud,KADTC,GAAW,IAKbloB,EAAAA,EAAAA,YAAU,KACHuqB,IACHC,GAAW,GACXlrB,GAAS+pB,EAAAA,EAAAA,MACX,GACC,CAACkB,EAASjrB,KAEbU,EAAAA,EAAAA,YAAU,KACRV,GAASmrB,EAAAA,EAAAA,IAAY,WAAW,GAC/B,CAACnrB,KAGFlC,EAAAA,EAAAA,MAACmB,EAAAA,SAAQ,CAAApB,SAAA,EACL+qB,IACA9rB,EAAAA,EAAAA,KAACsuB,GAAAA,EAAiB,CAACzuB,MAAM,UAAUinB,SAAS9mB,EAAAA,EAAAA,KAACuuB,GAAAA,EAAQ,OAEvDvuB,EAAAA,EAAAA,KAACwuB,GAAW,CAAC9G,MAAOA,MACX,C","sources":["screens/Console/Common/FormComponents/DateRangeSelector/DateRangeSelector.tsx","screens/Console/Common/ModalWrapper/ModalWrapper.tsx","screens/Console/Dashboard/BasicDashboard/Utils.tsx","screens/Console/Dashboard/Prometheus/types.ts","screens/Console/Dashboard/Prometheus/utils.tsx","screens/Console/Dashboard/Prometheus/Widgets/ExpandGraphLink.tsx","screens/Console/Dashboard/DownloadWidgetDataButton.tsx","screens/Console/Dashboard/Prometheus/Widgets/tooltips/BarChartTooltip.tsx","screens/Console/Dashboard/Prometheus/Widgets/BarChartWidget.tsx","screens/Console/Dashboard/Prometheus/Widgets/tooltips/LineChartTooltip.tsx","screens/Console/Dashboard/Prometheus/Widgets/LinearGraphWidget.tsx","screens/Console/Dashboard/Prometheus/Widgets/PieChartWidget.tsx","screens/Console/Dashboard/Prometheus/Widgets/SimpleWidget.tsx","screens/Console/Dashboard/DashboardItemBox.tsx","screens/Console/Dashboard/Prometheus/Widgets/NumericStatCard.tsx","screens/Console/Dashboard/Prometheus/Widgets/BucketsCountItem.tsx","screens/Console/Dashboard/Prometheus/Widgets/ObjectsCountItem.tsx","screens/Console/Dashboard/Prometheus/Widgets/SingleRepWidget.tsx","screens/Console/Dashboard/Prometheus/Widgets/SingleValueWidget.tsx","screens/Console/Dashboard/Prometheus/Widgets/CapacityItem.tsx","screens/Console/Dashboard/TimeStatItem.tsx","screens/Console/Dashboard/Prometheus/Widgets/HealActivityRenderer.tsx","screens/Console/Dashboard/Prometheus/Widgets/ScanActivityRenderer.tsx","screens/Console/Dashboard/Prometheus/Widgets/UptimeActivityRenderer.tsx","screens/Console/Dashboard/Prometheus/widgetUtils.tsx","screens/Console/Dashboard/Prometheus/Widgets/LayoutUtil.tsx","screens/Console/Dashboard/Prometheus/ZoomWidget.tsx","screens/Console/Dashboard/CommonCard.tsx","screens/Console/Dashboard/Prometheus/MergedWidgets.tsx","screens/Console/Dashboard/Prometheus/Widgets/EntityStateStatItem.tsx","screens/Console/Dashboard/Prometheus/Widgets/DualStatCard.tsx","screens/Console/Dashboard/Prometheus/Widgets/EntityStateItemRenderer.tsx","screens/Console/Dashboard/Prometheus/Widgets/NetworkGetItem.tsx","screens/Console/Dashboard/Prometheus/Widgets/NetworkPutItem.tsx","screens/Console/Dashboard/Prometheus/Widgets/NetworkItem.tsx","screens/Console/Dashboard/Prometheus/Widgets/MergedWidgetsRenderer.tsx","screens/Console/Dashboard/BasicDashboard/StatusCountCard.tsx","screens/Console/Dashboard/BasicDashboard/ServerInfoItem.tsx","screens/Console/Dashboard/BasicDashboard/DriveInfoItem.tsx","screens/Console/Dashboard/BasicDashboard/ServersList.tsx","screens/Console/Dashboard/BasicDashboard/CounterCard.tsx","screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx","screens/Console/Dashboard/Prometheus/PrDashboard.tsx","screens/Console/Dashboard/Dashboard.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport {\n Button,\n SyncIcon,\n Grid,\n Box,\n breakPoints,\n TimeIcon,\n DateTimeInput,\n} from \"mds\";\nimport { DateTime } from \"luxon\";\n\ninterface IDateRangeSelector {\n timeStart: DateTime | null;\n setTimeStart: (value: DateTime | null) => void;\n timeEnd: DateTime | null;\n setTimeEnd: (value: DateTime | null) => void;\n triggerSync?: () => void;\n label?: string;\n startLabel?: string;\n endLabel?: string;\n}\n\nconst DateRangeSelector = ({\n timeStart,\n setTimeStart,\n timeEnd,\n setTimeEnd,\n triggerSync,\n label = \"Filter:\",\n startLabel = \"Start Time:\",\n endLabel = \"End Time:\",\n}: IDateRangeSelector) => {\n return (\n \n \n \n {label}\n \n \n \n \n {startLabel}\n \n }\n />\n \n \n {endLabel}\n \n }\n />\n \n\n {triggerSync && (\n \n }\n label={\"Sync\"}\n />\n \n )}\n \n \n );\n};\n\nexport default DateRangeSelector;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { ModalBox, Snackbar } from \"mds\";\nimport { CSSObject } from \"styled-components\";\nimport { AppState, useAppDispatch } from \"../../../../store\";\nimport { setModalSnackMessage } from \"../../../../systemSlice\";\nimport MainError from \"../MainError/MainError\";\n\ninterface IModalProps {\n onClose: () => void;\n modalOpen: boolean;\n title: string | React.ReactNode;\n children: any;\n wideLimit?: boolean;\n titleIcon?: React.ReactNode;\n iconColor?: \"default\" | \"delete\" | \"accept\";\n sx?: CSSObject;\n}\n\nconst ModalWrapper = ({\n onClose,\n modalOpen,\n title,\n children,\n wideLimit = true,\n titleIcon = null,\n iconColor = \"default\",\n sx,\n}: IModalProps) => {\n const dispatch = useAppDispatch();\n const [openSnackbar, setOpenSnackbar] = useState(false);\n\n const modalSnackMessage = useSelector(\n (state: AppState) => state.system.modalSnackBar,\n );\n\n useEffect(() => {\n dispatch(setModalSnackMessage(\"\"));\n }, [dispatch]);\n\n useEffect(() => {\n if (modalSnackMessage) {\n if (modalSnackMessage.message === \"\") {\n setOpenSnackbar(false);\n return;\n }\n // Open SnackBar\n if (modalSnackMessage.type !== \"error\") {\n setOpenSnackbar(true);\n }\n }\n }, [modalSnackMessage]);\n\n const closeSnackBar = () => {\n setOpenSnackbar(false);\n dispatch(setModalSnackMessage(\"\"));\n };\n\n let message = \"\";\n\n if (modalSnackMessage) {\n message = modalSnackMessage.detailedErrorMsg;\n if (message === \"\" || (message && message.length < 5)) {\n message = modalSnackMessage.message;\n }\n }\n\n return (\n \n \n \n {children}\n \n );\n};\n\nexport default ModalWrapper;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nexport const STATUS_COLORS = {\n RED: \"#C83B51\",\n GREEN: \"#4CCB92\",\n YELLOW: \"#FFBD62\",\n};\n\nexport const getDriveStatusColor = (\n activeDisks: number,\n totalDrives: number,\n) => {\n if (activeDisks <= totalDrives / 2) {\n return \"bad\";\n }\n if (totalDrives !== 2 && activeDisks === totalDrives / 2 + 1) {\n return \"warn\";\n }\n if (activeDisks === totalDrives) {\n return \"good\";\n }\n};\n\nexport const serverStatusColor = (health_status: string) => {\n switch (health_status) {\n case \"offline\":\n return \"bad\";\n case \"online\":\n return \"good\";\n default:\n return \"warn\";\n }\n};\nexport const getNetworkStatusColor = (\n activeNetwork: number,\n networkTotal: number,\n) => {\n if (activeNetwork <= networkTotal / 2) {\n return \"bad\";\n }\n if (activeNetwork === networkTotal / 2 + 1) {\n return \"warn\";\n }\n if (activeNetwork === networkTotal) {\n return \"good\";\n }\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport {\n IBarChartConfiguration,\n IBarChartRelation,\n IDataSRep,\n ILinearGraphConfiguration,\n IPieChartConfiguration,\n} from \"./Widgets/types\";\n\nexport enum widgetType {\n singleValue = \"singleValue\",\n linearGraph = \"linearGraph\",\n areaGraph = \"areaGraph\",\n barChart = \"barChart\",\n pieChart = \"pieChart\",\n singleRep = \"singleRep\",\n simpleWidget = \"simpleWidget\",\n}\n\nexport interface IDashboardPanel {\n id: number;\n mergedPanels?: IDashboardPanel[];\n title: string;\n data?: string | object[] | IDataSRep[];\n dataOuter?: string | object[];\n type?: widgetType;\n widgetIcon?: any;\n widgetConfiguration?:\n | ILinearGraphConfiguration[]\n | IBarChartConfiguration[]\n | IPieChartConfiguration;\n color?: string;\n fillColor?: string;\n innerLabel?: string;\n labelDisplayFunction?: (value: string) => any;\n disableYAxis?: boolean;\n xAxisFormatter?: (item: string) => string;\n yAxisFormatter?: (item: string) => string;\n customStructure?: IBarChartRelation[];\n}\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport get from \"lodash/get\";\nimport { IDashboardPanel, widgetType } from \"./types\";\nimport {\n getTimeFromTimestamp,\n niceBytes,\n niceDays,\n representationNumber,\n textToRGBColor,\n units,\n} from \"../../../../common/utils\";\nimport { DiagnosticsIcon, HealIcon, UptimeIcon } from \"mds\";\n\nconst colorsMain = [\n \"#C4D4E9\",\n \"#DCD1EE\",\n \"#D1EEE7\",\n \"#EEDED1\",\n \"#AAF38F\",\n \"#F9E6C5\",\n \"#C83B51\",\n \"#F4CECE\",\n \"#D6D6D6\",\n];\n\nconst niceDaysFromNS = (seconds: string) => {\n return niceDays(seconds, \"ns\");\n};\n\nconst roundNumber = (value: string) => {\n return parseInt(value).toString(10);\n};\n\nexport const panelsConfiguration: IDashboardPanel[] = [\n {\n id: 1,\n title: \"Uptime\",\n data: \"N/A\",\n type: widgetType.simpleWidget,\n widgetIcon: ,\n labelDisplayFunction: niceDays,\n },\n {\n id: 50,\n title: \"Capacity\",\n data: [],\n dataOuter: [{ name: \"outer\", value: 100 }],\n widgetConfiguration: {\n outerChart: {\n colorList: [\"#9c9c9c\"],\n innerRadius: 0,\n outerRadius: 0,\n startAngle: 0,\n endAngle: 0,\n },\n innerChart: {\n colorList: colorsMain,\n innerRadius: 20,\n outerRadius: 50,\n startAngle: 90,\n endAngle: -200,\n },\n },\n type: widgetType.pieChart,\n innerLabel: \"N/A\",\n labelDisplayFunction: niceBytes,\n },\n {\n id: 51,\n title: \"Usable Capacity\",\n data: [],\n dataOuter: [{ name: \"outer\", value: 100 }],\n widgetConfiguration: {\n outerChart: {\n colorList: [\"#9c9c9c\"],\n innerRadius: 0,\n outerRadius: 0,\n startAngle: 0,\n endAngle: 0,\n },\n innerChart: {\n colorList: colorsMain,\n innerRadius: 20,\n outerRadius: 50,\n startAngle: 90,\n endAngle: -200,\n },\n },\n type: widgetType.pieChart,\n innerLabel: \"N/A\",\n labelDisplayFunction: niceBytes,\n },\n {\n id: 68,\n title: \"Data Usage Growth\",\n data: [],\n widgetConfiguration: [\n {\n dataKey: \"\",\n keyLabel: \"\",\n lineColor: \"#000\",\n fillColor: \"#000\",\n },\n ],\n type: widgetType.areaGraph,\n yAxisFormatter: niceBytes,\n xAxisFormatter: getTimeFromTimestamp,\n },\n {\n id: 52,\n title: \"Object size distribution\",\n data: [],\n widgetConfiguration: [\n {\n dataKey: \"a\",\n color: \"#2781B0\",\n background: {\n fill: \"#EEF1F4\",\n },\n greatestColor: \"#081C42\",\n },\n ],\n customStructure: [\n { originTag: \"LESS_THAN_1024_B\", displayTag: \"Less than 1024B\" },\n {\n originTag: \"BETWEEN_1024_B_AND_1_MB\",\n displayTag: \"Between 1024B and 1MB\",\n },\n {\n originTag: \"BETWEEN_1_MB_AND_10_MB\",\n displayTag: \"Between 1MB and 10MB\",\n },\n {\n originTag: \"BETWEEN_10_MB_AND_64_MB\",\n displayTag: \"Between 10MB and 64MB\",\n },\n {\n originTag: \"BETWEEN_64_MB_AND_128_MB\",\n displayTag: \"Between 64MB and 128MB\",\n },\n {\n originTag: \"BETWEEN_128_MB_AND_512_MB\",\n displayTag: \"Between 128MB and 512MB\",\n },\n {\n originTag: \"GREATER_THAN_512_MB\",\n displayTag: \"Greater than 512MB\",\n },\n ],\n type: widgetType.barChart,\n },\n {\n id: 66,\n title: \"Buckets\",\n data: [],\n innerLabel: \"N/A\",\n type: widgetType.singleRep,\n color: \"#0071BC\",\n fillColor: \"#ADD5E0\",\n },\n {\n id: 44,\n title: \"Objects\",\n data: [],\n innerLabel: \"N/A\",\n type: widgetType.singleRep,\n color: \"#0071BC\",\n fillColor: \"#ADD5E0\",\n },\n {\n id: 63,\n title: \"API Data Received Rate\",\n data: [],\n widgetConfiguration: [\n {\n dataKey: \"\",\n keyLabel: \"\",\n lineColor: \"#000\",\n fillColor: \"#000\",\n strokeWidth: 3,\n },\n ],\n type: widgetType.linearGraph,\n\n xAxisFormatter: getTimeFromTimestamp,\n yAxisFormatter: niceBytes,\n },\n {\n id: 61,\n title: \"Total Open FDs\",\n data: [],\n innerLabel: \"N/A\",\n type: widgetType.singleRep,\n color: \"#22B573\",\n fillColor: \"#A6E8C4\",\n },\n {\n id: 62,\n title: \"Total Goroutines\",\n data: [],\n innerLabel: \"N/A\",\n type: widgetType.singleRep,\n color: \"#F7655E\",\n fillColor: \"#F4CECE\",\n },\n {\n id: 77,\n title: \"Node CPU Usage\",\n data: [],\n widgetConfiguration: [\n {\n dataKey: \"\",\n keyLabel: \"\",\n lineColor: \"#000\",\n fillColor: \"#000\",\n },\n ],\n type: widgetType.linearGraph,\n\n yAxisFormatter: roundNumber,\n xAxisFormatter: getTimeFromTimestamp,\n },\n {\n id: 60,\n title: \"API Request Rate\",\n data: [],\n widgetConfiguration: [\n {\n dataKey: \"\",\n keyLabel: \"\",\n lineColor: \"#000\",\n fillColor: \"#000\",\n },\n ],\n type: widgetType.linearGraph,\n yAxisFormatter: roundNumber,\n xAxisFormatter: getTimeFromTimestamp,\n },\n {\n id: 70,\n title: \"API Data Sent Rate\",\n data: [],\n widgetConfiguration: [\n {\n dataKey: \"\",\n keyLabel: \"\",\n lineColor: \"#000\",\n fillColor: \"#000\",\n },\n ],\n type: widgetType.linearGraph,\n\n xAxisFormatter: getTimeFromTimestamp,\n yAxisFormatter: niceBytes,\n },\n {\n id: 17,\n title: \"Internode Data Transfer\",\n data: [],\n widgetConfiguration: [\n {\n dataKey: \"\",\n keyLabel: \"\",\n lineColor: \"#000\",\n fillColor: \"#000\",\n },\n ],\n type: widgetType.linearGraph,\n\n yAxisFormatter: niceBytes,\n xAxisFormatter: getTimeFromTimestamp,\n },\n {\n id: 73,\n title: \"Node IO\",\n data: [],\n widgetConfiguration: [\n {\n dataKey: \"\",\n keyLabel: \"\",\n lineColor: \"#000\",\n fillColor: \"#000\",\n },\n ],\n type: widgetType.linearGraph,\n\n yAxisFormatter: niceBytes,\n xAxisFormatter: getTimeFromTimestamp,\n },\n {\n id: 80,\n title: \"Time Since Last Heal Activity\",\n data: \"N/A\",\n type: widgetType.simpleWidget,\n widgetIcon: ,\n labelDisplayFunction: niceDaysFromNS,\n },\n {\n id: 81,\n title: \"Time Since Last Scan Activity\",\n data: \"N/A\",\n type: widgetType.simpleWidget,\n widgetIcon: ,\n labelDisplayFunction: niceDaysFromNS,\n },\n {\n id: 71,\n title: \"API Request Error Rate\",\n data: [],\n widgetConfiguration: [\n {\n dataKey: \"\",\n keyLabel: \"\",\n lineColor: \"#000\",\n fillColor: \"#000\",\n },\n ],\n type: widgetType.linearGraph,\n\n xAxisFormatter: getTimeFromTimestamp,\n },\n {\n id: 76,\n title: \"Node Memory Usage\",\n data: [],\n widgetConfiguration: [\n {\n dataKey: \"\",\n keyLabel: \"\",\n lineColor: \"#000\",\n fillColor: \"#000\",\n },\n ],\n type: widgetType.linearGraph,\n\n xAxisFormatter: getTimeFromTimestamp,\n yAxisFormatter: niceBytes,\n },\n {\n id: 74,\n title: \"Drive Used Capacity\",\n data: [],\n widgetConfiguration: [\n {\n dataKey: \"\",\n keyLabel: \"\",\n lineColor: \"#000\",\n fillColor: \"#000\",\n },\n ],\n type: widgetType.linearGraph,\n\n xAxisFormatter: getTimeFromTimestamp,\n yAxisFormatter: niceBytes,\n },\n {\n id: 82,\n title: \"Drives Free Inodes\",\n data: [],\n widgetConfiguration: [\n {\n dataKey: \"\",\n keyLabel: \"\",\n lineColor: \"#000\",\n fillColor: \"#000\",\n },\n ],\n type: widgetType.linearGraph,\n\n disableYAxis: true,\n xAxisFormatter: getTimeFromTimestamp,\n },\n {\n id: 11,\n title: \"Node Syscalls\",\n data: [],\n widgetConfiguration: [\n {\n dataKey: \"\",\n keyLabel: \"\",\n lineColor: \"#000\",\n fillColor: \"#000\",\n },\n ],\n type: widgetType.linearGraph,\n yAxisFormatter: roundNumber,\n xAxisFormatter: getTimeFromTimestamp,\n },\n {\n id: 8,\n title: \"Node File Descriptors\",\n data: [],\n widgetConfiguration: [\n {\n dataKey: \"\",\n keyLabel: \"\",\n lineColor: \"#000\",\n fillColor: \"#000\",\n },\n ],\n type: widgetType.linearGraph,\n yAxisFormatter: roundNumber,\n xAxisFormatter: getTimeFromTimestamp,\n },\n {\n id: 500,\n mergedPanels: [\n {\n id: 53,\n title: \"Online\",\n data: \"N/A\",\n type: widgetType.singleValue,\n },\n {\n id: 69,\n title: \"Offline\",\n data: \"N/A\",\n type: widgetType.singleValue,\n },\n ],\n title: \"Servers\",\n },\n {\n id: 501,\n mergedPanels: [\n {\n id: 9,\n title: \"Online\",\n data: \"N/A\",\n type: widgetType.singleValue,\n },\n {\n id: 78,\n title: \"Offline\",\n data: \"N/A\",\n type: widgetType.singleValue,\n },\n ],\n title: \"Drives\",\n },\n {\n id: 502,\n mergedPanels: [\n {\n id: 65,\n title: \"Upload\",\n data: \"N/A\",\n type: widgetType.singleValue,\n\n labelDisplayFunction: niceBytes,\n },\n {\n id: 64,\n title: \"Download\",\n data: \"N/A\",\n type: widgetType.singleValue,\n\n labelDisplayFunction: niceBytes,\n },\n ],\n title: \"Network\",\n },\n];\n\nconst calculateMainValue = (elements: any[], metricCalc: string) => {\n if (elements.length === 0) {\n return [\"\", \"0\"];\n }\n\n switch (metricCalc) {\n case \"mean\":\n const sumValues = elements.reduce((accumulator, currValue) => {\n return accumulator + parseFloat(currValue[1]);\n }, 0);\n\n const mean = Math.floor(sumValues / elements.length);\n\n return [\"\", mean.toString()];\n default:\n const sortResult = elements.sort(\n (value1: any[], value2: any[]) => value1[0] - value2[0],\n );\n\n return sortResult[sortResult.length - 1];\n }\n};\n\nconst constructLabelNames = (metrics: any, legendFormat: string) => {\n const keysToReplace = Object.keys(metrics);\n const expToReplace = new RegExp(`{{(${keysToReplace.join(\"|\")})}}`, \"g\");\n\n let replacedLegend = legendFormat.replace(expToReplace, (matchItem) => {\n const nwMatchItem = matchItem.replace(/({{|}})/g, \"\");\n return metrics[nwMatchItem];\n });\n\n const countVarsOpen = (replacedLegend.match(/{{/g) || []).length;\n const countVarsClose = (replacedLegend.match(/}}/g) || []).length;\n\n let cleanLegend = replacedLegend.replace(/{{(.*?)}}/g, \"\");\n\n if (\n countVarsOpen === countVarsClose &&\n countVarsOpen !== 0 &&\n countVarsClose !== 0\n ) {\n keysToReplace.forEach((element) => {\n replacedLegend = replacedLegend.replace(element, metrics[element]);\n });\n\n cleanLegend = replacedLegend;\n }\n\n // In case not all the legends were replaced, we remove the placeholders.\n return cleanLegend;\n};\n\nexport const widgetDetailsToPanel = (\n payloadData: any,\n panelItem: IDashboardPanel,\n) => {\n if (!payloadData) {\n return panelItem;\n }\n\n const typeOfPayload = payloadData.type;\n\n switch (panelItem.type) {\n case widgetType.singleValue:\n case widgetType.simpleWidget:\n if (typeOfPayload === \"stat\" || typeOfPayload === \"singlestat\") {\n // We sort values & get the last value\n let elements = get(payloadData, \"targets[0].result[0].values\", []);\n\n if (elements === null) {\n elements = [];\n }\n\n const metricCalc = get(\n payloadData,\n \"options.reduceOptions.calcs[0]\",\n \"lastNotNull\",\n );\n\n const valueDisplay = calculateMainValue(elements, metricCalc);\n\n const data = panelItem.labelDisplayFunction\n ? panelItem.labelDisplayFunction(valueDisplay[1])\n : valueDisplay[1];\n\n return {\n ...panelItem,\n data,\n };\n }\n break;\n case widgetType.pieChart:\n if (typeOfPayload === \"gauge\") {\n const metricCalc = get(\n payloadData,\n \"options.reduceOptions.calcs[0]\",\n \"lastNotNull\",\n );\n\n let chartSeries = get(payloadData, \"targets\", []).filter(\n (seriesItem: any) => seriesItem !== null,\n );\n\n const values = chartSeries.map((chartTarget: any) => {\n const resultMap =\n chartTarget.result && Array.isArray(chartTarget.result)\n ? chartTarget.result\n : [];\n\n const values = resultMap.map((elementValue: any) => {\n const values = get(elementValue, \"values\", []);\n const metricKeyItem = Object.keys(elementValue.metric);\n const sortResult = values.sort(\n (value1: any[], value2: any[]) =>\n parseInt(value1[0][1]) - parseInt(value2[0][1]),\n );\n\n const metricName = elementValue.metric[metricKeyItem[0]];\n const value = sortResult[sortResult.length - 1];\n return {\n name: metricName,\n value: parseInt(value[1]),\n legend: chartTarget.legendFormat,\n };\n });\n\n return values;\n });\n\n const firstTarget =\n chartSeries[0].result && chartSeries[0].result.length > 0\n ? chartSeries[0].result[0].values\n : [];\n\n const totalValues = calculateMainValue(firstTarget, metricCalc);\n\n const innerLabel = panelItem.labelDisplayFunction\n ? panelItem.labelDisplayFunction(totalValues[1])\n : totalValues[1];\n\n return {\n ...panelItem,\n data: values,\n innerLabel,\n };\n }\n break;\n case widgetType.linearGraph:\n case widgetType.areaGraph:\n if (typeOfPayload === \"graph\") {\n let targets = get(payloadData, \"targets\", []);\n if (targets === null) {\n targets = [];\n }\n\n const series: any[] = [];\n const plotValues: any[] = [];\n\n targets.forEach(\n (\n targetMaster: { legendFormat: string; result: any[] },\n index: number,\n ) => {\n // Add a new serie to plot variables in case it is not from multiple values\n let results = get(targetMaster, \"result\", []);\n const legendFormat = targetMaster.legendFormat;\n if (results === null) {\n results = [];\n }\n\n results.forEach((itemVals: { metric: object; values: any[] }) => {\n // Label Creation\n const labelName = constructLabelNames(\n itemVals.metric,\n legendFormat,\n );\n const keyName = `key_${index}${labelName}`;\n\n // series creation with recently created label\n series.push({\n dataKey: keyName,\n keyLabel: labelName,\n lineColor: \"\",\n fillColor: \"\",\n });\n\n // we iterate over values and create elements\n let values = get(itemVals, \"values\", []);\n if (values === null) {\n values = [];\n }\n\n values.forEach((valInfo: any[]) => {\n const itemIndex = plotValues.findIndex(\n (element) => element.name === valInfo[0],\n );\n\n // Element not exists yet\n if (itemIndex === -1) {\n let itemToPush: any = { name: valInfo[0] };\n itemToPush[keyName] = valInfo[1];\n\n plotValues.push(itemToPush);\n } else {\n plotValues[itemIndex][keyName] = valInfo[1];\n }\n });\n });\n },\n );\n\n const sortedSeries = series.sort((series1: any, series2: any) => {\n if (series1.keyLabel < series2.keyLabel) {\n return -1;\n }\n if (series1.keyLabel > series2.keyLabel) {\n return 1;\n }\n return 0;\n });\n\n const seriesWithColors = sortedSeries.map(\n (serialC: any, index: number) => {\n return {\n ...serialC,\n lineColor: colorsMain[index] || textToRGBColor(serialC.keyLabel),\n fillColor: colorsMain[index] || textToRGBColor(serialC.keyLabel),\n };\n },\n );\n\n const sortedVals = plotValues.sort(\n (value1: any, value2: any) => value1.name - value2.name,\n );\n\n return {\n ...panelItem,\n widgetConfiguration: seriesWithColors,\n data: sortedVals,\n };\n }\n break;\n case widgetType.barChart:\n if (typeOfPayload === \"bargauge\") {\n let chartBars = get(payloadData, \"targets[0].result\", []);\n\n if (chartBars === null) {\n chartBars = [];\n }\n\n const sortFunction = (value1: any[], value2: any[]) =>\n value1[0] - value2[0];\n\n let values = [];\n if (panelItem.customStructure) {\n values = panelItem.customStructure.map((structureItem) => {\n const metricTake = chartBars.find((element: any) => {\n return element.metric.range === structureItem.originTag;\n });\n\n const elements = get(metricTake, \"values\", []);\n\n const sortResult = elements.sort(sortFunction);\n const lastValue = sortResult[sortResult.length - 1] || [\"\", \"0\"];\n\n return {\n name: structureItem.displayTag,\n a: parseInt(lastValue[1]),\n };\n });\n } else {\n // If no configuration is set, we construct the series for bar chart and return the element\n values = chartBars.map((elementValue: any) => {\n const metricKeyItem = Object.keys(elementValue.metric);\n\n const metricName = elementValue.metric[metricKeyItem[0]];\n\n const elements = get(elementValue, \"values\", []);\n\n const sortResult = elements.sort(sortFunction);\n const lastValue = sortResult[sortResult.length - 1] || [\"\", \"0\"];\n return { name: metricName, a: parseInt(lastValue[1]) };\n });\n }\n\n return {\n ...panelItem,\n data: values,\n };\n }\n break;\n case widgetType.singleRep:\n if (typeOfPayload === \"stat\") {\n // We sort values & get the last value\n let elements = get(payloadData, \"targets[0].result[0].values\", []);\n if (elements === null) {\n elements = [];\n }\n const metricCalc = get(\n payloadData,\n \"options.reduceOptions.calcs[0]\",\n \"lastNotNull\",\n );\n\n const valueDisplay = calculateMainValue(elements, metricCalc);\n\n const sortResult = elements.sort(\n (value1: any[], value2: any[]) => value1[0] - value2[0],\n );\n\n let valuesForBackground = [];\n\n if (sortResult.length === 1) {\n valuesForBackground.push({ value: 0 });\n }\n\n sortResult.forEach((eachVal: any) => {\n valuesForBackground.push({ value: parseInt(eachVal[1]) });\n });\n\n const innerLabel = panelItem.labelDisplayFunction\n ? panelItem.labelDisplayFunction(valueDisplay[1])\n : valueDisplay[1];\n\n return {\n ...panelItem,\n data: valuesForBackground,\n innerLabel,\n };\n }\n break;\n }\n\n return panelItem;\n};\n\nconst verifyNumeric = (item: string) => {\n return !isNaN(parseFloat(item));\n};\n\nexport const splitSizeMetric = (val: string) => {\n const splittedText = val.split(\" \");\n // Value is not a size metric, we return as common string\n\n const singleValue = () => {\n let vl = val;\n\n if (verifyNumeric(val)) {\n vl = representationNumber(parseFloat(val));\n }\n return {vl};\n };\n\n if (splittedText.length !== 2) {\n return singleValue();\n }\n\n if (!units.includes(splittedText[1])) {\n return singleValue();\n }\n\n return (\n \n {splittedText[0]}\n {splittedText[1]}\n \n );\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Box, ExpandIcon } from \"mds\";\n\nimport { IDashboardPanel } from \"../types\";\n\nimport { openZoomPage } from \"../../dashboardSlice\";\nimport { useAppDispatch } from \"../../../../../store\";\n\nconst ExpandGraphLink = ({ panelItem }: { panelItem: IDashboardPanel }) => {\n const dispatch = useAppDispatch();\n return (\n \n {\n dispatch(openZoomPage(panelItem));\n }}\n className={\"zoom-graph-icon\"}\n >\n \n \n \n );\n};\n\nexport default ExpandGraphLink;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport { Box, DownloadIcon, DropdownSelector } from \"mds\";\nimport { exportComponentAsPNG } from \"react-component-export-image\";\nimport { ErrorResponseHandler } from \"../../../common/types\";\nimport { useAppDispatch } from \"../../../../src/store\";\nimport { setErrorSnackMessage } from \"../../../../src/systemSlice\";\n\ninterface IDownloadWidgetDataButton {\n title: any;\n componentRef: any;\n data: any;\n}\n\nconst DownloadWidgetDataButton = ({\n title,\n componentRef,\n data,\n}: IDownloadWidgetDataButton) => {\n const [anchorEl, setAnchorEl] = React.useState(null);\n const openDownloadMenu = Boolean(anchorEl);\n const handleClick = (event: React.MouseEvent) => {\n setAnchorEl(event.currentTarget);\n };\n const handleCloseDownload = () => {\n setAnchorEl(null);\n };\n const download = (filename: string, text: string) => {\n let element = document.createElement(\"a\");\n element.setAttribute(\"href\", \"data:text/plain;charset=utf-8,\" + text);\n element.setAttribute(\"download\", filename);\n\n element.style.display = \"none\";\n document.body.appendChild(element);\n\n element.click();\n document.body.removeChild(element);\n };\n\n const dispatch = useAppDispatch();\n const onDownloadError = (err: ErrorResponseHandler) =>\n dispatch(setErrorSnackMessage(err));\n\n const convertToCSV = (objectToConvert: any) => {\n const array = [Object.keys(objectToConvert[0])].concat(objectToConvert);\n return array\n .map((it) => {\n return Object.values(it).toString();\n })\n .join(\"\\n\");\n };\n\n const widgetDataCSVFileName = () => {\n if (title !== null) {\n return (title + \"_\" + Date.now().toString() + \".csv\")\n .replace(/\\s+/g, \"\")\n .trim()\n .toLowerCase();\n } else {\n return \"widgetData_\" + Date.now().toString() + \".csv\";\n }\n };\n\n const downloadAsCSV = () => {\n if (data !== null && data.length > 0) {\n download(widgetDataCSVFileName(), convertToCSV(data));\n } else {\n let err: ErrorResponseHandler;\n err = {\n errorMessage: \"Unable to download widget data\",\n detailedError: \"Unable to download widget data - data not available\",\n };\n onDownloadError(err);\n }\n };\n\n const downloadAsPNG = () => {\n if (title !== null) {\n const pngFileName = (title + \"_\" + Date.now().toString() + \".png\")\n .replace(/\\s+/g, \"\")\n .trim()\n .toLowerCase();\n exportComponentAsPNG(componentRef, { fileName: pngFileName });\n } else {\n const pngFileName = \"widgetData_\" + Date.now().toString() + \".png\";\n exportComponentAsPNG(componentRef, { fileName: pngFileName });\n }\n };\n\n const handleSelectedOption = (selectOption: string) => {\n if (selectOption === \"csv\") {\n downloadAsCSV();\n } else if (selectOption === \"png\") {\n downloadAsPNG();\n }\n };\n\n return (\n \n \n \n handleSelectedOption(value)}\n hideTriggerAction={() => {\n handleCloseDownload();\n }}\n open={openDownloadMenu}\n anchorEl={anchorEl}\n anchorOrigin={\"end\"}\n />\n \n \n );\n};\n\nexport default DownloadWidgetDataButton;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Box } from \"mds\";\nimport { tooltipCommon } from \"../../../../Common/FormComponents/common/styleLibrary\";\n\nconst BarChartTooltip = ({\n active,\n payload,\n label,\n barChartConfiguration,\n}: any) => {\n if (active) {\n return (\n \n {label}\n {payload &&\n payload.map((pl: any, index: number) => {\n return (\n \n \n \n {pl.value}\n \n \n );\n })}\n \n );\n }\n\n return null;\n};\n\nexport default BarChartTooltip;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useRef, useState } from \"react\";\nimport styled from \"styled-components\";\nimport { Box, breakPoints, Grid, Loader } from \"mds\";\nimport { useSelector } from \"react-redux\";\nimport {\n Bar,\n BarChart,\n Cell,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { IBarChartConfiguration } from \"./types\";\nimport { widgetCommon } from \"../../../Common/FormComponents/common/styleLibrary\";\nimport { IDashboardPanel } from \"../types\";\nimport { widgetDetailsToPanel } from \"../utils\";\nimport { ErrorResponseHandler } from \"../../../../../common/types\";\nimport { setErrorSnackMessage } from \"../../../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../../../store\";\nimport ExpandGraphLink from \"./ExpandGraphLink\";\nimport DownloadWidgetDataButton from \"../../DownloadWidgetDataButton\";\nimport BarChartTooltip from \"./tooltips/BarChartTooltip\";\nimport api from \"../../../../../common/api\";\n\ninterface IBarChartWidget {\n title: string;\n panelItem: IDashboardPanel;\n timeStart: any;\n timeEnd: any;\n apiPrefix: string;\n zoomActivated?: boolean;\n}\n\nconst BarChartMain = styled.div(({ theme }) => ({\n ...widgetCommon(theme),\n loadingAlign: {\n width: \"100%\",\n paddingTop: \"15px\",\n textAlign: \"center\",\n margin: \"auto\",\n },\n}));\n\nconst CustomizedAxisTick = ({ y, payload }: any) => {\n return (\n \n {payload.value}\n \n );\n};\n\nconst BarChartWidget = ({\n title,\n panelItem,\n timeStart,\n timeEnd,\n apiPrefix,\n zoomActivated = false,\n}: IBarChartWidget) => {\n const dispatch = useAppDispatch();\n const [loading, setLoading] = useState(false);\n const [data, setData] = useState([]);\n const [result, setResult] = useState(null);\n const [hover, setHover] = useState(false);\n const [biggerThanMd, setBiggerThanMd] = useState(\n window.innerWidth >= breakPoints.md,\n );\n\n const componentRef = useRef();\n const widgetVersion = useSelector(\n (state: AppState) => state.dashboard.widgetLoadVersion,\n );\n\n const onHover = () => {\n setHover(true);\n };\n const onStopHover = () => {\n setHover(false);\n };\n\n useEffect(() => {\n setLoading(true);\n }, [widgetVersion]);\n\n useEffect(() => {\n const handleWindowResize = () => {\n let extMD = false;\n if (window.innerWidth >= breakPoints.md) {\n extMD = true;\n }\n setBiggerThanMd(extMD);\n };\n\n window.addEventListener(\"resize\", handleWindowResize);\n\n return () => {\n window.removeEventListener(\"resize\", handleWindowResize);\n };\n }, []);\n\n useEffect(() => {\n if (loading) {\n let stepCalc = 0;\n if (timeStart !== null && timeEnd !== null) {\n const secondsInPeriod =\n timeEnd.toUnixInteger() - timeStart.toUnixInteger();\n const periods = Math.floor(secondsInPeriod / 60);\n\n stepCalc = periods < 1 ? 15 : periods;\n }\n\n api\n .invoke(\n \"GET\",\n `/api/v1/${apiPrefix}/info/widgets/${\n panelItem.id\n }/?step=${stepCalc}&${\n timeStart !== null ? `&start=${timeStart.toUnixInteger()}` : \"\"\n }${timeStart !== null && timeEnd !== null ? \"&\" : \"\"}${\n timeEnd !== null ? `end=${timeEnd.toUnixInteger()}` : \"\"\n }`,\n )\n .then((res: any) => {\n const widgetsWithValue = widgetDetailsToPanel(res, panelItem);\n setData(widgetsWithValue.data);\n setResult(widgetsWithValue);\n setLoading(false);\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(err));\n setLoading(false);\n });\n }\n }, [loading, panelItem, timeEnd, timeStart, dispatch, apiPrefix]);\n\n const barChartConfiguration = result\n ? (result.widgetConfiguration as IBarChartConfiguration[])\n : [];\n\n let greatestIndex = 0;\n let currentValue = 0;\n\n if (barChartConfiguration.length === 1) {\n const dataGraph = barChartConfiguration[0];\n data.forEach((item: any, index: number) => {\n if (item[dataGraph.dataKey] > currentValue) {\n currentValue = item[dataGraph.dataKey];\n greatestIndex = index;\n }\n });\n }\n\n return (\n \n \n {!zoomActivated && (\n \n \n
{title}
\n
\n \n {hover && }\n \n \n \n \n \n )}\n {loading && (\n \n \n \n )}\n {!loading && (\n }\n className={zoomActivated ? \"zoomChartCont\" : \"contentContainer\"}\n >\n \n \n \n }\n tickLine={false}\n axisLine={false}\n width={150}\n hide={!biggerThanMd}\n style={{\n fontSize: \"12px\",\n fontWeight: 100,\n }}\n />\n {barChartConfiguration.map((bar) => (\n \n {barChartConfiguration.length === 1 ? (\n \n {data.map((_: any, index: number) => (\n \n ))}\n \n ) : null}\n \n ))}\n \n }\n />\n \n \n \n )}\n \n
\n );\n};\n\nexport default BarChartWidget;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Box } from \"mds\";\nimport { getTimeFromTimestamp } from \"../../../../../../common/utils\";\nimport { tooltipCommon } from \"../../../../Common/FormComponents/common/styleLibrary\";\n\nconst LineChartTooltip = ({\n active,\n payload,\n label,\n linearConfiguration,\n yAxisFormatter,\n}: any) => {\n if (active) {\n return (\n \n \n {getTimeFromTimestamp(label, true)}\n \n {payload &&\n payload.map((pl: any, index: number) => {\n return (\n \n \n \n \n {linearConfiguration[index].keyLabel}:{\" \"}\n {yAxisFormatter(pl.value)}\n \n \n \n );\n })}\n \n );\n }\n\n return null;\n};\n\nexport default LineChartTooltip;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useRef, useState } from \"react\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport { useSelector } from \"react-redux\";\nimport {\n Area,\n AreaChart,\n CartesianGrid,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport { Box, breakPoints, Grid, Loader } from \"mds\";\nimport { ILinearGraphConfiguration } from \"./types\";\nimport { widgetCommon } from \"../../../Common/FormComponents/common/styleLibrary\";\nimport { IDashboardPanel } from \"../types\";\nimport { widgetDetailsToPanel } from \"../utils\";\nimport { ErrorResponseHandler } from \"../../../../../common/types\";\nimport { setErrorSnackMessage } from \"../../../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../../../store\";\nimport api from \"../../../../../common/api\";\nimport LineChartTooltip from \"./tooltips/LineChartTooltip\";\nimport ExpandGraphLink from \"./ExpandGraphLink\";\nimport DownloadWidgetDataButton from \"../../DownloadWidgetDataButton\";\n\ninterface ILinearGraphWidget {\n title: string;\n panelItem: IDashboardPanel;\n timeStart: any;\n timeEnd: any;\n apiPrefix: string;\n hideYAxis?: boolean;\n yAxisFormatter?: (item: string) => string;\n xAxisFormatter?: (item: string, var1: boolean, var2: boolean) => string;\n areaWidget?: boolean;\n zoomActivated?: boolean;\n}\n\nconst LinearGraphMain = styled.div(({ theme }) => ({\n ...widgetCommon(theme),\n \"& .chartCont\": {\n position: \"relative\",\n height: 140,\n width: \"100%\",\n },\n \"& .legendChart\": {\n display: \"flex\",\n flexDirection: \"column\",\n flex: \"0 1 auto\",\n maxHeight: 130,\n margin: 0,\n overflowY: \"auto\",\n position: \"relative\",\n textAlign: \"center\",\n width: \"100%\",\n justifyContent: \"flex-start\",\n color: get(theme, \"mutedText\", \"#87888d\"),\n fontWeight: \"bold\",\n fontSize: 12,\n [`@media (max-width: ${breakPoints.md}px)`]: {\n display: \"none\",\n },\n },\n \"& .loadingAlign\": {\n width: 40,\n height: 40,\n textAlign: \"center\",\n margin: \"15px auto\",\n },\n}));\n\nconst LinearGraphWidget = ({\n title,\n timeStart,\n timeEnd,\n panelItem,\n apiPrefix,\n hideYAxis = false,\n areaWidget = false,\n yAxisFormatter = (item: string) => item,\n xAxisFormatter = (item: string, var1: boolean, var2: boolean) => item,\n zoomActivated = false,\n}: ILinearGraphWidget) => {\n const dispatch = useAppDispatch();\n const [loading, setLoading] = useState(false);\n const [hover, setHover] = useState(false);\n const [data, setData] = useState([]);\n const [csvData, setCsvData] = useState([]);\n const [dataMax, setDataMax] = useState(0);\n const [result, setResult] = useState(null);\n const widgetVersion = useSelector(\n (state: AppState) => state.dashboard.widgetLoadVersion,\n );\n\n const componentRef = useRef(null);\n\n useEffect(() => {\n setLoading(true);\n }, [widgetVersion]);\n\n useEffect(() => {\n if (loading) {\n let stepCalc = 0;\n if (timeStart !== null && timeEnd !== null) {\n const secondsInPeriod =\n timeEnd.toUnixInteger() - timeStart.toUnixInteger();\n const periods = Math.floor(secondsInPeriod / 60);\n\n stepCalc = periods < 1 ? 15 : periods;\n }\n\n api\n .invoke(\n \"GET\",\n `/api/v1/${apiPrefix}/info/widgets/${\n panelItem.id\n }/?step=${stepCalc}&${\n timeStart !== null ? `&start=${timeStart.toUnixInteger()}` : \"\"\n }${timeStart !== null && timeEnd !== null ? \"&\" : \"\"}${\n timeEnd !== null ? `end=${timeEnd.toUnixInteger()}` : \"\"\n }`,\n )\n .then((res: any) => {\n const widgetsWithValue = widgetDetailsToPanel(res, panelItem);\n setData(widgetsWithValue.data);\n setResult(widgetsWithValue);\n setLoading(false);\n let maxVal = 0;\n for (const dp of widgetsWithValue.data) {\n for (const key in dp) {\n if (key === \"name\") {\n continue;\n }\n let val = parseInt(dp[key]);\n\n if (isNaN(val)) {\n val = 0;\n }\n\n if (maxVal < val) {\n maxVal = val;\n }\n }\n }\n setDataMax(maxVal);\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(err));\n setLoading(false);\n });\n }\n }, [loading, panelItem, timeEnd, timeStart, dispatch, apiPrefix]);\n\n let intervalCount = Math.floor(data.length / 5);\n\n const onHover = () => {\n setHover(true);\n };\n\n const onStopHover = () => {\n setHover(false);\n };\n\n useEffect(() => {\n const fmtData = data.map((el: any) => {\n const date = new Date(el?.name * 1000);\n return {\n ...el,\n name: date,\n };\n });\n\n setCsvData(fmtData);\n }, [data]);\n\n const linearConfiguration = result\n ? (result?.widgetConfiguration as ILinearGraphConfiguration[])\n : [];\n\n const CustomizedDot = (prop: any) => {\n const { cx, cy, index } = prop;\n\n if (index % 3 !== 0) {\n return null;\n }\n return ;\n };\n\n let dspLongDate = false;\n\n if (zoomActivated) {\n dspLongDate = true;\n }\n\n return (\n \n \n {!zoomActivated && (\n \n \n {title}\n \n \n {hover && }\n \n \n {componentRef !== null && (\n \n )}\n \n \n )}\n
\n \n {loading && }\n {!loading && (\n \n \n \n \n {areaWidget && (\n \n \n \n \n\n \n \n \n )}\n \n \n xAxisFormatter(value, dspLongDate, true)\n }\n interval={intervalCount}\n tick={{\n fontSize: \"68%\",\n fontWeight: \"normal\",\n color: \"#404143\",\n }}\n tickCount={10}\n stroke={\"#082045\"}\n />\n yAxisFormatter(value)}\n tick={{\n fontSize: \"68%\",\n fontWeight: \"normal\",\n color: \"#404143\",\n }}\n stroke={\"#082045\"}\n />\n {linearConfiguration.map((section, index) => {\n return (\n : false}\n />\n );\n })}\n \n }\n wrapperStyle={{\n zIndex: 5000,\n }}\n />\n \n \n \n {!areaWidget && (\n \n {zoomActivated && (\n \n Series\n
\n
\n
\n )}\n\n \n {linearConfiguration.map((section, index) => {\n return (\n \n \n \n {section.keyLabel}\n \n \n );\n })}\n \n
\n )}\n
\n )}\n \n
\n \n
\n );\n};\n\nexport default LinearGraphWidget;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState } from \"react\";\nimport get from \"lodash/get\";\nimport styled from \"styled-components\";\nimport { Box, Loader } from \"mds\";\nimport { Cell, Pie, PieChart, ResponsiveContainer } from \"recharts\";\nimport { useSelector } from \"react-redux\";\nimport api from \"../../../../../common/api\";\nimport { IPieChartConfiguration } from \"./types\";\nimport { widgetCommon } from \"../../../Common/FormComponents/common/styleLibrary\";\nimport { IDashboardPanel } from \"../types\";\nimport { splitSizeMetric, widgetDetailsToPanel } from \"../utils\";\nimport { ErrorResponseHandler } from \"../../../../../common/types\";\nimport { setErrorSnackMessage } from \"../../../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../../../store\";\n\ninterface IPieChartWidget {\n title: string;\n panelItem: IDashboardPanel;\n timeStart: any;\n timeEnd: any;\n apiPrefix: string;\n}\n\nconst PieChartMain = styled.div(({ theme }) => ({\n ...widgetCommon(theme),\n \"& .loadingAlign\": {\n width: \"100%\",\n paddingTop: \"15px\",\n textAlign: \"center\",\n margin: \"auto\",\n },\n \"& .pieChartLabel\": {\n fontSize: 60,\n color: get(theme, \"signalColors.main\", \"#07193E\"),\n fontWeight: \"bold\",\n width: \"100%\",\n \"& .unitText\": {\n color: get(theme, \"mutedText\", \"#87888d\"),\n fontSize: 12,\n },\n },\n \"& .chartContainer\": {\n width: \"100%\",\n height: 140,\n },\n}));\n\nconst PieChartWidget = ({\n title,\n panelItem,\n timeStart,\n timeEnd,\n apiPrefix,\n}: IPieChartWidget) => {\n const dispatch = useAppDispatch();\n const [loading, setLoading] = useState(false);\n const [dataInner, setDataInner] = useState([]);\n const [dataOuter, setDataOuter] = useState([]);\n const [result, setResult] = useState(null);\n const widgetVersion = useSelector(\n (state: AppState) => state.dashboard.widgetLoadVersion,\n );\n\n useEffect(() => {\n setLoading(true);\n }, [widgetVersion]);\n\n useEffect(() => {\n if (loading) {\n let stepCalc = 0;\n if (timeStart !== null && timeEnd !== null) {\n const secondsInPeriod =\n timeEnd.toUnixInteger() - timeStart.toUnixInteger();\n const periods = Math.floor(secondsInPeriod / 60);\n\n stepCalc = periods < 1 ? 15 : periods;\n }\n\n api\n .invoke(\n \"GET\",\n `/api/v1/${apiPrefix}/info/widgets/${\n panelItem.id\n }/?step=${stepCalc}&${\n timeStart !== null ? `&start=${timeStart.toUnixInteger()}` : \"\"\n }${timeStart !== null && timeEnd !== null ? \"&\" : \"\"}${\n timeEnd !== null ? `end=${timeEnd.toUnixInteger()}` : \"\"\n }`,\n )\n .then((res: any) => {\n const widgetsWithValue = widgetDetailsToPanel(res, panelItem);\n setDataInner(widgetsWithValue.data);\n setDataOuter(widgetsWithValue.dataOuter as object[]);\n setResult(widgetsWithValue);\n setLoading(false);\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(err));\n setLoading(false);\n });\n }\n }, [loading, panelItem, timeEnd, timeStart, dispatch, apiPrefix]);\n\n const pieChartConfiguration = result\n ? (result.widgetConfiguration as IPieChartConfiguration)\n : [];\n const middleLabel = result?.innerLabel;\n\n const innerColors = get(pieChartConfiguration, \"innerChart.colorList\", []);\n const outerColors = get(pieChartConfiguration, \"outerChart.colorList\", []);\n\n return (\n \n \n {title}\n {loading && (\n \n \n \n )}\n {!loading && (\n \n \n {middleLabel && splitSizeMetric(middleLabel)}\n \n \n \n \n {dataOuter && (\n \n {dataOuter.map((entry, index) => (\n \n ))}\n \n )}\n {dataInner && (\n \n {dataInner.map((entry, index) => {\n return (\n \n );\n })}\n \n )}\n \n \n \n \n )}\n \n \n );\n};\n\nexport default PieChartWidget;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport { useSelector } from \"react-redux\";\nimport { Loader } from \"mds\";\nimport api from \"../../../../../common/api\";\nimport { widgetDetailsToPanel } from \"../utils\";\nimport { IDashboardPanel } from \"../types\";\nimport { ErrorResponseHandler } from \"../../../../../common/types\";\nimport { setErrorSnackMessage } from \"../../../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../../../store\";\n\ninterface ISimpleWidget {\n iconWidget: any;\n title: string;\n panelItem: IDashboardPanel;\n timeStart: any;\n timeEnd: any;\n apiPrefix: string;\n renderFn?: undefined | null | ((arg: Record) => any);\n}\n\nconst SimpleWidgetMain = styled.span(({ theme }) => ({\n display: \"inline-flex\",\n color: get(theme, \"signalColors.main\", \"#07193E\"),\n alignItems: \"center\",\n \"& .icon\": {\n color: get(theme, \"signalColors.main\", \"#07193E\"),\n fill: get(theme, \"signalColors.main\", \"#07193E\"),\n marginRight: 5,\n marginLeft: 12,\n },\n \"& .widgetLabel\": {\n fontWeight: \"bold\",\n textTransform: \"uppercase\",\n marginRight: 10,\n },\n \"& .widgetValue\": {\n marginRight: 25,\n },\n}));\n\nconst SimpleWidget = ({\n iconWidget,\n title,\n panelItem,\n timeStart,\n timeEnd,\n apiPrefix,\n renderFn,\n}: ISimpleWidget) => {\n const dispatch = useAppDispatch();\n const [loading, setLoading] = useState(false);\n const [data, setData] = useState(\"\");\n const widgetVersion = useSelector(\n (state: AppState) => state.dashboard.widgetLoadVersion,\n );\n\n useEffect(() => {\n setLoading(true);\n }, [widgetVersion]);\n\n useEffect(() => {\n if (loading) {\n let stepCalc = 0;\n if (timeStart !== null && timeEnd !== null) {\n const secondsInPeriod =\n timeEnd.toUnixInteger() - timeStart.toUnixInteger();\n const periods = Math.floor(secondsInPeriod / 60);\n\n stepCalc = periods < 1 ? 15 : periods;\n }\n\n api\n .invoke(\n \"GET\",\n `/api/v1/${apiPrefix}/info/widgets/${\n panelItem.id\n }/?step=${stepCalc}&${\n timeStart !== null ? `&start=${timeStart.toUnixInteger()}` : \"\"\n }${timeStart !== null && timeEnd !== null ? \"&\" : \"\"}${\n timeEnd !== null ? `end=${timeEnd.toUnixInteger()}` : \"\"\n }`,\n )\n .then((res: any) => {\n const widgetsWithValue = widgetDetailsToPanel(res, panelItem);\n setData(widgetsWithValue.data);\n setLoading(false);\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(err));\n setLoading(false);\n });\n }\n }, [loading, panelItem, timeEnd, timeStart, dispatch, apiPrefix]);\n\n if (renderFn) {\n return renderFn({\n valueToRender: data,\n loading,\n title,\n id: panelItem.id,\n iconWidget: iconWidget,\n });\n }\n return (\n \n {loading && (\n
\n \n
\n )}\n {!loading && (\n \n {iconWidget ? iconWidget : null}\n {title}: \n {data}\n \n )}\n
\n );\n};\n\nexport default SimpleWidget;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Box, breakPoints } from \"mds\";\n\nconst DashboardItemBox = ({ children }: { children: any }) => {\n return (\n \n {children}\n \n );\n};\n\nexport default DashboardItemBox;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport { Box, breakPoints, Loader, Tooltip } from \"mds\";\n\nconst StatCardMain = styled.div(({ theme }) => ({\n fontFamily: \"Inter,sans-serif\",\n color: get(theme, \"signalColors.main\", \"#07193E\"),\n maxWidth: \"300px\",\n display: \"flex\",\n marginLeft: \"auto\",\n marginRight: \"auto\",\n cursor: \"default\",\n position: \"relative\",\n width: \"100%\",\n}));\n\nconst NumericStatCard = ({\n value,\n label = \"\",\n icon = null,\n loading = false,\n}: {\n value: string | number;\n label?: any;\n icon?: any;\n loading?: boolean;\n}) => {\n const getContent = () => {\n return (\n \n \n \n {label}\n \n\n \n \n {value}\n \n \n \n \n {}\n {loading ? (\n \n ) : (\n icon\n )}\n \n \n );\n };\n\n return {getContent()};\n};\n\nexport default NumericStatCard;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport NumericStatCard from \"./NumericStatCard\";\nimport { BucketsIcon } from \"mds\";\n\nconst BucketsCountItem = ({\n title,\n value,\n loading,\n}: {\n title: string;\n value: string;\n loading?: boolean;\n}) => {\n return (\n }\n value={value}\n loading={loading}\n />\n );\n};\n\nexport default BucketsCountItem;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport NumericStatCard from \"./NumericStatCard\";\nimport { TotalObjectsIcon } from \"mds\";\n\nconst ObjectsCountItem = ({\n title,\n value,\n loading,\n}: {\n title: string;\n value: string;\n loading?: boolean;\n}) => {\n return (\n }\n value={value}\n loading={loading}\n />\n );\n};\n\nexport default ObjectsCountItem;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState } from \"react\";\nimport { connect, useSelector } from \"react-redux\";\nimport { IDashboardPanel } from \"../types\";\nimport { widgetDetailsToPanel } from \"../utils\";\nimport { ErrorResponseHandler } from \"../../../../../common/types\";\nimport { representationNumber } from \"../../../../../common/utils\";\nimport api from \"../../../../../common/api\";\nimport DashboardItemBox from \"../../DashboardItemBox\";\nimport BucketsCountItem from \"./BucketsCountItem\";\nimport ObjectsCountItem from \"./ObjectsCountItem\";\nimport { setErrorSnackMessage } from \"../../../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../../../store\";\n\ninterface ISingleRepWidget {\n title: string;\n panelItem: IDashboardPanel;\n timeStart: any;\n timeEnd: any;\n propLoading: boolean;\n\n color?: string;\n fillColor?: string;\n apiPrefix: string;\n}\n\nconst SingleRepWidget = ({\n title,\n panelItem,\n timeStart,\n timeEnd,\n propLoading,\n\n apiPrefix,\n}: ISingleRepWidget) => {\n const dispatch = useAppDispatch();\n const [loading, setLoading] = useState(false);\n const [result, setResult] = useState(null);\n const widgetVersion = useSelector(\n (state: AppState) => state.dashboard.widgetLoadVersion,\n );\n\n useEffect(() => {\n setLoading(true);\n }, [widgetVersion]);\n\n useEffect(() => {\n if (loading) {\n let stepCalc = 0;\n if (timeStart !== null && timeEnd !== null) {\n const secondsInPeriod =\n timeEnd.toUnixInteger() - timeStart.toUnixInteger();\n const periods = Math.floor(secondsInPeriod / 60);\n\n stepCalc = periods < 1 ? 15 : periods;\n }\n\n api\n .invoke(\n \"GET\",\n `/api/v1/${apiPrefix}/info/widgets/${\n panelItem.id\n }/?step=${stepCalc}&${\n timeStart !== null ? `&start=${timeStart.toUnixInteger()}` : \"\"\n }${timeStart !== null && timeEnd !== null ? \"&\" : \"\"}${\n timeEnd !== null ? `end=${timeEnd.toUnixInteger()}` : \"\"\n }`,\n )\n .then((res: any) => {\n const widgetsWithValue = widgetDetailsToPanel(res, panelItem);\n setResult(widgetsWithValue);\n setLoading(false);\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(err));\n setLoading(false);\n });\n }\n }, [loading, panelItem, timeEnd, timeStart, dispatch, apiPrefix]);\n\n let repNumber = \"\";\n\n if (result) {\n const resultRep = parseInt(result.innerLabel || \"0\");\n\n if (!isNaN(resultRep)) {\n repNumber = representationNumber(resultRep);\n } else {\n repNumber = \"0\";\n }\n }\n\n const renderById = (id: number) => {\n if (id === 66) {\n return (\n \n \n \n );\n }\n if (id === 44) {\n return (\n \n \n \n );\n }\n\n return null;\n };\n\n return renderById(panelItem.id);\n};\n\nconst connector = connect(null, {\n setErrorSnackMessage: setErrorSnackMessage,\n});\n\nexport default connector(SingleRepWidget);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { Box, Loader } from \"mds\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport { widgetCommon } from \"../../../Common/FormComponents/common/styleLibrary\";\nimport { splitSizeMetric, widgetDetailsToPanel } from \"../utils\";\nimport { IDashboardPanel } from \"../types\";\nimport { ErrorResponseHandler } from \"../../../../../common/types\";\nimport { setErrorSnackMessage } from \"../../../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../../../store\";\nimport api from \"../../../../../common/api\";\n\ninterface ISingleValueWidget {\n title: string;\n panelItem: IDashboardPanel;\n timeStart: any;\n timeEnd: any;\n apiPrefix: string;\n renderFn?: (arg: Record) => any;\n}\n\nconst SingleValueWidgetMain = styled.div(({ theme }) => ({\n display: \"flex\",\n height: 140,\n flexDirection: \"column\",\n justifyContent: \"center\",\n \"& .unitText\": {\n color: get(theme, \"mutedText\", \"#87888d\"),\n fontSize: 12,\n },\n \"& .loadingAlign\": {\n width: \"100%\",\n textAlign: \"center\",\n margin: \"auto\",\n },\n \"& .metric\": {\n fontSize: 60,\n lineHeight: 1,\n color: get(theme, \"signalColors.main\", \"#07193E\"),\n fontWeight: 700,\n },\n \"& .titleElement\": {\n fontSize: 10,\n color: get(theme, \"mutedText\", \"#87888d\"),\n fontWeight: 700,\n },\n ...widgetCommon(theme),\n}));\n\nconst SingleValueWidget = ({\n title,\n panelItem,\n timeStart,\n timeEnd,\n apiPrefix,\n renderFn,\n}: ISingleValueWidget) => {\n const dispatch = useAppDispatch();\n\n const [loading, setLoading] = useState(false);\n const [data, setData] = useState(\"\");\n const widgetVersion = useSelector(\n (state: AppState) => state.dashboard.widgetLoadVersion,\n );\n\n useEffect(() => {\n setLoading(true);\n }, [widgetVersion]);\n\n useEffect(() => {\n if (loading) {\n let stepCalc = 0;\n if (timeStart !== null && timeEnd !== null) {\n const secondsInPeriod =\n timeEnd.toUnixInteger() - timeStart.toUnixInteger();\n const periods = Math.floor(secondsInPeriod / 60);\n\n stepCalc = periods < 1 ? 15 : periods;\n }\n\n api\n .invoke(\n \"GET\",\n `/api/v1/${apiPrefix}/info/widgets/${\n panelItem.id\n }/?step=${stepCalc}&${\n timeStart !== null ? `&start=${timeStart.toUnixInteger()}` : \"\"\n }${timeStart !== null && timeEnd !== null ? \"&\" : \"\"}${\n timeEnd !== null ? `end=${timeEnd.toUnixInteger()}` : \"\"\n }`,\n )\n .then((res: any) => {\n const widgetsWithValue = widgetDetailsToPanel(res, panelItem);\n setData(widgetsWithValue.data);\n setLoading(false);\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(err));\n setLoading(false);\n });\n }\n }, [loading, panelItem, timeEnd, timeStart, dispatch, apiPrefix]);\n\n const valueToRender = splitSizeMetric(data);\n\n if (renderFn) {\n return renderFn({ valueToRender, loading, title, id: panelItem.id });\n }\n return (\n \n {loading && (\n \n \n \n )}\n {!loading && (\n \n {splitSizeMetric(data)}\n {title}\n \n )}\n \n );\n};\n\nexport default SingleValueWidget;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState } from \"react\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport { Box, breakPoints, Loader, ReportedUsageIcon } from \"mds\";\nimport { Cell, Pie, PieChart } from \"recharts\";\nimport { useSelector } from \"react-redux\";\nimport api from \"../../../../../common/api\";\nimport { IDashboardPanel } from \"../types\";\nimport { widgetDetailsToPanel } from \"../utils\";\nimport { ErrorResponseHandler } from \"../../../../../common/types\";\nimport {\n calculateBytes,\n capacityColors,\n niceBytesInt,\n} from \"../../../../../common/utils\";\nimport { setErrorSnackMessage } from \"../../../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../../../store\";\n\nconst CapacityItemMain = styled.div(({ theme }) => ({\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n flexFlow: \"row\",\n \"& .usableLabel\": {\n color: get(theme, \"mutedText\", \"#87888d\"),\n fontSize: \"10px\",\n display: \"flex\",\n flexFlow: \"column\",\n alignItems: \"center\",\n textAlign: \"center\",\n },\n \"& .usedLabel\": {\n color: get(theme, \"mutedText\", \"#87888d\"),\n fontWeight: \"bold\",\n fontSize: \"14px\",\n },\n \"& .totalUsed\": {\n display: \"flex\",\n \"& .value\": {\n fontSize: \"50px\",\n fontFamily: \"Inter\",\n fontWeight: 600,\n alignSelf: \"flex-end\",\n lineHeight: 1,\n },\n \"& .unit\": {\n color: get(theme, \"mutedText\", \"#87888d\"),\n fontWeight: \"bold\",\n fontSize: \"14px\",\n marginLeft: \"12px\",\n alignSelf: \"flex-end\",\n },\n },\n \"& .ofUsed\": {\n marginTop: \"5px\",\n \"& .value\": {\n color: get(theme, \"mutedText\", \"#87888d\"),\n fontWeight: \"bold\",\n fontSize: \"14px\",\n textAlign: \"right\",\n },\n },\n [`@media (max-width: ${breakPoints.sm}px)`]: {\n flexFlow: \"column\",\n },\n}));\n\nconst CapacityItem = ({\n value,\n timeStart,\n timeEnd,\n apiPrefix,\n}: {\n value: IDashboardPanel;\n timeStart: any;\n timeEnd: any;\n apiPrefix: string;\n}) => {\n const dispatch = useAppDispatch();\n const [loading, setLoading] = useState(false);\n\n const [totalUsableFree, setTotalUsableFree] = useState(0);\n const [totalUsableFreeRatio, setTotalUsableFreeRatio] = useState(0);\n const [totalUsed, setTotalUsed] = useState(0);\n const [totalUsable, setTotalUsable] = useState(0);\n const widgetVersion = useSelector(\n (state: AppState) => state.dashboard.widgetLoadVersion,\n );\n\n useEffect(() => {\n setLoading(true);\n }, [widgetVersion]);\n\n useEffect(() => {\n if (loading) {\n let stepCalc = 0;\n if (timeStart !== null && timeEnd !== null) {\n const secondsInPeriod =\n timeEnd.toUnixInteger() - timeStart.toUnixInteger();\n const periods = Math.floor(secondsInPeriod / 60);\n\n stepCalc = periods < 1 ? 15 : periods;\n }\n\n api\n .invoke(\n \"GET\",\n `/api/v1/${apiPrefix}/info/widgets/${value.id}/?step=${stepCalc}&${\n timeStart !== null ? `&start=${timeStart.toUnixInteger()}` : \"\"\n }${timeStart !== null && timeEnd !== null ? \"&\" : \"\"}${\n timeEnd !== null ? `end=${timeEnd.toUnixInteger()}` : \"\"\n }`,\n )\n .then((res: any) => {\n const widgetsWithValue = widgetDetailsToPanel(res, value);\n\n let tUsable = 0;\n let tUsed = 0;\n let tFree = 0;\n\n widgetsWithValue.data.forEach((eachArray: any[]) => {\n eachArray.forEach((itemSum) => {\n switch (itemSum.legend) {\n case \"Total Usable\":\n tUsable += itemSum.value;\n break;\n case \"Used Space\":\n tUsed += itemSum.value;\n break;\n case \"Usable Free\":\n tFree += itemSum.value;\n break;\n }\n });\n });\n\n const freeRatio = Math.round((tFree / tUsable) * 100);\n\n setTotalUsableFree(tFree);\n setTotalUsableFreeRatio(freeRatio);\n setTotalUsed(tUsed);\n setTotalUsable(tUsable);\n\n setLoading(false);\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(err));\n setLoading(false);\n });\n }\n }, [loading, value, timeEnd, timeStart, dispatch, apiPrefix]);\n\n const usedConvert = calculateBytes(totalUsed, true, false);\n\n const plotValues = [\n {\n value: totalUsableFree,\n color: \"#D6D6D6\",\n label: \"Usable Available Space\",\n },\n {\n value: totalUsed,\n color: capacityColors(totalUsed, totalUsable),\n label: \"Used Space\",\n },\n ];\n return (\n \n \n Capacity\n \n \n \n {`${totalUsableFreeRatio}%`}\n
\n Free\n \n \n \n {plotValues.map((entry, index) => (\n \n ))}\n \n \n \n \n \n Used:\n \n
{usedConvert.total}
\n
{usedConvert.unit}
\n
\n \n
Of: {niceBytesInt(totalUsable)}
\n
\n
\n\n \n \n {loading ? (\n \n ) : (\n \n )}\n \n \n \n
\n );\n};\n\nexport default CapacityItem;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport { Box, Loader, SuccessIcon } from \"mds\";\n\nconst TimeStatBase = styled.div(({ theme }) => ({\n display: \"grid\",\n alignItems: \"center\",\n gap: 8,\n height: 33,\n paddingLeft: 15,\n gridTemplateColumns: \"20px 1.5fr .5fr 20px\",\n background: get(theme, \"boxBackground\", \"#FBFAFA\"), // #EBF9EE\n \"& .min-icon\": {\n height: \"12px\",\n width: \"12px\",\n fill: get(theme, \"signalColors.good\", \"#4CCB92\"),\n },\n \"& .ok-icon\": {\n height: \"8px\",\n width: \"8px\",\n fill: get(theme, \"signalColors.good\", \"#4CCB92\"),\n color: get(theme, \"signalColors.good\", \"#4CCB92\"),\n },\n \"& .timeStatLabel\": {\n fontSize: \"12px\",\n color: get(theme, \"signalColors.good\", \"#4CCB92\"),\n fontWeight: 600,\n },\n \"& .timeStatValue\": {\n fontSize: \"12px\",\n color: get(theme, \"signalColors.good\", \"#4CCB92\"),\n },\n}));\n\nconst TimeStatItem = ({\n icon,\n label,\n value,\n loading = false,\n}: {\n icon: any;\n label: any;\n value: string;\n loading?: boolean;\n}) => {\n return (\n \n {loading ? : icon}\n {label}\n {value}\n {value !== \"n/a\" ? : null}\n \n );\n};\n\nexport default TimeStatItem;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Box, breakPoints } from \"mds\";\nimport TimeStatItem from \"../../TimeStatItem\";\n\nexport type SimpleWidgetRenderProps = {\n valueToRender?: any;\n loading?: boolean;\n title?: any;\n id?: number;\n iconWidget?: any;\n};\nconst HealActivityRenderer = ({\n valueToRender = \"\",\n loading = false,\n iconWidget = null,\n}: SimpleWidgetRenderProps) => {\n return (\n \n \n \n Time since last\n {\" \"}\n Heal Activity\n \n }\n value={valueToRender}\n />\n \n );\n};\n\nexport default HealActivityRenderer;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Box, breakPoints } from \"mds\";\nimport TimeStatItem from \"../../TimeStatItem\";\nimport { SimpleWidgetRenderProps } from \"./HealActivityRenderer\";\n\nconst ScanActivityRenderer = ({\n valueToRender = \"\",\n loading = false,\n iconWidget = null,\n}: SimpleWidgetRenderProps) => {\n return (\n \n \n \n Time since last\n {\" \"}\n Scan Activity\n \n }\n value={valueToRender}\n />\n \n );\n};\n\nexport default ScanActivityRenderer;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Box } from \"mds\";\nimport TimeStatItem from \"../../TimeStatItem\";\n\ntype SimpleWidgetRenderProps = {\n valueToRender?: any;\n loading?: boolean;\n title?: any;\n id?: number;\n iconWidget?: any;\n};\nconst UptimeActivityRenderer = ({\n valueToRender = \"\",\n loading = false,\n iconWidget = null,\n}: SimpleWidgetRenderProps) => {\n return (\n \n Uptime}\n value={valueToRender}\n />\n \n );\n};\n\nexport default UptimeActivityRenderer;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { IDashboardPanel, widgetType } from \"./types\";\nimport BarChartWidget from \"./Widgets/BarChartWidget\";\nimport LinearGraphWidget from \"./Widgets/LinearGraphWidget\";\nimport PieChartWidget from \"./Widgets/PieChartWidget\";\nimport SimpleWidget from \"./Widgets/SimpleWidget\";\nimport SingleRepWidget from \"./Widgets/SingleRepWidget\";\nimport SingleValueWidget from \"./Widgets/SingleValueWidget\";\nimport CapacityItem from \"./Widgets/CapacityItem\";\nimport DashboardItemBox from \"../DashboardItemBox\";\nimport HealActivityRenderer, {\n SimpleWidgetRenderProps,\n} from \"./Widgets/HealActivityRenderer\";\nimport ScanActivityRenderer from \"./Widgets/ScanActivityRenderer\";\nimport UptimeActivityRenderer from \"./Widgets/UptimeActivityRenderer\";\n\nexport const componentToUse = (\n value: IDashboardPanel,\n timeStart: any,\n timeEnd: any,\n loading: boolean,\n apiPrefix: string,\n zoomActivated: boolean = false,\n) => {\n switch (value.type) {\n case widgetType.singleValue:\n return (\n \n );\n case widgetType.simpleWidget:\n let renderFn;\n let CmpToRender: any = null;\n if (value.id === 80) {\n CmpToRender = HealActivityRenderer;\n } else if (value.id === 81) {\n CmpToRender = ScanActivityRenderer;\n } else if (value.id === 1) {\n CmpToRender = UptimeActivityRenderer;\n }\n\n if ([80, 81, 1].includes(value.id)) {\n renderFn = ({\n valueToRender,\n loading,\n title,\n id,\n iconWidget,\n }: SimpleWidgetRenderProps) => {\n return (\n \n );\n };\n }\n return (\n \n );\n case widgetType.pieChart:\n if (value.id === 50) {\n return (\n \n \n \n );\n }\n return (\n \n );\n case widgetType.linearGraph:\n case widgetType.areaGraph:\n return (\n \n );\n case widgetType.barChart:\n return (\n \n );\n case widgetType.singleRep:\n const fillColor = value.fillColor ? value.fillColor : value.color;\n return (\n \n );\n default:\n return null;\n }\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport { Box } from \"mds\";\nimport { CSSObject } from \"styled-components\";\nimport { breakPoints } from \"mds\";\n\nexport type DLayoutColumnProps = {\n componentId: number;\n sx?: CSSObject;\n};\nexport type DLayoutRowProps = {\n sx?: CSSObject;\n columns: DLayoutColumnProps[];\n};\n\nexport const summaryPanelsLayout: DLayoutRowProps[] = [\n {\n sx: {\n minWidth: 0,\n display: \"grid\",\n gap: \"30px\",\n gridTemplateColumns: \"1fr 1fr 1fr 1fr\",\n [`@media (max-width: ${breakPoints.sm}px)`]: {\n gridTemplateColumns: \"1fr\",\n },\n [`@media (max-width: ${breakPoints.md}px)`]: {\n gridTemplateColumns: \"1fr 1fr\",\n },\n },\n columns: [\n {\n componentId: 66,\n },\n {\n componentId: 44,\n },\n {\n componentId: 500,\n },\n {\n componentId: 501,\n },\n ],\n },\n {\n sx: {\n display: \"grid\",\n minWidth: 0, // important to avoid css grid blow out.\n gap: \"30px\",\n gridTemplateColumns: \"1fr 1fr\",\n [`@media (max-width: ${breakPoints.md}px)`]: {\n gridTemplateColumns: \"1fr\",\n },\n },\n columns: [\n {\n componentId: 50,\n },\n {\n componentId: 502,\n },\n ],\n },\n {\n sx: {\n display: \"grid\",\n minWidth: 0,\n gap: \"30px\",\n gridTemplateColumns: \"1fr 1fr 1fr\",\n [`@media (max-width: ${breakPoints.md}px)`]: {\n gridTemplateColumns: \"1fr\",\n },\n },\n columns: [\n {\n componentId: 80,\n },\n {\n componentId: 81,\n },\n {\n componentId: 1,\n },\n ],\n },\n {\n sx: {\n display: \"grid\",\n minWidth: 0,\n gap: \"30px\",\n gridTemplateColumns: \"1fr 1fr\",\n [`@media (max-width: ${breakPoints.md}px)`]: {\n gridTemplateColumns: \"1fr\",\n },\n },\n columns: [\n {\n componentId: 68,\n },\n {\n componentId: 52,\n },\n ],\n },\n {\n sx: {\n display: \"grid\",\n minWidth: 0,\n gap: \"30px\",\n gridTemplateColumns: \"1fr 1fr\",\n [`@media (max-width: ${breakPoints.md}px)`]: {\n gridTemplateColumns: \"1fr\",\n },\n },\n columns: [\n {\n componentId: 63,\n },\n {\n componentId: 70,\n },\n ],\n },\n];\n\nexport const trafficPanelsLayout: DLayoutRowProps[] = [\n {\n sx: {\n display: \"grid\",\n gridTemplateColumns: \"1fr\",\n gap: \"30px\",\n },\n columns: [\n {\n componentId: 60,\n },\n ],\n },\n {\n sx: {\n display: \"grid\",\n minWidth: 0,\n gap: \"30px\",\n gridTemplateColumns: \"1fr 1fr\",\n [`@media (max-width: ${breakPoints.md}px)`]: {\n gridTemplateColumns: \"1fr\",\n },\n },\n columns: [\n {\n componentId: 71,\n sx: {\n flex: 1,\n width: \"50%\",\n flexShrink: 0,\n },\n },\n {\n componentId: 17,\n sx: {\n flex: 1,\n width: \"50%\",\n flexShrink: 0,\n },\n },\n ],\n },\n {\n sx: {\n display: \"grid\",\n gridTemplateColumns: \"1fr\",\n gap: \"30px\",\n },\n columns: [\n {\n componentId: 73,\n },\n ],\n },\n];\n\nexport const resourcesPanelsLayout: DLayoutRowProps[] = [\n {\n sx: {\n display: \"grid\",\n minWidth: 0,\n gridTemplateColumns: \"1fr 1fr\",\n gap: \"30px\",\n },\n columns: [\n {\n componentId: 76,\n },\n {\n componentId: 77,\n },\n ],\n },\n {\n sx: {\n display: \"grid\",\n minWidth: 0,\n gridTemplateColumns: \"1fr 1fr\",\n gap: \"30px\",\n },\n columns: [\n {\n componentId: 82,\n },\n {\n componentId: 74,\n },\n ],\n },\n];\nexport const resourcesPanelsLayoutAdvanced: DLayoutRowProps[] = [\n {\n sx: {\n display: \"grid\",\n minWidth: 0,\n gridTemplateColumns: \"1fr 1fr\",\n gap: \"30px\",\n },\n columns: [\n {\n componentId: 11,\n },\n {\n componentId: 8,\n },\n ],\n },\n];\n\nexport const RowPanelLayout = ({ children }: { children: any }) => {\n return (\n \n {children}\n \n );\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\n\nimport ModalWrapper from \"../../Common/ModalWrapper/ModalWrapper\";\nimport { IDashboardPanel } from \"./types\";\nimport { componentToUse } from \"./widgetUtils\";\nimport { closeZoomPage } from \"../dashboardSlice\";\nimport { useAppDispatch } from \"../../../../store\";\n\ninterface IZoomWidget {\n widgetRender: number;\n value: IDashboardPanel | null;\n modalOpen: boolean;\n timeStart: any;\n timeEnd: any;\n apiPrefix: string;\n}\n\nconst ZoomWidget = ({\n value,\n modalOpen,\n timeStart,\n timeEnd,\n apiPrefix,\n}: IZoomWidget) => {\n const dispatch = useAppDispatch();\n if (!value) {\n return null;\n }\n\n return (\n {\n dispatch(closeZoomPage());\n }}\n modalOpen={modalOpen}\n wideLimit={false}\n sx={{\n padding: 0,\n }}\n >\n \n {componentToUse(value, timeStart, timeEnd, true, apiPrefix, true)}\n \n \n );\n};\n\nexport default ZoomWidget;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport { Box } from \"mds\";\nimport { Link } from \"react-router-dom\";\nimport { widgetCommon } from \"../Common/FormComponents/common/styleLibrary\";\n\ninterface ISubInterface {\n message: string;\n fontWeight?: \"normal\" | \"bold\";\n}\n\ninterface ICommonCard {\n title: string;\n metricValue: any;\n metricUnit?: string;\n subMessage?: ISubInterface;\n moreLink?: string;\n rightComponent?: any;\n extraMargin?: boolean;\n}\n\nconst CommonCardItem = styled.div(({ theme }) => ({\n ...widgetCommon(theme),\n \"& .metricText\": {\n fontSize: 70,\n lineHeight: 1.1,\n color: get(theme, \"signalColors.main\", \"#07193E\"),\n fontWeight: \"bold\",\n },\n \"& .unitText\": {\n fontSize: 10,\n color: get(theme, \"mutedText\", \"#87888d\"),\n fontWeight: \"normal\",\n },\n \"& .subHeaderContainer\": {\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n },\n \"& .subMessage\": {\n fontSize: 10,\n color: get(theme, \"mutedText\", \"#87888d\"),\n \"&.bold\": {\n fontWeight: \"bold\",\n },\n },\n \"& .headerContainer\": {\n display: \"flex\",\n justifyContent: \"space-between\",\n },\n \"& .viewAll\": {\n fontSize: 10,\n color: get(theme, \"signalColors.danger\", \"#C83B51\"),\n textTransform: \"capitalize\",\n\n \"& a, & a:hover, & a:visited, & a:active\": {\n color: get(theme, \"signalColors.danger\", \"#C83B51\"),\n },\n },\n}));\n\nconst CommonCard = ({\n title,\n metricValue,\n metricUnit,\n subMessage,\n moreLink,\n rightComponent,\n extraMargin = false,\n}: ICommonCard) => {\n const SubHeader = () => {\n return (\n \n
\n
\n
\n \n {metricValue}\n {metricUnit}\n \n
\n {subMessage && (\n \n {subMessage.message}\n \n )}\n
\n
{rightComponent}
\n
\n
\n );\n };\n\n const Header = () => {\n return (\n \n
\n {title}\n {moreLink && (\n \n \n View All\n \n \n )}\n
\n
\n );\n };\n\n return (\n \n \n {metricValue !== \"\" && (\n \n
\n \n \n )}\n \n \n );\n};\n\nexport default CommonCard;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport CommonCard from \"../CommonCard\";\n\ninterface IMergedWidgets {\n title: string;\n leftComponent: any;\n rightComponent: any;\n}\n\nconst MergedWidgets = ({\n title,\n leftComponent,\n rightComponent,\n}: IMergedWidgets) => {\n return (\n \n \n \n );\n};\n\nexport default MergedWidgets;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState } from \"react\";\nimport { Loader, Box } from \"mds\";\nimport { useSelector } from \"react-redux\";\nimport { widgetDetailsToPanel } from \"../utils\";\nimport { ErrorResponseHandler } from \"../../../../../common/types\";\nimport { IDashboardPanel } from \"../types\";\nimport { setErrorSnackMessage } from \"../../../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../../../store\";\nimport api from \"../../../../../common/api\";\n\nconst EntityStateStatItem = ({\n panelItem,\n timeStart,\n timeEnd,\n apiPrefix,\n statLabel,\n}: {\n panelItem: IDashboardPanel;\n timeStart: any;\n timeEnd: any;\n apiPrefix: string;\n statLabel: any;\n}) => {\n const dispatch = useAppDispatch();\n const [loading, setLoading] = useState(false);\n const [data, setData] = useState(\"\");\n const widgetVersion = useSelector(\n (state: AppState) => state.dashboard.widgetLoadVersion,\n );\n\n useEffect(() => {\n setLoading(true);\n }, [widgetVersion]);\n\n useEffect(() => {\n if (loading) {\n let stepCalc = 0;\n if (timeStart !== null && timeEnd !== null) {\n const secondsInPeriod =\n timeEnd.toUnixInteger() - timeStart.toUnixInteger();\n const periods = Math.floor(secondsInPeriod / 60);\n\n stepCalc = periods < 1 ? 15 : periods;\n }\n\n api\n .invoke(\n \"GET\",\n `/api/v1/${apiPrefix}/info/widgets/${\n panelItem.id\n }/?step=${stepCalc}&${\n timeStart !== null ? `&start=${timeStart.toUnixInteger()}` : \"\"\n }${timeStart !== null && timeEnd !== null ? \"&\" : \"\"}${\n timeEnd !== null ? `end=${timeEnd.toUnixInteger()}` : \"\"\n }`,\n )\n .then((res: any) => {\n const widgetsWithValue = widgetDetailsToPanel(res, panelItem);\n setData(widgetsWithValue.data);\n setLoading(false);\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(err));\n setLoading(false);\n });\n }\n }, [loading, panelItem, timeEnd, timeStart, dispatch, apiPrefix]);\n\n let toRender = loading ? (\n \n \n \n ) : (\n \n {data}\n {statLabel}\n \n );\n\n return toRender;\n};\n\nexport default EntityStateStatItem;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport { Box, breakPoints } from \"mds\";\n\nconst DualSTCardContent = styled.div(({ theme }) => ({\n fontFamily: \"Inter,sans-serif\",\n color: get(theme, \"signalColors.main\", \"#07193E\"),\n maxWidth: \"321px\",\n display: \"flex\",\n marginLeft: \"auto\",\n marginRight: \"auto\",\n cursor: \"default\",\n \"& .stat-text\": {\n color: get(theme, \"mutedText\", \"#87888d\"),\n fontSize: \"12px\",\n marginTop: \"8px\",\n },\n}));\n\nconst DualStatCard = ({\n statItemLeft = null,\n statItemRight = null,\n icon = null,\n label = \"\",\n}: {\n statItemLeft: any;\n statItemRight: any;\n icon: any;\n label: string;\n}) => {\n const getContent = () => {\n return (\n \n \n \n {label}\n \n\n \n {statItemLeft}\n {statItemRight}\n \n \n \n {icon}\n \n \n );\n };\n\n return {getContent()};\n};\n\nexport default DualStatCard;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport { CircleIcon, DrivesIcon, ServersIcon, Box } from \"mds\";\nimport EntityStateStatItem from \"./EntityStateStatItem\";\nimport DualStatCard from \"./DualStatCard\";\nimport { IDashboardPanel } from \"../types\";\n\nconst StateIndicator = styled.div(({ theme }) => ({\n display: \"flex\",\n alignItems: \"center\",\n marginTop: \"5px\",\n gap: 8,\n \"&.online\": {\n \"& .min-icon\": {\n margin: 0,\n fill: get(theme, \"signalColors.good\", \"#4CCB92\"),\n },\n },\n \"&.offline\": {\n \"& .min-icon\": {\n margin: 0,\n fill: get(theme, \"signalColors.danger\", \"#C51B3F\"),\n },\n },\n \"& .indicatorText\": {\n color: get(theme, \"mutedText\", \"#C51B3F\"),\n fontSize: 12,\n },\n}));\n\nconst EntityStateItemRenderer = ({\n info,\n timeStart,\n timeEnd,\n apiPrefix,\n}: {\n info: IDashboardPanel;\n timeStart: any;\n timeEnd: any;\n apiPrefix: string;\n}) => {\n const { mergedPanels = [], id } = info;\n const [leftPanel, rightPanel] = mergedPanels;\n\n const lStatItem = (\n \n \n Online\n \n }\n />\n );\n const rStatItem = (\n \n \n Offline\n \n }\n />\n );\n\n let statIcon = null;\n let statLabel = \"\";\n if (id === 500) {\n statIcon = ;\n statLabel = \"Servers\";\n } else if (id === 501) {\n statIcon = ;\n statLabel = \"Drives\";\n }\n\n return (\n \n );\n};\nexport default EntityStateItemRenderer;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport { Loader, NetworkGetIcon, Box } from \"mds\";\n\nconst NetworkGetBase = styled.div(({ theme }) => ({\n \"& .putLabel\": {\n display: \"flex\",\n gap: 10,\n alignItems: \"center\",\n marginTop: \"10px\",\n\n \"& .min-icon\": {\n height: 15,\n width: 15,\n fill: get(theme, \"signalColors.good\", \"#4CCB92\"),\n },\n\n \"& .getText\": {\n fontSize: \"18px\",\n color: get(theme, \"mutedText\", \"#87888d\"),\n fontWeight: \"bold\",\n },\n \"& .valueText\": {\n fontSize: 50,\n fontFamily: \"Inter\",\n fontWeight: 600,\n },\n },\n}));\n\nconst NetworkGetItem = ({\n value,\n loading,\n}: {\n value: any;\n loading: boolean;\n title?: any;\n id?: number;\n}) => {\n return (\n \n \n GET\n {loading ? (\n \n ) : (\n \n )}\n \n {value}\n \n );\n};\n\nexport default NetworkGetItem;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport { Box, Loader, NetworkPutIcon } from \"mds\";\n\nconst NetworkPutBase = styled.div(({ theme }) => ({\n \"& .putLabel\": {\n display: \"flex\",\n gap: 10,\n alignItems: \"center\",\n marginTop: \"10px\",\n\n \"& .min-icon\": {\n height: 15,\n width: 15,\n fill: get(theme, \"signalColors.info\", \"#2781B0\"),\n },\n\n \"& .putText\": {\n fontSize: \"18px\",\n color: get(theme, \"mutedText\", \"#87888d\"),\n fontWeight: \"bold\",\n },\n \"& .valueText\": {\n fontSize: 50,\n fontFamily: \"Inter\",\n fontWeight: 600,\n },\n },\n}));\n\nconst NetworkPutItem = ({\n value,\n loading,\n}: {\n value: any;\n loading: boolean;\n title?: any;\n id?: number;\n}) => {\n return (\n \n \n PUT\n {loading ? (\n \n ) : (\n \n )}\n \n {value}\n \n );\n};\n\nexport default NetworkPutItem;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport { Box, breakPoints, SpeedtestIcon } from \"mds\";\nimport { IDashboardPanel } from \"../types\";\nimport SingleValueWidget from \"./SingleValueWidget\";\nimport NetworkGetItem from \"./NetworkGetItem\";\nimport NetworkPutItem from \"./NetworkPutItem\";\n\nconst NetworkItemBase = styled.div(({ theme }) => ({\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n flexFlow: \"row\",\n gap: \"15px\",\n \"& .unitText\": {\n fontSize: \"14px\",\n color: get(theme, \"mutedText\", \"#87888d\"),\n marginLeft: \"5px\",\n },\n \"& .unit\": {\n color: get(theme, \"mutedText\", \"#87888d\"),\n fontSize: \"18px\",\n marginLeft: \"12px\",\n marginTop: \"10px\",\n },\n [`@media (max-width: ${breakPoints.sm}px)`]: {\n flexFlow: \"column\",\n },\n}));\n\nconst NetworkItem = ({\n value,\n timeStart,\n timeEnd,\n apiPrefix,\n}: {\n value: IDashboardPanel;\n timeStart: any;\n timeEnd: any;\n apiPrefix: string;\n}) => {\n const { mergedPanels = [] } = value;\n const [leftPanel, rightPanel] = mergedPanels;\n\n const rightCmp = (\n {\n return (\n \n );\n }}\n />\n );\n const leftCmp = (\n {\n return (\n \n );\n }}\n />\n );\n\n return (\n \n \n Network\n \n \n \n {leftCmp}\n \n \n \n \n {rightCmp}\n \n \n \n \n \n \n );\n};\n\nexport default NetworkItem;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { componentToUse } from \"../widgetUtils\";\nimport { IDashboardPanel } from \"../types\";\nimport MergedWidgets from \"../MergedWidgets\";\nimport EntityStateItemRenderer from \"./EntityStateItemRenderer\";\nimport NetworkItem from \"./NetworkItem\";\nimport DashboardItemBox from \"../../DashboardItemBox\";\n\nconst MergedWidgetsRenderer = ({\n info,\n timeStart,\n timeEnd,\n loading,\n apiPrefix,\n}: {\n info: IDashboardPanel;\n timeStart: any;\n timeEnd: any;\n loading: boolean;\n apiPrefix: string;\n}) => {\n const { mergedPanels = [], title = \"\", id } = info;\n const [leftPanel, rightPanel] = mergedPanels;\n\n const renderById = () => {\n if ([500, 501].includes(id)) {\n return (\n \n \n \n );\n }\n\n if (id === 502) {\n return (\n \n \n \n );\n }\n\n return (\n \n );\n };\n\n return renderById();\n};\n\nexport default MergedWidgetsRenderer;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport { Box, breakPoints, CircleIcon } from \"mds\";\n\nconst StatusCountBase = styled.div(({ theme }) => ({\n fontFamily: \"Inter,sans-serif\",\n maxWidth: \"321px\",\n display: \"flex\",\n marginLeft: \"auto\",\n marginRight: \"auto\",\n cursor: \"default\",\n color: get(theme, \"signalColors.main\", \"#07193E\"),\n \"& .mainBox\": {\n flex: 1,\n display: \"flex\",\n padding: \"0 8px 0 8px\",\n [`@media (max-width: ${breakPoints.sm}px)`]: {\n padding: \"0 10px 0 10px\",\n },\n \"& .indicatorIcon\": {\n width: \"20px\",\n height: \"20px\",\n marginTop: \"8px\",\n maxWidth: \"26px\",\n \"& .min-icon\": {\n width: \"16px\",\n height: \"16px\",\n },\n },\n \"& .indicatorContainer\": {\n flex: 1,\n display: \"flex\",\n flexFlow: \"column\",\n \"& .indicatorLabel\": {\n fontSize: \"16px\",\n fontWeight: 600,\n },\n \"& .counterIndicator\": {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"5px\",\n justifyContent: \"space-between\",\n paddingBottom: 0,\n fontSize: \"55px\",\n [`@media (max-width: ${breakPoints.sm}px)`]: {\n paddingBottom: 10,\n fontSize: \"35px\",\n },\n [`@media (max-width: ${breakPoints.lg}px)`]: {\n fontSize: \"45px\",\n },\n [`@media (max-width: ${breakPoints.xl}px)`]: {\n fontSize: \"50px\",\n },\n flexFlow: \"row\",\n fontWeight: 600,\n\n \"& .stat-text\": {\n color: get(theme, \"mutedText\", \"#87888D\"),\n fontSize: \"12px\",\n marginTop: \"8px\",\n },\n \"& .stat-value\": {\n textAlign: \"center\",\n height: \"50px\",\n },\n \"& .min-icon\": {\n marginRight: \"8px\",\n marginTop: \"8px\",\n height: \"10px\",\n width: \"10px\",\n },\n },\n \"& .onlineCounter\": {\n display: \"flex\",\n alignItems: \"center\",\n marginTop: \"5px\",\n \"& .min-icon\": {\n fill: get(theme, \"signalColors.good\", \"#4CCB92\"),\n },\n },\n \"& .offlineCount\": {\n display: \"flex\",\n alignItems: \"center\",\n marginTop: \"8px\",\n \"& .min-icon\": {\n fill: get(theme, \"signalColors.danger\", \"#C51B3F\"),\n },\n },\n },\n },\n}));\n\nconst StatusCountCard = ({\n onlineCount = 0,\n offlineCount = 0,\n icon = null,\n label = \"\",\n okStatusText = \"Online\",\n notOkStatusText = \"Offline\",\n}: {\n icon: any;\n onlineCount: number;\n offlineCount: number;\n label: string;\n okStatusText?: string;\n notOkStatusText?: string;\n}) => {\n return (\n \n \n \n {label}\n\n \n \n {onlineCount}\n \n \n
{okStatusText}
\n
\n
\n\n \n {offlineCount}\n \n {\" \"}\n
{notOkStatusText}
\n
\n
\n
\n
\n {icon}\n
\n
\n );\n};\n\nexport default StatusCountCard;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\nimport React from \"react\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\nimport { Box, breakPoints, CircleIcon } from \"mds\";\nimport { niceDays } from \"../../../../common/utils\";\nimport {\n getDriveStatusColor,\n getNetworkStatusColor,\n serverStatusColor,\n} from \"./Utils\";\nimport { ServerProperties } from \"api/consoleApi\";\n\ninterface ICardProps {\n server: ServerProperties;\n index: number;\n}\n\nconst ServerStatItemMain = styled.div(({ theme }) => ({\n alignItems: \"baseline\",\n padding: \"5px\",\n display: \"flex\",\n gap: \"5px\",\n \"& .StatBox\": {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexFlow: \"column\",\n \"& .stat-text\": {\n color: get(theme, \"mutedText\", \"#87888d\"),\n fontSize: \"12px\",\n },\n \"& .stat-value\": {\n fontSize: \"18px\",\n color: get(theme, \"signalColors.main\", \"#07193E\"),\n display: \"flex\",\n fontWeight: 500,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n \"& .stat-container\": {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexFlow: \"column\",\n marginLeft: \"5px\",\n maxWidth: \"40px\",\n \"&:first-of-type(svg)\": {\n fill: get(theme, \"mutedText\", \"#87888d\"),\n },\n \"& .stat-indicator\": {\n marginRight: \"0px\",\n justifyContent: \"center\",\n alignItems: \"center\",\n textAlign: \"center\",\n \"& svg.min-icon\": {\n width: \"10px\",\n height: \"10px\",\n },\n \"&.good\": {\n \"& svg.min-icon\": {\n fill: get(theme, \"signalColors.good\", \"#4CCB92\"),\n },\n },\n \"&.warn\": {\n \"& svg.min-icon\": {\n fill: get(theme, \"signalColors.warning\", \"#FFBD62\"),\n },\n },\n \"&.bad\": {\n \"& svg.min-icon\": {\n fill: get(theme, \"signalColors.danger\", \"#C51B3F\"),\n },\n },\n },\n },\n },\n },\n}));\n\nconst ServerInfoItemMain = styled.div(({ theme }) => ({\n display: \"flex\",\n alignItems: \"flex-start\",\n flexFlow: \"column\",\n flex: 1,\n \"& .server-state\": {\n marginLeft: \"8px\",\n \"& .min-icon\": {\n height: \"14px\",\n width: \"14px\",\n },\n \"&.good\": {\n \"& svg.min-icon\": {\n fill: get(theme, \"signalColors.good\", \"#4CCB92\"),\n },\n },\n \"&.warn\": {\n \"& svg.min-icon\": {\n fill: get(theme, \"signalColors.warning\", \"#FFBD62\"),\n },\n },\n \"&.bad\": {\n \"& svg.min-icon\": {\n fill: get(theme, \"signalColors.danger\", \"#C51B3F\"),\n },\n },\n },\n}));\n\nconst ServerStatItem = ({\n label = \"\",\n value = \"\",\n statusColor = \"warn\",\n hasStatus = false,\n}: {\n label?: string;\n value?: any;\n hasStatus?: boolean;\n statusColor?: \"good\" | \"warn\" | \"bad\";\n}) => {\n return (\n \n \n
\n {value}{\" \"}\n \n {hasStatus ? (\n \n \n \n ) : (\n \n )}\n \n
\n
{label}
\n
\n
\n );\n};\n\nconst ServerInfoItem = ({ server }: ICardProps) => {\n const networkKeys = Object.keys(get(server, \"network\", {}));\n const networkTotal = networkKeys.length;\n const totalDrives = server.drives ? server.drives.length : 0;\n const activeNetwork = networkKeys.reduce((acc: number, currValue: string) => {\n const item = server.network ? server.network[currValue] : \"\";\n if (item === \"online\") {\n return acc + 1;\n }\n return acc;\n }, 0);\n const activeDisks = server.drives\n ? server.drives.filter((element) => element.state === \"ok\").length\n : 0;\n return (\n \n \n \n \n {server.endpoint || \"\"}\n \n {server?.state && (\n \n \n \n )}\n \n\n \n \n \n \n \n \n Version:\n {server.version ? server.version : \"N/A\"}\n \n }\n />\n \n \n );\n};\nexport default ServerInfoItem;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport { useMemo } from \"react\";\nimport get from \"lodash/get\";\nimport { useTheme } from \"styled-components\";\nimport { niceBytes } from \"../../../../common/utils\";\nimport { Box, breakPoints, CircleIcon, SizeChart } from \"mds\";\nimport { ServerDrives } from \"api/consoleApi\";\nimport { STATUS_COLORS } from \"./Utils\";\n\ninterface ICardProps {\n drive: ServerDrives;\n}\n\nconst DriveInfoItem = ({ drive }: ICardProps) => {\n const theme = useTheme();\n\n const totalSpace = drive.totalSpace ?? 0;\n const usedSpace = drive.usedSpace ?? 0;\n const usedPercentage =\n totalSpace !== 0 ? Math.max((usedSpace / totalSpace) * 100, 0) : 0;\n const availableSpace = drive.availableSpace ?? 0;\n const availablePercentage =\n totalSpace !== 0 ? Math.max((availableSpace / totalSpace) * 100, 0) : 0;\n\n const driveStatusColor = useMemo(() => {\n switch (drive.state) {\n case \"offline\":\n return STATUS_COLORS.RED;\n case \"ok\":\n return STATUS_COLORS.GREEN;\n default:\n return STATUS_COLORS.YELLOW;\n }\n }, [drive.state]);\n\n const driveStatusText = useMemo(() => {\n switch (drive.state) {\n case \"offline\":\n return \"Offline Drive\";\n case \"ok\":\n return \"Online Drive\";\n default:\n return \"Unknown\";\n }\n }, [drive.state]);\n\n return (\n \n \n \n \n \n \n {drive.endpoint ?? \"\"}\n \n \n \n \n \n {driveStatusText}\n \n \n \n \n \n \n {niceBytes(usedSpace.toString())}\n \n \n {usedPercentage.toFixed(2)}%\n \n of {niceBytes(totalSpace.toString())}\n \n \n \n \n \n \n {niceBytes(availableSpace.toString())}\n \n \n \n {availablePercentage.toFixed(2)}%\n \n of {niceBytes(totalSpace.toString())}\n \n \n \n \n \n );\n};\n\nexport default DriveInfoItem;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Accordion, Box, breakPoints } from \"mds\";\nimport ServerInfoItem from \"./ServerInfoItem\";\nimport DriveInfoItem from \"./DriveInfoItem\";\nimport { ServerProperties } from \"api/consoleApi\";\n\nconst ServersList = ({ data }: { data: ServerProperties[] }) => {\n const [expanded, setExpanded] = React.useState(\n data.length > 1 ? \"\" : data[0].endpoint + \"-0\",\n );\n\n const handleClick = (key: string) => {\n setExpanded(key);\n };\n\n return (\n \n \n Servers ({data.length})\n \n \n {data.map((serverInfo, index) => {\n const key = `${serverInfo.endpoint}-${index}`;\n const isExpanded = expanded === key;\n return (\n {\n if (!isExpanded) {\n handleClick(key);\n } else {\n handleClick(\"\");\n }\n }}\n id={\"key\"}\n title={}\n sx={{ marginBottom: 15 }}\n >\n \n Drives ({serverInfo.drives?.length})\n \n \n {serverInfo.drives?.map((driveInfo, index) => {\n return (\n \n );\n })}\n \n \n );\n })}\n \n \n );\n};\n\nexport default ServersList;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport get from \"lodash/get\";\nimport styled from \"styled-components\";\nimport { Box, breakPoints, Tooltip } from \"mds\";\n\nconst CounterCardMain = styled.div(({ theme }) => ({\n fontFamily: \"Inter,sans-serif\",\n color: get(theme, \"signalColors.main\", \"#07193E\"),\n maxWidth: \"300px\",\n display: \"flex\",\n marginLeft: \"auto\",\n marginRight: \"auto\",\n cursor: \"default\",\n position: \"relative\",\n width: \"100%\",\n}));\n\nconst CounterCard = ({\n counterValue,\n label = \"\",\n icon = null,\n actions = null,\n}: {\n counterValue: string | number;\n label?: any;\n icon?: any;\n actions?: any;\n}) => {\n return (\n \n \n \n \n {label}\n \n\n \n = 5 ? 50 : 55,\n [`@media (max-width: ${breakPoints.sm}px)`]: {\n flexFlow: \"column\",\n maxWidth: 200,\n fontSize: counterValue.toString().length >= 5 ? 20 : 35,\n },\n [`@media (max-width: ${breakPoints.md}px)`]: {\n fontSize: counterValue.toString().length >= 5 ? 28 : 35,\n },\n [`@media (max-width: ${breakPoints.lg}px)`]: {\n fontSize: counterValue.toString().length >= 5 ? 28 : 36,\n },\n [`@media (max-width: ${breakPoints.xl}px)`]: {\n fontSize: counterValue.toString().length >= 5 ? 45 : 50,\n },\n }}\n >\n {counterValue}\n \n \n \n \n {icon}\n\n \n {actions}\n \n \n \n \n );\n};\n\nexport default CounterCard;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport {\n ArrowRightIcon,\n Box,\n breakPoints,\n BucketsIcon,\n Button,\n DiagnosticsMenuIcon,\n DrivesIcon,\n FormatDrivesIcon,\n HealIcon,\n HelpBox,\n PrometheusErrorIcon,\n ServersIcon,\n StorageIcon,\n TotalObjectsIcon,\n UptimeIcon,\n} from \"mds\";\nimport { calculateBytes, representationNumber } from \"../../../../common/utils\";\nimport StatusCountCard from \"./StatusCountCard\";\nimport groupBy from \"lodash/groupBy\";\nimport ServersList from \"./ServersList\";\nimport CounterCard from \"./CounterCard\";\nimport ReportedUsage from \"./ReportedUsage\";\nimport { Link } from \"react-router-dom\";\nimport { IAM_PAGES } from \"../../../../common/SecureComponent/permissions\";\nimport TimeStatItem from \"../TimeStatItem\";\nimport TooltipWrapper from \"../../Common/TooltipWrapper/TooltipWrapper\";\nimport { AdminInfoResponse, ServerDrives } from \"api/consoleApi\";\n\nconst BoxItem = ({ children }: { children: any }) => {\n return (\n \n {children}\n \n );\n};\n\ninterface IDashboardProps {\n usage: AdminInfoResponse | undefined;\n}\n\nconst getServersList = (usage: AdminInfoResponse | undefined) => {\n if (usage && usage.servers) {\n return [...usage.servers].sort(function (a, b) {\n const nameA = a.endpoint?.toLowerCase() || \"\";\n const nameB = b.endpoint?.toLowerCase() || \"\";\n if (nameA < nameB) {\n return -1;\n }\n if (nameA > nameB) {\n return 1;\n }\n return 0;\n });\n }\n\n return [];\n};\n\nconst prettyUsage = (usage: string | undefined) => {\n if (usage === undefined) {\n return { total: \"0\", unit: \"Mi\" };\n }\n\n return calculateBytes(usage);\n};\n\nconst BasicDashboard = ({ usage }: IDashboardProps) => {\n const usageValue = usage && usage.usage ? usage.usage.toString() : \"0\";\n const usageToRepresent = prettyUsage(usageValue);\n\n const { lastScan = \"n/a\", lastHeal = \"n/a\", upTime = \"n/a\" } = {};\n\n const serverList = getServersList(usage);\n\n let allDrivesArray: ServerDrives[] = [];\n\n serverList.forEach((server) => {\n const drivesInput = server.drives?.map((drive) => {\n return drive;\n });\n if (drivesInput) {\n allDrivesArray = [...allDrivesArray, ...drivesInput];\n }\n });\n\n const serversGroup = groupBy(serverList, \"state\");\n const { offline: offlineServers = [], online: onlineServers = [] } =\n serversGroup;\n const drivesGroup = groupBy(allDrivesArray, \"state\");\n const { offline: offlineDrives = [], ok: onlineDrives = [] } = drivesGroup;\n return (\n \n \n \n \n \n }\n counterValue={usage ? representationNumber(usage.buckets) : 0}\n actions={\n \n \n {}}\n label={\"Browse\"}\n icon={}\n variant={\"regular\"}\n style={{\n padding: 5,\n height: 30,\n fontSize: 14,\n marginTop: 20,\n }}\n />\n \n \n }\n />\n \n \n }\n counterValue={usage ? representationNumber(usage.objects) : 0}\n />\n \n\n \n }\n />\n \n \n }\n />\n \n\n \n \n\n \n }\n label={\n \n \n Time since last\n {\" \"}\n Heal Activity\n \n }\n value={lastHeal}\n />\n }\n label={\n \n \n Time since last\n {\" \"}\n Scan Activity\n \n }\n value={lastScan}\n />\n }\n label={\"Uptime\"}\n value={upTime}\n />\n \n \n \n \n }\n label={\"Backend type\"}\n value={usage?.backend?.backendType ?? \"Unknown\"}\n />\n }\n label={\"Standard storage class parity\"}\n value={usage?.backend?.standardSCParity?.toString() ?? \"n/a\"}\n />\n }\n label={\"Reduced redundancy storage class parity\"}\n value={usage?.backend?.rrSCParity?.toString() ?? \"n/a\"}\n />\n \n\n \n \n \n \n {usage?.advancedMetricsStatus === \"not configured\" && (\n \n }\n title={\"We can’t retrieve advanced metrics at this time.\"}\n help={\n \n \n MinIO Dashboard will display basic metrics as we couldn’t\n connect to Prometheus successfully. Please try again in a\n few minutes. If the problem persists, you can review your\n configuration and confirm that Prometheus server is up and\n running.\n \n \n \n Read more about Prometheus on our Docs site.\n \n \n \n }\n />\n \n )}\n \n \n );\n};\n\nexport default BasicDashboard;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useState } from \"react\";\nimport {\n Box,\n Button,\n Grid,\n HelpBox,\n PageLayout,\n ProgressBar,\n PrometheusErrorIcon,\n SyncIcon,\n TabItemProps,\n Tabs,\n} from \"mds\";\nimport { IDashboardPanel } from \"./types\";\nimport { panelsConfiguration } from \"./utils\";\nimport { componentToUse } from \"./widgetUtils\";\nimport { useAppDispatch, useAppSelector } from \"../../../../store\";\nimport {\n DLayoutColumnProps,\n DLayoutRowProps,\n resourcesPanelsLayout,\n resourcesPanelsLayoutAdvanced,\n RowPanelLayout,\n summaryPanelsLayout,\n trafficPanelsLayout,\n} from \"./Widgets/LayoutUtil\";\nimport { getUsageAsync } from \"../dashboardThunks\";\nimport { reloadWidgets } from \"../dashboardSlice\";\nimport { selFeatures } from \"../../consoleSlice\";\nimport { AdminInfoResponse } from \"api/consoleApi\";\nimport ZoomWidget from \"./ZoomWidget\";\nimport DateRangeSelector from \"../../Common/FormComponents/DateRangeSelector/DateRangeSelector\";\nimport MergedWidgetsRenderer from \"./Widgets/MergedWidgetsRenderer\";\nimport BasicDashboard from \"../BasicDashboard/BasicDashboard\";\n\ninterface IPrDashboard {\n apiPrefix?: string;\n usage: AdminInfoResponse | null;\n}\n\nconst PrDashboard = ({ apiPrefix = \"admin\", usage }: IPrDashboard) => {\n const dispatch = useAppDispatch();\n const status = useAppSelector((state) => state.dashboard.status);\n const zoomOpen = useAppSelector((state) => state.dashboard.zoom.openZoom);\n const zoomWidget = useAppSelector(\n (state) => state.dashboard.zoom.widgetRender,\n );\n const features = useAppSelector(selFeatures);\n const obOnly = !!features?.includes(\"object-browser-only\");\n let hideMenu = false;\n if (features?.includes(\"hide-menu\")) {\n hideMenu = true;\n } else if (obOnly) {\n hideMenu = true;\n }\n\n const [timeStart, setTimeStart] = useState(null);\n const [timeEnd, setTimeEnd] = useState(null);\n const panelInformation = panelsConfiguration;\n const [curTab, setCurTab] = useState(\"info\");\n\n const getPanelDetails = (id: number) => {\n return panelInformation.find((panel) => panel.id === id);\n };\n\n const triggerLoad = () => {\n dispatch(reloadWidgets());\n };\n\n const renderCmpByConfig = (\n panelInfo: IDashboardPanel | undefined,\n key: string,\n ) => {\n return (\n \n {panelInfo ? (\n \n \n {panelInfo.mergedPanels ? (\n \n ) : (\n componentToUse(\n panelInfo,\n timeStart,\n timeEnd,\n true,\n apiPrefix,\n zoomOpen,\n )\n )}\n \n \n ) : null}\n \n );\n };\n\n const renderPanelItems = (layoutRows: DLayoutRowProps[]) => {\n return layoutRows.reduce((prev: any[], rowItem, rIdx) => {\n const { columns = [] } = rowItem;\n const cellItems: any[] = columns.map(\n (cellItem: DLayoutColumnProps, colIdx: number) => {\n const panelInfo = getPanelDetails(cellItem.componentId);\n return renderCmpByConfig(panelInfo, `${rIdx}-${colIdx}`);\n },\n );\n const rowConfig = (\n \n {cellItems}\n \n );\n return [...prev, rowConfig];\n }, []);\n };\n\n const renderSummaryPanels = () => {\n return renderPanelItems(summaryPanelsLayout);\n };\n\n const renderTrafficPanels = () => {\n return renderPanelItems(trafficPanelsLayout);\n };\n\n const renderResourcesPanels = () => {\n return renderPanelItems(resourcesPanelsLayout);\n };\n\n const renderAdvancedResourcesPanels = () => {\n return renderPanelItems(resourcesPanelsLayoutAdvanced);\n };\n\n const prometheusOptionsDisabled =\n usage?.advancedMetricsStatus === \"not configured\";\n\n const searchBox = (\n \n {curTab === \"info\" ? (\n \n \n \n Server Information\n \n \n \n \n \n {\n dispatch(getUsageAsync());\n }}\n disabled={status === \"loading\"}\n icon={}\n label={\"Sync\"}\n />\n \n \n \n \n ) : (\n \n )}\n \n );\n\n const infoTab: TabItemProps = {\n tabConfig: { label: \"Info\", id: \"info\", disabled: false },\n content: (\n \n {(!usage || status === \"loading\") && }\n {usage && status === \"idle\" && (\n \n {searchBox}\n \n \n )}\n \n ),\n };\n\n const prometheusTabs: TabItemProps[] = [\n {\n tabConfig: {\n label: \"Usage\",\n id: \"usage\",\n disabled: prometheusOptionsDisabled,\n },\n content: (\n \n {searchBox}\n \n {usage?.advancedMetricsStatus === \"unavailable\" && (\n }\n title={\"We can’t retrieve advanced metrics at this time.\"}\n help={\n \n It looks like Prometheus is not available or reachable at\n the moment.\n \n }\n />\n )}\n {panelInformation.length ? renderSummaryPanels() : null}\n \n \n ),\n },\n {\n tabConfig: {\n label: \"Traffic\",\n id: \"traffic\",\n disabled: prometheusOptionsDisabled,\n },\n content: (\n \n {searchBox}\n \n {usage?.advancedMetricsStatus === \"unavailable\" && (\n }\n title={\"We can’t retrieve advanced metrics at this time.\"}\n help={\n \n It looks like Prometheus is not available or reachable at\n the moment.\n \n }\n />\n )}\n {panelInformation.length ? renderTrafficPanels() : null}\n \n \n ),\n },\n {\n tabConfig: {\n label: \"Resources\",\n id: \"resources\",\n disabled: prometheusOptionsDisabled,\n },\n content: (\n \n {searchBox}\n \n {usage?.advancedMetricsStatus === \"unavailable\" && (\n }\n title={\"We can’t retrieve advanced metrics at this time.\"}\n help={\n \n It looks like Prometheus is not available or reachable at\n the moment.\n \n }\n />\n )}\n {panelInformation.length ? renderResourcesPanels() : null}\n

\n Advanced\n

\n {panelInformation.length ? renderAdvancedResourcesPanels() : null}\n
\n
\n ),\n },\n ];\n\n let tabsOptions: TabItemProps[] = [infoTab, ...prometheusTabs];\n\n return (\n \n {zoomOpen && (\n \n )}\n\n {\n setCurTab(newValue);\n }}\n />\n \n );\n};\n\nexport default PrDashboard;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { AppState, useAppDispatch } from \"../../../store\";\nimport { getUsageAsync } from \"./dashboardThunks\";\nimport { selFeatures } from \"../consoleSlice\";\nimport { setHelpName } from \"../../../systemSlice\";\nimport PrDashboard from \"./Prometheus/PrDashboard\";\nimport PageHeaderWrapper from \"../Common/PageHeaderWrapper/PageHeaderWrapper\";\nimport HelpMenu from \"../HelpMenu\";\n\nconst Dashboard = () => {\n const dispatch = useAppDispatch();\n const [iniLoad, setIniLoad] = useState(false);\n\n const usage = useSelector((state: AppState) => state.dashboard.usage);\n const features = useSelector(selFeatures);\n const obOnly = !!features?.includes(\"object-browser-only\");\n let hideMenu = false;\n if (features?.includes(\"hide-menu\")) {\n hideMenu = true;\n } else if (obOnly) {\n hideMenu = true;\n }\n\n useEffect(() => {\n if (!iniLoad) {\n setIniLoad(true);\n dispatch(getUsageAsync());\n }\n }, [iniLoad, dispatch]);\n\n useEffect(() => {\n dispatch(setHelpName(\"metrics\"));\n }, [dispatch]);\n\n return (\n \n {!hideMenu && (\n } />\n )}\n \n \n );\n};\n\nexport default Dashboard;\n"],"names":["_ref","timeStart","setTimeStart","timeEnd","setTimeEnd","triggerSync","label","startLabel","endLabel","_jsx","Grid","item","xs","sx","display","width","border","paddingLeft","paddingRight","borderRadius","height","marginRight","color","WebkitTextFillColor","children","_jsxs","Box","alignItems","gridTemplateColumns","padding","breakPoints","sm","md","gap","fontSize","fontWeight","className","customBorderPadding","DateTimeInput","value","onChange","id","secondsSelector","pickerStartComponent","Fragment","TimeIcon","justifyContent","Button","type","variant","onClick","icon","SyncIcon","onClose","modalOpen","title","wideLimit","titleIcon","iconColor","dispatch","useAppDispatch","openSnackbar","setOpenSnackbar","useState","modalSnackMessage","useSelector","state","system","modalSnackBar","useEffect","setModalSnackMessage","message","detailedErrorMsg","length","ModalBox","open","widthLimit","MainError","isModal","Snackbar","closeSnackBar","mode","autoHideDuration","condensed","STATUS_COLORS","RED","GREEN","YELLOW","getDriveStatusColor","activeDisks","totalDrives","serverStatusColor","health_status","getNetworkStatusColor","activeNetwork","networkTotal","widgetType","colorsMain","niceDaysFromNS","seconds","niceDays","roundNumber","parseInt","toString","panelsConfiguration","data","simpleWidget","widgetIcon","UptimeIcon","labelDisplayFunction","dataOuter","name","widgetConfiguration","outerChart","colorList","innerRadius","outerRadius","startAngle","endAngle","innerChart","pieChart","innerLabel","niceBytes","dataKey","keyLabel","lineColor","fillColor","areaGraph","yAxisFormatter","xAxisFormatter","getTimeFromTimestamp","background","fill","greatestColor","customStructure","originTag","displayTag","barChart","singleRep","strokeWidth","linearGraph","HealIcon","DiagnosticsIcon","disableYAxis","mergedPanels","singleValue","calculateMainValue","elements","metricCalc","sumValues","reduce","accumulator","currValue","parseFloat","Math","floor","sortResult","sort","value1","value2","widgetDetailsToPanel","payloadData","panelItem","typeOfPayload","get","valueDisplay","chartSeries","filter","seriesItem","values","map","chartTarget","result","Array","isArray","elementValue","metricKeyItem","Object","keys","metric","metricName","legend","legendFormat","firstTarget","totalValues","targets","series","plotValues","forEach","targetMaster","index","results","itemVals","labelName","constructLabelNames","metrics","keysToReplace","expToReplace","RegExp","join","replacedLegend","replace","matchItem","nwMatchItem","countVarsOpen","match","countVarsClose","cleanLegend","element","keyName","push","valInfo","itemIndex","findIndex","itemToPush","seriesWithColors","series1","series2","serialC","textToRGBColor","sortedVals","chartBars","sortFunction","structureItem","metricTake","find","range","lastValue","a","valuesForBackground","eachVal","splitSizeMetric","val","splittedText","split","vl","isNaN","representationNumber","units","includes","backgroundColor","cursor","openZoomPage","ExpandIcon","componentRef","anchorEl","setAnchorEl","React","openDownloadMenu","Boolean","downloadAsCSV","download","filename","text","document","createElement","setAttribute","style","body","appendChild","click","removeChild","Date","now","trim","toLowerCase","objectToConvert","concat","it","err","errorMessage","detailedError","setErrorSnackMessage","onDownloadError","handleSelectedOption","selectOption","downloadAsPNG","pngFileName","exportComponentAsPNG","fileName","justifyItems","event","currentTarget","DownloadIcon","DropdownSelector","options","selectedOption","onSelect","hideTriggerAction","anchorOrigin","active","payload","barChartConfiguration","tooltipCommon","customTooltip","timeStampTitle","pl","labelContainer","labelColor","itemValue","valueContainer","BarChartMain","styled","div","theme","widgetCommon","loadingAlign","paddingTop","textAlign","margin","CustomizedAxisTick","_ref2","y","textAnchor","transform","dy","_ref3","apiPrefix","zoomActivated","loading","setLoading","setData","setResult","hover","setHover","biggerThanMd","setBiggerThanMd","window","innerWidth","useRef","widgetVersion","dashboard","widgetLoadVersion","handleWindowResize","extMD","addEventListener","removeEventListener","stepCalc","secondsInPeriod","toUnixInteger","periods","api","invoke","then","res","widgetsWithValue","catch","greatestIndex","currentValue","dataGraph","onMouseOver","onHover","onMouseLeave","onStopHover","container","ExpandGraphLink","DownloadWidgetDataButton","Loader","ref","ResponsiveContainer","BarChart","layout","barCategoryGap","XAxis","hide","YAxis","interval","tick","tickLine","axisLine","bar","Bar","barSize","_","Cell","Tooltip","content","BarChartTooltip","linearConfiguration","LinearGraphMain","position","flexDirection","flex","maxHeight","overflowY","hideYAxis","areaWidget","var1","var2","csvData","setCsvData","dataMax","setDataMax","maxVal","dp","key","intervalCount","fmtData","el","date","CustomizedDot","prop","cx","cy","r","dspLongDate","alignContent","AreaChart","top","right","left","bottom","x1","y1","x2","y2","offset","stopColor","stopOpacity","CartesianGrid","strokeDasharray","strokeOpacity","stroke","vertical","tickFormatter","tickCount","domain","section","Area","isAnimationActive","fillOpacity","strokeLinecap","dot","LineChartTooltip","wrapperStyle","zIndex","PieChartMain","dataInner","setDataInner","setDataOuter","pieChartConfiguration","middleLabel","innerColors","outerColors","PieChart","Pie","entry","SimpleWidgetMain","span","marginLeft","textTransform","iconWidget","renderFn","valueToRender","withBorders","maxWidth","flexFlow","StatCardMain","fontFamily","marginTop","overflow","tooltip","placement","textOverflow","lg","xl","NumericStatCard","BucketsIcon","TotalObjectsIcon","connect","propLoading","repNumber","resultRep","DashboardItemBox","BucketsCountItem","ObjectsCountItem","SingleValueWidgetMain","lineHeight","CapacityItemMain","alignSelf","totalUsableFree","setTotalUsableFree","totalUsableFreeRatio","setTotalUsableFreeRatio","totalUsed","setTotalUsed","totalUsable","setTotalUsable","tUsable","tUsed","tFree","eachArray","itemSum","freeRatio","round","usedConvert","calculateBytes","capacityColors","animationDuration","total","unit","niceBytesInt","ReportedUsageIcon","TimeStatBase","SuccessIcon","TimeStatItem","componentToUse","arguments","undefined","SingleValueWidget","CmpToRender","HealActivityRenderer","ScanActivityRenderer","UptimeActivityRenderer","SimpleWidget","CapacityItem","PieChartWidget","LinearGraphWidget","BarChartWidget","SingleRepWidget","summaryPanelsLayout","minWidth","columns","componentId","trafficPanelsLayout","flexShrink","resourcesPanelsLayout","resourcesPanelsLayoutAdvanced","RowPanelLayout","ModalWrapper","closeZoomPage","CommonCardItem","metricValue","metricUnit","subMessage","moreLink","rightComponent","extraMargin","SubHeader","Header","Link","to","leftComponent","CommonCard","statLabel","DualSTCardContent","statItemLeft","statItemRight","paddingBottom","StateIndicator","info","leftPanel","rightPanel","lStatItem","EntityStateStatItem","CircleIcon","rStatItem","statIcon","ServersIcon","DrivesIcon","DualStatCard","NetworkGetBase","NetworkGetIcon","NetworkPutBase","NetworkPutIcon","NetworkItemBase","rightCmp","NetworkPutItem","leftCmp","_ref4","NetworkGetItem","SpeedtestIcon","EntityStateItemRenderer","NetworkItem","MergedWidgets","StatusCountBase","onlineCount","offlineCount","okStatusText","notOkStatusText","ServerStatItemMain","whiteSpace","ServerInfoItemMain","ServerStatItem","statusColor","hasStatus","server","networkKeys","drives","acc","network","endpoint","uptime","version","_drive$totalSpace","_drive$usedSpace","_drive$availableSpace","_drive$endpoint","drive","useTheme","totalSpace","usedSpace","usedPercentage","max","availableSpace","availablePercentage","driveStatusColor","useMemo","driveStatusText","wordBreak","SizeChart","chartLabel","usedBytes","totalBytes","toFixed","expanded","setExpanded","handleClick","serverInfo","_serverInfo$drives","_serverInfo$drives2","isExpanded","Accordion","onTitleClick","ServerInfoItem","marginBottom","useBackground","driveInfo","DriveInfoItem","CounterCardMain","counterValue","actions","BoxItem","_usage$backend","_usage$backend2","_usage$backend$backen","_usage$backend3","_usage$backend$standa","_usage$backend4","_usage$backend4$stand","_usage$backend$rrSCPa","_usage$backend5","_usage$backend5$rrSCP","usage","usageValue","usageToRepresent","prettyUsage","lastScan","lastHeal","upTime","serverList","servers","b","_a$endpoint","_b$endpoint","nameA","nameB","getServersList","allDrivesArray","_server$drives","drivesInput","serversGroup","groupBy","offline","offlineServers","online","onlineServers","drivesGroup","offlineDrives","ok","onlineDrives","gridTemplateRows","CounterCard","buckets","IAM_PAGES","BUCKETS","textDecoration","TooltipWrapper","ArrowRightIcon","objects","StatusCountCard","backend","gridRowStart","gridRowEnd","gridColumnStart","ReportedUsage","DiagnosticsMenuIcon","StorageIcon","backendType","FormatDrivesIcon","standardSCParity","rrSCParity","ServersList","advancedMetricsStatus","HelpBox","iconComponent","PrometheusErrorIcon","help","href","target","rel","status","useAppSelector","zoomOpen","zoom","openZoom","zoomWidget","widgetRender","features","selFeatures","obOnly","hideMenu","panelInformation","curTab","setCurTab","renderPanelItems","layoutRows","prev","rowItem","rIdx","cellItems","cellItem","colIdx","renderCmpByConfig","panelInfo","MergedWidgetsRenderer","panel","prometheusOptionsDisabled","searchBox","direction","getUsageAsync","disabled","DateRangeSelector","triggerLoad","reloadWidgets","tabsOptions","tabConfig","ProgressBar","BasicDashboard","borderBottom","PageLayout","ZoomWidget","Tabs","horizontal","currentTabOrPath","onTabClick","newValue","Dashboard","iniLoad","setIniLoad","setHelpName","PageHeaderWrapper","HelpMenu","PrDashboard"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/258.1442e3bb.chunk.js b/web-app/build/static/js/258.1442e3bb.chunk.js new file mode 100644 index 000000000..ea1b6a068 --- /dev/null +++ b/web-app/build/static/js/258.1442e3bb.chunk.js @@ -0,0 +1,2 @@ +(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[258],{649:(e,t,o)=>{"use strict";o.d(t,{A:()=>c});var r=o(6797),n=o.n(r),a=o(3097),s=o.n(a),i=o(6483),l=o(4710);const c=new class{invoke(e,t,o,r){let a=t;"/"===a[0]&&(a=a.slice(1));let s=n()(e,a);if(r)for(let n in r)s.set(n,r[n]);return s.send(o).then((e=>e.body)).catch((e=>401===e.status&&localStorage.getItem("userLoggedIn")&&!a.includes("api/v1/login")?("/"!==window.location.pathname&&localStorage.setItem("redirect-path",window.location.pathname),(0,i.q7)(),void(window.location.href=`${l.p}login`)):this.onError(e)))}onError(e){if(e.status){const t=s()(e.response,"body.message",`Error ${e.status.toString()}`);let o=s()(e.response,"body.detailedMessage","");t===o&&(o="");const r={errorMessage:t.charAt(0).toUpperCase()+t.slice(1),detailedError:o.charAt(0).toUpperCase()+o.slice(1),statusCode:e.status};return Promise.reject(r)}(0,i.q7)(),window.location.href=`${l.p}login`}}},6483:(e,t,o)=>{"use strict";o.d(t,{K7:()=>u,Tw:()=>m,eQ:()=>p,nO:()=>l,oK:()=>f,q7:()=>h,qO:()=>c,qf:()=>g});var r=o(9816),n=o(3097),a=o.n(n);const s=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=["Ki","Mi","Gi","Ti","Pi","Ei"],l=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=parseInt(e,10)||0;return c(o,t)},c=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=0;for(;e>=1024&&++o;)e/=1024;const r=["B",...i];return e.toFixed(1)+" "+(t?r[o]:s[o])},d=e=>{document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;"},h=()=>{r.Ay.removeItem("token"),r.Ay.removeItem("auth-state"),d("token"),d("idp-refresh-token")},u=e=>{const t=Math.floor(e/86400),o=Math.floor(e%86400/3600),r=Math.floor(e%3600/60),n=e%60,a=[];return t>0&&a.push(`${t} day${1!==t?"s":""}`),o>0&&a.push(`${o} hour${1!==o?"s":""}`),r>0&&a.push(`${r} minute${1!==r?"s":""}`),n>0&&a.push(`${n} second${1!==n?"s":""}`),a.join(" and ")},p=function(e){switch(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"s"){case"ns":e=Math.floor(1e-9*e);break;case"ms":e=Math.floor(.001*e)}const t=Math.floor(e/86400);e-=3600*t*24;const o=Math.floor(e/3600);e-=3600*o;const r=Math.floor(e/60);if(e-=60*r,t>365){const e=t/365;return`${e} year${1===Math.floor(e)?"":"s"}`}if(t>30){const e=Math.floor(t/30),o=t-30*e;return`${e} month${1===Math.floor(e)?"":"s"} ${o>0?`${o} day${o>1?"s":""}`:""}`}if(t>=7&&t<=30){const e=Math.floor(t/7);return`${Math.floor(e)} week${1===e?"":"s"}`}return t>=1&&t<=6?`${t} day${t>1?"s":""}`:`${o>=1?`${o} hour${o>1?"s":""}`:""} ${r>=1&&0===o?`${r} minute${r>1?"s":""}`:""} ${e>=1&&0===r&&0===o?`${e} second${e>1?"s":""}`:""}`},f=()=>{const e=a()(window.navigator,"platform","undefined");return e||"undefined"},g=e=>e.split("\u202e").join("<\ufffd202e>"),m=e=>{try{return decodeURIComponent(e)}catch(t){return e}}},9361:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>f});var r=o(5043),n=o(4574),a=o(3216),s=o(649),i=o(4710),l=o(9923),c=o(4558),d=o(3097),h=o.n(d),u=o(579);const p=n.Ay.div((e=>{let{theme:t}=e;return{"& .errorDescription":{fontStyle:"italic",transition:"all .2s ease-in-out",padding:"0 15px",marginTop:5,overflow:"auto"},"& .errorLabel":{color:h()(t,"fontColor","#000"),fontSize:18,fontWeight:"bold",marginLeft:5},"& .simpleError":{marginTop:5,padding:"2px 5px",fontSize:16,color:h()(t,"fontColor","#000")},"& .messageIcon":{color:h()(t,"signalColors.danger","#C72C48"),display:"flex","& svg":{width:32,height:32}},"& .errorTitle":{display:"flex",alignItems:"center",borderBottom:15}}})),f=()=>{const e=(0,a.Zp)(),[t,o]=(0,r.useState)(""),[n,d]=(0,r.useState)(""),[h,f]=(0,r.useState)(!0);return(0,r.useEffect)((()=>{if(h){const t=window.location.search,r=new URLSearchParams(t),n=r.get("code"),a=r.get("state"),i=r.get("error"),l=r.get("errorDescription");i||l?(o(i||""),d(l||""),f(!1)):s.A.invoke("POST","/api/v1/login/oauth2/auth",{code:n,state:a}).then((()=>{let t="/";localStorage.getItem("redirect-path")&&""!==localStorage.getItem("redirect-path")&&(t=`${localStorage.getItem("redirect-path")}`,localStorage.setItem("redirect-path","")),a&&localStorage.setItem("auth-state",a),f(!1),e(t)})).catch((e=>{o(e.errorMessage),d(e.detailedError),f(!1)}))}}),[h,e]),""!==t||""!==n?(0,u.jsx)(r.Fragment,{children:(0,u.jsx)(l.ndn,{logoProps:{applicationName:(0,c.R)(),subVariant:(0,c.v)()},form:(0,u.jsxs)(p,{children:[(0,u.jsxs)("div",{className:"errorTitle",children:[(0,u.jsx)("span",{className:"messageIcon",children:(0,u.jsx)(l.cJw,{})}),(0,u.jsx)("span",{className:"errorLabel",children:"Error from IDP"})]}),(0,u.jsx)("div",{className:"simpleError",children:t}),(0,u.jsx)(l.azJ,{className:"errorDescription",children:n}),(0,u.jsx)(l.$nd,{id:"back-to-login",onClick:()=>{window.location.href=`${i.p}login`},type:"submit",variant:"callAction",fullWidth:!0,children:"Back to Login"})]}),promoHeader:(0,u.jsx)("span",{style:{fontSize:28},children:"High-Performance Object Store"}),promoInfo:(0,u.jsxs)("span",{style:{fontSize:14,lineHeight:1},children:["MinIO is a cloud-native object store built to run on any infrastructure - public, private or edge clouds. Primary use cases include data lakes, databases, AI/ML, SaaS applications and fast backup & recovery. MinIO is dual licensed under GNU AGPL v3 and commercial license. To learn more, visit"," ",(0,u.jsx)("a",{href:"https://min.io/?ref=con",target:"_blank",rel:"noopener",children:"www.min.io"}),"."]}),backgroundAnimation:!1})}):null}},2634:()=>{}}]); +//# sourceMappingURL=258.1442e3bb.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/258.1442e3bb.chunk.js.map b/web-app/build/static/js/258.1442e3bb.chunk.js.map new file mode 100644 index 000000000..8cb3e71a4 --- /dev/null +++ b/web-app/build/static/js/258.1442e3bb.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"static/js/258.1442e3bb.chunk.js","mappings":"+KA+FA,MACA,EADY,IAvEL,MACLA,MAAAA,CAAOC,EAAgBC,EAAaC,EAAeC,GACjD,IAAIC,EAAYH,EACK,MAAjBG,EAAU,KACZA,EAAYA,EAAUC,MAAM,IAE9B,IAAIC,EAAMC,IAAQP,EAAQI,GAE1B,GAAID,EACF,IAAK,IAAIK,KAAKL,EACZG,EAAIG,IAAID,EAAGL,EAAQK,IAIvB,OAAOF,EACJI,KAAKR,GACLS,MAAMC,GAAQA,EAAIC,OAClBC,OAAOC,GAGW,MAA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C,SAAA,EAChBQ,EAAAA,EAAAA,MAAA,OAAKC,UAAW,aAAaT,SAAA,EAC3BF,EAAAA,EAAAA,KAAA,QAAMW,UAAW,cAAcT,UAC7BF,EAAAA,EAAAA,KAACY,EAAAA,IAAQ,OAEXZ,EAAAA,EAAAA,KAAA,QAAMW,UAAW,aAAaT,SAAC,uBAEjCF,EAAAA,EAAAA,KAAA,OAAKW,UAAW,cAAcT,SAAElB,KAChCgB,EAAAA,EAAAA,KAACa,EAAAA,IAAG,CAACF,UAAW,mBAAmBT,SAAEf,KACrCa,EAAAA,EAAAA,KAACc,EAAAA,IAAM,CACLC,GAAI,gBACJC,QAASA,KACPzH,OAAOC,SAASI,KAAO,GAAGC,EAAAA,QAAc,EAE1CoH,KAAK,SACLC,QAAQ,aACRC,WAAS,EAAAjB,SACV,qBAKLkB,aACEpB,EAAAA,EAAAA,KAAA,QAAMqB,MAAO,CAAEhD,SAAU,IAAK6B,SAAC,kCAEjCoB,WACEZ,EAAAA,EAAAA,MAAA,QAAMW,MAAO,CAAEhD,SAAU,GAAIkD,WAAY,GAAIrB,SAAA,CAAC,wSAKH,KACzCF,EAAAA,EAAAA,KAAA,KAAGpG,KAAM,0BAA2B4H,OAAO,SAASC,IAAI,WAAUvB,SAAC,eAE/D,OAIRwB,qBAAqB,MAGvB,IAAI,C","sources":["common/api/index.ts","common/utils.ts","screens/LoginPage/LoginCallback.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport request from \"superagent\";\nimport get from \"lodash/get\";\nimport { clearSession } from \"../utils\";\nimport { ErrorResponseHandler } from \"../types\";\nimport { baseUrl } from \"../../history\";\n\ntype RequestHeaders = { [name: string]: string };\n\nexport class API {\n invoke(method: string, url: string, data?: object, headers?: RequestHeaders) {\n let targetURL = url;\n if (targetURL[0] === \"/\") {\n targetURL = targetURL.slice(1);\n }\n let req = request(method, targetURL);\n\n if (headers) {\n for (let k in headers) {\n req.set(k, headers[k]);\n }\n }\n\n return req\n .send(data)\n .then((res) => res.body)\n .catch((err) => {\n // if we get unauthorized and we are not doing login, kick out the user\n if (\n err.status === 401 &&\n localStorage.getItem(\"userLoggedIn\") &&\n !targetURL.includes(\"api/v1/login\")\n ) {\n if (window.location.pathname !== \"/\") {\n localStorage.setItem(\"redirect-path\", window.location.pathname);\n }\n clearSession();\n // Refresh the whole page to ensure cache is clear\n // and we dont end on an infinite loop\n window.location.href = `${baseUrl}login`;\n return;\n }\n\n return this.onError(err);\n });\n }\n\n onError(err: any) {\n if (err.status) {\n const errMessage = get(\n err.response,\n \"body.message\",\n `Error ${err.status.toString()}`,\n );\n\n let detailedMessage = get(err.response, \"body.detailedMessage\", \"\");\n\n if (errMessage === detailedMessage) {\n detailedMessage = \"\";\n }\n\n const capMessage =\n errMessage.charAt(0).toUpperCase() + errMessage.slice(1);\n const capDetailed =\n detailedMessage.charAt(0).toUpperCase() + detailedMessage.slice(1);\n\n const throwMessage: ErrorResponseHandler = {\n errorMessage: capMessage,\n detailedError: capDetailed,\n statusCode: err.status,\n };\n\n return Promise.reject(throwMessage);\n } else {\n clearSession();\n window.location.href = `${baseUrl}login`;\n }\n }\n}\n\nconst api = new API();\nexport default api;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport storage from \"local-storage-fallback\";\nimport { IErasureCodeCalc, IStorageFactors } from \"./types\";\n\nimport get from \"lodash/get\";\n\nconst minMemReq = 2147483648; // Minimal Memory required for MinIO in bytes\n\nconst units = [\"B\", \"KiB\", \"MiB\", \"GiB\", \"TiB\", \"PiB\", \"EiB\", \"ZiB\", \"YiB\"];\nconst k8sUnits = [\"Ki\", \"Mi\", \"Gi\", \"Ti\", \"Pi\", \"Ei\"];\nconst k8sCalcUnits = [\"B\", ...k8sUnits];\n\nexport const niceBytes = (x: string, showK8sUnits: boolean = false) => {\n let n = parseInt(x, 10) || 0;\n\n return niceBytesInt(n, showK8sUnits);\n};\n\nexport const niceBytesInt = (n: number, showK8sUnits: boolean = false) => {\n let l = 0;\n\n while (n >= 1024 && ++l) {\n n = n / 1024;\n }\n // include a decimal point and a tenths-place digit if presenting\n // less than ten of KB or greater units\n const k8sUnitsN = [\"B\", ...k8sUnits];\n return n.toFixed(1) + \" \" + (showK8sUnits ? k8sUnitsN[l] : units[l]);\n};\n\nconst deleteCookie = (name: string) => {\n document.cookie = name + \"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;\";\n};\n\nexport const clearSession = () => {\n storage.removeItem(\"token\");\n storage.removeItem(\"auth-state\");\n deleteCookie(\"token\");\n deleteCookie(\"idp-refresh-token\");\n};\n\n//getBytes, converts from a value and a unit from units array to bytes as a string\nexport const getBytes = (\n value: string,\n unit: string,\n fromk8s: boolean = false,\n): string => {\n return getBytesNumber(value, unit, fromk8s).toString(10);\n};\n\n//getBytesNumber, converts from a value and a unit from units array to bytes\nconst getBytesNumber = (\n value: string,\n unit: string,\n fromk8s: boolean = false,\n): number => {\n const vl: number = parseFloat(value);\n\n const unitsTake = fromk8s ? k8sCalcUnits : units;\n\n const powFactor = unitsTake.findIndex((element) => element === unit);\n\n if (powFactor === -1) {\n return 0;\n }\n const factor = Math.pow(1024, powFactor);\n const total = vl * factor;\n\n return total;\n};\n\nexport const setMemoryResource = (\n memorySize: number,\n capacitySize: string,\n maxMemorySize: number,\n) => {\n // value always comes as Gi\n const requestedSizeBytes = getBytes(memorySize.toString(10), \"Gi\", true);\n const memReqSize = parseInt(requestedSizeBytes, 10);\n if (maxMemorySize === 0) {\n return {\n error: \"There is no memory available for the selected number of nodes\",\n request: 0,\n limit: 0,\n };\n }\n\n if (maxMemorySize < minMemReq) {\n return {\n error: \"There are not enough memory resources available\",\n request: 0,\n limit: 0,\n };\n }\n\n if (memReqSize < minMemReq) {\n return {\n error: \"The requested memory size must be greater than 2Gi\",\n request: 0,\n limit: 0,\n };\n }\n if (memReqSize > maxMemorySize) {\n return {\n error:\n \"The requested memory is greater than the max available memory for the selected number of nodes\",\n request: 0,\n limit: 0,\n };\n }\n\n const capSize = parseInt(capacitySize, 10);\n let memLimitSize = memReqSize;\n // set memory limit based on the capacitySize\n // if capacity size is lower than 1TiB we use the limit equal to request\n if (capSize >= parseInt(getBytes(\"1\", \"Pi\", true), 10)) {\n memLimitSize = Math.max(\n memReqSize,\n parseInt(getBytes(\"64\", \"Gi\", true), 10),\n );\n } else if (capSize >= parseInt(getBytes(\"100\", \"Ti\"), 10)) {\n memLimitSize = Math.max(\n memReqSize,\n parseInt(getBytes(\"32\", \"Gi\", true), 10),\n );\n } else if (capSize >= parseInt(getBytes(\"10\", \"Ti\"), 10)) {\n memLimitSize = Math.max(\n memReqSize,\n parseInt(getBytes(\"16\", \"Gi\", true), 10),\n );\n } else if (capSize >= parseInt(getBytes(\"1\", \"Ti\"), 10)) {\n memLimitSize = Math.max(\n memReqSize,\n parseInt(getBytes(\"8\", \"Gi\", true), 10),\n );\n }\n\n return {\n error: \"\",\n request: memReqSize,\n limit: memLimitSize,\n };\n};\n\n// Erasure Code Parity Calc\nexport const erasureCodeCalc = (\n parityValidValues: string[],\n totalDisks: number,\n pvSize: number,\n totalNodes: number,\n): IErasureCodeCalc => {\n // Parity Values is empty\n if (parityValidValues.length < 1) {\n return {\n error: 1,\n defaultEC: \"\",\n erasureCodeSet: 0,\n maxEC: \"\",\n rawCapacity: \"0\",\n storageFactors: [],\n };\n }\n\n const totalStorage = totalDisks * pvSize;\n const maxEC = parityValidValues[0];\n const maxParityNumber = parseInt(maxEC.split(\":\")[1], 10);\n\n const erasureStripeSet = maxParityNumber * 2; // ESS is calculated by multiplying maximum parity by two.\n\n const storageFactors: IStorageFactors[] = parityValidValues.map(\n (currentParity) => {\n const parityNumber = parseInt(currentParity.split(\":\")[1], 10);\n const storageFactor =\n erasureStripeSet / (erasureStripeSet - parityNumber);\n\n const maxCapacity = Math.floor(totalStorage / storageFactor);\n const maxTolerations =\n totalDisks - Math.floor(totalDisks / storageFactor);\n return {\n erasureCode: currentParity,\n storageFactor,\n maxCapacity: maxCapacity.toString(10),\n maxFailureTolerations: maxTolerations,\n };\n },\n );\n\n let defaultEC = maxEC;\n\n const fourVar = parityValidValues.find((element) => element === \"EC:4\");\n\n if (fourVar) {\n defaultEC = \"EC:4\";\n }\n\n return {\n error: 0,\n storageFactors,\n maxEC,\n rawCapacity: totalStorage.toString(10),\n erasureCodeSet: erasureStripeSet,\n defaultEC,\n };\n};\n\n// 92400 seconds -> 1 day, 1 hour, 40 minutes.\nexport const niceTimeFromSeconds = (seconds: number): string => {\n const days = Math.floor(seconds / (3600 * 24));\n const hours = Math.floor((seconds % (3600 * 24)) / 3600);\n const minutes = Math.floor((seconds % 3600) / 60);\n const remainingSeconds = seconds % 60;\n\n const parts = [];\n\n if (days > 0) {\n parts.push(`${days} day${days !== 1 ? \"s\" : \"\"}`);\n }\n\n if (hours > 0) {\n parts.push(`${hours} hour${hours !== 1 ? \"s\" : \"\"}`);\n }\n\n if (minutes > 0) {\n parts.push(`${minutes} minute${minutes !== 1 ? \"s\" : \"\"}`);\n }\n\n if (remainingSeconds > 0) {\n parts.push(\n `${remainingSeconds} second${remainingSeconds !== 1 ? \"s\" : \"\"}`,\n );\n }\n\n return parts.join(\" and \");\n};\n\n// niceDaysInt returns the string in the max unit found e.g. 92400 seconds -> 1 day\nexport const niceDaysInt = (seconds: number, timeVariant: string = \"s\") => {\n switch (timeVariant) {\n case \"ns\":\n seconds = Math.floor(seconds * 0.000000001);\n break;\n case \"ms\":\n seconds = Math.floor(seconds * 0.001);\n break;\n default:\n }\n\n const days = Math.floor(seconds / (3600 * 24));\n\n seconds -= days * 3600 * 24;\n const hours = Math.floor(seconds / 3600);\n seconds -= hours * 3600;\n const minutes = Math.floor(seconds / 60);\n seconds -= minutes * 60;\n\n if (days > 365) {\n const years = days / 365;\n return `${years} year${Math.floor(years) === 1 ? \"\" : \"s\"}`;\n }\n\n if (days > 30) {\n const months = Math.floor(days / 30);\n const diffDays = days - months * 30;\n\n return `${months} month${Math.floor(months) === 1 ? \"\" : \"s\"} ${\n diffDays > 0 ? `${diffDays} day${diffDays > 1 ? \"s\" : \"\"}` : \"\"\n }`;\n }\n\n if (days >= 7 && days <= 30) {\n const weeks = Math.floor(days / 7);\n\n return `${Math.floor(weeks)} week${weeks === 1 ? \"\" : \"s\"}`;\n }\n\n if (days >= 1 && days <= 6) {\n return `${days} day${days > 1 ? \"s\" : \"\"}`;\n }\n\n return `${hours >= 1 ? `${hours} hour${hours > 1 ? \"s\" : \"\"}` : \"\"} ${\n minutes >= 1 && hours === 0\n ? `${minutes} minute${minutes > 1 ? \"s\" : \"\"}`\n : \"\"\n } ${\n seconds >= 1 && minutes === 0 && hours === 0\n ? `${seconds} second${seconds > 1 ? \"s\" : \"\"}`\n : \"\"\n }`;\n};\n\nexport const getClientOS = (): string => {\n const getPlatform = get(window.navigator, \"platform\", \"undefined\");\n\n if (!getPlatform) {\n return \"undefined\";\n }\n\n return getPlatform;\n};\n\n// replaces bad unicode characters\nexport const replaceUnicodeChar = (inputString: string): string => {\n let unicodeChar = \"\\u202E\";\n return inputString.split(unicodeChar).join(\"<�202e>\");\n};\n\n// unescaped characters might throw error like '%'\nexport const safeDecodeURIComponent = (value: any) => {\n try {\n return decodeURIComponent(value);\n } catch (err) {\n return value;\n }\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport styled from \"styled-components\";\nimport { useNavigate } from \"react-router-dom\";\nimport api from \"../../common/api\";\nimport { baseUrl } from \"../../history\";\nimport { Box, Button, LoginWrapper, WarnIcon } from \"mds\";\nimport { getLogoApplicationVariant, getLogoVar } from \"../../config\";\nimport get from \"lodash/get\";\n\nconst CallBackContainer = styled.div(({ theme }) => ({\n \"& .errorDescription\": {\n fontStyle: \"italic\",\n transition: \"all .2s ease-in-out\",\n padding: \"0 15px\",\n marginTop: 5,\n overflow: \"auto\",\n },\n \"& .errorLabel\": {\n color: get(theme, \"fontColor\", \"#000\"),\n fontSize: 18,\n fontWeight: \"bold\",\n marginLeft: 5,\n },\n \"& .simpleError\": {\n marginTop: 5,\n padding: \"2px 5px\",\n fontSize: 16,\n color: get(theme, \"fontColor\", \"#000\"),\n },\n \"& .messageIcon\": {\n color: get(theme, \"signalColors.danger\", \"#C72C48\"),\n display: \"flex\",\n \"& svg\": {\n width: 32,\n height: 32,\n },\n },\n \"& .errorTitle\": {\n display: \"flex\",\n alignItems: \"center\",\n borderBottom: 15,\n },\n}));\n\nconst LoginCallback = () => {\n const navigate = useNavigate();\n\n const [error, setError] = useState(\"\");\n const [errorDescription, setErrorDescription] = useState(\"\");\n const [loading, setLoading] = useState(true);\n\n useEffect(() => {\n if (loading) {\n const queryString = window.location.search;\n const urlParams = new URLSearchParams(queryString);\n const code = urlParams.get(\"code\");\n const state = urlParams.get(\"state\");\n const error = urlParams.get(\"error\");\n const errorDescription = urlParams.get(\"errorDescription\");\n if (error || errorDescription) {\n setError(error || \"\");\n setErrorDescription(errorDescription || \"\");\n setLoading(false);\n } else {\n api\n .invoke(\"POST\", \"/api/v1/login/oauth2/auth\", { code, state })\n .then(() => {\n // We push to history the new URL.\n let targetPath = \"/\";\n if (\n localStorage.getItem(\"redirect-path\") &&\n localStorage.getItem(\"redirect-path\") !== \"\"\n ) {\n targetPath = `${localStorage.getItem(\"redirect-path\")}`;\n localStorage.setItem(\"redirect-path\", \"\");\n }\n if (state) {\n localStorage.setItem(\"auth-state\", state);\n }\n setLoading(false);\n navigate(targetPath);\n })\n .catch((error) => {\n setError(error.errorMessage);\n setErrorDescription(error.detailedError);\n setLoading(false);\n });\n }\n }\n }, [loading, navigate]);\n return error !== \"\" || errorDescription !== \"\" ? (\n \n \n
\n \n \n \n Error from IDP\n
\n
{error}
\n {errorDescription}\n {\n window.location.href = `${baseUrl}login`;\n }}\n type=\"submit\"\n variant=\"callAction\"\n fullWidth\n >\n Back to Login\n \n \n }\n promoHeader={\n High-Performance Object Store\n }\n promoInfo={\n \n MinIO is a cloud-native object store built to run on any\n infrastructure - public, private or edge clouds. Primary use cases\n include data lakes, databases, AI/ML, SaaS applications and fast\n backup & recovery. MinIO is dual licensed under GNU AGPL v3 and\n commercial license. To learn more, visit{\" \"}\n \n www.min.io\n \n .\n \n }\n backgroundAnimation={false}\n />\n
\n ) : null;\n};\n\nexport default LoginCallback;\n"],"names":["invoke","method","url","data","headers","targetURL","slice","req","request","k","set","send","then","res","body","catch","err","status","localStorage","getItem","includes","window","location","pathname","setItem","clearSession","href","baseUrl","this","onError","errMessage","get","response","toString","detailedMessage","throwMessage","errorMessage","charAt","toUpperCase","detailedError","statusCode","Promise","reject","units","k8sUnits","niceBytes","x","showK8sUnits","arguments","length","undefined","n","parseInt","niceBytesInt","l","k8sUnitsN","toFixed","deleteCookie","name","document","cookie","storage","removeItem","niceTimeFromSeconds","seconds","days","Math","floor","hours","minutes","remainingSeconds","parts","push","join","niceDaysInt","years","months","diffDays","weeks","getClientOS","getPlatform","navigator","replaceUnicodeChar","inputString","split","safeDecodeURIComponent","value","decodeURIComponent","CallBackContainer","styled","div","_ref","theme","fontStyle","transition","padding","marginTop","overflow","color","fontSize","fontWeight","marginLeft","display","width","height","alignItems","borderBottom","LoginCallback","navigate","useNavigate","error","setError","useState","errorDescription","setErrorDescription","loading","setLoading","useEffect","queryString","search","urlParams","URLSearchParams","code","state","api","targetPath","_jsx","Fragment","children","LoginWrapper","logoProps","applicationName","getLogoApplicationVariant","subVariant","getLogoVar","form","_jsxs","className","WarnIcon","Box","Button","id","onClick","type","variant","fullWidth","promoHeader","style","promoInfo","lineHeight","target","rel","backgroundAnimation"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/2689.2888d029.chunk.js b/web-app/build/static/js/2689.2888d029.chunk.js deleted file mode 100644 index 0ab68fc7a..000000000 --- a/web-app/build/static/js/2689.2888d029.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[2689],{62689:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_});var i=n(65043),l=n(22166),s=n(73216),r=n(89923),c=n(20649),a=n(77938),o=n(99161),d=n(64159),u=n(39947),p=n(21383),h=n(6681),b=n(72237),x=n(70579);const m=(0,b.A)(i.lazy((()=>n.e(9714).then(n.bind(n,79714))))),A=(0,b.A)(i.lazy((()=>n.e(459).then(n.bind(n,10459))))),R=(0,b.A)(i.lazy((()=>n.e(8152).then(n.bind(n,28152))))),_=()=>{const e=(0,p.jL)(),t=(0,s.g)(),n=(0,l.d4)(u.Nx),[b,_]=(0,i.useState)(!0),[j,O]=(0,i.useState)([]),[I,S]=(0,i.useState)(!1),[T,k]=(0,i.useState)(!1),[g,N]=(0,i.useState)(!1),[C,f]=(0,i.useState)(""),[y,P]=(0,i.useState)([]),[E,v]=(0,i.useState)(!1),F=t.bucketName||"",V=(0,a._)(F,[o.OV.S3_GET_REPLICATION_CONFIGURATION,o.OV.S3_GET_ACTIONS]);(0,i.useEffect)((()=>{e((0,d.ph)("bucket_detail_replication"))}),[]),(0,i.useEffect)((()=>{n&&_(!0)}),[n,_]),(0,i.useEffect)((()=>{b&&(V?c.A.invoke("GET",`/api/v1/buckets/${F}/replication`).then((e=>{const t=e.rules?e.rules:[];t.sort(((e,t)=>e.priority-t.priority)),O(t),_(!1)})).catch((t=>{e((0,d.C9)(t)),_(!1)})):_(!1))}),[b,e,F,V]);const w=function(){k(arguments.length>0&&void 0!==arguments[0]&&arguments[0])},U=(0,s.Zp)(),G=[{type:"delete",onClick:e=>{f(e.id),v(!1),S(!0)}},{type:"view",onClick:e=>{f(e.id),U(`/buckets/edit-replication?bucketName=${F}&ruleID=${e.id}`)},disableButtonFunction:!(0,a._)(F,[o.OV.S3_PUT_REPLICATION_CONFIGURATION,o.OV.S3_PUT_ACTIONS],!0)}];return(0,x.jsxs)(i.Fragment,{children:[T&&(0,x.jsx)(A,{closeModalAndRefresh:()=>{w(!1),_(!0)},open:T,bucketName:F,setReplicationRules:j}),I&&(0,x.jsx)(R,{deleteOpen:I,selectedBucket:F,closeDeleteModalAndRefresh:e=>{S(!1),e&&_(!0)},ruleToDelete:C,rulesToDelete:y,remainingRules:j.length,allSelected:j.length>0&&y.length===j.length,deleteSelectedRules:E}),g&&(0,x.jsx)(m,{closeModalAndRefresh:e=>{N(!1),e&&_(!0)},open:g,bucketName:F,ruleID:C}),(0,x.jsx)(r._xt,{separator:!0,sx:{marginBottom:15},actions:(0,x.jsxs)(r.azJ,{style:{display:"flex",gap:10},children:[(0,x.jsx)(a.R,{scopes:[o.OV.S3_PUT_REPLICATION_CONFIGURATION,o.OV.S3_PUT_ACTIONS],resource:F,matchAll:!0,errorProps:{disabled:!0},children:(0,x.jsx)(h.A,{tooltip:"Remove Selected Replication Rules",children:(0,x.jsx)(r.$nd,{id:"remove-bucket-replication-rule",onClick:()=>{f("selectedRules"),v(!0),S(!0)},label:"Remove Selected Rules",icon:(0,x.jsx)(r.ucK,{}),color:"secondary",disabled:0===y.length||0===j.length,variant:"secondary"})})}),(0,x.jsx)(a.R,{scopes:[o.OV.S3_PUT_REPLICATION_CONFIGURATION,o.OV.S3_PUT_ACTIONS],resource:F,matchAll:!0,errorProps:{disabled:!0},children:(0,x.jsx)(h.A,{tooltip:"Add Replication Rule",children:(0,x.jsx)(r.$nd,{id:"add-bucket-replication-rule",onClick:()=>{U(o.zZ.BUCKETS_ADD_REPLICATION+`?bucketName=${F}&nextPriority=${j.length+1}`)},label:"Add Replication Rule",icon:(0,x.jsx)(r.REV,{}),variant:"callAction"})})})]}),children:(0,x.jsx)(r.V7x,{content:(0,x.jsxs)(i.Fragment,{children:["MinIO"," ",(0,x.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/kubernetes/upstream/administration/bucket-replication.html",children:"server-side bucket replication"})," ","is an automatic bucket-level configuration that synchronizes objects between a source and destination bucket."]}),placement:"right",children:"Replication"})}),(0,x.jsxs)(r.xA9,{container:!0,children:[(0,x.jsx)(r.xA9,{item:!0,xs:12,children:(0,x.jsx)(a.R,{scopes:[o.OV.S3_GET_REPLICATION_CONFIGURATION,o.OV.S3_GET_ACTIONS],resource:F,errorProps:{disabled:!0},children:(0,x.jsx)(r.bQt,{itemActions:G,columns:[{label:"Priority",elementKey:"priority",width:55,contentTextAlign:"center"},{label:"Destination",elementKey:"destination",renderFunction:e=>(0,x.jsx)(i.Fragment,{children:e.bucket.replace("arn:aws:s3:::","")})},{label:"Prefix",elementKey:"prefix",width:200},{label:"Tags",elementKey:"tags",renderFunction:e=>(0,x.jsx)(i.Fragment,{children:e&&""!==e.tags?"Yes":"No"}),width:60},{label:"Status",elementKey:"status",width:100}],isLoading:b,records:j,entityName:"Replication Rules",idField:"id",customPaperHeight:"400px",textSelectable:!0,selectedItems:y,onSelect:e=>(e=>{const t=e.target,n=t.value,i=t.checked;let l=[...y];return i?l.push(n):l=l.filter((e=>e!==n)),P(l),l})(e),onSelectAll:()=>{y.length!==j.length?P(j.map((e=>e.id))):P([])}})})}),(0,x.jsxs)(r.xA9,{item:!0,xs:12,children:[(0,x.jsx)("br",{}),(0,x.jsx)(r.lVp,{title:"Replication",iconComponent:(0,x.jsx)(r.brV,{}),help:(0,x.jsxs)(i.Fragment,{children:["MinIO supports server-side and client-side replication of objects between source and destination buckets.",(0,x.jsx)("br",{}),(0,x.jsx)("br",{}),"You can learn more at our"," ",(0,x.jsx)("a",{href:"https://min.io/docs/minio/linux/administration/bucket-replication.html?ref=con",target:"_blank",rel:"noopener",children:"documentation"}),"."]})})]})]})]})}}}]); -//# sourceMappingURL=2689.2888d029.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/2689.2888d029.chunk.js.map b/web-app/build/static/js/2689.2888d029.chunk.js.map deleted file mode 100644 index 7e723923a..000000000 --- a/web-app/build/static/js/2689.2888d029.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"static/js/2689.2888d029.chunk.js","mappings":"mRAoDA,MAAMA,GAAuBC,EAAAA,EAAAA,GAC3BC,EAAAA,MAAW,IAAM,mCAEbC,GAAsBF,EAAAA,EAAAA,GAC1BC,EAAAA,MAAW,IAAM,kCAEbE,GAAwBH,EAAAA,EAAAA,GAC5BC,EAAAA,MAAW,IAAM,mCA+VnB,EA5V+BG,KAC7B,MAAMC,GAAWC,EAAAA,EAAAA,MACXC,GAASC,EAAAA,EAAAA,KAETC,GAAgBC,EAAAA,EAAAA,IAAYC,EAAAA,KAE3BC,EAAoBC,IAAyBC,EAAAA,EAAAA,WAAkB,IAC/DC,EAAkBC,IAAuBF,EAAAA,EAAAA,UAE9C,KACKG,EAAwBC,IAC7BJ,EAAAA,EAAAA,WAAkB,IACbK,EAAoBC,IAAyBN,EAAAA,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AGRC,EAAAA,EAAAA,KAAA,UACAA,EAAAA,EAAAA,KAAA,SAAM,4BACoB,KAC1BA,EAAAA,EAAAA,KAAA,KACE0C,KAAK,iFACLD,OAAO,SACP4C,IAAI,WAAUtF,SACf,kBAEG,iBAOL,C","sources":["screens/Console/Buckets/BucketDetails/BucketReplicationPanel.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { useNavigate, useParams } from \"react-router-dom\";\nimport {\n AddIcon,\n Box,\n BucketsIcon,\n Button,\n DataTable,\n Grid,\n HelpBox,\n SectionTitle,\n TrashIcon,\n HelpTip,\n} from \"mds\";\nimport api from \"../../../../common/api\";\nimport {\n BucketReplication,\n BucketReplicationDestination,\n BucketReplicationRule,\n} from \"../types\";\nimport { ErrorResponseHandler } from \"../../../../common/types\";\nimport {\n hasPermission,\n SecureComponent,\n} from \"../../../../common/SecureComponent\";\nimport {\n IAM_PAGES,\n IAM_SCOPES,\n} from \"../../../../common/SecureComponent/permissions\";\nimport { setErrorSnackMessage, setHelpName } from \"../../../../systemSlice\";\nimport { selBucketDetailsLoading } from \"./bucketDetailsSlice\";\nimport { useAppDispatch } from \"../../../../store\";\nimport TooltipWrapper from \"../../Common/TooltipWrapper/TooltipWrapper\";\nimport withSuspense from \"../../Common/Components/withSuspense\";\n\nconst EditReplicationModal = withSuspense(\n React.lazy(() => import(\"./EditReplicationModal\")),\n);\nconst AddReplicationModal = withSuspense(\n React.lazy(() => import(\"./AddReplicationModal\")),\n);\nconst DeleteReplicationRule = withSuspense(\n React.lazy(() => import(\"./DeleteReplicationRule\")),\n);\n\nconst BucketReplicationPanel = () => {\n const dispatch = useAppDispatch();\n const params = useParams();\n\n const loadingBucket = useSelector(selBucketDetailsLoading);\n\n const [loadingReplication, setLoadingReplication] = useState(true);\n const [replicationRules, setReplicationRules] = useState<\n BucketReplicationRule[]\n >([]);\n const [deleteReplicationModal, setDeleteReplicationModal] =\n useState(false);\n const [openSetReplication, setOpenSetReplication] = useState(false);\n const [editReplicationModal, setEditReplicationModal] =\n useState(false);\n const [selectedRRule, setSelectedRRule] = useState(\"\");\n const [selectedRepRules, setSelectedRepRules] = useState([]);\n const [deleteSelectedRules, setDeleteSelectedRules] =\n useState(false);\n\n const bucketName = params.bucketName || \"\";\n\n const displayReplicationRules = hasPermission(bucketName, [\n IAM_SCOPES.S3_GET_REPLICATION_CONFIGURATION,\n IAM_SCOPES.S3_GET_ACTIONS,\n ]);\n useEffect(() => {\n dispatch(setHelpName(\"bucket_detail_replication\"));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n if (loadingBucket) {\n setLoadingReplication(true);\n }\n }, [loadingBucket, setLoadingReplication]);\n\n useEffect(() => {\n if (loadingReplication) {\n if (displayReplicationRules) {\n api\n .invoke(\"GET\", `/api/v1/buckets/${bucketName}/replication`)\n .then((res: BucketReplication) => {\n const r = res.rules ? res.rules : [];\n\n r.sort((a, b) => a.priority - b.priority);\n\n setReplicationRules(r);\n setLoadingReplication(false);\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(err));\n setLoadingReplication(false);\n });\n } else {\n setLoadingReplication(false);\n }\n }\n }, [loadingReplication, dispatch, bucketName, displayReplicationRules]);\n\n const closeAddReplication = () => {\n setOpenReplicationOpen(false);\n setLoadingReplication(true);\n };\n\n const setOpenReplicationOpen = (open = false) => {\n setOpenSetReplication(open);\n };\n\n const closeReplicationModalDelete = (refresh: boolean) => {\n setDeleteReplicationModal(false);\n\n if (refresh) {\n setLoadingReplication(true);\n }\n };\n\n const closeEditReplication = (refresh: boolean) => {\n setEditReplicationModal(false);\n\n if (refresh) {\n setLoadingReplication(true);\n }\n };\n\n const confirmDeleteReplication = (replication: BucketReplicationRule) => {\n setSelectedRRule(replication.id);\n setDeleteSelectedRules(false);\n setDeleteReplicationModal(true);\n };\n\n const confirmDeleteSelectedReplicationRules = () => {\n setSelectedRRule(\"selectedRules\");\n setDeleteSelectedRules(true);\n setDeleteReplicationModal(true);\n };\n const navigate = useNavigate();\n const editReplicationRule = (replication: BucketReplicationRule) => {\n setSelectedRRule(replication.id);\n navigate(\n `/buckets/edit-replication?bucketName=${bucketName}&ruleID=${replication.id}`,\n );\n };\n\n const ruleDestDisplay = (events: BucketReplicationDestination) => {\n return {events.bucket.replace(\"arn:aws:s3:::\", \"\")};\n };\n\n const tagDisplay = (events: BucketReplicationRule) => {\n return {events && events.tags !== \"\" ? \"Yes\" : \"No\"};\n };\n\n const selectAllItems = () => {\n if (selectedRepRules.length === replicationRules.length) {\n setSelectedRepRules([]);\n return;\n }\n setSelectedRepRules(replicationRules.map((x) => x.id));\n };\n\n const selectRules = (e: React.ChangeEvent) => {\n const targetD = e.target;\n const value = targetD.value;\n const checked = targetD.checked;\n\n let elements: string[] = [...selectedRepRules]; // We clone the selectedSAs array\n if (checked) {\n // If the user has checked this field we need to push this to selectedSAs\n elements.push(value);\n } else {\n // User has unchecked this field, we need to remove it from the list\n elements = elements.filter((element) => element !== value);\n }\n setSelectedRepRules(elements);\n return elements;\n };\n\n const replicationTableActions: any = [\n {\n type: \"delete\",\n onClick: confirmDeleteReplication,\n },\n {\n type: \"view\",\n onClick: editReplicationRule,\n disableButtonFunction: !hasPermission(\n bucketName,\n [\n IAM_SCOPES.S3_PUT_REPLICATION_CONFIGURATION,\n IAM_SCOPES.S3_PUT_ACTIONS,\n ],\n true,\n ),\n },\n ];\n\n return (\n \n {openSetReplication && (\n \n )}\n\n {deleteReplicationModal && (\n 0 &&\n selectedRepRules.length === replicationRules.length\n }\n deleteSelectedRules={deleteSelectedRules}\n />\n )}\n\n {editReplicationModal && (\n \n )}\n \n \n \n {\n confirmDeleteSelectedReplicationRules();\n }}\n label={\"Remove Selected Rules\"}\n icon={}\n color={\"secondary\"}\n disabled={\n selectedRepRules.length === 0 ||\n replicationRules.length === 0\n }\n variant={\"secondary\"}\n />\n \n \n \n \n {\n navigate(\n IAM_PAGES.BUCKETS_ADD_REPLICATION +\n `?bucketName=${bucketName}&nextPriority=${\n replicationRules.length + 1\n }`,\n );\n }}\n label={\"Add Replication Rule\"}\n icon={}\n variant={\"callAction\"}\n />\n \n \n \n }\n >\n \n MinIO{\" \"}\n \n server-side bucket replication\n {\" \"}\n is an automatic bucket-level configuration that synchronizes\n objects between a source and destination bucket.\n \n }\n placement=\"right\"\n >\n Replication\n \n \n \n \n \n selectRules(e)}\n onSelectAll={selectAllItems}\n />\n \n \n \n
\n }\n help={\n \n MinIO supports server-side and client-side replication of\n objects between source and destination buckets.\n
\n
\n You can learn more at our{\" \"}\n \n documentation\n \n .\n
\n }\n />\n
\n
\n \n );\n};\n\nexport default BucketReplicationPanel;\n"],"names":["EditReplicationModal","withSuspense","React","AddReplicationModal","DeleteReplicationRule","BucketReplicationPanel","dispatch","useAppDispatch","params","useParams","loadingBucket","useSelector","selBucketDetailsLoading","loadingReplication","setLoadingReplication","useState","replicationRules","setReplicationRules","deleteReplicationModal","setDeleteReplicationModal","openSetReplication","setOpenSetReplication","editReplicationModal","setEditReplicationModal","selectedRRule","setSelectedRRule","selectedRepRules","setSelectedRepRules","deleteSelectedRules","setDeleteSelectedRules","bucketName","displayReplicationRules","hasPermission","IAM_SCOPES","S3_GET_REPLICATION_CONFIGURATION","S3_GET_ACTIONS","useEffect","setHelpName","api","invoke","then","res","r","rules","sort","a","b","priority","catch","err","setErrorSnackMessage","setOpenReplicationOpen","arguments","length","undefined","navigate","useNavigate","replicationTableActions","type","onClick","replication","id","disableButtonFunction","S3_PUT_REPLICATION_CONFIGURATION","S3_PUT_ACTIONS","_jsxs","Fragment","children","_jsx","closeModalAndRefresh","closeAddReplication","open","deleteOpen","selectedBucket","closeDeleteModalAndRefresh","refresh","ruleToDelete","rulesToDelete","remainingRules","allSelected","ruleID","SectionTitle","separator","sx","marginBottom","actions","Box","style","display","gap","SecureComponent","scopes","resource","matchAll","errorProps","disabled","TooltipWrapper","tooltip","Button","label","icon","TrashIcon","color","variant","IAM_PAGES","BUCKETS_ADD_REPLICATION","AddIcon","HelpTip","content","target","href","placement","Grid","container","item","xs","DataTable","itemActions","columns","elementKey","width","contentTextAlign","renderFunction","events","bucket","replace","tags","isLoading","records","entityName","idField","customPaperHeight","textSelectable","selectedItems","onSelect","e","targetD","value","checked","elements","push","filter","element","selectRules","onSelectAll","selectAllItems","map","x","HelpBox","title","iconComponent","BucketsIcon","help","rel"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/2704.1285a8c1.chunk.js b/web-app/build/static/js/2704.1285a8c1.chunk.js deleted file mode 100644 index d9ed89fd1..000000000 --- a/web-app/build/static/js/2704.1285a8c1.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[2704],{32704:(e,t,a)=>{a.r(t),a.d(t,{default:()=>w});var n=a(65043),s=a(24241),d=a(89923),l=a(22166),o=a(94141),r=a(21383),i=a(6035),c=a(77403),u=a(70579);const w=e=>{let{closeModalAndRefresh:t,open:a,bucketName:w}=e;const b=(0,r.jL)(),h=(0,l.d4)((e=>e.objectBrowser.rewind.rewindEnabled)),x=(0,l.d4)((e=>e.objectBrowser.rewind.dateToRewind)),[j,p]=(0,n.useState)(!1),[S,m]=(0,n.useState)(!0),[k,f]=(0,n.useState)(s.c9.fromJSDate(new Date));(0,n.useEffect)((()=>{h&&(m(!0),f(s.c9.fromISO(x||s.c9.now().toISO()||"")))}),[h,x]);return(0,u.jsx)(o.A,{modalOpen:a,onClose:()=>{t()},title:`Rewind - ${w}`,children:(0,u.jsxs)(d.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,u.jsx)(d.e8j,{value:k,onChange:e=>e?f(e):null,id:"rewind-selector",label:"Rewind to",timeFormat:"24h",secondsSelector:!1,disabled:!S}),h&&(0,u.jsx)(d.dOG,{value:"status",id:"status",name:"status",checked:S,onChange:e=>{m(e.target.checked)},label:"Current Status",indicatorLabels:["Enabled","Disabled"]}),(0,u.jsx)(d.xA9,{item:!0,xs:12,sx:c.Uz.modalButtonBar,children:(0,u.jsx)(d.$nd,{type:"button",variant:"callAction",disabled:j||!k&&S,onClick:()=>{!S&&h?b((0,i.rS)()):(p(!0),b((0,i.v8)({state:!0,bucket:w,dateRewind:k.toISO()}))),b((0,i.Yw)(!0)),t()},id:"rewind-apply-button",label:!S&&h?"Show Current Data":"Show Rewind Data"})}),j&&(0,u.jsx)(d.xA9,{item:!0,xs:12,children:(0,u.jsx)(d.z21,{})})]})})}}}]); -//# sourceMappingURL=2704.1285a8c1.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/2704.1285a8c1.chunk.js.map b/web-app/build/static/js/2704.1285a8c1.chunk.js.map deleted file mode 100644 index a0fff00dd..000000000 --- a/web-app/build/static/js/2704.1285a8c1.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"static/js/2704.1285a8c1.chunk.js","mappings":"uOA0CA,MAwGA,EAxGqBA,IAIC,IAJA,qBACpBC,EAAoB,KACpBC,EAAI,WACJC,GACcH,EACd,MAAMI,GAAWC,EAAAA,EAAAA,MAEXC,GAAgBC,EAAAA,EAAAA,KACnBC,GAAoBA,EAAMC,cAAcC,OAAOJ,gBAE5CK,GAAaJ,EAAAA,EAAAA,KAChBC,GAAoBA,EAAMC,cAAcC,OAAOE,gBAG3CC,EAAgBC,IAAqBC,EAAAA,EAAAA,WAAkB,IACvDC,EAAoBC,IAAyBF,EAAAA,EAAAA,WAA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I,sBACJC,OACG1B,GAAsBV,EACnB,oBACA,uBAKTO,IACCc,EAAAA,EAAAA,KAACyB,EAAAA,IAAI,CAACC,MAAI,EAACC,GAAI,GAAGtB,UAChBL,EAAAA,EAAAA,KAACwC,EAAAA,IAAW,UAIL,C","sources":["screens/Console/Buckets/ListBuckets/Objects/ListObjects/RewindEnable.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState } from \"react\";\nimport { DateTime } from \"luxon\";\nimport {\n Button,\n DateTimeInput,\n FormLayout,\n Grid,\n ProgressBar,\n Switch,\n} from \"mds\";\nimport { useSelector } from \"react-redux\";\nimport ModalWrapper from \"../../../../Common/ModalWrapper/ModalWrapper\";\nimport { AppState, useAppDispatch } from \"../../../../../../store\";\nimport {\n resetRewind,\n setReloadObjectsList,\n setRewindEnable,\n} from \"../../../../ObjectBrowser/objectBrowserSlice\";\nimport { modalStyleUtils } from \"../../../../Common/FormComponents/common/styleLibrary\";\n\ninterface IRewindEnable {\n closeModalAndRefresh: () => void;\n open: boolean;\n bucketName: string;\n}\n\nconst RewindEnable = ({\n closeModalAndRefresh,\n open,\n bucketName,\n}: IRewindEnable) => {\n const dispatch = useAppDispatch();\n\n const rewindEnabled = useSelector(\n (state: AppState) => state.objectBrowser.rewind.rewindEnabled,\n );\n const dateRewind = useSelector(\n (state: AppState) => state.objectBrowser.rewind.dateToRewind,\n );\n\n const [rewindEnabling, setRewindEnabling] = useState(false);\n const [rewindEnableButton, setRewindEnableButton] = useState(true);\n const [dateSelected, setDateSelected] = useState(\n DateTime.fromJSDate(new Date()),\n );\n\n useEffect(() => {\n if (rewindEnabled) {\n setRewindEnableButton(true);\n setDateSelected(\n DateTime.fromISO(dateRewind || DateTime.now().toISO() || \"\"),\n );\n }\n }, [rewindEnabled, dateRewind]);\n\n const rewindApply = () => {\n if (!rewindEnableButton && rewindEnabled) {\n dispatch(resetRewind());\n } else {\n setRewindEnabling(true);\n dispatch(\n setRewindEnable({\n state: true,\n bucket: bucketName,\n dateRewind: dateSelected.toISO(),\n }),\n );\n }\n dispatch(setReloadObjectsList(true));\n\n closeModalAndRefresh();\n };\n\n return (\n {\n closeModalAndRefresh();\n }}\n title={`Rewind - ${bucketName}`}\n >\n \n (dateTime ? setDateSelected(dateTime) : null)}\n id=\"rewind-selector\"\n label=\"Rewind to\"\n timeFormat={\"24h\"}\n secondsSelector={false}\n disabled={!rewindEnableButton}\n />\n\n {rewindEnabled && (\n ) => {\n setRewindEnableButton(e.target.checked);\n }}\n label={\"Current Status\"}\n indicatorLabels={[\"Enabled\", \"Disabled\"]}\n />\n )}\n \n \n \n\n {rewindEnabling && (\n \n \n \n )}\n \n \n );\n};\n\nexport default RewindEnable;\n"],"names":["_ref","closeModalAndRefresh","open","bucketName","dispatch","useAppDispatch","rewindEnabled","useSelector","state","objectBrowser","rewind","dateRewind","dateToRewind","rewindEnabling","setRewindEnabling","useState","rewindEnableButton","setRewindEnableButton","dateSelected","setDateSelected","DateTime","fromJSDate","Date","useEffect","fromISO","now","toISO","_jsx","ModalWrapper","modalOpen","onClose","title","children","_jsxs","FormLayout","withBorders","containerPadding","DateTimeInput","value","onChange","dateTime","id","label","timeFormat","secondsSelector","disabled","Switch","name","checked","e","target","indicatorLabels","Grid","item","xs","sx","modalStyleUtils","modalButtonBar","Button","type","variant","onClick","rewindApply","resetRewind","setRewindEnable","bucket","setReloadObjectsList","ProgressBar"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/3298.bc647bb4.chunk.js b/web-app/build/static/js/3298.bc647bb4.chunk.js deleted file mode 100644 index acba8cdf5..000000000 --- a/web-app/build/static/js/3298.bc647bb4.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[3298],{43298:(e,t,n)=>{n.r(t),n.d(t,{default:()=>N});var s=n(65043),a=n(73216),i=n(89923),l=n(77403),r=n(77938),c=n(99161),o=n(64159),d=n(21383),u=n(22166),h=n(46537),x=n(48793),m=n(56629),g=n(53518),p=n(88617),b=n(69772),j=n(6681),k=n(64681),v=n(29977),C=n(18218),S=n(33097),f=n.n(S),y=n(94574),A=n(35475),_=n(56483),B=n(80882),T=n(70579);const w=y.Ay.div((e=>{let{theme:t}=e;return{border:`${f()(t,"borderColor","#eaeaea")} 1px solid`,borderRadius:3,padding:15,cursor:"pointer","&.disabled":{backgroundColor:f()(t,"signalColors.danger","red")},"&:hover":{backgroundColor:f()(t,"boxBackground","#FBFAFA")},"& .bucketTitle":{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:10,"& h1":{padding:0,margin:0,marginBottom:5,fontSize:22,color:f()(t,"screenTitle.iconColor","#07193E"),[`@media (max-width: ${i.nmC.md}px)`]:{marginBottom:0}}},"& .bucketDetails":{display:"flex",gap:40,"& span":{fontSize:14},[`@media (max-width: ${i.nmC.md}px)`]:{flexFlow:"column-reverse",gap:5}},"& .bucketMetrics":{display:"flex",alignItems:"center",marginTop:20,gap:25,borderTop:`${f()(t,"borderColor","#E2E2E2")} 1px solid`,paddingTop:20,"& svg.bucketIcon":{color:f()(t,"screenTitle.iconColor","#07193E"),fill:f()(t,"screenTitle.iconColor","#07193E")},"& .metric":{"& .min-icon":{color:f()(t,"fontColor","#000"),width:13,marginRight:5}},"& .metricLabel":{fontSize:14,fontWeight:"bold",color:f()(t,"fontColor","#000")},"& .metricText":{fontSize:24,fontWeight:"bold"},"& .unit":{fontSize:12,fontWeight:"normal"},[`@media (max-width: ${i.nmC.md}px)`]:{marginTop:8,paddingTop:8}}}})),E=e=>{var t,n;let{bucket:l,onSelect:o,selected:d,bulkSelect:u}=e;const h=(0,a.Zp)(),[x,m]=(0,s.useState)(!1),g=(0,_.nO)(`${l.size}`||"0"),p=g.split(" ")[0],b=g.split(" ")[1],j=f()(l,"details.quota.quota","0"),k=(0,_.GT)(j,!0,!1),v=(0,r._)(l.name,c.pC[c.ac.BUCKET_ADMIN])&&!1;return(0,T.jsxs)(w,{onClick:()=>{!x&&h(`/buckets/${l.name}/admin`)},id:`manageBucket-${l.name}`,className:"bucket-item "+(v?"disabled":""),children:[(0,T.jsxs)(i.azJ,{className:"bucketTitle",children:[u&&(0,T.jsx)(i.azJ,{onClick:e=>{e.stopPropagation()},children:(0,T.jsx)(i.Sc0,{checked:d,id:`select-${l.name}`,label:"",name:`select-${l.name}`,onChange:e=>{o(e)},value:l.name})}),(0,T.jsxs)("h1",{children:[l.name," ",v]})]}),(0,T.jsxs)(i.azJ,{className:"bucketDetails",children:[(0,T.jsxs)("span",{id:`created-${l.name}`,children:[(0,T.jsx)("strong",{children:"Created:"})," ",l.creation_date?new Date(l.creation_date).toString():"n/a"]}),(0,T.jsxs)("span",{id:`access-${l.name}`,children:[(0,T.jsx)("strong",{children:"Access:"})," ",(e=>{var t,n,s,a,i,l;return null===(t=e.rw_access)||void 0===t||!t.read||null!==(n=e.rw_access)&&void 0!==n&&n.write?null!==(s=e.rw_access)&&void 0!==s&&s.read||null===(a=e.rw_access)||void 0===a||!a.write?null!==(i=e.rw_access)&&void 0!==i&&i.read&&null!==(l=e.rw_access)&&void 0!==l&&l.write?"R/W":"":"W":"R"})(l)]})]}),(0,T.jsxs)(i.azJ,{className:"bucketMetrics",children:[(0,T.jsx)(A.N_,{to:`/buckets/${l.name}/admin`,children:(0,T.jsx)(i.brV,{className:"bucketIcon",style:{height:48,width:48}})}),(0,T.jsxs)(i.xA9,{item:!0,className:"metric",onMouseEnter:()=>{var e;return(null===(e=l.details)||void 0===e?void 0:e.versioning)&&m(!0)},onMouseLeave:()=>{var e;return(null===(e=l.details)||void 0===e?void 0:e.versioning)&&m(!1)},children:[(null===(t=l.details)||void 0===t?void 0:t.versioning)&&(0,T.jsxs)(i.V7x,{content:B.p,placement:"top",children:[(0,T.jsx)(i.wNL,{})," "]}),!(null!==(n=l.details)&&void 0!==n&&n.versioning)&&(0,T.jsx)(i.wNL,{}),(0,T.jsx)("span",{className:"metricLabel",children:"Usage"}),(0,T.jsxs)("div",{className:"metricText",children:[p,(0,T.jsx)("span",{className:"unit",children:b}),"0"!==j&&(0,T.jsxs)(s.Fragment,{children:[" ","/ ",k.total,(0,T.jsx)("span",{className:"unit",children:k.unit})]})]})]}),(0,T.jsxs)(i.xA9,{item:!0,className:"metric",children:[(0,T.jsx)(i.Sxe,{}),(0,T.jsx)("span",{className:"metricLabel",children:"Objects"}),(0,T.jsx)("div",{className:"metricText",children:l.objects?(0,_.Af)(l.objects):0})]})]})]})};var R=n(94141),L=n(23758);const $=e=>{let{open:t,closeModalAndRefresh:n,buckets:a}=e;const l=(0,d.jL)(),[r,c]=(0,s.useState)([]),[u,h]=(0,s.useState)(!1),[x,p]=(0,s.useState)(!1),[b,j]=(0,s.useState)(""),[k,v]=(0,s.useState)(""),[C,S]=(0,s.useState)(""),[y,A]=(0,s.useState)(""),[B,w]=(0,s.useState)(!0),[E,$]=(0,s.useState)("async"),[N,F]=(0,s.useState)("100"),[U,z]=(0,s.useState)("Gi"),[K,M]=(0,s.useState)("60"),[I,O]=(0,s.useState)([]),[V,D]=(0,s.useState)([]),[J,P]=(0,s.useState)([]),W=V.map((e=>({label:e,value:e})));(0,s.useEffect)((()=>{if(0===I.length){const e=[],t=[];a.forEach((n=>{e.push(n),t.push("")})),O(t),c(e)}}),[a,I.length]);const q=e=>{let{errString:t}=e;switch(t){case"":return(0,T.jsx)(i.azJ,{sx:{color:"#42C91A"},children:(0,T.jsx)(i.C1y,{})});case"n/a":return null;default:if(t)return(0,T.jsx)(i.azJ,{sx:{color:"#C72C48"},children:(0,T.jsx)(i.m_M,{tooltip:t,placement:"top",children:(0,T.jsx)(i.cJw,{})})})}return null},Z=(e,t)=>{const n=[...I];n[e]=t,O(n)},G=e=>{let t=[...r],n=[...I];null===e||void 0===e||e.forEach((e=>{const s=f()(e,"errorString","");if(!s||""===s){const s=t.indexOf(e.originBucket||"");t.splice(s,1),n.splice(s,1)}})),c(t),O(n)};return(0,T.jsx)(R.A,{modalOpen:t,onClose:()=>{n(!1)},title:"Set Multiple Bucket Replication",children:(0,T.jsx)(i.sQ4,{loadingStep:u||x,wizardSteps:[{label:"Remote Configuration",componentRender:(0,T.jsx)(s.Fragment,{children:(0,T.jsxs)(i.Hbc,{containerPadding:!1,withBorders:!1,children:[(0,T.jsx)(i.EmB,{label:"Local Buckets to replicate",sx:{maxWidth:"440px",width:"100%"},children:r.join(", ")}),(0,T.jsx)("h4",{children:"Remote Endpoint Configuration"}),(0,T.jsxs)("span",{style:{fontSize:14},children:["Please avoid the use of root credentials for this feature",(0,T.jsx)("br",{}),(0,T.jsx)("br",{})]}),(0,T.jsx)(i.cl_,{id:"accessKey",name:"accessKey",onChange:e=>{j(e.target.value)},label:"Access Key",value:b}),(0,T.jsx)(i.cl_,{id:"secretKey",name:"secretKey",onChange:e=>{v(e.target.value)},label:"Secret Key",value:k}),(0,T.jsx)(i.cl_,{id:"targetURL",name:"targetURL",onChange:e=>{S(e.target.value)},placeholder:"play.min.io:9000",label:"Target URL",value:C}),(0,T.jsx)(i.dOG,{checked:B,id:"useTLS",name:"useTLS",label:"Use TLS",onChange:e=>{w(e.target.checked)},value:"yes"}),(0,T.jsx)(i.cl_,{id:"region",name:"region",onChange:e=>{A(e.target.value)},label:"Region",value:y}),(0,T.jsx)(i.l6P,{id:"replication_mode",name:"replication_mode",onChange:e=>{$(e)},label:"Replication Mode",value:E,options:[{label:"Asynchronous",value:"async"},{label:"Synchronous",value:"sync"}]}),"async"===E&&(0,T.jsx)(i.cl_,{type:"number",id:"bandwidth_scalar",name:"bandwidth_scalar",onChange:e=>{e.target.validity.valid&&F(e.target.value)},label:"Bandwidth",value:N,min:"0",pattern:"[0-9]*",overlayObject:(0,T.jsx)(L.A,{id:"quota_unit",onUnitChange:e=>{z(e)},unitSelected:U,unitsList:(0,_.l9)(["Ki"]),disabled:!1})}),(0,T.jsx)(i.cl_,{id:"healthCheck",name:"healthCheck",onChange:e=>{M(e.target.value)},label:"Health Check Duration",value:K})]})}),buttons:[{type:"custom",label:"Next",enabled:!x,action:e=>{const t={accessKey:b,secretKey:k,targetURL:C,useTLS:B};p(!0),m.F.listExternalBuckets.listExternalBuckets(t).then((t=>{const n=f()(t.data,"buckets",[]);if(n&&n.length>0){const e=n.map((e=>e.name));D(e)}e("++"),p(!1)})).catch((e=>{p(!1),l((0,o.Dy)((0,g.S)(e.error)))}))}}]},{label:"Bucket Assignments",componentRender:(0,T.jsxs)(s.Fragment,{children:[(0,T.jsx)("h3",{children:"Remote Bucket Assignments"}),(0,T.jsx)("span",{style:{fontSize:14},children:"Please select / type the desired remote bucket were you want the local data to be replicated."}),(0,T.jsx)(i.azJ,{sx:{display:"grid",gridTemplateColumns:"auto auto 45px",alignItems:"center",justifyContent:"stretch","& .hide":{opacity:0,transitionDuration:"0.3s"}},children:r.map(((e,t)=>{const n=(e=>{if(J&&J.length>0){const t=J.find((t=>t.originBucket===e));if(t){return f()(t,"errorString","")||""}}return"n/a"})(e);return(0,T.jsxs)(s.Fragment,{children:[(0,T.jsx)("div",{className:""===n?"hide":"",children:e}),(0,T.jsx)("div",{className:""===n?"hide":"",children:(a=t,V.length>0?(0,T.jsx)(s.Fragment,{children:(0,T.jsx)(i.l6P,{label:"",id:`assign-bucket-${a}`,name:`assign-bucket-${a}`,value:I[a],onChange:e=>{Z(a,e)},options:W,disabled:u})}):(0,T.jsx)(s.Fragment,{children:(0,T.jsx)(i.cl_,{id:`assign-bucket-${a}`,name:`assign-bucket-${a}`,label:"",onChange:e=>{Z(a,e.target.value)},value:I[a],disabled:u})}))}),(0,T.jsx)("div",{className:""===n?"hide":"",children:J&&J.length>0&&(0,T.jsx)(q,{errString:n})})]},`buckets-assignation-${t.toString()}-${e}`);var a}))})]}),buttons:[{type:"back",label:"Back",enabled:!0},{type:"next",label:"Create",enabled:!u,action:()=>{h(!0);const e=r.map(((e,t)=>({originBucket:e,destinationBucket:I[t]}))),t=`${B?"https://":"http://"}${C}`,s=parseInt(K),a={accessKey:b,secretKey:k,targetURL:t,region:y,bucketsRelation:e,syncMode:E,bandwidth:"async"===E?parseInt((0,_.q5)(N,U,!0)):0,healthCheckPeriod:s};m.F.bucketsReplication.setMultiBucketReplication(a).then((e=>{h(!1);const t=e.data.replicationState;P(t);const s=null===t||void 0===t?void 0:t.filter((e=>e.errorString&&""!==e.errorString));0===(null===s||void 0===s?void 0:s.length)?n(!0):setTimeout((()=>{G(t)}),500)})).catch((e=>{h(!1),l((0,o.Dy)((0,g.S)(e.error)))}))}}]}],forModal:!0})})},N=()=>{const e=(0,d.jL)(),t=(0,a.Zp)(),[n,S]=(0,s.useState)([]),[f,y]=(0,s.useState)(!0),[A,_]=(0,s.useState)(""),[B,w]=(0,s.useState)([]),[R,L]=(0,s.useState)(!1),[N,F]=(0,s.useState)(!1),U=(0,u.d4)(h.s$),z=!(null===U||void 0===U||!U.includes("object-browser-only"));(0,s.useEffect)((()=>{e((0,o.ph)("ob_bucket_list"))}),[e]),(0,s.useEffect)((()=>{if(f){(()=>{y(!0),m.F.buckets.listBuckets().then((t=>{t.data?(y(!1),S(t.data.buckets||[])):t.error&&(y(!1),e((0,o.C9)((0,g.S)(t.error))))}))})()}}),[f,e]);const K=n.filter((e=>""===A||e.name.indexOf(A)>=0)),M=n.length>0,I=e=>{const t=e.target,n=t.value,s=t.checked;let a=[...B];return s?a.push(n):a=a.filter((e=>e!==n)),w(a),a},O=(0,C.A)("*",[c.OV.S3_CREATE_BUCKET]),V=(0,C.A)("*",[c.OV.S3_LIST_BUCKET,c.OV.S3_ALL_LIST_BUCKET]);return(0,T.jsxs)(s.Fragment,{children:[R&&(0,T.jsx)($,{open:R,buckets:B,closeModalAndRefresh:e=>{L(!1),e&&w([])}}),!z&&(0,T.jsx)(x.A,{label:"Buckets",actions:(0,T.jsx)(p.A,{})}),(0,T.jsxs)(i.Mxu,{children:[(0,T.jsxs)(i.xA9,{item:!0,xs:12,sx:l._0.actionsTray,children:[z&&(0,T.jsx)(i.xA9,{item:!0,xs:!0,children:(0,T.jsx)(b.A,{marginRight:15,marginTop:10})}),M&&(0,T.jsx)(k.A,{onChange:_,placeholder:"Search Buckets",value:A,sx:{minWidth:380,[`@media (max-width: ${i.nmC.md}px)`]:{minWidth:220}}}),(0,T.jsxs)(i.xA9,{item:!0,xs:12,sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:5},children:[!z&&(0,T.jsxs)(s.Fragment,{children:[(0,T.jsx)(j.A,{tooltip:M?N?"Unselect Buckets":"Select Multiple Buckets":"",children:(0,T.jsx)(i.$nd,{id:"multiple-bucket-seection",onClick:()=>{F(!N),w([])},icon:(0,T.jsx)(i.IN,{}),variant:N?"callAction":"regular",disabled:!M})}),N&&(0,T.jsx)(j.A,{tooltip:M?B.length===K.length?"Unselect All Buckets":"Select All Buckets":"",children:(0,T.jsx)(i.$nd,{id:"select-all-buckets",onClick:()=>{if(B.length===K.length)return void w([]);const e=K.map((e=>e.name));w(e)},icon:(0,T.jsx)(i.nhX,{}),variant:"regular"})}),(0,T.jsx)(j.A,{tooltip:M?0===B.length?N?"Please select at least one bucket on which to configure Replication":"Use the Select Multiple Buckets button to choose buckets on which to configure Replication":"Set Replication":"",children:(0,T.jsx)(i.$nd,{id:"set-replication",onClick:()=>{L(!0)},icon:(0,T.jsx)(i.hwo,{}),variant:"regular",disabled:0===B.length})})]}),(0,T.jsx)(j.A,{tooltip:"Refresh",children:(0,T.jsx)(i.$nd,{id:"refresh-buckets",onClick:()=>{y(!0)},icon:(0,T.jsx)(i.fNY,{}),variant:"regular"})}),!z&&(0,T.jsx)(j.A,{tooltip:O?"":(0,c.vj)([c.OV.S3_CREATE_BUCKET],"create a bucket"),children:(0,T.jsx)(i.$nd,{id:"create-bucket",onClick:()=>{t(c.zZ.ADD_BUCKETS)},icon:(0,T.jsx)(i.REV,{}),variant:"callAction",disabled:!O,label:"Create Bucket"})})]})]}),f&&(0,T.jsx)(i.z21,{}),!f&&(0,T.jsxs)(i.xA9,{item:!0,xs:12,sx:{marginTop:25,height:"calc(100vh - 211px)","&.isEmbedded":{height:"calc(100vh - 128px)"}},className:z?"isEmbedded":"",children:[0!==K.length&&(0,T.jsx)(v.A,{rowRenderFunction:e=>{const t=K[e]||null;return t?(0,T.jsx)(E,{bucket:t,onSelect:I,selected:B.includes(t.name),bulkSelect:N}):null},totalItems:K.length}),0===K.length&&""!==A&&(0,T.jsx)(i.xA9,{container:!0,children:(0,T.jsx)(i.xA9,{item:!0,xs:8,children:(0,T.jsx)(i.lVp,{iconComponent:(0,T.jsx)(i.brV,{}),title:"No Results",help:(0,T.jsx)(s.Fragment,{children:"No buckets match the filtering condition"})})})}),!M&&(0,T.jsx)(i.xA9,{container:!0,children:(0,T.jsx)(i.xA9,{item:!0,xs:8,children:(0,T.jsx)(i.lVp,{iconComponent:(0,T.jsx)(i.brV,{}),title:"Buckets",help:(0,T.jsxs)(s.Fragment,{children:["MinIO uses buckets to organize objects. A bucket is similar to a folder or directory in a filesystem, where each bucket can hold an arbitrary number of objects.",(0,T.jsx)("br",{}),V?"":(0,T.jsxs)(s.Fragment,{children:[(0,T.jsx)("br",{}),(0,c.vj)([c.OV.S3_LIST_BUCKET,c.OV.S3_ALL_LIST_BUCKET],"view the buckets on this server"),(0,T.jsx)("br",{})]}),(0,T.jsxs)(r.R,{scopes:[c.OV.S3_CREATE_BUCKET],resource:c.Ms,children:[(0,T.jsx)("br",{}),"To get started,\xa0",(0,T.jsx)(i.t53,{onClick:()=>{t(c.zZ.ADD_BUCKETS)},children:"Create a Bucket."})]})]})})})})]})]})]})}},23758:(e,t,n)=>{n.d(t,{A:()=>d});var s=n(65043),a=n(89923),i=n(94574),l=n(33097),r=n.n(l),c=n(70579);const o=i.Ay.button((e=>{let{theme:t}=e;return{border:`1px solid ${r()(t,"borderColor","#E2E2E2")}`,borderRadius:3,color:r()(t,"secondaryText","#5B5C5C"),backgroundColor:r()(t,"boxBackground","#FBFAFA"),fontSize:12}})),d=e=>{let{id:t,unitSelected:n,unitsList:i,disabled:l=!1,onUnitChange:r}=e;const[d,u]=s.useState(null),h=Boolean(d),x=e=>{u(null),""!==e&&r&&r(e)};return(0,c.jsxs)(s.Fragment,{children:[(0,c.jsx)(o,{id:`${t}-button`,"aria-controls":`${t}-menu`,"aria-haspopup":"true","aria-expanded":h?"true":void 0,onClick:e=>{u(e.currentTarget)},disabled:l,type:"button",children:n}),(0,c.jsx)(a.Vey,{id:"upload-main-menu",options:i,selectedOption:"",onSelect:e=>x(e),hideTriggerAction:()=>{x("")},open:h,anchorEl:d,anchorOrigin:"end"})]})}},94141:(e,t,n)=>{n.d(t,{A:()=>d});var s=n(65043),a=n(22166),i=n(89923),l=n(21383),r=n(64159),c=n(49555),o=n(70579);const d=e=>{let{onClose:t,modalOpen:n,title:d,children:u,wideLimit:h=!0,titleIcon:x=null,iconColor:m="default",sx:g}=e;const p=(0,l.jL)(),[b,j]=(0,s.useState)(!1),k=(0,a.d4)((e=>e.system.modalSnackBar));(0,s.useEffect)((()=>{p((0,r.h0)(""))}),[p]),(0,s.useEffect)((()=>{if(k){if(""===k.message)return void j(!1);"error"!==k.type&&j(!0)}}),[k]);let v="";return k&&(v=k.detailedErrorMsg,(""===v||v&&v.length<5)&&(v=k.message)),(0,o.jsxs)(i.ngX,{onClose:t,open:n,title:d,titleIcon:x,widthLimit:h,sx:g,iconColor:m,children:[(0,o.jsx)(c.A,{isModal:!0}),(0,o.jsx)(i.qb_,{onClose:()=>{j(!1),p((0,r.h0)(""))},open:b,message:v,mode:"inline",variant:"error"===k.type?"error":"default",autoHideDuration:"error"===k.type?10:5,condensed:!0}),u]})}}}]); -//# sourceMappingURL=3298.bc647bb4.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/3298.bc647bb4.chunk.js.map b/web-app/build/static/js/3298.bc647bb4.chunk.js.map deleted file mode 100644 index b4df1b2eb..000000000 --- a/web-app/build/static/js/3298.bc647bb4.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"static/js/3298.bc647bb4.chunk.js","mappings":"gaA0CA,MAAMA,EAAiBC,EAAAA,GAAOC,KAAIC,IAAA,IAAC,MAAEC,GAAOD,EAAA,MAAM,CAChDE,OAAQ,GAAGC,IAAIF,EAAO,cAAe,uBACrCG,aAAc,EACdC,QAAS,GACTC,OAAQ,UACR,aAAc,CACZC,gBAAiBJ,IAAIF,EAAO,sBAAuB,QAErD,UAAW,CACTM,gBAAiBJ,IAAIF,EAAO,gBAAiB,YAE/C,iBAAkB,CAChBO,QAAS,OACTC,WAAY,SACZC,eAAgB,aAChBC,IAAK,GACL,OAAQ,CACNN,QAAS,EACTO,OAAQ,EACRC,aAAc,EACdC,SAAU,GACVC,MAAOZ,IAAIF,EAAO,wBAAyB,WAC3C,CAAC,sBAAsBe,EAAAA,IAAYC,SAAU,CAC3CJ,aAAc,KAIpB,mBAAoB,CAClBL,QAAS,OACTG,IAAK,GACL,SAAU,CACRG,SAAU,IAEZ,CAAC,sBAAsBE,EAAAA,IAAYC,SAAU,CAC3CC,SAAU,iBACVP,IAAK,IAGT,mBAAoB,CAClBH,QAAS,OACTC,WAAY,SACZU,UAAW,GACXR,IAAK,GACLS,UAAW,GAAGjB,IAAIF,EAAO,cAAe,uBACxCoB,WAAY,GACZ,mBAAoB,CAClBN,MAAOZ,IAAIF,EAAO,wBAAyB,WAC3CqB,KAAMnB,IAAIF,EAAO,wBAAyB,YAE5C,YAAa,CACX,cAAe,CACbc,MAAOZ,IAAIF,EAAO,YAAa,QAC/BsB,MAAO,GACPC,YAAa,IAGjB,iBAAkB,CAChBV,SAAU,GACVW,WAAY,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,IACC,CAACC,IAOJ,IAAIK,EAAU,GASd,OAPIL,IACFK,EAAUL,EAAkBM,kBACZ,KAAZD,GAAmBA,GAAWA,EAAQ1M,OAAS,KACjD0M,EAAUL,EAAkBK,WAK9BpS,EAAAA,EAAAA,MAACsS,EAAAA,IAAQ,CACPlL,QAASA,EACTjE,KAAMgE,EACNE,MAAOA,EACPsK,UAAWA,EACXY,WAAYb,EACZzL,GAAIA,EACJ2L,UAAWA,EAAUxR,SAAA,EAErBE,EAAAA,EAAAA,KAACkS,EAAAA,EAAS,CAACC,SAAS,KACpBnS,EAAAA,EAAAA,KAACoS,EAAAA,IAAQ,CACPtL,QA1BgBuL,KACpBb,GAAgB,GAChBxO,GAAS6O,EAAAA,EAAAA,IAAqB,IAAI,EAyB9BhP,KAAM0O,EACNO,QAASA,EACTQ,KAAM,SACNvD,QAAoC,UAA3B0C,EAAkBzJ,KAAmB,QAAU,UACxDuK,iBAA6C,UAA3Bd,EAAkBzJ,KAAmB,GAAK,EAC5DwK,WAAS,IAEV1S,IACQ,C","sources":["screens/Console/Buckets/ListBuckets/BucketListItem.tsx","screens/Console/Buckets/ListBuckets/BulkReplicationModal.tsx","screens/Console/Buckets/ListBuckets/ListBuckets.tsx","screens/Console/Common/FormComponents/InputUnitMenu/InputUnitMenu.tsx","screens/Console/Common/ModalWrapper/ModalWrapper.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\nimport React, { Fragment, useState } from \"react\";\nimport get from \"lodash/get\";\nimport styled from \"styled-components\";\nimport { Link, useNavigate } from \"react-router-dom\";\nimport {\n Box,\n breakPoints,\n BucketsIcon,\n Checkbox,\n Grid,\n HelpTip,\n ReportedUsageIcon,\n TotalObjectsIcon,\n} from \"mds\";\nimport {\n calculateBytes,\n niceBytes,\n prettyNumber,\n} from \"../../../../common/utils\";\nimport {\n IAM_PERMISSIONS,\n IAM_ROLES,\n} from \"../../../../common/SecureComponent/permissions\";\nimport { hasPermission } from \"../../../../common/SecureComponent\";\nimport { Bucket } from \"../../../../api/consoleApi\";\nimport { usageClarifyingContent } from \"screens/Console/Dashboard/BasicDashboard/ReportedUsage\";\n\nconst BucketItemMain = styled.div(({ theme }) => ({\n border: `${get(theme, \"borderColor\", \"#eaeaea\")} 1px solid`,\n borderRadius: 3,\n padding: 15,\n cursor: \"pointer\",\n \"&.disabled\": {\n backgroundColor: get(theme, \"signalColors.danger\", \"red\"),\n },\n \"&:hover\": {\n backgroundColor: get(theme, \"boxBackground\", \"#FBFAFA\"),\n },\n \"& .bucketTitle\": {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n gap: 10,\n \"& h1\": {\n padding: 0,\n margin: 0,\n marginBottom: 5,\n fontSize: 22,\n color: get(theme, \"screenTitle.iconColor\", \"#07193E\"),\n [`@media (max-width: ${breakPoints.md}px)`]: {\n marginBottom: 0,\n },\n },\n },\n \"& .bucketDetails\": {\n display: \"flex\",\n gap: 40,\n \"& span\": {\n fontSize: 14,\n },\n [`@media (max-width: ${breakPoints.md}px)`]: {\n flexFlow: \"column-reverse\",\n gap: 5,\n },\n },\n \"& .bucketMetrics\": {\n display: \"flex\",\n alignItems: \"center\",\n marginTop: 20,\n gap: 25,\n borderTop: `${get(theme, \"borderColor\", \"#E2E2E2\")} 1px solid`,\n paddingTop: 20,\n \"& svg.bucketIcon\": {\n color: get(theme, \"screenTitle.iconColor\", \"#07193E\"),\n fill: get(theme, \"screenTitle.iconColor\", \"#07193E\"),\n },\n \"& .metric\": {\n \"& .min-icon\": {\n color: get(theme, \"fontColor\", \"#000\"),\n width: 13,\n marginRight: 5,\n },\n },\n \"& .metricLabel\": {\n fontSize: 14,\n fontWeight: \"bold\",\n color: get(theme, \"fontColor\", \"#000\"),\n },\n \"& .metricText\": {\n fontSize: 24,\n fontWeight: \"bold\",\n },\n \"& .unit\": {\n fontSize: 12,\n fontWeight: \"normal\",\n },\n [`@media (max-width: ${breakPoints.md}px)`]: {\n marginTop: 8,\n paddingTop: 8,\n },\n },\n}));\n\ninterface IBucketListItem {\n bucket: Bucket;\n onSelect: (e: React.ChangeEvent) => void;\n selected: boolean;\n bulkSelect: boolean;\n}\n\nconst BucketListItem = ({\n bucket,\n onSelect,\n selected,\n bulkSelect,\n}: IBucketListItem) => {\n const navigate = useNavigate();\n\n const [clickOverride, setClickOverride] = useState(false);\n\n const usage = niceBytes(`${bucket.size}` || \"0\");\n const usageScalar = usage.split(\" \")[0];\n const usageUnit = usage.split(\" \")[1];\n\n const quota = get(bucket, \"details.quota.quota\", \"0\");\n const quotaForString = calculateBytes(quota, true, false);\n\n const manageAllowed =\n hasPermission(bucket.name, IAM_PERMISSIONS[IAM_ROLES.BUCKET_ADMIN]) &&\n false;\n\n const accessToStr = (bucket: Bucket): string => {\n if (bucket.rw_access?.read && !bucket.rw_access?.write) {\n return \"R\";\n } else if (!bucket.rw_access?.read && bucket.rw_access?.write) {\n return \"W\";\n } else if (bucket.rw_access?.read && bucket.rw_access?.write) {\n return \"R/W\";\n }\n return \"\";\n };\n const onCheckboxClick = (e: React.ChangeEvent) => {\n onSelect(e);\n };\n\n return (\n {\n !clickOverride && navigate(`/buckets/${bucket.name}/admin`);\n }}\n id={`manageBucket-${bucket.name}`}\n className={`bucket-item ${manageAllowed ? \"disabled\" : \"\"}`}\n >\n \n {bulkSelect && (\n {\n e.stopPropagation();\n }}\n >\n \n \n )}\n

\n {bucket.name} {manageAllowed}\n

\n \n \n \n Created:{\" \"}\n {bucket.creation_date\n ? new Date(bucket.creation_date).toString()\n : \"n/a\"}\n \n \n Access: {accessToStr(bucket)}\n \n \n \n \n \n \n\n \n bucket.details?.versioning && setClickOverride(true)\n }\n onMouseLeave={() =>\n bucket.details?.versioning && setClickOverride(false)\n }\n >\n {bucket.details?.versioning && (\n \n {\" \"}\n \n )}\n {!bucket.details?.versioning && }\n Usage\n
\n {usageScalar}\n {usageUnit}\n {quota !== \"0\" && (\n \n {\" \"}\n / {quotaForString.total}\n {quotaForString.unit}\n \n )}\n
\n \n\n \n \n Objects\n
\n {bucket.objects ? prettyNumber(bucket.objects) : 0}\n
\n
\n
\n \n );\n};\n\nexport default BucketListItem;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport {\n Box,\n CheckCircleIcon,\n FormLayout,\n InputBox,\n ReadBox,\n Select,\n Switch,\n Tooltip,\n WarnIcon,\n Wizard,\n} from \"mds\";\nimport get from \"lodash/get\";\nimport ModalWrapper from \"../../Common/ModalWrapper/ModalWrapper\";\nimport { getBytes, k8sScalarUnitsExcluding } from \"../../../../common/utils\";\nimport InputUnitMenu from \"../../Common/FormComponents/InputUnitMenu/InputUnitMenu\";\nimport { setModalErrorSnackMessage } from \"../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../store\";\nimport { api } from \"api\";\nimport { MultiBucketResponseItem } from \"api/consoleApi\";\nimport { errorToHandler } from \"api/errors\";\nimport { SelectorTypes } from \"../../../../common/types\";\n\ninterface IBulkReplicationModal {\n open: boolean;\n closeModalAndRefresh: (clearSelection: boolean) => any;\n buckets: string[];\n}\n\nconst AddBulkReplicationModal = ({\n open,\n closeModalAndRefresh,\n buckets,\n}: IBulkReplicationModal) => {\n const dispatch = useAppDispatch();\n const [bucketsToAlter, setBucketsToAlter] = useState([]);\n const [addLoading, setAddLoading] = useState(false);\n const [externalLoading, setExternalLoading] = useState(false);\n const [accessKey, setAccessKey] = useState(\"\");\n const [secretKey, setSecretKey] = useState(\"\");\n const [targetURL, setTargetURL] = useState(\"\");\n const [region, setRegion] = useState(\"\");\n const [useTLS, setUseTLS] = useState(true);\n const [replicationMode, setReplicationMode] = useState<\"async\" | \"sync\">(\n \"async\",\n );\n const [bandwidthScalar, setBandwidthScalar] = useState(\"100\");\n const [bandwidthUnit, setBandwidthUnit] = useState(\"Gi\");\n const [healthCheck, setHealthCheck] = useState(\"60\");\n const [relationBuckets, setRelationBuckets] = useState([]);\n const [remoteBucketsOpts, setRemoteBucketOpts] = useState([]);\n const [responseItem, setResponseItem] = useState<\n MultiBucketResponseItem[] | undefined\n >([]);\n\n const optionsForBucketsDrop: SelectorTypes[] = remoteBucketsOpts.map(\n (remoteBucketName: string) => {\n return {\n label: remoteBucketName,\n value: remoteBucketName,\n };\n },\n );\n\n useEffect(() => {\n if (relationBuckets.length === 0) {\n const bucketsAlter: string[] = [];\n const relationBucketsAlter: string[] = [];\n\n buckets.forEach((item: string) => {\n bucketsAlter.push(item);\n relationBucketsAlter.push(\"\");\n });\n\n setRelationBuckets(relationBucketsAlter);\n setBucketsToAlter(bucketsAlter);\n }\n }, [buckets, relationBuckets.length]);\n\n const addRecord = () => {\n setAddLoading(true);\n const replicate = bucketsToAlter.map((bucketName, index) => {\n return {\n originBucket: bucketName,\n destinationBucket: relationBuckets[index],\n };\n });\n\n const endURL = `${useTLS ? \"https://\" : \"http://\"}${targetURL}`;\n const hc = parseInt(healthCheck);\n\n const remoteBucketsInfo = {\n accessKey: accessKey,\n secretKey: secretKey,\n targetURL: endURL,\n region: region,\n bucketsRelation: replicate,\n syncMode: replicationMode,\n bandwidth:\n replicationMode === \"async\"\n ? parseInt(getBytes(bandwidthScalar, bandwidthUnit, true))\n : 0,\n healthCheckPeriod: hc,\n };\n\n api.bucketsReplication\n .setMultiBucketReplication(remoteBucketsInfo)\n .then((response) => {\n setAddLoading(false);\n\n const states = response.data.replicationState;\n setResponseItem(states);\n\n const filterErrors = states?.filter(\n (itm) => itm.errorString && itm.errorString !== \"\",\n );\n\n if (filterErrors?.length === 0) {\n closeModalAndRefresh(true);\n } else {\n setTimeout(() => {\n removeSuccessItems(states);\n }, 500);\n }\n })\n .catch((err) => {\n setAddLoading(false);\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n });\n };\n\n const retrieveRemoteBuckets = (\n wizardPageJump: (page: number | string) => void,\n ) => {\n const remoteConnectInfo = {\n accessKey: accessKey,\n secretKey: secretKey,\n targetURL: targetURL,\n useTLS,\n };\n setExternalLoading(true);\n\n api.listExternalBuckets\n .listExternalBuckets(remoteConnectInfo)\n .then((res) => {\n const buckets = get(res.data, \"buckets\", []);\n\n if (buckets && buckets.length > 0) {\n const arrayReplaceBuckets = buckets.map((element: any) => {\n return element.name;\n });\n\n setRemoteBucketOpts(arrayReplaceBuckets);\n }\n\n wizardPageJump(\"++\");\n setExternalLoading(false);\n })\n .catch((err) => {\n setExternalLoading(false);\n dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));\n });\n };\n\n const stateOfItem = (initialBucket: string) => {\n if (responseItem && responseItem.length > 0) {\n const bucketResponse = responseItem.find(\n (item) => item.originBucket === initialBucket,\n );\n\n if (bucketResponse) {\n const errString = get(bucketResponse, \"errorString\", \"\");\n\n if (errString) {\n return errString;\n }\n\n return \"\";\n }\n }\n return \"n/a\";\n };\n\n const LogoToShow = ({ errString }: { errString: string }) => {\n switch (errString) {\n case \"\":\n return (\n \n \n \n );\n case \"n/a\":\n return null;\n default:\n if (errString) {\n return (\n \n \n \n \n \n );\n }\n }\n return null;\n };\n\n const updateItem = (indexItem: number, value: string) => {\n const updatedList = [...relationBuckets];\n updatedList[indexItem] = value;\n setRelationBuckets(updatedList);\n };\n\n const itemDisplayBulk = (indexItem: number) => {\n if (remoteBucketsOpts.length > 0) {\n return (\n \n {\n updateItem(indexItem, value);\n }}\n options={optionsForBucketsDrop}\n disabled={addLoading}\n />\n \n );\n }\n return (\n \n ) => {\n updateItem(indexItem, event.target.value);\n }}\n value={relationBuckets[indexItem]}\n disabled={addLoading}\n />\n \n );\n };\n\n const removeSuccessItems = (\n responseItem: MultiBucketResponseItem[] | undefined,\n ) => {\n let newBucketsToAlter = [...bucketsToAlter];\n let newRelationBuckets = [...relationBuckets];\n\n responseItem?.forEach((successElement) => {\n const errorString = get(successElement, \"errorString\", \"\");\n\n if (!errorString || errorString === \"\") {\n const indexToRemove = newBucketsToAlter.indexOf(\n successElement.originBucket || \"\",\n );\n\n newBucketsToAlter.splice(indexToRemove, 1);\n newRelationBuckets.splice(indexToRemove, 1);\n }\n });\n\n setBucketsToAlter(newBucketsToAlter);\n setRelationBuckets(newRelationBuckets);\n };\n\n return (\n {\n closeModalAndRefresh(false);\n }}\n title=\"Set Multiple Bucket Replication\"\n >\n \n \n \n {bucketsToAlter.join(\", \")}\n \n

Remote Endpoint Configuration

\n \n Please avoid the use of root credentials for this feature\n
\n
\n
\n ) => {\n setAccessKey(e.target.value);\n }}\n label=\"Access Key\"\n value={accessKey}\n />\n ) => {\n setSecretKey(e.target.value);\n }}\n label=\"Secret Key\"\n value={secretKey}\n />\n ) => {\n setTargetURL(e.target.value);\n }}\n placeholder=\"play.min.io:9000\"\n label=\"Target URL\"\n value={targetURL}\n />\n {\n setUseTLS(e.target.checked);\n }}\n value=\"yes\"\n />\n ) => {\n setRegion(e.target.value);\n }}\n label=\"Region\"\n value={region}\n />\n {\n setReplicationMode(value as \"sync\" | \"async\");\n }}\n label=\"Replication Mode\"\n value={replicationMode}\n options={[\n { label: \"Asynchronous\", value: \"async\" },\n { label: \"Synchronous\", value: \"sync\" },\n ]}\n />\n {replicationMode === \"async\" && (\n ) => {\n if (e.target.validity.valid) {\n setBandwidthScalar(e.target.value as string);\n }\n }}\n label=\"Bandwidth\"\n value={bandwidthScalar}\n min=\"0\"\n pattern={\"[0-9]*\"}\n overlayObject={\n {\n setBandwidthUnit(newValue);\n }}\n unitSelected={bandwidthUnit}\n unitsList={k8sScalarUnitsExcluding([\"Ki\"])}\n disabled={false}\n />\n }\n />\n )}\n ) => {\n setHealthCheck(e.target.value as string);\n }}\n label=\"Health Check Duration\"\n value={healthCheck}\n />\n
\n \n ),\n buttons: [\n {\n type: \"custom\",\n label: \"Next\",\n enabled: !externalLoading,\n action: retrieveRemoteBuckets,\n },\n ],\n },\n {\n label: \"Bucket Assignments\",\n componentRender: (\n \n

Remote Bucket Assignments

\n \n Please select / type the desired remote bucket were you want\n the local data to be replicated.\n \n \n {bucketsToAlter.map((bucketName: string, index: number) => {\n const errorItem = stateOfItem(bucketName);\n return (\n \n
\n {bucketName}\n
\n
\n {itemDisplayBulk(index)}\n
\n
\n {responseItem && responseItem.length > 0 && (\n \n )}\n
\n
\n );\n })}\n \n \n ),\n buttons: [\n {\n type: \"back\",\n label: \"Back\",\n enabled: true,\n },\n {\n type: \"next\",\n label: \"Create\",\n enabled: !addLoading,\n action: addRecord,\n },\n ],\n },\n ]}\n forModal\n />\n \n );\n};\n\nexport default AddBulkReplicationModal;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport {\n AddIcon,\n BucketsIcon,\n Button,\n HelpBox,\n MultipleBucketsIcon,\n PageLayout,\n RefreshIcon,\n SelectAllIcon,\n SelectMultipleIcon,\n Grid,\n breakPoints,\n ProgressBar,\n ActionLink,\n} from \"mds\";\n\nimport { actionsTray } from \"../../Common/FormComponents/common/styleLibrary\";\nimport { SecureComponent } from \"../../../../common/SecureComponent\";\nimport {\n CONSOLE_UI_RESOURCE,\n IAM_PAGES,\n IAM_SCOPES,\n permissionTooltipHelper,\n} from \"../../../../common/SecureComponent/permissions\";\nimport { setErrorSnackMessage, setHelpName } from \"../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../store\";\nimport { useSelector } from \"react-redux\";\nimport { selFeatures } from \"../../consoleSlice\";\nimport PageHeaderWrapper from \"../../Common/PageHeaderWrapper/PageHeaderWrapper\";\nimport { api } from \"../../../../api\";\nimport { Bucket } from \"../../../../api/consoleApi\";\nimport { errorToHandler } from \"../../../../api/errors\";\nimport HelpMenu from \"../../HelpMenu\";\nimport AutoColorIcon from \"../../Common/Components/AutoColorIcon\";\nimport TooltipWrapper from \"../../Common/TooltipWrapper/TooltipWrapper\";\nimport SearchBox from \"../../Common/SearchBox\";\nimport VirtualizedList from \"../../Common/VirtualizedList/VirtualizedList\";\nimport hasPermission from \"../../../../common/SecureComponent/accessControl\";\nimport BucketListItem from \"./BucketListItem\";\nimport BulkReplicationModal from \"./BulkReplicationModal\";\n\nconst ListBuckets = () => {\n const dispatch = useAppDispatch();\n const navigate = useNavigate();\n\n const [records, setRecords] = useState([]);\n const [loading, setLoading] = useState(true);\n const [filterBuckets, setFilterBuckets] = useState(\"\");\n const [selectedBuckets, setSelectedBuckets] = useState([]);\n const [replicationModalOpen, setReplicationModalOpen] =\n useState(false);\n const [bulkSelect, setBulkSelect] = useState(false);\n\n const features = useSelector(selFeatures);\n const obOnly = !!features?.includes(\"object-browser-only\");\n\n useEffect(() => {\n dispatch(setHelpName(\"ob_bucket_list\"));\n }, [dispatch]);\n\n useEffect(() => {\n if (loading) {\n const fetchRecords = () => {\n setLoading(true);\n api.buckets.listBuckets().then((res) => {\n if (res.data) {\n setLoading(false);\n setRecords(res.data.buckets || []);\n } else if (res.error) {\n setLoading(false);\n dispatch(setErrorSnackMessage(errorToHandler(res.error)));\n }\n });\n };\n fetchRecords();\n }\n }, [loading, dispatch]);\n\n const filteredRecords = records.filter((b: Bucket) => {\n if (filterBuckets === \"\") {\n return true;\n } else {\n return b.name.indexOf(filterBuckets) >= 0;\n }\n });\n\n const hasBuckets = records.length > 0;\n\n const selectListBuckets = (e: React.ChangeEvent) => {\n const targetD = e.target;\n const value = targetD.value;\n const checked = targetD.checked;\n\n let elements: string[] = [...selectedBuckets]; // We clone the selectedBuckets array\n\n if (checked) {\n // If the user has checked this field we need to push this to selectedBucketsList\n elements.push(value);\n } else {\n // User has unchecked this field, we need to remove it from the list\n elements = elements.filter((element) => element !== value);\n }\n setSelectedBuckets(elements);\n\n return elements;\n };\n\n const closeBulkReplicationModal = (unselectAll: boolean) => {\n setReplicationModalOpen(false);\n\n if (unselectAll) {\n setSelectedBuckets([]);\n }\n };\n\n const renderItemLine = (index: number) => {\n const bucket = filteredRecords[index] || null;\n if (bucket) {\n return (\n \n );\n }\n return null;\n };\n\n const selectAllBuckets = () => {\n if (selectedBuckets.length === filteredRecords.length) {\n setSelectedBuckets([]);\n return;\n }\n\n const selectAllBuckets = filteredRecords.map((bucket) => {\n return bucket.name;\n });\n\n setSelectedBuckets(selectAllBuckets);\n };\n\n const canCreateBucket = hasPermission(\"*\", [IAM_SCOPES.S3_CREATE_BUCKET]);\n const canListBuckets = hasPermission(\"*\", [\n IAM_SCOPES.S3_LIST_BUCKET,\n IAM_SCOPES.S3_ALL_LIST_BUCKET,\n ]);\n\n return (\n \n {replicationModalOpen && (\n \n )}\n {!obOnly && (\n } />\n )}\n\n \n \n {obOnly && (\n \n \n \n )}\n {hasBuckets && (\n \n )}\n\n \n {!obOnly && (\n \n \n {\n setBulkSelect(!bulkSelect);\n setSelectedBuckets([]);\n }}\n icon={}\n variant={bulkSelect ? \"callAction\" : \"regular\"}\n disabled={!hasBuckets}\n />\n \n\n {bulkSelect && (\n \n }\n variant={\"regular\"}\n />\n \n )}\n\n \n {\n setReplicationModalOpen(true);\n }}\n icon={}\n variant={\"regular\"}\n disabled={selectedBuckets.length === 0}\n />\n \n \n )}\n\n \n {\n setLoading(true);\n }}\n icon={}\n variant={\"regular\"}\n />\n \n\n {!obOnly && (\n \n {\n navigate(IAM_PAGES.ADD_BUCKETS);\n }}\n icon={}\n variant={\"callAction\"}\n disabled={!canCreateBucket}\n label={\"Create Bucket\"}\n />\n \n )}\n \n \n\n {loading && }\n {!loading && (\n \n {filteredRecords.length !== 0 && (\n \n )}\n {filteredRecords.length === 0 && filterBuckets !== \"\" && (\n \n \n }\n title={\"No Results\"}\n help={\n \n No buckets match the filtering condition\n \n }\n />\n \n \n )}\n {!hasBuckets && (\n \n \n }\n title={\"Buckets\"}\n help={\n \n MinIO uses buckets to organize objects. A bucket is\n similar to a folder or directory in a filesystem, where\n each bucket can hold an arbitrary number of objects.\n
\n {canListBuckets ? (\n \"\"\n ) : (\n \n
\n {permissionTooltipHelper(\n [\n IAM_SCOPES.S3_LIST_BUCKET,\n IAM_SCOPES.S3_ALL_LIST_BUCKET,\n ],\n \"view the buckets on this server\",\n )}\n
\n
\n )}\n \n
\n To get started, \n {\n navigate(IAM_PAGES.ADD_BUCKETS);\n }}\n >\n Create a Bucket.\n \n \n
\n }\n />\n
\n
\n )}\n \n )}\n
\n
\n );\n};\n\nexport default ListBuckets;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport { DropdownSelector, SelectorType } from \"mds\";\nimport styled from \"styled-components\";\nimport get from \"lodash/get\";\n\ninterface IInputUnitBox {\n id: string;\n unitSelected: string;\n unitsList: SelectorType[];\n disabled?: boolean;\n onUnitChange?: (newValue: string) => void;\n}\n\nconst UnitMenuButton = styled.button(({ theme }) => ({\n border: `1px solid ${get(theme, \"borderColor\", \"#E2E2E2\")}`,\n borderRadius: 3,\n color: get(theme, \"secondaryText\", \"#5B5C5C\"),\n backgroundColor: get(theme, \"boxBackground\", \"#FBFAFA\"),\n fontSize: 12,\n}));\n\nconst InputUnitMenu = ({\n id,\n unitSelected,\n unitsList,\n disabled = false,\n onUnitChange,\n}: IInputUnitBox) => {\n const [anchorEl, setAnchorEl] = React.useState(null);\n const open = Boolean(anchorEl);\n const handleClick = (event: React.MouseEvent) => {\n setAnchorEl(event.currentTarget);\n };\n const handleClose = (newUnit: string) => {\n setAnchorEl(null);\n if (newUnit !== \"\" && onUnitChange) {\n onUnitChange(newUnit);\n }\n };\n\n return (\n \n \n {unitSelected}\n \n handleClose(value)}\n hideTriggerAction={() => {\n handleClose(\"\");\n }}\n open={open}\n anchorEl={anchorEl}\n anchorOrigin={\"end\"}\n />\n \n );\n};\n\nexport default InputUnitMenu;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { ModalBox, Snackbar } from \"mds\";\nimport { CSSObject } from \"styled-components\";\nimport { AppState, useAppDispatch } from \"../../../../store\";\nimport { setModalSnackMessage } from \"../../../../systemSlice\";\nimport MainError from \"../MainError/MainError\";\n\ninterface IModalProps {\n onClose: () => void;\n modalOpen: boolean;\n title: string | React.ReactNode;\n children: any;\n wideLimit?: boolean;\n titleIcon?: React.ReactNode;\n iconColor?: \"default\" | \"delete\" | \"accept\";\n sx?: CSSObject;\n}\n\nconst ModalWrapper = ({\n onClose,\n modalOpen,\n title,\n children,\n wideLimit = true,\n titleIcon = null,\n iconColor = \"default\",\n sx,\n}: IModalProps) => {\n const dispatch = useAppDispatch();\n const [openSnackbar, setOpenSnackbar] = useState(false);\n\n const modalSnackMessage = useSelector(\n (state: AppState) => state.system.modalSnackBar,\n );\n\n useEffect(() => {\n dispatch(setModalSnackMessage(\"\"));\n }, [dispatch]);\n\n useEffect(() => {\n if (modalSnackMessage) {\n if (modalSnackMessage.message === \"\") {\n setOpenSnackbar(false);\n return;\n }\n // Open SnackBar\n if (modalSnackMessage.type !== \"error\") {\n setOpenSnackbar(true);\n }\n }\n }, [modalSnackMessage]);\n\n const closeSnackBar = () => {\n setOpenSnackbar(false);\n dispatch(setModalSnackMessage(\"\"));\n };\n\n let message = \"\";\n\n if (modalSnackMessage) {\n message = modalSnackMessage.detailedErrorMsg;\n if (message === \"\" || (message && message.length < 5)) {\n message = modalSnackMessage.message;\n }\n }\n\n return (\n \n \n \n {children}\n \n );\n};\n\nexport default ModalWrapper;\n"],"names":["BucketItemMain","styled","div","_ref","theme","border","get","borderRadius","padding","cursor","backgroundColor","display","alignItems","justifyContent","gap","margin","marginBottom","fontSize","color","breakPoints","md","flexFlow","marginTop","borderTop","paddingTop","fill","width","marginRight","fontWeight","_ref2","_bucket$details3","_bucket$details4","bucket","onSelect","selected","bulkSelect","navigate","useNavigate","clickOverride","setClickOverride","useState","usage","niceBytes","size","usageScalar","split","usageUnit","quota","quotaForString","calculateBytes","manageAllowed","hasPermission","name","IAM_PERMISSIONS","IAM_ROLES","BUCKET_ADMIN","_jsxs","onClick","id","className","children","Box","_jsx","e","stopPropagation","Checkbox","checked","label","onChange","value","creation_date","Date","toString","_bucket$rw_access","_bucket$rw_access2","_bucket$rw_access3","_bucket$rw_access4","_bucket$rw_access5","_bucket$rw_access6","rw_access","read","write","accessToStr","Link","to","BucketsIcon","style","height","Grid","item","onMouseEnter","_bucket$details","details","versioning","onMouseLeave","_bucket$details2","HelpTip","content","usageClarifyingContent","placement","ReportedUsageIcon","Fragment","total","unit","TotalObjectsIcon","objects","prettyNumber","open","closeModalAndRefresh","buckets","dispatch","useAppDispatch","bucketsToAlter","setBucketsToAlter","addLoading","setAddLoading","externalLoading","setExternalLoading","accessKey","setAccessKey","secretKey","setSecretKey","targetURL","setTargetURL","region","setRegion","useTLS","setUseTLS","replicationMode","setReplicationMode","bandwidthScalar","setBandwidthScalar","bandwidthUnit","setBandwidthUnit","healthCheck","setHealthCheck","relationBuckets","setRelationBuckets","remoteBucketsOpts","setRemoteBucketOpts","responseItem","setResponseItem","optionsForBucketsDrop","map","remoteBucketName","useEffect","length","bucketsAlter","relationBucketsAlter","forEach","push","LogoToShow","errString","sx","CheckCircleIcon","Tooltip","tooltip","WarnIcon","updateItem","indexItem","updatedList","removeSuccessItems","newBucketsToAlter","newRelationBuckets","successElement","errorString","indexToRemove","indexOf","originBucket","splice","ModalWrapper","modalOpen","onClose","title","Wizard","loadingStep","wizardSteps","componentRender","FormLayout","containerPadding","withBorders","ReadBox","maxWidth","join","InputBox","target","placeholder","Switch","Select","options","type","validity","valid","min","pattern","overlayObject","InputUnitMenu","onUnitChange","newValue","unitSelected","unitsList","k8sScalarUnitsExcluding","disabled","buttons","enabled","action","wizardPageJump","remoteConnectInfo","api","listExternalBuckets","then","res","data","arrayReplaceBuckets","element","catch","err","setModalErrorSnackMessage","errorToHandler","error","gridTemplateColumns","opacity","transitionDuration","bucketName","index","errorItem","initialBucket","bucketResponse","find","stateOfItem","event","addRecord","replicate","destinationBucket","endURL","hc","parseInt","remoteBucketsInfo","bucketsRelation","syncMode","bandwidth","getBytes","healthCheckPeriod","bucketsReplication","setMultiBucketReplication","response","states","replicationState","filterErrors","filter","itm","setTimeout","forModal","ListBuckets","records","setRecords","loading","setLoading","filterBuckets","setFilterBuckets","selectedBuckets","setSelectedBuckets","replicationModalOpen","setReplicationModalOpen","setBulkSelect","features","useSelector","selFeatures","obOnly","includes","setHelpName","fetchRecords","listBuckets","setErrorSnackMessage","filteredRecords","b","hasBuckets","selectListBuckets","targetD","elements","canCreateBucket","IAM_SCOPES","S3_CREATE_BUCKET","canListBuckets","S3_LIST_BUCKET","S3_ALL_LIST_BUCKET","BulkReplicationModal","unselectAll","PageHeaderWrapper","actions","HelpMenu","PageLayout","xs","actionsTray","AutoColorIcon","SearchBox","minWidth","TooltipWrapper","Button","icon","SelectMultipleIcon","variant","selectAllBuckets","SelectAllIcon","MultipleBucketsIcon","RefreshIcon","permissionTooltipHelper","IAM_PAGES","ADD_BUCKETS","AddIcon","ProgressBar","VirtualizedList","rowRenderFunction","BucketListItem","totalItems","container","HelpBox","iconComponent","help","SecureComponent","scopes","resource","CONSOLE_UI_RESOURCE","ActionLink","UnitMenuButton","button","anchorEl","setAnchorEl","React","Boolean","handleClose","newUnit","undefined","currentTarget","DropdownSelector","selectedOption","hideTriggerAction","anchorOrigin","wideLimit","titleIcon","iconColor","openSnackbar","setOpenSnackbar","modalSnackMessage","state","system","modalSnackBar","setModalSnackMessage","message","detailedErrorMsg","ModalBox","widthLimit","MainError","isModal","Snackbar","closeSnackBar","mode","autoHideDuration","condensed"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/3323.8de9a2da.chunk.js b/web-app/build/static/js/3323.8de9a2da.chunk.js deleted file mode 100644 index 46521bb34..000000000 --- a/web-app/build/static/js/3323.8de9a2da.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[3323],{43323:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var l=a(65043),s=a(89923),n=a(70579);const r=e=>{let{onChange:t}=e;const[a,r]=(0,l.useState)(!1),[u,o]=(0,l.useState)(""),[c,d]=(0,l.useState)(""),[i,m]=(0,l.useState)(""),[g,h]=(0,l.useState)(""),[p,b]=(0,l.useState)(""),[v,x]=(0,l.useState)(""),[j,f]=(0,l.useState)(""),[S,k]=(0,l.useState)("namespace"),[C,_]=(0,l.useState)(""),[w,E]=(0,l.useState)(""),[y,B]=(0,l.useState)(""),q=(0,l.useCallback)((()=>`${p}:${v}@tcp(${c}:${g})/${i}`),[p,v,c,g,i]);(0,l.useEffect)((()=>{if(""!==u){t([{key:"dsn_string",value:u},{key:"table",value:j},{key:"format",value:S},{key:"queue_dir",value:C},{key:"queue_limit",value:w},{key:"comment",value:y}])}}),[u,j,S,C,w,y,t]),(0,l.useEffect)((()=>{const e=q();o(e)}),[p,i,v,g,c,o,q]);return(0,n.jsxs)(s.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,n.jsx)(s.dOG,{label:"Enter DNS String",checked:a,id:"checkedB",name:"checkedB",onChange:e=>{if(e.target.checked){const e=q();o(e)}else{const e=(e=>{let t=new Map;const a=/(.*?):(.*?)@tcp\((.*?):(.*?)\)\/(.*?)$/gm;let l;for(;null!==(l=a.exec(e));)l.index===a.lastIndex&&a.lastIndex++,t.set("user",l[1]),t.set("password",l[2]),t.set("host",l[3]),t.set("port",l[4]),t.set("dbname",l[5]);return t})(u);d(e.get("host")?e.get("host")+"":""),h(e.get("port")?e.get("port")+"":""),m(e.get("dbname")?e.get("dbname")+"":""),b(e.get("user")?e.get("user")+"":""),x(e.get("password")?e.get("password")+"":"")}r(e.target.checked)},value:"dnsString"}),a?(0,n.jsx)(l.Fragment,{children:(0,n.jsx)(s.azJ,{className:"inputItem",children:(0,n.jsx)(s.cl_,{id:"dsn-string",name:"dsn_string",label:"DSN String",value:u,onChange:e=>{o(e.target.value)}})})}):(0,n.jsxs)(l.Fragment,{children:[(0,n.jsx)(s.azJ,{children:(0,n.jsxs)(s.azJ,{withBorders:!0,useBackground:!0,sx:{overflowY:"auto",height:170,marginBottom:12},children:[(0,n.jsx)(s.cl_,{id:"host",name:"host",label:"",placeholder:"Enter Host",value:c,onChange:e=>{d(e.target.value)}}),(0,n.jsx)(s.cl_,{id:"db-name",name:"db-name",label:"",placeholder:"Enter DB Name",value:i,onChange:e=>{m(e.target.value)}}),(0,n.jsx)(s.cl_,{id:"port",name:"port",label:"",placeholder:"Enter Port",value:g,onChange:e=>{h(e.target.value)}}),(0,n.jsx)(s.cl_,{id:"user",name:"user",label:"",placeholder:"Enter User",value:p,onChange:e=>{b(e.target.value)}}),(0,n.jsx)(s.cl_,{id:"password",name:"password",label:"",placeholder:"Enter Password",type:"password",value:v,onChange:e=>{x(e.target.value)}})]})}),(0,n.jsx)(s.xA9,{item:!0,xs:12,sx:{margin:"12px 0"},children:(0,n.jsx)(s.EmB,{label:"Connection String",multiLine:!0,children:u})})]}),(0,n.jsx)(s.cl_,{id:"table",name:"table",label:"Table",placeholder:"Enter Table Name",value:j,tooltip:"DB table name to store/update events, table is auto-created",onChange:e=>{f(e.target.value)}}),(0,n.jsx)(s.z6M,{currentValue:S,id:"format",name:"format",label:"Format",onChange:e=>{k(e.target.value)},tooltip:"'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'namespace'",selectorOptions:[{label:"Namespace",value:"namespace"},{label:"Access",value:"access"}]}),(0,n.jsx)(s.cl_,{id:"queue-dir",name:"queue_dir",label:"Queue Dir",placeholder:"Enter Queue Dir",value:C,tooltip:"Staging directory for undelivered messages e.g. '/home/events'",onChange:e=>{_(e.target.value)}}),(0,n.jsx)(s.cl_,{id:"queue-limit",name:"queue_limit",label:"Queue Limit",placeholder:"Enter Queue Limit",type:"number",value:w,tooltip:"Maximum limit for undelivered messages, defaults to '10000'",onChange:e=>{E(e.target.value)}}),(0,n.jsx)(s.hFj,{id:"comment",name:"comment",label:"Comment",placeholder:"Enter custom notes if any",value:y,onChange:e=>{B(e.target.value)}})]})}}}]); -//# sourceMappingURL=3323.8de9a2da.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/3323.8de9a2da.chunk.js.map b/web-app/build/static/js/3323.8de9a2da.chunk.js.map deleted file mode 100644 index 920532f96..000000000 --- a/web-app/build/static/js/3323.8de9a2da.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"static/js/3323.8de9a2da.chunk.js","mappings":"sKAiCA,MA6PA,EA7PkBA,IAAoC,IAAnC,SAAEC,GAA2BD,EAE9C,MAAOE,EAAcC,IAAmBC,EAAAA,EAAAA,WAAkB,IACnDC,EAAWC,IAAgBF,EAAAA,EAAAA,UAAiB,KAC5CG,EAAMC,IAAeJ,EAAAA,EAAAA,UAAiB,KACtCK,EAAQC,IAAaN,EAAAA,EAAAA,UAAiB,KACtCO,EAAMC,IAAWR,EAAAA,EAAAA,UAAiB,KAClCS,EAAMC,IAAWV,EAAAA,EAAAA,UAAiB,KAClCW,EAAUC,IAAeZ,EAAAA,EAAAA,UAAiB,KAE1Ca,EAAOC,IAAYd,EAAAA,EAAAA,UAAiB,KACpCe,EAAQC,IAAahB,EAAAA,EAAAA,UAAiB,cACtCiB,EAAUC,IAAelB,EAAAA,EAAAA,UAAiB,KAC1CmB,EAAYC,IAAiBpB,EAAAA,EAAAA,UAAiB,KAC9CqB,EAASC,IAActB,EAAAA,EAAAA,UAAiB,IAiCzCuB,GAAoBC,EAAAA,EAAAA,cAAY,IAC7B,GAAGf,KAAQE,SAAgBR,KAAQI,MAASF,KAClD,CAACI,EAAME,EAAUR,EAAMI,EAAMF,KAEhCoB,EAAAA,EAAAA,YAAU,KACR,GAAkB,KAAdxB,EAAkB,CAUpBJ,EATmB,CACjB,CAAE6B,IAAK,aAAcC,MAAO1B,GAC5B,CAAEyB,IAAK,QAASC,MAAOd,GACvB,CAAEa,IAAK,SAAUC,MAAOZ,GACxB,CA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tC,GAAG,UACHC,KAAK,UACLH,MAAM,UACN4B,YAAY,4BACZrC,MAAON,EACPxB,SAAW6D,IACTpC,EAAWoC,EAAEjB,OAAOd,MAAM,MAGnB,C","sources":["screens/Console/EventDestinations/CustomForms/ConfMySql.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport { IElementValue } from \"../../Configurations/types\";\nimport {\n Box,\n CommentBox,\n FormLayout,\n Grid,\n InputBox,\n RadioGroup,\n ReadBox,\n Switch,\n} from \"mds\";\n\ninterface IConfMySqlProps {\n onChange: (newValue: IElementValue[]) => void;\n}\n\nconst ConfMySql = ({ onChange }: IConfMySqlProps) => {\n //Local States\n const [useDsnString, setUseDsnString] = useState(false);\n const [dsnString, setDsnString] = useState(\"\");\n const [host, setHostname] = useState(\"\");\n const [dbName, setDbName] = useState(\"\");\n const [port, setPort] = useState(\"\");\n const [user, setUser] = useState(\"\");\n const [password, setPassword] = useState(\"\");\n\n const [table, setTable] = useState(\"\");\n const [format, setFormat] = useState(\"namespace\");\n const [queueDir, setQueueDir] = useState(\"\");\n const [queueLimit, setQueueLimit] = useState(\"\");\n const [comment, setComment] = useState(\"\");\n\n // dsn_string* (string) MySQL data-source-name connection string e.g. \":@tcp(:)/\"\n // table* (string) DB table name to store/update events, table is auto-created\n // format* (namespace*|access) 'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'namespace'\n // queue_dir (path) staging dir for undelivered messages e.g. '/home/events'\n // queue_limit (number) maximum limit for undelivered messages, defaults to '100000'\n // comment (sentence) optionally add a comment to this setting\n\n const parseDsnString = (\n input: string,\n keys: string[],\n ): Map => {\n let kvFields: Map = new Map();\n const regex = /(.*?):(.*?)@tcp\\((.*?):(.*?)\\)\\/(.*?)$/gm;\n let m;\n\n while ((m = regex.exec(input)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n kvFields.set(\"user\", m[1]);\n kvFields.set(\"password\", m[2]);\n kvFields.set(\"host\", m[3]);\n kvFields.set(\"port\", m[4]);\n kvFields.set(\"dbname\", m[5]);\n }\n\n return kvFields;\n };\n\n const configToDsnString = useCallback((): string => {\n return `${user}:${password}@tcp(${host}:${port})/${dbName}`;\n }, [user, password, host, port, dbName]);\n\n useEffect(() => {\n if (dsnString !== \"\") {\n const formValues = [\n { key: \"dsn_string\", value: dsnString },\n { key: \"table\", value: table },\n { key: \"format\", value: format },\n { key: \"queue_dir\", value: queueDir },\n { key: \"queue_limit\", value: queueLimit },\n { key: \"comment\", value: comment },\n ];\n\n onChange(formValues);\n }\n }, [dsnString, table, format, queueDir, queueLimit, comment, onChange]);\n\n useEffect(() => {\n const cs = configToDsnString();\n setDsnString(cs);\n }, [user, dbName, password, port, host, setDsnString, configToDsnString]);\n\n const switcherChangeEvt = (event: React.ChangeEvent) => {\n if (event.target.checked) {\n // build dsn_string\n const cs = configToDsnString();\n setDsnString(cs);\n } else {\n // parse dsn_string\n const kv = parseDsnString(dsnString, [\n \"host\",\n \"port\",\n \"dbname\",\n \"user\",\n \"password\",\n ]);\n setHostname(kv.get(\"host\") ? kv.get(\"host\") + \"\" : \"\");\n setPort(kv.get(\"port\") ? kv.get(\"port\") + \"\" : \"\");\n setDbName(kv.get(\"dbname\") ? kv.get(\"dbname\") + \"\" : \"\");\n setUser(kv.get(\"user\") ? kv.get(\"user\") + \"\" : \"\");\n setPassword(kv.get(\"password\") ? kv.get(\"password\") + \"\" : \"\");\n }\n\n setUseDsnString(event.target.checked);\n };\n\n return (\n \n \n {useDsnString ? (\n \n \n ) => {\n setDsnString(e.target.value);\n }}\n />\n \n \n ) : (\n \n \n \n ) => {\n setHostname(e.target.value);\n }}\n />\n ) => {\n setDbName(e.target.value);\n }}\n />\n ) => {\n setPort(e.target.value);\n }}\n />\n ) => {\n setUser(e.target.value);\n }}\n />\n ) => {\n setPassword(e.target.value);\n }}\n />\n \n \n \n \n {dsnString}\n \n \n \n )}\n ) => {\n setTable(e.target.value);\n }}\n />\n {\n setFormat(e.target.value);\n }}\n tooltip=\"'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'namespace'\"\n selectorOptions={[\n { label: \"Namespace\", value: \"namespace\" },\n { label: \"Access\", value: \"access\" },\n ]}\n />\n ) => {\n setQueueDir(e.target.value);\n }}\n />\n ) => {\n setQueueLimit(e.target.value);\n }}\n />\n {\n setComment(e.target.value);\n }}\n />\n \n );\n};\n\nexport default ConfMySql;\n"],"names":["_ref","onChange","useDsnString","setUseDsnString","useState","dsnString","setDsnString","host","setHostname","dbName","setDbName","port","setPort","user","setUser","password","setPassword","table","setTable","format","setFormat","queueDir","setQueueDir","queueLimit","setQueueLimit","comment","setComment","configToDsnString","useCallback","useEffect","key","value","cs","_jsxs","FormLayout","withBorders","containerPadding","children","_jsx","Switch","label","checked","id","name","event","target","kv","parseDsnString","input","kvFields","Map","regex","m","exec","index","lastIndex","set","get","React","Box","className","InputBox","e","useBackground","sx","overflowY","height","marginBottom","placeholder","type","Grid","item","xs","margin","ReadBox","multiLine","tooltip","RadioGroup","currentValue","selectorOptions","CommentBox"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/3329.df273360.chunk.js b/web-app/build/static/js/3329.df273360.chunk.js deleted file mode 100644 index a4d91476c..000000000 --- a/web-app/build/static/js/3329.df273360.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[3329],{53329:(e,n,t)=>{t.r(n),t.d(n,{default:()=>y});var a=t(65043),s=t(89923),r=t(73216),l=t(99161),c=t(21383),i=t(77403),o=t(38375),x=t(56629),d=t(64159),p=t(53518),j=t(70579);const h=()=>{const e=(0,c.jL)(),n=(0,r.Zp)(),[t,h]=(0,a.useState)(""),[m,u]=(0,a.useState)(!1),y=""!==t.trim()&&-1===t.indexOf(" ");return(0,j.jsx)(s.Mxu,{children:(0,j.jsx)(s.Hbc,{title:"Create Key",icon:(0,j.jsx)(s.No_,{}),helpBox:(0,j.jsx)(o.A,{helpText:"Encryption Key",contents:["Create a new cryptographic key in the Key Management Service server connected to MINIO."]}),children:(0,j.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:a=>{a.preventDefault(),u(!0),x.F.kms.kmsCreateKey({key:t}).then((e=>{n(`${l.zZ.KMS_KEYS}`)})).catch((async n=>{const t=await n.json();e((0,d.C9)((0,p.S)(t)))})).finally((()=>u(!1)))},children:(0,j.jsxs)(s.xA9,{container:!0,children:[(0,j.jsx)(s.xA9,{item:!0,xs:12,children:(0,j.jsx)(s.cl_,{id:"key-name",name:"key-name",label:"Key Name",autoFocus:!0,value:t,error:(e=>-1!==e.indexOf(" ")?"Key name cannot contain spaces":"")(t),onChange:e=>{h(e.target.value)}})}),(0,j.jsxs)(s.xA9,{item:!0,xs:12,sx:i.Uz.modalButtonBar,children:[(0,j.jsx)(s.$nd,{id:"clear",type:"button",variant:"regular",onClick:()=>{h("")},label:"Clear"}),(0,j.jsx)(s.$nd,{id:"save-key",type:"submit",variant:"callAction",color:"primary",disabled:m||!y,label:"Save"})]})]})})})})};var m=t(48793),u=t(88617);const y=()=>{const e=(0,c.jL)(),n=(0,r.Zp)();return(0,a.useEffect)((()=>{e((0,d.ph)("add_key"))}),[]),(0,j.jsx)(a.Fragment,{children:(0,j.jsxs)(s.xA9,{item:!0,xs:12,children:[(0,j.jsx)(m.A,{label:(0,j.jsx)(s.EGL,{label:"Keys",onClick:()=>n(l.zZ.KMS_KEYS)}),actions:(0,j.jsx)(u.A,{})}),(0,j.jsx)(h,{})]})})}},38375:(e,n,t)=>{t.d(n,{A:()=>l});var a=t(65043),s=t(89923),r=t(70579);const l=e=>{let{helpText:n,contents:t}=e;return(0,r.jsx)(s.lVp,{iconComponent:(0,r.jsx)(s.nag,{}),title:n,help:(0,r.jsx)(a.Fragment,{children:t.map((e=>(0,r.jsx)(s.azJ,{sx:{paddingBottom:"20px"},children:e})))})})}}}]); -//# sourceMappingURL=3329.df273360.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/3329.df273360.chunk.js.map b/web-app/build/static/js/3329.df273360.chunk.js.map deleted file mode 100644 index b2c63d95b..000000000 --- a/web-app/build/static/js/3329.df273360.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"static/js/3329.df273360.chunk.js","mappings":"8PAmCA,MA8FA,EA9FmBA,KACjB,MAAMC,GAAWC,EAAAA,EAAAA,MACXC,GAAWC,EAAAA,EAAAA,OAEVC,EAASC,IAAcC,EAAAA,EAAAA,UAAiB,KACxCC,EAAeC,IAAoBF,EAAAA,EAAAA,WAAkB,GA2BtDG,EAA+B,KAAnBL,EAAQM,SAA2C,IAA1BN,EAAQO,QAAQ,KAE3D,OACEC,EAAAA,EAAAA,KAACC,EAAAA,IAAU,CAAAC,UACTF,EAAAA,EAAAA,KAACG,EAAAA,IAAU,CACTC,MAAO,aACPC,MAAML,EAAAA,EAAAA,KAACM,EAAAA,IAAiB,IACxBC,SACEP,EAAAA,EAAAA,KAACQ,EAAAA,EAAU,CACTC,SAAU,iBACVC,SAAU,CACR,6FAGLR,UAEDF,EAAAA,EAAAA,KAAA,QACEW,YAAU,EACVC,aAAa,MACbC,SAAWC,IACCA,EA5CZC,iBACNnB,GAAiB,GACjBoB,EAAAA,EAAIC,IACDC,aAAa,CAAEC,IAAK3B,IACpB4B,MAAMC,IACL/B,EAAS,GAAGgC,EAAAA,GAAUC,WAAW,IAElCC,OAAMC,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,EAAAA,EAAiB,CAChBrB,OACExC,EAAAA,EAAAA,KAAC8D,EAAAA,IAAQ,CACPtB,MAAO,OACPa,QAASA,IAAM/D,EAASgC,EAAAA,GAAUC,YAGtCwC,SAAS/D,EAAAA,EAAAA,KAACgE,EAAAA,EAAQ,OAEpBhE,EAAAA,EAAAA,KAACb,EAAU,QAEJ,C,wECzBf,MAgBA,EAhBmB8E,IAA+C,IAA9C,SAAExD,EAAQ,SAAEC,GAA4BuD,EAC1D,OACEjE,EAAAA,EAAAA,KAACkE,EAAAA,IAAO,CACNC,eAAenE,EAAAA,EAAAA,KAACoE,EAAAA,IAAc,IAC9BhE,MAAOK,EACP4D,MACErE,EAAAA,EAAAA,KAAC4D,EAAAA,SAAQ,CAAA1D,SACNQ,EAAS4D,KAAKC,IACbvE,EAAAA,EAAAA,KAACwE,EAAAA,IAAG,CAACzB,GAAI,CAAE0B,cAAe,QAASvE,SAAEqE,SAI3C,C","sources":["screens/Console/KMS/AddKeyForm.tsx","screens/Console/KMS/AddKey.tsx","screens/Console/KMS/KMSHelpbox.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useState } from \"react\";\nimport {\n AddAccessRuleIcon,\n Button,\n FormLayout,\n PageLayout,\n Grid,\n InputBox,\n} from \"mds\";\nimport { modalStyleUtils } from \"../Common/FormComponents/common/styleLibrary\";\nimport KMSHelpBox from \"./KMSHelpbox\";\nimport { api } from \"api\";\nimport { useAppDispatch } from \"store\";\nimport { useNavigate } from \"react-router-dom\";\nimport { ApiError, HttpResponse } from \"api/consoleApi\";\nimport { setErrorSnackMessage } from \"systemSlice\";\nimport { errorToHandler } from \"api/errors\";\nimport { IAM_PAGES } from \"common/SecureComponent/permissions\";\n\nconst AddKeyForm = () => {\n const dispatch = useAppDispatch();\n const navigate = useNavigate();\n\n const [keyName, setKeyName] = useState(\"\");\n const [loadingCreate, setLoadingCreate] = useState(false);\n\n const addRecord = (event: React.FormEvent) => {\n event.preventDefault();\n setLoadingCreate(true);\n api.kms\n .kmsCreateKey({ key: keyName })\n .then((_) => {\n navigate(`${IAM_PAGES.KMS_KEYS}`);\n })\n .catch(async (res: HttpResponse) => {\n const err = (await res.json()) as ApiError;\n dispatch(setErrorSnackMessage(errorToHandler(err)));\n })\n .finally(() => setLoadingCreate(false));\n };\n\n const resetForm = () => {\n setKeyName(\"\");\n };\n\n const validateKeyName = (keyName: string) => {\n if (keyName.indexOf(\" \") !== -1) {\n return \"Key name cannot contain spaces\";\n } else return \"\";\n };\n\n const validSave = keyName.trim() !== \"\" && keyName.indexOf(\" \") === -1;\n\n return (\n \n }\n helpBox={\n \n }\n >\n ) => {\n addRecord(e);\n }}\n >\n \n \n ) => {\n setKeyName(e.target.value);\n }}\n />\n \n \n \n\n \n \n \n \n \n \n );\n};\n\nexport default AddKeyForm;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect } from \"react\";\nimport { BackLink, Grid } from \"mds\";\nimport { useNavigate } from \"react-router-dom\";\nimport { IAM_PAGES } from \"../../../common/SecureComponent/permissions\";\nimport { useAppDispatch } from \"../../../store\";\nimport AddKeyForm from \"./AddKeyForm\";\nimport PageHeaderWrapper from \"../Common/PageHeaderWrapper/PageHeaderWrapper\";\nimport HelpMenu from \"../HelpMenu\";\nimport { setHelpName } from \"systemSlice\";\n\nconst AddKey = () => {\n const dispatch = useAppDispatch();\n const navigate = useNavigate();\n\n useEffect(() => {\n dispatch(setHelpName(\"add_key\"));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n \n \n navigate(IAM_PAGES.KMS_KEYS)}\n />\n }\n actions={}\n />\n \n \n \n );\n};\n\nexport default AddKey;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2023 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport { HelpBox, HelpIconFilled, Box } from \"mds\";\n\ninterface IKMSHelpBoxProps {\n helpText: string;\n contents: string[];\n}\n\nconst KMSHelpBox = ({ helpText, contents }: IKMSHelpBoxProps) => {\n return (\n }\n title={helpText}\n help={\n \n {contents.map((content) => (\n {content}\n ))}\n \n }\n />\n );\n};\n\nexport default KMSHelpBox;\n"],"names":["AddKeyForm","dispatch","useAppDispatch","navigate","useNavigate","keyName","setKeyName","useState","loadingCreate","setLoadingCreate","validSave","trim","indexOf","_jsx","PageLayout","children","FormLayout","title","icon","AddAccessRuleIcon","helpBox","KMSHelpBox","helpText","contents","noValidate","autoComplete","onSubmit","e","preventDefault","api","kms","kmsCreateKey","key","then","_","IAM_PAGES","KMS_KEYS","catch","async","err","res","json","setErrorSnackMessage","errorToHandler","finally","_jsxs","Grid","container","item","xs","InputBox","id","name","label","autoFocus","value","error","validateKeyName","onChange","target","sx","modalStyleUtils","modalButtonBar","Button","type","variant","onClick","resetForm","color","disabled","AddKey","useEffect","setHelpName","Fragment","PageHeaderWrapper","BackLink","actions","HelpMenu","_ref","HelpBox","iconComponent","HelpIconFilled","help","map","content","Box","paddingBottom"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/3527.0fc04358.chunk.js b/web-app/build/static/js/3527.0fc04358.chunk.js deleted file mode 100644 index 4007141b3..000000000 --- a/web-app/build/static/js/3527.0fc04358.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[3527,8823],{18823:(e,s,t)=>{t.r(s),t.d(s,{default:()=>u});var n=t(65043),a=t(58661),r=t(89923),i=t(64159),o=t(21383),c=t(56629),l=t(53518),d=t(70579);const u=e=>{let{closeDeleteModalAndRefresh:s,deleteOpen:t,selectedServiceAccount:u}=e;const x=(0,o.jL)(),[h,p]=(0,n.useState)(!1);if(!u)return null;return(0,d.jsx)(a.A,{title:"Delete Access Key",confirmText:"Delete",isOpen:t,titleIcon:(0,d.jsx)(r.xWY,{}),isLoading:h,onConfirm:()=>{p(!0),c.F.serviceAccounts.deleteServiceAccount(u).then((e=>{s(!0)})).catch((async e=>{const t=await e.json();x((0,i.C9)((0,l.S)(t))),s(!1)})).finally((()=>p(!1)))},onClose:()=>s(!1),confirmationContent:(0,d.jsxs)(n.Fragment,{children:["Are you sure you want to delete Access Key"," ",(0,d.jsx)("b",{style:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},children:u}),"?"]})})}},78619:(e,s,t)=>{t.d(s,{A:()=>A});var n=t(65043),a=t(33097),r=t.n(a),i=t(94574),o=t(89923),c=t(94141),l=t(61476),d=t.n(l),u=t(64159),x=t(21383),h=t(70579);const p=e=>{let{label:s="",value:t=""}=e;const n=(0,x.jL)();return(0,h.jsxs)(o.azJ,{sx:{marginTop:12},children:[(0,h.jsx)(o.l1Y,{children:s}),(0,h.jsx)(o.EmB,{actionButton:(0,h.jsx)(d(),{text:t,children:(0,h.jsx)(o.$nd,{id:"copy-path",variant:"regular",onClick:()=>{n((0,u.h0)(`${s} copied to clipboard`))},style:{marginRight:"5px",width:"28px",height:"28px",padding:"0px"},icon:(0,h.jsx)(o.TdU,{})})}),children:t})]})};var m=t(6681),j=t(77403);const y=i.Ay.div((e=>{let{theme:s}=e;return{color:r()(s,"signalColors.danger","#C51B3F"),fontSize:".85rem",margin:".5rem 0 .5rem 0",display:"flex",alignItems:"center","& svg ":{marginRight:".3rem",height:16,width:16}}})),g=(e,s)=>{let t=document.createElement("a");t.setAttribute("href","data:text/plain;charset=utf-8,"+s),t.setAttribute("download",e),t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)},A=e=>{let{newServiceAccount:s,open:t,closeModal:a,entity:i}=e;if(!s)return null;const l=r()(s,"console",null),d=r()(s,"idp",!1);return(0,h.jsx)(c.A,{modalOpen:t,onClose:()=>{a()},title:`New ${i} Created`,titleIcon:(0,h.jsx)(o.kQt,{}),children:(0,h.jsxs)(o.xA9,{container:!0,children:[(0,h.jsxs)(o.xA9,{item:!0,xs:12,children:["A new ",i," has been created with the following details:",!d&&l&&(0,h.jsx)(n.Fragment,{children:(0,h.jsxs)(o.xA9,{item:!0,xs:12,sx:{overflowY:"auto",maxHeight:350},children:[(0,h.jsx)(o.azJ,{sx:{padding:".8rem 0 0 0",fontWeight:600,fontSize:".9rem"},children:"Console Credentials"}),Array.isArray(l)&&l.map(((e,s)=>(0,h.jsxs)(n.Fragment,{children:[(0,h.jsx)(p,{label:"Access Key",value:e.accessKey}),(0,h.jsx)(p,{label:"Secret Key",value:e.secretKey})]}))),!Array.isArray(l)&&(0,h.jsxs)(n.Fragment,{children:[(0,h.jsx)(p,{label:"Access Key",value:l.accessKey}),(0,h.jsx)(p,{label:"Secret Key",value:l.secretKey})]})]})}),(null===l||void 0===l)&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(p,{label:"Access Key",value:s.accessKey||""}),(0,h.jsx)(p,{label:"Secret Key",value:s.secretKey||""})]}),d?(0,h.jsx)(y,{children:"Please Login via the configured external identity provider."}):(0,h.jsxs)(y,{children:[(0,h.jsx)(o.cJw,{}),(0,h.jsx)("span",{children:"Write these down, as this is the only time the secret will be displayed."})]})]}),(0,h.jsx)(o.xA9,{item:!0,xs:12,sx:{...j.Uz.modalButtonBar},children:!d&&(0,h.jsxs)(n.Fragment,{children:[(0,h.jsx)(m.A,{tooltip:"Download credentials in a JSON file formatted for import using mc alias import. This will only include the default login credentials.",children:(0,h.jsx)(o.$nd,{id:"download-button",label:"Download for import",onClick:()=>{let e={};if(l)if(Array.isArray(l)){e=l.map((e=>({url:e.url,accessKey:e.accessKey,secretKey:e.secretKey,api:"s3v4",path:"auto"})))[0]}else e={url:l.url,accessKey:l.accessKey,secretKey:l.secretKey,api:"s3v4",path:"auto"};else e={url:s.url,accessKey:s.accessKey,secretKey:s.secretKey,api:"s3v4",path:"auto"};g("credentials.json",JSON.stringify({...e}))},icon:(0,h.jsx)(o.s3U,{}),variant:"callAction"})}),Array.isArray(l)&&l.length>1&&(0,h.jsx)(m.A,{tooltip:"Download all access credentials to a JSON file. NOTE: This file is not formatted for import using mc alias import. If you plan to import this alias from the file, please use the Download for Import button. ",children:(0,h.jsx)(o.$nd,{id:"download-all-button",label:"Download all access credentials",onClick:()=>{let e={};if(l&&Array.isArray(l)&&l.length>1){e=l.map((e=>({accessKey:e.accessKey,secretKey:e.secretKey})))}g("all_credentials.json",JSON.stringify({...e}))},icon:(0,h.jsx)(o.s3U,{}),variant:"callAction",color:"primary"})})]})})]})})}},11441:(e,s,t)=>{t.d(s,{A:()=>i});t(65043);var n=t(94574),a=t(70579);const r=n.Ay.h1((()=>({padding:0,margin:0,fontSize:".9rem"}))),i=e=>{let{children:s}=e;return(0,a.jsx)(r,{children:s})}},42967:(e,s,t)=>{t.d(s,{A:()=>h});var n=t(65043),a=t(89923),r=t(8185),i=t(64681),o=t(64159),c=t(21383),l=t(62560),d=t(22166),u=t(56629),x=t(70579);const h=e=>{let{noTitle:s=!1}=e;const t=(0,c.jL)(),[h,p]=(0,n.useState)([]),[m,j]=(0,n.useState)(!1),[y,g]=(0,n.useState)(""),A=(0,d.d4)((e=>e.createUser.selectedPolicies)),b=(0,n.useCallback)((()=>{j(!0),u.F.policies.listPolicies().then((e=>{var s;const t=null!==(s=e.data.policies)&&void 0!==s?s:[];j(!1),p(t.sort(r.Hw))})).catch((e=>{j(!1),t((0,o.Dy)(e))}))}),[t]);(0,n.useEffect)((()=>{j(!0)}),[]),(0,n.useEffect)((()=>{m&&b()}),[m,b]);const f=h.filter((e=>e.name.includes(y)));return(0,x.jsxs)(a.xA9,{item:!0,xs:12,className:"inputItem",children:[m&&(0,x.jsx)(a.z21,{}),h.length>0?(0,x.jsxs)(n.Fragment,{children:[(0,x.jsx)(a.xA9,{item:!0,xs:12,className:"inputItem",children:(0,x.jsx)(i.A,{placeholder:"Start typing to search for a Policy",onChange:e=>{g(e)},value:y,label:s?"":"Assign Policies"})}),(0,x.jsx)(a.bQt,{columns:[{label:"Policy",elementKey:"name"}],onSelect:e=>{const s=e.target,n=s.value,a=s.checked;let r=[...A];a?r.push(n):r=r.filter((e=>e!==n)),r=r.filter((e=>""!==e)),t((0,l.Gy)(r))},selectedItems:A,isLoading:m,records:f,entityName:"Policies",idField:"name",customPaperHeight:"200px"})]}):(0,x.jsx)(a.azJ,{sx:{textAlign:"center",padding:"10px 0"},children:"No Policies Available"})]})}},56071:(e,s,t)=>{t.r(s),t.d(s,{default:()=>h});var n=t(65043),a=t(73216),r=t(64159),i=t(89923),o=t(99161),c=t(58661),l=t(21383),d=t(56629),u=t(53518),x=t(70579);const h=e=>{let{closeDeleteModalAndRefresh:s,deleteOpen:t,selectedUsers:h}=e;const p=(0,a.Zp)(),m=(0,l.jL)(),j=()=>s(!1),[y,g]=(0,n.useState)(!0),[A,b]=(0,n.useState)(!1),[f,S]=(0,n.useState)([]),[v,C]=(0,n.useState)(!1),_=localStorage.getItem("userLoggedIn")||"";if((0,n.useEffect)((()=>{h&&d.F.users.checkUserServiceAccounts(h).then((e=>{var s;e.data&&(S(null!==(s=e.data.userServiceAccountList)&&void 0!==s?s:[]),e.data.hasSA&&b(!0))})).catch((e=>m((0,r.C9)((0,u.S)(e.error))))).finally((()=>g(!1)))}),[h,m]),!h)return null;const E=h.map((e=>(0,x.jsx)("div",{children:(0,x.jsx)("b",{children:e})},e))),U=[{type:"view",onClick:e=>{p(`${o.zZ.USERS}/${encodeURIComponent(e.userName)}`),j()}}],w="Are you sure you want to delete the following "+h.length+" user"+(h.length>1?"s?":"?");return(0,x.jsx)(c.A,{title:"Delete User"+(h.length>1?"s":""),confirmText:"Delete",isOpen:t,titleIcon:(0,x.jsx)(i.xWY,{}),isLoading:v,onConfirm:()=>{for(let e of h)e===_?(m((0,r.C9)({errorMessage:"Cannot delete currently logged in user",detailedError:`Cannot delete currently logged in user ${_}`})),s(!0)):d.F.user.removeUser(e).then((e=>{s(!0),p(`${o.zZ.USERS}`)})).finally((()=>C(!1)))},onClose:j,confirmationContent:y?(0,x.jsx)(i.aHM,{}):(0,x.jsx)(n.Fragment,{children:A?(0,x.jsxs)(n.Fragment,{children:[(0,x.jsx)(i.Wei,{variant:"warning",message:(0,x.jsxs)(n.Fragment,{children:["Click on a user to view the full listing of associated Access Keys. All Access Keys associated with a user will be deleted along with the user.",(0,x.jsx)("br",{}),(0,x.jsx)("br",{}),(0,x.jsx)("strong",{children:"Are you sure you want to continue?"})]}),title:"Warning: One or more users selected has associated Access Keys.",sx:{margin:"15px 0"}}),(0,x.jsx)(i.bQt,{itemActions:U,columns:[{label:"Username",elementKey:"userName"},{label:"# Associated Access Keys",elementKey:"numSAs"}],isLoading:y,records:f,entityName:"User Access Keys",idField:"userName",customPaperHeight:"250"})]}):(0,x.jsxs)(n.Fragment,{children:[w,E]})})})}},13109:(e,s,t)=>{t.d(s,{A:()=>h});var n=t(65043),a=t(33097),r=t.n(a),i=t(89923),o=t(8185),c=t(64159),l=t(21383),d=t(20649),u=t(64681),x=t(70579);const h=e=>{let{selectedGroups:s,setSelectedGroups:t}=e;const a=(0,l.jL)(),[h,p]=(0,n.useState)([]),[m,j]=(0,n.useState)(!1),[y,g]=(0,n.useState)(""),A=(0,n.useCallback)((()=>{d.A.invoke("GET","/api/v1/groups").then((e=>{let s=r()(e,"groups",[]);s||(s=[]),p(s.sort(o.SO)),j(!1)})).catch((e=>{a((0,c.Dy)(e)),j(!1)}))}),[a]);(0,n.useEffect)((()=>{j(!0)}),[]),(0,n.useEffect)((()=>{m&&A()}),[m,A]);const b=s||[],f=h.filter((e=>e.includes(y)));return(0,x.jsxs)(i.xA9,{item:!0,xs:12,className:"inputItem",children:[m&&(0,x.jsx)(i.z21,{}),null!==h&&h.length>0?(0,x.jsxs)(n.Fragment,{children:[(0,x.jsx)(i.xA9,{item:!0,xs:12,className:"inputItem",children:(0,x.jsx)(u.A,{placeholder:"Start typing to search for Groups",onChange:g,value:y,label:"Assign Groups"})}),(0,x.jsx)(i.bQt,{columns:[{label:"Group"}],onSelect:e=>{const s=e.target,n=s.value,a=s.checked;let r=[...b];return a?r.push(n):r=r.filter((e=>e!==n)),t(r),r},selectedItems:b,isLoading:m,records:f,entityName:"Groups",idField:"",customPaperHeight:"200px"})]}):(0,x.jsx)(i.azJ,{sx:{textAlign:"center",padding:"10px 0"},children:"No Groups Available"})]})}},43527:(e,s,t)=>{t.r(s),t.d(s,{default:()=>ee});var n=t(65043),a=t(73216),r=t(39808),i=t(89923),o=t(8185),c=t(77403),l=t(99161),d=t(20649),u=t(64681),x=t(72237),h=t(77938),p=t(64159),m=t(21383),j=t(6681),y=t(48793),g=t(88617),A=t(70579);const b=(0,x.A)(n.lazy((()=>Promise.resolve().then(t.bind(t,56071))))),f=(0,x.A)(n.lazy((()=>t.e(24).then(t.bind(t,60024))))),S=()=>{const e=(0,m.jL)(),s=(0,a.Zp)(),[t,r]=(0,n.useState)([]),[x,S]=(0,n.useState)(!0),[v,C]=(0,n.useState)(!1),[_,E]=(0,n.useState)(!1),[U,w]=(0,n.useState)(""),[I,O]=(0,n.useState)([]),R=(0,h._)(l.Ms,l.x6),M=(0,h._)(l.Ms,l.Ld),K=(0,h._)(l.Ms,l.BD),D=(0,h._)(l.Ms,l.Dg);(0,n.useEffect)((()=>{x&&(R?d.A.invoke("GET","/api/v1/users").then((e=>{const s=null===e.users?[]:e.users;S(!1),r(s.sort(o.LA))})).catch((s=>{S(!1),e((0,p.C9)(s))})):S(!1))}),[x,e,R]);const k=t.filter((e=>e.accessKey.includes(U))),P=e=>{s(`${l.zZ.USERS}/${encodeURIComponent(e.accessKey)}`)},z=[{type:"view",onClick:P,disableButtonFunction:()=>!M},{type:"edit",onClick:P,disableButtonFunction:()=>!M}];return(0,n.useEffect)((()=>{e((0,p.ph)("list_users"))}),[]),(0,A.jsxs)(n.Fragment,{children:[v&&(0,A.jsx)(b,{deleteOpen:v,selectedUsers:I,closeDeleteModalAndRefresh:e=>{(e=>{C(!1),e&&(S(!0),O([]))})(e)}}),_&&(0,A.jsx)(f,{open:_,checkedUsers:I,closeModalAndRefresh:e=>{!function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];E(!1),e&&O([])}(e)}}),(0,A.jsx)(y.A,{label:"Users",actions:(0,A.jsx)(g.A,{})}),(0,A.jsx)(i.Mxu,{children:(0,A.jsxs)(i.xA9,{container:!0,children:[(0,A.jsxs)(i.xA9,{item:!0,xs:12,sx:c._0.actionsTray,children:[(0,A.jsx)(u.A,{placeholder:"Search Users",onChange:w,value:U,sx:{marginRight:"auto",maxWidth:380}}),(0,A.jsx)(h.R,{resource:l.Ms,scopes:[l.OV.ADMIN_DELETE_USER],matchAll:!0,errorProps:{disabled:!0},children:(0,A.jsx)(j.A,{tooltip:(0,h._)("console",[l.OV.ADMIN_DELETE_USER])?0===I.length?"Select Users to delete":"Delete Selected":(0,l.vj)([l.OV.ADMIN_DELETE_USER],"delete users"),children:(0,A.jsx)(i.$nd,{id:"delete-selected-users",onClick:()=>{C(!0)},label:"Delete Selected",icon:(0,A.jsx)(i.d7y,{}),disabled:0===I.length,variant:"secondary","aria-label":"delete-selected-users"})})}),(0,A.jsx)(h.R,{scopes:[l.OV.ADMIN_ADD_USER_TO_GROUP],resource:l.Ms,errorProps:{disabled:!0},children:(0,A.jsx)(j.A,{tooltip:(0,h._)("console",[l.OV.ADMIN_ADD_USER_TO_GROUP])?0===I.length?"Select Users to group":"Add to Group":(0,l.vj)([l.OV.ADMIN_ADD_USER_TO_GROUP],"add users to groups"),children:(0,A.jsx)(i.$nd,{id:"add-to-group",label:"Add to Group",icon:(0,A.jsx)(i.YXz,{}),disabled:I.length<=0,onClick:()=>{I.length>0&&E(!0)},variant:"regular"})})}),(0,A.jsx)(h.R,{scopes:[l.OV.ADMIN_CREATE_USER,l.OV.ADMIN_LIST_USER_POLICIES,l.OV.ADMIN_LIST_GROUPS],resource:l.HD,matchAll:!0,errorProps:{disabled:!0},children:(0,A.jsx)(j.A,{tooltip:(0,h._)("console-ui",[l.OV.ADMIN_CREATE_USER,l.OV.ADMIN_LIST_USER_POLICIES,l.OV.ADMIN_LIST_GROUPS,l.OV.ADMIN_ATTACH_USER_OR_GROUP_POLICY],!0)?"Create User":(0,l.vj)([l.OV.ADMIN_CREATE_USER,l.OV.ADMIN_LIST_USER_POLICIES,l.OV.ADMIN_LIST_GROUPS,l.OV.ADMIN_ATTACH_USER_OR_GROUP_POLICY],"create users"),children:(0,A.jsx)(i.$nd,{id:"create-user",label:"Create User",icon:(0,A.jsx)(i.REV,{}),onClick:()=>{s(`${l.zZ.USER_ADD}`)},variant:"callAction",disabled:!(0,h._)("console-ui",[l.OV.ADMIN_CREATE_USER,l.OV.ADMIN_LIST_USER_POLICIES,l.OV.ADMIN_LIST_GROUPS,l.OV.ADMIN_ATTACH_USER_OR_GROUP_POLICY],!0)})})})]}),x&&(0,A.jsx)(i.z21,{}),!x&&(0,A.jsxs)(n.Fragment,{children:[t.length>0&&(0,A.jsxs)(n.Fragment,{children:[(0,A.jsx)(i.xA9,{item:!0,xs:12,sx:{marginBottom:15},children:(0,A.jsx)(h.R,{scopes:[l.OV.ADMIN_LIST_USERS],resource:l.Ms,errorProps:{disabled:!0},children:(0,A.jsx)(i.bQt,{itemActions:z,columns:[{label:"Access Key",elementKey:"accessKey"}],onSelect:K||D?e=>{const{target:{value:s="",checked:t=!1}={}}=e;let n=[...I];return t?n.push(s):n=n.filter((e=>e!==s)),O(n),n}:void 0,selectedItems:I,isLoading:x,records:k,entityName:"Users",idField:"accessKey"})})}),(0,A.jsx)(i.lVp,{title:"Users",iconComponent:(0,A.jsx)(i.c2u,{}),help:(0,A.jsxs)(n.Fragment,{children:["A MinIO user consists of a unique access key (username) and corresponding secret key (password). Clients must authenticate their identity by specifying both a valid access key (username) and the corresponding secret key (password) of an existing MinIO user.",(0,A.jsx)("br",{}),"Groups provide a simplified method for managing shared permissions among users with common access patterns and workloads.",(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),"Users inherit access permissions to data and resources through the groups they belong to.",(0,A.jsx)("br",{}),"MinIO uses Policy-Based Access Control (PBAC) to define the authorized actions and resources to which an authenticated user has access. Each policy describes one or more actions and conditions that outline the permissions of a user or group of users.",(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),"Each user can access only those resources and operations which are explicitly granted by the built-in role. MinIO denies access to any other resource or action by default.",(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),"You can learn more at our"," ",(0,A.jsx)("a",{href:"https://min.io/docs/minio/kubernetes/upstream/administration/identity-access-management/minio-user-management.html?ref=con",target:"_blank",rel:"noopener",children:"documentation"}),"."]})})]}),0===t.length&&(0,A.jsx)(i.xA9,{container:!0,children:(0,A.jsx)(i.xA9,{item:!0,xs:8,children:(0,A.jsx)(i.lVp,{title:"Users",iconComponent:(0,A.jsx)(i.c2u,{}),help:(0,A.jsxs)(n.Fragment,{children:["A MinIO user consists of a unique access key (username) and corresponding secret key (password). Clients must authenticate their identity by specifying both a valid access key (username) and the corresponding secret key (password) of an existing MinIO user.",(0,A.jsx)("br",{}),"Groups provide a simplified method for managing shared permissions among users with common access patterns and workloads.",(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),"Users inherit access permissions to data and resources through the groups they belong to.",(0,A.jsx)("br",{}),"MinIO uses Policy-Based Access Control (PBAC) to define the authorized actions and resources to which an authenticated user has access. Each policy describes one or more actions and conditions that outline the permissions of a user or group of users.",(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),"Each user can access only those resources and operations which are explicitly granted by the built-in role. MinIO denies access to any other resource or action by default.",(0,A.jsxs)(h.R,{scopes:[l.OV.ADMIN_CREATE_USER,l.OV.ADMIN_LIST_USER_POLICIES,l.OV.ADMIN_LIST_GROUPS],matchAll:!0,resource:l.Ms,children:[(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),"To get started,"," ",(0,A.jsx)(i.t53,{onClick:()=>{s(`${l.zZ.USER_ADD}`)},children:"Create a User"}),"."]})]})})})})]})]})})]})};var v=t(13109),C=t(94141);const _=e=>{let{closeModalAndRefresh:s,selectedUser:t,open:a}=e;const r=(0,m.jL)(),[o,l]=(0,n.useState)(!1),[u,x]=(0,n.useState)(""),[h,j]=(0,n.useState)(""),[y,g]=(0,n.useState)(!1),[b,f]=(0,n.useState)([]),S=(0,n.useCallback)((()=>{if(!t)return null;d.A.invoke("GET",`/api/v1/user/${encodeURIComponent(t)}`).then((e=>{l(!1),x(e.accessKey),f(e.memberOf||[]),g("enabled"===e.status)})).catch((e=>{l(!1),r((0,p.Dy)(e))}))}),[t,r]);(0,n.useEffect)((()=>{null===t?(x(""),j(""),f([])):S()}),[t,S]);const _=""!==u.trim()&&(""!==h.trim()&&null===t||null!==t);return(0,A.jsx)(C.A,{onClose:()=>{s()},modalOpen:a,title:"Set Groups",titleIcon:(0,A.jsx)(i.WC,{}),children:(0,A.jsx)(n.Fragment,{children:(0,A.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{e.preventDefault(),o||(l(!0),null!==t?d.A.invoke("PUT",`/api/v1/user/${encodeURIComponent(t)}`,{status:y?"enabled":"disabled",groups:b}).then((e=>{l(!1),s()})).catch((e=>{l(!1),r((0,p.Dy)(e))})):d.A.invoke("POST","/api/v1/users",{accessKey:u,secretKey:h,groups:b}).then((e=>{l(!1),s()})).catch((e=>{l(!1),r((0,p.Dy)(e))})))},children:[(0,A.jsx)(i.Hbc,{withBorders:!1,containerPadding:!1,children:(0,A.jsx)(v.A,{selectedGroups:b,setSelectedGroups:e=>{f(e)}})}),(0,A.jsxs)(i.azJ,{sx:c.Uz.modalButtonBar,children:[(0,A.jsx)(i.$nd,{id:"clear-change-user-groups",type:"button",variant:"regular",onClick:()=>{null===t?(x(""),j(""),f([])):f([])},label:"Clear"}),(0,A.jsx)(i.$nd,{id:"save-user-groups",type:"submit",variant:"callAction",disabled:o||!_,label:"Save"})]}),o&&(0,A.jsx)(i.xA9,{item:!0,xs:12,children:(0,A.jsx)(i.z21,{})})]})})})};var E=t(22166),U=t(62560),w=t(42967);const I=e=>{let{closeModalAndRefresh:s,selectedUser:t,currentPolicies:a,open:r}=e;const o=(0,m.jL)(),[l,u]=(0,n.useState)(!1),[x,h]=(0,n.useState)([]),j=(0,E.d4)((e=>e.createUser.selectedPolicies));return(0,n.useEffect)((()=>{if(r){const e=a.map((e=>e.policy));h(e),o((0,U.Gy)(e))}}),[r,t]),(0,A.jsxs)(C.A,{onClose:()=>{s()},modalOpen:r,title:"Set Policies",titleIcon:(0,A.jsx)(i.n$X,{}),children:[(0,A.jsx)(i.Hbc,{withBorders:!1,containerPadding:!1,children:(0,A.jsx)(w.A,{selectedPolicy:j})}),(0,A.jsxs)(i.azJ,{sx:c.Uz.modalButtonBar,children:[(0,A.jsx)(i.$nd,{id:"reset-user-policies",type:"button",variant:"regular",color:"primary",onClick:()=>{o((0,U.Gy)(x))},label:"Reset"}),(0,A.jsx)(i.$nd,{id:"save-user-policy",type:"button",variant:"callAction",color:"primary",disabled:l,onClick:()=>{let e=t;u(!0),d.A.invoke("PUT","/api/v1/set-policy",{name:j,entityName:e,entityType:"user"}).then((()=>{u(!1),o((0,U.Gy)([])),s()})).catch((e=>{u(!1),o((0,p.Dy)(e))}))},label:"Save"})]}),l&&(0,A.jsx)(i.xA9,{item:!0,xs:12,children:(0,A.jsx)(i.z21,{})})]})};var O=t(18823),R=t(78619),M=t(68045),K=t(45479),D=t(10158),k=t(99956);const P=e=>{let{user:s,hasPolicy:t}=e;const r=(0,m.jL)(),c=(0,a.Zp)(),[u,x]=(0,n.useState)([]),[y,g]=(0,n.useState)(!1),[b,f]=(0,n.useState)(!1),[S,v]=(0,n.useState)(null),[C,_]=(0,n.useState)(!1),[E,U]=(0,n.useState)(null),[w,I]=(0,n.useState)([]),[P,z]=(0,n.useState)(!1),[N,T]=(0,n.useState)(!1);(0,n.useEffect)((()=>{L()}),[]),(0,n.useEffect)((()=>{y&&d.A.invoke("GET",`/api/v1/user/${encodeURIComponent(s)}/service-accounts`).then((e=>{g(!1);const s=e.sort(o.LA);x(s)})).catch((e=>{r((0,p.C9)(e)),g(!1)}))}),[y,g,x,s,r]);const L=()=>{g(!0)},$=e=>{v(e),T(!0)},F=[{type:"view",onClick:e=>{e&&$(e.accessKey)}},{type:"delete",onClick:e=>{e&&(e=>{v(e),f(!0)})(e.accessKey)}},{type:"edit",onClick:e=>{e&&$(e.accessKey)}}];return(0,n.useEffect)((()=>{r((0,p.ph)("user_details_accounts"))}),[]),(0,A.jsxs)(n.Fragment,{children:[b&&(0,A.jsx)(O.default,{deleteOpen:b,selectedServiceAccount:S,closeDeleteModalAndRefresh:e=>{(e=>{f(!1),e&&L()})(e)}}),P&&(0,A.jsx)(M.A,{deleteOpen:P,selectedSAs:w,closeDeleteModalAndRefresh:e=>{z(!1),e&&(r((0,p.Hk)("Access Keys deleted successfully.")),I([]),g(!0))}}),C&&(0,A.jsx)(R.A,{newServiceAccount:E,open:C,closeModal:()=>{_(!1),U(null)},entity:"Access Key"}),N&&(0,A.jsx)(D.A,{open:N,selectedAccessKey:S,closeModalAndRefresh:()=>{T(!1),g(!0)}}),(0,A.jsx)(i._xt,{separator:!0,sx:{marginBottom:15},actions:(0,A.jsxs)(i.azJ,{sx:{display:"flex",justifyContent:"flex-end",gap:10},children:[(0,A.jsx)(j.A,{tooltip:"Delete Selected",children:(0,A.jsx)(i.$nd,{id:"delete-selected",onClick:()=>{z(!0)},label:"Delete Selected",icon:(0,A.jsx)(i.d7y,{}),disabled:0===w.length,variant:"secondary"})}),(0,A.jsx)(h.R,{scopes:[l.OV.ADMIN_CREATE_SERVICEACCOUNT,l.OV.ADMIN_UPDATE_SERVICEACCOUNT,l.OV.ADMIN_REMOVE_SERVICEACCOUNT,l.OV.ADMIN_LIST_SERVICEACCOUNTS],resource:l.Ms,matchAll:!0,errorProps:{disabled:!0},children:(0,A.jsx)(j.A,{tooltip:"Create Access Key",children:(0,A.jsx)(i.$nd,{id:"create-service-account",label:"Create Access Key",variant:"callAction",icon:(0,A.jsx)(i.REV,{}),onClick:()=>{c(`/identity/users/new-user-sa/${encodeURIComponent(s)}`)},disabled:!t})})})]}),children:"Access Keys"}),(0,A.jsx)(i.bQt,{itemActions:F,entityName:"Access Keys",columns:k.X,onSelect:e=>(0,K.Qm)(e,I,w),selectedItems:w,isLoading:y,records:u,idField:"accessKey"})]})};var z=t(56629),N=t(53518);const T=e=>{let{open:s,userName:t,closeModal:a}=e;const r=(0,m.jL)(),[o,l]=(0,n.useState)(""),[d,u]=(0,n.useState)(""),[x,h]=(0,n.useState)(!1);return s?(0,A.jsx)(C.A,{title:"Change User Password",modalOpen:s,onClose:()=>{l(""),u(""),a()},titleIcon:(0,A.jsx)(i.Fwq,{}),children:(0,A.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{(e=>{if(e.preventDefault(),x)return;if(h(!0),o.length<8)return r((0,p.Dy)({errorMessage:"Passwords must be at least 8 characters long",detailedError:""})),void h(!1);let s={selectedUser:t,newSecretKey:o};z.F.account.changeUserPassword(s).then((e=>{h(!1),l(""),u(""),r((0,p.Hk)(`Successfully updated the password for the user ${t}.`)),a()})).catch((async e=>{h(!1),l(""),u("");const s=await e.json();r((0,p.C9)((0,N.S)(s)))}))})(e)},children:(0,A.jsxs)(i.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,A.jsxs)(i.azJ,{sx:{margin:"10px 0 20px"},children:["Change password for: ",(0,A.jsx)("strong",{children:t})]}),(0,A.jsx)(i.cl_,{id:"new-password",name:"new-password",onChange:e=>{l(e.target.value)},label:"New Password",type:"password",value:o}),(0,A.jsx)(i.cl_,{id:"re-new-password",name:"re-new-password",onChange:e=>{u(e.target.value)},label:"Type New Password Again",type:"password",value:d}),(0,A.jsx)(i.azJ,{sx:c.Uz.modalButtonBar,children:(0,A.jsx)(i.$nd,{id:"save-user-password",type:"submit",variant:"callAction",color:"primary",disabled:x||!(d.length>0&&o===d),label:"Save"})}),x&&(0,A.jsx)(i.azJ,{children:(0,A.jsx)(i.z21,{})})]})})}):null};var L=t(56071);const $=()=>{const e=(0,m.jL)(),s=(0,a.g)(),t=(0,a.Zp)(),[r,c]=(0,n.useState)(!1),[u,x]=(0,n.useState)(!1),[b,f]=(0,n.useState)(!1),[S,v]=(0,n.useState)(!1),[C,E]=(0,n.useState)(!1),[U,w]=(0,n.useState)([]),[O,R]=(0,n.useState)([]),[M,K]=(0,n.useState)([]),[D,k]=(0,n.useState)(!1),[z,N]=(0,n.useState)(!1),[$,F]=(0,n.useState)(!1),[G,J]=(0,n.useState)("groups"),B=(0,h._)(l.Ms,l.Ho)&&!C,V=(0,h._)(l.Ms,l.m0)&&C,H=s.userName||"",Y=localStorage.getItem("userLoggedIn")||"",Z=(0,h._)(l.Ms,l.$X,!0),W=(0,h._)(l.Ms,l.Lb,!0),Q=(0,h._)(l.Ms,l.Oh),q=(0,n.useCallback)((()=>{if(""===H)return null;c(!0),d.A.invoke("GET",`/api/v1/user/${encodeURIComponent(H)}`).then((e=>{v(!1);const s=e.memberOf||[];w(s);const t=s.map((e=>({group:e})));R(t);const n=e.policy.map((e=>({policy:e})));n.sort(o.rY),K(n),E("enabled"===e.status),F(e.hasPolicy),c(!1)})).catch((s=>{v(!1),c(!1),e((0,p.Dy)(s))}))}),[H,e]);(0,n.useEffect)((()=>{e((0,p.ph)("user_details_groups"))}),[]),(0,n.useEffect)((()=>{q()}),[q]);const X=[{type:"view",onClick:e=>{t(`${l.zZ.GROUPS}/${encodeURIComponent(e.group)}`)},disableButtonFunction:()=>!Q}];return(0,A.jsxs)(n.Fragment,{children:[u&&(0,A.jsx)(_,{open:u,selectedUser:H,closeModalAndRefresh:()=>{x(!1),q()}}),b&&(0,A.jsx)(I,{open:b,selectedUser:H,currentPolicies:M,closeModalAndRefresh:()=>{f(!1),q()}}),z&&(0,A.jsx)(L.default,{deleteOpen:z,selectedUsers:[H],closeDeleteModalAndRefresh:e=>{(e=>{N(!1),e&&q()})(e)}}),D&&(0,A.jsx)(T,{open:D,userName:H,closeModal:()=>k(!1)}),(0,A.jsx)(y.A,{label:(0,A.jsx)(n.Fragment,{children:(0,A.jsx)(i.EGL,{label:"Users",onClick:()=>t(l.zZ.USERS)})}),actions:(0,A.jsx)(g.A,{})}),(0,A.jsx)(i.Mxu,{children:(0,A.jsxs)(i.xA9,{container:!0,children:[(0,A.jsx)(i.xA9,{item:!0,xs:12,children:(0,A.jsx)(i.lcx,{icon:(0,A.jsx)(i.c2u,{width:40}),title:H,subTitle:"",actions:(0,A.jsxs)(n.Fragment,{children:[(0,A.jsx)("span",{style:{fontSize:".8rem",marginRight:".5rem"},children:"User Status:"}),(0,A.jsx)("span",{style:{fontWeight:"bold",fontSize:".9rem",marginRight:".5rem"},children:C?"Enabled":"Disabled"}),(0,A.jsx)(j.A,{tooltip:B||V?"":(0,h._)(l.Ms,l.Ho)?(0,l.vj)(l.m0,"disable users"):(0,h._)(l.Ms,l.m0)?(0,l.vj)(l.Ho,"enable users"):(0,l.vj)(l.ni,"enable or disable users"),children:(0,A.jsx)(i.dOG,{indicatorLabels:["Enabled","Disabled"],checked:C,value:"group_enabled",id:"group-status",name:"group-status",onChange:()=>{var s;E(!C),s=!C,S||(v(!0),d.A.invoke("PUT",`/api/v1/user/${encodeURIComponent(H)}`,{status:s?"enabled":"disabled",groups:U}).then((e=>{v(!1)})).catch((s=>{v(!1),e((0,p.Dy)(s))})))},switchOnly:!0,disabled:!B&&!V})}),(0,A.jsx)(j.A,{tooltip:(0,h._)(l.Ms,l.Dg)?Y===H?"You cannot delete the currently logged in User":"Delete User":(0,l.vj)(l.Dg,"delete user"),children:(0,A.jsx)(i.$nd,{id:"delete-user",onClick:()=>{N(!0)},icon:(0,A.jsx)(i.ucK,{}),variant:"secondary",disabled:!(0,h._)(l.Ms,l.Dg)||Y===H})}),(0,A.jsx)(j.A,{tooltip:"Change Password",children:(0,A.jsx)(i.$nd,{id:"change-user-password",onClick:()=>{k(!0)},icon:(0,A.jsx)(i.aJN,{}),variant:"regular",disabled:Y===H})})]}),sx:{marginBottom:15}})}),(0,A.jsx)(i.xA9,{item:!0,xs:12,children:(0,A.jsx)(i.tUM,{currentTabOrPath:G,onTabClick:J,options:[{tabConfig:{id:"groups",label:"Groups",disabled:!W},content:(0,A.jsxs)(n.Fragment,{children:[(0,A.jsx)(i.azJ,{onMouseMove:()=>e((0,p.ph)("user_details_groups")),children:(0,A.jsx)(i._xt,{separator:!0,sx:{marginBottom:15},actions:(0,A.jsx)(j.A,{tooltip:W?"Assign groups":(0,l.vj)(l.Lb,"add users to groups"),children:(0,A.jsx)(i.$nd,{id:"add-groups",label:"Add to Groups",onClick:()=>{x(!0)},icon:(0,A.jsx)(i.REV,{}),variant:"callAction",disabled:!W})}),children:"Groups"})}),(0,A.jsx)(i.xA9,{item:!0,xs:12,onMouseMove:()=>e((0,p.ph)("user_details_groups")),children:(0,A.jsx)(i.bQt,{itemActions:X,columns:[{label:"Name",elementKey:"group"}],isLoading:r,records:O,entityName:"Groups",idField:"group"})})]})},{tabConfig:{id:"service_accounts",label:"Service Accounts",disabled:!(0,h._)(l.Ms,l.xw)},content:(0,A.jsx)(P,{user:H,hasPolicy:$})},{tabConfig:{id:"policies",label:"Policies",disabled:!Z},content:(0,A.jsxs)(n.Fragment,{children:[(0,A.jsx)(i.azJ,{onMouseMove:()=>e((0,p.ph)("user_details_policies")),children:(0,A.jsx)(i._xt,{separator:!0,sx:{marginBottom:15},actions:(0,A.jsx)(j.A,{tooltip:Z?"Assign Policies":(0,l.vj)(l.$X,"assign policies"),children:(0,A.jsx)(i.$nd,{id:"assign-policies",label:"Assign Policies",onClick:()=>{f(!0)},icon:(0,A.jsx)(i.n$X,{}),variant:"callAction",disabled:!Z})}),children:"Policies"})}),(0,A.jsx)(i.azJ,{children:(0,A.jsx)(i.bQt,{itemActions:[{type:"view",onClick:e=>{t(`${l.zZ.POLICIES}/${encodeURIComponent(e.policy)}`)}}],columns:[{label:"Name",elementKey:"policy"}],isLoading:r,records:M,entityName:"Policies",idField:"policy"})})]})}]})})]})})]})};var F=t(88115);const G=e=>{let{icon:s,description:t}=e;return(0,A.jsxs)(i.azJ,{sx:{display:"flex","& .min-icon":{marginRight:"10px",height:"23px",width:"23px",marginBottom:"10px"}},children:[s," ",(0,A.jsx)("div",{style:{fontSize:"14px",fontStyle:"italic",color:"#5E5E5E"},children:t})]})},J=()=>(0,A.jsxs)(i.azJ,{sx:{flex:1,border:"1px solid #eaeaea",borderRadius:"2px",display:"flex",flexFlow:"column",padding:"20px",marginTop:0},children:[(0,A.jsxs)(i.azJ,{sx:{fontSize:"16px",fontWeight:600,display:"flex",alignItems:"center",marginBottom:"16px","& .min-icon":{height:"21px",width:"21px",marginRight:"15px"}},children:[(0,A.jsx)(i.nag,{}),(0,A.jsx)("div",{children:"Learn more about the Users feature"})]}),(0,A.jsxs)(i.azJ,{sx:{fontSize:"14px",marginBottom:"15px"},children:["A MinIO user consists of a unique access key (username) and corresponding secret key (password). Clients must authenticate their identity by specifying both a valid access key (username) and the corresponding secret key (password) of an existing MinIO user.",(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),"Each user can have one or more assigned policies that explicitly list the actions and resources to which that user has access. Users can also inherit policies from the groups in which they have membership.",(0,A.jsx)("br",{})]}),(0,A.jsxs)(i.azJ,{sx:{display:"flex",flexFlow:"column"},children:[(0,A.jsx)(G,{icon:(0,A.jsx)(i.c2u,{}),description:"Create Users"}),(0,A.jsx)(G,{icon:(0,A.jsx)(i.YXz,{}),description:"Manage Groups"}),(0,A.jsx)(G,{icon:(0,A.jsx)(i.uYH,{}),description:"Assign Policies"})]})]}),B=()=>{const e=(0,m.jL)(),s=(0,E.d4)((e=>e.createUser.userName));return(0,A.jsx)(i.cl_,{id:"accesskey-input",name:"accesskey-input",label:"User Name",value:s,autoFocus:!0,onChange:s=>{e((0,U.ht)(s.target.value))}})},V=()=>{const e=(0,m.jL)(),s=(0,E.d4)((e=>e.createUser.secretKey));return(0,A.jsx)(i.cl_,{id:"standard-multiline-static",name:"standard-multiline-static",type:"password",label:"Password",value:s,onChange:s=>{e((0,U.ir)(s.target.value))},autoComplete:"current-password"})},H=()=>{const e=(0,m.jL)(),s=(0,E.d4)((e=>e.createUser.selectedPolicies)),t=(0,E.d4)((e=>e.createUser.selectedGroups)),r=(0,E.d4)((e=>e.createUser.addLoading)),o=(0,E.d4)((e=>e.createUser.sendEnabled)),d=(0,E.d4)((e=>e.createUser.secretKeylength)),u=(0,a.Zp)();e((0,U.yt)());return(0,n.useEffect)((()=>{e((0,p.ph)("add_user"))}),[]),(0,A.jsx)(n.Fragment,{children:(0,A.jsxs)(i.xA9,{item:!0,xs:12,children:[(0,A.jsx)(y.A,{label:(0,A.jsx)(i.EGL,{label:"Users",onClick:()=>u(l.zZ.USERS)}),actions:(0,A.jsx)(g.A,{})}),(0,A.jsx)(i.Mxu,{children:(0,A.jsx)(i.Hbc,{title:"Create User",icon:(0,A.jsx)(i.R$W,{}),helpBox:(0,A.jsx)(J,{}),children:(0,A.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:s=>{(s=>{if(s.preventDefault(),d<8)return e((0,p.C9)({errorMessage:"Passwords must be at least 8 characters long",detailedError:""})),void e((0,U.AE)(!1));r||(e((0,U.AE)(!0)),e((0,F.y)()).unwrap().then((()=>u(`${l.zZ.USERS}`))))})(s)},children:[(0,A.jsx)(B,{}),(0,A.jsx)(V,{}),(0,A.jsx)(w.A,{selectedPolicy:s}),(0,A.jsx)(v.A,{selectedGroups:t,setSelectedGroups:s=>{e((0,U.yD)(s))}}),r&&(0,A.jsx)(i.xA9,{item:!0,xs:12,children:(0,A.jsx)(i.z21,{})}),(0,A.jsxs)(i.xA9,{item:!0,xs:12,sx:c.Uz.modalButtonBar,children:[(0,A.jsx)(i.$nd,{id:"clear-add-user",type:"button",variant:"regular",onClick:s=>{e((0,F.o)())},label:"Clear"}),(0,A.jsx)(i.$nd,{id:"save-user",type:"submit",variant:"callAction",color:"primary",disabled:r||!o,label:"Save"})]})]})})})]})})};var Y=t(56483),Z=t(41206);const W=e=>{let{icon:s,description:t}=e;return(0,A.jsxs)(i.azJ,{sx:{display:"flex","& .min-icon":{marginRight:"10px",height:"23px",width:"23px",marginBottom:"10px"}},children:[s," ",(0,A.jsx)("div",{style:{fontSize:"14px",fontStyle:"italic",color:"#5E5E5E"},children:t})]})},Q=()=>(0,A.jsxs)(i.azJ,{sx:{flex:1,border:"1px solid #eaeaea",borderRadius:"2px",display:"flex",flexFlow:"column",padding:"20px",marginTop:0},children:[(0,A.jsxs)(i.azJ,{sx:{fontSize:"16px",fontWeight:600,display:"flex",alignItems:"center",marginBottom:"16px",paddingBottom:"20px","& .min-icon":{height:"21px",width:"21px",marginRight:"15px"}},children:[(0,A.jsx)(i.nag,{}),(0,A.jsx)("div",{children:"Learn more about Access Keys"})]}),(0,A.jsxs)(i.azJ,{sx:{fontSize:"14px",marginBottom:"15px"},children:[(0,A.jsxs)(i.azJ,{sx:{paddingBottom:"20px"},children:[(0,A.jsx)(W,{icon:(0,A.jsx)(i.ehx,{}),description:"Create Access Keys"}),(0,A.jsx)(i.azJ,{sx:{paddingTop:"20px"},children:"Access Keys inherit the policies explicitly attached to the parent user, and the policies attached to each group in which the parent user has membership."})]}),(0,A.jsxs)(i.azJ,{sx:{paddingBottom:"20px"},children:[(0,A.jsx)(W,{icon:(0,A.jsx)(i.aJN,{}),description:"Assign Custom Credentials"}),(0,A.jsx)(i.azJ,{sx:{paddingTop:"10px"},children:"Randomized access credentials are recommended, and provided by default. You may use your own custom Access Key and Secret Key by replacing the default values. After creation of any Access Key, you will be given the opportunity to view and download the account credentials."}),(0,A.jsx)(i.azJ,{sx:{paddingTop:"10px"},children:"Access Keys support programmatic access by applications. You cannot use a Access Key to log into the MinIO Console."})]}),(0,A.jsxs)(i.azJ,{sx:{paddingBottom:"20px"},children:[(0,A.jsx)(W,{icon:(0,A.jsx)(i.n$X,{}),description:"Assign Access Policies"}),(0,A.jsx)(i.azJ,{sx:{paddingTop:"10px"},children:"You can specify an optional JSON-formatted IAM policy to further restrict Access Key access to a subset of the actions and resources explicitly allowed for the parent user. Additional access beyond that of the parent user cannot be implemented through these policies."}),(0,A.jsx)(i.azJ,{sx:{paddingTop:"10px"},children:"You cannot modify the optional Access Key IAM policy after saving."})]})]}),(0,A.jsx)(i.azJ,{sx:{display:"flex",flexFlow:"column"}})]});var q=t(11441);const X=()=>{const e=(0,m.jL)(),s=(0,a.g)(),t=(0,a.Zp)(),[r,o]=(0,n.useState)(!1),[u,x]=(0,n.useState)((0,Y.$f)(20)),[h,j]=(0,n.useState)((0,Y.$f)(40)),[b,f]=(0,n.useState)(!1),[S,v]=(0,n.useState)(null),[C,_]=(0,n.useState)(""),E=s.userName||"",[U,w]=(0,n.useState)(""),[I,O]=(0,n.useState)(""),[M,K]=(0,n.useState)(""),[D,k]=(0,n.useState)();(0,n.useEffect)((()=>{if(r){const s=D?D.toJSDate().toISOString():null;d.A.invoke("POST",`/api/v1/user/${encodeURIComponent(E)}/service-account-credentials`,{policy:C,accessKey:u,secretKey:h,description:I,comment:M,name:U,expiry:s}).then((e=>{o(!1),v({accessKey:e.accessKey||"",secretKey:e.secretKey||"",url:e.url||""})})).catch((s=>{o(!1),e((0,p.C9)(s))}))}}),[r,o,e,C,E,u,h,U,I,D,M]),(0,n.useEffect)((()=>{b&&d.A.invoke("GET",`/api/v1/user/${encodeURIComponent(E)}/policies`).then((e=>{_(JSON.stringify(JSON.parse(e.policy),null,4))})).catch((e=>{(0,p.C9)(e)}))}),[b,E]);return(0,n.useEffect)((()=>{e((0,p.ph)("add_user_SA"))}),[]),(0,A.jsxs)(n.Fragment,{children:[S&&(0,A.jsx)(R.A,{newServiceAccount:S,open:!0,closeModal:()=>{v(null),t(`${l.zZ.USERS}/${encodeURIComponent(E)}`)},entity:"Access Key"}),(0,A.jsxs)(i.xA9,{item:!0,xs:12,children:[(0,A.jsx)(y.A,{label:(0,A.jsx)(i.EGL,{onClick:()=>t(`${l.zZ.USERS}/${encodeURIComponent(E)}`),label:"User Details - "+E}),actions:(0,A.jsx)(g.A,{})}),(0,A.jsx)(i.Mxu,{children:(0,A.jsx)(i.Hbc,{helpBox:(0,A.jsx)(Q,{}),icon:(0,A.jsx)(i.kQt,{}),title:`Create Access Key for ${E}`,children:(0,A.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{e.preventDefault(),(e=>{e.preventDefault(),o(!0)})(e)},children:[(0,A.jsx)(i.cl_,{value:u,label:"Access Key",id:"accessKey",name:"accessKey",placeholder:"Enter Access Key",onChange:e=>{x(e.target.value)},startIcon:(0,A.jsx)(i.ehx,{})}),(0,A.jsx)(i.cl_,{value:h,label:"Secret Key",id:"secretKey",name:"secretKey",type:"password",placeholder:"Enter Secret Key",onChange:e=>{j(e.target.value)},startIcon:(0,A.jsx)(i.aJN,{})}),(0,A.jsx)(i.dOG,{value:"serviceAccountPolicy",id:"serviceAccountPolicy",name:"serviceAccountPolicy",checked:b,onChange:e=>{f(e.target.checked)},label:"Restrict beyond user policy",description:"You can specify an optional JSON-formatted IAM policy to further restrict Access Key access to a subset of the actions and resources explicitly allowed for the parent user. Additional access beyond that of the parent user cannot be implemented through these policies."}),b&&(0,A.jsxs)(i.xA9,{item:!0,xs:12,children:[(0,A.jsx)(i.azJ,{children:(0,A.jsx)(i.V7x,{content:(0,A.jsx)(n.Fragment,{children:(0,A.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/kubernetes/upstream/administration/identity-access-management/policy-based-access-control.html#policy-document-structure",children:"Guide to access policy structure"})}),placement:"right",children:(0,A.jsx)(q.A,{children:"Current User Policy - edit the JSON to remove permissions for this Access Key"})})}),(0,A.jsx)(i.xA9,{item:!0,xs:12,sx:{...c.Uz.formScrollable},children:(0,A.jsx)(Z.A,{value:C,onChange:e=>{_(e)},editorHeight:"350px",helptip:(0,A.jsx)(n.Fragment,{children:(0,A.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/kubernetes/upstream/administration/identity-access-management/policy-based-access-control.html#policy-document-structure",children:"Guide to access policy structure"})})})})]}),(0,A.jsx)(i.azJ,{sx:{marginBottom:"15px",marginTop:"15px",width:"100%","& label":{width:"180px"}},children:(0,A.jsx)(i.e8j,{noLabelMinWidth:!0,value:D,onChange:e=>{k(e)},id:"expiryTime",label:"Expiry",timeFormat:"24h",secondsSelector:!1})}),(0,A.jsx)(i.cl_,{value:U,label:"Name",id:"name",name:"name",type:"text",placeholder:"Enter a name",onChange:e=>{w(e.target.value)}}),(0,A.jsx)(i.cl_,{value:I,label:"Description",id:"description",name:"description",type:"text",placeholder:"Enter a description",onChange:e=>{O(e.target.value)}}),(0,A.jsx)(i.cl_,{value:M,label:"Comments",id:"comment",name:"comment",type:"text",placeholder:"Enter a comment",onChange:e=>{K(e.target.value)}}),(0,A.jsxs)(i.xA9,{item:!0,xs:12,sx:{...c.Uz.modalButtonBar},children:[(0,A.jsx)(i.$nd,{id:"clear",type:"button",variant:"regular",onClick:()=>{v(null),x(""),j("")},label:"Clear"}),(0,A.jsx)(i.$nd,{id:"create-sa",type:"submit",variant:"callAction",color:"primary",label:"Create"})]})]})})})]})]})},ee=()=>(0,A.jsxs)(a.BV,{children:[(0,A.jsx)(a.qh,{path:"add-user",element:(0,A.jsx)(H,{})}),(0,A.jsx)(a.qh,{path:":userName",element:(0,A.jsx)($,{})}),(0,A.jsx)(a.qh,{path:"new-user-sa/:userName",element:(0,A.jsx)(X,{})}),(0,A.jsx)(a.qh,{path:"/",element:(0,A.jsx)(S,{})}),(0,A.jsx)(a.qh,{element:(0,A.jsx)(r.A,{})})]})}}]); -//# sourceMappingURL=3527.0fc04358.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/3527.0fc04358.chunk.js.map b/web-app/build/static/js/3527.0fc04358.chunk.js.map deleted file mode 100644 index 51f2e28cb..000000000 --- a/web-app/build/static/js/3527.0fc04358.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"static/js/3527.0fc04358.chunk.js","mappings":"kOA+BA,MAyDA,EAzD6BA,IAIM,IAJL,2BAC5BC,EAA0B,WAC1BC,EAAU,uBACVC,GAC2BH,EAC3B,MAAMI,GAAWC,EAAAA,EAAAA,OAGVC,EAAeC,IAAoBC,EAAAA,EAAAA,WAAkB,GAE5D,IAAKL,EACH,OAAO,KAkBT,OACEM,EAAAA,EAAAA,KAACC,EAAAA,EAAa,CACZC,MAAO,oBACPC,YAAa,SACbC,OAAQX,EACRY,WAAWL,EAAAA,EAAAA,KAACM,EAAAA,IAAiB,IAC7BC,UAAWV,EACXW,UAtBoBC,KACtBX,GAAiB,GACjBY,EAAAA,EAAIC,gBACDC,qBAAqBlB,GACrBmB,MAAMC,IACLtB,GAA2B,EAAK,IAEjCuB,OAAMC,UACL,MAAMC,QAAaC,EAAIC,OACvBxB,GAASyB,EAAAA,EAAAA,KAAqBC,EAAAA,EAAAA,GAAeJ,KAC7CzB,GAA2B,EAAM,IAElC8B,SAAQ,IAAMxB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,KAAM,YAAa5C,SAASjE,EAAAA,EAAAA,KAAC4V,EAAW,OAC/C5V,EAAAA,EAAAA,KAAC2c,EAAAA,GAAK,CACJ9V,KAAM,wBACN5C,SAASjE,EAAAA,EAAAA,KAAC6c,EAA2B,OAEvC7c,EAAAA,EAAAA,KAAC2c,EAAAA,GAAK,CAAC9V,KAAM,IAAK5C,SAASjE,EAAAA,EAAAA,KAACmN,EAAS,OACrCnN,EAAAA,EAAAA,KAAC2c,EAAAA,GAAK,CAAC1Y,SAASjE,EAAAA,EAAAA,KAAC8c,EAAAA,EAAY,Q","sources":["screens/Console/Account/DeleteServiceAccount.tsx","screens/Console/Common/CredentialsPrompt/CredentialItem.tsx","screens/Console/Common/CredentialsPrompt/CredentialsPrompt.tsx","screens/Console/Common/PanelTitle/PanelTitle.tsx","screens/Console/Policies/PolicySelectors.tsx","screens/Console/Users/DeleteUser.tsx","screens/Console/Users/GroupsSelectors.tsx","screens/Console/Users/ListUsers.tsx","screens/Console/Users/ChangeUserGroups.tsx","screens/Console/Users/SetUserPolicies.tsx","screens/Console/Users/UserServiceAccountsPanel.tsx","screens/Console/Account/ChangeUserPasswordModal.tsx","screens/Console/Users/UserDetails.tsx","screens/Console/Users/AddUserHelpBox.tsx","screens/Console/Users/UserSelector.tsx","screens/Console/Users/PasswordSelector.tsx","screens/Console/Users/AddUserScreen.tsx","screens/Console/Users/AddUserServiceAccountHelpBox.tsx","screens/Console/Users/AddUserServiceAccountScreen.tsx","screens/Console/Users/Users.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useState } from \"react\";\nimport ConfirmDialog from \"../Common/ModalWrapper/ConfirmDialog\";\nimport { ConfirmDeleteIcon } from \"mds\";\nimport { setErrorSnackMessage } from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\nimport { api } from \"api\";\nimport { ApiError, HttpResponse } from \"api/consoleApi\";\nimport { errorToHandler } from \"api/errors\";\n\ninterface IDeleteServiceAccountProps {\n closeDeleteModalAndRefresh: (refresh: boolean) => void;\n deleteOpen: boolean;\n selectedServiceAccount: string | null;\n}\n\nconst DeleteServiceAccount = ({\n closeDeleteModalAndRefresh,\n deleteOpen,\n selectedServiceAccount,\n}: IDeleteServiceAccountProps) => {\n const dispatch = useAppDispatch();\n const onClose = () => closeDeleteModalAndRefresh(false);\n\n const [loadingDelete, setLoadingDelete] = useState(false);\n\n if (!selectedServiceAccount) {\n return null;\n }\n\n const onConfirmDelete = () => {\n setLoadingDelete(true);\n api.serviceAccounts\n .deleteServiceAccount(selectedServiceAccount)\n .then((_) => {\n closeDeleteModalAndRefresh(true);\n })\n .catch(async (res: HttpResponse) => {\n const err = (await res.json()) as ApiError;\n dispatch(setErrorSnackMessage(errorToHandler(err)));\n closeDeleteModalAndRefresh(false);\n })\n .finally(() => setLoadingDelete(false));\n };\n\n return (\n }\n isLoading={loadingDelete}\n onConfirm={onConfirmDelete}\n onClose={onClose}\n confirmationContent={\n \n Are you sure you want to delete Access Key{\" \"}\n \n {selectedServiceAccount}\n \n ?\n \n }\n />\n );\n};\n\nexport default DeleteServiceAccount;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Button, CopyIcon, InputLabel, ReadBox, Box } from \"mds\";\nimport CopyToClipboard from \"react-copy-to-clipboard\";\nimport { setModalSnackMessage } from \"../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../store\";\n\ninterface ICredentialsItem {\n label?: string;\n value?: string;\n}\n\nconst CredentialItem = ({ label = \"\", value = \"\" }: ICredentialsItem) => {\n const dispatch = useAppDispatch();\n\n return (\n \n {label}\n \n {\n dispatch(setModalSnackMessage(`${label} copied to clipboard`));\n }}\n style={{\n marginRight: \"5px\",\n width: \"28px\",\n height: \"28px\",\n padding: \"0px\",\n }}\n icon={}\n />\n \n }\n >\n {value}\n \n \n );\n};\n\nexport default CredentialItem;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport get from \"lodash/get\";\nimport styled from \"styled-components\";\nimport {\n Box,\n Button,\n DownloadIcon,\n ServiceAccountCredentialsIcon,\n WarnIcon,\n Grid,\n} from \"mds\";\nimport { NewServiceAccount } from \"./types\";\nimport ModalWrapper from \"../ModalWrapper/ModalWrapper\";\nimport CredentialItem from \"./CredentialItem\";\nimport TooltipWrapper from \"../TooltipWrapper/TooltipWrapper\";\nimport { modalStyleUtils } from \"../FormComponents/common/styleLibrary\";\n\nconst WarningBlock = styled.div(({ theme }) => ({\n color: get(theme, \"signalColors.danger\", \"#C51B3F\"),\n fontSize: \".85rem\",\n margin: \".5rem 0 .5rem 0\",\n display: \"flex\",\n alignItems: \"center\",\n \"& svg \": {\n marginRight: \".3rem\",\n height: 16,\n width: 16,\n },\n}));\n\ninterface ICredentialsPromptProps {\n newServiceAccount: NewServiceAccount | null;\n open: boolean;\n entity: string;\n closeModal: () => void;\n}\n\nconst download = (filename: string, text: string) => {\n let element = document.createElement(\"a\");\n element.setAttribute(\"href\", \"data:text/plain;charset=utf-8,\" + text);\n element.setAttribute(\"download\", filename);\n\n element.style.display = \"none\";\n document.body.appendChild(element);\n\n element.click();\n document.body.removeChild(element);\n};\n\nconst CredentialsPrompt = ({\n newServiceAccount,\n open,\n closeModal,\n entity,\n}: ICredentialsPromptProps) => {\n if (!newServiceAccount) {\n return null;\n }\n const consoleCreds = get(newServiceAccount, \"console\", null);\n const idp = get(newServiceAccount, \"idp\", false);\n\n const downloadImport = () => {\n let consoleExtras = {};\n\n if (consoleCreds) {\n if (!Array.isArray(consoleCreds)) {\n consoleExtras = {\n url: consoleCreds.url,\n accessKey: consoleCreds.accessKey,\n secretKey: consoleCreds.secretKey,\n api: \"s3v4\",\n path: \"auto\",\n };\n } else {\n const cCreds = consoleCreds.map((itemMap) => {\n return {\n url: itemMap.url,\n accessKey: itemMap.accessKey,\n secretKey: itemMap.secretKey,\n api: \"s3v4\",\n path: \"auto\",\n };\n });\n consoleExtras = cCreds[0];\n }\n } else {\n consoleExtras = {\n url: newServiceAccount.url,\n accessKey: newServiceAccount.accessKey,\n secretKey: newServiceAccount.secretKey,\n api: \"s3v4\",\n path: \"auto\",\n };\n }\n\n download(\n \"credentials.json\",\n JSON.stringify({\n ...consoleExtras,\n }),\n );\n };\n\n const downloaddAllCredentials = () => {\n let allCredentials = {};\n if (\n consoleCreds &&\n Array.isArray(consoleCreds) &&\n consoleCreds.length > 1\n ) {\n const cCreds = consoleCreds.map((itemMap) => {\n return {\n accessKey: itemMap.accessKey,\n secretKey: itemMap.secretKey,\n };\n });\n allCredentials = cCreds;\n }\n download(\n \"all_credentials.json\",\n JSON.stringify({\n ...allCredentials,\n }),\n );\n };\n\n return (\n {\n closeModal();\n }}\n title={`New ${entity} Created`}\n titleIcon={}\n >\n \n \n A new {entity} has been created with the following details:\n {!idp && consoleCreds && (\n \n \n \n Console Credentials\n \n {Array.isArray(consoleCreds) &&\n consoleCreds.map((credentialsPair, index) => {\n return (\n \n \n \n \n );\n })}\n {!Array.isArray(consoleCreds) && (\n \n \n \n \n )}\n \n \n )}\n {(consoleCreds === null || consoleCreds === undefined) && (\n <>\n \n \n \n )}\n {idp ? (\n \n Please Login via the configured external identity provider.\n \n ) : (\n \n \n \n Write these down, as this is the only time the secret will be\n displayed.\n \n \n )}\n \n \n {!idp && (\n \n \n }\n variant=\"callAction\"\n />\n \n\n {Array.isArray(consoleCreds) && consoleCreds.length > 1 && (\n \n }\n variant=\"callAction\"\n color=\"primary\"\n />\n \n )}\n \n )}\n \n \n \n );\n};\n\nexport default CredentialsPrompt;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport styled from \"styled-components\";\n\nconst PanelTitleContainer = styled.h1(() => ({\n padding: 0,\n margin: 0,\n fontSize: \".9rem\",\n}));\n\ninterface IPanelTitle {\n children: React.ReactNode;\n}\n\nconst PanelTitle = ({ children }: IPanelTitle) => {\n return {children};\n};\n\nexport default PanelTitle;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useCallback, useEffect, useState } from \"react\";\n\nimport { Box, DataTable, Grid, ProgressBar } from \"mds\";\nimport { policySort } from \"../../../utils/sortFunctions\";\nimport { ErrorResponseHandler } from \"../../../common/types\";\nimport SearchBox from \"../Common/SearchBox\";\nimport { setModalErrorSnackMessage } from \"../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../store\";\nimport { setSelectedPolicies } from \"../Users/AddUsersSlice\";\nimport { useSelector } from \"react-redux\";\nimport { api } from \"../../../api\";\n\ninterface ISelectPolicyProps {\n selectedPolicy?: string[];\n noTitle?: boolean;\n}\n\nconst PolicySelectors = ({ noTitle = false }: ISelectPolicyProps) => {\n const dispatch = useAppDispatch();\n // Local State\n const [records, setRecords] = useState([]);\n const [loading, isLoading] = useState(false);\n const [filter, setFilter] = useState(\"\");\n\n const currentPolicies = useSelector(\n (state: AppState) => state.createUser.selectedPolicies,\n );\n\n const fetchPolicies = useCallback(() => {\n isLoading(true);\n\n api.policies\n .listPolicies()\n .then((res) => {\n const policies = res.data.policies ?? [];\n isLoading(false);\n setRecords(policies.sort(policySort));\n })\n .catch((err: ErrorResponseHandler) => {\n isLoading(false);\n dispatch(setModalErrorSnackMessage(err));\n });\n }, [dispatch]);\n\n //Effects\n useEffect(() => {\n isLoading(true);\n }, []);\n\n useEffect(() => {\n if (loading) {\n fetchPolicies();\n }\n }, [loading, fetchPolicies]);\n\n const selectionChanged = (e: React.ChangeEvent) => {\n const targetD = e.target;\n const value = targetD.value;\n const checked = targetD.checked;\n\n let elements: string[] = [...currentPolicies]; // We clone the checkedUsers array\n\n if (checked) {\n // If the user has checked this field we need to push this to checkedUsersList\n elements.push(value);\n } else {\n // User has unchecked this field, we need to remove it from the list\n elements = elements.filter((element) => element !== value);\n }\n // remove empty values\n elements = elements.filter((element) => element !== \"\");\n\n dispatch(setSelectedPolicies(elements));\n };\n\n const filteredRecords = records.filter((elementItem) =>\n elementItem.name.includes(filter),\n );\n\n return (\n \n {loading && }\n {records.length > 0 ? (\n \n \n {\n setFilter(value);\n }}\n value={filter}\n label={!noTitle ? \"Assign Policies\" : \"\"}\n />\n \n\n \n \n ) : (\n \n No Policies Available\n \n )}\n \n );\n};\n\nexport default PolicySelectors;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport { setErrorSnackMessage } from \"../../../systemSlice\";\nimport { ConfirmDeleteIcon, DataTable, InformativeMessage, Loader } from \"mds\";\nimport { IAM_PAGES } from \"../../../common/SecureComponent/permissions\";\nimport ConfirmDialog from \"../Common/ModalWrapper/ConfirmDialog\";\nimport { useAppDispatch } from \"../../../store\";\nimport { api } from \"api\";\nimport { UserServiceAccountItem } from \"../../../api/consoleApi\";\nimport { errorToHandler } from \"../../../api/errors\";\n\ninterface IDeleteUserProps {\n closeDeleteModalAndRefresh: (refresh: boolean) => void;\n deleteOpen: boolean;\n selectedUsers: string[] | null;\n}\n\nconst DeleteUser = ({\n closeDeleteModalAndRefresh,\n deleteOpen,\n selectedUsers,\n}: IDeleteUserProps) => {\n const navigate = useNavigate();\n const dispatch = useAppDispatch();\n\n const onClose = () => closeDeleteModalAndRefresh(false);\n\n const [loadingSA, setLoadingSA] = useState(true);\n const [hasSA, setHasSA] = useState(false);\n const [userSAList, setUserSAList] = useState([]);\n const [deleteLoading, setDeleteLoading] = useState(false);\n\n const userLoggedIn = localStorage.getItem(\"userLoggedIn\") || \"\";\n\n useEffect(() => {\n if (selectedUsers) {\n api.users\n .checkUserServiceAccounts(selectedUsers)\n .then((res) => {\n if (res.data) {\n setUserSAList(res.data.userServiceAccountList ?? []);\n if (res.data.hasSA) {\n setHasSA(true);\n }\n }\n })\n .catch((err) =>\n dispatch(setErrorSnackMessage(errorToHandler(err.error))),\n )\n .finally(() => setLoadingSA(false));\n }\n }, [selectedUsers, dispatch]);\n\n if (!selectedUsers) {\n return null;\n }\n const renderUsers = selectedUsers.map((user) => (\n
\n {user}\n
\n ));\n const viewAction = (selectionElement: any): void => {\n navigate(\n `${IAM_PAGES.USERS}/${encodeURIComponent(selectionElement.userName)}`,\n );\n onClose();\n };\n const tableActions = [\n {\n type: \"view\",\n onClick: viewAction,\n },\n ];\n\n const onConfirmDelete = () => {\n for (let user of selectedUsers) {\n if (user === userLoggedIn) {\n dispatch(\n setErrorSnackMessage({\n errorMessage: \"Cannot delete currently logged in user\",\n detailedError: `Cannot delete currently logged in user ${userLoggedIn}`,\n }),\n );\n closeDeleteModalAndRefresh(true);\n } else {\n api.user\n .removeUser(user)\n .then((res) => {\n closeDeleteModalAndRefresh(true);\n navigate(`${IAM_PAGES.USERS}`);\n })\n .finally(() => setDeleteLoading(false));\n }\n }\n };\n\n const noSAtext =\n \"Are you sure you want to delete the following \" +\n selectedUsers.length +\n \" \" +\n \"user\" +\n (selectedUsers.length > 1 ? \"s?\" : \"?\");\n\n return (\n 1 ? \"s\" : \"\"}`}\n confirmText={\"Delete\"}\n isOpen={deleteOpen}\n titleIcon={}\n isLoading={deleteLoading}\n onConfirm={onConfirmDelete}\n onClose={onClose}\n confirmationContent={\n loadingSA ? (\n \n ) : (\n \n {hasSA ? (\n \n \n Click on a user to view the full listing of associated\n Access Keys. All Access Keys associated with a user will\n be deleted along with the user.\n
\n
\n Are you sure you want to continue?\n
\n }\n title=\"Warning: One or more users selected has associated Access Keys.\"\n sx={{ margin: \"15px 0\" }}\n />\n \n
\n ) : (\n \n {noSAtext}\n {renderUsers}\n \n )}\n \n )\n }\n />\n );\n};\n\nexport default DeleteUser;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useCallback, useEffect, useState, Fragment } from \"react\";\nimport get from \"lodash/get\";\n\nimport { Box, DataTable, Grid, ProgressBar } from \"mds\";\nimport { stringSort } from \"../../../utils/sortFunctions\";\nimport { GroupsList } from \"../Groups/types\";\nimport { ErrorResponseHandler } from \"../../../common/types\";\nimport { setModalErrorSnackMessage } from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\nimport api from \"../../../common/api\";\nimport SearchBox from \"../Common/SearchBox\";\n\ninterface IGroupsProps {\n selectedGroups: string[];\n setSelectedGroups: any;\n}\n\nconst GroupsSelectors = ({\n selectedGroups,\n setSelectedGroups,\n}: IGroupsProps) => {\n const dispatch = useAppDispatch();\n // Local State\n const [records, setRecords] = useState([]);\n const [loading, isLoading] = useState(false);\n const [filter, setFilter] = useState(\"\");\n\n const fetchGroups = useCallback(() => {\n api\n .invoke(\"GET\", `/api/v1/groups`)\n .then((res: GroupsList) => {\n let groups = get(res, \"groups\", []);\n\n if (!groups) {\n groups = [];\n }\n setRecords(groups.sort(stringSort));\n isLoading(false);\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setModalErrorSnackMessage(err));\n isLoading(false);\n });\n }, [dispatch]);\n\n //Effects\n useEffect(() => {\n isLoading(true);\n }, []);\n\n useEffect(() => {\n if (loading) {\n fetchGroups();\n }\n }, [loading, fetchGroups]);\n\n const selGroups = !selectedGroups ? [] : selectedGroups;\n\n const selectionChanged = (e: React.ChangeEvent) => {\n const targetD = e.target;\n const value = targetD.value;\n const checked = targetD.checked;\n\n let elements: string[] = [...selGroups]; // We clone the selectedGroups array\n\n if (checked) {\n // If the user has checked this field we need to push this to selectedGroupsList\n elements.push(value);\n } else {\n // User has unchecked this field, we need to remove it from the list\n elements = elements.filter((element) => element !== value);\n }\n setSelectedGroups(elements);\n\n return elements;\n };\n\n const filteredRecords = records.filter((elementItem) =>\n elementItem.includes(filter),\n );\n\n return (\n \n {loading && }\n {records !== null && records.length > 0 ? (\n \n \n \n \n \n \n ) : (\n \n No Groups Available\n \n )}\n \n );\n};\n\nexport default GroupsSelectors;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport {\n AddIcon,\n Button,\n DeleteIcon,\n GroupsIcon,\n HelpBox,\n PageLayout,\n UsersIcon,\n DataTable,\n Grid,\n ProgressBar,\n ActionLink,\n} from \"mds\";\n\nimport { User, UsersList } from \"./types\";\nimport { usersSort } from \"../../../utils/sortFunctions\";\nimport { actionsTray } from \"../Common/FormComponents/common/styleLibrary\";\nimport { ErrorResponseHandler } from \"../../../common/types\";\nimport {\n addUserToGroupPermissions,\n CONSOLE_UI_RESOURCE,\n deleteUserPermissions,\n IAM_PAGES,\n IAM_SCOPES,\n listUsersPermissions,\n permissionTooltipHelper,\n S3_ALL_RESOURCES,\n viewUserPermissions,\n} from \"../../../common/SecureComponent/permissions\";\nimport api from \"../../../common/api\";\nimport SearchBox from \"../Common/SearchBox\";\nimport withSuspense from \"../Common/Components/withSuspense\";\n\nimport {\n hasPermission,\n SecureComponent,\n} from \"../../../common/SecureComponent\";\nimport { setErrorSnackMessage, setHelpName } from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\nimport TooltipWrapper from \"../Common/TooltipWrapper/TooltipWrapper\";\nimport PageHeaderWrapper from \"../Common/PageHeaderWrapper/PageHeaderWrapper\";\nimport HelpMenu from \"../HelpMenu\";\n\nconst DeleteUser = withSuspense(React.lazy(() => import(\"./DeleteUser\")));\nconst AddToGroup = withSuspense(React.lazy(() => import(\"./BulkAddToGroup\")));\n\nconst ListUsers = () => {\n const dispatch = useAppDispatch();\n const navigate = useNavigate();\n\n const [records, setRecords] = useState([]);\n const [loading, setLoading] = useState(true);\n const [deleteOpen, setDeleteOpen] = useState(false);\n const [addGroupOpen, setAddGroupOpen] = useState(false);\n const [filter, setFilter] = useState(\"\");\n const [checkedUsers, setCheckedUsers] = useState([]);\n\n const displayListUsers = hasPermission(\n CONSOLE_UI_RESOURCE,\n listUsersPermissions,\n );\n\n const viewUser = hasPermission(CONSOLE_UI_RESOURCE, viewUserPermissions);\n\n const addUserToGroup = hasPermission(\n CONSOLE_UI_RESOURCE,\n addUserToGroupPermissions,\n );\n\n const deleteUser = hasPermission(CONSOLE_UI_RESOURCE, deleteUserPermissions);\n\n const closeDeleteModalAndRefresh = (refresh: boolean) => {\n setDeleteOpen(false);\n if (refresh) {\n setLoading(true);\n setCheckedUsers([]);\n }\n };\n\n const closeAddGroupBulk = (unCheckAll: boolean = false) => {\n setAddGroupOpen(false);\n if (unCheckAll) {\n setCheckedUsers([]);\n }\n };\n\n useEffect(() => {\n if (loading) {\n if (displayListUsers) {\n api\n .invoke(\"GET\", `/api/v1/users`)\n .then((res: UsersList) => {\n const users = res.users === null ? [] : res.users;\n\n setLoading(false);\n setRecords(users.sort(usersSort));\n })\n .catch((err: ErrorResponseHandler) => {\n setLoading(false);\n dispatch(setErrorSnackMessage(err));\n });\n } else {\n setLoading(false);\n }\n }\n }, [loading, dispatch, displayListUsers]);\n\n const filteredRecords = records.filter((elementItem) =>\n elementItem.accessKey.includes(filter),\n );\n\n const selectionChanged = (e: React.ChangeEvent) => {\n const { target: { value = \"\", checked = false } = {} } = e;\n\n let elements: string[] = [...checkedUsers]; // We clone the checkedUsers array\n\n if (checked) {\n // If the user has checked this field we need to push this to checkedUsersList\n elements.push(value);\n } else {\n // User has unchecked this field, we need to remove it from the list\n elements = elements.filter((element) => element !== value);\n }\n\n setCheckedUsers(elements);\n\n return elements;\n };\n\n const viewAction = (selectionElement: any): void => {\n navigate(\n `${IAM_PAGES.USERS}/${encodeURIComponent(selectionElement.accessKey)}`,\n );\n };\n\n const tableActions = [\n {\n type: \"view\",\n onClick: viewAction,\n disableButtonFunction: () => !viewUser,\n },\n {\n type: \"edit\",\n onClick: viewAction,\n disableButtonFunction: () => !viewUser,\n },\n ];\n\n useEffect(() => {\n dispatch(setHelpName(\"list_users\"));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n \n {deleteOpen && (\n {\n closeDeleteModalAndRefresh(refresh);\n }}\n />\n )}\n {addGroupOpen && (\n {\n closeAddGroupBulk(close);\n }}\n />\n )}\n } />\n\n \n \n \n \n \n \n {\n setDeleteOpen(true);\n }}\n label={\"Delete Selected\"}\n icon={}\n disabled={checkedUsers.length === 0}\n variant={\"secondary\"}\n aria-label=\"delete-selected-users\"\n />\n \n \n \n \n }\n disabled={checkedUsers.length <= 0}\n onClick={() => {\n if (checkedUsers.length > 0) {\n setAddGroupOpen(true);\n }\n }}\n variant={\"regular\"}\n />\n \n \n \n \n }\n onClick={() => {\n navigate(`${IAM_PAGES.USER_ADD}`);\n }}\n variant={\"callAction\"}\n disabled={\n !hasPermission(\n \"console-ui\",\n [\n IAM_SCOPES.ADMIN_CREATE_USER,\n IAM_SCOPES.ADMIN_LIST_USER_POLICIES,\n IAM_SCOPES.ADMIN_LIST_GROUPS,\n IAM_SCOPES.ADMIN_ATTACH_USER_OR_GROUP_POLICY,\n ],\n true,\n )\n }\n />\n \n \n \n\n {loading && }\n {!loading && (\n \n {records.length > 0 && (\n \n \n \n \n \n \n }\n help={\n \n A MinIO user consists of a unique access key (username)\n and corresponding secret key (password). Clients must\n authenticate their identity by specifying both a valid\n access key (username) and the corresponding secret key\n (password) of an existing MinIO user.\n
\n Groups provide a simplified method for managing shared\n permissions among users with common access patterns and\n workloads.\n
\n
\n Users inherit access permissions to data and resources\n through the groups they belong to.\n
\n MinIO uses Policy-Based Access Control (PBAC) to define\n the authorized actions and resources to which an\n authenticated user has access. Each policy describes one\n or more actions and conditions that outline the\n permissions of a user or group of users.\n
\n
\n Each user can access only those resources and operations\n which are explicitly granted by the built-in role. MinIO\n denies access to any other resource or action by\n default.\n
\n
\n You can learn more at our{\" \"}\n \n documentation\n \n .\n
\n }\n />\n
\n )}\n {records.length === 0 && (\n \n \n }\n help={\n \n A MinIO user consists of a unique access key\n (username) and corresponding secret key (password).\n Clients must authenticate their identity by specifying\n both a valid access key (username) and the\n corresponding secret key (password) of an existing\n MinIO user.\n
\n Groups provide a simplified method for managing shared\n permissions among users with common access patterns\n and workloads.\n
\n
\n Users inherit access permissions to data and resources\n through the groups they belong to.\n
\n MinIO uses Policy-Based Access Control (PBAC) to\n define the authorized actions and resources to which\n an authenticated user has access. Each policy\n describes one or more actions and conditions that\n outline the permissions of a user or group of users.\n
\n
\n Each user can access only those resources and\n operations which are explicitly granted by the\n built-in role. MinIO denies access to any other\n resource or action by default.\n \n
\n
\n To get started,{\" \"}\n {\n navigate(`${IAM_PAGES.USER_ADD}`);\n }}\n >\n Create a User\n \n .\n \n
\n }\n />\n
\n
\n )}\n
\n )}\n
\n
\n
\n );\n};\n\nexport default ListUsers;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useCallback, useEffect, useState, Fragment } from \"react\";\n\nimport {\n AddMembersToGroupIcon,\n Button,\n FormLayout,\n Grid,\n Box,\n ProgressBar,\n} from \"mds\";\nimport { modalStyleUtils } from \"../Common/FormComponents/common/styleLibrary\";\nimport { ErrorResponseHandler } from \"../../../common/types\";\nimport { setModalErrorSnackMessage } from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\nimport api from \"../../../common/api\";\nimport GroupsSelectors from \"./GroupsSelectors\";\nimport ModalWrapper from \"../Common/ModalWrapper/ModalWrapper\";\n\ninterface IChangeUserGroupsContentProps {\n closeModalAndRefresh: () => void;\n selectedUser: string;\n open: boolean;\n}\n\nconst ChangeUserGroups = ({\n closeModalAndRefresh,\n selectedUser,\n open,\n}: IChangeUserGroupsContentProps) => {\n const dispatch = useAppDispatch();\n const [addLoading, setAddLoading] = useState(false);\n const [accessKey, setAccessKey] = useState(\"\");\n const [secretKey, setSecretKey] = useState(\"\");\n const [enabled, setEnabled] = useState(false);\n const [selectedGroups, setSelectedGroups] = useState([]);\n\n const getUserInformation = useCallback(() => {\n if (!selectedUser) {\n return null;\n }\n\n api\n .invoke(\"GET\", `/api/v1/user/${encodeURIComponent(selectedUser)}`)\n .then((res) => {\n setAddLoading(false);\n setAccessKey(res.accessKey);\n setSelectedGroups(res.memberOf || []);\n setEnabled(res.status === \"enabled\");\n })\n .catch((err: ErrorResponseHandler) => {\n setAddLoading(false);\n dispatch(setModalErrorSnackMessage(err));\n });\n }, [selectedUser, dispatch]);\n\n useEffect(() => {\n if (selectedUser === null) {\n setAccessKey(\"\");\n setSecretKey(\"\");\n setSelectedGroups([]);\n } else {\n getUserInformation();\n }\n }, [selectedUser, getUserInformation]);\n\n const saveRecord = (event: React.FormEvent) => {\n event.preventDefault();\n\n if (addLoading) {\n return;\n }\n setAddLoading(true);\n if (selectedUser !== null) {\n api\n .invoke(\"PUT\", `/api/v1/user/${encodeURIComponent(selectedUser)}`, {\n status: enabled ? \"enabled\" : \"disabled\",\n groups: selectedGroups,\n })\n .then((_) => {\n setAddLoading(false);\n closeModalAndRefresh();\n })\n .catch((err: ErrorResponseHandler) => {\n setAddLoading(false);\n dispatch(setModalErrorSnackMessage(err));\n });\n } else {\n api\n .invoke(\"POST\", \"/api/v1/users\", {\n accessKey,\n secretKey,\n groups: selectedGroups,\n })\n .then((_) => {\n setAddLoading(false);\n closeModalAndRefresh();\n })\n .catch((err: ErrorResponseHandler) => {\n setAddLoading(false);\n dispatch(setModalErrorSnackMessage(err));\n });\n }\n };\n\n const resetForm = () => {\n if (selectedUser !== null) {\n setSelectedGroups([]);\n return;\n }\n setAccessKey(\"\");\n setSecretKey(\"\");\n setSelectedGroups([]);\n };\n\n const sendEnabled =\n accessKey.trim() !== \"\" &&\n ((secretKey.trim() !== \"\" && selectedUser === null) ||\n selectedUser !== null);\n return (\n {\n closeModalAndRefresh();\n }}\n modalOpen={open}\n title={\"Set Groups\"}\n titleIcon={}\n >\n \n ) => {\n saveRecord(e);\n }}\n >\n \n {\n setSelectedGroups(elements);\n }}\n />\n \n \n \n\n \n \n {addLoading && (\n \n \n \n )}\n \n \n \n );\n};\n\nexport default ChangeUserGroups;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState } from \"react\";\nimport {\n Box,\n Button,\n FormLayout,\n IAMPoliciesIcon,\n ProgressBar,\n Grid,\n} from \"mds\";\nimport { useSelector } from \"react-redux\";\nimport { modalStyleUtils } from \"../Common/FormComponents/common/styleLibrary\";\nimport { IPolicyItem } from \"../Users/types\";\nimport { ErrorResponseHandler } from \"../../../common/types\";\nimport { setModalErrorSnackMessage } from \"../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../store\";\nimport { setSelectedPolicies } from \"./AddUsersSlice\";\nimport ModalWrapper from \"../Common/ModalWrapper/ModalWrapper\";\nimport api from \"../../../common/api\";\nimport PolicySelectors from \"../Policies/PolicySelectors\";\n\ninterface ISetUserPoliciesProps {\n closeModalAndRefresh: () => void;\n selectedUser: string;\n currentPolicies: IPolicyItem[];\n open: boolean;\n}\n\nconst SetUserPolicies = ({\n closeModalAndRefresh,\n selectedUser,\n currentPolicies,\n open,\n}: ISetUserPoliciesProps) => {\n const dispatch = useAppDispatch();\n //Local States\n const [loading, setLoading] = useState(false);\n const [actualPolicy, setActualPolicy] = useState([]);\n\n const statePolicies = useSelector(\n (state: AppState) => state.createUser.selectedPolicies,\n );\n\n const SetUserPoliciesAction = () => {\n let entity = \"user\";\n let value = selectedUser;\n\n setLoading(true);\n\n api\n .invoke(\"PUT\", `/api/v1/set-policy`, {\n name: statePolicies,\n entityName: value,\n entityType: entity,\n })\n .then(() => {\n setLoading(false);\n dispatch(setSelectedPolicies([]));\n closeModalAndRefresh();\n })\n .catch((err: ErrorResponseHandler) => {\n setLoading(false);\n dispatch(setModalErrorSnackMessage(err));\n });\n };\n\n const resetSelection = () => {\n dispatch(setSelectedPolicies(actualPolicy));\n };\n\n useEffect(() => {\n if (open) {\n const userPolicy: string[] = currentPolicies.map((pol) => {\n return pol.policy;\n });\n setActualPolicy(userPolicy);\n dispatch(setSelectedPolicies(userPolicy));\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, selectedUser]);\n\n return (\n {\n closeModalAndRefresh();\n }}\n modalOpen={open}\n title=\"Set Policies\"\n titleIcon={}\n >\n \n \n \n \n \n \n \n {loading && (\n \n \n \n )}\n \n );\n};\n\nexport default SetUserPolicies;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport { AddIcon, Box, Button, DataTable, DeleteIcon, SectionTitle } from \"mds\";\nimport api from \"../../../common/api\";\nimport { NewServiceAccount } from \"../Common/CredentialsPrompt/types\";\nimport { ErrorResponseHandler } from \"../../../common/types\";\nimport DeleteServiceAccount from \"../Account/DeleteServiceAccount\";\nimport CredentialsPrompt from \"../Common/CredentialsPrompt/CredentialsPrompt\";\n\nimport DeleteMultipleServiceAccounts from \"./DeleteMultipleServiceAccounts\";\nimport { selectSAs } from \"../Configurations/utils\";\nimport EditServiceAccount from \"../Account/EditServiceAccount\";\nimport {\n CONSOLE_UI_RESOURCE,\n IAM_SCOPES,\n} from \"../../../common/SecureComponent/permissions\";\nimport { SecureComponent } from \"../../../common/SecureComponent\";\nimport {\n setErrorSnackMessage,\n setHelpName,\n setSnackBarMessage,\n} from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\nimport TooltipWrapper from \"../Common/TooltipWrapper/TooltipWrapper\";\nimport { ServiceAccounts } from \"../../../api/consoleApi\";\nimport { usersSort } from \"../../../utils/sortFunctions\";\nimport { ACCOUNT_TABLE_COLUMNS } from \"../Account/AccountUtils\";\n\ninterface IUserServiceAccountsProps {\n user: string;\n hasPolicy: boolean;\n}\n\nconst UserServiceAccountsPanel = ({\n user,\n hasPolicy,\n}: IUserServiceAccountsProps) => {\n const dispatch = useAppDispatch();\n const navigate = useNavigate();\n\n const [records, setRecords] = useState([]);\n const [loading, setLoading] = useState(false);\n const [deleteOpen, setDeleteOpen] = useState(false);\n const [selectedServiceAccount, setSelectedServiceAccount] = useState<\n string | null\n >(null);\n const [showNewCredentials, setShowNewCredentials] = useState(false);\n const [newServiceAccount, setNewServiceAccount] =\n useState(null);\n const [selectedSAs, setSelectedSAs] = useState([]);\n const [deleteMultipleOpen, setDeleteMultipleOpen] = useState(false);\n const [editOpen, setEditOpen] = useState(false);\n\n useEffect(() => {\n fetchRecords();\n }, []);\n\n useEffect(() => {\n if (loading) {\n api\n .invoke(\n \"GET\",\n `/api/v1/user/${encodeURIComponent(user)}/service-accounts`,\n )\n .then((res: ServiceAccounts) => {\n setLoading(false);\n const sortedRows = res.sort(usersSort);\n setRecords(sortedRows);\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(err));\n setLoading(false);\n });\n }\n }, [loading, setLoading, setRecords, user, dispatch]);\n\n const fetchRecords = () => {\n setLoading(true);\n };\n\n const closeDeleteModalAndRefresh = (refresh: boolean) => {\n setDeleteOpen(false);\n\n if (refresh) {\n fetchRecords();\n }\n };\n\n const closeDeleteMultipleModalAndRefresh = (refresh: boolean) => {\n setDeleteMultipleOpen(false);\n if (refresh) {\n dispatch(setSnackBarMessage(`Access Keys deleted successfully.`));\n setSelectedSAs([]);\n setLoading(true);\n }\n };\n\n const closeCredentialsModal = () => {\n setShowNewCredentials(false);\n setNewServiceAccount(null);\n };\n\n const editModalOpen = (selectedServiceAccount: string) => {\n setSelectedServiceAccount(selectedServiceAccount);\n setEditOpen(true);\n };\n\n const confirmDeleteServiceAccount = (selectedServiceAccount: string) => {\n setSelectedServiceAccount(selectedServiceAccount);\n setDeleteOpen(true);\n };\n\n const closePolicyModal = () => {\n setEditOpen(false);\n setLoading(true);\n };\n\n const tableActions = [\n {\n type: \"view\",\n onClick: (value: any) => {\n if (value) {\n editModalOpen(value.accessKey);\n }\n },\n },\n {\n type: \"delete\",\n onClick: (value: any) => {\n if (value) {\n confirmDeleteServiceAccount(value.accessKey);\n }\n },\n },\n {\n type: \"edit\",\n onClick: (value: any) => {\n if (value) {\n editModalOpen(value.accessKey);\n }\n },\n },\n ];\n\n useEffect(() => {\n dispatch(setHelpName(\"user_details_accounts\"));\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n return (\n \n {deleteOpen && (\n {\n closeDeleteModalAndRefresh(refresh);\n }}\n />\n )}\n {deleteMultipleOpen && (\n \n )}\n {showNewCredentials && (\n {\n closeCredentialsModal();\n }}\n entity=\"Access Key\"\n />\n )}\n {editOpen && (\n \n )}\n\n \n \n {\n setDeleteMultipleOpen(true);\n }}\n label={\"Delete Selected\"}\n icon={}\n disabled={selectedSAs.length === 0}\n variant={\"secondary\"}\n />\n \n \n \n }\n onClick={() => {\n navigate(\n `/identity/users/new-user-sa/${encodeURIComponent(user)}`,\n );\n }}\n disabled={!hasPolicy}\n />\n \n \n \n }\n >\n Access Keys\n \n\n selectSAs(e, setSelectedSAs, selectedSAs)}\n selectedItems={selectedSAs}\n isLoading={loading}\n records={records}\n idField=\"accessKey\"\n />\n \n );\n};\n\nexport default UserServiceAccountsPanel;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useState } from \"react\";\nimport {\n Box,\n Button,\n ChangePasswordIcon,\n FormLayout,\n InputBox,\n ProgressBar,\n} from \"mds\";\nimport { modalStyleUtils } from \"../Common/FormComponents/common/styleLibrary\";\nimport {\n setErrorSnackMessage,\n setModalErrorSnackMessage,\n setSnackBarMessage,\n} from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\nimport { api } from \"api\";\nimport { ApiError, ChangeUserPasswordRequest } from \"api/consoleApi\";\nimport { errorToHandler } from \"api/errors\";\nimport ModalWrapper from \"../Common/ModalWrapper/ModalWrapper\";\n\ninterface IChangeUserPasswordProps {\n open: boolean;\n userName: string;\n closeModal: () => void;\n}\n\nconst ChangeUserPassword = ({\n open,\n userName,\n closeModal,\n}: IChangeUserPasswordProps) => {\n const dispatch = useAppDispatch();\n const [newPassword, setNewPassword] = useState(\"\");\n const [reNewPassword, setReNewPassword] = useState(\"\");\n const [loading, setLoading] = useState(false);\n\n const changeUserPassword = (event: React.FormEvent) => {\n event.preventDefault();\n\n if (loading) {\n return;\n }\n setLoading(true);\n\n if (newPassword.length < 8) {\n dispatch(\n setModalErrorSnackMessage({\n errorMessage: \"Passwords must be at least 8 characters long\",\n detailedError: \"\",\n }),\n );\n setLoading(false);\n return;\n }\n\n let request: ChangeUserPasswordRequest = {\n selectedUser: userName,\n newSecretKey: newPassword,\n };\n\n api.account\n .changeUserPassword(request)\n .then((res) => {\n setLoading(false);\n setNewPassword(\"\");\n setReNewPassword(\"\");\n dispatch(\n setSnackBarMessage(\n `Successfully updated the password for the user ${userName}.`,\n ),\n );\n closeModal();\n })\n .catch(async (res) => {\n setLoading(false);\n setNewPassword(\"\");\n setReNewPassword(\"\");\n const err = (await res.json()) as ApiError;\n dispatch(setErrorSnackMessage(errorToHandler(err)));\n });\n };\n\n return open ? (\n {\n setNewPassword(\"\");\n setReNewPassword(\"\");\n closeModal();\n }}\n titleIcon={}\n >\n ) => {\n changeUserPassword(e);\n }}\n >\n \n \n Change password for: {userName}\n \n ) => {\n setNewPassword(event.target.value);\n }}\n label=\"New Password\"\n type=\"password\"\n value={newPassword}\n />\n ) => {\n setReNewPassword(event.target.value);\n }}\n label=\"Type New Password Again\"\n type=\"password\"\n value={reNewPassword}\n />\n \n 0 && newPassword === reNewPassword)\n }\n label={\"Save\"}\n />\n \n {loading && (\n \n \n \n )}\n \n \n \n ) : null;\n};\n\nexport default ChangeUserPassword;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useCallback, useEffect, useState } from \"react\";\nimport { useNavigate, useParams } from \"react-router-dom\";\nimport {\n AddIcon,\n BackLink,\n Box,\n Button,\n DataTable,\n Grid,\n IAMPoliciesIcon,\n PageLayout,\n PasswordKeyIcon,\n ScreenTitle,\n SectionTitle,\n Switch,\n Tabs,\n TrashIcon,\n UsersIcon,\n} from \"mds\";\nimport { IPolicyItem } from \"./types\";\nimport { ErrorResponseHandler } from \"../../../common/types\";\nimport { setHelpName, setModalErrorSnackMessage } from \"../../../systemSlice\";\nimport {\n assignGroupPermissions,\n assignIAMPolicyPermissions,\n CONSOLE_UI_RESOURCE,\n deleteUserPermissions,\n disableUserPermissions,\n editServiceAccountPermissions,\n enableDisableUserPermissions,\n enableUserPermissions,\n getGroupPermissions,\n IAM_PAGES,\n permissionTooltipHelper,\n} from \"../../../common/SecureComponent/permissions\";\nimport { hasPermission } from \"../../../common/SecureComponent\";\nimport { useAppDispatch } from \"../../../store\";\nimport { policyDetailsSort } from \"../../../utils/sortFunctions\";\nimport TooltipWrapper from \"../Common/TooltipWrapper/TooltipWrapper\";\nimport PageHeaderWrapper from \"../Common/PageHeaderWrapper/PageHeaderWrapper\";\nimport HelpMenu from \"../HelpMenu\";\nimport api from \"../../../common/api\";\nimport ChangeUserGroups from \"./ChangeUserGroups\";\nimport SetUserPolicies from \"./SetUserPolicies\";\nimport UserServiceAccountsPanel from \"./UserServiceAccountsPanel\";\nimport ChangeUserPasswordModal from \"../Account/ChangeUserPasswordModal\";\nimport DeleteUser from \"./DeleteUser\";\n\ninterface IGroupItem {\n group: string;\n}\n\nconst UserDetails = () => {\n const dispatch = useAppDispatch();\n const params = useParams();\n const navigate = useNavigate();\n\n const [loading, setLoading] = useState(false);\n const [addGroupOpen, setAddGroupOpen] = useState(false);\n const [policyOpen, setPolicyOpen] = useState(false);\n const [addLoading, setAddLoading] = useState(false);\n const [enabled, setEnabled] = useState(false);\n const [selectedGroups, setSelectedGroups] = useState([]);\n const [currentGroups, setCurrentGroups] = useState([]);\n const [currentPolicies, setCurrentPolicies] = useState([]);\n const [changeUserPasswordModalOpen, setChangeUserPasswordModalOpen] =\n useState(false);\n const [deleteOpen, setDeleteOpen] = useState(false);\n const [hasPolicy, setHasPolicy] = useState(false);\n const [selectedTab, setSelectedTab] = useState(\"groups\");\n\n const enableEnabled =\n hasPermission(CONSOLE_UI_RESOURCE, enableUserPermissions) && !enabled;\n const disableEnabled =\n hasPermission(CONSOLE_UI_RESOURCE, disableUserPermissions) && enabled;\n\n const userName = params.userName || \"\";\n\n const changeUserPassword = () => {\n setChangeUserPasswordModalOpen(true);\n };\n\n const deleteUser = () => {\n setDeleteOpen(true);\n };\n\n const userLoggedIn = localStorage.getItem(\"userLoggedIn\") || \"\";\n const canAssignPolicy = hasPermission(\n CONSOLE_UI_RESOURCE,\n assignIAMPolicyPermissions,\n true,\n );\n const canAssignGroup = hasPermission(\n CONSOLE_UI_RESOURCE,\n assignGroupPermissions,\n true,\n );\n\n const viewGroup = hasPermission(CONSOLE_UI_RESOURCE, getGroupPermissions);\n\n const getUserInformation = useCallback(() => {\n if (userName === \"\") {\n return null;\n }\n setLoading(true);\n api\n .invoke(\"GET\", `/api/v1/user/${encodeURIComponent(userName)}`)\n .then((res) => {\n setAddLoading(false);\n const memberOf = res.memberOf || [];\n setSelectedGroups(memberOf);\n\n const currentGroups: IGroupItem[] = memberOf.map((group: string) => {\n return {\n group: group,\n };\n });\n\n setCurrentGroups(currentGroups);\n const currentPolicies: IPolicyItem[] = res.policy.map(\n (policy: string) => {\n return {\n policy: policy,\n };\n },\n );\n\n currentPolicies.sort(policyDetailsSort);\n\n setCurrentPolicies(currentPolicies);\n setEnabled(res.status === \"enabled\");\n setHasPolicy(res.hasPolicy);\n setLoading(false);\n })\n .catch((err: ErrorResponseHandler) => {\n setAddLoading(false);\n setLoading(false);\n dispatch(setModalErrorSnackMessage(err));\n });\n }, [userName, dispatch]);\n\n const saveRecord = (isEnabled: boolean) => {\n if (addLoading) {\n return;\n }\n setAddLoading(true);\n api\n .invoke(\"PUT\", `/api/v1/user/${encodeURIComponent(userName)}`, {\n status: isEnabled ? \"enabled\" : \"disabled\",\n groups: selectedGroups,\n })\n .then((_) => {\n setAddLoading(false);\n })\n .catch((err: ErrorResponseHandler) => {\n setAddLoading(false);\n dispatch(setModalErrorSnackMessage(err));\n });\n };\n\n useEffect(() => {\n dispatch(setHelpName(\"user_details_groups\"));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n getUserInformation();\n }, [getUserInformation]);\n\n const closeDeleteModalAndRefresh = (refresh: boolean) => {\n setDeleteOpen(false);\n if (refresh) {\n getUserInformation();\n }\n };\n\n const groupViewAction = (group: any) => {\n navigate(`${IAM_PAGES.GROUPS}/${encodeURIComponent(group.group)}`);\n };\n\n const groupTableActions = [\n {\n type: \"view\",\n onClick: groupViewAction,\n disableButtonFunction: () => !viewGroup,\n },\n ];\n\n return (\n \n {addGroupOpen && (\n {\n setAddGroupOpen(false);\n getUserInformation();\n }}\n />\n )}\n {policyOpen && (\n {\n setPolicyOpen(false);\n getUserInformation();\n }}\n />\n )}\n {deleteOpen && (\n {\n closeDeleteModalAndRefresh(refresh);\n }}\n />\n )}\n {changeUserPasswordModalOpen && (\n setChangeUserPasswordModalOpen(false)}\n />\n )}\n \n navigate(IAM_PAGES.USERS)}\n />\n \n }\n actions={}\n />\n \n \n \n }\n title={userName}\n subTitle={\"\"}\n actions={\n \n \n User Status:\n \n \n {enabled ? \"Enabled\" : \"Disabled\"}\n \n \n {\n setEnabled(!enabled);\n saveRecord(!enabled);\n }}\n switchOnly\n disabled={!enableEnabled && !disableEnabled}\n />\n \n \n }\n variant={\"secondary\"}\n disabled={\n !hasPermission(\n CONSOLE_UI_RESOURCE,\n deleteUserPermissions,\n ) || userLoggedIn === userName\n }\n />\n \n\n \n }\n variant={\"regular\"}\n disabled={userLoggedIn === userName}\n />\n \n \n }\n sx={{ marginBottom: 15 }}\n />\n \n\n \n \n \n dispatch(setHelpName(\"user_details_groups\"))\n }\n >\n \n {\n setAddGroupOpen(true);\n }}\n icon={}\n variant={\"callAction\"}\n disabled={!canAssignGroup}\n />\n \n }\n >\n Groups\n \n \n \n dispatch(setHelpName(\"user_details_groups\"))\n }\n >\n \n \n \n ),\n },\n {\n tabConfig: {\n id: \"service_accounts\",\n label: \"Service Accounts\",\n disabled: !hasPermission(\n CONSOLE_UI_RESOURCE,\n editServiceAccountPermissions,\n ),\n },\n content: (\n \n ),\n },\n {\n tabConfig: {\n id: \"policies\",\n label: \"Policies\",\n disabled: !canAssignPolicy,\n },\n content: (\n \n \n dispatch(setHelpName(\"user_details_policies\"))\n }\n >\n \n {\n setPolicyOpen(true);\n }}\n icon={}\n variant={\"callAction\"}\n disabled={!canAssignPolicy}\n />\n \n }\n >\n Policies\n \n \n \n {\n navigate(\n `${IAM_PAGES.POLICIES}/${encodeURIComponent(\n policy.policy,\n )}`,\n );\n },\n },\n ]}\n columns={[{ label: \"Name\", elementKey: \"policy\" }]}\n isLoading={loading}\n records={currentPolicies}\n entityName=\"Policies\"\n idField=\"policy\"\n />\n \n \n ),\n },\n ]}\n />\n \n \n \n \n );\n};\n\nexport default UserDetails;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\nimport React from \"react\";\n\nimport {\n Box,\n ChangeAccessPolicyIcon,\n GroupsIcon,\n HelpIconFilled,\n UsersIcon,\n} from \"mds\";\n\nconst FeatureItem = ({\n icon,\n description,\n}: {\n icon: any;\n description: string;\n}) => {\n return (\n \n {icon}{\" \"}\n
\n {description}\n
\n \n );\n};\nconst AddUserHelpBox = () => {\n return (\n \n \n \n
Learn more about the Users feature
\n \n \n A MinIO user consists of a unique access key (username) and\n corresponding secret key (password). Clients must authenticate their\n identity by specifying both a valid access key (username) and the\n corresponding secret key (password) of an existing MinIO user.\n
\n
\n Each user can have one or more assigned policies that explicitly list\n the actions and resources to which that user has access. Users can also\n inherit policies from the groups in which they have membership.\n
\n
\n\n \n } description={`Create Users`} />\n } description={`Manage Groups`} />\n }\n description={`Assign Policies`}\n />\n \n \n );\n};\n\nexport default AddUserHelpBox;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { setUserName } from \"./AddUsersSlice\";\nimport { useSelector } from \"react-redux\";\nimport { AppState, useAppDispatch } from \"../../../store\";\nimport { InputBox } from \"mds\";\n\nconst UserSelector = () => {\n const dispatch = useAppDispatch();\n const userName = useSelector((state: AppState) => state.createUser.userName);\n return (\n ) => {\n dispatch(setUserName(e.target.value));\n }}\n />\n );\n};\nexport default UserSelector;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { InputBox } from \"mds\";\nimport { setSecretKey } from \"./AddUsersSlice\";\nimport { useSelector } from \"react-redux\";\nimport { AppState, useAppDispatch } from \"../../../store\";\n\nconst PasswordSelector = () => {\n const dispatch = useAppDispatch();\n const secretKey = useSelector(\n (state: AppState) => state.createUser.secretKey,\n );\n\n return (\n ) => {\n dispatch(setSecretKey(e.target.value));\n }}\n autoComplete=\"current-password\"\n />\n );\n};\nexport default PasswordSelector;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect } from \"react\";\nimport {\n BackLink,\n Button,\n CreateUserIcon,\n FormLayout,\n Grid,\n PageLayout,\n ProgressBar,\n} from \"mds\";\nimport { createUserAsync, resetFormAsync } from \"./thunk/AddUsersThunk\";\nimport { modalStyleUtils } from \"../Common/FormComponents/common/styleLibrary\";\n\nimport { IAM_PAGES } from \"../../../common/SecureComponent/permissions\";\nimport { useNavigate } from \"react-router-dom\";\nimport { setErrorSnackMessage, setHelpName } from \"../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../store\";\nimport { useSelector } from \"react-redux\";\nimport {\n setAddLoading,\n setSelectedGroups,\n setSendEnabled,\n} from \"./AddUsersSlice\";\nimport AddUserHelpBox from \"./AddUserHelpBox\";\nimport PageHeaderWrapper from \"../Common/PageHeaderWrapper/PageHeaderWrapper\";\nimport HelpMenu from \"../HelpMenu\";\nimport PolicySelectors from \"../Policies/PolicySelectors\";\nimport UserSelector from \"./UserSelector\";\nimport PasswordSelector from \"./PasswordSelector\";\nimport GroupsSelectors from \"./GroupsSelectors\";\n\nconst AddUser = () => {\n const dispatch = useAppDispatch();\n const selectedPolicies = useSelector(\n (state: AppState) => state.createUser.selectedPolicies,\n );\n const selectedGroups = useSelector(\n (state: AppState) => state.createUser.selectedGroups,\n );\n const addLoading = useSelector(\n (state: AppState) => state.createUser.addLoading,\n );\n const sendEnabled = useSelector(\n (state: AppState) => state.createUser.sendEnabled,\n );\n const secretKeylength = useSelector(\n (state: AppState) => state.createUser.secretKeylength,\n );\n const navigate = useNavigate();\n dispatch(setSendEnabled());\n\n const saveRecord = (event: React.FormEvent) => {\n event.preventDefault();\n if (secretKeylength < 8) {\n dispatch(\n setErrorSnackMessage({\n errorMessage: \"Passwords must be at least 8 characters long\",\n detailedError: \"\",\n }),\n );\n dispatch(setAddLoading(false));\n return;\n }\n if (addLoading) {\n return;\n }\n dispatch(setAddLoading(true));\n dispatch(createUserAsync())\n .unwrap() // <-- async Thunk returns a promise, that can be 'unwrapped')\n .then(() => navigate(`${IAM_PAGES.USERS}`));\n };\n\n useEffect(() => {\n dispatch(setHelpName(\"add_user\"));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n \n \n navigate(IAM_PAGES.USERS)}\n />\n }\n actions={}\n />\n \n }\n helpBox={}\n >\n ) => {\n saveRecord(e);\n }}\n >\n \n \n \n {\n dispatch(setSelectedGroups(elements));\n }}\n />\n {addLoading && (\n \n \n \n )}\n\n \n {\n dispatch(resetFormAsync());\n }}\n label={\"Clear\"}\n />\n\n \n \n \n \n \n \n \n );\n};\n\nexport default AddUser;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\nimport React from \"react\";\nimport {\n Box,\n HelpIconFilled,\n IAMPoliciesIcon,\n PasswordKeyIcon,\n ServiceAccountIcon,\n} from \"mds\";\n\nconst FeatureItem = ({\n icon,\n description,\n}: {\n icon: any;\n description: string;\n}) => {\n return (\n \n {icon}{\" \"}\n
\n {description}\n
\n \n );\n};\nconst AddUserServiceAccountHelpBox = () => {\n return (\n \n \n \n
Learn more about Access Keys
\n \n \n \n }\n description={`Create Access Keys`}\n />\n \n Access Keys inherit the policies explicitly attached to the parent\n user, and the policies attached to each group in which the parent\n user has membership.\n \n \n \n }\n description={`Assign Custom Credentials`}\n />\n \n Randomized access credentials are recommended, and provided by\n default. You may use your own custom Access Key and Secret Key by\n replacing the default values. After creation of any Access Key, you\n will be given the opportunity to view and download the account\n credentials.\n \n \n Access Keys support programmatic access by applications. You cannot\n use a Access Key to log into the MinIO Console.\n \n \n \n }\n description={`Assign Access Policies`}\n />\n \n You can specify an optional JSON-formatted IAM policy to further\n restrict Access Key access to a subset of the actions and resources\n explicitly allowed for the parent user. Additional access beyond\n that of the parent user cannot be implemented through these\n policies.\n \n \n You cannot modify the optional Access Key IAM policy after saving.\n \n \n \n \n \n );\n};\n\nexport default AddUserServiceAccountHelpBox;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useNavigate, useParams } from \"react-router-dom\";\nimport {\n BackLink,\n Box,\n Button,\n FormLayout,\n Grid,\n InputBox,\n PageLayout,\n PasswordKeyIcon,\n ServiceAccountCredentialsIcon,\n ServiceAccountIcon,\n Switch,\n HelpTip,\n DateTimeInput,\n} from \"mds\";\nimport { modalStyleUtils } from \"../Common/FormComponents/common/styleLibrary\";\nimport { NewServiceAccount } from \"../Common/CredentialsPrompt/types\";\nimport { IAM_PAGES } from \"../../../common/SecureComponent/permissions\";\nimport { ErrorResponseHandler } from \"../../../common/types\";\nimport { getRandomString } from \"../../../common/utils\";\nimport { setErrorSnackMessage, setHelpName } from \"../../../systemSlice\";\nimport { useAppDispatch } from \"../../../store\";\nimport CodeMirrorWrapper from \"../Common/FormComponents/CodeMirrorWrapper/CodeMirrorWrapper\";\nimport api from \"../../../../src/common/api\";\nimport CredentialsPrompt from \"../Common/CredentialsPrompt/CredentialsPrompt\";\nimport AddUserServiceAccountHelpBox from \"./AddUserServiceAccountHelpBox\";\nimport PageHeaderWrapper from \"../Common/PageHeaderWrapper/PageHeaderWrapper\";\nimport HelpMenu from \"../HelpMenu\";\nimport PanelTitle from \"../Common/PanelTitle/PanelTitle\";\n\nconst AddServiceAccount = () => {\n const dispatch = useAppDispatch();\n const params = useParams();\n const navigate = useNavigate();\n\n const [addSending, setAddSending] = useState(false);\n const [accessKey, setAccessKey] = useState(getRandomString(20));\n const [secretKey, setSecretKey] = useState(getRandomString(40));\n const [isRestrictedByPolicy, setIsRestrictedByPolicy] =\n useState(false);\n const [newServiceAccount, setNewServiceAccount] =\n useState(null);\n const [policyJSON, setPolicyJSON] = useState(\"\");\n\n const userName = params.userName || \"\";\n\n const [name, setName] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [comments, setComments] = useState(\"\");\n const [expiry, setExpiry] = useState();\n\n useEffect(() => {\n if (addSending) {\n const expiryDt = expiry ? expiry.toJSDate().toISOString() : null;\n api\n .invoke(\n \"POST\",\n `/api/v1/user/${encodeURIComponent(\n userName,\n )}/service-account-credentials`,\n {\n policy: policyJSON,\n accessKey: accessKey,\n secretKey: secretKey,\n description: description,\n comment: comments,\n name: name,\n expiry: expiryDt,\n },\n )\n .then((res) => {\n setAddSending(false);\n setNewServiceAccount({\n accessKey: res.accessKey || \"\",\n secretKey: res.secretKey || \"\",\n url: res.url || \"\",\n });\n })\n .catch((err: ErrorResponseHandler) => {\n setAddSending(false);\n dispatch(setErrorSnackMessage(err));\n });\n }\n }, [\n addSending,\n setAddSending,\n dispatch,\n policyJSON,\n userName,\n accessKey,\n secretKey,\n name,\n description,\n expiry,\n comments,\n ]);\n\n useEffect(() => {\n if (isRestrictedByPolicy) {\n api\n .invoke(\"GET\", `/api/v1/user/${encodeURIComponent(userName)}/policies`)\n\n .then((res) => {\n setPolicyJSON(JSON.stringify(JSON.parse(res.policy), null, 4));\n })\n .catch((err: ErrorResponseHandler) => {\n setErrorSnackMessage(err);\n });\n }\n }, [isRestrictedByPolicy, userName]);\n\n const addUserServiceAccount = (e: React.FormEvent) => {\n e.preventDefault();\n setAddSending(true);\n };\n\n const resetForm = () => {\n setNewServiceAccount(null);\n setAccessKey(\"\");\n setSecretKey(\"\");\n };\n\n const closeCredentialsModal = () => {\n setNewServiceAccount(null);\n navigate(`${IAM_PAGES.USERS}/${encodeURIComponent(userName)}`);\n };\n\n useEffect(() => {\n dispatch(setHelpName(\"add_user_SA\"));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n \n {newServiceAccount && (\n {\n closeCredentialsModal();\n }}\n entity=\"Access Key\"\n />\n )}\n \n \n navigate(`${IAM_PAGES.USERS}/${encodeURIComponent(userName)}`)\n }\n label={\"User Details - \" + userName}\n />\n }\n actions={}\n />\n \n }\n icon={}\n title={`Create Access Key for ${userName}`}\n >\n ) => {\n e.preventDefault();\n addUserServiceAccount(e);\n }}\n >\n {\n setAccessKey(e.target.value);\n }}\n startIcon={}\n />\n {\n setSecretKey(e.target.value);\n }}\n startIcon={}\n />\n\n ) => {\n setIsRestrictedByPolicy(event.target.checked);\n }}\n label={\"Restrict beyond user policy\"}\n description={\n \"You can specify an optional JSON-formatted IAM policy to further restrict Access Key access to a subset of the actions and resources explicitly allowed for the parent user. Additional access beyond that of the parent user cannot be implemented through these policies.\"\n }\n />\n {isRestrictedByPolicy && (\n \n \n \n \n Guide to access policy structure\n \n \n }\n placement=\"right\"\n >\n \n Current User Policy - edit the JSON to remove\n permissions for this Access Key\n \n \n \n \n {\n setPolicyJSON(value);\n }}\n editorHeight={\"350px\"}\n helptip={\n \n \n Guide to access policy structure\n \n \n }\n />\n \n \n )}\n\n \n {\n setExpiry(e);\n }}\n id=\"expiryTime\"\n label={\"Expiry\"}\n timeFormat={\"24h\"}\n secondsSelector={false}\n />\n \n\n {\n setName(e.target.value);\n }}\n />\n {\n setDescription(e.target.value);\n }}\n />\n {\n setComments(e.target.value);\n }}\n />\n \n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default AddServiceAccount;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Route, Routes } from \"react-router-dom\";\nimport NotFoundPage from \"../../NotFoundPage\";\nimport ListUsers from \"./ListUsers\";\nimport UserDetails from \"./UserDetails\";\nimport AddUserScreen from \"./AddUserScreen\";\nimport AddUserServiceAccountScreen from \"./AddUserServiceAccountScreen\";\n\nconst Users = () => {\n return (\n \n } />\n } />\n }\n />\n } />\n } />\n \n );\n};\n\nexport default Users;\n"],"names":["_ref","closeDeleteModalAndRefresh","deleteOpen","selectedServiceAccount","dispatch","useAppDispatch","loadingDelete","setLoadingDelete","useState","_jsx","ConfirmDialog","title","confirmText","isOpen","titleIcon","ConfirmDeleteIcon","isLoading","onConfirm","onConfirmDelete","api","serviceAccounts","deleteServiceAccount","then","_","catch","async","err","res","json","setErrorSnackMessage","errorToHandler","finally","onClose","confirmationContent","_jsxs","Fragment","children","style","maxWidth","whiteSpace","wordWrap","label","value","Box","sx","marginTop","InputLabel","ReadBox","actionButton","CopyToClipboard","text","Button","id","variant","onClick","setModalSnackMessage","marginRight","width","height","padding","icon","CopyIcon","WarningBlock","styled","div","theme","color","get","fontSize","margin","display","alignItems","download","filename","element","document","createElement","setAttribute","body","appendChild","click","removeChild","_ref2","newServiceAccount","open","closeModal","entity","consoleCreds","idp","ModalWrapper","modalOpen","ServiceAccountCredentialsIcon","Grid","container","item","xs","overflowY","maxHeight","fontWeight","Array","isArray","map","credentialsPair","index","CredentialItem","accessKey","secretKey","undefined","_Fragment","WarnIcon","modalStyleUtils","modalButtonBar","TooltipWrapper","tooltip","downloadImport","consoleExtras","itemMap","url","path","JSON","stringify","DownloadIcon","length","downloaddAllCredentials","allCredentials","PanelTitleContainer","h1","noTitle","records","setRecords","loading","filter","setFilter","currentPolicies","useSelector","state","createUser","selectedPolicies","fetchPolicies","useCallback","policies","listPolicies","_res$data$policies","data","sort","policySort","setModalErrorSnackMessage","useEffect","filteredRecords","elementItem","name","includes","className","ProgressBar","SearchBox","placeholder","onChange","DataTable","columns","elementKey","onSelect","e","targetD","target","checked","elements","push","setSelectedPolicies","selectedItems","entityName","idField","customPaperHeight","textAlign","selectedUsers","navigate","useNavigate","loadingSA","setLoadingSA","hasSA","setHasSA","userSAList","setUserSAList","deleteLoading","setDeleteLoading","userLoggedIn","localStorage","getItem","users","checkUserServiceAccounts","_res$data$userService","userServiceAccountList","error","renderUsers","user","tableActions","type","selectionElement","IAM_PAGES","USERS","encodeURIComponent","userName","noSAtext","errorMessage","detailedError","removeUser","Loader","InformativeMessage","message","itemActions","selectedGroups","setSelectedGroups","fetchGroups","invoke","groups","stringSort","selGroups","DeleteUser","withSuspense","React","AddToGroup","ListUsers","setLoading","setDeleteOpen","addGroupOpen","setAddGroupOpen","checkedUsers","setCheckedUsers","displayListUsers","hasPermission","CONSOLE_UI_RESOURCE","listUsersPermissions","viewUser","viewUserPermissions","addUserToGroup","addUserToGroupPermissions","deleteUser","deleteUserPermissions","usersSort","viewAction","disableButtonFunction","setHelpName","refresh","closeModalAndRefresh","close","unCheckAll","arguments","closeAddGroupBulk","PageHeaderWrapper","actions","HelpMenu","PageLayout","actionsTray","SecureComponent","resource","scopes","IAM_SCOPES","ADMIN_DELETE_USER","matchAll","errorProps","disabled","permissionTooltipHelper","DeleteIcon","ADMIN_ADD_USER_TO_GROUP","GroupsIcon","ADMIN_CREATE_USER","ADMIN_LIST_USER_POLICIES","ADMIN_LIST_GROUPS","S3_ALL_RESOURCES","ADMIN_ATTACH_USER_OR_GROUP_POLICY","AddIcon","USER_ADD","marginBottom","ADMIN_LIST_USERS","HelpBox","iconComponent","UsersIcon","help","href","rel","ActionLink","selectedUser","addLoading","setAddLoading","setAccessKey","setSecretKey","enabled","setEnabled","getUserInformation","memberOf","status","sendEnabled","trim","AddMembersToGroupIcon","noValidate","autoComplete","onSubmit","preventDefault","FormLayout","withBorders","containerPadding","GroupsSelectors","resetForm","actualPolicy","setActualPolicy","statePolicies","userPolicy","pol","policy","IAMPoliciesIcon","PolicySelectors","selectedPolicy","resetSelection","SetUserPoliciesAction","entityType","hasPolicy","setSelectedServiceAccount","showNewCredentials","setShowNewCredentials","setNewServiceAccount","selectedSAs","setSelectedSAs","deleteMultipleOpen","setDeleteMultipleOpen","editOpen","setEditOpen","fetchRecords","sortedRows","editModalOpen","confirmDeleteServiceAccount","DeleteServiceAccount","DeleteMultipleServiceAccounts","setSnackBarMessage","CredentialsPrompt","EditServiceAccount","selectedAccessKey","closePolicyModal","SectionTitle","separator","justifyContent","gap","ADMIN_CREATE_SERVICEACCOUNT","ADMIN_UPDATE_SERVICEACCOUNT","ADMIN_REMOVE_SERVICEACCOUNT","ADMIN_LIST_SERVICEACCOUNTS","ACCOUNT_TABLE_COLUMNS","selectSAs","newPassword","setNewPassword","reNewPassword","setReNewPassword","ChangePasswordIcon","event","request","newSecretKey","account","changeUserPassword","InputBox","UserDetails","params","useParams","policyOpen","setPolicyOpen","currentGroups","setCurrentGroups","setCurrentPolicies","changeUserPasswordModalOpen","setChangeUserPasswordModalOpen","setHasPolicy","selectedTab","setSelectedTab","enableEnabled","enableUserPermissions","disableEnabled","disableUserPermissions","canAssignPolicy","assignIAMPolicyPermissions","canAssignGroup","assignGroupPermissions","viewGroup","getGroupPermissions","group","policyDetailsSort","groupTableActions","GROUPS","ChangeUserGroups","SetUserPolicies","ChangeUserPasswordModal","BackLink","ScreenTitle","subTitle","enableDisableUserPermissions","Switch","indicatorLabels","isEnabled","switchOnly","TrashIcon","PasswordKeyIcon","Tabs","currentTabOrPath","onTabClick","options","tabConfig","content","onMouseMove","editServiceAccountPermissions","UserServiceAccountsPanel","POLICIES","FeatureItem","description","fontStyle","AddUserHelpBox","flex","border","borderRadius","flexFlow","HelpIconFilled","ChangeAccessPolicyIcon","UserSelector","autoFocus","setUserName","PasswordSelector","AddUser","secretKeylength","setSendEnabled","CreateUserIcon","helpBox","createUserAsync","unwrap","saveRecord","resetFormAsync","AddUserServiceAccountHelpBox","paddingBottom","ServiceAccountIcon","paddingTop","AddServiceAccount","addSending","setAddSending","getRandomString","isRestrictedByPolicy","setIsRestrictedByPolicy","policyJSON","setPolicyJSON","setName","setDescription","comments","setComments","expiry","setExpiry","expiryDt","toJSDate","toISOString","comment","parse","addUserServiceAccount","startIcon","HelpTip","placement","PanelTitle","formScrollable","CodeMirrorWrapper","editorHeight","helptip","DateTimeInput","noLabelMinWidth","timeFormat","secondsSelector","Users","Routes","Route","AddUserScreen","AddUserServiceAccountScreen","NotFoundPage"],"sourceRoot":""} \ No newline at end of file diff --git a/web-app/build/static/js/368.b04989d2.chunk.js b/web-app/build/static/js/368.b04989d2.chunk.js new file mode 100644 index 000000000..7f6f8b2f4 --- /dev/null +++ b/web-app/build/static/js/368.b04989d2.chunk.js @@ -0,0 +1,3 @@ +/*! For license information please see 368.b04989d2.chunk.js.LICENSE.txt */ +(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[368],{8628:(t,e)=>{"use strict";e.A=function(t,e){if(t&&e){var i=Array.isArray(e)?e:e.split(",");if(0===i.length)return!0;var n=t.name||"",s=(t.type||"").toLowerCase(),a=s.replace(/\/.*$/,"");return i.some((function(t){var e=t.trim().toLowerCase();return"."===e.charAt(0)?n.toLowerCase().endsWith(e):e.endsWith("/*")?a===e.replace(/\/.*$/,""):s===e}))}return!0}},5270:(t,e,i)=>{"use strict";var n=i(139),s={"text/plain":"Text","text/html":"Url",default:"Text"};t.exports=function(t,e){var i,a,r,o,l,c,h=!1;e||(e={}),i=e.debug||!1;try{if(r=n(),o=document.createRange(),l=document.getSelection(),(c=document.createElement("span")).textContent=t,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(n){if(n.stopPropagation(),e.format)if(n.preventDefault(),"undefined"===typeof n.clipboardData){i&&console.warn("unable to use e.clipboardData"),i&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=s[e.format]||s.default;window.clipboardData.setData(a,t)}else n.clipboardData.clearData(),n.clipboardData.setData(e.format,t);e.onCopy&&(n.preventDefault(),e.onCopy(n.clipboardData))})),document.body.appendChild(c),o.selectNodeContents(c),l.addRange(o),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");h=!0}catch(d){i&&console.error("unable to copy using execCommand: ",d),i&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),h=!0}catch(d){i&&console.error("unable to copy using clipboardData: ",d),i&&console.error("falling back to prompt"),a=function(t){var e=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}("message"in e?e.message:"Copy to clipboard: #{key}, Enter"),window.prompt(a,t)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(o):l.removeAllRanges()),c&&document.body.removeChild(c),r()}return h}},2099:(t,e,i)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.CopyToClipboard=void 0;var s=o(i(5043)),a=o(i(5270)),r=["text","onCopy","options","children"];function o(t){return t&&t.__esModule?t:{default:t}}function l(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function c(t){for(var e=1;e=0||(s[i]=t[i]);return s}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}function d(t,e){for(var i=0;i{"use strict";var n=i(2099).CopyToClipboard;n.CopyToClipboard=n,t.exports=n},8424:(t,e,i)=>{"use strict";i.d(e,{VB:()=>rt});var n=i(5043),s=i(5173),a=i.n(s);function r(t,e,i,n){return new(i||(i=Promise))((function(s,a){function r(t){try{l(n.next(t))}catch(e){a(e)}}function o(t){try{l(n.throw(t))}catch(e){a(e)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,o)}l((n=n.apply(t,e||[])).next())}))}Object.create;Object.create;"function"===typeof SuppressedError&&SuppressedError;const o=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function l(t,e,i){const n=function(t){const{name:e}=t;if(e&&-1!==e.lastIndexOf(".")&&!t.type){const i=e.split(".").pop().toLowerCase(),n=o.get(i);n&&Object.defineProperty(t,"type",{value:n,writable:!1,configurable:!1,enumerable:!0})}return t}(t),{webkitRelativePath:s}=t,a="string"===typeof e?e:"string"===typeof s&&s.length>0?s:`./${t.name}`;return"string"!==typeof n.path&&c(n,"path",a),void 0!==i&&Object.defineProperty(n,"handle",{value:i,writable:!1,configurable:!1,enumerable:!0}),c(n,"relativePath",a),n}function c(t,e,i){Object.defineProperty(t,e,{value:i,writable:!1,configurable:!1,enumerable:!0})}const h=[".DS_Store","Thumbs.db"];function d(t){return"object"===typeof t&&null!==t}function u(t){return t.filter((t=>-1===h.indexOf(t.name)))}function p(t){if(null===t)return[];const e=[];for(let i=0;i[...t,...Array.isArray(e)?g(e):[e]]),[])}function f(t,e){var i;if("function"===typeof t.getAsFileSystemHandle)return t.getAsFileSystemHandle().then((t=>r(this,void 0,void 0,(function*(){const e=yield t.getFile();return e.handle=t,l(e)}))));const n=t.getAsFile();if(!n)return Promise.reject(`${t} is not a File`);const s=l(n,null!==(i=null===e||void 0===e?void 0:e.fullPath)&&void 0!==i?i:void 0);return Promise.resolve(s)}function v(t){return r(this,void 0,void 0,(function*(){return t.isDirectory?b(t):function(t){return r(this,void 0,void 0,(function*(){return new Promise(((e,i)=>{t.file((i=>{const n=l(i,t.fullPath);e(n)}),(t=>{i(t)}))}))}))}(t)}))}function b(t){const e=t.createReader();return new Promise(((t,i)=>{const n=[];!function s(){e.readEntries((e=>r(this,void 0,void 0,(function*(){if(e.length){const t=Promise.all(e.map(v));n.push(t),s()}else try{const e=yield Promise.all(n);t(e)}catch(a){i(a)}}))),(t=>{i(t)}))}()}))}var y=i(8628);function x(t){return function(t){if(Array.isArray(t))return C(t)}(t)||function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||k(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function A(t){for(var e=1;et.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:"").split(","),e=t.length>1?"one of ".concat(t.join(", ")):t[0];return{code:T,message:"File type must be ".concat(e)}},P=function(t){return{code:M,message:"File is larger than ".concat(t," ").concat(1===t?"byte":"bytes")}},L=function(t){return{code:D,message:"File is smaller than ".concat(t," ").concat(1===t?"byte":"bytes")}},F={code:I,message:"Too many files"};function O(t,e){var i="application/x-moz-file"===t.type||E(t,e);return[i,i?null:R(e)]}function N(t,e,i){if(j(t.size))if(j(e)&&j(i)){if(t.size>i)return[!1,P(i)];if(t.sizei)return[!1,P(i)]}return[!0,null]}function j(t){return void 0!==t&&null!==t}function z(t){return"function"===typeof t.isPropagationStopped?t.isPropagationStopped():"undefined"!==typeof t.cancelBubble&&t.cancelBubble}function H(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,(function(t){return"Files"===t||"application/x-moz-file"===t})):!!t.target&&!!t.target.files}function B(t){t.preventDefault()}function V(){for(var t=arguments.length,e=new Array(t),i=0;i1?i-1:0),s=1;st.length)&&(e=t.length);for(var i=0,n=new Array(e);i=0||(s[i]=t[i]);return s}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}var nt=(0,n.forwardRef)((function(t,e){var i=t.children,s=rt(it(t,W)),a=s.open,r=it(s,q);return(0,n.useImperativeHandle)(e,(function(){return{open:a}}),[a]),n.createElement(n.Fragment,null,i(tt(tt({},r),{},{open:a})))}));nt.displayName="Dropzone";var st={disabled:!1,getFilesFromEvent:function(t){return r(this,void 0,void 0,(function*(){return d(t)&&d(t.dataTransfer)?function(t,e){return r(this,void 0,void 0,(function*(){if(t.items){const i=p(t.items).filter((t=>"file"===t.kind));if("drop"!==e)return i;return u(g(yield Promise.all(i.map(m))))}return u(p(t.files).map((t=>l(t))))}))}(t.dataTransfer,t.type):function(t){return d(t)&&d(t.target)}(t)?function(t){return p(t.target.files).map((t=>l(t)))}(t):Array.isArray(t)&&t.every((t=>"getFile"in t&&"function"===typeof t.getFile))?function(t){return r(this,void 0,void 0,(function*(){return(yield Promise.all(t.map((t=>t.getFile())))).map((t=>l(t)))}))}(t):[]}))},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};nt.defaultProps=st,nt.propTypes={children:a().func,accept:a().objectOf(a().arrayOf(a().string)),multiple:a().bool,preventDropOnDocument:a().bool,noClick:a().bool,noKeyboard:a().bool,noDrag:a().bool,noDragEventsBubbling:a().bool,minSize:a().number,maxSize:a().number,maxFiles:a().number,disabled:a().bool,getFilesFromEvent:a().func,onFileDialogCancel:a().func,onFileDialogOpen:a().func,useFsAccessApi:a().bool,autoFocus:a().bool,onDragEnter:a().func,onDragLeave:a().func,onDragOver:a().func,onDrop:a().func,onDropAccepted:a().func,onDropRejected:a().func,onError:a().func,validator:a().func};var at={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function rt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=tt(tt({},st),t),i=e.accept,s=e.disabled,a=e.getFilesFromEvent,r=e.maxSize,o=e.minSize,l=e.multiple,c=e.maxFiles,h=e.onDragEnter,d=e.onDragLeave,u=e.onDragOver,p=e.onDrop,m=e.onDropAccepted,g=e.onDropRejected,f=e.onFileDialogCancel,v=e.onFileDialogOpen,b=e.useFsAccessApi,y=e.autoFocus,w=e.preventDropOnDocument,k=e.noClick,C=e.noKeyboard,E=e.noDrag,T=e.noDragEventsBubbling,M=e.onError,D=e.validator,I=(0,n.useMemo)((function(){return function(t){if(j(t))return Object.entries(t).reduce((function(t,e){var i=S(e,2),n=i[0],s=i[1];return[].concat(x(t),[n],x(s))}),[]).filter((function(t){return $(t)||U(t)})).join(",")}(i)}),[i]),R=(0,n.useMemo)((function(){return function(t){return j(t)?[{description:"Files",accept:Object.entries(t).filter((function(t){var e=S(t,2),i=e[0],n=e[1],s=!0;return $(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),Array.isArray(n)&&n.every(U)||(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),s=!1),s})).reduce((function(t,e){var i=S(e,2),n=i[0],s=i[1];return A(A({},t),{},_({},n,s))}),{})}]:t}(i)}),[i]),P=(0,n.useMemo)((function(){return"function"===typeof v?v:lt}),[v]),L=(0,n.useMemo)((function(){return"function"===typeof f?f:lt}),[f]),W=(0,n.useRef)(null),q=(0,n.useRef)(null),Z=K((0,n.useReducer)(ot,at),2),J=Z[0],Q=Z[1],nt=J.isFocused,rt=J.isFileDialogActive,ct=(0,n.useRef)("undefined"!==typeof window&&window.isSecureContext&&b&&"showOpenFilePicker"in window),ht=function(){!ct.current&&rt&&setTimeout((function(){q.current&&(q.current.files.length||(Q({type:"closeDialog"}),L()))}),300)};(0,n.useEffect)((function(){return window.addEventListener("focus",ht,!1),function(){window.removeEventListener("focus",ht,!1)}}),[q,rt,L,ct]);var dt=(0,n.useRef)([]),ut=function(t){W.current&&W.current.contains(t.target)||(t.preventDefault(),dt.current=[])};(0,n.useEffect)((function(){return w&&(document.addEventListener("dragover",B,!1),document.addEventListener("drop",ut,!1)),function(){w&&(document.removeEventListener("dragover",B),document.removeEventListener("drop",ut))}}),[W,w]),(0,n.useEffect)((function(){return!s&&y&&W.current&&W.current.focus(),function(){}}),[W,y,s]);var pt=(0,n.useCallback)((function(t){M?M(t):console.error(t)}),[M]),mt=(0,n.useCallback)((function(t){t.preventDefault(),t.persist(),Et(t),dt.current=[].concat(X(dt.current),[t.target]),H(t)&&Promise.resolve(a(t)).then((function(e){if(!z(t)||T){var i=e.length,n=i>0&&function(t){var e=t.files,i=t.accept,n=t.minSize,s=t.maxSize,a=t.multiple,r=t.maxFiles,o=t.validator;return!(!a&&e.length>1||a&&r>=1&&e.length>r)&&e.every((function(t){var e=S(O(t,i),1)[0],a=S(N(t,n,s),1)[0],r=o?o(t):null;return e&&a&&!r}))}({files:e,accept:I,minSize:o,maxSize:r,multiple:l,maxFiles:c,validator:D});Q({isDragAccept:n,isDragReject:i>0&&!n,isDragActive:!0,type:"setDraggedFiles"}),h&&h(t)}})).catch((function(t){return pt(t)}))}),[a,h,pt,T,I,o,r,l,c,D]),gt=(0,n.useCallback)((function(t){t.preventDefault(),t.persist(),Et(t);var e=H(t);if(e&&t.dataTransfer)try{t.dataTransfer.dropEffect="copy"}catch(i){}return e&&u&&u(t),!1}),[u,T]),ft=(0,n.useCallback)((function(t){t.preventDefault(),t.persist(),Et(t);var e=dt.current.filter((function(t){return W.current&&W.current.contains(t)})),i=e.indexOf(t.target);-1!==i&&e.splice(i,1),dt.current=e,e.length>0||(Q({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),H(t)&&d&&d(t))}),[W,d,T]),vt=(0,n.useCallback)((function(t,e){var i=[],n=[];t.forEach((function(t){var e=K(O(t,I),2),s=e[0],a=e[1],l=K(N(t,o,r),2),c=l[0],h=l[1],d=D?D(t):null;if(s&&c&&!d)i.push(t);else{var u=[a,h];d&&(u=u.concat(d)),n.push({file:t,errors:u.filter((function(t){return t}))})}})),(!l&&i.length>1||l&&c>=1&&i.length>c)&&(i.forEach((function(t){n.push({file:t,errors:[F]})})),i.splice(0)),Q({acceptedFiles:i,fileRejections:n,isDragReject:n.length>0,type:"setFiles"}),p&&p(i,n,e),n.length>0&&g&&g(n,e),i.length>0&&m&&m(i,e)}),[Q,l,I,o,r,c,p,m,g,D]),bt=(0,n.useCallback)((function(t){t.preventDefault(),t.persist(),Et(t),dt.current=[],H(t)&&Promise.resolve(a(t)).then((function(e){z(t)&&!T||vt(e,t)})).catch((function(t){return pt(t)})),Q({type:"reset"})}),[a,vt,pt,T]),yt=(0,n.useCallback)((function(){if(ct.current){Q({type:"openDialog"}),P();var t={multiple:l,types:R};window.showOpenFilePicker(t).then((function(t){return a(t)})).then((function(t){vt(t,null),Q({type:"closeDialog"})})).catch((function(t){var e;(e=t)instanceof DOMException&&("AbortError"===e.name||e.code===e.ABORT_ERR)?(L(t),Q({type:"closeDialog"})):!function(t){return t instanceof DOMException&&("SecurityError"===t.name||t.code===t.SECURITY_ERR)}(t)?pt(t):(ct.current=!1,q.current?(q.current.value=null,q.current.click()):pt(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided.")))}))}else q.current&&(Q({type:"openDialog"}),P(),q.current.value=null,q.current.click())}),[Q,P,L,b,vt,pt,R,l]),xt=(0,n.useCallback)((function(t){W.current&&W.current.isEqualNode(t.target)&&(" "!==t.key&&"Enter"!==t.key&&32!==t.keyCode&&13!==t.keyCode||(t.preventDefault(),yt()))}),[W,yt]),wt=(0,n.useCallback)((function(){Q({type:"focus"})}),[]),At=(0,n.useCallback)((function(){Q({type:"blur"})}),[]),_t=(0,n.useCallback)((function(){k||(!function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return function(t){return-1!==t.indexOf("MSIE")||-1!==t.indexOf("Trident/")}(t)||function(t){return-1!==t.indexOf("Edge/")}(t)}()?yt():setTimeout(yt,0))}),[k,yt]),St=function(t){return s?null:t},kt=function(t){return C?null:St(t)},Ct=function(t){return E?null:St(t)},Et=function(t){T&&t.stopPropagation()},Tt=(0,n.useMemo)((function(){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.refKey,i=void 0===e?"ref":e,n=t.role,a=t.onKeyDown,r=t.onFocus,o=t.onBlur,l=t.onClick,c=t.onDragEnter,h=t.onDragOver,d=t.onDragLeave,u=t.onDrop,p=it(t,G);return tt(tt(et({onKeyDown:kt(V(a,xt)),onFocus:kt(V(r,wt)),onBlur:kt(V(o,At)),onClick:St(V(l,_t)),onDragEnter:Ct(V(c,mt)),onDragOver:Ct(V(h,gt)),onDragLeave:Ct(V(d,ft)),onDrop:Ct(V(u,bt)),role:"string"===typeof n&&""!==n?n:"presentation"},i,W),s||C?{}:{tabIndex:0}),p)}}),[W,xt,wt,At,_t,mt,gt,ft,bt,C,E,s]),Mt=(0,n.useCallback)((function(t){t.stopPropagation()}),[]),Dt=(0,n.useMemo)((function(){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.refKey,i=void 0===e?"ref":e,n=t.onChange,s=t.onClick,a=it(t,Y);return tt(tt({},et({accept:I,multiple:l,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:St(V(n,bt)),onClick:St(V(s,Mt)),tabIndex:-1},i,q)),a)}}),[q,i,l,bt,s]);return tt(tt({},J),{},{isFocused:nt&&!s,getRootProps:Tt,getInputProps:Dt,rootRef:W,inputRef:q,open:St(yt)})}function ot(t,e){switch(e.type){case"focus":return tt(tt({},t),{},{isFocused:!0});case"blur":return tt(tt({},t),{},{isFocused:!1});case"openDialog":return tt(tt({},at),{},{isFileDialogActive:!0});case"closeDialog":return tt(tt({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return tt(tt({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return tt(tt({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections,isDragReject:e.isDragReject});case"reset":return tt({},at);default:return t}}function lt(){}},139:t=>{t.exports=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,i=[],n=0;n{"use strict";var e=function(){};t.exports=e},3498:function(t){t.exports=function(){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}var e=/^\s+/,i=/\s+$/;function n(t,e){if(e=e||{},(t=t||"")instanceof n)return t;if(!(this instanceof n))return new n(t,e);var i=s(t);this._originalInput=t,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||i.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=i.ok}function s(e){var i={r:0,g:0,b:0},n=1,s=null,r=null,l=null,h=!1,d=!1;return"string"==typeof e&&(e=H(e)),"object"==t(e)&&(z(e.r)&&z(e.g)&&z(e.b)?(i=a(e.r,e.g,e.b),h=!0,d="%"===String(e.r).substr(-1)?"prgb":"rgb"):z(e.h)&&z(e.s)&&z(e.v)?(s=F(e.s),r=F(e.v),i=c(e.h,s,r),h=!0,d="hsv"):z(e.h)&&z(e.s)&&z(e.l)&&(s=F(e.s),l=F(e.l),i=o(e.h,s,l),h=!0,d="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=T(n),{ok:h,format:e.format||d,r:Math.min(255,Math.max(i.r,0)),g:Math.min(255,Math.max(i.g,0)),b:Math.min(255,Math.max(i.b,0)),a:n}}function a(t,e,i){return{r:255*M(t,255),g:255*M(e,255),b:255*M(i,255)}}function r(t,e,i){t=M(t,255),e=M(e,255),i=M(i,255);var n,s,a=Math.max(t,e,i),r=Math.min(t,e,i),o=(a+r)/2;if(a==r)n=s=0;else{var l=a-r;switch(s=o>.5?l/(2-a-r):l/(a+r),a){case t:n=(e-i)/l+(e1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}if(t=M(t,360),e=M(e,100),i=M(i,100),0===e)n=s=a=i;else{var o=i<.5?i*(1+e):i+e-i*e,l=2*i-o;n=r(l,o,t+1/3),s=r(l,o,t),a=r(l,o,t-1/3)}return{r:255*n,g:255*s,b:255*a}}function l(t,e,i){t=M(t,255),e=M(e,255),i=M(i,255);var n,s,a=Math.max(t,e,i),r=Math.min(t,e,i),o=a,l=a-r;if(s=0===a?0:l/a,a==r)n=0;else{switch(a){case t:n=(e-i)/l+(e>1)+720)%360;--e;)s.h=(s.h+a)%360,r.push(n(s));return r}function S(t,e){e=e||6;for(var i=n(t).toHsv(),s=i.h,a=i.s,r=i.v,o=[],l=1/e;e--;)o.push(n({h:s,s:a,v:r})),r=(r+l)%1;return o}n.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,i,n=this.toRgb();return t=n.r/255,e=n.g/255,i=n.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))},setAlpha:function(t){return this._a=T(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=l(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=l(this._r,this._g,this._b),e=Math.round(360*t.h),i=Math.round(100*t.s),n=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+i+"%, "+n+"%)":"hsva("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=r(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=r(this._r,this._g,this._b),e=Math.round(360*t.h),i=Math.round(100*t.s),n=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+i+"%, "+n+"%)":"hsla("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return d(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*M(this._r,255))+"%",g:Math.round(100*M(this._g,255))+"%",b:Math.round(100*M(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*M(this._r,255))+"%, "+Math.round(100*M(this._g,255))+"%, "+Math.round(100*M(this._b,255))+"%)":"rgba("+Math.round(100*M(this._r,255))+"%, "+Math.round(100*M(this._g,255))+"%, "+Math.round(100*M(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+u(this._r,this._g,this._b,this._a),i=e,s=this._gradientType?"GradientType = 1, ":"";if(t){var a=n(t);i="#"+u(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+e+",endColorstr="+i+")"},toString:function(t){var e=!!t;t=t||this._format;var i=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(i=this.toRgbString()),"prgb"===t&&(i=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(i=this.toHexString()),"hex3"===t&&(i=this.toHexString(!0)),"hex4"===t&&(i=this.toHex8String(!0)),"hex8"===t&&(i=this.toHex8String()),"name"===t&&(i=this.toName()),"hsl"===t&&(i=this.toHslString()),"hsv"===t&&(i=this.toHsvString()),i||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return n(this.toString())},_applyModification:function(t,e){var i=t.apply(null,[this].concat([].slice.call(e)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(f,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(_,arguments)},complement:function(){return this._applyCombination(x,arguments)},monochromatic:function(){return this._applyCombination(S,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(w,[3])},tetrad:function(){return this._applyCombination(w,[4])}},n.fromRatio=function(e,i){if("object"==t(e)){var s={};for(var a in e)e.hasOwnProperty(a)&&(s[a]="a"===a?e[a]:F(e[a]));e=s}return n(e,i)},n.equals=function(t,e){return!(!t||!e)&&n(t).toRgbString()==n(e).toRgbString()},n.random=function(){return n.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},n.mix=function(t,e,i){i=0===i?0:i||50;var s=n(t).toRgb(),a=n(e).toRgb(),r=i/100;return n({r:(a.r-s.r)*r+s.r,g:(a.g-s.g)*r+s.g,b:(a.b-s.b)*r+s.b,a:(a.a-s.a)*r+s.a})},n.readability=function(t,e){var i=n(t),s=n(e);return(Math.max(i.getLuminance(),s.getLuminance())+.05)/(Math.min(i.getLuminance(),s.getLuminance())+.05)},n.isReadable=function(t,e,i){var s,a,r=n.readability(t,e);switch(a=!1,(s=B(i)).level+s.size){case"AAsmall":case"AAAlarge":a=r>=4.5;break;case"AAlarge":a=r>=3;break;case"AAAsmall":a=r>=7}return a},n.mostReadable=function(t,e,i){var s,a,r,o,l=null,c=0;a=(i=i||{}).includeFallbackColors,r=i.level,o=i.size;for(var h=0;hc&&(c=s,l=n(e[h]));return n.isReadable(t,l,{level:r,size:o})||!a?l:(i.includeFallbackColors=!1,n.mostReadable(t,["#fff","#000"],i))};var k=n.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=n.hexNames=E(k);function E(t){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[t[i]]=i);return e}function T(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function M(t,e){R(t)&&(t="100%");var i=P(t);return t=Math.min(e,Math.max(0,parseFloat(t))),i&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function D(t){return Math.min(1,Math.max(0,t))}function I(t){return parseInt(t,16)}function R(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function P(t){return"string"===typeof t&&-1!=t.indexOf("%")}function L(t){return 1==t.length?"0"+t:""+t}function F(t){return t<=1&&(t=100*t+"%"),t}function O(t){return Math.round(255*parseFloat(t)).toString(16)}function N(t){return I(t)/255}var j=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function z(t){return!!j.CSS_UNIT.exec(t)}function H(t){t=t.replace(e,"").replace(i,"").toLowerCase();var n,s=!1;if(k[t])t=k[t],s=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(n=j.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=j.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=j.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=j.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=j.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=j.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=j.hex8.exec(t))?{r:I(n[1]),g:I(n[2]),b:I(n[3]),a:N(n[4]),format:s?"name":"hex8"}:(n=j.hex6.exec(t))?{r:I(n[1]),g:I(n[2]),b:I(n[3]),format:s?"name":"hex"}:(n=j.hex4.exec(t))?{r:I(n[1]+""+n[1]),g:I(n[2]+""+n[2]),b:I(n[3]+""+n[3]),a:N(n[4]+""+n[4]),format:s?"name":"hex8"}:!!(n=j.hex3.exec(t))&&{r:I(n[1]+""+n[1]),g:I(n[2]+""+n[2]),b:I(n[3]+""+n[3]),format:s?"name":"hex"}}function B(t){var e,i;return"AA"!==(e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==e&&(e="AA"),"small"!==(i=(t.size||"small").toLowerCase())&&"large"!==i&&(i="small"),{level:e,size:i}}return n}()},4241:(t,e,i)=>{"use strict";i.d(e,{c9:()=>gn});class n extends Error{}class s extends n{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class a extends n{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class r extends n{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class o extends n{}class l extends n{constructor(t){super(`Invalid unit ${t}`)}}class c extends n{}class h extends n{constructor(){super("Zone is an abstract class")}}const d="numeric",u="short",p="long",m={year:d,month:d,day:d},g={year:d,month:u,day:d},f={year:d,month:u,day:d,weekday:u},v={year:d,month:p,day:d},b={year:d,month:p,day:d,weekday:p},y={hour:d,minute:d},x={hour:d,minute:d,second:d},w={hour:d,minute:d,second:d,timeZoneName:u},A={hour:d,minute:d,second:d,timeZoneName:p},_={hour:d,minute:d,hourCycle:"h23"},S={hour:d,minute:d,second:d,hourCycle:"h23"},k={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:u},C={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:p},E={year:d,month:d,day:d,hour:d,minute:d},T={year:d,month:d,day:d,hour:d,minute:d,second:d},M={year:d,month:u,day:d,hour:d,minute:d},D={year:d,month:u,day:d,hour:d,minute:d,second:d},I={year:d,month:u,day:d,weekday:u,hour:d,minute:d},R={year:d,month:p,day:d,hour:d,minute:d,timeZoneName:u},P={year:d,month:p,day:d,hour:d,minute:d,second:d,timeZoneName:u},L={year:d,month:p,day:d,weekday:p,hour:d,minute:d,timeZoneName:p},F={year:d,month:p,day:d,weekday:p,hour:d,minute:d,second:d,timeZoneName:p};class O{get type(){throw new h}get name(){throw new h}get ianaName(){return this.name}get isUniversal(){throw new h}offsetName(t,e){throw new h}formatOffset(t,e){throw new h}offset(t){throw new h}equals(t){throw new h}get isValid(){throw new h}}let N=null;class j extends O{static get instance(){return null===N&&(N=new j),N}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,e){let{format:i,locale:n}=e;return ie(t,i,n)}formatOffset(t,e){return re(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return"system"===t.type}get isValid(){return!0}}let z={};const H={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let B={};class V extends O{static create(t){return B[t]||(B[t]=new V(t)),B[t]}static resetCache(){B={},z={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch(e){return!1}}constructor(t){super(),this.zoneName=t,this.valid=V.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,e){let{format:i,locale:n}=e;return ie(t,i,n,this.name)}formatOffset(t,e){return re(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const i=(n=this.name,z[n]||(z[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),z[n]);var n;let[s,a,r,o,l,c,h]=i.formatToParts?function(t,e){const i=t.formatToParts(e),n=[];for(let s=0;s=0?u:1e3+u,(Jt({year:s,month:a,day:r,hour:24===l?0:l,minute:c,second:h,millisecond:0})-d)/6e4}equals(t){return"iana"===t.type&&t.name===this.name}get isValid(){return this.valid}}let $={};let U={};function W(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=JSON.stringify([t,e]);let n=U[i];return n||(n=new Intl.DateTimeFormat(t,e),U[i]=n),n}let q={};let G={};let Y=null;let X={};function K(t,e,i,n){const s=t.listingMode();return"error"===s?null:"en"===s?i(e):n(e)}class Z{constructor(t,e,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:n,floor:s,...a}=i;if(!e||Object.keys(a).length>0){const e={useGrouping:!1,...i};i.padTo>0&&(e.minimumIntegerDigits=i.padTo),this.inf=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=JSON.stringify([t,e]);let n=q[i];return n||(n=new Intl.NumberFormat(t,e),q[i]=n),n}(t,e)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}return Ut(this.floor?Math.floor(t):Yt(t,3),this.padTo)}}class J{constructor(t,e,i){let n;if(this.opts=i,this.originalZone=void 0,this.opts.timeZone)this.dt=t;else if("fixed"===t.zone.type){const e=t.offset/60*-1,i=e>=0?`Etc/GMT+${e}`:`Etc/GMT${e}`;0!==t.offset&&V.create(i).valid?(n=i,this.dt=t):(n="UTC",this.dt=0===t.offset?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else"system"===t.zone.type?this.dt=t:"iana"===t.zone.type?(this.dt=t,n=t.zone.name):(n="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const s={...this.opts};s.timeZone=s.timeZone||n,this.dtf=W(e,s)}format(){return this.originalZone?this.formatToParts().map((t=>{let{value:e}=t;return e})).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map((t=>{if("timeZoneName"===t.type){const e=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:e}}return t})):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class Q{constructor(t,e,i){this.opts={style:"long",...i},!e&&jt()&&(this.rtf=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{base:i,...n}=e,s=JSON.stringify([t,n]);let a=G[s];return a||(a=new Intl.RelativeTimeFormat(t,e),G[s]=a),a}(t,i))}format(t,e){return this.rtf?this.rtf.format(t,e):function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"always",n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=-1===["hours","minutes","seconds"].indexOf(t);if("auto"===i&&a){const i="days"===t;switch(e){case 1:return i?"tomorrow":`next ${s[t][0]}`;case-1:return i?"yesterday":`last ${s[t][0]}`;case 0:return i?"today":`this ${s[t][0]}`}}const r=Object.is(e,-0)||e<0,o=Math.abs(e),l=1===o,c=s[t],h=n?l?c[1]:c[2]||c[1]:l?s[t][0]:t;return r?`${o} ${h} ago`:`in ${o} ${h}`}(e,t,this.opts.numeric,"long"!==this.opts.style)}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}const tt={firstDay:1,minimalDays:4,weekend:[6,7]};class et{static fromOpts(t){return et.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const a=t||yt.defaultLocale,r=a||(s?"en-US":Y||(Y=(new Intl.DateTimeFormat).resolvedOptions().locale,Y)),o=e||yt.defaultNumberingSystem,l=i||yt.defaultOutputCalendar,c=Vt(n)||yt.defaultWeekSettings;return new et(r,o,l,c,a)}static resetCache(){Y=null,U={},q={},G={}}static fromObject(){let{locale:t,numberingSystem:e,outputCalendar:i,weekSettings:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return et.create(t,e,i,n)}constructor(t,e,i,n,s){const[a,r,o]=function(t){const e=t.indexOf("-x-");-1!==e&&(t=t.substring(0,e));const i=t.indexOf("-u-");if(-1===i)return[t];{let e,s;try{e=W(t).resolvedOptions(),s=t}catch(n){const a=t.substring(0,i);e=W(a).resolvedOptions(),s=a}const{numberingSystem:a,calendar:r}=e;return[s,a,r]}}(t);this.locale=a,this.numberingSystem=e||r||null,this.outputCalendar=i||o||null,this.weekSettings=n,this.intl=function(t,e,i){return i||e?(t.includes("-u-")||(t+="-u"),i&&(t+=`-ca-${i}`),e&&(t+=`-nu-${e}`),t):t}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){var t;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(t=this).numberingSystem||"latn"===t.numberingSystem)&&("latn"===t.numberingSystem||!t.locale||t.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),e=(null===this.numberingSystem||"latn"===this.numberingSystem)&&(null===this.outputCalendar||"gregory"===this.outputCalendar);return t&&e?"en":"intl"}clone(t){return t&&0!==Object.getOwnPropertyNames(t).length?et.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,Vt(t.weekSettings)||this.weekSettings,t.defaultToEN||!1):this}redefaultToEN(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.clone({...t,defaultToEN:!0})}redefaultToSystem(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.clone({...t,defaultToEN:!1})}months(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return K(this,t,de,(()=>{const i=e?{month:t,day:"numeric"}:{month:t},n=e?"format":"standalone";return this.monthsCache[n][t]||(this.monthsCache[n][t]=function(t){const e=[];for(let i=1;i<=12;i++){const n=gn.utc(2009,i,1);e.push(t(n))}return e}((t=>this.extract(t,i,"month")))),this.monthsCache[n][t]}))}weekdays(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return K(this,t,ge,(()=>{const i=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},n=e?"format":"standalone";return this.weekdaysCache[n][t]||(this.weekdaysCache[n][t]=function(t){const e=[];for(let i=1;i<=7;i++){const n=gn.utc(2016,11,13+i);e.push(t(n))}return e}((t=>this.extract(t,i,"weekday")))),this.weekdaysCache[n][t]}))}meridiems(){return K(this,void 0,(()=>fe),(()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[gn.utc(2016,11,13,9),gn.utc(2016,11,13,19)].map((e=>this.extract(e,t,"dayperiod")))}return this.meridiemCache}))}eras(t){return K(this,t,xe,(()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[gn.utc(-40,1,1),gn.utc(2017,1,1)].map((t=>this.extract(t,e,"era")))),this.eraCache[t]}))}extract(t,e,i){const n=this.dtFormatter(t,e).formatToParts().find((t=>t.type.toLowerCase()===i));return n?n.value:null}numberFormatter(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Z(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new J(t,this.intl,e)}relFormatter(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Q(this.intl,this.isEnglish(),t)}listFormatter(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=JSON.stringify([t,e]);let n=$[i];return n||(n=new Intl.ListFormat(t,e),$[i]=n),n}(this.intl,t)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:zt()?function(t){let e=X[t];if(!e){const i=new Intl.Locale(t);e="getWeekInfo"in i?i.getWeekInfo():i.weekInfo,X[t]=e}return e}(this.locale):tt}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let it=null;class nt extends O{static get utcInstance(){return null===it&&(it=new nt(0)),it}static instance(t){return 0===t?nt.utcInstance:new nt(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new nt(ne(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${re(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${re(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return re(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return"fixed"===t.type&&t.fixed===this.fixed}get isValid(){return!0}}class st extends O{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function at(t,e){if(Ft(t)||null===t)return e;if(t instanceof O)return t;if("string"===typeof t){const i=t.toLowerCase();return"default"===i?e:"local"===i||"system"===i?j.instance:"utc"===i||"gmt"===i?nt.utcInstance:nt.parseSpecifier(i)||V.create(t)}return Ot(t)?nt.instance(t):"object"===typeof t&&"offset"in t&&"function"===typeof t.offset?t:new st(t)}const rt={arab:"[\u0660-\u0669]",arabext:"[\u06f0-\u06f9]",bali:"[\u1b50-\u1b59]",beng:"[\u09e6-\u09ef]",deva:"[\u0966-\u096f]",fullwide:"[\uff10-\uff19]",gujr:"[\u0ae6-\u0aef]",hanidec:"[\u3007|\u4e00|\u4e8c|\u4e09|\u56db|\u4e94|\u516d|\u4e03|\u516b|\u4e5d]",khmr:"[\u17e0-\u17e9]",knda:"[\u0ce6-\u0cef]",laoo:"[\u0ed0-\u0ed9]",limb:"[\u1946-\u194f]",mlym:"[\u0d66-\u0d6f]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0b66-\u0b6f]",tamldec:"[\u0be6-\u0bef]",telu:"[\u0c66-\u0c6f]",thai:"[\u0e50-\u0e59]",tibt:"[\u0f20-\u0f29]",latn:"\\d"},ot={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},lt=rt.hanidec.replace(/[\[|\]]/g,"").split("");let ct={};function ht(t){let{numberingSystem:e}=t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e||"latn";return ct[n]||(ct[n]={}),ct[n][i]||(ct[n][i]=new RegExp(`${rt[n]}${i}`)),ct[n][i]}let dt,ut=()=>Date.now(),pt="system",mt=null,gt=null,ft=null,vt=60,bt=null;class yt{static get now(){return ut}static set now(t){ut=t}static set defaultZone(t){pt=t}static get defaultZone(){return at(pt,j.instance)}static get defaultLocale(){return mt}static set defaultLocale(t){mt=t}static get defaultNumberingSystem(){return gt}static set defaultNumberingSystem(t){gt=t}static get defaultOutputCalendar(){return ft}static set defaultOutputCalendar(t){ft=t}static get defaultWeekSettings(){return bt}static set defaultWeekSettings(t){bt=Vt(t)}static get twoDigitCutoffYear(){return vt}static set twoDigitCutoffYear(t){vt=t%100}static get throwOnInvalid(){return dt}static set throwOnInvalid(t){dt=t}static resetCaches(){et.resetCache(),V.resetCache(),gn.resetCache(),ct={}}}class xt{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const wt=[0,31,59,90,120,151,181,212,243,273,304,334],At=[0,31,60,91,121,152,182,213,244,274,305,335];function _t(t,e){return new xt("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function St(t,e,i){const n=new Date(Date.UTC(t,e-1,i));t<100&&t>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const s=n.getUTCDay();return 0===s?7:s}function kt(t,e,i){return i+(Xt(t)?At:wt)[e-1]}function Ct(t,e){const i=Xt(t)?At:wt,n=i.findIndex((t=>t1&&void 0!==arguments[1]?arguments[1]:4,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const{year:n,month:s,day:a}=t,r=kt(n,s,a),o=Et(St(n,s,a),i);let l,c=Math.floor((r-o+14-e)/7);return c<1?(l=n-1,c=te(l,e,i)):c>te(n,e,i)?(l=n+1,c=1):l=n,{weekYear:l,weekNumber:c,weekday:o,...oe(t)}}function Mt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const{weekYear:n,weekNumber:s,weekday:a}=t,r=Et(St(n,1,e),i),o=Kt(n);let l,c=7*s+a-r-7+e;c<1?(l=n-1,c+=Kt(l)):c>o?(l=n+1,c-=Kt(n)):l=n;const{month:h,day:d}=Ct(l,c);return{year:l,month:h,day:d,...oe(t)}}function Dt(t){const{year:e,month:i,day:n}=t;return{year:e,ordinal:kt(e,i,n),...oe(t)}}function It(t){const{year:e,ordinal:i}=t,{month:n,day:s}=Ct(e,i);return{year:e,month:n,day:s,...oe(t)}}function Rt(t,e){if(!Ft(t.localWeekday)||!Ft(t.localWeekNumber)||!Ft(t.localWeekYear)){if(!Ft(t.weekday)||!Ft(t.weekNumber)||!Ft(t.weekYear))throw new o("Cannot mix locale-based week fields with ISO-based week fields");return Ft(t.localWeekday)||(t.weekday=t.localWeekday),Ft(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),Ft(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function Pt(t){const e=Nt(t.year),i=$t(t.month,1,12),n=$t(t.day,1,Zt(t.year,t.month));return e?i?!n&&_t("day",t.day):_t("month",t.month):_t("year",t.year)}function Lt(t){const{hour:e,minute:i,second:n,millisecond:s}=t,a=$t(e,0,23)||24===e&&0===i&&0===n&&0===s,r=$t(i,0,59),o=$t(n,0,59),l=$t(s,0,999);return a?r?o?!l&&_t("millisecond",s):_t("second",n):_t("minute",i):_t("hour",e)}function Ft(t){return"undefined"===typeof t}function Ot(t){return"number"===typeof t}function Nt(t){return"number"===typeof t&&t%1===0}function jt(){try{return"undefined"!==typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function zt(){try{return"undefined"!==typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(t){return!1}}function Ht(t,e,i){if(0!==t.length)return t.reduce(((t,n)=>{const s=[e(n),n];return t&&i(t[0],s[0])===t[0]?t:s}),null)[1]}function Bt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Vt(t){if(null==t)return null;if("object"!==typeof t)throw new c("Week settings must be an object");if(!$t(t.firstDay,1,7)||!$t(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some((t=>!$t(t,1,7))))throw new c("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function $t(t,e,i){return Nt(t)&&t>=e&&t<=i}function Ut(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;let i;return i=t<0?"-"+(""+-t).padStart(e,"0"):(""+t).padStart(e,"0"),i}function Wt(t){return Ft(t)||null===t||""===t?void 0:parseInt(t,10)}function qt(t){return Ft(t)||null===t||""===t?void 0:parseFloat(t)}function Gt(t){if(!Ft(t)&&null!==t&&""!==t){const e=1e3*parseFloat("0."+t);return Math.floor(e)}}function Yt(t,e){const i=10**e;return(arguments.length>2&&void 0!==arguments[2]&&arguments[2]?Math.trunc:Math.round)(t*i)/i}function Xt(t){return t%4===0&&(t%100!==0||t%400===0)}function Kt(t){return Xt(t)?366:365}function Zt(t,e){const i=function(t,e){return t-e*Math.floor(t/e)}(e-1,12)+1;return 2===i?Xt(t+(e-i)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function Jt(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function Qt(t,e,i){return-Et(St(t,1,e),i)+e-1}function te(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const n=Qt(t,e,i),s=Qt(t+1,e,i);return(Kt(t)-n+s)/7}function ee(t){return t>99?t:t>yt.twoDigitCutoffYear?1900+t:2e3+t}function ie(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const s=new Date(t),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(a.timeZone=n);const r={timeZoneName:e,...a},o=new Intl.DateTimeFormat(i,r).formatToParts(s).find((t=>"timezonename"===t.type.toLowerCase()));return o?o.value:null}function ne(t,e){let i=parseInt(t,10);Number.isNaN(i)&&(i=0);const n=parseInt(e,10)||0;return 60*i+(i<0||Object.is(i,-0)?-n:n)}function se(t){const e=Number(t);if("boolean"===typeof t||""===t||Number.isNaN(e))throw new c(`Invalid unit value ${t}`);return e}function ae(t,e){const i={};for(const n in t)if(Bt(t,n)){const s=t[n];if(void 0===s||null===s)continue;i[e(n)]=se(s)}return i}function re(t,e){const i=Math.trunc(Math.abs(t/60)),n=Math.trunc(Math.abs(t%60)),s=t>=0?"+":"-";switch(e){case"short":return`${s}${Ut(i,2)}:${Ut(n,2)}`;case"narrow":return`${s}${i}${n>0?`:${n}`:""}`;case"techie":return`${s}${Ut(i,2)}${Ut(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function oe(t){return function(t,e){return e.reduce(((e,i)=>(e[i]=t[i],e)),{})}(t,["hour","minute","second","millisecond"])}const le=["January","February","March","April","May","June","July","August","September","October","November","December"],ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],he=["J","F","M","A","M","J","J","A","S","O","N","D"];function de(t){switch(t){case"narrow":return[...he];case"short":return[...ce];case"long":return[...le];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const ue=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],pe=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],me=["M","T","W","T","F","S","S"];function ge(t){switch(t){case"narrow":return[...me];case"short":return[...pe];case"long":return[...ue];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const fe=["AM","PM"],ve=["Before Christ","Anno Domini"],be=["BC","AD"],ye=["B","A"];function xe(t){switch(t){case"narrow":return[...ye];case"short":return[...be];case"long":return[...ve];default:return null}}function we(t,e){let i="";for(const n of t)n.literal?i+=n.val:i+=e(n.val);return i}const Ae={D:m,DD:g,DDD:v,DDDD:b,t:y,tt:x,ttt:w,tttt:A,T:_,TT:S,TTT:k,TTTT:C,f:E,ff:M,fff:R,ffff:L,F:T,FF:D,FFF:P,FFFF:F};class _e{static create(t){return new _e(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}static parseFormat(t){let e=null,i="",n=!1;const s=[];for(let a=0;a0&&s.push({literal:n||/^\s+$/.test(i),val:i}),e=null,i="",n=!n):n||r===e?i+=r:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=r,e=r)}return i.length>0&&s.push({literal:n||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(t){return Ae[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}dtFormatter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.loc.dtFormatter(t,{...this.opts,...e})}formatDateTime(t,e){return this.dtFormatter(t,e).format()}formatDateTimeParts(t,e){return this.dtFormatter(t,e).formatToParts()}formatInterval(t,e){return this.dtFormatter(t.start,e).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,e){return this.dtFormatter(t,e).resolvedOptions()}num(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(this.opts.forceSimple)return Ut(t,e);const i={...this.opts};return e>0&&(i.padTo=e),this.loc.numberFormatter(i).format(t)}formatDateTimeFromString(t,e){const i="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,s=(e,i)=>this.loc.extract(t,e,i),a=e=>t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):"",r=()=>i?function(t){return fe[t.hour<12?0:1]}(t):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),o=(e,n)=>i?function(t,e){return de(e)[t.month-1]}(t,e):s(n?{month:e}:{month:e,day:"numeric"},"month"),l=(e,n)=>i?function(t,e){return ge(e)[t.weekday-1]}(t,e):s(n?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday"),c=e=>{const i=_e.macroTokenToFormatOpts(e);return i?this.formatWithSystemDefault(t,i):e},h=e=>i?function(t,e){return xe(e)[t.year<0?0:1]}(t,e):s({era:e},"era");return we(_e.parseFormat(e),(e=>{switch(e){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return r();case"d":return n?s({day:"numeric"},"day"):this.num(t.day);case"dd":return n?s({day:"2-digit"},"day"):this.num(t.day,2);case"c":case"E":return this.num(t.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?s({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return n?s({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return n?s({month:"numeric"},"month"):this.num(t.month);case"MM":return n?s({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return n?s({year:"numeric"},"year"):this.num(t.year);case"yy":return n?s({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return n?s({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return n?s({year:"numeric"},"year"):this.num(t.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return c(e)}}))}formatDurationFromString(t,e){const i=t=>{switch(t[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=_e.parseFormat(e),s=n.reduce(((t,e)=>{let{literal:i,val:n}=e;return i?t:t.concat(n)}),[]);return we(n,(t=>e=>{const n=i(e);return n?this.num(t.get(n),e.length):e})(t.shiftTo(...s.map(i).filter((t=>t)))))}}const Se=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ke(){for(var t=arguments.length,e=new Array(t),i=0;it+e.source),"");return RegExp(`^${n}$`)}function Ce(){for(var t=arguments.length,e=new Array(t),i=0;ie.reduce(((e,i)=>{let[n,s,a]=e;const[r,o,l]=i(t,a);return[{...n,...r},o||s,l]}),[{},null,1]).slice(0,2)}function Ee(t){if(null==t)return[null,null];for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n{const n={};let s;for(s=0;s1&&void 0!==arguments[1]&&arguments[1]||t&&h)?-t:t};return[{years:u(qt(i)),months:u(qt(n)),weeks:u(qt(s)),days:u(qt(a)),hours:u(qt(r)),minutes:u(qt(o)),seconds:u(qt(l),"-0"===l),milliseconds:u(Gt(c),d)}]}const Ue={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function We(t,e,i,n,s,a,r){const o={year:2===e.length?ee(Wt(e)):Wt(e),month:ce.indexOf(i)+1,day:Wt(n),hour:Wt(s),minute:Wt(a)};return r&&(o.second=Wt(r)),t&&(o.weekday=t.length>3?ue.indexOf(t)+1:pe.indexOf(t)+1),o}const qe=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Ge(t){const[,e,i,n,s,a,r,o,l,c,h,d]=t,u=We(e,s,n,i,a,r,o);let p;return p=l?Ue[l]:c?0:ne(h,d),[u,new nt(p)]}const Ye=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Xe=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Ke=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Ze(t){const[,e,i,n,s,a,r,o]=t;return[We(e,s,n,i,a,r,o),nt.utcInstance]}function Je(t){const[,e,i,n,s,a,r,o]=t;return[We(e,o,i,n,s,a,r),nt.utcInstance]}const Qe=ke(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Re),ti=ke(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Re),ei=ke(/(\d{4})-?(\d{3})/,Re),ii=ke(Ie),ni=Ce((function(t,e){return[{year:Ne(t,e),month:Ne(t,e+1,1),day:Ne(t,e+2,1)},null,e+3]}),je,ze,He),si=Ce(Pe,je,ze,He),ai=Ce(Le,je,ze,He),ri=Ce(je,ze,He);const oi=Ce(je);const li=ke(/(\d{4})-(\d\d)-(\d\d)/,Oe),ci=ke(Fe),hi=Ce(je,ze,He);const di="Invalid Duration",ui={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},pi={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...ui},mi=365.2425,gi=30.436875,fi={years:{quarters:4,months:12,weeks:52.1775,days:mi,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:gi,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...ui},vi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],bi=vi.slice(0).reverse();function yi(t,e){const i={values:arguments.length>2&&void 0!==arguments[2]&&arguments[2]?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new Ai(i)}function xi(t,e){let i=e.milliseconds??0;for(const n of bi.slice(1))e[n]&&(i+=e[n]*t[n].milliseconds);return i}function wi(t,e){const i=xi(t,e)<0?-1:1;vi.reduceRight(((n,s)=>{if(Ft(e[s]))return n;if(n){const a=e[n]*i,r=t[s][n],o=Math.floor(a/r);e[s]+=o*i,e[n]-=o*r*i}return s}),null),vi.reduce(((i,n)=>{if(Ft(e[n]))return i;if(i){const s=e[i]%1;e[i]-=s,e[n]+=s*t[i][n]}return n}),null)}class Ai{constructor(t){const e="longterm"===t.conversionAccuracy||!1;let i=e?fi:pi;t.matrix&&(i=t.matrix),this.values=t.values,this.loc=t.loc||et.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(t,e){return Ai.fromObject({milliseconds:t},e)}static fromObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==t||"object"!==typeof t)throw new c("Duration.fromObject: argument expected to be an object, got "+(null===t?"null":typeof t));return new Ai({values:ae(t,Ai.normalizeUnit),loc:et.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(Ot(t))return Ai.fromMillis(t);if(Ai.isDuration(t))return t;if("object"===typeof t)return Ai.fromObject(t);throw new c(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[i]=function(t){return Ee(t,[Ve,$e])}(t);return i?Ai.fromObject(i,e):Ai.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[i]=function(t){return Ee(t,[Be,oi])}(t);return i?Ai.fromObject(i,e):Ai.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)throw new c("need to specify a reason the Duration is invalid");const i=t instanceof xt?t:new xt(t,e);if(yt.throwOnInvalid)throw new r(i);return new Ai({invalid:i})}static normalizeUnit(t){const e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t?t.toLowerCase():t];if(!e)throw new l(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i={...e,floor:!1!==e.round&&!1!==e.floor};return this.isValid?_e.create(this.loc,i).formatDurationFromString(this,t):di}toHuman(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.isValid)return di;const e=vi.map((e=>{const i=this.values[e];return Ft(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:e.slice(0,-1)}).format(i)})).filter((t=>t));return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(e)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return 0!==this.years&&(t+=this.years+"Y"),0===this.months&&0===this.quarters||(t+=this.months+3*this.quarters+"M"),0!==this.weeks&&(t+=this.weeks+"W"),0!==this.days&&(t+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(t+="T"),0!==this.hours&&(t+=this.hours+"H"),0!==this.minutes&&(t+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(t+=Yt(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===t&&(t+="T0S"),t}toISOTime(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.isValid)return null;const e=this.toMillis();if(e<0||e>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1};return gn.fromMillis(e,{zone:"UTC"}).toISOTime(t)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?xi(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=Ai.fromDurationLike(t),i={};for(const n of vi)(Bt(e.values,n)||Bt(this.values,n))&&(i[n]=e.get(n)+this.get(n));return yi(this,{values:i},!0)}minus(t){if(!this.isValid)return this;const e=Ai.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;const e={};for(const i of Object.keys(this.values))e[i]=se(t(this.values[i],i));return yi(this,{values:e},!0)}get(t){return this[Ai.normalizeUnit(t)]}set(t){if(!this.isValid)return this;return yi(this,{values:{...this.values,...ae(t,Ai.normalizeUnit)}})}reconfigure(){let{locale:t,numberingSystem:e,conversionAccuracy:i,matrix:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return yi(this,{loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:n,conversionAccuracy:i})}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return wi(this.matrix,t),yi(this,{values:t},!0)}rescale(){if(!this.isValid)return this;return yi(this,{values:function(t){const e={};for(const[i,n]of Object.entries(t))0!==n&&(e[i]=n);return e}(this.normalize().shiftToAll().toObject())},!0)}shiftTo(){for(var t=arguments.length,e=new Array(t),i=0;iAi.normalizeUnit(t)));const n={},s={},a=this.toObject();let r;for(const o of vi)if(e.indexOf(o)>=0){r=o;let t=0;for(const i in s)t+=this.matrix[i][o]*s[i],s[i]=0;Ot(a[o])&&(t+=a[o]);const e=Math.trunc(t);n[o]=e,s[o]=(1e3*t-1e3*e)/1e3}else Ot(a[o])&&(s[o]=a[o]);for(const o in s)0!==s[o]&&(n[r]+=o===r?s[o]:s[o]/this.matrix[r][o]);return wi(this.matrix,n),yi(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const e of Object.keys(this.values))t[e]=0===this.values[e]?0:-this.values[e];return yi(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid)return!1;if(!this.loc.equals(t.loc))return!1;for(const n of vi)if(e=this.values[n],i=t.values[n],!(void 0===e||0===e?void 0===i||0===i:e===i))return!1;var e,i;return!0}}const _i="Invalid Interval";class Si{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)throw new c("need to specify a reason the Interval is invalid");const i=t instanceof xt?t:new xt(t,e);if(yt.throwOnInvalid)throw new a(i);return new Si({invalid:i})}static fromDateTimes(t,e){const i=fn(t),n=fn(e),s=function(t,e){return t&&t.isValid?e&&e.isValid?e0&&void 0!==arguments[0]?arguments[0]:"milliseconds";return this.isValid?this.toDuration(t).get(t):NaN}count(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"milliseconds",e=arguments.length>1?arguments[1]:void 0;if(!this.isValid)return NaN;const i=this.start.startOf(t,e);let n;return n=e?.useLocaleWeeks?this.end.reconfigure({locale:i.locale}):this.end,n=n.startOf(t,e),Math.floor(n.diff(i,t).get(t))+(n.valueOf()!==this.end.valueOf())}hasSame(t){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,t))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return!!this.isValid&&this.s>t}isBefore(t){return!!this.isValid&&this.e<=t}contains(t){return!!this.isValid&&(this.s<=t&&this.e>t)}set(){let{start:t,end:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.isValid?Si.fromDateTimes(t||this.s,e||this.e):this}splitAt(){if(!this.isValid)return[];for(var t=arguments.length,e=new Array(t),i=0;ithis.contains(t))).sort(((t,e)=>t.toMillis()-e.toMillis())),s=[];let{s:a}=this,r=0;for(;a+this.e?this.e:t;s.push(Si.fromDateTimes(a,e)),a=e,r+=1}return s}splitBy(t){const e=Ai.fromDurationLike(t);if(!this.isValid||!e.isValid||0===e.as("milliseconds"))return[];let i,{s:n}=this,s=1;const a=[];for(;nt*s)));i=+t>+this.e?this.e:t,a.push(Si.fromDateTimes(n,i)),n=i,s+=1}return a}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e)}equals(t){return!(!this.isValid||!t.isValid)&&(this.s.equals(t.s)&&this.e.equals(t.e))}intersection(t){if(!this.isValid)return this;const e=this.s>t.s?this.s:t.s,i=this.e=i?null:Si.fromDateTimes(e,i)}union(t){if(!this.isValid)return this;const e=this.st.e?this.e:t.e;return Si.fromDateTimes(e,i)}static merge(t){const[e,i]=t.sort(((t,e)=>t.s-e.s)).reduce(((t,e)=>{let[i,n]=t;return n?n.overlaps(e)||n.abutsStart(e)?[i,n.union(e)]:[i.concat([n]),e]:[i,e]}),[[],null]);return i&&e.push(i),e}static xor(t){let e=null,i=0;const n=[],s=t.map((t=>[{time:t.s,type:"s"},{time:t.e,type:"e"}])),a=Array.prototype.concat(...s).sort(((t,e)=>t.time-e.time));for(const r of a)i+="s"===r.type?1:-1,1===i?e=r.time:(e&&+e!==+r.time&&n.push(Si.fromDateTimes(e,r.time)),e=null);return Si.merge(n)}difference(){for(var t=arguments.length,e=new Array(t),i=0;ithis.intersection(t))).filter((t=>t&&!t.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:_i}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.isValid?_e.create(this.s.loc.clone(e),t).formatInterval(this):_i}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:_i}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:_i}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:_i}toFormat(t){let{separator:e=" \u2013 "}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:_i}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):Ai.invalid(this.invalidReason)}mapEndpoints(t){return Si.fromDateTimes(t(this.s),t(this.e))}}class ki{static hasDST(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:yt.defaultZone;const e=gn.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return V.isValidZone(t)}static normalizeZone(t){return at(t,yt.defaultZone)}static getStartOfWeek(){let{locale:t=null,locObj:e=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e||et.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek(){let{locale:t=null,locObj:e=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e||et.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays(){let{locale:t=null,locObj:e=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e||et.create(t)).getWeekendDays().slice()}static months(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:s="gregory"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(n||et.create(e,i,s)).months(t)}static monthsFormat(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:s="gregory"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(n||et.create(e,i,s)).months(t,!0)}static weekdays(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"long",{locale:e=null,numberingSystem:i=null,locObj:n=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(n||et.create(e,i,null)).weekdays(t)}static weekdaysFormat(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"long",{locale:e=null,numberingSystem:i=null,locObj:n=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(n||et.create(e,i,null)).weekdays(t,!0)}static meridiems(){let{locale:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return et.create(t).meridiems()}static eras(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"short",{locale:e=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return et.create(e,null,"gregory").eras(t)}static features(){return{relative:jt(),localeWeek:zt()}}}function Ci(t,e){const i=t=>t.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=i(e)-i(t);return Math.floor(Ai.fromMillis(n).as("days"))}function Ei(t,e,i,n){let[s,a,r,o]=function(t,e,i){const n=[["years",(t,e)=>e.year-t.year],["quarters",(t,e)=>e.quarter-t.quarter+4*(e.year-t.year)],["months",(t,e)=>e.month-t.month+12*(e.year-t.year)],["weeks",(t,e)=>{const i=Ci(t,e);return(i-i%7)/7}],["days",Ci]],s={},a=t;let r,o;for(const[l,c]of n)i.indexOf(l)>=0&&(r=l,s[l]=c(t,e),o=a.plus(s),o>e?(s[l]--,(t=a.plus(s))>e&&(o=t,s[l]--,t=a.plus(s))):t=o);return[t,s,o,r]}(t,e,i);const l=e-s,c=i.filter((t=>["hours","minutes","seconds","milliseconds"].indexOf(t)>=0));0===c.length&&(r0?Ai.fromMillis(l,n).shiftTo(...c).plus(h):h}function Ti(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t=>t;return{regex:t,deser:t=>{let[i]=t;return e(function(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let i=0;i=i&&n<=s&&(e+=n-i)}}return parseInt(e,10)}return e}(i))}}}const Mi=`[ ${String.fromCharCode(160)}]`,Di=new RegExp(Mi,"g");function Ii(t){return t.replace(/\./g,"\\.?").replace(Di,Mi)}function Ri(t){return t.replace(/\./g,"").replace(Di," ").toLowerCase()}function Pi(t,e){return null===t?null:{regex:RegExp(t.map(Ii).join("|")),deser:i=>{let[n]=i;return t.findIndex((t=>Ri(n)===Ri(t)))+e}}}function Li(t,e){return{regex:t,deser:t=>{let[,e,i]=t;return ne(e,i)},groups:e}}function Fi(t){return{regex:t,deser:t=>{let[e]=t;return e}}}const Oi={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let Ni=null;function ji(t,e){return Array.prototype.concat(...t.map((t=>function(t,e){if(t.literal)return t;const i=Bi(_e.macroTokenToFormatOpts(t.val),e);return null==i||i.includes(void 0)?t:i}(t,e))))}class zi{constructor(t,e){if(this.locale=t,this.format=e,this.tokens=ji(_e.parseFormat(e),t),this.units=this.tokens.map((e=>function(t,e){const i=ht(e),n=ht(e,"{2}"),s=ht(e,"{3}"),a=ht(e,"{4}"),r=ht(e,"{6}"),o=ht(e,"{1,2}"),l=ht(e,"{1,3}"),c=ht(e,"{1,6}"),h=ht(e,"{1,9}"),d=ht(e,"{2,4}"),u=ht(e,"{4,6}"),p=t=>{return{regex:RegExp((e=t.val,e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:t=>{let[e]=t;return e},literal:!0};var e},m=(m=>{if(t.literal)return p(m);switch(m.val){case"G":return Pi(e.eras("short"),0);case"GG":return Pi(e.eras("long"),0);case"y":return Ti(c);case"yy":case"kk":return Ti(d,ee);case"yyyy":case"kkkk":return Ti(a);case"yyyyy":return Ti(u);case"yyyyyy":return Ti(r);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Ti(o);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Ti(n);case"MMM":return Pi(e.months("short",!0),1);case"MMMM":return Pi(e.months("long",!0),1);case"LLL":return Pi(e.months("short",!1),1);case"LLLL":return Pi(e.months("long",!1),1);case"o":case"S":return Ti(l);case"ooo":case"SSS":return Ti(s);case"u":return Fi(h);case"uu":return Fi(o);case"uuu":case"E":case"c":return Ti(i);case"a":return Pi(e.meridiems(),0);case"EEE":return Pi(e.weekdays("short",!1),1);case"EEEE":return Pi(e.weekdays("long",!1),1);case"ccc":return Pi(e.weekdays("short",!0),1);case"cccc":return Pi(e.weekdays("long",!0),1);case"Z":case"ZZ":return Li(new RegExp(`([+-]${o.source})(?::(${n.source}))?`),2);case"ZZZ":return Li(new RegExp(`([+-]${o.source})(${n.source})?`),2);case"z":return Fi(/[a-z_+-/]{1,256}?/i);case" ":return Fi(/[^\S\n\r]/);default:return p(m)}})(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return m.token=t,m}(e,t))),this.disqualifyingUnit=this.units.find((t=>t.invalidReason)),!this.disqualifyingUnit){const[t,e]=[`^${(i=this.units).map((t=>t.regex)).reduce(((t,e)=>`${t}(${e.source})`),"")}$`,i];this.regex=RegExp(t,"i"),this.handlers=e}var i}explainFromTokens(t){if(this.isValid){const[e,i]=function(t,e,i){const n=t.match(e);if(n){const t={};let e=1;for(const s in i)if(Bt(i,s)){const a=i[s],r=a.groups?a.groups+1:1;!a.literal&&a.token&&(t[a.token.val[0]]=a.deser(n.slice(e,e+r))),e+=r}return[n,t]}return[n,{}]}(t,this.regex,this.handlers),[n,s,a]=i?function(t){let e,i=null;return Ft(t.z)||(i=V.create(t.z)),Ft(t.Z)||(i||(i=new nt(t.Z)),e=t.Z),Ft(t.q)||(t.M=3*(t.q-1)+1),Ft(t.h)||(t.h<12&&1===t.a?t.h+=12:12===t.h&&0===t.a&&(t.h=0)),0===t.G&&t.y&&(t.y=-t.y),Ft(t.u)||(t.S=Gt(t.u)),[Object.keys(t).reduce(((e,i)=>{const n=(t=>{switch(t){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(i);return n&&(e[n]=t[i]),e}),{}),i,e]}(i):[null,null,void 0];if(Bt(i,"a")&&Bt(i,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:e,matches:i,result:n,zone:s,specificOffset:a}}return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Hi(t,e,i){return new zi(t,i).explainFromTokens(e)}function Bi(t,e){if(!t)return null;const i=_e.create(e,t).dtFormatter((Ni||(Ni=gn.fromMillis(1555555555555)),Ni)),n=i.formatToParts(),s=i.resolvedOptions();return n.map((e=>function(t,e,i){const{type:n,value:s}=t;if("literal"===n){const t=/^\s+$/.test(s);return{literal:!t,val:t?" ":s}}const a=e[n];let r=n;"hour"===n&&(r=null!=e.hour12?e.hour12?"hour12":"hour24":null!=e.hourCycle?"h11"===e.hourCycle||"h12"===e.hourCycle?"hour12":"hour24":i.hour12?"hour12":"hour24");let o=Oi[r];if("object"===typeof o&&(o=o[a]),o)return{literal:!1,val:o}}(e,t,s)))}const Vi="Invalid DateTime",$i=864e13;function Ui(t){return new xt("unsupported zone",`the zone "${t.name}" is not supported`)}function Wi(t){return null===t.weekData&&(t.weekData=Tt(t.c)),t.weekData}function qi(t){return null===t.localWeekData&&(t.localWeekData=Tt(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function Gi(t,e){const i={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new gn({...i,...e,old:i})}function Yi(t,e,i){let n=t-60*e*1e3;const s=i.offset(n);if(e===s)return[n,e];n-=60*(s-e)*1e3;const a=i.offset(n);return s===a?[n,s]:[t-60*Math.min(s,a)*1e3,Math.max(s,a)]}function Xi(t,e){const i=new Date(t+=60*e*1e3);return{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}function Ki(t,e,i){return Yi(Jt(t),e,i)}function Zi(t,e){const i=t.o,n=t.c.year+Math.trunc(e.years),s=t.c.month+Math.trunc(e.months)+3*Math.trunc(e.quarters),a={...t.c,year:n,month:s,day:Math.min(t.c.day,Zt(n,s))+Math.trunc(e.days)+7*Math.trunc(e.weeks)},r=Ai.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),o=Jt(a);let[l,c]=Yi(o,i,t.zone);return 0!==r&&(l+=r,c=t.zone.offset(l)),{ts:l,o:c}}function Ji(t,e,i,n,s,a){const{setZone:r,zone:o}=i;if(t&&0!==Object.keys(t).length||e){const n=e||o,s=gn.fromObject(t,{...i,zone:n,specificOffset:a});return r?s:s.setZone(o)}return gn.invalid(new xt("unparsable",`the input "${s}" can't be parsed as ${n}`))}function Qi(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t.isValid?_e.create(et.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(t,e):null}function tn(t,e){const i=t.c.year>9999||t.c.year<0;let n="";return i&&t.c.year>=0&&(n+="+"),n+=Ut(t.c.year,i?6:4),e?(n+="-",n+=Ut(t.c.month),n+="-",n+=Ut(t.c.day)):(n+=Ut(t.c.month),n+=Ut(t.c.day)),n}function en(t,e,i,n,s,a){let r=Ut(t.c.hour);return e?(r+=":",r+=Ut(t.c.minute),0===t.c.millisecond&&0===t.c.second&&i||(r+=":")):r+=Ut(t.c.minute),0===t.c.millisecond&&0===t.c.second&&i||(r+=Ut(t.c.second),0===t.c.millisecond&&n||(r+=".",r+=Ut(t.c.millisecond,3))),s&&(t.isOffsetFixed&&0===t.offset&&!a?r+="Z":t.o<0?(r+="-",r+=Ut(Math.trunc(-t.o/60)),r+=":",r+=Ut(Math.trunc(-t.o%60))):(r+="+",r+=Ut(Math.trunc(t.o/60)),r+=":",r+=Ut(Math.trunc(t.o%60)))),a&&(r+="["+t.zone.ianaName+"]"),r}const nn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},sn={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},an={ordinal:1,hour:0,minute:0,second:0,millisecond:0},rn=["year","month","day","hour","minute","second","millisecond"],on=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ln=["year","ordinal","hour","minute","second","millisecond"];function cn(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new l(t);return e}(t)}}function hn(t,e){const i=at(e.zone,yt.defaultZone);if(!i.isValid)return gn.invalid(Ui(i));const n=et.fromObject(e);let s,a;if(Ft(t.year))s=yt.now();else{for(const i of rn)Ft(t[i])&&(t[i]=nn[i]);const e=Pt(t)||Lt(t);if(e)return gn.invalid(e);const n=function(t){return mn[t]||(void 0===pn&&(pn=yt.now()),mn[t]=t.offset(pn)),mn[t]}(i);[s,a]=Ki(t,n,i)}return new gn({ts:s,zone:i,loc:n,o:a})}function dn(t,e,i){const n=!!Ft(i.round)||i.round,s=(t,s)=>{t=Yt(t,n||i.calendary?0:2,!0);return e.loc.clone(i).relFormatter(i).format(t,s)},a=n=>i.calendary?e.hasSame(t,n)?0:e.startOf(n).diff(t.startOf(n),n).get(n):e.diff(t,n).get(n);if(i.unit)return s(a(i.unit),i.unit);for(const r of i.units){const t=a(r);if(Math.abs(t)>=1)return s(t,r)}return s(t>e?-0:0,i.units[i.units.length-1])}function un(t){let e,i={};return t.length>0&&"object"===typeof t[t.length-1]?(i=t[t.length-1],e=Array.from(t).slice(0,t.length-1)):e=Array.from(t),[i,e]}let pn,mn={};class gn{constructor(t){const e=t.zone||yt.defaultZone;let i=t.invalid||(Number.isNaN(t.ts)?new xt("invalid input"):null)||(e.isValid?null:Ui(e));this.ts=Ft(t.ts)?yt.now():t.ts;let n=null,s=null;if(!i){if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[n,s]=[t.old.c,t.old.o];else{const a=Ot(t.o)&&!t.old?t.o:e.offset(this.ts);n=Xi(this.ts,a),i=Number.isNaN(n.year)?new xt("invalid input"):null,n=i?null:n,s=i?null:a}}this._zone=e,this.loc=t.loc||et.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=n,this.o=s,this.isLuxonDateTime=!0}static now(){return new gn({})}static local(){const[t,e]=un(arguments),[i,n,s,a,r,o,l]=e;return hn({year:i,month:n,day:s,hour:a,minute:r,second:o,millisecond:l},t)}static utc(){const[t,e]=un(arguments),[i,n,s,a,r,o,l]=e;return t.zone=nt.utcInstance,hn({year:i,month:n,day:s,hour:a,minute:r,second:o,millisecond:l},t)}static fromJSDate(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=(n=t,"[object Date]"===Object.prototype.toString.call(n)?t.valueOf():NaN);var n;if(Number.isNaN(i))return gn.invalid("invalid input");const s=at(e.zone,yt.defaultZone);return s.isValid?new gn({ts:i,zone:s,loc:et.fromObject(e)}):gn.invalid(Ui(s))}static fromMillis(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Ot(t))return t<-$i||t>$i?gn.invalid("Timestamp out of range"):new gn({ts:t,zone:at(e.zone,yt.defaultZone),loc:et.fromObject(e)});throw new c(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Ot(t))return new gn({ts:1e3*t,zone:at(e.zone,yt.defaultZone),loc:et.fromObject(e)});throw new c("fromSeconds requires a numerical input")}static fromObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=t||{};const i=at(e.zone,yt.defaultZone);if(!i.isValid)return gn.invalid(Ui(i));const n=et.fromObject(e),s=ae(t,cn),{minDaysInFirstWeek:a,startOfWeek:r}=Rt(s,n),l=yt.now(),c=Ft(e.specificOffset)?i.offset(l):e.specificOffset,h=!Ft(s.ordinal),d=!Ft(s.year),u=!Ft(s.month)||!Ft(s.day),p=d||u,m=s.weekYear||s.weekNumber;if((p||h)&&m)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&h)throw new o("Can't mix ordinal dates with month/day");const g=m||s.weekday&&!p;let f,v,b=Xi(l,c);g?(f=on,v=sn,b=Tt(b,a,r)):h?(f=ln,v=an,b=Dt(b)):(f=rn,v=nn);let y=!1;for(const o of f){Ft(s[o])?s[o]=y?v[o]:b[o]:y=!0}const x=g?function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const n=Nt(t.weekYear),s=$t(t.weekNumber,1,te(t.weekYear,e,i)),a=$t(t.weekday,1,7);return n?s?!a&&_t("weekday",t.weekday):_t("week",t.weekNumber):_t("weekYear",t.weekYear)}(s,a,r):h?function(t){const e=Nt(t.year),i=$t(t.ordinal,1,Kt(t.year));return e?!i&&_t("ordinal",t.ordinal):_t("year",t.year)}(s):Pt(s),w=x||Lt(s);if(w)return gn.invalid(w);const A=g?Mt(s,a,r):h?It(s):s,[_,S]=Ki(A,c,i),k=new gn({ts:_,zone:i,o:S,loc:n});return s.weekday&&p&&t.weekday!==k.weekday?gn.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${k.toISO()}`):k.isValid?k:gn.invalid(k.invalid)}static fromISO(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[i,n]=function(t){return Ee(t,[Qe,ni],[ti,si],[ei,ai],[ii,ri])}(t);return Ji(i,n,e,"ISO 8601",t)}static fromRFC2822(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[i,n]=function(t){return Ee(function(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(t),[qe,Ge])}(t);return Ji(i,n,e,"RFC 2822",t)}static fromHTTP(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[i,n]=function(t){return Ee(t,[Ye,Ze],[Xe,Ze],[Ke,Je])}(t);return Ji(i,n,e,"HTTP",e)}static fromFormat(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Ft(t)||Ft(e))throw new c("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:s=null}=i,a=et.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0}),[r,o,l,h]=function(t,e,i){const{result:n,zone:s,specificOffset:a,invalidReason:r}=Hi(t,e,i);return[n,s,a,r]}(a,t,e);return h?gn.invalid(h):Ji(r,o,i,`format ${e}`,t,l)}static fromString(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return gn.fromFormat(t,e,i)}static fromSQL(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[i,n]=function(t){return Ee(t,[li,ni],[ci,hi])}(t);return Ji(i,n,e,"SQL",t)}static invalid(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)throw new c("need to specify a reason the DateTime is invalid");const i=t instanceof xt?t:new xt(t,e);if(yt.throwOnInvalid)throw new s(i);return new gn({invalid:i})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=Bi(t,et.fromObject(e));return i?i.map((t=>t?t.val:null)).join(""):null}static expandFormat(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ji(_e.parseFormat(t),et.fromObject(e)).map((t=>t.val)).join("")}static resetCache(){pn=void 0,mn={}}get(t){return this[t]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Wi(this).weekYear:NaN}get weekNumber(){return this.isValid?Wi(this).weekNumber:NaN}get weekday(){return this.isValid?Wi(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?qi(this).weekday:NaN}get localWeekNumber(){return this.isValid?qi(this).weekNumber:NaN}get localWeekYear(){return this.isValid?qi(this).weekYear:NaN}get ordinal(){return this.isValid?Dt(this.c).ordinal:NaN}get monthShort(){return this.isValid?ki.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ki.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ki.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ki.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,e=6e4,i=Jt(this.c),n=this.zone.offset(i-t),s=this.zone.offset(i+t),a=this.zone.offset(i-n*e),r=this.zone.offset(i-s*e);if(a===r)return[this];const o=i-a*e,l=i-r*e,c=Xi(o,a),h=Xi(l,r);return c.hour===h.hour&&c.minute===h.minute&&c.second===h.second&&c.millisecond===h.millisecond?[Gi(this,{ts:o}),Gi(this,{ts:l})]:[this]}get isInLeapYear(){return Xt(this.year)}get daysInMonth(){return Zt(this.year,this.month)}get daysInYear(){return this.isValid?Kt(this.year):NaN}get weeksInWeekYear(){return this.isValid?te(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?te(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{locale:e,numberingSystem:i,calendar:n}=_e.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:i,outputCalendar:n}}toUTC(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.setZone(nt.instance(t),e)}toLocal(){return this.setZone(yt.defaultZone)}setZone(t){let{keepLocalTime:e=!1,keepCalendarTime:i=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((t=at(t,yt.defaultZone)).equals(this.zone))return this;if(t.isValid){let n=this.ts;if(e||i){const e=t.offset(this.ts),i=this.toObject();[n]=Ki(i,e,t)}return Gi(this,{ts:n,zone:t})}return gn.invalid(Ui(t))}reconfigure(){let{locale:t,numberingSystem:e,outputCalendar:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Gi(this,{loc:this.loc.clone({locale:t,numberingSystem:e,outputCalendar:i})})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=ae(t,cn),{minDaysInFirstWeek:i,startOfWeek:n}=Rt(e,this.loc),s=!Ft(e.weekYear)||!Ft(e.weekNumber)||!Ft(e.weekday),a=!Ft(e.ordinal),r=!Ft(e.year),l=!Ft(e.month)||!Ft(e.day),c=r||l,h=e.weekYear||e.weekNumber;if((c||a)&&h)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&a)throw new o("Can't mix ordinal dates with month/day");let d;s?d=Mt({...Tt(this.c,i,n),...e},i,n):Ft(e.ordinal)?(d={...this.toObject(),...e},Ft(e.day)&&(d.day=Math.min(Zt(d.year,d.month),d.day))):d=It({...Dt(this.c),...e});const[u,p]=Ki(d,this.o,this.zone);return Gi(this,{ts:u,o:p})}plus(t){if(!this.isValid)return this;return Gi(this,Zi(this,Ai.fromDurationLike(t)))}minus(t){if(!this.isValid)return this;return Gi(this,Zi(this,Ai.fromDurationLike(t).negate()))}startOf(t){let{useLocaleWeeks:e=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isValid)return this;const i={},n=Ai.normalizeUnit(t);switch(n){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0}if("weeks"===n)if(e){const t=this.loc.getStartOfWeek(),{weekday:e}=this;e1&&void 0!==arguments[1]?arguments[1]:{};return this.isValid?_e.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):Vi}toLocaleString(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.isValid?_e.create(this.loc.clone(e),t).formatDateTime(this):Vi}toLocaleParts(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.isValid?_e.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO(){let{format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:i=!1,includeOffset:n=!0,extendedZone:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.isValid)return null;const a="extended"===t;let r=tn(this,a);return r+="T",r+=en(this,a,e,i,n,s),r}toISODate(){let{format:t="extended"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.isValid?tn(this,"extended"===t):null}toISOWeekDate(){return Qi(this,"kkkk-'W'WW-c")}toISOTime(){let{suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:i=!0,includePrefix:n=!1,extendedZone:s=!1,format:a="extended"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.isValid?(n?"T":"")+en(this,"extended"===a,e,t,i,s):null}toRFC2822(){return Qi(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Qi(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?tn(this,!0):null}toSQLTime(){let{includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:i=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="HH:mm:ss.SSS";return(e||t)&&(i&&(n+=" "),e?n+="z":t&&(n+="ZZ")),Qi(this,n,!0)}toSQL(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Vi}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.isValid)return{};const e={...this.c};return t.includeConfig&&(e.outputCalendar=this.outputCalendar,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"milliseconds",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!this.isValid||!t.isValid)return Ai.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...i},s=(o=e,Array.isArray(o)?o:[o]).map(Ai.normalizeUnit),a=t.valueOf()>this.valueOf(),r=Ei(a?this:t,a?t:this,s,n);var o;return a?r.negate():r}diffNow(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"milliseconds",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.diff(gn.now(),t,e)}until(t){return this.isValid?Si.fromDateTimes(this,t):this}hasSame(t,e,i){if(!this.isValid)return!1;const n=t.valueOf(),s=this.setZone(t.zone,{keepLocalTime:!0});return s.startOf(e,i)<=n&&n<=s.endOf(e,i)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.isValid)return null;const e=t.base||gn.fromObject({},{zone:this.zone}),i=t.padding?this0&&void 0!==arguments[0]?arguments[0]:{};return this.isValid?dn(t.base||gn.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(){for(var t=arguments.length,e=new Array(t),i=0;it.valueOf()),Math.min)}static max(){for(var t=arguments.length,e=new Array(t),i=0;it.valueOf()),Math.max)}static fromFormatExplain(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{locale:n=null,numberingSystem:s=null}=i;return Hi(et.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0}),t,e)}static fromStringExplain(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return gn.fromFormatExplain(t,e,i)}static buildFormatParser(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{locale:i=null,numberingSystem:n=null}=e,s=et.fromOpts({locale:i,numberingSystem:n,defaultToEN:!0});return new zi(s,t)}static fromFormatParser(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Ft(t)||Ft(e))throw new c("fromFormatParser requires an input string and a format parser");const{locale:n=null,numberingSystem:s=null}=i,a=et.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0});if(!a.equals(e.locale))throw new c(`fromFormatParser called with a locale of ${a}, but the format parser was created for ${e.locale}`);const{result:r,zone:o,specificOffset:l,invalidReason:h}=e.explainFromTokens(t);return h?gn.invalid(h):Ji(r,o,i,`format ${e.format}`,t,l)}static get DATE_SHORT(){return m}static get DATE_MED(){return g}static get DATE_MED_WITH_WEEKDAY(){return f}static get DATE_FULL(){return v}static get DATE_HUGE(){return b}static get TIME_SIMPLE(){return y}static get TIME_WITH_SECONDS(){return x}static get TIME_WITH_SHORT_OFFSET(){return w}static get TIME_WITH_LONG_OFFSET(){return A}static get TIME_24_SIMPLE(){return _}static get TIME_24_WITH_SECONDS(){return S}static get TIME_24_WITH_SHORT_OFFSET(){return k}static get TIME_24_WITH_LONG_OFFSET(){return C}static get DATETIME_SHORT(){return E}static get DATETIME_SHORT_WITH_SECONDS(){return T}static get DATETIME_MED(){return M}static get DATETIME_MED_WITH_SECONDS(){return D}static get DATETIME_MED_WITH_WEEKDAY(){return I}static get DATETIME_FULL(){return R}static get DATETIME_FULL_WITH_SECONDS(){return P}static get DATETIME_HUGE(){return L}static get DATETIME_HUGE_WITH_SECONDS(){return F}}function fn(t){if(gn.isDateTime(t))return t;if(t&&t.valueOf&&Ot(t.valueOf()))return gn.fromJSDate(t);if(t&&"object"===typeof t)return gn.fromObject(t);throw new c(`Unknown datetime argument: ${t}, of type ${typeof t}`)}},645:(t,e,i)=>{"use strict";function n(t){var e=!1;return{promise:new Promise((function(i,n){t.then((function(t){return!e&&i(t)})).catch((function(t){return!e&&n(t)}))})),cancel:function(){e=!0}}}i.d(e,{A:()=>n})},7906:(t,e,i)=>{"use strict";i.d(e,{Ay:()=>a});var n=function(t,e,i){if(i||2===arguments.length)for(var n,s=0,a=e.length;s{"use strict";i.d(e,{D6:()=>As,EA:()=>xs,Tm:()=>ws,YE:()=>_s,dU:()=>bs,ng:()=>ys});var n={d:(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},s=globalThis.pdfjsLib={};n.d(s,{AbortException:()=>ft,AnnotationEditorLayer:()=>fs,AnnotationEditorParamsType:()=>y,AnnotationEditorType:()=>b,AnnotationEditorUIManager:()=>he,AnnotationLayer:()=>is,AnnotationMode:()=>v,ColorPicker:()=>us,DOMSVGFactory:()=>Sn,DrawLayer:()=>vs,FeatureTest:()=>xt,GlobalWorkerOptions:()=>oi,ImageKind:()=>E,InvalidPDFException:()=>ut,MissingPDFException:()=>pt,OPS:()=>J,OutputScale:()=>ee,PDFDataRangeTransport:()=>ln,PDFDateString:()=>Xt,PDFWorker:()=>un,PasswordResponses:()=>Q,PermissionFlag:()=>x,PixelsPerInch:()=>Nt,RenderingCancelledException:()=>Ht,TextLayer:()=>Zi,UnexpectedResponseException:()=>mt,Util:()=>At,VerbosityLevel:()=>Z,XfaLayer:()=>kn,build:()=>yn,createValidAbsoluteUrl:()=>ot,fetchData:()=>jt,getDocument:()=>an,getFilenameFromUrl:()=>$t,getPdfFilenameFromUrl:()=>Ut,getXfaPageViewport:()=>Kt,isDataScheme:()=>Bt,isPdfFile:()=>Vt,noContextMenu:()=>Gt,normalizeUnicode:()=>kt,setLayerDimensions:()=>te,shadow:()=>lt,version:()=>bn});const a="object"===typeof process&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),r=[1,0,0,1,0,0],o=[.001,0,0,.001,0,0],l=1.35,c=1,h=2,d=4,u=16,p=32,m=64,g=128,f=256,v={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},b={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},y={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},x={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},w=0,A=1,_=2,S=3,k=3,C=4,E={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},T=1,M=2,D=3,I=4,R=5,P=6,L=7,F=8,O=9,N=10,j=11,z=12,H=13,B=14,V=15,$=16,U=17,W=20,q=1,G=2,Y=3,X=4,K=5,Z={ERRORS:0,WARNINGS:1,INFOS:5},J={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93},Q={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let tt=Z.WARNINGS;function et(t){Number.isInteger(t)&&(tt=t)}function it(){return tt}function nt(t){tt>=Z.INFOS&&console.log(`Info: ${t}`)}function st(t){tt>=Z.WARNINGS&&console.log(`Warning: ${t}`)}function at(t){throw new Error(t)}function rt(t,e){t||at(e)}function ot(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(i&&"string"===typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e?.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch{}}const n=e?new URL(t,e):new URL(t);if(function(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n))return n}catch{}return null}function lt(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(t,e,{value:i,enumerable:!n,configurable:!0,writable:!1}),i}const ct=function(){function t(t,e){this.message=t,this.name=e}return t.prototype=new Error,t.constructor=t,t}();class ht extends ct{constructor(t,e){super(t,"PasswordException"),this.code=e}}class dt extends ct{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class ut extends ct{constructor(t){super(t,"InvalidPDFException")}}class pt extends ct{constructor(t){super(t,"MissingPDFException")}}class mt extends ct{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}class gt extends ct{constructor(t){super(t,"FormatError")}}class ft extends ct{constructor(t){super(t,"AbortException")}}function vt(t){"object"===typeof t&&void 0!==t?.length||at("Invalid argument for bytesToString");const e=t.length,i=8192;if(et.toString(16).padStart(2,"0")));class At{static makeHexColor(t,e,i){return`#${wt[t]}${wt[e]}${wt[i]}`}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const i=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i]}static getAxialAlignedBoundingBox(t,e){const i=this.applyTransform(t,e),n=this.applyTransform(t.slice(2,4),e),s=this.applyTransform([t[0],t[3]],e),a=this.applyTransform([t[2],t[1]],e);return[Math.min(i[0],n[0],s[0],a[0]),Math.min(i[1],n[1],s[1],a[1]),Math.max(i[0],n[0],s[0],a[0]),Math.max(i[1],n[1],s[1],a[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],n=t[0]*e[1]+t[1]*e[3],s=t[2]*e[0]+t[3]*e[2],a=t[2]*e[1]+t[3]*e[3],r=(i+a)/2,o=Math.sqrt((i+a)**2-4*(i*a-s*n))/2,l=r+o||1,c=r-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>n)return null;const s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),a=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>a?null:[i,s,n,a]}static#t(t,e,i,n,s,a,r,o,l,c){if(l<=0||l>=1)return;const h=1-l,d=l*l,u=d*l,p=h*(h*(h*t+3*l*e)+3*d*i)+u*n,m=h*(h*(h*s+3*l*a)+3*d*r)+u*o;c[0]=Math.min(c[0],p),c[1]=Math.min(c[1],m),c[2]=Math.max(c[2],p),c[3]=Math.max(c[3],m)}static#e(t,e,i,n,s,a,r,o,l,c,h,d){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&this.#t(t,e,i,n,s,a,r,o,-h/c,d));const u=c**2-4*h*l;if(u<0)return;const p=Math.sqrt(u),m=2*l;this.#t(t,e,i,n,s,a,r,o,(-c+p)/m,d),this.#t(t,e,i,n,s,a,r,o,(-c-p)/m,d)}static bezierBoundingBox(t,e,i,n,s,a,r,o,l){return l?(l[0]=Math.min(l[0],t,r),l[1]=Math.min(l[1],e,o),l[2]=Math.max(l[2],t,r),l[3]=Math.max(l[3],e,o)):l=[Math.min(t,r),Math.min(e,o),Math.max(t,r),Math.max(e,o)],this.#e(t,i,s,r,e,n,a,o,3*(3*(i-s)-t+r),6*(t-2*i+s),3*(i-t),l),this.#e(t,i,s,r,e,n,a,o,3*(3*(n-a)-e+o),6*(e-2*n+a),3*(n-e),l),l}}let _t=null,St=null;function kt(t){return _t||(_t=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,St=new Map([["\ufb05","\u017ft"]])),t.replaceAll(_t,((t,e,i)=>e?e.normalize("NFKC"):St.get(i)))}const Ct="pdfjs_internal_id_",Et=0,Tt=1,Mt=2,Dt=3,It=4,Rt=5,Pt=6,Lt=7,Ft=8;const Ot="http://www.w3.org/2000/svg";class Nt{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=(()=>this.CSS/this.PDF)()}async function jt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";if(qt(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);switch(e){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise(((i,n)=>{const s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType=e,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE)if(200!==s.status&&0!==s.status)n(new Error(s.statusText));else{switch(e){case"arraybuffer":case"blob":case"json":return void i(s.response)}i(s.responseText)}},s.send(null)}))}class zt{constructor(t){let{viewBox:e,scale:i,rotation:n,offsetX:s=0,offsetY:a=0,dontFlip:r=!1}=t;this.viewBox=e,this.scale=i,this.rotation=n,this.offsetX=s,this.offsetY=a;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,h,d,u,p,m,g,f;switch(n%=360,n<0&&(n+=360),n){case 180:c=-1,h=0,d=0,u=1;break;case 90:c=0,h=1,d=1,u=0;break;case 270:c=0,h=-1,d=-1,u=0;break;case 0:c=1,h=0,d=0,u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}r&&(d=-d,u=-u),0===c?(p=Math.abs(l-e[1])*i+s,m=Math.abs(o-e[0])*i+a,g=(e[3]-e[1])*i,f=(e[2]-e[0])*i):(p=Math.abs(o-e[0])*i+s,m=Math.abs(l-e[1])*i+a,g=(e[2]-e[0])*i,f=(e[3]-e[1])*i),this.transform=[c*i,h*i,d*i,u*i,p-c*i*o-d*i*l,m-h*i*o-u*i*l],this.width=g,this.height=f}get rawDims(){const{viewBox:t}=this;return lt(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new zt({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(t,e){return At.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=At.applyTransform([t[0],t[1]],this.transform),i=At.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return At.applyInverseTransform([t,e],this.transform)}}class Ht extends ct{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException"),this.extraDelay=e}}function Bt(t){const e=t.length;let i=0;for(;i1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof t)return e;if(Bt(t))return st('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let s=i.exec(n[1])||i.exec(n[2])||i.exec(n[3]);if(s&&(s=s[0],s.includes("%")))try{s=i.exec(decodeURIComponent(s))[0]}catch{}return s||e}class Wt{started=(()=>Object.create(null))();times=[];time(t){t in this.started&&st(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||st(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:i}of this.times)e=Math.max(i.length,e);for(const{name:i,start:n,end:s}of this.times)t.push(`${i.padEnd(e)} ${s-n}ms\n`);return t.join("")}}function qt(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch{return!1}}function Gt(t){t.preventDefault()}function Yt(t){console.log("Deprecated API usage: "+t)}class Xt{static#i;static toDateObject(t){if(!t||"string"!==typeof t)return null;this.#i||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const e=this.#i.exec(t);if(!e)return null;const i=parseInt(e[1],10);let n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;let r=parseInt(e[5],10);r=r>=0&&r<=59?r:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;const l=e[7]||"Z";let c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let h=parseInt(e[9],10)||0;return h=h>=0&&h<=59?h:0,"-"===l?(a+=c,r+=h):"+"===l&&(a-=c,r-=h),new Date(Date.UTC(i,n,s,a,r,o))}}function Kt(t,e){let{scale:i=1,rotation:n=0}=e;const{width:s,height:a}=t.attributes.style,r=[0,0,parseInt(s),parseInt(a)];return new zt({viewBox:r,scale:i,rotation:n})}function Zt(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map((t=>parseInt(t))):t.startsWith("rgba(")?t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3):(st(`Not a valid color format: "${t}"`),[0,0,0])}function Jt(t){const{a:e,b:i,c:n,d:s,e:a,f:r}=t.getTransform();return[e,i,n,s,a,r]}function Qt(t){const{a:e,b:i,c:n,d:s,e:a,f:r}=t.getTransform().invertSelf();return[e,i,n,s,a,r]}function te(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e instanceof zt){const{pageWidth:n,pageHeight:s}=e.rawDims,{style:a}=t,r=xt.isCSSRoundSupported,o=`var(--scale-factor) * ${n}px`,l=`var(--scale-factor) * ${s}px`,c=r?`round(down, ${o}, var(--scale-round-x, 1px))`:`calc(${o})`,h=r?`round(down, ${l}, var(--scale-round-y, 1px))`:`calc(${l})`;i&&e.rotation%180!==0?(a.width=h,a.height=c):(a.width=c,a.height=h)}n&&t.setAttribute("data-main-rotation",e.rotation)}class ee{constructor(){const t=window.devicePixelRatio||1;this.sx=t,this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}}class ie{#n=null;#s=null;#a;#r=null;#o=null;static#l=null;constructor(t){this.#a=t,ie.#l||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button"})}render(){const t=this.#n=document.createElement("div");t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=this.#a._uiManager._signal;t.addEventListener("contextmenu",Gt,{signal:e}),t.addEventListener("pointerdown",ie.#c,{signal:e});const i=this.#r=document.createElement("div");i.className="buttons",t.append(i);const n=this.#a.toolbarPosition;if(n){const{style:e}=t,i="ltr"===this.#a._uiManager.direction?1-n[0]:n[0];e.insetInlineEnd=100*i+"%",e.top=`calc(${100*n[1]}% + var(--editor-toolbar-vert-offset))`}return this.#h(),t}get div(){return this.#n}static#c(t){t.stopPropagation()}#d(t){this.#a._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}#u(t){this.#a._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}#p(t){const e=this.#a._uiManager._signal;t.addEventListener("focusin",this.#d.bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",this.#u.bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",Gt,{signal:e})}hide(){this.#n.classList.add("hidden"),this.#s?.hideDropdown()}show(){this.#n.classList.remove("hidden"),this.#o?.shown()}#h(){const{editorType:t,_uiManager:e}=this.#a,i=document.createElement("button");i.className="delete",i.tabIndex=0,i.setAttribute("data-l10n-id",ie.#l[t]),this.#p(i),i.addEventListener("click",(t=>{e.delete()}),{signal:e._signal}),this.#r.append(i)}get#m(){const t=document.createElement("div");return t.className="divider",t}async addAltText(t){const e=await t.render();this.#p(e),this.#r.prepend(e,this.#m),this.#o=t}addColorPicker(t){this.#s=t;const e=t.renderButton();this.#p(e),this.#r.prepend(e,this.#m)}remove(){this.#n.remove(),this.#s?.destroy(),this.#s=null}}class ne{#r=null;#n=null;#g;constructor(t){this.#g=t}#f(){const t=this.#n=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",Gt,{signal:this.#g._signal});const e=this.#r=document.createElement("div");return e.className="buttons",t.append(e),this.#v(),t}#b(t,e){let i=0,n=0;for(const s of t){const t=s.y+s.height;if(ti?(n=a,i=t):e?a>n&&(n=a):a{this.#g.highlightSelection("floating_button")}),{signal:i}),this.#r.append(t)}}function se(t,e,i){for(const n of i)e.addEventListener(n,t[n].bind(t))}class ae{#y=0;get id(){return"pdfjs_internal_editor_"+this.#y++}}class re{#x=(()=>function(){if("undefined"!==typeof crypto&&"function"===typeof crypto?.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);if("undefined"!==typeof crypto&&"function"===typeof crypto?.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(255*Math.random());return vt(t)}())();#y=0;#w=null;static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),e=new Image;e.src='data:image/svg+xml;charset=UTF-8,';return lt(this,"_isSVGFittingCanvas",e.decode().then((()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]))))}async#A(t,e){this.#w||=new Map;let i=this.#w.get(t);if(null===i)return null;if(i?.bitmap)return i.refCounter+=1,i;try{let t;if(i||={bitmap:null,id:`image_${this.#x}_${this.#y++}`,refCounter:0,isSvg:!1},"string"===typeof e?(i.url=e,t=await jt(e,"blob")):e instanceof File?t=i.file=e:e instanceof Blob&&(t=e),"image/svg+xml"===t.type){const e=re._isSVGFittingCanvas,n=new FileReader,s=new Image,a=new Promise(((t,a)=>{s.onload=()=>{i.bitmap=s,i.isSvg=!0,t()},n.onload=async()=>{const t=i.svgUrl=n.result;s.src=await e?`${t}#svgView(preserveAspectRatio(none))`:t},s.onerror=n.onerror=a}));n.readAsDataURL(t),await a}else i.bitmap=await createImageBitmap(t);i.refCounter=1}catch(n){console.error(n),i=null}return this.#w.set(t,i),i&&this.#w.set(i.id,i),i}async getFromFile(t){const{lastModified:e,name:i,size:n,type:s}=t;return this.#A(`${e}_${i}_${n}_${s}`,t)}async getFromUrl(t){return this.#A(t,t)}async getFromBlob(t,e){const i=await e;return this.#A(t,i)}async getFromId(t){this.#w||=new Map;const e=this.#w.get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){const{blobPromise:t}=e;return delete e.blobPromise,this.getFromBlob(e.id,t)}return this.getFromUrl(e.url)}getFromCanvas(t,e){this.#w||=new Map;let i=this.#w.get(t);if(i?.bitmap)return i.refCounter+=1,i;const n=new OffscreenCanvas(e.width,e.height);return n.getContext("2d").drawImage(e,0,0),i={bitmap:n.transferToImageBitmap(),id:`image_${this.#x}_${this.#y++}`,refCounter:1,isSvg:!1},this.#w.set(t,i),this.#w.set(i.id,i),i}getSvgUrl(t){const e=this.#w.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#w||=new Map;const e=this.#w.get(t);if(!e)return;if(e.refCounter-=1,0!==e.refCounter)return;const{bitmap:i}=e;if(!e.url&&!e.file){const t=new OffscreenCanvas(i.width,i.height);t.getContext("bitmaprenderer").transferFromImageBitmap(i),e.blobPromise=t.convertToBlob()}i.close?.(),e.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#x}_`)}}class oe{#_=[];#S=!1;#k;#C=-1;constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;this.#k=t}add(t){let{cmd:e,undo:i,post:n,mustExec:s,type:a=NaN,overwriteIfSameType:r=!1,keepUndo:o=!1}=t;if(s&&e(),this.#S)return;const l={cmd:e,undo:i,post:n,type:a};if(-1===this.#C)return this.#_.length>0&&(this.#_.length=0),this.#C=0,void this.#_.push(l);if(r&&this.#_[this.#C].type===a)return o&&(l.undo=this.#_[this.#C].undo),void(this.#_[this.#C]=l);const c=this.#C+1;c===this.#k?this.#_.splice(0,1):(this.#C=c,cnew Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]))();get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const i of t.keys()){e.style.color=i;const n=window.getComputedStyle(e).color;t.set(i,Zt(n))}e.remove()}(t),lt(this,"_colors",t)}convert(t){const e=Zt(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[i,n]of this._colors)if(n.every(((t,i)=>t===e[i])))return ce._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?At.makeHexColor(...e):t}}class he{#T=(()=>new AbortController)();#M=null;#D=(()=>new Map)();#I=(()=>new Map)();#R=null;#P=null;#L=null;#F=(()=>new oe)();#O=null;#N=0;#j=(()=>new Set)();#z=null;#H=null;#B=(()=>new Set)();#V=!1;#$=!1;#U=!1;#W=null;#q=null;#G=null;#Y=null;#X=!1;#K=null;#Z=(()=>new ae)();#J=!1;#Q=!1;#tt=null;#et=null;#it=null;#nt=null;#st=(()=>b.NONE)();#at=(()=>new Set)();#rt=null;#ot=null;#lt=null;#ct={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#ht=[0,0];#dt=null;#ut=null;#pt=null;#mt=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=he.prototype,e=t=>t.#ut.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),i=(t,e)=>{let{target:i}=e;if(i instanceof HTMLInputElement){const{type:t}=i;return"text"!==t&&"number"!==t}return!0},n=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return lt(this,"_keyboardManager",new le([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&t.#ut.contains(i)&&!t.isEnterHandled}}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&t.#ut.contains(document.activeElement)}}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}]]))}constructor(t,e,i,n,s,a,r,o,l,c,h){const d=this._signal=this.#T.signal;this.#ut=t,this.#pt=e,this.#R=i,this._eventBus=n,n._on("editingaction",this.onEditingAction.bind(this),{signal:d}),n._on("pagechanging",this.onPageChanging.bind(this),{signal:d}),n._on("scalechanging",this.onScaleChanging.bind(this),{signal:d}),n._on("rotationchanging",this.onRotationChanging.bind(this),{signal:d}),n._on("setpreference",this.onSetPreference.bind(this),{signal:d}),n._on("switchannotationeditorparams",(t=>this.updateParams(t.type,t.value)),{signal:d}),this.#gt(),this.#ft(),this.#vt(),this.#P=s.annotationStorage,this.#W=s.filterFactory,this.#ot=a,this.#Y=r||null,this.#V=o,this.#$=l,this.#U=c,this.#nt=h||null,this.viewParameters={realScale:Nt.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#mt?.resolve(),this.#mt=null,this.#T?.abort(),this.#T=null,this._signal=null;for(const t of this.#I.values())t.destroy();this.#I.clear(),this.#D.clear(),this.#B.clear(),this.#M=null,this.#at.clear(),this.#F.destroy(),this.#R?.destroy(),this.#K?.hide(),this.#K=null,this.#q&&(clearTimeout(this.#q),this.#q=null),this.#dt&&(clearTimeout(this.#dt),this.#dt=null)}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#nt}get useNewAltTextFlow(){return this.#$}get useNewAltTextWhenAddingImage(){return this.#U}get hcmFilter(){return lt(this,"hcmFilter",this.#ot?this.#W.addHCMFilter(this.#ot.foreground,this.#ot.background):"none")}get direction(){return lt(this,"direction",getComputedStyle(this.#ut).direction)}get highlightColors(){return lt(this,"highlightColors",this.#Y?new Map(this.#Y.split(",").map((t=>t.split("=").map((t=>t.trim()))))):null)}get highlightColorNames(){return lt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,(t=>t.reverse()))):null)}setMainHighlightColorPicker(t){this.#it=t}editAltText(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.#R?.editAltText(this,t,e)}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference(t){let{name:e,value:i}=t;if("enableNewAltTextWhenAddingImage"===e)this.#U=i}onPageChanging(t){let{pageNumber:e}=t;this.#N=e-1}focusMainContainer(){this.#ut.focus()}findParent(t,e){for(const i of this.#I.values()){const{x:n,y:s,width:a,height:r}=i.div.getBoundingClientRect();if(t>=n&&t<=n+a&&e>=s&&e<=s+r)return i}return null}disableUserSelect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#pt.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#B.add(t)}removeShouldRescale(t){this.#B.delete(t)}onScaleChanging(t){let{scale:e}=t;this.commitOrRemove(),this.viewParameters.realScale=e*Nt.PDF_TO_CSS_UNITS;for(const i of this.#B)i.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove(),this.viewParameters.rotation=e}#bt(t){let{anchorNode:e}=t;return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#yt(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const i of this.#I.values())if(i.hasTextLayer(t))return i;return null}highlightSelection(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const e=document.getSelection();if(!e||e.isCollapsed)return;const{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:a}=e,r=e.toString(),o=this.#bt(e).closest(".textLayer"),l=this.getSelectionBoxes(o);if(!l)return;e.empty();const c=this.#yt(o),h=this.#st===b.NONE,d=()=>{c?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:l,anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:a,text:r}),h&&this.showAllEditors("highlight",!0,!0)};h?this.switchToMode(b.HIGHLIGHT,d):d()}#xt(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=this.#bt(t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(this.#K||=new ne(this),this.#K.show(e,i,"ltr"===this.direction))}addToAnnotationStorage(t){t.isEmpty()||!this.#P||this.#P.has(t.id)||this.#P.setValue(t.id,t)}#wt(){const t=document.getSelection();if(!t||t.isCollapsed)return void(this.#rt&&(this.#K?.hide(),this.#rt=null,this.#At({hasSelectedText:!1})));const{anchorNode:e}=t;if(e===this.#rt)return;const i=this.#bt(t).closest(".textLayer");if(i){if(this.#K?.hide(),this.#rt=e,this.#At({hasSelectedText:!0}),(this.#st===b.HIGHLIGHT||this.#st===b.NONE)&&(this.#st===b.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#X=this.isShiftKeyDown,!this.isShiftKeyDown)){const t=this.#st===b.HIGHLIGHT?this.#yt(i):null;t?.toggleDrawing();const e=new AbortController,n=this.combinedSignal(e),s=i=>{"pointerup"===i.type&&0!==i.button||(e.abort(),t?.toggleDrawing(!0),"pointerup"===i.type&&this.#_t("main_toolbar"))};window.addEventListener("pointerup",s,{signal:n}),window.addEventListener("blur",s,{signal:n})}}else this.#rt&&(this.#K?.hide(),this.#rt=null,this.#At({hasSelectedText:!1}))}#_t(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.#st===b.HIGHLIGHT?this.highlightSelection(t):this.#V&&this.#xt()}#gt(){document.addEventListener("selectionchange",this.#wt.bind(this),{signal:this._signal})}#St(){if(this.#G)return;this.#G=new AbortController;const t=this.combinedSignal(this.#G);window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}#kt(){this.#G?.abort(),this.#G=null}blur(){if(this.isShiftKeyDown=!1,this.#X&&(this.#X=!1,this.#_t("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of this.#at)if(e.div.contains(t)){this.#et=[e,t],e._focusEventsAllowed=!1;break}}focus(){if(!this.#et)return;const[t,e]=this.#et;this.#et=null,e.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:this._signal}),e.focus()}#vt(){if(this.#tt)return;this.#tt=new AbortController;const t=this.combinedSignal(this.#tt);window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#Ct(){this.#tt?.abort(),this.#tt=null}#Et(){if(this.#O)return;this.#O=new AbortController;const t=this.combinedSignal(this.#O);document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}#Tt(){this.#O?.abort(),this.#O=null}#ft(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#vt(),this.#Et()}removeEditListeners(){this.#Ct(),this.#Tt()}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of this.#H)if(i.isHandlingMimeForPasting(e))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const e of t.dataTransfer.items)for(const i of this.#H)if(i.isHandlingMimeForPasting(e.type))return i.paste(e,this.currentLayer),void t.preventDefault()}copy(t){if(t.preventDefault(),this.#M?.commitOrRemove(),!this.hasSelection)return;const e=[];for(const i of this.#at){const t=i.serialize(!0);t&&e.push(t)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const a of e.items)for(const t of this.#H)if(t.isHandlingMimeForPasting(a.type))return void t.paste(a,this.currentLayer);let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(s){return void st(`paste: "${s.message}".`)}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const t=[];for(const a of i){const e=await n.deserialize(a);if(!e)return;t.push(e)}const e=()=>{for(const e of t)this.#Mt(e);this.#Dt(t)},s=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:s,mustExec:!0})}catch(s){st(`paste: "${s.message}".`)}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),this.#st===b.NONE||this.isEditorHandlingKeyboard||he._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,this.#X&&(this.#X=!1,this.#_t("main_toolbar")))}onEditingAction(t){let{name:e}=t;switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu")}}#At(t){Object.entries(t).some((t=>{let[e,i]=t;return this.#ct[e]!==i}))&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#ct,t)}),this.#st===b.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#It([[y.HIGHLIGHT_FREE,!0]]))}#It(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#St(),this.#Et(),this.#At({isEditing:this.#st!==b.NONE,isEmpty:this.#Rt(),hasSomethingToUndo:this.#F.hasSomethingToUndo(),hasSomethingToRedo:this.#F.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#kt(),this.#Tt(),this.#At({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#H){this.#H=t;for(const t of this.#H)this.#It(t.defaultPropertiesToUpdate)}}getId(){return this.#Z.id}get currentLayer(){return this.#I.get(this.#N)}getLayer(t){return this.#I.get(t)}get currentPageIndex(){return this.#N}addLayer(t){this.#I.set(t.pageIndex,t),this.#J?t.enable():t.disable()}removeLayer(t){this.#I.delete(t.pageIndex)}async updateMode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.#st!==t&&(!this.#mt||(await this.#mt.promise,this.#mt))){if(this.#mt=Promise.withResolvers(),this.#st=t,t===b.NONE)return this.setEditingState(!1),this.#Pt(),void this.#mt.resolve();this.setEditingState(!0),await this.#Lt(),this.unselectAll();for(const e of this.#I.values())e.updateMode(t);if(!e)return i&&this.addNewEditorFromKeyboard(),void this.#mt.resolve();for(const t of this.#D.values())t.annotationElementId===e?(this.setSelected(t),t.enterInEditMode()):t.unselect();this.#mt.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==this.#st&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(this.#H){switch(t){case y.CREATE:return void this.currentLayer.addNewEditor();case y.HIGHLIGHT_DEFAULT_COLOR:this.#it?.updateColor(e);break;case y.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#lt||=new Map).set(t,e),this.showAllEditors("highlight",e)}for(const i of this.#at)i.updateParams(t,e);for(const i of this.#H)i.updateDefaultParams(t,e)}}showAllEditors(t,e){for(const i of this.#D.values())i.editorType===t&&i.show(e);(this.#lt?.get(y.HIGHLIGHT_SHOW_ALL)??!0)!==e&&this.#It([[y.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.#Q!==t){this.#Q=t;for(const e of this.#I.values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}async#Lt(){if(!this.#J){this.#J=!0;const t=[];for(const e of this.#I.values())t.push(e.enable());await Promise.all(t);for(const e of this.#D.values())e.enable()}}#Pt(){if(this.unselectAll(),this.#J){this.#J=!1;for(const t of this.#I.values())t.disable();for(const t of this.#D.values())t.disable()}}getEditors(t){const e=[];for(const i of this.#D.values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return this.#D.get(t)}addEditor(t){this.#D.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#q&&clearTimeout(this.#q),this.#q=setTimeout((()=>{this.focusMainContainer(),this.#q=null}),0)),this.#D.delete(t.id),this.unselect(t),t.annotationElementId&&this.#j.has(t.annotationElementId)||this.#P?.remove(t.id)}addDeletedAnnotationElement(t){this.#j.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#j.has(t)}removeDeletedAnnotationElement(t){this.#j.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#Mt(t){const e=this.#I.get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#M!==t&&(this.#M=t,t&&this.#It(t.propertiesToUpdate))}get#Ft(){let t=null;for(t of this.#at);return t}updateUI(t){this.#Ft===t&&this.#It(t.propertiesToUpdate)}toggleSelected(t){if(this.#at.has(t))return this.#at.delete(t),t.unselect(),void this.#At({hasSelectedEditor:this.hasSelection});this.#at.add(t),t.select(),this.#It(t.propertiesToUpdate),this.#At({hasSelectedEditor:!0})}setSelected(t){for(const e of this.#at)e!==t&&e.unselect();this.#at.clear(),this.#at.add(t),t.select(),this.#It(t.propertiesToUpdate),this.#At({hasSelectedEditor:!0})}isSelected(t){return this.#at.has(t)}get firstSelectedEditor(){return this.#at.values().next().value}unselect(t){t.unselect(),this.#at.delete(t),this.#At({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#at.size}get isEnterHandled(){return 1===this.#at.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#F.undo(),this.#At({hasSomethingToUndo:this.#F.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Rt()})}redo(){this.#F.redo(),this.#At({hasSomethingToUndo:!0,hasSomethingToRedo:this.#F.hasSomethingToRedo(),isEmpty:this.#Rt()})}addCommands(t){this.#F.add(t),this.#At({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Rt()})}#Rt(){if(0===this.#D.size)return!0;if(1===this.#D.size)for(const t of this.#D.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...this.#at];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)this.#Mt(e)},mustExec:!0})}commitOrRemove(){this.#M?.commitOrRemove()}hasSomethingToControl(){return this.#M||this.hasSelection}#Dt(t){for(const e of this.#at)e.unselect();this.#at.clear();for(const e of t)e.isEmpty()||(this.#at.add(e),e.select());this.#At({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#at)t.commit();this.#Dt(this.#D.values())}unselectAll(){if((!this.#M||(this.#M.commitOrRemove(),this.#st===b.NONE))&&this.hasSelection){for(const t of this.#at)t.unselect();this.#at.clear(),this.#At({hasSelectedEditor:!1})}}translateSelectedEditors(t,e){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;this.#ht[0]+=t,this.#ht[1]+=e;const[i,n]=this.#ht,s=[...this.#at];this.#dt&&clearTimeout(this.#dt),this.#dt=setTimeout((()=>{this.#dt=null,this.#ht[0]=this.#ht[1]=0,this.addCommands({cmd:()=>{for(const t of s)this.#D.has(t.id)&&t.translateInPage(i,n)},undo:()=>{for(const t of s)this.#D.has(t.id)&&t.translateInPage(-i,-n)},mustExec:!1})}),1e3);for(const a of s)a.translateInPage(t,e)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#z=new Map;for(const t of this.#at)this.#z.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#z)return!1;this.disableUserSelect(!1);const t=this.#z;this.#z=null;let e=!1;for(const[{x:n,y:s,pageIndex:a},r]of t)r.newX=n,r.newY=s,r.newPageIndex=a,e||=n!==r.savedX||s!==r.savedY||a!==r.savedPageIndex;if(!e)return!1;const i=(t,e,i,n)=>{if(this.#D.has(t.id)){const s=this.#I.get(n);s?t._setParentAndPosition(s,e,i):(t.pageIndex=n,t.x=e,t.y=i)}};return this.addCommands({cmd:()=>{for(const[e,{newX:n,newY:s,newPageIndex:a}]of t)i(e,n,s,a)},undo:()=>{for(const[e,{savedX:n,savedY:s,savedPageIndex:a}]of t)i(e,n,s,a)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(this.#z)for(const i of this.#z.keys())i.drag(t,e)}rebuild(t){if(null===t.parent){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#at.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#M===t}getActive(){return this.#M}getMode(){return this.#st}get imageManager(){return lt(this,"imageManager",new re)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let l=0,c=e.rangeCount;l({x:(e-n)/a,y:1-(t+r-i)/s,width:o/a,height:r/s});break;case"180":r=(t,e,r,o)=>({x:1-(t+r-i)/s,y:1-(e+o-n)/a,width:r/s,height:o/a});break;case"270":r=(t,e,r,o)=>({x:1-(e+o-n)/a,y:(t-i)/s,width:o/a,height:r/s});break;default:r=(t,e,r,o)=>({x:(t-i)/s,y:(e-n)/a,width:r/s,height:o/a})}const o=[];for(let l=0,c=e.rangeCount;lt.stopPropagation()),{signal:i});const n=t=>{t.preventDefault(),this.#a._uiManager.editAltText(this.#a),this.#Wt&&this.#a._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#Gt}})};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",(e=>{e.target===t&&"Enter"===e.key&&(this.#Bt=!0,n(e))}),{signal:i}),await this.#Yt(),t}get#Gt(){return(this.#o?"added":null===this.#o&&this.guessedText&&"review")||"missing"}finish(){this.#Nt&&(this.#Nt.focus({focusVisible:this.#Bt}),this.#Bt=!1)}isEmpty(){return this.#Wt?null===this.#o:!this.#o&&!this.#Ot}hasData(){return this.#Wt?null!==this.#o||!!this.#$t:this.isEmpty()}get guessedText(){return this.#$t}async setGuessedText(t){null===this.#o&&(this.#$t=t,this.#Ut=await de._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),this.#Yt())}toggleAltTextBadge(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.#Wt||this.#o)return this.#Vt?.remove(),void(this.#Vt=null);if(!this.#Vt){const t=this.#Vt=document.createElement("div");t.className="noAltTextBadge",this.#a.div.append(t)}this.#Vt.classList.toggle("hidden",!t)}serialize(t){let e=this.#o;return t||this.#$t!==e||(e=this.#Ut),{altText:e,decorative:this.#Ot,guessedText:this.#$t,textWithDisclaimer:this.#Ut}}get data(){return{altText:this.#o,decorative:this.#Ot}}set data(t){let{altText:e,decorative:i,guessedText:n,textWithDisclaimer:s,cancel:a=!1}=t;n&&(this.#$t=n,this.#Ut=s),this.#o===e&&this.#Ot===i||(a||(this.#o=e,this.#Ot=i),this.#Yt())}toggle(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#Nt&&(!t&&this.#Ht&&(clearTimeout(this.#Ht),this.#Ht=null),this.#Nt.disabled=!t)}shown(){this.#a._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#Gt}})}destroy(){this.#Nt?.remove(),this.#Nt=null,this.#jt=null,this.#zt=null,this.#Vt?.remove(),this.#Vt=null}async#Yt(){const t=this.#Nt;if(!t)return;if(this.#Wt){if(t.classList.toggle("done",!!this.#o),t.setAttribute("data-l10n-id",de.#qt[this.#Gt]),this.#jt?.setAttribute("data-l10n-id",de.#qt[`${this.#Gt}-label`]),!this.#o)return void this.#zt?.remove()}else{if(!this.#o&&!this.#Ot)return t.classList.remove("done"),void this.#zt?.remove();t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=this.#zt;if(!e){this.#zt=e=document.createElement("span"),e.className="tooltip",e.setAttribute("role","tooltip"),e.id=`alt-text-tooltip-${this.#a.id}`;const i=100,n=this.#a._uiManager._signal;n.addEventListener("abort",(()=>{clearTimeout(this.#Ht),this.#Ht=null}),{once:!0}),t.addEventListener("mouseenter",(()=>{this.#Ht=setTimeout((()=>{this.#Ht=null,this.#zt.classList.add("show"),this.#a._reportTelemetry({action:"alt_text_tooltip"})}),i)}),{signal:n}),t.addEventListener("mouseleave",(()=>{this.#Ht&&(clearTimeout(this.#Ht),this.#Ht=null),this.#zt?.classList.remove("show")}),{signal:n})}this.#Ot?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=this.#o),e.parentNode||t.append(e);const i=this.#a.getImageForAltText();i?.setAttribute("aria-describedby",e.id)}}class ue{#Xt=null;#Kt=null;#o=null;#Zt=!1;#Jt=!1;#Qt=null;#te=null;#ee=null;#ie="";#ne=!1;#se=null;#ae=!1;#re=!1;#oe=!1;#le=null;#ce=0;#he=0;#de=null;_editToolbar=null;_initialOptions=(()=>Object.create(null))();_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#ue=!1;#pe=(()=>ue._zIndex++)();static _borderLineWidth=-1;static _colorManager=(()=>new ce)();static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=ue.prototype._resizeWithKeyboard,e=he.TRANSLATE_SMALL,i=he.TRANSLATE_BIG;return lt(this,"_resizerKeyboardManager",new le([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],ue.prototype._stopResizingWithKeyboard]]))}constructor(t){this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:e,rawDims:{pageWidth:i,pageHeight:n,pageX:s,pageY:a}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[s,a];const[r,o]=this.parentDimensions;this.x=t.x/r,this.y=t.y/o,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return lt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new pe({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){if(ue._l10n??=t,ue._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),-1!==ue._borderLineWidth)return;const i=getComputedStyle(document.documentElement);ue._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){at("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#ue}set _isDraggable(t){this.#ue=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#pe}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#me(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#ne?this.#ne=!1:this.parent.setSelected(this))}focusout(t){if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const e=t.relatedTarget;e?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,n){const[s,a]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(t+i)/s,this.y=(e+n)/a,this.fixAndSetPosition()}#ge(t,e,i){let[n,s]=t;[e,i]=this.screenToPageTranslation(e,i),this.x+=e/n,this.y+=i/s,this.fixAndSetPosition()}translate(t,e){this.#ge(this.parentDimensions,t,e)}translateInPage(t,e){this.#se||=[this.x,this.y],this.#ge(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){this.#se||=[this.x,this.y];const[i,n]=this.parentDimensions;if(this.x+=t/i,this.y+=e/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:e}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,e)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:a}=this;const[r,o]=this.getBaseTranslation();s+=r,a+=o,this.div.style.left=`${(100*s).toFixed(2)}%`,this.div.style.top=`${(100*a).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#se&&(this.#se[0]!==this.x||this.#se[1]!==this.y)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=ue,n=i/t,s=i/e;switch(this.rotation){case 90:return[-n,s];case 180:return[n,s];case 270:return[n,-s];default:return[-n,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.rotation;const[e,i]=this.pageDimensions;let{x:n,y:s,width:a,height:r}=this;if(a*=e,r*=i,n*=e,s*=i,this._mustFixPosition)switch(t){case 0:n=Math.max(0,Math.min(e-a,n)),s=Math.max(0,Math.min(i-r,s));break;case 90:n=Math.max(0,Math.min(e-r,n)),s=Math.min(i,Math.max(a,s));break;case 180:n=Math.min(e,Math.max(a,n)),s=Math.min(i,Math.max(r,s));break;case 270:n=Math.min(e,Math.max(r,n)),s=Math.max(0,Math.min(i-a,s))}this.x=n/=e,this.y=s/=i;const[o,l]=this.getBaseTranslation();n+=o,s+=l;const{style:c}=this.div;c.left=`${(100*n).toFixed(2)}%`,c.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static#fe(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return ue.#fe(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return ue.#fe(t,e,360-this.parentRotation)}#ve(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this;return[e*t,i*t]}setDims(t,e){const[i,n]=this.parentDimensions;this.div.style.width=`${(100*t/i).toFixed(2)}%`,this.#Jt||(this.div.style.height=`${(100*e/n).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,n=i.endsWith("%"),s=!this.#Jt&&e.endsWith("%");if(n&&s)return;const[a,r]=this.parentDimensions;n||(t.width=`${(100*parseFloat(i)/a).toFixed(2)}%`),this.#Jt||s||(t.height=`${(100*parseFloat(e)/r).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#be(){if(this.#Qt)return;this.#Qt=document.createElement("div"),this.#Qt.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const t=document.createElement("div");this.#Qt.append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",this.#ye.bind(this,i),{signal:e}),t.addEventListener("contextmenu",Gt,{signal:e}),t.tabIndex=-1}this.div.prepend(this.#Qt)}#ye(t,e){e.preventDefault();const{isMac:i}=xt.platform;if(0!==e.button||e.ctrlKey&&i)return;this.#o?.toggle(!1);const n=this._isDraggable;this._isDraggable=!1;const s=new AbortController,a=this._uiManager.combinedSignal(s);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#xe.bind(this,t),{passive:!0,capture:!0,signal:a}),window.addEventListener("contextmenu",Gt,{signal:a});const r=this.x,o=this.y,l=this.width,c=this.height,h=this.parent.div.style.cursor,d=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const u=()=>{s.abort(),this.parent.togglePointerEvents(!0),this.#o?.toggle(!0),this._isDraggable=n,this.parent.div.style.cursor=h,this.div.style.cursor=d,this.#we(r,o,l,c)};window.addEventListener("pointerup",u,{signal:a}),window.addEventListener("blur",u,{signal:a})}#we(t,e,i,n){const s=this.x,a=this.y,r=this.width,o=this.height;s===t&&a===e&&r===i&&o===n||this.addCommands({cmd:()=>{this.width=r,this.height=o,this.x=s,this.y=a;const[t,e]=this.parentDimensions;this.setDims(t*r,e*o),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=n,this.x=t,this.y=e;const[s,a]=this.parentDimensions;this.setDims(s*i,a*n),this.fixAndSetPosition()},mustExec:!0})}#xe(t,e){const[i,n]=this.parentDimensions,s=this.x,a=this.y,r=this.width,o=this.height,l=ue.MIN_SIZE/i,c=ue.MIN_SIZE/n,h=t=>Math.round(1e4*t)/1e4,d=this.#ve(this.rotation),u=(t,e)=>[d[0]*t+d[2]*e,d[1]*t+d[3]*e],p=this.#ve(360-this.rotation);let m,g,f=!1,v=!1;switch(t){case"topLeft":f=!0,m=(t,e)=>[0,0],g=(t,e)=>[t,e];break;case"topMiddle":m=(t,e)=>[t/2,0],g=(t,e)=>[t/2,e];break;case"topRight":f=!0,m=(t,e)=>[t,0],g=(t,e)=>[0,e];break;case"middleRight":v=!0,m=(t,e)=>[t,e/2],g=(t,e)=>[0,e/2];break;case"bottomRight":f=!0,m=(t,e)=>[t,e],g=(t,e)=>[0,0];break;case"bottomMiddle":m=(t,e)=>[t/2,e],g=(t,e)=>[t/2,0];break;case"bottomLeft":f=!0,m=(t,e)=>[0,e],g=(t,e)=>[t,0];break;case"middleLeft":v=!0,m=(t,e)=>[0,e/2],g=(t,e)=>[t,e/2]}const b=m(r,o),y=g(r,o);let x=u(...y);const w=h(s+x[0]),A=h(a+x[1]);let _=1,S=1,[k,C]=this.screenToPageTranslation(e.movementX,e.movementY);var E,T;if([k,C]=(E=k/i,T=C/n,[p[0]*E+p[2]*T,p[1]*E+p[3]*T]),f){const t=Math.hypot(r,o);_=S=Math.max(Math.min(Math.hypot(y[0]-b[0]-k,y[1]-b[1]-C)/t,1/r,1/o),l/r,c/o)}else v?_=Math.max(l,Math.min(1,Math.abs(y[0]-b[0]-k)))/r:S=Math.max(c,Math.min(1,Math.abs(y[1]-b[1]-C)))/o;const M=h(r*_),D=h(o*S);x=u(...g(M,D));const I=w-x[0],R=A-x[1];this.width=M,this.height=D,this.x=I,this.y=R,this.setDims(i*M,n*D),this.fixAndSetPosition()}altTextFinish(){this.#o?.finish()}async addEditToolbar(){return this._editToolbar||this.#re||(this._editToolbar=new ie(this),this.div.append(this._editToolbar.render()),this.#o&&await this._editToolbar.addAltText(this.#o)),this._editToolbar}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#o?.destroy())}addContainer(t){const e=this._editToolbar?.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#o||(de.initialize(ue._l10n),this.#o=new de(this),this.#Xt&&(this.#o.data=this.#Xt,this.#Xt=null),await this.addEditToolbar())}get altTextData(){return this.#o?.data}set altTextData(t){this.#o&&(this.#o.data=t)}get guessedAltText(){return this.#o?.guessedText}async setGuessedAltText(t){await(this.#o?.setGuessedText(t))}serializeAltText(t){return this.#o?.serialize(t)}hasAltText(){return!!this.#o&&!this.#o.isEmpty()}hasAltTextData(){return this.#o?.hasData()??!1}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#Zt?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),this.#Ae();const[t,e]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*e/t).toFixed(2)}%`,this.div.style.maxHeight=`${(100*t/e).toFixed(2)}%`);const[i,n]=this.getInitialTranslation();return this.translate(i,n),se(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:e}=xt.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(this.#ne=!0,this._isDraggable?this.#_e(t):this.#Se(t))}get isSelected(){return this._uiManager.isSelected(this)}#Se(t){const{isMac:e}=xt.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}#_e(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();const i=new AbortController,n=this._uiManager.combinedSignal(i);if(e){this.div.classList.add("moving"),this.#ce=t.clientX,this.#he=t.clientY;const e=t=>{const{clientX:e,clientY:i}=t,[n,s]=this.screenToPageTranslation(e-this.#ce,i-this.#he);this.#ce=e,this.#he=i,this._uiManager.dragSelectedEditors(n,s)};window.addEventListener("pointermove",e,{passive:!0,capture:!0,signal:n})}const s=()=>{i.abort(),e&&this.div.classList.remove("moving"),this.#ne=!1,this._uiManager.endDragSession()||this.#Se(t)};window.addEventListener("pointerup",s,{signal:n}),window.addEventListener("blur",s,{signal:n})}moveInDOM(){this.#le&&clearTimeout(this.#le),this.#le=setTimeout((()=>{this.#le=null,this.parent?.moveEditorInDOM(this)}),0)}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition()}getRect(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.rotation;const n=this.parentScale,[s,a]=this.pageDimensions,[r,o]=this.pageTranslation,l=t/n,c=e/n,h=this.x*s,d=this.y*a,u=this.width*s,p=this.height*a;switch(i){case 0:return[h+l+r,a-d-c-p+o,h+l+u+r,a-d-c+o];case 90:return[h+c+r,a-d+l+o,h+c+p+r,a-d+l+u+o];case 180:return[h-l-u+r,a-d+c+o,h-l+r,a-d+c+p+o];case 270:return[h-c-p+r,a-d-l-u+o,h-c+r,a-d-l+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,n,s,a]=t,r=s-i,o=a-n;switch(this.rotation){case 0:return[i,e-a,r,o];case 90:return[i,e-n,o,r];case 180:return[s,e-n,r,o];case 270:return[s,e-a,o,r];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#re=!0}disableEditMode(){this.#re=!1}isInEditMode(){return this.#re}shouldGetKeyboardEvents(){return this.#oe}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}#Ae(){if(this.#ee||!this.div)return;this.#ee=new AbortController;const t=this._uiManager.combinedSignal(this.#ee);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}rebuild(){this.#Ae()}rotate(t){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(){at("An editor must be serializable")}static async deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i});n.rotation=t.rotation,n.#Xt=t.accessibilityData;const[s,a]=n.pageDimensions,[r,o,l,c]=n.getRectInCurrentCoords(t.rect,a);return n.x=r/s,n.y=o/a,n.width=l/s,n.height=c/a,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.#ee?.abort(),this.#ee=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#le&&(clearTimeout(this.#le),this.#le=null),this.#me(),this.removeEditToolbar(),this.#de){for(const t of this.#de.values())clearTimeout(t);this.#de=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#be(),this.#Qt.classList.remove("hidden"),se(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),this.#te={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const e=this.#Qt.children;if(!this.#Kt){this.#Kt=Array.from(e);const t=this.#ke.bind(this),i=this.#Ce.bind(this),n=this._uiManager._signal;for(const e of this.#Kt){const s=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton"),e.addEventListener("keydown",t,{signal:n}),e.addEventListener("blur",i,{signal:n}),e.addEventListener("focus",this.#Ee.bind(this,s),{signal:n}),e.setAttribute("data-l10n-id",ue._l10nResizer[s])}}const i=this.#Kt[0];let n=0;for(const a of e){if(a===i)break;n++}const s=(360-this.rotation+this.parentRotation)%360/90*(this.#Kt.length/4);if(s!==n){if(sn)for(let e=0;e{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()}))}unselect(){this.#Qt?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#o?.toggleAltTextBadge(!0)}updateParams(t,e){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#ae}set isEditing(t){this.#ae=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){this.#Jt=!0;const i=t/e,{style:n}=this.div;n.aspectRatio=i,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){this.#de||=new Map;const{action:e}=t;let i=this.#de.get(e);return i&&clearTimeout(i),i=setTimeout((()=>{this._reportTelemetry(t),this.#de.delete(e),0===this.#de.size&&(this.#de=null)}),ue._telemetryTimeout),void this.#de.set(e,i)}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#Zt=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#Zt=!0}renderAnnotationElement(t){let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){const t=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.before(e)}}else e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);return e}resetAnnotationElement(t){const{firstChild:e}=t.container;"DIV"===e?.nodeName&&e.classList.contains("annotationContent")&&e.remove()}}class pe extends ue{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const me=3285377520,ge=4294901760,fe=65535;class ve{constructor(t){this.h1=t?4294967295&t:me,this.h2=t?4294967295&t:me}update(t){let e,i;if("string"===typeof t){e=new Uint8Array(2*t.length),i=0;for(let n=0,s=t.length;n>>8,e[i++]=255&s)}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice(),i=e.byteLength}const n=i>>2,s=i-4*n,a=new Uint32Array(e.buffer,0,n);let r=0,o=0,l=this.h1,c=this.h2;const h=3432918353,d=461845907,u=11601,p=13715;for(let m=0;m>>17,r=r*d&ge|r*p&fe,l^=r,l=l<<13|l>>>19,l=5*l+3864292196):(o=a[m],o=o*h&ge|o*u&fe,o=o<<15|o>>>17,o=o*d&ge|o*p&fe,c^=o,c=c<<13|c>>>19,c=5*c+3864292196);switch(r=0,s){case 3:r^=e[4*n+2]<<16;case 2:r^=e[4*n+1]<<8;case 1:r^=e[4*n],r=r*h&ge|r*u&fe,r=r<<15|r>>>17,r=r*d&ge|r*p&fe,1&n?l^=r:c^=r}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&ge|36045*t&fe,e=4283543511*e&ge|(2950163797*(e<<16|t>>>16)&ge)>>>16,t^=e>>>1,t=444984403*t&ge|60499*t&fe,e=3301882366*e&ge|(3120437893*(e<<16|t>>>16)&ge)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const be=Object.freeze({map:null,hash:"",transfer:void 0});class ye{#Me=!1;#De=null;#Ie=(()=>new Map)();constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=this.#Ie.get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return this.#Ie.get(t)}remove(t){if(this.#Ie.delete(t),0===this.#Ie.size&&this.resetModified(),"function"===typeof this.onAnnotationEditor){for(const t of this.#Ie.values())if(t instanceof ue)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=this.#Ie.get(t);let n=!1;if(void 0!==i)for(const[s,a]of Object.entries(e))i[s]!==a&&(n=!0,i[s]=a);else n=!0,this.#Ie.set(t,e);n&&this.#Re(),e instanceof ue&&"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this.#Ie.has(t)}getAll(){return this.#Ie.size>0?yt(this.#Ie):null}setAll(t){for(const[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return this.#Ie.size}#Re(){this.#Me||(this.#Me=!0,"function"===typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#Me&&(this.#Me=!1,"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new xe(this)}get serializable(){if(0===this.#Ie.size)return be;const t=new Map,e=new ve,i=[],n=Object.create(null);let s=!1;for(const[a,r]of this.#Ie){const i=r instanceof ue?r.serialize(!1,n):r;i&&(t.set(a,i),e.update(`${a}:${JSON.stringify(i)}`),s||=!!i.bitmap)}if(s)for(const a of t.values())a.bitmap&&i.push(a.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:be}get editorStats(){let t=null;const e=new Map;for(const i of this.#Ie.values()){if(!(i instanceof ue))continue;const n=i.telemetryFinalData;if(!n)continue;const{type:s}=n;e.has(s)||e.set(s,Object.getPrototypeOf(i).constructor),t||=Object.create(null);const a=t[s]||=new Map;for(const[t,e]of Object.entries(n)){if("type"===t)continue;let i=a.get(t);i||(i=new Map,a.set(t,i));const n=i.get(e)??0;i.set(e,n+1)}}for(const[i,n]of e)t[i]=n.computeTelemetryFinalData(t[i]);return t}resetModifiedIds(){this.#De=null}get modifiedIds(){if(this.#De)return this.#De;const t=[];for(const e of this.#Ie.values())e instanceof ue&&e.annotationElementId&&e.serialize()&&t.push(e.annotationElementId);return this.#De={ids:new Set(t),hash:t.join(",")}}}class xe extends ye{#Pe;constructor(t){super();const{map:e,hash:i,transfer:n}=t.serializable,s=structuredClone(e,n?{transfer:n}:null);this.#Pe={map:s,hash:i,transfer:n}}get print(){at("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#Pe}get modifiedIds(){return lt(this,"modifiedIds",{ids:new Set,hash:""})}}class we{#Le=(()=>new Set)();constructor(t){let{ownerDocument:e=globalThis.document,styleElement:i=null}=t;this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#Le.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){let{systemFontInfo:e,_inspectFont:i}=t;if(e&&!this.#Le.has(e.loadedName))if(rt(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:t,src:n,style:s}=e,a=new FontFace(t,n,s);this.addNativeFontFace(a);try{await a.load(),this.#Le.add(t),i?.(e)}catch{st(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}}else at("Not implemented: loadSystemFont without the Font Loading API.")}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void await this.loadSystemFont(t);if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw st(`Failed to load font '${e.family}': '${i}'.`),t.disableFontFace=!0,i}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise((e=>{const i=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,i)}))}}get isFontLoadingAPISupported(){return lt(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){let t=!1;return(a||"undefined"!==typeof navigator&&"string"===typeof navigator?.userAgent&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),lt(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function(){for(rt(!i.done,"completeRequest() cannot be called twice."),i.done=!0;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(i),i}get _loadTestFont(){return lt(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAA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&t.charCodeAt(e+3)}function n(t,e,i,n){return t.substring(0,e)+n+t.substring(e+i)}let s,a;const r=this._document.createElement("canvas");r.width=1,r.height=1;const o=r.getContext("2d");let l=0;const c=`lt${Date.now()}${this.loadTestFontId++}`;let h=this._loadTestFont;h=n(h,976,c.length,c);const d=1482184792;let u=i(h,16);for(s=0,a=c.length-3;s>24&255,p>>16&255,p>>8&255,255&p)));const m=`@font-face {font-family:"${c}";src:${`url(data:font/opentype;base64,${btoa(h)});`}}`;this.insertRule(m);const g=this._document.createElement("div");g.style.visibility="hidden",g.style.width=g.style.height="10px",g.style.position="absolute",g.style.top=g.style.left="0px";for(const f of[t.loadedName,c]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=f,g.append(t)}this._document.body.append(g),function t(e,i){if(++l>30)return st("Load test font never loaded."),void i();o.font="30px "+e,o.fillText(".",0,20),o.getImageData(0,0,1,1).data[3]>0?i():setTimeout(t.bind(null,e,i))}(c,(()=>{g.remove(),e.complete()}))}}class Ae{constructor(t,e){let{disableFontFace:i=!1,inspectFont:n=null}=e;this.compiledGlyphs=Object.create(null);for(const s in t)this[s]=t[s];this.disableFontFace=!0===i,this._inspectFont=n}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${e=this.data,Uint8Array.prototype.toBase64?e.toBase64():btoa(vt(e))});`;var e;let i;if(this.cssFontInfo){let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${t}}`}else i=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this._inspectFont?.(this,t),i}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(s){st(`getPathGenerator - ignoring character: "${s}".`)}if(!Array.isArray(i)||0===i.length)return this.compiledGlyphs[e]=function(t,e){};const n=[];for(let a=0,r=i.length;ai.bezierCurveTo(t,e,s,r,o,l))),a+=6}break;case Tt:{const[t,e]=i.slice(a,a+2);n.push((i=>i.moveTo(t,e))),a+=2}break;case Mt:{const[t,e]=i.slice(a,a+2);n.push((i=>i.lineTo(t,e))),a+=2}break;case Dt:{const[t,e,s,r]=i.slice(a,a+4);n.push((i=>i.quadraticCurveTo(t,e,s,r))),a+=4}break;case It:n.push((t=>t.restore()));break;case Rt:n.push((t=>t.save()));break;case Pt:rt(2===n.length,"Scale command is only valid at the third position.");break;case Lt:{const[t,e,s,r,o,l]=i.slice(a,a+6);n.push((i=>i.transform(t,e,s,r,o,l))),a+=6}break;case Ft:{const[t,e]=i.slice(a,a+2);n.push((i=>i.translate(t,e))),a+=2}}return this.compiledGlyphs[e]=function(t,e){n[0](t),n[1](t),t.scale(e,-e);for(let i=2,s=n.length;i({cMapData:t,isCompressed:this.isCompressed}))).catch((t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)}))}async _fetch(t){at("Abstract method `_fetch` called.")}}class ke extends Se{async _fetch(t){const e=await jt(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):bt(e)}}class Ce{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,n,s){return"none"}destroy(){}}class Ee{constructor(t){let{baseUrl:e=null}=t;this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const i=`${this.baseUrl}${e}`;return this._fetch(i).catch((t=>{throw new Error(`Unable to load font data at: ${i}`)}))}async _fetch(t){at("Abstract method `_fetch` called.")}}class Te extends Ee{async _fetch(t){const e=await jt(t,"arraybuffer");return new Uint8Array(e)}}if(a){var Me=Promise.withResolvers(),De=null;(async()=>{const t=await import("fs"),e=await import("http"),i=await import("https"),n=await import("url");return new Map(Object.entries({fs:t,http:e,https:i,url:n,canvas:undefined,path2d:undefined}))})().then((t=>{De=t,Me.resolve()}),(t=>{st(`loadPackages: ${t}`),De=new Map,Me.resolve()}))}class Ie{static get promise(){return Me.promise}static get(t){return De?.get(t)}}async function Re(t){const e=Ie.get("fs"),i=await e.promises.readFile(t);return new Uint8Array(i)}const Pe="Fill",Le="Stroke",Fe="Shading";function Oe(t,e){if(!e)return;const i=e[2]-e[0],n=e[3]-e[1],s=new Path2D;s.rect(e[0],e[1],i,n),t.clip(s)}class Ne{getPattern(){at("Abstract method `getPattern` called.")}}class je extends Ne{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)e.addColorStop(i[0],i[1]);return e}getPattern(t,e,i,n){let s;if(n===Le||n===Pe){const a=e.current.getClippedPathBoundingBox(n,Jt(t))||[0,0,0,0],r=Math.ceil(a[2]-a[0])||1,o=Math.ceil(a[3]-a[1])||1,l=e.cachedCanvases.getCanvas("pattern",r,o),c=l.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-a[0],-a[1]),i=At.transform(i,[1,0,0,1,a[0],a[1]]),c.transform(...e.baseTransform),this.matrix&&c.transform(...this.matrix),Oe(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),s=t.createPattern(l.canvas,"no-repeat");const h=new DOMMatrix(i);s.setTransform(h)}else Oe(t,this._bbox),s=this._createGradient(t);return s}}function ze(t,e,i,n,s,a,r,o){const l=e.coords,c=e.colors,h=t.data,d=4*t.width;let u;l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=a,a=r,r=u),l[n+1]>l[s+1]&&(u=n,n=s,s=u,u=r,r=o,o=u),l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=a,a=r,r=u);const p=(l[i]+e.offsetX)*e.scaleX,m=(l[i+1]+e.offsetY)*e.scaleY,g=(l[n]+e.offsetX)*e.scaleX,f=(l[n+1]+e.offsetY)*e.scaleY,v=(l[s]+e.offsetX)*e.scaleX,b=(l[s+1]+e.offsetY)*e.scaleY;if(m>=b)return;const y=c[a],x=c[a+1],w=c[a+2],A=c[r],_=c[r+1],S=c[r+2],k=c[o],C=c[o+1],E=c[o+2],T=Math.round(m),M=Math.round(b);let D,I,R,P,L,F,O,N;for(let j=T;j<=M;j++){if(jb?1:f===b?0:(f-j)/(f-b),D=g-(g-v)*t,I=A-(A-k)*t,R=_-(_-C)*t,P=S-(S-E)*t}let t;t=jb?1:(m-j)/(m-b),L=p-(p-v)*t,F=y-(y-k)*t,O=x-(x-C)*t,N=w-(w-E)*t;const e=Math.round(Math.min(D,L)),i=Math.round(Math.max(D,L));let n=d*j+4*e;for(let s=e;s<=i;s++)t=(D-s)/(D-L),t<0?t=0:t>1&&(t=1),h[n++]=I-(I-F)*t|0,h[n++]=R-(R-O)*t|0,h[n++]=P-(P-N)*t|0,h[n++]=255}}function He(t,e,i){const n=e.coords,s=e.colors;let a,r;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(n.length/o)-1,c=o-1;for(a=0;a=Math.ceil(p*v)?y=o:w=!0,S>=Math.ceil(m*b)?x=l:A=!0;const k=this.getSizeAndScale(y,this.ctx.canvas.width,v),C=this.getSizeAndScale(x,this.ctx.canvas.height,b),E=t.cachedCanvases.getCanvas("pattern",k.size,C.size),T=E.context,M=r.createCanvasGraphics(T);if(M.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(M,n,a),T.translate(-k.scale*c,-C.scale*h),M.transform(k.scale,0,0,C.scale,0,0),T.save(),this.clipBbox(M,c,h,d,u),M.baseTransform=Jt(M.ctx),M.executeOperatorList(i),M.endDrawing(),T.restore(),w||A){const e=E.canvas;w&&(y=o),A&&(x=l);const i=this.getSizeAndScale(y,this.ctx.canvas.width,v),n=this.getSizeAndScale(x,this.ctx.canvas.height,b),s=i.size,a=n.size,r=t.cachedCanvases.getCanvas("pattern-workaround",s,a),d=r.context,u=w?Math.floor(p/o):0,g=A?Math.floor(m/l):0;for(let t=0;t<=u;t++)for(let i=0;i<=g;i++)d.drawImage(e,s*t,a*i,s,a,0,0,s,a);return{canvas:r.canvas,scaleX:i.scale,scaleY:n.scale,offsetX:c,offsetY:h}}return{canvas:E.canvas,scaleX:k.scale,scaleY:C.scale,offsetX:c,offsetY:h}}getSizeAndScale(t,e,i){const n=Math.max(We.MAX_PATTERN_SIZE,e);let s=Math.ceil(t*i);return s>=n?s=n:i=s/t,{scale:i,size:s}}clipBbox(t,e,i,n,s){const a=n-e,r=s-i;t.ctx.rect(e,i,a,r),t.current.updateRectMinMax(Jt(t.ctx),[e,i,n,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,s=t.current;switch(e){case $e:const t=this.ctx;n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,s.fillColor=t.fillStyle,s.strokeColor=t.strokeStyle;break;case Ue:const a=At.makeHexColor(i[0],i[1],i[2]);n.fillStyle=a,n.strokeStyle=a,s.fillColor=a,s.strokeColor=a;break;default:throw new gt(`Unsupported paint type: ${e}`)}}getPattern(t,e,i,n){let s=i;n!==Fe&&(s=At.transform(s,e.baseTransform),this.matrix&&(s=At.transform(s,this.matrix)));const a=this.createPatternCanvas(e);let r=new DOMMatrix(s);r=r.translate(a.offsetX,a.offsetY),r=r.scale(1/a.scaleX,1/a.scaleY);const o=t.createPattern(a.canvas,"repeat");return o.setTransform(r),o}}function qe(t){let{src:e,srcPos:i=0,dest:n,width:s,height:a,nonBlackColor:r=4294967295,inverseDecode:o=!1}=t;const l=xt.isLittleEndian?4278190080:255,[c,h]=o?[r,l]:[l,r],d=s>>3,u=7&s,p=e.length;n=new Uint32Array(n.buffer);let m=0;for(let g=0;g0&&void 0!==arguments[0]?arguments[0]:Pe,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===Le){e||at("Stroke bounding box must include transform.");const t=At.singularValueDecompose2dScale(e),n=t[0]*this.lineWidth/2,s=t[1]*this.lineWidth/2;i[0]-=n,i[1]-=s,i[2]+=n,i[3]+=s}return i}updateClipFromPath(){const t=At.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pe,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return At.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function Ze(t,e){if("undefined"!==typeof ImageData&&e instanceof ImageData)return void t.putImageData(e,0,0);const i=e.height,n=e.width,s=i%Ge,a=(i-s)/Ge,r=0===s?a:a+1,o=t.createImageData(n,Ge);let l,c=0;const h=e.data,d=o.data;let u,p,m,g;if(e.kind===E.GRAYSCALE_1BPP){const e=h.byteLength,i=new Uint32Array(d.buffer,0,d.byteLength>>2),g=i.length,f=n+7>>3,v=4294967295,b=xt.isLittleEndian?4278190080:255;for(u=0;uf?n:8*t-7,r=-8&a;let o=0,d=0;for(;s>=1}for(;l=a&&(m=s,g=n*m),l=0,p=g;p--;)d[l++]=h[c++],d[l++]=h[c++],d[l++]=h[c++],d[l++]=255;t.putImageData(o,0,u*Ge)}}}function Je(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const i=e.height,n=e.width,s=i%Ge,a=(i-s)/Ge,r=0===s?a:a+1,o=t.createImageData(n,Ge);let l=0;const c=e.data,h=o.data;for(let d=0;d1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing(t){let{transform:e,viewport:i,transparency:n=!1,background:s=null}=t;const a=this.ctx.canvas.width,r=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,a,r),this.ctx.fillStyle=o,n){const t=this.cachedCanvases.getCanvas("transparent",a,r);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...Jt(this.compositeCtx))}this.ctx.save(),ti(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=Jt(this.ctx)}executeOperatorList(t,e,i,n){const s=t.argsArray,a=t.fnArray;let r=e||0;const o=s.length;if(o===r)return r;const l=o-r>10&&"function"===typeof i,c=l?Date.now()+15:0;let h=0;const d=this.commonObjs,u=this.objs;let p;for(;;){if(void 0!==n&&r===n.nextBreakPoint)return n.breakIt(r,i),r;if(p=a[r],p!==J.dependency)this[p].apply(this,s[r]);else for(const t of s[r]){const e=t.startsWith("g_")?d:u;if(!e.has(t))return e.get(t,i),r}if(r++,r===o)return r;if(l&&++h>10){if(Date.now()>c)return i(),r;h=0}}}#Oe(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#Oe(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#Ne()}#Ne(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}}_scaleImage(t,e){const i=t.width??t.displayWidth,n=t.height??t.displayHeight;let s,a,r=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=i,c=n,h="prescale1";for(;r>2&&l>1||o>2&&c>1;){let e=l,i=c;r>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),r/=l/e),o>2&&c>1&&(i=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/i),s=this.cachedCanvases.getCanvas(h,e,i),a=s.context,a.clearRect(0,0,e,i),a.drawImage(t,0,0,l,c,0,0,e,i),t=s.canvas,l=e,c=i,h="prescale1"===h?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:n}=t,s=this.current.fillColor,a=this.current.patternFill,r=Jt(e);let o,l,c,h;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;l=JSON.stringify(a?r:[r.slice(0,4),s]),o=this._cachedBitmapsMap.get(e),o||(o=new Map,this._cachedBitmapsMap.set(e,o));const i=o.get(l);if(i&&!a){return{canvas:i,offsetX:Math.round(Math.min(r[0],r[2])+r[4]),offsetY:Math.round(Math.min(r[1],r[3])+r[5])}}c=i}c||(h=this.cachedCanvases.getCanvas("maskCanvas",i,n),Je(h.context,t));let d=At.transform(r,[1/i,0,0,-1/n,0,0]);d=At.transform(d,[1,0,0,1,0,-n]);const[u,p,m,g]=At.getAxialAlignedBoundingBox([0,0,i,n],d),f=Math.round(m-u)||1,v=Math.round(g-p)||1,b=this.cachedCanvases.getCanvas("fillCanvas",f,v),y=b.context,x=u,w=p;y.translate(-x,-w),y.transform(...d),c||(c=this._scaleImage(h.canvas,Qt(y)),c=c.img,o&&a&&o.set(l,c)),y.imageSmoothingEnabled=ei(Jt(y),t.interpolate),Xe(y,c,0,0,c.width,c.height,0,0,i,n),y.globalCompositeOperation="source-in";const A=At.transform(Qt(y),[1,0,0,1,-x,-w]);return y.fillStyle=a?s.getPattern(e,this,A,Pe):s,y.fillRect(0,0,i,n),o&&!a&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,b.canvas)),{canvas:b.canvas,offsetX:Math.round(x),offsetY:Math.round(w)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=ii[t]}setLineJoin(t){this.ctx.lineJoin=ni[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx,this.ctx=n.context;const s=this.ctx;s.setTransform(...Jt(this.suspendedCtx)),Qe(this.suspendedCtx,s),function(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,i){e.translate(t,i),this.__originalTranslate(t,i)},t.scale=function(t,i){e.scale(t,i),this.__originalScale(t,i)},t.transform=function(t,i,n,s,a,r){e.transform(t,i,n,s,a,r),this.__originalTransform(t,i,n,s,a,r)},t.setTransform=function(t,i,n,s,a,r){e.setTransform(t,i,n,s,a,r),this.__originalSetTransform(t,i,n,s,a,r)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){e.rotate(t),this.__originalRotate(t)},t.clip=function(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},t.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},t.bezierCurveTo=function(t,i,n,s,a,r){e.bezierCurveTo(t,i,n,s,a,r),this.__originalBezierCurveTo(t,i,n,s,a,r)},t.rect=function(t,i,n,s){e.rect(t,i,n,s),this.__originalRect(t,i,n,s)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(s,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Qe(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,e,i,n){const s=n[0],a=n[1],r=n[2]-s,o=n[3]-a;0!==r&&0!==o&&(this.genericComposeSMask(e.context,i,r,o,e.subtype,e.backdrop,e.transferMap,s,a,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,e,i,n,s,a,r,o,l,c,h){let d=t.canvas,u=o-c,p=l-h;if(a){const e=At.makeHexColor(...a);if(u<0||p<0||u+i>d.width||p+n>d.height){const t=this.cachedCanvases.getCanvas("maskExtension",i,n),s=t.context;s.drawImage(d,-u,-p),s.globalCompositeOperation="destination-atop",s.fillStyle=e,s.fillRect(0,0,i,n),s.globalCompositeOperation="source-over",d=t.canvas,u=p=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const s=new Path2D;s.rect(u,p,i,n),t.clip(s),t.globalCompositeOperation="destination-atop",t.fillStyle=e,t.fillRect(u,p,i,n),t.restore()}}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),"Alpha"===s&&r?e.filter=this.filterFactory.addAlphaFilter(r):"Luminosity"===s&&(e.filter=this.filterFactory.addLuminosityFilter(r));const m=new Path2D;m.rect(o,l,i,n),e.clip(m),e.globalCompositeOperation="destination-in",e.drawImage(d,u,p,i,n,o,l,i,n),e.restore()}save(){this.inSMaskMode?(Qe(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),Qe(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,i,n,s,a){this.ctx.transform(t,e,i,n,s,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){const n=this.ctx,s=this.current;let a,r,o=s.x,l=s.y;const c=Jt(n),h=0===c[0]&&0===c[3]||0===c[1]&&0===c[2],d=h?i.slice(0):null;for(let u=0,p=0,m=t.length;u0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"===typeof i&&i?.getPattern?(e.save(),e.strokeStyle=i.getPattern(e,this,Qt(e),Le),this.rescaleAndStroke(!1),e.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,i=this.current.fillColor;let n=!1;this.current.patternFill&&(e.save(),e.fillStyle=i.getPattern(e,this,Qt(e),Pe),n=!0);const s=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==s&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),n&&e.restore(),t&&this.consumePath(s)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=si}eoClip(){this.pendingClip=ai}beginText(){this.current.textMatrix=r,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(const i of t)e.setTransform(...i.transform),e.translate(i.x,i.y),i.addToPath(e,i.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){const i=this.commonObjs.get(t),n=this.current;if(!i)throw new Error(`Can't find font for ${t}`);if(n.fontMatrix=i.fontMatrix||o,0!==n.fontMatrix[0]&&0!==n.fontMatrix[3]||st("Invalid font matrix for font "+t),e<0?(e=-e,n.fontDirection=-1):n.fontDirection=1,this.current.font=i,this.current.fontSize=e,i.isType3Font)return;const s=i.loadedName||"sans-serif",a=i.systemFontInfo?.css||`"${s}", ${i.fallbackName}`;let r="normal";i.black?r="900":i.bold&&(r="bold");const l=i.italic?"italic":"normal";let c=e;e<16?c=16:e>100&&(c=100),this.current.fontSizeScale=e/c,this.ctx.font=`${l} ${r} ${c}px ${a}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,i,n,s,a){this.current.textMatrix=[t,e,i,n,s,a],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,i,n){const s=this.ctx,a=this.current,r=a.font,o=a.textRenderingMode,l=a.fontSize/a.fontSizeScale,c=o&k,h=!!(o&C),d=a.patternFill&&!r.missingFile;let u;if((r.disableFontFace||h||d)&&(u=r.getPathGenerator(this.commonObjs,t)),r.disableFontFace||d?(s.save(),s.translate(e,i),s.beginPath(),u(s,l),n&&s.setTransform(...n),c!==w&&c!==_||s.fill(),c!==A&&c!==_||s.stroke(),s.restore()):(c!==w&&c!==_||s.fillText(t,e,i),c!==A&&c!==_||s.strokeText(t,e,i)),h){(this.pendingTextPaths||=[]).push({transform:Jt(s),x:e,y:i,fontSize:l,addToPath:u})}}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let n=3;n0&&e[n]<255){i=!0;break}return lt(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const n=e.fontSize;if(0===n)return;const s=this.ctx,a=e.fontSizeScale,r=e.charSpacing,o=e.wordSpacing,l=e.fontDirection,c=e.textHScale*l,h=t.length,d=i.vertical,u=d?1:-1,p=i.defaultVMetrics,m=n*e.fontMatrix[0],g=e.textRenderingMode===w&&!i.disableFontFace&&!e.patternFill;let f;if(s.save(),s.transform(...e.textMatrix),s.translate(e.x,e.y+e.textRise),l>0?s.scale(c,-1):s.scale(c,1),e.patternFill){s.save();const t=e.fillColor.getPattern(s,this,Qt(s),Pe);f=Jt(s),s.restore(),s.fillStyle=t}let v=e.lineWidth;const b=e.textMatrixScale;if(0===b||0===v){const t=e.textRenderingMode&k;t!==A&&t!==_||(v=this.getSinglePixelWidth())}else v/=b;if(1!==a&&(s.scale(a,a),v/=a),s.lineWidth=v,i.isInvalidPDFjsFont){const i=[];let n=0;for(const e of t)i.push(e.unicode),n+=e.width;return s.fillText(i.join(""),0,0),e.x+=n*m*c,s.restore(),void this.compose()}let y,x=0;for(y=0;y0){const t=1e3*s.measureText(v).width/n*a;if(_new ri(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new We(t,i,this.ctx,s,n)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,i){this.ctx.strokeStyle=this.current.strokeColor=At.makeHexColor(t,e,i)}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent"}setFillRGBColor(t,e,i){this.ctx.fillStyle=this.current.fillColor=At.makeHexColor(t,e,i),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(t)?e=this.cachedPatterns.get(t):(e=function(t){switch(t[0]){case"RadialAxial":return new je(t);case"Mesh":return new Be(t);case"Dummy":return new Ve}throw new Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t)),this.cachedPatterns.set(t,e)),i&&(e.matrix=i),e}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,Qt(e),Fe);const n=Qt(e);if(n){const{width:t,height:i}=e.canvas,[s,a,r,o]=At.getAxialAlignedBoundingBox([0,0,t,i],n);this.ctx.fillRect(s,a,r-s,o-a)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){at("Should not call beginInlineImage")}beginImageData(){at("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=Jt(this.ctx),e)){const t=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],t,i),this.current.updateRectMinMax(Jt(this.ctx),e),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const e=this.ctx;t.isolated||nt("TODO: Support non-isolated groups."),t.knockout&&st("Knockout groups not supported.");const i=Jt(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let n=At.getAxialAlignedBoundingBox(t.bbox,Jt(e));const s=[0,0,e.canvas.width,e.canvas.height];n=At.intersect(n,s)||[0,0,0,0];const a=Math.floor(n[0]),r=Math.floor(n[1]),o=Math.max(Math.ceil(n[2])-a,1),l=Math.max(Math.ceil(n[3])-r,1);this.current.startNewPathAndClipBox([0,0,o,l]);let c="groupAt"+this.groupLevel;t.smask&&(c+="_smask_"+this.smaskCounter++%2);const h=this.cachedCanvases.getCanvas(c,o,l),d=h.context;d.translate(-a,-r),d.transform(...i),t.smask?this.smaskStack.push({canvas:h.canvas,context:d,offsetX:a,offsetY:r,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(a,r),e.save()),Qe(e,d),this.ctx=d,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=Jt(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const i=At.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,e,i,n,s){if(this.#Oe(),ti(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),e){const n=e[2]-e[0],a=e[3]-e[1];if(s&&this.annotationCanvasMap){(i=i.slice())[4]-=e[0],i[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=n,e[3]=a;const[s,r]=At.singularValueDecompose2dScale(Jt(this.ctx)),{viewportScale:o}=this,l=Math.ceil(n*this.outputScaleX*o),c=Math.ceil(a*this.outputScaleY*o);this.annotationCanvas=this.canvasFactory.create(l,c);const{canvas:h,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(t,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(s,0,0,-r,0,a*r),ti(this.ctx)}else ti(this.ctx),this.endPath(),this.ctx.rect(e[0],e[1],n,a),this.ctx.clip(),this.ctx.beginPath()}this.current=new Ke(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#Ne(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const i=this.ctx,n=this.processingType3;if(n&&(void 0===n.compiled&&(n.compiled=function(t){const{width:e,height:i}=t;if(e>1e3||i>1e3)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1;let a,r,o,l=new Uint8Array(s*(i+1));const c=e+7&-8;let h=new Uint8Array(c*i),d=0;for(const g of t.data){let t=128;for(;t>0;)h[d++]=g&t?0:255,t>>=1}let u=0;for(d=0,0!==h[d]&&(l[0]=1,++u),r=1;r>2)+(h[d+1]?4:0)+(h[d-c+1]?8:0),n[t]&&(l[o+r]=n[t],++u),d++;if(h[d-c]!==h[d]&&(l[o+r]=h[d]?2:4,++u),u>1e3)return null}for(d=c*(i-1),o=a*s,0!==h[d]&&(l[o]=8,++u),r=1;r1e3)return null;const p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),m=new Path2D;for(a=0;u&&a<=i;a++){let t=a*s;const i=t+e;for(;t>4,l[t]&=r>>2|r<<2),m.lineTo(t%s,t/s|0),l[t]||--u}while(n!==t);--a}return h=null,l=null,function(t){t.save(),t.scale(1/e,-1/i),t.translate(0,-i),t.fill(m),t.beginPath(),t.restore()}}(t)),n.compiled))return void n.compiled(i);const s=this._createMaskCanvas(t),a=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(a,s.offsetX,s.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;t=this.getObject(t.data,t);const r=this.ctx;r.save();const o=Jt(r);r.transform(e,i,n,s,0,0);const l=this._createMaskCanvas(t);r.setTransform(1,0,0,1,l.offsetX-o[4],l.offsetY-o[5]);for(let c=0,h=a.length;ce?c/e:1,r=l>e?l/e:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=r}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:i}=this.current,[n,s]=this.getScaleForStroking();if(e.lineWidth=i||1,1===n&&1===s)return void e.stroke();const a=e.getLineDash();if(t&&e.save(),e.scale(n,s),a.length>0){const t=Math.max(n,s);e.setLineDash(a.map((e=>e/t))),e.lineDashOffset/=t}e.stroke(),t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const Ss in J)void 0!==ri.prototype[Ss]&&(ri.prototype[J[Ss]]=ri.prototype[Ss]);class oi{static#je=null;static#ze="";static get workerPort(){return this.#je}static set workerPort(t){if(!("undefined"!==typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");this.#je=t}static get workerSrc(){return this.#ze}static set workerSrc(t){if("string"!==typeof t)throw new Error("Invalid `workerSrc` type.");this.#ze=t}}const li=1,ci=2,hi=1,di=2,ui=3,pi=4,mi=5,gi=6,fi=7,vi=8;function bi(t){switch(t instanceof Error||"object"===typeof t&&null!==t||at('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new ft(t.message);case"MissingPDFException":return new pt(t.message);case"PasswordException":return new ht(t.message,t.code);case"UnexpectedResponseException":return new mt(t.message,t.status);case"UnknownErrorException":return new dt(t.message,t.details);default:return new dt(t.message,t.toString())}}class yi{#He=(()=>new AbortController)();constructor(t,e,i){this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),i.addEventListener("message",this.#Be.bind(this),{signal:this.#He.signal})}#Be(t){let{data:e}=t;if(e.targetName!==this.sourceName)return;if(e.stream)return void this.#Ve(e);if(e.callback){const t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw new Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===li)i.resolve(e.data);else{if(e.callback!==ci)throw new Error("Unexpected callback case");i.reject(bi(e.reason))}return}const i=this.actionHandler[e.action];if(!i)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const t=this.sourceName,n=e.sourceName,s=this.comObj;new Promise((function(t){t(i(e.data))})).then((function(i){s.postMessage({sourceName:t,targetName:n,callback:li,callbackId:e.callbackId,data:i})}),(function(i){s.postMessage({sourceName:t,targetName:n,callback:ci,callbackId:e.callbackId,reason:bi(i)})}))}else e.streamId?this.#$e(e):i(e.data)}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const n=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[n]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},i)}catch(a){s.reject(a)}return s.promise}sendWithStream(t,e,i,n){const s=this.streamId++,a=this.sourceName,r=this.targetName,o=this.comObj;return new ReadableStream({start:i=>{const l=Promise.withResolvers();return this.streamControllers[s]={controller:i,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:a,targetName:r,action:t,streamId:s,data:e,desiredSize:i.desiredSize},n),l.promise},pull:t=>{const e=Promise.withResolvers();return this.streamControllers[s].pullCall=e,o.postMessage({sourceName:a,targetName:r,stream:gi,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{rt(t instanceof Error,"cancel must have a valid reason");const e=Promise.withResolvers();return this.streamControllers[s].cancelCall=e,this.streamControllers[s].isClosed=!0,o.postMessage({sourceName:a,targetName:r,stream:hi,streamId:s,reason:bi(t)}),e.promise}},i)}#$e(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,a=this,r=this.actionHandler[t.action],o={enqueue(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=a,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:i,targetName:n,stream:pi,streamId:e,chunk:t},r)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:ui,streamId:e}),delete a.streamSinks[e])},error(t){rt(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:mi,streamId:e,reason:bi(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[e]=o,new Promise((function(e){e(r(t.data,o))})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:vi,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:vi,streamId:e,reason:bi(t)})}))}#Ve(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,a=this.streamControllers[e],r=this.streamSinks[e];switch(t.stream){case vi:t.success?a.startCall.resolve():a.startCall.reject(bi(t.reason));break;case fi:t.success?a.pullCall.resolve():a.pullCall.reject(bi(t.reason));break;case gi:if(!r){s.postMessage({sourceName:i,targetName:n,stream:fi,streamId:e,success:!0});break}r.desiredSize<=0&&t.desiredSize>0&&r.sinkCapability.resolve(),r.desiredSize=t.desiredSize,new Promise((function(t){t(r.onPull?.())})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:fi,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:fi,streamId:e,reason:bi(t)})}));break;case pi:if(rt(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(t.chunk);break;case ui:if(rt(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#Ue(a,e);break;case mi:rt(a,"error should have stream controller"),a.controller.error(bi(t.reason)),this.#Ue(a,e);break;case di:t.success?a.cancelCall.resolve():a.cancelCall.reject(bi(t.reason)),this.#Ue(a,e);break;case hi:if(!r)break;new Promise((function(e){e(r.onCancel?.(bi(t.reason)))})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:di,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:di,streamId:e,reason:bi(t)})})),r.sinkCapability.reject(bi(t.reason)),r.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async#Ue(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.#He?.abort(),this.#He=null}}class xi{#We;#qe;constructor(t){let{parsedData:e,rawData:i}=t;this.#We=e,this.#qe=i}getRaw(){return this.#qe}get(t){return this.#We.get(t)??null}getAll(){return yt(this.#We)}has(t){return this.#We.has(t)}}const wi=Symbol("INTERNAL");class Ai{#Ge=!1;#Ye=!1;#Xe=!1;#Ke=!0;constructor(t,e){let{name:i,intent:n,usage:s,rbGroups:a}=e;this.#Ge=!!(t&h),this.#Ye=!!(t&d),this.name=i,this.intent=n,this.usage=s,this.rbGroups=a}get visible(){if(this.#Xe)return this.#Ke;if(!this.#Ke)return!1;const{print:t,view:e}=this.usage;return this.#Ge?"OFF"!==e?.viewState:!this.#Ye||"OFF"!==t?.printState}_setVisible(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t!==wi&&at("Internal method `_setVisible` called."),this.#Xe=i,this.#Ke=e}}class _i{#Ze=null;#Je=(()=>new Map)();#Qe=null;#ti=null;constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;if(this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,this.#ti=t.order;for(const i of t.groups)this.#Je.set(i.id,new Ai(e,i));if("OFF"===t.baseState)for(const t of this.#Je.values())t._setVisible(wi,!1);for(const e of t.on)this.#Je.get(e)._setVisible(wi,!0);for(const e of t.off)this.#Je.get(e)._setVisible(wi,!1);this.#Qe=this.getHash()}}#ei(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let n=1;n1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const n=this.#Je.get(t);if(n){if(i&&e&&n.rbGroups.length)for(const e of n.rbGroups)for(const i of e)i!==t&&this.#Je.get(i)?._setVisible(wi,!1,!0);n._setVisible(wi,!!e,!0),this.#Ze=null}else st(`Optional content group not found: ${t}`)}setOCGState(t){let e,{state:i,preserveRB:n}=t;for(const s of i){switch(s){case"ON":case"OFF":case"Toggle":e=s;continue}const t=this.#Je.get(s);if(t)switch(e){case"ON":this.setVisibility(s,!0,n);break;case"OFF":this.setVisibility(s,!1,n);break;case"Toggle":this.setVisibility(s,!t.visible,n)}}this.#Ze=null}get hasInitialVisibility(){return null===this.#Qe||this.getHash()===this.#Qe}getOrder(){return this.#Je.size?this.#ti?this.#ti.slice():[...this.#Je.keys()]:null}getGroups(){return this.#Je.size>0?yt(this.#Je):null}getGroup(t){return this.#Je.get(t)||null}getHash(){if(null!==this.#Ze)return this.#Ze;const t=new ve;for(const[e,i]of this.#Je)t.update(`${e}:${i.visible}`);return this.#Ze=t.hexdigest()}}class Si{constructor(t,e){let{disableRange:i=!1,disableStream:n=!1}=e;rt(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:a,progressiveDone:r,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=r,this._contentDispositionFilename=o,a?.length>0){const t=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!n,this._isRangeSupported=!i,this._contentLength=s,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener(((t,e)=>{this._onReceiveData({begin:t,chunk:e})})),t.addProgressListener(((t,e)=>{this._onProgress({loaded:t,total:e})})),t.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})})),t.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),t.transportReady()}_onReceiveData(t){let{begin:e,chunk:i}=t;const n=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{rt(this._rangeReaders.some((function(t){return t._begin===e&&(t._enqueue(n),!0)})),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){rt(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new ki(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Ci(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}}class ki{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=t,this._done=i||!1,this._filename=Vt(n)?n:null,this._queuedChunks=e||[],this._loaded=0;for(const s of this._queuedChunks)this._loaded+=s.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Ci{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function Ei(t,e){const i=new Headers;if(!t||!e||"object"!==typeof e)return i;for(const n in e){const t=e[n];void 0!==t&&i.append(n,t)}return i}function Ti(t){let{responseHeaders:e,isHttp:i,rangeChunkSize:n,disableRange:s}=t;const a={allowRangeRequests:!1,suggestedLength:void 0},r=parseInt(e.get("Content-Length"),10);if(!Number.isInteger(r))return a;if(a.suggestedLength=r,r<=2*n)return a;if(s||!i)return a;if("bytes"!==e.get("Accept-Ranges"))return a;return"identity"!==(e.get("Content-Encoding")||"identity")||(a.allowRangeRequests=!0),a}function Mi(t){const e=t.get("Content-Disposition");if(e){let t=function(t){let e=!0,i=n("filename\\*","i").exec(t);if(i){i=i[1];let t=r(i);return t=unescape(t),t=o(t),t=l(t),a(t)}if(i=function(t){const e=[];let i;const s=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=s.exec(t));){let[,t,n,s]=i;if(t=parseInt(t,10),t in e){if(0===t)break}else e[t]=[n,s]}const a=[];for(let n=0;n{if(!Ii(e.status))throw Di(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const i=e.headers,{allowRangeRequests:s,suggestedLength:a}=Ti({responseHeaders:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=a||this._contentLength,this._filename=Mi(i),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new ft("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:Pi(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class Oi{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const n=t.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController;const s=new Headers(t.headers);s.append("Range",`bytes=${e}-${i-1}`);const a=n.url;fetch(a,Ri(s,this._withCredentials,this._abortController)).then((t=>{if(!Ii(t.status))throw Di(t.status,a);this._readCapability.resolve(),this._reader=t.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:Pi(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class Ni{constructor(t){let{url:e,httpHeaders:i,withCredentials:n}=t;this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=Ei(this.isHttp,i),this.withCredentials=n||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,i){const n={begin:t,end:e};for(const s in i)n[s]=i[s];return this.request(n)}requestFull(t){return this.request(t)}request(t){const e=new XMLHttpRequest,i=this.currXhrId++,n=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const[s,a]of this.headers)e.setRequestHeader(s,a);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),n.expectedStatus=206):n.expectedStatus=200,e.responseType="arraybuffer",t.onError&&(e.onerror=function(i){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),n.onHeadersReceived=t.onHeadersReceived,n.onDone=t.onDone,n.onError=t.onError,n.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){const i=this.pendingRequests[t];i&&i.onProgress?.(e)}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const n=i.xhr;if(n.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4!==n.readyState)return;if(!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void i.onError?.(n.status);const s=n.status||200;if(!(200===s&&206===i.expectedStatus)&&s!==i.expectedStatus)return void i.onError?.(n.status);const a=function(t){const e=t.response;return"string"!==typeof e?e:bt(e).buffer}(n);if(206===s){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i.onDone({begin:parseInt(e[1],10),chunk:a})}else a?i.onDone({begin:0,chunk:a}):i.onError?.(n.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class ji{constructor(t){this._source=t,this._manager=new Ni(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return rt(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new zi(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new Hi(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class zi{constructor(t,e){this._manager=t;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(i),this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),i=new Headers(e.getAllResponseHeaders().trim().split(/[\r\n]+/).map((t=>{const[e,...i]=t.split(": ");return[e,i.join(": ")]}))),{allowRangeRequests:n,suggestedLength:s}=Ti({responseHeaders:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=Mi(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);if(this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=Di(t,this._url),this._headersCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class Hi{constructor(t,e,i){this._manager=t;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,i,n),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const e=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=Di(t,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const Bi=/^[a-z][a-z0-9\-+.]+:/i;function Vi(t,e,i){if("http:"===t.protocol){return Ie.get("http").request(t,{headers:e},i)}return Ie.get("https").request(t,{headers:e},i)}class $i{constructor(t){this.source=t,this.url=function(t){if(Bi.test(t))return new URL(t);const e=Ie.get("url");return new URL(e.pathToFileURL(t))}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.headers=Ei(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return rt(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new Yi(this):new qi(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=this.isFsUrl?new Xi(this,t,e):new Gi(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class Ui{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(t).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new ft("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class Wi{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=t.length,this.onProgress?.({loaded:this._loaded});return{value:new Uint8Array(t).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),this._storedError&&this._readableStream.destroy(this._storedError)}}class qi extends Ui{constructor(t){super(t);const e=Object.fromEntries(t.headers);this._request=Vi(this._url,e,(e=>{if(404===e.statusCode){const t=new pt(`Missing PDF "${this._url}".`);return this._storedError=t,void this._headersCapability.reject(t)}this._headersCapability.resolve(),this._setReadableStream(e);const i=new Headers(this._readableStream.headers),{allowRangeRequests:n,suggestedLength:s}=Ti({responseHeaders:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=Mi(i)})),this._request.on("error",(t=>{this._storedError=t,this._headersCapability.reject(t)})),this._request.end()}}class Gi extends Wi{constructor(t,e,i){super(t);const n=Object.fromEntries(t.headers);n.Range=`bytes=${e}-${i-1}`;this._request=Vi(this._url,n,(t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new pt(`Missing PDF "${this._url}".`);this._storedError=t}})),this._request.on("error",(t=>{this._storedError=t})),this._request.end()}}class Yi extends Ui{constructor(t){super(t);const e=Ie.get("fs");e.promises.lstat(this._url).then((t=>{this._contentLength=t.size,this._setReadableStream(e.createReadStream(this._url)),this._headersCapability.resolve()}),(t=>{"ENOENT"===t.code&&(t=new pt(`Missing PDF "${this._url}".`)),this._storedError=t,this._headersCapability.reject(t)}))}}class Xi extends Wi{constructor(t,e,i){super(t);const n=Ie.get("fs");this._setReadableStream(n.createReadStream(this._url,{start:e,end:i-1}))}}const Ki=30;class Zi{#ii=(()=>Promise.withResolvers())();#ut=null;#ni=!1;#si=(()=>!!globalThis.FontInspector?.enabled)();#ai=null;#ri=null;#oi=0;#li=0;#ci=null;#hi=null;#di=0;#ui=0;#pi=(()=>Object.create(null))();#mi=[];#gi=null;#fi=[];#vi=(()=>new WeakMap)();#bi=null;static#yi=(()=>new Map)();static#xi=(()=>new Map)();static#wi=(()=>new WeakMap)();static#Ai=null;static#_i=(()=>new Set)();constructor(t){let{textContentSource:e,container:i,viewport:n}=t;if(e instanceof ReadableStream)this.#gi=e;else{if("object"!==typeof e)throw new Error('No "textContentSource" parameter specified.');this.#gi=new ReadableStream({start(t){t.enqueue(e),t.close()}})}this.#ut=this.#hi=i,this.#ui=n.scale*(globalThis.devicePixelRatio||1),this.#di=n.rotation,this.#ri={div:null,properties:null,ctx:null};const{pageWidth:s,pageHeight:a,pageX:r,pageY:o}=n.rawDims;this.#bi=[1,0,0,-1,-r,o+a],this.#li=s,this.#oi=a,Zi.#Si(),te(i,n),this.#ii.promise.finally((()=>{Zi.#_i.delete(this),this.#ri=null,this.#pi=null})).catch((()=>{}))}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=xt.platform;return lt(this,"fontFamilyMap",new Map([["sans-serif",(t&&e?"Calibri, ":"")+"sans-serif"],["monospace",(t&&e?"Lucida Console, ":"")+"monospace"]]))}render(){const t=()=>{this.#ci.read().then((e=>{let{value:i,done:n}=e;n?this.#ii.resolve():(this.#ai??=i.lang,Object.assign(this.#pi,i.styles),this.#ki(i.items),t())}),this.#ii.reject)};return this.#ci=this.#gi.getReader(),Zi.#_i.add(this),t(),this.#ii.promise}update(t){let{viewport:e,onBefore:i=null}=t;const n=e.scale*(globalThis.devicePixelRatio||1),s=e.rotation;if(s!==this.#di&&(i?.(),this.#di=s,te(this.#hi,{rotation:s})),n!==this.#ui){i?.(),this.#ui=n;const t={div:null,properties:null,ctx:Zi.#Ci(this.#ai)};for(const e of this.#fi)t.properties=this.#vi.get(e),t.div=e,this.#Ei(t)}}cancel(){const t=new ft("TextLayer task cancelled.");this.#ci?.cancel(t).catch((()=>{})),this.#ci=null,this.#ii.reject(t)}get textDivs(){return this.#fi}get textContentItemsStr(){return this.#mi}#ki(t){if(this.#ni)return;this.#ri.ctx??=Zi.#Ci(this.#ai);const e=this.#fi,i=this.#mi;for(const n of t){if(e.length>1e5)return st("Ignoring additional textDivs for performance reasons."),void(this.#ni=!0);if(void 0!==n.str)i.push(n.str),this.#Ti(n);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const t=this.#ut;this.#ut=document.createElement("span"),this.#ut.classList.add("markedContent"),null!==n.id&&this.#ut.setAttribute("id",`${n.id}`),t.append(this.#ut)}else"endMarkedContent"===n.type&&(this.#ut=this.#ut.parentNode)}}#Ti(t){const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};this.#fi.push(e);const n=At.transform(this.#bi,t.transform);let s=Math.atan2(n[1],n[0]);const a=this.#pi[t.fontName];a.vertical&&(s+=Math.PI/2);let r=this.#si&&a.fontSubstitution||a.fontFamily;r=Zi.fontFamilyMap.get(r)||r;const o=Math.hypot(n[2],n[3]),l=o*Zi.#Mi(r,this.#ai);let c,h;0===s?(c=n[4],h=n[5]-l):(c=n[4]+l*Math.sin(s),h=n[5]-l*Math.cos(s));const d="calc(var(--scale-factor)*",u=e.style;this.#ut===this.#hi?(u.left=`${(100*c/this.#li).toFixed(2)}%`,u.top=`${(100*h/this.#oi).toFixed(2)}%`):(u.left=`${d}${c.toFixed(2)}px)`,u.top=`${d}${h.toFixed(2)}px)`),u.fontSize=`${d}${(Zi.#Ai*o).toFixed(2)}px)`,u.fontFamily=r,i.fontSize=o,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,this.#si&&(e.dataset.fontName=a.fontSubstitutionLoadedName||t.fontName),0!==s&&(i.angle=s*(180/Math.PI));let p=!1;if(t.str.length>1)p=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),i=Math.abs(t.transform[3]);e!==i&&Math.max(e,i)/Math.min(e,i)>1.5&&(p=!0)}if(p&&(i.canvasWidth=a.vertical?t.height:t.width),this.#vi.set(e,i),this.#ri.div=e,this.#ri.properties=i,this.#Ei(this.#ri),i.hasText&&this.#ut.append(e),i.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),this.#ut.append(t)}}#Ei(t){const{div:e,properties:i,ctx:n}=t,{style:s}=e;let a="";if(Zi.#Ai>1&&(a=`scale(${1/Zi.#Ai})`),0!==i.canvasWidth&&i.hasText){const{fontFamily:t}=s,{canvasWidth:r,fontSize:o}=i;Zi.#Di(n,o*this.#ui,t);const{width:l}=n.measureText(e.textContent);l>0&&(a=`scaleX(${r*this.#ui/l}) ${a}`)}0!==i.angle&&(a=`rotate(${i.angle}deg) ${a}`),a.length>0&&(s.transform=a)}static cleanup(){if(!(this.#_i.size>0)){this.#yi.clear();for(const{canvas:t}of this.#xi.values())t.remove();this.#xi.clear()}}static#Ci(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.#xi.get(t||="");if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#xi.set(t,e),this.#wi.set(e,{size:0,family:""})}return e}static#Di(t,e,i){const n=this.#wi.get(t);e===n.size&&i===n.family||(t.font=`${e}px ${i}`,n.size=e,n.family=i)}static#Si(){if(null!==this.#Ai)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),this.#Ai=t.getBoundingClientRect().height,t.remove()}static#Mi(t,e){const i=this.#yi.get(t);if(i)return i;const n=this.#Ci(e);n.canvas.width=n.canvas.height=Ki,this.#Di(n,Ki,t);const s=n.measureText("");let a=s.fontBoundingBoxAscent,r=Math.abs(s.fontBoundingBoxDescent);if(a){const e=a/(a+r);return this.#yi.set(t,e),n.canvas.width=n.canvas.height=0,e}n.strokeStyle="red",n.clearRect(0,0,Ki,Ki),n.strokeText("g",0,0);let o=n.getImageData(0,0,Ki,Ki).data;r=0;for(let c=o.length-1-3;c>=0;c-=4)if(o[c]>0){r=Math.ceil(c/4/Ki);break}n.clearRect(0,0,Ki,Ki),n.strokeText("A",0,Ki),o=n.getImageData(0,0,Ki,Ki).data,a=0;for(let c=0,h=o.length;c0){a=Ki-Math.floor(c/4/Ki);break}n.canvas.width=n.canvas.height=0;const l=a?a/(a+r):.8;return this.#yi.set(t,l),l}}class Ji{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};return function t(i){if(!i)return;let n=null;const s=i.name;if("#text"===s)n=i.value;else{if(!Ji.shouldBuildText(s))return;i?.attributes?.textContent?n=i.attributes.textContent:i.value&&(n=i.value)}if(null!==n&&e.push({str:n}),i.children)for(const e of i.children)t(e)}(t),i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}const Qi=65536,tn=a?class extends _e{_createCanvas(t,e){return Ie.get("canvas").createCanvas(t,e)}}:class extends _e{constructor(t){let{ownerDocument:e=globalThis.document,enableHWA:i=!1}=t;super({enableHWA:i}),this._document=e}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}},en=a?class extends Se{async _fetch(t){return Re(t)}}:ke,nn=a?class extends Ce{}:class extends Ce{#Ii;#Ri;#Pi;#Li;#Fi;#Oi;#y=0;constructor(t){let{docId:e,ownerDocument:i=globalThis.document}=t;super(),this.#Li=e,this.#Fi=i}get#w(){return this.#Ri||=new Map}get#Ni(){return this.#Oi||=new Map}get#ji(){if(!this.#Pi){const t=this.#Fi.createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const i=this.#Fi.createElementNS(Ot,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#Pi=this.#Fi.createElementNS(Ot,"defs"),t.append(i),i.append(this.#Pi),this.#Fi.body.append(t)}return this.#Pi}#zi(t){if(1===t.length){const e=t[0],i=new Array(256);for(let t=0;t<256;t++)i[t]=e[t]/255;const n=i.join(",");return[n,n,n]}const[e,i,n]=t,s=new Array(256),a=new Array(256),r=new Array(256);for(let o=0;o<256;o++)s[o]=e[o]/255,a[o]=i[o]/255,r[o]=n[o]/255;return[s.join(","),a.join(","),r.join(",")]}#Hi(t){if(void 0===this.#Ii){this.#Ii="";const t=this.#Fi.URL;t!==this.#Fi.baseURI&&(Bt(t)?st('#createUrl: ignore "data:"-URL for performance reasons.'):this.#Ii=t.split("#",1)[0])}return`url(${this.#Ii}#${t})`}addFilter(t){if(!t)return"none";let e=this.#w.get(t);if(e)return e;const[i,n,s]=this.#zi(t),a=1===t.length?i:`${i}${n}${s}`;if(e=this.#w.get(a),e)return this.#w.set(t,e),e;const r=`g_${this.#Li}_transfer_map_${this.#y++}`,o=this.#Hi(r);this.#w.set(t,o),this.#w.set(a,o);const l=this.#Bi(r);return this.#Vi(i,n,s,l),o}addHCMFilter(t,e){const i=`${t}-${e}`,n="base";let s=this.#Ni.get(n);if(s?.key===i)return s.url;if(s?(s.filter?.remove(),s.key=i,s.url="none",s.filter=null):(s={key:i,url:"none",filter:null},this.#Ni.set(n,s)),!t||!e)return s.url;const a=this.#$i(t);t=At.makeHexColor(...a);const r=this.#$i(e);if(e=At.makeHexColor(...r),this.#ji.style.color="","#000000"===t&&"#ffffff"===e||t===e)return s.url;const o=new Array(256);for(let u=0;u<=255;u++){const t=u/255;o[u]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const l=o.join(","),c=`g_${this.#Li}_hcm_filter`,h=s.filter=this.#Bi(c);this.#Vi(l,l,l,h),this.#Ui(h);const d=(t,e)=>{const i=a[t]/255,n=r[t]/255,s=new Array(e+1);for(let a=0;a<=e;a++)s[a]=i+a/e*(n-i);return s.join(",")};return this.#Vi(d(0,5),d(1,5),d(2,5),h),s.url=this.#Hi(c),s.url}addAlphaFilter(t){let e=this.#w.get(t);if(e)return e;const[i]=this.#zi([t]),n=`alpha_${i}`;if(e=this.#w.get(n),e)return this.#w.set(t,e),e;const s=`g_${this.#Li}_alpha_map_${this.#y++}`,a=this.#Hi(s);this.#w.set(t,a),this.#w.set(n,a);const r=this.#Bi(s);return this.#Wi(i,r),a}addLuminosityFilter(t){let e,i,n=this.#w.get(t||"luminosity");if(n)return n;if(t?([e]=this.#zi([t]),i=`luminosity_${e}`):i="luminosity",n=this.#w.get(i),n)return this.#w.set(t,n),n;const s=`g_${this.#Li}_luminosity_map_${this.#y++}`,a=this.#Hi(s);this.#w.set(t,a),this.#w.set(i,a);const r=this.#Bi(s);return this.#qi(r),t&&this.#Wi(e,r),a}addHighlightHCMFilter(t,e,i,n,s){const a=`${e}-${i}-${n}-${s}`;let r=this.#Ni.get(t);if(r?.key===a)return r.url;if(r?(r.filter?.remove(),r.key=a,r.url="none",r.filter=null):(r={key:a,url:"none",filter:null},this.#Ni.set(t,r)),!e||!i)return r.url;const[o,l]=[e,i].map(this.#$i.bind(this));let c=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),h=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[d,u]=[n,s].map(this.#$i.bind(this));h{const n=new Array(256),s=(h-c)/i,a=t/255,r=(e-t)/(255*i);let o=0;for(let l=0;l<=i;l++){const t=Math.round(c+l*s),e=a+l*r;for(let i=o;i<=t;i++)n[i]=e;o=t+1}for(let l=o;l<256;l++)n[l]=n[o-1];return n.join(",")},m=`g_${this.#Li}_hcm_${t}_filter`,g=r.filter=this.#Bi(m);return this.#Ui(g),this.#Vi(p(d[0],u[0],5),p(d[1],u[1],5),p(d[2],u[2],5),g),r.url=this.#Hi(m),r.url}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&0!==this.#Ni.size||(this.#Pi&&(this.#Pi.parentNode.parentNode.remove(),this.#Pi=null),this.#Ri&&(this.#Ri.clear(),this.#Ri=null),this.#y=0)}#qi(t){const e=this.#Fi.createElementNS(Ot,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)}#Ui(t){const e=this.#Fi.createElementNS(Ot,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)}#Bi(t){const e=this.#Fi.createElementNS(Ot,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#ji.append(e),e}#Gi(t,e,i){const n=this.#Fi.createElementNS(Ot,e);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),t.append(n)}#Vi(t,e,i,n){const s=this.#Fi.createElementNS(Ot,"feComponentTransfer");n.append(s),this.#Gi(s,"feFuncR",t),this.#Gi(s,"feFuncG",e),this.#Gi(s,"feFuncB",i)}#Wi(t,e){const i=this.#Fi.createElementNS(Ot,"feComponentTransfer");e.append(i),this.#Gi(i,"feFuncA",t)}#$i(t){return this.#ji.style.color=t,Zt(getComputedStyle(this.#ji).getPropertyValue("color"))}},sn=a?class extends Ee{async _fetch(t){return Re(t)}}:Te;function an(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"string"===typeof t||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new on,{docId:i}=e,n=t.url?function(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(a&&"string"===typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url):null,s=t.data?function(t){if(a&&"undefined"!==typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"===typeof t)return bt(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"===typeof t&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(t.data):null,r=t.httpHeaders||null,o=!0===t.withCredentials,l=t.password??null,c=t.range instanceof ln?t.range:null,h=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:Qi;let d=t.worker instanceof un?t.worker:null;const u=t.verbosity,p="string"!==typeof t.docBaseUrl||Bt(t.docBaseUrl)?null:t.docBaseUrl,m="string"===typeof t.cMapUrl?t.cMapUrl:null,g=!1!==t.cMapPacked,f=t.CMapReaderFactory||en,v="string"===typeof t.standardFontDataUrl?t.standardFontDataUrl:null,b=t.StandardFontDataFactory||sn,y=!0!==t.stopAtErrors,x=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,w=!1!==t.isEvalSupported,A="boolean"===typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!a,_="boolean"===typeof t.isChrome?t.isChrome:!xt.platform.isFirefox&&"undefined"!==typeof window&&!!window?.chrome,S=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,k="boolean"===typeof t.disableFontFace?t.disableFontFace:a,C=!0===t.fontExtraProperties,E=!0===t.enableXfa,T=t.ownerDocument||globalThis.document,M=!0===t.disableRange,D=!0===t.disableStream,I=!0===t.disableAutoFetch,R=!0===t.pdfBug,P=t.CanvasFactory||tn,L=t.FilterFactory||nn,F=!0===t.enableHWA,O=c?c.length:t.length??NaN,N="boolean"===typeof t.useSystemFonts?t.useSystemFonts:!a&&!k,j="boolean"===typeof t.useWorkerFetch?t.useWorkerFetch:f===ke&&b===Te&&m&&v&&qt(m,document.baseURI)&&qt(v,document.baseURI);t.canvasFactory&&Yt("`canvasFactory`-instance option, please use `CanvasFactory` instead."),t.filterFactory&&Yt("`filterFactory`-instance option, please use `FilterFactory` instead.");et(u);const z={canvasFactory:new P({ownerDocument:T,enableHWA:F}),filterFactory:new L({docId:i,ownerDocument:T}),cMapReaderFactory:j?null:new f({baseUrl:m,isCompressed:g}),standardFontDataFactory:j?null:new b({baseUrl:v})};if(!d){const t={verbosity:u,port:oi.workerPort};d=t.port?un.fromPort(t):new un(t),e._worker=d}const H={docId:i,apiVersion:"4.8.69",data:s,password:l,disableAutoFetch:I,rangeChunkSize:h,length:O,docBaseUrl:p,enableXfa:E,evaluatorOptions:{maxImageSize:x,disableFontFace:k,ignoreErrors:y,isEvalSupported:w,isOffscreenCanvasSupported:A,isChrome:_,canvasMaxAreaInBytes:S,fontExtraProperties:C,useSystemFonts:N,cMapUrl:j?m:null,standardFontDataUrl:j?v:null}},B={disableFontFace:k,fontExtraProperties:C,ownerDocument:T,pdfBug:R,styleElement:null,loadingParams:{disableAutoFetch:I,enableXfa:E}};return d.promise.then((function(){if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const t=d.messageHandler.sendWithPromise("GetDocRequest",H,s?[s.buffer]:null);let l;if(c)l=new Si(c,{disableRange:M,disableStream:D});else if(!s){if(!n)throw new Error("getDocument - no `url` parameter provided.");let t;if(a){t="undefined"!==typeof fetch&&"undefined"!==typeof Response&&"body"in Response.prototype&&qt(n)?Li:$i}else t=qt(n)?Li:ji;l=new t({url:n,length:O,httpHeaders:r,withCredentials:o,rangeChunkSize:h,disableRange:M,disableStream:D})}return t.then((t=>{if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const n=new yi(i,t,d.port),s=new pn(n,e,l,B,z);e._transport=s,n.send("Ready",null)}))})).catch(e._capability.reject),e}function rn(t){return"object"===typeof t&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0}class on{static#Li=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d"+on.#Li++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await(this._transport?.destroy())}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}class ln{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=n,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const i of this._progressListeners)i(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const t of this._progressiveDoneListeners)t()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){at("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class cn{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return lt(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class hn{#Yi=null;#Xi=!1;constructor(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new Wt:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new gn,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new zt({viewBox:this.view,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return lt(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render(t){let{canvasContext:e,viewport:i,intent:n="display",annotationMode:s=v.ENABLE,transform:a=null,background:r=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:h=null,isEditing:u=!1}=t;this._stats?.time("Overall");const p=this._transport.getRenderingIntent(n,s,h,u),{renderingIntent:m,cacheKey:g}=p;this.#Xi=!1,this.#Ki(),o||=this._transport.getOptionalContentConfig(m);let f=this._intentStates.get(g);f||(f=Object.create(null),this._intentStates.set(g,f)),f.streamReaderCancelTimeout&&(clearTimeout(f.streamReaderCancelTimeout),f.streamReaderCancelTimeout=null);const b=!!(m&d);f.displayReadyCapability||(f.displayReadyCapability=Promise.withResolvers(),f.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(p));const y=t=>{f.renderTasks.delete(x),(this._maybeCleanupAfterRender||b)&&(this.#Xi=!0),this.#Zi(!b),t?(x.capability.reject(t),this._abortOperatorList({intentState:f,reason:t instanceof Error?t:new Error(t)})):x.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},x=new vn({callback:y,params:{canvasContext:e,viewport:i,transform:a,background:r},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:f.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!b,pdfBug:this._pdfBug,pageColors:c});(f.renderTasks||=new Set).add(x);const w=x.task;return Promise.all([f.displayReadyCapability.promise,o]).then((t=>{let[e,i]=t;if(this.destroyed)y();else{if(this._stats?.time("Rendering"),!(i.renderingIntent&m))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");x.initializeGraphics({transparency:e,optionalContentConfig:i}),x.operatorListChanged()}})).catch(y),w}getOperatorList(){let{intent:t="display",annotationMode:e=v.ENABLE,printAnnotationStorage:i=null,isEditing:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s=this._transport.getRenderingIntent(t,e,i,n,!0);let a,r=this._intentStates.get(s.cacheKey);return r||(r=Object.create(null),this._intentStates.set(s.cacheKey,r)),r.opListReadCapability||(a=Object.create(null),a.operatorListChanged=function(){r.operatorList.lastChunk&&(r.opListReadCapability.resolve(r.operatorList),r.renderTasks.delete(a))},r.opListReadCapability=Promise.withResolvers(),(r.renderTasks||=new Set).add(a),r.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(s)),r.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:t=!1,disableNormalization:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((t=>Ji.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,i){const n=e.getReader(),s={items:[],styles:Object.create(null),lang:null};!function e(){n.read().then((function(i){let{value:n,done:a}=i;a?t(s):(s.lang??=n.lang,Object.assign(s.styles,n.styles),s.items.push(...n.items),e())}),i)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),this.#Xi=!1,this.#Ki(),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#Xi=!0;const e=this.#Zi(!1);return t&&e&&(this._stats&&=new Wt),e}#Zi(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.#Ki(),!this.#Xi||this.destroyed)return!1;if(t)return this.#Yi=setTimeout((()=>{this.#Yi=null,this.#Zi(!1)}),5e3),!1;for(const{renderTasks:e,operatorList:i}of this._intentStates.values())if(e.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#Xi=!1,!0}#Ki(){this.#Yi&&(clearTimeout(this.#Yi),this.#Yi=null)}_startRenderPage(t,e){const i=this._intentStates.get(e);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(t))}_renderPageChunk(t,e){for(let i=0,n=t.length;i{o.read().then((t=>{let{value:e,done:i}=t;i?l.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,l),c())}),(t=>{if(l.streamReader=null,!this._transport.destroyed){if(l.operatorList){l.operatorList.lastChunk=!0;for(const t of l.renderTasks)t.operatorListChanged();this.#Zi(!0)}if(l.displayReadyCapability)l.displayReadyCapability.reject(t);else{if(!l.opListReadCapability)throw t;l.opListReadCapability.reject(t)}}}))};c()}_abortOperatorList(t){let{intentState:e,reason:i,force:n=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(i instanceof Ht){let t=100;return i.extraDelay>0&&i.extraDelay<1e3&&(t+=i.extraDelay),void(e.streamReaderCancelTimeout=setTimeout((()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:i,force:!0})}),t))}}if(e.streamReader.cancel(new ft(i.message)).catch((()=>{})),e.streamReader=null,!this._transport.destroyed){for(const[t,i]of this._intentStates)if(i===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}class dn{#Ji=(()=>new Map)();#Qi=(()=>Promise.resolve())();postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};this.#Qi.then((()=>{for(const[t]of this.#Ji)t.call(this,i)}))}addEventListener(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=null;if(i?.signal instanceof AbortSignal){const{signal:s}=i;if(s.aborted)return void st("LoopbackPort - cannot use an `aborted` signal.");const a=()=>this.removeEventListener(t,e);n=()=>s.removeEventListener("abort",a),s.addEventListener("abort",a)}this.#Ji.set(e,n)}removeEventListener(t,e){const i=this.#Ji.get(e);i?.(),this.#Ji.delete(e)}terminate(){for(const[,t]of this.#Ji)t?.();this.#Ji.clear()}}class un{static#tn=0;static#en=!1;static#in;static#nn=(()=>{a&&(this.#en=!0,oi.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(t,e)=>{let i;try{if(i=new URL(t),!i.origin||"null"===i.origin)return!1}catch{return!1}const n=new URL(e,i);return i.origin===n.origin},this._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}})();constructor(){let{name:t=null,port:e=null,verbosity:i=it()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,e){if(un.#in?.has(e))throw new Error("Cannot use more than one PDFWorker per port.");return(un.#in||=new WeakMap).set(e,this),void this._initializeFromPort(e)}this._initialize()}get promise(){return a?Promise.all([Ie.promise,this._readyCapability.promise]):this._readyCapability.promise}#sn(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new yi("main","worker",t),this._messageHandler.on("ready",(function(){})),this.#sn()}_initialize(){if(un.#en||un.#an)return void this._setupFakeWorker();let{workerSrc:t}=un;try{un._isSameOrigin(window.location.href,t)||(t=un._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new yi("main","worker",e),n=()=>{s.abort(),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=new AbortController;e.addEventListener("error",(()=>{this._webWorker||n()}),{signal:s.signal}),i.on("test",(t=>{s.abort(),!this.destroyed&&t?(this._messageHandler=i,this._port=e,this._webWorker=e,this.#sn()):n()})),i.on("ready",(t=>{if(s.abort(),this.destroyed)n();else try{a()}catch{this._setupFakeWorker()}}));const a=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};return void a()}catch{nt("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){un.#en||(st("Setting up fake worker."),un.#en=!0),un._setupFakeWorkerGlobal.then((t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new dn;this._port=e;const i="fake"+un.#tn++,n=new yi(i+"_worker",i,e);t.setup(n,e),this._messageHandler=new yi(i,i+"_worker",e),this.#sn()})).catch((t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))}))}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),un.#in?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const e=this.#in?.get(t.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new un(t)}static get workerSrc(){if(oi.workerSrc)return oi.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#an(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return lt(this,"_setupFakeWorkerGlobal",(async()=>{if(this.#an)return this.#an;return(await import(this.workerSrc)).WorkerMessageHandler})())}}class pn{#rn=(()=>new Map)();#on=(()=>new Map)();#ln=(()=>new Map)();#cn=(()=>new Map)();#hn=null;constructor(t,e,i,n,s){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new gn,this.fontLoader=new we({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#dn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=this.#rn.get(t);if(i)return i;const n=this.messageHandler.sendWithPromise(t,e);return this.#rn.set(t,n),n}get annotationStorage(){return lt(this,"annotationStorage",new ye)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=h,r=be;switch(t){case"any":a=c;break;case"display":break;case"print":a=d;break;default:st(`getRenderingIntent - invalid intent: ${t}`)}const o=a&d&&i instanceof xe?i:this.annotationStorage;switch(e){case v.DISABLE:a+=m;break;case v.ENABLE:break;case v.ENABLE_FORMS:a+=u;break;case v.ENABLE_STORAGE:a+=p,r=o.serializable;break;default:st(`getRenderingIntent - invalid annotationMode: ${e}`)}n&&(a+=g),s&&(a+=f);const{ids:l,hash:b}=o.modifiedIds;return{renderingIntent:a,cacheKey:[a,r.hash,b].join("_"),annotationStorageSerializable:r,modifiedIds:l}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#hn?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const i of this.#on.values())t.push(i._destroy());this.#on.clear(),this.#ln.clear(),this.#cn.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then((()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#rn.clear(),this.filterFactory.destroy(),Zi.cleanup(),this._networkStream?.cancelAllRequests(new ft("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",((t,e)=>{rt(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then((function(t){let{value:i,done:n}=t;n?e.close():(rt(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}})),t.on("ReaderHeadersReady",(async t=>{await this._fullReader.headersReady;const{isStreamingSupported:i,isRangeSupported:n,contentLength:s}=this._fullReader;return i&&n||(this._lastProgress&&e.onProgress?.(this._lastProgress),this._fullReader.onProgress=t=>{e.onProgress?.({loaded:t.loaded,total:t.total})}),{isStreamingSupported:i,isRangeSupported:n,contentLength:s}})),t.on("GetRangeReader",((t,e)=>{rt(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(t.begin,t.end);i?(e.onPull=()=>{i.read().then((function(t){let{value:i,done:n}=t;n?e.close():(rt(i instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{i.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}):e.close()})),t.on("GetDoc",(t=>{let{pdfInfo:i}=t;this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,e._capability.resolve(new cn(i,this))})),t.on("DocException",(function(t){let i;switch(t.name){case"PasswordException":i=new ht(t.message,t.code);break;case"InvalidPDFException":i=new ut(t.message);break;case"MissingPDFException":i=new pt(t.message);break;case"UnexpectedResponseException":i=new mt(t.message,t.status);break;case"UnknownErrorException":i=new dt(t.message,t.details);break;default:at("DocException - expected a valid Error.")}e._capability.reject(i)})),t.on("PasswordRequest",(t=>{if(this.#hn=Promise.withResolvers(),e.onPassword){const n=t=>{t instanceof Error?this.#hn.reject(t):this.#hn.resolve({password:t})};try{e.onPassword(n,t.code)}catch(i){this.#hn.reject(i)}}else this.#hn.reject(new ht(t.message,t.code));return this.#hn.promise})),t.on("DataLoaded",(t=>{e.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)})),t.on("StartRenderPage",(t=>{if(this.destroyed)return;this.#on.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)})),t.on("commonobj",(e=>{let[i,n,s]=e;if(this.destroyed)return null;if(this.commonObjs.has(i))return null;switch(n){case"Font":const{disableFontFace:e,fontExtraProperties:a,pdfBug:r}=this._params;if("error"in s){const t=s.error;st(`Error during font loading: ${t}`),this.commonObjs.resolve(i,t);break}const o=r&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,l=new Ae(s,{disableFontFace:e,inspectFont:o});this.fontLoader.bind(l).catch((()=>t.sendWithPromise("FontFallback",{id:i}))).finally((()=>{!a&&l.data&&(l.data=null),this.commonObjs.resolve(i,l)}));break;case"CopyLocalImage":const{imageRef:c}=s;rt(c,"The imageRef must be defined.");for(const t of this.#on.values())for(const[,e]of t.objs)if(e?.ref===c)return e.dataLen?(this.commonObjs.resolve(i,structuredClone(e)),e.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,s);break;default:throw new Error(`Got unknown common object type ${n}`)}return null})),t.on("obj",(t=>{let[e,i,n,s]=t;if(this.destroyed)return;const a=this.#on.get(i);if(!a.objs.has(e))if(0!==a._intentStates.size)switch(n){case"Image":a.objs.resolve(e,s),s?.dataLen>1e7&&(a._maybeCleanupAfterRender=!0);break;case"Pattern":a.objs.resolve(e,s);break;default:throw new Error(`Got unknown object type ${n}`)}else s?.bitmap?.close()})),t.on("DocProgress",(t=>{this.destroyed||e.onProgress?.({loaded:t.loaded,total:t.total})})),t.on("FetchBuiltInCMap",(async t=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.cMapReaderFactory)throw new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.");return this.cMapReaderFactory.fetch(t)})),t.on("FetchStandardFontData",(async t=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.standardFontDataFactory)throw new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.");return this.standardFontDataFactory.fetch(t)}))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&st("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).finally((()=>{this.annotationStorage.resetModified()}))}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=this.#ln.get(e);if(i)return i;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&this.#cn.set(i.refStr,t);const n=new hn(e,i,this,this._params.pdfBug);return this.#on.set(e,n),n}));return this.#ln.set(e,n),n}getPageIndex(t){return rn(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this.#dn("GetFieldObjects")}hasJSActions(){return this.#dn("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!==typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#dn("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#dn("GetOptionalContentConfig").then((e=>new _i(e,t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=this.#rn.get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then((t=>({info:t[0],metadata:t[1]?new xi(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})));return this.#rn.set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#on.values()){if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`)}this.commonObjs.clear(),t||this.fontLoader.clear(),this.#rn.clear(),this.filterFactory.destroy(!0),Zi.cleanup()}}cachedPageNumber(t){if(!rn(t))return null;const e=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;return this.#cn.get(e)??null}}const mn=Symbol("INITIAL_DATA");class gn{#un=(()=>Object.create(null))();#pn(t){return this.#un[t]||={...Promise.withResolvers(),data:mn}}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const i=this.#pn(t);return i.promise.then((()=>e(i.data))),null}const i=this.#un[t];if(!i||i.data===mn)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const e=this.#un[t];return!!e&&e.data!==mn}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=this.#pn(t);i.data=e,i.resolve()}clear(){for(const t in this.#un){const{data:e}=this.#un[t];e?.bitmap?.close()}this.#un=Object.create(null)}*[Symbol.iterator](){for(const t in this.#un){const{data:e}=this.#un[t];e!==mn&&(yield[t,e])}}}class fn{#mn=null;constructor(t){this.#mn=t,this.onContinue=null}get promise(){return this.#mn.capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.#mn.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#mn.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this.#mn;return t.form||t.canvas&&e?.size>0}}class vn{#gn=null;static#fn=(()=>new WeakSet)();constructor(t){let{callback:e,params:i,objs:n,commonObjs:s,annotationCanvasMap:a,operatorList:r,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:h=!1,pdfBug:d=!1,pageColors:u=null}=t;this.callback=e,this.params=i,this.objs=n,this.commonObjs=s,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=r,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=d,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===h&&"undefined"!==typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new fn(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=i.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics(t){let{transparency:e=!1,optionalContentConfig:i}=t;if(this.cancelled)return;if(this._canvas){if(vn.#fn.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");vn.#fn.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:n,viewport:s,transform:a,background:r}=this.params;this.gfx=new ri(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:i},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:a,viewport:s,transparency:e,background:r}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#gn&&(window.cancelAnimationFrame(this.#gn),this.#gn=null),vn.#fn.delete(this._canvas),this.callback(t||new Ht(`Rendering cancelled, page ${this._pageIndex+1}`,e))}operatorListChanged(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#gn=window.requestAnimationFrame((()=>{this.#gn=null,this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),vn.#fn.delete(this._canvas),this.callback())))}}const bn="4.8.69",yn="3634dab10";function xn(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function wn(t){return Math.max(0,Math.min(255,255*t))}class An{static CMYK_G(t){let[e,i,n,s]=t;return["G",1-Math.min(1,.3*e+.59*n+.11*i+s)]}static G_CMYK(t){let[e]=t;return["CMYK",0,0,0,1-e]}static G_RGB(t){let[e]=t;return["RGB",e,e,e]}static G_rgb(t){let[e]=t;return e=wn(e),[e,e,e]}static G_HTML(t){let[e]=t;const i=xn(e);return`#${i}${i}${i}`}static RGB_G(t){let[e,i,n]=t;return["G",.3*e+.59*i+.11*n]}static RGB_rgb(t){return t.map(wn)}static RGB_HTML(t){return`#${t.map(xn).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(t){let[e,i,n,s]=t;return["RGB",1-Math.min(1,e+s),1-Math.min(1,n+s),1-Math.min(1,i+s)]}static CMYK_rgb(t){let[e,i,n,s]=t;return[wn(1-Math.min(1,e+s)),wn(1-Math.min(1,n+s)),wn(1-Math.min(1,i+s))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,i,n]=t;const s=1-e,a=1-i,r=1-n;return["CMYK",s,a,r,Math.min(s,a,r)]}}class _n{create(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),i||(n.setAttribute("width",`${t}px`),n.setAttribute("height",`${e}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${t} ${e}`),n}createElement(t){if("string"!==typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){at("Abstract method `_createSVG` called.")}}class Sn extends _n{_createSVG(t){return document.createElementNS(Ot,t)}}class kn{static setupStorage(t,e,i,n,s){const a=n.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==a.value&&(t.textContent=a.value),"print"===s)break;t.addEventListener("input",(t=>{n.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(a.value===i.attributes.xfaOn?t.setAttribute("checked",!0):a.value===i.attributes.xfaOff&&t.removeAttribute("checked"),"print"===s)break;t.addEventListener("change",(t=>{n.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{if(null!==a.value&&t.setAttribute("value",a.value),"print"===s)break;t.addEventListener("input",(t=>{n.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==a.value){t.setAttribute("value",a.value);for(const t of i.children)t.attributes.value===a.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",(t=>{const i=t.target.options,s=-1===i.selectedIndex?"":i[i.selectedIndex].value;n.setValue(e,{value:s})}))}}static setAttributes(t){let{html:e,element:i,storage:n=null,intent:s,linkService:a}=t;const{attributes:r}=i,o=e instanceof HTMLAnchorElement;"radio"===r.type&&(r.name=`${r.name}-${s}`);for(const[l,c]of Object.entries(r))if(null!==c&&void 0!==c)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!o||"href"!==l&&"newWindow"!==l)&&e.setAttribute(l,c)}o&&a.addLinkAttributes(e,r.href,r.newWindow),n&&r.dataId&&this.setupStorage(e,r.dataId,i,n)}static render(t){const e=t.annotationStorage,i=t.linkService,n=t.xfaHtml,s=t.intent||"display",a=document.createElement(n.name);n.attributes&&this.setAttributes({html:a,element:n,intent:s,linkService:i});const r="richText"!==s,o=t.div;if(o.append(a),t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;o.style.transform=e}r&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===n.children.length){if(n.value){const t=document.createTextNode(n.value);a.append(t),r&&Ji.shouldBuildText(n.name)&&l.push(t)}return{textDivs:l}}const c=[[n,-1,a]];for(;c.length>0;){const[t,n,a]=c.at(-1);if(n+1===t.children.length){c.pop();continue}const o=t.children[++c.at(-1)[1]];if(null===o)continue;const{name:h}=o;if("#text"===h){const t=document.createTextNode(o.value);l.push(t),a.append(t);continue}const d=o?.attributes?.xmlns?document.createElementNS(o.attributes.xmlns,h):document.createElement(h);if(a.append(d),o.attributes&&this.setAttributes({html:d,element:o,storage:e,intent:s,linkService:i}),o.children?.length>0)c.push([o,-1,d]);else if(o.value){const t=document.createTextNode(o.value);r&&Ji.shouldBuildText(h)&&l.push(t),d.append(t)}}for(const h of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))h.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}const Cn=1e3,En=new WeakSet;function Tn(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class Mn{static create(t){switch(t.data.annotationType){case M:return new In(t);case T:return new Rn(t);case W:switch(t.data.fieldType){case"Tx":return new Ln(t);case"Btn":return t.data.radioButton?new Nn(t):t.data.checkBox?new On(t):new jn(t);case"Ch":return new zn(t);case"Sig":return new Fn(t)}return new Pn(t);case $:return new Hn(t);case D:return new Vn(t);case I:return new $n(t);case R:return new Un(t);case P:return new Wn(t);case F:return new qn(t);case B:return new Yn(t);case V:return new Xn(t);case L:return new Gn(t);case O:return new Kn(t);case N:return new Zn(t);case j:return new Jn(t);case z:return new Qn(t);case H:return new ts(t);case U:return new es(t);default:return new Dn(t)}}}class Dn{#vn=null;#bn=!1;#yn=null;constructor(t){let{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData(t){let{titleObj:e,contentsObj:i,richText:n}=t;return!!(e?.str||i?.str||n?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return Dn._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#vn||={rect:this.data.rect.slice(0)};const{rect:e}=t;e&&this.#xn(e),this.#yn?.popup.updateEdited(t)}resetEdited(){this.#vn&&(this.#xn(this.#vn.rect),this.#yn?.popup.resetEdited(),this.#vn=null)}#xn(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:a,pageX:r,pageY:o}}}}=this;i?.splice(0,4,...t);const{width:l,height:c}=Tn(t);e.left=100*(t[0]-r)/s+"%",e.top=100*(a-t[3]+o)/a+"%",0===n?(e.width=100*l/s+"%",e.height=100*c/a+"%"):this.setRotation(n)}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),this instanceof Pn||(s.tabIndex=Cn);const{style:a}=s;if(a.zIndex=this.parent.zIndex++,e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof Hn){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,s),s}const{width:r,height:o}=Tn(e.rect);if(!t&&e.borderStyle.width>0){a.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e=`calc(${t}px * var(--scale-factor)) / calc(${i}px * var(--scale-factor))`;a.borderRadius=e}else if(this instanceof Nn){const t=`calc(${r}px * var(--scale-factor)) / calc(${o}px * var(--scale-factor))`;a.borderRadius=t}switch(e.borderStyle.style){case q:a.borderStyle="solid";break;case G:a.borderStyle="dashed";break;case Y:st("Unimplemented border style: beveled");break;case X:st("Unimplemented border style: inset");break;case K:a.borderBottomStyle="solid"}const n=e.borderColor||null;n?(this.#bn=!0,a.borderColor=At.makeHexColor(0|n[0],0|n[1],0|n[2])):a.borderWidth=0}const l=At.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:c,pageHeight:h,pageX:d,pageY:u}=n.rawDims;a.left=100*(l[0]-d)/c+"%",a.top=100*(l[1]-u)/h+"%";const{rotation:p}=e;return e.hasOwnCanvas||0===p?(a.width=100*r/c+"%",a.height=100*o/h+"%"):this.setRotation(p,s),s}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims,{width:s,height:a}=Tn(this.data.rect);let r,o;t%180===0?(r=100*s/i,o=100*a/n):(r=100*a/i,o=100*s/n),e.style.width=`${r}%`,e.style.height=`${o}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,e,i)=>{const n=i.detail[t],s=n[0],a=n.slice(1);i.target.style[e]=An[`${s}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[e]:An[`${s}_rgb`](a)})};return lt(this,"_commonActions",{display:t=>{const{display:e}=t.detail,i=e%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const n of Object.keys(e.detail)){const s=t[n]||i[n];s?.(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[n,s]of Object.entries(e)){const a=i[n];if(a){a({detail:{[n]:s},target:t}),delete e[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,n,s]=this.data.rect.map((t=>Math.fround(t)));if(8===t.length){const[a,r,o,l]=t.subarray(2,6);if(n===a&&s===r&&e===o&&i===l)return}const{style:a}=this.container;let r;if(this.#bn){const{borderColor:t,borderWidth:e}=a;a.borderWidth=0,r=["url('data:image/svg+xml;utf8,",'',``],this.container.classList.add("hasBorder")}const o=n-e,l=s-i,{svgFactory:c}=this,h=c.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0);const d=c.createElement("defs");h.append(d);const u=c.createElement("clipPath"),p=`clippath_${this.data.id}`;u.setAttribute("id",p),u.setAttribute("clipPathUnits","objectBoundingBox"),d.append(u);for(let m=2,g=t.length;m`)}this.#bn&&(r.push("')"),a.backgroundImage=r.join("")),this.container.append(h),this.container.style.clipPath=`url(#${p})`}_createPopup(){const{data:t}=this,e=this.#yn=new Hn({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation},parent:this.parent,elements:[this]});this.parent.div.append(e.render())}render(){at("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[];if(this._fieldObjects){const n=this._fieldObjects[t];if(n)for(const{page:t,id:s,exportValues:a}of n){if(-1===t)continue;if(s===e)continue;const n="string"===typeof a?a:null,r=document.querySelector(`[data-element-id="${s}"]`);!r||En.has(r)?i.push({id:s,exportValue:n,domElement:r}):st(`_getElementsByName - element not allowed: ${s}`)}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,s=n.getAttribute("data-element-id");s!==e&&(En.has(n)&&i.push({id:s,exportValue:t,domElement:n}))}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",(()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})}))}}class In extends Dn{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let n=!1;return t.url?(e.addLinkAttributes(i,t.url,t.newWindow),n=!0):t.action?(this._bindNamedAction(i,t.action),n=!0):t.attachment?(this.#wn(i,t.attachment,t.attachmentDest),n=!0):t.setOCGState?(this.#An(i,t.setOCGState),n=!0):t.dest?(this._bindLink(i,t.dest),n=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),n=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(i,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(i),this.container}#_n(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&this.#_n()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),this.#_n()}#wn(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t.href=this.linkService.getAnchorUrl(""),e.description&&(t.title=e.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(e.content,e.filename,i),!1),this.#_n()}#An(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),this.#_n()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(e.actions)){const s=i.get(n);s&&(t[s]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}}),!1))}t.onclick||(t.onclick=()=>!1),this.#_n()}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),this.#_n(),!this._fieldObjects)return st('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{i?.();const{fields:t,refs:n,include:s}=e,a=[];if(0!==t.length||0!==n.length){const e=new Set(n);for(const i of t){const t=this._fieldObjects[i]||[];for(const{id:i}of t)e.add(i)}for(const t of Object.values(this._fieldObjects))for(const i of t)e.has(i.id)===s&&a.push(i)}else for(const e of Object.values(this._fieldObjects))a.push(...e);const r=this.annotationStorage,o=[];for(const e of a){const{id:t}=e;switch(o.push(t),e.type){case"text":{const i=e.defaultValue||"";r.setValue(t,{value:i});break}case"checkbox":case"radiobutton":{const i=e.defaultValue===e.exportValues;r.setValue(t,{value:i});break}case"combobox":case"listbox":{const i=e.defaultValue||"";r.setValue(t,{value:i});break}default:continue}const i=document.querySelector(`[data-element-id="${t}"]`);i&&(En.has(i)?i.dispatchEvent(new Event("resetform")):st(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}),!1}}}class Rn extends Dn{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class Pn extends Dn{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&("CANVAS"===t.previousSibling?.nodeName&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return xt.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,s){i.includes("mouse")?t.addEventListener(i,(t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(i,(t=>{if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t)}})}))}_setEventListeners(t,e,i,n){for(const[s,a]of i)("Action"===a||this.data.actions?.[a])&&("Focus"!==a&&"Blur"!==a||(e||={focused:!1}),this._setEventListener(t,e,s,a,n),"Focus"!==a||this.data.actions?.Blur?"Blur"!==a||this.data.actions?.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null))}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":At.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,s=t.style;let a;const r=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(l*n))||1);a=Math.min(n,r(e/l))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(n,r(t/l))}s.fontSize=`calc(${a}px * var(--scale-factor))`,s.color=At.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(s.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class Ln extends Pn{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,n){const s=this.annotationStorage;for(const a of this._getElementsByName(t.name,t.id))a.domElement&&(a.domElement[e]=i),s.setValue(a.id,{[n]:i})}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const n=t.getValue(e,{value:this.data.fieldValue});let s=n.value||"";const a=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;a&&s.length>a&&(s=s.slice(0,a));let r=n.formattedValue||this.data.textContent?.join("\n")||null;r&&this.data.comb&&(r=r.replaceAll(/\s+/g,""));const o={userValue:s,formattedValue:r,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=r??s,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",r??s),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),En.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=Cn,this._setRequired(i,this.data.required),a&&(i.maxLength=a),i.addEventListener("input",(n=>{t.setValue(e,{value:n.target.value}),this.setPropertyOnSiblings(i,"value",n.target.value,"value"),o.formattedValue=null})),i.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue??"";i.value=o.userValue=e,o.formattedValue=null}));let l=t=>{const{formattedValue:e}=o;null!==e&&void 0!==e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",(t=>{if(o.focused)return;const{target:e}=t;o.userValue&&(e.value=o.userValue),o.lastCommittedValue=e.value,o.commitKey=1,this.data.actions?.Focus||(o.focused=!0)})),i.addEventListener("updatefromsandbox",(i=>{this.showElementAndHideCanvas(i.target);const n={value(i){o.userValue=i.detail.value??"",t.setValue(e,{value:o.userValue.toString()}),i.target.value=o.userValue},formattedValue(i){const{formattedValue:n}=i.detail;o.formattedValue=n,null!==n&&void 0!==n&&i.target!==document.activeElement&&(i.target.value=n),t.setValue(e,{formattedValue:n})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{const{charLimit:n}=i.detail,{target:s}=i;if(0===n)return void s.removeAttribute("maxLength");s.setAttribute("maxLength",n);let a=o.userValue;!a||a.length<=n||(a=a.slice(0,n),s.value=o.userValue=a,t.setValue(e,{value:a}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:s.selectionStart,selEnd:s.selectionEnd}}))}};this._dispatchEventFromSandbox(n,i)})),i.addEventListener("keydown",(t=>{o.commitKey=1;let i=-1;if("Escape"===t.key?i=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(o.commitKey=3):i=2,-1===i)return;const{value:n}=t.target;o.lastCommittedValue!==n&&(o.lastCommittedValue=n,o.userValue=n,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))}));const n=l;l=null,i.addEventListener("blur",(t=>{if(!o.focused||!t.relatedTarget)return;this.data.actions?.Blur||(o.focused=!1);const{value:i}=t.target;o.userValue=i,o.lastCommittedValue!==i&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,willCommit:!0,commitKey:o.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),n(t)})),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",(t=>{o.lastCommittedValue=null;const{data:i,target:n}=t,{value:s,selectionStart:a,selectionEnd:r}=n;let l=a,c=r;switch(t.inputType){case"deleteWordBackward":{const t=s.substring(0,a).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=s.substring(a).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":a===r&&(l-=1);break;case"deleteContentForward":a===r&&(c+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,change:i||"",willCommit:!1,selStart:l,selEnd:c}})})),this._setEventListeners(i,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}if(l&&i.addEventListener("blur",l),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/a;i.classList.add("comb"),i.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Fn extends Pn{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class On extends Pn{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;"string"===typeof n&&(n="Off"!==n,t.setValue(i,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");return En.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.setAttribute("exportValue",e.exportValue),s.tabIndex=Cn,s.addEventListener("change",(n=>{const{name:s,checked:a}=n.target;for(const r of this._getElementsByName(s,i)){const i=a&&r.exportValue===e.exportValue;r.domElement&&(r.domElement.checked=i),t.setValue(r.id,{value:i})}t.setValue(i,{value:a})})),s.addEventListener("resetform",(t=>{const i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue})),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",(e=>{const n={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(i,{value:e.target.checked})}};this._dispatchEventFromSandbox(n,e)})),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Nn extends Pn{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if("string"===typeof n&&(n=n!==e.buttonValue,t.setValue(i,{value:n})),n)for(const a of this._getElementsByName(e.fieldName,i))t.setValue(a.id,{value:!1});const s=document.createElement("input");if(En.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.tabIndex=Cn,s.addEventListener("change",(e=>{const{name:n,checked:s}=e.target;for(const a of this._getElementsByName(n,i))t.setValue(a.id,{value:!1});t.setValue(i,{value:s})})),s.addEventListener("resetform",(t=>{const i=e.defaultFieldValue;t.target.checked=null!==i&&void 0!==i&&i===e.buttonValue})),this.enableScripting&&this.hasJSActions){const n=e.buttonValue;s.addEventListener("updatefromsandbox",(e=>{const s={value:e=>{const s=n===e.detail.value;for(const n of this._getElementsByName(e.target.name)){const e=s&&n.id===i;n.domElement&&(n.domElement.checked=e),t.setValue(n.id,{value:e})}}};this._dispatchEventFromSandbox(s,e)})),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class jn extends In{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))),t}}class zn extends Pn{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),n=document.createElement("select");En.add(n),n.setAttribute("data-element-id",e),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=Cn;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const i of n.options)i.selected=i.value===e}));for(const c of this.data.options){const t=document.createElement("option");t.textContent=c.displayValue,t.value=c.exportValue,i.value.includes(c.exportValue)&&(t.setAttribute("selected",!0),s=!1),n.append(t)}let a=null;if(s){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),n.prepend(t),a=()=>{t.remove(),n.removeEventListener("input",a),a=null},n.addEventListener("input",a)}const r=t=>{const e=t?"value":"textContent",{options:i,multiple:s}=n;return s?Array.prototype.filter.call(i,(t=>t.selected)).map((t=>t[e])):-1===i.selectedIndex?null:i[i.selectedIndex][e]};let o=r(!1);const l=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",(i=>{const s={value(i){a?.();const s=i.detail.value,l=new Set(Array.isArray(s)?s:[s]);for(const t of n.options)t.selected=l.has(t.value);t.setValue(e,{value:r(!0)}),o=r(!1)},multipleSelection(t){n.multiple=!0},remove(i){const s=n.options,a=i.detail.remove;if(s[a].selected=!1,n.remove(a),s.length>0){-1===Array.prototype.findIndex.call(s,(t=>t.selected))&&(s[0].selected=!0)}t.setValue(e,{value:r(!0),items:l(i)}),o=r(!1)},clear(i){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]}),o=r(!1)},insert(i){const{index:s,displayValue:a,exportValue:c}=i.detail.insert,h=n.children[s],d=document.createElement("option");d.textContent=a,d.value=c,h?h.before(d):n.append(d),t.setValue(e,{value:r(!0),items:l(i)}),o=r(!1)},items(i){const{items:s}=i.detail;for(;0!==n.length;)n.remove(0);for(const t of s){const{displayValue:e,exportValue:i}=t,s=document.createElement("option");s.textContent=e,s.value=i,n.append(s)}n.options.length>0&&(n.options[0].selected=!0),t.setValue(e,{value:r(!0),items:l(i)}),o=r(!1)},indices(i){const n=new Set(i.detail.indices);for(const t of i.target.options)t.selected=n.has(t.index);t.setValue(e,{value:r(!0)}),o=r(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(s,i)})),n.addEventListener("input",(i=>{const n=r(!0),s=r(!1);t.setValue(e,{value:n}),i.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,change:s,changeEx:n,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(t=>t.target.value))):n.addEventListener("input",(function(i){t.setValue(e,{value:r(!0)})})),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class Hn extends Dn{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:Dn._hasPopupData(e)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new Bn({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),e=[];for(const i of this.elements)i.popup=t,i.container.ariaHasPopup="dialog",e.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",e.map((t=>`${Ct}${t}`)).join(",")),this.container}}class Bn{#Sn=this.#kn.bind(this);#Cn=this.#En.bind(this);#Tn=this.#Mn.bind(this);#Dn=this.#In.bind(this);#Rn=null;#ut=null;#Pn=null;#Ln=null;#Fn=null;#On=null;#Nn=null;#jn=!1;#zn=null;#C=null;#Hn=null;#Bn=null;#Vn=null;#vn=null;#$n=!1;constructor(t){let{container:e,color:i,elements:n,titleObj:s,modificationDate:a,contentsObj:r,richText:o,parent:l,rect:c,parentRect:h,open:d}=t;this.#ut=e,this.#Vn=s,this.#Pn=r,this.#Bn=o,this.#On=l,this.#Rn=i,this.#Hn=c,this.#Nn=h,this.#Fn=n,this.#Ln=Xt.toDateObject(a),this.trigger=n.flatMap((t=>t.getElementsToTriggerPopup()));for(const u of this.trigger)u.addEventListener("click",this.#Dn),u.addEventListener("mouseenter",this.#Tn),u.addEventListener("mouseleave",this.#Cn),u.classList.add("popupTriggerArea");for(const u of n)u.container?.addEventListener("keydown",this.#Sn);this.#ut.hidden=!0,d&&this.#In()}render(){if(this.#zn)return;const t=this.#zn=document.createElement("div");if(t.className="popup",this.#Rn){const e=t.style.outlineColor=At.makeHexColor(...this.#Rn);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))t.style.backgroundColor=`color-mix(in srgb, ${e} 30%, white)`;else{const e=.7;t.style.backgroundColor=At.makeHexColor(...this.#Rn.map((t=>Math.floor(e*(255-t)+t))))}}const e=document.createElement("span");e.className="header";const i=document.createElement("h1");if(e.append(i),({dir:i.dir,str:i.textContent}=this.#Vn),t.append(e),this.#Ln){const t=document.createElement("span");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),t.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#Ln.valueOf()})),e.append(t)}const n=this.#Un;if(n)kn.render({xfaHtml:n,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const e=this._formatContents(this.#Pn);t.append(e)}this.#ut.append(t)}get#Un(){const t=this.#Bn,e=this.#Pn;return!t?.str||e?.str&&e.str!==t.str?null:this.#Bn.html||null}get#Wn(){return this.#Un?.attributes?.style?.fontSize||0}get#qn(){return this.#Un?.attributes?.style?.color||null}#Gn(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:this.#qn,fontSize:this.#Wn?`calc(${this.#Wn}px * var(--scale-factor))`:""}};for(const s of t.split("\n"))e.push({name:"span",value:s,attributes:n});return i}_formatContents(t){let{str:e,dir:i}=t;const n=document.createElement("p");n.classList.add("popupContent"),n.dir=i;const s=e.split(/(?:\r\n?|\n)/);for(let a=0,r=s.length;a{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&this.#es()})),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return this.#ts}addHighlightArea(){this.container.classList.add("highlightArea")}#es(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class is{#is=null;#ns=null;#ss=(()=>new Map)();#as=null;constructor(t){let{div:e,accessibilityManager:i,annotationCanvasMap:n,annotationEditorUIManager:s,page:a,viewport:r,structTreeLayer:o}=t;this.div=e,this.#is=i,this.#ns=n,this.#as=o||null,this.page=a,this.viewport=r,this.zIndex=0,this._annotationEditorUIManager=s}hasEditableAnnotations(){return this.#ss.size>0}async#rs(t,e){const i=t.firstChild||t,n=i.id=`${Ct}${e}`,s=await(this.#as?.getAriaAttributes(n));if(s)for(const[a,r]of s)i.setAttribute(a,r);this.div.append(t),this.#is?.moveElementInDOM(this.div,t,i,!1)}async render(t){const{annotations:e}=t,i=this.div;te(i,this.viewport);const n=new Map,s={data:null,layer:i,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new Sn,annotationStorage:t.annotationStorage||new ye,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const a of e){if(a.noHTML)continue;const t=a.annotationType===$;if(t){const t=n.get(a.id);if(!t)continue;s.elements=t}else{const{width:t,height:e}=Tn(a.rect);if(t<=0||e<=0)continue}s.data=a;const e=Mn.create(s);if(!e.isRenderable)continue;if(!t&&a.popupRef){const t=n.get(a.popupRef);t?t.push(e):n.set(a.popupRef,[e])}const i=e.render();a.hidden&&(i.style.visibility="hidden"),await this.#rs(i,a.id),e._isEditable&&(this.#ss.set(e.data.id,e),this._annotationEditorUIManager?.renderAnnotationElement(e))}this.#os()}update(t){let{viewport:e}=t;const i=this.div;this.viewport=e,te(i,{rotation:e.rotation}),this.#os(),i.hidden=!1}#os(){if(!this.#ns)return;const t=this.div;for(const[e,i]of this.#ns){const n=t.querySelector(`[data-annotation-id="${e}"]`);if(!n)continue;i.className="annotationContent";const{firstChild:s}=n;s?"CANVAS"===s.nodeName?s.replaceWith(i):s.classList.contains("annotationContent")?s.after(i):s.before(i):n.append(i)}this.#ns.clear()}getEditableAnnotations(){return Array.from(this.#ss.values())}getEditableAnnotation(t){return this.#ss.get(t)}}const ns=/\r\n?|\n/g;class ss extends ue{#Rn;#ls="";#cs=`${this.id}-editor`;#hs=null;#Wn;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=ss.prototype,e=t=>t.isEmpty(),i=he.TRANSLATE_SMALL,n=he.TRANSLATE_BIG;return lt(this,"_keyboardManager",new le([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-n,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[n,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-n],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,n],checker:e}]]))}static _type="freetext";static _editorType=(()=>b.FREETEXT)();constructor(t){super({...t,name:"freeTextEditor"}),this.#Rn=t.color||ss._defaultColor||ue._defaultLineColor,this.#Wn=t.fontSize||ss._defaultFontSize}static initialize(t,e){ue.initialize(t,e);const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case y.FREETEXT_SIZE:ss._defaultFontSize=e;break;case y.FREETEXT_COLOR:ss._defaultColor=e}}updateParams(t,e){switch(t){case y.FREETEXT_SIZE:this.#ds(e);break;case y.FREETEXT_COLOR:this.#us(e)}}static get defaultPropertiesToUpdate(){return[[y.FREETEXT_SIZE,ss._defaultFontSize],[y.FREETEXT_COLOR,ss._defaultColor||ue._defaultLineColor]]}get propertiesToUpdate(){return[[y.FREETEXT_SIZE,this.#Wn],[y.FREETEXT_COLOR,this.#Rn]]}#ds(t){const e=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-this.#Wn)*this.parentScale),this.#Wn=t,this.#ps()},i=this.#Wn;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:y.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#us(t){const e=t=>{this.#Rn=this.editorDiv.style.color=t},i=this.#Rn;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:y.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-ss._internalPadding*t,-(ss._internalPadding+this.#Wn)*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(b.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#hs=new AbortController;const t=this._uiManager.combinedSignal(this.#hs);this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#cs),this._isDraggable=!0,this.#hs?.abort(),this.#hs=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#ms(){const t=[];this.editorDiv.normalize();let e=null;for(const i of this.editorDiv.childNodes)e?.nodeType===Node.TEXT_NODE&&"BR"===i.nodeName||(t.push(ss.#gs(i)),e=i);return t.join("\n")}#ps(){const[t,e]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,n=e.style.display,s=e.classList.contains("hidden");e.classList.remove("hidden"),e.style.display="hidden",t.div.append(this.div),i=e.getBoundingClientRect(),e.remove(),e.style.display=n,e.classList.toggle("hidden",s)}this.rotation%180===this.parentRotation%180?(this.width=i.width/t,this.height=i.height/e):(this.width=i.height/t,this.height=i.width/e),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#ls,e=this.#ls=this.#ms().trimEnd();if(t===e)return;const i=t=>{this.#ls=t,t?(this.#fs(),this._uiManager.rebuild(this),this.#ps()):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),this.#ps()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){ss._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#cs),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#Wn}px * var(--scale-factor))`,i.color=this.#Rn,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),se(this,this.div,["dblclick","keydown"]),this.width){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:s}=this._initialData;let[a,r]=this.getInitialTranslation();[a,r]=this.pageTranslationToScreen(a,r);const[o,l]=this.pageDimensions,[c,h]=this.pageTranslation;let d,u;switch(this.rotation){case 0:d=t+(s[0]-c)/o,u=e+this.height-(s[1]-h)/l;break;case 90:d=t+(s[0]-c)/o,u=e-(s[1]-h)/l,[a,r]=[r,-a];break;case 180:d=t-this.width+(s[0]-c)/o,u=e-(s[1]-h)/l,[a,r]=[-a,-r];break;case 270:d=t+(s[0]-c-this.height*l)/o,u=e+(s[1]-h-this.width*o)/l,[a,r]=[-r,a]}this.setAt(d*i,u*n,a,r)}else this.setAt(t*i,e*n,this.width*i,this.height*n);this.#fs(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#gs(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(ns,"")}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();const n=ss.#vs(e.getData("text")||"").replaceAll(ns,"\n");if(!n)return;const s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();const a=s.getRangeAt(0);if(!n.includes("\n"))return a.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),void s.collapseToStart();const{startContainer:r,startOffset:o}=a,l=[],c=[];if(r.nodeType===Node.TEXT_NODE){const t=r.parentElement;if(c.push(r.nodeValue.slice(o).replaceAll(ns,"")),t!==this.editorDiv){let e=l;for(const i of this.editorDiv.childNodes)i!==t?e.push(ss.#gs(i)):e=c}l.push(r.nodeValue.slice(0,o).replaceAll(ns,""))}else if(r===this.editorDiv){let t=l,e=0;for(const i of this.editorDiv.childNodes)e++===o&&(t=c),t.push(ss.#gs(i))}this.#ls=`${l.join("\n")}${n}${c.join("\n")}`,this.#fs();const h=new Range;let d=l.reduce(((t,e)=>t+e.length),0);for(const{firstChild:u}of this.editorDiv.childNodes)if(u.nodeType===Node.TEXT_NODE){const t=u.nodeValue.length;if(d<=t){h.setStart(u,d),h.setEnd(u,d);break}d-=t}s.removeAllRanges(),s.addRange(h)}#fs(){if(this.editorDiv.replaceChildren(),this.#ls)for(const t of this.#ls.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}#bs(){return this.#ls.replaceAll("\xa0"," ")}static#vs(t){return t.replaceAll(" ","\xa0")}get contentDiv(){return this.editorDiv}static async deserialize(t,e,i){let n=null;if(t instanceof Vn){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:s,rotation:a,id:r,popupRef:o},textContent:l,textPosition:c,parent:{page:{pageNumber:h}}}=t;if(!l||0===l.length)return null;n=t={annotationType:b.FREETEXT,color:Array.from(i),fontSize:e,value:l.join("\n"),position:c,pageIndex:h-1,rect:s.slice(0),rotation:a,id:r,deleted:!1,popupRef:o}}const s=await super.deserialize(t,e,i);return s.#Wn=t.fontSize,s.#Rn=At.makeHexColor(...t.color),s.#ls=ss.#vs(t.value),s.annotationElementId=t.id||null,s._initialData=n,s}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const e=ss._internalPadding*this.parentScale,i=this.getRect(e,e),n=ue._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#Rn),s={annotationType:b.FREETEXT,color:n,fontSize:this.#Wn,value:this.#bs(),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?s:this.annotationElementId&&!this.#ys(s)?null:(s.id=this.annotationElementId,s)}#ys(t){const{value:e,fontSize:i,color:n,pageIndex:s}=this._initialData;return this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some(((t,e)=>t!==n[e]))||t.pageIndex!==s}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(this.deleted)return e;const{style:i}=e;i.fontSize=`calc(${this.#Wn}px * var(--scale-factor))`,i.color=this.#Rn,e.replaceChildren();for(const s of this.#ls.split("\n")){const t=document.createElement("div");t.append(s?document.createTextNode(s):document.createElement("br")),e.append(t)}const n=ss._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(n,n),popupContent:this.#ls}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}class as{toSVGPath(){at("Abstract method `toSVGPath` must be implemented.")}get box(){at("Abstract getter `box` must be implemented.")}serialize(t,e){at("Abstract method `serialize` must be implemented.")}get classNamesForDrawing(){at("Abstract getter `classNamesForDrawing` must be implemented.")}get classNamesForOutlining(){at("Abstract getter `classNamesForOutlining` must be implemented.")}get mustRemoveSelfIntersections(){return!1}}class rs{#xs;#ws=[];#As;#_s;#Ss=[];#ks=(()=>new Float64Array(18))();#Cs;#Es;#Ts;#Ms;#Ds;#Is;#Rs=[];static#Ps=8;static#Ls=2;static#Fs=(()=>rs.#Ps+rs.#Ls)();constructor(t,e,i,n,s){let{x:a,y:r}=t,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.#xs=e,this.#Is=n*i,this.#_s=s,this.#ks.set([NaN,NaN,NaN,NaN,a,r],6),this.#As=o,this.#Ms=rs.#Ps*i,this.#Ts=rs.#Fs*i,this.#Ds=i,this.#Rs.push(a,r)}isEmpty(){return isNaN(this.#ks[8])}#Os(){const t=this.#ks.subarray(4,6),e=this.#ks.subarray(16,18),[i,n,s,a]=this.#xs;return[(this.#Cs+(t[0]-e[0])/2-i)/s,(this.#Es+(t[1]-e[1])/2-n)/a,(this.#Cs+(e[0]-t[0])/2-i)/s,(this.#Es+(e[1]-t[1])/2-n)/a]}add(t){let{x:e,y:i}=t;this.#Cs=e,this.#Es=i;const[n,s,a,r]=this.#xs;let[o,l,c,h]=this.#ks.subarray(8,12);const d=e-c,u=i-h,p=Math.hypot(d,u);if(p=6;n-=6)isNaN(e[n])?i.push(`L${e[n+4]} ${e[n+5]}`):i.push(`C${e[n]} ${e[n+1]} ${e[n+2]} ${e[n+3]} ${e[n+4]} ${e[n+5]}`);return this.#zs(i),i.join(" ")}#Ns(){const[t,e,i,n]=this.#xs,[s,a,r,o]=this.#Os();return`M${(this.#ks[2]-t)/i} ${(this.#ks[3]-e)/n} L${(this.#ks[4]-t)/i} ${(this.#ks[5]-e)/n} L${s} ${a} L${r} ${o} L${(this.#ks[16]-t)/i} ${(this.#ks[17]-e)/n} L${(this.#ks[14]-t)/i} ${(this.#ks[15]-e)/n} Z`}#zs(t){const e=this.#ws;t.push(`L${e[4]} ${e[5]} Z`)}#js(t){const[e,i,n,s]=this.#xs,a=this.#ks.subarray(4,6),r=this.#ks.subarray(16,18),[o,l,c,h]=this.#Os();t.push(`L${(a[0]-e)/n} ${(a[1]-i)/s} L${o} ${l} L${c} ${h} L${(r[0]-e)/n} ${(r[1]-i)/s}`)}newFreeDrawOutline(t,e,i,n,s,a){return new os(t,e,i,n,s,a)}getOutlines(){const t=this.#Ss,e=this.#ws,i=this.#ks,[n,s,a,r]=this.#xs,o=new Float64Array((this.#Rs?.length??0)+2);for(let h=0,d=o.length-2;h=6;h-=6)for(let t=0;t<6;t+=2)isNaN(e[h+t])?(l[c]=l[c+1]=NaN,c+=2):(l[c]=e[h+t],l[c+1]=e[h+t+1],c+=2);return this.#Vs(l,c),this.newFreeDrawOutline(l,o,this.#xs,this.#Ds,this.#As,this.#_s)}#Hs(t){const e=this.#ks,[i,n,s,a]=this.#xs,[r,o,l,c]=this.#Os(),h=new Float64Array(36);return h.set([NaN,NaN,NaN,NaN,(e[2]-i)/s,(e[3]-n)/a,NaN,NaN,NaN,NaN,(e[4]-i)/s,(e[5]-n)/a,NaN,NaN,NaN,NaN,r,o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,(e[16]-i)/s,(e[17]-n)/a,NaN,NaN,NaN,NaN,(e[14]-i)/s,(e[15]-n)/a],0),this.newFreeDrawOutline(h,t,this.#xs,this.#Ds,this.#As,this.#_s)}#Vs(t,e){const i=this.#ws;return t.set([NaN,NaN,NaN,NaN,i[4],i[5]],e),e+6}#Bs(t,e){const i=this.#ks.subarray(4,6),n=this.#ks.subarray(16,18),[s,a,r,o]=this.#xs,[l,c,h,d]=this.#Os();return t.set([NaN,NaN,NaN,NaN,(i[0]-s)/r,(i[1]-a)/o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,h,d,NaN,NaN,NaN,NaN,(n[0]-s)/r,(n[1]-a)/o],e),e+24}}class os extends as{#xs;#$s=null;#As;#_s;#Rs;#Ds;#Us;constructor(t,e,i,n,s,a){super(),this.#Us=t,this.#Rs=e,this.#xs=i,this.#Ds=n,this.#As=s,this.#_s=a,this.#Ws(a);const{x:r,y:o,width:l,height:c}=this.#$s;for(let h=0,d=t.length;h5&&void 0!==arguments[5]?arguments[5]:0)}getNewOutline(t,e){const{x:i,y:n,width:s,height:a}=this.#$s,[r,o,l,c]=this.#xs,h=s*l,d=a*c,u=i*l+r,p=n*c+o,m=this.newOutliner({x:this.#Rs[0]*h+u,y:this.#Rs[1]*d+p},this.#xs,this.#Ds,t,this.#_s,e??this.#As);for(let g=2;g1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=1/0,a=-1/0,r=1/0,o=-1/0;const l=10**-4;for(const{x:g,y:f,width:v,height:b}of t){const t=Math.floor((g-e)/l)*l,i=Math.ceil((g+v+e)/l)*l,n=Math.floor((f-e)/l)*l,c=Math.ceil((f+b+e)/l)*l,h=[t,n,c,!0],d=[i,n,c,!1];this.#Ys.push(h,d),s=Math.min(s,t),a=Math.max(a,i),r=Math.min(r,n),o=Math.max(o,c)}const c=a-s+2*i,h=o-r+2*i,d=s-i,u=r-i,p=this.#Ys.at(n?-1:-2),m=[p[0],p[2]];for(const g of this.#Ys){const[t,e,i]=g;g[0]=(t-d)/c,g[1]=(e-u)/h,g[2]=(i-u)/h}this.#xs={x:d,y:u,width:c,height:h,lastPoint:m}}getOutlines(){this.#Ys.sort(((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]));const t=[];for(const e of this.#Ys)e[3]?(t.push(...this.#Ks(e)),this.#Zs(e)):(this.#Js(e),t.push(...this.#Ks(e)));return this.#Qs(t)}#Qs(t){const e=[],i=new Set;for(const a of t){const[t,i,n]=a;e.push([t,i,a],[t,n,a])}e.sort(((t,e)=>t[1]-e[1]||t[0]-e[0]));for(let a=0,r=e.length;a0;){const t=i.values().next().value;let[e,a,r,o,l]=t;i.delete(t);let c=e,h=a;for(s=[e,r],n.push(s);;){let t;if(i.has(o))t=o;else{if(!i.has(l))break;t=l}i.delete(t),[e,a,r,o,l]=t,c!==e&&(s.push(c,h,e,h===a?a:r),c=e),h=h===a?r:a}s.push(c,h)}return new cs(n,this.#xs)}#ta(t){const e=this.#Xs;let i=0,n=e.length-1;for(;i<=n;){const s=i+n>>1,a=e[s][0];if(a===t)return s;a=0;s--){const[t,n]=this.#Xs[s];if(t!==e)break;if(t===e&&n===i)return void this.#Xs.splice(s,1)}}#Ks(t){const[e,i,n]=t,s=[[e,i,n]],a=this.#ta(n);for(let r=0;r=t)if(o>i)s[n][1]=i;else{if(1===a)return[];s.splice(n,1),n--,a--}else s[n][2]=t,o>i&&s.push([e,i,o])}}return s}}class cs extends as{#xs;#ea;constructor(t,e){super(),this.#ea=t,this.#xs=e}toSVGPath(){const t=[];for(const e of this.#ea){let[i,n]=e;t.push(`M${i} ${n}`);for(let s=2;s5&&void 0!==arguments[5]?arguments[5]:0)}}class us{#ia=null;#na=null;#sa;#aa=null;#ra=!1;#oa=!1;#a=null;#la;#ca=null;#g=null;#ha;static#da=null;static get _keyboardManager(){return lt(this,"_keyboardManager",new le([[["Escape","mac+Escape"],us.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],us.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],us.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],us.prototype._moveToPrevious],[["Home","mac+Home"],us.prototype._moveToBeginning],[["End","mac+End"],us.prototype._moveToEnd]]))}constructor(t){let{editor:e=null,uiManager:i=null}=t;e?(this.#oa=!1,this.#ha=y.HIGHLIGHT_COLOR,this.#a=e):(this.#oa=!0,this.#ha=y.HIGHLIGHT_DEFAULT_COLOR),this.#g=e?._uiManager||i,this.#la=this.#g._eventBus,this.#sa=e?.color||this.#g?.highlightColors.values().next().value||"#FFFF98",us.#da||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const t=this.#ia=document.createElement("button");t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.setAttribute("aria-haspopup",!0);const e=this.#g._signal;t.addEventListener("click",this.#ua.bind(this),{signal:e}),t.addEventListener("keydown",this.#kn.bind(this),{signal:e});const i=this.#na=document.createElement("span");return i.className="swatch",i.setAttribute("aria-hidden",!0),i.style.backgroundColor=this.#sa,t.append(i),t}renderMainDropdown(){const t=this.#aa=this.#pa();return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}#pa(){const t=document.createElement("div"),e=this.#g._signal;t.addEventListener("contextmenu",Gt,{signal:e}),t.className="dropdown",t.role="listbox",t.setAttribute("aria-multiselectable",!1),t.setAttribute("aria-orientation","vertical"),t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[i,n]of this.#g.highlightColors){const s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",n),s.title=i,s.setAttribute("data-l10n-id",us.#da[i]);const a=document.createElement("span");s.append(a),a.className="swatch",a.style.backgroundColor=n,s.setAttribute("aria-selected",n===this.#sa),s.addEventListener("click",this.#ma.bind(this,n),{signal:e}),t.append(s)}return t.addEventListener("keydown",this.#kn.bind(this),{signal:e}),t}#ma(t,e){e.stopPropagation(),this.#la.dispatch("switchannotationeditorparams",{source:this,type:this.#ha,value:t})}_colorSelectFromKeyboard(t){if(t.target===this.#ia)return void this.#ua(t);const e=t.target.getAttribute("data-color");e&&this.#ma(e,t)}_moveToNext(t){this.#ga?t.target!==this.#ia?t.target.nextSibling?.focus():this.#aa.firstChild?.focus():this.#ua(t)}_moveToPrevious(t){t.target!==this.#aa?.firstChild&&t.target!==this.#ia?(this.#ga||this.#ua(t),t.target.previousSibling?.focus()):this.#ga&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){this.#ga?this.#aa.firstChild?.focus():this.#ua(t)}_moveToEnd(t){this.#ga?this.#aa.lastChild?.focus():this.#ua(t)}#kn(t){us._keyboardManager.exec(this,t)}#ua(t){if(this.#ga)return void this.hideDropdown();if(this.#ra=0===t.detail,this.#ca||(this.#ca=new AbortController,window.addEventListener("pointerdown",this.#c.bind(this),{signal:this.#g.combinedSignal(this.#ca)})),this.#aa)return void this.#aa.classList.remove("hidden");const e=this.#aa=this.#pa();this.#ia.append(e)}#c(t){this.#aa?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#aa?.classList.add("hidden"),this.#ca?.abort(),this.#ca=null}get#ga(){return this.#aa&&!this.#aa.classList.contains("hidden")}_hideDropdownFromKeyboard(){this.#oa||(this.#ga?(this.hideDropdown(),this.#ia.focus({preventScroll:!0,focusVisible:this.#ra})):this.#a?.unselect())}updateColor(t){if(this.#na&&(this.#na.style.backgroundColor=t),!this.#aa)return;const e=this.#g.highlightColors.values();for(const i of this.#aa.children)i.setAttribute("aria-selected",e.next().value===t)}destroy(){this.#ia?.remove(),this.#ia=null,this.#na=null,this.#aa?.remove(),this.#aa=null}}class ps extends ue{#fa=null;#va=0;#ba;#ya=null;#s=null;#xa=null;#wa=null;#Aa=0;#_a=null;#Sa=null;#y=null;#ka=!1;#Ca=null;#Ea;#Ta=null;#Ma="";#Is;#Da="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=(()=>b.HIGHLIGHT)();static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const t=ps.prototype;return lt(this,"_keyboardManager",new le([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:"highlightEditor"}),this.color=t.color||ps._defaultColor,this.#Is=t.thickness||ps._defaultThickness,this.#Ea=t.opacity||ps._defaultOpacity,this.#ba=t.boxes||null,this.#Da=t.methodOfCreation||"",this.#Ma=t.text||"",this._isDraggable=!1,t.highlightId>-1?(this.#ka=!0,this.#Ia(t),this.#Ra()):this.#ba&&(this.#fa=t.anchorNode,this.#va=t.anchorOffset,this.#wa=t.focusNode,this.#Aa=t.focusOffset,this.#Pa(),this.#Ra(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:this.#ka?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#Is,methodOfCreation:this.#Da}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}#Pa(){const t=new ls(this.#ba,.001);this.#Sa=t.getOutlines(),({x:this.x,y:this.y,width:this.width,height:this.height}=this.#Sa.box);const e=new ls(this.#ba,.0025,.001,"ltr"===this._uiManager.direction);this.#xa=e.getOutlines();const{lastPoint:i}=this.#xa.box;this.#Ca=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]}#Ia(t){let{highlightOutlines:e,highlightId:i,clipPathId:n}=t;this.#Sa=e;if(this.#xa=e.getNewOutline(this.#Is/2+1.5,.0025),i>=0)this.#y=i,this.#ya=n,this.parent.drawLayer.finalizeLine(i,e),this.#Ta=this.parent.drawLayer.drawOutline(this.#xa);else if(this.parent){const t=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(this.#y,e),this.parent.drawLayer.updateBox(this.#y,ps.#La(this.#Sa.box,(t-this.rotation+360)%360)),this.parent.drawLayer.updateLine(this.#Ta,this.#xa),this.parent.drawLayer.updateBox(this.#Ta,ps.#La(this.#xa.box,t))}const{x:s,y:a,width:r,height:o}=e.box;switch(this.rotation){case 0:this.x=s,this.y=a,this.width=r,this.height=o;break;case 90:{const[t,e]=this.parentDimensions;this.x=a,this.y=1-s,this.width=r*e/t,this.height=o*t/e;break}case 180:this.x=1-s,this.y=1-a,this.width=r,this.height=o;break;case 270:{const[t,e]=this.parentDimensions;this.x=1-a,this.y=s,this.width=r*e/t,this.height=o*t/e;break}}const{lastPoint:l}=this.#xa.box;this.#Ca=[(l[0]-s)/r,(l[1]-a)/o]}static initialize(t,e){ue.initialize(t,e),ps._defaultColor||=e.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(t,e){switch(t){case y.HIGHLIGHT_DEFAULT_COLOR:ps._defaultColor=e;break;case y.HIGHLIGHT_THICKNESS:ps._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return this.#Ca}updateParams(t,e){switch(t){case y.HIGHLIGHT_COLOR:this.#us(e);break;case y.HIGHLIGHT_THICKNESS:this.#Fa(e)}}static get defaultPropertiesToUpdate(){return[[y.HIGHLIGHT_DEFAULT_COLOR,ps._defaultColor],[y.HIGHLIGHT_THICKNESS,ps._defaultThickness]]}get propertiesToUpdate(){return[[y.HIGHLIGHT_COLOR,this.color||ps._defaultColor],[y.HIGHLIGHT_THICKNESS,this.#Is||ps._defaultThickness],[y.HIGHLIGHT_FREE,this.#ka]]}#us(t){const e=(t,e)=>{this.color=t,this.parent?.drawLayer.changeColor(this.#y,t),this.#s?.updateColor(t),this.#Ea=e,this.parent?.drawLayer.changeOpacity(this.#y,e)},i=this.color,n=this.#Ea;this.addCommands({cmd:e.bind(this,t,ps._defaultOpacity),undo:e.bind(this,i,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:y.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)}#Fa(t){const e=this.#Is,i=t=>{this.#Is=t,this.#Oa(t)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:y.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&(this.#s=new us({editor:this}),t.addColorPicker(this.#s)),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#Na())}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,this.#Na())}onceAdded(){this.annotationElementId||this.parent.addUndoableEditor(this),this.div.focus()}remove(){this.#ja(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#Ra(),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?this.#ja():t&&(this.#Ra(t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),e&&this.select()}#Oa(t){if(!this.#ka)return;this.#Ia({highlightOutlines:this.#Sa.getNewOutline(t/2)}),this.fixAndSetPosition();const[e,i]=this.parentDimensions;this.setDims(this.width*e,this.height*i)}#ja(){null!==this.#y&&this.parent&&(this.parent.drawLayer.remove(this.#y),this.#y=null,this.parent.drawLayer.remove(this.#Ta),this.#Ta=null)}#Ra(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;null===this.#y&&(({id:this.#y,clipPathId:this.#ya}=t.drawLayer.draw(this.#Sa,this.color,this.#Ea)),this.#Ta=t.drawLayer.drawOutline(this.#xa),this.#_a&&(this.#_a.style.clipPath=this.#ya))}static#La(t,e){let{x:i,y:n,width:s,height:a}=t;switch(e){case 90:return{x:1-n-a,y:i,width:a,height:s};case 180:return{x:1-i-s,y:1-n-a,width:s,height:a};case 270:return{x:n,y:1-i-s,width:a,height:s}}return{x:i,y:n,width:s,height:a}}rotate(t){const{drawLayer:e}=this.parent;let i;this.#ka?(t=(t-this.rotation+360)%360,i=ps.#La(this.#Sa.box,t)):i=ps.#La(this,t),e.rotate(this.#y,t),e.rotate(this.#Ta,t),e.updateBox(this.#y,i),e.updateBox(this.#Ta,ps.#La(this.#xa.box,t))}render(){if(this.div)return this.div;const t=super.render();this.#Ma&&(t.setAttribute("aria-label",this.#Ma),t.setAttribute("role","mark")),this.#ka?t.classList.add("free"):this.div.addEventListener("keydown",this.#za.bind(this),{signal:this._uiManager._signal});const e=this.#_a=document.createElement("div");t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=this.#ya;const[i,n]=this.parentDimensions;return this.setDims(this.width*i,this.height*n),se(this,this.#_a,["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent.drawLayer.addClass(this.#Ta,"hovered")}pointerleave(){this.isSelected||this.parent.drawLayer.removeClass(this.#Ta,"hovered")}#za(t){ps._keyboardManager.exec(this,t)}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:this.#Ha(!0);break;case 1:case 3:this.#Ha(!1)}}#Ha(t){if(!this.#fa)return;const e=window.getSelection();t?e.setPosition(this.#fa,this.#va):e.setPosition(this.#wa,this.#Aa)}select(){super.select(),this.#Ta&&(this.parent?.drawLayer.removeClass(this.#Ta,"hovered"),this.parent?.drawLayer.addClass(this.#Ta,"selected"))}unselect(){super.unselect(),this.#Ta&&(this.parent?.drawLayer.removeClass(this.#Ta,"selected"),this.#ka||this.#Ha(!1))}get _mustFixPosition(){return!this.#ka}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;super.show(t),this.parent&&(this.parent.drawLayer.show(this.#y,t),this.parent.drawLayer.show(this.#Ta,t))}#Na(){return this.#ka?this.rotation:0}#Ba(){if(this.#ka)return null;const[t,e]=this.pageDimensions,[i,n]=this.pageTranslation,s=this.#ba,a=new Float32Array(8*s.length);let r=0;for(const{x:o,y:l,width:c,height:h}of s){const s=o*t+i,d=(1-l-h)*e+n;a[r]=a[r+4]=s,a[r+1]=a[r+3]=d,a[r+2]=a[r+6]=s+c*t,a[r+5]=a[r+7]=d+h*e,r+=8}return a}#Va(t){return this.#Sa.serialize(t,this.#Na())}static startHighlighting(t,e,i){let{target:n,x:s,y:a}=i;const{x:r,y:o,width:l,height:c}=n.getBoundingClientRect(),h=new AbortController,d=t.combinedSignal(h),u=e=>{h.abort(),this.#$a(t,e)};window.addEventListener("blur",u,{signal:d}),window.addEventListener("pointerup",u,{signal:d}),window.addEventListener("pointerdown",(t=>{t.preventDefault(),t.stopPropagation()}),{capture:!0,passive:!1,signal:d}),window.addEventListener("contextmenu",Gt,{signal:d}),n.addEventListener("pointermove",this.#Ua.bind(this,t),{signal:d}),this._freeHighlight=new hs({x:s,y:a},[r,o,l,c],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0))}static#Ua(t,e){this._freeHighlight.add(e)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}static#$a(t,e){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(t,e,i){let n=null;if(t instanceof Kn){const{data:{quadPoints:e,rect:i,rotation:s,id:a,color:r,opacity:o,popupRef:l},parent:{page:{pageNumber:c}}}=t;n=t={annotationType:b.HIGHLIGHT,color:Array.from(r),opacity:o,quadPoints:e,boxes:null,pageIndex:c-1,rect:i.slice(0),rotation:s,id:a,deleted:!1,popupRef:l}}else if(t instanceof Xn){const{data:{inkLists:e,rect:i,rotation:s,id:a,color:r,borderStyle:{rawWidth:o},popupRef:l},parent:{page:{pageNumber:c}}}=t;n=t={annotationType:b.HIGHLIGHT,color:Array.from(r),thickness:o,inkLists:e,boxes:null,pageIndex:c-1,rect:i.slice(0),rotation:s,id:a,deleted:!1,popupRef:l}}const{color:s,quadPoints:a,inkLists:r,opacity:o}=t,l=await super.deserialize(t,e,i);l.color=At.makeHexColor(...s),l.#Ea=o||1,r&&(l.#Is=t.thickness),l.annotationElementId=t.id||null,l._initialData=n;const[c,h]=l.pageDimensions,[d,u]=l.pageTranslation;if(a){const t=l.#ba=[];for(let e=0;e0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const e=this.getRect(0,0),i=ue._colorManager.convert(this.color),n={annotationType:b.HIGHLIGHT,color:i,opacity:this.#Ea,thickness:this.#Is,quadPoints:this.#Ba(),outlines:this.#Va(e),pageIndex:this.pageIndex,rect:e,rotation:this.#Na(),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!this.#ys(n)?null:(n.id=this.annotationElementId,n)}#ys(t){const{color:e}=this._initialData;return t.color.some(((t,i)=>t!==e[i]))}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}}class ms extends ue{#Wa=0;#qa=0;#Ga=null;#Ya=(()=>new Path2D)();#Xa=!1;#Ka=null;#Za=!1;#Ja=!1;#Qa=null;#tr=null;#er=0;#ir=0;#nr=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";static _editorType=(()=>b.INK)();constructor(t){super({...t,name:"inkEditor"}),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t,e){ue.initialize(t,e)}static updateDefaultParams(t,e){switch(t){case y.INK_THICKNESS:ms._defaultThickness=e;break;case y.INK_COLOR:ms._defaultColor=e;break;case y.INK_OPACITY:ms._defaultOpacity=e/100}}updateParams(t,e){switch(t){case y.INK_THICKNESS:this.#Fa(e);break;case y.INK_COLOR:this.#us(e);break;case y.INK_OPACITY:this.#sr(e)}}static get defaultPropertiesToUpdate(){return[[y.INK_THICKNESS,ms._defaultThickness],[y.INK_COLOR,ms._defaultColor||ue._defaultLineColor],[y.INK_OPACITY,Math.round(100*ms._defaultOpacity)]]}get propertiesToUpdate(){return[[y.INK_THICKNESS,this.thickness||ms._defaultThickness],[y.INK_COLOR,this.color||ms._defaultColor||ue._defaultLineColor],[y.INK_OPACITY,Math.round(100*(this.opacity??ms._defaultOpacity))]]}#Fa(t){const e=t=>{this.thickness=t,this.#ar()},i=this.thickness;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:y.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#us(t){const e=t=>{this.color=t,this.#rr()},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:y.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#sr(t){const e=t=>{this.opacity=t,this.#rr()};t/=100;const i=this.opacity;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:y.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(this.#or(),this.#lr()),this.isAttachedToDOM||(this.parent.add(this),this.#cr()),this.#ar()))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#Ga&&(clearTimeout(this.#Ga),this.#Ga=null),this.#Qa?.disconnect(),this.#Qa=null,super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions,i=this.width*t,n=this.height*e;this.setDimensions(i,n)}enableEditMode(){this.#Xa||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.#hr())}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.#dr())}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#ur(){const{parentRotation:t,parentDimensions:[e,i]}=this;switch(t){case 90:return[0,i,i,e];case 180:return[e,i,e,i];case 270:return[e,0,i,e];default:return[0,0,e,i]}}#pr(){const{ctx:t,color:e,opacity:i,thickness:n,parentScale:s,scaleFactor:a}=this;t.lineWidth=n*s/a,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=`${e}${function(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}(i)}`}#mr(t,e){this.canvas.addEventListener("contextmenu",Gt,{signal:this._uiManager._signal}),this.#dr(),this.#Ka=new AbortController;const i=this._uiManager.combinedSignal(this.#Ka);this.canvas.addEventListener("pointerleave",this.canvasPointerleave.bind(this),{signal:i}),this.canvas.addEventListener("pointermove",this.canvasPointermove.bind(this),{signal:i}),this.canvas.addEventListener("pointerup",this.canvasPointerup.bind(this),{signal:i}),this.isEditing=!0,this.#Ja||(this.#Ja=!0,this.#cr(),this.thickness||=ms._defaultThickness,this.color||=ms._defaultColor||ue._defaultLineColor,this.opacity??=ms._defaultOpacity),this.currentPath.push([t,e]),this.#Za=!1,this.#pr(),this.#nr=()=>{this.#gr(),this.#nr&&window.requestAnimationFrame(this.#nr)},window.requestAnimationFrame(this.#nr)}#fr(t,e){const[i,n]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===i&&e===n)return;const s=this.currentPath;let a=this.#Ya;if(s.push([t,e]),this.#Za=!0,s.length<=2)return a.moveTo(...s[0]),void a.lineTo(t,e);3===s.length&&(this.#Ya=a=new Path2D,a.moveTo(...s[0])),this.#vr(a,...s.at(-3),...s.at(-2),t,e)}#br(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);this.#Ya.lineTo(...t)}#yr(t,e){let i;if(this.#nr=null,t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),this.#fr(t,e),this.#br(),1!==this.currentPath.length)i=this.#xr();else{const n=[t,e];i=[[n,n.slice(),n.slice(),n]]}const n=this.#Ya,s=this.currentPath;this.currentPath=[],this.#Ya=new Path2D;this.addCommands({cmd:()=>{this.allRawPaths.push(s),this.paths.push(i),this.bezierPath2D.push(n),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#or(),this.#lr()),this.#ar())},mustExec:!0})}#gr(){if(!this.#Za)return;this.#Za=!1;const t=Math.ceil(this.thickness*this.parentScale),e=this.currentPath.slice(-3),i=e.map((t=>t[0])),n=e.map((t=>t[1])),{ctx:s}=(Math.min(...i),Math.max(...i),Math.min(...n),Math.max(...n),this);s.save(),s.clearRect(0,0,this.canvas.width,this.canvas.height);for(const a of this.bezierPath2D)s.stroke(a);s.stroke(this.#Ya),s.restore()}#vr(t,e,i,n,s,a,r){const o=(e+n)/2,l=(i+s)/2,c=(n+a)/2,h=(s+r)/2;t.bezierCurveTo(o+2*(n-o)/3,l+2*(s-l)/3,c+2*(n-c)/3,h+2*(s-h)/3,c,h)}#xr(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const e=[];let i,[n,s]=t[0];for(i=1;i{this.#Ga=null,this.canvas.removeEventListener("contextmenu",Gt)}),10),this.#yr(t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#or(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#lr(){this.#Qa=new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)})),this.#Qa.observe(this.div),this._uiManager._signal.addEventListener("abort",(()=>{this.#Qa?.disconnect(),this.#Qa=null}),{once:!0})}get isResizable(){return!this.isEmpty()&&this.#Xa}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[i,n,s,a]=this.#ur();if(this.setAt(i,n,0,0),this.setDims(s,a),this.#or(),this.width){const[i,n]=this.parentDimensions;this.setAspectRatio(this.width*i,this.height*n),this.setAt(t*i,e*n,this.width*i,this.height*n),this.#Ja=!0,this.#cr(),this.setDims(this.width*i,this.height*n),this.#rr(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#lr(),this.div}#cr(){if(!this.#Ja)return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),this.#wr()}setDimensions(t,e){const i=Math.round(t),n=Math.round(e);if(this.#er===i&&this.#ir===n)return;this.#er=i,this.#ir=n,this.canvas.style.visibility="hidden";const[s,a]=this.parentDimensions;this.width=t/s,this.height=e/a,this.fixAndSetPosition(),this.#Xa&&this.#_r(t,e),this.#cr(),this.#rr(),this.canvas.style.visibility="visible",this.fixDims()}#_r(t,e){const i=this.#Sr(),n=(t-i)/this.#qa,s=(e-i)/this.#Wa;this.scaleFactor=Math.min(n,s)}#wr(){const t=this.#Sr()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}static#kr(t){const e=new Path2D;for(let i=0,n=t.length;i0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!this.#Xa)return void this.#rr();const e=this.#Mr(),i=this.#Sr();this.#qa=Math.max(ue.MIN_SIZE,e[2]-e[0]),this.#Wa=Math.max(ue.MIN_SIZE,e[3]-e[1]);const n=Math.ceil(i+this.#qa*this.scaleFactor),s=Math.ceil(i+this.#Wa*this.scaleFactor),[a,r]=this.parentDimensions;this.width=n/a,this.height=s/r,this.setAspectRatio(n,s);const o=this.translationX,l=this.translationY;this.translationX=-e[0],this.translationY=-e[1],this.#cr(),this.#rr(),this.#er=n,this.#ir=s,this.setDims(n,s);const c=t?i/this.scaleFactor/2:0;this.translate(o-this.translationX-c,l-this.translationY-c)}static async deserialize(t,e,i){if(t instanceof Xn)return null;const n=await super.deserialize(t,e,i);n.thickness=t.thickness,n.color=At.makeHexColor(...t.color),n.opacity=t.opacity;const[s,a]=n.pageDimensions,r=n.width*s,o=n.height*a,l=n.parentScale,c=t.thickness/2;n.#Xa=!0,n.#er=Math.round(r),n.#ir=Math.round(o);const{paths:h,rect:d,rotation:u}=t;for(let{bezier:m}of h){m=ms.#Er(m,d,u);const t=[];n.paths.push(t);let e=l*(m[0]-c),i=l*(m[1]-c);for(let n=2,a=m.length;nb.STAMP)();constructor(t){super({...t,name:"stampEditor"}),this.#Pr=t.bitmapUrl,this.#Lr=t.bitmapFile}static initialize(t,e){ue.initialize(t,e)}static get supportedTypes(){return lt(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((t=>`image/${t}`)))}static get supportedTypesStr(){return lt(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(b.STAMP,{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){const e=t.get("hasAltText");return{hasAltText:e.get(!0)??0,hasNoAltText:e.get(!1)??0}}#Hr(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?(this.#Dr=t.bitmap,e||(this.#Ir=t.id,this.#jr=t.isSvg),t.file&&(this.#Fr=t.file.name),this.#or()):this.remove()}#Br(){if(this.#Rr=null,this._uiManager.enableWaiting(!1),this.#Or){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#Dr)return this._editToolbar.hide(),void this._uiManager.editAltText(this,!0);if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#Dr){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:n,width:s,height:a}=t||this.copyCanvas(null,null,!0).imageData,r=await i.guess({name:"altText",request:{data:n,width:s,height:a,channels:n.length/(s*a)}});if(!r)throw new Error("No response from the AI service.");if(r.error)throw new Error("Error from the AI service.");if(r.cancel)return null;if(!r.output)throw new Error("No valid response from the AI service.");const o=r.output;return await this.setGuessedAltText(o),e&&!this.hasAltTextData()&&(this.altTextData={alt:o,decorative:!1}),o}#Vr(){if(this.#Ir)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#Ir).then((t=>this.#Hr(t,!0))).finally((()=>this.#Br()));if(this.#Pr){const t=this.#Pr;return this.#Pr=null,this._uiManager.enableWaiting(!0),void(this.#Rr=this._uiManager.imageManager.getFromUrl(t).then((t=>this.#Hr(t))).finally((()=>this.#Br())))}if(this.#Lr){const t=this.#Lr;return this.#Lr=null,this._uiManager.enableWaiting(!0),void(this.#Rr=this._uiManager.imageManager.getFromFile(t).then((t=>this.#Hr(t))).finally((()=>this.#Br())))}const t=document.createElement("input");t.type="file",t.accept=gs.supportedTypesStr;const e=this._uiManager._signal;this.#Rr=new Promise((i=>{t.addEventListener("change",(async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#Hr(e)}else this.remove();i()}),{signal:e}),t.addEventListener("cancel",(()=>{this.remove(),i()}),{signal:e})})).finally((()=>this.#Br())),t.click()}remove(){this.#Ir&&(this.#Dr=null,this._uiManager.imageManager.deleteId(this.#Ir),this.#Or?.remove(),this.#Or=null,this.#Qa?.disconnect(),this.#Qa=null,this.#Nr&&(clearTimeout(this.#Nr),this.#Nr=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#Ir&&null===this.#Or&&this.#Vr(),this.isAttachedToDOM||this.parent.add(this))):this.#Ir&&this.#Vr()}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#Rr||this.#Dr||this.#Pr||this.#Lr||this.#Ir)}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.div.setAttribute("role","figure"),this.addAltTextButton(),this.#Dr?this.#or():this.#Vr(),this.width&&!this.annotationElementId){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n)}return this.div}#or(){const{div:t}=this;let{width:e,height:i}=this.#Dr;const[n,s]=this.pageDimensions,a=.75;if(this.width)e=this.width*n,i=this.height*s;else if(e>a*n||i>a*s){const t=Math.min(a*n/e,a*s/i);e*=t,i*=t}const[r,o]=this.parentDimensions;this.setDims(e*r/n,i*o/s),this._uiManager.enableWaiting(!1);const l=this.#Or=document.createElement("canvas");l.setAttribute("role","img"),this.addContainer(l),this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(t.hidden=!1),this.#$r(e,i),this.#lr(),this.#zr||(this.parent.addUndoableEditor(this),this.#zr=!0),this._reportTelemetry({action:"inserted_image"}),this.#Fr&&l.setAttribute("aria-label",this.#Fr)}copyCanvas(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t||(t=224);const{width:n,height:s}=this.#Dr,a=new ee;let r=this.#Dr,o=n,l=s,c=null;if(e){if(n>e||s>e){const t=Math.min(e/n,e/s);o=Math.floor(n*t),l=Math.floor(s*t)}c=document.createElement("canvas");const t=c.width=Math.ceil(o*a.sx),i=c.height=Math.ceil(l*a.sy);this.#jr||(r=this.#Ur(t,i));const h=c.getContext("2d");h.filter=this._uiManager.hcmFilter;let d="white",u="#cfcfd8";"none"!==this._uiManager.hcmFilter?u="black":window.matchMedia?.("(prefers-color-scheme: dark)").matches&&(d="#8f8f9d",u="#42414d");const p=15,m=p*a.sx,g=p*a.sy,f=new OffscreenCanvas(2*m,2*g),v=f.getContext("2d");v.fillStyle=d,v.fillRect(0,0,2*m,2*g),v.fillStyle=u,v.fillRect(0,0,m,g),v.fillRect(m,g,m,g),h.fillStyle=h.createPattern(f,"repeat"),h.fillRect(0,0,t,i),h.drawImage(r,0,0,r.width,r.height,0,0,t,i)}let h=null;if(i){let e,i;if(a.symmetric&&r.widtht||s>t){const a=Math.min(t/n,t/s);e=Math.floor(n*a),i=Math.floor(s*a),this.#jr||(r=this.#Ur(e,i))}const o=new OffscreenCanvas(e,i).getContext("2d",{willReadFrequently:!0});o.drawImage(r,0,0,r.width,r.height,0,0,e,i),h={width:e,height:i,data:o.getImageData(0,0,e,i).data}}return{canvas:c,width:o,height:l,imageData:h}}#Wr(t,e){const[i,n]=this.parentDimensions;this.width=t/i,this.height=e/n,this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==this.#Nr&&clearTimeout(this.#Nr);this.#Nr=setTimeout((()=>{this.#Nr=null,this.#$r(t,e)}),200)}#Ur(t,e){const{width:i,height:n}=this.#Dr;let s=i,a=n,r=this.#Dr;for(;s>2*t||a>2*e;){const i=s,n=a;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));const o=new OffscreenCanvas(s,a);o.getContext("2d").drawImage(r,0,0,i,n,0,0,s,a),r=o.transferToImageBitmap()}return r}#$r(t,e){const i=new ee,n=Math.ceil(t*i.sx),s=Math.ceil(e*i.sy),a=this.#Or;if(!a||a.width===n&&a.height===s)return;a.width=n,a.height=s;const r=this.#jr?this.#Dr:this.#Ur(n,s),o=a.getContext("2d");o.filter=this._uiManager.hcmFilter,o.drawImage(r,0,0,r.width,r.height,0,0,n,s)}getImageForAltText(){return this.#Or}#qr(t){if(t){if(this.#jr){const t=this._uiManager.imageManager.getSvgUrl(this.#Ir);if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=this.#Dr);return t.getContext("2d").drawImage(this.#Dr,0,0),t.toDataURL()}if(this.#jr){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*Nt.PDF_TO_CSS_UNITS),n=Math.round(this.height*e*Nt.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(i,n);return s.getContext("2d").drawImage(this.#Dr,0,0,this.#Dr.width,this.#Dr.height,0,0,i,n),s.transferToImageBitmap()}return structuredClone(this.#Dr)}#lr(){this._uiManager._signal&&(this.#Qa=new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.#Wr(e.width,e.height)})),this.#Qa.observe(this.div),this._uiManager._signal.addEventListener("abort",(()=>{this.#Qa?.disconnect(),this.#Qa=null}),{once:!0}))}static async deserialize(t,e,i){let n=null;if(t instanceof ts){const{data:{rect:s,rotation:a,id:r,structParent:o,popupRef:l},container:c,parent:{page:{pageNumber:h}}}=t,d=c.querySelector("canvas"),u=i.imageManager.getFromCanvas(c.id,d);d.remove();const p=(await e._structTree.getAriaAttributes(`${Ct}${r}`))?.get("aria-label")||"";n=t={annotationType:b.STAMP,bitmapId:u.id,bitmap:u.bitmap,pageIndex:h-1,rect:s.slice(0),rotation:a,id:r,deleted:!1,accessibilityData:{decorative:!1,altText:p},isSvg:!1,structParent:o,popupRef:l}}const s=await super.deserialize(t,e,i),{rect:a,bitmap:r,bitmapUrl:o,bitmapId:l,isSvg:c,accessibilityData:h}=t;l&&i.imageManager.isValidId(l)?(s.#Ir=l,r&&(s.#Dr=r)):s.#Pr=o,s.#jr=c;const[d,u]=s.pageDimensions;return s.width=(a[2]-a[0])/d,s.height=(a[3]-a[1])/u,s.annotationElementId=t.id||null,h&&(s.altTextData=h),s._initialData=n,s.#zr=!!n,s}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i={annotationType:b.STAMP,bitmapId:this.#Ir,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#jr,structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=this.#qr(!0),i.accessibilityData=this.serializeAltText(!0),i;const{decorative:n,altText:s}=this.serializeAltText(!1);if(!n&&s&&(i.accessibilityData={type:"Figure",alt:s}),this.annotationElementId){const t=this.#ys(i);if(t.isSame)return null;t.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1}if(i.id=this.annotationElementId,null===e)return i;e.stamps||=new Map;const a=this.#jr?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(this.#Ir)){if(this.#jr){const t=e.stamps.get(this.#Ir);a>t.area&&(t.area=a,t.serialized.bitmap.close(),t.serialized.bitmap=this.#qr(!1))}}else e.stamps.set(this.#Ir,{area:a,serialized:i}),i.bitmap=this.#qr(!1);return i}#ys(t){const{rect:e,pageIndex:i,accessibilityData:{altText:n}}=this._initialData,s=t.rect.every(((t,i)=>Math.abs(t-e[i])<1)),a=t.pageIndex===i,r=(t.accessibilityData?.alt||"")===n;return{isSame:s&&a&&r,isSameAltText:r}}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}}class fs{#is;#Gr=!1;#Yr=null;#Xr=null;#Kr=null;#Zr=(()=>new Map)();#Jr=!1;#Qr=!1;#to=!1;#eo=null;#io=null;#g;static _initialized=!1;static#H=(()=>new Map([ss,ms,gs,ps].map((t=>[t._editorType,t]))))();constructor(t){let{uiManager:e,pageIndex:i,div:n,structTreeLayer:s,accessibilityManager:a,annotationLayer:r,drawLayer:o,textLayer:l,viewport:c,l10n:h}=t;const d=[...fs.#H.values()];if(!fs._initialized){fs._initialized=!0;for(const t of d)t.initialize(h,e)}e.registerEditorTypes(d),this.#g=e,this.pageIndex=i,this.div=n,this.#is=a,this.#Yr=r,this.viewport=c,this.#eo=l,this.drawLayer=o,this._structTree=s,this.#g.addLayer(this)}get isEmpty(){return 0===this.#Zr.size}get isInvisible(){return this.isEmpty&&this.#g.getMode()===b.NONE}updateToolbar(t){this.#g.updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.#g.getMode();switch(this.#no(),t){case b.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case b.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case b.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;for(const i of fs.#H.values())e.toggle(`${i._type}Editing`,t===i._editorType);this.div.hidden=!1}hasTextLayer(t){return t===this.#eo?.div}addInkEditorIfNeeded(t){if(this.#g.getMode()!==b.INK)return;if(!t)for(const e of this.#Zr.values())if(e.isEmpty())return void e.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(t){this.#g.setEditingState(t)}addCommands(t){this.#g.addCommands(t)}toggleDrawing(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("drawing",!t)}togglePointerEvents(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#Yr?.div.classList.toggle("disabled",!t)}async enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const i of this.#Zr.values())i.enableEditing(),i.show(!0),i.annotationElementId&&(this.#g.removeChangedExistingAnnotation(i),t.add(i.annotationElementId));if(!this.#Yr)return;const e=this.#Yr.getEditableAnnotations();for(const i of e){if(i.hide(),this.#g.isDeletedAnnotationElement(i.data.id))continue;if(t.has(i.data.id))continue;const e=await this.deserialize(i);e&&(this.addOrRebuild(e),e.enableEditing())}}disable(){this.#to=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);const t=new Map,e=new Map;for(const n of this.#Zr.values())n.disableEditing(),n.annotationElementId&&(null===n.serialize()?(e.set(n.annotationElementId,n),this.getEditableAnnotation(n.annotationElementId)?.show(),n.remove()):t.set(n.annotationElementId,n));if(this.#Yr){const i=this.#Yr.getEditableAnnotations();for(const n of i){const{id:i}=n.data;if(this.#g.isDeletedAnnotationElement(i))continue;let s=e.get(i);s?(s.resetAnnotationElement(n),s.show(!1),n.show()):(s=t.get(i),s&&(this.#g.addChangedExistingAnnotation(s),s.renderAnnotationElement(n)&&s.show(!1)),n.show())}}this.#no(),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const n of fs.#H.values())i.remove(`${n._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#to=!1}getEditableAnnotation(t){return this.#Yr?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#g.getActive()!==t&&this.#g.setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,this.#eo?.div&&!this.#io){this.#io=new AbortController;const t=this.#g.combinedSignal(this.#io);this.#eo.div.addEventListener("pointerdown",this.#so.bind(this),{signal:t}),this.#eo.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#eo?.div&&this.#io&&(this.#io.abort(),this.#io=null,this.#eo.div.classList.remove("highlighting"))}#so(t){this.#g.unselectAll();const{target:e}=t;if(e===this.#eo.div||("img"===e.getAttribute("role")||e.classList.contains("endOfContent"))&&this.#eo.div.contains(e)){const{isMac:e}=xt.platform;if(0!==t.button||t.ctrlKey&&e)return;this.#g.showAllEditors("highlight",!0,!0),this.#eo.div.classList.add("free"),this.toggleDrawing(),ps.startHighlighting(this,"ltr"===this.#g.direction,{target:this.#eo.div,x:t.x,y:t.y}),this.#eo.div.addEventListener("pointerup",(()=>{this.#eo.div.classList.remove("free"),this.toggleDrawing(!0)}),{once:!0,signal:this.#g._signal}),t.preventDefault()}}enableClick(){if(this.#Xr)return;this.#Xr=new AbortController;const t=this.#g.combinedSignal(this.#Xr);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t}),this.div.addEventListener("pointerup",this.pointerup.bind(this),{signal:t})}disableClick(){this.#Xr?.abort(),this.#Xr=null}attach(t){this.#Zr.set(t.id,t);const{annotationElementId:e}=t;e&&this.#g.isDeletedAnnotationElement(e)&&this.#g.removeDeletedAnnotationElement(t)}detach(t){this.#Zr.delete(t.id),this.#is?.removePointerInTextLayer(t.contentDiv),!this.#to&&t.annotationElementId&&this.#g.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#g.removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1,this.#Qr||this.addInkEditorIfNeeded(!1)}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(this.#g.addDeletedAnnotationElement(t.annotationElementId),ue.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),this.#g.addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),this.#g.addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:e}=document;t.div.contains(e)&&!this.#Kr&&(t._focusEventsAllowed=!1,this.#Kr=setTimeout((()=>{this.#Kr=null,t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:this.#g._signal}),e.focus())}),0)),t._structTreeParentId=this.#is?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||=this,t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return this.#g.getId()}get#ao(){return fs.#H.get(this.#g.getMode())}combinedSignal(t){return this.#g.combinedSignal(t)}#ro(t){const e=this.#ao;return e?new e.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#ao?.canCreateNewEmptyEditor()}pasteEditor(t,e){this.#g.updateToolbar(t),this.#g.updateMode(t);const{offsetX:i,offsetY:n}=this.#oo(),s=this.getNextId(),a=this.#ro({parent:this,id:s,x:i,y:n,uiManager:this.#g,isCentered:!0,...e});a&&this.add(a)}async deserialize(t){return await(fs.#H.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#g))||null}createAndAddNewEditor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.getNextId(),s=this.#ro({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:this.#g,isCentered:e,...i});return s&&this.add(s),s}#oo(){const{x:t,y:e,width:i,height:n}=this.div.getBoundingClientRect(),s=Math.max(0,t),a=Math.max(0,e),r=(s+Math.min(window.innerWidth,t+i))/2-t,o=(a+Math.min(window.innerHeight,e+n))/2-e,[l,c]=this.viewport.rotation%180===0?[r,o]:[o,r];return{offsetX:l,offsetY:c}}addNewEditor(){this.createAndAddNewEditor(this.#oo(),!0)}setSelected(t){this.#g.setSelected(t)}toggleSelected(t){this.#g.toggleSelected(t)}unselect(t){this.#g.unselect(t)}pointerup(t){const{isMac:e}=xt.platform;0!==t.button||t.ctrlKey&&e||t.target===this.div&&this.#Jr&&(this.#Jr=!1,this.#Gr?this.#g.getMode()!==b.STAMP?this.createAndAddNewEditor(t,!1):this.#g.unselectAll():this.#Gr=!0)}pointerdown(t){if(this.#g.getMode()===b.HIGHLIGHT&&this.enableTextSelection(),this.#Jr)return void(this.#Jr=!1);const{isMac:e}=xt.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;this.#Jr=!0;const i=this.#g.getActive();this.#Gr=!i||i.isEmpty()}findNewParent(t,e,i){const n=this.#g.findParent(e,i);return null!==n&&n!==this&&(n.changeParent(t),!0)}destroy(){this.#g.getActive()?.parent===this&&(this.#g.commitOrRemove(),this.#g.setActiveEditor(null)),this.#Kr&&(clearTimeout(this.#Kr),this.#Kr=null);for(const t of this.#Zr.values())this.#is?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#Zr.clear(),this.#g.removeLayer(this)}#no(){this.#Qr=!0;for(const t of this.#Zr.values())t.isEmpty()&&t.remove();this.#Qr=!1}render(t){let{viewport:e}=t;this.viewport=e,te(this.div,e);for(const i of this.#g.getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update(t){let{viewport:e}=t;this.#g.commitOrRemove(),this.#no();const i=this.viewport.rotation,n=e.rotation;if(this.viewport=e,te(this.div,{rotation:n}),i!==n)for(const s of this.#Zr.values())s.rotate(n);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return this.#g.viewParameters.realScale}}class vs{#On=null;#y=0;#lo=(()=>new Map)();#co=(()=>new Map)();constructor(t){let{pageIndex:e}=t;this.pageIndex=e}setParent(t){if(this.#On){if(this.#On!==t){if(this.#lo.size>0)for(const e of this.#lo.values())e.remove(),t.append(e);this.#On=t}}else this.#On=t}static get _svgFactory(){return lt(this,"_svgFactory",new Sn)}static#ho(t){let{x:e=0,y:i=0,width:n=1,height:s=1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{style:a}=t;a.top=100*i+"%",a.left=100*e+"%",a.width=100*n+"%",a.height=100*s+"%"}#do(t){const e=vs._svgFactory.create(1,1,!0);return this.#On.append(e),e.setAttribute("aria-hidden",!0),vs.#ho(e,t),e}#uo(t,e){const i=vs._svgFactory.createElement("clipPath");t.append(i);const n=`clip_${e}`;i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const s=vs._svgFactory.createElement("use");return i.append(s),s.setAttribute("href",`#${e}`),s.classList.add("clip"),n}draw(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const s=this.#y++,a=this.#do(t.box);a.classList.add(...t.classNamesForDrawing);const r=vs._svgFactory.createElement("defs");a.append(r);const o=vs._svgFactory.createElement("path");r.append(o);const l=`path_p${this.pageIndex}_${s}`;o.setAttribute("id",l),o.setAttribute("d",t.toSVGPath()),n&&this.#co.set(s,o);const c=this.#uo(r,l),h=vs._svgFactory.createElement("use");return a.append(h),a.setAttribute("fill",e),a.setAttribute("fill-opacity",i),h.setAttribute("href",`#${l}`),this.#lo.set(s,a),{id:s,clipPathId:`url(#${c})`}}drawOutline(t){const e=this.#y++,i=this.#do(t.box);i.classList.add(...t.classNamesForOutlining);const n=vs._svgFactory.createElement("defs");i.append(n);const s=vs._svgFactory.createElement("path");n.append(s);const a=`path_p${this.pageIndex}_${e}`;let r;if(s.setAttribute("id",a),s.setAttribute("d",t.toSVGPath()),s.setAttribute("vector-effect","non-scaling-stroke"),t.mustRemoveSelfIntersections){const t=vs._svgFactory.createElement("mask");n.append(t),r=`mask_p${this.pageIndex}_${e}`,t.setAttribute("id",r),t.setAttribute("maskUnits","objectBoundingBox");const i=vs._svgFactory.createElement("rect");t.append(i),i.setAttribute("width","1"),i.setAttribute("height","1"),i.setAttribute("fill","white");const s=vs._svgFactory.createElement("use");t.append(s),s.setAttribute("href",`#${a}`),s.setAttribute("stroke","none"),s.setAttribute("fill","black"),s.setAttribute("fill-rule","nonzero"),s.classList.add("mask")}const o=vs._svgFactory.createElement("use");i.append(o),o.setAttribute("href",`#${a}`),r&&o.setAttribute("mask",`url(#${r})`);const l=o.cloneNode();return i.append(l),o.classList.add("mainOutline"),l.classList.add("secondaryOutline"),this.#lo.set(e,i),e}finalizeLine(t,e){const i=this.#co.get(t);this.#co.delete(t),this.updateBox(t,e.box),i.setAttribute("d",e.toSVGPath())}updateLine(t,e){this.#lo.get(t).firstChild.firstChild.setAttribute("d",e.toSVGPath())}updatePath(t,e){this.#co.get(t).setAttribute("d",e.toSVGPath())}updateBox(t,e){vs.#ho(this.#lo.get(t),e)}show(t,e){this.#lo.get(t).classList.toggle("hidden",!e)}rotate(t,e){this.#lo.get(t).setAttribute("data-main-rotation",e)}changeColor(t,e){this.#lo.get(t).setAttribute("fill",e)}changeOpacity(t,e){this.#lo.get(t).setAttribute("fill-opacity",e)}addClass(t,e){this.#lo.get(t).classList.add(e)}removeClass(t,e){this.#lo.get(t).classList.remove(e)}getSVGRoot(t){return this.#lo.get(t)}remove(t){this.#co.delete(t),null!==this.#On&&(this.#lo.get(t).remove(),this.#lo.delete(t))}destroy(){this.#On=null;for(const t of this.#lo.values())t.remove();this.#lo.clear(),this.#co.clear()}}var bs=s.AnnotationLayer,ys=s.AnnotationMode,xs=s.GlobalWorkerOptions,ws=s.PDFDataRangeTransport,As=s.TextLayer,_s=s.getDocument},7806:(t,e,i)=>{"use strict";i.d(e,{A:()=>k});var n=i(579),s=i(5043),a=i(7906),r=i(645),o=i(8387),l=i(3404),c=i(6440),h=Object.prototype.hasOwnProperty;function d(t,e,i){for(i of t.keys())if(u(i,e))return i}function u(t,e){var i,n,s;if(t===e)return!0;if(t&&e&&(i=t.constructor)===e.constructor){if(i===Date)return t.getTime()===e.getTime();if(i===RegExp)return t.toString()===e.toString();if(i===Array){if((n=t.length)===e.length)for(;n--&&u(t[n],e[n]););return-1===n}if(i===Set){if(t.size!==e.size)return!1;for(n of t){if((s=n)&&"object"===typeof s&&!(s=d(e,s)))return!1;if(!e.has(s))return!1}return!0}if(i===Map){if(t.size!==e.size)return!1;for(n of t){if((s=n[0])&&"object"===typeof s&&!(s=d(e,s)))return!1;if(!u(n[1],e.get(s)))return!1}return!0}if(i===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(i===DataView){if((n=t.byteLength)===e.byteLength)for(;n--&&t.getInt8(n)===e.getInt8(n););return-1===n}if(ArrayBuffer.isView(t)){if((n=t.byteLength)===e.byteLength)for(;n--&&t[n]===e[n];);return-1===n}if(!i||"object"===typeof t){for(i in n=0,t){if(h.call(t,i)&&++n&&!h.call(e,i))return!1;if(!(i in e)||!u(t[i],e[i]))return!1}return Object.keys(e).length===n}}return t!==t&&e!==e}var p=i(9355),m=i(6512),g=i(8599);class f{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(t){this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setExternalLinkRel(t){this.externalLinkRel=t}setExternalLinkTarget(t){this.externalLinkTarget=t}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(t){(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise((e=>{(0,l.A)(this.pdfDocument,"PDF document not loaded."),(0,l.A)(t,"Destination is not specified."),"string"===typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)})).then((t=>{(0,l.A)(Array.isArray(t),`"${t}" is not a valid destination array.`);const e=t[0];new Promise((t=>{(0,l.A)(this.pdfDocument,"PDF document not loaded."),e instanceof Object?this.pdfDocument.getPageIndex(e).then((e=>{t(e)})).catch((()=>{(0,l.A)(!1,`"${e}" is not a valid page reference.`)})):"number"===typeof e?t(e):(0,l.A)(!1,`"${e}" is not a valid destination reference.`)})).then((e=>{const i=e+1;(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,l.A)(i>=1&&i<=this.pagesCount,`"${i}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:i})}))}))}navigateTo(t){this.goToDestination(t)}goToPage(t){const e=t-1;(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,l.A)(t>=1&&t<=this.pagesCount,`"${t}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}addLinkAttributes(t,e,i){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=i?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const v={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var b=i(665),y=i(8234),x=function(t,e,i,n){return new(i||(i=Promise))((function(s,a){function r(t){try{l(n.next(t))}catch(e){a(e)}}function o(t){try{l(n.throw(t))}catch(e){a(e)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,o)}l((n=n.apply(t,e||[])).next())}))},w=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s{switch(e){case v.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case v.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}};function S(t){return"object"===typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}const k=(0,s.forwardRef)((function(t,e){var{children:i,className:h,error:d="Failed to load PDF file.",externalLinkRel:v,externalLinkTarget:k,file:C,inputRef:E,imageResourcesPath:T,loading:M="Loading PDF\u2026",noData:D="No PDF file specified.",onItemClick:I,onLoadError:R,onLoadProgress:P,onLoadSuccess:L,onPassword:F=_,onSourceError:O,onSourceSuccess:N,options:j,renderMode:z,rotate:H}=t,B=w(t,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[V,$]=(0,y.A)(),{value:U,error:W}=V,[q,G]=(0,y.A)(),{value:Y,error:X}=q,K=(0,s.useRef)(new f),Z=(0,s.useRef)([]),J=(0,s.useRef)(void 0),Q=(0,s.useRef)(void 0);C&&C!==J.current&&S(C)&&(c(!u(C,J.current),'File prop passed to changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.'),J.current=C),j&&j!==Q.current&&(c(!u(j,Q.current),'Options prop passed to changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.'),Q.current=j);const tt=(0,s.useRef)({scrollPageIntoView:t=>{const{dest:e,pageNumber:i,pageIndex:n=i-1}=t;if(I)return void I({dest:e,pageIndex:n,pageNumber:i});const s=Z.current[n];s?s.scrollIntoView():c(!1,`An internal link leading to page ${i} was clicked, but neither was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to and handle navigating by yourself or ensure that all pages are rendered within .`)}});(0,s.useImperativeHandle)(e,(()=>({linkService:K,pages:Z,viewer:tt})),[]),(0,s.useEffect)((function(){$({type:"RESET"})}),[C,$]);const et=(0,s.useCallback)((()=>x(this,void 0,void 0,(function*(){if(!C)return null;if("string"===typeof C){if((0,b.zL)(C)){return{data:(0,b.jA)(C)}}return(0,b.qC)(),{url:C}}if(C instanceof A)return{range:C};if((0,b.mw)(C))return{data:C};if(b.Bd&&(0,b.qf)(C)){return{data:yield(0,b.h1)(C)}}if((0,l.A)("object"===typeof C,"Invalid parameter in file, need either Uint8Array, string or a parameter object"),(0,l.A)(S(C),"Invalid parameter object: need either .data, .range or .url"),"url"in C&&"string"===typeof C.url){if((0,b.zL)(C.url)){const{url:t}=C,e=w(C,["url"]),i=(0,b.jA)(t);return Object.assign({data:i},e)}(0,b.qC)()}return C}))),[C]);(0,s.useEffect)((()=>{const t=(0,r.A)(et());return t.promise.then((t=>{$({type:"RESOLVE",value:t})})).catch((t=>{$({type:"REJECT",error:t})})),()=>{(0,b.xL)(t)}}),[et,$]),(0,s.useEffect)((()=>{"undefined"!==typeof U&&(!1!==U?N&&N():W&&(c(!1,W.toString()),O&&O(W)))}),[U]),(0,s.useEffect)((function(){G({type:"RESET"})}),[G,U]),(0,s.useEffect)((function(){if(!U)return;const t=j?Object.assign(Object.assign({},U),j):U,e=p.YE(t);P&&(e.onProgress=P),F&&(e.onPassword=F);const i=e,n=i.promise.then((t=>{G({type:"RESOLVE",value:t})})).catch((t=>{i.destroyed||G({type:"REJECT",error:t})}));return()=>{n.finally((()=>i.destroy()))}}),[j,G,U]),(0,s.useEffect)((()=>{"undefined"!==typeof Y&&(!1!==Y?Y&&(L&&L(Y),Z.current=new Array(Y.numPages),K.current.setDocument(Y)):X&&(c(!1,X.toString()),R&&R(X)))}),[Y]),(0,s.useEffect)((function(){K.current.setViewer(tt.current),K.current.setExternalLinkRel(v),K.current.setExternalLinkTarget(k)}),[v,k]);const it=(0,s.useCallback)(((t,e)=>{Z.current[t]=e}),[]),nt=(0,s.useCallback)((t=>{delete Z.current[t]}),[]),st=(0,s.useMemo)((()=>({imageResourcesPath:T,linkService:K.current,onItemClick:I,pdf:Y,registerPage:it,renderMode:z,rotate:H,unregisterPage:nt})),[T,I,Y,it,z,H,nt]),at=(0,s.useMemo)((()=>(0,a.Ay)(B,(()=>Y))),[B,Y]);return(0,n.jsx)("div",Object.assign({className:(0,o.A)("react-pdf__Document",h),ref:E,style:{"--scale-factor":"1"}},at,{children:C?void 0===Y||null===Y?(0,n.jsx)(g.A,{type:"loading",children:"function"===typeof M?M():M}):!1===Y?(0,n.jsx)(g.A,{type:"error",children:"function"===typeof d?d():d}):(0,n.jsx)(m.A.Provider,{value:st,children:i}):(0,n.jsx)(g.A,{type:"no-data",children:"function"===typeof D?D():D})}))}))},6512:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});const n=(0,i(5043).createContext)(null)},8599:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(579);function s(t){let{children:e,type:i}=t;return(0,n.jsx)("div",{className:`react-pdf__message react-pdf__message--${i}`,children:e})}},6584:(t,e,i)=>{"use strict";i.d(e,{A:()=>L});var n=i(579),s=i(5043),a=i(645),r=i(7906),o=i(8387);function l(){for(var t=[],e=0;ex(i)),[i]),r=(0,s.useMemo)((()=>f(i)?v(i)?null:i.children.map(((t,e)=>(0,n.jsx)(w,{node:t},e))):null),[i]);return(0,n.jsx)("span",Object.assign({className:e},a,{children:r}))}function A(){return(0,s.useContext)(d)}var _=i(8234),S=i(665);function k(){const t=A();(0,c.A)(t,"Unable to find Page context.");const{onGetStructTreeError:e,onGetStructTreeSuccess:i}=t,[r,o]=(0,_.A)(),{value:l,error:d}=r,{customTextRenderer:u,page:p}=t;return(0,s.useEffect)((function(){o({type:"RESET"})}),[o,p]),(0,s.useEffect)((function(){if(u)return;if(!p)return;const t=(0,a.A)(p.getStructTree()),e=t;return t.promise.then((t=>{o({type:"RESOLVE",value:t})})).catch((t=>{o({type:"REJECT",error:t})})),()=>(0,S.xL)(e)}),[u,p,o]),(0,s.useEffect)((()=>{void 0!==l&&(!1!==l?l&&i&&i(l):d&&(h(!1,d.toString()),e&&e(d)))}),[l]),l?(0,n.jsx)(w,{className:"react-pdf__Page__structTree structTree",node:l}):null}const C=p.ng;function E(t){const e=A();(0,c.A)(e,"Unable to find Page context.");const i=Object.assign(Object.assign({},e),t),{_className:a,canvasBackground:r,devicePixelRatio:o=(0,S.mZ)(),onRenderError:d,onRenderSuccess:u,page:p,renderForms:m,renderTextLayer:g,rotate:f,scale:v}=i,{canvasRef:b}=t;(0,c.A)(p,"Attempted to render page canvas, but no page was specified.");const y=(0,s.useRef)(null);function x(t){(0,S.UT)(t)||(h(!1,t.toString()),d&&d(t))}const w=(0,s.useMemo)((()=>p.getViewport({scale:v*o,rotation:f})),[o,p,f,v]),_=(0,s.useMemo)((()=>p.getViewport({scale:v,rotation:f})),[p,f,v]);(0,s.useEffect)((function(){if(!p)return;p.cleanup();const{current:t}=y;if(!t)return;t.width=w.width,t.height=w.height,t.style.width=`${Math.floor(_.width)}px`,t.style.height=`${Math.floor(_.height)}px`,t.style.visibility="hidden";const e={annotationMode:m?C.ENABLE_FORMS:C.ENABLE,canvasContext:t.getContext("2d",{alpha:!1}),viewport:w};r&&(e.background=r);const i=p.render(e),n=i;return i.promise.then((()=>{t.style.visibility="",p&&u&&u((0,S.vS)(p,v))})).catch(x),()=>(0,S.xL)(n)}),[r,p,m,w,_]);const E=(0,s.useCallback)((()=>{const{current:t}=y;t&&(t.width=0,t.height=0)}),[]);return(0,s.useEffect)((()=>E),[E]),(0,n.jsx)("canvas",{className:`${a}__canvas`,dir:"ltr",ref:l(b,y),style:{display:"block",userSelect:"none"},children:g?(0,n.jsx)(k,{}):null})}function T(){const t=A();(0,c.A)(t,"Unable to find Page context.");const{customTextRenderer:e,onGetTextError:i,onGetTextSuccess:r,onRenderTextLayerError:l,onRenderTextLayerSuccess:d,page:u,pageIndex:m,pageNumber:g,rotate:f,scale:v}=t;(0,c.A)(u,"Attempted to load page text content, but no page was specified.");const[b,y]=(0,_.A)(),{value:x,error:w}=b,k=(0,s.useRef)(null);h(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10),"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer"),(0,s.useEffect)((function(){y({type:"RESET"})}),[u,y]),(0,s.useEffect)((function(){if(!u)return;const t=(0,a.A)(u.getTextContent()),e=t;return t.promise.then((t=>{y({type:"RESOLVE",value:t})})).catch((t=>{y({type:"REJECT",error:t})})),()=>(0,S.xL)(e)}),[u,y]),(0,s.useEffect)((()=>{void 0!==x&&(!1!==x?x&&r&&r(x):w&&(h(!1,w.toString()),i&&i(w)))}),[x]);const C=(0,s.useCallback)((()=>{d&&d()}),[d]),E=(0,s.useCallback)((t=>{h(!1,t.toString()),l&&l(t)}),[l]);const T=(0,s.useMemo)((()=>u.getViewport({scale:v,rotation:f})),[u,f,v]);return(0,s.useLayoutEffect)((function(){if(!u||!x)return;const{current:t}=k;if(!t)return;t.innerHTML="";const i=u.streamTextContent({includeMarkedContent:!0}),n={container:t,textContentSource:i,viewport:T},s=new p.D6(n),a=s;return s.render().then((()=>{const i=document.createElement("div");i.className="endOfContent",t.append(i);const n=t.querySelectorAll('[role="presentation"]');if(e){let t=0;x.items.forEach(((i,s)=>{if(!function(t){return"str"in t}(i))return;const a=n[t];if(!a)return;const r=e(Object.assign({pageIndex:m,pageNumber:g,itemIndex:s},i));a.innerHTML=r,t+=i.str&&i.hasEOL?2:1}))}C()})).catch(E),()=>(0,S.xL)(a)}),[e,E,C,u,m,g,x,T]),(0,n.jsx)("div",{className:(0,o.A)("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=k.current;t&&t.classList.remove("selecting")},onMouseDown:function(){const t=k.current;t&&t.classList.add("selecting")},ref:k})}var M=i(6512);function D(){return(0,s.useContext)(M.A)}function I(){const t=D(),e=A();(0,c.A)(e,"Unable to find Page context.");const i=Object.assign(Object.assign({},t),e),{imageResourcesPath:r,linkService:l,onGetAnnotationsError:d,onGetAnnotationsSuccess:u,onRenderAnnotationLayerError:m,onRenderAnnotationLayerSuccess:g,page:f,pdf:v,renderForms:b,rotate:y,scale:x=1}=i;(0,c.A)(v,"Attempted to load page annotations, but no document was specified. Wrap in a or pass explicit `pdf` prop."),(0,c.A)(f,"Attempted to load page annotations, but no page was specified."),(0,c.A)(l,"Attempted to load page annotations, but no linkService was specified.");const[w,k]=(0,_.A)(),{value:C,error:E}=w,T=(0,s.useRef)(null);h(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10),"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations"),(0,s.useEffect)((function(){k({type:"RESET"})}),[k,f]),(0,s.useEffect)((function(){if(!f)return;const t=(0,a.A)(f.getAnnotations()),e=t;return t.promise.then((t=>{k({type:"RESOLVE",value:t})})).catch((t=>{k({type:"REJECT",error:t})})),()=>{(0,S.xL)(e)}}),[k,f]),(0,s.useEffect)((()=>{void 0!==C&&(!1!==C?C&&u&&u(C):E&&(h(!1,E.toString()),d&&d(E)))}),[C]);const M=(0,s.useMemo)((()=>f.getViewport({scale:x,rotation:y})),[f,y,x]);return(0,s.useEffect)((function(){if(!v||!f||!l||!C)return;const{current:t}=T;if(!t)return;const e=M.clone({dontFlip:!0}),i={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:t,l10n:null,page:f,structTreeLayer:null,viewport:e},n={annotations:C,annotationStorage:v.annotationStorage,div:t,imageResourcesPath:r,linkService:l,page:f,renderForms:b,viewport:e};t.innerHTML="";try{new p.dU(i).render(n),g&&g()}catch(s){!function(t){h(!1,`${t}`),m&&m(t)}(s)}return()=>{}}),[C,r,l,f,v,b,M]),(0,n.jsx)("div",{className:(0,o.A)("react-pdf__Page__annotations","annotationLayer"),ref:T})}var R=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s in a or pass explicit `pdf` prop.");const pt=(0,S.ci)(K)?K-1:null!==X&&void 0!==X?X:null,mt=null!==K&&void 0!==K?K:(0,S.ci)(X)?X+1:null,gt=null!==nt&&void 0!==nt?nt:ht?ht.rotate:null,ft=(0,s.useMemo)((()=>{if(!ht)return null;let t=1;const e=null!==st&&void 0!==st?st:P;if(rt||k){const e=ht.getViewport({scale:1,rotation:gt});rt?t=rt/e.width:k&&(t=k/e.height)}return e*t}),[k,ht,gt,st,rt]);(0,s.useEffect)((function(){return()=>{(0,S.ci)(pt)&&m&&at&&at(pt)}}),[m,Z,pt,at]),(0,s.useEffect)((function(){ct({type:"RESET"})}),[ct,Z,pt]),(0,s.useEffect)((function(){if(!Z||!mt)return;const t=(0,a.A)(Z.getPage(mt)),e=t;return t.promise.then((t=>{ct({type:"RESOLVE",value:t})})).catch((t=>{ct({type:"REJECT",error:t})})),()=>(0,S.xL)(e)}),[ct,Z,mt]),(0,s.useEffect)((()=>{void 0!==ht&&(!1!==ht?function(){if(V){if(!ht||!ft)return;V((0,S.vS)(ht,ft))}if(m&&J){if(!(0,S.ci)(pt)||!ut.current)return;J(pt,ut.current)}}():dt&&(h(!1,dt.toString()),B&&B(dt)))}),[ht,ft]);const vt=(0,s.useMemo)((()=>ht&&(0,S.ci)(pt)&&mt&&(0,S.ci)(gt)&&(0,S.ci)(ft)?{_className:p,canvasBackground:g,customTextRenderer:x,devicePixelRatio:w,onGetAnnotationsError:F,onGetAnnotationsSuccess:O,onGetStructTreeError:N,onGetStructTreeSuccess:j,onGetTextError:z,onGetTextSuccess:H,onRenderAnnotationLayerError:$,onRenderAnnotationLayerSuccess:U,onRenderError:W,onRenderSuccess:q,onRenderTextLayerError:G,onRenderTextLayerSuccess:Y,page:ht,pageIndex:pt,pageNumber:mt,renderForms:tt,renderTextLayer:it,rotate:gt,scale:ft}:null),[p,g,x,w,F,O,N,j,z,H,$,U,W,q,G,Y,ht,pt,mt,tt,it,gt,ft]),bt=(0,s.useMemo)((()=>(0,r.Ay)(ot,(()=>ht?ft?(0,S.vS)(ht,ft):void 0:ht))),[ot,ht,ft]),yt=`${pt}@${ft}/${gt}`;function xt(){switch(et){case"custom":return(0,c.A)(y,'renderMode was set to "custom", but no customRenderer was passed.'),(0,n.jsx)(y,{},`${yt}_custom`);case"none":return null;default:return(0,n.jsx)(E,{canvasRef:f},`${yt}_canvas`)}}return(0,n.jsx)("div",Object.assign({className:(0,o.A)(p,b),"data-page-number":mt,ref:l(C,ut),style:{"--scale-factor":`${ft}`,backgroundColor:g||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},bt,{children:mt?null===Z||void 0===ht||null===ht?(0,n.jsx)(u.A,{type:"loading",children:"function"===typeof M?M():M}):!1===Z||!1===ht?(0,n.jsx)(u.A,{type:"error",children:"function"===typeof A?A():A}):(0,n.jsxs)(d.Provider,{value:vt,children:[xt(),it?(0,n.jsx)(T,{},`${yt}_text`):null,Q?(0,n.jsx)(I,{},`${yt}_annotations`):null,v]}):(0,n.jsx)(u.A,{type:"no-data",children:"function"===typeof L?L():L})}))}},8234:(t,e,i)=>{"use strict";i.d(e,{A:()=>a});var n=i(5043);function s(t,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return t}}function a(){return(0,n.useReducer)(s,{value:void 0,error:void 0})}},665:(t,e,i)=>{"use strict";i.d(e,{Bd:()=>a,UT:()=>v,ci:()=>o,h1:()=>b,jA:()=>d,mZ:()=>u,mw:()=>l,qC:()=>m,qf:()=>c,vS:()=>f,xL:()=>g,zL:()=>h});var n=i(3404),s=i(6440);const a="undefined"!==typeof window,r=a&&"file:"===window.location.protocol;function o(t){return function(t){return"undefined"!==typeof t}(t)&&null!==t}function l(t){return t instanceof ArrayBuffer}function c(t){return(0,n.A)(a,"isBlob can only be used in a browser environment"),t instanceof Blob}function h(t){return function(t){return"string"===typeof t}(t)&&/^data:/.test(t)}function d(t){(0,n.A)(h(t),"Invalid data URI.");const[e="",i=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(i):unescape(i)}function u(){return a&&window.devicePixelRatio||1}const p="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function m(){s(!r,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${p}`)}function g(t){(null===t||void 0===t?void 0:t.cancel)&&t.cancel()}function f(t,e){return Object.defineProperty(t,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(t,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(t,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(t,"originalHeight",{get(){return this.view[3]},configurable:!0}),t}function v(t){return"RenderingCancelledException"===t.name}function b(t){return new Promise(((e,i)=>{const n=new FileReader;n.onload=()=>{if(!n.result)return i(new Error("Error while reading a file."));e(n.result)},n.onerror=t=>{if(!t.target)return i(new Error("Error while reading a file."));const{error:e}=t.target;if(!e)return i(new Error("Error while reading a file."));switch(e.code){case e.NOT_FOUND_ERR:return i(new Error("Error while reading a file: File not found."));case e.SECURITY_ERR:return i(new Error("Error while reading a file: Security error."));case e.ABORT_ERR:return i(new Error("Error while reading a file: Aborted."));default:return i(new Error("Error while reading a file."))}},n.readAsArrayBuffer(t)}))}},3404:(t,e,i)=>{"use strict";i.d(e,{A:()=>a});var n=!0,s="Invariant failed";function a(t,e){if(!t){if(n)throw new Error(s);var i="function"===typeof e?e():e,a=i?"".concat(s,": ").concat(i):s;throw new Error(a)}}}}]); +//# sourceMappingURL=368.b04989d2.chunk.js.map \ No newline at end of file diff --git a/web-app/build/static/js/5067.2702d94c.chunk.js.LICENSE.txt b/web-app/build/static/js/368.b04989d2.chunk.js.LICENSE.txt similarity index 95% rename from web-app/build/static/js/5067.2702d94c.chunk.js.LICENSE.txt rename to web-app/build/static/js/368.b04989d2.chunk.js.LICENSE.txt index 483239689..90a33e698 100644 --- a/web-app/build/static/js/5067.2702d94c.chunk.js.LICENSE.txt +++ b/web-app/build/static/js/368.b04989d2.chunk.js.LICENSE.txt @@ -2,7 +2,7 @@ * @licstart The following is the entire license notice for the * JavaScript code in this page * - * Copyright 2023 Mozilla Foundation + * Copyright 2024 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/web-app/build/static/js/368.b04989d2.chunk.js.map b/web-app/build/static/js/368.b04989d2.chunk.js.map new file mode 100644 index 000000000..2788510dc --- /dev/null +++ b/web-app/build/static/js/368.b04989d2.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"static/js/368.b04989d2.chunk.js","mappings":";+FAIAA,EAAQ,EAAU,SAAUC,EAAMC,GAChC,GAAID,GAAQC,EAAe,CACzB,IAAIC,EAAqBC,MAAMC,QAAQH,GAAiBA,EAAgBA,EAAcI,MAAM,KAE5F,GAAkC,IAA9BH,EAAmBI,OACrB,OAAO,EAGT,IAAIC,EAAWP,EAAKQ,MAAQ,GACxBC,GAAYT,EAAKU,MAAQ,IAAIC,cAC7BC,EAAeH,EAASI,QAAQ,QAAS,IAC7C,OAAOX,EAAmBY,MAAK,SAAUJ,GACvC,IAAIK,EAAYL,EAAKM,OAAOL,cAE5B,MAA4B,MAAxBI,EAAUE,OAAO,GACZV,EAASI,cAAcO,SAASH,GAC9BA,EAAUG,SAAS,MAErBN,IAAiBG,EAAUF,QAAQ,QAAS,IAG9CJ,IAAaM,CACtB,GACF,CAEA,OAAO,CACT,+BC5BA,IAAII,EAAkBC,EAAQ,KAE1BC,EAA4B,CAC9B,aAAc,OACd,YAAa,MACb,QAAW,QA2GbC,EAAOvB,QAjGP,SAAcwB,EAAMC,GAClB,IAAIC,EACFC,EACAC,EACAC,EACAC,EACAC,EACAC,GAAU,EACPP,IACHA,EA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F,EAClE,MAAM,IAAIxmJ,MAAMmB,EANhB,CAOJ","sources":["../node_modules/attr-accept/dist/es/index.js","../node_modules/copy-to-clipboard/index.js","../node_modules/react-copy-to-clipboard/lib/Component.js","../node_modules/react-copy-to-clipboard/lib/index.js","../node_modules/tslib/tslib.es6.mjs","../node_modules/file-selector/src/file.ts","../node_modules/file-selector/src/file-selector.ts","../node_modules/react-dropzone/dist/es/utils/index.js","../node_modules/react-dropzone/dist/es/index.js","../node_modules/toggle-selection/index.js","../node_modules/warning/warning.js","../node_modules/tinycolor2/cjs/tinycolor.js","../node_modules/luxon/src/errors.js","../node_modules/luxon/src/impl/formats.js","../node_modules/luxon/src/zone.js","../node_modules/luxon/src/zones/systemZone.js","../node_modules/luxon/src/zones/IANAZone.js","../node_modules/luxon/src/impl/locale.js","../node_modules/luxon/src/impl/english.js","../node_modules/luxon/src/zones/fixedOffsetZone.js","../node_modules/luxon/src/zones/invalidZone.js","../node_modules/luxon/src/impl/zoneUtil.js","../node_modules/luxon/src/impl/util.js","../node_modules/luxon/src/impl/digits.js","../node_modules/luxon/src/settings.js","../node_modules/luxon/src/impl/invalid.js","../node_modules/luxon/src/impl/conversions.js","../node_modules/luxon/src/impl/formatter.js","../node_modules/luxon/src/impl/regexParser.js","../node_modules/luxon/src/duration.js","../node_modules/luxon/src/interval.js","../node_modules/luxon/src/info.js","../node_modules/luxon/src/impl/diff.js","../node_modules/luxon/src/impl/tokenParser.js","../node_modules/luxon/src/datetime.js","../node_modules/make-cancellable-promise/dist/esm/index.js","../node_modules/make-event-props/dist/esm/index.js","../pdf.js/webpack/bootstrap","../pdf.js/webpack/runtime/define property getters","../pdf.js/webpack/runtime/hasOwnProperty shorthand","../pdf.js/src/shared/util.js","../pdf.js/src/display/display_utils.js","../pdf.js/src/display/editor/toolbar.js","../pdf.js/src/display/editor/tools.js","../pdf.js/src/display/editor/alt_text.js","../pdf.js/src/display/editor/editor.js","../pdf.js/src/shared/murmurhash3.js","../pdf.js/src/display/annotation_storage.js","../pdf.js/src/display/font_loader.js","../pdf.js/src/display/canvas_factory.js","../pdf.js/src/display/cmap_reader_factory.js","../pdf.js/src/display/filter_factory.js","../pdf.js/src/display/standard_fontdata_factory.js","../pdf.js/src/display/node_utils.js","../pdf.js/src/display/pattern_helper.js","../pdf.js/src/shared/image_utils.js","../pdf.js/src/display/canvas.js","../pdf.js/src/display/worker_options.js","../pdf.js/src/shared/message_handler.js","../pdf.js/src/display/metadata.js","../pdf.js/src/display/optional_content_config.js","../pdf.js/src/display/transport_stream.js","../pdf.js/src/display/network_utils.js","../pdf.js/src/display/content_disposition.js","../pdf.js/src/display/fetch_stream.js","../pdf.js/src/display/network.js","../pdf.js/src/display/node_stream.js","../pdf.js/src/display/text_layer.js","../pdf.js/src/display/xfa_text.js","../pdf.js/src/display/api.js","../pdf.js/src/shared/scripting_utils.js","../pdf.js/src/display/svg_factory.js","../pdf.js/src/display/xfa_layer.js","../pdf.js/src/display/annotation_layer.js","../pdf.js/src/display/editor/freetext.js","../pdf.js/src/display/editor/drawers/outline.js","../pdf.js/src/display/editor/drawers/freedraw.js","../pdf.js/src/display/editor/drawers/highlight.js","../pdf.js/src/display/editor/color_picker.js","../pdf.js/src/display/editor/highlight.js","../pdf.js/src/display/editor/ink.js","../pdf.js/src/display/editor/stamp.js","../pdf.js/src/display/editor/annotation_editor_layer.js","../pdf.js/src/display/draw_layer.js","../node_modules/dequal/dist/index.mjs","../node_modules/react-pdf/dist/esm/LinkService.js","../node_modules/react-pdf/dist/esm/PasswordResponses.js","../node_modules/react-pdf/dist/esm/Document.js","../node_modules/react-pdf/dist/esm/DocumentContext.js","../node_modules/react-pdf/dist/esm/Message.js","../node_modules/merge-refs/dist/esm/index.js","../node_modules/react-pdf/dist/esm/PageContext.js","../node_modules/react-pdf/dist/esm/shared/constants.js","../node_modules/react-pdf/dist/esm/shared/structTreeUtils.js","../node_modules/react-pdf/dist/esm/StructTreeItem.js","../node_modules/react-pdf/dist/esm/shared/hooks/usePageContext.js","../node_modules/react-pdf/dist/esm/StructTree.js","../node_modules/react-pdf/dist/esm/Page/Canvas.js","../node_modules/react-pdf/dist/esm/Page/TextLayer.js","../node_modules/react-pdf/dist/esm/shared/hooks/useDocumentContext.js","../node_modules/react-pdf/dist/esm/Page/AnnotationLayer.js","../node_modules/react-pdf/dist/esm/Page.js","../node_modules/react-pdf/dist/esm/shared/hooks/useResolver.js","../node_modules/react-pdf/dist/esm/shared/utils.js","../node_modules/tiny-invariant/dist/esm/tiny-invariant.js"],"sourcesContent":["\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (file, acceptedFiles) {\n if (file && acceptedFiles) {\n var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');\n\n if (acceptedFilesArray.length === 0) {\n return true;\n }\n\n var fileName = file.name || '';\n var mimeType = (file.type || '').toLowerCase();\n var baseMimeType = mimeType.replace(/\\/.*$/, '');\n return acceptedFilesArray.some(function (type) {\n var validType = type.trim().toLowerCase();\n\n if (validType.charAt(0) === '.') {\n return fileName.toLowerCase().endsWith(validType);\n } else if (validType.endsWith('/*')) {\n // This is something like a image/* mime type\n return baseMimeType === validType.replace(/\\/.*$/, '');\n }\n\n return mimeType === validType;\n });\n }\n\n return true;\n};","\"use strict\";\n\nvar deselectCurrent = require(\"toggle-selection\");\n\nvar clipboardToIE11Formatting = {\n \"text/plain\": \"Text\",\n \"text/html\": \"Url\",\n \"default\": \"Text\"\n}\n\nvar defaultMessage = \"Copy to clipboard: #{key}, Enter\";\n\nfunction format(message) {\n var copyKey = (/mac os x/i.test(navigator.userAgent) ? \"⌘\" : \"Ctrl\") + \"+C\";\n return message.replace(/#{\\s*key\\s*}/g, copyKey);\n}\n\nfunction copy(text, options) {\n var debug,\n message,\n reselectPrevious,\n range,\n selection,\n mark,\n success = false;\n if (!options) {\n options = {};\n }\n debug = options.debug || false;\n try {\n reselectPrevious = deselectCurrent();\n\n range = document.createRange();\n selection = document.getSelection();\n\n mark = document.createElement(\"span\");\n mark.textContent = text;\n // avoid screen readers from reading out loud the text\n mark.ariaHidden = \"true\"\n // reset user styles for span element\n mark.style.all = \"unset\";\n // prevents scrolling to the end of the page\n mark.style.position = \"fixed\";\n mark.style.top = 0;\n mark.style.clip = \"rect(0, 0, 0, 0)\";\n // used to preserve spaces and line breaks\n mark.style.whiteSpace = \"pre\";\n // do not inherit user-select (it may be `none`)\n mark.style.webkitUserSelect = \"text\";\n mark.style.MozUserSelect = \"text\";\n mark.style.msUserSelect = \"text\";\n mark.style.userSelect = \"text\";\n mark.addEventListener(\"copy\", function(e) {\n e.stopPropagation();\n if (options.format) {\n e.preventDefault();\n if (typeof e.clipboardData === \"undefined\") { // IE 11\n debug && console.warn(\"unable to use e.clipboardData\");\n debug && console.warn(\"trying IE specific stuff\");\n window.clipboardData.clearData();\n var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting[\"default\"]\n window.clipboardData.setData(format, text);\n } else { // all other browsers\n e.clipboardData.clearData();\n e.clipboardData.setData(options.format, text);\n }\n }\n if (options.onCopy) {\n e.preventDefault();\n options.onCopy(e.clipboardData);\n }\n });\n\n document.body.appendChild(mark);\n\n range.selectNodeContents(mark);\n selection.addRange(range);\n\n var successful = document.execCommand(\"copy\");\n if (!successful) {\n throw new Error(\"copy command was unsuccessful\");\n }\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using execCommand: \", err);\n debug && console.warn(\"trying IE specific stuff\");\n try {\n window.clipboardData.setData(options.format || \"text\", text);\n options.onCopy && options.onCopy(window.clipboardData);\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using clipboardData: \", err);\n debug && console.error(\"falling back to prompt\");\n message = format(\"message\" in options ? options.message : defaultMessage);\n window.prompt(message, text);\n }\n } finally {\n if (selection) {\n if (typeof selection.removeRange == \"function\") {\n selection.removeRange(range);\n } else {\n selection.removeAllRanges();\n }\n }\n\n if (mark) {\n document.body.removeChild(mark);\n }\n reselectPrevious();\n }\n\n return success;\n}\n\nmodule.exports = copy;\n","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.CopyToClipboard = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _copyToClipboard = _interopRequireDefault(require(\"copy-to-clipboard\"));\n\nvar _excluded = [\"text\", \"onCopy\", \"options\", \"children\"];\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar CopyToClipboard = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(CopyToClipboard, _React$PureComponent);\n\n var _super = _createSuper(CopyToClipboard);\n\n function CopyToClipboard() {\n var _this;\n\n _classCallCheck(this, CopyToClipboard);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"onClick\", function (event) {\n var _this$props = _this.props,\n text = _this$props.text,\n onCopy = _this$props.onCopy,\n children = _this$props.children,\n options = _this$props.options;\n\n var elem = _react[\"default\"].Children.only(children);\n\n var result = (0, _copyToClipboard[\"default\"])(text, options);\n\n if (onCopy) {\n onCopy(text, result);\n } // Bypass onClick if it was present\n\n\n if (elem && elem.props && typeof elem.props.onClick === 'function') {\n elem.props.onClick(event);\n }\n });\n\n return _this;\n }\n\n _createClass(CopyToClipboard, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n _text = _this$props2.text,\n _onCopy = _this$props2.onCopy,\n _options = _this$props2.options,\n children = _this$props2.children,\n props = _objectWithoutProperties(_this$props2, _excluded);\n\n var elem = _react[\"default\"].Children.only(children);\n\n return /*#__PURE__*/_react[\"default\"].cloneElement(elem, _objectSpread(_objectSpread({}, props), {}, {\n onClick: this.onClick\n }));\n }\n }]);\n\n return CopyToClipboard;\n}(_react[\"default\"].PureComponent);\n\nexports.CopyToClipboard = CopyToClipboard;\n\n_defineProperty(CopyToClipboard, \"defaultProps\", {\n onCopy: undefined,\n options: undefined\n});","\"use strict\";\n\nvar _require = require('./Component'),\n CopyToClipboard = _require.CopyToClipboard;\n\nCopyToClipboard.CopyToClipboard = CopyToClipboard;\nmodule.exports = CopyToClipboard;","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","export const COMMON_MIME_TYPES = new Map([\n // https://github.com/guzzle/psr7/blob/2d9260799e713f1c475d3c5fdc3d6561ff7441b2/src/MimeType.php\n ['1km', 'application/vnd.1000minds.decision-model+xml'],\n ['3dml', 'text/vnd.in3d.3dml'],\n ['3ds', 'image/x-3ds'],\n ['3g2', 'video/3gpp2'],\n ['3gp', 'video/3gp'],\n ['3gpp', 'video/3gpp'],\n ['3mf', 'model/3mf'],\n ['7z', 'application/x-7z-compressed'],\n ['7zip', 'application/x-7z-compressed'],\n ['123', 'application/vnd.lotus-1-2-3'],\n ['aab', 'application/x-authorware-bin'],\n ['aac', 'audio/x-acc'],\n ['aam', 'application/x-authorware-map'],\n ['aas', 'application/x-authorware-seg'],\n ['abw', 'application/x-abiword'],\n ['ac', 'application/vnd.nokia.n-gage.ac+xml'],\n ['ac3', 'audio/ac3'],\n ['acc', 'application/vnd.americandynamics.acc'],\n ['ace', 'application/x-ace-compressed'],\n ['acu', 'application/vnd.acucobol'],\n ['acutc', 'application/vnd.acucorp'],\n ['adp', 'audio/adpcm'],\n ['aep', 'application/vnd.audiograph'],\n ['afm', 'application/x-font-type1'],\n ['afp', 'application/vnd.ibm.modcap'],\n ['ahead', 'application/vnd.ahead.space'],\n ['ai', 'application/pdf'],\n ['aif', 'audio/x-aiff'],\n ['aifc', 'audio/x-aiff'],\n ['aiff', 'audio/x-aiff'],\n ['air', 'application/vnd.adobe.air-application-installer-package+zip'],\n ['ait', 'application/vnd.dvb.ait'],\n ['ami', 'application/vnd.amiga.ami'],\n ['amr', 'audio/amr'],\n ['apk', 'application/vnd.android.package-archive'],\n ['apng', 'image/apng'],\n ['appcache', 'text/cache-manifest'],\n ['application', 'application/x-ms-application'],\n ['apr', 'application/vnd.lotus-approach'],\n ['arc', 'application/x-freearc'],\n ['arj', 'application/x-arj'],\n ['asc', 'application/pgp-signature'],\n ['asf', 'video/x-ms-asf'],\n ['asm', 'text/x-asm'],\n ['aso', 'application/vnd.accpac.simply.aso'],\n ['asx', 'video/x-ms-asf'],\n ['atc', 'application/vnd.acucorp'],\n ['atom', 'application/atom+xml'],\n ['atomcat', 'application/atomcat+xml'],\n ['atomdeleted', 'application/atomdeleted+xml'],\n ['atomsvc', 'application/atomsvc+xml'],\n ['atx', 'application/vnd.antix.game-component'],\n ['au', 'audio/x-au'],\n ['avi', 'video/x-msvideo'],\n ['avif', 'image/avif'],\n ['aw', 'application/applixware'],\n ['azf', 'application/vnd.airzip.filesecure.azf'],\n ['azs', 'application/vnd.airzip.filesecure.azs'],\n ['azv', 'image/vnd.airzip.accelerator.azv'],\n ['azw', 'application/vnd.amazon.ebook'],\n ['b16', 'image/vnd.pco.b16'],\n ['bat', 'application/x-msdownload'],\n ['bcpio', 'application/x-bcpio'],\n ['bdf', 'application/x-font-bdf'],\n ['bdm', 'application/vnd.syncml.dm+wbxml'],\n ['bdoc', 'application/x-bdoc'],\n ['bed', 'application/vnd.realvnc.bed'],\n ['bh2', 'application/vnd.fujitsu.oasysprs'],\n ['bin', 'application/octet-stream'],\n ['blb', 'application/x-blorb'],\n ['blorb', 'application/x-blorb'],\n ['bmi', 'application/vnd.bmi'],\n ['bmml', 'application/vnd.balsamiq.bmml+xml'],\n ['bmp', 'image/bmp'],\n ['book', 'application/vnd.framemaker'],\n ['box', 'application/vnd.previewsystems.box'],\n ['boz', 'application/x-bzip2'],\n ['bpk', 'application/octet-stream'],\n ['bpmn', 'application/octet-stream'],\n ['bsp', 'model/vnd.valve.source.compiled-map'],\n ['btif', 'image/prs.btif'],\n ['buffer', 'application/octet-stream'],\n ['bz', 'application/x-bzip'],\n ['bz2', 'application/x-bzip2'],\n ['c', 'text/x-c'],\n ['c4d', 'application/vnd.clonk.c4group'],\n ['c4f', 'application/vnd.clonk.c4group'],\n ['c4g', 'application/vnd.clonk.c4group'],\n ['c4p', 'application/vnd.clonk.c4group'],\n ['c4u', 'application/vnd.clonk.c4group'],\n ['c11amc', 'application/vnd.cluetrust.cartomobile-config'],\n ['c11amz', 'application/vnd.cluetrust.cartomobile-config-pkg'],\n ['cab', 'application/vnd.ms-cab-compressed'],\n ['caf', 'audio/x-caf'],\n ['cap', 'application/vnd.tcpdump.pcap'],\n ['car', 'application/vnd.curl.car'],\n ['cat', 'application/vnd.ms-pki.seccat'],\n ['cb7', 'application/x-cbr'],\n ['cba', 'application/x-cbr'],\n ['cbr', 'application/x-cbr'],\n ['cbt', 'application/x-cbr'],\n ['cbz', 'application/x-cbr'],\n ['cc', 'text/x-c'],\n ['cco', 'application/x-cocoa'],\n ['cct', 'application/x-director'],\n ['ccxml', 'application/ccxml+xml'],\n ['cdbcmsg', 'application/vnd.contact.cmsg'],\n ['cda', 'application/x-cdf'],\n ['cdf', 'application/x-netcdf'],\n ['cdfx', 'application/cdfx+xml'],\n ['cdkey', 'application/vnd.mediastation.cdkey'],\n ['cdmia', 'application/cdmi-capability'],\n ['cdmic', 'application/cdmi-container'],\n ['cdmid', 'application/cdmi-domain'],\n ['cdmio', 'application/cdmi-object'],\n ['cdmiq', 'application/cdmi-queue'],\n ['cdr', 'application/cdr'],\n ['cdx', 'chemical/x-cdx'],\n ['cdxml', 'application/vnd.chemdraw+xml'],\n ['cdy', 'application/vnd.cinderella'],\n ['cer', 'application/pkix-cert'],\n ['cfs', 'application/x-cfs-compressed'],\n ['cgm', 'image/cgm'],\n ['chat', 'application/x-chat'],\n ['chm', 'application/vnd.ms-htmlhelp'],\n ['chrt', 'application/vnd.kde.kchart'],\n ['cif', 'chemical/x-cif'],\n ['cii', 'application/vnd.anser-web-certificate-issue-initiation'],\n ['cil', 'application/vnd.ms-artgalry'],\n ['cjs', 'application/node'],\n ['cla', 'application/vnd.claymore'],\n ['class', 'application/octet-stream'],\n ['clkk', 'application/vnd.crick.clicker.keyboard'],\n ['clkp', 'application/vnd.crick.clicker.palette'],\n ['clkt', 'application/vnd.crick.clicker.template'],\n ['clkw', 'application/vnd.crick.clicker.wordbank'],\n ['clkx', 'application/vnd.crick.clicker'],\n ['clp', 'application/x-msclip'],\n ['cmc', 'application/vnd.cosmocaller'],\n ['cmdf', 'chemical/x-cmdf'],\n ['cml', 'chemical/x-cml'],\n ['cmp', 'application/vnd.yellowriver-custom-menu'],\n ['cmx', 'image/x-cmx'],\n ['cod', 'application/vnd.rim.cod'],\n ['coffee', 'text/coffeescript'],\n ['com', 'application/x-msdownload'],\n ['conf', 'text/plain'],\n ['cpio', 'application/x-cpio'],\n ['cpp', 'text/x-c'],\n ['cpt', 'application/mac-compactpro'],\n ['crd', 'application/x-mscardfile'],\n ['crl', 'application/pkix-crl'],\n ['crt', 'application/x-x509-ca-cert'],\n ['crx', 'application/x-chrome-extension'],\n ['cryptonote', 'application/vnd.rig.cryptonote'],\n ['csh', 'application/x-csh'],\n ['csl', 'application/vnd.citationstyles.style+xml'],\n ['csml', 'chemical/x-csml'],\n ['csp', 'application/vnd.commonspace'],\n ['csr', 'application/octet-stream'],\n ['css', 'text/css'],\n ['cst', 'application/x-director'],\n ['csv', 'text/csv'],\n ['cu', 'application/cu-seeme'],\n ['curl', 'text/vnd.curl'],\n ['cww', 'application/prs.cww'],\n ['cxt', 'application/x-director'],\n ['cxx', 'text/x-c'],\n ['dae', 'model/vnd.collada+xml'],\n ['daf', 'application/vnd.mobius.daf'],\n ['dart', 'application/vnd.dart'],\n ['dataless', 'application/vnd.fdsn.seed'],\n ['davmount', 'application/davmount+xml'],\n ['dbf', 'application/vnd.dbf'],\n ['dbk', 'application/docbook+xml'],\n ['dcr', 'application/x-director'],\n ['dcurl', 'text/vnd.curl.dcurl'],\n ['dd2', 'application/vnd.oma.dd2+xml'],\n ['ddd', 'application/vnd.fujixerox.ddd'],\n ['ddf', 'application/vnd.syncml.dmddf+xml'],\n ['dds', 'image/vnd.ms-dds'],\n ['deb', 'application/x-debian-package'],\n ['def', 'text/plain'],\n ['deploy', 'application/octet-stream'],\n ['der', 'application/x-x509-ca-cert'],\n ['dfac', 'application/vnd.dreamfactory'],\n ['dgc', 'application/x-dgc-compressed'],\n ['dic', 'text/x-c'],\n ['dir', 'application/x-director'],\n ['dis', 'application/vnd.mobius.dis'],\n ['disposition-notification', 'message/disposition-notification'],\n ['dist', 'application/octet-stream'],\n ['distz', 'application/octet-stream'],\n ['djv', 'image/vnd.djvu'],\n ['djvu', 'image/vnd.djvu'],\n ['dll', 'application/octet-stream'],\n ['dmg', 'application/x-apple-diskimage'],\n ['dmn', 'application/octet-stream'],\n ['dmp', 'application/vnd.tcpdump.pcap'],\n ['dms', 'application/octet-stream'],\n ['dna', 'application/vnd.dna'],\n ['doc', 'application/msword'],\n ['docm', 'application/vnd.ms-word.template.macroEnabled.12'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ['dot', 'application/msword'],\n ['dotm', 'application/vnd.ms-word.template.macroEnabled.12'],\n ['dotx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'],\n ['dp', 'application/vnd.osgi.dp'],\n ['dpg', 'application/vnd.dpgraph'],\n ['dra', 'audio/vnd.dra'],\n ['drle', 'image/dicom-rle'],\n ['dsc', 'text/prs.lines.tag'],\n ['dssc', 'application/dssc+der'],\n ['dtb', 'application/x-dtbook+xml'],\n ['dtd', 'application/xml-dtd'],\n ['dts', 'audio/vnd.dts'],\n ['dtshd', 'audio/vnd.dts.hd'],\n ['dump', 'application/octet-stream'],\n ['dvb', 'video/vnd.dvb.file'],\n ['dvi', 'application/x-dvi'],\n ['dwd', 'application/atsc-dwd+xml'],\n ['dwf', 'model/vnd.dwf'],\n ['dwg', 'image/vnd.dwg'],\n ['dxf', 'image/vnd.dxf'],\n ['dxp', 'application/vnd.spotfire.dxp'],\n ['dxr', 'application/x-director'],\n ['ear', 'application/java-archive'],\n ['ecelp4800', 'audio/vnd.nuera.ecelp4800'],\n ['ecelp7470', 'audio/vnd.nuera.ecelp7470'],\n ['ecelp9600', 'audio/vnd.nuera.ecelp9600'],\n ['ecma', 'application/ecmascript'],\n ['edm', 'application/vnd.novadigm.edm'],\n ['edx', 'application/vnd.novadigm.edx'],\n ['efif', 'application/vnd.picsel'],\n ['ei6', 'application/vnd.pg.osasli'],\n ['elc', 'application/octet-stream'],\n ['emf', 'image/emf'],\n ['eml', 'message/rfc822'],\n ['emma', 'application/emma+xml'],\n ['emotionml', 'application/emotionml+xml'],\n ['emz', 'application/x-msmetafile'],\n ['eol', 'audio/vnd.digital-winds'],\n ['eot', 'application/vnd.ms-fontobject'],\n ['eps', 'application/postscript'],\n ['epub', 'application/epub+zip'],\n ['es', 'application/ecmascript'],\n ['es3', 'application/vnd.eszigno3+xml'],\n ['esa', 'application/vnd.osgi.subsystem'],\n ['esf', 'application/vnd.epson.esf'],\n ['et3', 'application/vnd.eszigno3+xml'],\n ['etx', 'text/x-setext'],\n ['eva', 'application/x-eva'],\n ['evy', 'application/x-envoy'],\n ['exe', 'application/octet-stream'],\n ['exi', 'application/exi'],\n ['exp', 'application/express'],\n ['exr', 'image/aces'],\n ['ext', 'application/vnd.novadigm.ext'],\n ['ez', 'application/andrew-inset'],\n ['ez2', 'application/vnd.ezpix-album'],\n ['ez3', 'application/vnd.ezpix-package'],\n ['f', 'text/x-fortran'],\n ['f4v', 'video/mp4'],\n ['f77', 'text/x-fortran'],\n ['f90', 'text/x-fortran'],\n ['fbs', 'image/vnd.fastbidsheet'],\n ['fcdt', 'application/vnd.adobe.formscentral.fcdt'],\n ['fcs', 'application/vnd.isac.fcs'],\n ['fdf', 'application/vnd.fdf'],\n ['fdt', 'application/fdt+xml'],\n ['fe_launch', 'application/vnd.denovo.fcselayout-link'],\n ['fg5', 'application/vnd.fujitsu.oasysgp'],\n ['fgd', 'application/x-director'],\n ['fh', 'image/x-freehand'],\n ['fh4', 'image/x-freehand'],\n ['fh5', 'image/x-freehand'],\n ['fh7', 'image/x-freehand'],\n ['fhc', 'image/x-freehand'],\n ['fig', 'application/x-xfig'],\n ['fits', 'image/fits'],\n ['flac', 'audio/x-flac'],\n ['fli', 'video/x-fli'],\n ['flo', 'application/vnd.micrografx.flo'],\n ['flv', 'video/x-flv'],\n ['flw', 'application/vnd.kde.kivio'],\n ['flx', 'text/vnd.fmi.flexstor'],\n ['fly', 'text/vnd.fly'],\n ['fm', 'application/vnd.framemaker'],\n ['fnc', 'application/vnd.frogans.fnc'],\n ['fo', 'application/vnd.software602.filler.form+xml'],\n ['for', 'text/x-fortran'],\n ['fpx', 'image/vnd.fpx'],\n ['frame', 'application/vnd.framemaker'],\n ['fsc', 'application/vnd.fsc.weblaunch'],\n ['fst', 'image/vnd.fst'],\n ['ftc', 'application/vnd.fluxtime.clip'],\n ['fti', 'application/vnd.anser-web-funds-transfer-initiation'],\n ['fvt', 'video/vnd.fvt'],\n ['fxp', 'application/vnd.adobe.fxp'],\n ['fxpl', 'application/vnd.adobe.fxp'],\n ['fzs', 'application/vnd.fuzzysheet'],\n ['g2w', 'application/vnd.geoplan'],\n ['g3', 'image/g3fax'],\n ['g3w', 'application/vnd.geospace'],\n ['gac', 'application/vnd.groove-account'],\n ['gam', 'application/x-tads'],\n ['gbr', 'application/rpki-ghostbusters'],\n ['gca', 'application/x-gca-compressed'],\n ['gdl', 'model/vnd.gdl'],\n ['gdoc', 'application/vnd.google-apps.document'],\n ['geo', 'application/vnd.dynageo'],\n ['geojson', 'application/geo+json'],\n ['gex', 'application/vnd.geometry-explorer'],\n ['ggb', 'application/vnd.geogebra.file'],\n ['ggt', 'application/vnd.geogebra.tool'],\n ['ghf', 'application/vnd.groove-help'],\n ['gif', 'image/gif'],\n ['gim', 'application/vnd.groove-identity-message'],\n ['glb', 'model/gltf-binary'],\n ['gltf', 'model/gltf+json'],\n ['gml', 'application/gml+xml'],\n ['gmx', 'application/vnd.gmx'],\n ['gnumeric', 'application/x-gnumeric'],\n ['gpg', 'application/gpg-keys'],\n ['gph', 'application/vnd.flographit'],\n ['gpx', 'application/gpx+xml'],\n ['gqf', 'application/vnd.grafeq'],\n ['gqs', 'application/vnd.grafeq'],\n ['gram', 'application/srgs'],\n ['gramps', 'application/x-gramps-xml'],\n ['gre', 'application/vnd.geometry-explorer'],\n ['grv', 'application/vnd.groove-injector'],\n ['grxml', 'application/srgs+xml'],\n ['gsf', 'application/x-font-ghostscript'],\n ['gsheet', 'application/vnd.google-apps.spreadsheet'],\n ['gslides', 'application/vnd.google-apps.presentation'],\n ['gtar', 'application/x-gtar'],\n ['gtm', 'application/vnd.groove-tool-message'],\n ['gtw', 'model/vnd.gtw'],\n ['gv', 'text/vnd.graphviz'],\n ['gxf', 'application/gxf'],\n ['gxt', 'application/vnd.geonext'],\n ['gz', 'application/gzip'],\n ['gzip', 'application/gzip'],\n ['h', 'text/x-c'],\n ['h261', 'video/h261'],\n ['h263', 'video/h263'],\n ['h264', 'video/h264'],\n ['hal', 'application/vnd.hal+xml'],\n ['hbci', 'application/vnd.hbci'],\n ['hbs', 'text/x-handlebars-template'],\n ['hdd', 'application/x-virtualbox-hdd'],\n ['hdf', 'application/x-hdf'],\n ['heic', 'image/heic'],\n ['heics', 'image/heic-sequence'],\n ['heif', 'image/heif'],\n ['heifs', 'image/heif-sequence'],\n ['hej2', 'image/hej2k'],\n ['held', 'application/atsc-held+xml'],\n ['hh', 'text/x-c'],\n ['hjson', 'application/hjson'],\n ['hlp', 'application/winhlp'],\n ['hpgl', 'application/vnd.hp-hpgl'],\n ['hpid', 'application/vnd.hp-hpid'],\n ['hps', 'application/vnd.hp-hps'],\n ['hqx', 'application/mac-binhex40'],\n ['hsj2', 'image/hsj2'],\n ['htc', 'text/x-component'],\n ['htke', 'application/vnd.kenameaapp'],\n ['htm', 'text/html'],\n ['html', 'text/html'],\n ['hvd', 'application/vnd.yamaha.hv-dic'],\n ['hvp', 'application/vnd.yamaha.hv-voice'],\n ['hvs', 'application/vnd.yamaha.hv-script'],\n ['i2g', 'application/vnd.intergeo'],\n ['icc', 'application/vnd.iccprofile'],\n ['ice', 'x-conference/x-cooltalk'],\n ['icm', 'application/vnd.iccprofile'],\n ['ico', 'image/x-icon'],\n ['ics', 'text/calendar'],\n ['ief', 'image/ief'],\n ['ifb', 'text/calendar'],\n ['ifm', 'application/vnd.shana.informed.formdata'],\n ['iges', 'model/iges'],\n ['igl', 'application/vnd.igloader'],\n ['igm', 'application/vnd.insors.igm'],\n ['igs', 'model/iges'],\n ['igx', 'application/vnd.micrografx.igx'],\n ['iif', 'application/vnd.shana.informed.interchange'],\n ['img', 'application/octet-stream'],\n ['imp', 'application/vnd.accpac.simply.imp'],\n ['ims', 'application/vnd.ms-ims'],\n ['in', 'text/plain'],\n ['ini', 'text/plain'],\n ['ink', 'application/inkml+xml'],\n ['inkml', 'application/inkml+xml'],\n ['install', 'application/x-install-instructions'],\n ['iota', 'application/vnd.astraea-software.iota'],\n ['ipfix', 'application/ipfix'],\n ['ipk', 'application/vnd.shana.informed.package'],\n ['irm', 'application/vnd.ibm.rights-management'],\n ['irp', 'application/vnd.irepository.package+xml'],\n ['iso', 'application/x-iso9660-image'],\n ['itp', 'application/vnd.shana.informed.formtemplate'],\n ['its', 'application/its+xml'],\n ['ivp', 'application/vnd.immervision-ivp'],\n ['ivu', 'application/vnd.immervision-ivu'],\n ['jad', 'text/vnd.sun.j2me.app-descriptor'],\n ['jade', 'text/jade'],\n ['jam', 'application/vnd.jam'],\n ['jar', 'application/java-archive'],\n ['jardiff', 'application/x-java-archive-diff'],\n ['java', 'text/x-java-source'],\n ['jhc', 'image/jphc'],\n ['jisp', 'application/vnd.jisp'],\n ['jls', 'image/jls'],\n ['jlt', 'application/vnd.hp-jlyt'],\n ['jng', 'image/x-jng'],\n ['jnlp', 'application/x-java-jnlp-file'],\n ['joda', 'application/vnd.joost.joda-archive'],\n ['jp2', 'image/jp2'],\n ['jpe', 'image/jpeg'],\n ['jpeg', 'image/jpeg'],\n ['jpf', 'image/jpx'],\n ['jpg', 'image/jpeg'],\n ['jpg2', 'image/jp2'],\n ['jpgm', 'video/jpm'],\n ['jpgv', 'video/jpeg'],\n ['jph', 'image/jph'],\n ['jpm', 'video/jpm'],\n ['jpx', 'image/jpx'],\n ['js', 'application/javascript'],\n ['json', 'application/json'],\n ['json5', 'application/json5'],\n ['jsonld', 'application/ld+json'],\n // https://jsonlines.org/\n ['jsonl', 'application/jsonl'],\n ['jsonml', 'application/jsonml+json'],\n ['jsx', 'text/jsx'],\n ['jxr', 'image/jxr'],\n ['jxra', 'image/jxra'],\n ['jxrs', 'image/jxrs'],\n ['jxs', 'image/jxs'],\n ['jxsc', 'image/jxsc'],\n ['jxsi', 'image/jxsi'],\n ['jxss', 'image/jxss'],\n ['kar', 'audio/midi'],\n ['karbon', 'application/vnd.kde.karbon'],\n ['kdb', 'application/octet-stream'],\n ['kdbx', 'application/x-keepass2'],\n ['key', 'application/x-iwork-keynote-sffkey'],\n ['kfo', 'application/vnd.kde.kformula'],\n ['kia', 'application/vnd.kidspiration'],\n ['kml', 'application/vnd.google-earth.kml+xml'],\n ['kmz', 'application/vnd.google-earth.kmz'],\n ['kne', 'application/vnd.kinar'],\n ['knp', 'application/vnd.kinar'],\n ['kon', 'application/vnd.kde.kontour'],\n ['kpr', 'application/vnd.kde.kpresenter'],\n ['kpt', 'application/vnd.kde.kpresenter'],\n ['kpxx', 'application/vnd.ds-keypoint'],\n ['ksp', 'application/vnd.kde.kspread'],\n ['ktr', 'application/vnd.kahootz'],\n ['ktx', 'image/ktx'],\n ['ktx2', 'image/ktx2'],\n ['ktz', 'application/vnd.kahootz'],\n ['kwd', 'application/vnd.kde.kword'],\n ['kwt', 'application/vnd.kde.kword'],\n ['lasxml', 'application/vnd.las.las+xml'],\n ['latex', 'application/x-latex'],\n ['lbd', 'application/vnd.llamagraphics.life-balance.desktop'],\n ['lbe', 'application/vnd.llamagraphics.life-balance.exchange+xml'],\n ['les', 'application/vnd.hhe.lesson-player'],\n ['less', 'text/less'],\n ['lgr', 'application/lgr+xml'],\n ['lha', 'application/octet-stream'],\n ['link66', 'application/vnd.route66.link66+xml'],\n ['list', 'text/plain'],\n ['list3820', 'application/vnd.ibm.modcap'],\n ['listafp', 'application/vnd.ibm.modcap'],\n ['litcoffee', 'text/coffeescript'],\n ['lnk', 'application/x-ms-shortcut'],\n ['log', 'text/plain'],\n ['lostxml', 'application/lost+xml'],\n ['lrf', 'application/octet-stream'],\n ['lrm', 'application/vnd.ms-lrm'],\n ['ltf', 'application/vnd.frogans.ltf'],\n ['lua', 'text/x-lua'],\n ['luac', 'application/x-lua-bytecode'],\n ['lvp', 'audio/vnd.lucent.voice'],\n ['lwp', 'application/vnd.lotus-wordpro'],\n ['lzh', 'application/octet-stream'],\n ['m1v', 'video/mpeg'],\n ['m2a', 'audio/mpeg'],\n ['m2v', 'video/mpeg'],\n ['m3a', 'audio/mpeg'],\n ['m3u', 'text/plain'],\n ['m3u8', 'application/vnd.apple.mpegurl'],\n ['m4a', 'audio/x-m4a'],\n ['m4p', 'application/mp4'],\n ['m4s', 'video/iso.segment'],\n ['m4u', 'application/vnd.mpegurl'],\n ['m4v', 'video/x-m4v'],\n ['m13', 'application/x-msmediaview'],\n ['m14', 'application/x-msmediaview'],\n ['m21', 'application/mp21'],\n ['ma', 'application/mathematica'],\n ['mads', 'application/mads+xml'],\n ['maei', 'application/mmt-aei+xml'],\n ['mag', 'application/vnd.ecowin.chart'],\n ['maker', 'application/vnd.framemaker'],\n ['man', 'text/troff'],\n ['manifest', 'text/cache-manifest'],\n ['map', 'application/json'],\n ['mar', 'application/octet-stream'],\n ['markdown', 'text/markdown'],\n ['mathml', 'application/mathml+xml'],\n ['mb', 'application/mathematica'],\n ['mbk', 'application/vnd.mobius.mbk'],\n ['mbox', 'application/mbox'],\n ['mc1', 'application/vnd.medcalcdata'],\n ['mcd', 'application/vnd.mcd'],\n ['mcurl', 'text/vnd.curl.mcurl'],\n ['md', 'text/markdown'],\n ['mdb', 'application/x-msaccess'],\n ['mdi', 'image/vnd.ms-modi'],\n ['mdx', 'text/mdx'],\n ['me', 'text/troff'],\n ['mesh', 'model/mesh'],\n ['meta4', 'application/metalink4+xml'],\n ['metalink', 'application/metalink+xml'],\n ['mets', 'application/mets+xml'],\n ['mfm', 'application/vnd.mfmp'],\n ['mft', 'application/rpki-manifest'],\n ['mgp', 'application/vnd.osgeo.mapguide.package'],\n ['mgz', 'application/vnd.proteus.magazine'],\n ['mid', 'audio/midi'],\n ['midi', 'audio/midi'],\n ['mie', 'application/x-mie'],\n ['mif', 'application/vnd.mif'],\n ['mime', 'message/rfc822'],\n ['mj2', 'video/mj2'],\n ['mjp2', 'video/mj2'],\n ['mjs', 'application/javascript'],\n ['mk3d', 'video/x-matroska'],\n ['mka', 'audio/x-matroska'],\n ['mkd', 'text/x-markdown'],\n ['mks', 'video/x-matroska'],\n ['mkv', 'video/x-matroska'],\n ['mlp', 'application/vnd.dolby.mlp'],\n ['mmd', 'application/vnd.chipnuts.karaoke-mmd'],\n ['mmf', 'application/vnd.smaf'],\n ['mml', 'text/mathml'],\n ['mmr', 'image/vnd.fujixerox.edmics-mmr'],\n ['mng', 'video/x-mng'],\n ['mny', 'application/x-msmoney'],\n ['mobi', 'application/x-mobipocket-ebook'],\n ['mods', 'application/mods+xml'],\n ['mov', 'video/quicktime'],\n ['movie', 'video/x-sgi-movie'],\n ['mp2', 'audio/mpeg'],\n ['mp2a', 'audio/mpeg'],\n ['mp3', 'audio/mpeg'],\n ['mp4', 'video/mp4'],\n ['mp4a', 'audio/mp4'],\n ['mp4s', 'application/mp4'],\n ['mp4v', 'video/mp4'],\n ['mp21', 'application/mp21'],\n ['mpc', 'application/vnd.mophun.certificate'],\n ['mpd', 'application/dash+xml'],\n ['mpe', 'video/mpeg'],\n ['mpeg', 'video/mpeg'],\n ['mpg', 'video/mpeg'],\n ['mpg4', 'video/mp4'],\n ['mpga', 'audio/mpeg'],\n ['mpkg', 'application/vnd.apple.installer+xml'],\n ['mpm', 'application/vnd.blueice.multipass'],\n ['mpn', 'application/vnd.mophun.application'],\n ['mpp', 'application/vnd.ms-project'],\n ['mpt', 'application/vnd.ms-project'],\n ['mpy', 'application/vnd.ibm.minipay'],\n ['mqy', 'application/vnd.mobius.mqy'],\n ['mrc', 'application/marc'],\n ['mrcx', 'application/marcxml+xml'],\n ['ms', 'text/troff'],\n ['mscml', 'application/mediaservercontrol+xml'],\n ['mseed', 'application/vnd.fdsn.mseed'],\n ['mseq', 'application/vnd.mseq'],\n ['msf', 'application/vnd.epson.msf'],\n ['msg', 'application/vnd.ms-outlook'],\n ['msh', 'model/mesh'],\n ['msi', 'application/x-msdownload'],\n ['msl', 'application/vnd.mobius.msl'],\n ['msm', 'application/octet-stream'],\n ['msp', 'application/octet-stream'],\n ['msty', 'application/vnd.muvee.style'],\n ['mtl', 'model/mtl'],\n ['mts', 'model/vnd.mts'],\n ['mus', 'application/vnd.musician'],\n ['musd', 'application/mmt-usd+xml'],\n ['musicxml', 'application/vnd.recordare.musicxml+xml'],\n ['mvb', 'application/x-msmediaview'],\n ['mvt', 'application/vnd.mapbox-vector-tile'],\n ['mwf', 'application/vnd.mfer'],\n ['mxf', 'application/mxf'],\n ['mxl', 'application/vnd.recordare.musicxml'],\n ['mxmf', 'audio/mobile-xmf'],\n ['mxml', 'application/xv+xml'],\n ['mxs', 'application/vnd.triscape.mxs'],\n ['mxu', 'video/vnd.mpegurl'],\n ['n-gage', 'application/vnd.nokia.n-gage.symbian.install'],\n ['n3', 'text/n3'],\n ['nb', 'application/mathematica'],\n ['nbp', 'application/vnd.wolfram.player'],\n ['nc', 'application/x-netcdf'],\n ['ncx', 'application/x-dtbncx+xml'],\n ['nfo', 'text/x-nfo'],\n ['ngdat', 'application/vnd.nokia.n-gage.data'],\n ['nitf', 'application/vnd.nitf'],\n ['nlu', 'application/vnd.neurolanguage.nlu'],\n ['nml', 'application/vnd.enliven'],\n ['nnd', 'application/vnd.noblenet-directory'],\n ['nns', 'application/vnd.noblenet-sealer'],\n ['nnw', 'application/vnd.noblenet-web'],\n ['npx', 'image/vnd.net-fpx'],\n ['nq', 'application/n-quads'],\n ['nsc', 'application/x-conference'],\n ['nsf', 'application/vnd.lotus-notes'],\n ['nt', 'application/n-triples'],\n ['ntf', 'application/vnd.nitf'],\n ['numbers', 'application/x-iwork-numbers-sffnumbers'],\n ['nzb', 'application/x-nzb'],\n ['oa2', 'application/vnd.fujitsu.oasys2'],\n ['oa3', 'application/vnd.fujitsu.oasys3'],\n ['oas', 'application/vnd.fujitsu.oasys'],\n ['obd', 'application/x-msbinder'],\n ['obgx', 'application/vnd.openblox.game+xml'],\n ['obj', 'model/obj'],\n ['oda', 'application/oda'],\n ['odb', 'application/vnd.oasis.opendocument.database'],\n ['odc', 'application/vnd.oasis.opendocument.chart'],\n ['odf', 'application/vnd.oasis.opendocument.formula'],\n ['odft', 'application/vnd.oasis.opendocument.formula-template'],\n ['odg', 'application/vnd.oasis.opendocument.graphics'],\n ['odi', 'application/vnd.oasis.opendocument.image'],\n ['odm', 'application/vnd.oasis.opendocument.text-master'],\n ['odp', 'application/vnd.oasis.opendocument.presentation'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['odt', 'application/vnd.oasis.opendocument.text'],\n ['oga', 'audio/ogg'],\n ['ogex', 'model/vnd.opengex'],\n ['ogg', 'audio/ogg'],\n ['ogv', 'video/ogg'],\n ['ogx', 'application/ogg'],\n ['omdoc', 'application/omdoc+xml'],\n ['onepkg', 'application/onenote'],\n ['onetmp', 'application/onenote'],\n ['onetoc', 'application/onenote'],\n ['onetoc2', 'application/onenote'],\n ['opf', 'application/oebps-package+xml'],\n ['opml', 'text/x-opml'],\n ['oprc', 'application/vnd.palm'],\n ['opus', 'audio/ogg'],\n ['org', 'text/x-org'],\n ['osf', 'application/vnd.yamaha.openscoreformat'],\n ['osfpvg', 'application/vnd.yamaha.openscoreformat.osfpvg+xml'],\n ['osm', 'application/vnd.openstreetmap.data+xml'],\n ['otc', 'application/vnd.oasis.opendocument.chart-template'],\n ['otf', 'font/otf'],\n ['otg', 'application/vnd.oasis.opendocument.graphics-template'],\n ['oth', 'application/vnd.oasis.opendocument.text-web'],\n ['oti', 'application/vnd.oasis.opendocument.image-template'],\n ['otp', 'application/vnd.oasis.opendocument.presentation-template'],\n ['ots', 'application/vnd.oasis.opendocument.spreadsheet-template'],\n ['ott', 'application/vnd.oasis.opendocument.text-template'],\n ['ova', 'application/x-virtualbox-ova'],\n ['ovf', 'application/x-virtualbox-ovf'],\n ['owl', 'application/rdf+xml'],\n ['oxps', 'application/oxps'],\n ['oxt', 'application/vnd.openofficeorg.extension'],\n ['p', 'text/x-pascal'],\n ['p7a', 'application/x-pkcs7-signature'],\n ['p7b', 'application/x-pkcs7-certificates'],\n ['p7c', 'application/pkcs7-mime'],\n ['p7m', 'application/pkcs7-mime'],\n ['p7r', 'application/x-pkcs7-certreqresp'],\n ['p7s', 'application/pkcs7-signature'],\n ['p8', 'application/pkcs8'],\n ['p10', 'application/x-pkcs10'],\n ['p12', 'application/x-pkcs12'],\n ['pac', 'application/x-ns-proxy-autoconfig'],\n ['pages', 'application/x-iwork-pages-sffpages'],\n ['pas', 'text/x-pascal'],\n ['paw', 'application/vnd.pawaafile'],\n ['pbd', 'application/vnd.powerbuilder6'],\n ['pbm', 'image/x-portable-bitmap'],\n ['pcap', 'application/vnd.tcpdump.pcap'],\n ['pcf', 'application/x-font-pcf'],\n ['pcl', 'application/vnd.hp-pcl'],\n ['pclxl', 'application/vnd.hp-pclxl'],\n ['pct', 'image/x-pict'],\n ['pcurl', 'application/vnd.curl.pcurl'],\n ['pcx', 'image/x-pcx'],\n ['pdb', 'application/x-pilot'],\n ['pde', 'text/x-processing'],\n ['pdf', 'application/pdf'],\n ['pem', 'application/x-x509-user-cert'],\n ['pfa', 'application/x-font-type1'],\n ['pfb', 'application/x-font-type1'],\n ['pfm', 'application/x-font-type1'],\n ['pfr', 'application/font-tdpfr'],\n ['pfx', 'application/x-pkcs12'],\n ['pgm', 'image/x-portable-graymap'],\n ['pgn', 'application/x-chess-pgn'],\n ['pgp', 'application/pgp'],\n ['php', 'application/x-httpd-php'],\n ['php3', 'application/x-httpd-php'],\n ['php4', 'application/x-httpd-php'],\n ['phps', 'application/x-httpd-php-source'],\n ['phtml', 'application/x-httpd-php'],\n ['pic', 'image/x-pict'],\n ['pkg', 'application/octet-stream'],\n ['pki', 'application/pkixcmp'],\n ['pkipath', 'application/pkix-pkipath'],\n ['pkpass', 'application/vnd.apple.pkpass'],\n ['pl', 'application/x-perl'],\n ['plb', 'application/vnd.3gpp.pic-bw-large'],\n ['plc', 'application/vnd.mobius.plc'],\n ['plf', 'application/vnd.pocketlearn'],\n ['pls', 'application/pls+xml'],\n ['pm', 'application/x-perl'],\n ['pml', 'application/vnd.ctc-posml'],\n ['png', 'image/png'],\n ['pnm', 'image/x-portable-anymap'],\n ['portpkg', 'application/vnd.macports.portpkg'],\n ['pot', 'application/vnd.ms-powerpoint'],\n ['potm', 'application/vnd.ms-powerpoint.presentation.macroEnabled.12'],\n ['potx', 'application/vnd.openxmlformats-officedocument.presentationml.template'],\n ['ppa', 'application/vnd.ms-powerpoint'],\n ['ppam', 'application/vnd.ms-powerpoint.addin.macroEnabled.12'],\n ['ppd', 'application/vnd.cups-ppd'],\n ['ppm', 'image/x-portable-pixmap'],\n ['pps', 'application/vnd.ms-powerpoint'],\n ['ppsm', 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12'],\n ['ppsx', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow'],\n ['ppt', 'application/powerpoint'],\n ['pptm', 'application/vnd.ms-powerpoint.presentation.macroEnabled.12'],\n ['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],\n ['pqa', 'application/vnd.palm'],\n ['prc', 'application/x-pilot'],\n ['pre', 'application/vnd.lotus-freelance'],\n ['prf', 'application/pics-rules'],\n ['provx', 'application/provenance+xml'],\n ['ps', 'application/postscript'],\n ['psb', 'application/vnd.3gpp.pic-bw-small'],\n ['psd', 'application/x-photoshop'],\n ['psf', 'application/x-font-linux-psf'],\n ['pskcxml', 'application/pskc+xml'],\n ['pti', 'image/prs.pti'],\n ['ptid', 'application/vnd.pvi.ptid1'],\n ['pub', 'application/x-mspublisher'],\n ['pvb', 'application/vnd.3gpp.pic-bw-var'],\n ['pwn', 'application/vnd.3m.post-it-notes'],\n ['pya', 'audio/vnd.ms-playready.media.pya'],\n ['pyv', 'video/vnd.ms-playready.media.pyv'],\n ['qam', 'application/vnd.epson.quickanime'],\n ['qbo', 'application/vnd.intu.qbo'],\n ['qfx', 'application/vnd.intu.qfx'],\n ['qps', 'application/vnd.publishare-delta-tree'],\n ['qt', 'video/quicktime'],\n ['qwd', 'application/vnd.quark.quarkxpress'],\n ['qwt', 'application/vnd.quark.quarkxpress'],\n ['qxb', 'application/vnd.quark.quarkxpress'],\n ['qxd', 'application/vnd.quark.quarkxpress'],\n ['qxl', 'application/vnd.quark.quarkxpress'],\n ['qxt', 'application/vnd.quark.quarkxpress'],\n ['ra', 'audio/x-realaudio'],\n ['ram', 'audio/x-pn-realaudio'],\n ['raml', 'application/raml+yaml'],\n ['rapd', 'application/route-apd+xml'],\n ['rar', 'application/x-rar'],\n ['ras', 'image/x-cmu-raster'],\n ['rcprofile', 'application/vnd.ipunplugged.rcprofile'],\n ['rdf', 'application/rdf+xml'],\n ['rdz', 'application/vnd.data-vision.rdz'],\n ['relo', 'application/p2p-overlay+xml'],\n ['rep', 'application/vnd.businessobjects'],\n ['res', 'application/x-dtbresource+xml'],\n ['rgb', 'image/x-rgb'],\n ['rif', 'application/reginfo+xml'],\n ['rip', 'audio/vnd.rip'],\n ['ris', 'application/x-research-info-systems'],\n ['rl', 'application/resource-lists+xml'],\n ['rlc', 'image/vnd.fujixerox.edmics-rlc'],\n ['rld', 'application/resource-lists-diff+xml'],\n ['rm', 'audio/x-pn-realaudio'],\n ['rmi', 'audio/midi'],\n ['rmp', 'audio/x-pn-realaudio-plugin'],\n ['rms', 'application/vnd.jcp.javame.midlet-rms'],\n ['rmvb', 'application/vnd.rn-realmedia-vbr'],\n ['rnc', 'application/relax-ng-compact-syntax'],\n ['rng', 'application/xml'],\n ['roa', 'application/rpki-roa'],\n ['roff', 'text/troff'],\n ['rp9', 'application/vnd.cloanto.rp9'],\n ['rpm', 'audio/x-pn-realaudio-plugin'],\n ['rpss', 'application/vnd.nokia.radio-presets'],\n ['rpst', 'application/vnd.nokia.radio-preset'],\n ['rq', 'application/sparql-query'],\n ['rs', 'application/rls-services+xml'],\n ['rsa', 'application/x-pkcs7'],\n ['rsat', 'application/atsc-rsat+xml'],\n ['rsd', 'application/rsd+xml'],\n ['rsheet', 'application/urc-ressheet+xml'],\n ['rss', 'application/rss+xml'],\n ['rtf', 'text/rtf'],\n ['rtx', 'text/richtext'],\n ['run', 'application/x-makeself'],\n ['rusd', 'application/route-usd+xml'],\n ['rv', 'video/vnd.rn-realvideo'],\n ['s', 'text/x-asm'],\n ['s3m', 'audio/s3m'],\n ['saf', 'application/vnd.yamaha.smaf-audio'],\n ['sass', 'text/x-sass'],\n ['sbml', 'application/sbml+xml'],\n ['sc', 'application/vnd.ibm.secure-container'],\n ['scd', 'application/x-msschedule'],\n ['scm', 'application/vnd.lotus-screencam'],\n ['scq', 'application/scvp-cv-request'],\n ['scs', 'application/scvp-cv-response'],\n ['scss', 'text/x-scss'],\n ['scurl', 'text/vnd.curl.scurl'],\n ['sda', 'application/vnd.stardivision.draw'],\n ['sdc', 'application/vnd.stardivision.calc'],\n ['sdd', 'application/vnd.stardivision.impress'],\n ['sdkd', 'application/vnd.solent.sdkm+xml'],\n ['sdkm', 'application/vnd.solent.sdkm+xml'],\n ['sdp', 'application/sdp'],\n ['sdw', 'application/vnd.stardivision.writer'],\n ['sea', 'application/octet-stream'],\n ['see', 'application/vnd.seemail'],\n ['seed', 'application/vnd.fdsn.seed'],\n ['sema', 'application/vnd.sema'],\n ['semd', 'application/vnd.semd'],\n ['semf', 'application/vnd.semf'],\n ['senmlx', 'application/senml+xml'],\n ['sensmlx', 'application/sensml+xml'],\n ['ser', 'application/java-serialized-object'],\n ['setpay', 'application/set-payment-initiation'],\n ['setreg', 'application/set-registration-initiation'],\n ['sfd-hdstx', 'application/vnd.hydrostatix.sof-data'],\n ['sfs', 'application/vnd.spotfire.sfs'],\n ['sfv', 'text/x-sfv'],\n ['sgi', 'image/sgi'],\n ['sgl', 'application/vnd.stardivision.writer-global'],\n ['sgm', 'text/sgml'],\n ['sgml', 'text/sgml'],\n ['sh', 'application/x-sh'],\n ['shar', 'application/x-shar'],\n ['shex', 'text/shex'],\n ['shf', 'application/shf+xml'],\n ['shtml', 'text/html'],\n ['sid', 'image/x-mrsid-image'],\n ['sieve', 'application/sieve'],\n ['sig', 'application/pgp-signature'],\n ['sil', 'audio/silk'],\n ['silo', 'model/mesh'],\n ['sis', 'application/vnd.symbian.install'],\n ['sisx', 'application/vnd.symbian.install'],\n ['sit', 'application/x-stuffit'],\n ['sitx', 'application/x-stuffitx'],\n ['siv', 'application/sieve'],\n ['skd', 'application/vnd.koan'],\n ['skm', 'application/vnd.koan'],\n ['skp', 'application/vnd.koan'],\n ['skt', 'application/vnd.koan'],\n ['sldm', 'application/vnd.ms-powerpoint.slide.macroenabled.12'],\n ['sldx', 'application/vnd.openxmlformats-officedocument.presentationml.slide'],\n ['slim', 'text/slim'],\n ['slm', 'text/slim'],\n ['sls', 'application/route-s-tsid+xml'],\n ['slt', 'application/vnd.epson.salt'],\n ['sm', 'application/vnd.stepmania.stepchart'],\n ['smf', 'application/vnd.stardivision.math'],\n ['smi', 'application/smil'],\n ['smil', 'application/smil'],\n ['smv', 'video/x-smv'],\n ['smzip', 'application/vnd.stepmania.package'],\n ['snd', 'audio/basic'],\n ['snf', 'application/x-font-snf'],\n ['so', 'application/octet-stream'],\n ['spc', 'application/x-pkcs7-certificates'],\n ['spdx', 'text/spdx'],\n ['spf', 'application/vnd.yamaha.smaf-phrase'],\n ['spl', 'application/x-futuresplash'],\n ['spot', 'text/vnd.in3d.spot'],\n ['spp', 'application/scvp-vp-response'],\n ['spq', 'application/scvp-vp-request'],\n ['spx', 'audio/ogg'],\n ['sql', 'application/x-sql'],\n ['src', 'application/x-wais-source'],\n ['srt', 'application/x-subrip'],\n ['sru', 'application/sru+xml'],\n ['srx', 'application/sparql-results+xml'],\n ['ssdl', 'application/ssdl+xml'],\n ['sse', 'application/vnd.kodak-descriptor'],\n ['ssf', 'application/vnd.epson.ssf'],\n ['ssml', 'application/ssml+xml'],\n ['sst', 'application/octet-stream'],\n ['st', 'application/vnd.sailingtracker.track'],\n ['stc', 'application/vnd.sun.xml.calc.template'],\n ['std', 'application/vnd.sun.xml.draw.template'],\n ['stf', 'application/vnd.wt.stf'],\n ['sti', 'application/vnd.sun.xml.impress.template'],\n ['stk', 'application/hyperstudio'],\n ['stl', 'model/stl'],\n ['stpx', 'model/step+xml'],\n ['stpxz', 'model/step-xml+zip'],\n ['stpz', 'model/step+zip'],\n ['str', 'application/vnd.pg.format'],\n ['stw', 'application/vnd.sun.xml.writer.template'],\n ['styl', 'text/stylus'],\n ['stylus', 'text/stylus'],\n ['sub', 'text/vnd.dvb.subtitle'],\n ['sus', 'application/vnd.sus-calendar'],\n ['susp', 'application/vnd.sus-calendar'],\n ['sv4cpio', 'application/x-sv4cpio'],\n ['sv4crc', 'application/x-sv4crc'],\n ['svc', 'application/vnd.dvb.service'],\n ['svd', 'application/vnd.svd'],\n ['svg', 'image/svg+xml'],\n ['svgz', 'image/svg+xml'],\n ['swa', 'application/x-director'],\n ['swf', 'application/x-shockwave-flash'],\n ['swi', 'application/vnd.aristanetworks.swi'],\n ['swidtag', 'application/swid+xml'],\n ['sxc', 'application/vnd.sun.xml.calc'],\n ['sxd', 'application/vnd.sun.xml.draw'],\n ['sxg', 'application/vnd.sun.xml.writer.global'],\n ['sxi', 'application/vnd.sun.xml.impress'],\n ['sxm', 'application/vnd.sun.xml.math'],\n ['sxw', 'application/vnd.sun.xml.writer'],\n ['t', 'text/troff'],\n ['t3', 'application/x-t3vm-image'],\n ['t38', 'image/t38'],\n ['taglet', 'application/vnd.mynfc'],\n ['tao', 'application/vnd.tao.intent-module-archive'],\n ['tap', 'image/vnd.tencent.tap'],\n ['tar', 'application/x-tar'],\n ['tcap', 'application/vnd.3gpp2.tcap'],\n ['tcl', 'application/x-tcl'],\n ['td', 'application/urc-targetdesc+xml'],\n ['teacher', 'application/vnd.smart.teacher'],\n ['tei', 'application/tei+xml'],\n ['teicorpus', 'application/tei+xml'],\n ['tex', 'application/x-tex'],\n ['texi', 'application/x-texinfo'],\n ['texinfo', 'application/x-texinfo'],\n ['text', 'text/plain'],\n ['tfi', 'application/thraud+xml'],\n ['tfm', 'application/x-tex-tfm'],\n ['tfx', 'image/tiff-fx'],\n ['tga', 'image/x-tga'],\n ['tgz', 'application/x-tar'],\n ['thmx', 'application/vnd.ms-officetheme'],\n ['tif', 'image/tiff'],\n ['tiff', 'image/tiff'],\n ['tk', 'application/x-tcl'],\n ['tmo', 'application/vnd.tmobile-livetv'],\n ['toml', 'application/toml'],\n ['torrent', 'application/x-bittorrent'],\n ['tpl', 'application/vnd.groove-tool-template'],\n ['tpt', 'application/vnd.trid.tpt'],\n ['tr', 'text/troff'],\n ['tra', 'application/vnd.trueapp'],\n ['trig', 'application/trig'],\n ['trm', 'application/x-msterminal'],\n ['ts', 'video/mp2t'],\n ['tsd', 'application/timestamped-data'],\n ['tsv', 'text/tab-separated-values'],\n ['ttc', 'font/collection'],\n ['ttf', 'font/ttf'],\n ['ttl', 'text/turtle'],\n ['ttml', 'application/ttml+xml'],\n ['twd', 'application/vnd.simtech-mindmapper'],\n ['twds', 'application/vnd.simtech-mindmapper'],\n ['txd', 'application/vnd.genomatix.tuxedo'],\n ['txf', 'application/vnd.mobius.txf'],\n ['txt', 'text/plain'],\n ['u8dsn', 'message/global-delivery-status'],\n ['u8hdr', 'message/global-headers'],\n ['u8mdn', 'message/global-disposition-notification'],\n ['u8msg', 'message/global'],\n ['u32', 'application/x-authorware-bin'],\n ['ubj', 'application/ubjson'],\n ['udeb', 'application/x-debian-package'],\n ['ufd', 'application/vnd.ufdl'],\n ['ufdl', 'application/vnd.ufdl'],\n ['ulx', 'application/x-glulx'],\n ['umj', 'application/vnd.umajin'],\n ['unityweb', 'application/vnd.unity'],\n ['uoml', 'application/vnd.uoml+xml'],\n ['uri', 'text/uri-list'],\n ['uris', 'text/uri-list'],\n ['urls', 'text/uri-list'],\n ['usdz', 'model/vnd.usdz+zip'],\n ['ustar', 'application/x-ustar'],\n ['utz', 'application/vnd.uiq.theme'],\n ['uu', 'text/x-uuencode'],\n ['uva', 'audio/vnd.dece.audio'],\n ['uvd', 'application/vnd.dece.data'],\n ['uvf', 'application/vnd.dece.data'],\n ['uvg', 'image/vnd.dece.graphic'],\n ['uvh', 'video/vnd.dece.hd'],\n ['uvi', 'image/vnd.dece.graphic'],\n ['uvm', 'video/vnd.dece.mobile'],\n ['uvp', 'video/vnd.dece.pd'],\n ['uvs', 'video/vnd.dece.sd'],\n ['uvt', 'application/vnd.dece.ttml+xml'],\n ['uvu', 'video/vnd.uvvu.mp4'],\n ['uvv', 'video/vnd.dece.video'],\n ['uvva', 'audio/vnd.dece.audio'],\n ['uvvd', 'application/vnd.dece.data'],\n ['uvvf', 'application/vnd.dece.data'],\n ['uvvg', 'image/vnd.dece.graphic'],\n ['uvvh', 'video/vnd.dece.hd'],\n ['uvvi', 'image/vnd.dece.graphic'],\n ['uvvm', 'video/vnd.dece.mobile'],\n ['uvvp', 'video/vnd.dece.pd'],\n ['uvvs', 'video/vnd.dece.sd'],\n ['uvvt', 'application/vnd.dece.ttml+xml'],\n ['uvvu', 'video/vnd.uvvu.mp4'],\n ['uvvv', 'video/vnd.dece.video'],\n ['uvvx', 'application/vnd.dece.unspecified'],\n ['uvvz', 'application/vnd.dece.zip'],\n ['uvx', 'application/vnd.dece.unspecified'],\n ['uvz', 'application/vnd.dece.zip'],\n ['vbox', 'application/x-virtualbox-vbox'],\n ['vbox-extpack', 'application/x-virtualbox-vbox-extpack'],\n ['vcard', 'text/vcard'],\n ['vcd', 'application/x-cdlink'],\n ['vcf', 'text/x-vcard'],\n ['vcg', 'application/vnd.groove-vcard'],\n ['vcs', 'text/x-vcalendar'],\n ['vcx', 'application/vnd.vcx'],\n ['vdi', 'application/x-virtualbox-vdi'],\n ['vds', 'model/vnd.sap.vds'],\n ['vhd', 'application/x-virtualbox-vhd'],\n ['vis', 'application/vnd.visionary'],\n ['viv', 'video/vnd.vivo'],\n ['vlc', 'application/videolan'],\n ['vmdk', 'application/x-virtualbox-vmdk'],\n ['vob', 'video/x-ms-vob'],\n ['vor', 'application/vnd.stardivision.writer'],\n ['vox', 'application/x-authorware-bin'],\n ['vrml', 'model/vrml'],\n ['vsd', 'application/vnd.visio'],\n ['vsf', 'application/vnd.vsf'],\n ['vss', 'application/vnd.visio'],\n ['vst', 'application/vnd.visio'],\n ['vsw', 'application/vnd.visio'],\n ['vtf', 'image/vnd.valve.source.texture'],\n ['vtt', 'text/vtt'],\n ['vtu', 'model/vnd.vtu'],\n ['vxml', 'application/voicexml+xml'],\n ['w3d', 'application/x-director'],\n ['wad', 'application/x-doom'],\n ['wadl', 'application/vnd.sun.wadl+xml'],\n ['war', 'application/java-archive'],\n ['wasm', 'application/wasm'],\n ['wav', 'audio/x-wav'],\n ['wax', 'audio/x-ms-wax'],\n ['wbmp', 'image/vnd.wap.wbmp'],\n ['wbs', 'application/vnd.criticaltools.wbs+xml'],\n ['wbxml', 'application/wbxml'],\n ['wcm', 'application/vnd.ms-works'],\n ['wdb', 'application/vnd.ms-works'],\n ['wdp', 'image/vnd.ms-photo'],\n ['weba', 'audio/webm'],\n ['webapp', 'application/x-web-app-manifest+json'],\n ['webm', 'video/webm'],\n ['webmanifest', 'application/manifest+json'],\n ['webp', 'image/webp'],\n ['wg', 'application/vnd.pmi.widget'],\n ['wgt', 'application/widget'],\n ['wks', 'application/vnd.ms-works'],\n ['wm', 'video/x-ms-wm'],\n ['wma', 'audio/x-ms-wma'],\n ['wmd', 'application/x-ms-wmd'],\n ['wmf', 'image/wmf'],\n ['wml', 'text/vnd.wap.wml'],\n ['wmlc', 'application/wmlc'],\n ['wmls', 'text/vnd.wap.wmlscript'],\n ['wmlsc', 'application/vnd.wap.wmlscriptc'],\n ['wmv', 'video/x-ms-wmv'],\n ['wmx', 'video/x-ms-wmx'],\n ['wmz', 'application/x-msmetafile'],\n ['woff', 'font/woff'],\n ['woff2', 'font/woff2'],\n ['word', 'application/msword'],\n ['wpd', 'application/vnd.wordperfect'],\n ['wpl', 'application/vnd.ms-wpl'],\n ['wps', 'application/vnd.ms-works'],\n ['wqd', 'application/vnd.wqd'],\n ['wri', 'application/x-mswrite'],\n ['wrl', 'model/vrml'],\n ['wsc', 'message/vnd.wfa.wsc'],\n ['wsdl', 'application/wsdl+xml'],\n ['wspolicy', 'application/wspolicy+xml'],\n ['wtb', 'application/vnd.webturbo'],\n ['wvx', 'video/x-ms-wvx'],\n ['x3d', 'model/x3d+xml'],\n ['x3db', 'model/x3d+fastinfoset'],\n ['x3dbz', 'model/x3d+binary'],\n ['x3dv', 'model/x3d-vrml'],\n ['x3dvz', 'model/x3d+vrml'],\n ['x3dz', 'model/x3d+xml'],\n ['x32', 'application/x-authorware-bin'],\n ['x_b', 'model/vnd.parasolid.transmit.binary'],\n ['x_t', 'model/vnd.parasolid.transmit.text'],\n ['xaml', 'application/xaml+xml'],\n ['xap', 'application/x-silverlight-app'],\n ['xar', 'application/vnd.xara'],\n ['xav', 'application/xcap-att+xml'],\n ['xbap', 'application/x-ms-xbap'],\n ['xbd', 'application/vnd.fujixerox.docuworks.binder'],\n ['xbm', 'image/x-xbitmap'],\n ['xca', 'application/xcap-caps+xml'],\n ['xcs', 'application/calendar+xml'],\n ['xdf', 'application/xcap-diff+xml'],\n ['xdm', 'application/vnd.syncml.dm+xml'],\n ['xdp', 'application/vnd.adobe.xdp+xml'],\n ['xdssc', 'application/dssc+xml'],\n ['xdw', 'application/vnd.fujixerox.docuworks'],\n ['xel', 'application/xcap-el+xml'],\n ['xenc', 'application/xenc+xml'],\n ['xer', 'application/patch-ops-error+xml'],\n ['xfdf', 'application/vnd.adobe.xfdf'],\n ['xfdl', 'application/vnd.xfdl'],\n ['xht', 'application/xhtml+xml'],\n ['xhtml', 'application/xhtml+xml'],\n ['xhvml', 'application/xv+xml'],\n ['xif', 'image/vnd.xiff'],\n ['xl', 'application/excel'],\n ['xla', 'application/vnd.ms-excel'],\n ['xlam', 'application/vnd.ms-excel.addin.macroEnabled.12'],\n ['xlc', 'application/vnd.ms-excel'],\n ['xlf', 'application/xliff+xml'],\n ['xlm', 'application/vnd.ms-excel'],\n ['xls', 'application/vnd.ms-excel'],\n ['xlsb', 'application/vnd.ms-excel.sheet.binary.macroEnabled.12'],\n ['xlsm', 'application/vnd.ms-excel.sheet.macroEnabled.12'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xlt', 'application/vnd.ms-excel'],\n ['xltm', 'application/vnd.ms-excel.template.macroEnabled.12'],\n ['xltx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'],\n ['xlw', 'application/vnd.ms-excel'],\n ['xm', 'audio/xm'],\n ['xml', 'application/xml'],\n ['xns', 'application/xcap-ns+xml'],\n ['xo', 'application/vnd.olpc-sugar'],\n ['xop', 'application/xop+xml'],\n ['xpi', 'application/x-xpinstall'],\n ['xpl', 'application/xproc+xml'],\n ['xpm', 'image/x-xpixmap'],\n ['xpr', 'application/vnd.is-xpr'],\n ['xps', 'application/vnd.ms-xpsdocument'],\n ['xpw', 'application/vnd.intercon.formnet'],\n ['xpx', 'application/vnd.intercon.formnet'],\n ['xsd', 'application/xml'],\n ['xsl', 'application/xml'],\n ['xslt', 'application/xslt+xml'],\n ['xsm', 'application/vnd.syncml+xml'],\n ['xspf', 'application/xspf+xml'],\n ['xul', 'application/vnd.mozilla.xul+xml'],\n ['xvm', 'application/xv+xml'],\n ['xvml', 'application/xv+xml'],\n ['xwd', 'image/x-xwindowdump'],\n ['xyz', 'chemical/x-xyz'],\n ['xz', 'application/x-xz'],\n ['yaml', 'text/yaml'],\n ['yang', 'application/yang'],\n ['yin', 'application/yin+xml'],\n ['yml', 'text/yaml'],\n ['ymp', 'text/x-suse-ymp'],\n ['z', 'application/x-compress'],\n ['z1', 'application/x-zmachine'],\n ['z2', 'application/x-zmachine'],\n ['z3', 'application/x-zmachine'],\n ['z4', 'application/x-zmachine'],\n ['z5', 'application/x-zmachine'],\n ['z6', 'application/x-zmachine'],\n ['z7', 'application/x-zmachine'],\n ['z8', 'application/x-zmachine'],\n ['zaz', 'application/vnd.zzazz.deck+xml'],\n ['zip', 'application/zip'],\n ['zir', 'application/vnd.zul'],\n ['zirz', 'application/vnd.zul'],\n ['zmm', 'application/vnd.handheld-entertainment+xml'],\n ['zsh', 'text/x-scriptzsh']\n]);\n\n\nexport function toFileWithPath(file: FileWithPath, path?: string, h?: FileSystemHandle): FileWithPath {\n const f = withMimeType(file);\n const {webkitRelativePath} = file;\n const p = typeof path === 'string'\n ? path\n // If is set,\n // the File will have a {webkitRelativePath} property\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory\n : typeof webkitRelativePath === 'string' && webkitRelativePath.length > 0\n ? webkitRelativePath\n : `./${file.name}`;\n if (typeof f.path !== 'string') { // on electron, path is already set to the absolute path\n setObjProp(f, 'path', p);\n }\n if (h !== undefined) {\n Object.defineProperty(f, 'handle', {\n value: h,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n // Always populate a relative path so that even electron apps have access to a relativePath value\n setObjProp(f, 'relativePath', p);\n return f;\n}\n\nexport interface FileWithPath extends File {\n readonly path?: string;\n readonly handle?: FileSystemFileHandle;\n readonly relativePath?: string;\n}\n\nfunction withMimeType(file: FileWithPath) {\n const {name} = file;\n const hasExtension = name && name.lastIndexOf('.') !== -1;\n\n if (hasExtension && !file.type) {\n const ext = name.split('.')\n .pop()!.toLowerCase();\n const type = COMMON_MIME_TYPES.get(ext);\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n\n return file;\n}\n\nfunction setObjProp(f: FileWithPath, key: string, value: string) {\n Object.defineProperty(f, key, {\n value,\n writable: false,\n configurable: false,\n enumerable: true\n })\n}\n","import {FileWithPath, toFileWithPath} from './file';\n\n\nconst FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store', // macOs\n 'Thumbs.db' // Windows\n];\n\n\n/**\n * Convert a DragEvent's DataTrasfer object to a list of File objects\n * NOTE: If some of the items are folders,\n * everything will be flattened and placed in the same list but the paths will be kept as a {path} property.\n *\n * EXPERIMENTAL: A list of https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle objects can also be passed as an arg\n * and a list of File objects will be returned.\n *\n * @param evt\n */\nexport async function fromEvent(evt: Event | any): Promise<(FileWithPath | DataTransferItem)[]> {\n if (isObject(evt) && isDataTransfer(evt.dataTransfer)) {\n return getDataTransferFiles(evt.dataTransfer, evt.type);\n } else if (isChangeEvt(evt)) {\n return getInputFiles(evt);\n } else if (Array.isArray(evt) && evt.every(item => 'getFile' in item && typeof item.getFile === 'function')) {\n return getFsHandleFiles(evt)\n }\n return [];\n}\n\nfunction isDataTransfer(value: any): value is DataTransfer {\n return isObject(value);\n}\n\nfunction isChangeEvt(value: any): value is Event {\n return isObject(value) && isObject(value.target);\n}\n\nfunction isObject(v: any): v is T {\n return typeof v === 'object' && v !== null\n}\n\nfunction getInputFiles(evt: Event) {\n return fromList((evt.target as HTMLInputElement).files).map(file => toFileWithPath(file));\n}\n\n// Ee expect each handle to be https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle\nasync function getFsHandleFiles(handles: any[]) {\n const files = await Promise.all(handles.map(h => h.getFile()));\n return files.map(file => toFileWithPath(file));\n}\n\n\nasync function getDataTransferFiles(dt: DataTransfer, type: string) {\n // IE11 does not support dataTransfer.items\n // See https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/items#Browser_compatibility\n if (dt.items) {\n const items = fromList(dt.items)\n .filter(item => item.kind === 'file');\n // According to https://html.spec.whatwg.org/multipage/dnd.html#dndevents,\n // only 'dragstart' and 'drop' has access to the data (source node)\n if (type !== 'drop') {\n return items;\n }\n const files = await Promise.all(items.map(toFilePromises));\n return noIgnoredFiles(flatten(files));\n }\n\n return noIgnoredFiles(fromList(dt.files)\n .map(file => toFileWithPath(file)));\n}\n\nfunction noIgnoredFiles(files: FileWithPath[]) {\n return files.filter(file => FILES_TO_IGNORE.indexOf(file.name) === -1);\n}\n\n// IE11 does not support Array.from()\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Browser_compatibility\n// https://developer.mozilla.org/en-US/docs/Web/API/FileList\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList\nfunction fromList(items: DataTransferItemList | FileList | null): T[] {\n if (items === null) {\n return [];\n }\n\n const files = [];\n\n // tslint:disable: prefer-for-of\n for (let i = 0; i < items.length; i++) {\n const file = items[i];\n files.push(file);\n }\n\n return files as any;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem\nfunction toFilePromises(item: DataTransferItem) {\n if (typeof item.webkitGetAsEntry !== 'function') {\n return fromDataTransferItem(item);\n }\n\n const entry = item.webkitGetAsEntry();\n\n // Safari supports dropping an image node from a different window and can be retrieved using\n // the DataTransferItem.getAsFile() API\n // NOTE: FileSystemEntry.file() throws if trying to get the file\n if (entry && entry.isDirectory) {\n return fromDirEntry(entry) as any;\n }\n\n return fromDataTransferItem(item, entry);\n}\n\nfunction flatten(items: any[]): T[] {\n return items.reduce((acc, files) => [\n ...acc,\n ...(Array.isArray(files) ? flatten(files) : [files])\n ], []);\n}\n\nfunction fromDataTransferItem(item: DataTransferItem, entry?: FileSystemEntry | null) {\n if (typeof (item as any).getAsFileSystemHandle === 'function') {\n return (item as any).getAsFileSystemHandle()\n .then(async (h: any) => {\n const file = await h.getFile();\n file.handle = h;\n return toFileWithPath(file);\n });\n }\n const file = item.getAsFile();\n if (!file) {\n return Promise.reject(`${item} is not a File`);\n }\n const fwp = toFileWithPath(file, entry?.fullPath ?? undefined);\n return Promise.resolve(fwp);\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry\nasync function fromEntry(entry: any) {\n return entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry);\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry\nfunction fromDirEntry(entry: any) {\n const reader = entry.createReader();\n\n return new Promise((resolve, reject) => {\n const entries: Promise[] = [];\n\n function readEntries() {\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry/createReader\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader/readEntries\n reader.readEntries(async (batch: any[]) => {\n if (!batch.length) {\n // Done reading directory\n try {\n const files = await Promise.all(entries);\n resolve(files);\n } catch (err) {\n reject(err);\n }\n } else {\n const items = Promise.all(batch.map(fromEntry));\n entries.push(items);\n\n // Continue reading\n readEntries();\n }\n }, (err: any) => {\n reject(err);\n });\n }\n\n readEntries();\n });\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry\nasync function fromFileEntry(entry: any) {\n return new Promise((resolve, reject) => {\n entry.file((file: FileWithPath) => {\n const fwp = toFileWithPath(file, entry.fullPath);\n resolve(fwp);\n }, (err: any) => {\n reject(err);\n });\n });\n}\n\n// Infinite type recursion\n// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540\ninterface FileArray extends Array {}\ntype FileValue = FileWithPath\n | FileArray[];\n","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport _accepts from \"attr-accept\";\nvar accepts = typeof _accepts === \"function\" ? _accepts : _accepts.default; // Error codes\n\nexport var FILE_INVALID_TYPE = \"file-invalid-type\";\nexport var FILE_TOO_LARGE = \"file-too-large\";\nexport var FILE_TOO_SMALL = \"file-too-small\";\nexport var TOO_MANY_FILES = \"too-many-files\";\nexport var ErrorCode = {\n FileInvalidType: FILE_INVALID_TYPE,\n FileTooLarge: FILE_TOO_LARGE,\n FileTooSmall: FILE_TOO_SMALL,\n TooManyFiles: TOO_MANY_FILES\n};\n/**\n *\n * @param {string} accept\n */\n\nexport var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr() {\n var accept = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"\";\n var acceptArr = accept.split(\",\");\n var msg = acceptArr.length > 1 ? \"one of \".concat(acceptArr.join(\", \")) : acceptArr[0];\n return {\n code: FILE_INVALID_TYPE,\n message: \"File type must be \".concat(msg)\n };\n};\nexport var getTooLargeRejectionErr = function getTooLargeRejectionErr(maxSize) {\n return {\n code: FILE_TOO_LARGE,\n message: \"File is larger than \".concat(maxSize, \" \").concat(maxSize === 1 ? \"byte\" : \"bytes\")\n };\n};\nexport var getTooSmallRejectionErr = function getTooSmallRejectionErr(minSize) {\n return {\n code: FILE_TOO_SMALL,\n message: \"File is smaller than \".concat(minSize, \" \").concat(minSize === 1 ? \"byte\" : \"bytes\")\n };\n};\nexport var TOO_MANY_FILES_REJECTION = {\n code: TOO_MANY_FILES,\n message: \"Too many files\"\n};\n/**\n * Check if file is accepted.\n *\n * Firefox versions prior to 53 return a bogus MIME type for every file drag,\n * so dragovers with that MIME type will always be accepted.\n *\n * @param {File} file\n * @param {string} accept\n * @returns\n */\n\nexport function fileAccepted(file, accept) {\n var isAcceptable = file.type === \"application/x-moz-file\" || accepts(file, accept);\n return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];\n}\nexport function fileMatchSize(file, minSize, maxSize) {\n if (isDefined(file.size)) {\n if (isDefined(minSize) && isDefined(maxSize)) {\n if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];\n } else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n }\n\n return [true, null];\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n/**\n *\n * @param {object} options\n * @param {File[]} options.files\n * @param {string} [options.accept]\n * @param {number} [options.minSize]\n * @param {number} [options.maxSize]\n * @param {boolean} [options.multiple]\n * @param {number} [options.maxFiles]\n * @param {(f: File) => FileError|FileError[]|null} [options.validator]\n * @returns\n */\n\n\nexport function allFilesAccepted(_ref) {\n var files = _ref.files,\n accept = _ref.accept,\n minSize = _ref.minSize,\n maxSize = _ref.maxSize,\n multiple = _ref.multiple,\n maxFiles = _ref.maxFiles,\n validator = _ref.validator;\n\n if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {\n return false;\n }\n\n return files.every(function (file) {\n var _fileAccepted = fileAccepted(file, accept),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 1),\n accepted = _fileAccepted2[0];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 1),\n sizeMatch = _fileMatchSize2[0];\n\n var customErrors = validator ? validator(file) : null;\n return accepted && sizeMatch && !customErrors;\n });\n} // React's synthetic events has event.isPropagationStopped,\n// but to remain compatibility with other libs (Preact) fall back\n// to check event.cancelBubble\n\nexport function isPropagationStopped(event) {\n if (typeof event.isPropagationStopped === \"function\") {\n return event.isPropagationStopped();\n } else if (typeof event.cancelBubble !== \"undefined\") {\n return event.cancelBubble;\n }\n\n return false;\n}\nexport function isEvtWithFiles(event) {\n if (!event.dataTransfer) {\n return !!event.target && !!event.target.files;\n } // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file\n\n\n return Array.prototype.some.call(event.dataTransfer.types, function (type) {\n return type === \"Files\" || type === \"application/x-moz-file\";\n });\n}\nexport function isKindFile(item) {\n return _typeof(item) === \"object\" && item !== null && item.kind === \"file\";\n} // allow the entire document to be a drag target\n\nexport function onDocumentDragOver(event) {\n event.preventDefault();\n}\n\nfunction isIe(userAgent) {\n return userAgent.indexOf(\"MSIE\") !== -1 || userAgent.indexOf(\"Trident/\") !== -1;\n}\n\nfunction isEdge(userAgent) {\n return userAgent.indexOf(\"Edge/\") !== -1;\n}\n\nexport function isIeOrEdge() {\n var userAgent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.navigator.userAgent;\n return isIe(userAgent) || isEdge(userAgent);\n}\n/**\n * This is intended to be used to compose event handlers\n * They are executed in order until one of them calls `event.isPropagationStopped()`.\n * Note that the check is done on the first invoke too,\n * meaning that if propagation was stopped before invoking the fns,\n * no handlers will be executed.\n *\n * @param {Function} fns the event hanlder functions\n * @return {Function} the event handler to add to an element\n */\n\nexport function composeEventHandlers() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return fns.some(function (fn) {\n if (!isPropagationStopped(event) && fn) {\n fn.apply(void 0, [event].concat(args));\n }\n\n return isPropagationStopped(event);\n });\n };\n}\n/**\n * canUseFileSystemAccessAPI checks if the [File System Access API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API)\n * is supported by the browser.\n * @returns {boolean}\n */\n\nexport function canUseFileSystemAccessAPI() {\n return \"showOpenFilePicker\" in window;\n}\n/**\n * Convert the `{accept}` dropzone prop to the\n * `{types}` option for https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker\n *\n * @param {AcceptProp} accept\n * @returns {{accept: string[]}[]}\n */\n\nexport function pickerOptionsFromAccept(accept) {\n if (isDefined(accept)) {\n var acceptForPicker = Object.entries(accept).filter(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n mimeType = _ref3[0],\n ext = _ref3[1];\n\n var ok = true;\n\n if (!isMIMEType(mimeType)) {\n console.warn(\"Skipped \\\"\".concat(mimeType, \"\\\" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.\"));\n ok = false;\n }\n\n if (!Array.isArray(ext) || !ext.every(isExt)) {\n console.warn(\"Skipped \\\"\".concat(mimeType, \"\\\" because an invalid file extension was provided.\"));\n ok = false;\n }\n\n return ok;\n }).reduce(function (agg, _ref4) {\n var _ref5 = _slicedToArray(_ref4, 2),\n mimeType = _ref5[0],\n ext = _ref5[1];\n\n return _objectSpread(_objectSpread({}, agg), {}, _defineProperty({}, mimeType, ext));\n }, {});\n return [{\n // description is required due to https://crbug.com/1264708\n description: \"Files\",\n accept: acceptForPicker\n }];\n }\n\n return accept;\n}\n/**\n * Convert the `{accept}` dropzone prop to an array of MIME types/extensions.\n * @param {AcceptProp} accept\n * @returns {string}\n */\n\nexport function acceptPropAsAcceptAttr(accept) {\n if (isDefined(accept)) {\n return Object.entries(accept).reduce(function (a, _ref6) {\n var _ref7 = _slicedToArray(_ref6, 2),\n mimeType = _ref7[0],\n ext = _ref7[1];\n\n return [].concat(_toConsumableArray(a), [mimeType], _toConsumableArray(ext));\n }, []) // Silently discard invalid entries as pickerOptionsFromAccept warns about these\n .filter(function (v) {\n return isMIMEType(v) || isExt(v);\n }).join(\",\");\n }\n\n return undefined;\n}\n/**\n * Check if v is an exception caused by aborting a request (e.g window.showOpenFilePicker()).\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.\n * @param {any} v\n * @returns {boolean} True if v is an abort exception.\n */\n\nexport function isAbort(v) {\n return v instanceof DOMException && (v.name === \"AbortError\" || v.code === v.ABORT_ERR);\n}\n/**\n * Check if v is a security error.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.\n * @param {any} v\n * @returns {boolean} True if v is a security error.\n */\n\nexport function isSecurityError(v) {\n return v instanceof DOMException && (v.name === \"SecurityError\" || v.code === v.SECURITY_ERR);\n}\n/**\n * Check if v is a MIME type string.\n *\n * See accepted format: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers.\n *\n * @param {string} v\n */\n\nexport function isMIMEType(v) {\n return v === \"audio/*\" || v === \"video/*\" || v === \"image/*\" || v === \"text/*\" || v === \"application/*\" || /\\w+\\/[-+.\\w]+/g.test(v);\n}\n/**\n * Check if v is a file extension.\n * @param {string} v\n */\n\nexport function isExt(v) {\n return /^.*\\.[\\w]+$/.test(v);\n}\n/**\n * @typedef {Object.} AcceptProp\n */\n\n/**\n * @typedef {object} FileError\n * @property {string} message\n * @property {ErrorCode|string} code\n */\n\n/**\n * @typedef {\"file-invalid-type\"|\"file-too-large\"|\"file-too-small\"|\"too-many-files\"} ErrorCode\n */","var _excluded = [\"children\"],\n _excluded2 = [\"open\"],\n _excluded3 = [\"refKey\", \"role\", \"onKeyDown\", \"onFocus\", \"onBlur\", \"onClick\", \"onDragEnter\", \"onDragOver\", \"onDragLeave\", \"onDrop\"],\n _excluded4 = [\"refKey\", \"onChange\", \"onClick\"];\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* eslint prefer-template: 0 */\nimport React, { forwardRef, Fragment, useCallback, useEffect, useImperativeHandle, useMemo, useReducer, useRef } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { fromEvent } from \"file-selector\";\nimport { acceptPropAsAcceptAttr, allFilesAccepted, composeEventHandlers, fileAccepted, fileMatchSize, canUseFileSystemAccessAPI, isAbort, isEvtWithFiles, isIeOrEdge, isPropagationStopped, isSecurityError, onDocumentDragOver, pickerOptionsFromAccept, TOO_MANY_FILES_REJECTION } from \"./utils/index\";\n/**\n * Convenience wrapper component for the `useDropzone` hook\n *\n * ```jsx\n * \n * {({getRootProps, getInputProps}) => (\n *
\n * \n *

Drag 'n' drop some files here, or click to select files

\n *
\n * )}\n *
\n * ```\n */\n\nvar Dropzone = /*#__PURE__*/forwardRef(function (_ref, ref) {\n var children = _ref.children,\n params = _objectWithoutProperties(_ref, _excluded);\n\n var _useDropzone = useDropzone(params),\n open = _useDropzone.open,\n props = _objectWithoutProperties(_useDropzone, _excluded2);\n\n useImperativeHandle(ref, function () {\n return {\n open: open\n };\n }, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element\n\n return /*#__PURE__*/React.createElement(Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, {\n open: open\n })));\n});\nDropzone.displayName = \"Dropzone\"; // Add default props for react-docgen\n\nvar defaultProps = {\n disabled: false,\n getFilesFromEvent: fromEvent,\n maxSize: Infinity,\n minSize: 0,\n multiple: true,\n maxFiles: 0,\n preventDropOnDocument: true,\n noClick: false,\n noKeyboard: false,\n noDrag: false,\n noDragEventsBubbling: false,\n validator: null,\n useFsAccessApi: false,\n autoFocus: false\n};\nDropzone.defaultProps = defaultProps;\nDropzone.propTypes = {\n /**\n * Render function that exposes the dropzone state and prop getter fns\n *\n * @param {object} params\n * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render\n * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render\n * @param {Function} params.open Open the native file selection dialog\n * @param {boolean} params.isFocused Dropzone area is in focus\n * @param {boolean} params.isFileDialogActive File dialog is opened\n * @param {boolean} params.isDragActive Active drag is in progress\n * @param {boolean} params.isDragAccept Dragged files are accepted\n * @param {boolean} params.isDragReject Some dragged files are rejected\n * @param {File[]} params.acceptedFiles Accepted files\n * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected\n */\n children: PropTypes.func,\n\n /**\n * Set accepted file types.\n * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).\n */\n accept: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)),\n\n /**\n * Allow drag 'n' drop (or selection from the file dialog) of multiple files\n */\n multiple: PropTypes.bool,\n\n /**\n * If false, allow dropped items to take over the current browser window\n */\n preventDropOnDocument: PropTypes.bool,\n\n /**\n * If true, disables click to open the native file selection dialog\n */\n noClick: PropTypes.bool,\n\n /**\n * If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n */\n noKeyboard: PropTypes.bool,\n\n /**\n * If true, disables drag 'n' drop\n */\n noDrag: PropTypes.bool,\n\n /**\n * If true, stops drag event propagation to parents\n */\n noDragEventsBubbling: PropTypes.bool,\n\n /**\n * Minimum file size (in bytes)\n */\n minSize: PropTypes.number,\n\n /**\n * Maximum file size (in bytes)\n */\n maxSize: PropTypes.number,\n\n /**\n * Maximum accepted number of files\n * The default value is 0 which means there is no limitation to how many files are accepted.\n */\n maxFiles: PropTypes.number,\n\n /**\n * Enable/disable the dropzone\n */\n disabled: PropTypes.bool,\n\n /**\n * Use this to provide a custom file aggregator\n *\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n getFilesFromEvent: PropTypes.func,\n\n /**\n * Cb for when closing the file dialog with no selection\n */\n onFileDialogCancel: PropTypes.func,\n\n /**\n * Cb for when opening the file dialog\n */\n onFileDialogOpen: PropTypes.func,\n\n /**\n * Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `` click event.\n */\n useFsAccessApi: PropTypes.bool,\n\n /**\n * Set to true to focus the root element on render\n */\n autoFocus: PropTypes.bool,\n\n /**\n * Cb for when the `dragenter` event occurs.\n *\n * @param {DragEvent} event\n */\n onDragEnter: PropTypes.func,\n\n /**\n * Cb for when the `dragleave` event occurs\n *\n * @param {DragEvent} event\n */\n onDragLeave: PropTypes.func,\n\n /**\n * Cb for when the `dragover` event occurs\n *\n * @param {DragEvent} event\n */\n onDragOver: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n *\n * @param {File[]} acceptedFiles\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n onDrop: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are accepted, this callback is not invoked.\n *\n * @param {File[]} files\n * @param {(DragEvent|Event)} event\n */\n onDropAccepted: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are rejected, this callback is not invoked.\n *\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event\n */\n onDropRejected: PropTypes.func,\n\n /**\n * Cb for when there's some error from any of the promises.\n *\n * @param {Error} error\n */\n onError: PropTypes.func,\n\n /**\n * Custom validation function. It must return null if there's no errors.\n * @param {File} file\n * @returns {FileError|FileError[]|null}\n */\n validator: PropTypes.func\n};\nexport default Dropzone;\n/**\n * A function that is invoked for the `dragenter`,\n * `dragover` and `dragleave` events.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dragCb\n * @param {DragEvent} event\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dropCb\n * @param {File[]} acceptedFiles List of accepted files\n * @param {FileRejection[]} fileRejections List of rejected files and why they were rejected\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are files (such as link, text, etc.).\n *\n * @callback dropAcceptedCb\n * @param {File[]} files List of accepted files that meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n *\n * @callback dropRejectedCb\n * @param {File[]} files List of rejected files that do not meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is used aggregate files,\n * in a asynchronous fashion, from drag or input change events.\n *\n * @callback getFilesFromEvent\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n * @returns {(File[]|Promise)}\n */\n\n/**\n * An object with the current dropzone state.\n *\n * @typedef {object} DropzoneState\n * @property {boolean} isFocused Dropzone area is in focus\n * @property {boolean} isFileDialogActive File dialog is opened\n * @property {boolean} isDragActive Active drag is in progress\n * @property {boolean} isDragAccept Dragged files are accepted\n * @property {boolean} isDragReject Some dragged files are rejected\n * @property {File[]} acceptedFiles Accepted files\n * @property {FileRejection[]} fileRejections Rejected files and why they were rejected\n */\n\n/**\n * An object with the dropzone methods.\n *\n * @typedef {object} DropzoneMethods\n * @property {Function} getRootProps Returns the props you should apply to the root drop container you render\n * @property {Function} getInputProps Returns the props you should apply to hidden file input you render\n * @property {Function} open Open the native file selection dialog\n */\n\nvar initialState = {\n isFocused: false,\n isFileDialogActive: false,\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false,\n acceptedFiles: [],\n fileRejections: []\n};\n/**\n * A React hook that creates a drag 'n' drop area.\n *\n * ```jsx\n * function MyDropzone(props) {\n * const {getRootProps, getInputProps} = useDropzone({\n * onDrop: acceptedFiles => {\n * // do something with the File objects, e.g. upload to some server\n * }\n * });\n * return (\n *
\n * \n *

Drag and drop some files here, or click to select files

\n *
\n * )\n * }\n * ```\n *\n * @function useDropzone\n *\n * @param {object} props\n * @param {import(\"./utils\").AcceptProp} [props.accept] Set accepted file types.\n * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).\n * @param {boolean} [props.multiple=true] Allow drag 'n' drop (or selection from the file dialog) of multiple files\n * @param {boolean} [props.preventDropOnDocument=true] If false, allow dropped items to take over the current browser window\n * @param {boolean} [props.noClick=false] If true, disables click to open the native file selection dialog\n * @param {boolean} [props.noKeyboard=false] If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n * @param {boolean} [props.noDrag=false] If true, disables drag 'n' drop\n * @param {boolean} [props.noDragEventsBubbling=false] If true, stops drag event propagation to parents\n * @param {number} [props.minSize=0] Minimum file size (in bytes)\n * @param {number} [props.maxSize=Infinity] Maximum file size (in bytes)\n * @param {boolean} [props.disabled=false] Enable/disable the dropzone\n * @param {getFilesFromEvent} [props.getFilesFromEvent] Use this to provide a custom file aggregator\n * @param {Function} [props.onFileDialogCancel] Cb for when closing the file dialog with no selection\n * @param {boolean} [props.useFsAccessApi] Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `` click event.\n * @param {boolean} autoFocus Set to true to auto focus the root element.\n * @param {Function} [props.onFileDialogOpen] Cb for when opening the file dialog\n * @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.\n * @param {dragCb} [props.onDragLeave] Cb for when the `dragleave` event occurs\n * @param {dragCb} [props.onDragOver] Cb for when the `dragover` event occurs\n * @param {dropCb} [props.onDrop] Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be an object with keys as a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) and the value an array of file extensions (optional).\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n * @param {dropAcceptedCb} [props.onDropAccepted]\n * @param {dropRejectedCb} [props.onDropRejected]\n * @param {(error: Error) => void} [props.onError]\n *\n * @returns {DropzoneState & DropzoneMethods}\n */\n\nexport function useDropzone() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),\n accept = _defaultProps$props.accept,\n disabled = _defaultProps$props.disabled,\n getFilesFromEvent = _defaultProps$props.getFilesFromEvent,\n maxSize = _defaultProps$props.maxSize,\n minSize = _defaultProps$props.minSize,\n multiple = _defaultProps$props.multiple,\n maxFiles = _defaultProps$props.maxFiles,\n onDragEnter = _defaultProps$props.onDragEnter,\n onDragLeave = _defaultProps$props.onDragLeave,\n onDragOver = _defaultProps$props.onDragOver,\n onDrop = _defaultProps$props.onDrop,\n onDropAccepted = _defaultProps$props.onDropAccepted,\n onDropRejected = _defaultProps$props.onDropRejected,\n onFileDialogCancel = _defaultProps$props.onFileDialogCancel,\n onFileDialogOpen = _defaultProps$props.onFileDialogOpen,\n useFsAccessApi = _defaultProps$props.useFsAccessApi,\n autoFocus = _defaultProps$props.autoFocus,\n preventDropOnDocument = _defaultProps$props.preventDropOnDocument,\n noClick = _defaultProps$props.noClick,\n noKeyboard = _defaultProps$props.noKeyboard,\n noDrag = _defaultProps$props.noDrag,\n noDragEventsBubbling = _defaultProps$props.noDragEventsBubbling,\n onError = _defaultProps$props.onError,\n validator = _defaultProps$props.validator;\n\n var acceptAttr = useMemo(function () {\n return acceptPropAsAcceptAttr(accept);\n }, [accept]);\n var pickerTypes = useMemo(function () {\n return pickerOptionsFromAccept(accept);\n }, [accept]);\n var onFileDialogOpenCb = useMemo(function () {\n return typeof onFileDialogOpen === \"function\" ? onFileDialogOpen : noop;\n }, [onFileDialogOpen]);\n var onFileDialogCancelCb = useMemo(function () {\n return typeof onFileDialogCancel === \"function\" ? onFileDialogCancel : noop;\n }, [onFileDialogCancel]);\n /**\n * @constant\n * @type {React.MutableRefObject}\n */\n\n var rootRef = useRef(null);\n var inputRef = useRef(null);\n\n var _useReducer = useReducer(reducer, initialState),\n _useReducer2 = _slicedToArray(_useReducer, 2),\n state = _useReducer2[0],\n dispatch = _useReducer2[1];\n\n var isFocused = state.isFocused,\n isFileDialogActive = state.isFileDialogActive;\n var fsAccessApiWorksRef = useRef(typeof window !== \"undefined\" && window.isSecureContext && useFsAccessApi && canUseFileSystemAccessAPI()); // Update file dialog active state when the window is focused on\n\n var onWindowFocus = function onWindowFocus() {\n // Execute the timeout only if the file dialog is opened in the browser\n if (!fsAccessApiWorksRef.current && isFileDialogActive) {\n setTimeout(function () {\n if (inputRef.current) {\n var files = inputRef.current.files;\n\n if (!files.length) {\n dispatch({\n type: \"closeDialog\"\n });\n onFileDialogCancelCb();\n }\n }\n }, 300);\n }\n };\n\n useEffect(function () {\n window.addEventListener(\"focus\", onWindowFocus, false);\n return function () {\n window.removeEventListener(\"focus\", onWindowFocus, false);\n };\n }, [inputRef, isFileDialogActive, onFileDialogCancelCb, fsAccessApiWorksRef]);\n var dragTargetsRef = useRef([]);\n\n var onDocumentDrop = function onDocumentDrop(event) {\n if (rootRef.current && rootRef.current.contains(event.target)) {\n // If we intercepted an event for our instance, let it propagate down to the instance's onDrop handler\n return;\n }\n\n event.preventDefault();\n dragTargetsRef.current = [];\n };\n\n useEffect(function () {\n if (preventDropOnDocument) {\n document.addEventListener(\"dragover\", onDocumentDragOver, false);\n document.addEventListener(\"drop\", onDocumentDrop, false);\n }\n\n return function () {\n if (preventDropOnDocument) {\n document.removeEventListener(\"dragover\", onDocumentDragOver);\n document.removeEventListener(\"drop\", onDocumentDrop);\n }\n };\n }, [rootRef, preventDropOnDocument]); // Auto focus the root when autoFocus is true\n\n useEffect(function () {\n if (!disabled && autoFocus && rootRef.current) {\n rootRef.current.focus();\n }\n\n return function () {};\n }, [rootRef, autoFocus, disabled]);\n var onErrCb = useCallback(function (e) {\n if (onError) {\n onError(e);\n } else {\n // Let the user know something's gone wrong if they haven't provided the onError cb.\n console.error(e);\n }\n }, [onError]);\n var onDragEnterCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n var fileCount = files.length;\n var isDragAccept = fileCount > 0 && allFilesAccepted({\n files: files,\n accept: acceptAttr,\n minSize: minSize,\n maxSize: maxSize,\n multiple: multiple,\n maxFiles: maxFiles,\n validator: validator\n });\n var isDragReject = fileCount > 0 && !isDragAccept;\n dispatch({\n isDragAccept: isDragAccept,\n isDragReject: isDragReject,\n isDragActive: true,\n type: \"setDraggedFiles\"\n });\n\n if (onDragEnter) {\n onDragEnter(event);\n }\n }).catch(function (e) {\n return onErrCb(e);\n });\n }\n }, [getFilesFromEvent, onDragEnter, onErrCb, noDragEventsBubbling, acceptAttr, minSize, maxSize, multiple, maxFiles, validator]);\n var onDragOverCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event);\n var hasFiles = isEvtWithFiles(event);\n\n if (hasFiles && event.dataTransfer) {\n try {\n event.dataTransfer.dropEffect = \"copy\";\n } catch (_unused) {}\n /* eslint-disable-line no-empty */\n\n }\n\n if (hasFiles && onDragOver) {\n onDragOver(event);\n }\n\n return false;\n }, [onDragOver, noDragEventsBubbling]);\n var onDragLeaveCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event); // Only deactivate once the dropzone and all children have been left\n\n var targets = dragTargetsRef.current.filter(function (target) {\n return rootRef.current && rootRef.current.contains(target);\n }); // Make sure to remove a target present multiple times only once\n // (Firefox may fire dragenter/dragleave multiple times on the same element)\n\n var targetIdx = targets.indexOf(event.target);\n\n if (targetIdx !== -1) {\n targets.splice(targetIdx, 1);\n }\n\n dragTargetsRef.current = targets;\n\n if (targets.length > 0) {\n return;\n }\n\n dispatch({\n type: \"setDraggedFiles\",\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false\n });\n\n if (isEvtWithFiles(event) && onDragLeave) {\n onDragLeave(event);\n }\n }, [rootRef, onDragLeave, noDragEventsBubbling]);\n var setFiles = useCallback(function (files, event) {\n var acceptedFiles = [];\n var fileRejections = [];\n files.forEach(function (file) {\n var _fileAccepted = fileAccepted(file, acceptAttr),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 2),\n accepted = _fileAccepted2[0],\n acceptError = _fileAccepted2[1];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 2),\n sizeMatch = _fileMatchSize2[0],\n sizeError = _fileMatchSize2[1];\n\n var customErrors = validator ? validator(file) : null;\n\n if (accepted && sizeMatch && !customErrors) {\n acceptedFiles.push(file);\n } else {\n var errors = [acceptError, sizeError];\n\n if (customErrors) {\n errors = errors.concat(customErrors);\n }\n\n fileRejections.push({\n file: file,\n errors: errors.filter(function (e) {\n return e;\n })\n });\n }\n });\n\n if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {\n // Reject everything and empty accepted files\n acceptedFiles.forEach(function (file) {\n fileRejections.push({\n file: file,\n errors: [TOO_MANY_FILES_REJECTION]\n });\n });\n acceptedFiles.splice(0);\n }\n\n dispatch({\n acceptedFiles: acceptedFiles,\n fileRejections: fileRejections,\n isDragReject: fileRejections.length > 0,\n type: \"setFiles\"\n });\n\n if (onDrop) {\n onDrop(acceptedFiles, fileRejections, event);\n }\n\n if (fileRejections.length > 0 && onDropRejected) {\n onDropRejected(fileRejections, event);\n }\n\n if (acceptedFiles.length > 0 && onDropAccepted) {\n onDropAccepted(acceptedFiles, event);\n }\n }, [dispatch, multiple, acceptAttr, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]);\n var onDropCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [];\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n setFiles(files, event);\n }).catch(function (e) {\n return onErrCb(e);\n });\n }\n\n dispatch({\n type: \"reset\"\n });\n }, [getFilesFromEvent, setFiles, onErrCb, noDragEventsBubbling]); // Fn for opening the file dialog programmatically\n\n var openFileDialog = useCallback(function () {\n // No point to use FS access APIs if context is not secure\n // https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#feature_detection\n if (fsAccessApiWorksRef.current) {\n dispatch({\n type: \"openDialog\"\n });\n onFileDialogOpenCb(); // https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker\n\n var opts = {\n multiple: multiple,\n types: pickerTypes\n };\n window.showOpenFilePicker(opts).then(function (handles) {\n return getFilesFromEvent(handles);\n }).then(function (files) {\n setFiles(files, null);\n dispatch({\n type: \"closeDialog\"\n });\n }).catch(function (e) {\n // AbortError means the user canceled\n if (isAbort(e)) {\n onFileDialogCancelCb(e);\n dispatch({\n type: \"closeDialog\"\n });\n } else if (isSecurityError(e)) {\n fsAccessApiWorksRef.current = false; // CORS, so cannot use this API\n // Try using the input\n\n if (inputRef.current) {\n inputRef.current.value = null;\n inputRef.current.click();\n } else {\n onErrCb(new Error(\"Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided.\"));\n }\n } else {\n onErrCb(e);\n }\n });\n return;\n }\n\n if (inputRef.current) {\n dispatch({\n type: \"openDialog\"\n });\n onFileDialogOpenCb();\n inputRef.current.value = null;\n inputRef.current.click();\n }\n }, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, onErrCb, pickerTypes, multiple]); // Cb to open the file dialog when SPACE/ENTER occurs on the dropzone\n\n var onKeyDownCb = useCallback(function (event) {\n // Ignore keyboard events bubbling up the DOM tree\n if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {\n return;\n }\n\n if (event.key === \" \" || event.key === \"Enter\" || event.keyCode === 32 || event.keyCode === 13) {\n event.preventDefault();\n openFileDialog();\n }\n }, [rootRef, openFileDialog]); // Update focus state for the dropzone\n\n var onFocusCb = useCallback(function () {\n dispatch({\n type: \"focus\"\n });\n }, []);\n var onBlurCb = useCallback(function () {\n dispatch({\n type: \"blur\"\n });\n }, []); // Cb to open the file dialog when click occurs on the dropzone\n\n var onClickCb = useCallback(function () {\n if (noClick) {\n return;\n } // In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout()\n // to ensure React can handle state changes\n // See: https://github.com/react-dropzone/react-dropzone/issues/450\n\n\n if (isIeOrEdge()) {\n setTimeout(openFileDialog, 0);\n } else {\n openFileDialog();\n }\n }, [noClick, openFileDialog]);\n\n var composeHandler = function composeHandler(fn) {\n return disabled ? null : fn;\n };\n\n var composeKeyboardHandler = function composeKeyboardHandler(fn) {\n return noKeyboard ? null : composeHandler(fn);\n };\n\n var composeDragHandler = function composeDragHandler(fn) {\n return noDrag ? null : composeHandler(fn);\n };\n\n var stopPropagation = function stopPropagation(event) {\n if (noDragEventsBubbling) {\n event.stopPropagation();\n }\n };\n\n var getRootProps = useMemo(function () {\n return function () {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref2$refKey = _ref2.refKey,\n refKey = _ref2$refKey === void 0 ? \"ref\" : _ref2$refKey,\n role = _ref2.role,\n onKeyDown = _ref2.onKeyDown,\n onFocus = _ref2.onFocus,\n onBlur = _ref2.onBlur,\n onClick = _ref2.onClick,\n onDragEnter = _ref2.onDragEnter,\n onDragOver = _ref2.onDragOver,\n onDragLeave = _ref2.onDragLeave,\n onDrop = _ref2.onDrop,\n rest = _objectWithoutProperties(_ref2, _excluded3);\n\n return _objectSpread(_objectSpread(_defineProperty({\n onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),\n onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),\n onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),\n onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter, onDragEnterCb)),\n onDragOver: composeDragHandler(composeEventHandlers(onDragOver, onDragOverCb)),\n onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),\n onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb)),\n role: typeof role === \"string\" && role !== \"\" ? role : \"presentation\"\n }, refKey, rootRef), !disabled && !noKeyboard ? {\n tabIndex: 0\n } : {}), rest);\n };\n }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);\n var onInputElementClick = useCallback(function (event) {\n event.stopPropagation();\n }, []);\n var getInputProps = useMemo(function () {\n return function () {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? \"ref\" : _ref3$refKey,\n onChange = _ref3.onChange,\n onClick = _ref3.onClick,\n rest = _objectWithoutProperties(_ref3, _excluded4);\n\n var inputProps = _defineProperty({\n accept: acceptAttr,\n multiple: multiple,\n type: \"file\",\n style: {\n border: 0,\n clip: \"rect(0, 0, 0, 0)\",\n clipPath: \"inset(50%)\",\n height: \"1px\",\n margin: \"0 -1px -1px 0\",\n overflow: \"hidden\",\n padding: 0,\n position: \"absolute\",\n width: \"1px\",\n whiteSpace: \"nowrap\"\n },\n onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),\n tabIndex: -1\n }, refKey, inputRef);\n\n return _objectSpread(_objectSpread({}, inputProps), rest);\n };\n }, [inputRef, accept, multiple, onDropCb, disabled]);\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: isFocused && !disabled,\n getRootProps: getRootProps,\n getInputProps: getInputProps,\n rootRef: rootRef,\n inputRef: inputRef,\n open: composeHandler(openFileDialog)\n });\n}\n/**\n * @param {DropzoneState} state\n * @param {{type: string} & DropzoneState} action\n * @returns {DropzoneState}\n */\n\nfunction reducer(state, action) {\n /* istanbul ignore next */\n switch (action.type) {\n case \"focus\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: true\n });\n\n case \"blur\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: false\n });\n\n case \"openDialog\":\n return _objectSpread(_objectSpread({}, initialState), {}, {\n isFileDialogActive: true\n });\n\n case \"closeDialog\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: false\n });\n\n case \"setDraggedFiles\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isDragActive: action.isDragActive,\n isDragAccept: action.isDragAccept,\n isDragReject: action.isDragReject\n });\n\n case \"setFiles\":\n return _objectSpread(_objectSpread({}, state), {}, {\n acceptedFiles: action.acceptedFiles,\n fileRejections: action.fileRejections,\n isDragReject: action.isDragReject\n });\n\n case \"reset\":\n return _objectSpread({}, initialState);\n\n default:\n return state;\n }\n}\n\nfunction noop() {}\n\nexport { ErrorCode } from \"./utils\";","\nmodule.exports = function () {\n var selection = document.getSelection();\n if (!selection.rangeCount) {\n return function () {};\n }\n var active = document.activeElement;\n\n var ranges = [];\n for (var i = 0; i < selection.rangeCount; i++) {\n ranges.push(selection.getRangeAt(i));\n }\n\n switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n case 'INPUT':\n case 'TEXTAREA':\n active.blur();\n break;\n\n default:\n active = null;\n break;\n }\n\n selection.removeAllRanges();\n return function () {\n selection.type === 'Caret' &&\n selection.removeAllRanges();\n\n if (!selection.rangeCount) {\n ranges.forEach(function(range) {\n selection.addRange(range);\n });\n }\n\n active &&\n active.focus();\n };\n};\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","// This file is autogenerated. It's used to publish CJS to npm.\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.tinycolor = factory());\n})(this, (function () { 'use strict';\n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n }\n\n // https://github.com/bgrins/TinyColor\n // Brian Grinstead, MIT License\n\n var trimLeft = /^\\s+/;\n var trimRight = /\\s+$/;\n function tinycolor(color, opts) {\n color = color ? color : \"\";\n opts = opts || {};\n\n // If input is already a tinycolor, return itself\n if (color instanceof tinycolor) {\n return color;\n }\n // If we are called as a function, call using new instead\n if (!(this instanceof tinycolor)) {\n return new tinycolor(color, opts);\n }\n var rgb = inputToRGB(color);\n this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = Math.round(100 * this._a) / 100, this._format = opts.format || rgb.format;\n this._gradientType = opts.gradientType;\n\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this._r < 1) this._r = Math.round(this._r);\n if (this._g < 1) this._g = Math.round(this._g);\n if (this._b < 1) this._b = Math.round(this._b);\n this._ok = rgb.ok;\n }\n tinycolor.prototype = {\n isDark: function isDark() {\n return this.getBrightness() < 128;\n },\n isLight: function isLight() {\n return !this.isDark();\n },\n isValid: function isValid() {\n return this._ok;\n },\n getOriginalInput: function getOriginalInput() {\n return this._originalInput;\n },\n getFormat: function getFormat() {\n return this._format;\n },\n getAlpha: function getAlpha() {\n return this._a;\n },\n getBrightness: function getBrightness() {\n //http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n },\n getLuminance: function getLuminance() {\n //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var RsRGB, GsRGB, BsRGB, R, G, B;\n RsRGB = rgb.r / 255;\n GsRGB = rgb.g / 255;\n BsRGB = rgb.b / 255;\n if (RsRGB <= 0.03928) R = RsRGB / 12.92;else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);\n if (GsRGB <= 0.03928) G = GsRGB / 12.92;else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);\n if (BsRGB <= 0.03928) B = BsRGB / 12.92;else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);\n return 0.2126 * R + 0.7152 * G + 0.0722 * B;\n },\n setAlpha: function setAlpha(value) {\n this._a = boundAlpha(value);\n this._roundA = Math.round(100 * this._a) / 100;\n return this;\n },\n toHsv: function toHsv() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n return {\n h: hsv.h * 360,\n s: hsv.s,\n v: hsv.v,\n a: this._a\n };\n },\n toHsvString: function toHsvString() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n var h = Math.round(hsv.h * 360),\n s = Math.round(hsv.s * 100),\n v = Math.round(hsv.v * 100);\n return this._a == 1 ? \"hsv(\" + h + \", \" + s + \"%, \" + v + \"%)\" : \"hsva(\" + h + \", \" + s + \"%, \" + v + \"%, \" + this._roundA + \")\";\n },\n toHsl: function toHsl() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n return {\n h: hsl.h * 360,\n s: hsl.s,\n l: hsl.l,\n a: this._a\n };\n },\n toHslString: function toHslString() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n var h = Math.round(hsl.h * 360),\n s = Math.round(hsl.s * 100),\n l = Math.round(hsl.l * 100);\n return this._a == 1 ? \"hsl(\" + h + \", \" + s + \"%, \" + l + \"%)\" : \"hsla(\" + h + \", \" + s + \"%, \" + l + \"%, \" + this._roundA + \")\";\n },\n toHex: function toHex(allow3Char) {\n return rgbToHex(this._r, this._g, this._b, allow3Char);\n },\n toHexString: function toHexString(allow3Char) {\n return \"#\" + this.toHex(allow3Char);\n },\n toHex8: function toHex8(allow4Char) {\n return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);\n },\n toHex8String: function toHex8String(allow4Char) {\n return \"#\" + this.toHex8(allow4Char);\n },\n toRgb: function toRgb() {\n return {\n r: Math.round(this._r),\n g: Math.round(this._g),\n b: Math.round(this._b),\n a: this._a\n };\n },\n toRgbString: function toRgbString() {\n return this._a == 1 ? \"rgb(\" + Math.round(this._r) + \", \" + Math.round(this._g) + \", \" + Math.round(this._b) + \")\" : \"rgba(\" + Math.round(this._r) + \", \" + Math.round(this._g) + \", \" + Math.round(this._b) + \", \" + this._roundA + \")\";\n },\n toPercentageRgb: function toPercentageRgb() {\n return {\n r: Math.round(bound01(this._r, 255) * 100) + \"%\",\n g: Math.round(bound01(this._g, 255) * 100) + \"%\",\n b: Math.round(bound01(this._b, 255) * 100) + \"%\",\n a: this._a\n };\n },\n toPercentageRgbString: function toPercentageRgbString() {\n return this._a == 1 ? \"rgb(\" + Math.round(bound01(this._r, 255) * 100) + \"%, \" + Math.round(bound01(this._g, 255) * 100) + \"%, \" + Math.round(bound01(this._b, 255) * 100) + \"%)\" : \"rgba(\" + Math.round(bound01(this._r, 255) * 100) + \"%, \" + Math.round(bound01(this._g, 255) * 100) + \"%, \" + Math.round(bound01(this._b, 255) * 100) + \"%, \" + this._roundA + \")\";\n },\n toName: function toName() {\n if (this._a === 0) {\n return \"transparent\";\n }\n if (this._a < 1) {\n return false;\n }\n return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;\n },\n toFilter: function toFilter(secondColor) {\n var hex8String = \"#\" + rgbaToArgbHex(this._r, this._g, this._b, this._a);\n var secondHex8String = hex8String;\n var gradientType = this._gradientType ? \"GradientType = 1, \" : \"\";\n if (secondColor) {\n var s = tinycolor(secondColor);\n secondHex8String = \"#\" + rgbaToArgbHex(s._r, s._g, s._b, s._a);\n }\n return \"progid:DXImageTransform.Microsoft.gradient(\" + gradientType + \"startColorstr=\" + hex8String + \",endColorstr=\" + secondHex8String + \")\";\n },\n toString: function toString(format) {\n var formatSet = !!format;\n format = format || this._format;\n var formattedString = false;\n var hasAlpha = this._a < 1 && this._a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format === \"hex\" || format === \"hex6\" || format === \"hex3\" || format === \"hex4\" || format === \"hex8\" || format === \"name\");\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === \"name\" && this._a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === \"rgb\") {\n formattedString = this.toRgbString();\n }\n if (format === \"prgb\") {\n formattedString = this.toPercentageRgbString();\n }\n if (format === \"hex\" || format === \"hex6\") {\n formattedString = this.toHexString();\n }\n if (format === \"hex3\") {\n formattedString = this.toHexString(true);\n }\n if (format === \"hex4\") {\n formattedString = this.toHex8String(true);\n }\n if (format === \"hex8\") {\n formattedString = this.toHex8String();\n }\n if (format === \"name\") {\n formattedString = this.toName();\n }\n if (format === \"hsl\") {\n formattedString = this.toHslString();\n }\n if (format === \"hsv\") {\n formattedString = this.toHsvString();\n }\n return formattedString || this.toHexString();\n },\n clone: function clone() {\n return tinycolor(this.toString());\n },\n _applyModification: function _applyModification(fn, args) {\n var color = fn.apply(null, [this].concat([].slice.call(args)));\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this.setAlpha(color._a);\n return this;\n },\n lighten: function lighten() {\n return this._applyModification(_lighten, arguments);\n },\n brighten: function brighten() {\n return this._applyModification(_brighten, arguments);\n },\n darken: function darken() {\n return this._applyModification(_darken, arguments);\n },\n desaturate: function desaturate() {\n return this._applyModification(_desaturate, arguments);\n },\n saturate: function saturate() {\n return this._applyModification(_saturate, arguments);\n },\n greyscale: function greyscale() {\n return this._applyModification(_greyscale, arguments);\n },\n spin: function spin() {\n return this._applyModification(_spin, arguments);\n },\n _applyCombination: function _applyCombination(fn, args) {\n return fn.apply(null, [this].concat([].slice.call(args)));\n },\n analogous: function analogous() {\n return this._applyCombination(_analogous, arguments);\n },\n complement: function complement() {\n return this._applyCombination(_complement, arguments);\n },\n monochromatic: function monochromatic() {\n return this._applyCombination(_monochromatic, arguments);\n },\n splitcomplement: function splitcomplement() {\n return this._applyCombination(_splitcomplement, arguments);\n },\n // Disabled until https://github.com/bgrins/TinyColor/issues/254\n // polyad: function (number) {\n // return this._applyCombination(polyad, [number]);\n // },\n triad: function triad() {\n return this._applyCombination(polyad, [3]);\n },\n tetrad: function tetrad() {\n return this._applyCombination(polyad, [4]);\n }\n };\n\n // If input is an object, force 1 into \"1.0\" to handle ratios properly\n // String input requires \"1.0\" as input, so 1 will be treated as 1\n tinycolor.fromRatio = function (color, opts) {\n if (_typeof(color) == \"object\") {\n var newColor = {};\n for (var i in color) {\n if (color.hasOwnProperty(i)) {\n if (i === \"a\") {\n newColor[i] = color[i];\n } else {\n newColor[i] = convertToPercentage(color[i]);\n }\n }\n }\n color = newColor;\n }\n return tinycolor(color, opts);\n };\n\n // Given a string or object, convert that input to RGB\n // Possible string inputs:\n //\n // \"red\"\n // \"#f00\" or \"f00\"\n // \"#ff0000\" or \"ff0000\"\n // \"#ff000000\" or \"ff000000\"\n // \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n // \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n // \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n // \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n // \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n // \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n // \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n //\n function inputToRGB(color) {\n var rgb = {\n r: 0,\n g: 0,\n b: 0\n };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n if (typeof color == \"string\") {\n color = stringInputToObject(color);\n }\n if (_typeof(color) == \"object\") {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === \"%\" ? \"prgb\" : \"rgb\";\n } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = \"hsv\";\n } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = \"hsl\";\n }\n if (color.hasOwnProperty(\"a\")) {\n a = color.a;\n }\n }\n a = boundAlpha(a);\n return {\n ok: ok,\n format: color.format || format,\n r: Math.min(255, Math.max(rgb.r, 0)),\n g: Math.min(255, Math.max(rgb.g, 0)),\n b: Math.min(255, Math.max(rgb.b, 0)),\n a: a\n };\n }\n\n // Conversion Functions\n // --------------------\n\n // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n // \n\n // `rgbToRgb`\n // Handle bounds / percentage checking to conform to CSS color spec\n // \n // *Assumes:* r, g, b in [0, 255] or [0, 1]\n // *Returns:* { r, g, b } in [0, 255]\n function rgbToRgb(r, g, b) {\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255\n };\n }\n\n // `rgbToHsl`\n // Converts an RGB color value to HSL.\n // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n // *Returns:* { h, s, l } in [0,1]\n function rgbToHsl(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n var max = Math.max(r, g, b),\n min = Math.min(r, g, b);\n var h,\n s,\n l = (max + min) / 2;\n if (max == min) {\n h = s = 0; // achromatic\n } else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n return {\n h: h,\n s: s,\n l: l\n };\n }\n\n // `hslToRgb`\n // Converts an HSL color value to RGB.\n // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n // *Returns:* { r, g, b } in the set [0, 255]\n function hslToRgb(h, s, l) {\n var r, g, b;\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n function hue2rgb(p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n }\n if (s === 0) {\n r = g = b = l; // achromatic\n } else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return {\n r: r * 255,\n g: g * 255,\n b: b * 255\n };\n }\n\n // `rgbToHsv`\n // Converts an RGB color value to HSV\n // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n // *Returns:* { h, s, v } in [0,1]\n function rgbToHsv(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n var max = Math.max(r, g, b),\n min = Math.min(r, g, b);\n var h,\n s,\n v = max;\n var d = max - min;\n s = max === 0 ? 0 : d / max;\n if (max == min) {\n h = 0; // achromatic\n } else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n return {\n h: h,\n s: s,\n v: v\n };\n }\n\n // `hsvToRgb`\n // Converts an HSV color value to RGB.\n // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n // *Returns:* { r, g, b } in the set [0, 255]\n function hsvToRgb(h, s, v) {\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n var i = Math.floor(h),\n f = h - i,\n p = v * (1 - s),\n q = v * (1 - f * s),\n t = v * (1 - (1 - f) * s),\n mod = i % 6,\n r = [v, q, p, p, t, v][mod],\n g = [t, v, v, q, p, p][mod],\n b = [p, p, t, v, v, q][mod];\n return {\n r: r * 255,\n g: g * 255,\n b: b * 255\n };\n }\n\n // `rgbToHex`\n // Converts an RGB color to hex\n // Assumes r, g, and b are contained in the set [0, 255]\n // Returns a 3 or 6 character hex\n function rgbToHex(r, g, b, allow3Char) {\n var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];\n\n // Return a 3 character hex if possible\n if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n return hex.join(\"\");\n }\n\n // `rgbaToHex`\n // Converts an RGBA color plus alpha transparency to hex\n // Assumes r, g, b are contained in the set [0, 255] and\n // a in [0, 1]. Returns a 4 or 8 character rgba hex\n function rgbaToHex(r, g, b, a, allow4Char) {\n var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n return hex.join(\"\");\n }\n\n // `rgbaToArgbHex`\n // Converts an RGBA color to an ARGB Hex8 string\n // Rarely used, but required for \"toFilter()\"\n function rgbaToArgbHex(r, g, b, a) {\n var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];\n return hex.join(\"\");\n }\n\n // `equals`\n // Can be called with any tinycolor input\n tinycolor.equals = function (color1, color2) {\n if (!color1 || !color2) return false;\n return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();\n };\n tinycolor.random = function () {\n return tinycolor.fromRatio({\n r: Math.random(),\n g: Math.random(),\n b: Math.random()\n });\n };\n\n // Modification Functions\n // ----------------------\n // Thanks to less.js for some of the basics here\n // \n\n function _desaturate(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }\n function _saturate(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }\n function _greyscale(color) {\n return tinycolor(color).desaturate(100);\n }\n function _lighten(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n }\n function _brighten(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var rgb = tinycolor(color).toRgb();\n rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));\n rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));\n rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));\n return tinycolor(rgb);\n }\n function _darken(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n }\n\n // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n // Values outside of this range will be wrapped into this range.\n function _spin(color, amount) {\n var hsl = tinycolor(color).toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return tinycolor(hsl);\n }\n\n // Combination Functions\n // ---------------------\n // Thanks to jQuery xColor for some of the ideas behind these\n // \n\n function _complement(color) {\n var hsl = tinycolor(color).toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return tinycolor(hsl);\n }\n function polyad(color, number) {\n if (isNaN(number) || number <= 0) {\n throw new Error(\"Argument to polyad must be a positive number\");\n }\n var hsl = tinycolor(color).toHsl();\n var result = [tinycolor(color)];\n var step = 360 / number;\n for (var i = 1; i < number; i++) {\n result.push(tinycolor({\n h: (hsl.h + i * step) % 360,\n s: hsl.s,\n l: hsl.l\n }));\n }\n return result;\n }\n function _splitcomplement(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [tinycolor(color), tinycolor({\n h: (h + 72) % 360,\n s: hsl.s,\n l: hsl.l\n }), tinycolor({\n h: (h + 216) % 360,\n s: hsl.s,\n l: hsl.l\n })];\n }\n function _analogous(color, results, slices) {\n results = results || 6;\n slices = slices || 30;\n var hsl = tinycolor(color).toHsl();\n var part = 360 / slices;\n var ret = [tinycolor(color)];\n for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(tinycolor(hsl));\n }\n return ret;\n }\n function _monochromatic(color, results) {\n results = results || 6;\n var hsv = tinycolor(color).toHsv();\n var h = hsv.h,\n s = hsv.s,\n v = hsv.v;\n var ret = [];\n var modification = 1 / results;\n while (results--) {\n ret.push(tinycolor({\n h: h,\n s: s,\n v: v\n }));\n v = (v + modification) % 1;\n }\n return ret;\n }\n\n // Utility Functions\n // ---------------------\n\n tinycolor.mix = function (color1, color2, amount) {\n amount = amount === 0 ? 0 : amount || 50;\n var rgb1 = tinycolor(color1).toRgb();\n var rgb2 = tinycolor(color2).toRgb();\n var p = amount / 100;\n var rgba = {\n r: (rgb2.r - rgb1.r) * p + rgb1.r,\n g: (rgb2.g - rgb1.g) * p + rgb1.g,\n b: (rgb2.b - rgb1.b) * p + rgb1.b,\n a: (rgb2.a - rgb1.a) * p + rgb1.a\n };\n return tinycolor(rgba);\n };\n\n // Readability Functions\n // ---------------------\n // false\n // tinycolor.isReadable(\"#000\", \"#111\",{level:\"AA\",size:\"large\"}) => false\n tinycolor.isReadable = function (color1, color2, wcag2) {\n var readability = tinycolor.readability(color1, color2);\n var wcag2Parms, out;\n out = false;\n wcag2Parms = validateWCAG2Parms(wcag2);\n switch (wcag2Parms.level + wcag2Parms.size) {\n case \"AAsmall\":\n case \"AAAlarge\":\n out = readability >= 4.5;\n break;\n case \"AAlarge\":\n out = readability >= 3;\n break;\n case \"AAAsmall\":\n out = readability >= 7;\n break;\n }\n return out;\n };\n\n // `mostReadable`\n // Given a base color and a list of possible foreground or background\n // colors for that base, returns the most readable color.\n // Optionally returns Black or White if the most readable color is unreadable.\n // *Example*\n // tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:false}).toHexString(); // \"#112255\"\n // tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:true}).toHexString(); // \"#ffffff\"\n // tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"large\"}).toHexString(); // \"#faf3f3\"\n // tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"small\"}).toHexString(); // \"#ffffff\"\n tinycolor.mostReadable = function (baseColor, colorList, args) {\n var bestColor = null;\n var bestScore = 0;\n var readability;\n var includeFallbackColors, level, size;\n args = args || {};\n includeFallbackColors = args.includeFallbackColors;\n level = args.level;\n size = args.size;\n for (var i = 0; i < colorList.length; i++) {\n readability = tinycolor.readability(baseColor, colorList[i]);\n if (readability > bestScore) {\n bestScore = readability;\n bestColor = tinycolor(colorList[i]);\n }\n }\n if (tinycolor.isReadable(baseColor, bestColor, {\n level: level,\n size: size\n }) || !includeFallbackColors) {\n return bestColor;\n } else {\n args.includeFallbackColors = false;\n return tinycolor.mostReadable(baseColor, [\"#fff\", \"#000\"], args);\n }\n };\n\n // Big List of Colors\n // ------------------\n // \n var names = tinycolor.names = {\n aliceblue: \"f0f8ff\",\n antiquewhite: \"faebd7\",\n aqua: \"0ff\",\n aquamarine: \"7fffd4\",\n azure: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"000\",\n blanchedalmond: \"ffebcd\",\n blue: \"00f\",\n blueviolet: \"8a2be2\",\n brown: \"a52a2a\",\n burlywood: \"deb887\",\n burntsienna: \"ea7e5d\",\n cadetblue: \"5f9ea0\",\n chartreuse: \"7fff00\",\n chocolate: \"d2691e\",\n coral: \"ff7f50\",\n cornflowerblue: \"6495ed\",\n cornsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"0ff\",\n darkblue: \"00008b\",\n darkcyan: \"008b8b\",\n darkgoldenrod: \"b8860b\",\n darkgray: \"a9a9a9\",\n darkgreen: \"006400\",\n darkgrey: \"a9a9a9\",\n darkkhaki: \"bdb76b\",\n darkmagenta: \"8b008b\",\n darkolivegreen: \"556b2f\",\n darkorange: \"ff8c00\",\n darkorchid: \"9932cc\",\n darkred: \"8b0000\",\n darksalmon: \"e9967a\",\n darkseagreen: \"8fbc8f\",\n darkslateblue: \"483d8b\",\n darkslategray: \"2f4f4f\",\n darkslategrey: \"2f4f4f\",\n darkturquoise: \"00ced1\",\n darkviolet: \"9400d3\",\n deeppink: \"ff1493\",\n deepskyblue: \"00bfff\",\n dimgray: \"696969\",\n dimgrey: \"696969\",\n dodgerblue: \"1e90ff\",\n firebrick: \"b22222\",\n floralwhite: \"fffaf0\",\n forestgreen: \"228b22\",\n fuchsia: \"f0f\",\n gainsboro: \"dcdcdc\",\n ghostwhite: \"f8f8ff\",\n gold: \"ffd700\",\n goldenrod: \"daa520\",\n gray: \"808080\",\n green: \"008000\",\n greenyellow: \"adff2f\",\n grey: \"808080\",\n honeydew: \"f0fff0\",\n hotpink: \"ff69b4\",\n indianred: \"cd5c5c\",\n indigo: \"4b0082\",\n ivory: \"fffff0\",\n khaki: \"f0e68c\",\n lavender: \"e6e6fa\",\n lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\",\n lemonchiffon: \"fffacd\",\n lightblue: \"add8e6\",\n lightcoral: \"f08080\",\n lightcyan: \"e0ffff\",\n lightgoldenrodyellow: \"fafad2\",\n lightgray: \"d3d3d3\",\n lightgreen: \"90ee90\",\n lightgrey: \"d3d3d3\",\n lightpink: \"ffb6c1\",\n lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\",\n lightskyblue: \"87cefa\",\n lightslategray: \"789\",\n lightslategrey: \"789\",\n lightsteelblue: \"b0c4de\",\n lightyellow: \"ffffe0\",\n lime: \"0f0\",\n limegreen: \"32cd32\",\n linen: \"faf0e6\",\n magenta: \"f0f\",\n maroon: \"800000\",\n mediumaquamarine: \"66cdaa\",\n mediumblue: \"0000cd\",\n mediumorchid: \"ba55d3\",\n mediumpurple: \"9370db\",\n mediumseagreen: \"3cb371\",\n mediumslateblue: \"7b68ee\",\n mediumspringgreen: \"00fa9a\",\n mediumturquoise: \"48d1cc\",\n mediumvioletred: \"c71585\",\n midnightblue: \"191970\",\n mintcream: \"f5fffa\",\n mistyrose: \"ffe4e1\",\n moccasin: \"ffe4b5\",\n navajowhite: \"ffdead\",\n navy: \"000080\",\n oldlace: \"fdf5e6\",\n olive: \"808000\",\n olivedrab: \"6b8e23\",\n orange: \"ffa500\",\n orangered: \"ff4500\",\n orchid: \"da70d6\",\n palegoldenrod: \"eee8aa\",\n palegreen: \"98fb98\",\n paleturquoise: \"afeeee\",\n palevioletred: \"db7093\",\n papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\",\n peru: \"cd853f\",\n pink: \"ffc0cb\",\n plum: \"dda0dd\",\n powderblue: \"b0e0e6\",\n purple: \"800080\",\n rebeccapurple: \"663399\",\n red: \"f00\",\n rosybrown: \"bc8f8f\",\n royalblue: \"4169e1\",\n saddlebrown: \"8b4513\",\n salmon: \"fa8072\",\n sandybrown: \"f4a460\",\n seagreen: \"2e8b57\",\n seashell: \"fff5ee\",\n sienna: \"a0522d\",\n silver: \"c0c0c0\",\n skyblue: \"87ceeb\",\n slateblue: \"6a5acd\",\n slategray: \"708090\",\n slategrey: \"708090\",\n snow: \"fffafa\",\n springgreen: \"00ff7f\",\n steelblue: \"4682b4\",\n tan: \"d2b48c\",\n teal: \"008080\",\n thistle: \"d8bfd8\",\n tomato: \"ff6347\",\n turquoise: \"40e0d0\",\n violet: \"ee82ee\",\n wheat: \"f5deb3\",\n white: \"fff\",\n whitesmoke: \"f5f5f5\",\n yellow: \"ff0\",\n yellowgreen: \"9acd32\"\n };\n\n // Make it easy to access colors via `hexNames[hex]`\n var hexNames = tinycolor.hexNames = flip(names);\n\n // Utilities\n // ---------\n\n // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`\n function flip(o) {\n var flipped = {};\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n flipped[o[i]] = i;\n }\n }\n return flipped;\n }\n\n // Return a valid alpha value [0,1] with all invalid values being set to 1\n function boundAlpha(a) {\n a = parseFloat(a);\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n return a;\n }\n\n // Take input from [0, n] and return it as [0, 1]\n function bound01(n, max) {\n if (isOnePointZero(n)) n = \"100%\";\n var processPercent = isPercentage(n);\n n = Math.min(max, Math.max(0, parseFloat(n)));\n\n // Automatically convert percentage into number\n if (processPercent) {\n n = parseInt(n * max, 10) / 100;\n }\n\n // Handle floating point rounding errors\n if (Math.abs(n - max) < 0.000001) {\n return 1;\n }\n\n // Convert into [0, 1] range if it isn't already\n return n % max / parseFloat(max);\n }\n\n // Force a number between 0 and 1\n function clamp01(val) {\n return Math.min(1, Math.max(0, val));\n }\n\n // Parse a base-16 hex value into a base-10 integer\n function parseIntFromHex(val) {\n return parseInt(val, 16);\n }\n\n // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n // \n function isOnePointZero(n) {\n return typeof n == \"string\" && n.indexOf(\".\") != -1 && parseFloat(n) === 1;\n }\n\n // Check to see if string passed in is a percentage\n function isPercentage(n) {\n return typeof n === \"string\" && n.indexOf(\"%\") != -1;\n }\n\n // Force a hex value to have 2 characters\n function pad2(c) {\n return c.length == 1 ? \"0\" + c : \"\" + c;\n }\n\n // Replace a decimal with it's percentage value\n function convertToPercentage(n) {\n if (n <= 1) {\n n = n * 100 + \"%\";\n }\n return n;\n }\n\n // Converts a decimal to a hex value\n function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }\n // Converts a hex value to a decimal\n function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n }\n var matchers = function () {\n // \n var CSS_INTEGER = \"[-\\\\+]?\\\\d+%?\";\n\n // \n var CSS_NUMBER = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\";\n\n // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\n var CSS_UNIT = \"(?:\" + CSS_NUMBER + \")|(?:\" + CSS_INTEGER + \")\";\n\n // Actual matching.\n // Parentheses and commas are optional, but not required.\n // Whitespace can take the place of commas or opening paren\n var PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n var PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n return {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp(\"rgb\" + PERMISSIVE_MATCH3),\n rgba: new RegExp(\"rgba\" + PERMISSIVE_MATCH4),\n hsl: new RegExp(\"hsl\" + PERMISSIVE_MATCH3),\n hsla: new RegExp(\"hsla\" + PERMISSIVE_MATCH4),\n hsv: new RegExp(\"hsv\" + PERMISSIVE_MATCH3),\n hsva: new RegExp(\"hsva\" + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n };\n }();\n\n // `isValidCSSUnit`\n // Take in a single string / number and check to see if it looks like a CSS unit\n // (see `matchers` above for definition).\n function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n }\n\n // `stringInputToObject`\n // Permissive string parsing. Take in a number of formats, and output an object\n // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\n function stringInputToObject(color) {\n color = color.replace(trimLeft, \"\").replace(trimRight, \"\").toLowerCase();\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n } else if (color == \"transparent\") {\n return {\n r: 0,\n g: 0,\n b: 0,\n a: 0,\n format: \"name\"\n };\n }\n\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n var match;\n if (match = matchers.rgb.exec(color)) {\n return {\n r: match[1],\n g: match[2],\n b: match[3]\n };\n }\n if (match = matchers.rgba.exec(color)) {\n return {\n r: match[1],\n g: match[2],\n b: match[3],\n a: match[4]\n };\n }\n if (match = matchers.hsl.exec(color)) {\n return {\n h: match[1],\n s: match[2],\n l: match[3]\n };\n }\n if (match = matchers.hsla.exec(color)) {\n return {\n h: match[1],\n s: match[2],\n l: match[3],\n a: match[4]\n };\n }\n if (match = matchers.hsv.exec(color)) {\n return {\n h: match[1],\n s: match[2],\n v: match[3]\n };\n }\n if (match = matchers.hsva.exec(color)) {\n return {\n h: match[1],\n s: match[2],\n v: match[3],\n a: match[4]\n };\n }\n if (match = matchers.hex8.exec(color)) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n a: convertHexToDecimal(match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if (match = matchers.hex6.exec(color)) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n if (match = matchers.hex4.exec(color)) {\n return {\n r: parseIntFromHex(match[1] + \"\" + match[1]),\n g: parseIntFromHex(match[2] + \"\" + match[2]),\n b: parseIntFromHex(match[3] + \"\" + match[3]),\n a: convertHexToDecimal(match[4] + \"\" + match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if (match = matchers.hex3.exec(color)) {\n return {\n r: parseIntFromHex(match[1] + \"\" + match[1]),\n g: parseIntFromHex(match[2] + \"\" + match[2]),\n b: parseIntFromHex(match[3] + \"\" + match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n return false;\n }\n function validateWCAG2Parms(parms) {\n // return valid WCAG2 parms for isReadable.\n // If input parms are invalid, return {\"level\":\"AA\", \"size\":\"small\"}\n var level, size;\n parms = parms || {\n level: \"AA\",\n size: \"small\"\n };\n level = (parms.level || \"AA\").toUpperCase();\n size = (parms.size || \"small\").toLowerCase();\n if (level !== \"AA\" && level !== \"AAA\") {\n level = \"AA\";\n }\n if (size !== \"small\" && size !== \"large\") {\n size = \"small\";\n }\n return {\n level: level,\n size: size\n };\n }\n\n return tinycolor;\n\n}));\n","// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n","import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The IANA name of this zone.\n * Defaults to `name` if not overwritten by a subclass.\n * @abstract\n * @type {string}\n */\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n","import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /**\n * The type of zone. `iana` for all instances of `IANAZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"iana\";\n }\n\n /**\n * The name of this zone (i.e. the IANA zone name).\n * @override\n * @type {string}\n */\n get name() {\n return this.zoneName;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns false for all IANA zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return false;\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @override\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /**\n * Return whether this Zone is valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return this.valid;\n }\n}\n","import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n\n toString() {\n return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;\n }\n}\n","import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /**\n * The type of zone. `fixed` for all instances of `FixedOffsetZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"fixed\";\n }\n\n /**\n * The name of this zone.\n * All fixed zones' names always start with \"UTC\" (plus optional offset)\n * @override\n * @type {string}\n */\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n /**\n * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn`\n *\n * @override\n * @type {string}\n */\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /**\n * Returns the offset's common name at the specified timestamp.\n *\n * For fixed offset zones this equals to the zone name.\n * @override\n */\n offsetName() {\n return this.name;\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns true for all fixed offset zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return true;\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n *\n * For fixed offset zones, this is constant and does not depend on a timestamp.\n * @override\n * @return {number}\n */\n offset() {\n return this.fixed;\n }\n\n /**\n * Return whether this Zone is equal to another zone (i.e. also fixed and same offset)\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /**\n * Return whether this Zone is valid:\n * All fixed offset zones are valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return true;\n }\n}\n","import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n","/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n","/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\n/**\n * Returns the offset's value as a string\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n","const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\n// cache of {numberingSystem: {append: regex}}\nlet digitRegexCache = {};\nexport function resetDigitRegexCache() {\n digitRegexCache = {};\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n const ns = numberingSystem || \"latn\";\n\n if (!digitRegexCache[ns]) {\n digitRegexCache[ns] = {};\n }\n if (!digitRegexCache[ns][append]) {\n digitRegexCache[ns][append] = new RegExp(`${numberingSystems[ns]}${append}`);\n }\n\n return digitRegexCache[ns][append];\n}\n","import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport DateTime from \"./datetime.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\nimport { resetDigitRegexCache } from \"./impl/digits.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century\n * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n DateTime.resetCache();\n resetDigitRegexCache();\n }\n}\n","export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n","import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n","import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n","import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n","import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n","import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n","import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n","import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport class TokenParser {\n constructor(locale, format) {\n this.locale = locale;\n this.format = format;\n this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale);\n this.units = this.tokens.map((t) => unitForToken(t, locale));\n this.disqualifyingUnit = this.units.find((t) => t.invalidReason);\n\n if (!this.disqualifyingUnit) {\n const [regexString, handlers] = buildRegex(this.units);\n this.regex = RegExp(regexString, \"i\");\n this.handlers = handlers;\n }\n }\n\n explainFromTokens(input) {\n if (!this.isValid) {\n return { input, tokens: this.tokens, invalidReason: this.invalidReason };\n } else {\n const [rawMatches, matches] = match(input, this.regex, this.handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return {\n input,\n tokens: this.tokens,\n regex: this.regex,\n rawMatches,\n matches,\n result,\n zone,\n specificOffset,\n };\n }\n }\n\n get isValid() {\n return !this.disqualifyingUnit;\n }\n\n get invalidReason() {\n return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;\n }\n}\n\nexport function explainFromTokens(locale, input, format) {\n const parser = new TokenParser(locale, format);\n return parser.explainFromTokens(input);\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n","import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n TokenParser,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// cache offsets for zones based on the current timestamp when this function is\n// first called. When we are handling a datetime from components like (year,\n// month, day, hour) in a time zone, we need a guess about what the timezone\n// offset is so that we can convert into a UTC timestamp. One way is to find the\n// offset of now in the zone. The actual date may have a different offset (for\n// example, if we handle a date in June while we're in December in a zone that\n// observes DST), but we can check and adjust that.\n//\n// When handling many dates, calculating the offset for now every time is\n// expensive. It's just a guess, so we can cache the offset to use even if we\n// are right on a time change boundary (we'll just correct in the other\n// direction). Using a timestamp from first read is a slight optimization for\n// handling dates close to the current date, since those dates will usually be\n// in the same offset (we could set the timestamp statically, instead). We use a\n// single timestamp for all zones to make things a bit more predictable.\n//\n// This is safe for quickDT (used by local() and utc()) because we don't fill in\n// higher-order units from tsNow (as we do in fromObject, this requires that\n// offset is calculated from tsNow).\nfunction guessOffsetForZone(zone) {\n if (!zoneOffsetGuessCache[zone]) {\n if (zoneOffsetTs === undefined) {\n zoneOffsetTs = Settings.now();\n }\n\n zoneOffsetGuessCache[zone] = zone.offset(zoneOffsetTs);\n }\n return zoneOffsetGuessCache[zone];\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n }\n\n const loc = Locale.fromObject(opts);\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = guessOffsetForZone(zone);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = Settings.now();\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * Timestamp to use for cached zone offset guesses (exposed for test)\n */\nlet zoneOffsetTs;\n/**\n * Cache for zone offset guesses (exposed for test).\n *\n * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of\n * zone.offset().\n */\nlet zoneOffsetGuessCache = {};\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n // If an offset has been passed and we have not been called from\n // clone(), we can trust it and avoid the offset calculation.\n const ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n if (!inst.isValid) {\n return DateTime.invalid(inst.invalid);\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n static resetCache() {\n zoneOffsetTs = undefined;\n zoneOffsetGuessCache = {};\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n /**\n * Build a parser for `fmt` using the given locale. This parser can be passed\n * to {@link DateTime.fromFormatParser} to a parse a date in this format. This\n * can be used to optimize cases where many dates need to be parsed in a\n * specific format.\n *\n * @param {String} fmt - the format the string is expected to be in (see\n * description)\n * @param {Object} options - options used to set locale and numberingSystem\n * for parser\n * @returns {TokenParser} - opaque object to be used\n */\n static buildFormatParser(fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return new TokenParser(localeToUse, fmt);\n }\n\n /**\n * Create a DateTime from an input string and format parser.\n *\n * The format parser must have been created with the same locale as this call.\n *\n * @param {String} text - the string to parse\n * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser}\n * @param {Object} opts - options taken by fromFormat()\n * @returns {DateTime}\n */\n static fromFormatParser(text, formatParser, opts = {}) {\n if (isUndefined(text) || isUndefined(formatParser)) {\n throw new InvalidArgumentError(\n \"fromFormatParser requires an input string and a format parser\"\n );\n }\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n\n if (!localeToUse.equals(formatParser.locale)) {\n throw new InvalidArgumentError(\n `fromFormatParser called with a locale of ${localeToUse}, ` +\n `but the format parser was created for ${formatParser.locale}`\n );\n }\n\n const { result, zone, specificOffset, invalidReason } = formatParser.explainFromTokens(text);\n\n if (invalidReason) {\n return DateTime.invalid(invalidReason);\n } else {\n return parseDataToDateTime(\n result,\n zone,\n opts,\n `format ${formatParser.format}`,\n text,\n specificOffset\n );\n }\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n","export default function makeCancellablePromise(promise) {\n var isCancelled = false;\n var wrappedPromise = new Promise(function (resolve, reject) {\n promise\n .then(function (value) { return !isCancelled && resolve(value); })\n .catch(function (error) { return !isCancelled && reject(error); });\n });\n return {\n promise: wrappedPromise,\n cancel: function () {\n isCancelled = true;\n },\n };\n}\n","var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n// As defined on the list of supported events: https://reactjs.org/docs/events.html\nexport var clipboardEvents = ['onCopy', 'onCut', 'onPaste'];\nexport var compositionEvents = [\n 'onCompositionEnd',\n 'onCompositionStart',\n 'onCompositionUpdate',\n];\nexport var focusEvents = ['onFocus', 'onBlur'];\nexport var formEvents = ['onInput', 'onInvalid', 'onReset', 'onSubmit'];\nexport var imageEvents = ['onLoad', 'onError'];\nexport var keyboardEvents = ['onKeyDown', 'onKeyPress', 'onKeyUp'];\nexport var mediaEvents = [\n 'onAbort',\n 'onCanPlay',\n 'onCanPlayThrough',\n 'onDurationChange',\n 'onEmptied',\n 'onEncrypted',\n 'onEnded',\n 'onError',\n 'onLoadedData',\n 'onLoadedMetadata',\n 'onLoadStart',\n 'onPause',\n 'onPlay',\n 'onPlaying',\n 'onProgress',\n 'onRateChange',\n 'onSeeked',\n 'onSeeking',\n 'onStalled',\n 'onSuspend',\n 'onTimeUpdate',\n 'onVolumeChange',\n 'onWaiting',\n];\nexport var mouseEvents = [\n 'onClick',\n 'onContextMenu',\n 'onDoubleClick',\n 'onMouseDown',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n];\nexport var dragEvents = [\n 'onDrag',\n 'onDragEnd',\n 'onDragEnter',\n 'onDragExit',\n 'onDragLeave',\n 'onDragOver',\n 'onDragStart',\n 'onDrop',\n];\nexport var selectionEvents = ['onSelect'];\nexport var touchEvents = ['onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart'];\nexport var pointerEvents = [\n 'onPointerDown',\n 'onPointerMove',\n 'onPointerUp',\n 'onPointerCancel',\n 'onGotPointerCapture',\n 'onLostPointerCapture',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerOver',\n 'onPointerOut',\n];\nexport var uiEvents = ['onScroll'];\nexport var wheelEvents = ['onWheel'];\nexport var animationEvents = [\n 'onAnimationStart',\n 'onAnimationEnd',\n 'onAnimationIteration',\n];\nexport var transitionEvents = ['onTransitionEnd'];\nexport var otherEvents = ['onToggle'];\nexport var changeEvents = ['onChange'];\nexport var allEvents = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], clipboardEvents, true), compositionEvents, true), focusEvents, true), formEvents, true), imageEvents, true), keyboardEvents, true), mediaEvents, true), mouseEvents, true), dragEvents, true), selectionEvents, true), touchEvents, true), pointerEvents, true), uiEvents, true), wheelEvents, true), animationEvents, true), transitionEvents, true), changeEvents, true), otherEvents, true);\n/**\n * Returns an object with on-event callback props curried with provided args.\n * @param {Object} props Props passed to a component.\n * @param {Function=} getArgs A function that returns argument(s) on-event callbacks\n * shall be curried with.\n */\nexport default function makeEventProps(props, getArgs) {\n var eventProps = {};\n allEvents.forEach(function (eventName) {\n var eventHandler = props[eventName];\n if (!eventHandler) {\n return;\n }\n if (getArgs) {\n eventProps[eventName] = (function (event) {\n return eventHandler(event, getArgs(eventName));\n });\n }\n else {\n eventProps[eventName] = eventHandler;\n }\n });\n return eventProps;\n}\n","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals process */\n\n// NW.js / Electron is a browser context, but copies some Node.js objects; see\n// http://docs.nwjs.io/en/latest/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/#access-nodejs-and-nwjs-api-in-browser-context\n// https://www.electronjs.org/docs/api/process#processversionselectron-readonly\n// https://www.electronjs.org/docs/api/process#processtype-readonly\nconst isNodeJS =\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n typeof process === \"object\" &&\n process + \"\" === \"[object process]\" &&\n !process.versions.nw &&\n !(process.versions.electron && process.type && process.type !== \"browser\");\n\nconst IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];\nconst FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];\n\nconst MAX_IMAGE_SIZE_TO_CACHE = 10e6; // Ten megabytes.\n\n// Represent the percentage of the height of a single-line field over\n// the font size. Acrobat seems to use this value.\nconst LINE_FACTOR = 1.35;\nconst LINE_DESCENT_FACTOR = 0.35;\nconst BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR;\n\n/**\n * Refer to the `WorkerTransport.getRenderingIntent`-method in the API, to see\n * how these flags are being used:\n * - ANY, DISPLAY, and PRINT are the normal rendering intents, note the\n * `PDFPageProxy.{render, getOperatorList, getAnnotations}`-methods.\n * - SAVE is used, on the worker-thread, when saving modified annotations.\n * - ANNOTATIONS_FORMS, ANNOTATIONS_STORAGE, ANNOTATIONS_DISABLE control which\n * annotations are rendered onto the canvas (i.e. by being included in the\n * operatorList), note the `PDFPageProxy.{render, getOperatorList}`-methods\n * and their `annotationMode`-option.\n * - IS_EDITING is used when editing is active in the viewer.\n * - OPLIST is used with the `PDFPageProxy.getOperatorList`-method, note the\n * `OperatorList`-constructor (on the worker-thread).\n */\nconst RenderingIntentFlag = {\n ANY: 0x01,\n DISPLAY: 0x02,\n PRINT: 0x04,\n SAVE: 0x08,\n ANNOTATIONS_FORMS: 0x10,\n ANNOTATIONS_STORAGE: 0x20,\n ANNOTATIONS_DISABLE: 0x40,\n IS_EDITING: 0x80,\n OPLIST: 0x100,\n};\n\nconst AnnotationMode = {\n DISABLE: 0,\n ENABLE: 1,\n ENABLE_FORMS: 2,\n ENABLE_STORAGE: 3,\n};\n\nconst AnnotationEditorPrefix = \"pdfjs_internal_editor_\";\n\nconst AnnotationEditorType = {\n DISABLE: -1,\n NONE: 0,\n FREETEXT: 3,\n HIGHLIGHT: 9,\n STAMP: 13,\n INK: 15,\n};\n\nconst AnnotationEditorParamsType = {\n RESIZE: 1,\n CREATE: 2,\n FREETEXT_SIZE: 11,\n FREETEXT_COLOR: 12,\n FREETEXT_OPACITY: 13,\n INK_COLOR: 21,\n INK_THICKNESS: 22,\n INK_OPACITY: 23,\n HIGHLIGHT_COLOR: 31,\n HIGHLIGHT_DEFAULT_COLOR: 32,\n HIGHLIGHT_THICKNESS: 33,\n HIGHLIGHT_FREE: 34,\n HIGHLIGHT_SHOW_ALL: 35,\n};\n\n// Permission flags from Table 22, Section 7.6.3.2 of the PDF specification.\nconst PermissionFlag = {\n PRINT: 0x04,\n MODIFY_CONTENTS: 0x08,\n COPY: 0x10,\n MODIFY_ANNOTATIONS: 0x20,\n FILL_INTERACTIVE_FORMS: 0x100,\n COPY_FOR_ACCESSIBILITY: 0x200,\n ASSEMBLE: 0x400,\n PRINT_HIGH_QUALITY: 0x800,\n};\n\nconst TextRenderingMode = {\n FILL: 0,\n STROKE: 1,\n FILL_STROKE: 2,\n INVISIBLE: 3,\n FILL_ADD_TO_PATH: 4,\n STROKE_ADD_TO_PATH: 5,\n FILL_STROKE_ADD_TO_PATH: 6,\n ADD_TO_PATH: 7,\n FILL_STROKE_MASK: 3,\n ADD_TO_PATH_FLAG: 4,\n};\n\nconst ImageKind = {\n GRAYSCALE_1BPP: 1,\n RGB_24BPP: 2,\n RGBA_32BPP: 3,\n};\n\nconst AnnotationType = {\n TEXT: 1,\n LINK: 2,\n FREETEXT: 3,\n LINE: 4,\n SQUARE: 5,\n CIRCLE: 6,\n POLYGON: 7,\n POLYLINE: 8,\n HIGHLIGHT: 9,\n UNDERLINE: 10,\n SQUIGGLY: 11,\n STRIKEOUT: 12,\n STAMP: 13,\n CARET: 14,\n INK: 15,\n POPUP: 16,\n FILEATTACHMENT: 17,\n SOUND: 18,\n MOVIE: 19,\n WIDGET: 20,\n SCREEN: 21,\n PRINTERMARK: 22,\n TRAPNET: 23,\n WATERMARK: 24,\n THREED: 25,\n REDACT: 26,\n};\n\nconst AnnotationReplyType = {\n GROUP: \"Group\",\n REPLY: \"R\",\n};\n\nconst AnnotationFlag = {\n INVISIBLE: 0x01,\n HIDDEN: 0x02,\n PRINT: 0x04,\n NOZOOM: 0x08,\n NOROTATE: 0x10,\n NOVIEW: 0x20,\n READONLY: 0x40,\n LOCKED: 0x80,\n TOGGLENOVIEW: 0x100,\n LOCKEDCONTENTS: 0x200,\n};\n\nconst AnnotationFieldFlag = {\n READONLY: 0x0000001,\n REQUIRED: 0x0000002,\n NOEXPORT: 0x0000004,\n MULTILINE: 0x0001000,\n PASSWORD: 0x0002000,\n NOTOGGLETOOFF: 0x0004000,\n RADIO: 0x0008000,\n PUSHBUTTON: 0x0010000,\n COMBO: 0x0020000,\n EDIT: 0x0040000,\n SORT: 0x0080000,\n FILESELECT: 0x0100000,\n MULTISELECT: 0x0200000,\n DONOTSPELLCHECK: 0x0400000,\n DONOTSCROLL: 0x0800000,\n COMB: 0x1000000,\n RICHTEXT: 0x2000000,\n RADIOSINUNISON: 0x2000000,\n COMMITONSELCHANGE: 0x4000000,\n};\n\nconst AnnotationBorderStyleType = {\n SOLID: 1,\n DASHED: 2,\n BEVELED: 3,\n INSET: 4,\n UNDERLINE: 5,\n};\n\nconst AnnotationActionEventType = {\n E: \"Mouse Enter\",\n X: \"Mouse Exit\",\n D: \"Mouse Down\",\n U: \"Mouse Up\",\n Fo: \"Focus\",\n Bl: \"Blur\",\n PO: \"PageOpen\",\n PC: \"PageClose\",\n PV: \"PageVisible\",\n PI: \"PageInvisible\",\n K: \"Keystroke\",\n F: \"Format\",\n V: \"Validate\",\n C: \"Calculate\",\n};\n\nconst DocumentActionEventType = {\n WC: \"WillClose\",\n WS: \"WillSave\",\n DS: \"DidSave\",\n WP: \"WillPrint\",\n DP: \"DidPrint\",\n};\n\nconst PageActionEventType = {\n O: \"PageOpen\",\n C: \"PageClose\",\n};\n\nconst VerbosityLevel = {\n ERRORS: 0,\n WARNINGS: 1,\n INFOS: 5,\n};\n\n// All the possible operations for an operator list.\nconst OPS = {\n // Intentionally start from 1 so it is easy to spot bad operators that will be\n // 0's.\n // PLEASE NOTE: We purposely keep any removed operators commented out, since\n // re-numbering the list would risk breaking third-party users.\n dependency: 1,\n setLineWidth: 2,\n setLineCap: 3,\n setLineJoin: 4,\n setMiterLimit: 5,\n setDash: 6,\n setRenderingIntent: 7,\n setFlatness: 8,\n setGState: 9,\n save: 10,\n restore: 11,\n transform: 12,\n moveTo: 13,\n lineTo: 14,\n curveTo: 15,\n curveTo2: 16,\n curveTo3: 17,\n closePath: 18,\n rectangle: 19,\n stroke: 20,\n closeStroke: 21,\n fill: 22,\n eoFill: 23,\n fillStroke: 24,\n eoFillStroke: 25,\n closeFillStroke: 26,\n closeEOFillStroke: 27,\n endPath: 28,\n clip: 29,\n eoClip: 30,\n beginText: 31,\n endText: 32,\n setCharSpacing: 33,\n setWordSpacing: 34,\n setHScale: 35,\n setLeading: 36,\n setFont: 37,\n setTextRenderingMode: 38,\n setTextRise: 39,\n moveText: 40,\n setLeadingMoveText: 41,\n setTextMatrix: 42,\n nextLine: 43,\n showText: 44,\n showSpacedText: 45,\n nextLineShowText: 46,\n nextLineSetSpacingShowText: 47,\n setCharWidth: 48,\n setCharWidthAndBounds: 49,\n setStrokeColorSpace: 50,\n setFillColorSpace: 51,\n setStrokeColor: 52,\n setStrokeColorN: 53,\n setFillColor: 54,\n setFillColorN: 55,\n setStrokeGray: 56,\n setFillGray: 57,\n setStrokeRGBColor: 58,\n setFillRGBColor: 59,\n setStrokeCMYKColor: 60,\n setFillCMYKColor: 61,\n shadingFill: 62,\n beginInlineImage: 63,\n beginImageData: 64,\n endInlineImage: 65,\n paintXObject: 66,\n markPoint: 67,\n markPointProps: 68,\n beginMarkedContent: 69,\n beginMarkedContentProps: 70,\n endMarkedContent: 71,\n beginCompat: 72,\n endCompat: 73,\n paintFormXObjectBegin: 74,\n paintFormXObjectEnd: 75,\n beginGroup: 76,\n endGroup: 77,\n // beginAnnotations: 78,\n // endAnnotations: 79,\n beginAnnotation: 80,\n endAnnotation: 81,\n // paintJpegXObject: 82,\n paintImageMaskXObject: 83,\n paintImageMaskXObjectGroup: 84,\n paintImageXObject: 85,\n paintInlineImageXObject: 86,\n paintInlineImageXObjectGroup: 87,\n paintImageXObjectRepeat: 88,\n paintImageMaskXObjectRepeat: 89,\n paintSolidColorImageMask: 90,\n constructPath: 91,\n setStrokeTransparent: 92,\n setFillTransparent: 93,\n};\n\nconst PasswordResponses = {\n NEED_PASSWORD: 1,\n INCORRECT_PASSWORD: 2,\n};\n\nlet verbosity = VerbosityLevel.WARNINGS;\n\nfunction setVerbosityLevel(level) {\n if (Number.isInteger(level)) {\n verbosity = level;\n }\n}\n\nfunction getVerbosityLevel() {\n return verbosity;\n}\n\n// A notice for devs. These are good for things that are helpful to devs, such\n// as warning that Workers were disabled, which is important to devs but not\n// end users.\nfunction info(msg) {\n if (verbosity >= VerbosityLevel.INFOS) {\n console.log(`Info: ${msg}`);\n }\n}\n\n// Non-fatal warnings.\nfunction warn(msg) {\n if (verbosity >= VerbosityLevel.WARNINGS) {\n console.log(`Warning: ${msg}`);\n }\n}\n\nfunction unreachable(msg) {\n throw new Error(msg);\n}\n\nfunction assert(cond, msg) {\n if (!cond) {\n unreachable(msg);\n }\n}\n\n// Checks if URLs use one of the allowed protocols, e.g. to avoid XSS.\nfunction _isValidProtocol(url) {\n switch (url?.protocol) {\n case \"http:\":\n case \"https:\":\n case \"ftp:\":\n case \"mailto:\":\n case \"tel:\":\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Attempts to create a valid absolute URL.\n *\n * @param {URL|string} url - An absolute, or relative, URL.\n * @param {URL|string} [baseUrl] - An absolute URL.\n * @param {Object} [options]\n * @returns Either a valid {URL}, or `null` otherwise.\n */\nfunction createValidAbsoluteUrl(url, baseUrl = null, options = null) {\n if (!url) {\n return null;\n }\n try {\n if (options && typeof url === \"string\") {\n // Let URLs beginning with \"www.\" default to using the \"http://\" protocol.\n if (options.addDefaultProtocol && url.startsWith(\"www.\")) {\n const dots = url.match(/\\./g);\n // Avoid accidentally matching a *relative* URL pointing to a file named\n // e.g. \"www.pdf\" or similar.\n if (dots?.length >= 2) {\n url = `http://${url}`;\n }\n }\n\n // According to ISO 32000-1:2008, section 12.6.4.7, URIs should be encoded\n // in 7-bit ASCII. Some bad PDFs use UTF-8 encoding; see bug 1122280.\n if (options.tryConvertEncoding) {\n try {\n url = stringToUTF8String(url);\n } catch {}\n }\n }\n\n const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url);\n if (_isValidProtocol(absoluteUrl)) {\n return absoluteUrl;\n }\n } catch {\n /* `new URL()` will throw on incorrect data. */\n }\n return null;\n}\n\nfunction shadow(obj, prop, value, nonSerializable = false) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n prop in obj,\n `shadow: Property \"${prop && prop.toString()}\" not found in object.`\n );\n }\n Object.defineProperty(obj, prop, {\n value,\n enumerable: !nonSerializable,\n configurable: true,\n writable: false,\n });\n return value;\n}\n\n/**\n * @type {any}\n */\nconst BaseException = (function BaseExceptionClosure() {\n // eslint-disable-next-line no-shadow\n function BaseException(message, name) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseException\n ) {\n unreachable(\"Cannot initialize BaseException.\");\n }\n this.message = message;\n this.name = name;\n }\n BaseException.prototype = new Error();\n BaseException.constructor = BaseException;\n\n return BaseException;\n})();\n\nclass PasswordException extends BaseException {\n constructor(msg, code) {\n super(msg, \"PasswordException\");\n this.code = code;\n }\n}\n\nclass UnknownErrorException extends BaseException {\n constructor(msg, details) {\n super(msg, \"UnknownErrorException\");\n this.details = details;\n }\n}\n\nclass InvalidPDFException extends BaseException {\n constructor(msg) {\n super(msg, \"InvalidPDFException\");\n }\n}\n\nclass MissingPDFException extends BaseException {\n constructor(msg) {\n super(msg, \"MissingPDFException\");\n }\n}\n\nclass UnexpectedResponseException extends BaseException {\n constructor(msg, status) {\n super(msg, \"UnexpectedResponseException\");\n this.status = status;\n }\n}\n\n/**\n * Error caused during parsing PDF data.\n */\nclass FormatError extends BaseException {\n constructor(msg) {\n super(msg, \"FormatError\");\n }\n}\n\n/**\n * Error used to indicate task cancellation.\n */\nclass AbortException extends BaseException {\n constructor(msg) {\n super(msg, \"AbortException\");\n }\n}\n\nfunction bytesToString(bytes) {\n if (typeof bytes !== \"object\" || bytes?.length === undefined) {\n unreachable(\"Invalid argument for bytesToString\");\n }\n const length = bytes.length;\n const MAX_ARGUMENT_COUNT = 8192;\n if (length < MAX_ARGUMENT_COUNT) {\n return String.fromCharCode.apply(null, bytes);\n }\n const strBuf = [];\n for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) {\n const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);\n const chunk = bytes.subarray(i, chunkEnd);\n strBuf.push(String.fromCharCode.apply(null, chunk));\n }\n return strBuf.join(\"\");\n}\n\nfunction stringToBytes(str) {\n if (typeof str !== \"string\") {\n unreachable(\"Invalid argument for stringToBytes\");\n }\n const length = str.length;\n const bytes = new Uint8Array(length);\n for (let i = 0; i < length; ++i) {\n bytes[i] = str.charCodeAt(i) & 0xff;\n }\n return bytes;\n}\n\nfunction string32(value) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n typeof value === \"number\" && Math.abs(value) < 2 ** 32,\n `string32: Unexpected input \"${value}\".`\n );\n }\n return String.fromCharCode(\n (value >> 24) & 0xff,\n (value >> 16) & 0xff,\n (value >> 8) & 0xff,\n value & 0xff\n );\n}\n\nfunction objectSize(obj) {\n return Object.keys(obj).length;\n}\n\n// Ensure that the returned Object has a `null` prototype; hence why\n// `Object.fromEntries(...)` is not used.\nfunction objectFromMap(map) {\n const obj = Object.create(null);\n for (const [key, value] of map) {\n obj[key] = value;\n }\n return obj;\n}\n\n// Checks the endianness of the platform.\nfunction isLittleEndian() {\n const buffer8 = new Uint8Array(4);\n buffer8[0] = 1;\n const view32 = new Uint32Array(buffer8.buffer, 0, 1);\n return view32[0] === 1;\n}\n\n// Checks if it's possible to eval JS expressions.\nfunction isEvalSupported() {\n try {\n new Function(\"\"); // eslint-disable-line no-new, no-new-func\n return true;\n } catch {\n return false;\n }\n}\n\nclass FeatureTest {\n static get isLittleEndian() {\n return shadow(this, \"isLittleEndian\", isLittleEndian());\n }\n\n static get isEvalSupported() {\n return shadow(this, \"isEvalSupported\", isEvalSupported());\n }\n\n static get isOffscreenCanvasSupported() {\n return shadow(\n this,\n \"isOffscreenCanvasSupported\",\n typeof OffscreenCanvas !== \"undefined\"\n );\n }\n\n static get platform() {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n (typeof navigator !== \"undefined\" &&\n typeof navigator?.platform === \"string\")\n ) {\n return shadow(this, \"platform\", {\n isMac: navigator.platform.includes(\"Mac\"),\n isWindows: navigator.platform.includes(\"Win\"),\n isFirefox:\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n (typeof navigator?.userAgent === \"string\" &&\n navigator.userAgent.includes(\"Firefox\")),\n });\n }\n return shadow(this, \"platform\", {\n isMac: false,\n isWindows: false,\n isFirefox: false,\n });\n }\n\n static get isCSSRoundSupported() {\n return shadow(\n this,\n \"isCSSRoundSupported\",\n globalThis.CSS?.supports?.(\"width: round(1.5px, 1px)\")\n );\n }\n}\n\nconst hexNumbers = Array.from(Array(256).keys(), n =>\n n.toString(16).padStart(2, \"0\")\n);\n\nclass Util {\n static makeHexColor(r, g, b) {\n return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`;\n }\n\n // Apply a scaling matrix to some min/max values.\n // If a scaling factor is negative then min and max must be\n // swapped.\n static scaleMinMax(transform, minMax) {\n let temp;\n if (transform[0]) {\n if (transform[0] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[2];\n minMax[2] = temp;\n }\n minMax[0] *= transform[0];\n minMax[2] *= transform[0];\n\n if (transform[3] < 0) {\n temp = minMax[1];\n minMax[1] = minMax[3];\n minMax[3] = temp;\n }\n minMax[1] *= transform[3];\n minMax[3] *= transform[3];\n } else {\n temp = minMax[0];\n minMax[0] = minMax[1];\n minMax[1] = temp;\n temp = minMax[2];\n minMax[2] = minMax[3];\n minMax[3] = temp;\n\n if (transform[1] < 0) {\n temp = minMax[1];\n minMax[1] = minMax[3];\n minMax[3] = temp;\n }\n minMax[1] *= transform[1];\n minMax[3] *= transform[1];\n\n if (transform[2] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[2];\n minMax[2] = temp;\n }\n minMax[0] *= transform[2];\n minMax[2] *= transform[2];\n }\n minMax[0] += transform[4];\n minMax[1] += transform[5];\n minMax[2] += transform[4];\n minMax[3] += transform[5];\n }\n\n // Concatenates two transformation matrices together and returns the result.\n static transform(m1, m2) {\n return [\n m1[0] * m2[0] + m1[2] * m2[1],\n m1[1] * m2[0] + m1[3] * m2[1],\n m1[0] * m2[2] + m1[2] * m2[3],\n m1[1] * m2[2] + m1[3] * m2[3],\n m1[0] * m2[4] + m1[2] * m2[5] + m1[4],\n m1[1] * m2[4] + m1[3] * m2[5] + m1[5],\n ];\n }\n\n // For 2d affine transforms\n static applyTransform(p, m) {\n const xt = p[0] * m[0] + p[1] * m[2] + m[4];\n const yt = p[0] * m[1] + p[1] * m[3] + m[5];\n return [xt, yt];\n }\n\n static applyInverseTransform(p, m) {\n const d = m[0] * m[3] - m[1] * m[2];\n const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;\n const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;\n return [xt, yt];\n }\n\n // Applies the transform to the rectangle and finds the minimum axially\n // aligned bounding box.\n static getAxialAlignedBoundingBox(r, m) {\n const p1 = this.applyTransform(r, m);\n const p2 = this.applyTransform(r.slice(2, 4), m);\n const p3 = this.applyTransform([r[0], r[3]], m);\n const p4 = this.applyTransform([r[2], r[1]], m);\n return [\n Math.min(p1[0], p2[0], p3[0], p4[0]),\n Math.min(p1[1], p2[1], p3[1], p4[1]),\n Math.max(p1[0], p2[0], p3[0], p4[0]),\n Math.max(p1[1], p2[1], p3[1], p4[1]),\n ];\n }\n\n static inverseTransform(m) {\n const d = m[0] * m[3] - m[1] * m[2];\n return [\n m[3] / d,\n -m[1] / d,\n -m[2] / d,\n m[0] / d,\n (m[2] * m[5] - m[4] * m[3]) / d,\n (m[4] * m[1] - m[5] * m[0]) / d,\n ];\n }\n\n // This calculation uses Singular Value Decomposition.\n // The SVD can be represented with formula A = USV. We are interested in the\n // matrix S here because it represents the scale values.\n static singularValueDecompose2dScale(m) {\n const transpose = [m[0], m[2], m[1], m[3]];\n\n // Multiply matrix m with its transpose.\n const a = m[0] * transpose[0] + m[1] * transpose[2];\n const b = m[0] * transpose[1] + m[1] * transpose[3];\n const c = m[2] * transpose[0] + m[3] * transpose[2];\n const d = m[2] * transpose[1] + m[3] * transpose[3];\n\n // Solve the second degree polynomial to get roots.\n const first = (a + d) / 2;\n const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2;\n const sx = first + second || 1;\n const sy = first - second || 1;\n\n // Scale values are the square roots of the eigenvalues.\n return [Math.sqrt(sx), Math.sqrt(sy)];\n }\n\n // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2)\n // For coordinate systems whose origin lies in the bottom-left, this\n // means normalization to (BL,TR) ordering. For systems with origin in the\n // top-left, this means (TL,BR) ordering.\n static normalizeRect(rect) {\n const r = rect.slice(0); // clone rect\n if (rect[0] > rect[2]) {\n r[0] = rect[2];\n r[2] = rect[0];\n }\n if (rect[1] > rect[3]) {\n r[1] = rect[3];\n r[3] = rect[1];\n }\n return r;\n }\n\n // Returns a rectangle [x1, y1, x2, y2] corresponding to the\n // intersection of rect1 and rect2. If no intersection, returns 'null'\n // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2]\n static intersect(rect1, rect2) {\n const xLow = Math.max(\n Math.min(rect1[0], rect1[2]),\n Math.min(rect2[0], rect2[2])\n );\n const xHigh = Math.min(\n Math.max(rect1[0], rect1[2]),\n Math.max(rect2[0], rect2[2])\n );\n if (xLow > xHigh) {\n return null;\n }\n const yLow = Math.max(\n Math.min(rect1[1], rect1[3]),\n Math.min(rect2[1], rect2[3])\n );\n const yHigh = Math.min(\n Math.max(rect1[1], rect1[3]),\n Math.max(rect2[1], rect2[3])\n );\n if (yLow > yHigh) {\n return null;\n }\n\n return [xLow, yLow, xHigh, yHigh];\n }\n\n static #getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, t, minMax) {\n if (t <= 0 || t >= 1) {\n return;\n }\n const mt = 1 - t;\n const tt = t * t;\n const ttt = tt * t;\n const x = mt * (mt * (mt * x0 + 3 * t * x1) + 3 * tt * x2) + ttt * x3;\n const y = mt * (mt * (mt * y0 + 3 * t * y1) + 3 * tt * y2) + ttt * y3;\n minMax[0] = Math.min(minMax[0], x);\n minMax[1] = Math.min(minMax[1], y);\n minMax[2] = Math.max(minMax[2], x);\n minMax[3] = Math.max(minMax[3], y);\n }\n\n static #getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, a, b, c, minMax) {\n if (Math.abs(a) < 1e-12) {\n if (Math.abs(b) >= 1e-12) {\n this.#getExtremumOnCurve(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n -c / b,\n minMax\n );\n }\n return;\n }\n\n const delta = b ** 2 - 4 * c * a;\n if (delta < 0) {\n return;\n }\n const sqrtDelta = Math.sqrt(delta);\n const a2 = 2 * a;\n this.#getExtremumOnCurve(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n (-b + sqrtDelta) / a2,\n minMax\n );\n this.#getExtremumOnCurve(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n (-b - sqrtDelta) / a2,\n minMax\n );\n }\n\n // From https://github.com/adobe-webplatform/Snap.svg/blob/b365287722a72526000ac4bfcf0ce4cac2faa015/src/path.js#L852\n static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax) {\n if (minMax) {\n minMax[0] = Math.min(minMax[0], x0, x3);\n minMax[1] = Math.min(minMax[1], y0, y3);\n minMax[2] = Math.max(minMax[2], x0, x3);\n minMax[3] = Math.max(minMax[3], y0, y3);\n } else {\n minMax = [\n Math.min(x0, x3),\n Math.min(y0, y3),\n Math.max(x0, x3),\n Math.max(y0, y3),\n ];\n }\n this.#getExtremum(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n 3 * (-x0 + 3 * (x1 - x2) + x3),\n 6 * (x0 - 2 * x1 + x2),\n 3 * (x1 - x0),\n minMax\n );\n this.#getExtremum(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n 3 * (-y0 + 3 * (y1 - y2) + y3),\n 6 * (y0 - 2 * y1 + y2),\n 3 * (y1 - y0),\n minMax\n );\n return minMax;\n }\n}\n\nconst PDFStringTranslateTable = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8,\n 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192,\n 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018,\n 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d,\n 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac,\n];\n\nfunction stringToPDFString(str) {\n // See section 7.9.2.2 Text String Type.\n // The string can contain some language codes bracketed with 0x0b,\n // so we must remove them.\n if (str[0] >= \"\\xEF\") {\n let encoding;\n if (str[0] === \"\\xFE\" && str[1] === \"\\xFF\") {\n encoding = \"utf-16be\";\n if (str.length % 2 === 1) {\n str = str.slice(0, -1);\n }\n } else if (str[0] === \"\\xFF\" && str[1] === \"\\xFE\") {\n encoding = \"utf-16le\";\n if (str.length % 2 === 1) {\n str = str.slice(0, -1);\n }\n } else if (str[0] === \"\\xEF\" && str[1] === \"\\xBB\" && str[2] === \"\\xBF\") {\n encoding = \"utf-8\";\n }\n\n if (encoding) {\n try {\n const decoder = new TextDecoder(encoding, { fatal: true });\n const buffer = stringToBytes(str);\n const decoded = decoder.decode(buffer);\n if (!decoded.includes(\"\\x1b\")) {\n return decoded;\n }\n return decoded.replaceAll(/\\x1b[^\\x1b]*(?:\\x1b|$)/g, \"\");\n } catch (ex) {\n warn(`stringToPDFString: \"${ex}\".`);\n }\n }\n }\n // ISO Latin 1\n const strBuf = [];\n for (let i = 0, ii = str.length; i < ii; i++) {\n const charCode = str.charCodeAt(i);\n if (charCode === 0x1b) {\n // eslint-disable-next-line no-empty\n while (++i < ii && str.charCodeAt(i) !== 0x1b) {}\n continue;\n }\n const code = PDFStringTranslateTable[charCode];\n strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));\n }\n return strBuf.join(\"\");\n}\n\nfunction stringToUTF8String(str) {\n return decodeURIComponent(escape(str));\n}\n\nfunction utf8StringToString(str) {\n return unescape(encodeURIComponent(str));\n}\n\nfunction isArrayEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n for (let i = 0, ii = arr1.length; i < ii; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction getModificationDate(date = new Date()) {\n const buffer = [\n date.getUTCFullYear().toString(),\n (date.getUTCMonth() + 1).toString().padStart(2, \"0\"),\n date.getUTCDate().toString().padStart(2, \"0\"),\n date.getUTCHours().toString().padStart(2, \"0\"),\n date.getUTCMinutes().toString().padStart(2, \"0\"),\n date.getUTCSeconds().toString().padStart(2, \"0\"),\n ];\n\n return buffer.join(\"\");\n}\n\nlet NormalizeRegex = null;\nlet NormalizationMap = null;\nfunction normalizeUnicode(str) {\n if (!NormalizeRegex) {\n // In order to generate the following regex:\n // - create a PDF containing all the chars in the range 0000-FFFF with\n // a NFKC which is different of the char.\n // - copy and paste all those chars and get the ones where NFKC is\n // required.\n // It appears that most the chars here contain some ligatures.\n NormalizeRegex =\n /([\\u00a0\\u00b5\\u037e\\u0eb3\\u2000-\\u200a\\u202f\\u2126\\ufb00-\\ufb04\\ufb06\\ufb20-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufba1\\ufba4-\\ufba9\\ufbae-\\ufbb1\\ufbd3-\\ufbdc\\ufbde-\\ufbe7\\ufbea-\\ufbf8\\ufbfc-\\ufbfd\\ufc00-\\ufc5d\\ufc64-\\ufcf1\\ufcf5-\\ufd3d\\ufd88\\ufdf4\\ufdfa-\\ufdfb\\ufe71\\ufe77\\ufe79\\ufe7b\\ufe7d]+)|(\\ufb05+)/gu;\n NormalizationMap = new Map([[\"ſt\", \"ſt\"]]);\n }\n return str.replaceAll(NormalizeRegex, (_, p1, p2) =>\n p1 ? p1.normalize(\"NFKC\") : NormalizationMap.get(p2)\n );\n}\n\nfunction getUuid() {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n (typeof crypto !== \"undefined\" && typeof crypto?.randomUUID === \"function\")\n ) {\n return crypto.randomUUID();\n }\n const buf = new Uint8Array(32);\n if (\n typeof crypto !== \"undefined\" &&\n typeof crypto?.getRandomValues === \"function\"\n ) {\n crypto.getRandomValues(buf);\n } else {\n for (let i = 0; i < 32; i++) {\n buf[i] = Math.floor(Math.random() * 255);\n }\n }\n return bytesToString(buf);\n}\n\nconst AnnotationPrefix = \"pdfjs_internal_id_\";\n\nconst FontRenderOps = {\n BEZIER_CURVE_TO: 0,\n MOVE_TO: 1,\n LINE_TO: 2,\n QUADRATIC_CURVE_TO: 3,\n RESTORE: 4,\n SAVE: 5,\n SCALE: 6,\n TRANSFORM: 7,\n TRANSLATE: 8,\n};\n\n// TODO: Remove this once `Uint8Array.prototype.toHex` is generally available.\nfunction toHexUtil(arr) {\n if (Uint8Array.prototype.toHex) {\n return arr.toHex();\n }\n return Array.from(arr, num => hexNumbers[num]).join(\"\");\n}\n\n// TODO: Remove this once `Uint8Array.prototype.toBase64` is generally\n// available.\nfunction toBase64Util(arr) {\n if (Uint8Array.prototype.toBase64) {\n return arr.toBase64();\n }\n return btoa(bytesToString(arr));\n}\n\n// TODO: Remove this once `Uint8Array.fromBase64` is generally available.\nfunction fromBase64Util(str) {\n if (Uint8Array.fromBase64) {\n return Uint8Array.fromBase64(str);\n }\n return stringToBytes(atob(str));\n}\n\nexport {\n AbortException,\n AnnotationActionEventType,\n AnnotationBorderStyleType,\n AnnotationEditorParamsType,\n AnnotationEditorPrefix,\n AnnotationEditorType,\n AnnotationFieldFlag,\n AnnotationFlag,\n AnnotationMode,\n AnnotationPrefix,\n AnnotationReplyType,\n AnnotationType,\n assert,\n BaseException,\n BASELINE_FACTOR,\n bytesToString,\n createValidAbsoluteUrl,\n DocumentActionEventType,\n FeatureTest,\n FONT_IDENTITY_MATRIX,\n FontRenderOps,\n FormatError,\n fromBase64Util,\n getModificationDate,\n getUuid,\n getVerbosityLevel,\n hexNumbers,\n IDENTITY_MATRIX,\n ImageKind,\n info,\n InvalidPDFException,\n isArrayEqual,\n isNodeJS,\n LINE_DESCENT_FACTOR,\n LINE_FACTOR,\n MAX_IMAGE_SIZE_TO_CACHE,\n MissingPDFException,\n normalizeUnicode,\n objectFromMap,\n objectSize,\n OPS,\n PageActionEventType,\n PasswordException,\n PasswordResponses,\n PermissionFlag,\n RenderingIntentFlag,\n setVerbosityLevel,\n shadow,\n string32,\n stringToBytes,\n stringToPDFString,\n stringToUTF8String,\n TextRenderingMode,\n toBase64Util,\n toHexUtil,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n utf8StringToString,\n Util,\n VerbosityLevel,\n warn,\n};\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n BaseException,\n FeatureTest,\n shadow,\n Util,\n warn,\n} from \"../shared/util.js\";\n\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\n\nclass PixelsPerInch {\n static CSS = 96.0;\n\n static PDF = 72.0;\n\n static PDF_TO_CSS_UNITS = this.CSS / this.PDF;\n}\n\nasync function fetchData(url, type = \"text\") {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n isValidFetchUrl(url, document.baseURI)\n ) {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n switch (type) {\n case \"arraybuffer\":\n return response.arrayBuffer();\n case \"blob\":\n return response.blob();\n case \"json\":\n return response.json();\n }\n return response.text();\n }\n\n // The Fetch API is not supported.\n return new Promise((resolve, reject) => {\n const request = new XMLHttpRequest();\n request.open(\"GET\", url, /* async = */ true);\n request.responseType = type;\n\n request.onreadystatechange = () => {\n if (request.readyState !== XMLHttpRequest.DONE) {\n return;\n }\n if (request.status === 200 || request.status === 0) {\n switch (type) {\n case \"arraybuffer\":\n case \"blob\":\n case \"json\":\n resolve(request.response);\n return;\n }\n resolve(request.responseText);\n return;\n }\n reject(new Error(request.statusText));\n };\n\n request.send(null);\n });\n}\n\n/**\n * @typedef {Object} PageViewportParameters\n * @property {Array} viewBox - The xMin, yMin, xMax and\n * yMax coordinates.\n * @property {number} scale - The scale of the viewport.\n * @property {number} rotation - The rotation, in degrees, of the viewport.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset. The\n * default value is `0`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset. The\n * default value is `0`.\n * @property {boolean} [dontFlip] - If true, the y-axis will not be flipped.\n * The default value is `false`.\n */\n\n/**\n * @typedef {Object} PageViewportCloneParameters\n * @property {number} [scale] - The scale, overriding the one in the cloned\n * viewport. The default value is `this.scale`.\n * @property {number} [rotation] - The rotation, in degrees, overriding the one\n * in the cloned viewport. The default value is `this.rotation`.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.\n * The default value is `this.offsetX`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.\n * The default value is `this.offsetY`.\n * @property {boolean} [dontFlip] - If true, the x-axis will not be flipped.\n * The default value is `false`.\n */\n\n/**\n * PDF page viewport created based on scale, rotation and offset.\n */\nclass PageViewport {\n /**\n * @param {PageViewportParameters}\n */\n constructor({\n viewBox,\n scale,\n rotation,\n offsetX = 0,\n offsetY = 0,\n dontFlip = false,\n }) {\n this.viewBox = viewBox;\n this.scale = scale;\n this.rotation = rotation;\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n\n // creating transform to convert pdf coordinate system to the normal\n // canvas like coordinates taking in account scale and rotation\n const centerX = (viewBox[2] + viewBox[0]) / 2;\n const centerY = (viewBox[3] + viewBox[1]) / 2;\n let rotateA, rotateB, rotateC, rotateD;\n // Normalize the rotation, by clamping it to the [0, 360) range.\n rotation %= 360;\n if (rotation < 0) {\n rotation += 360;\n }\n switch (rotation) {\n case 180:\n rotateA = -1;\n rotateB = 0;\n rotateC = 0;\n rotateD = 1;\n break;\n case 90:\n rotateA = 0;\n rotateB = 1;\n rotateC = 1;\n rotateD = 0;\n break;\n case 270:\n rotateA = 0;\n rotateB = -1;\n rotateC = -1;\n rotateD = 0;\n break;\n case 0:\n rotateA = 1;\n rotateB = 0;\n rotateC = 0;\n rotateD = -1;\n break;\n default:\n throw new Error(\n \"PageViewport: Invalid rotation, must be a multiple of 90 degrees.\"\n );\n }\n\n if (dontFlip) {\n rotateC = -rotateC;\n rotateD = -rotateD;\n }\n\n let offsetCanvasX, offsetCanvasY;\n let width, height;\n if (rotateA === 0) {\n offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY;\n width = (viewBox[3] - viewBox[1]) * scale;\n height = (viewBox[2] - viewBox[0]) * scale;\n } else {\n offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY;\n width = (viewBox[2] - viewBox[0]) * scale;\n height = (viewBox[3] - viewBox[1]) * scale;\n }\n // creating transform for the following operations:\n // translate(-centerX, -centerY), rotate and flip vertically,\n // scale, and translate(offsetCanvasX, offsetCanvasY)\n this.transform = [\n rotateA * scale,\n rotateB * scale,\n rotateC * scale,\n rotateD * scale,\n offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY,\n offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY,\n ];\n\n this.width = width;\n this.height = height;\n }\n\n /**\n * The original, un-scaled, viewport dimensions.\n * @type {Object}\n */\n get rawDims() {\n const { viewBox } = this;\n return shadow(this, \"rawDims\", {\n pageWidth: viewBox[2] - viewBox[0],\n pageHeight: viewBox[3] - viewBox[1],\n pageX: viewBox[0],\n pageY: viewBox[1],\n });\n }\n\n /**\n * Clones viewport, with optional additional properties.\n * @param {PageViewportCloneParameters} [params]\n * @returns {PageViewport} Cloned viewport.\n */\n clone({\n scale = this.scale,\n rotation = this.rotation,\n offsetX = this.offsetX,\n offsetY = this.offsetY,\n dontFlip = false,\n } = {}) {\n return new PageViewport({\n viewBox: this.viewBox.slice(),\n scale,\n rotation,\n offsetX,\n offsetY,\n dontFlip,\n });\n }\n\n /**\n * Converts PDF point to the viewport coordinates. For examples, useful for\n * converting PDF location into canvas pixel coordinates.\n * @param {number} x - The x-coordinate.\n * @param {number} y - The y-coordinate.\n * @returns {Array} Array containing `x`- and `y`-coordinates of the\n * point in the viewport coordinate space.\n * @see {@link convertToPdfPoint}\n * @see {@link convertToViewportRectangle}\n */\n convertToViewportPoint(x, y) {\n return Util.applyTransform([x, y], this.transform);\n }\n\n /**\n * Converts PDF rectangle to the viewport coordinates.\n * @param {Array} rect - The xMin, yMin, xMax and yMax coordinates.\n * @returns {Array} Array containing corresponding coordinates of the\n * rectangle in the viewport coordinate space.\n * @see {@link convertToViewportPoint}\n */\n convertToViewportRectangle(rect) {\n const topLeft = Util.applyTransform([rect[0], rect[1]], this.transform);\n const bottomRight = Util.applyTransform([rect[2], rect[3]], this.transform);\n return [topLeft[0], topLeft[1], bottomRight[0], bottomRight[1]];\n }\n\n /**\n * Converts viewport coordinates to the PDF location. For examples, useful\n * for converting canvas pixel location into PDF one.\n * @param {number} x - The x-coordinate.\n * @param {number} y - The y-coordinate.\n * @returns {Array} Array containing `x`- and `y`-coordinates of the\n * point in the PDF coordinate space.\n * @see {@link convertToViewportPoint}\n */\n convertToPdfPoint(x, y) {\n return Util.applyInverseTransform([x, y], this.transform);\n }\n}\n\nclass RenderingCancelledException extends BaseException {\n constructor(msg, extraDelay = 0) {\n super(msg, \"RenderingCancelledException\");\n this.extraDelay = extraDelay;\n }\n}\n\nfunction isDataScheme(url) {\n const ii = url.length;\n let i = 0;\n while (i < ii && url[i].trim() === \"\") {\n i++;\n }\n return url.substring(i, i + 5).toLowerCase() === \"data:\";\n}\n\nfunction isPdfFile(filename) {\n return typeof filename === \"string\" && /\\.pdf$/i.test(filename);\n}\n\n/**\n * Gets the filename from a given URL.\n * @param {string} url\n * @returns {string}\n */\nfunction getFilenameFromUrl(url) {\n [url] = url.split(/[#?]/, 1);\n return url.substring(url.lastIndexOf(\"/\") + 1);\n}\n\n/**\n * Returns the filename or guessed filename from the url (see issue 3455).\n * @param {string} url - The original PDF location.\n * @param {string} defaultFilename - The value returned if the filename is\n * unknown, or the protocol is unsupported.\n * @returns {string} Guessed PDF filename.\n */\nfunction getPdfFilenameFromUrl(url, defaultFilename = \"document.pdf\") {\n if (typeof url !== \"string\") {\n return defaultFilename;\n }\n if (isDataScheme(url)) {\n warn('getPdfFilenameFromUrl: ignore \"data:\"-URL for performance reasons.');\n return defaultFilename;\n }\n const reURI = /^(?:(?:[^:]+:)?\\/\\/[^/]+)?([^?#]*)(\\?[^#]*)?(#.*)?$/;\n // SCHEME HOST 1.PATH 2.QUERY 3.REF\n // Pattern to get last matching NAME.pdf\n const reFilename = /[^/?#=]+\\.pdf\\b(?!.*\\.pdf\\b)/i;\n const splitURI = reURI.exec(url);\n let suggestedFilename =\n reFilename.exec(splitURI[1]) ||\n reFilename.exec(splitURI[2]) ||\n reFilename.exec(splitURI[3]);\n if (suggestedFilename) {\n suggestedFilename = suggestedFilename[0];\n if (suggestedFilename.includes(\"%\")) {\n // URL-encoded %2Fpath%2Fto%2Ffile.pdf should be file.pdf\n try {\n suggestedFilename = reFilename.exec(\n decodeURIComponent(suggestedFilename)\n )[0];\n } catch {\n // Possible (extremely rare) errors:\n // URIError \"Malformed URI\", e.g. for \"%AA.pdf\"\n // TypeError \"null has no properties\", e.g. for \"%2F.pdf\"\n }\n }\n }\n return suggestedFilename || defaultFilename;\n}\n\nclass StatTimer {\n started = Object.create(null);\n\n times = [];\n\n time(name) {\n if (name in this.started) {\n warn(`Timer is already running for ${name}`);\n }\n this.started[name] = Date.now();\n }\n\n timeEnd(name) {\n if (!(name in this.started)) {\n warn(`Timer has not been started for ${name}`);\n }\n this.times.push({\n name,\n start: this.started[name],\n end: Date.now(),\n });\n // Remove timer from started so it can be called again.\n delete this.started[name];\n }\n\n toString() {\n // Find the longest name for padding purposes.\n const outBuf = [];\n let longest = 0;\n for (const { name } of this.times) {\n longest = Math.max(name.length, longest);\n }\n for (const { name, start, end } of this.times) {\n outBuf.push(`${name.padEnd(longest)} ${end - start}ms\\n`);\n }\n return outBuf.join(\"\");\n }\n}\n\nfunction isValidFetchUrl(url, baseUrl) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: isValidFetchUrl\");\n }\n try {\n const { protocol } = baseUrl ? new URL(url, baseUrl) : new URL(url);\n // The Fetch API only supports the http/https protocols, and not file/ftp.\n return protocol === \"http:\" || protocol === \"https:\";\n } catch {\n return false; // `new URL()` will throw on incorrect data.\n }\n}\n\n/**\n * Event handler to suppress context menu.\n */\nfunction noContextMenu(e) {\n e.preventDefault();\n}\n\n// Deprecated API function -- display regardless of the `verbosity` setting.\nfunction deprecated(details) {\n console.log(\"Deprecated API usage: \" + details);\n}\n\nclass PDFDateString {\n static #regex;\n\n /**\n * Convert a PDF date string to a JavaScript `Date` object.\n *\n * The PDF date string format is described in section 7.9.4 of the official\n * PDF 32000-1:2008 specification. However, in the PDF 1.7 reference (sixth\n * edition) Adobe describes the same format including a trailing apostrophe.\n * This syntax in incorrect, but Adobe Acrobat creates PDF files that contain\n * them. We ignore all apostrophes as they are not necessary for date parsing.\n *\n * Moreover, Adobe Acrobat doesn't handle changing the date to universal time\n * and doesn't use the user's time zone (effectively ignoring the HH' and mm'\n * parts of the date string).\n *\n * @param {string} input\n * @returns {Date|null}\n */\n static toDateObject(input) {\n if (!input || typeof input !== \"string\") {\n return null;\n }\n\n // Lazily initialize the regular expression.\n this.#regex ||= new RegExp(\n \"^D:\" + // Prefix (required)\n \"(\\\\d{4})\" + // Year (required)\n \"(\\\\d{2})?\" + // Month (optional)\n \"(\\\\d{2})?\" + // Day (optional)\n \"(\\\\d{2})?\" + // Hour (optional)\n \"(\\\\d{2})?\" + // Minute (optional)\n \"(\\\\d{2})?\" + // Second (optional)\n \"([Z|+|-])?\" + // Universal time relation (optional)\n \"(\\\\d{2})?\" + // Offset hour (optional)\n \"'?\" + // Splitting apostrophe (optional)\n \"(\\\\d{2})?\" + // Offset minute (optional)\n \"'?\" // Trailing apostrophe (optional)\n );\n\n // Optional fields that don't satisfy the requirements from the regular\n // expression (such as incorrect digit counts or numbers that are out of\n // range) will fall back the defaults from the specification.\n const matches = this.#regex.exec(input);\n if (!matches) {\n return null;\n }\n\n // JavaScript's `Date` object expects the month to be between 0 and 11\n // instead of 1 and 12, so we have to correct for that.\n const year = parseInt(matches[1], 10);\n let month = parseInt(matches[2], 10);\n month = month >= 1 && month <= 12 ? month - 1 : 0;\n let day = parseInt(matches[3], 10);\n day = day >= 1 && day <= 31 ? day : 1;\n let hour = parseInt(matches[4], 10);\n hour = hour >= 0 && hour <= 23 ? hour : 0;\n let minute = parseInt(matches[5], 10);\n minute = minute >= 0 && minute <= 59 ? minute : 0;\n let second = parseInt(matches[6], 10);\n second = second >= 0 && second <= 59 ? second : 0;\n const universalTimeRelation = matches[7] || \"Z\";\n let offsetHour = parseInt(matches[8], 10);\n offsetHour = offsetHour >= 0 && offsetHour <= 23 ? offsetHour : 0;\n let offsetMinute = parseInt(matches[9], 10) || 0;\n offsetMinute = offsetMinute >= 0 && offsetMinute <= 59 ? offsetMinute : 0;\n\n // Universal time relation 'Z' means that the local time is equal to the\n // universal time, whereas the relations '+'/'-' indicate that the local\n // time is later respectively earlier than the universal time. Every date\n // is normalized to universal time.\n if (universalTimeRelation === \"-\") {\n hour += offsetHour;\n minute += offsetMinute;\n } else if (universalTimeRelation === \"+\") {\n hour -= offsetHour;\n minute -= offsetMinute;\n }\n\n return new Date(Date.UTC(year, month, day, hour, minute, second));\n }\n}\n\n/**\n * NOTE: This is (mostly) intended to support printing of XFA forms.\n */\nfunction getXfaPageViewport(xfaPage, { scale = 1, rotation = 0 }) {\n const { width, height } = xfaPage.attributes.style;\n const viewBox = [0, 0, parseInt(width), parseInt(height)];\n\n return new PageViewport({\n viewBox,\n scale,\n rotation,\n });\n}\n\nfunction getRGB(color) {\n if (color.startsWith(\"#\")) {\n const colorRGB = parseInt(color.slice(1), 16);\n return [\n (colorRGB & 0xff0000) >> 16,\n (colorRGB & 0x00ff00) >> 8,\n colorRGB & 0x0000ff,\n ];\n }\n\n if (color.startsWith(\"rgb(\")) {\n // getComputedStyle(...).color returns a `rgb(R, G, B)` color.\n return color\n .slice(/* \"rgb(\".length */ 4, -1) // Strip out \"rgb(\" and \")\".\n .split(\",\")\n .map(x => parseInt(x));\n }\n\n if (color.startsWith(\"rgba(\")) {\n return color\n .slice(/* \"rgba(\".length */ 5, -1) // Strip out \"rgba(\" and \")\".\n .split(\",\")\n .map(x => parseInt(x))\n .slice(0, 3);\n }\n\n warn(`Not a valid color format: \"${color}\"`);\n return [0, 0, 0];\n}\n\nfunction getColorValues(colors) {\n const span = document.createElement(\"span\");\n span.style.visibility = \"hidden\";\n document.body.append(span);\n for (const name of colors.keys()) {\n span.style.color = name;\n const computedColor = window.getComputedStyle(span).color;\n colors.set(name, getRGB(computedColor));\n }\n span.remove();\n}\n\nfunction getCurrentTransform(ctx) {\n const { a, b, c, d, e, f } = ctx.getTransform();\n return [a, b, c, d, e, f];\n}\n\nfunction getCurrentTransformInverse(ctx) {\n const { a, b, c, d, e, f } = ctx.getTransform().invertSelf();\n return [a, b, c, d, e, f];\n}\n\n/**\n * @param {HTMLDivElement} div\n * @param {PageViewport} viewport\n * @param {boolean} mustFlip\n * @param {boolean} mustRotate\n */\nfunction setLayerDimensions(\n div,\n viewport,\n mustFlip = false,\n mustRotate = true\n) {\n if (viewport instanceof PageViewport) {\n const { pageWidth, pageHeight } = viewport.rawDims;\n const { style } = div;\n const useRound = FeatureTest.isCSSRoundSupported;\n\n const w = `var(--scale-factor) * ${pageWidth}px`,\n h = `var(--scale-factor) * ${pageHeight}px`;\n const widthStr = useRound\n ? `round(down, ${w}, var(--scale-round-x, 1px))`\n : `calc(${w})`,\n heightStr = useRound\n ? `round(down, ${h}, var(--scale-round-y, 1px))`\n : `calc(${h})`;\n\n if (!mustFlip || viewport.rotation % 180 === 0) {\n style.width = widthStr;\n style.height = heightStr;\n } else {\n style.width = heightStr;\n style.height = widthStr;\n }\n }\n\n if (mustRotate) {\n div.setAttribute(\"data-main-rotation\", viewport.rotation);\n }\n}\n\n/**\n * Scale factors for the canvas, necessary with HiDPI displays.\n */\nclass OutputScale {\n constructor() {\n const pixelRatio = window.devicePixelRatio || 1;\n\n /**\n * @type {number} Horizontal scale.\n */\n this.sx = pixelRatio;\n\n /**\n * @type {number} Vertical scale.\n */\n this.sy = pixelRatio;\n }\n\n /**\n * @type {boolean} Returns `true` when scaling is required, `false` otherwise.\n */\n get scaled() {\n return this.sx !== 1 || this.sy !== 1;\n }\n\n get symmetric() {\n return this.sx === this.sy;\n }\n}\n\nexport {\n deprecated,\n fetchData,\n getColorValues,\n getCurrentTransform,\n getCurrentTransformInverse,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getRGB,\n getXfaPageViewport,\n isDataScheme,\n isPdfFile,\n isValidFetchUrl,\n noContextMenu,\n OutputScale,\n PageViewport,\n PDFDateString,\n PixelsPerInch,\n RenderingCancelledException,\n setLayerDimensions,\n StatTimer,\n SVG_NS,\n};\n","/* Copyright 2023 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { noContextMenu } from \"../display_utils.js\";\n\nclass EditorToolbar {\n #toolbar = null;\n\n #colorPicker = null;\n\n #editor;\n\n #buttons = null;\n\n #altText = null;\n\n static #l10nRemove = null;\n\n constructor(editor) {\n this.#editor = editor;\n\n EditorToolbar.#l10nRemove ||= Object.freeze({\n freetext: \"pdfjs-editor-remove-freetext-button\",\n highlight: \"pdfjs-editor-remove-highlight-button\",\n ink: \"pdfjs-editor-remove-ink-button\",\n stamp: \"pdfjs-editor-remove-stamp-button\",\n });\n }\n\n render() {\n const editToolbar = (this.#toolbar = document.createElement(\"div\"));\n editToolbar.classList.add(\"editToolbar\", \"hidden\");\n editToolbar.setAttribute(\"role\", \"toolbar\");\n const signal = this.#editor._uiManager._signal;\n editToolbar.addEventListener(\"contextmenu\", noContextMenu, { signal });\n editToolbar.addEventListener(\"pointerdown\", EditorToolbar.#pointerDown, {\n signal,\n });\n\n const buttons = (this.#buttons = document.createElement(\"div\"));\n buttons.className = \"buttons\";\n editToolbar.append(buttons);\n\n const position = this.#editor.toolbarPosition;\n if (position) {\n const { style } = editToolbar;\n const x =\n this.#editor._uiManager.direction === \"ltr\"\n ? 1 - position[0]\n : position[0];\n style.insetInlineEnd = `${100 * x}%`;\n style.top = `calc(${\n 100 * position[1]\n }% + var(--editor-toolbar-vert-offset))`;\n }\n\n this.#addDeleteButton();\n\n return editToolbar;\n }\n\n get div() {\n return this.#toolbar;\n }\n\n static #pointerDown(e) {\n e.stopPropagation();\n }\n\n #focusIn(e) {\n this.#editor._focusEventsAllowed = false;\n e.preventDefault();\n e.stopPropagation();\n }\n\n #focusOut(e) {\n this.#editor._focusEventsAllowed = true;\n e.preventDefault();\n e.stopPropagation();\n }\n\n #addListenersToElement(element) {\n // If we're clicking on a button with the keyboard or with\n // the mouse, we don't want to trigger any focus events on\n // the editor.\n const signal = this.#editor._uiManager._signal;\n element.addEventListener(\"focusin\", this.#focusIn.bind(this), {\n capture: true,\n signal,\n });\n element.addEventListener(\"focusout\", this.#focusOut.bind(this), {\n capture: true,\n signal,\n });\n element.addEventListener(\"contextmenu\", noContextMenu, { signal });\n }\n\n hide() {\n this.#toolbar.classList.add(\"hidden\");\n this.#colorPicker?.hideDropdown();\n }\n\n show() {\n this.#toolbar.classList.remove(\"hidden\");\n this.#altText?.shown();\n }\n\n #addDeleteButton() {\n const { editorType, _uiManager } = this.#editor;\n\n const button = document.createElement(\"button\");\n button.className = \"delete\";\n button.tabIndex = 0;\n button.setAttribute(\"data-l10n-id\", EditorToolbar.#l10nRemove[editorType]);\n this.#addListenersToElement(button);\n button.addEventListener(\n \"click\",\n e => {\n _uiManager.delete();\n },\n { signal: _uiManager._signal }\n );\n this.#buttons.append(button);\n }\n\n get #divider() {\n const divider = document.createElement(\"div\");\n divider.className = \"divider\";\n return divider;\n }\n\n async addAltText(altText) {\n const button = await altText.render();\n this.#addListenersToElement(button);\n this.#buttons.prepend(button, this.#divider);\n this.#altText = altText;\n }\n\n addColorPicker(colorPicker) {\n this.#colorPicker = colorPicker;\n const button = colorPicker.renderButton();\n this.#addListenersToElement(button);\n this.#buttons.prepend(button, this.#divider);\n }\n\n remove() {\n this.#toolbar.remove();\n this.#colorPicker?.destroy();\n this.#colorPicker = null;\n }\n}\n\nclass HighlightToolbar {\n #buttons = null;\n\n #toolbar = null;\n\n #uiManager;\n\n constructor(uiManager) {\n this.#uiManager = uiManager;\n }\n\n #render() {\n const editToolbar = (this.#toolbar = document.createElement(\"div\"));\n editToolbar.className = \"editToolbar\";\n editToolbar.setAttribute(\"role\", \"toolbar\");\n editToolbar.addEventListener(\"contextmenu\", noContextMenu, {\n signal: this.#uiManager._signal,\n });\n\n const buttons = (this.#buttons = document.createElement(\"div\"));\n buttons.className = \"buttons\";\n editToolbar.append(buttons);\n\n this.#addHighlightButton();\n\n return editToolbar;\n }\n\n #getLastPoint(boxes, isLTR) {\n let lastY = 0;\n let lastX = 0;\n for (const box of boxes) {\n const y = box.y + box.height;\n if (y < lastY) {\n continue;\n }\n const x = box.x + (isLTR ? box.width : 0);\n if (y > lastY) {\n lastX = x;\n lastY = y;\n continue;\n }\n if (isLTR) {\n if (x > lastX) {\n lastX = x;\n }\n } else if (x < lastX) {\n lastX = x;\n }\n }\n return [isLTR ? 1 - lastX : lastX, lastY];\n }\n\n show(parent, boxes, isLTR) {\n const [x, y] = this.#getLastPoint(boxes, isLTR);\n const { style } = (this.#toolbar ||= this.#render());\n parent.append(this.#toolbar);\n style.insetInlineEnd = `${100 * x}%`;\n style.top = `calc(${100 * y}% + var(--editor-toolbar-vert-offset))`;\n }\n\n hide() {\n this.#toolbar.remove();\n }\n\n #addHighlightButton() {\n const button = document.createElement(\"button\");\n button.className = \"highlightButton\";\n button.tabIndex = 0;\n button.setAttribute(\"data-l10n-id\", `pdfjs-highlight-floating-button1`);\n const span = document.createElement(\"span\");\n button.append(span);\n span.className = \"visuallyHidden\";\n span.setAttribute(\"data-l10n-id\", \"pdfjs-highlight-floating-button-label\");\n const signal = this.#uiManager._signal;\n button.addEventListener(\"contextmenu\", noContextMenu, { signal });\n button.addEventListener(\n \"click\",\n () => {\n this.#uiManager.highlightSelection(\"floating_button\");\n },\n { signal }\n );\n this.#buttons.append(button);\n }\n}\n\nexport { EditorToolbar, HighlightToolbar };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./editor.js\").AnnotationEditor} AnnotationEditor */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n AnnotationEditorParamsType,\n AnnotationEditorPrefix,\n AnnotationEditorType,\n FeatureTest,\n getUuid,\n shadow,\n Util,\n warn,\n} from \"../../shared/util.js\";\nimport {\n fetchData,\n getColorValues,\n getRGB,\n PixelsPerInch,\n} from \"../display_utils.js\";\nimport { HighlightToolbar } from \"./toolbar.js\";\n\nfunction bindEvents(obj, element, names) {\n for (const name of names) {\n element.addEventListener(name, obj[name].bind(obj));\n }\n}\n\n/**\n * Convert a number between 0 and 100 into an hex number between 0 and 255.\n * @param {number} opacity\n * @return {string}\n */\nfunction opacityToHex(opacity) {\n return Math.round(Math.min(255, Math.max(1, 255 * opacity)))\n .toString(16)\n .padStart(2, \"0\");\n}\n\n/**\n * Class to create some unique ids for the different editors.\n */\nclass IdManager {\n #id = 0;\n\n constructor() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n Object.defineProperty(this, \"reset\", {\n value: () => (this.#id = 0),\n });\n }\n }\n\n /**\n * Get a unique id.\n * @returns {string}\n */\n get id() {\n return `${AnnotationEditorPrefix}${this.#id++}`;\n }\n}\n\n/**\n * Class to manage the images used by the editors.\n * The main idea is to try to minimize the memory used by the images.\n * The images are cached and reused when possible\n * We use a refCounter to know when an image is not used anymore but we need to\n * be able to restore an image after a remove+undo, so we keep a file reference\n * or an url one.\n */\nclass ImageManager {\n #baseId = getUuid();\n\n #id = 0;\n\n #cache = null;\n\n static get _isSVGFittingCanvas() {\n // By default, Firefox doesn't rescale without preserving the aspect ratio\n // when drawing an SVG image on a canvas, see https://bugzilla.mozilla.org/1547776.\n // The \"workaround\" is to append \"svgView(preserveAspectRatio(none))\" to the\n // url, but according to comment #15, it seems that it leads to unexpected\n // behavior in Safari.\n const svg = `data:image/svg+xml;charset=UTF-8,`;\n const canvas = new OffscreenCanvas(1, 3);\n const ctx = canvas.getContext(\"2d\", { willReadFrequently: true });\n const image = new Image();\n image.src = svg;\n const promise = image.decode().then(() => {\n ctx.drawImage(image, 0, 0, 1, 1, 0, 0, 1, 3);\n return new Uint32Array(ctx.getImageData(0, 0, 1, 1).data.buffer)[0] === 0;\n });\n\n return shadow(this, \"_isSVGFittingCanvas\", promise);\n }\n\n async #get(key, rawData) {\n this.#cache ||= new Map();\n let data = this.#cache.get(key);\n if (data === null) {\n // We already tried to load the image but it failed.\n return null;\n }\n if (data?.bitmap) {\n data.refCounter += 1;\n return data;\n }\n try {\n data ||= {\n bitmap: null,\n id: `image_${this.#baseId}_${this.#id++}`,\n refCounter: 0,\n isSvg: false,\n };\n let image;\n if (typeof rawData === \"string\") {\n data.url = rawData;\n image = await fetchData(rawData, \"blob\");\n } else if (rawData instanceof File) {\n image = data.file = rawData;\n } else if (rawData instanceof Blob) {\n image = rawData;\n }\n\n if (image.type === \"image/svg+xml\") {\n // Unfortunately, createImageBitmap doesn't work with SVG images.\n // (see https://bugzilla.mozilla.org/1841972).\n const mustRemoveAspectRatioPromise = ImageManager._isSVGFittingCanvas;\n const fileReader = new FileReader();\n const imageElement = new Image();\n const imagePromise = new Promise((resolve, reject) => {\n imageElement.onload = () => {\n data.bitmap = imageElement;\n data.isSvg = true;\n resolve();\n };\n fileReader.onload = async () => {\n const url = (data.svgUrl = fileReader.result);\n // We need to set the preserveAspectRatio to none in order to let\n // the image fits the canvas when resizing.\n imageElement.src = (await mustRemoveAspectRatioPromise)\n ? `${url}#svgView(preserveAspectRatio(none))`\n : url;\n };\n imageElement.onerror = fileReader.onerror = reject;\n });\n fileReader.readAsDataURL(image);\n await imagePromise;\n } else {\n data.bitmap = await createImageBitmap(image);\n }\n data.refCounter = 1;\n } catch (e) {\n console.error(e);\n data = null;\n }\n this.#cache.set(key, data);\n if (data) {\n this.#cache.set(data.id, data);\n }\n return data;\n }\n\n async getFromFile(file) {\n const { lastModified, name, size, type } = file;\n return this.#get(`${lastModified}_${name}_${size}_${type}`, file);\n }\n\n async getFromUrl(url) {\n return this.#get(url, url);\n }\n\n async getFromBlob(id, blobPromise) {\n const blob = await blobPromise;\n return this.#get(id, blob);\n }\n\n async getFromId(id) {\n this.#cache ||= new Map();\n const data = this.#cache.get(id);\n if (!data) {\n return null;\n }\n if (data.bitmap) {\n data.refCounter += 1;\n return data;\n }\n\n if (data.file) {\n return this.getFromFile(data.file);\n }\n if (data.blobPromise) {\n const { blobPromise } = data;\n delete data.blobPromise;\n return this.getFromBlob(data.id, blobPromise);\n }\n return this.getFromUrl(data.url);\n }\n\n getFromCanvas(id, canvas) {\n this.#cache ||= new Map();\n let data = this.#cache.get(id);\n if (data?.bitmap) {\n data.refCounter += 1;\n return data;\n }\n const offscreen = new OffscreenCanvas(canvas.width, canvas.height);\n const ctx = offscreen.getContext(\"2d\");\n ctx.drawImage(canvas, 0, 0);\n data = {\n bitmap: offscreen.transferToImageBitmap(),\n id: `image_${this.#baseId}_${this.#id++}`,\n refCounter: 1,\n isSvg: false,\n };\n this.#cache.set(id, data);\n this.#cache.set(data.id, data);\n return data;\n }\n\n getSvgUrl(id) {\n const data = this.#cache.get(id);\n if (!data?.isSvg) {\n return null;\n }\n return data.svgUrl;\n }\n\n deleteId(id) {\n this.#cache ||= new Map();\n const data = this.#cache.get(id);\n if (!data) {\n return;\n }\n data.refCounter -= 1;\n if (data.refCounter !== 0) {\n return;\n }\n const { bitmap } = data;\n if (!data.url && !data.file) {\n // The image has no way to be restored (ctrl+z) so we must fix that.\n const canvas = new OffscreenCanvas(bitmap.width, bitmap.height);\n const ctx = canvas.getContext(\"bitmaprenderer\");\n ctx.transferFromImageBitmap(bitmap);\n data.blobPromise = canvas.convertToBlob();\n }\n\n bitmap.close?.();\n data.bitmap = null;\n }\n\n // We can use the id only if it belongs this manager.\n // We must take care of having the right manager because we can copy/paste\n // some images from other documents, hence it'd be a pity to use an id from an\n // other manager.\n isValidId(id) {\n return id.startsWith(`image_${this.#baseId}_`);\n }\n}\n\n/**\n * Class to handle undo/redo.\n * Commands are just saved in a buffer.\n * If we hit some memory issues we could likely use a circular buffer.\n * It has to be used as a singleton.\n */\nclass CommandManager {\n #commands = [];\n\n #locked = false;\n\n #maxSize;\n\n #position = -1;\n\n constructor(maxSize = 128) {\n this.#maxSize = maxSize;\n }\n\n /**\n * @typedef {Object} addOptions\n * @property {function} cmd\n * @property {function} undo\n * @property {function} [post]\n * @property {boolean} mustExec\n * @property {number} type\n * @property {boolean} overwriteIfSameType\n * @property {boolean} keepUndo\n */\n\n /**\n * Add a new couple of commands to be used in case of redo/undo.\n * @param {addOptions} options\n */\n add({\n cmd,\n undo,\n post,\n mustExec,\n type = NaN,\n overwriteIfSameType = false,\n keepUndo = false,\n }) {\n if (mustExec) {\n cmd();\n }\n\n if (this.#locked) {\n return;\n }\n\n const save = { cmd, undo, post, type };\n if (this.#position === -1) {\n if (this.#commands.length > 0) {\n // All the commands have been undone and then a new one is added\n // hence we clear the queue.\n this.#commands.length = 0;\n }\n this.#position = 0;\n this.#commands.push(save);\n return;\n }\n\n if (overwriteIfSameType && this.#commands[this.#position].type === type) {\n // For example when we change a color we don't want to\n // be able to undo all the steps, hence we only want to\n // keep the last undoable action in this sequence of actions.\n if (keepUndo) {\n save.undo = this.#commands[this.#position].undo;\n }\n this.#commands[this.#position] = save;\n return;\n }\n\n const next = this.#position + 1;\n if (next === this.#maxSize) {\n this.#commands.splice(0, 1);\n } else {\n this.#position = next;\n if (next < this.#commands.length) {\n this.#commands.splice(next);\n }\n }\n\n this.#commands.push(save);\n }\n\n /**\n * Undo the last command.\n */\n undo() {\n if (this.#position === -1) {\n // Nothing to undo.\n return;\n }\n\n // Avoid to insert something during the undo execution.\n this.#locked = true;\n const { undo, post } = this.#commands[this.#position];\n undo();\n post?.();\n this.#locked = false;\n\n this.#position -= 1;\n }\n\n /**\n * Redo the last command.\n */\n redo() {\n if (this.#position < this.#commands.length - 1) {\n this.#position += 1;\n\n // Avoid to insert something during the redo execution.\n this.#locked = true;\n const { cmd, post } = this.#commands[this.#position];\n cmd();\n post?.();\n this.#locked = false;\n }\n }\n\n /**\n * Check if there is something to undo.\n * @returns {boolean}\n */\n hasSomethingToUndo() {\n return this.#position !== -1;\n }\n\n /**\n * Check if there is something to redo.\n * @returns {boolean}\n */\n hasSomethingToRedo() {\n return this.#position < this.#commands.length - 1;\n }\n\n destroy() {\n this.#commands = null;\n }\n}\n\n/**\n * Class to handle the different keyboards shortcuts we can have on mac or\n * non-mac OSes.\n */\nclass KeyboardManager {\n /**\n * Create a new keyboard manager class.\n * @param {Array} callbacks - an array containing an array of shortcuts\n * and a callback to call.\n * A shortcut is a string like `ctrl+c` or `mac+ctrl+c` for mac OS.\n */\n constructor(callbacks) {\n this.buffer = [];\n this.callbacks = new Map();\n this.allKeys = new Set();\n\n const { isMac } = FeatureTest.platform;\n for (const [keys, callback, options = {}] of callbacks) {\n for (const key of keys) {\n const isMacKey = key.startsWith(\"mac+\");\n if (isMac && isMacKey) {\n this.callbacks.set(key.slice(4), { callback, options });\n this.allKeys.add(key.split(\"+\").at(-1));\n } else if (!isMac && !isMacKey) {\n this.callbacks.set(key, { callback, options });\n this.allKeys.add(key.split(\"+\").at(-1));\n }\n }\n }\n }\n\n /**\n * Serialize an event into a string in order to match a\n * potential key for a callback.\n * @param {KeyboardEvent} event\n * @returns {string}\n */\n #serialize(event) {\n if (event.altKey) {\n this.buffer.push(\"alt\");\n }\n if (event.ctrlKey) {\n this.buffer.push(\"ctrl\");\n }\n if (event.metaKey) {\n this.buffer.push(\"meta\");\n }\n if (event.shiftKey) {\n this.buffer.push(\"shift\");\n }\n this.buffer.push(event.key);\n const str = this.buffer.join(\"+\");\n this.buffer.length = 0;\n\n return str;\n }\n\n /**\n * Execute a callback, if any, for a given keyboard event.\n * The self is used as `this` in the callback.\n * @param {Object} self\n * @param {KeyboardEvent} event\n * @returns\n */\n exec(self, event) {\n if (!this.allKeys.has(event.key)) {\n return;\n }\n const info = this.callbacks.get(this.#serialize(event));\n if (!info) {\n return;\n }\n const {\n callback,\n options: { bubbles = false, args = [], checker = null },\n } = info;\n\n if (checker && !checker(self, event)) {\n return;\n }\n callback.bind(self, ...args, event)();\n\n // For example, ctrl+s in a FreeText must be handled by the viewer, hence\n // the event must bubble.\n if (!bubbles) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n}\n\nclass ColorManager {\n static _colorsMapping = new Map([\n [\"CanvasText\", [0, 0, 0]],\n [\"Canvas\", [255, 255, 255]],\n ]);\n\n get _colors() {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof document === \"undefined\"\n ) {\n return shadow(this, \"_colors\", ColorManager._colorsMapping);\n }\n\n const colors = new Map([\n [\"CanvasText\", null],\n [\"Canvas\", null],\n ]);\n getColorValues(colors);\n return shadow(this, \"_colors\", colors);\n }\n\n /**\n * In High Contrast Mode, the color on the screen is not always the\n * real color used in the pdf.\n * For example in some cases white can appear to be black but when saving\n * we want to have white.\n * @param {string} color\n * @returns {Array}\n */\n convert(color) {\n const rgb = getRGB(color);\n if (!window.matchMedia(\"(forced-colors: active)\").matches) {\n return rgb;\n }\n\n for (const [name, RGB] of this._colors) {\n if (RGB.every((x, i) => x === rgb[i])) {\n return ColorManager._colorsMapping.get(name);\n }\n }\n return rgb;\n }\n\n /**\n * An input element must have its color value as a hex string\n * and not as color name.\n * So this function converts a name into an hex string.\n * @param {string} name\n * @returns {string}\n */\n getHexCode(name) {\n const rgb = this._colors.get(name);\n if (!rgb) {\n return name;\n }\n return Util.makeHexColor(...rgb);\n }\n}\n\n/**\n * A pdf has several pages and each of them when it will rendered\n * will have an AnnotationEditorLayer which will contain the some\n * new Annotations associated to an editor in order to modify them.\n *\n * This class is used to manage all the different layers, editors and\n * some action like copy/paste, undo/redo, ...\n */\nclass AnnotationEditorUIManager {\n #abortController = new AbortController();\n\n #activeEditor = null;\n\n #allEditors = new Map();\n\n #allLayers = new Map();\n\n #altTextManager = null;\n\n #annotationStorage = null;\n\n #changedExistingAnnotations = null;\n\n #commandManager = new CommandManager();\n\n #copyPasteAC = null;\n\n #currentPageIndex = 0;\n\n #deletedAnnotationsElementIds = new Set();\n\n #draggingEditors = null;\n\n #editorTypes = null;\n\n #editorsToRescale = new Set();\n\n #enableHighlightFloatingButton = false;\n\n #enableUpdatedAddImage = false;\n\n #enableNewAltTextWhenAddingImage = false;\n\n #filterFactory = null;\n\n #focusMainContainerTimeoutId = null;\n\n #focusManagerAC = null;\n\n #highlightColors = null;\n\n #highlightWhenShiftUp = false;\n\n #highlightToolbar = null;\n\n #idManager = new IdManager();\n\n #isEnabled = false;\n\n #isWaiting = false;\n\n #keyboardManagerAC = null;\n\n #lastActiveElement = null;\n\n #mainHighlightColorPicker = null;\n\n #mlManager = null;\n\n #mode = AnnotationEditorType.NONE;\n\n #selectedEditors = new Set();\n\n #selectedTextNode = null;\n\n #pageColors = null;\n\n #showAllStates = null;\n\n #previousStates = {\n isEditing: false,\n isEmpty: true,\n hasSomethingToUndo: false,\n hasSomethingToRedo: false,\n hasSelectedEditor: false,\n hasSelectedText: false,\n };\n\n #translation = [0, 0];\n\n #translationTimeoutId = null;\n\n #container = null;\n\n #viewer = null;\n\n #updateModeCapability = null;\n\n static TRANSLATE_SMALL = 1; // page units.\n\n static TRANSLATE_BIG = 10; // page units.\n\n static get _keyboardManager() {\n const proto = AnnotationEditorUIManager.prototype;\n\n /**\n * If the focused element is an input, we don't want to handle the arrow.\n * For example, sliders can be controlled with the arrow keys.\n */\n const arrowChecker = self =>\n self.#container.contains(document.activeElement) &&\n document.activeElement.tagName !== \"BUTTON\" &&\n self.hasSomethingToControl();\n\n const textInputChecker = (_self, { target: el }) => {\n if (el instanceof HTMLInputElement) {\n const { type } = el;\n return type !== \"text\" && type !== \"number\";\n }\n return true;\n };\n\n const small = this.TRANSLATE_SMALL;\n const big = this.TRANSLATE_BIG;\n\n return shadow(\n this,\n \"_keyboardManager\",\n new KeyboardManager([\n [\n [\"ctrl+a\", \"mac+meta+a\"],\n proto.selectAll,\n { checker: textInputChecker },\n ],\n [[\"ctrl+z\", \"mac+meta+z\"], proto.undo, { checker: textInputChecker }],\n [\n // On mac, depending of the OS version, the event.key is either \"z\" or\n // \"Z\" when the user presses \"meta+shift+z\".\n [\n \"ctrl+y\",\n \"ctrl+shift+z\",\n \"mac+meta+shift+z\",\n \"ctrl+shift+Z\",\n \"mac+meta+shift+Z\",\n ],\n proto.redo,\n { checker: textInputChecker },\n ],\n [\n [\n \"Backspace\",\n \"alt+Backspace\",\n \"ctrl+Backspace\",\n \"shift+Backspace\",\n \"mac+Backspace\",\n \"mac+alt+Backspace\",\n \"mac+ctrl+Backspace\",\n \"Delete\",\n \"ctrl+Delete\",\n \"shift+Delete\",\n \"mac+Delete\",\n ],\n proto.delete,\n { checker: textInputChecker },\n ],\n [\n [\"Enter\", \"mac+Enter\"],\n proto.addNewEditorFromKeyboard,\n {\n // Those shortcuts can be used in the toolbar for some other actions\n // like zooming, hence we need to check if the container has the\n // focus.\n checker: (self, { target: el }) =>\n !(el instanceof HTMLButtonElement) &&\n self.#container.contains(el) &&\n !self.isEnterHandled,\n },\n ],\n [\n [\" \", \"mac+ \"],\n proto.addNewEditorFromKeyboard,\n {\n // Those shortcuts can be used in the toolbar for some other actions\n // like zooming, hence we need to check if the container has the\n // focus.\n checker: (self, { target: el }) =>\n !(el instanceof HTMLButtonElement) &&\n self.#container.contains(document.activeElement),\n },\n ],\n [[\"Escape\", \"mac+Escape\"], proto.unselectAll],\n [\n [\"ArrowLeft\", \"mac+ArrowLeft\"],\n proto.translateSelectedEditors,\n { args: [-small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n proto.translateSelectedEditors,\n { args: [-big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowRight\", \"mac+ArrowRight\"],\n proto.translateSelectedEditors,\n { args: [small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n proto.translateSelectedEditors,\n { args: [big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowUp\", \"mac+ArrowUp\"],\n proto.translateSelectedEditors,\n { args: [0, -small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"],\n proto.translateSelectedEditors,\n { args: [0, -big], checker: arrowChecker },\n ],\n [\n [\"ArrowDown\", \"mac+ArrowDown\"],\n proto.translateSelectedEditors,\n { args: [0, small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"],\n proto.translateSelectedEditors,\n { args: [0, big], checker: arrowChecker },\n ],\n ])\n );\n }\n\n constructor(\n container,\n viewer,\n altTextManager,\n eventBus,\n pdfDocument,\n pageColors,\n highlightColors,\n enableHighlightFloatingButton,\n enableUpdatedAddImage,\n enableNewAltTextWhenAddingImage,\n mlManager\n ) {\n const signal = (this._signal = this.#abortController.signal);\n this.#container = container;\n this.#viewer = viewer;\n this.#altTextManager = altTextManager;\n this._eventBus = eventBus;\n eventBus._on(\"editingaction\", this.onEditingAction.bind(this), { signal });\n eventBus._on(\"pagechanging\", this.onPageChanging.bind(this), { signal });\n eventBus._on(\"scalechanging\", this.onScaleChanging.bind(this), { signal });\n eventBus._on(\"rotationchanging\", this.onRotationChanging.bind(this), {\n signal,\n });\n eventBus._on(\"setpreference\", this.onSetPreference.bind(this), { signal });\n eventBus._on(\n \"switchannotationeditorparams\",\n evt => this.updateParams(evt.type, evt.value),\n { signal }\n );\n this.#addSelectionListener();\n this.#addDragAndDropListeners();\n this.#addKeyboardManager();\n this.#annotationStorage = pdfDocument.annotationStorage;\n this.#filterFactory = pdfDocument.filterFactory;\n this.#pageColors = pageColors;\n this.#highlightColors = highlightColors || null;\n this.#enableHighlightFloatingButton = enableHighlightFloatingButton;\n this.#enableUpdatedAddImage = enableUpdatedAddImage;\n this.#enableNewAltTextWhenAddingImage = enableNewAltTextWhenAddingImage;\n this.#mlManager = mlManager || null;\n this.viewParameters = {\n realScale: PixelsPerInch.PDF_TO_CSS_UNITS,\n rotation: 0,\n };\n this.isShiftKeyDown = false;\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n Object.defineProperty(this, \"reset\", {\n value: () => {\n this.selectAll();\n this.delete();\n this.#idManager.reset();\n },\n });\n }\n }\n\n destroy() {\n this.#updateModeCapability?.resolve();\n this.#updateModeCapability = null;\n\n this.#abortController?.abort();\n this.#abortController = null;\n this._signal = null;\n\n for (const layer of this.#allLayers.values()) {\n layer.destroy();\n }\n this.#allLayers.clear();\n this.#allEditors.clear();\n this.#editorsToRescale.clear();\n this.#activeEditor = null;\n this.#selectedEditors.clear();\n this.#commandManager.destroy();\n this.#altTextManager?.destroy();\n this.#highlightToolbar?.hide();\n this.#highlightToolbar = null;\n if (this.#focusMainContainerTimeoutId) {\n clearTimeout(this.#focusMainContainerTimeoutId);\n this.#focusMainContainerTimeoutId = null;\n }\n if (this.#translationTimeoutId) {\n clearTimeout(this.#translationTimeoutId);\n this.#translationTimeoutId = null;\n }\n }\n\n combinedSignal(ac) {\n return AbortSignal.any([this._signal, ac.signal]);\n }\n\n get mlManager() {\n return this.#mlManager;\n }\n\n get useNewAltTextFlow() {\n return this.#enableUpdatedAddImage;\n }\n\n get useNewAltTextWhenAddingImage() {\n return this.#enableNewAltTextWhenAddingImage;\n }\n\n get hcmFilter() {\n return shadow(\n this,\n \"hcmFilter\",\n this.#pageColors\n ? this.#filterFactory.addHCMFilter(\n this.#pageColors.foreground,\n this.#pageColors.background\n )\n : \"none\"\n );\n }\n\n get direction() {\n return shadow(\n this,\n \"direction\",\n getComputedStyle(this.#container).direction\n );\n }\n\n get highlightColors() {\n return shadow(\n this,\n \"highlightColors\",\n this.#highlightColors\n ? new Map(\n this.#highlightColors\n .split(\",\")\n .map(pair => pair.split(\"=\").map(x => x.trim()))\n )\n : null\n );\n }\n\n get highlightColorNames() {\n return shadow(\n this,\n \"highlightColorNames\",\n this.highlightColors\n ? new Map(Array.from(this.highlightColors, e => e.reverse()))\n : null\n );\n }\n\n setMainHighlightColorPicker(colorPicker) {\n this.#mainHighlightColorPicker = colorPicker;\n }\n\n editAltText(editor, firstTime = false) {\n this.#altTextManager?.editAltText(this, editor, firstTime);\n }\n\n switchToMode(mode, callback) {\n // Switching to a mode can be asynchronous.\n this._eventBus.on(\"annotationeditormodechanged\", callback, {\n once: true,\n signal: this._signal,\n });\n this._eventBus.dispatch(\"showannotationeditorui\", {\n source: this,\n mode,\n });\n }\n\n setPreference(name, value) {\n this._eventBus.dispatch(\"setpreference\", {\n source: this,\n name,\n value,\n });\n }\n\n onSetPreference({ name, value }) {\n switch (name) {\n case \"enableNewAltTextWhenAddingImage\":\n this.#enableNewAltTextWhenAddingImage = value;\n break;\n }\n }\n\n onPageChanging({ pageNumber }) {\n this.#currentPageIndex = pageNumber - 1;\n }\n\n focusMainContainer() {\n this.#container.focus();\n }\n\n findParent(x, y) {\n for (const layer of this.#allLayers.values()) {\n const {\n x: layerX,\n y: layerY,\n width,\n height,\n } = layer.div.getBoundingClientRect();\n if (\n x >= layerX &&\n x <= layerX + width &&\n y >= layerY &&\n y <= layerY + height\n ) {\n return layer;\n }\n }\n return null;\n }\n\n disableUserSelect(value = false) {\n this.#viewer.classList.toggle(\"noUserSelect\", value);\n }\n\n addShouldRescale(editor) {\n this.#editorsToRescale.add(editor);\n }\n\n removeShouldRescale(editor) {\n this.#editorsToRescale.delete(editor);\n }\n\n onScaleChanging({ scale }) {\n this.commitOrRemove();\n this.viewParameters.realScale = scale * PixelsPerInch.PDF_TO_CSS_UNITS;\n for (const editor of this.#editorsToRescale) {\n editor.onScaleChanging();\n }\n }\n\n onRotationChanging({ pagesRotation }) {\n this.commitOrRemove();\n this.viewParameters.rotation = pagesRotation;\n }\n\n #getAnchorElementForSelection({ anchorNode }) {\n return anchorNode.nodeType === Node.TEXT_NODE\n ? anchorNode.parentElement\n : anchorNode;\n }\n\n #getLayerForTextLayer(textLayer) {\n const { currentLayer } = this;\n if (currentLayer.hasTextLayer(textLayer)) {\n return currentLayer;\n }\n for (const layer of this.#allLayers.values()) {\n if (layer.hasTextLayer(textLayer)) {\n return layer;\n }\n }\n return null;\n }\n\n highlightSelection(methodOfCreation = \"\") {\n const selection = document.getSelection();\n if (!selection || selection.isCollapsed) {\n return;\n }\n const { anchorNode, anchorOffset, focusNode, focusOffset } = selection;\n const text = selection.toString();\n const anchorElement = this.#getAnchorElementForSelection(selection);\n const textLayer = anchorElement.closest(\".textLayer\");\n const boxes = this.getSelectionBoxes(textLayer);\n if (!boxes) {\n return;\n }\n selection.empty();\n\n const layer = this.#getLayerForTextLayer(textLayer);\n const isNoneMode = this.#mode === AnnotationEditorType.NONE;\n const callback = () => {\n layer?.createAndAddNewEditor({ x: 0, y: 0 }, false, {\n methodOfCreation,\n boxes,\n anchorNode,\n anchorOffset,\n focusNode,\n focusOffset,\n text,\n });\n if (isNoneMode) {\n this.showAllEditors(\"highlight\", true, /* updateButton = */ true);\n }\n };\n if (isNoneMode) {\n this.switchToMode(AnnotationEditorType.HIGHLIGHT, callback);\n return;\n }\n callback();\n }\n\n #displayHighlightToolbar() {\n const selection = document.getSelection();\n if (!selection || selection.isCollapsed) {\n return;\n }\n const anchorElement = this.#getAnchorElementForSelection(selection);\n const textLayer = anchorElement.closest(\".textLayer\");\n const boxes = this.getSelectionBoxes(textLayer);\n if (!boxes) {\n return;\n }\n this.#highlightToolbar ||= new HighlightToolbar(this);\n this.#highlightToolbar.show(textLayer, boxes, this.direction === \"ltr\");\n }\n\n /**\n * Add an editor in the annotation storage.\n * @param {AnnotationEditor} editor\n */\n addToAnnotationStorage(editor) {\n if (\n !editor.isEmpty() &&\n this.#annotationStorage &&\n !this.#annotationStorage.has(editor.id)\n ) {\n this.#annotationStorage.setValue(editor.id, editor);\n }\n }\n\n #selectionChange() {\n const selection = document.getSelection();\n if (!selection || selection.isCollapsed) {\n if (this.#selectedTextNode) {\n this.#highlightToolbar?.hide();\n this.#selectedTextNode = null;\n this.#dispatchUpdateStates({\n hasSelectedText: false,\n });\n }\n return;\n }\n const { anchorNode } = selection;\n if (anchorNode === this.#selectedTextNode) {\n return;\n }\n\n const anchorElement = this.#getAnchorElementForSelection(selection);\n const textLayer = anchorElement.closest(\".textLayer\");\n if (!textLayer) {\n if (this.#selectedTextNode) {\n this.#highlightToolbar?.hide();\n this.#selectedTextNode = null;\n this.#dispatchUpdateStates({\n hasSelectedText: false,\n });\n }\n return;\n }\n\n this.#highlightToolbar?.hide();\n this.#selectedTextNode = anchorNode;\n this.#dispatchUpdateStates({\n hasSelectedText: true,\n });\n\n if (\n this.#mode !== AnnotationEditorType.HIGHLIGHT &&\n this.#mode !== AnnotationEditorType.NONE\n ) {\n return;\n }\n\n if (this.#mode === AnnotationEditorType.HIGHLIGHT) {\n this.showAllEditors(\"highlight\", true, /* updateButton = */ true);\n }\n\n this.#highlightWhenShiftUp = this.isShiftKeyDown;\n if (!this.isShiftKeyDown) {\n const activeLayer =\n this.#mode === AnnotationEditorType.HIGHLIGHT\n ? this.#getLayerForTextLayer(textLayer)\n : null;\n activeLayer?.toggleDrawing();\n\n const ac = new AbortController();\n const signal = this.combinedSignal(ac);\n\n const pointerup = e => {\n if (e.type === \"pointerup\" && e.button !== 0) {\n // Do nothing on right click.\n return;\n }\n ac.abort();\n activeLayer?.toggleDrawing(true);\n if (e.type === \"pointerup\") {\n this.#onSelectEnd(\"main_toolbar\");\n }\n };\n window.addEventListener(\"pointerup\", pointerup, { signal });\n window.addEventListener(\"blur\", pointerup, { signal });\n }\n }\n\n #onSelectEnd(methodOfCreation = \"\") {\n if (this.#mode === AnnotationEditorType.HIGHLIGHT) {\n this.highlightSelection(methodOfCreation);\n } else if (this.#enableHighlightFloatingButton) {\n this.#displayHighlightToolbar();\n }\n }\n\n #addSelectionListener() {\n document.addEventListener(\n \"selectionchange\",\n this.#selectionChange.bind(this),\n { signal: this._signal }\n );\n }\n\n #addFocusManager() {\n if (this.#focusManagerAC) {\n return;\n }\n this.#focusManagerAC = new AbortController();\n const signal = this.combinedSignal(this.#focusManagerAC);\n\n window.addEventListener(\"focus\", this.focus.bind(this), { signal });\n window.addEventListener(\"blur\", this.blur.bind(this), { signal });\n }\n\n #removeFocusManager() {\n this.#focusManagerAC?.abort();\n this.#focusManagerAC = null;\n }\n\n blur() {\n this.isShiftKeyDown = false;\n if (this.#highlightWhenShiftUp) {\n this.#highlightWhenShiftUp = false;\n this.#onSelectEnd(\"main_toolbar\");\n }\n if (!this.hasSelection) {\n return;\n }\n // When several editors are selected and the window loses focus, we want to\n // keep the last active element in order to be able to focus it again when\n // the window gets the focus back but we don't want to trigger any focus\n // callbacks else only one editor will be selected.\n const { activeElement } = document;\n for (const editor of this.#selectedEditors) {\n if (editor.div.contains(activeElement)) {\n this.#lastActiveElement = [editor, activeElement];\n editor._focusEventsAllowed = false;\n break;\n }\n }\n }\n\n focus() {\n if (!this.#lastActiveElement) {\n return;\n }\n const [lastEditor, lastActiveElement] = this.#lastActiveElement;\n this.#lastActiveElement = null;\n lastActiveElement.addEventListener(\n \"focusin\",\n () => {\n lastEditor._focusEventsAllowed = true;\n },\n { once: true, signal: this._signal }\n );\n lastActiveElement.focus();\n }\n\n #addKeyboardManager() {\n if (this.#keyboardManagerAC) {\n return;\n }\n this.#keyboardManagerAC = new AbortController();\n const signal = this.combinedSignal(this.#keyboardManagerAC);\n\n // The keyboard events are caught at the container level in order to be able\n // to execute some callbacks even if the current page doesn't have focus.\n window.addEventListener(\"keydown\", this.keydown.bind(this), { signal });\n window.addEventListener(\"keyup\", this.keyup.bind(this), { signal });\n }\n\n #removeKeyboardManager() {\n this.#keyboardManagerAC?.abort();\n this.#keyboardManagerAC = null;\n }\n\n #addCopyPasteListeners() {\n if (this.#copyPasteAC) {\n return;\n }\n this.#copyPasteAC = new AbortController();\n const signal = this.combinedSignal(this.#copyPasteAC);\n\n document.addEventListener(\"copy\", this.copy.bind(this), { signal });\n document.addEventListener(\"cut\", this.cut.bind(this), { signal });\n document.addEventListener(\"paste\", this.paste.bind(this), { signal });\n }\n\n #removeCopyPasteListeners() {\n this.#copyPasteAC?.abort();\n this.#copyPasteAC = null;\n }\n\n #addDragAndDropListeners() {\n const signal = this._signal;\n document.addEventListener(\"dragover\", this.dragOver.bind(this), { signal });\n document.addEventListener(\"drop\", this.drop.bind(this), { signal });\n }\n\n addEditListeners() {\n this.#addKeyboardManager();\n this.#addCopyPasteListeners();\n }\n\n removeEditListeners() {\n this.#removeKeyboardManager();\n this.#removeCopyPasteListeners();\n }\n\n dragOver(event) {\n for (const { type } of event.dataTransfer.items) {\n for (const editorType of this.#editorTypes) {\n if (editorType.isHandlingMimeForPasting(type)) {\n event.dataTransfer.dropEffect = \"copy\";\n event.preventDefault();\n return;\n }\n }\n }\n }\n\n /**\n * Drop callback.\n * @param {DragEvent} event\n */\n drop(event) {\n for (const item of event.dataTransfer.items) {\n for (const editorType of this.#editorTypes) {\n if (editorType.isHandlingMimeForPasting(item.type)) {\n editorType.paste(item, this.currentLayer);\n event.preventDefault();\n return;\n }\n }\n }\n }\n\n /**\n * Copy callback.\n * @param {ClipboardEvent} event\n */\n copy(event) {\n event.preventDefault();\n\n // An editor is being edited so just commit it.\n this.#activeEditor?.commitOrRemove();\n\n if (!this.hasSelection) {\n return;\n }\n\n const editors = [];\n for (const editor of this.#selectedEditors) {\n const serialized = editor.serialize(/* isForCopying = */ true);\n if (serialized) {\n editors.push(serialized);\n }\n }\n if (editors.length === 0) {\n return;\n }\n\n event.clipboardData.setData(\"application/pdfjs\", JSON.stringify(editors));\n }\n\n /**\n * Cut callback.\n * @param {ClipboardEvent} event\n */\n cut(event) {\n this.copy(event);\n this.delete();\n }\n\n /**\n * Paste callback.\n * @param {ClipboardEvent} event\n */\n async paste(event) {\n event.preventDefault();\n const { clipboardData } = event;\n for (const item of clipboardData.items) {\n for (const editorType of this.#editorTypes) {\n if (editorType.isHandlingMimeForPasting(item.type)) {\n editorType.paste(item, this.currentLayer);\n return;\n }\n }\n }\n\n let data = clipboardData.getData(\"application/pdfjs\");\n if (!data) {\n return;\n }\n\n try {\n data = JSON.parse(data);\n } catch (ex) {\n warn(`paste: \"${ex.message}\".`);\n return;\n }\n\n if (!Array.isArray(data)) {\n return;\n }\n\n this.unselectAll();\n const layer = this.currentLayer;\n\n try {\n const newEditors = [];\n for (const editor of data) {\n const deserializedEditor = await layer.deserialize(editor);\n if (!deserializedEditor) {\n return;\n }\n newEditors.push(deserializedEditor);\n }\n\n const cmd = () => {\n for (const editor of newEditors) {\n this.#addEditorToLayer(editor);\n }\n this.#selectEditors(newEditors);\n };\n const undo = () => {\n for (const editor of newEditors) {\n editor.remove();\n }\n };\n this.addCommands({ cmd, undo, mustExec: true });\n } catch (ex) {\n warn(`paste: \"${ex.message}\".`);\n }\n }\n\n /**\n * Keydown callback.\n * @param {KeyboardEvent} event\n */\n keydown(event) {\n if (!this.isShiftKeyDown && event.key === \"Shift\") {\n this.isShiftKeyDown = true;\n }\n if (\n this.#mode !== AnnotationEditorType.NONE &&\n !this.isEditorHandlingKeyboard\n ) {\n AnnotationEditorUIManager._keyboardManager.exec(this, event);\n }\n }\n\n /**\n * Keyup callback.\n * @param {KeyboardEvent} event\n */\n keyup(event) {\n if (this.isShiftKeyDown && event.key === \"Shift\") {\n this.isShiftKeyDown = false;\n if (this.#highlightWhenShiftUp) {\n this.#highlightWhenShiftUp = false;\n this.#onSelectEnd(\"main_toolbar\");\n }\n }\n }\n\n /**\n * Execute an action for a given name.\n * For example, the user can click on the \"Undo\" entry in the context menu\n * and it'll trigger the undo action.\n */\n onEditingAction({ name }) {\n switch (name) {\n case \"undo\":\n case \"redo\":\n case \"delete\":\n case \"selectAll\":\n this[name]();\n break;\n case \"highlightSelection\":\n this.highlightSelection(\"context_menu\");\n break;\n }\n }\n\n /**\n * Update the different possible states of this manager, e.g. is there\n * something to undo, redo, ...\n * @param {Object} details\n */\n #dispatchUpdateStates(details) {\n const hasChanged = Object.entries(details).some(\n ([key, value]) => this.#previousStates[key] !== value\n );\n\n if (hasChanged) {\n this._eventBus.dispatch(\"annotationeditorstateschanged\", {\n source: this,\n details: Object.assign(this.#previousStates, details),\n });\n // We could listen on our own event but it sounds like a bit weird and\n // it's a way to simpler to handle that stuff here instead of having to\n // add something in every place where an editor can be unselected.\n if (\n this.#mode === AnnotationEditorType.HIGHLIGHT &&\n details.hasSelectedEditor === false\n ) {\n this.#dispatchUpdateUI([\n [AnnotationEditorParamsType.HIGHLIGHT_FREE, true],\n ]);\n }\n }\n }\n\n #dispatchUpdateUI(details) {\n this._eventBus.dispatch(\"annotationeditorparamschanged\", {\n source: this,\n details,\n });\n }\n\n /**\n * Set the editing state.\n * It can be useful to temporarily disable it when the user is editing a\n * FreeText annotation.\n * @param {boolean} isEditing\n */\n setEditingState(isEditing) {\n if (isEditing) {\n this.#addFocusManager();\n this.#addCopyPasteListeners();\n this.#dispatchUpdateStates({\n isEditing: this.#mode !== AnnotationEditorType.NONE,\n isEmpty: this.#isEmpty(),\n hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n hasSelectedEditor: false,\n });\n } else {\n this.#removeFocusManager();\n this.#removeCopyPasteListeners();\n this.#dispatchUpdateStates({\n isEditing: false,\n });\n this.disableUserSelect(false);\n }\n }\n\n registerEditorTypes(types) {\n if (this.#editorTypes) {\n return;\n }\n this.#editorTypes = types;\n for (const editorType of this.#editorTypes) {\n this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate);\n }\n }\n\n /**\n * Get an id.\n * @returns {string}\n */\n getId() {\n return this.#idManager.id;\n }\n\n get currentLayer() {\n return this.#allLayers.get(this.#currentPageIndex);\n }\n\n getLayer(pageIndex) {\n return this.#allLayers.get(pageIndex);\n }\n\n get currentPageIndex() {\n return this.#currentPageIndex;\n }\n\n /**\n * Add a new layer for a page which will contains the editors.\n * @param {AnnotationEditorLayer} layer\n */\n addLayer(layer) {\n this.#allLayers.set(layer.pageIndex, layer);\n if (this.#isEnabled) {\n layer.enable();\n } else {\n layer.disable();\n }\n }\n\n /**\n * Remove a layer.\n * @param {AnnotationEditorLayer} layer\n */\n removeLayer(layer) {\n this.#allLayers.delete(layer.pageIndex);\n }\n\n /**\n * Change the editor mode (None, FreeText, Ink, ...)\n * @param {number} mode\n * @param {string|null} editId\n * @param {boolean} [isFromKeyboard] - true if the mode change is due to a\n * keyboard action.\n */\n async updateMode(mode, editId = null, isFromKeyboard = false) {\n if (this.#mode === mode) {\n return;\n }\n\n if (this.#updateModeCapability) {\n await this.#updateModeCapability.promise;\n if (!this.#updateModeCapability) {\n // This ui manager has been destroyed.\n return;\n }\n }\n\n this.#updateModeCapability = Promise.withResolvers();\n\n this.#mode = mode;\n if (mode === AnnotationEditorType.NONE) {\n this.setEditingState(false);\n this.#disableAll();\n\n this.#updateModeCapability.resolve();\n return;\n }\n this.setEditingState(true);\n await this.#enableAll();\n this.unselectAll();\n for (const layer of this.#allLayers.values()) {\n layer.updateMode(mode);\n }\n if (!editId) {\n if (isFromKeyboard) {\n this.addNewEditorFromKeyboard();\n }\n\n this.#updateModeCapability.resolve();\n return;\n }\n\n for (const editor of this.#allEditors.values()) {\n if (editor.annotationElementId === editId) {\n this.setSelected(editor);\n editor.enterInEditMode();\n } else {\n editor.unselect();\n }\n }\n\n this.#updateModeCapability.resolve();\n }\n\n addNewEditorFromKeyboard() {\n if (this.currentLayer.canCreateNewEmptyEditor()) {\n this.currentLayer.addNewEditor();\n }\n }\n\n /**\n * Update the toolbar if it's required to reflect the tool currently used.\n * @param {number} mode\n * @returns {undefined}\n */\n updateToolbar(mode) {\n if (mode === this.#mode) {\n return;\n }\n this._eventBus.dispatch(\"switchannotationeditormode\", {\n source: this,\n mode,\n });\n }\n\n /**\n * Update a parameter in the current editor or globally.\n * @param {number} type\n * @param {*} value\n */\n updateParams(type, value) {\n if (!this.#editorTypes) {\n return;\n }\n\n switch (type) {\n case AnnotationEditorParamsType.CREATE:\n this.currentLayer.addNewEditor();\n return;\n case AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:\n this.#mainHighlightColorPicker?.updateColor(value);\n break;\n case AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL:\n this._eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n data: {\n type: \"highlight\",\n action: \"toggle_visibility\",\n },\n },\n });\n (this.#showAllStates ||= new Map()).set(type, value);\n this.showAllEditors(\"highlight\", value);\n break;\n }\n\n for (const editor of this.#selectedEditors) {\n editor.updateParams(type, value);\n }\n\n for (const editorType of this.#editorTypes) {\n editorType.updateDefaultParams(type, value);\n }\n }\n\n showAllEditors(type, visible, updateButton = false) {\n for (const editor of this.#allEditors.values()) {\n if (editor.editorType === type) {\n editor.show(visible);\n }\n }\n const state =\n this.#showAllStates?.get(AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL) ??\n true;\n if (state !== visible) {\n this.#dispatchUpdateUI([\n [AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL, visible],\n ]);\n }\n }\n\n enableWaiting(mustWait = false) {\n if (this.#isWaiting === mustWait) {\n return;\n }\n this.#isWaiting = mustWait;\n for (const layer of this.#allLayers.values()) {\n if (mustWait) {\n layer.disableClick();\n } else {\n layer.enableClick();\n }\n layer.div.classList.toggle(\"waiting\", mustWait);\n }\n }\n\n /**\n * Enable all the layers.\n */\n async #enableAll() {\n if (!this.#isEnabled) {\n this.#isEnabled = true;\n const promises = [];\n for (const layer of this.#allLayers.values()) {\n promises.push(layer.enable());\n }\n await Promise.all(promises);\n for (const editor of this.#allEditors.values()) {\n editor.enable();\n }\n }\n }\n\n /**\n * Disable all the layers.\n */\n #disableAll() {\n this.unselectAll();\n if (this.#isEnabled) {\n this.#isEnabled = false;\n for (const layer of this.#allLayers.values()) {\n layer.disable();\n }\n for (const editor of this.#allEditors.values()) {\n editor.disable();\n }\n }\n }\n\n /**\n * Get all the editors belonging to a given page.\n * @param {number} pageIndex\n * @returns {Array}\n */\n getEditors(pageIndex) {\n const editors = [];\n for (const editor of this.#allEditors.values()) {\n if (editor.pageIndex === pageIndex) {\n editors.push(editor);\n }\n }\n return editors;\n }\n\n /**\n * Get an editor with the given id.\n * @param {string} id\n * @returns {AnnotationEditor}\n */\n getEditor(id) {\n return this.#allEditors.get(id);\n }\n\n /**\n * Add a new editor.\n * @param {AnnotationEditor} editor\n */\n addEditor(editor) {\n this.#allEditors.set(editor.id, editor);\n }\n\n /**\n * Remove an editor.\n * @param {AnnotationEditor} editor\n */\n removeEditor(editor) {\n if (editor.div.contains(document.activeElement)) {\n if (this.#focusMainContainerTimeoutId) {\n clearTimeout(this.#focusMainContainerTimeoutId);\n }\n this.#focusMainContainerTimeoutId = setTimeout(() => {\n // When the div is removed from DOM the focus can move on the\n // document.body, so we need to move it back to the main container.\n this.focusMainContainer();\n this.#focusMainContainerTimeoutId = null;\n }, 0);\n }\n this.#allEditors.delete(editor.id);\n this.unselect(editor);\n if (\n !editor.annotationElementId ||\n !this.#deletedAnnotationsElementIds.has(editor.annotationElementId)\n ) {\n this.#annotationStorage?.remove(editor.id);\n }\n }\n\n /**\n * The annotation element with the given id has been deleted.\n * @param {AnnotationEditor} editor\n */\n addDeletedAnnotationElement(editor) {\n this.#deletedAnnotationsElementIds.add(editor.annotationElementId);\n this.addChangedExistingAnnotation(editor);\n editor.deleted = true;\n }\n\n /**\n * Check if the annotation element with the given id has been deleted.\n * @param {string} annotationElementId\n * @returns {boolean}\n */\n isDeletedAnnotationElement(annotationElementId) {\n return this.#deletedAnnotationsElementIds.has(annotationElementId);\n }\n\n /**\n * The annotation element with the given id have been restored.\n * @param {AnnotationEditor} editor\n */\n removeDeletedAnnotationElement(editor) {\n this.#deletedAnnotationsElementIds.delete(editor.annotationElementId);\n this.removeChangedExistingAnnotation(editor);\n editor.deleted = false;\n }\n\n /**\n * Add an editor to the layer it belongs to or add it to the global map.\n * @param {AnnotationEditor} editor\n */\n #addEditorToLayer(editor) {\n const layer = this.#allLayers.get(editor.pageIndex);\n if (layer) {\n layer.addOrRebuild(editor);\n } else {\n this.addEditor(editor);\n this.addToAnnotationStorage(editor);\n }\n }\n\n /**\n * Set the given editor as the active one.\n * @param {AnnotationEditor} editor\n */\n setActiveEditor(editor) {\n if (this.#activeEditor === editor) {\n return;\n }\n\n this.#activeEditor = editor;\n if (editor) {\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n }\n }\n\n get #lastSelectedEditor() {\n let ed = null;\n for (ed of this.#selectedEditors) {\n // Iterate to get the last element.\n }\n return ed;\n }\n\n /**\n * Update the UI of the active editor.\n * @param {AnnotationEditor} editor\n */\n updateUI(editor) {\n if (this.#lastSelectedEditor === editor) {\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n }\n }\n\n /**\n * Add or remove an editor the current selection.\n * @param {AnnotationEditor} editor\n */\n toggleSelected(editor) {\n if (this.#selectedEditors.has(editor)) {\n this.#selectedEditors.delete(editor);\n editor.unselect();\n this.#dispatchUpdateStates({\n hasSelectedEditor: this.hasSelection,\n });\n return;\n }\n this.#selectedEditors.add(editor);\n editor.select();\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n this.#dispatchUpdateStates({\n hasSelectedEditor: true,\n });\n }\n\n /**\n * Set the last selected editor.\n * @param {AnnotationEditor} editor\n */\n setSelected(editor) {\n for (const ed of this.#selectedEditors) {\n if (ed !== editor) {\n ed.unselect();\n }\n }\n this.#selectedEditors.clear();\n\n this.#selectedEditors.add(editor);\n editor.select();\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n this.#dispatchUpdateStates({\n hasSelectedEditor: true,\n });\n }\n\n /**\n * Check if the editor is selected.\n * @param {AnnotationEditor} editor\n */\n isSelected(editor) {\n return this.#selectedEditors.has(editor);\n }\n\n get firstSelectedEditor() {\n return this.#selectedEditors.values().next().value;\n }\n\n /**\n * Unselect an editor.\n * @param {AnnotationEditor} editor\n */\n unselect(editor) {\n editor.unselect();\n this.#selectedEditors.delete(editor);\n this.#dispatchUpdateStates({\n hasSelectedEditor: this.hasSelection,\n });\n }\n\n get hasSelection() {\n return this.#selectedEditors.size !== 0;\n }\n\n get isEnterHandled() {\n return (\n this.#selectedEditors.size === 1 &&\n this.firstSelectedEditor.isEnterHandled\n );\n }\n\n /**\n * Undo the last command.\n */\n undo() {\n this.#commandManager.undo();\n this.#dispatchUpdateStates({\n hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n hasSomethingToRedo: true,\n isEmpty: this.#isEmpty(),\n });\n }\n\n /**\n * Redo the last undoed command.\n */\n redo() {\n this.#commandManager.redo();\n this.#dispatchUpdateStates({\n hasSomethingToUndo: true,\n hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n isEmpty: this.#isEmpty(),\n });\n }\n\n /**\n * Add a command to execute (cmd) and another one to undo it.\n * @param {Object} params\n */\n addCommands(params) {\n this.#commandManager.add(params);\n this.#dispatchUpdateStates({\n hasSomethingToUndo: true,\n hasSomethingToRedo: false,\n isEmpty: this.#isEmpty(),\n });\n }\n\n #isEmpty() {\n if (this.#allEditors.size === 0) {\n return true;\n }\n\n if (this.#allEditors.size === 1) {\n for (const editor of this.#allEditors.values()) {\n return editor.isEmpty();\n }\n }\n\n return false;\n }\n\n /**\n * Delete the current editor or all.\n */\n delete() {\n this.commitOrRemove();\n if (!this.hasSelection) {\n return;\n }\n\n const editors = [...this.#selectedEditors];\n const cmd = () => {\n for (const editor of editors) {\n editor.remove();\n }\n };\n const undo = () => {\n for (const editor of editors) {\n this.#addEditorToLayer(editor);\n }\n };\n\n this.addCommands({ cmd, undo, mustExec: true });\n }\n\n commitOrRemove() {\n // An editor is being edited so just commit it.\n this.#activeEditor?.commitOrRemove();\n }\n\n hasSomethingToControl() {\n return this.#activeEditor || this.hasSelection;\n }\n\n /**\n * Select the editors.\n * @param {Array} editors\n */\n #selectEditors(editors) {\n for (const editor of this.#selectedEditors) {\n editor.unselect();\n }\n this.#selectedEditors.clear();\n for (const editor of editors) {\n if (editor.isEmpty()) {\n continue;\n }\n this.#selectedEditors.add(editor);\n editor.select();\n }\n this.#dispatchUpdateStates({ hasSelectedEditor: this.hasSelection });\n }\n\n /**\n * Select all the editors.\n */\n selectAll() {\n for (const editor of this.#selectedEditors) {\n editor.commit();\n }\n this.#selectEditors(this.#allEditors.values());\n }\n\n /**\n * Unselect all the selected editors.\n */\n unselectAll() {\n if (this.#activeEditor) {\n // An editor is being edited so just commit it.\n this.#activeEditor.commitOrRemove();\n if (this.#mode !== AnnotationEditorType.NONE) {\n // If the mode is NONE, we want to really unselect the editor, hence we\n // mustn't return here.\n return;\n }\n }\n\n if (!this.hasSelection) {\n return;\n }\n for (const editor of this.#selectedEditors) {\n editor.unselect();\n }\n this.#selectedEditors.clear();\n this.#dispatchUpdateStates({\n hasSelectedEditor: false,\n });\n }\n\n translateSelectedEditors(x, y, noCommit = false) {\n if (!noCommit) {\n this.commitOrRemove();\n }\n if (!this.hasSelection) {\n return;\n }\n\n this.#translation[0] += x;\n this.#translation[1] += y;\n const [totalX, totalY] = this.#translation;\n const editors = [...this.#selectedEditors];\n\n // We don't want to have an undo/redo for each translation so we wait a bit\n // before adding the command to the command manager.\n const TIME_TO_WAIT = 1000;\n\n if (this.#translationTimeoutId) {\n clearTimeout(this.#translationTimeoutId);\n }\n\n this.#translationTimeoutId = setTimeout(() => {\n this.#translationTimeoutId = null;\n this.#translation[0] = this.#translation[1] = 0;\n\n this.addCommands({\n cmd: () => {\n for (const editor of editors) {\n if (this.#allEditors.has(editor.id)) {\n editor.translateInPage(totalX, totalY);\n }\n }\n },\n undo: () => {\n for (const editor of editors) {\n if (this.#allEditors.has(editor.id)) {\n editor.translateInPage(-totalX, -totalY);\n }\n }\n },\n mustExec: false,\n });\n }, TIME_TO_WAIT);\n\n for (const editor of editors) {\n editor.translateInPage(x, y);\n }\n }\n\n /**\n * Set up the drag session for moving the selected editors.\n */\n setUpDragSession() {\n // Note: don't use any references to the editor's parent which can be null\n // if the editor belongs to a destroyed page.\n if (!this.hasSelection) {\n return;\n }\n // Avoid to have spurious text selection in the text layer when dragging.\n this.disableUserSelect(true);\n this.#draggingEditors = new Map();\n for (const editor of this.#selectedEditors) {\n this.#draggingEditors.set(editor, {\n savedX: editor.x,\n savedY: editor.y,\n savedPageIndex: editor.pageIndex,\n newX: 0,\n newY: 0,\n newPageIndex: -1,\n });\n }\n }\n\n /**\n * Ends the drag session.\n * @returns {boolean} true if at least one editor has been moved.\n */\n endDragSession() {\n if (!this.#draggingEditors) {\n return false;\n }\n this.disableUserSelect(false);\n const map = this.#draggingEditors;\n this.#draggingEditors = null;\n let mustBeAddedInUndoStack = false;\n\n for (const [{ x, y, pageIndex }, value] of map) {\n value.newX = x;\n value.newY = y;\n value.newPageIndex = pageIndex;\n mustBeAddedInUndoStack ||=\n x !== value.savedX ||\n y !== value.savedY ||\n pageIndex !== value.savedPageIndex;\n }\n\n if (!mustBeAddedInUndoStack) {\n return false;\n }\n\n const move = (editor, x, y, pageIndex) => {\n if (this.#allEditors.has(editor.id)) {\n // The editor can be undone/redone on a page which is not visible (and\n // which potentially has no annotation editor layer), hence we need to\n // use the pageIndex instead of the parent.\n const parent = this.#allLayers.get(pageIndex);\n if (parent) {\n editor._setParentAndPosition(parent, x, y);\n } else {\n editor.pageIndex = pageIndex;\n editor.x = x;\n editor.y = y;\n }\n }\n };\n\n this.addCommands({\n cmd: () => {\n for (const [editor, { newX, newY, newPageIndex }] of map) {\n move(editor, newX, newY, newPageIndex);\n }\n },\n undo: () => {\n for (const [editor, { savedX, savedY, savedPageIndex }] of map) {\n move(editor, savedX, savedY, savedPageIndex);\n }\n },\n mustExec: true,\n });\n\n return true;\n }\n\n /**\n * Drag the set of selected editors.\n * @param {number} tx\n * @param {number} ty\n */\n dragSelectedEditors(tx, ty) {\n if (!this.#draggingEditors) {\n return;\n }\n for (const editor of this.#draggingEditors.keys()) {\n editor.drag(tx, ty);\n }\n }\n\n /**\n * Rebuild the editor (usually on undo/redo actions) on a potentially\n * non-rendered page.\n * @param {AnnotationEditor} editor\n */\n rebuild(editor) {\n if (editor.parent === null) {\n const parent = this.getLayer(editor.pageIndex);\n if (parent) {\n parent.changeParent(editor);\n parent.addOrRebuild(editor);\n } else {\n this.addEditor(editor);\n this.addToAnnotationStorage(editor);\n editor.rebuild();\n }\n } else {\n editor.parent.addOrRebuild(editor);\n }\n }\n\n get isEditorHandlingKeyboard() {\n return (\n this.getActive()?.shouldGetKeyboardEvents() ||\n (this.#selectedEditors.size === 1 &&\n this.firstSelectedEditor.shouldGetKeyboardEvents())\n );\n }\n\n /**\n * Is the current editor the one passed as argument?\n * @param {AnnotationEditor} editor\n * @returns\n */\n isActive(editor) {\n return this.#activeEditor === editor;\n }\n\n /**\n * Get the current active editor.\n * @returns {AnnotationEditor|null}\n */\n getActive() {\n return this.#activeEditor;\n }\n\n /**\n * Get the current editor mode.\n * @returns {number}\n */\n getMode() {\n return this.#mode;\n }\n\n get imageManager() {\n return shadow(this, \"imageManager\", new ImageManager());\n }\n\n getSelectionBoxes(textLayer) {\n if (!textLayer) {\n return null;\n }\n const selection = document.getSelection();\n for (let i = 0, ii = selection.rangeCount; i < ii; i++) {\n if (\n !textLayer.contains(selection.getRangeAt(i).commonAncestorContainer)\n ) {\n return null;\n }\n }\n\n const {\n x: layerX,\n y: layerY,\n width: parentWidth,\n height: parentHeight,\n } = textLayer.getBoundingClientRect();\n\n // We must rotate the boxes because we want to have them in the non-rotated\n // page coordinates.\n let rotator;\n switch (textLayer.getAttribute(\"data-main-rotation\")) {\n case \"90\":\n rotator = (x, y, w, h) => ({\n x: (y - layerY) / parentHeight,\n y: 1 - (x + w - layerX) / parentWidth,\n width: h / parentHeight,\n height: w / parentWidth,\n });\n break;\n case \"180\":\n rotator = (x, y, w, h) => ({\n x: 1 - (x + w - layerX) / parentWidth,\n y: 1 - (y + h - layerY) / parentHeight,\n width: w / parentWidth,\n height: h / parentHeight,\n });\n break;\n case \"270\":\n rotator = (x, y, w, h) => ({\n x: 1 - (y + h - layerY) / parentHeight,\n y: (x - layerX) / parentWidth,\n width: h / parentHeight,\n height: w / parentWidth,\n });\n break;\n default:\n rotator = (x, y, w, h) => ({\n x: (x - layerX) / parentWidth,\n y: (y - layerY) / parentHeight,\n width: w / parentWidth,\n height: h / parentHeight,\n });\n break;\n }\n\n const boxes = [];\n for (let i = 0, ii = selection.rangeCount; i < ii; i++) {\n const range = selection.getRangeAt(i);\n if (range.collapsed) {\n continue;\n }\n for (const { x, y, width, height } of range.getClientRects()) {\n if (width === 0 || height === 0) {\n continue;\n }\n boxes.push(rotator(x, y, width, height));\n }\n }\n return boxes.length === 0 ? null : boxes;\n }\n\n addChangedExistingAnnotation({ annotationElementId, id }) {\n (this.#changedExistingAnnotations ||= new Map()).set(\n annotationElementId,\n id\n );\n }\n\n removeChangedExistingAnnotation({ annotationElementId }) {\n this.#changedExistingAnnotations?.delete(annotationElementId);\n }\n\n renderAnnotationElement(annotation) {\n const editorId = this.#changedExistingAnnotations?.get(annotation.data.id);\n if (!editorId) {\n return;\n }\n const editor = this.#annotationStorage.getRawValue(editorId);\n if (!editor) {\n return;\n }\n if (this.#mode === AnnotationEditorType.NONE && !editor.hasBeenModified) {\n return;\n }\n editor.renderAnnotationElement(annotation);\n }\n}\n\nexport {\n AnnotationEditorUIManager,\n bindEvents,\n ColorManager,\n CommandManager,\n KeyboardManager,\n opacityToHex,\n};\n","/* Copyright 2023 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { noContextMenu } from \"../display_utils.js\";\n\nclass AltText {\n #altText = null;\n\n #altTextDecorative = false;\n\n #altTextButton = null;\n\n #altTextButtonLabel = null;\n\n #altTextTooltip = null;\n\n #altTextTooltipTimeout = null;\n\n #altTextWasFromKeyBoard = false;\n\n #badge = null;\n\n #editor = null;\n\n #guessedText = null;\n\n #textWithDisclaimer = null;\n\n #useNewAltTextFlow = false;\n\n static #l10nNewButton = null;\n\n static _l10n = null;\n\n constructor(editor) {\n this.#editor = editor;\n this.#useNewAltTextFlow = editor._uiManager.useNewAltTextFlow;\n\n AltText.#l10nNewButton ||= Object.freeze({\n added: \"pdfjs-editor-new-alt-text-added-button\",\n \"added-label\": \"pdfjs-editor-new-alt-text-added-button-label\",\n missing: \"pdfjs-editor-new-alt-text-missing-button\",\n \"missing-label\": \"pdfjs-editor-new-alt-text-missing-button-label\",\n review: \"pdfjs-editor-new-alt-text-to-review-button\",\n \"review-label\": \"pdfjs-editor-new-alt-text-to-review-button-label\",\n });\n }\n\n static initialize(l10n) {\n AltText._l10n ??= l10n;\n }\n\n async render() {\n const altText = (this.#altTextButton = document.createElement(\"button\"));\n altText.className = \"altText\";\n altText.tabIndex = \"0\";\n\n const label = (this.#altTextButtonLabel = document.createElement(\"span\"));\n altText.append(label);\n\n if (this.#useNewAltTextFlow) {\n altText.classList.add(\"new\");\n altText.setAttribute(\"data-l10n-id\", AltText.#l10nNewButton.missing);\n label.setAttribute(\n \"data-l10n-id\",\n AltText.#l10nNewButton[\"missing-label\"]\n );\n } else {\n altText.setAttribute(\"data-l10n-id\", \"pdfjs-editor-alt-text-button\");\n label.setAttribute(\"data-l10n-id\", \"pdfjs-editor-alt-text-button-label\");\n }\n\n const signal = this.#editor._uiManager._signal;\n altText.addEventListener(\"contextmenu\", noContextMenu, { signal });\n altText.addEventListener(\"pointerdown\", event => event.stopPropagation(), {\n signal,\n });\n\n const onClick = event => {\n event.preventDefault();\n this.#editor._uiManager.editAltText(this.#editor);\n if (this.#useNewAltTextFlow) {\n this.#editor._reportTelemetry({\n action: \"pdfjs.image.alt_text.image_status_label_clicked\",\n data: { label: this.#label },\n });\n }\n };\n altText.addEventListener(\"click\", onClick, { capture: true, signal });\n altText.addEventListener(\n \"keydown\",\n event => {\n if (event.target === altText && event.key === \"Enter\") {\n this.#altTextWasFromKeyBoard = true;\n onClick(event);\n }\n },\n { signal }\n );\n await this.#setState();\n\n return altText;\n }\n\n get #label() {\n return (\n (this.#altText && \"added\") ||\n (this.#altText === null && this.guessedText && \"review\") ||\n \"missing\"\n );\n }\n\n finish() {\n if (!this.#altTextButton) {\n return;\n }\n this.#altTextButton.focus({ focusVisible: this.#altTextWasFromKeyBoard });\n this.#altTextWasFromKeyBoard = false;\n }\n\n isEmpty() {\n if (this.#useNewAltTextFlow) {\n return this.#altText === null;\n }\n return !this.#altText && !this.#altTextDecorative;\n }\n\n hasData() {\n if (this.#useNewAltTextFlow) {\n return this.#altText !== null || !!this.#guessedText;\n }\n return this.isEmpty();\n }\n\n get guessedText() {\n return this.#guessedText;\n }\n\n async setGuessedText(guessedText) {\n if (this.#altText !== null) {\n // The user provided their own alt text, so we don't want to overwrite it.\n return;\n }\n this.#guessedText = guessedText;\n this.#textWithDisclaimer = await AltText._l10n.get(\n \"pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer\",\n { generatedAltText: guessedText }\n );\n this.#setState();\n }\n\n toggleAltTextBadge(visibility = false) {\n if (!this.#useNewAltTextFlow || this.#altText) {\n this.#badge?.remove();\n this.#badge = null;\n return;\n }\n if (!this.#badge) {\n const badge = (this.#badge = document.createElement(\"div\"));\n badge.className = \"noAltTextBadge\";\n this.#editor.div.append(badge);\n }\n this.#badge.classList.toggle(\"hidden\", !visibility);\n }\n\n serialize(isForCopying) {\n let altText = this.#altText;\n if (!isForCopying && this.#guessedText === altText) {\n altText = this.#textWithDisclaimer;\n }\n return {\n altText,\n decorative: this.#altTextDecorative,\n guessedText: this.#guessedText,\n textWithDisclaimer: this.#textWithDisclaimer,\n };\n }\n\n get data() {\n return {\n altText: this.#altText,\n decorative: this.#altTextDecorative,\n };\n }\n\n /**\n * Set the alt text data.\n */\n set data({\n altText,\n decorative,\n guessedText,\n textWithDisclaimer,\n cancel = false,\n }) {\n if (guessedText) {\n this.#guessedText = guessedText;\n this.#textWithDisclaimer = textWithDisclaimer;\n }\n if (this.#altText === altText && this.#altTextDecorative === decorative) {\n return;\n }\n if (!cancel) {\n this.#altText = altText;\n this.#altTextDecorative = decorative;\n }\n this.#setState();\n }\n\n toggle(enabled = false) {\n if (!this.#altTextButton) {\n return;\n }\n if (!enabled && this.#altTextTooltipTimeout) {\n clearTimeout(this.#altTextTooltipTimeout);\n this.#altTextTooltipTimeout = null;\n }\n this.#altTextButton.disabled = !enabled;\n }\n\n shown() {\n this.#editor._reportTelemetry({\n action: \"pdfjs.image.alt_text.image_status_label_displayed\",\n data: { label: this.#label },\n });\n }\n\n destroy() {\n this.#altTextButton?.remove();\n this.#altTextButton = null;\n this.#altTextButtonLabel = null;\n this.#altTextTooltip = null;\n this.#badge?.remove();\n this.#badge = null;\n }\n\n async #setState() {\n const button = this.#altTextButton;\n if (!button) {\n return;\n }\n\n if (this.#useNewAltTextFlow) {\n button.classList.toggle(\"done\", !!this.#altText);\n button.setAttribute(\"data-l10n-id\", AltText.#l10nNewButton[this.#label]);\n\n this.#altTextButtonLabel?.setAttribute(\n \"data-l10n-id\",\n AltText.#l10nNewButton[`${this.#label}-label`]\n );\n if (!this.#altText) {\n this.#altTextTooltip?.remove();\n return;\n }\n } else {\n if (!this.#altText && !this.#altTextDecorative) {\n button.classList.remove(\"done\");\n this.#altTextTooltip?.remove();\n return;\n }\n button.classList.add(\"done\");\n button.setAttribute(\"data-l10n-id\", \"pdfjs-editor-alt-text-edit-button\");\n }\n\n let tooltip = this.#altTextTooltip;\n if (!tooltip) {\n this.#altTextTooltip = tooltip = document.createElement(\"span\");\n tooltip.className = \"tooltip\";\n tooltip.setAttribute(\"role\", \"tooltip\");\n tooltip.id = `alt-text-tooltip-${this.#editor.id}`;\n\n const DELAY_TO_SHOW_TOOLTIP = 100;\n const signal = this.#editor._uiManager._signal;\n signal.addEventListener(\n \"abort\",\n () => {\n clearTimeout(this.#altTextTooltipTimeout);\n this.#altTextTooltipTimeout = null;\n },\n { once: true }\n );\n button.addEventListener(\n \"mouseenter\",\n () => {\n this.#altTextTooltipTimeout = setTimeout(() => {\n this.#altTextTooltipTimeout = null;\n this.#altTextTooltip.classList.add(\"show\");\n this.#editor._reportTelemetry({\n action: \"alt_text_tooltip\",\n });\n }, DELAY_TO_SHOW_TOOLTIP);\n },\n { signal }\n );\n button.addEventListener(\n \"mouseleave\",\n () => {\n if (this.#altTextTooltipTimeout) {\n clearTimeout(this.#altTextTooltipTimeout);\n this.#altTextTooltipTimeout = null;\n }\n this.#altTextTooltip?.classList.remove(\"show\");\n },\n { signal }\n );\n }\n if (this.#altTextDecorative) {\n tooltip.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-alt-text-decorative-tooltip\"\n );\n } else {\n tooltip.removeAttribute(\"data-l10n-id\");\n tooltip.textContent = this.#altText;\n }\n\n if (!tooltip.parentNode) {\n button.append(tooltip);\n }\n\n const element = this.#editor.getImageForAltText();\n element?.setAttribute(\"aria-describedby\", tooltip.id);\n }\n}\n\nexport { AltText };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n AnnotationEditorUIManager,\n bindEvents,\n ColorManager,\n KeyboardManager,\n} from \"./tools.js\";\nimport { FeatureTest, shadow, unreachable } from \"../../shared/util.js\";\nimport { AltText } from \"./alt_text.js\";\nimport { EditorToolbar } from \"./toolbar.js\";\nimport { noContextMenu } from \"../display_utils.js\";\n\n/**\n * @typedef {Object} AnnotationEditorParameters\n * @property {AnnotationEditorUIManager} uiManager - the global manager\n * @property {AnnotationEditorLayer} parent - the layer containing this editor\n * @property {string} id - editor id\n * @property {number} x - x-coordinate\n * @property {number} y - y-coordinate\n */\n\n/**\n * Base class for editors.\n */\nclass AnnotationEditor {\n #accessibilityData = null;\n\n #allResizerDivs = null;\n\n #altText = null;\n\n #disabled = false;\n\n #keepAspectRatio = false;\n\n #resizersDiv = null;\n\n #savedDimensions = null;\n\n #focusAC = null;\n\n #focusedResizerName = \"\";\n\n #hasBeenClicked = false;\n\n #initialPosition = null;\n\n #isEditing = false;\n\n #isInEditMode = false;\n\n #isResizerEnabledForKeyboard = false;\n\n #moveInDOMTimeout = null;\n\n #prevDragX = 0;\n\n #prevDragY = 0;\n\n #telemetryTimeouts = null;\n\n _editToolbar = null;\n\n _initialOptions = Object.create(null);\n\n _initialData = null;\n\n _isVisible = true;\n\n _uiManager = null;\n\n _focusEventsAllowed = true;\n\n static _l10n = null;\n\n static _l10nResizer = null;\n\n #isDraggable = false;\n\n #zIndex = AnnotationEditor._zIndex++;\n\n static _borderLineWidth = -1;\n\n static _colorManager = new ColorManager();\n\n static _zIndex = 1;\n\n // Time to wait (in ms) before sending the telemetry data.\n // We wait a bit to avoid sending too many requests when changing something\n // like the thickness of a line.\n static _telemetryTimeout = 1000;\n\n static get _resizerKeyboardManager() {\n const resize = AnnotationEditor.prototype._resizeWithKeyboard;\n const small = AnnotationEditorUIManager.TRANSLATE_SMALL;\n const big = AnnotationEditorUIManager.TRANSLATE_BIG;\n\n return shadow(\n this,\n \"_resizerKeyboardManager\",\n new KeyboardManager([\n [[\"ArrowLeft\", \"mac+ArrowLeft\"], resize, { args: [-small, 0] }],\n [\n [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n resize,\n { args: [-big, 0] },\n ],\n [[\"ArrowRight\", \"mac+ArrowRight\"], resize, { args: [small, 0] }],\n [\n [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n resize,\n { args: [big, 0] },\n ],\n [[\"ArrowUp\", \"mac+ArrowUp\"], resize, { args: [0, -small] }],\n [[\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"], resize, { args: [0, -big] }],\n [[\"ArrowDown\", \"mac+ArrowDown\"], resize, { args: [0, small] }],\n [[\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"], resize, { args: [0, big] }],\n [\n [\"Escape\", \"mac+Escape\"],\n AnnotationEditor.prototype._stopResizingWithKeyboard,\n ],\n ])\n );\n }\n\n /**\n * @param {AnnotationEditorParameters} parameters\n */\n constructor(parameters) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === AnnotationEditor\n ) {\n unreachable(\"Cannot initialize AnnotationEditor.\");\n }\n\n this.parent = parameters.parent;\n this.id = parameters.id;\n this.width = this.height = null;\n this.pageIndex = parameters.parent.pageIndex;\n this.name = parameters.name;\n this.div = null;\n this._uiManager = parameters.uiManager;\n this.annotationElementId = null;\n this._willKeepAspectRatio = false;\n this._initialOptions.isCentered = parameters.isCentered;\n this._structTreeParentId = null;\n\n const {\n rotation,\n rawDims: { pageWidth, pageHeight, pageX, pageY },\n } = this.parent.viewport;\n\n this.rotation = rotation;\n this.pageRotation =\n (360 + rotation - this._uiManager.viewParameters.rotation) % 360;\n this.pageDimensions = [pageWidth, pageHeight];\n this.pageTranslation = [pageX, pageY];\n\n const [width, height] = this.parentDimensions;\n this.x = parameters.x / width;\n this.y = parameters.y / height;\n\n this.isAttachedToDOM = false;\n this.deleted = false;\n }\n\n get editorType() {\n return Object.getPrototypeOf(this).constructor._type;\n }\n\n static get _defaultLineColor() {\n return shadow(\n this,\n \"_defaultLineColor\",\n this._colorManager.getHexCode(\"CanvasText\")\n );\n }\n\n static deleteAnnotationElement(editor) {\n const fakeEditor = new FakeEditor({\n id: editor.parent.getNextId(),\n parent: editor.parent,\n uiManager: editor._uiManager,\n });\n fakeEditor.annotationElementId = editor.annotationElementId;\n fakeEditor.deleted = true;\n fakeEditor._uiManager.addToAnnotationStorage(fakeEditor);\n }\n\n /**\n * Initialize the l10n stuff for this type of editor.\n * @param {Object} l10n\n */\n static initialize(l10n, _uiManager) {\n AnnotationEditor._l10n ??= l10n;\n\n AnnotationEditor._l10nResizer ||= Object.freeze({\n topLeft: \"pdfjs-editor-resizer-top-left\",\n topMiddle: \"pdfjs-editor-resizer-top-middle\",\n topRight: \"pdfjs-editor-resizer-top-right\",\n middleRight: \"pdfjs-editor-resizer-middle-right\",\n bottomRight: \"pdfjs-editor-resizer-bottom-right\",\n bottomMiddle: \"pdfjs-editor-resizer-bottom-middle\",\n bottomLeft: \"pdfjs-editor-resizer-bottom-left\",\n middleLeft: \"pdfjs-editor-resizer-middle-left\",\n });\n\n if (AnnotationEditor._borderLineWidth !== -1) {\n return;\n }\n const style = getComputedStyle(document.documentElement);\n AnnotationEditor._borderLineWidth =\n parseFloat(style.getPropertyValue(\"--outline-width\")) || 0;\n }\n\n /**\n * Update the default parameters for this type of editor.\n * @param {number} _type\n * @param {*} _value\n */\n static updateDefaultParams(_type, _value) {}\n\n /**\n * Get the default properties to set in the UI for this type of editor.\n * @returns {Array}\n */\n static get defaultPropertiesToUpdate() {\n return [];\n }\n\n /**\n * Check if this kind of editor is able to handle the given mime type for\n * pasting.\n * @param {string} mime\n * @returns {boolean}\n */\n static isHandlingMimeForPasting(mime) {\n return false;\n }\n\n /**\n * Extract the data from the clipboard item and delegate the creation of the\n * editor to the parent.\n * @param {DataTransferItem} item\n * @param {AnnotationEditorLayer} parent\n */\n static paste(item, parent) {\n unreachable(\"Not implemented\");\n }\n\n /**\n * Get the properties to update in the UI for this editor.\n * @returns {Array}\n */\n get propertiesToUpdate() {\n return [];\n }\n\n get _isDraggable() {\n return this.#isDraggable;\n }\n\n set _isDraggable(value) {\n this.#isDraggable = value;\n this.div?.classList.toggle(\"draggable\", value);\n }\n\n /**\n * @returns {boolean} true if the editor handles the Enter key itself.\n */\n get isEnterHandled() {\n return true;\n }\n\n center() {\n const [pageWidth, pageHeight] = this.pageDimensions;\n switch (this.parentRotation) {\n case 90:\n this.x -= (this.height * pageHeight) / (pageWidth * 2);\n this.y += (this.width * pageWidth) / (pageHeight * 2);\n break;\n case 180:\n this.x += this.width / 2;\n this.y += this.height / 2;\n break;\n case 270:\n this.x += (this.height * pageHeight) / (pageWidth * 2);\n this.y -= (this.width * pageWidth) / (pageHeight * 2);\n break;\n default:\n this.x -= this.width / 2;\n this.y -= this.height / 2;\n break;\n }\n this.fixAndSetPosition();\n }\n\n /**\n * Add some commands into the CommandManager (undo/redo stuff).\n * @param {Object} params\n */\n addCommands(params) {\n this._uiManager.addCommands(params);\n }\n\n get currentLayer() {\n return this._uiManager.currentLayer;\n }\n\n /**\n * This editor will be behind the others.\n */\n setInBackground() {\n this.div.style.zIndex = 0;\n }\n\n /**\n * This editor will be in the foreground.\n */\n setInForeground() {\n this.div.style.zIndex = this.#zIndex;\n }\n\n setParent(parent) {\n if (parent !== null) {\n this.pageIndex = parent.pageIndex;\n this.pageDimensions = parent.pageDimensions;\n } else {\n // The editor is being removed from the DOM, so we need to stop resizing.\n this.#stopResizing();\n }\n this.parent = parent;\n }\n\n /**\n * onfocus callback.\n */\n focusin(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n if (!this.#hasBeenClicked) {\n this.parent.setSelected(this);\n } else {\n this.#hasBeenClicked = false;\n }\n }\n\n /**\n * onblur callback.\n * @param {FocusEvent} event\n */\n focusout(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n\n if (!this.isAttachedToDOM) {\n return;\n }\n\n // In case of focusout, the relatedTarget is the element which\n // is grabbing the focus.\n // So if the related target is an element under the div for this\n // editor, then the editor isn't unactive.\n const target = event.relatedTarget;\n if (target?.closest(`#${this.id}`)) {\n return;\n }\n\n event.preventDefault();\n\n if (!this.parent?.isMultipleSelection) {\n this.commitOrRemove();\n }\n }\n\n commitOrRemove() {\n if (this.isEmpty()) {\n this.remove();\n } else {\n this.commit();\n }\n }\n\n /**\n * Commit the data contained in this editor.\n */\n commit() {\n this.addToAnnotationStorage();\n }\n\n addToAnnotationStorage() {\n this._uiManager.addToAnnotationStorage(this);\n }\n\n /**\n * Set the editor position within its parent.\n * @param {number} x\n * @param {number} y\n * @param {number} tx - x-translation in screen coordinates.\n * @param {number} ty - y-translation in screen coordinates.\n */\n setAt(x, y, tx, ty) {\n const [width, height] = this.parentDimensions;\n [tx, ty] = this.screenToPageTranslation(tx, ty);\n\n this.x = (x + tx) / width;\n this.y = (y + ty) / height;\n\n this.fixAndSetPosition();\n }\n\n #translate([width, height], x, y) {\n [x, y] = this.screenToPageTranslation(x, y);\n\n this.x += x / width;\n this.y += y / height;\n\n this.fixAndSetPosition();\n }\n\n /**\n * Translate the editor position within its parent.\n * @param {number} x - x-translation in screen coordinates.\n * @param {number} y - y-translation in screen coordinates.\n */\n translate(x, y) {\n // We don't change the initial position because the move here hasn't been\n // done by the user.\n this.#translate(this.parentDimensions, x, y);\n }\n\n /**\n * Translate the editor position within its page and adjust the scroll\n * in order to have the editor in the view.\n * @param {number} x - x-translation in page coordinates.\n * @param {number} y - y-translation in page coordinates.\n */\n translateInPage(x, y) {\n this.#initialPosition ||= [this.x, this.y];\n this.#translate(this.pageDimensions, x, y);\n this.div.scrollIntoView({ block: \"nearest\" });\n }\n\n drag(tx, ty) {\n this.#initialPosition ||= [this.x, this.y];\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.x += tx / parentWidth;\n this.y += ty / parentHeight;\n if (this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {\n // It's possible to not have a parent: for example, when the user is\n // dragging all the selected editors but this one on a page which has been\n // destroyed.\n // It's why we need to check for it. In such a situation, it isn't really\n // a problem to not find a new parent: it's something which is related to\n // what the user is seeing, hence it depends on how pages are layed out.\n\n // The element will be outside of its parent so change the parent.\n const { x, y } = this.div.getBoundingClientRect();\n if (this.parent.findNewParent(this, x, y)) {\n this.x -= Math.floor(this.x);\n this.y -= Math.floor(this.y);\n }\n }\n\n // The editor can be moved wherever the user wants, so we don't need to fix\n // the position: it'll be done when the user will release the mouse button.\n\n let { x, y } = this;\n const [bx, by] = this.getBaseTranslation();\n x += bx;\n y += by;\n\n this.div.style.left = `${(100 * x).toFixed(2)}%`;\n this.div.style.top = `${(100 * y).toFixed(2)}%`;\n this.div.scrollIntoView({ block: \"nearest\" });\n }\n\n get _hasBeenMoved() {\n return (\n !!this.#initialPosition &&\n (this.#initialPosition[0] !== this.x ||\n this.#initialPosition[1] !== this.y)\n );\n }\n\n /**\n * Get the translation to take into account the editor border.\n * The CSS engine positions the element by taking the border into account so\n * we must apply the opposite translation to have the editor in the right\n * position.\n * @returns {Array}\n */\n getBaseTranslation() {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const { _borderLineWidth } = AnnotationEditor;\n const x = _borderLineWidth / parentWidth;\n const y = _borderLineWidth / parentHeight;\n switch (this.rotation) {\n case 90:\n return [-x, y];\n case 180:\n return [x, y];\n case 270:\n return [x, -y];\n default:\n return [-x, -y];\n }\n }\n\n /**\n * @returns {boolean} true if position must be fixed (i.e. make the x and y\n * living in the page).\n */\n get _mustFixPosition() {\n return true;\n }\n\n /**\n * Fix the position of the editor in order to keep it inside its parent page.\n * @param {number} [rotation] - the rotation of the page.\n */\n fixAndSetPosition(rotation = this.rotation) {\n const [pageWidth, pageHeight] = this.pageDimensions;\n let { x, y, width, height } = this;\n width *= pageWidth;\n height *= pageHeight;\n x *= pageWidth;\n y *= pageHeight;\n\n if (this._mustFixPosition) {\n switch (rotation) {\n case 0:\n x = Math.max(0, Math.min(pageWidth - width, x));\n y = Math.max(0, Math.min(pageHeight - height, y));\n break;\n case 90:\n x = Math.max(0, Math.min(pageWidth - height, x));\n y = Math.min(pageHeight, Math.max(width, y));\n break;\n case 180:\n x = Math.min(pageWidth, Math.max(width, x));\n y = Math.min(pageHeight, Math.max(height, y));\n break;\n case 270:\n x = Math.min(pageWidth, Math.max(height, x));\n y = Math.max(0, Math.min(pageHeight - width, y));\n break;\n }\n }\n\n this.x = x /= pageWidth;\n this.y = y /= pageHeight;\n\n const [bx, by] = this.getBaseTranslation();\n x += bx;\n y += by;\n\n const { style } = this.div;\n style.left = `${(100 * x).toFixed(2)}%`;\n style.top = `${(100 * y).toFixed(2)}%`;\n\n this.moveInDOM();\n }\n\n static #rotatePoint(x, y, angle) {\n switch (angle) {\n case 90:\n return [y, -x];\n case 180:\n return [-x, -y];\n case 270:\n return [-y, x];\n default:\n return [x, y];\n }\n }\n\n /**\n * Convert a screen translation into a page one.\n * @param {number} x\n * @param {number} y\n */\n screenToPageTranslation(x, y) {\n return AnnotationEditor.#rotatePoint(x, y, this.parentRotation);\n }\n\n /**\n * Convert a page translation into a screen one.\n * @param {number} x\n * @param {number} y\n */\n pageTranslationToScreen(x, y) {\n return AnnotationEditor.#rotatePoint(x, y, 360 - this.parentRotation);\n }\n\n #getRotationMatrix(rotation) {\n switch (rotation) {\n case 90: {\n const [pageWidth, pageHeight] = this.pageDimensions;\n return [0, -pageWidth / pageHeight, pageHeight / pageWidth, 0];\n }\n case 180:\n return [-1, 0, 0, -1];\n case 270: {\n const [pageWidth, pageHeight] = this.pageDimensions;\n return [0, pageWidth / pageHeight, -pageHeight / pageWidth, 0];\n }\n default:\n return [1, 0, 0, 1];\n }\n }\n\n get parentScale() {\n return this._uiManager.viewParameters.realScale;\n }\n\n get parentRotation() {\n return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360;\n }\n\n get parentDimensions() {\n const {\n parentScale,\n pageDimensions: [pageWidth, pageHeight],\n } = this;\n return [pageWidth * parentScale, pageHeight * parentScale];\n }\n\n /**\n * Set the dimensions of this editor.\n * @param {number} width\n * @param {number} height\n */\n setDims(width, height) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.div.style.width = `${((100 * width) / parentWidth).toFixed(2)}%`;\n if (!this.#keepAspectRatio) {\n this.div.style.height = `${((100 * height) / parentHeight).toFixed(2)}%`;\n }\n }\n\n fixDims() {\n const { style } = this.div;\n const { height, width } = style;\n const widthPercent = width.endsWith(\"%\");\n const heightPercent = !this.#keepAspectRatio && height.endsWith(\"%\");\n if (widthPercent && heightPercent) {\n return;\n }\n\n const [parentWidth, parentHeight] = this.parentDimensions;\n if (!widthPercent) {\n style.width = `${((100 * parseFloat(width)) / parentWidth).toFixed(2)}%`;\n }\n if (!this.#keepAspectRatio && !heightPercent) {\n style.height = `${((100 * parseFloat(height)) / parentHeight).toFixed(\n 2\n )}%`;\n }\n }\n\n /**\n * Get the translation used to position this editor when it's created.\n * @returns {Array}\n */\n getInitialTranslation() {\n return [0, 0];\n }\n\n #createResizers() {\n if (this.#resizersDiv) {\n return;\n }\n this.#resizersDiv = document.createElement(\"div\");\n this.#resizersDiv.classList.add(\"resizers\");\n // When the resizers are used with the keyboard, they're focusable, hence\n // we want to have them in this order (top left, top middle, top right, ...)\n // in the DOM to have the focus order correct.\n const classes = this._willKeepAspectRatio\n ? [\"topLeft\", \"topRight\", \"bottomRight\", \"bottomLeft\"]\n : [\n \"topLeft\",\n \"topMiddle\",\n \"topRight\",\n \"middleRight\",\n \"bottomRight\",\n \"bottomMiddle\",\n \"bottomLeft\",\n \"middleLeft\",\n ];\n const signal = this._uiManager._signal;\n for (const name of classes) {\n const div = document.createElement(\"div\");\n this.#resizersDiv.append(div);\n div.classList.add(\"resizer\", name);\n div.setAttribute(\"data-resizer-name\", name);\n div.addEventListener(\n \"pointerdown\",\n this.#resizerPointerdown.bind(this, name),\n { signal }\n );\n div.addEventListener(\"contextmenu\", noContextMenu, { signal });\n div.tabIndex = -1;\n }\n this.div.prepend(this.#resizersDiv);\n }\n\n #resizerPointerdown(name, event) {\n event.preventDefault();\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n return;\n }\n\n this.#altText?.toggle(false);\n\n const savedDraggable = this._isDraggable;\n this._isDraggable = false;\n\n const ac = new AbortController();\n const signal = this._uiManager.combinedSignal(ac);\n\n this.parent.togglePointerEvents(false);\n window.addEventListener(\n \"pointermove\",\n this.#resizerPointermove.bind(this, name),\n { passive: true, capture: true, signal }\n );\n window.addEventListener(\"contextmenu\", noContextMenu, { signal });\n const savedX = this.x;\n const savedY = this.y;\n const savedWidth = this.width;\n const savedHeight = this.height;\n const savedParentCursor = this.parent.div.style.cursor;\n const savedCursor = this.div.style.cursor;\n this.div.style.cursor = this.parent.div.style.cursor =\n window.getComputedStyle(event.target).cursor;\n\n const pointerUpCallback = () => {\n ac.abort();\n this.parent.togglePointerEvents(true);\n this.#altText?.toggle(true);\n this._isDraggable = savedDraggable;\n this.parent.div.style.cursor = savedParentCursor;\n this.div.style.cursor = savedCursor;\n\n this.#addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight);\n };\n window.addEventListener(\"pointerup\", pointerUpCallback, { signal });\n // If the user switches to another window (with alt+tab), then we end the\n // resize session.\n window.addEventListener(\"blur\", pointerUpCallback, { signal });\n }\n\n #addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight) {\n const newX = this.x;\n const newY = this.y;\n const newWidth = this.width;\n const newHeight = this.height;\n if (\n newX === savedX &&\n newY === savedY &&\n newWidth === savedWidth &&\n newHeight === savedHeight\n ) {\n return;\n }\n\n this.addCommands({\n cmd: () => {\n this.width = newWidth;\n this.height = newHeight;\n this.x = newX;\n this.y = newY;\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(parentWidth * newWidth, parentHeight * newHeight);\n this.fixAndSetPosition();\n },\n undo: () => {\n this.width = savedWidth;\n this.height = savedHeight;\n this.x = savedX;\n this.y = savedY;\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(parentWidth * savedWidth, parentHeight * savedHeight);\n this.fixAndSetPosition();\n },\n mustExec: true,\n });\n }\n\n #resizerPointermove(name, event) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const savedX = this.x;\n const savedY = this.y;\n const savedWidth = this.width;\n const savedHeight = this.height;\n const minWidth = AnnotationEditor.MIN_SIZE / parentWidth;\n const minHeight = AnnotationEditor.MIN_SIZE / parentHeight;\n\n // 10000 because we multiply by 100 and use toFixed(2) in fixAndSetPosition.\n // Without rounding, the positions of the corners other than the top left\n // one can be slightly wrong.\n const round = x => Math.round(x * 10000) / 10000;\n const rotationMatrix = this.#getRotationMatrix(this.rotation);\n const transf = (x, y) => [\n rotationMatrix[0] * x + rotationMatrix[2] * y,\n rotationMatrix[1] * x + rotationMatrix[3] * y,\n ];\n const invRotationMatrix = this.#getRotationMatrix(360 - this.rotation);\n const invTransf = (x, y) => [\n invRotationMatrix[0] * x + invRotationMatrix[2] * y,\n invRotationMatrix[1] * x + invRotationMatrix[3] * y,\n ];\n let getPoint;\n let getOpposite;\n let isDiagonal = false;\n let isHorizontal = false;\n\n switch (name) {\n case \"topLeft\":\n isDiagonal = true;\n getPoint = (w, h) => [0, 0];\n getOpposite = (w, h) => [w, h];\n break;\n case \"topMiddle\":\n getPoint = (w, h) => [w / 2, 0];\n getOpposite = (w, h) => [w / 2, h];\n break;\n case \"topRight\":\n isDiagonal = true;\n getPoint = (w, h) => [w, 0];\n getOpposite = (w, h) => [0, h];\n break;\n case \"middleRight\":\n isHorizontal = true;\n getPoint = (w, h) => [w, h / 2];\n getOpposite = (w, h) => [0, h / 2];\n break;\n case \"bottomRight\":\n isDiagonal = true;\n getPoint = (w, h) => [w, h];\n getOpposite = (w, h) => [0, 0];\n break;\n case \"bottomMiddle\":\n getPoint = (w, h) => [w / 2, h];\n getOpposite = (w, h) => [w / 2, 0];\n break;\n case \"bottomLeft\":\n isDiagonal = true;\n getPoint = (w, h) => [0, h];\n getOpposite = (w, h) => [w, 0];\n break;\n case \"middleLeft\":\n isHorizontal = true;\n getPoint = (w, h) => [0, h / 2];\n getOpposite = (w, h) => [w, h / 2];\n break;\n }\n\n const point = getPoint(savedWidth, savedHeight);\n const oppositePoint = getOpposite(savedWidth, savedHeight);\n let transfOppositePoint = transf(...oppositePoint);\n const oppositeX = round(savedX + transfOppositePoint[0]);\n const oppositeY = round(savedY + transfOppositePoint[1]);\n let ratioX = 1;\n let ratioY = 1;\n\n let [deltaX, deltaY] = this.screenToPageTranslation(\n event.movementX,\n event.movementY\n );\n [deltaX, deltaY] = invTransf(deltaX / parentWidth, deltaY / parentHeight);\n\n if (isDiagonal) {\n const oldDiag = Math.hypot(savedWidth, savedHeight);\n ratioX = ratioY = Math.max(\n Math.min(\n Math.hypot(\n oppositePoint[0] - point[0] - deltaX,\n oppositePoint[1] - point[1] - deltaY\n ) / oldDiag,\n // Avoid the editor to be larger than the page.\n 1 / savedWidth,\n 1 / savedHeight\n ),\n // Avoid the editor to be smaller than the minimum size.\n minWidth / savedWidth,\n minHeight / savedHeight\n );\n } else if (isHorizontal) {\n ratioX =\n Math.max(\n minWidth,\n Math.min(1, Math.abs(oppositePoint[0] - point[0] - deltaX))\n ) / savedWidth;\n } else {\n ratioY =\n Math.max(\n minHeight,\n Math.min(1, Math.abs(oppositePoint[1] - point[1] - deltaY))\n ) / savedHeight;\n }\n\n const newWidth = round(savedWidth * ratioX);\n const newHeight = round(savedHeight * ratioY);\n transfOppositePoint = transf(...getOpposite(newWidth, newHeight));\n const newX = oppositeX - transfOppositePoint[0];\n const newY = oppositeY - transfOppositePoint[1];\n\n this.width = newWidth;\n this.height = newHeight;\n this.x = newX;\n this.y = newY;\n\n this.setDims(parentWidth * newWidth, parentHeight * newHeight);\n this.fixAndSetPosition();\n }\n\n /**\n * Called when the alt text dialog is closed.\n */\n altTextFinish() {\n this.#altText?.finish();\n }\n\n /**\n * Add a toolbar for this editor.\n * @returns {Promise}\n */\n async addEditToolbar() {\n if (this._editToolbar || this.#isInEditMode) {\n return this._editToolbar;\n }\n this._editToolbar = new EditorToolbar(this);\n this.div.append(this._editToolbar.render());\n if (this.#altText) {\n await this._editToolbar.addAltText(this.#altText);\n }\n\n return this._editToolbar;\n }\n\n removeEditToolbar() {\n if (!this._editToolbar) {\n return;\n }\n this._editToolbar.remove();\n this._editToolbar = null;\n\n // We destroy the alt text but we don't null it because we want to be able\n // to restore it in case the user undoes the deletion.\n this.#altText?.destroy();\n }\n\n addContainer(container) {\n const editToolbarDiv = this._editToolbar?.div;\n if (editToolbarDiv) {\n editToolbarDiv.before(container);\n } else {\n this.div.append(container);\n }\n }\n\n getClientDimensions() {\n return this.div.getBoundingClientRect();\n }\n\n async addAltTextButton() {\n if (this.#altText) {\n return;\n }\n AltText.initialize(AnnotationEditor._l10n);\n this.#altText = new AltText(this);\n if (this.#accessibilityData) {\n this.#altText.data = this.#accessibilityData;\n this.#accessibilityData = null;\n }\n await this.addEditToolbar();\n }\n\n get altTextData() {\n return this.#altText?.data;\n }\n\n /**\n * Set the alt text data.\n */\n set altTextData(data) {\n if (!this.#altText) {\n return;\n }\n this.#altText.data = data;\n }\n\n get guessedAltText() {\n return this.#altText?.guessedText;\n }\n\n async setGuessedAltText(text) {\n await this.#altText?.setGuessedText(text);\n }\n\n serializeAltText(isForCopying) {\n return this.#altText?.serialize(isForCopying);\n }\n\n hasAltText() {\n return !!this.#altText && !this.#altText.isEmpty();\n }\n\n hasAltTextData() {\n return this.#altText?.hasData() ?? false;\n }\n\n /**\n * Render this editor in a div.\n * @returns {HTMLDivElement | null}\n */\n render() {\n this.div = document.createElement(\"div\");\n this.div.setAttribute(\"data-editor-rotation\", (360 - this.rotation) % 360);\n this.div.className = this.name;\n this.div.setAttribute(\"id\", this.id);\n this.div.tabIndex = this.#disabled ? -1 : 0;\n if (!this._isVisible) {\n this.div.classList.add(\"hidden\");\n }\n\n this.setInForeground();\n this.#addFocusListeners();\n\n const [parentWidth, parentHeight] = this.parentDimensions;\n if (this.parentRotation % 180 !== 0) {\n this.div.style.maxWidth = `${((100 * parentHeight) / parentWidth).toFixed(\n 2\n )}%`;\n this.div.style.maxHeight = `${(\n (100 * parentWidth) /\n parentHeight\n ).toFixed(2)}%`;\n }\n\n const [tx, ty] = this.getInitialTranslation();\n this.translate(tx, ty);\n\n bindEvents(this, this.div, [\"pointerdown\"]);\n\n return this.div;\n }\n\n /**\n * Onpointerdown callback.\n * @param {PointerEvent} event\n */\n pointerdown(event) {\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n // Avoid to focus this editor because of a non-left click.\n event.preventDefault();\n return;\n }\n\n this.#hasBeenClicked = true;\n\n if (this._isDraggable) {\n this.#setUpDragSession(event);\n return;\n }\n\n this.#selectOnPointerEvent(event);\n }\n\n get isSelected() {\n return this._uiManager.isSelected(this);\n }\n\n #selectOnPointerEvent(event) {\n const { isMac } = FeatureTest.platform;\n if (\n (event.ctrlKey && !isMac) ||\n event.shiftKey ||\n (event.metaKey && isMac)\n ) {\n this.parent.toggleSelected(this);\n } else {\n this.parent.setSelected(this);\n }\n }\n\n #setUpDragSession(event) {\n const { isSelected } = this;\n this._uiManager.setUpDragSession();\n\n const ac = new AbortController();\n const signal = this._uiManager.combinedSignal(ac);\n\n if (isSelected) {\n this.div.classList.add(\"moving\");\n this.#prevDragX = event.clientX;\n this.#prevDragY = event.clientY;\n const pointerMoveCallback = e => {\n const { clientX: x, clientY: y } = e;\n const [tx, ty] = this.screenToPageTranslation(\n x - this.#prevDragX,\n y - this.#prevDragY\n );\n this.#prevDragX = x;\n this.#prevDragY = y;\n this._uiManager.dragSelectedEditors(tx, ty);\n };\n window.addEventListener(\"pointermove\", pointerMoveCallback, {\n passive: true,\n capture: true,\n signal,\n });\n }\n\n const pointerUpCallback = () => {\n ac.abort();\n if (isSelected) {\n this.div.classList.remove(\"moving\");\n }\n\n this.#hasBeenClicked = false;\n if (!this._uiManager.endDragSession()) {\n this.#selectOnPointerEvent(event);\n }\n };\n window.addEventListener(\"pointerup\", pointerUpCallback, { signal });\n // If the user is using alt+tab during the dragging session, the pointerup\n // event could be not fired, but a blur event is fired so we can use it in\n // order to interrupt the dragging session.\n window.addEventListener(\"blur\", pointerUpCallback, { signal });\n }\n\n moveInDOM() {\n // Moving the editor in the DOM can be expensive, so we wait a bit before.\n // It's important to not block the UI (for example when changing the font\n // size in a FreeText).\n if (this.#moveInDOMTimeout) {\n clearTimeout(this.#moveInDOMTimeout);\n }\n this.#moveInDOMTimeout = setTimeout(() => {\n this.#moveInDOMTimeout = null;\n this.parent?.moveEditorInDOM(this);\n }, 0);\n }\n\n _setParentAndPosition(parent, x, y) {\n parent.changeParent(this);\n this.x = x;\n this.y = y;\n this.fixAndSetPosition();\n }\n\n /**\n * Convert the current rect into a page one.\n * @param {number} tx - x-translation in screen coordinates.\n * @param {number} ty - y-translation in screen coordinates.\n * @param {number} [rotation] - the rotation of the page.\n */\n getRect(tx, ty, rotation = this.rotation) {\n const scale = this.parentScale;\n const [pageWidth, pageHeight] = this.pageDimensions;\n const [pageX, pageY] = this.pageTranslation;\n const shiftX = tx / scale;\n const shiftY = ty / scale;\n const x = this.x * pageWidth;\n const y = this.y * pageHeight;\n const width = this.width * pageWidth;\n const height = this.height * pageHeight;\n\n switch (rotation) {\n case 0:\n return [\n x + shiftX + pageX,\n pageHeight - y - shiftY - height + pageY,\n x + shiftX + width + pageX,\n pageHeight - y - shiftY + pageY,\n ];\n case 90:\n return [\n x + shiftY + pageX,\n pageHeight - y + shiftX + pageY,\n x + shiftY + height + pageX,\n pageHeight - y + shiftX + width + pageY,\n ];\n case 180:\n return [\n x - shiftX - width + pageX,\n pageHeight - y + shiftY + pageY,\n x - shiftX + pageX,\n pageHeight - y + shiftY + height + pageY,\n ];\n case 270:\n return [\n x - shiftY - height + pageX,\n pageHeight - y - shiftX - width + pageY,\n x - shiftY + pageX,\n pageHeight - y - shiftX + pageY,\n ];\n default:\n throw new Error(\"Invalid rotation\");\n }\n }\n\n getRectInCurrentCoords(rect, pageHeight) {\n const [x1, y1, x2, y2] = rect;\n\n const width = x2 - x1;\n const height = y2 - y1;\n\n switch (this.rotation) {\n case 0:\n return [x1, pageHeight - y2, width, height];\n case 90:\n return [x1, pageHeight - y1, height, width];\n case 180:\n return [x2, pageHeight - y1, width, height];\n case 270:\n return [x2, pageHeight - y2, height, width];\n default:\n throw new Error(\"Invalid rotation\");\n }\n }\n\n /**\n * Executed once this editor has been rendered.\n */\n onceAdded() {}\n\n /**\n * Check if the editor contains something.\n * @returns {boolean}\n */\n isEmpty() {\n return false;\n }\n\n /**\n * Enable edit mode.\n */\n enableEditMode() {\n this.#isInEditMode = true;\n }\n\n /**\n * Disable edit mode.\n */\n disableEditMode() {\n this.#isInEditMode = false;\n }\n\n /**\n * Check if the editor is edited.\n * @returns {boolean}\n */\n isInEditMode() {\n return this.#isInEditMode;\n }\n\n /**\n * If it returns true, then this editor handles the keyboard\n * events itself.\n * @returns {boolean}\n */\n shouldGetKeyboardEvents() {\n return this.#isResizerEnabledForKeyboard;\n }\n\n /**\n * Check if this editor needs to be rebuilt or not.\n * @returns {boolean}\n */\n needsToBeRebuilt() {\n return this.div && !this.isAttachedToDOM;\n }\n\n #addFocusListeners() {\n if (this.#focusAC || !this.div) {\n return;\n }\n this.#focusAC = new AbortController();\n const signal = this._uiManager.combinedSignal(this.#focusAC);\n\n this.div.addEventListener(\"focusin\", this.focusin.bind(this), { signal });\n this.div.addEventListener(\"focusout\", this.focusout.bind(this), { signal });\n }\n\n /**\n * Rebuild the editor in case it has been removed on undo.\n *\n * To implement in subclasses.\n */\n rebuild() {\n this.#addFocusListeners();\n }\n\n /**\n * Rotate the editor.\n * @param {number} angle\n */\n rotate(_angle) {}\n\n /**\n * Serialize the editor when it has been deleted.\n * @returns {Object}\n */\n serializeDeleted() {\n return {\n id: this.annotationElementId,\n deleted: true,\n pageIndex: this.pageIndex,\n popupRef: this._initialData?.popupRef || \"\",\n };\n }\n\n /**\n * Serialize the editor.\n * The result of the serialization will be used to construct a\n * new annotation to add to the pdf document.\n *\n * To implement in subclasses.\n * @param {boolean} [isForCopying]\n * @param {Object | null} [context]\n * @returns {Object | null}\n */\n serialize(isForCopying = false, context = null) {\n unreachable(\"An editor must be serializable\");\n }\n\n /**\n * Deserialize the editor.\n * The result of the deserialization is a new editor.\n *\n * @param {Object} data\n * @param {AnnotationEditorLayer} parent\n * @param {AnnotationEditorUIManager} uiManager\n * @returns {Promise}\n */\n static async deserialize(data, parent, uiManager) {\n const editor = new this.prototype.constructor({\n parent,\n id: parent.getNextId(),\n uiManager,\n });\n editor.rotation = data.rotation;\n editor.#accessibilityData = data.accessibilityData;\n\n const [pageWidth, pageHeight] = editor.pageDimensions;\n const [x, y, width, height] = editor.getRectInCurrentCoords(\n data.rect,\n pageHeight\n );\n\n editor.x = x / pageWidth;\n editor.y = y / pageHeight;\n editor.width = width / pageWidth;\n editor.height = height / pageHeight;\n\n return editor;\n }\n\n /**\n * Check if an existing annotation associated with this editor has been\n * modified.\n * @returns {boolean}\n */\n get hasBeenModified() {\n return (\n !!this.annotationElementId && (this.deleted || this.serialize() !== null)\n );\n }\n\n /**\n * Remove this editor.\n * It's used on ctrl+backspace action.\n */\n remove() {\n this.#focusAC?.abort();\n this.#focusAC = null;\n\n if (!this.isEmpty()) {\n // The editor is removed but it can be back at some point thanks to\n // undo/redo so we must commit it before.\n this.commit();\n }\n if (this.parent) {\n this.parent.remove(this);\n } else {\n this._uiManager.removeEditor(this);\n }\n\n if (this.#moveInDOMTimeout) {\n clearTimeout(this.#moveInDOMTimeout);\n this.#moveInDOMTimeout = null;\n }\n this.#stopResizing();\n this.removeEditToolbar();\n if (this.#telemetryTimeouts) {\n for (const timeout of this.#telemetryTimeouts.values()) {\n clearTimeout(timeout);\n }\n this.#telemetryTimeouts = null;\n }\n this.parent = null;\n }\n\n /**\n * @returns {boolean} true if this editor can be resized.\n */\n get isResizable() {\n return false;\n }\n\n /**\n * Add the resizers to this editor.\n */\n makeResizable() {\n if (this.isResizable) {\n this.#createResizers();\n this.#resizersDiv.classList.remove(\"hidden\");\n bindEvents(this, this.div, [\"keydown\"]);\n }\n }\n\n get toolbarPosition() {\n return null;\n }\n\n /**\n * onkeydown callback.\n * @param {KeyboardEvent} event\n */\n keydown(event) {\n if (\n !this.isResizable ||\n event.target !== this.div ||\n event.key !== \"Enter\"\n ) {\n return;\n }\n this._uiManager.setSelected(this);\n this.#savedDimensions = {\n savedX: this.x,\n savedY: this.y,\n savedWidth: this.width,\n savedHeight: this.height,\n };\n const children = this.#resizersDiv.children;\n if (!this.#allResizerDivs) {\n this.#allResizerDivs = Array.from(children);\n const boundResizerKeydown = this.#resizerKeydown.bind(this);\n const boundResizerBlur = this.#resizerBlur.bind(this);\n const signal = this._uiManager._signal;\n for (const div of this.#allResizerDivs) {\n const name = div.getAttribute(\"data-resizer-name\");\n div.setAttribute(\"role\", \"spinbutton\");\n div.addEventListener(\"keydown\", boundResizerKeydown, { signal });\n div.addEventListener(\"blur\", boundResizerBlur, { signal });\n div.addEventListener(\"focus\", this.#resizerFocus.bind(this, name), {\n signal,\n });\n div.setAttribute(\"data-l10n-id\", AnnotationEditor._l10nResizer[name]);\n }\n }\n\n // We want to have the resizers in the visual order, so we move the first\n // (top-left) to the right place.\n const first = this.#allResizerDivs[0];\n let firstPosition = 0;\n for (const div of children) {\n if (div === first) {\n break;\n }\n firstPosition++;\n }\n const nextFirstPosition =\n (((360 - this.rotation + this.parentRotation) % 360) / 90) *\n (this.#allResizerDivs.length / 4);\n\n if (nextFirstPosition !== firstPosition) {\n // We need to reorder the resizers in the DOM in order to have the focus\n // on the top-left one.\n if (nextFirstPosition < firstPosition) {\n for (let i = 0; i < firstPosition - nextFirstPosition; i++) {\n this.#resizersDiv.append(this.#resizersDiv.firstChild);\n }\n } else if (nextFirstPosition > firstPosition) {\n for (let i = 0; i < nextFirstPosition - firstPosition; i++) {\n this.#resizersDiv.firstChild.before(this.#resizersDiv.lastChild);\n }\n }\n\n let i = 0;\n for (const child of children) {\n const div = this.#allResizerDivs[i++];\n const name = div.getAttribute(\"data-resizer-name\");\n child.setAttribute(\"data-l10n-id\", AnnotationEditor._l10nResizer[name]);\n }\n }\n\n this.#setResizerTabIndex(0);\n this.#isResizerEnabledForKeyboard = true;\n this.#resizersDiv.firstChild.focus({ focusVisible: true });\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n\n #resizerKeydown(event) {\n AnnotationEditor._resizerKeyboardManager.exec(this, event);\n }\n\n #resizerBlur(event) {\n if (\n this.#isResizerEnabledForKeyboard &&\n event.relatedTarget?.parentNode !== this.#resizersDiv\n ) {\n this.#stopResizing();\n }\n }\n\n #resizerFocus(name) {\n this.#focusedResizerName = this.#isResizerEnabledForKeyboard ? name : \"\";\n }\n\n #setResizerTabIndex(value) {\n if (!this.#allResizerDivs) {\n return;\n }\n for (const div of this.#allResizerDivs) {\n div.tabIndex = value;\n }\n }\n\n _resizeWithKeyboard(x, y) {\n if (!this.#isResizerEnabledForKeyboard) {\n return;\n }\n this.#resizerPointermove(this.#focusedResizerName, {\n movementX: x,\n movementY: y,\n });\n }\n\n #stopResizing() {\n this.#isResizerEnabledForKeyboard = false;\n this.#setResizerTabIndex(-1);\n if (this.#savedDimensions) {\n const { savedX, savedY, savedWidth, savedHeight } = this.#savedDimensions;\n this.#addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight);\n this.#savedDimensions = null;\n }\n }\n\n _stopResizingWithKeyboard() {\n this.#stopResizing();\n this.div.focus();\n }\n\n /**\n * Select this editor.\n */\n select() {\n this.makeResizable();\n this.div?.classList.add(\"selectedEditor\");\n if (!this._editToolbar) {\n this.addEditToolbar().then(() => {\n if (this.div?.classList.contains(\"selectedEditor\")) {\n // The editor can have been unselected while we were waiting for the\n // edit toolbar to be created, hence we want to be sure that this\n // editor is still selected.\n this._editToolbar?.show();\n }\n });\n return;\n }\n this._editToolbar?.show();\n this.#altText?.toggleAltTextBadge(false);\n }\n\n /**\n * Unselect this editor.\n */\n unselect() {\n this.#resizersDiv?.classList.add(\"hidden\");\n this.div?.classList.remove(\"selectedEditor\");\n if (this.div?.contains(document.activeElement)) {\n // Don't use this.div.blur() because we don't know where the focus will\n // go.\n this._uiManager.currentLayer.div.focus({\n preventScroll: true,\n });\n }\n this._editToolbar?.hide();\n this.#altText?.toggleAltTextBadge(true);\n }\n\n /**\n * Update some parameters which have been changed through the UI.\n * @param {number} type\n * @param {*} value\n */\n updateParams(type, value) {}\n\n /**\n * When the user disables the editing mode some editors can change some of\n * their properties.\n */\n disableEditing() {}\n\n /**\n * When the user enables the editing mode some editors can change some of\n * their properties.\n */\n enableEditing() {}\n\n /**\n * The editor is about to be edited.\n */\n enterInEditMode() {}\n\n /**\n * @returns {HTMLElement | null} the element requiring an alt text.\n */\n getImageForAltText() {\n return null;\n }\n\n /**\n * Get the div which really contains the displayed content.\n * @returns {HTMLDivElement | undefined}\n */\n get contentDiv() {\n return this.div;\n }\n\n /**\n * If true then the editor is currently edited.\n * @type {boolean}\n */\n get isEditing() {\n return this.#isEditing;\n }\n\n /**\n * When set to true, it means that this editor is currently edited.\n * @param {boolean} value\n */\n set isEditing(value) {\n this.#isEditing = value;\n if (!this.parent) {\n return;\n }\n if (value) {\n this.parent.setSelected(this);\n this.parent.setActiveEditor(this);\n } else {\n this.parent.setActiveEditor(null);\n }\n }\n\n /**\n * Set the aspect ratio to use when resizing.\n * @param {number} width\n * @param {number} height\n */\n setAspectRatio(width, height) {\n this.#keepAspectRatio = true;\n const aspectRatio = width / height;\n const { style } = this.div;\n style.aspectRatio = aspectRatio;\n style.height = \"auto\";\n }\n\n static get MIN_SIZE() {\n return 16;\n }\n\n static canCreateNewEmptyEditor() {\n return true;\n }\n\n /**\n * Get the data to report to the telemetry when the editor is added.\n * @returns {Object}\n */\n get telemetryInitialData() {\n return { action: \"added\" };\n }\n\n /**\n * The telemetry data to use when saving/printing.\n * @returns {Object|null}\n */\n get telemetryFinalData() {\n return null;\n }\n\n _reportTelemetry(data, mustWait = false) {\n if (mustWait) {\n this.#telemetryTimeouts ||= new Map();\n const { action } = data;\n let timeout = this.#telemetryTimeouts.get(action);\n if (timeout) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(() => {\n this._reportTelemetry(data);\n this.#telemetryTimeouts.delete(action);\n if (this.#telemetryTimeouts.size === 0) {\n this.#telemetryTimeouts = null;\n }\n }, AnnotationEditor._telemetryTimeout);\n this.#telemetryTimeouts.set(action, timeout);\n return;\n }\n data.type ||= this.editorType;\n this._uiManager._eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n data,\n },\n });\n }\n\n /**\n * Show or hide this editor.\n * @param {boolean|undefined} visible\n */\n show(visible = this._isVisible) {\n this.div.classList.toggle(\"hidden\", !visible);\n this._isVisible = visible;\n }\n\n enable() {\n if (this.div) {\n this.div.tabIndex = 0;\n }\n this.#disabled = false;\n }\n\n disable() {\n if (this.div) {\n this.div.tabIndex = -1;\n }\n this.#disabled = true;\n }\n\n /**\n * Render an annotation in the annotation layer.\n * @param {Object} annotation\n * @returns {HTMLElement|null}\n */\n renderAnnotationElement(annotation) {\n let content = annotation.container.querySelector(\".annotationContent\");\n if (!content) {\n content = document.createElement(\"div\");\n content.classList.add(\"annotationContent\", this.editorType);\n annotation.container.prepend(content);\n } else if (content.nodeName === \"CANVAS\") {\n const canvas = content;\n content = document.createElement(\"div\");\n content.classList.add(\"annotationContent\", this.editorType);\n canvas.before(content);\n }\n\n return content;\n }\n\n resetAnnotationElement(annotation) {\n const { firstChild } = annotation.container;\n if (\n firstChild?.nodeName === \"DIV\" &&\n firstChild.classList.contains(\"annotationContent\")\n ) {\n firstChild.remove();\n }\n }\n}\n\n// This class is used to fake an editor which has been deleted.\nclass FakeEditor extends AnnotationEditor {\n constructor(params) {\n super(params);\n this.annotationElementId = params.annotationElementId;\n this.deleted = true;\n }\n\n serialize() {\n return this.serializeDeleted();\n }\n}\n\nexport { AnnotationEditor };\n","/* Copyright 2014 Opera Software ASA\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *\n * Based on https://code.google.com/p/smhasher/wiki/MurmurHash3.\n * Hashes roughly 100 KB per millisecond on i7 3.4 GHz.\n */\n\nconst SEED = 0xc3d2e1f0;\n// Workaround for missing math precision in JS.\nconst MASK_HIGH = 0xffff0000;\nconst MASK_LOW = 0xffff;\n\nclass MurmurHash3_64 {\n constructor(seed) {\n this.h1 = seed ? seed & 0xffffffff : SEED;\n this.h2 = seed ? seed & 0xffffffff : SEED;\n }\n\n update(input) {\n let data, length;\n if (typeof input === \"string\") {\n data = new Uint8Array(input.length * 2);\n length = 0;\n for (let i = 0, ii = input.length; i < ii; i++) {\n const code = input.charCodeAt(i);\n if (code <= 0xff) {\n data[length++] = code;\n } else {\n data[length++] = code >>> 8;\n data[length++] = code & 0xff;\n }\n }\n } else if (ArrayBuffer.isView(input)) {\n data = input.slice();\n length = data.byteLength;\n } else {\n throw new Error(\"Invalid data format, must be a string or TypedArray.\");\n }\n\n const blockCounts = length >> 2;\n const tailLength = length - blockCounts * 4;\n // We don't care about endianness here.\n const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts);\n let k1 = 0,\n k2 = 0;\n let h1 = this.h1,\n h2 = this.h2;\n const C1 = 0xcc9e2d51,\n C2 = 0x1b873593;\n const C1_LOW = C1 & MASK_LOW,\n C2_LOW = C2 & MASK_LOW;\n\n for (let i = 0; i < blockCounts; i++) {\n if (i & 1) {\n k1 = dataUint32[i];\n k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW);\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW);\n h1 ^= k1;\n h1 = (h1 << 13) | (h1 >>> 19);\n h1 = h1 * 5 + 0xe6546b64;\n } else {\n k2 = dataUint32[i];\n k2 = ((k2 * C1) & MASK_HIGH) | ((k2 * C1_LOW) & MASK_LOW);\n k2 = (k2 << 15) | (k2 >>> 17);\n k2 = ((k2 * C2) & MASK_HIGH) | ((k2 * C2_LOW) & MASK_LOW);\n h2 ^= k2;\n h2 = (h2 << 13) | (h2 >>> 19);\n h2 = h2 * 5 + 0xe6546b64;\n }\n }\n\n k1 = 0;\n\n switch (tailLength) {\n case 3:\n k1 ^= data[blockCounts * 4 + 2] << 16;\n /* falls through */\n case 2:\n k1 ^= data[blockCounts * 4 + 1] << 8;\n /* falls through */\n case 1:\n k1 ^= data[blockCounts * 4];\n /* falls through */\n\n k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW);\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW);\n if (blockCounts & 1) {\n h1 ^= k1;\n } else {\n h2 ^= k1;\n }\n }\n\n this.h1 = h1;\n this.h2 = h2;\n }\n\n hexdigest() {\n let h1 = this.h1,\n h2 = this.h2;\n\n h1 ^= h2 >>> 1;\n h1 = ((h1 * 0xed558ccd) & MASK_HIGH) | ((h1 * 0x8ccd) & MASK_LOW);\n h2 =\n ((h2 * 0xff51afd7) & MASK_HIGH) |\n (((((h2 << 16) | (h1 >>> 16)) * 0xafd7ed55) & MASK_HIGH) >>> 16);\n h1 ^= h2 >>> 1;\n h1 = ((h1 * 0x1a85ec53) & MASK_HIGH) | ((h1 * 0xec53) & MASK_LOW);\n h2 =\n ((h2 * 0xc4ceb9fe) & MASK_HIGH) |\n (((((h2 << 16) | (h1 >>> 16)) * 0xb9fe1a85) & MASK_HIGH) >>> 16);\n h1 ^= h2 >>> 1;\n\n return (\n (h1 >>> 0).toString(16).padStart(8, \"0\") +\n (h2 >>> 0).toString(16).padStart(8, \"0\")\n );\n }\n}\n\nexport { MurmurHash3_64 };\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { objectFromMap, shadow, unreachable } from \"../shared/util.js\";\nimport { AnnotationEditor } from \"./editor/editor.js\";\nimport { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\n\nconst SerializableEmpty = Object.freeze({\n map: null,\n hash: \"\",\n transfer: undefined,\n});\n\n/**\n * Key/value storage for annotation data in forms.\n */\nclass AnnotationStorage {\n #modified = false;\n\n #modifiedIds = null;\n\n #storage = new Map();\n\n constructor() {\n // Callbacks to signal when the modification state is set or reset.\n // This is used by the viewer to only bind on `beforeunload` if forms\n // are actually edited to prevent doing so unconditionally since that\n // can have undesirable effects.\n this.onSetModified = null;\n this.onResetModified = null;\n this.onAnnotationEditor = null;\n }\n\n /**\n * Get the value for a given key if it exists, or return the default value.\n * @param {string} key\n * @param {Object} defaultValue\n * @returns {Object}\n */\n getValue(key, defaultValue) {\n const value = this.#storage.get(key);\n if (value === undefined) {\n return defaultValue;\n }\n\n return Object.assign(defaultValue, value);\n }\n\n /**\n * Get the value for a given key.\n * @param {string} key\n * @returns {Object}\n */\n getRawValue(key) {\n return this.#storage.get(key);\n }\n\n /**\n * Remove a value from the storage.\n * @param {string} key\n */\n remove(key) {\n this.#storage.delete(key);\n\n if (this.#storage.size === 0) {\n this.resetModified();\n }\n\n if (typeof this.onAnnotationEditor === \"function\") {\n for (const value of this.#storage.values()) {\n if (value instanceof AnnotationEditor) {\n return;\n }\n }\n this.onAnnotationEditor(null);\n }\n }\n\n /**\n * Set the value for a given key\n * @param {string} key\n * @param {Object} value\n */\n setValue(key, value) {\n const obj = this.#storage.get(key);\n let modified = false;\n if (obj !== undefined) {\n for (const [entry, val] of Object.entries(value)) {\n if (obj[entry] !== val) {\n modified = true;\n obj[entry] = val;\n }\n }\n } else {\n modified = true;\n this.#storage.set(key, value);\n }\n if (modified) {\n this.#setModified();\n }\n\n if (\n value instanceof AnnotationEditor &&\n typeof this.onAnnotationEditor === \"function\"\n ) {\n this.onAnnotationEditor(value.constructor._type);\n }\n }\n\n /**\n * Check if the storage contains the given key.\n * @param {string} key\n * @returns {boolean}\n */\n has(key) {\n return this.#storage.has(key);\n }\n\n /**\n * @returns {Object | null}\n */\n getAll() {\n return this.#storage.size > 0 ? objectFromMap(this.#storage) : null;\n }\n\n /**\n * @param {Object} obj\n */\n setAll(obj) {\n for (const [key, val] of Object.entries(obj)) {\n this.setValue(key, val);\n }\n }\n\n get size() {\n return this.#storage.size;\n }\n\n #setModified() {\n if (!this.#modified) {\n this.#modified = true;\n if (typeof this.onSetModified === \"function\") {\n this.onSetModified();\n }\n }\n }\n\n resetModified() {\n if (this.#modified) {\n this.#modified = false;\n if (typeof this.onResetModified === \"function\") {\n this.onResetModified();\n }\n }\n }\n\n /**\n * @returns {PrintAnnotationStorage}\n */\n get print() {\n return new PrintAnnotationStorage(this);\n }\n\n /**\n * PLEASE NOTE: Only intended for usage within the API itself.\n * @ignore\n */\n get serializable() {\n if (this.#storage.size === 0) {\n return SerializableEmpty;\n }\n const map = new Map(),\n hash = new MurmurHash3_64(),\n transfer = [];\n const context = Object.create(null);\n let hasBitmap = false;\n\n for (const [key, val] of this.#storage) {\n const serialized =\n val instanceof AnnotationEditor\n ? val.serialize(/* isForCopying = */ false, context)\n : val;\n if (serialized) {\n map.set(key, serialized);\n\n hash.update(`${key}:${JSON.stringify(serialized)}`);\n hasBitmap ||= !!serialized.bitmap;\n }\n }\n\n if (hasBitmap) {\n // We must transfer the bitmap data separately, since it can be changed\n // during serialization with SVG images.\n for (const value of map.values()) {\n if (value.bitmap) {\n transfer.push(value.bitmap);\n }\n }\n }\n\n return map.size > 0\n ? { map, hash: hash.hexdigest(), transfer }\n : SerializableEmpty;\n }\n\n get editorStats() {\n let stats = null;\n const typeToEditor = new Map();\n for (const value of this.#storage.values()) {\n if (!(value instanceof AnnotationEditor)) {\n continue;\n }\n const editorStats = value.telemetryFinalData;\n if (!editorStats) {\n continue;\n }\n const { type } = editorStats;\n if (!typeToEditor.has(type)) {\n typeToEditor.set(type, Object.getPrototypeOf(value).constructor);\n }\n stats ||= Object.create(null);\n const map = (stats[type] ||= new Map());\n for (const [key, val] of Object.entries(editorStats)) {\n if (key === \"type\") {\n continue;\n }\n let counters = map.get(key);\n if (!counters) {\n counters = new Map();\n map.set(key, counters);\n }\n const count = counters.get(val) ?? 0;\n counters.set(val, count + 1);\n }\n }\n for (const [type, editor] of typeToEditor) {\n stats[type] = editor.computeTelemetryFinalData(stats[type]);\n }\n return stats;\n }\n\n resetModifiedIds() {\n this.#modifiedIds = null;\n }\n\n /**\n * @returns {{ids: Set, hash: string}}\n */\n get modifiedIds() {\n if (this.#modifiedIds) {\n return this.#modifiedIds;\n }\n const ids = [];\n for (const value of this.#storage.values()) {\n if (\n !(value instanceof AnnotationEditor) ||\n !value.annotationElementId ||\n !value.serialize()\n ) {\n continue;\n }\n ids.push(value.annotationElementId);\n }\n return (this.#modifiedIds = {\n ids: new Set(ids),\n hash: ids.join(\",\"),\n });\n }\n}\n\n/**\n * A special `AnnotationStorage` for use during printing, where the serializable\n * data is *frozen* upon initialization, to prevent scripting from modifying its\n * contents. (Necessary since printing is triggered synchronously in browsers.)\n */\nclass PrintAnnotationStorage extends AnnotationStorage {\n #serializable;\n\n constructor(parent) {\n super();\n const { map, hash, transfer } = parent.serializable;\n // Create a *copy* of the data, since Objects are passed by reference in JS.\n const clone = structuredClone(map, transfer ? { transfer } : null);\n\n this.#serializable = { map: clone, hash, transfer };\n }\n\n /**\n * @returns {PrintAnnotationStorage}\n */\n // eslint-disable-next-line getter-return\n get print() {\n unreachable(\"Should not call PrintAnnotationStorage.print\");\n }\n\n /**\n * PLEASE NOTE: Only intended for usage within the API itself.\n * @ignore\n */\n get serializable() {\n return this.#serializable;\n }\n\n get modifiedIds() {\n return shadow(this, \"modifiedIds\", {\n ids: new Set(),\n hash: \"\",\n });\n }\n}\n\nexport { AnnotationStorage, PrintAnnotationStorage, SerializableEmpty };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n assert,\n FontRenderOps,\n isNodeJS,\n shadow,\n string32,\n toBase64Util,\n unreachable,\n warn,\n} from \"../shared/util.js\";\n\nclass FontLoader {\n #systemFonts = new Set();\n\n constructor({\n ownerDocument = globalThis.document,\n styleElement = null, // For testing only.\n }) {\n this._document = ownerDocument;\n\n this.nativeFontFaces = new Set();\n this.styleElement =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")\n ? styleElement\n : null;\n\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n this.loadingRequests = [];\n this.loadTestFontId = 0;\n }\n }\n\n addNativeFontFace(nativeFontFace) {\n this.nativeFontFaces.add(nativeFontFace);\n this._document.fonts.add(nativeFontFace);\n }\n\n removeNativeFontFace(nativeFontFace) {\n this.nativeFontFaces.delete(nativeFontFace);\n this._document.fonts.delete(nativeFontFace);\n }\n\n insertRule(rule) {\n if (!this.styleElement) {\n this.styleElement = this._document.createElement(\"style\");\n this._document.documentElement\n .getElementsByTagName(\"head\")[0]\n .append(this.styleElement);\n }\n const styleSheet = this.styleElement.sheet;\n styleSheet.insertRule(rule, styleSheet.cssRules.length);\n }\n\n clear() {\n for (const nativeFontFace of this.nativeFontFaces) {\n this._document.fonts.delete(nativeFontFace);\n }\n this.nativeFontFaces.clear();\n this.#systemFonts.clear();\n\n if (this.styleElement) {\n // Note: ChildNode.remove doesn't throw if the parentNode is undefined.\n this.styleElement.remove();\n this.styleElement = null;\n }\n }\n\n async loadSystemFont({ systemFontInfo: info, _inspectFont }) {\n if (!info || this.#systemFonts.has(info.loadedName)) {\n return;\n }\n assert(\n !this.disableFontFace,\n \"loadSystemFont shouldn't be called when `disableFontFace` is set.\"\n );\n\n if (this.isFontLoadingAPISupported) {\n const { loadedName, src, style } = info;\n const fontFace = new FontFace(loadedName, src, style);\n this.addNativeFontFace(fontFace);\n try {\n await fontFace.load();\n this.#systemFonts.add(loadedName);\n _inspectFont?.(info);\n } catch {\n warn(\n `Cannot load system font: ${info.baseFontName}, installing it could help to improve PDF rendering.`\n );\n\n this.removeNativeFontFace(fontFace);\n }\n return;\n }\n\n unreachable(\n \"Not implemented: loadSystemFont without the Font Loading API.\"\n );\n }\n\n async bind(font) {\n // Add the font to the DOM only once; skip if the font is already loaded.\n if (font.attached || (font.missingFile && !font.systemFontInfo)) {\n return;\n }\n font.attached = true;\n\n if (font.systemFontInfo) {\n await this.loadSystemFont(font);\n return;\n }\n\n if (this.isFontLoadingAPISupported) {\n const nativeFontFace = font.createNativeFontFace();\n if (nativeFontFace) {\n this.addNativeFontFace(nativeFontFace);\n try {\n await nativeFontFace.loaded;\n } catch (ex) {\n warn(`Failed to load font '${nativeFontFace.family}': '${ex}'.`);\n\n // When font loading failed, fall back to the built-in font renderer.\n font.disableFontFace = true;\n throw ex;\n }\n }\n return; // The font was, asynchronously, loaded.\n }\n\n // !this.isFontLoadingAPISupported\n const rule = font.createFontFaceRule();\n if (rule) {\n this.insertRule(rule);\n\n if (this.isSyncFontLoadingSupported) {\n return; // The font was, synchronously, loaded.\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: async font loading\");\n }\n await new Promise(resolve => {\n const request = this._queueLoadingCallback(resolve);\n this._prepareFontLoadEvent(font, request);\n });\n // The font was, asynchronously, loaded.\n }\n }\n\n get isFontLoadingAPISupported() {\n const hasFonts = !!this._document?.fonts;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n return shadow(\n this,\n \"isFontLoadingAPISupported\",\n hasFonts && !this.styleElement\n );\n }\n return shadow(this, \"isFontLoadingAPISupported\", hasFonts);\n }\n\n get isSyncFontLoadingSupported() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return shadow(this, \"isSyncFontLoadingSupported\", true);\n }\n\n let supported = false;\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"CHROME\")) {\n if (isNodeJS) {\n // Node.js - we can pretend that sync font loading is supported.\n supported = true;\n } else if (\n typeof navigator !== \"undefined\" &&\n typeof navigator?.userAgent === \"string\" &&\n // User agent string sniffing is bad, but there is no reliable way to\n // tell if the font is fully loaded and ready to be used with canvas.\n /Mozilla\\/5.0.*?rv:\\d+.*? Gecko/.test(navigator.userAgent)\n ) {\n // Firefox, from version 14, supports synchronous font loading.\n supported = true;\n }\n }\n return shadow(this, \"isSyncFontLoadingSupported\", supported);\n }\n\n _queueLoadingCallback(callback) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _queueLoadingCallback\");\n }\n\n function completeRequest() {\n assert(!request.done, \"completeRequest() cannot be called twice.\");\n request.done = true;\n\n // Sending all completed requests in order of how they were queued.\n while (loadingRequests.length > 0 && loadingRequests[0].done) {\n const otherRequest = loadingRequests.shift();\n setTimeout(otherRequest.callback, 0);\n }\n }\n\n const { loadingRequests } = this;\n const request = {\n done: false,\n complete: completeRequest,\n callback,\n };\n loadingRequests.push(request);\n return request;\n }\n\n get _loadTestFont() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _loadTestFont\");\n }\n\n // This is a CFF font with 1 glyph for '.' that fills its entire width\n // and height.\n const testFont = atob(\n \"T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA\" +\n \"FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA\" +\n \"ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA\" +\n \"AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1\" +\n \"AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD\" +\n \"6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAA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YWFhYWFhYAAABAQAADwACAQEEE/t3\" +\n \"Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj\" +\n \"FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==\"\n );\n return shadow(this, \"_loadTestFont\", testFont);\n }\n\n _prepareFontLoadEvent(font, request) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _prepareFontLoadEvent\");\n }\n\n /** Hack begin */\n // There's currently no event when a font has finished downloading so the\n // following code is a dirty hack to 'guess' when a font is ready.\n // It's assumed fonts are loaded in order, so add a known test font after\n // the desired fonts and then test for the loading of that test font.\n\n function int32(data, offset) {\n return (\n (data.charCodeAt(offset) << 24) |\n (data.charCodeAt(offset + 1) << 16) |\n (data.charCodeAt(offset + 2) << 8) |\n (data.charCodeAt(offset + 3) & 0xff)\n );\n }\n function spliceString(s, offset, remove, insert) {\n const chunk1 = s.substring(0, offset);\n const chunk2 = s.substring(offset + remove);\n return chunk1 + insert + chunk2;\n }\n let i, ii;\n\n // The temporary canvas is used to determine if fonts are loaded.\n const canvas = this._document.createElement(\"canvas\");\n canvas.width = 1;\n canvas.height = 1;\n const ctx = canvas.getContext(\"2d\");\n\n let called = 0;\n function isFontReady(name, callback) {\n // With setTimeout clamping this gives the font ~100ms to load.\n if (++called > 30) {\n warn(\"Load test font never loaded.\");\n callback();\n return;\n }\n ctx.font = \"30px \" + name;\n ctx.fillText(\".\", 0, 20);\n const imageData = ctx.getImageData(0, 0, 1, 1);\n if (imageData.data[3] > 0) {\n callback();\n return;\n }\n setTimeout(isFontReady.bind(null, name, callback));\n }\n\n const loadTestFontId = `lt${Date.now()}${this.loadTestFontId++}`;\n // Chromium seems to cache fonts based on a hash of the actual font data,\n // so the font must be modified for each load test else it will appear to\n // be loaded already.\n // TODO: This could maybe be made faster by avoiding the btoa of the full\n // font by splitting it in chunks before hand and padding the font id.\n let data = this._loadTestFont;\n const COMMENT_OFFSET = 976; // has to be on 4 byte boundary (for checksum)\n data = spliceString(\n data,\n COMMENT_OFFSET,\n loadTestFontId.length,\n loadTestFontId\n );\n // CFF checksum is important for IE, adjusting it\n const CFF_CHECKSUM_OFFSET = 16;\n const XXXX_VALUE = 0x58585858; // the \"comment\" filled with 'X'\n let checksum = int32(data, CFF_CHECKSUM_OFFSET);\n for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) {\n checksum = (checksum - XXXX_VALUE + int32(loadTestFontId, i)) | 0;\n }\n if (i < loadTestFontId.length) {\n // align to 4 bytes boundary\n checksum = (checksum - XXXX_VALUE + int32(loadTestFontId + \"XXX\", i)) | 0;\n }\n data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, string32(checksum));\n\n const url = `url(data:font/opentype;base64,${btoa(data)});`;\n const rule = `@font-face {font-family:\"${loadTestFontId}\";src:${url}}`;\n this.insertRule(rule);\n\n const div = this._document.createElement(\"div\");\n div.style.visibility = \"hidden\";\n div.style.width = div.style.height = \"10px\";\n div.style.position = \"absolute\";\n div.style.top = div.style.left = \"0px\";\n\n for (const name of [font.loadedName, loadTestFontId]) {\n const span = this._document.createElement(\"span\");\n span.textContent = \"Hi\";\n span.style.fontFamily = name;\n div.append(span);\n }\n this._document.body.append(div);\n\n isFontReady(loadTestFontId, () => {\n div.remove();\n request.complete();\n });\n /** Hack end */\n }\n}\n\nclass FontFaceObject {\n constructor(translatedData, { disableFontFace = false, inspectFont = null }) {\n this.compiledGlyphs = Object.create(null);\n // importing translated data\n for (const i in translatedData) {\n this[i] = translatedData[i];\n }\n this.disableFontFace = disableFontFace === true;\n this._inspectFont = inspectFont;\n }\n\n createNativeFontFace() {\n if (!this.data || this.disableFontFace) {\n return null;\n }\n let nativeFontFace;\n if (!this.cssFontInfo) {\n nativeFontFace = new FontFace(this.loadedName, this.data, {});\n } else {\n const css = {\n weight: this.cssFontInfo.fontWeight,\n };\n if (this.cssFontInfo.italicAngle) {\n css.style = `oblique ${this.cssFontInfo.italicAngle}deg`;\n }\n nativeFontFace = new FontFace(\n this.cssFontInfo.fontFamily,\n this.data,\n css\n );\n }\n\n this._inspectFont?.(this);\n return nativeFontFace;\n }\n\n createFontFaceRule() {\n if (!this.data || this.disableFontFace) {\n return null;\n }\n // Add the @font-face rule to the document.\n const url = `url(data:${this.mimetype};base64,${toBase64Util(this.data)});`;\n let rule;\n if (!this.cssFontInfo) {\n rule = `@font-face {font-family:\"${this.loadedName}\";src:${url}}`;\n } else {\n let css = `font-weight: ${this.cssFontInfo.fontWeight};`;\n if (this.cssFontInfo.italicAngle) {\n css += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`;\n }\n rule = `@font-face {font-family:\"${this.cssFontInfo.fontFamily}\";${css}src:${url}}`;\n }\n\n this._inspectFont?.(this, url);\n return rule;\n }\n\n getPathGenerator(objs, character) {\n if (this.compiledGlyphs[character] !== undefined) {\n return this.compiledGlyphs[character];\n }\n\n let cmds;\n try {\n cmds = objs.get(this.loadedName + \"_path_\" + character);\n } catch (ex) {\n warn(`getPathGenerator - ignoring character: \"${ex}\".`);\n }\n\n if (!Array.isArray(cmds) || cmds.length === 0) {\n return (this.compiledGlyphs[character] = function (c, size) {\n // No-op function, to allow rendering to continue.\n });\n }\n\n const commands = [];\n for (let i = 0, ii = cmds.length; i < ii; ) {\n switch (cmds[i++]) {\n case FontRenderOps.BEZIER_CURVE_TO:\n {\n const [a, b, c, d, e, f] = cmds.slice(i, i + 6);\n commands.push(ctx => ctx.bezierCurveTo(a, b, c, d, e, f));\n i += 6;\n }\n break;\n case FontRenderOps.MOVE_TO:\n {\n const [a, b] = cmds.slice(i, i + 2);\n commands.push(ctx => ctx.moveTo(a, b));\n i += 2;\n }\n break;\n case FontRenderOps.LINE_TO:\n {\n const [a, b] = cmds.slice(i, i + 2);\n commands.push(ctx => ctx.lineTo(a, b));\n i += 2;\n }\n break;\n case FontRenderOps.QUADRATIC_CURVE_TO:\n {\n const [a, b, c, d] = cmds.slice(i, i + 4);\n commands.push(ctx => ctx.quadraticCurveTo(a, b, c, d));\n i += 4;\n }\n break;\n case FontRenderOps.RESTORE:\n commands.push(ctx => ctx.restore());\n break;\n case FontRenderOps.SAVE:\n commands.push(ctx => ctx.save());\n break;\n case FontRenderOps.SCALE:\n // The scale command must be at the third position, after save and\n // transform (for the font matrix) commands (see also\n // font_renderer.js).\n // The goal is to just scale the canvas and then run the commands loop\n // without the need to pass the size parameter to each command.\n assert(\n commands.length === 2,\n \"Scale command is only valid at the third position.\"\n );\n break;\n case FontRenderOps.TRANSFORM:\n {\n const [a, b, c, d, e, f] = cmds.slice(i, i + 6);\n commands.push(ctx => ctx.transform(a, b, c, d, e, f));\n i += 6;\n }\n break;\n case FontRenderOps.TRANSLATE:\n {\n const [a, b] = cmds.slice(i, i + 2);\n commands.push(ctx => ctx.translate(a, b));\n i += 2;\n }\n break;\n }\n }\n\n return (this.compiledGlyphs[character] = function glyphDrawer(ctx, size) {\n commands[0](ctx);\n commands[1](ctx);\n ctx.scale(size, -size);\n for (let i = 2, ii = commands.length; i < ii; i++) {\n commands[i](ctx);\n }\n });\n }\n}\n\nexport { FontFaceObject, FontLoader };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { unreachable } from \"../shared/util.js\";\n\nclass BaseCanvasFactory {\n #enableHWA = false;\n\n constructor({ enableHWA = false }) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseCanvasFactory\n ) {\n unreachable(\"Cannot initialize BaseCanvasFactory.\");\n }\n this.#enableHWA = enableHWA;\n }\n\n create(width, height) {\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid canvas size\");\n }\n const canvas = this._createCanvas(width, height);\n return {\n canvas,\n context: canvas.getContext(\"2d\", {\n willReadFrequently: !this.#enableHWA,\n }),\n };\n }\n\n reset(canvasAndContext, width, height) {\n if (!canvasAndContext.canvas) {\n throw new Error(\"Canvas is not specified\");\n }\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid canvas size\");\n }\n canvasAndContext.canvas.width = width;\n canvasAndContext.canvas.height = height;\n }\n\n destroy(canvasAndContext) {\n if (!canvasAndContext.canvas) {\n throw new Error(\"Canvas is not specified\");\n }\n // Zeroing the width and height cause Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n canvasAndContext.canvas.width = 0;\n canvasAndContext.canvas.height = 0;\n canvasAndContext.canvas = null;\n canvasAndContext.context = null;\n }\n\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n unreachable(\"Abstract method `_createCanvas` called.\");\n }\n}\n\nclass DOMCanvasFactory extends BaseCanvasFactory {\n constructor({ ownerDocument = globalThis.document, enableHWA = false }) {\n super({ enableHWA });\n this._document = ownerDocument;\n }\n\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n const canvas = this._document.createElement(\"canvas\");\n canvas.width = width;\n canvas.height = height;\n return canvas;\n }\n}\n\nexport { BaseCanvasFactory, DOMCanvasFactory };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { stringToBytes, unreachable } from \"../shared/util.js\";\nimport { fetchData } from \"./display_utils.js\";\n\nclass BaseCMapReaderFactory {\n constructor({ baseUrl = null, isCompressed = true }) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseCMapReaderFactory\n ) {\n unreachable(\"Cannot initialize BaseCMapReaderFactory.\");\n }\n this.baseUrl = baseUrl;\n this.isCompressed = isCompressed;\n }\n\n async fetch({ name }) {\n if (!this.baseUrl) {\n throw new Error(\n \"Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.\"\n );\n }\n if (!name) {\n throw new Error(\"CMap name must be specified.\");\n }\n const url = this.baseUrl + name + (this.isCompressed ? \".bcmap\" : \"\");\n\n return this._fetch(url)\n .then(cMapData => ({ cMapData, isCompressed: this.isCompressed }))\n .catch(reason => {\n throw new Error(\n `Unable to load ${this.isCompressed ? \"binary \" : \"\"}CMap at: ${url}`\n );\n });\n }\n\n /**\n * @ignore\n * @returns {Promise}\n */\n async _fetch(url) {\n unreachable(\"Abstract method `_fetch` called.\");\n }\n}\n\nclass DOMCMapReaderFactory extends BaseCMapReaderFactory {\n /**\n * @ignore\n */\n async _fetch(url) {\n const data = await fetchData(\n url,\n /* type = */ this.isCompressed ? \"arraybuffer\" : \"text\"\n );\n return data instanceof ArrayBuffer\n ? new Uint8Array(data)\n : stringToBytes(data);\n }\n}\n\nexport { BaseCMapReaderFactory, DOMCMapReaderFactory };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getRGB, isDataScheme, SVG_NS } from \"./display_utils.js\";\nimport { unreachable, Util, warn } from \"../shared/util.js\";\n\nclass BaseFilterFactory {\n constructor() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseFilterFactory\n ) {\n unreachable(\"Cannot initialize BaseFilterFactory.\");\n }\n }\n\n addFilter(maps) {\n return \"none\";\n }\n\n addHCMFilter(fgColor, bgColor) {\n return \"none\";\n }\n\n addAlphaFilter(map) {\n return \"none\";\n }\n\n addLuminosityFilter(map) {\n return \"none\";\n }\n\n addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) {\n return \"none\";\n }\n\n destroy(keepHCM = false) {}\n}\n\n/**\n * FilterFactory aims to create some SVG filters we can use when drawing an\n * image (or whatever) on a canvas.\n * Filters aren't applied with ctx.putImageData because it just overwrites the\n * underlying pixels.\n * With these filters, it's possible for example to apply some transfer maps on\n * an image without the need to apply them on the pixel arrays: the renderer\n * does the magic for us.\n */\nclass DOMFilterFactory extends BaseFilterFactory {\n #baseUrl;\n\n #_cache;\n\n #_defs;\n\n #docId;\n\n #document;\n\n #_hcmCache;\n\n #id = 0;\n\n constructor({ docId, ownerDocument = globalThis.document }) {\n super();\n this.#docId = docId;\n this.#document = ownerDocument;\n }\n\n get #cache() {\n return (this.#_cache ||= new Map());\n }\n\n get #hcmCache() {\n return (this.#_hcmCache ||= new Map());\n }\n\n get #defs() {\n if (!this.#_defs) {\n const div = this.#document.createElement(\"div\");\n const { style } = div;\n style.visibility = \"hidden\";\n style.contain = \"strict\";\n style.width = style.height = 0;\n style.position = \"absolute\";\n style.top = style.left = 0;\n style.zIndex = -1;\n\n const svg = this.#document.createElementNS(SVG_NS, \"svg\");\n svg.setAttribute(\"width\", 0);\n svg.setAttribute(\"height\", 0);\n this.#_defs = this.#document.createElementNS(SVG_NS, \"defs\");\n div.append(svg);\n svg.append(this.#_defs);\n this.#document.body.append(div);\n }\n return this.#_defs;\n }\n\n #createTables(maps) {\n if (maps.length === 1) {\n const mapR = maps[0];\n const buffer = new Array(256);\n for (let i = 0; i < 256; i++) {\n buffer[i] = mapR[i] / 255;\n }\n\n const table = buffer.join(\",\");\n return [table, table, table];\n }\n\n const [mapR, mapG, mapB] = maps;\n const bufferR = new Array(256);\n const bufferG = new Array(256);\n const bufferB = new Array(256);\n for (let i = 0; i < 256; i++) {\n bufferR[i] = mapR[i] / 255;\n bufferG[i] = mapG[i] / 255;\n bufferB[i] = mapB[i] / 255;\n }\n return [bufferR.join(\",\"), bufferG.join(\",\"), bufferB.join(\",\")];\n }\n\n #createUrl(id) {\n if (this.#baseUrl === undefined) {\n // Unless a ``-element is present a relative URL should work.\n this.#baseUrl = \"\";\n\n const url = this.#document.URL;\n if (url !== this.#document.baseURI) {\n if (isDataScheme(url)) {\n warn('#createUrl: ignore \"data:\"-URL for performance reasons.');\n } else {\n this.#baseUrl = url.split(\"#\", 1)[0];\n }\n }\n }\n return `url(${this.#baseUrl}#${id})`;\n }\n\n addFilter(maps) {\n if (!maps) {\n return \"none\";\n }\n\n // When a page is zoomed the page is re-drawn but the maps are likely\n // the same.\n let value = this.#cache.get(maps);\n if (value) {\n return value;\n }\n\n const [tableR, tableG, tableB] = this.#createTables(maps);\n const key = maps.length === 1 ? tableR : `${tableR}${tableG}${tableB}`;\n\n value = this.#cache.get(key);\n if (value) {\n this.#cache.set(maps, value);\n return value;\n }\n\n // We create a SVG filter: feComponentTransferElement\n // https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement\n\n const id = `g_${this.#docId}_transfer_map_${this.#id++}`;\n const url = this.#createUrl(id);\n this.#cache.set(maps, url);\n this.#cache.set(key, url);\n\n const filter = this.#createFilter(id);\n this.#addTransferMapConversion(tableR, tableG, tableB, filter);\n\n return url;\n }\n\n addHCMFilter(fgColor, bgColor) {\n const key = `${fgColor}-${bgColor}`;\n const filterName = \"base\";\n let info = this.#hcmCache.get(filterName);\n if (info?.key === key) {\n return info.url;\n }\n\n if (info) {\n info.filter?.remove();\n info.key = key;\n info.url = \"none\";\n info.filter = null;\n } else {\n info = {\n key,\n url: \"none\",\n filter: null,\n };\n this.#hcmCache.set(filterName, info);\n }\n\n if (!fgColor || !bgColor) {\n return info.url;\n }\n\n const fgRGB = this.#getRGB(fgColor);\n fgColor = Util.makeHexColor(...fgRGB);\n const bgRGB = this.#getRGB(bgColor);\n bgColor = Util.makeHexColor(...bgRGB);\n this.#defs.style.color = \"\";\n\n if (\n (fgColor === \"#000000\" && bgColor === \"#ffffff\") ||\n fgColor === bgColor\n ) {\n return info.url;\n }\n\n // https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_Colors_and_Luminance\n //\n // Relative luminance:\n // https://www.w3.org/TR/WCAG20/#relativeluminancedef\n //\n // We compute the rounded luminance of the default background color.\n // Then for every color in the pdf, if its rounded luminance is the\n // same as the background one then it's replaced by the new\n // background color else by the foreground one.\n const map = new Array(256);\n for (let i = 0; i <= 255; i++) {\n const x = i / 255;\n map[i] = x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4;\n }\n const table = map.join(\",\");\n\n const id = `g_${this.#docId}_hcm_filter`;\n const filter = (info.filter = this.#createFilter(id));\n this.#addTransferMapConversion(table, table, table, filter);\n this.#addGrayConversion(filter);\n\n const getSteps = (c, n) => {\n const start = fgRGB[c] / 255;\n const end = bgRGB[c] / 255;\n const arr = new Array(n + 1);\n for (let i = 0; i <= n; i++) {\n arr[i] = start + (i / n) * (end - start);\n }\n return arr.join(\",\");\n };\n this.#addTransferMapConversion(\n getSteps(0, 5),\n getSteps(1, 5),\n getSteps(2, 5),\n filter\n );\n\n info.url = this.#createUrl(id);\n return info.url;\n }\n\n addAlphaFilter(map) {\n // When a page is zoomed the page is re-drawn but the maps are likely\n // the same.\n let value = this.#cache.get(map);\n if (value) {\n return value;\n }\n\n const [tableA] = this.#createTables([map]);\n const key = `alpha_${tableA}`;\n\n value = this.#cache.get(key);\n if (value) {\n this.#cache.set(map, value);\n return value;\n }\n\n const id = `g_${this.#docId}_alpha_map_${this.#id++}`;\n const url = this.#createUrl(id);\n this.#cache.set(map, url);\n this.#cache.set(key, url);\n\n const filter = this.#createFilter(id);\n this.#addTransferMapAlphaConversion(tableA, filter);\n\n return url;\n }\n\n addLuminosityFilter(map) {\n // When a page is zoomed the page is re-drawn but the maps are likely\n // the same.\n let value = this.#cache.get(map || \"luminosity\");\n if (value) {\n return value;\n }\n\n let tableA, key;\n if (map) {\n [tableA] = this.#createTables([map]);\n key = `luminosity_${tableA}`;\n } else {\n key = \"luminosity\";\n }\n\n value = this.#cache.get(key);\n if (value) {\n this.#cache.set(map, value);\n return value;\n }\n\n const id = `g_${this.#docId}_luminosity_map_${this.#id++}`;\n const url = this.#createUrl(id);\n this.#cache.set(map, url);\n this.#cache.set(key, url);\n\n const filter = this.#createFilter(id);\n this.#addLuminosityConversion(filter);\n if (map) {\n this.#addTransferMapAlphaConversion(tableA, filter);\n }\n\n return url;\n }\n\n addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) {\n const key = `${fgColor}-${bgColor}-${newFgColor}-${newBgColor}`;\n let info = this.#hcmCache.get(filterName);\n if (info?.key === key) {\n return info.url;\n }\n\n if (info) {\n info.filter?.remove();\n info.key = key;\n info.url = \"none\";\n info.filter = null;\n } else {\n info = {\n key,\n url: \"none\",\n filter: null,\n };\n this.#hcmCache.set(filterName, info);\n }\n\n if (!fgColor || !bgColor) {\n return info.url;\n }\n\n const [fgRGB, bgRGB] = [fgColor, bgColor].map(this.#getRGB.bind(this));\n let fgGray = Math.round(\n 0.2126 * fgRGB[0] + 0.7152 * fgRGB[1] + 0.0722 * fgRGB[2]\n );\n let bgGray = Math.round(\n 0.2126 * bgRGB[0] + 0.7152 * bgRGB[1] + 0.0722 * bgRGB[2]\n );\n let [newFgRGB, newBgRGB] = [newFgColor, newBgColor].map(\n this.#getRGB.bind(this)\n );\n if (bgGray < fgGray) {\n [fgGray, bgGray, newFgRGB, newBgRGB] = [\n bgGray,\n fgGray,\n newBgRGB,\n newFgRGB,\n ];\n }\n this.#defs.style.color = \"\";\n\n // Now we can create the filters to highlight some canvas parts.\n // The colors in the pdf will almost be Canvas and CanvasText, hence we\n // want to filter them to finally get Highlight and HighlightText.\n // Since we're in HCM the background color and the foreground color should\n // be really different when converted to grayscale (if they're not then it\n // means that we've a poor contrast). Once the canvas colors are converted\n // to grayscale we can easily map them on their new colors.\n // The grayscale step is important because if we've something like:\n // fgColor = #FF....\n // bgColor = #FF....\n // then we are enable to map the red component on the new red components\n // which can be different.\n\n const getSteps = (fg, bg, n) => {\n const arr = new Array(256);\n const step = (bgGray - fgGray) / n;\n const newStart = fg / 255;\n const newStep = (bg - fg) / (255 * n);\n let prev = 0;\n for (let i = 0; i <= n; i++) {\n const k = Math.round(fgGray + i * step);\n const value = newStart + i * newStep;\n for (let j = prev; j <= k; j++) {\n arr[j] = value;\n }\n prev = k + 1;\n }\n for (let i = prev; i < 256; i++) {\n arr[i] = arr[prev - 1];\n }\n return arr.join(\",\");\n };\n\n const id = `g_${this.#docId}_hcm_${filterName}_filter`;\n const filter = (info.filter = this.#createFilter(id));\n\n this.#addGrayConversion(filter);\n this.#addTransferMapConversion(\n getSteps(newFgRGB[0], newBgRGB[0], 5),\n getSteps(newFgRGB[1], newBgRGB[1], 5),\n getSteps(newFgRGB[2], newBgRGB[2], 5),\n filter\n );\n\n info.url = this.#createUrl(id);\n return info.url;\n }\n\n destroy(keepHCM = false) {\n if (keepHCM && this.#hcmCache.size !== 0) {\n return;\n }\n if (this.#_defs) {\n this.#_defs.parentNode.parentNode.remove();\n this.#_defs = null;\n }\n if (this.#_cache) {\n this.#_cache.clear();\n this.#_cache = null;\n }\n this.#id = 0;\n }\n\n #addLuminosityConversion(filter) {\n const feColorMatrix = this.#document.createElementNS(\n SVG_NS,\n \"feColorMatrix\"\n );\n feColorMatrix.setAttribute(\"type\", \"matrix\");\n feColorMatrix.setAttribute(\n \"values\",\n \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0\"\n );\n filter.append(feColorMatrix);\n }\n\n #addGrayConversion(filter) {\n const feColorMatrix = this.#document.createElementNS(\n SVG_NS,\n \"feColorMatrix\"\n );\n feColorMatrix.setAttribute(\"type\", \"matrix\");\n feColorMatrix.setAttribute(\n \"values\",\n \"0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0\"\n );\n filter.append(feColorMatrix);\n }\n\n #createFilter(id) {\n const filter = this.#document.createElementNS(SVG_NS, \"filter\");\n filter.setAttribute(\"color-interpolation-filters\", \"sRGB\");\n filter.setAttribute(\"id\", id);\n this.#defs.append(filter);\n\n return filter;\n }\n\n #appendFeFunc(feComponentTransfer, func, table) {\n const feFunc = this.#document.createElementNS(SVG_NS, func);\n feFunc.setAttribute(\"type\", \"discrete\");\n feFunc.setAttribute(\"tableValues\", table);\n feComponentTransfer.append(feFunc);\n }\n\n #addTransferMapConversion(rTable, gTable, bTable, filter) {\n const feComponentTransfer = this.#document.createElementNS(\n SVG_NS,\n \"feComponentTransfer\"\n );\n filter.append(feComponentTransfer);\n this.#appendFeFunc(feComponentTransfer, \"feFuncR\", rTable);\n this.#appendFeFunc(feComponentTransfer, \"feFuncG\", gTable);\n this.#appendFeFunc(feComponentTransfer, \"feFuncB\", bTable);\n }\n\n #addTransferMapAlphaConversion(aTable, filter) {\n const feComponentTransfer = this.#document.createElementNS(\n SVG_NS,\n \"feComponentTransfer\"\n );\n filter.append(feComponentTransfer);\n this.#appendFeFunc(feComponentTransfer, \"feFuncA\", aTable);\n }\n\n #getRGB(color) {\n this.#defs.style.color = color;\n return getRGB(getComputedStyle(this.#defs).getPropertyValue(\"color\"));\n }\n}\n\nexport { BaseFilterFactory, DOMFilterFactory };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { fetchData } from \"./display_utils.js\";\nimport { unreachable } from \"../shared/util.js\";\n\nclass BaseStandardFontDataFactory {\n constructor({ baseUrl = null }) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseStandardFontDataFactory\n ) {\n unreachable(\"Cannot initialize BaseStandardFontDataFactory.\");\n }\n this.baseUrl = baseUrl;\n }\n\n async fetch({ filename }) {\n if (!this.baseUrl) {\n throw new Error(\n \"Ensure that the `standardFontDataUrl` API parameter is provided.\"\n );\n }\n if (!filename) {\n throw new Error(\"Font filename must be specified.\");\n }\n const url = `${this.baseUrl}${filename}`;\n\n return this._fetch(url).catch(reason => {\n throw new Error(`Unable to load font data at: ${url}`);\n });\n }\n\n /**\n * @ignore\n * @returns {Promise}\n */\n async _fetch(url) {\n unreachable(\"Abstract method `_fetch` called.\");\n }\n}\n\nclass DOMStandardFontDataFactory extends BaseStandardFontDataFactory {\n /**\n * @ignore\n */\n async _fetch(url) {\n const data = await fetchData(url, /* type = */ \"arraybuffer\");\n return new Uint8Array(data);\n }\n}\n\nexport { BaseStandardFontDataFactory, DOMStandardFontDataFactory };\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isNodeJS, warn } from \"../shared/util.js\";\nimport { BaseCanvasFactory } from \"./canvas_factory.js\";\nimport { BaseCMapReaderFactory } from \"./cmap_reader_factory.js\";\nimport { BaseFilterFactory } from \"./filter_factory.js\";\nimport { BaseStandardFontDataFactory } from \"./standard_fontdata_factory.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./node_utils.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nif (isNodeJS) {\n // eslint-disable-next-line no-var\n var packageCapability = Promise.withResolvers();\n // eslint-disable-next-line no-var\n var packageMap = null;\n\n const loadPackages = async () => {\n // Native packages.\n const fs = await __non_webpack_import__(\"fs\"),\n http = await __non_webpack_import__(\"http\"),\n https = await __non_webpack_import__(\"https\"),\n url = await __non_webpack_import__(\"url\");\n\n // Optional, third-party, packages.\n let canvas, path2d;\n if (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"SKIP_BABEL\")) {\n try {\n canvas = await __non_webpack_import__(\"canvas\");\n } catch {}\n try {\n path2d = await __non_webpack_import__(\"path2d\");\n } catch {}\n }\n\n return new Map(Object.entries({ fs, http, https, url, canvas, path2d }));\n };\n\n loadPackages().then(\n map => {\n packageMap = map;\n packageCapability.resolve();\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"SKIP_BABEL\")) {\n return;\n }\n if (!globalThis.DOMMatrix) {\n const DOMMatrix = map.get(\"canvas\")?.DOMMatrix;\n\n if (DOMMatrix) {\n globalThis.DOMMatrix = DOMMatrix;\n } else {\n warn(\"Cannot polyfill `DOMMatrix`, rendering may be broken.\");\n }\n }\n if (!globalThis.Path2D) {\n const CanvasRenderingContext2D =\n map.get(\"canvas\")?.CanvasRenderingContext2D;\n const applyPath2DToCanvasRenderingContext =\n map.get(\"path2d\")?.applyPath2DToCanvasRenderingContext;\n const Path2D = map.get(\"path2d\")?.Path2D;\n\n if (\n CanvasRenderingContext2D &&\n applyPath2DToCanvasRenderingContext &&\n Path2D\n ) {\n try {\n applyPath2DToCanvasRenderingContext(CanvasRenderingContext2D);\n } catch (ex) {\n warn(`applyPath2DToCanvasRenderingContext: \"${ex}\".`);\n }\n globalThis.Path2D = Path2D;\n } else {\n warn(\"Cannot polyfill `Path2D`, rendering may be broken.\");\n }\n }\n },\n reason => {\n warn(`loadPackages: ${reason}`);\n\n packageMap = new Map();\n packageCapability.resolve();\n }\n );\n}\n\nclass NodePackages {\n static get promise() {\n return packageCapability.promise;\n }\n\n static get(name) {\n return packageMap?.get(name);\n }\n}\n\nasync function fetchData(url) {\n const fs = NodePackages.get(\"fs\");\n const data = await fs.promises.readFile(url);\n return new Uint8Array(data);\n}\n\nclass NodeFilterFactory extends BaseFilterFactory {}\n\nclass NodeCanvasFactory extends BaseCanvasFactory {\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n const canvas = NodePackages.get(\"canvas\");\n return canvas.createCanvas(width, height);\n }\n}\n\nclass NodeCMapReaderFactory extends BaseCMapReaderFactory {\n /**\n * @ignore\n */\n async _fetch(url) {\n return fetchData(url);\n }\n}\n\nclass NodeStandardFontDataFactory extends BaseStandardFontDataFactory {\n /**\n * @ignore\n */\n async _fetch(url) {\n return fetchData(url);\n }\n}\n\nexport {\n fetchData,\n NodeCanvasFactory,\n NodeCMapReaderFactory,\n NodeFilterFactory,\n NodePackages,\n NodeStandardFontDataFactory,\n};\n","/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FormatError, info, unreachable, Util } from \"../shared/util.js\";\nimport { getCurrentTransform } from \"./display_utils.js\";\n\nconst PathType = {\n FILL: \"Fill\",\n STROKE: \"Stroke\",\n SHADING: \"Shading\",\n};\n\nfunction applyBoundingBox(ctx, bbox) {\n if (!bbox) {\n return;\n }\n const width = bbox[2] - bbox[0];\n const height = bbox[3] - bbox[1];\n const region = new Path2D();\n region.rect(bbox[0], bbox[1], width, height);\n ctx.clip(region);\n}\n\nclass BaseShadingPattern {\n constructor() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseShadingPattern\n ) {\n unreachable(\"Cannot initialize BaseShadingPattern.\");\n }\n }\n\n getPattern() {\n unreachable(\"Abstract method `getPattern` called.\");\n }\n}\n\nclass RadialAxialShadingPattern extends BaseShadingPattern {\n constructor(IR) {\n super();\n this._type = IR[1];\n this._bbox = IR[2];\n this._colorStops = IR[3];\n this._p0 = IR[4];\n this._p1 = IR[5];\n this._r0 = IR[6];\n this._r1 = IR[7];\n this.matrix = null;\n }\n\n _createGradient(ctx) {\n let grad;\n if (this._type === \"axial\") {\n grad = ctx.createLinearGradient(\n this._p0[0],\n this._p0[1],\n this._p1[0],\n this._p1[1]\n );\n } else if (this._type === \"radial\") {\n grad = ctx.createRadialGradient(\n this._p0[0],\n this._p0[1],\n this._r0,\n this._p1[0],\n this._p1[1],\n this._r1\n );\n }\n\n for (const colorStop of this._colorStops) {\n grad.addColorStop(colorStop[0], colorStop[1]);\n }\n return grad;\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n let pattern;\n if (pathType === PathType.STROKE || pathType === PathType.FILL) {\n const ownerBBox = owner.current.getClippedPathBoundingBox(\n pathType,\n getCurrentTransform(ctx)\n ) || [0, 0, 0, 0];\n // Create a canvas that is only as big as the current path. This doesn't\n // allow us to cache the pattern, but it generally creates much smaller\n // canvases and saves memory use. See bug 1722807 for an example.\n const width = Math.ceil(ownerBBox[2] - ownerBBox[0]) || 1;\n const height = Math.ceil(ownerBBox[3] - ownerBBox[1]) || 1;\n\n const tmpCanvas = owner.cachedCanvases.getCanvas(\n \"pattern\",\n width,\n height\n );\n\n const tmpCtx = tmpCanvas.context;\n tmpCtx.clearRect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n tmpCtx.beginPath();\n tmpCtx.rect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n // Non shading fill patterns are positioned relative to the base transform\n // (usually the page's initial transform), but we may have created a\n // smaller canvas based on the path, so we must account for the shift.\n tmpCtx.translate(-ownerBBox[0], -ownerBBox[1]);\n inverse = Util.transform(inverse, [\n 1,\n 0,\n 0,\n 1,\n ownerBBox[0],\n ownerBBox[1],\n ]);\n\n tmpCtx.transform(...owner.baseTransform);\n if (this.matrix) {\n tmpCtx.transform(...this.matrix);\n }\n applyBoundingBox(tmpCtx, this._bbox);\n\n tmpCtx.fillStyle = this._createGradient(tmpCtx);\n tmpCtx.fill();\n\n pattern = ctx.createPattern(tmpCanvas.canvas, \"no-repeat\");\n const domMatrix = new DOMMatrix(inverse);\n pattern.setTransform(domMatrix);\n } else {\n // Shading fills are applied relative to the current matrix which is also\n // how canvas gradients work, so there's no need to do anything special\n // here.\n applyBoundingBox(ctx, this._bbox);\n pattern = this._createGradient(ctx);\n }\n return pattern;\n }\n}\n\nfunction drawTriangle(data, context, p1, p2, p3, c1, c2, c3) {\n // Very basic Gouraud-shaded triangle rasterization algorithm.\n const coords = context.coords,\n colors = context.colors;\n const bytes = data.data,\n rowSize = data.width * 4;\n let tmp;\n if (coords[p1 + 1] > coords[p2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n if (coords[p2 + 1] > coords[p3 + 1]) {\n tmp = p2;\n p2 = p3;\n p3 = tmp;\n tmp = c2;\n c2 = c3;\n c3 = tmp;\n }\n if (coords[p1 + 1] > coords[p2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n const x1 = (coords[p1] + context.offsetX) * context.scaleX;\n const y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY;\n const x2 = (coords[p2] + context.offsetX) * context.scaleX;\n const y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY;\n const x3 = (coords[p3] + context.offsetX) * context.scaleX;\n const y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY;\n if (y1 >= y3) {\n return;\n }\n const c1r = colors[c1],\n c1g = colors[c1 + 1],\n c1b = colors[c1 + 2];\n const c2r = colors[c2],\n c2g = colors[c2 + 1],\n c2b = colors[c2 + 2];\n const c3r = colors[c3],\n c3g = colors[c3 + 1],\n c3b = colors[c3 + 2];\n\n const minY = Math.round(y1),\n maxY = Math.round(y3);\n let xa, car, cag, cab;\n let xb, cbr, cbg, cbb;\n for (let y = minY; y <= maxY; y++) {\n if (y < y2) {\n const k = y < y1 ? 0 : (y1 - y) / (y1 - y2);\n xa = x1 - (x1 - x2) * k;\n car = c1r - (c1r - c2r) * k;\n cag = c1g - (c1g - c2g) * k;\n cab = c1b - (c1b - c2b) * k;\n } else {\n let k;\n if (y > y3) {\n k = 1;\n } else if (y2 === y3) {\n k = 0;\n } else {\n k = (y2 - y) / (y2 - y3);\n }\n xa = x2 - (x2 - x3) * k;\n car = c2r - (c2r - c3r) * k;\n cag = c2g - (c2g - c3g) * k;\n cab = c2b - (c2b - c3b) * k;\n }\n\n let k;\n if (y < y1) {\n k = 0;\n } else if (y > y3) {\n k = 1;\n } else {\n k = (y1 - y) / (y1 - y3);\n }\n xb = x1 - (x1 - x3) * k;\n cbr = c1r - (c1r - c3r) * k;\n cbg = c1g - (c1g - c3g) * k;\n cbb = c1b - (c1b - c3b) * k;\n const x1_ = Math.round(Math.min(xa, xb));\n const x2_ = Math.round(Math.max(xa, xb));\n let j = rowSize * y + x1_ * 4;\n for (let x = x1_; x <= x2_; x++) {\n k = (xa - x) / (xa - xb);\n if (k < 0) {\n k = 0;\n } else if (k > 1) {\n k = 1;\n }\n bytes[j++] = (car - (car - cbr) * k) | 0;\n bytes[j++] = (cag - (cag - cbg) * k) | 0;\n bytes[j++] = (cab - (cab - cbb) * k) | 0;\n bytes[j++] = 255;\n }\n }\n}\n\nfunction drawFigure(data, figure, context) {\n const ps = figure.coords;\n const cs = figure.colors;\n let i, ii;\n switch (figure.type) {\n case \"lattice\":\n const verticesPerRow = figure.verticesPerRow;\n const rows = Math.floor(ps.length / verticesPerRow) - 1;\n const cols = verticesPerRow - 1;\n for (i = 0; i < rows; i++) {\n let q = i * verticesPerRow;\n for (let j = 0; j < cols; j++, q++) {\n drawTriangle(\n data,\n context,\n ps[q],\n ps[q + 1],\n ps[q + verticesPerRow],\n cs[q],\n cs[q + 1],\n cs[q + verticesPerRow]\n );\n drawTriangle(\n data,\n context,\n ps[q + verticesPerRow + 1],\n ps[q + 1],\n ps[q + verticesPerRow],\n cs[q + verticesPerRow + 1],\n cs[q + 1],\n cs[q + verticesPerRow]\n );\n }\n }\n break;\n case \"triangles\":\n for (i = 0, ii = ps.length; i < ii; i += 3) {\n drawTriangle(\n data,\n context,\n ps[i],\n ps[i + 1],\n ps[i + 2],\n cs[i],\n cs[i + 1],\n cs[i + 2]\n );\n }\n break;\n default:\n throw new Error(\"illegal figure\");\n }\n}\n\nclass MeshShadingPattern extends BaseShadingPattern {\n constructor(IR) {\n super();\n this._coords = IR[2];\n this._colors = IR[3];\n this._figures = IR[4];\n this._bounds = IR[5];\n this._bbox = IR[7];\n this._background = IR[8];\n this.matrix = null;\n }\n\n _createMeshCanvas(combinedScale, backgroundColor, cachedCanvases) {\n // we will increase scale on some weird factor to let antialiasing take\n // care of \"rough\" edges\n const EXPECTED_SCALE = 1.1;\n // MAX_PATTERN_SIZE is used to avoid OOM situation.\n const MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough\n // We need to keep transparent border around our pattern for fill():\n // createPattern with 'no-repeat' will bleed edges across entire area.\n const BORDER_SIZE = 2;\n\n const offsetX = Math.floor(this._bounds[0]);\n const offsetY = Math.floor(this._bounds[1]);\n const boundsWidth = Math.ceil(this._bounds[2]) - offsetX;\n const boundsHeight = Math.ceil(this._bounds[3]) - offsetY;\n\n const width = Math.min(\n Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)),\n MAX_PATTERN_SIZE\n );\n const height = Math.min(\n Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)),\n MAX_PATTERN_SIZE\n );\n const scaleX = boundsWidth / width;\n const scaleY = boundsHeight / height;\n\n const context = {\n coords: this._coords,\n colors: this._colors,\n offsetX: -offsetX,\n offsetY: -offsetY,\n scaleX: 1 / scaleX,\n scaleY: 1 / scaleY,\n };\n\n const paddedWidth = width + BORDER_SIZE * 2;\n const paddedHeight = height + BORDER_SIZE * 2;\n\n const tmpCanvas = cachedCanvases.getCanvas(\n \"mesh\",\n paddedWidth,\n paddedHeight\n );\n const tmpCtx = tmpCanvas.context;\n\n const data = tmpCtx.createImageData(width, height);\n if (backgroundColor) {\n const bytes = data.data;\n for (let i = 0, ii = bytes.length; i < ii; i += 4) {\n bytes[i] = backgroundColor[0];\n bytes[i + 1] = backgroundColor[1];\n bytes[i + 2] = backgroundColor[2];\n bytes[i + 3] = 255;\n }\n }\n for (const figure of this._figures) {\n drawFigure(data, figure, context);\n }\n tmpCtx.putImageData(data, BORDER_SIZE, BORDER_SIZE);\n const canvas = tmpCanvas.canvas;\n\n return {\n canvas,\n offsetX: offsetX - BORDER_SIZE * scaleX,\n offsetY: offsetY - BORDER_SIZE * scaleY,\n scaleX,\n scaleY,\n };\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n applyBoundingBox(ctx, this._bbox);\n let scale;\n if (pathType === PathType.SHADING) {\n scale = Util.singularValueDecompose2dScale(getCurrentTransform(ctx));\n } else {\n // Obtain scale from matrix and current transformation matrix.\n scale = Util.singularValueDecompose2dScale(owner.baseTransform);\n if (this.matrix) {\n const matrixScale = Util.singularValueDecompose2dScale(this.matrix);\n scale = [scale[0] * matrixScale[0], scale[1] * matrixScale[1]];\n }\n }\n\n // Rasterizing on the main thread since sending/queue large canvases\n // might cause OOM.\n const temporaryPatternCanvas = this._createMeshCanvas(\n scale,\n pathType === PathType.SHADING ? null : this._background,\n owner.cachedCanvases\n );\n\n if (pathType !== PathType.SHADING) {\n ctx.setTransform(...owner.baseTransform);\n if (this.matrix) {\n ctx.transform(...this.matrix);\n }\n }\n\n ctx.translate(\n temporaryPatternCanvas.offsetX,\n temporaryPatternCanvas.offsetY\n );\n ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY);\n\n return ctx.createPattern(temporaryPatternCanvas.canvas, \"no-repeat\");\n }\n}\n\nclass DummyShadingPattern extends BaseShadingPattern {\n getPattern() {\n return \"hotpink\";\n }\n}\n\nfunction getShadingPattern(IR) {\n switch (IR[0]) {\n case \"RadialAxial\":\n return new RadialAxialShadingPattern(IR);\n case \"Mesh\":\n return new MeshShadingPattern(IR);\n case \"Dummy\":\n return new DummyShadingPattern();\n }\n throw new Error(`Unknown IR type: ${IR[0]}`);\n}\n\nconst PaintType = {\n COLORED: 1,\n UNCOLORED: 2,\n};\n\nclass TilingPattern {\n // 10in @ 300dpi shall be enough.\n static MAX_PATTERN_SIZE = 3000;\n\n constructor(IR, color, ctx, canvasGraphicsFactory, baseTransform) {\n this.operatorList = IR[2];\n this.matrix = IR[3];\n this.bbox = IR[4];\n this.xstep = IR[5];\n this.ystep = IR[6];\n this.paintType = IR[7];\n this.tilingType = IR[8];\n this.color = color;\n this.ctx = ctx;\n this.canvasGraphicsFactory = canvasGraphicsFactory;\n this.baseTransform = baseTransform;\n }\n\n createPatternCanvas(owner) {\n const {\n bbox,\n operatorList,\n paintType,\n tilingType,\n color,\n canvasGraphicsFactory,\n } = this;\n let { xstep, ystep } = this;\n xstep = Math.abs(xstep);\n ystep = Math.abs(ystep);\n\n info(\"TilingType: \" + tilingType);\n\n // A tiling pattern as defined by PDF spec 8.7.2 is a cell whose size is\n // described by bbox, and may repeat regularly by shifting the cell by\n // xstep and ystep.\n // Because the HTML5 canvas API does not support pattern repetition with\n // gaps in between, we use the xstep/ystep instead of the bbox's size.\n //\n // This has the following consequences (similarly for ystep):\n //\n // - If xstep is the same as bbox, then there is no observable difference.\n //\n // - If xstep is larger than bbox, then the pattern canvas is partially\n // empty: the area bounded by bbox is painted, the outside area is void.\n //\n // - If xstep is smaller than bbox, then the pixels between xstep and the\n // bbox boundary will be missing. This is INCORRECT behavior.\n // \"Figures on adjacent tiles should not overlap\" (PDF spec 8.7.3.1),\n // but overlapping cells without common pixels are still valid.\n\n const x0 = bbox[0],\n y0 = bbox[1],\n x1 = bbox[2],\n y1 = bbox[3];\n const width = x1 - x0;\n const height = y1 - y0;\n\n // Obtain scale from matrix and current transformation matrix.\n const matrixScale = Util.singularValueDecompose2dScale(this.matrix);\n const curMatrixScale = Util.singularValueDecompose2dScale(\n this.baseTransform\n );\n const combinedScaleX = matrixScale[0] * curMatrixScale[0];\n const combinedScaleY = matrixScale[1] * curMatrixScale[1];\n\n let canvasWidth = width,\n canvasHeight = height,\n redrawHorizontally = false,\n redrawVertically = false;\n\n const xScaledStep = Math.ceil(xstep * combinedScaleX);\n const yScaledStep = Math.ceil(ystep * combinedScaleY);\n const xScaledWidth = Math.ceil(width * combinedScaleX);\n const yScaledHeight = Math.ceil(height * combinedScaleY);\n\n if (xScaledStep >= xScaledWidth) {\n canvasWidth = xstep;\n } else {\n redrawHorizontally = true;\n }\n if (yScaledStep >= yScaledHeight) {\n canvasHeight = ystep;\n } else {\n redrawVertically = true;\n }\n\n // Use width and height values that are as close as possible to the end\n // result when the pattern is used. Too low value makes the pattern look\n // blurry. Too large value makes it look too crispy.\n const dimx = this.getSizeAndScale(\n canvasWidth,\n this.ctx.canvas.width,\n combinedScaleX\n );\n const dimy = this.getSizeAndScale(\n canvasHeight,\n this.ctx.canvas.height,\n combinedScaleY\n );\n\n const tmpCanvas = owner.cachedCanvases.getCanvas(\n \"pattern\",\n dimx.size,\n dimy.size\n );\n const tmpCtx = tmpCanvas.context;\n const graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx);\n graphics.groupLevel = owner.groupLevel;\n\n this.setFillAndStrokeStyleToContext(graphics, paintType, color);\n\n tmpCtx.translate(-dimx.scale * x0, -dimy.scale * y0);\n graphics.transform(dimx.scale, 0, 0, dimy.scale, 0, 0);\n\n // To match CanvasGraphics beginDrawing we must save the context here or\n // else we end up with unbalanced save/restores.\n tmpCtx.save();\n\n this.clipBbox(graphics, x0, y0, x1, y1);\n\n graphics.baseTransform = getCurrentTransform(graphics.ctx);\n\n graphics.executeOperatorList(operatorList);\n\n graphics.endDrawing();\n\n tmpCtx.restore();\n\n if (redrawHorizontally || redrawVertically) {\n // The tile is overlapping itself, so we create a new tile with\n // dimensions xstep * ystep.\n // Then we draw the overlapping parts of the original tile on the new\n // tile.\n // Just as a side note, the code here works correctly even if we don't\n // have to redraw the tile horizontally or vertically. In that case, the\n // original tile is drawn on the new tile only once, but it's useless.\n const image = tmpCanvas.canvas;\n if (redrawHorizontally) {\n canvasWidth = xstep;\n }\n if (redrawVertically) {\n canvasHeight = ystep;\n }\n\n const dimx2 = this.getSizeAndScale(\n canvasWidth,\n this.ctx.canvas.width,\n combinedScaleX\n );\n const dimy2 = this.getSizeAndScale(\n canvasHeight,\n this.ctx.canvas.height,\n combinedScaleY\n );\n\n const xSize = dimx2.size;\n const ySize = dimy2.size;\n const tmpCanvas2 = owner.cachedCanvases.getCanvas(\n \"pattern-workaround\",\n xSize,\n ySize\n );\n const tmpCtx2 = tmpCanvas2.context;\n const ii = redrawHorizontally ? Math.floor(width / xstep) : 0;\n const jj = redrawVertically ? Math.floor(height / ystep) : 0;\n\n // Draw the overlapping parts of the original tile on the new tile.\n for (let i = 0; i <= ii; i++) {\n for (let j = 0; j <= jj; j++) {\n tmpCtx2.drawImage(\n image,\n xSize * i,\n ySize * j,\n xSize,\n ySize,\n 0,\n 0,\n xSize,\n ySize\n );\n }\n }\n return {\n canvas: tmpCanvas2.canvas,\n scaleX: dimx2.scale,\n scaleY: dimy2.scale,\n offsetX: x0,\n offsetY: y0,\n };\n }\n\n return {\n canvas: tmpCanvas.canvas,\n scaleX: dimx.scale,\n scaleY: dimy.scale,\n offsetX: x0,\n offsetY: y0,\n };\n }\n\n getSizeAndScale(step, realOutputSize, scale) {\n // MAX_PATTERN_SIZE is used to avoid OOM situation.\n // Use the destination canvas's size if it is bigger than the hard-coded\n // limit of MAX_PATTERN_SIZE to avoid clipping patterns that cover the\n // whole canvas.\n const maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize);\n let size = Math.ceil(step * scale);\n if (size >= maxSize) {\n size = maxSize;\n } else {\n scale = size / step;\n }\n return { scale, size };\n }\n\n clipBbox(graphics, x0, y0, x1, y1) {\n const bboxWidth = x1 - x0;\n const bboxHeight = y1 - y0;\n graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight);\n graphics.current.updateRectMinMax(getCurrentTransform(graphics.ctx), [\n x0,\n y0,\n x1,\n y1,\n ]);\n graphics.clip();\n graphics.endPath();\n }\n\n setFillAndStrokeStyleToContext(graphics, paintType, color) {\n const context = graphics.ctx,\n current = graphics.current;\n switch (paintType) {\n case PaintType.COLORED:\n const ctx = this.ctx;\n context.fillStyle = ctx.fillStyle;\n context.strokeStyle = ctx.strokeStyle;\n current.fillColor = ctx.fillStyle;\n current.strokeColor = ctx.strokeStyle;\n break;\n case PaintType.UNCOLORED:\n const cssColor = Util.makeHexColor(color[0], color[1], color[2]);\n context.fillStyle = cssColor;\n context.strokeStyle = cssColor;\n // Set color needed by image masks (fixes issues 3226 and 8741).\n current.fillColor = cssColor;\n current.strokeColor = cssColor;\n break;\n default:\n throw new FormatError(`Unsupported paint type: ${paintType}`);\n }\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n // PDF spec 8.7.2 NOTE 1: pattern's matrix is relative to initial matrix.\n let matrix = inverse;\n if (pathType !== PathType.SHADING) {\n matrix = Util.transform(matrix, owner.baseTransform);\n if (this.matrix) {\n matrix = Util.transform(matrix, this.matrix);\n }\n }\n\n const temporaryPatternCanvas = this.createPatternCanvas(owner);\n\n let domMatrix = new DOMMatrix(matrix);\n // Rescale and so that the ctx.createPattern call generates a pattern with\n // the desired size.\n domMatrix = domMatrix.translate(\n temporaryPatternCanvas.offsetX,\n temporaryPatternCanvas.offsetY\n );\n domMatrix = domMatrix.scale(\n 1 / temporaryPatternCanvas.scaleX,\n 1 / temporaryPatternCanvas.scaleY\n );\n\n const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, \"repeat\");\n pattern.setTransform(domMatrix);\n\n return pattern;\n }\n}\n\nexport { getShadingPattern, PathType, TilingPattern };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FeatureTest, ImageKind } from \"./util.js\";\n\nfunction convertToRGBA(params) {\n switch (params.kind) {\n case ImageKind.GRAYSCALE_1BPP:\n return convertBlackAndWhiteToRGBA(params);\n case ImageKind.RGB_24BPP:\n return convertRGBToRGBA(params);\n }\n\n return null;\n}\n\nfunction convertBlackAndWhiteToRGBA({\n src,\n srcPos = 0,\n dest,\n width,\n height,\n nonBlackColor = 0xffffffff,\n inverseDecode = false,\n}) {\n const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n const [zeroMapping, oneMapping] = inverseDecode\n ? [nonBlackColor, black]\n : [black, nonBlackColor];\n const widthInSource = width >> 3;\n const widthRemainder = width & 7;\n const srcLength = src.length;\n dest = new Uint32Array(dest.buffer);\n let destPos = 0;\n\n for (let i = 0; i < height; i++) {\n for (const max = srcPos + widthInSource; srcPos < max; srcPos++) {\n const elem = srcPos < srcLength ? src[srcPos] : 255;\n dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping;\n }\n if (widthRemainder === 0) {\n continue;\n }\n const elem = srcPos < srcLength ? src[srcPos++] : 255;\n for (let j = 0; j < widthRemainder; j++) {\n dest[destPos++] = elem & (1 << (7 - j)) ? oneMapping : zeroMapping;\n }\n }\n return { srcPos, destPos };\n}\n\nfunction convertRGBToRGBA({\n src,\n srcPos = 0,\n dest,\n destPos = 0,\n width,\n height,\n}) {\n let i = 0;\n const len32 = src.length >> 2;\n const src32 = new Uint32Array(src.buffer, srcPos, len32);\n\n if (FeatureTest.isLittleEndian) {\n // It's a way faster to do the shuffle manually instead of working\n // component by component with some Uint8 arrays.\n for (; i < len32 - 2; i += 3, destPos += 4) {\n const s1 = src32[i]; // R2B1G1R1\n const s2 = src32[i + 1]; // G3R3B2G2\n const s3 = src32[i + 2]; // B4G4R4B3\n\n dest[destPos] = s1 | 0xff000000;\n dest[destPos + 1] = (s1 >>> 24) | (s2 << 8) | 0xff000000;\n dest[destPos + 2] = (s2 >>> 16) | (s3 << 16) | 0xff000000;\n dest[destPos + 3] = (s3 >>> 8) | 0xff000000;\n }\n\n for (let j = i * 4, jj = src.length; j < jj; j += 3) {\n dest[destPos++] =\n src[j] | (src[j + 1] << 8) | (src[j + 2] << 16) | 0xff000000;\n }\n } else {\n for (; i < len32 - 2; i += 3, destPos += 4) {\n const s1 = src32[i]; // R1G1B1R2\n const s2 = src32[i + 1]; // G2B2R3G3\n const s3 = src32[i + 2]; // B3R4G4B4\n\n dest[destPos] = s1 | 0xff;\n dest[destPos + 1] = (s1 << 24) | (s2 >>> 8) | 0xff;\n dest[destPos + 2] = (s2 << 16) | (s3 >>> 16) | 0xff;\n dest[destPos + 3] = (s3 << 8) | 0xff;\n }\n\n for (let j = i * 4, jj = src.length; j < jj; j += 3) {\n dest[destPos++] =\n (src[j] << 24) | (src[j + 1] << 16) | (src[j + 2] << 8) | 0xff;\n }\n }\n\n return { srcPos, destPos };\n}\n\nfunction grayToRGBA(src, dest) {\n if (FeatureTest.isLittleEndian) {\n for (let i = 0, ii = src.length; i < ii; i++) {\n dest[i] = (src[i] * 0x10101) | 0xff000000;\n }\n } else {\n for (let i = 0, ii = src.length; i < ii; i++) {\n dest[i] = (src[i] * 0x1010100) | 0x000000ff;\n }\n }\n}\n\nexport { convertBlackAndWhiteToRGBA, convertToRGBA, grayToRGBA };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FeatureTest,\n FONT_IDENTITY_MATRIX,\n IDENTITY_MATRIX,\n ImageKind,\n info,\n isNodeJS,\n OPS,\n shadow,\n TextRenderingMode,\n unreachable,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport {\n getCurrentTransform,\n getCurrentTransformInverse,\n PixelsPerInch,\n} from \"./display_utils.js\";\nimport {\n getShadingPattern,\n PathType,\n TilingPattern,\n} from \"./pattern_helper.js\";\nimport { convertBlackAndWhiteToRGBA } from \"../shared/image_utils.js\";\n\n// contexts store most of the state we need natively.\n// However, PDF needs a bit more state, which we store here.\n// Minimal font size that would be used during canvas fillText operations.\nconst MIN_FONT_SIZE = 16;\n// Maximum font size that would be used during canvas fillText operations.\nconst MAX_FONT_SIZE = 100;\n\n// Defines the time the `executeOperatorList`-method is going to be executing\n// before it stops and schedules a continue of execution.\nconst EXECUTION_TIME = 15; // ms\n// Defines the number of steps before checking the execution time.\nconst EXECUTION_STEPS = 10;\n\n// To disable Type3 compilation, set the value to `-1`.\nconst MAX_SIZE_TO_COMPILE = 1000;\n\nconst FULL_CHUNK_HEIGHT = 16;\n\n/**\n * Overrides certain methods on a 2d ctx so that when they are called they\n * will also call the same method on the destCtx. The methods that are\n * overridden are all the transformation state modifiers, path creation, and\n * save/restore. We only forward these specific methods because they are the\n * only state modifiers that we cannot copy over when we switch contexts.\n *\n * To remove mirroring call `ctx._removeMirroring()`.\n *\n * @param {Object} ctx - The 2d canvas context that will duplicate its calls on\n * the destCtx.\n * @param {Object} destCtx - The 2d canvas context that will receive the\n * forwarded calls.\n */\nfunction mirrorContextOperations(ctx, destCtx) {\n if (ctx._removeMirroring) {\n throw new Error(\"Context is already forwarding operations.\");\n }\n ctx.__originalSave = ctx.save;\n ctx.__originalRestore = ctx.restore;\n ctx.__originalRotate = ctx.rotate;\n ctx.__originalScale = ctx.scale;\n ctx.__originalTranslate = ctx.translate;\n ctx.__originalTransform = ctx.transform;\n ctx.__originalSetTransform = ctx.setTransform;\n ctx.__originalResetTransform = ctx.resetTransform;\n ctx.__originalClip = ctx.clip;\n ctx.__originalMoveTo = ctx.moveTo;\n ctx.__originalLineTo = ctx.lineTo;\n ctx.__originalBezierCurveTo = ctx.bezierCurveTo;\n ctx.__originalRect = ctx.rect;\n ctx.__originalClosePath = ctx.closePath;\n ctx.__originalBeginPath = ctx.beginPath;\n\n ctx._removeMirroring = () => {\n ctx.save = ctx.__originalSave;\n ctx.restore = ctx.__originalRestore;\n ctx.rotate = ctx.__originalRotate;\n ctx.scale = ctx.__originalScale;\n ctx.translate = ctx.__originalTranslate;\n ctx.transform = ctx.__originalTransform;\n ctx.setTransform = ctx.__originalSetTransform;\n ctx.resetTransform = ctx.__originalResetTransform;\n\n ctx.clip = ctx.__originalClip;\n ctx.moveTo = ctx.__originalMoveTo;\n ctx.lineTo = ctx.__originalLineTo;\n ctx.bezierCurveTo = ctx.__originalBezierCurveTo;\n ctx.rect = ctx.__originalRect;\n ctx.closePath = ctx.__originalClosePath;\n ctx.beginPath = ctx.__originalBeginPath;\n delete ctx._removeMirroring;\n };\n\n ctx.save = function ctxSave() {\n destCtx.save();\n this.__originalSave();\n };\n\n ctx.restore = function ctxRestore() {\n destCtx.restore();\n this.__originalRestore();\n };\n\n ctx.translate = function ctxTranslate(x, y) {\n destCtx.translate(x, y);\n this.__originalTranslate(x, y);\n };\n\n ctx.scale = function ctxScale(x, y) {\n destCtx.scale(x, y);\n this.__originalScale(x, y);\n };\n\n ctx.transform = function ctxTransform(a, b, c, d, e, f) {\n destCtx.transform(a, b, c, d, e, f);\n this.__originalTransform(a, b, c, d, e, f);\n };\n\n ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) {\n destCtx.setTransform(a, b, c, d, e, f);\n this.__originalSetTransform(a, b, c, d, e, f);\n };\n\n ctx.resetTransform = function ctxResetTransform() {\n destCtx.resetTransform();\n this.__originalResetTransform();\n };\n\n ctx.rotate = function ctxRotate(angle) {\n destCtx.rotate(angle);\n this.__originalRotate(angle);\n };\n\n ctx.clip = function ctxRotate(rule) {\n destCtx.clip(rule);\n this.__originalClip(rule);\n };\n\n ctx.moveTo = function (x, y) {\n destCtx.moveTo(x, y);\n this.__originalMoveTo(x, y);\n };\n\n ctx.lineTo = function (x, y) {\n destCtx.lineTo(x, y);\n this.__originalLineTo(x, y);\n };\n\n ctx.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) {\n destCtx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n this.__originalBezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n };\n\n ctx.rect = function (x, y, width, height) {\n destCtx.rect(x, y, width, height);\n this.__originalRect(x, y, width, height);\n };\n\n ctx.closePath = function () {\n destCtx.closePath();\n this.__originalClosePath();\n };\n\n ctx.beginPath = function () {\n destCtx.beginPath();\n this.__originalBeginPath();\n };\n}\n\nclass CachedCanvases {\n constructor(canvasFactory) {\n this.canvasFactory = canvasFactory;\n this.cache = Object.create(null);\n }\n\n getCanvas(id, width, height) {\n let canvasEntry;\n if (this.cache[id] !== undefined) {\n canvasEntry = this.cache[id];\n this.canvasFactory.reset(canvasEntry, width, height);\n } else {\n canvasEntry = this.canvasFactory.create(width, height);\n this.cache[id] = canvasEntry;\n }\n return canvasEntry;\n }\n\n delete(id) {\n delete this.cache[id];\n }\n\n clear() {\n for (const id in this.cache) {\n const canvasEntry = this.cache[id];\n this.canvasFactory.destroy(canvasEntry);\n delete this.cache[id];\n }\n }\n}\n\nfunction drawImageAtIntegerCoords(\n ctx,\n srcImg,\n srcX,\n srcY,\n srcW,\n srcH,\n destX,\n destY,\n destW,\n destH\n) {\n const [a, b, c, d, tx, ty] = getCurrentTransform(ctx);\n if (b === 0 && c === 0) {\n // top-left corner is at (X, Y) and\n // bottom-right one is at (X + width, Y + height).\n\n // If leftX is 4.321 then it's rounded to 4.\n // If width is 10.432 then it's rounded to 11 because\n // rightX = leftX + width = 14.753 which is rounded to 15\n // so after rounding the total width is 11 (15 - 4).\n // It's why we can't just floor/ceil uniformly, it just depends\n // on the values we've.\n\n const tlX = destX * a + tx;\n const rTlX = Math.round(tlX);\n const tlY = destY * d + ty;\n const rTlY = Math.round(tlY);\n const brX = (destX + destW) * a + tx;\n\n // Some pdf contains images with 1x1 images so in case of 0-width after\n // scaling we must fallback on 1 to be sure there is something.\n const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n const brY = (destY + destH) * d + ty;\n const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n\n // We must apply a transformation in order to apply it on the image itself.\n // For example if a == 1 && d == -1, it means that the image itself is\n // mirrored w.r.t. the x-axis.\n ctx.setTransform(Math.sign(a), 0, 0, Math.sign(d), rTlX, rTlY);\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight);\n ctx.setTransform(a, b, c, d, tx, ty);\n\n return [rWidth, rHeight];\n }\n\n if (a === 0 && d === 0) {\n // This path is taken in issue9462.pdf (page 3).\n const tlX = destY * c + tx;\n const rTlX = Math.round(tlX);\n const tlY = destX * b + ty;\n const rTlY = Math.round(tlY);\n const brX = (destY + destH) * c + tx;\n const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n const brY = (destX + destW) * b + ty;\n const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n\n ctx.setTransform(0, Math.sign(b), Math.sign(c), 0, rTlX, rTlY);\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth);\n ctx.setTransform(a, b, c, d, tx, ty);\n\n return [rHeight, rWidth];\n }\n\n // Not a scale matrix so let the render handle the case without rounding.\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH);\n\n const scaleX = Math.hypot(a, b);\n const scaleY = Math.hypot(c, d);\n return [scaleX * destW, scaleY * destH];\n}\n\nfunction compileType3Glyph(imgData) {\n const { width, height } = imgData;\n if (width > MAX_SIZE_TO_COMPILE || height > MAX_SIZE_TO_COMPILE) {\n return null;\n }\n\n const POINT_TO_PROCESS_LIMIT = 1000;\n const POINT_TYPES = new Uint8Array([\n 0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0,\n ]);\n\n const width1 = width + 1;\n let points = new Uint8Array(width1 * (height + 1));\n let i, j, j0;\n\n // decodes bit-packed mask data\n const lineSize = (width + 7) & ~7;\n let data = new Uint8Array(lineSize * height),\n pos = 0;\n for (const elem of imgData.data) {\n let mask = 128;\n while (mask > 0) {\n data[pos++] = elem & mask ? 0 : 255;\n mask >>= 1;\n }\n }\n\n // finding interesting points: every point is located between mask pixels,\n // so there will be points of the (width + 1)x(height + 1) grid. Every point\n // will have flags assigned based on neighboring mask pixels:\n // 4 | 8\n // --P--\n // 2 | 1\n // We are interested only in points with the flags:\n // - outside corners: 1, 2, 4, 8;\n // - inside corners: 7, 11, 13, 14;\n // - and, intersections: 5, 10.\n let count = 0;\n pos = 0;\n if (data[pos] !== 0) {\n points[0] = 1;\n ++count;\n }\n for (j = 1; j < width; j++) {\n if (data[pos] !== data[pos + 1]) {\n points[j] = data[pos] ? 2 : 1;\n ++count;\n }\n pos++;\n }\n if (data[pos] !== 0) {\n points[j] = 2;\n ++count;\n }\n for (i = 1; i < height; i++) {\n pos = i * lineSize;\n j0 = i * width1;\n if (data[pos - lineSize] !== data[pos]) {\n points[j0] = data[pos] ? 1 : 8;\n ++count;\n }\n // 'sum' is the position of the current pixel configuration in the 'TYPES'\n // array (in order 8-1-2-4, so we can use '>>2' to shift the column).\n let sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0);\n for (j = 1; j < width; j++) {\n sum =\n (sum >> 2) +\n (data[pos + 1] ? 4 : 0) +\n (data[pos - lineSize + 1] ? 8 : 0);\n if (POINT_TYPES[sum]) {\n points[j0 + j] = POINT_TYPES[sum];\n ++count;\n }\n pos++;\n }\n if (data[pos - lineSize] !== data[pos]) {\n points[j0 + j] = data[pos] ? 2 : 4;\n ++count;\n }\n\n if (count > POINT_TO_PROCESS_LIMIT) {\n return null;\n }\n }\n\n pos = lineSize * (height - 1);\n j0 = i * width1;\n if (data[pos] !== 0) {\n points[j0] = 8;\n ++count;\n }\n for (j = 1; j < width; j++) {\n if (data[pos] !== data[pos + 1]) {\n points[j0 + j] = data[pos] ? 4 : 8;\n ++count;\n }\n pos++;\n }\n if (data[pos] !== 0) {\n points[j0 + j] = 4;\n ++count;\n }\n if (count > POINT_TO_PROCESS_LIMIT) {\n return null;\n }\n\n // building outlines\n const steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]);\n const path = new Path2D();\n\n for (i = 0; count && i <= height; i++) {\n let p = i * width1;\n const end = p + width;\n while (p < end && !points[p]) {\n p++;\n }\n if (p === end) {\n continue;\n }\n path.moveTo(p % width1, i);\n\n const p0 = p;\n let type = points[p];\n do {\n const step = steps[type];\n do {\n p += step;\n } while (!points[p]);\n\n const pp = points[p];\n if (pp !== 5 && pp !== 10) {\n // set new direction\n type = pp;\n // delete mark\n points[p] = 0;\n } else {\n // type is 5 or 10, ie, a crossing\n // set new direction\n type = pp & ((0x33 * type) >> 4);\n // set new type for \"future hit\"\n points[p] &= (type >> 2) | (type << 2);\n }\n path.lineTo(p % width1, (p / width1) | 0);\n\n if (!points[p]) {\n --count;\n }\n } while (p0 !== p);\n --i;\n }\n\n // Immediately release the, potentially large, `Uint8Array`s after parsing.\n data = null;\n points = null;\n\n const drawOutline = function (c) {\n c.save();\n // the path shall be painted in [0..1]x[0..1] space\n c.scale(1 / width, -1 / height);\n c.translate(0, -height);\n c.fill(path);\n c.beginPath();\n c.restore();\n };\n\n return drawOutline;\n}\n\nclass CanvasExtraState {\n constructor(width, height) {\n // Are soft masks and alpha values shapes or opacities?\n this.alphaIsShape = false;\n this.fontSize = 0;\n this.fontSizeScale = 1;\n this.textMatrix = IDENTITY_MATRIX;\n this.textMatrixScale = 1;\n this.fontMatrix = FONT_IDENTITY_MATRIX;\n this.leading = 0;\n // Current point (in user coordinates)\n this.x = 0;\n this.y = 0;\n // Start of text line (in text coordinates)\n this.lineX = 0;\n this.lineY = 0;\n // Character and word spacing\n this.charSpacing = 0;\n this.wordSpacing = 0;\n this.textHScale = 1;\n this.textRenderingMode = TextRenderingMode.FILL;\n this.textRise = 0;\n // Default fore and background colors\n this.fillColor = \"#000000\";\n this.strokeColor = \"#000000\";\n this.patternFill = false;\n // Note: fill alpha applies to all non-stroking operations\n this.fillAlpha = 1;\n this.strokeAlpha = 1;\n this.lineWidth = 1;\n this.activeSMask = null;\n this.transferMaps = \"none\";\n\n this.startNewPathAndClipBox([0, 0, width, height]);\n }\n\n clone() {\n const clone = Object.create(this);\n clone.clipBox = this.clipBox.slice();\n return clone;\n }\n\n setCurrentPoint(x, y) {\n this.x = x;\n this.y = y;\n }\n\n updatePathMinMax(transform, x, y) {\n [x, y] = Util.applyTransform([x, y], transform);\n this.minX = Math.min(this.minX, x);\n this.minY = Math.min(this.minY, y);\n this.maxX = Math.max(this.maxX, x);\n this.maxY = Math.max(this.maxY, y);\n }\n\n updateRectMinMax(transform, rect) {\n const p1 = Util.applyTransform(rect, transform);\n const p2 = Util.applyTransform(rect.slice(2), transform);\n const p3 = Util.applyTransform([rect[0], rect[3]], transform);\n const p4 = Util.applyTransform([rect[2], rect[1]], transform);\n\n this.minX = Math.min(this.minX, p1[0], p2[0], p3[0], p4[0]);\n this.minY = Math.min(this.minY, p1[1], p2[1], p3[1], p4[1]);\n this.maxX = Math.max(this.maxX, p1[0], p2[0], p3[0], p4[0]);\n this.maxY = Math.max(this.maxY, p1[1], p2[1], p3[1], p4[1]);\n }\n\n updateScalingPathMinMax(transform, minMax) {\n Util.scaleMinMax(transform, minMax);\n this.minX = Math.min(this.minX, minMax[0]);\n this.minY = Math.min(this.minY, minMax[1]);\n this.maxX = Math.max(this.maxX, minMax[2]);\n this.maxY = Math.max(this.maxY, minMax[3]);\n }\n\n updateCurvePathMinMax(transform, x0, y0, x1, y1, x2, y2, x3, y3, minMax) {\n const box = Util.bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax);\n if (minMax) {\n return;\n }\n this.updateRectMinMax(transform, box);\n }\n\n getPathBoundingBox(pathType = PathType.FILL, transform = null) {\n const box = [this.minX, this.minY, this.maxX, this.maxY];\n if (pathType === PathType.STROKE) {\n if (!transform) {\n unreachable(\"Stroke bounding box must include transform.\");\n }\n // Stroked paths can be outside of the path bounding box by 1/2 the line\n // width.\n const scale = Util.singularValueDecompose2dScale(transform);\n const xStrokePad = (scale[0] * this.lineWidth) / 2;\n const yStrokePad = (scale[1] * this.lineWidth) / 2;\n box[0] -= xStrokePad;\n box[1] -= yStrokePad;\n box[2] += xStrokePad;\n box[3] += yStrokePad;\n }\n return box;\n }\n\n updateClipFromPath() {\n const intersect = Util.intersect(this.clipBox, this.getPathBoundingBox());\n this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]);\n }\n\n isEmptyClip() {\n return this.minX === Infinity;\n }\n\n startNewPathAndClipBox(box) {\n this.clipBox = box;\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = 0;\n this.maxY = 0;\n }\n\n getClippedPathBoundingBox(pathType = PathType.FILL, transform = null) {\n return Util.intersect(\n this.clipBox,\n this.getPathBoundingBox(pathType, transform)\n );\n }\n}\n\nfunction putBinaryImageData(ctx, imgData) {\n if (typeof ImageData !== \"undefined\" && imgData instanceof ImageData) {\n ctx.putImageData(imgData, 0, 0);\n return;\n }\n\n // Put the image data to the canvas in chunks, rather than putting the\n // whole image at once. This saves JS memory, because the ImageData object\n // is smaller. It also possibly saves C++ memory within the implementation\n // of putImageData(). (E.g. in Firefox we make two short-lived copies of\n // the data passed to putImageData()). |n| shouldn't be too small, however,\n // because too many putImageData() calls will slow things down.\n //\n // Note: as written, if the last chunk is partial, the putImageData() call\n // will (conceptually) put pixels past the bounds of the canvas. But\n // that's ok; any such pixels are ignored.\n\n const height = imgData.height,\n width = imgData.width;\n const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n\n const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n let srcPos = 0,\n destPos;\n const src = imgData.data;\n const dest = chunkImgData.data;\n let i, j, thisChunkHeight, elemsInThisChunk;\n\n // There are multiple forms in which the pixel data can be passed, and\n // imgData.kind tells us which one this is.\n if (imgData.kind === ImageKind.GRAYSCALE_1BPP) {\n // Grayscale, 1 bit per pixel (i.e. black-and-white).\n const srcLength = src.byteLength;\n const dest32 = new Uint32Array(dest.buffer, 0, dest.byteLength >> 2);\n const dest32DataLength = dest32.length;\n const fullSrcDiff = (width + 7) >> 3;\n const white = 0xffffffff;\n const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n\n for (i = 0; i < totalChunks; i++) {\n thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n destPos = 0;\n for (j = 0; j < thisChunkHeight; j++) {\n const srcDiff = srcLength - srcPos;\n let k = 0;\n const kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7;\n const kEndUnrolled = kEnd & ~7;\n let mask = 0;\n let srcByte = 0;\n for (; k < kEndUnrolled; k += 8) {\n srcByte = src[srcPos++];\n dest32[destPos++] = srcByte & 128 ? white : black;\n dest32[destPos++] = srcByte & 64 ? white : black;\n dest32[destPos++] = srcByte & 32 ? white : black;\n dest32[destPos++] = srcByte & 16 ? white : black;\n dest32[destPos++] = srcByte & 8 ? white : black;\n dest32[destPos++] = srcByte & 4 ? white : black;\n dest32[destPos++] = srcByte & 2 ? white : black;\n dest32[destPos++] = srcByte & 1 ? white : black;\n }\n for (; k < kEnd; k++) {\n if (mask === 0) {\n srcByte = src[srcPos++];\n mask = 128;\n }\n\n dest32[destPos++] = srcByte & mask ? white : black;\n mask >>= 1;\n }\n }\n // We ran out of input. Make all remaining pixels transparent.\n while (destPos < dest32DataLength) {\n dest32[destPos++] = 0;\n }\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else if (imgData.kind === ImageKind.RGBA_32BPP) {\n // RGBA, 32-bits per pixel.\n j = 0;\n elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4;\n for (i = 0; i < fullChunks; i++) {\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n srcPos += elemsInThisChunk;\n\n ctx.putImageData(chunkImgData, 0, j);\n j += FULL_CHUNK_HEIGHT;\n }\n if (i < totalChunks) {\n elemsInThisChunk = width * partialChunkHeight * 4;\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n\n ctx.putImageData(chunkImgData, 0, j);\n }\n } else if (imgData.kind === ImageKind.RGB_24BPP) {\n // RGB, 24-bits per pixel.\n thisChunkHeight = FULL_CHUNK_HEIGHT;\n elemsInThisChunk = width * thisChunkHeight;\n for (i = 0; i < totalChunks; i++) {\n if (i >= fullChunks) {\n thisChunkHeight = partialChunkHeight;\n elemsInThisChunk = width * thisChunkHeight;\n }\n\n destPos = 0;\n for (j = elemsInThisChunk; j--; ) {\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = 255;\n }\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else {\n throw new Error(`bad image kind: ${imgData.kind}`);\n }\n}\n\nfunction putBinaryImageMask(ctx, imgData) {\n if (imgData.bitmap) {\n // The bitmap has been created in the worker.\n ctx.drawImage(imgData.bitmap, 0, 0);\n return;\n }\n\n // Slow path: OffscreenCanvas isn't available in the worker.\n const height = imgData.height,\n width = imgData.width;\n const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n\n const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n let srcPos = 0;\n const src = imgData.data;\n const dest = chunkImgData.data;\n\n for (let i = 0; i < totalChunks; i++) {\n const thisChunkHeight =\n i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n\n // Expand the mask so it can be used by the canvas. Any required\n // inversion has already been handled.\n\n ({ srcPos } = convertBlackAndWhiteToRGBA({\n src,\n srcPos,\n dest,\n width,\n height: thisChunkHeight,\n nonBlackColor: 0,\n }));\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n}\n\nfunction copyCtxState(sourceCtx, destCtx) {\n const properties = [\n \"strokeStyle\",\n \"fillStyle\",\n \"fillRule\",\n \"globalAlpha\",\n \"lineWidth\",\n \"lineCap\",\n \"lineJoin\",\n \"miterLimit\",\n \"globalCompositeOperation\",\n \"font\",\n \"filter\",\n ];\n for (const property of properties) {\n if (sourceCtx[property] !== undefined) {\n destCtx[property] = sourceCtx[property];\n }\n }\n if (sourceCtx.setLineDash !== undefined) {\n destCtx.setLineDash(sourceCtx.getLineDash());\n destCtx.lineDashOffset = sourceCtx.lineDashOffset;\n }\n}\n\nfunction resetCtxToDefault(ctx) {\n ctx.strokeStyle = ctx.fillStyle = \"#000000\";\n ctx.fillRule = \"nonzero\";\n ctx.globalAlpha = 1;\n ctx.lineWidth = 1;\n ctx.lineCap = \"butt\";\n ctx.lineJoin = \"miter\";\n ctx.miterLimit = 10;\n ctx.globalCompositeOperation = \"source-over\";\n ctx.font = \"10px sans-serif\";\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash([]);\n ctx.lineDashOffset = 0;\n }\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n !isNodeJS\n ) {\n const { filter } = ctx;\n if (filter !== \"none\" && filter !== \"\") {\n ctx.filter = \"none\";\n }\n }\n}\n\nfunction getImageSmoothingEnabled(transform, interpolate) {\n // In section 8.9.5.3 of the PDF spec, it's mentioned that the interpolate\n // flag should be used when the image is upscaled.\n // In Firefox, smoothing is always used when downscaling images (bug 1360415).\n\n if (interpolate) {\n return true;\n }\n\n const scale = Util.singularValueDecompose2dScale(transform);\n // Round to a 32bit float so that `<=` check below will pass for numbers that\n // are very close, but not exactly the same 64bit floats.\n scale[0] = Math.fround(scale[0]);\n scale[1] = Math.fround(scale[1]);\n const actualScale = Math.fround(\n (globalThis.devicePixelRatio || 1) * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n return scale[0] <= actualScale && scale[1] <= actualScale;\n}\n\nconst LINE_CAP_STYLES = [\"butt\", \"round\", \"square\"];\nconst LINE_JOIN_STYLES = [\"miter\", \"round\", \"bevel\"];\nconst NORMAL_CLIP = {};\nconst EO_CLIP = {};\n\nclass CanvasGraphics {\n constructor(\n canvasCtx,\n commonObjs,\n objs,\n canvasFactory,\n filterFactory,\n { optionalContentConfig, markedContentStack = null },\n annotationCanvasMap,\n pageColors\n ) {\n this.ctx = canvasCtx;\n this.current = new CanvasExtraState(\n this.ctx.canvas.width,\n this.ctx.canvas.height\n );\n this.stateStack = [];\n this.pendingClip = null;\n this.pendingEOFill = false;\n this.res = null;\n this.xobjs = null;\n this.commonObjs = commonObjs;\n this.objs = objs;\n this.canvasFactory = canvasFactory;\n this.filterFactory = filterFactory;\n this.groupStack = [];\n this.processingType3 = null;\n // Patterns are painted relative to the initial page/form transform, see\n // PDF spec 8.7.2 NOTE 1.\n this.baseTransform = null;\n this.baseTransformStack = [];\n this.groupLevel = 0;\n this.smaskStack = [];\n this.smaskCounter = 0;\n this.tempSMask = null;\n this.suspendedCtx = null;\n this.contentVisible = true;\n this.markedContentStack = markedContentStack || [];\n this.optionalContentConfig = optionalContentConfig;\n this.cachedCanvases = new CachedCanvases(this.canvasFactory);\n this.cachedPatterns = new Map();\n this.annotationCanvasMap = annotationCanvasMap;\n this.viewportScale = 1;\n this.outputScaleX = 1;\n this.outputScaleY = 1;\n this.pageColors = pageColors;\n\n this._cachedScaleForStroking = [-1, 0];\n this._cachedGetSinglePixelWidth = null;\n this._cachedBitmapsMap = new Map();\n }\n\n getObject(data, fallback = null) {\n if (typeof data === \"string\") {\n return data.startsWith(\"g_\")\n ? this.commonObjs.get(data)\n : this.objs.get(data);\n }\n return fallback;\n }\n\n beginDrawing({\n transform,\n viewport,\n transparency = false,\n background = null,\n }) {\n // For pdfs that use blend modes we have to clear the canvas else certain\n // blend modes can look wrong since we'd be blending with a white\n // backdrop. The problem with a transparent backdrop though is we then\n // don't get sub pixel anti aliasing on text, creating temporary\n // transparent canvas when we have blend modes.\n const width = this.ctx.canvas.width;\n const height = this.ctx.canvas.height;\n\n const savedFillStyle = this.ctx.fillStyle;\n this.ctx.fillStyle = background || \"#ffffff\";\n this.ctx.fillRect(0, 0, width, height);\n this.ctx.fillStyle = savedFillStyle;\n\n if (transparency) {\n const transparentCanvas = this.cachedCanvases.getCanvas(\n \"transparent\",\n width,\n height\n );\n this.compositeCtx = this.ctx;\n this.transparentCanvas = transparentCanvas.canvas;\n this.ctx = transparentCanvas.context;\n this.ctx.save();\n // The transform can be applied before rendering, transferring it to\n // the new canvas.\n this.ctx.transform(...getCurrentTransform(this.compositeCtx));\n }\n\n this.ctx.save();\n resetCtxToDefault(this.ctx);\n if (transform) {\n this.ctx.transform(...transform);\n this.outputScaleX = transform[0];\n this.outputScaleY = transform[0];\n }\n this.ctx.transform(...viewport.transform);\n this.viewportScale = viewport.scale;\n\n this.baseTransform = getCurrentTransform(this.ctx);\n }\n\n executeOperatorList(\n operatorList,\n executionStartIdx,\n continueCallback,\n stepper\n ) {\n const argsArray = operatorList.argsArray;\n const fnArray = operatorList.fnArray;\n let i = executionStartIdx || 0;\n const argsArrayLen = argsArray.length;\n\n // Sometimes the OperatorList to execute is empty.\n if (argsArrayLen === i) {\n return i;\n }\n\n const chunkOperations =\n argsArrayLen - i > EXECUTION_STEPS &&\n typeof continueCallback === \"function\";\n const endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0;\n let steps = 0;\n\n const commonObjs = this.commonObjs;\n const objs = this.objs;\n let fnId;\n\n while (true) {\n if (stepper !== undefined && i === stepper.nextBreakPoint) {\n stepper.breakIt(i, continueCallback);\n return i;\n }\n\n fnId = fnArray[i];\n\n if (fnId !== OPS.dependency) {\n // eslint-disable-next-line prefer-spread\n this[fnId].apply(this, argsArray[i]);\n } else {\n for (const depObjId of argsArray[i]) {\n const objsPool = depObjId.startsWith(\"g_\") ? commonObjs : objs;\n\n // If the promise isn't resolved yet, add the continueCallback\n // to the promise and bail out.\n if (!objsPool.has(depObjId)) {\n objsPool.get(depObjId, continueCallback);\n return i;\n }\n }\n }\n\n i++;\n\n // If the entire operatorList was executed, stop as were done.\n if (i === argsArrayLen) {\n return i;\n }\n\n // If the execution took longer then a certain amount of time and\n // `continueCallback` is specified, interrupt the execution.\n if (chunkOperations && ++steps > EXECUTION_STEPS) {\n if (Date.now() > endTime) {\n continueCallback();\n return i;\n }\n steps = 0;\n }\n\n // If the operatorList isn't executed completely yet OR the execution\n // time was short enough, do another execution round.\n }\n }\n\n #restoreInitialState() {\n // Finishing all opened operations such as SMask group painting.\n while (this.stateStack.length || this.inSMaskMode) {\n this.restore();\n }\n\n this.current.activeSMask = null;\n this.ctx.restore();\n\n if (this.transparentCanvas) {\n this.ctx = this.compositeCtx;\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0); // Avoid apply transform twice\n this.ctx.drawImage(this.transparentCanvas, 0, 0);\n this.ctx.restore();\n this.transparentCanvas = null;\n }\n }\n\n endDrawing() {\n this.#restoreInitialState();\n\n this.cachedCanvases.clear();\n this.cachedPatterns.clear();\n\n for (const cache of this._cachedBitmapsMap.values()) {\n for (const canvas of cache.values()) {\n if (\n typeof HTMLCanvasElement !== \"undefined\" &&\n canvas instanceof HTMLCanvasElement\n ) {\n canvas.width = canvas.height = 0;\n }\n }\n cache.clear();\n }\n this._cachedBitmapsMap.clear();\n this.#drawFilter();\n }\n\n #drawFilter() {\n if (this.pageColors) {\n const hcmFilterId = this.filterFactory.addHCMFilter(\n this.pageColors.foreground,\n this.pageColors.background\n );\n if (hcmFilterId !== \"none\") {\n const savedFilter = this.ctx.filter;\n this.ctx.filter = hcmFilterId;\n this.ctx.drawImage(this.ctx.canvas, 0, 0);\n this.ctx.filter = savedFilter;\n }\n }\n }\n\n _scaleImage(img, inverseTransform) {\n // Vertical or horizontal scaling shall not be more than 2 to not lose the\n // pixels during drawImage operation, painting on the temporary canvas(es)\n // that are twice smaller in size.\n\n // displayWidth and displayHeight are used for VideoFrame.\n const width = img.width ?? img.displayWidth;\n const height = img.height ?? img.displayHeight;\n let widthScale = Math.max(\n Math.hypot(inverseTransform[0], inverseTransform[1]),\n 1\n );\n let heightScale = Math.max(\n Math.hypot(inverseTransform[2], inverseTransform[3]),\n 1\n );\n\n let paintWidth = width,\n paintHeight = height;\n let tmpCanvasId = \"prescale1\";\n let tmpCanvas, tmpCtx;\n while (\n (widthScale > 2 && paintWidth > 1) ||\n (heightScale > 2 && paintHeight > 1)\n ) {\n let newWidth = paintWidth,\n newHeight = paintHeight;\n if (widthScale > 2 && paintWidth > 1) {\n // See bug 1820511 (Windows specific bug).\n // TODO: once the above bug is fixed we could revert to:\n // newWidth = Math.ceil(paintWidth / 2);\n newWidth =\n paintWidth >= 16384\n ? Math.floor(paintWidth / 2) - 1 || 1\n : Math.ceil(paintWidth / 2);\n widthScale /= paintWidth / newWidth;\n }\n if (heightScale > 2 && paintHeight > 1) {\n // TODO: see the comment above.\n newHeight =\n paintHeight >= 16384\n ? Math.floor(paintHeight / 2) - 1 || 1\n : Math.ceil(paintHeight) / 2;\n heightScale /= paintHeight / newHeight;\n }\n tmpCanvas = this.cachedCanvases.getCanvas(\n tmpCanvasId,\n newWidth,\n newHeight\n );\n tmpCtx = tmpCanvas.context;\n tmpCtx.clearRect(0, 0, newWidth, newHeight);\n tmpCtx.drawImage(\n img,\n 0,\n 0,\n paintWidth,\n paintHeight,\n 0,\n 0,\n newWidth,\n newHeight\n );\n img = tmpCanvas.canvas;\n paintWidth = newWidth;\n paintHeight = newHeight;\n tmpCanvasId = tmpCanvasId === \"prescale1\" ? \"prescale2\" : \"prescale1\";\n }\n return {\n img,\n paintWidth,\n paintHeight,\n };\n }\n\n _createMaskCanvas(img) {\n const ctx = this.ctx;\n const { width, height } = img;\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n const currentTransform = getCurrentTransform(ctx);\n\n let cache, cacheKey, scaled, maskCanvas;\n if ((img.bitmap || img.data) && img.count > 1) {\n const mainKey = img.bitmap || img.data.buffer;\n // We're reusing the same image several times, so we can cache it.\n // In case we've a pattern fill we just keep the scaled version of\n // the image.\n // Only the scaling part matters, the translation part is just used\n // to compute offsets (but not when filling patterns see #15573).\n // TODO: handle the case of a pattern fill if it's possible.\n cacheKey = JSON.stringify(\n isPatternFill\n ? currentTransform\n : [currentTransform.slice(0, 4), fillColor]\n );\n\n cache = this._cachedBitmapsMap.get(mainKey);\n if (!cache) {\n cache = new Map();\n this._cachedBitmapsMap.set(mainKey, cache);\n }\n const cachedImage = cache.get(cacheKey);\n if (cachedImage && !isPatternFill) {\n const offsetX = Math.round(\n Math.min(currentTransform[0], currentTransform[2]) +\n currentTransform[4]\n );\n const offsetY = Math.round(\n Math.min(currentTransform[1], currentTransform[3]) +\n currentTransform[5]\n );\n return {\n canvas: cachedImage,\n offsetX,\n offsetY,\n };\n }\n scaled = cachedImage;\n }\n\n if (!scaled) {\n maskCanvas = this.cachedCanvases.getCanvas(\"maskCanvas\", width, height);\n putBinaryImageMask(maskCanvas.context, img);\n }\n\n // Create the mask canvas at the size it will be drawn at and also set\n // its transform to match the current transform so if there are any\n // patterns applied they will be applied relative to the correct\n // transform.\n\n let maskToCanvas = Util.transform(currentTransform, [\n 1 / width,\n 0,\n 0,\n -1 / height,\n 0,\n 0,\n ]);\n maskToCanvas = Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]);\n const [minX, minY, maxX, maxY] = Util.getAxialAlignedBoundingBox(\n [0, 0, width, height],\n maskToCanvas\n );\n const drawnWidth = Math.round(maxX - minX) || 1;\n const drawnHeight = Math.round(maxY - minY) || 1;\n const fillCanvas = this.cachedCanvases.getCanvas(\n \"fillCanvas\",\n drawnWidth,\n drawnHeight\n );\n const fillCtx = fillCanvas.context;\n\n // The offset will be the top-left cordinate mask.\n // If objToCanvas is [a,b,c,d,e,f] then:\n // - offsetX = min(a, c) + e\n // - offsetY = min(b, d) + f\n const offsetX = minX;\n const offsetY = minY;\n fillCtx.translate(-offsetX, -offsetY);\n fillCtx.transform(...maskToCanvas);\n\n if (!scaled) {\n // Pre-scale if needed to improve image smoothing.\n scaled = this._scaleImage(\n maskCanvas.canvas,\n getCurrentTransformInverse(fillCtx)\n );\n scaled = scaled.img;\n if (cache && isPatternFill) {\n cache.set(cacheKey, scaled);\n }\n }\n\n fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(\n getCurrentTransform(fillCtx),\n img.interpolate\n );\n\n drawImageAtIntegerCoords(\n fillCtx,\n scaled,\n 0,\n 0,\n scaled.width,\n scaled.height,\n 0,\n 0,\n width,\n height\n );\n fillCtx.globalCompositeOperation = \"source-in\";\n\n const inverse = Util.transform(getCurrentTransformInverse(fillCtx), [\n 1,\n 0,\n 0,\n 1,\n -offsetX,\n -offsetY,\n ]);\n fillCtx.fillStyle = isPatternFill\n ? fillColor.getPattern(ctx, this, inverse, PathType.FILL)\n : fillColor;\n\n fillCtx.fillRect(0, 0, width, height);\n\n if (cache && !isPatternFill) {\n // The fill canvas is put in the cache associated to the mask image\n // so we must remove from the cached canvas: it mustn't be used again.\n this.cachedCanvases.delete(\"fillCanvas\");\n cache.set(cacheKey, fillCanvas.canvas);\n }\n\n // Round the offsets to avoid drawing fractional pixels.\n return {\n canvas: fillCanvas.canvas,\n offsetX: Math.round(offsetX),\n offsetY: Math.round(offsetY),\n };\n }\n\n // Graphics state\n setLineWidth(width) {\n if (width !== this.current.lineWidth) {\n this._cachedScaleForStroking[0] = -1;\n }\n this.current.lineWidth = width;\n this.ctx.lineWidth = width;\n }\n\n setLineCap(style) {\n this.ctx.lineCap = LINE_CAP_STYLES[style];\n }\n\n setLineJoin(style) {\n this.ctx.lineJoin = LINE_JOIN_STYLES[style];\n }\n\n setMiterLimit(limit) {\n this.ctx.miterLimit = limit;\n }\n\n setDash(dashArray, dashPhase) {\n const ctx = this.ctx;\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash(dashArray);\n ctx.lineDashOffset = dashPhase;\n }\n }\n\n setRenderingIntent(intent) {\n // This operation is ignored since we haven't found a use case for it yet.\n }\n\n setFlatness(flatness) {\n // This operation is ignored since we haven't found a use case for it yet.\n }\n\n setGState(states) {\n for (const [key, value] of states) {\n switch (key) {\n case \"LW\":\n this.setLineWidth(value);\n break;\n case \"LC\":\n this.setLineCap(value);\n break;\n case \"LJ\":\n this.setLineJoin(value);\n break;\n case \"ML\":\n this.setMiterLimit(value);\n break;\n case \"D\":\n this.setDash(value[0], value[1]);\n break;\n case \"RI\":\n this.setRenderingIntent(value);\n break;\n case \"FL\":\n this.setFlatness(value);\n break;\n case \"Font\":\n this.setFont(value[0], value[1]);\n break;\n case \"CA\":\n this.current.strokeAlpha = value;\n break;\n case \"ca\":\n this.current.fillAlpha = value;\n this.ctx.globalAlpha = value;\n break;\n case \"BM\":\n this.ctx.globalCompositeOperation = value;\n break;\n case \"SMask\":\n this.current.activeSMask = value ? this.tempSMask : null;\n this.tempSMask = null;\n this.checkSMaskState();\n break;\n case \"TR\":\n this.ctx.filter = this.current.transferMaps =\n this.filterFactory.addFilter(value);\n break;\n }\n }\n }\n\n get inSMaskMode() {\n return !!this.suspendedCtx;\n }\n\n checkSMaskState() {\n const inSMaskMode = this.inSMaskMode;\n if (this.current.activeSMask && !inSMaskMode) {\n this.beginSMaskMode();\n } else if (!this.current.activeSMask && inSMaskMode) {\n this.endSMaskMode();\n }\n // Else, the state is okay and nothing needs to be done.\n }\n\n /**\n * Soft mask mode takes the current main drawing canvas and replaces it with\n * a temporary canvas. Any drawing operations that happen on the temporary\n * canvas need to be composed with the main canvas that was suspended (see\n * `compose()`). The temporary canvas also duplicates many of its operations\n * on the suspended canvas to keep them in sync, so that when the soft mask\n * mode ends any clipping paths or transformations will still be active and in\n * the right order on the canvas' graphics state stack.\n */\n beginSMaskMode() {\n if (this.inSMaskMode) {\n throw new Error(\"beginSMaskMode called while already in smask mode\");\n }\n const drawnWidth = this.ctx.canvas.width;\n const drawnHeight = this.ctx.canvas.height;\n const cacheId = \"smaskGroupAt\" + this.groupLevel;\n const scratchCanvas = this.cachedCanvases.getCanvas(\n cacheId,\n drawnWidth,\n drawnHeight\n );\n this.suspendedCtx = this.ctx;\n this.ctx = scratchCanvas.context;\n const ctx = this.ctx;\n ctx.setTransform(...getCurrentTransform(this.suspendedCtx));\n copyCtxState(this.suspendedCtx, ctx);\n mirrorContextOperations(ctx, this.suspendedCtx);\n\n this.setGState([\n [\"BM\", \"source-over\"],\n [\"ca\", 1],\n [\"CA\", 1],\n ]);\n }\n\n endSMaskMode() {\n if (!this.inSMaskMode) {\n throw new Error(\"endSMaskMode called while not in smask mode\");\n }\n // The soft mask is done, now restore the suspended canvas as the main\n // drawing canvas.\n this.ctx._removeMirroring();\n copyCtxState(this.ctx, this.suspendedCtx);\n this.ctx = this.suspendedCtx;\n\n this.suspendedCtx = null;\n }\n\n compose(dirtyBox) {\n if (!this.current.activeSMask) {\n return;\n }\n\n if (!dirtyBox) {\n dirtyBox = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];\n } else {\n dirtyBox[0] = Math.floor(dirtyBox[0]);\n dirtyBox[1] = Math.floor(dirtyBox[1]);\n dirtyBox[2] = Math.ceil(dirtyBox[2]);\n dirtyBox[3] = Math.ceil(dirtyBox[3]);\n }\n const smask = this.current.activeSMask;\n const suspendedCtx = this.suspendedCtx;\n\n this.composeSMask(suspendedCtx, smask, this.ctx, dirtyBox);\n // Whatever was drawn has been moved to the suspended canvas, now clear it\n // out of the current canvas.\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0);\n this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);\n this.ctx.restore();\n }\n\n composeSMask(ctx, smask, layerCtx, layerBox) {\n const layerOffsetX = layerBox[0];\n const layerOffsetY = layerBox[1];\n const layerWidth = layerBox[2] - layerOffsetX;\n const layerHeight = layerBox[3] - layerOffsetY;\n if (layerWidth === 0 || layerHeight === 0) {\n return;\n }\n this.genericComposeSMask(\n smask.context,\n layerCtx,\n layerWidth,\n layerHeight,\n smask.subtype,\n smask.backdrop,\n smask.transferMap,\n layerOffsetX,\n layerOffsetY,\n smask.offsetX,\n smask.offsetY\n );\n ctx.save();\n ctx.globalAlpha = 1;\n ctx.globalCompositeOperation = \"source-over\";\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(layerCtx.canvas, 0, 0);\n ctx.restore();\n }\n\n genericComposeSMask(\n maskCtx,\n layerCtx,\n width,\n height,\n subtype,\n backdrop,\n transferMap,\n layerOffsetX,\n layerOffsetY,\n maskOffsetX,\n maskOffsetY\n ) {\n let maskCanvas = maskCtx.canvas;\n let maskX = layerOffsetX - maskOffsetX;\n let maskY = layerOffsetY - maskOffsetY;\n\n if (backdrop) {\n const backdropRGB = Util.makeHexColor(...backdrop);\n if (\n maskX < 0 ||\n maskY < 0 ||\n maskX + width > maskCanvas.width ||\n maskY + height > maskCanvas.height\n ) {\n const canvas = this.cachedCanvases.getCanvas(\n \"maskExtension\",\n width,\n height\n );\n const ctx = canvas.context;\n ctx.drawImage(maskCanvas, -maskX, -maskY);\n ctx.globalCompositeOperation = \"destination-atop\";\n ctx.fillStyle = backdropRGB;\n ctx.fillRect(0, 0, width, height);\n ctx.globalCompositeOperation = \"source-over\";\n\n maskCanvas = canvas.canvas;\n maskX = maskY = 0;\n } else {\n maskCtx.save();\n maskCtx.globalAlpha = 1;\n maskCtx.setTransform(1, 0, 0, 1, 0, 0);\n const clip = new Path2D();\n clip.rect(maskX, maskY, width, height);\n maskCtx.clip(clip);\n maskCtx.globalCompositeOperation = \"destination-atop\";\n maskCtx.fillStyle = backdropRGB;\n maskCtx.fillRect(maskX, maskY, width, height);\n maskCtx.restore();\n }\n }\n\n layerCtx.save();\n layerCtx.globalAlpha = 1;\n layerCtx.setTransform(1, 0, 0, 1, 0, 0);\n\n if (subtype === \"Alpha\" && transferMap) {\n layerCtx.filter = this.filterFactory.addAlphaFilter(transferMap);\n } else if (subtype === \"Luminosity\") {\n layerCtx.filter = this.filterFactory.addLuminosityFilter(transferMap);\n }\n\n const clip = new Path2D();\n clip.rect(layerOffsetX, layerOffsetY, width, height);\n layerCtx.clip(clip);\n layerCtx.globalCompositeOperation = \"destination-in\";\n layerCtx.drawImage(\n maskCanvas,\n maskX,\n maskY,\n width,\n height,\n layerOffsetX,\n layerOffsetY,\n width,\n height\n );\n layerCtx.restore();\n }\n\n save() {\n if (this.inSMaskMode) {\n // SMask mode may be turned on/off causing us to lose graphics state.\n // Copy the temporary canvas state to the main(suspended) canvas to keep\n // it in sync.\n copyCtxState(this.ctx, this.suspendedCtx);\n // Don't bother calling save on the temporary canvas since state is not\n // saved there.\n this.suspendedCtx.save();\n } else {\n this.ctx.save();\n }\n const old = this.current;\n this.stateStack.push(old);\n this.current = old.clone();\n }\n\n restore() {\n if (this.stateStack.length === 0 && this.inSMaskMode) {\n this.endSMaskMode();\n }\n if (this.stateStack.length !== 0) {\n this.current = this.stateStack.pop();\n if (this.inSMaskMode) {\n // Graphics state is stored on the main(suspended) canvas. Restore its\n // state then copy it over to the temporary canvas.\n this.suspendedCtx.restore();\n copyCtxState(this.suspendedCtx, this.ctx);\n } else {\n this.ctx.restore();\n }\n this.checkSMaskState();\n\n // Ensure that the clipping path is reset (fixes issue6413.pdf).\n this.pendingClip = null;\n\n this._cachedScaleForStroking[0] = -1;\n this._cachedGetSinglePixelWidth = null;\n }\n }\n\n transform(a, b, c, d, e, f) {\n this.ctx.transform(a, b, c, d, e, f);\n\n this._cachedScaleForStroking[0] = -1;\n this._cachedGetSinglePixelWidth = null;\n }\n\n // Path\n constructPath(ops, args, minMax) {\n const ctx = this.ctx;\n const current = this.current;\n let x = current.x,\n y = current.y;\n let startX, startY;\n const currentTransform = getCurrentTransform(ctx);\n\n // Most of the time the current transform is a scaling matrix\n // so we don't need to transform points before computing min/max:\n // we can compute min/max first and then smartly \"apply\" the\n // transform (see Util.scaleMinMax).\n // For rectangle, moveTo and lineTo, min/max are computed in the\n // worker (see evaluator.js).\n const isScalingMatrix =\n (currentTransform[0] === 0 && currentTransform[3] === 0) ||\n (currentTransform[1] === 0 && currentTransform[2] === 0);\n const minMaxForBezier = isScalingMatrix ? minMax.slice(0) : null;\n\n for (let i = 0, j = 0, ii = ops.length; i < ii; i++) {\n switch (ops[i] | 0) {\n case OPS.rectangle:\n x = args[j++];\n y = args[j++];\n const width = args[j++];\n const height = args[j++];\n\n const xw = x + width;\n const yh = y + height;\n ctx.moveTo(x, y);\n if (width === 0 || height === 0) {\n ctx.lineTo(xw, yh);\n } else {\n ctx.lineTo(xw, y);\n ctx.lineTo(xw, yh);\n ctx.lineTo(x, yh);\n }\n if (!isScalingMatrix) {\n current.updateRectMinMax(currentTransform, [x, y, xw, yh]);\n }\n ctx.closePath();\n break;\n case OPS.moveTo:\n x = args[j++];\n y = args[j++];\n ctx.moveTo(x, y);\n if (!isScalingMatrix) {\n current.updatePathMinMax(currentTransform, x, y);\n }\n break;\n case OPS.lineTo:\n x = args[j++];\n y = args[j++];\n ctx.lineTo(x, y);\n if (!isScalingMatrix) {\n current.updatePathMinMax(currentTransform, x, y);\n }\n break;\n case OPS.curveTo:\n startX = x;\n startY = y;\n x = args[j + 4];\n y = args[j + 5];\n ctx.bezierCurveTo(\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3],\n x,\n y\n );\n current.updateCurvePathMinMax(\n currentTransform,\n startX,\n startY,\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3],\n x,\n y,\n minMaxForBezier\n );\n j += 6;\n break;\n case OPS.curveTo2:\n startX = x;\n startY = y;\n ctx.bezierCurveTo(\n x,\n y,\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3]\n );\n current.updateCurvePathMinMax(\n currentTransform,\n startX,\n startY,\n x,\n y,\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3],\n minMaxForBezier\n );\n x = args[j + 2];\n y = args[j + 3];\n j += 4;\n break;\n case OPS.curveTo3:\n startX = x;\n startY = y;\n x = args[j + 2];\n y = args[j + 3];\n ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y);\n current.updateCurvePathMinMax(\n currentTransform,\n startX,\n startY,\n args[j],\n args[j + 1],\n x,\n y,\n x,\n y,\n minMaxForBezier\n );\n j += 4;\n break;\n case OPS.closePath:\n ctx.closePath();\n break;\n }\n }\n\n if (isScalingMatrix) {\n current.updateScalingPathMinMax(currentTransform, minMaxForBezier);\n }\n\n current.setCurrentPoint(x, y);\n }\n\n closePath() {\n this.ctx.closePath();\n }\n\n stroke(consumePath = true) {\n const ctx = this.ctx;\n const strokeColor = this.current.strokeColor;\n // For stroke we want to temporarily change the global alpha to the\n // stroking alpha.\n ctx.globalAlpha = this.current.strokeAlpha;\n if (this.contentVisible) {\n if (typeof strokeColor === \"object\" && strokeColor?.getPattern) {\n ctx.save();\n ctx.strokeStyle = strokeColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.STROKE\n );\n this.rescaleAndStroke(/* saveRestore */ false);\n ctx.restore();\n } else {\n this.rescaleAndStroke(/* saveRestore */ true);\n }\n }\n if (consumePath) {\n this.consumePath(this.current.getClippedPathBoundingBox());\n }\n // Restore the global alpha to the fill alpha\n ctx.globalAlpha = this.current.fillAlpha;\n }\n\n closeStroke() {\n this.closePath();\n this.stroke();\n }\n\n fill(consumePath = true) {\n const ctx = this.ctx;\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n let needRestore = false;\n\n if (isPatternFill) {\n ctx.save();\n ctx.fillStyle = fillColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL\n );\n needRestore = true;\n }\n\n const intersect = this.current.getClippedPathBoundingBox();\n if (this.contentVisible && intersect !== null) {\n if (this.pendingEOFill) {\n ctx.fill(\"evenodd\");\n this.pendingEOFill = false;\n } else {\n ctx.fill();\n }\n }\n\n if (needRestore) {\n ctx.restore();\n }\n if (consumePath) {\n this.consumePath(intersect);\n }\n }\n\n eoFill() {\n this.pendingEOFill = true;\n this.fill();\n }\n\n fillStroke() {\n this.fill(false);\n this.stroke(false);\n\n this.consumePath();\n }\n\n eoFillStroke() {\n this.pendingEOFill = true;\n this.fillStroke();\n }\n\n closeFillStroke() {\n this.closePath();\n this.fillStroke();\n }\n\n closeEOFillStroke() {\n this.pendingEOFill = true;\n this.closePath();\n this.fillStroke();\n }\n\n endPath() {\n this.consumePath();\n }\n\n // Clipping\n clip() {\n this.pendingClip = NORMAL_CLIP;\n }\n\n eoClip() {\n this.pendingClip = EO_CLIP;\n }\n\n // Text\n beginText() {\n this.current.textMatrix = IDENTITY_MATRIX;\n this.current.textMatrixScale = 1;\n this.current.x = this.current.lineX = 0;\n this.current.y = this.current.lineY = 0;\n }\n\n endText() {\n const paths = this.pendingTextPaths;\n const ctx = this.ctx;\n if (paths === undefined) {\n ctx.beginPath();\n return;\n }\n\n ctx.save();\n ctx.beginPath();\n for (const path of paths) {\n ctx.setTransform(...path.transform);\n ctx.translate(path.x, path.y);\n path.addToPath(ctx, path.fontSize);\n }\n ctx.restore();\n ctx.clip();\n ctx.beginPath();\n delete this.pendingTextPaths;\n }\n\n setCharSpacing(spacing) {\n this.current.charSpacing = spacing;\n }\n\n setWordSpacing(spacing) {\n this.current.wordSpacing = spacing;\n }\n\n setHScale(scale) {\n this.current.textHScale = scale / 100;\n }\n\n setLeading(leading) {\n this.current.leading = -leading;\n }\n\n setFont(fontRefName, size) {\n const fontObj = this.commonObjs.get(fontRefName);\n const current = this.current;\n\n if (!fontObj) {\n throw new Error(`Can't find font for ${fontRefName}`);\n }\n current.fontMatrix = fontObj.fontMatrix || FONT_IDENTITY_MATRIX;\n\n // A valid matrix needs all main diagonal elements to be non-zero\n // This also ensures we bypass FF bugzilla bug #719844.\n if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) {\n warn(\"Invalid font matrix for font \" + fontRefName);\n }\n\n // The spec for Tf (setFont) says that 'size' specifies the font 'scale',\n // and in some docs this can be negative (inverted x-y axes).\n if (size < 0) {\n size = -size;\n current.fontDirection = -1;\n } else {\n current.fontDirection = 1;\n }\n\n this.current.font = fontObj;\n this.current.fontSize = size;\n\n if (fontObj.isType3Font) {\n return; // we don't need ctx.font for Type3 fonts\n }\n\n const name = fontObj.loadedName || \"sans-serif\";\n const typeface =\n fontObj.systemFontInfo?.css || `\"${name}\", ${fontObj.fallbackName}`;\n\n let bold = \"normal\";\n if (fontObj.black) {\n bold = \"900\";\n } else if (fontObj.bold) {\n bold = \"bold\";\n }\n const italic = fontObj.italic ? \"italic\" : \"normal\";\n\n // Some font backends cannot handle fonts below certain size.\n // Keeping the font at minimal size and using the fontSizeScale to change\n // the current transformation matrix before the fillText/strokeText.\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=726227\n let browserFontSize = size;\n if (size < MIN_FONT_SIZE) {\n browserFontSize = MIN_FONT_SIZE;\n } else if (size > MAX_FONT_SIZE) {\n browserFontSize = MAX_FONT_SIZE;\n }\n this.current.fontSizeScale = size / browserFontSize;\n\n this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`;\n }\n\n setTextRenderingMode(mode) {\n this.current.textRenderingMode = mode;\n }\n\n setTextRise(rise) {\n this.current.textRise = rise;\n }\n\n moveText(x, y) {\n this.current.x = this.current.lineX += x;\n this.current.y = this.current.lineY += y;\n }\n\n setLeadingMoveText(x, y) {\n this.setLeading(-y);\n this.moveText(x, y);\n }\n\n setTextMatrix(a, b, c, d, e, f) {\n this.current.textMatrix = [a, b, c, d, e, f];\n this.current.textMatrixScale = Math.hypot(a, b);\n\n this.current.x = this.current.lineX = 0;\n this.current.y = this.current.lineY = 0;\n }\n\n nextLine() {\n this.moveText(0, this.current.leading);\n }\n\n paintChar(character, x, y, patternTransform) {\n const ctx = this.ctx;\n const current = this.current;\n const font = current.font;\n const textRenderingMode = current.textRenderingMode;\n const fontSize = current.fontSize / current.fontSizeScale;\n const fillStrokeMode =\n textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;\n const isAddToPathSet = !!(\n textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG\n );\n const patternFill = current.patternFill && !font.missingFile;\n\n let addToPath;\n if (font.disableFontFace || isAddToPathSet || patternFill) {\n addToPath = font.getPathGenerator(this.commonObjs, character);\n }\n\n if (font.disableFontFace || patternFill) {\n ctx.save();\n ctx.translate(x, y);\n ctx.beginPath();\n addToPath(ctx, fontSize);\n if (patternTransform) {\n ctx.setTransform(...patternTransform);\n }\n if (\n fillStrokeMode === TextRenderingMode.FILL ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.fill();\n }\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.stroke();\n }\n ctx.restore();\n } else {\n if (\n fillStrokeMode === TextRenderingMode.FILL ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.fillText(character, x, y);\n }\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.strokeText(character, x, y);\n }\n }\n\n if (isAddToPathSet) {\n const paths = (this.pendingTextPaths ||= []);\n paths.push({\n transform: getCurrentTransform(ctx),\n x,\n y,\n fontSize,\n addToPath,\n });\n }\n }\n\n get isFontSubpixelAAEnabled() {\n // Checks if anti-aliasing is enabled when scaled text is painted.\n // On Windows GDI scaled fonts looks bad.\n const { context: ctx } = this.cachedCanvases.getCanvas(\n \"isFontSubpixelAAEnabled\",\n 10,\n 10\n );\n ctx.scale(1.5, 1);\n ctx.fillText(\"I\", 0, 10);\n const data = ctx.getImageData(0, 0, 10, 10).data;\n let enabled = false;\n for (let i = 3; i < data.length; i += 4) {\n if (data[i] > 0 && data[i] < 255) {\n enabled = true;\n break;\n }\n }\n return shadow(this, \"isFontSubpixelAAEnabled\", enabled);\n }\n\n showText(glyphs) {\n const current = this.current;\n const font = current.font;\n if (font.isType3Font) {\n return this.showType3Text(glyphs);\n }\n\n const fontSize = current.fontSize;\n if (fontSize === 0) {\n return undefined;\n }\n\n const ctx = this.ctx;\n const fontSizeScale = current.fontSizeScale;\n const charSpacing = current.charSpacing;\n const wordSpacing = current.wordSpacing;\n const fontDirection = current.fontDirection;\n const textHScale = current.textHScale * fontDirection;\n const glyphsLength = glyphs.length;\n const vertical = font.vertical;\n const spacingDir = vertical ? 1 : -1;\n const defaultVMetrics = font.defaultVMetrics;\n const widthAdvanceScale = fontSize * current.fontMatrix[0];\n\n const simpleFillText =\n current.textRenderingMode === TextRenderingMode.FILL &&\n !font.disableFontFace &&\n !current.patternFill;\n\n ctx.save();\n ctx.transform(...current.textMatrix);\n ctx.translate(current.x, current.y + current.textRise);\n\n if (fontDirection > 0) {\n ctx.scale(textHScale, -1);\n } else {\n ctx.scale(textHScale, 1);\n }\n\n let patternTransform;\n if (current.patternFill) {\n ctx.save();\n const pattern = current.fillColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL\n );\n patternTransform = getCurrentTransform(ctx);\n ctx.restore();\n ctx.fillStyle = pattern;\n }\n\n let lineWidth = current.lineWidth;\n const scale = current.textMatrixScale;\n if (scale === 0 || lineWidth === 0) {\n const fillStrokeMode =\n current.textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n lineWidth = this.getSinglePixelWidth();\n }\n } else {\n lineWidth /= scale;\n }\n\n if (fontSizeScale !== 1.0) {\n ctx.scale(fontSizeScale, fontSizeScale);\n lineWidth /= fontSizeScale;\n }\n\n ctx.lineWidth = lineWidth;\n\n if (font.isInvalidPDFjsFont) {\n const chars = [];\n let width = 0;\n for (const glyph of glyphs) {\n chars.push(glyph.unicode);\n width += glyph.width;\n }\n ctx.fillText(chars.join(\"\"), 0, 0);\n current.x += width * widthAdvanceScale * textHScale;\n ctx.restore();\n this.compose();\n\n return undefined;\n }\n\n let x = 0,\n i;\n for (i = 0; i < glyphsLength; ++i) {\n const glyph = glyphs[i];\n if (typeof glyph === \"number\") {\n x += (spacingDir * glyph * fontSize) / 1000;\n continue;\n }\n\n let restoreNeeded = false;\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const character = glyph.fontChar;\n const accent = glyph.accent;\n let scaledX, scaledY;\n let width = glyph.width;\n if (vertical) {\n const vmetric = glyph.vmetric || defaultVMetrics;\n const vx =\n -(glyph.vmetric ? vmetric[1] : width * 0.5) * widthAdvanceScale;\n const vy = vmetric[2] * widthAdvanceScale;\n\n width = vmetric ? -vmetric[0] : width;\n scaledX = vx / fontSizeScale;\n scaledY = (x + vy) / fontSizeScale;\n } else {\n scaledX = x / fontSizeScale;\n scaledY = 0;\n }\n\n if (font.remeasure && width > 0) {\n // Some standard fonts may not have the exact width: rescale per\n // character if measured width is greater than expected glyph width\n // and subpixel-aa is enabled, otherwise just center the glyph.\n const measuredWidth =\n ((ctx.measureText(character).width * 1000) / fontSize) *\n fontSizeScale;\n if (width < measuredWidth && this.isFontSubpixelAAEnabled) {\n const characterScaleX = width / measuredWidth;\n restoreNeeded = true;\n ctx.save();\n ctx.scale(characterScaleX, 1);\n scaledX /= characterScaleX;\n } else if (width !== measuredWidth) {\n scaledX +=\n (((width - measuredWidth) / 2000) * fontSize) / fontSizeScale;\n }\n }\n\n // Only attempt to draw the glyph if it is actually in the embedded font\n // file or if there isn't a font file so the fallback font is shown.\n if (this.contentVisible && (glyph.isInFont || font.missingFile)) {\n if (simpleFillText && !accent) {\n // common case\n ctx.fillText(character, scaledX, scaledY);\n } else {\n this.paintChar(character, scaledX, scaledY, patternTransform);\n if (accent) {\n const scaledAccentX =\n scaledX + (fontSize * accent.offset.x) / fontSizeScale;\n const scaledAccentY =\n scaledY - (fontSize * accent.offset.y) / fontSizeScale;\n this.paintChar(\n accent.fontChar,\n scaledAccentX,\n scaledAccentY,\n patternTransform\n );\n }\n }\n }\n\n const charWidth = vertical\n ? width * widthAdvanceScale - spacing * fontDirection\n : width * widthAdvanceScale + spacing * fontDirection;\n x += charWidth;\n\n if (restoreNeeded) {\n ctx.restore();\n }\n }\n if (vertical) {\n current.y -= x;\n } else {\n current.x += x * textHScale;\n }\n ctx.restore();\n this.compose();\n\n return undefined;\n }\n\n showType3Text(glyphs) {\n // Type3 fonts - each glyph is a \"mini-PDF\"\n const ctx = this.ctx;\n const current = this.current;\n const font = current.font;\n const fontSize = current.fontSize;\n const fontDirection = current.fontDirection;\n const spacingDir = font.vertical ? 1 : -1;\n const charSpacing = current.charSpacing;\n const wordSpacing = current.wordSpacing;\n const textHScale = current.textHScale * fontDirection;\n const fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX;\n const glyphsLength = glyphs.length;\n const isTextInvisible =\n current.textRenderingMode === TextRenderingMode.INVISIBLE;\n let i, glyph, width, spacingLength;\n\n if (isTextInvisible || fontSize === 0) {\n return;\n }\n this._cachedScaleForStroking[0] = -1;\n this._cachedGetSinglePixelWidth = null;\n\n ctx.save();\n ctx.transform(...current.textMatrix);\n ctx.translate(current.x, current.y);\n\n ctx.scale(textHScale, fontDirection);\n\n for (i = 0; i < glyphsLength; ++i) {\n glyph = glyphs[i];\n if (typeof glyph === \"number\") {\n spacingLength = (spacingDir * glyph * fontSize) / 1000;\n this.ctx.translate(spacingLength, 0);\n current.x += spacingLength * textHScale;\n continue;\n }\n\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const operatorList = font.charProcOperatorList[glyph.operatorListId];\n if (!operatorList) {\n warn(`Type3 character \"${glyph.operatorListId}\" is not available.`);\n continue;\n }\n if (this.contentVisible) {\n this.processingType3 = glyph;\n this.save();\n ctx.scale(fontSize, fontSize);\n ctx.transform(...fontMatrix);\n this.executeOperatorList(operatorList);\n this.restore();\n }\n\n const transformed = Util.applyTransform([glyph.width, 0], fontMatrix);\n width = transformed[0] * fontSize + spacing;\n\n ctx.translate(width, 0);\n current.x += width * textHScale;\n }\n ctx.restore();\n this.processingType3 = null;\n }\n\n // Type3 fonts\n setCharWidth(xWidth, yWidth) {\n // We can safely ignore this since the width should be the same\n // as the width in the Widths array.\n }\n\n setCharWidthAndBounds(xWidth, yWidth, llx, lly, urx, ury) {\n this.ctx.rect(llx, lly, urx - llx, ury - lly);\n this.ctx.clip();\n this.endPath();\n }\n\n // Color\n getColorN_Pattern(IR) {\n let pattern;\n if (IR[0] === \"TilingPattern\") {\n const color = IR[1];\n const baseTransform = this.baseTransform || getCurrentTransform(this.ctx);\n const canvasGraphicsFactory = {\n createCanvasGraphics: ctx =>\n new CanvasGraphics(\n ctx,\n this.commonObjs,\n this.objs,\n this.canvasFactory,\n this.filterFactory,\n {\n optionalContentConfig: this.optionalContentConfig,\n markedContentStack: this.markedContentStack,\n }\n ),\n };\n pattern = new TilingPattern(\n IR,\n color,\n this.ctx,\n canvasGraphicsFactory,\n baseTransform\n );\n } else {\n pattern = this._getPattern(IR[1], IR[2]);\n }\n return pattern;\n }\n\n setStrokeColorN() {\n this.current.strokeColor = this.getColorN_Pattern(arguments);\n }\n\n setFillColorN() {\n this.current.fillColor = this.getColorN_Pattern(arguments);\n this.current.patternFill = true;\n }\n\n setStrokeRGBColor(r, g, b) {\n this.ctx.strokeStyle = this.current.strokeColor = Util.makeHexColor(\n r,\n g,\n b\n );\n }\n\n setStrokeTransparent() {\n this.ctx.strokeStyle = this.current.strokeColor = \"transparent\";\n }\n\n setFillRGBColor(r, g, b) {\n this.ctx.fillStyle = this.current.fillColor = Util.makeHexColor(r, g, b);\n this.current.patternFill = false;\n }\n\n setFillTransparent() {\n this.ctx.fillStyle = this.current.fillColor = \"transparent\";\n this.current.patternFill = false;\n }\n\n _getPattern(objId, matrix = null) {\n let pattern;\n if (this.cachedPatterns.has(objId)) {\n pattern = this.cachedPatterns.get(objId);\n } else {\n pattern = getShadingPattern(this.getObject(objId));\n this.cachedPatterns.set(objId, pattern);\n }\n if (matrix) {\n pattern.matrix = matrix;\n }\n return pattern;\n }\n\n shadingFill(objId) {\n if (!this.contentVisible) {\n return;\n }\n const ctx = this.ctx;\n\n this.save();\n const pattern = this._getPattern(objId);\n ctx.fillStyle = pattern.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.SHADING\n );\n\n const inv = getCurrentTransformInverse(ctx);\n if (inv) {\n const { width, height } = ctx.canvas;\n const [x0, y0, x1, y1] = Util.getAxialAlignedBoundingBox(\n [0, 0, width, height],\n inv\n );\n\n this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0);\n } else {\n // HACK to draw the gradient onto an infinite rectangle.\n // PDF gradients are drawn across the entire image while\n // Canvas only allows gradients to be drawn in a rectangle\n // The following bug should allow us to remove this.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=664884\n\n this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);\n }\n\n this.compose(this.current.getClippedPathBoundingBox());\n this.restore();\n }\n\n // Images\n beginInlineImage() {\n unreachable(\"Should not call beginInlineImage\");\n }\n\n beginImageData() {\n unreachable(\"Should not call beginImageData\");\n }\n\n paintFormXObjectBegin(matrix, bbox) {\n if (!this.contentVisible) {\n return;\n }\n this.save();\n this.baseTransformStack.push(this.baseTransform);\n\n if (matrix) {\n this.transform(...matrix);\n }\n this.baseTransform = getCurrentTransform(this.ctx);\n\n if (bbox) {\n const width = bbox[2] - bbox[0];\n const height = bbox[3] - bbox[1];\n this.ctx.rect(bbox[0], bbox[1], width, height);\n this.current.updateRectMinMax(getCurrentTransform(this.ctx), bbox);\n this.clip();\n this.endPath();\n }\n }\n\n paintFormXObjectEnd() {\n if (!this.contentVisible) {\n return;\n }\n this.restore();\n this.baseTransform = this.baseTransformStack.pop();\n }\n\n beginGroup(group) {\n if (!this.contentVisible) {\n return;\n }\n\n this.save();\n // If there's an active soft mask we don't want it enabled for the group, so\n // clear it out. The mask and suspended canvas will be restored in endGroup.\n if (this.inSMaskMode) {\n this.endSMaskMode();\n this.current.activeSMask = null;\n }\n\n const currentCtx = this.ctx;\n // TODO non-isolated groups - according to Rik at adobe non-isolated\n // group results aren't usually that different and they even have tools\n // that ignore this setting. Notes from Rik on implementing:\n // - When you encounter an transparency group, create a new canvas with\n // the dimensions of the bbox\n // - copy the content from the previous canvas to the new canvas\n // - draw as usual\n // - remove the backdrop alpha:\n // alphaNew = 1 - (1 - alpha)/(1 - alphaBackdrop) with 'alpha' the alpha\n // value of your transparency group and 'alphaBackdrop' the alpha of the\n // backdrop\n // - remove background color:\n // colorNew = color - alphaNew *colorBackdrop /(1 - alphaNew)\n if (!group.isolated) {\n info(\"TODO: Support non-isolated groups.\");\n }\n\n // TODO knockout - supposedly possible with the clever use of compositing\n // modes.\n if (group.knockout) {\n warn(\"Knockout groups not supported.\");\n }\n\n const currentTransform = getCurrentTransform(currentCtx);\n if (group.matrix) {\n currentCtx.transform(...group.matrix);\n }\n if (!group.bbox) {\n throw new Error(\"Bounding box is required.\");\n }\n\n // Based on the current transform figure out how big the bounding box\n // will actually be.\n let bounds = Util.getAxialAlignedBoundingBox(\n group.bbox,\n getCurrentTransform(currentCtx)\n );\n // Clip the bounding box to the current canvas.\n const canvasBounds = [\n 0,\n 0,\n currentCtx.canvas.width,\n currentCtx.canvas.height,\n ];\n bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0];\n // Use ceil in case we're between sizes so we don't create canvas that is\n // too small and make the canvas at least 1x1 pixels.\n const offsetX = Math.floor(bounds[0]);\n const offsetY = Math.floor(bounds[1]);\n const drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1);\n const drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1);\n\n this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]);\n\n let cacheId = \"groupAt\" + this.groupLevel;\n if (group.smask) {\n // Using two cache entries is case if masks are used one after another.\n cacheId += \"_smask_\" + (this.smaskCounter++ % 2);\n }\n const scratchCanvas = this.cachedCanvases.getCanvas(\n cacheId,\n drawnWidth,\n drawnHeight\n );\n const groupCtx = scratchCanvas.context;\n\n // Since we created a new canvas that is just the size of the bounding box\n // we have to translate the group ctx.\n groupCtx.translate(-offsetX, -offsetY);\n groupCtx.transform(...currentTransform);\n\n if (group.smask) {\n // Saving state and cached mask to be used in setGState.\n this.smaskStack.push({\n canvas: scratchCanvas.canvas,\n context: groupCtx,\n offsetX,\n offsetY,\n subtype: group.smask.subtype,\n backdrop: group.smask.backdrop,\n transferMap: group.smask.transferMap || null,\n startTransformInverse: null, // used during suspend operation\n });\n } else {\n // Setup the current ctx so when the group is popped we draw it at the\n // right location.\n currentCtx.setTransform(1, 0, 0, 1, 0, 0);\n currentCtx.translate(offsetX, offsetY);\n currentCtx.save();\n }\n // The transparency group inherits all off the current graphics state\n // except the blend mode, soft mask, and alpha constants.\n copyCtxState(currentCtx, groupCtx);\n this.ctx = groupCtx;\n this.setGState([\n [\"BM\", \"source-over\"],\n [\"ca\", 1],\n [\"CA\", 1],\n ]);\n this.groupStack.push(currentCtx);\n this.groupLevel++;\n }\n\n endGroup(group) {\n if (!this.contentVisible) {\n return;\n }\n this.groupLevel--;\n const groupCtx = this.ctx;\n const ctx = this.groupStack.pop();\n this.ctx = ctx;\n // Turn off image smoothing to avoid sub pixel interpolation which can\n // look kind of blurry for some pdfs.\n this.ctx.imageSmoothingEnabled = false;\n\n if (group.smask) {\n this.tempSMask = this.smaskStack.pop();\n this.restore();\n } else {\n this.ctx.restore();\n const currentMtx = getCurrentTransform(this.ctx);\n this.restore();\n this.ctx.save();\n this.ctx.setTransform(...currentMtx);\n const dirtyBox = Util.getAxialAlignedBoundingBox(\n [0, 0, groupCtx.canvas.width, groupCtx.canvas.height],\n currentMtx\n );\n this.ctx.drawImage(groupCtx.canvas, 0, 0);\n this.ctx.restore();\n this.compose(dirtyBox);\n }\n }\n\n beginAnnotation(id, rect, transform, matrix, hasOwnCanvas) {\n // The annotations are drawn just after the page content.\n // The page content drawing can potentially have set a transform,\n // a clipping path, whatever...\n // So in order to have something clean, we restore the initial state.\n this.#restoreInitialState();\n resetCtxToDefault(this.ctx);\n\n this.ctx.save();\n this.save();\n\n if (this.baseTransform) {\n this.ctx.setTransform(...this.baseTransform);\n }\n\n if (rect) {\n const width = rect[2] - rect[0];\n const height = rect[3] - rect[1];\n\n if (hasOwnCanvas && this.annotationCanvasMap) {\n transform = transform.slice();\n transform[4] -= rect[0];\n transform[5] -= rect[1];\n\n rect = rect.slice();\n rect[0] = rect[1] = 0;\n rect[2] = width;\n rect[3] = height;\n\n const [scaleX, scaleY] = Util.singularValueDecompose2dScale(\n getCurrentTransform(this.ctx)\n );\n const { viewportScale } = this;\n const canvasWidth = Math.ceil(\n width * this.outputScaleX * viewportScale\n );\n const canvasHeight = Math.ceil(\n height * this.outputScaleY * viewportScale\n );\n\n this.annotationCanvas = this.canvasFactory.create(\n canvasWidth,\n canvasHeight\n );\n const { canvas, context } = this.annotationCanvas;\n this.annotationCanvasMap.set(id, canvas);\n this.annotationCanvas.savedCtx = this.ctx;\n this.ctx = context;\n this.ctx.save();\n this.ctx.setTransform(scaleX, 0, 0, -scaleY, 0, height * scaleY);\n\n resetCtxToDefault(this.ctx);\n } else {\n resetCtxToDefault(this.ctx);\n\n // Consume a potential path before clipping.\n this.endPath();\n\n this.ctx.rect(rect[0], rect[1], width, height);\n this.ctx.clip();\n this.ctx.beginPath();\n }\n }\n\n this.current = new CanvasExtraState(\n this.ctx.canvas.width,\n this.ctx.canvas.height\n );\n\n this.transform(...transform);\n this.transform(...matrix);\n }\n\n endAnnotation() {\n if (this.annotationCanvas) {\n this.ctx.restore();\n this.#drawFilter();\n\n this.ctx = this.annotationCanvas.savedCtx;\n delete this.annotationCanvas.savedCtx;\n delete this.annotationCanvas;\n }\n }\n\n paintImageMaskXObject(img) {\n if (!this.contentVisible) {\n return;\n }\n const count = img.count;\n img = this.getObject(img.data, img);\n img.count = count;\n\n const ctx = this.ctx;\n const glyph = this.processingType3;\n\n if (glyph) {\n if (glyph.compiled === undefined) {\n glyph.compiled = compileType3Glyph(img);\n }\n\n if (glyph.compiled) {\n glyph.compiled(ctx);\n return;\n }\n }\n const mask = this._createMaskCanvas(img);\n const maskCanvas = mask.canvas;\n\n ctx.save();\n // The mask is drawn with the transform applied. Reset the current\n // transform to draw to the identity.\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY);\n ctx.restore();\n this.compose();\n }\n\n paintImageMaskXObjectRepeat(\n img,\n scaleX,\n skewX = 0,\n skewY = 0,\n scaleY,\n positions\n ) {\n if (!this.contentVisible) {\n return;\n }\n\n img = this.getObject(img.data, img);\n\n const ctx = this.ctx;\n ctx.save();\n const currentTransform = getCurrentTransform(ctx);\n ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0);\n const mask = this._createMaskCanvas(img);\n\n ctx.setTransform(\n 1,\n 0,\n 0,\n 1,\n mask.offsetX - currentTransform[4],\n mask.offsetY - currentTransform[5]\n );\n for (let i = 0, ii = positions.length; i < ii; i += 2) {\n const trans = Util.transform(currentTransform, [\n scaleX,\n skewX,\n skewY,\n scaleY,\n positions[i],\n positions[i + 1],\n ]);\n\n const [x, y] = Util.applyTransform([0, 0], trans);\n ctx.drawImage(mask.canvas, x, y);\n }\n ctx.restore();\n this.compose();\n }\n\n paintImageMaskXObjectGroup(images) {\n if (!this.contentVisible) {\n return;\n }\n const ctx = this.ctx;\n\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n\n for (const image of images) {\n const { data, width, height, transform } = image;\n\n const maskCanvas = this.cachedCanvases.getCanvas(\n \"maskCanvas\",\n width,\n height\n );\n const maskCtx = maskCanvas.context;\n maskCtx.save();\n\n const img = this.getObject(data, image);\n putBinaryImageMask(maskCtx, img);\n\n maskCtx.globalCompositeOperation = \"source-in\";\n\n maskCtx.fillStyle = isPatternFill\n ? fillColor.getPattern(\n maskCtx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL\n )\n : fillColor;\n maskCtx.fillRect(0, 0, width, height);\n\n maskCtx.restore();\n\n ctx.save();\n ctx.transform(...transform);\n ctx.scale(1, -1);\n drawImageAtIntegerCoords(\n ctx,\n maskCanvas.canvas,\n 0,\n 0,\n width,\n height,\n 0,\n -1,\n 1,\n 1\n );\n ctx.restore();\n }\n this.compose();\n }\n\n paintImageXObject(objId) {\n if (!this.contentVisible) {\n return;\n }\n const imgData = this.getObject(objId);\n if (!imgData) {\n warn(\"Dependent image isn't ready yet\");\n return;\n }\n\n this.paintInlineImageXObject(imgData);\n }\n\n paintImageXObjectRepeat(objId, scaleX, scaleY, positions) {\n if (!this.contentVisible) {\n return;\n }\n const imgData = this.getObject(objId);\n if (!imgData) {\n warn(\"Dependent image isn't ready yet\");\n return;\n }\n\n const width = imgData.width;\n const height = imgData.height;\n const map = [];\n for (let i = 0, ii = positions.length; i < ii; i += 2) {\n map.push({\n transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]],\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n }\n this.paintInlineImageXObjectGroup(imgData, map);\n }\n\n applyTransferMapsToCanvas(ctx) {\n if (this.current.transferMaps !== \"none\") {\n ctx.filter = this.current.transferMaps;\n ctx.drawImage(ctx.canvas, 0, 0);\n ctx.filter = \"none\";\n }\n return ctx.canvas;\n }\n\n applyTransferMapsToBitmap(imgData) {\n if (this.current.transferMaps === \"none\") {\n return imgData.bitmap;\n }\n const { bitmap, width, height } = imgData;\n const tmpCanvas = this.cachedCanvases.getCanvas(\n \"inlineImage\",\n width,\n height\n );\n const tmpCtx = tmpCanvas.context;\n tmpCtx.filter = this.current.transferMaps;\n tmpCtx.drawImage(bitmap, 0, 0);\n tmpCtx.filter = \"none\";\n\n return tmpCanvas.canvas;\n }\n\n paintInlineImageXObject(imgData) {\n if (!this.contentVisible) {\n return;\n }\n const width = imgData.width;\n const height = imgData.height;\n const ctx = this.ctx;\n\n this.save();\n\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n !isNodeJS\n ) {\n // The filter, if any, will be applied in applyTransferMapsToBitmap.\n // It must be applied to the image before rescaling else some artifacts\n // could appear.\n // The final restore will reset it to its value.\n const { filter } = ctx;\n if (filter !== \"none\" && filter !== \"\") {\n ctx.filter = \"none\";\n }\n }\n\n // scale the image to the unit square\n ctx.scale(1 / width, -1 / height);\n\n let imgToPaint;\n if (imgData.bitmap) {\n imgToPaint = this.applyTransferMapsToBitmap(imgData);\n } else if (\n (typeof HTMLElement === \"function\" && imgData instanceof HTMLElement) ||\n !imgData.data\n ) {\n // typeof check is needed due to node.js support, see issue #8489\n imgToPaint = imgData;\n } else {\n const tmpCanvas = this.cachedCanvases.getCanvas(\n \"inlineImage\",\n width,\n height\n );\n const tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData);\n imgToPaint = this.applyTransferMapsToCanvas(tmpCtx);\n }\n\n const scaled = this._scaleImage(\n imgToPaint,\n getCurrentTransformInverse(ctx)\n );\n ctx.imageSmoothingEnabled = getImageSmoothingEnabled(\n getCurrentTransform(ctx),\n imgData.interpolate\n );\n\n drawImageAtIntegerCoords(\n ctx,\n scaled.img,\n 0,\n 0,\n scaled.paintWidth,\n scaled.paintHeight,\n 0,\n -height,\n width,\n height\n );\n this.compose();\n this.restore();\n }\n\n paintInlineImageXObjectGroup(imgData, map) {\n if (!this.contentVisible) {\n return;\n }\n const ctx = this.ctx;\n let imgToPaint;\n if (imgData.bitmap) {\n imgToPaint = imgData.bitmap;\n } else {\n const w = imgData.width;\n const h = imgData.height;\n\n const tmpCanvas = this.cachedCanvases.getCanvas(\"inlineImage\", w, h);\n const tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData);\n imgToPaint = this.applyTransferMapsToCanvas(tmpCtx);\n }\n\n for (const entry of map) {\n ctx.save();\n ctx.transform(...entry.transform);\n ctx.scale(1, -1);\n drawImageAtIntegerCoords(\n ctx,\n imgToPaint,\n entry.x,\n entry.y,\n entry.w,\n entry.h,\n 0,\n -1,\n 1,\n 1\n );\n ctx.restore();\n }\n this.compose();\n }\n\n paintSolidColorImageMask() {\n if (!this.contentVisible) {\n return;\n }\n this.ctx.fillRect(0, 0, 1, 1);\n this.compose();\n }\n\n // Marked content\n\n markPoint(tag) {\n // TODO Marked content.\n }\n\n markPointProps(tag, properties) {\n // TODO Marked content.\n }\n\n beginMarkedContent(tag) {\n this.markedContentStack.push({\n visible: true,\n });\n }\n\n beginMarkedContentProps(tag, properties) {\n if (tag === \"OC\") {\n this.markedContentStack.push({\n visible: this.optionalContentConfig.isVisible(properties),\n });\n } else {\n this.markedContentStack.push({\n visible: true,\n });\n }\n this.contentVisible = this.isContentVisible();\n }\n\n endMarkedContent() {\n this.markedContentStack.pop();\n this.contentVisible = this.isContentVisible();\n }\n\n // Compatibility\n\n beginCompat() {\n // TODO ignore undefined operators (should we do that anyway?)\n }\n\n endCompat() {\n // TODO stop ignoring undefined operators\n }\n\n // Helper functions\n\n consumePath(clipBox) {\n const isEmpty = this.current.isEmptyClip();\n if (this.pendingClip) {\n this.current.updateClipFromPath();\n }\n if (!this.pendingClip) {\n this.compose(clipBox);\n }\n const ctx = this.ctx;\n if (this.pendingClip) {\n if (!isEmpty) {\n if (this.pendingClip === EO_CLIP) {\n ctx.clip(\"evenodd\");\n } else {\n ctx.clip();\n }\n }\n this.pendingClip = null;\n }\n this.current.startNewPathAndClipBox(this.current.clipBox);\n ctx.beginPath();\n }\n\n getSinglePixelWidth() {\n if (!this._cachedGetSinglePixelWidth) {\n const m = getCurrentTransform(this.ctx);\n if (m[1] === 0 && m[2] === 0) {\n // Fast path\n this._cachedGetSinglePixelWidth =\n 1 / Math.min(Math.abs(m[0]), Math.abs(m[3]));\n } else {\n const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]);\n const normX = Math.hypot(m[0], m[2]);\n const normY = Math.hypot(m[1], m[3]);\n this._cachedGetSinglePixelWidth = Math.max(normX, normY) / absDet;\n }\n }\n return this._cachedGetSinglePixelWidth;\n }\n\n getScaleForStroking() {\n // A pixel has thicknessX = thicknessY = 1;\n // A transformed pixel is a parallelogram and the thicknesses\n // corresponds to the heights.\n // The goal of this function is to rescale before setting the\n // lineWidth in order to have both thicknesses greater or equal\n // to 1 after transform.\n if (this._cachedScaleForStroking[0] === -1) {\n const { lineWidth } = this.current;\n const { a, b, c, d } = this.ctx.getTransform();\n let scaleX, scaleY;\n\n if (b === 0 && c === 0) {\n // Fast path\n const normX = Math.abs(a);\n const normY = Math.abs(d);\n if (normX === normY) {\n if (lineWidth === 0) {\n scaleX = scaleY = 1 / normX;\n } else {\n const scaledLineWidth = normX * lineWidth;\n scaleX = scaleY = scaledLineWidth < 1 ? 1 / scaledLineWidth : 1;\n }\n } else if (lineWidth === 0) {\n scaleX = 1 / normX;\n scaleY = 1 / normY;\n } else {\n const scaledXLineWidth = normX * lineWidth;\n const scaledYLineWidth = normY * lineWidth;\n scaleX = scaledXLineWidth < 1 ? 1 / scaledXLineWidth : 1;\n scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1;\n }\n } else {\n // A pixel (base (x, y)) is transformed by M into a parallelogram:\n // - its area is |det(M)|;\n // - heightY (orthogonal to Mx) has a length: |det(M)| / norm(Mx);\n // - heightX (orthogonal to My) has a length: |det(M)| / norm(My).\n // heightX and heightY are the thicknesses of the transformed pixel\n // and they must be both greater or equal to 1.\n const absDet = Math.abs(a * d - b * c);\n const normX = Math.hypot(a, b);\n const normY = Math.hypot(c, d);\n if (lineWidth === 0) {\n scaleX = normY / absDet;\n scaleY = normX / absDet;\n } else {\n const baseArea = lineWidth * absDet;\n scaleX = normY > baseArea ? normY / baseArea : 1;\n scaleY = normX > baseArea ? normX / baseArea : 1;\n }\n }\n this._cachedScaleForStroking[0] = scaleX;\n this._cachedScaleForStroking[1] = scaleY;\n }\n return this._cachedScaleForStroking;\n }\n\n // Rescale before stroking in order to have a final lineWidth\n // with both thicknesses greater or equal to 1.\n rescaleAndStroke(saveRestore) {\n const { ctx } = this;\n const { lineWidth } = this.current;\n const [scaleX, scaleY] = this.getScaleForStroking();\n\n ctx.lineWidth = lineWidth || 1;\n\n if (scaleX === 1 && scaleY === 1) {\n ctx.stroke();\n return;\n }\n\n const dashes = ctx.getLineDash();\n if (saveRestore) {\n ctx.save();\n }\n\n ctx.scale(scaleX, scaleY);\n\n // How the dashed line is rendered depends on the current transform...\n // so we added a rescale to handle too thin lines and consequently\n // the way the line is dashed will be modified.\n // If scaleX === scaleY, the dashed lines will be rendered correctly\n // else we'll have some bugs (but only with too thin lines).\n // Here we take the max... why not taking the min... or something else.\n // Anyway, as said it's buggy when scaleX !== scaleY.\n if (dashes.length > 0) {\n const scale = Math.max(scaleX, scaleY);\n ctx.setLineDash(dashes.map(x => x / scale));\n ctx.lineDashOffset /= scale;\n }\n\n ctx.stroke();\n\n if (saveRestore) {\n ctx.restore();\n }\n }\n\n isContentVisible() {\n for (let i = this.markedContentStack.length - 1; i >= 0; i--) {\n if (!this.markedContentStack[i].visible) {\n return false;\n }\n }\n return true;\n }\n}\n\nfor (const op in OPS) {\n if (CanvasGraphics.prototype[op] !== undefined) {\n CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op];\n }\n}\n\nexport { CanvasGraphics };\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nclass GlobalWorkerOptions {\n static #port = null;\n\n static #src = \"\";\n\n /**\n * @type {Worker | null}\n */\n static get workerPort() {\n return this.#port;\n }\n\n /**\n * @param {Worker | null} workerPort - Defines global port for worker process.\n * Overrides the `workerSrc` option.\n */\n static set workerPort(val) {\n if (\n !(typeof Worker !== \"undefined\" && val instanceof Worker) &&\n val !== null\n ) {\n throw new Error(\"Invalid `workerPort` type.\");\n }\n this.#port = val;\n }\n\n /**\n * @type {string}\n */\n static get workerSrc() {\n return this.#src;\n }\n\n /**\n * @param {string} workerSrc - A string containing the path and filename of\n * the worker file.\n *\n * NOTE: The `workerSrc` option should always be set, in order to prevent\n * any issues when using the PDF.js library.\n */\n static set workerSrc(val) {\n if (typeof val !== \"string\") {\n throw new Error(\"Invalid `workerSrc` type.\");\n }\n this.#src = val;\n }\n}\n\nexport { GlobalWorkerOptions };\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AbortException,\n assert,\n MissingPDFException,\n PasswordException,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n} from \"./util.js\";\n\nconst CallbackKind = {\n UNKNOWN: 0,\n DATA: 1,\n ERROR: 2,\n};\n\nconst StreamKind = {\n UNKNOWN: 0,\n CANCEL: 1,\n CANCEL_COMPLETE: 2,\n CLOSE: 3,\n ENQUEUE: 4,\n ERROR: 5,\n PULL: 6,\n PULL_COMPLETE: 7,\n START_COMPLETE: 8,\n};\n\nfunction wrapReason(reason) {\n if (\n !(\n reason instanceof Error ||\n (typeof reason === \"object\" && reason !== null)\n )\n ) {\n unreachable(\n 'wrapReason: Expected \"reason\" to be a (possibly cloned) Error.'\n );\n }\n switch (reason.name) {\n case \"AbortException\":\n return new AbortException(reason.message);\n case \"MissingPDFException\":\n return new MissingPDFException(reason.message);\n case \"PasswordException\":\n return new PasswordException(reason.message, reason.code);\n case \"UnexpectedResponseException\":\n return new UnexpectedResponseException(reason.message, reason.status);\n case \"UnknownErrorException\":\n return new UnknownErrorException(reason.message, reason.details);\n default:\n return new UnknownErrorException(reason.message, reason.toString());\n }\n}\n\nclass MessageHandler {\n #messageAC = new AbortController();\n\n constructor(sourceName, targetName, comObj) {\n this.sourceName = sourceName;\n this.targetName = targetName;\n this.comObj = comObj;\n this.callbackId = 1;\n this.streamId = 1;\n this.streamSinks = Object.create(null);\n this.streamControllers = Object.create(null);\n this.callbackCapabilities = Object.create(null);\n this.actionHandler = Object.create(null);\n\n comObj.addEventListener(\"message\", this.#onMessage.bind(this), {\n signal: this.#messageAC.signal,\n });\n }\n\n #onMessage({ data }) {\n if (data.targetName !== this.sourceName) {\n return;\n }\n if (data.stream) {\n this.#processStreamMessage(data);\n return;\n }\n if (data.callback) {\n const callbackId = data.callbackId;\n const capability = this.callbackCapabilities[callbackId];\n if (!capability) {\n throw new Error(`Cannot resolve callback ${callbackId}`);\n }\n delete this.callbackCapabilities[callbackId];\n\n if (data.callback === CallbackKind.DATA) {\n capability.resolve(data.data);\n } else if (data.callback === CallbackKind.ERROR) {\n capability.reject(wrapReason(data.reason));\n } else {\n throw new Error(\"Unexpected callback case\");\n }\n return;\n }\n const action = this.actionHandler[data.action];\n if (!action) {\n throw new Error(`Unknown action from worker: ${data.action}`);\n }\n if (data.callbackId) {\n const sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n\n new Promise(function (resolve) {\n resolve(action(data.data));\n }).then(\n function (result) {\n comObj.postMessage({\n sourceName,\n targetName,\n callback: CallbackKind.DATA,\n callbackId: data.callbackId,\n data: result,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n callback: CallbackKind.ERROR,\n callbackId: data.callbackId,\n reason: wrapReason(reason),\n });\n }\n );\n return;\n }\n if (data.streamId) {\n this.#createStreamSink(data);\n return;\n }\n action(data.data);\n }\n\n on(actionName, handler) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n typeof handler === \"function\",\n 'MessageHandler.on: Expected \"handler\" to be a function.'\n );\n }\n const ah = this.actionHandler;\n if (ah[actionName]) {\n throw new Error(`There is already an actionName called \"${actionName}\"`);\n }\n ah[actionName] = handler;\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n */\n send(actionName, data, transfers) {\n this.comObj.postMessage(\n {\n sourceName: this.sourceName,\n targetName: this.targetName,\n action: actionName,\n data,\n },\n transfers\n );\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * Expects that the other side will callback with the response.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n * @returns {Promise} Promise to be resolved with response data.\n */\n sendWithPromise(actionName, data, transfers) {\n const callbackId = this.callbackId++;\n const capability = Promise.withResolvers();\n this.callbackCapabilities[callbackId] = capability;\n try {\n this.comObj.postMessage(\n {\n sourceName: this.sourceName,\n targetName: this.targetName,\n action: actionName,\n callbackId,\n data,\n },\n transfers\n );\n } catch (ex) {\n capability.reject(ex);\n }\n return capability.promise;\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * Expect that the other side will callback to signal 'start_complete'.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Object} queueingStrategy - Strategy to signal backpressure based on\n * internal queue.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n * @returns {ReadableStream} ReadableStream to read data in chunks.\n */\n sendWithStream(actionName, data, queueingStrategy, transfers) {\n const streamId = this.streamId++,\n sourceName = this.sourceName,\n targetName = this.targetName,\n comObj = this.comObj;\n\n return new ReadableStream(\n {\n start: controller => {\n const startCapability = Promise.withResolvers();\n this.streamControllers[streamId] = {\n controller,\n startCall: startCapability,\n pullCall: null,\n cancelCall: null,\n isClosed: false,\n };\n comObj.postMessage(\n {\n sourceName,\n targetName,\n action: actionName,\n streamId,\n data,\n desiredSize: controller.desiredSize,\n },\n transfers\n );\n // Return Promise for Async process, to signal success/failure.\n return startCapability.promise;\n },\n\n pull: controller => {\n const pullCapability = Promise.withResolvers();\n this.streamControllers[streamId].pullCall = pullCapability;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL,\n streamId,\n desiredSize: controller.desiredSize,\n });\n // Returning Promise will not call \"pull\"\n // again until current pull is resolved.\n return pullCapability.promise;\n },\n\n cancel: reason => {\n assert(reason instanceof Error, \"cancel must have a valid reason\");\n const cancelCapability = Promise.withResolvers();\n this.streamControllers[streamId].cancelCall = cancelCapability;\n this.streamControllers[streamId].isClosed = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL,\n streamId,\n reason: wrapReason(reason),\n });\n // Return Promise to signal success or failure.\n return cancelCapability.promise;\n },\n },\n queueingStrategy\n );\n }\n\n #createStreamSink(data) {\n const streamId = data.streamId,\n sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n const self = this,\n action = this.actionHandler[data.action];\n\n const streamSink = {\n enqueue(chunk, size = 1, transfers) {\n if (this.isCancelled) {\n return;\n }\n const lastDesiredSize = this.desiredSize;\n this.desiredSize -= size;\n // Enqueue decreases the desiredSize property of sink,\n // so when it changes from positive to negative,\n // set ready as unresolved promise.\n if (lastDesiredSize > 0 && this.desiredSize <= 0) {\n this.sinkCapability = Promise.withResolvers();\n this.ready = this.sinkCapability.promise;\n }\n comObj.postMessage(\n {\n sourceName,\n targetName,\n stream: StreamKind.ENQUEUE,\n streamId,\n chunk,\n },\n transfers\n );\n },\n\n close() {\n if (this.isCancelled) {\n return;\n }\n this.isCancelled = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CLOSE,\n streamId,\n });\n delete self.streamSinks[streamId];\n },\n\n error(reason) {\n assert(reason instanceof Error, \"error must have a valid reason\");\n if (this.isCancelled) {\n return;\n }\n this.isCancelled = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.ERROR,\n streamId,\n reason: wrapReason(reason),\n });\n },\n\n sinkCapability: Promise.withResolvers(),\n onPull: null,\n onCancel: null,\n isCancelled: false,\n desiredSize: data.desiredSize,\n ready: null,\n };\n\n streamSink.sinkCapability.resolve();\n streamSink.ready = streamSink.sinkCapability.promise;\n this.streamSinks[streamId] = streamSink;\n\n new Promise(function (resolve) {\n resolve(action(data.data, streamSink));\n }).then(\n function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.START_COMPLETE,\n streamId,\n success: true,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.START_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n }\n\n #processStreamMessage(data) {\n const streamId = data.streamId,\n sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n const streamController = this.streamControllers[streamId],\n streamSink = this.streamSinks[streamId];\n\n switch (data.stream) {\n case StreamKind.START_COMPLETE:\n if (data.success) {\n streamController.startCall.resolve();\n } else {\n streamController.startCall.reject(wrapReason(data.reason));\n }\n break;\n case StreamKind.PULL_COMPLETE:\n if (data.success) {\n streamController.pullCall.resolve();\n } else {\n streamController.pullCall.reject(wrapReason(data.reason));\n }\n break;\n case StreamKind.PULL:\n // Ignore any pull after close is called.\n if (!streamSink) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n success: true,\n });\n break;\n }\n // Pull increases the desiredSize property of sink, so when it changes\n // from negative to positive, set ready property as resolved promise.\n if (streamSink.desiredSize <= 0 && data.desiredSize > 0) {\n streamSink.sinkCapability.resolve();\n }\n // Reset desiredSize property of sink on every pull.\n streamSink.desiredSize = data.desiredSize;\n\n new Promise(function (resolve) {\n resolve(streamSink.onPull?.());\n }).then(\n function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n success: true,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n break;\n case StreamKind.ENQUEUE:\n assert(streamController, \"enqueue should have stream controller\");\n if (streamController.isClosed) {\n break;\n }\n streamController.controller.enqueue(data.chunk);\n break;\n case StreamKind.CLOSE:\n assert(streamController, \"close should have stream controller\");\n if (streamController.isClosed) {\n break;\n }\n streamController.isClosed = true;\n streamController.controller.close();\n this.#deleteStreamController(streamController, streamId);\n break;\n case StreamKind.ERROR:\n assert(streamController, \"error should have stream controller\");\n streamController.controller.error(wrapReason(data.reason));\n this.#deleteStreamController(streamController, streamId);\n break;\n case StreamKind.CANCEL_COMPLETE:\n if (data.success) {\n streamController.cancelCall.resolve();\n } else {\n streamController.cancelCall.reject(wrapReason(data.reason));\n }\n this.#deleteStreamController(streamController, streamId);\n break;\n case StreamKind.CANCEL:\n if (!streamSink) {\n break;\n }\n\n new Promise(function (resolve) {\n resolve(streamSink.onCancel?.(wrapReason(data.reason)));\n }).then(\n function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL_COMPLETE,\n streamId,\n success: true,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n streamSink.sinkCapability.reject(wrapReason(data.reason));\n streamSink.isCancelled = true;\n delete this.streamSinks[streamId];\n break;\n default:\n throw new Error(\"Unexpected stream case\");\n }\n }\n\n async #deleteStreamController(streamController, streamId) {\n // Delete the `streamController` only when the start, pull, and cancel\n // capabilities have settled, to prevent `TypeError`s.\n await Promise.allSettled([\n streamController.startCall?.promise,\n streamController.pullCall?.promise,\n streamController.cancelCall?.promise,\n ]);\n delete this.streamControllers[streamId];\n }\n\n destroy() {\n this.#messageAC?.abort();\n this.#messageAC = null;\n }\n}\n\nexport { MessageHandler };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { objectFromMap } from \"../shared/util.js\";\n\nclass Metadata {\n #metadataMap;\n\n #data;\n\n constructor({ parsedData, rawData }) {\n this.#metadataMap = parsedData;\n this.#data = rawData;\n }\n\n getRaw() {\n return this.#data;\n }\n\n get(name) {\n return this.#metadataMap.get(name) ?? null;\n }\n\n getAll() {\n return objectFromMap(this.#metadataMap);\n }\n\n has(name) {\n return this.#metadataMap.has(name);\n }\n}\n\nexport { Metadata };\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n info,\n objectFromMap,\n RenderingIntentFlag,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\n\nconst INTERNAL = Symbol(\"INTERNAL\");\n\nclass OptionalContentGroup {\n #isDisplay = false;\n\n #isPrint = false;\n\n #userSet = false;\n\n #visible = true;\n\n constructor(renderingIntent, { name, intent, usage, rbGroups }) {\n this.#isDisplay = !!(renderingIntent & RenderingIntentFlag.DISPLAY);\n this.#isPrint = !!(renderingIntent & RenderingIntentFlag.PRINT);\n\n this.name = name;\n this.intent = intent;\n this.usage = usage;\n this.rbGroups = rbGroups;\n }\n\n /**\n * @type {boolean}\n */\n get visible() {\n if (this.#userSet) {\n return this.#visible;\n }\n if (!this.#visible) {\n return false;\n }\n const { print, view } = this.usage;\n\n if (this.#isDisplay) {\n return view?.viewState !== \"OFF\";\n } else if (this.#isPrint) {\n return print?.printState !== \"OFF\";\n }\n return true;\n }\n\n /**\n * @ignore\n */\n _setVisible(internal, visible, userSet = false) {\n if (internal !== INTERNAL) {\n unreachable(\"Internal method `_setVisible` called.\");\n }\n this.#userSet = userSet;\n this.#visible = visible;\n }\n}\n\nclass OptionalContentConfig {\n #cachedGetHash = null;\n\n #groups = new Map();\n\n #initialHash = null;\n\n #order = null;\n\n constructor(data, renderingIntent = RenderingIntentFlag.DISPLAY) {\n this.renderingIntent = renderingIntent;\n\n this.name = null;\n this.creator = null;\n\n if (data === null) {\n return;\n }\n this.name = data.name;\n this.creator = data.creator;\n this.#order = data.order;\n for (const group of data.groups) {\n this.#groups.set(\n group.id,\n new OptionalContentGroup(renderingIntent, group)\n );\n }\n\n if (data.baseState === \"OFF\") {\n for (const group of this.#groups.values()) {\n group._setVisible(INTERNAL, false);\n }\n }\n\n for (const on of data.on) {\n this.#groups.get(on)._setVisible(INTERNAL, true);\n }\n\n for (const off of data.off) {\n this.#groups.get(off)._setVisible(INTERNAL, false);\n }\n\n // The following code must always run *last* in the constructor.\n this.#initialHash = this.getHash();\n }\n\n #evaluateVisibilityExpression(array) {\n const length = array.length;\n if (length < 2) {\n return true;\n }\n const operator = array[0];\n for (let i = 1; i < length; i++) {\n const element = array[i];\n let state;\n if (Array.isArray(element)) {\n state = this.#evaluateVisibilityExpression(element);\n } else if (this.#groups.has(element)) {\n state = this.#groups.get(element).visible;\n } else {\n warn(`Optional content group not found: ${element}`);\n return true;\n }\n switch (operator) {\n case \"And\":\n if (!state) {\n return false;\n }\n break;\n case \"Or\":\n if (state) {\n return true;\n }\n break;\n case \"Not\":\n return !state;\n default:\n return true;\n }\n }\n return operator === \"And\";\n }\n\n isVisible(group) {\n if (this.#groups.size === 0) {\n return true;\n }\n if (!group) {\n info(\"Optional content group not defined.\");\n return true;\n }\n if (group.type === \"OCG\") {\n if (!this.#groups.has(group.id)) {\n warn(`Optional content group not found: ${group.id}`);\n return true;\n }\n return this.#groups.get(group.id).visible;\n } else if (group.type === \"OCMD\") {\n // Per the spec, the expression should be preferred if available.\n if (group.expression) {\n return this.#evaluateVisibilityExpression(group.expression);\n }\n if (!group.policy || group.policy === \"AnyOn\") {\n // Default\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (this.#groups.get(id).visible) {\n return true;\n }\n }\n return false;\n } else if (group.policy === \"AllOn\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (!this.#groups.get(id).visible) {\n return false;\n }\n }\n return true;\n } else if (group.policy === \"AnyOff\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (!this.#groups.get(id).visible) {\n return true;\n }\n }\n return false;\n } else if (group.policy === \"AllOff\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (this.#groups.get(id).visible) {\n return false;\n }\n }\n return true;\n }\n warn(`Unknown optional content policy ${group.policy}.`);\n return true;\n }\n warn(`Unknown group type ${group.type}.`);\n return true;\n }\n\n setVisibility(id, visible = true, preserveRB = true) {\n const group = this.#groups.get(id);\n if (!group) {\n warn(`Optional content group not found: ${id}`);\n return;\n }\n\n // If the visibility is about to be set to `true` and the group belongs to\n // any radiobutton groups, hide all other OCGs in these radiobutton groups,\n // provided that radiobutton state relationships are to be preserved.\n if (preserveRB && visible && group.rbGroups.length) {\n for (const rbGroup of group.rbGroups) {\n for (const otherId of rbGroup) {\n if (otherId !== id) {\n this.#groups.get(otherId)?._setVisible(INTERNAL, false, true);\n }\n }\n }\n }\n\n group._setVisible(INTERNAL, !!visible, /* userSet = */ true);\n\n this.#cachedGetHash = null;\n }\n\n setOCGState({ state, preserveRB }) {\n let operator;\n\n for (const elem of state) {\n switch (elem) {\n case \"ON\":\n case \"OFF\":\n case \"Toggle\":\n operator = elem;\n continue;\n }\n\n const group = this.#groups.get(elem);\n if (!group) {\n continue;\n }\n switch (operator) {\n case \"ON\":\n this.setVisibility(elem, true, preserveRB);\n break;\n case \"OFF\":\n this.setVisibility(elem, false, preserveRB);\n break;\n case \"Toggle\":\n this.setVisibility(elem, !group.visible, preserveRB);\n break;\n }\n }\n\n this.#cachedGetHash = null;\n }\n\n get hasInitialVisibility() {\n return this.#initialHash === null || this.getHash() === this.#initialHash;\n }\n\n getOrder() {\n if (!this.#groups.size) {\n return null;\n }\n if (this.#order) {\n return this.#order.slice();\n }\n return [...this.#groups.keys()];\n }\n\n getGroups() {\n return this.#groups.size > 0 ? objectFromMap(this.#groups) : null;\n }\n\n getGroup(id) {\n return this.#groups.get(id) || null;\n }\n\n getHash() {\n if (this.#cachedGetHash !== null) {\n return this.#cachedGetHash;\n }\n const hash = new MurmurHash3_64();\n\n for (const [id, group] of this.#groups) {\n hash.update(`${id}:${group.visible}`);\n }\n return (this.#cachedGetHash = hash.hexdigest());\n }\n}\n\nexport { OptionalContentConfig };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../interfaces\").IPDFStream} IPDFStream */\n/** @typedef {import(\"../interfaces\").IPDFStreamReader} IPDFStreamReader */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../interfaces\").IPDFStreamRangeReader} IPDFStreamRangeReader */\n\nimport { assert } from \"../shared/util.js\";\nimport { isPdfFile } from \"./display_utils.js\";\n\n/** @implements {IPDFStream} */\nclass PDFDataTransportStream {\n constructor(\n pdfDataRangeTransport,\n { disableRange = false, disableStream = false }\n ) {\n assert(\n pdfDataRangeTransport,\n 'PDFDataTransportStream - missing required \"pdfDataRangeTransport\" argument.'\n );\n const { length, initialData, progressiveDone, contentDispositionFilename } =\n pdfDataRangeTransport;\n\n this._queuedChunks = [];\n this._progressiveDone = progressiveDone;\n this._contentDispositionFilename = contentDispositionFilename;\n\n if (initialData?.length > 0) {\n // Prevent any possible issues by only transferring a Uint8Array that\n // completely \"utilizes\" its underlying ArrayBuffer.\n const buffer =\n initialData instanceof Uint8Array &&\n initialData.byteLength === initialData.buffer.byteLength\n ? initialData.buffer\n : new Uint8Array(initialData).buffer;\n this._queuedChunks.push(buffer);\n }\n\n this._pdfDataRangeTransport = pdfDataRangeTransport;\n this._isStreamingSupported = !disableStream;\n this._isRangeSupported = !disableRange;\n this._contentLength = length;\n\n this._fullRequestReader = null;\n this._rangeReaders = [];\n\n pdfDataRangeTransport.addRangeListener((begin, chunk) => {\n this._onReceiveData({ begin, chunk });\n });\n\n pdfDataRangeTransport.addProgressListener((loaded, total) => {\n this._onProgress({ loaded, total });\n });\n\n pdfDataRangeTransport.addProgressiveReadListener(chunk => {\n this._onReceiveData({ chunk });\n });\n\n pdfDataRangeTransport.addProgressiveDoneListener(() => {\n this._onProgressiveDone();\n });\n\n pdfDataRangeTransport.transportReady();\n }\n\n _onReceiveData({ begin, chunk }) {\n // Prevent any possible issues by only transferring a Uint8Array that\n // completely \"utilizes\" its underlying ArrayBuffer.\n const buffer =\n chunk instanceof Uint8Array &&\n chunk.byteLength === chunk.buffer.byteLength\n ? chunk.buffer\n : new Uint8Array(chunk).buffer;\n\n if (begin === undefined) {\n if (this._fullRequestReader) {\n this._fullRequestReader._enqueue(buffer);\n } else {\n this._queuedChunks.push(buffer);\n }\n } else {\n const found = this._rangeReaders.some(function (rangeReader) {\n if (rangeReader._begin !== begin) {\n return false;\n }\n rangeReader._enqueue(buffer);\n return true;\n });\n assert(\n found,\n \"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.\"\n );\n }\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n _onProgress(evt) {\n if (evt.total === undefined) {\n // Reporting to first range reader, if it exists.\n this._rangeReaders[0]?.onProgress?.({ loaded: evt.loaded });\n } else {\n this._fullRequestReader?.onProgress?.({\n loaded: evt.loaded,\n total: evt.total,\n });\n }\n }\n\n _onProgressiveDone() {\n this._fullRequestReader?.progressiveDone();\n this._progressiveDone = true;\n }\n\n _removeRangeReader(reader) {\n const i = this._rangeReaders.indexOf(reader);\n if (i >= 0) {\n this._rangeReaders.splice(i, 1);\n }\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFDataTransportStream.getFullReader can only be called once.\"\n );\n const queuedChunks = this._queuedChunks;\n this._queuedChunks = null;\n return new PDFDataTransportStreamReader(\n this,\n queuedChunks,\n this._progressiveDone,\n this._contentDispositionFilename\n );\n }\n\n getRangeReader(begin, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const reader = new PDFDataTransportStreamRangeReader(this, begin, end);\n this._pdfDataRangeTransport.requestDataRange(begin, end);\n this._rangeReaders.push(reader);\n return reader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeReaders.slice(0)) {\n reader.cancel(reason);\n }\n this._pdfDataRangeTransport.abort();\n }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFDataTransportStreamReader {\n constructor(\n stream,\n queuedChunks,\n progressiveDone = false,\n contentDispositionFilename = null\n ) {\n this._stream = stream;\n this._done = progressiveDone || false;\n this._filename = isPdfFile(contentDispositionFilename)\n ? contentDispositionFilename\n : null;\n this._queuedChunks = queuedChunks || [];\n this._loaded = 0;\n for (const chunk of this._queuedChunks) {\n this._loaded += chunk.byteLength;\n }\n this._requests = [];\n this._headersReady = Promise.resolve();\n stream._fullRequestReader = this;\n\n this.onProgress = null;\n }\n\n _enqueue(chunk) {\n if (this._done) {\n return; // Ignore new data.\n }\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n requestCapability.resolve({ value: chunk, done: false });\n } else {\n this._queuedChunks.push(chunk);\n }\n this._loaded += chunk.byteLength;\n }\n\n get headersReady() {\n return this._headersReady;\n }\n\n get filename() {\n return this._filename;\n }\n\n get isRangeSupported() {\n return this._stream._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._stream._isStreamingSupported;\n }\n\n get contentLength() {\n return this._stream._contentLength;\n }\n\n async read() {\n if (this._queuedChunks.length > 0) {\n const chunk = this._queuedChunks.shift();\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = Promise.withResolvers();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n }\n\n progressiveDone() {\n if (this._done) {\n return;\n }\n this._done = true;\n }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFDataTransportStreamRangeReader {\n constructor(stream, begin, end) {\n this._stream = stream;\n this._begin = begin;\n this._end = end;\n this._queuedChunk = null;\n this._requests = [];\n this._done = false;\n\n this.onProgress = null;\n }\n\n _enqueue(chunk) {\n if (this._done) {\n return; // ignore new data\n }\n if (this._requests.length === 0) {\n this._queuedChunk = chunk;\n } else {\n const requestsCapability = this._requests.shift();\n requestsCapability.resolve({ value: chunk, done: false });\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n }\n this._done = true;\n this._stream._removeRangeReader(this);\n }\n\n get isStreamingSupported() {\n return false;\n }\n\n async read() {\n if (this._queuedChunk) {\n const chunk = this._queuedChunk;\n this._queuedChunk = null;\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = Promise.withResolvers();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n this._stream._removeRangeReader(this);\n }\n}\n\nexport { PDFDataTransportStream };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n assert,\n MissingPDFException,\n UnexpectedResponseException,\n} from \"../shared/util.js\";\nimport { getFilenameFromContentDispositionHeader } from \"./content_disposition.js\";\nimport { isPdfFile } from \"./display_utils.js\";\n\nfunction createHeaders(isHttp, httpHeaders) {\n const headers = new Headers();\n\n if (!isHttp || !httpHeaders || typeof httpHeaders !== \"object\") {\n return headers;\n }\n for (const key in httpHeaders) {\n const val = httpHeaders[key];\n if (val !== undefined) {\n headers.append(key, val);\n }\n }\n return headers;\n}\n\nfunction validateRangeRequestCapabilities({\n responseHeaders,\n isHttp,\n rangeChunkSize,\n disableRange,\n}) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n Number.isInteger(rangeChunkSize) && rangeChunkSize > 0,\n \"rangeChunkSize must be an integer larger than zero.\"\n );\n }\n const returnValues = {\n allowRangeRequests: false,\n suggestedLength: undefined,\n };\n\n const length = parseInt(responseHeaders.get(\"Content-Length\"), 10);\n if (!Number.isInteger(length)) {\n return returnValues;\n }\n\n returnValues.suggestedLength = length;\n\n if (length <= 2 * rangeChunkSize) {\n // The file size is smaller than the size of two chunks, so it does not\n // make any sense to abort the request and retry with a range request.\n return returnValues;\n }\n\n if (disableRange || !isHttp) {\n return returnValues;\n }\n if (responseHeaders.get(\"Accept-Ranges\") !== \"bytes\") {\n return returnValues;\n }\n\n const contentEncoding = responseHeaders.get(\"Content-Encoding\") || \"identity\";\n if (contentEncoding !== \"identity\") {\n return returnValues;\n }\n\n returnValues.allowRangeRequests = true;\n return returnValues;\n}\n\nfunction extractFilenameFromHeader(responseHeaders) {\n const contentDisposition = responseHeaders.get(\"Content-Disposition\");\n if (contentDisposition) {\n let filename = getFilenameFromContentDispositionHeader(contentDisposition);\n if (filename.includes(\"%\")) {\n try {\n filename = decodeURIComponent(filename);\n } catch {}\n }\n if (isPdfFile(filename)) {\n return filename;\n }\n }\n return null;\n}\n\nfunction createResponseStatusError(status, url) {\n if (status === 404 || (status === 0 && url.startsWith(\"file:\"))) {\n return new MissingPDFException('Missing PDF \"' + url + '\".');\n }\n return new UnexpectedResponseException(\n `Unexpected server response (${status}) while retrieving PDF \"${url}\".`,\n status\n );\n}\n\nfunction validateResponseStatus(status) {\n return status === 200 || status === 206;\n}\n\nexport {\n createHeaders,\n createResponseStatusError,\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n validateResponseStatus,\n};\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { stringToBytes } from \"../shared/util.js\";\n\n// This getFilenameFromContentDispositionHeader function is adapted from\n// https://github.com/Rob--W/open-in-browser/blob/7e2e35a38b8b4e981b11da7b2f01df0149049e92/extension/content-disposition.js\n// with the following changes:\n// - Modified to conform to PDF.js's coding style.\n// - Move return to the end of the function to prevent Babel from dropping the\n// function declarations.\n\n/**\n * Extract file name from the Content-Disposition HTTP response header.\n *\n * @param {string} contentDisposition\n * @returns {string} Filename, if found in the Content-Disposition header.\n */\nfunction getFilenameFromContentDispositionHeader(contentDisposition) {\n let needsEncodingFixup = true;\n\n // filename*=ext-value (\"ext-value\" from RFC 5987, referenced by RFC 6266).\n let tmp = toParamRegExp(\"filename\\\\*\", \"i\").exec(contentDisposition);\n if (tmp) {\n tmp = tmp[1];\n let filename = rfc2616unquote(tmp);\n filename = unescape(filename);\n filename = rfc5987decode(filename);\n filename = rfc2047decode(filename);\n return fixupEncoding(filename);\n }\n\n // Continuations (RFC 2231 section 3, referenced by RFC 5987 section 3.1).\n // filename*n*=part\n // filename*n=part\n tmp = rfc2231getparam(contentDisposition);\n if (tmp) {\n // RFC 2047, section\n const filename = rfc2047decode(tmp);\n return fixupEncoding(filename);\n }\n\n // filename=value (RFC 5987, section 4.1).\n tmp = toParamRegExp(\"filename\", \"i\").exec(contentDisposition);\n if (tmp) {\n tmp = tmp[1];\n let filename = rfc2616unquote(tmp);\n filename = rfc2047decode(filename);\n return fixupEncoding(filename);\n }\n\n // After this line there are only function declarations. We cannot put\n // \"return\" here for readability because babel would then drop the function\n // declarations...\n function toParamRegExp(attributePattern, flags) {\n return new RegExp(\n \"(?:^|;)\\\\s*\" +\n attributePattern +\n \"\\\\s*=\\\\s*\" +\n // Captures: value = token | quoted-string\n // (RFC 2616, section 3.6 and referenced by RFC 6266 4.1)\n \"(\" +\n '[^\";\\\\s][^;\\\\s]*' +\n \"|\" +\n '\"(?:[^\"\\\\\\\\]|\\\\\\\\\"?)+\"?' +\n \")\",\n flags\n );\n }\n function textdecode(encoding, value) {\n if (encoding) {\n if (!/^[\\x00-\\xFF]+$/.test(value)) {\n return value;\n }\n try {\n const decoder = new TextDecoder(encoding, { fatal: true });\n const buffer = stringToBytes(value);\n value = decoder.decode(buffer);\n needsEncodingFixup = false;\n } catch {\n // TextDecoder constructor threw - unrecognized encoding.\n }\n }\n return value;\n }\n function fixupEncoding(value) {\n if (needsEncodingFixup && /[\\x80-\\xff]/.test(value)) {\n // Maybe multi-byte UTF-8.\n value = textdecode(\"utf-8\", value);\n if (needsEncodingFixup) {\n // Try iso-8859-1 encoding.\n value = textdecode(\"iso-8859-1\", value);\n }\n }\n return value;\n }\n function rfc2231getparam(contentDispositionStr) {\n const matches = [];\n let match;\n // Iterate over all filename*n= and filename*n*= with n being an integer\n // of at least zero. Any non-zero number must not start with '0'.\n const iter = toParamRegExp(\"filename\\\\*((?!0\\\\d)\\\\d+)(\\\\*?)\", \"ig\");\n while ((match = iter.exec(contentDispositionStr)) !== null) {\n let [, n, quot, part] = match; // eslint-disable-line prefer-const\n n = parseInt(n, 10);\n if (n in matches) {\n // Ignore anything after the invalid second filename*0.\n if (n === 0) {\n break;\n }\n continue;\n }\n matches[n] = [quot, part];\n }\n const parts = [];\n for (let n = 0; n < matches.length; ++n) {\n if (!(n in matches)) {\n // Numbers must be consecutive. Truncate when there is a hole.\n break;\n }\n let [quot, part] = matches[n]; // eslint-disable-line prefer-const\n part = rfc2616unquote(part);\n if (quot) {\n part = unescape(part);\n if (n === 0) {\n part = rfc5987decode(part);\n }\n }\n parts.push(part);\n }\n return parts.join(\"\");\n }\n function rfc2616unquote(value) {\n if (value.startsWith('\"')) {\n const parts = value.slice(1).split('\\\\\"');\n // Find the first unescaped \" and terminate there.\n for (let i = 0; i < parts.length; ++i) {\n const quotindex = parts[i].indexOf('\"');\n if (quotindex !== -1) {\n parts[i] = parts[i].slice(0, quotindex);\n parts.length = i + 1; // Truncates and stop the iteration.\n }\n parts[i] = parts[i].replaceAll(/\\\\(.)/g, \"$1\");\n }\n value = parts.join('\"');\n }\n return value;\n }\n function rfc5987decode(extvalue) {\n // Decodes \"ext-value\" from RFC 5987.\n const encodingend = extvalue.indexOf(\"'\");\n if (encodingend === -1) {\n // Some servers send \"filename*=\" without encoding 'language' prefix,\n // e.g. in https://github.com/Rob--W/open-in-browser/issues/26\n // Let's accept the value like Firefox (57) (Chrome 62 rejects it).\n return extvalue;\n }\n const encoding = extvalue.slice(0, encodingend);\n const langvalue = extvalue.slice(encodingend + 1);\n // Ignore language (RFC 5987 section 3.2.1, and RFC 6266 section 4.1 ).\n const value = langvalue.replace(/^[^']*'/, \"\");\n return textdecode(encoding, value);\n }\n function rfc2047decode(value) {\n // RFC 2047-decode the result. Firefox tried to drop support for it, but\n // backed out because some servers use it - https://bugzil.la/875615\n // Firefox's condition for decoding is here: https://searchfox.org/mozilla-central/rev/4a590a5a15e35d88a3b23dd6ac3c471cf85b04a8/netwerk/mime/nsMIMEHeaderParamImpl.cpp#742-748\n\n // We are more strict and only recognize RFC 2047-encoding if the value\n // starts with \"=?\", since then it is likely that the full value is\n // RFC 2047-encoded.\n\n // Firefox also decodes words even where RFC 2047 section 5 states:\n // \"An 'encoded-word' MUST NOT appear within a 'quoted-string'.\"\n if (!value.startsWith(\"=?\") || /[\\x00-\\x19\\x80-\\xff]/.test(value)) {\n return value;\n }\n // RFC 2047, section 2.4\n // encoded-word = \"=?\" charset \"?\" encoding \"?\" encoded-text \"?=\"\n // charset = token (but let's restrict to characters that denote a\n // possibly valid encoding).\n // encoding = q or b\n // encoded-text = any printable ASCII character other than ? or space.\n // ... but Firefox permits ? and space.\n return value.replaceAll(\n /=\\?([\\w-]*)\\?([QqBb])\\?((?:[^?]|\\?(?!=))*)\\?=/g,\n function (matches, charset, encoding, text) {\n if (encoding === \"q\" || encoding === \"Q\") {\n // RFC 2047 section 4.2.\n text = text.replaceAll(\"_\", \" \");\n text = text.replaceAll(/=([0-9a-fA-F]{2})/g, function (match, hex) {\n return String.fromCharCode(parseInt(hex, 16));\n });\n return textdecode(charset, text);\n } // else encoding is b or B - base64 (RFC 2047 section 4.1)\n try {\n text = atob(text);\n } catch {}\n return textdecode(charset, text);\n }\n );\n }\n\n return \"\";\n}\n\nexport { getFilenameFromContentDispositionHeader };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AbortException, assert, warn } from \"../shared/util.js\";\nimport {\n createHeaders,\n createResponseStatusError,\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n validateResponseStatus,\n} from \"./network_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./fetch_stream.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nfunction createFetchOptions(headers, withCredentials, abortController) {\n return {\n method: \"GET\",\n headers,\n signal: abortController.signal,\n mode: \"cors\",\n credentials: withCredentials ? \"include\" : \"same-origin\",\n redirect: \"follow\",\n };\n}\n\nfunction getArrayBuffer(val) {\n if (val instanceof Uint8Array) {\n return val.buffer;\n }\n if (val instanceof ArrayBuffer) {\n return val;\n }\n warn(`getArrayBuffer - unexpected data format: ${val}`);\n return new Uint8Array(val).buffer;\n}\n\n/** @implements {IPDFStream} */\nclass PDFFetchStream {\n constructor(source) {\n this.source = source;\n this.isHttp = /^https?:/i.test(source.url);\n this.headers = createHeaders(this.isHttp, source.httpHeaders);\n\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFFetchStream.getFullReader can only be called once.\"\n );\n this._fullRequestReader = new PDFFetchStreamReader(this);\n return this._fullRequestReader;\n }\n\n getRangeReader(begin, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const reader = new PDFFetchStreamRangeReader(this, begin, end);\n this._rangeRequestReaders.push(reader);\n return reader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFFetchStreamReader {\n constructor(stream) {\n this._stream = stream;\n this._reader = null;\n this._loaded = 0;\n this._filename = null;\n const source = stream.source;\n this._withCredentials = source.withCredentials || false;\n this._contentLength = source.length;\n this._headersCapability = Promise.withResolvers();\n this._disableRange = source.disableRange || false;\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._abortController = new AbortController();\n this._isStreamingSupported = !source.disableStream;\n this._isRangeSupported = !source.disableRange;\n // Always create a copy of the headers.\n const headers = new Headers(stream.headers);\n\n const url = source.url;\n fetch(\n url,\n createFetchOptions(headers, this._withCredentials, this._abortController)\n )\n .then(response => {\n if (!validateResponseStatus(response.status)) {\n throw createResponseStatusError(response.status, url);\n }\n this._reader = response.body.getReader();\n this._headersCapability.resolve();\n\n const responseHeaders = response.headers;\n\n const { allowRangeRequests, suggestedLength } =\n validateRangeRequestCapabilities({\n responseHeaders,\n isHttp: stream.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange,\n });\n\n this._isRangeSupported = allowRangeRequests;\n // Setting right content length.\n this._contentLength = suggestedLength || this._contentLength;\n\n this._filename = extractFilenameFromHeader(responseHeaders);\n\n // We need to stop reading when range is supported and streaming is\n // disabled.\n if (!this._isStreamingSupported && this._isRangeSupported) {\n this.cancel(new AbortException(\"Streaming is disabled.\"));\n }\n })\n .catch(this._headersCapability.reject);\n\n this.onProgress = null;\n }\n\n get headersReady() {\n return this._headersCapability.promise;\n }\n\n get filename() {\n return this._filename;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._headersCapability.promise;\n const { value, done } = await this._reader.read();\n if (done) {\n return { value, done };\n }\n this._loaded += value.byteLength;\n this.onProgress?.({\n loaded: this._loaded,\n total: this._contentLength,\n });\n\n return { value: getArrayBuffer(value), done: false };\n }\n\n cancel(reason) {\n this._reader?.cancel(reason);\n this._abortController.abort();\n }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFFetchStreamRangeReader {\n constructor(stream, begin, end) {\n this._stream = stream;\n this._reader = null;\n this._loaded = 0;\n const source = stream.source;\n this._withCredentials = source.withCredentials || false;\n this._readCapability = Promise.withResolvers();\n this._isStreamingSupported = !source.disableStream;\n\n this._abortController = new AbortController();\n // Always create a copy of the headers.\n const headers = new Headers(stream.headers);\n headers.append(\"Range\", `bytes=${begin}-${end - 1}`);\n\n const url = source.url;\n fetch(\n url,\n createFetchOptions(headers, this._withCredentials, this._abortController)\n )\n .then(response => {\n if (!validateResponseStatus(response.status)) {\n throw createResponseStatusError(response.status, url);\n }\n this._readCapability.resolve();\n this._reader = response.body.getReader();\n })\n .catch(this._readCapability.reject);\n\n this.onProgress = null;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n const { value, done } = await this._reader.read();\n if (done) {\n return { value, done };\n }\n this._loaded += value.byteLength;\n this.onProgress?.({ loaded: this._loaded });\n\n return { value: getArrayBuffer(value), done: false };\n }\n\n cancel(reason) {\n this._reader?.cancel(reason);\n this._abortController.abort();\n }\n}\n\nexport { PDFFetchStream };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { assert, stringToBytes } from \"../shared/util.js\";\nimport {\n createHeaders,\n createResponseStatusError,\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n} from \"./network_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./network.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nconst OK_RESPONSE = 200;\nconst PARTIAL_CONTENT_RESPONSE = 206;\n\nfunction getArrayBuffer(xhr) {\n const data = xhr.response;\n if (typeof data !== \"string\") {\n return data;\n }\n return stringToBytes(data).buffer;\n}\n\nclass NetworkManager {\n constructor({ url, httpHeaders, withCredentials }) {\n this.url = url;\n this.isHttp = /^https?:/i.test(url);\n this.headers = createHeaders(this.isHttp, httpHeaders);\n this.withCredentials = withCredentials || false;\n\n this.currXhrId = 0;\n this.pendingRequests = Object.create(null);\n }\n\n requestRange(begin, end, listeners) {\n const args = {\n begin,\n end,\n };\n for (const prop in listeners) {\n args[prop] = listeners[prop];\n }\n return this.request(args);\n }\n\n requestFull(listeners) {\n return this.request(listeners);\n }\n\n request(args) {\n const xhr = new XMLHttpRequest();\n const xhrId = this.currXhrId++;\n const pendingRequest = (this.pendingRequests[xhrId] = { xhr });\n\n xhr.open(\"GET\", this.url);\n xhr.withCredentials = this.withCredentials;\n for (const [key, val] of this.headers) {\n xhr.setRequestHeader(key, val);\n }\n if (this.isHttp && \"begin\" in args && \"end\" in args) {\n xhr.setRequestHeader(\"Range\", `bytes=${args.begin}-${args.end - 1}`);\n pendingRequest.expectedStatus = PARTIAL_CONTENT_RESPONSE;\n } else {\n pendingRequest.expectedStatus = OK_RESPONSE;\n }\n xhr.responseType = \"arraybuffer\";\n\n if (args.onError) {\n xhr.onerror = function (evt) {\n args.onError(xhr.status);\n };\n }\n xhr.onreadystatechange = this.onStateChange.bind(this, xhrId);\n xhr.onprogress = this.onProgress.bind(this, xhrId);\n\n pendingRequest.onHeadersReceived = args.onHeadersReceived;\n pendingRequest.onDone = args.onDone;\n pendingRequest.onError = args.onError;\n pendingRequest.onProgress = args.onProgress;\n\n xhr.send(null);\n\n return xhrId;\n }\n\n onProgress(xhrId, evt) {\n const pendingRequest = this.pendingRequests[xhrId];\n if (!pendingRequest) {\n return; // Maybe abortRequest was called...\n }\n pendingRequest.onProgress?.(evt);\n }\n\n onStateChange(xhrId, evt) {\n const pendingRequest = this.pendingRequests[xhrId];\n if (!pendingRequest) {\n return; // Maybe abortRequest was called...\n }\n\n const xhr = pendingRequest.xhr;\n if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) {\n pendingRequest.onHeadersReceived();\n delete pendingRequest.onHeadersReceived;\n }\n\n if (xhr.readyState !== 4) {\n return;\n }\n\n if (!(xhrId in this.pendingRequests)) {\n // The XHR request might have been aborted in onHeadersReceived()\n // callback, in which case we should abort request.\n return;\n }\n\n delete this.pendingRequests[xhrId];\n\n // Success status == 0 can be on ftp, file and other protocols.\n if (xhr.status === 0 && this.isHttp) {\n pendingRequest.onError?.(xhr.status);\n return;\n }\n const xhrStatus = xhr.status || OK_RESPONSE;\n\n // From http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.2:\n // \"A server MAY ignore the Range header\". This means it's possible to\n // get a 200 rather than a 206 response from a range request.\n const ok_response_on_range_request =\n xhrStatus === OK_RESPONSE &&\n pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE;\n\n if (\n !ok_response_on_range_request &&\n xhrStatus !== pendingRequest.expectedStatus\n ) {\n pendingRequest.onError?.(xhr.status);\n return;\n }\n\n const chunk = getArrayBuffer(xhr);\n if (xhrStatus === PARTIAL_CONTENT_RESPONSE) {\n const rangeHeader = xhr.getResponseHeader(\"Content-Range\");\n const matches = /bytes (\\d+)-(\\d+)\\/(\\d+)/.exec(rangeHeader);\n pendingRequest.onDone({\n begin: parseInt(matches[1], 10),\n chunk,\n });\n } else if (chunk) {\n pendingRequest.onDone({\n begin: 0,\n chunk,\n });\n } else {\n pendingRequest.onError?.(xhr.status);\n }\n }\n\n getRequestXhr(xhrId) {\n return this.pendingRequests[xhrId].xhr;\n }\n\n isPendingRequest(xhrId) {\n return xhrId in this.pendingRequests;\n }\n\n abortRequest(xhrId) {\n const xhr = this.pendingRequests[xhrId].xhr;\n delete this.pendingRequests[xhrId];\n xhr.abort();\n }\n}\n\n/** @implements {IPDFStream} */\nclass PDFNetworkStream {\n constructor(source) {\n this._source = source;\n this._manager = new NetworkManager(source);\n this._rangeChunkSize = source.rangeChunkSize;\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n _onRangeRequestReaderClosed(reader) {\n const i = this._rangeRequestReaders.indexOf(reader);\n if (i >= 0) {\n this._rangeRequestReaders.splice(i, 1);\n }\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFNetworkStream.getFullReader can only be called once.\"\n );\n this._fullRequestReader = new PDFNetworkStreamFullRequestReader(\n this._manager,\n this._source\n );\n return this._fullRequestReader;\n }\n\n getRangeReader(begin, end) {\n const reader = new PDFNetworkStreamRangeRequestReader(\n this._manager,\n begin,\n end\n );\n reader.onClosed = this._onRangeRequestReaderClosed.bind(this);\n this._rangeRequestReaders.push(reader);\n return reader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFNetworkStreamFullRequestReader {\n constructor(manager, source) {\n this._manager = manager;\n\n const args = {\n onHeadersReceived: this._onHeadersReceived.bind(this),\n onDone: this._onDone.bind(this),\n onError: this._onError.bind(this),\n onProgress: this._onProgress.bind(this),\n };\n this._url = source.url;\n this._fullRequestId = manager.requestFull(args);\n this._headersCapability = Promise.withResolvers();\n this._disableRange = source.disableRange || false;\n this._contentLength = source.length; // Optional\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._isStreamingSupported = false;\n this._isRangeSupported = false;\n\n this._cachedChunks = [];\n this._requests = [];\n this._done = false;\n this._storedError = undefined;\n this._filename = null;\n\n this.onProgress = null;\n }\n\n _onHeadersReceived() {\n const fullRequestXhrId = this._fullRequestId;\n const fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId);\n\n const responseHeaders = new Headers(\n fullRequestXhr\n .getAllResponseHeaders()\n .trim()\n .split(/[\\r\\n]+/)\n .map(x => {\n const [key, ...val] = x.split(\": \");\n return [key, val.join(\": \")];\n })\n );\n\n const { allowRangeRequests, suggestedLength } =\n validateRangeRequestCapabilities({\n responseHeaders,\n isHttp: this._manager.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange,\n });\n\n if (allowRangeRequests) {\n this._isRangeSupported = true;\n }\n // Setting right content length.\n this._contentLength = suggestedLength || this._contentLength;\n\n this._filename = extractFilenameFromHeader(responseHeaders);\n\n if (this._isRangeSupported) {\n // NOTE: by cancelling the full request, and then issuing range\n // requests, there will be an issue for sites where you can only\n // request the pdf once. However, if this is the case, then the\n // server should not be returning that it can support range requests.\n this._manager.abortRequest(fullRequestXhrId);\n }\n\n this._headersCapability.resolve();\n }\n\n _onDone(data) {\n if (data) {\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n requestCapability.resolve({ value: data.chunk, done: false });\n } else {\n this._cachedChunks.push(data.chunk);\n }\n }\n this._done = true;\n if (this._cachedChunks.length > 0) {\n return;\n }\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n }\n\n _onError(status) {\n this._storedError = createResponseStatusError(status, this._url);\n this._headersCapability.reject(this._storedError);\n for (const requestCapability of this._requests) {\n requestCapability.reject(this._storedError);\n }\n this._requests.length = 0;\n this._cachedChunks.length = 0;\n }\n\n _onProgress(evt) {\n this.onProgress?.({\n loaded: evt.loaded,\n total: evt.lengthComputable ? evt.total : this._contentLength,\n });\n }\n\n get filename() {\n return this._filename;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get headersReady() {\n return this._headersCapability.promise;\n }\n\n async read() {\n if (this._storedError) {\n throw this._storedError;\n }\n if (this._cachedChunks.length > 0) {\n const chunk = this._cachedChunks.shift();\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = Promise.withResolvers();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n this._headersCapability.reject(reason);\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n if (this._manager.isPendingRequest(this._fullRequestId)) {\n this._manager.abortRequest(this._fullRequestId);\n }\n this._fullRequestReader = null;\n }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFNetworkStreamRangeRequestReader {\n constructor(manager, begin, end) {\n this._manager = manager;\n\n const args = {\n onDone: this._onDone.bind(this),\n onError: this._onError.bind(this),\n onProgress: this._onProgress.bind(this),\n };\n this._url = manager.url;\n this._requestId = manager.requestRange(begin, end, args);\n this._requests = [];\n this._queuedChunk = null;\n this._done = false;\n this._storedError = undefined;\n\n this.onProgress = null;\n this.onClosed = null;\n }\n\n _close() {\n this.onClosed?.(this);\n }\n\n _onDone(data) {\n const chunk = data.chunk;\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n requestCapability.resolve({ value: chunk, done: false });\n } else {\n this._queuedChunk = chunk;\n }\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n this._close();\n }\n\n _onError(status) {\n this._storedError = createResponseStatusError(status, this._url);\n for (const requestCapability of this._requests) {\n requestCapability.reject(this._storedError);\n }\n this._requests.length = 0;\n this._queuedChunk = null;\n }\n\n _onProgress(evt) {\n if (!this.isStreamingSupported) {\n this.onProgress?.({ loaded: evt.loaded });\n }\n }\n\n get isStreamingSupported() {\n return false;\n }\n\n async read() {\n if (this._storedError) {\n throw this._storedError;\n }\n if (this._queuedChunk !== null) {\n const chunk = this._queuedChunk;\n this._queuedChunk = null;\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = Promise.withResolvers();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n if (this._manager.isPendingRequest(this._requestId)) {\n this._manager.abortRequest(this._requestId);\n }\n this._close();\n }\n}\n\nexport { PDFNetworkStream };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AbortException, assert, MissingPDFException } from \"../shared/util.js\";\nimport {\n createHeaders,\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n} from \"./network_utils.js\";\nimport { NodePackages } from \"./node_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./node_stream.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nconst urlRegex = /^[a-z][a-z0-9\\-+.]+:/i;\n\nfunction parseUrlOrPath(sourceUrl) {\n if (urlRegex.test(sourceUrl)) {\n return new URL(sourceUrl);\n }\n const url = NodePackages.get(\"url\");\n return new URL(url.pathToFileURL(sourceUrl));\n}\n\nfunction createRequest(url, headers, callback) {\n if (url.protocol === \"http:\") {\n const http = NodePackages.get(\"http\");\n return http.request(url, { headers }, callback);\n }\n const https = NodePackages.get(\"https\");\n return https.request(url, { headers }, callback);\n}\n\nclass PDFNodeStream {\n constructor(source) {\n this.source = source;\n this.url = parseUrlOrPath(source.url);\n this.isHttp =\n this.url.protocol === \"http:\" || this.url.protocol === \"https:\";\n // Check if url refers to filesystem.\n this.isFsUrl = this.url.protocol === \"file:\";\n this.headers = createHeaders(this.isHttp, source.httpHeaders);\n\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFNodeStream.getFullReader can only be called once.\"\n );\n this._fullRequestReader = this.isFsUrl\n ? new PDFNodeStreamFsFullReader(this)\n : new PDFNodeStreamFullReader(this);\n return this._fullRequestReader;\n }\n\n getRangeReader(start, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const rangeReader = this.isFsUrl\n ? new PDFNodeStreamFsRangeReader(this, start, end)\n : new PDFNodeStreamRangeReader(this, start, end);\n this._rangeRequestReaders.push(rangeReader);\n return rangeReader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n}\n\nclass BaseFullReader {\n constructor(stream) {\n this._url = stream.url;\n this._done = false;\n this._storedError = null;\n this.onProgress = null;\n const source = stream.source;\n this._contentLength = source.length; // optional\n this._loaded = 0;\n this._filename = null;\n\n this._disableRange = source.disableRange || false;\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._isStreamingSupported = !source.disableStream;\n this._isRangeSupported = !source.disableRange;\n\n this._readableStream = null;\n this._readCapability = Promise.withResolvers();\n this._headersCapability = Promise.withResolvers();\n }\n\n get headersReady() {\n return this._headersCapability.promise;\n }\n\n get filename() {\n return this._filename;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n if (this._done) {\n return { value: undefined, done: true };\n }\n if (this._storedError) {\n throw this._storedError;\n }\n\n const chunk = this._readableStream.read();\n if (chunk === null) {\n this._readCapability = Promise.withResolvers();\n return this.read();\n }\n this._loaded += chunk.length;\n this.onProgress?.({\n loaded: this._loaded,\n total: this._contentLength,\n });\n\n // Ensure that `read()` method returns ArrayBuffer.\n const buffer = new Uint8Array(chunk).buffer;\n return { value: buffer, done: false };\n }\n\n cancel(reason) {\n // Call `this._error()` method when cancel is called\n // before _readableStream is set.\n if (!this._readableStream) {\n this._error(reason);\n return;\n }\n this._readableStream.destroy(reason);\n }\n\n _error(reason) {\n this._storedError = reason;\n this._readCapability.resolve();\n }\n\n _setReadableStream(readableStream) {\n this._readableStream = readableStream;\n readableStream.on(\"readable\", () => {\n this._readCapability.resolve();\n });\n\n readableStream.on(\"end\", () => {\n // Destroy readable to minimize resource usage.\n readableStream.destroy();\n this._done = true;\n this._readCapability.resolve();\n });\n\n readableStream.on(\"error\", reason => {\n this._error(reason);\n });\n\n // We need to stop reading when range is supported and streaming is\n // disabled.\n if (!this._isStreamingSupported && this._isRangeSupported) {\n this._error(new AbortException(\"streaming is disabled\"));\n }\n\n // Destroy ReadableStream if already in errored state.\n if (this._storedError) {\n this._readableStream.destroy(this._storedError);\n }\n }\n}\n\nclass BaseRangeReader {\n constructor(stream) {\n this._url = stream.url;\n this._done = false;\n this._storedError = null;\n this.onProgress = null;\n this._loaded = 0;\n this._readableStream = null;\n this._readCapability = Promise.withResolvers();\n const source = stream.source;\n this._isStreamingSupported = !source.disableStream;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n if (this._done) {\n return { value: undefined, done: true };\n }\n if (this._storedError) {\n throw this._storedError;\n }\n\n const chunk = this._readableStream.read();\n if (chunk === null) {\n this._readCapability = Promise.withResolvers();\n return this.read();\n }\n this._loaded += chunk.length;\n this.onProgress?.({ loaded: this._loaded });\n\n // Ensure that `read()` method returns ArrayBuffer.\n const buffer = new Uint8Array(chunk).buffer;\n return { value: buffer, done: false };\n }\n\n cancel(reason) {\n // Call `this._error()` method when cancel is called\n // before _readableStream is set.\n if (!this._readableStream) {\n this._error(reason);\n return;\n }\n this._readableStream.destroy(reason);\n }\n\n _error(reason) {\n this._storedError = reason;\n this._readCapability.resolve();\n }\n\n _setReadableStream(readableStream) {\n this._readableStream = readableStream;\n readableStream.on(\"readable\", () => {\n this._readCapability.resolve();\n });\n\n readableStream.on(\"end\", () => {\n // Destroy readableStream to minimize resource usage.\n readableStream.destroy();\n this._done = true;\n this._readCapability.resolve();\n });\n\n readableStream.on(\"error\", reason => {\n this._error(reason);\n });\n\n // Destroy readableStream if already in errored state.\n if (this._storedError) {\n this._readableStream.destroy(this._storedError);\n }\n }\n}\n\nclass PDFNodeStreamFullReader extends BaseFullReader {\n constructor(stream) {\n super(stream);\n\n // Node.js requires the `headers` to be a regular Object.\n const headers = Object.fromEntries(stream.headers);\n\n const handleResponse = response => {\n if (response.statusCode === 404) {\n const error = new MissingPDFException(`Missing PDF \"${this._url}\".`);\n this._storedError = error;\n this._headersCapability.reject(error);\n return;\n }\n this._headersCapability.resolve();\n this._setReadableStream(response);\n\n const responseHeaders = new Headers(this._readableStream.headers);\n\n const { allowRangeRequests, suggestedLength } =\n validateRangeRequestCapabilities({\n responseHeaders,\n isHttp: stream.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange,\n });\n\n this._isRangeSupported = allowRangeRequests;\n // Setting right content length.\n this._contentLength = suggestedLength || this._contentLength;\n\n this._filename = extractFilenameFromHeader(responseHeaders);\n };\n\n this._request = createRequest(this._url, headers, handleResponse);\n\n this._request.on(\"error\", reason => {\n this._storedError = reason;\n this._headersCapability.reject(reason);\n });\n // Note: `request.end(data)` is used to write `data` to request body\n // and notify end of request. But one should always call `request.end()`\n // even if there is no data to write -- (to notify the end of request).\n this._request.end();\n }\n}\n\nclass PDFNodeStreamRangeReader extends BaseRangeReader {\n constructor(stream, start, end) {\n super(stream);\n\n // Node.js requires the `headers` to be a regular Object.\n const headers = Object.fromEntries(stream.headers);\n headers.Range = `bytes=${start}-${end - 1}`;\n\n const handleResponse = response => {\n if (response.statusCode === 404) {\n const error = new MissingPDFException(`Missing PDF \"${this._url}\".`);\n this._storedError = error;\n return;\n }\n this._setReadableStream(response);\n };\n\n this._request = createRequest(this._url, headers, handleResponse);\n\n this._request.on(\"error\", reason => {\n this._storedError = reason;\n });\n this._request.end();\n }\n}\n\nclass PDFNodeStreamFsFullReader extends BaseFullReader {\n constructor(stream) {\n super(stream);\n\n const fs = NodePackages.get(\"fs\");\n fs.promises.lstat(this._url).then(\n stat => {\n // Setting right content length.\n this._contentLength = stat.size;\n\n this._setReadableStream(fs.createReadStream(this._url));\n this._headersCapability.resolve();\n },\n error => {\n if (error.code === \"ENOENT\") {\n error = new MissingPDFException(`Missing PDF \"${this._url}\".`);\n }\n this._storedError = error;\n this._headersCapability.reject(error);\n }\n );\n }\n}\n\nclass PDFNodeStreamFsRangeReader extends BaseRangeReader {\n constructor(stream, start, end) {\n super(stream);\n\n const fs = NodePackages.get(\"fs\");\n this._setReadableStream(\n fs.createReadStream(this._url, { start, end: end - 1 })\n );\n }\n}\n\nexport { PDFNodeStream };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"./api\").TextContent} TextContent */\n\nimport {\n AbortException,\n FeatureTest,\n shadow,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport { setLayerDimensions } from \"./display_utils.js\";\n\n/**\n * @typedef {Object} TextLayerParameters\n * @property {ReadableStream | TextContent} textContentSource - Text content to\n * render, i.e. the value returned by the page's `streamTextContent` or\n * `getTextContent` method.\n * @property {HTMLElement} container - The DOM node that will contain the text\n * runs.\n * @property {PageViewport} viewport - The target viewport to properly layout\n * the text runs.\n */\n\n/**\n * @typedef {Object} TextLayerUpdateParameters\n * @property {PageViewport} viewport - The target viewport to properly layout\n * the text runs.\n * @property {function} [onBefore] - Callback invoked before the textLayer is\n * updated in the DOM.\n */\n\nconst MAX_TEXT_DIVS_TO_RENDER = 100000;\nconst DEFAULT_FONT_SIZE = 30;\nconst DEFAULT_FONT_ASCENT = 0.8;\n\nclass TextLayer {\n #capability = Promise.withResolvers();\n\n #container = null;\n\n #disableProcessItems = false;\n\n #fontInspectorEnabled = !!globalThis.FontInspector?.enabled;\n\n #lang = null;\n\n #layoutTextParams = null;\n\n #pageHeight = 0;\n\n #pageWidth = 0;\n\n #reader = null;\n\n #rootContainer = null;\n\n #rotation = 0;\n\n #scale = 0;\n\n #styleCache = Object.create(null);\n\n #textContentItemsStr = [];\n\n #textContentSource = null;\n\n #textDivs = [];\n\n #textDivProperties = new WeakMap();\n\n #transform = null;\n\n static #ascentCache = new Map();\n\n static #canvasContexts = new Map();\n\n static #canvasCtxFonts = new WeakMap();\n\n static #minFontSize = null;\n\n static #pendingTextLayers = new Set();\n\n /**\n * @param {TextLayerParameters} options\n */\n constructor({ textContentSource, container, viewport }) {\n if (textContentSource instanceof ReadableStream) {\n this.#textContentSource = textContentSource;\n } else if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n typeof textContentSource === \"object\"\n ) {\n this.#textContentSource = new ReadableStream({\n start(controller) {\n controller.enqueue(textContentSource);\n controller.close();\n },\n });\n } else {\n throw new Error('No \"textContentSource\" parameter specified.');\n }\n this.#container = this.#rootContainer = container;\n\n this.#scale = viewport.scale * (globalThis.devicePixelRatio || 1);\n this.#rotation = viewport.rotation;\n this.#layoutTextParams = {\n div: null,\n properties: null,\n ctx: null,\n };\n const { pageWidth, pageHeight, pageX, pageY } = viewport.rawDims;\n this.#transform = [1, 0, 0, -1, -pageX, pageY + pageHeight];\n this.#pageWidth = pageWidth;\n this.#pageHeight = pageHeight;\n\n TextLayer.#ensureMinFontSizeComputed();\n\n setLayerDimensions(container, viewport);\n\n // Always clean-up the temporary canvas once rendering is no longer pending.\n this.#capability.promise\n .finally(() => {\n TextLayer.#pendingTextLayers.delete(this);\n this.#layoutTextParams = null;\n this.#styleCache = null;\n })\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"pageWidth\", {\n get() {\n return this.#pageWidth;\n },\n });\n Object.defineProperty(this, \"pageHeight\", {\n get() {\n return this.#pageHeight;\n },\n });\n }\n }\n\n static get fontFamilyMap() {\n const { isWindows, isFirefox } = FeatureTest.platform;\n return shadow(\n this,\n \"fontFamilyMap\",\n new Map([\n [\n \"sans-serif\",\n `${isWindows && isFirefox ? \"Calibri, \" : \"\"}sans-serif`,\n ],\n [\n \"monospace\",\n `${isWindows && isFirefox ? \"Lucida Console, \" : \"\"}monospace`,\n ],\n ])\n );\n }\n\n /**\n * Render the textLayer.\n * @returns {Promise}\n */\n render() {\n const pump = () => {\n this.#reader.read().then(({ value, done }) => {\n if (done) {\n this.#capability.resolve();\n return;\n }\n this.#lang ??= value.lang;\n Object.assign(this.#styleCache, value.styles);\n this.#processItems(value.items);\n pump();\n }, this.#capability.reject);\n };\n this.#reader = this.#textContentSource.getReader();\n TextLayer.#pendingTextLayers.add(this);\n pump();\n\n return this.#capability.promise;\n }\n\n /**\n * Update a previously rendered textLayer, if necessary.\n * @param {TextLayerUpdateParameters} options\n * @returns {undefined}\n */\n update({ viewport, onBefore = null }) {\n const scale = viewport.scale * (globalThis.devicePixelRatio || 1);\n const rotation = viewport.rotation;\n\n if (rotation !== this.#rotation) {\n onBefore?.();\n this.#rotation = rotation;\n setLayerDimensions(this.#rootContainer, { rotation });\n }\n\n if (scale !== this.#scale) {\n onBefore?.();\n this.#scale = scale;\n const params = {\n div: null,\n properties: null,\n ctx: TextLayer.#getCtx(this.#lang),\n };\n for (const div of this.#textDivs) {\n params.properties = this.#textDivProperties.get(div);\n params.div = div;\n this.#layout(params);\n }\n }\n }\n\n /**\n * Cancel rendering of the textLayer.\n * @returns {undefined}\n */\n cancel() {\n const abortEx = new AbortException(\"TextLayer task cancelled.\");\n\n this.#reader?.cancel(abortEx).catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n this.#reader = null;\n\n this.#capability.reject(abortEx);\n }\n\n /**\n * @type {Array} HTML elements that correspond to the text items\n * of the textContent input.\n * This is output and will initially be set to an empty array.\n */\n get textDivs() {\n return this.#textDivs;\n }\n\n /**\n * @type {Array} Strings that correspond to the `str` property of\n * the text items of the textContent input.\n * This is output and will initially be set to an empty array\n */\n get textContentItemsStr() {\n return this.#textContentItemsStr;\n }\n\n #processItems(items) {\n if (this.#disableProcessItems) {\n return;\n }\n this.#layoutTextParams.ctx ??= TextLayer.#getCtx(this.#lang);\n\n const textDivs = this.#textDivs,\n textContentItemsStr = this.#textContentItemsStr;\n\n for (const item of items) {\n // No point in rendering many divs as it would make the browser\n // unusable even after the divs are rendered.\n if (textDivs.length > MAX_TEXT_DIVS_TO_RENDER) {\n warn(\"Ignoring additional textDivs for performance reasons.\");\n\n this.#disableProcessItems = true; // Avoid multiple warnings for one page.\n return;\n }\n\n if (item.str === undefined) {\n if (\n item.type === \"beginMarkedContentProps\" ||\n item.type === \"beginMarkedContent\"\n ) {\n const parent = this.#container;\n this.#container = document.createElement(\"span\");\n this.#container.classList.add(\"markedContent\");\n if (item.id !== null) {\n this.#container.setAttribute(\"id\", `${item.id}`);\n }\n parent.append(this.#container);\n } else if (item.type === \"endMarkedContent\") {\n this.#container = this.#container.parentNode;\n }\n continue;\n }\n textContentItemsStr.push(item.str);\n this.#appendText(item);\n }\n }\n\n #appendText(geom) {\n // Initialize all used properties to keep the caches monomorphic.\n const textDiv = document.createElement(\"span\");\n const textDivProperties = {\n angle: 0,\n canvasWidth: 0,\n hasText: geom.str !== \"\",\n hasEOL: geom.hasEOL,\n fontSize: 0,\n };\n this.#textDivs.push(textDiv);\n\n const tx = Util.transform(this.#transform, geom.transform);\n let angle = Math.atan2(tx[1], tx[0]);\n const style = this.#styleCache[geom.fontName];\n if (style.vertical) {\n angle += Math.PI / 2;\n }\n\n let fontFamily =\n (this.#fontInspectorEnabled && style.fontSubstitution) ||\n style.fontFamily;\n\n // Workaround for bug 1922063.\n fontFamily = TextLayer.fontFamilyMap.get(fontFamily) || fontFamily;\n const fontHeight = Math.hypot(tx[2], tx[3]);\n const fontAscent =\n fontHeight * TextLayer.#getAscent(fontFamily, this.#lang);\n\n let left, top;\n if (angle === 0) {\n left = tx[4];\n top = tx[5] - fontAscent;\n } else {\n left = tx[4] + fontAscent * Math.sin(angle);\n top = tx[5] - fontAscent * Math.cos(angle);\n }\n\n const scaleFactorStr = \"calc(var(--scale-factor)*\";\n const divStyle = textDiv.style;\n // Setting the style properties individually, rather than all at once,\n // should be OK since the `textDiv` isn't appended to the document yet.\n if (this.#container === this.#rootContainer) {\n divStyle.left = `${((100 * left) / this.#pageWidth).toFixed(2)}%`;\n divStyle.top = `${((100 * top) / this.#pageHeight).toFixed(2)}%`;\n } else {\n // We're in a marked content span, hence we can't use percents.\n divStyle.left = `${scaleFactorStr}${left.toFixed(2)}px)`;\n divStyle.top = `${scaleFactorStr}${top.toFixed(2)}px)`;\n }\n // We multiply the font size by #minFontSize, and then #layout will\n // scale the element by 1/#minFontSize. This allows us to effectively\n // ignore the minimum font size enforced by the browser, so that the text\n // layer s can always match the size of the text in the canvas.\n divStyle.fontSize = `${scaleFactorStr}${(TextLayer.#minFontSize * fontHeight).toFixed(2)}px)`;\n divStyle.fontFamily = fontFamily;\n\n textDivProperties.fontSize = fontHeight;\n\n // Keeps screen readers from pausing on every new text span.\n textDiv.setAttribute(\"role\", \"presentation\");\n\n textDiv.textContent = geom.str;\n // geom.dir may be 'ttb' for vertical texts.\n textDiv.dir = geom.dir;\n\n // `fontName` is only used by the FontInspector, and we only use `dataset`\n // here to make the font name available in the debugger.\n if (this.#fontInspectorEnabled) {\n textDiv.dataset.fontName =\n style.fontSubstitutionLoadedName || geom.fontName;\n }\n if (angle !== 0) {\n textDivProperties.angle = angle * (180 / Math.PI);\n }\n // We don't bother scaling single-char text divs, because it has very\n // little effect on text highlighting. This makes scrolling on docs with\n // lots of such divs a lot faster.\n let shouldScaleText = false;\n if (geom.str.length > 1) {\n shouldScaleText = true;\n } else if (geom.str !== \" \" && geom.transform[0] !== geom.transform[3]) {\n const absScaleX = Math.abs(geom.transform[0]),\n absScaleY = Math.abs(geom.transform[3]);\n // When the horizontal/vertical scaling differs significantly, also scale\n // even single-char text to improve highlighting (fixes issue11713.pdf).\n if (\n absScaleX !== absScaleY &&\n Math.max(absScaleX, absScaleY) / Math.min(absScaleX, absScaleY) > 1.5\n ) {\n shouldScaleText = true;\n }\n }\n if (shouldScaleText) {\n textDivProperties.canvasWidth = style.vertical ? geom.height : geom.width;\n }\n this.#textDivProperties.set(textDiv, textDivProperties);\n\n // Finally, layout and append the text to the DOM.\n this.#layoutTextParams.div = textDiv;\n this.#layoutTextParams.properties = textDivProperties;\n this.#layout(this.#layoutTextParams);\n\n if (textDivProperties.hasText) {\n this.#container.append(textDiv);\n }\n if (textDivProperties.hasEOL) {\n const br = document.createElement(\"br\");\n br.setAttribute(\"role\", \"presentation\");\n this.#container.append(br);\n }\n }\n\n #layout(params) {\n const { div, properties, ctx } = params;\n const { style } = div;\n\n let transform = \"\";\n if (TextLayer.#minFontSize > 1) {\n transform = `scale(${1 / TextLayer.#minFontSize})`;\n }\n\n if (properties.canvasWidth !== 0 && properties.hasText) {\n const { fontFamily } = style;\n const { canvasWidth, fontSize } = properties;\n\n TextLayer.#ensureCtxFont(ctx, fontSize * this.#scale, fontFamily);\n // Only measure the width for multi-char text divs, see `appendText`.\n const { width } = ctx.measureText(div.textContent);\n\n if (width > 0) {\n transform = `scaleX(${(canvasWidth * this.#scale) / width}) ${transform}`;\n }\n }\n if (properties.angle !== 0) {\n transform = `rotate(${properties.angle}deg) ${transform}`;\n }\n if (transform.length > 0) {\n style.transform = transform;\n }\n }\n\n /**\n * Clean-up global textLayer data.\n * @returns {undefined}\n */\n static cleanup() {\n if (this.#pendingTextLayers.size > 0) {\n return;\n }\n this.#ascentCache.clear();\n\n for (const { canvas } of this.#canvasContexts.values()) {\n canvas.remove();\n }\n this.#canvasContexts.clear();\n }\n\n static #getCtx(lang = null) {\n let ctx = this.#canvasContexts.get((lang ||= \"\"));\n if (!ctx) {\n // We don't use an OffscreenCanvas here because we use serif/sans serif\n // fonts with it and they depends on the locale.\n // In Firefox, the element get a lang attribute that depends on\n // what Fluent returns for the locale and the OffscreenCanvas uses\n // the OS locale.\n // Those two locales can be different and consequently the used fonts will\n // be different (see bug 1869001).\n // Ideally, we should use in the text layer the fonts we've in the pdf (or\n // their replacements when they aren't embedded) and then we can use an\n // OffscreenCanvas.\n const canvas = document.createElement(\"canvas\");\n canvas.className = \"hiddenCanvasElement\";\n canvas.lang = lang;\n document.body.append(canvas);\n ctx = canvas.getContext(\"2d\", {\n alpha: false,\n willReadFrequently: true,\n });\n this.#canvasContexts.set(lang, ctx);\n\n // Also, initialize state for the `#ensureCtxFont` method.\n this.#canvasCtxFonts.set(ctx, { size: 0, family: \"\" });\n }\n return ctx;\n }\n\n static #ensureCtxFont(ctx, size, family) {\n const cached = this.#canvasCtxFonts.get(ctx);\n if (size === cached.size && family === cached.family) {\n return; // The font is already set.\n }\n ctx.font = `${size}px ${family}`;\n cached.size = size;\n cached.family = family;\n }\n\n /**\n * Compute the minimum font size enforced by the browser.\n */\n static #ensureMinFontSizeComputed() {\n if (this.#minFontSize !== null) {\n return;\n }\n const div = document.createElement(\"div\");\n div.style.opacity = 0;\n div.style.lineHeight = 1;\n div.style.fontSize = \"1px\";\n div.style.position = \"absolute\";\n div.textContent = \"X\";\n document.body.append(div);\n // In `display:block` elements contain a single line of text,\n // the height matches the line height (which, when set to 1,\n // matches the actual font size).\n this.#minFontSize = div.getBoundingClientRect().height;\n div.remove();\n }\n\n static #getAscent(fontFamily, lang) {\n const cachedAscent = this.#ascentCache.get(fontFamily);\n if (cachedAscent) {\n return cachedAscent;\n }\n const ctx = this.#getCtx(lang);\n\n ctx.canvas.width = ctx.canvas.height = DEFAULT_FONT_SIZE;\n this.#ensureCtxFont(ctx, DEFAULT_FONT_SIZE, fontFamily);\n const metrics = ctx.measureText(\"\");\n\n // Both properties aren't available by default in Firefox.\n let ascent = metrics.fontBoundingBoxAscent;\n let descent = Math.abs(metrics.fontBoundingBoxDescent);\n if (ascent) {\n const ratio = ascent / (ascent + descent);\n this.#ascentCache.set(fontFamily, ratio);\n\n ctx.canvas.width = ctx.canvas.height = 0;\n return ratio;\n }\n\n // Try basic heuristic to guess ascent/descent.\n // Draw a g with baseline at 0,0 and then get the line\n // number where a pixel has non-null red component (starting\n // from bottom).\n ctx.strokeStyle = \"red\";\n ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);\n ctx.strokeText(\"g\", 0, 0);\n let pixels = ctx.getImageData(\n 0,\n 0,\n DEFAULT_FONT_SIZE,\n DEFAULT_FONT_SIZE\n ).data;\n descent = 0;\n for (let i = pixels.length - 1 - 3; i >= 0; i -= 4) {\n if (pixels[i] > 0) {\n descent = Math.ceil(i / 4 / DEFAULT_FONT_SIZE);\n break;\n }\n }\n\n // Draw an A with baseline at 0,DEFAULT_FONT_SIZE and then get the line\n // number where a pixel has non-null red component (starting\n // from top).\n ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);\n ctx.strokeText(\"A\", 0, DEFAULT_FONT_SIZE);\n pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data;\n ascent = 0;\n for (let i = 0, ii = pixels.length; i < ii; i += 4) {\n if (pixels[i] > 0) {\n ascent = DEFAULT_FONT_SIZE - Math.floor(i / 4 / DEFAULT_FONT_SIZE);\n break;\n }\n }\n\n ctx.canvas.width = ctx.canvas.height = 0;\n\n const ratio = ascent ? ascent / (ascent + descent) : DEFAULT_FONT_ASCENT;\n this.#ascentCache.set(fontFamily, ratio);\n return ratio;\n }\n}\n\nexport { TextLayer };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./api\").TextContent} TextContent */\n\nclass XfaText {\n /**\n * Walk an XFA tree and create an array of text nodes that is compatible\n * with a regular PDFs TextContent. Currently, only TextItem.str is supported,\n * all other fields and styles haven't been implemented.\n *\n * @param {Object} xfa - An XFA fake DOM object.\n *\n * @returns {TextContent}\n */\n static textContent(xfa) {\n const items = [];\n const output = {\n items,\n styles: Object.create(null),\n };\n function walk(node) {\n if (!node) {\n return;\n }\n let str = null;\n const name = node.name;\n if (name === \"#text\") {\n str = node.value;\n } else if (!XfaText.shouldBuildText(name)) {\n return;\n } else if (node?.attributes?.textContent) {\n str = node.attributes.textContent;\n } else if (node.value) {\n str = node.value;\n }\n if (str !== null) {\n items.push({\n str,\n });\n }\n if (!node.children) {\n return;\n }\n for (const child of node.children) {\n walk(child);\n }\n }\n walk(xfa);\n return output;\n }\n\n /**\n * @param {string} name - DOM node name. (lower case)\n *\n * @returns {boolean} true if the DOM node should have a corresponding text\n * node.\n */\n static shouldBuildText(name) {\n return !(\n name === \"textarea\" ||\n name === \"input\" ||\n name === \"option\" ||\n name === \"select\"\n );\n }\n}\n\nexport { XfaText };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @module pdfjsLib\n */\n\nimport {\n AbortException,\n AnnotationMode,\n assert,\n FeatureTest,\n getVerbosityLevel,\n info,\n InvalidPDFException,\n isNodeJS,\n MAX_IMAGE_SIZE_TO_CACHE,\n MissingPDFException,\n PasswordException,\n RenderingIntentFlag,\n setVerbosityLevel,\n shadow,\n stringToBytes,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport {\n AnnotationStorage,\n PrintAnnotationStorage,\n SerializableEmpty,\n} from \"./annotation_storage.js\";\nimport {\n deprecated,\n isDataScheme,\n isValidFetchUrl,\n PageViewport,\n RenderingCancelledException,\n StatTimer,\n} from \"./display_utils.js\";\nimport { FontFaceObject, FontLoader } from \"./font_loader.js\";\nimport {\n NodeCanvasFactory,\n NodeCMapReaderFactory,\n NodeFilterFactory,\n NodePackages,\n NodeStandardFontDataFactory,\n} from \"display-node_utils\";\nimport { CanvasGraphics } from \"./canvas.js\";\nimport { DOMCanvasFactory } from \"./canvas_factory.js\";\nimport { DOMCMapReaderFactory } from \"display-cmap_reader_factory\";\nimport { DOMFilterFactory } from \"./filter_factory.js\";\nimport { DOMStandardFontDataFactory } from \"display-standard_fontdata_factory\";\nimport { GlobalWorkerOptions } from \"./worker_options.js\";\nimport { MessageHandler } from \"../shared/message_handler.js\";\nimport { Metadata } from \"./metadata.js\";\nimport { OptionalContentConfig } from \"./optional_content_config.js\";\nimport { PDFDataTransportStream } from \"./transport_stream.js\";\nimport { PDFFetchStream } from \"display-fetch_stream\";\nimport { PDFNetworkStream } from \"display-network\";\nimport { PDFNodeStream } from \"display-node_stream\";\nimport { TextLayer } from \"./text_layer.js\";\nimport { XfaText } from \"./xfa_text.js\";\n\nconst DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536\nconst RENDERING_CANCELLED_TIMEOUT = 100; // ms\nconst DELAYED_CLEANUP_TIMEOUT = 5000; // ms\n\nconst DefaultCanvasFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeCanvasFactory\n : DOMCanvasFactory;\nconst DefaultCMapReaderFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeCMapReaderFactory\n : DOMCMapReaderFactory;\nconst DefaultFilterFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeFilterFactory\n : DOMFilterFactory;\nconst DefaultStandardFontDataFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeStandardFontDataFactory\n : DOMStandardFontDataFactory;\n\n/**\n * @typedef { Int8Array | Uint8Array | Uint8ClampedArray |\n * Int16Array | Uint16Array |\n * Int32Array | Uint32Array | Float32Array |\n * Float64Array\n * } TypedArray\n */\n\n/**\n * @typedef {Object} RefProxy\n * @property {number} num\n * @property {number} gen\n */\n\n/**\n * Document initialization / loading parameters object.\n *\n * @typedef {Object} DocumentInitParameters\n * @property {string | URL} [url] - The URL of the PDF.\n * @property {TypedArray | ArrayBuffer | Array | string} [data] -\n * Binary PDF data.\n * Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is\n * BASE64-encoded, use `atob()` to convert it to a binary string first.\n *\n * NOTE: If TypedArrays are used they will generally be transferred to the\n * worker-thread. This will help reduce main-thread memory usage, however\n * it will take ownership of the TypedArrays.\n * @property {Object} [httpHeaders] - Basic authentication headers.\n * @property {boolean} [withCredentials] - Indicates whether or not\n * cross-site Access-Control requests should be made using credentials such\n * as cookies or authorization headers. The default is `false`.\n * @property {string} [password] - For decrypting password-protected PDFs.\n * @property {number} [length] - The PDF file length. It's used for progress\n * reports and range requests operations.\n * @property {PDFDataRangeTransport} [range] - Allows for using a custom range\n * transport implementation.\n * @property {number} [rangeChunkSize] - Specify maximum number of bytes fetched\n * per range request. The default value is {@link DEFAULT_RANGE_CHUNK_SIZE}.\n * @property {PDFWorker} [worker] - The worker that will be used for loading and\n * parsing the PDF data.\n * @property {number} [verbosity] - Controls the logging level; the constants\n * from {@link VerbosityLevel} should be used.\n * @property {string} [docBaseUrl] - The base URL of the document, used when\n * attempting to recover valid absolute URLs for annotations, and outline\n * items, that (incorrectly) only specify relative URLs.\n * @property {string} [cMapUrl] - The URL where the predefined Adobe CMaps are\n * located. Include the trailing slash.\n * @property {boolean} [cMapPacked] - Specifies if the Adobe CMaps are binary\n * packed or not. The default value is `true`.\n * @property {Object} [CMapReaderFactory] - The factory that will be used when\n * reading built-in CMap files. Providing a custom factory is useful for\n * environments without Fetch API or `XMLHttpRequest` support, such as\n * Node.js. The default value is {DOMCMapReaderFactory}.\n * @property {boolean} [useSystemFonts] - When `true`, fonts that aren't\n * embedded in the PDF document will fallback to a system font.\n * The default value is `true` in web environments and `false` in Node.js;\n * unless `disableFontFace === true` in which case this defaults to `false`\n * regardless of the environment (to prevent completely broken fonts).\n * @property {string} [standardFontDataUrl] - The URL where the standard font\n * files are located. Include the trailing slash.\n * @property {Object} [StandardFontDataFactory] - The factory that will be used\n * when reading the standard font files. Providing a custom factory is useful\n * for environments without Fetch API or `XMLHttpRequest` support, such as\n * Node.js. The default value is {DOMStandardFontDataFactory}.\n * @property {boolean} [useWorkerFetch] - Enable using the Fetch API in the\n * worker-thread when reading CMap and standard font files. When `true`,\n * the `CMapReaderFactory` and `StandardFontDataFactory` options are ignored.\n * The default value is `true` in web environments and `false` in Node.js.\n * @property {boolean} [stopAtErrors] - Reject certain promises, e.g.\n * `getOperatorList`, `getTextContent`, and `RenderTask`, when the associated\n * PDF data cannot be successfully parsed, instead of attempting to recover\n * whatever possible of the data. The default value is `false`.\n * @property {number} [maxImageSize] - The maximum allowed image size in total\n * pixels, i.e. width * height. Images above this value will not be rendered.\n * Use -1 for no limit, which is also the default value.\n * @property {boolean} [isEvalSupported] - Determines if we can evaluate strings\n * as JavaScript. Primarily used to improve performance of PDF functions.\n * The default value is `true`.\n * @property {boolean} [isOffscreenCanvasSupported] - Determines if we can use\n * `OffscreenCanvas` in the worker. Primarily used to improve performance of\n * image conversion/rendering.\n * The default value is `true` in web environments and `false` in Node.js.\n * @property {boolean} [isChrome] - Determines if we can use bmp ImageDecoder.\n * NOTE: Temporary option until [https://issues.chromium.org/issues/374807001]\n * is fixed.\n * @property {number} [canvasMaxAreaInBytes] - The integer value is used to\n * know when an image must be resized (uses `OffscreenCanvas` in the worker).\n * If it's -1 then a possibly slow algorithm is used to guess the max value.\n * @property {boolean} [disableFontFace] - By default fonts are converted to\n * OpenType fonts and loaded via the Font Loading API or `@font-face` rules.\n * If disabled, fonts will be rendered using a built-in font renderer that\n * constructs the glyphs with primitive path commands.\n * The default value is `false` in web environments and `true` in Node.js.\n * @property {boolean} [fontExtraProperties] - Include additional properties,\n * which are unused during rendering of PDF documents, when exporting the\n * parsed font data from the worker-thread. This may be useful for debugging\n * purposes (and backwards compatibility), but note that it will lead to\n * increased memory usage. The default value is `false`.\n * @property {boolean} [enableXfa] - Render Xfa forms if any.\n * The default value is `false`.\n * @property {HTMLDocument} [ownerDocument] - Specify an explicit document\n * context to create elements with and to load resources, such as fonts,\n * into. Defaults to the current document.\n * @property {boolean} [disableRange] - Disable range request loading of PDF\n * files. When enabled, and if the server supports partial content requests,\n * then the PDF will be fetched in chunks. The default value is `false`.\n * @property {boolean} [disableStream] - Disable streaming of PDF file data.\n * By default PDF.js attempts to load PDF files in chunks. The default value\n * is `false`.\n * @property {boolean} [disableAutoFetch] - Disable pre-fetching of PDF file\n * data. When range requests are enabled PDF.js will automatically keep\n * fetching more data even if it isn't needed to display the current page.\n * The default value is `false`.\n *\n * NOTE: It is also necessary to disable streaming, see above, in order for\n * disabling of pre-fetching to work correctly.\n * @property {boolean} [pdfBug] - Enables special hooks for debugging PDF.js\n * (see `web/debugger.js`). The default value is `false`.\n * @property {Object} [CanvasFactory] - The factory that will be used when\n * creating canvases. The default value is {DOMCanvasFactory}.\n * @property {Object} [FilterFactory] - The factory that will be used to\n * create SVG filters when rendering some images on the main canvas.\n * The default value is {DOMFilterFactory}.\n * @property {boolean} [enableHWA] - Enables hardware acceleration for\n * rendering. The default value is `false`.\n */\n\n/**\n * This is the main entry point for loading a PDF and interacting with it.\n *\n * NOTE: If a URL is used to fetch the PDF data a standard Fetch API call (or\n * XHR as fallback) is used, which means it must follow same origin rules,\n * e.g. no cross-domain requests without CORS.\n *\n * @param {string | URL | TypedArray | ArrayBuffer | DocumentInitParameters}\n * src - Can be a URL where a PDF file is located, a typed array (Uint8Array)\n * already populated with data, or a parameter object.\n * @returns {PDFDocumentLoadingTask}\n */\nfunction getDocument(src = {}) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (typeof src === \"string\" || src instanceof URL) {\n src = { url: src };\n } else if (src instanceof ArrayBuffer || ArrayBuffer.isView(src)) {\n src = { data: src };\n }\n }\n const task = new PDFDocumentLoadingTask();\n const { docId } = task;\n\n const url = src.url ? getUrlProp(src.url) : null;\n const data = src.data ? getDataProp(src.data) : null;\n const httpHeaders = src.httpHeaders || null;\n const withCredentials = src.withCredentials === true;\n const password = src.password ?? null;\n const rangeTransport =\n src.range instanceof PDFDataRangeTransport ? src.range : null;\n const rangeChunkSize =\n Number.isInteger(src.rangeChunkSize) && src.rangeChunkSize > 0\n ? src.rangeChunkSize\n : DEFAULT_RANGE_CHUNK_SIZE;\n let worker = src.worker instanceof PDFWorker ? src.worker : null;\n const verbosity = src.verbosity;\n // Ignore \"data:\"-URLs, since they can't be used to recover valid absolute\n // URLs anyway. We want to avoid sending them to the worker-thread, since\n // they contain the *entire* PDF document and can thus be arbitrarily long.\n const docBaseUrl =\n typeof src.docBaseUrl === \"string\" && !isDataScheme(src.docBaseUrl)\n ? src.docBaseUrl\n : null;\n const cMapUrl = typeof src.cMapUrl === \"string\" ? src.cMapUrl : null;\n const cMapPacked = src.cMapPacked !== false;\n const CMapReaderFactory = src.CMapReaderFactory || DefaultCMapReaderFactory;\n const standardFontDataUrl =\n typeof src.standardFontDataUrl === \"string\"\n ? src.standardFontDataUrl\n : null;\n const StandardFontDataFactory =\n src.StandardFontDataFactory || DefaultStandardFontDataFactory;\n const ignoreErrors = src.stopAtErrors !== true;\n const maxImageSize =\n Number.isInteger(src.maxImageSize) && src.maxImageSize > -1\n ? src.maxImageSize\n : -1;\n const isEvalSupported = src.isEvalSupported !== false;\n const isOffscreenCanvasSupported =\n typeof src.isOffscreenCanvasSupported === \"boolean\"\n ? src.isOffscreenCanvasSupported\n : !isNodeJS;\n const isChrome =\n typeof src.isChrome === \"boolean\"\n ? src.isChrome\n : (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) &&\n !FeatureTest.platform.isFirefox &&\n typeof window !== \"undefined\" &&\n !!window?.chrome;\n const canvasMaxAreaInBytes = Number.isInteger(src.canvasMaxAreaInBytes)\n ? src.canvasMaxAreaInBytes\n : -1;\n const disableFontFace =\n typeof src.disableFontFace === \"boolean\" ? src.disableFontFace : isNodeJS;\n const fontExtraProperties = src.fontExtraProperties === true;\n const enableXfa = src.enableXfa === true;\n const ownerDocument = src.ownerDocument || globalThis.document;\n const disableRange = src.disableRange === true;\n const disableStream = src.disableStream === true;\n const disableAutoFetch = src.disableAutoFetch === true;\n const pdfBug = src.pdfBug === true;\n const CanvasFactory = src.CanvasFactory || DefaultCanvasFactory;\n const FilterFactory = src.FilterFactory || DefaultFilterFactory;\n const enableHWA = src.enableHWA === true;\n\n // Parameters whose default values depend on other parameters.\n const length = rangeTransport ? rangeTransport.length : (src.length ?? NaN);\n const useSystemFonts =\n typeof src.useSystemFonts === \"boolean\"\n ? src.useSystemFonts\n : !isNodeJS && !disableFontFace;\n const useWorkerFetch =\n typeof src.useWorkerFetch === \"boolean\"\n ? src.useWorkerFetch\n : (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n (CMapReaderFactory === DOMCMapReaderFactory &&\n StandardFontDataFactory === DOMStandardFontDataFactory &&\n cMapUrl &&\n standardFontDataUrl &&\n isValidFetchUrl(cMapUrl, document.baseURI) &&\n isValidFetchUrl(standardFontDataUrl, document.baseURI));\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (src.canvasFactory) {\n deprecated(\n \"`canvasFactory`-instance option, please use `CanvasFactory` instead.\"\n );\n }\n if (src.filterFactory) {\n deprecated(\n \"`filterFactory`-instance option, please use `FilterFactory` instead.\"\n );\n }\n }\n\n // Parameters only intended for development/testing purposes.\n const styleElement =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")\n ? src.styleElement\n : null;\n\n // Set the main-thread verbosity level.\n setVerbosityLevel(verbosity);\n\n // Ensure that the various factories can be initialized, when necessary,\n // since the user may provide *custom* ones.\n const transportFactory = {\n canvasFactory: new CanvasFactory({ ownerDocument, enableHWA }),\n filterFactory: new FilterFactory({ docId, ownerDocument }),\n cMapReaderFactory:\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n useWorkerFetch\n ? null\n : new CMapReaderFactory({ baseUrl: cMapUrl, isCompressed: cMapPacked }),\n standardFontDataFactory:\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n useWorkerFetch\n ? null\n : new StandardFontDataFactory({ baseUrl: standardFontDataUrl }),\n };\n\n if (!worker) {\n const workerParams = {\n verbosity,\n port: GlobalWorkerOptions.workerPort,\n };\n // Worker was not provided -- creating and owning our own. If message port\n // is specified in global worker options, using it.\n worker = workerParams.port\n ? PDFWorker.fromPort(workerParams)\n : new PDFWorker(workerParams);\n task._worker = worker;\n }\n\n const docParams = {\n docId,\n apiVersion:\n typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"TESTING\")\n ? PDFJSDev.eval(\"BUNDLE_VERSION\")\n : null,\n data,\n password,\n disableAutoFetch,\n rangeChunkSize,\n length,\n docBaseUrl,\n enableXfa,\n evaluatorOptions: {\n maxImageSize,\n disableFontFace,\n ignoreErrors,\n isEvalSupported,\n isOffscreenCanvasSupported,\n isChrome,\n canvasMaxAreaInBytes,\n fontExtraProperties,\n useSystemFonts,\n cMapUrl: useWorkerFetch ? cMapUrl : null,\n standardFontDataUrl: useWorkerFetch ? standardFontDataUrl : null,\n },\n };\n const transportParams = {\n disableFontFace,\n fontExtraProperties,\n ownerDocument,\n pdfBug,\n styleElement,\n loadingParams: {\n disableAutoFetch,\n enableXfa,\n },\n };\n\n worker.promise\n .then(function () {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n\n const workerIdPromise = worker.messageHandler.sendWithPromise(\n \"GetDocRequest\",\n docParams,\n data ? [data.buffer] : null\n );\n\n let networkStream;\n if (rangeTransport) {\n networkStream = new PDFDataTransportStream(rangeTransport, {\n disableRange,\n disableStream,\n });\n } else if (!data) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: NetworkStream\");\n }\n if (!url) {\n throw new Error(\"getDocument - no `url` parameter provided.\");\n }\n let NetworkStream;\n\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS\n ) {\n const isFetchSupported =\n typeof fetch !== \"undefined\" &&\n typeof Response !== \"undefined\" &&\n \"body\" in Response.prototype;\n\n NetworkStream =\n isFetchSupported && isValidFetchUrl(url)\n ? PDFFetchStream\n : PDFNodeStream;\n } else {\n NetworkStream = isValidFetchUrl(url)\n ? PDFFetchStream\n : PDFNetworkStream;\n }\n\n networkStream = new NetworkStream({\n url,\n length,\n httpHeaders,\n withCredentials,\n rangeChunkSize,\n disableRange,\n disableStream,\n });\n }\n\n return workerIdPromise.then(workerId => {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n\n const messageHandler = new MessageHandler(docId, workerId, worker.port);\n const transport = new WorkerTransport(\n messageHandler,\n task,\n networkStream,\n transportParams,\n transportFactory\n );\n task._transport = transport;\n messageHandler.send(\"Ready\", null);\n });\n })\n .catch(task._capability.reject);\n\n return task;\n}\n\nfunction getUrlProp(val) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return null; // The 'url' is unused with `PDFDataRangeTransport`.\n }\n if (val instanceof URL) {\n return val.href;\n }\n try {\n // The full path is required in the 'url' field.\n return new URL(val, window.location).href;\n } catch {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS &&\n typeof val === \"string\"\n ) {\n return val; // Use the url as-is in Node.js environments.\n }\n }\n throw new Error(\n \"Invalid PDF url data: \" +\n \"either string or URL-object is expected in the url property.\"\n );\n}\n\nfunction getDataProp(val) {\n // Converting string or array-like data to Uint8Array.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS &&\n typeof Buffer !== \"undefined\" && // eslint-disable-line no-undef\n val instanceof Buffer // eslint-disable-line no-undef\n ) {\n throw new Error(\n \"Please provide binary data as `Uint8Array`, rather than `Buffer`.\"\n );\n }\n if (val instanceof Uint8Array && val.byteLength === val.buffer.byteLength) {\n // Use the data as-is when it's already a Uint8Array that completely\n // \"utilizes\" its underlying ArrayBuffer, to prevent any possible\n // issues when transferring it to the worker-thread.\n return val;\n }\n if (typeof val === \"string\") {\n return stringToBytes(val);\n }\n if (\n val instanceof ArrayBuffer ||\n ArrayBuffer.isView(val) ||\n (typeof val === \"object\" && !isNaN(val?.length))\n ) {\n return new Uint8Array(val);\n }\n throw new Error(\n \"Invalid PDF binary data: either TypedArray, \" +\n \"string, or array-like object is expected in the data property.\"\n );\n}\n\nfunction isRefProxy(ref) {\n return (\n typeof ref === \"object\" &&\n Number.isInteger(ref?.num) &&\n ref.num >= 0 &&\n Number.isInteger(ref?.gen) &&\n ref.gen >= 0\n );\n}\n\n/**\n * @typedef {Object} OnProgressParameters\n * @property {number} loaded - Currently loaded number of bytes.\n * @property {number} total - Total number of bytes in the PDF file.\n */\n\n/**\n * The loading task controls the operations required to load a PDF document\n * (such as network requests) and provides a way to listen for completion,\n * after which individual pages can be rendered.\n */\nclass PDFDocumentLoadingTask {\n static #docId = 0;\n\n constructor() {\n this._capability = Promise.withResolvers();\n this._transport = null;\n this._worker = null;\n\n /**\n * Unique identifier for the document loading task.\n * @type {string}\n */\n this.docId = `d${PDFDocumentLoadingTask.#docId++}`;\n\n /**\n * Whether the loading task is destroyed or not.\n * @type {boolean}\n */\n this.destroyed = false;\n\n /**\n * Callback to request a password if a wrong or no password was provided.\n * The callback receives two parameters: a function that should be called\n * with the new password, and a reason (see {@link PasswordResponses}).\n * @type {function}\n */\n this.onPassword = null;\n\n /**\n * Callback to be able to monitor the loading progress of the PDF file\n * (necessary to implement e.g. a loading bar).\n * The callback receives an {@link OnProgressParameters} argument.\n * @type {function}\n */\n this.onProgress = null;\n }\n\n /**\n * Promise for document loading task completion.\n * @type {Promise}\n */\n get promise() {\n return this._capability.promise;\n }\n\n /**\n * Abort all network requests and destroy the worker.\n * @returns {Promise} A promise that is resolved when destruction is\n * completed.\n */\n async destroy() {\n this.destroyed = true;\n try {\n if (this._worker?.port) {\n this._worker._pendingDestroy = true;\n }\n await this._transport?.destroy();\n } catch (ex) {\n if (this._worker?.port) {\n delete this._worker._pendingDestroy;\n }\n throw ex;\n }\n\n this._transport = null;\n if (this._worker) {\n this._worker.destroy();\n this._worker = null;\n }\n }\n}\n\n/**\n * Abstract class to support range requests file loading.\n *\n * NOTE: The TypedArrays passed to the constructor and relevant methods below\n * will generally be transferred to the worker-thread. This will help reduce\n * main-thread memory usage, however it will take ownership of the TypedArrays.\n */\nclass PDFDataRangeTransport {\n /**\n * @param {number} length\n * @param {Uint8Array|null} initialData\n * @param {boolean} [progressiveDone]\n * @param {string} [contentDispositionFilename]\n */\n constructor(\n length,\n initialData,\n progressiveDone = false,\n contentDispositionFilename = null\n ) {\n this.length = length;\n this.initialData = initialData;\n this.progressiveDone = progressiveDone;\n this.contentDispositionFilename = contentDispositionFilename;\n\n this._rangeListeners = [];\n this._progressListeners = [];\n this._progressiveReadListeners = [];\n this._progressiveDoneListeners = [];\n this._readyCapability = Promise.withResolvers();\n }\n\n /**\n * @param {function} listener\n */\n addRangeListener(listener) {\n this._rangeListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressListener(listener) {\n this._progressListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressiveReadListener(listener) {\n this._progressiveReadListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressiveDoneListener(listener) {\n this._progressiveDoneListeners.push(listener);\n }\n\n /**\n * @param {number} begin\n * @param {Uint8Array|null} chunk\n */\n onDataRange(begin, chunk) {\n for (const listener of this._rangeListeners) {\n listener(begin, chunk);\n }\n }\n\n /**\n * @param {number} loaded\n * @param {number|undefined} total\n */\n onDataProgress(loaded, total) {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressListeners) {\n listener(loaded, total);\n }\n });\n }\n\n /**\n * @param {Uint8Array|null} chunk\n */\n onDataProgressiveRead(chunk) {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressiveReadListeners) {\n listener(chunk);\n }\n });\n }\n\n onDataProgressiveDone() {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressiveDoneListeners) {\n listener();\n }\n });\n }\n\n transportReady() {\n this._readyCapability.resolve();\n }\n\n /**\n * @param {number} begin\n * @param {number} end\n */\n requestDataRange(begin, end) {\n unreachable(\"Abstract method PDFDataRangeTransport.requestDataRange\");\n }\n\n abort() {}\n}\n\n/**\n * Proxy to a `PDFDocument` in the worker thread.\n */\nclass PDFDocumentProxy {\n constructor(pdfInfo, transport) {\n this._pdfInfo = pdfInfo;\n this._transport = transport;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"getNetworkStreamName\", {\n value: () => this._transport.getNetworkStreamName(),\n });\n Object.defineProperty(this, \"getXFADatasets\", {\n value: () => this._transport.getXFADatasets(),\n });\n Object.defineProperty(this, \"getXRefPrevValue\", {\n value: () => this._transport.getXRefPrevValue(),\n });\n Object.defineProperty(this, \"getStartXRefPos\", {\n value: () => this._transport.getStartXRefPos(),\n });\n Object.defineProperty(this, \"getAnnotArray\", {\n value: pageIndex => this._transport.getAnnotArray(pageIndex),\n });\n }\n }\n\n /**\n * @type {AnnotationStorage} Storage for annotation data in forms.\n */\n get annotationStorage() {\n return this._transport.annotationStorage;\n }\n\n /**\n * @type {Object} The canvas factory instance.\n */\n get canvasFactory() {\n return this._transport.canvasFactory;\n }\n\n /**\n * @type {Object} The filter factory instance.\n */\n get filterFactory() {\n return this._transport.filterFactory;\n }\n\n /**\n * @type {number} Total number of pages in the PDF file.\n */\n get numPages() {\n return this._pdfInfo.numPages;\n }\n\n /**\n * @type {Array} A (not guaranteed to be) unique ID to\n * identify the PDF document.\n * NOTE: The first element will always be defined for all PDF documents,\n * whereas the second element is only defined for *modified* PDF documents.\n */\n get fingerprints() {\n return this._pdfInfo.fingerprints;\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n }\n\n /**\n * NOTE: This is (mostly) intended to support printing of XFA forms.\n *\n * @type {Object | null} An object representing a HTML tree structure\n * to render the XFA, or `null` when no XFA form exists.\n */\n get allXfaHtml() {\n return this._transport._htmlForXfa;\n }\n\n /**\n * @param {number} pageNumber - The page number to get. The first page is 1.\n * @returns {Promise} A promise that is resolved with\n * a {@link PDFPageProxy} object.\n */\n getPage(pageNumber) {\n return this._transport.getPage(pageNumber);\n }\n\n /**\n * @param {RefProxy} ref - The page reference.\n * @returns {Promise} A promise that is resolved with the page index,\n * starting from zero, that is associated with the reference.\n */\n getPageIndex(ref) {\n return this._transport.getPageIndex(ref);\n }\n\n /**\n * @returns {Promise>>} A promise that is resolved\n * with a mapping from named destinations to references.\n *\n * This can be slow for large documents. Use `getDestination` instead.\n */\n getDestinations() {\n return this._transport.getDestinations();\n }\n\n /**\n * @param {string} id - The named destination to get.\n * @returns {Promise | null>} A promise that is resolved with all\n * information of the given named destination, or `null` when the named\n * destination is not present in the PDF file.\n */\n getDestination(id) {\n return this._transport.getDestination(id);\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with\n * an {Array} containing the page labels that correspond to the page\n * indexes, or `null` when no page labels are present in the PDF file.\n */\n getPageLabels() {\n return this._transport.getPageLabels();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a {string}\n * containing the page layout name.\n */\n getPageLayout() {\n return this._transport.getPageLayout();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a {string}\n * containing the page mode name.\n */\n getPageMode() {\n return this._transport.getPageMode();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with an\n * {Object} containing the viewer preferences, or `null` when no viewer\n * preferences are present in the PDF file.\n */\n getViewerPreferences() {\n return this._transport.getViewerPreferences();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with an {Array}\n * containing the destination, or `null` when no open action is present\n * in the PDF.\n */\n getOpenAction() {\n return this._transport.getOpenAction();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a lookup table\n * for mapping named attachments to their content.\n */\n getAttachments() {\n return this._transport.getAttachments();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with\n * an {Object} with the JavaScript actions:\n * - from the name tree.\n * - from A or AA entries in the catalog dictionary.\n * , or `null` if no JavaScript exists.\n */\n getJSActions() {\n return this._transport.getDocJSActions();\n }\n\n /**\n * @typedef {Object} OutlineNode\n * @property {string} title\n * @property {boolean} bold\n * @property {boolean} italic\n * @property {Uint8ClampedArray} color - The color in RGB format to use for\n * display purposes.\n * @property {string | Array | null} dest\n * @property {string | null} url\n * @property {string | undefined} unsafeUrl\n * @property {boolean | undefined} newWindow\n * @property {number | undefined} count\n * @property {Array} items\n */\n\n /**\n * @returns {Promise>} A promise that is resolved with an\n * {Array} that is a tree outline (if it has one) of the PDF file.\n */\n getOutline() {\n return this._transport.getOutline();\n }\n\n /**\n * @typedef {Object} GetOptionalContentConfigParameters\n * @property {string} [intent] - Determines the optional content groups that\n * are visible by default; valid values are:\n * - 'display' (viewable groups).\n * - 'print' (printable groups).\n * - 'any' (all groups).\n * The default value is 'display'.\n */\n\n /**\n * @param {GetOptionalContentConfigParameters} [params] - Optional content\n * config parameters.\n * @returns {Promise} A promise that is resolved with\n * an {@link OptionalContentConfig} that contains all the optional content\n * groups (assuming that the document has any).\n */\n getOptionalContentConfig({ intent = \"display\" } = {}) {\n const { renderingIntent } = this._transport.getRenderingIntent(intent);\n\n return this._transport.getOptionalContentConfig(renderingIntent);\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with\n * an {Array} that contains the permission flags for the PDF document, or\n * `null` when no permissions are present in the PDF file.\n */\n getPermissions() {\n return this._transport.getPermissions();\n }\n\n /**\n * @returns {Promise<{ info: Object, metadata: Metadata }>} A promise that is\n * resolved with an {Object} that has `info` and `metadata` properties.\n * `info` is an {Object} filled with anything available in the information\n * dictionary and similarly `metadata` is a {Metadata} object with\n * information from the metadata section of the PDF.\n */\n getMetadata() {\n return this._transport.getMetadata();\n }\n\n /**\n * @typedef {Object} MarkInfo\n * Properties correspond to Table 321 of the PDF 32000-1:2008 spec.\n * @property {boolean} Marked\n * @property {boolean} UserProperties\n * @property {boolean} Suspects\n */\n\n /**\n * @returns {Promise} A promise that is resolved with\n * a {MarkInfo} object that contains the MarkInfo flags for the PDF\n * document, or `null` when no MarkInfo values are present in the PDF file.\n */\n getMarkInfo() {\n return this._transport.getMarkInfo();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a\n * {Uint8Array} containing the raw data of the PDF document.\n */\n getData() {\n return this._transport.getData();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a\n * {Uint8Array} containing the full data of the saved document.\n */\n saveDocument() {\n return this._transport.saveDocument();\n }\n\n /**\n * @returns {Promise<{ length: number }>} A promise that is resolved when the\n * document's data is loaded. It is resolved with an {Object} that contains\n * the `length` property that indicates size of the PDF data in bytes.\n */\n getDownloadInfo() {\n return this._transport.downloadInfoCapability.promise;\n }\n\n /**\n * Cleans up resources allocated by the document on both the main and worker\n * threads.\n *\n * NOTE: Do not, under any circumstances, call this method when rendering is\n * currently ongoing since that may lead to rendering errors.\n *\n * @param {boolean} [keepLoadedFonts] - Let fonts remain attached to the DOM.\n * NOTE: This will increase persistent memory usage, hence don't use this\n * option unless absolutely necessary. The default value is `false`.\n * @returns {Promise} A promise that is resolved when clean-up has finished.\n */\n cleanup(keepLoadedFonts = false) {\n return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa);\n }\n\n /**\n * Destroys the current document instance and terminates the worker.\n */\n destroy() {\n return this.loadingTask.destroy();\n }\n\n /**\n * @param {RefProxy} ref - The page reference.\n * @returns {number | null} The page number, if it's cached.\n */\n cachedPageNumber(ref) {\n return this._transport.cachedPageNumber(ref);\n }\n\n /**\n * @type {DocumentInitParameters} A subset of the current\n * {DocumentInitParameters}, which are needed in the viewer.\n */\n get loadingParams() {\n return this._transport.loadingParams;\n }\n\n /**\n * @type {PDFDocumentLoadingTask} The loadingTask for the current document.\n */\n get loadingTask() {\n return this._transport.loadingTask;\n }\n\n /**\n * @returns {Promise> | null>} A promise that is\n * resolved with an {Object} containing /AcroForm field data for the JS\n * sandbox, or `null` when no field data is present in the PDF file.\n */\n getFieldObjects() {\n return this._transport.getFieldObjects();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with `true`\n * if some /AcroForm fields have JavaScript actions.\n */\n hasJSActions() {\n return this._transport.hasJSActions();\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with an\n * {Array} containing IDs of annotations that have a calculation\n * action, or `null` when no such annotations are present in the PDF file.\n */\n getCalculationOrderIds() {\n return this._transport.getCalculationOrderIds();\n }\n}\n\n/**\n * Page getViewport parameters.\n *\n * @typedef {Object} GetViewportParameters\n * @property {number} scale - The desired scale of the viewport.\n * @property {number} [rotation] - The desired rotation, in degrees, of\n * the viewport. If omitted it defaults to the page rotation.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.\n * The default value is `0`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.\n * The default value is `0`.\n * @property {boolean} [dontFlip] - If true, the y-axis will not be\n * flipped. The default value is `false`.\n */\n\n/**\n * Page getTextContent parameters.\n *\n * @typedef {Object} getTextContentParameters\n * @property {boolean} [includeMarkedContent] - When true include marked\n * content items in the items array of TextContent. The default is `false`.\n * @property {boolean} [disableNormalization] - When true the text is *not*\n * normalized in the worker-thread. The default is `false`.\n */\n\n/**\n * Page text content.\n *\n * @typedef {Object} TextContent\n * @property {Array} items - Array of\n * {@link TextItem} and {@link TextMarkedContent} objects. TextMarkedContent\n * items are included when includeMarkedContent is true.\n * @property {Object} styles - {@link TextStyle} objects,\n * indexed by font name.\n * @property {string | null} lang - The document /Lang attribute.\n */\n\n/**\n * Page text content part.\n *\n * @typedef {Object} TextItem\n * @property {string} str - Text content.\n * @property {string} dir - Text direction: 'ttb', 'ltr' or 'rtl'.\n * @property {Array} transform - Transformation matrix.\n * @property {number} width - Width in device space.\n * @property {number} height - Height in device space.\n * @property {string} fontName - Font name used by PDF.js for converted font.\n * @property {boolean} hasEOL - Indicating if the text content is followed by a\n * line-break.\n */\n\n/**\n * Page text marked content part.\n *\n * @typedef {Object} TextMarkedContent\n * @property {string} type - Either 'beginMarkedContent',\n * 'beginMarkedContentProps', or 'endMarkedContent'.\n * @property {string} id - The marked content identifier. Only used for type\n * 'beginMarkedContentProps'.\n */\n\n/**\n * Text style.\n *\n * @typedef {Object} TextStyle\n * @property {number} ascent - Font ascent.\n * @property {number} descent - Font descent.\n * @property {boolean} vertical - Whether or not the text is in vertical mode.\n * @property {string} fontFamily - The possible font family.\n */\n\n/**\n * Page annotation parameters.\n *\n * @typedef {Object} GetAnnotationsParameters\n * @property {string} [intent] - Determines the annotations that are fetched,\n * can be 'display' (viewable annotations), 'print' (printable annotations),\n * or 'any' (all annotations). The default value is 'display'.\n */\n\n/**\n * Page render parameters.\n *\n * @typedef {Object} RenderParameters\n * @property {CanvasRenderingContext2D} canvasContext - A 2D context of a DOM\n * Canvas object.\n * @property {PageViewport} viewport - Rendering viewport obtained by calling\n * the `PDFPageProxy.getViewport` method.\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n * or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are rendered\n * onto the canvas, for annotations with appearance-data; the values from\n * {@link AnnotationMode} should be used. The following values are supported:\n * - `AnnotationMode.DISABLE`, which disables all annotations.\n * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n * it also depends on the `intent`-option, see above).\n * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n * interactive form elements (those will be rendered in the display layer).\n * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n * (as above) but where interactive form elements are updated with data\n * from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n * The default value is `AnnotationMode.ENABLE`.\n * @property {Array} [transform] - Additional transform, applied just\n * before viewport transform.\n * @property {CanvasGradient | CanvasPattern | string} [background] - Background\n * to use for the canvas.\n * Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS\n * value, a `CanvasGradient` object (a linear or radial gradient) or\n * a `CanvasPattern` object (a repetitive image). The default value is\n * 'rgb(255,255,255)'.\n *\n * NOTE: This option may be partially, or completely, ignored when the\n * `pageColors`-option is used.\n * @property {Object} [pageColors] - Overwrites background and foreground colors\n * with user defined ones in order to improve readability in high contrast\n * mode.\n * @property {Promise} [optionalContentConfigPromise] -\n * A promise that should resolve with an {@link OptionalContentConfig}\n * created from `PDFDocumentProxy.getOptionalContentConfig`. If `null`,\n * the configuration will be fetched automatically with the default visibility\n * states set.\n * @property {Map} [annotationCanvasMap] - Map some\n * annotation ids with canvases used to render them.\n * @property {PrintAnnotationStorage} [printAnnotationStorage]\n * @property {boolean} [isEditing] - Render the page in editing mode.\n */\n\n/**\n * Page getOperatorList parameters.\n *\n * @typedef {Object} GetOperatorListParameters\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n * or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are included\n * in the operatorList, for annotations with appearance-data; the values from\n * {@link AnnotationMode} should be used. The following values are supported:\n * - `AnnotationMode.DISABLE`, which disables all annotations.\n * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n * it also depends on the `intent`-option, see above).\n * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n * interactive form elements (those will be rendered in the display layer).\n * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n * (as above) but where interactive form elements are updated with data\n * from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n * The default value is `AnnotationMode.ENABLE`.\n * @property {PrintAnnotationStorage} [printAnnotationStorage]\n * @property {boolean} [isEditing] - Render the page in editing mode.\n */\n\n/**\n * Structure tree node. The root node will have a role \"Root\".\n *\n * @typedef {Object} StructTreeNode\n * @property {Array} children - Array of\n * {@link StructTreeNode} and {@link StructTreeContent} objects.\n * @property {string} role - element's role, already mapped if a role map exists\n * in the PDF.\n */\n\n/**\n * Structure tree content.\n *\n * @typedef {Object} StructTreeContent\n * @property {string} type - either \"content\" for page and stream structure\n * elements or \"object\" for object references.\n * @property {string} id - unique id that will map to the text layer.\n */\n\n/**\n * PDF page operator list.\n *\n * @typedef {Object} PDFOperatorList\n * @property {Array} fnArray - Array containing the operator functions.\n * @property {Array} argsArray - Array containing the arguments of the\n * functions.\n */\n\n/**\n * Proxy to a `PDFPage` in the worker thread.\n */\nclass PDFPageProxy {\n #delayedCleanupTimeout = null;\n\n #pendingCleanup = false;\n\n constructor(pageIndex, pageInfo, transport, pdfBug = false) {\n this._pageIndex = pageIndex;\n this._pageInfo = pageInfo;\n this._transport = transport;\n this._stats = pdfBug ? new StatTimer() : null;\n this._pdfBug = pdfBug;\n /** @type {PDFObjects} */\n this.commonObjs = transport.commonObjs;\n this.objs = new PDFObjects();\n\n this._maybeCleanupAfterRender = false;\n this._intentStates = new Map();\n this.destroyed = false;\n }\n\n /**\n * @type {number} Page number of the page. First page is 1.\n */\n get pageNumber() {\n return this._pageIndex + 1;\n }\n\n /**\n * @type {number} The number of degrees the page is rotated clockwise.\n */\n get rotate() {\n return this._pageInfo.rotate;\n }\n\n /**\n * @type {RefProxy | null} The reference that points to this page.\n */\n get ref() {\n return this._pageInfo.ref;\n }\n\n /**\n * @type {number} The default size of units in 1/72nds of an inch.\n */\n get userUnit() {\n return this._pageInfo.userUnit;\n }\n\n /**\n * @type {Array} An array of the visible portion of the PDF page in\n * user space units [x1, y1, x2, y2].\n */\n get view() {\n return this._pageInfo.view;\n }\n\n /**\n * @param {GetViewportParameters} params - Viewport parameters.\n * @returns {PageViewport} Contains 'width' and 'height' properties\n * along with transforms required for rendering.\n */\n getViewport({\n scale,\n rotation = this.rotate,\n offsetX = 0,\n offsetY = 0,\n dontFlip = false,\n } = {}) {\n return new PageViewport({\n viewBox: this.view,\n scale,\n rotation,\n offsetX,\n offsetY,\n dontFlip,\n });\n }\n\n /**\n * @param {GetAnnotationsParameters} [params] - Annotation parameters.\n * @returns {Promise>} A promise that is resolved with an\n * {Array} of the annotation objects.\n */\n getAnnotations({ intent = \"display\" } = {}) {\n const { renderingIntent } = this._transport.getRenderingIntent(intent);\n\n return this._transport.getAnnotations(this._pageIndex, renderingIntent);\n }\n\n /**\n * @returns {Promise} A promise that is resolved with an\n * {Object} with JS actions.\n */\n getJSActions() {\n return this._transport.getPageJSActions(this._pageIndex);\n }\n\n /**\n * @type {Object} The filter factory instance.\n */\n get filterFactory() {\n return this._transport.filterFactory;\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n }\n\n /**\n * @returns {Promise} A promise that is resolved with\n * an {Object} with a fake DOM object (a tree structure where elements\n * are {Object} with a name, attributes (class, style, ...), value and\n * children, very similar to a HTML DOM tree), or `null` if no XFA exists.\n */\n async getXfa() {\n return this._transport._htmlForXfa?.children[this._pageIndex] || null;\n }\n\n /**\n * Begins the process of rendering a page to the desired context.\n *\n * @param {RenderParameters} params - Page render parameters.\n * @returns {RenderTask} An object that contains a promise that is\n * resolved when the page finishes rendering.\n */\n render({\n canvasContext,\n viewport,\n intent = \"display\",\n annotationMode = AnnotationMode.ENABLE,\n transform = null,\n background = null,\n optionalContentConfigPromise = null,\n annotationCanvasMap = null,\n pageColors = null,\n printAnnotationStorage = null,\n isEditing = false,\n }) {\n this._stats?.time(\"Overall\");\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode,\n printAnnotationStorage,\n isEditing\n );\n const { renderingIntent, cacheKey } = intentArgs;\n // If there was a pending destroy, cancel it so no cleanup happens during\n // this call to render...\n this.#pendingCleanup = false;\n // ... and ensure that a delayed cleanup is always aborted.\n this.#abortDelayedCleanup();\n\n optionalContentConfigPromise ||=\n this._transport.getOptionalContentConfig(renderingIntent);\n\n let intentState = this._intentStates.get(cacheKey);\n if (!intentState) {\n intentState = Object.create(null);\n this._intentStates.set(cacheKey, intentState);\n }\n\n // Ensure that a pending `streamReader` cancel timeout is always aborted.\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n const intentPrint = !!(renderingIntent & RenderingIntentFlag.PRINT);\n\n // If there's no displayReadyCapability yet, then the operatorList\n // was never requested before. Make the request and create the promise.\n if (!intentState.displayReadyCapability) {\n intentState.displayReadyCapability = Promise.withResolvers();\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n separateAnnots: null,\n };\n\n this._stats?.time(\"Page Request\");\n this._pumpOperatorList(intentArgs);\n }\n\n const complete = error => {\n intentState.renderTasks.delete(internalRenderTask);\n\n // Attempt to reduce memory usage during *printing*, by always running\n // cleanup immediately once rendering has finished.\n if (this._maybeCleanupAfterRender || intentPrint) {\n this.#pendingCleanup = true;\n }\n this.#tryCleanup(/* delayed = */ !intentPrint);\n\n if (error) {\n internalRenderTask.capability.reject(error);\n\n this._abortOperatorList({\n intentState,\n reason: error instanceof Error ? error : new Error(error),\n });\n } else {\n internalRenderTask.capability.resolve();\n }\n\n if (this._stats) {\n this._stats.timeEnd(\"Rendering\");\n this._stats.timeEnd(\"Overall\");\n\n if (globalThis.Stats?.enabled) {\n globalThis.Stats.add(this.pageNumber, this._stats);\n }\n }\n };\n\n const internalRenderTask = new InternalRenderTask({\n callback: complete,\n // Only include the required properties, and *not* the entire object.\n params: {\n canvasContext,\n viewport,\n transform,\n background,\n },\n objs: this.objs,\n commonObjs: this.commonObjs,\n annotationCanvasMap,\n operatorList: intentState.operatorList,\n pageIndex: this._pageIndex,\n canvasFactory: this._transport.canvasFactory,\n filterFactory: this._transport.filterFactory,\n useRequestAnimationFrame: !intentPrint,\n pdfBug: this._pdfBug,\n pageColors,\n });\n\n (intentState.renderTasks ||= new Set()).add(internalRenderTask);\n const renderTask = internalRenderTask.task;\n\n Promise.all([\n intentState.displayReadyCapability.promise,\n optionalContentConfigPromise,\n ])\n .then(([transparency, optionalContentConfig]) => {\n if (this.destroyed) {\n complete();\n return;\n }\n this._stats?.time(\"Rendering\");\n\n if (!(optionalContentConfig.renderingIntent & renderingIntent)) {\n throw new Error(\n \"Must use the same `intent`-argument when calling the `PDFPageProxy.render` \" +\n \"and `PDFDocumentProxy.getOptionalContentConfig` methods.\"\n );\n }\n internalRenderTask.initializeGraphics({\n transparency,\n optionalContentConfig,\n });\n internalRenderTask.operatorListChanged();\n })\n .catch(complete);\n\n return renderTask;\n }\n\n /**\n * @param {GetOperatorListParameters} params - Page getOperatorList\n * parameters.\n * @returns {Promise} A promise resolved with an\n * {@link PDFOperatorList} object that represents the page's operator list.\n */\n getOperatorList({\n intent = \"display\",\n annotationMode = AnnotationMode.ENABLE,\n printAnnotationStorage = null,\n isEditing = false,\n } = {}) {\n if (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"GENERIC\")) {\n throw new Error(\"Not implemented: getOperatorList\");\n }\n function operatorListChanged() {\n if (intentState.operatorList.lastChunk) {\n intentState.opListReadCapability.resolve(intentState.operatorList);\n\n intentState.renderTasks.delete(opListTask);\n }\n }\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode,\n printAnnotationStorage,\n isEditing,\n /* isOpList = */ true\n );\n let intentState = this._intentStates.get(intentArgs.cacheKey);\n if (!intentState) {\n intentState = Object.create(null);\n this._intentStates.set(intentArgs.cacheKey, intentState);\n }\n let opListTask;\n\n if (!intentState.opListReadCapability) {\n opListTask = Object.create(null);\n opListTask.operatorListChanged = operatorListChanged;\n intentState.opListReadCapability = Promise.withResolvers();\n (intentState.renderTasks ||= new Set()).add(opListTask);\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n separateAnnots: null,\n };\n\n this._stats?.time(\"Page Request\");\n this._pumpOperatorList(intentArgs);\n }\n return intentState.opListReadCapability.promise;\n }\n\n /**\n * NOTE: All occurrences of whitespace will be replaced by\n * standard spaces (0x20).\n *\n * @param {getTextContentParameters} params - getTextContent parameters.\n * @returns {ReadableStream} Stream for reading text content chunks.\n */\n streamTextContent({\n includeMarkedContent = false,\n disableNormalization = false,\n } = {}) {\n const TEXT_CONTENT_CHUNK_SIZE = 100;\n\n return this._transport.messageHandler.sendWithStream(\n \"GetTextContent\",\n {\n pageIndex: this._pageIndex,\n includeMarkedContent: includeMarkedContent === true,\n disableNormalization: disableNormalization === true,\n },\n {\n highWaterMark: TEXT_CONTENT_CHUNK_SIZE,\n size(textContent) {\n return textContent.items.length;\n },\n }\n );\n }\n\n /**\n * NOTE: All occurrences of whitespace will be replaced by\n * standard spaces (0x20).\n *\n * @param {getTextContentParameters} params - getTextContent parameters.\n * @returns {Promise} A promise that is resolved with a\n * {@link TextContent} object that represents the page's text content.\n */\n getTextContent(params = {}) {\n if (this._transport._htmlForXfa) {\n // TODO: We need to revisit this once the XFA foreground patch lands and\n // only do this for non-foreground XFA.\n return this.getXfa().then(xfa => XfaText.textContent(xfa));\n }\n const readableStream = this.streamTextContent(params);\n\n return new Promise(function (resolve, reject) {\n function pump() {\n reader.read().then(function ({ value, done }) {\n if (done) {\n resolve(textContent);\n return;\n }\n textContent.lang ??= value.lang;\n Object.assign(textContent.styles, value.styles);\n textContent.items.push(...value.items);\n pump();\n }, reject);\n }\n\n const reader = readableStream.getReader();\n const textContent = {\n items: [],\n styles: Object.create(null),\n lang: null,\n };\n pump();\n });\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a\n * {@link StructTreeNode} object that represents the page's structure tree,\n * or `null` when no structure tree is present for the current page.\n */\n getStructTree() {\n return this._transport.getStructTree(this._pageIndex);\n }\n\n /**\n * Destroys the page object.\n * @private\n */\n _destroy() {\n this.destroyed = true;\n\n const waitOn = [];\n for (const intentState of this._intentStates.values()) {\n this._abortOperatorList({\n intentState,\n reason: new Error(\"Page was destroyed.\"),\n force: true,\n });\n\n if (intentState.opListReadCapability) {\n // Avoid errors below, since the renderTasks are just stubs.\n continue;\n }\n for (const internalRenderTask of intentState.renderTasks) {\n waitOn.push(internalRenderTask.completed);\n internalRenderTask.cancel();\n }\n }\n this.objs.clear();\n this.#pendingCleanup = false;\n this.#abortDelayedCleanup();\n\n return Promise.all(waitOn);\n }\n\n /**\n * Cleans up resources allocated by the page.\n *\n * @param {boolean} [resetStats] - Reset page stats, if enabled.\n * The default value is `false`.\n * @returns {boolean} Indicates if clean-up was successfully run.\n */\n cleanup(resetStats = false) {\n this.#pendingCleanup = true;\n const success = this.#tryCleanup(/* delayed = */ false);\n\n if (resetStats && success) {\n this._stats &&= new StatTimer();\n }\n return success;\n }\n\n /**\n * Attempts to clean up if rendering is in a state where that's possible.\n * @param {boolean} [delayed] - Delay the cleanup, to e.g. improve zooming\n * performance in documents with large images.\n * The default value is `false`.\n * @returns {boolean} Indicates if clean-up was successfully run.\n */\n #tryCleanup(delayed = false) {\n this.#abortDelayedCleanup();\n\n if (!this.#pendingCleanup || this.destroyed) {\n return false;\n }\n if (delayed) {\n this.#delayedCleanupTimeout = setTimeout(() => {\n this.#delayedCleanupTimeout = null;\n this.#tryCleanup(/* delayed = */ false);\n }, DELAYED_CLEANUP_TIMEOUT);\n\n return false;\n }\n for (const { renderTasks, operatorList } of this._intentStates.values()) {\n if (renderTasks.size > 0 || !operatorList.lastChunk) {\n return false;\n }\n }\n this._intentStates.clear();\n this.objs.clear();\n this.#pendingCleanup = false;\n return true;\n }\n\n #abortDelayedCleanup() {\n if (this.#delayedCleanupTimeout) {\n clearTimeout(this.#delayedCleanupTimeout);\n this.#delayedCleanupTimeout = null;\n }\n }\n\n /**\n * @private\n */\n _startRenderPage(transparency, cacheKey) {\n const intentState = this._intentStates.get(cacheKey);\n if (!intentState) {\n return; // Rendering was cancelled.\n }\n this._stats?.timeEnd(\"Page Request\");\n\n // TODO Refactor RenderPageRequest to separate rendering\n // and operator list logic\n intentState.displayReadyCapability?.resolve(transparency);\n }\n\n /**\n * @private\n */\n _renderPageChunk(operatorListChunk, intentState) {\n // Add the new chunk to the current operator list.\n for (let i = 0, ii = operatorListChunk.length; i < ii; i++) {\n intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]);\n intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]);\n }\n intentState.operatorList.lastChunk = operatorListChunk.lastChunk;\n intentState.operatorList.separateAnnots = operatorListChunk.separateAnnots;\n\n // Notify all the rendering tasks there are more operators to be consumed.\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n\n if (operatorListChunk.lastChunk) {\n this.#tryCleanup(/* delayed = */ true);\n }\n }\n\n /**\n * @private\n */\n _pumpOperatorList({\n renderingIntent,\n cacheKey,\n annotationStorageSerializable,\n modifiedIds,\n }) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n Number.isInteger(renderingIntent) && renderingIntent > 0,\n '_pumpOperatorList: Expected valid \"renderingIntent\" argument.'\n );\n }\n const { map, transfer } = annotationStorageSerializable;\n\n const readableStream = this._transport.messageHandler.sendWithStream(\n \"GetOperatorList\",\n {\n pageIndex: this._pageIndex,\n intent: renderingIntent,\n cacheKey,\n annotationStorage: map,\n modifiedIds,\n },\n transfer\n );\n const reader = readableStream.getReader();\n\n const intentState = this._intentStates.get(cacheKey);\n intentState.streamReader = reader;\n\n const pump = () => {\n reader.read().then(\n ({ value, done }) => {\n if (done) {\n intentState.streamReader = null;\n return;\n }\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n this._renderPageChunk(value, intentState);\n pump();\n },\n reason => {\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n if (intentState.operatorList) {\n // Mark operator list as complete.\n intentState.operatorList.lastChunk = true;\n\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n this.#tryCleanup(/* delayed = */ true);\n }\n\n if (intentState.displayReadyCapability) {\n intentState.displayReadyCapability.reject(reason);\n } else if (intentState.opListReadCapability) {\n intentState.opListReadCapability.reject(reason);\n } else {\n throw reason;\n }\n }\n );\n };\n pump();\n }\n\n /**\n * @private\n */\n _abortOperatorList({ intentState, reason, force = false }) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n reason instanceof Error,\n '_abortOperatorList: Expected valid \"reason\" argument.'\n );\n }\n\n if (!intentState.streamReader) {\n return;\n }\n // Ensure that a pending `streamReader` cancel timeout is always aborted.\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n if (!force) {\n // Ensure that an Error occurring in *only* one `InternalRenderTask`, e.g.\n // multiple render() calls on the same canvas, won't break all rendering.\n if (intentState.renderTasks.size > 0) {\n return;\n }\n // Don't immediately abort parsing on the worker-thread when rendering is\n // cancelled, since that will unnecessarily delay re-rendering when (for\n // partially parsed pages) e.g. zooming/rotation occurs in the viewer.\n if (reason instanceof RenderingCancelledException) {\n let delay = RENDERING_CANCELLED_TIMEOUT;\n if (reason.extraDelay > 0 && reason.extraDelay < /* ms = */ 1000) {\n // Above, we prevent the total delay from becoming arbitrarily large.\n delay += reason.extraDelay;\n }\n\n intentState.streamReaderCancelTimeout = setTimeout(() => {\n intentState.streamReaderCancelTimeout = null;\n this._abortOperatorList({ intentState, reason, force: true });\n }, delay);\n return;\n }\n }\n intentState.streamReader\n .cancel(new AbortException(reason.message))\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n // Remove the current `intentState`, since a cancelled `getOperatorList`\n // call on the worker-thread cannot be re-started...\n for (const [curCacheKey, curIntentState] of this._intentStates) {\n if (curIntentState === intentState) {\n this._intentStates.delete(curCacheKey);\n break;\n }\n }\n // ... and force clean-up to ensure that any old state is always removed.\n this.cleanup();\n }\n\n /**\n * @type {StatTimer | null} Returns page stats, if enabled; returns `null`\n * otherwise.\n */\n get stats() {\n return this._stats;\n }\n}\n\nclass LoopbackPort {\n #listeners = new Map();\n\n #deferred = Promise.resolve();\n\n postMessage(obj, transfer) {\n const event = {\n data: structuredClone(obj, transfer ? { transfer } : null),\n };\n\n this.#deferred.then(() => {\n for (const [listener] of this.#listeners) {\n listener.call(this, event);\n }\n });\n }\n\n addEventListener(name, listener, options = null) {\n let rmAbort = null;\n if (options?.signal instanceof AbortSignal) {\n const { signal } = options;\n if (signal.aborted) {\n warn(\"LoopbackPort - cannot use an `aborted` signal.\");\n return;\n }\n const onAbort = () => this.removeEventListener(name, listener);\n rmAbort = () => signal.removeEventListener(\"abort\", onAbort);\n\n signal.addEventListener(\"abort\", onAbort);\n }\n this.#listeners.set(listener, rmAbort);\n }\n\n removeEventListener(name, listener) {\n const rmAbort = this.#listeners.get(listener);\n rmAbort?.();\n\n this.#listeners.delete(listener);\n }\n\n terminate() {\n for (const [, rmAbort] of this.#listeners) {\n rmAbort?.();\n }\n this.#listeners.clear();\n }\n}\n\n/**\n * @typedef {Object} PDFWorkerParameters\n * @property {string} [name] - The name of the worker.\n * @property {Worker} [port] - The `workerPort` object.\n * @property {number} [verbosity] - Controls the logging level;\n * the constants from {@link VerbosityLevel} should be used.\n */\n\n/**\n * PDF.js web worker abstraction that controls the instantiation of PDF\n * documents. Message handlers are used to pass information from the main\n * thread to the worker thread and vice versa. If the creation of a web\n * worker is not possible, a \"fake\" worker will be used instead.\n *\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n */\nclass PDFWorker {\n static #fakeWorkerId = 0;\n\n static #isWorkerDisabled = false;\n\n static #workerPorts;\n\n static {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (isNodeJS) {\n // Workers aren't supported in Node.js, force-disabling them there.\n this.#isWorkerDisabled = true;\n\n GlobalWorkerOptions.workerSrc ||= PDFJSDev.test(\"LIB\")\n ? \"../pdf.worker.js\"\n : \"./pdf.worker.mjs\";\n }\n\n // Check if URLs have the same origin. For non-HTTP based URLs, returns\n // false.\n this._isSameOrigin = (baseUrl, otherUrl) => {\n let base;\n try {\n base = new URL(baseUrl);\n if (!base.origin || base.origin === \"null\") {\n return false; // non-HTTP url\n }\n } catch {\n return false;\n }\n const other = new URL(otherUrl, base);\n return base.origin === other.origin;\n };\n\n this._createCDNWrapper = url => {\n // We will rely on blob URL's property to specify origin.\n // We want this function to fail in case if createObjectURL or Blob do\n // not exist or fail for some reason -- our Worker creation will fail\n // anyway.\n const wrapper = `await import(\"${url}\");`;\n return URL.createObjectURL(\n new Blob([wrapper], { type: \"text/javascript\" })\n );\n };\n }\n }\n\n constructor({\n name = null,\n port = null,\n verbosity = getVerbosityLevel(),\n } = {}) {\n this.name = name;\n this.destroyed = false;\n this.verbosity = verbosity;\n\n this._readyCapability = Promise.withResolvers();\n this._port = null;\n this._webWorker = null;\n this._messageHandler = null;\n\n if (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) &&\n port\n ) {\n if (PDFWorker.#workerPorts?.has(port)) {\n throw new Error(\"Cannot use more than one PDFWorker per port.\");\n }\n (PDFWorker.#workerPorts ||= new WeakMap()).set(port, this);\n this._initializeFromPort(port);\n return;\n }\n this._initialize();\n }\n\n /**\n * Promise for worker initialization completion.\n * @type {Promise}\n */\n get promise() {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS\n ) {\n // Ensure that all Node.js packages/polyfills have loaded.\n return Promise.all([NodePackages.promise, this._readyCapability.promise]);\n }\n return this._readyCapability.promise;\n }\n\n #resolve() {\n this._readyCapability.resolve();\n // Send global setting, e.g. verbosity level.\n this._messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n }\n\n /**\n * The current `workerPort`, when it exists.\n * @type {Worker}\n */\n get port() {\n return this._port;\n }\n\n /**\n * The current MessageHandler-instance.\n * @type {MessageHandler}\n */\n get messageHandler() {\n return this._messageHandler;\n }\n\n _initializeFromPort(port) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _initializeFromPort\");\n }\n this._port = port;\n this._messageHandler = new MessageHandler(\"main\", \"worker\", port);\n this._messageHandler.on(\"ready\", function () {\n // Ignoring \"ready\" event -- MessageHandler should already be initialized\n // and ready to accept messages.\n });\n this.#resolve();\n }\n\n _initialize() {\n // If worker support isn't disabled explicit and the browser has worker\n // support, create a new web worker and test if it/the browser fulfills\n // all requirements to run parts of pdf.js in a web worker.\n // Right now, the requirement is, that an Uint8Array is still an\n // Uint8Array as it arrives on the worker.\n if (\n PDFWorker.#isWorkerDisabled ||\n PDFWorker.#mainThreadWorkerMessageHandler\n ) {\n this._setupFakeWorker();\n return;\n }\n let { workerSrc } = PDFWorker;\n\n try {\n // Wraps workerSrc path into blob URL, if the former does not belong\n // to the same origin.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n !PDFWorker._isSameOrigin(window.location.href, workerSrc)\n ) {\n workerSrc = PDFWorker._createCDNWrapper(\n new URL(workerSrc, window.location).href\n );\n }\n\n const worker = new Worker(workerSrc, { type: \"module\" });\n const messageHandler = new MessageHandler(\"main\", \"worker\", worker);\n const terminateEarly = () => {\n ac.abort();\n messageHandler.destroy();\n worker.terminate();\n if (this.destroyed) {\n this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n } else {\n // Fall back to fake worker if the termination is caused by an\n // error (e.g. NetworkError / SecurityError).\n this._setupFakeWorker();\n }\n };\n\n const ac = new AbortController();\n worker.addEventListener(\n \"error\",\n () => {\n if (!this._webWorker) {\n // Worker failed to initialize due to an error. Clean up and fall\n // back to the fake worker.\n terminateEarly();\n }\n },\n { signal: ac.signal }\n );\n\n messageHandler.on(\"test\", data => {\n ac.abort();\n if (this.destroyed || !data) {\n terminateEarly();\n return;\n }\n this._messageHandler = messageHandler;\n this._port = worker;\n this._webWorker = worker;\n\n this.#resolve();\n });\n\n messageHandler.on(\"ready\", data => {\n ac.abort();\n if (this.destroyed) {\n terminateEarly();\n return;\n }\n try {\n sendTest();\n } catch {\n // We need fallback to a faked worker.\n this._setupFakeWorker();\n }\n });\n\n const sendTest = () => {\n const testObj = new Uint8Array();\n // Ensure that we can use `postMessage` transfers.\n messageHandler.send(\"test\", testObj, [testObj.buffer]);\n };\n\n // It might take time for the worker to initialize. We will try to send\n // the \"test\" message immediately, and once the \"ready\" message arrives.\n // The worker shall process only the first received \"test\" message.\n sendTest();\n return;\n } catch {\n info(\"The worker has been disabled.\");\n }\n // Either workers are not supported or have thrown an exception.\n // Thus, we fallback to a faked worker.\n this._setupFakeWorker();\n }\n\n _setupFakeWorker() {\n if (!PDFWorker.#isWorkerDisabled) {\n warn(\"Setting up fake worker.\");\n PDFWorker.#isWorkerDisabled = true;\n }\n\n PDFWorker._setupFakeWorkerGlobal\n .then(WorkerMessageHandler => {\n if (this.destroyed) {\n this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n return;\n }\n const port = new LoopbackPort();\n this._port = port;\n\n // All fake workers use the same port, making id unique.\n const id = `fake${PDFWorker.#fakeWorkerId++}`;\n\n // If the main thread is our worker, setup the handling for the\n // messages -- the main thread sends to it self.\n const workerHandler = new MessageHandler(id + \"_worker\", id, port);\n WorkerMessageHandler.setup(workerHandler, port);\n\n this._messageHandler = new MessageHandler(id, id + \"_worker\", port);\n this.#resolve();\n })\n .catch(reason => {\n this._readyCapability.reject(\n new Error(`Setting up fake worker failed: \"${reason.message}\".`)\n );\n });\n }\n\n /**\n * Destroys the worker instance.\n */\n destroy() {\n this.destroyed = true;\n if (this._webWorker) {\n // We need to terminate only web worker created resource.\n this._webWorker.terminate();\n this._webWorker = null;\n }\n PDFWorker.#workerPorts?.delete(this._port);\n this._port = null;\n if (this._messageHandler) {\n this._messageHandler.destroy();\n this._messageHandler = null;\n }\n }\n\n /**\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n */\n static fromPort(params) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: fromPort\");\n }\n if (!params?.port) {\n throw new Error(\"PDFWorker.fromPort - invalid method signature.\");\n }\n const cachedPort = this.#workerPorts?.get(params.port);\n if (cachedPort) {\n if (cachedPort._pendingDestroy) {\n throw new Error(\n \"PDFWorker.fromPort - the worker is being destroyed.\\n\" +\n \"Please remember to await `PDFDocumentLoadingTask.destroy()`-calls.\"\n );\n }\n return cachedPort;\n }\n return new PDFWorker(params);\n }\n\n /**\n * The current `workerSrc`, when it exists.\n * @type {string}\n */\n static get workerSrc() {\n if (GlobalWorkerOptions.workerSrc) {\n return GlobalWorkerOptions.workerSrc;\n }\n throw new Error('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n\n static get #mainThreadWorkerMessageHandler() {\n try {\n return globalThis.pdfjsWorker?.WorkerMessageHandler || null;\n } catch {\n return null;\n }\n }\n\n // Loads worker code into the main-thread.\n static get _setupFakeWorkerGlobal() {\n const loader = async () => {\n if (this.#mainThreadWorkerMessageHandler) {\n // The worker was already loaded using e.g. a `\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationRawTagOpen(code) {\n if (code === 47) {\n effects.consume(code)\n buffer = ''\n return continuationRawEndTag\n }\n return continuation(code)\n }\n\n /**\n * In raw continuation, after ` | \n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function continuationRawEndTag(code) {\n if (code === 62) {\n const name = buffer.toLowerCase()\n if (htmlRawNames.includes(name)) {\n effects.consume(code)\n return continuationClose\n }\n return continuation(code)\n }\n if (asciiAlpha(code) && buffer.length < 8) {\n effects.consume(code)\n // @ts-expect-error: not null.\n buffer += String.fromCharCode(code)\n return continuationRawEndTag\n }\n return continuation(code)\n }\n\n /**\n * In cdata continuation, after `]`, expecting `]>`.\n *\n * ```markdown\n * > | &<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCdataInside(code) {\n if (code === 93) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n return continuation(code)\n }\n\n /**\n * In declaration or instruction continuation, at `>`.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | &<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationDeclarationInside(code) {\n if (code === 62) {\n effects.consume(code)\n return continuationClose\n }\n\n // More dashes.\n if (code === 45 && marker === 2) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n return continuation(code)\n }\n\n /**\n * In closed continuation: everything we get until the eol/eof is part of it.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('htmlFlowData')\n return continuationAfter(code)\n }\n effects.consume(code)\n return continuationClose\n }\n\n /**\n * Done.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationAfter(code) {\n effects.exit('htmlFlow')\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n // // No longer concrete.\n // tokenizer.concrete = false\n return ok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuationStart(effects, ok, nok) {\n const self = this\n return start\n\n /**\n * At eol, before continuation.\n *\n * ```markdown\n * > | * ```js\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return after\n }\n return nok(code)\n }\n\n /**\n * A continuation.\n *\n * ```markdown\n * | * ```js\n * > | b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLineBefore(effects, ok, nok) {\n return start\n\n /**\n * Before eol, expecting blank line.\n *\n * ```markdown\n * > |
\n * ^\n * |\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return effects.attempt(blankLine, ok, nok)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding, markdownSpace} from 'micromark-util-character'\n/** @type {Construct} */\nconst nonLazyContinuation = {\n tokenize: tokenizeNonLazyContinuation,\n partial: true\n}\n\n/** @type {Construct} */\nexport const codeFenced = {\n name: 'codeFenced',\n tokenize: tokenizeCodeFenced,\n concrete: true\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCodeFenced(effects, ok, nok) {\n const self = this\n /** @type {Construct} */\n const closeStart = {\n tokenize: tokenizeCloseStart,\n partial: true\n }\n let initialPrefix = 0\n let sizeOpen = 0\n /** @type {NonNullable} */\n let marker\n return start\n\n /**\n * Start of code.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse whitespace like `markdown-rs`.\n return beforeSequenceOpen(code)\n }\n\n /**\n * In opening fence, after prefix, at sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeSequenceOpen(code) {\n const tail = self.events[self.events.length - 1]\n initialPrefix =\n tail && tail[1].type === 'linePrefix'\n ? tail[2].sliceSerialize(tail[1], true).length\n : 0\n marker = code\n effects.enter('codeFenced')\n effects.enter('codeFencedFence')\n effects.enter('codeFencedFenceSequence')\n return sequenceOpen(code)\n }\n\n /**\n * In opening fence sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === marker) {\n sizeOpen++\n effects.consume(code)\n return sequenceOpen\n }\n if (sizeOpen < 3) {\n return nok(code)\n }\n effects.exit('codeFencedFenceSequence')\n return markdownSpace(code)\n ? factorySpace(effects, infoBefore, 'whitespace')(code)\n : infoBefore(code)\n }\n\n /**\n * In opening fence, after the sequence (and optional whitespace), before info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function infoBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFencedFence')\n return self.interrupt\n ? ok(code)\n : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code)\n }\n effects.enter('codeFencedFenceInfo')\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return info(code)\n }\n\n /**\n * In info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function info(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceInfo')\n return infoBefore(code)\n }\n if (markdownSpace(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceInfo')\n return factorySpace(effects, metaBefore, 'whitespace')(code)\n }\n if (code === 96 && code === marker) {\n return nok(code)\n }\n effects.consume(code)\n return info\n }\n\n /**\n * In opening fence, after info and whitespace, before meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function metaBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return infoBefore(code)\n }\n effects.enter('codeFencedFenceMeta')\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return meta(code)\n }\n\n /**\n * In meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceMeta')\n return infoBefore(code)\n }\n if (code === 96 && code === marker) {\n return nok(code)\n }\n effects.consume(code)\n return meta\n }\n\n /**\n * At eol/eof in code, before a non-lazy closing fence or content.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function atNonLazyBreak(code) {\n return effects.attempt(closeStart, after, contentBefore)(code)\n }\n\n /**\n * Before code content, not a closing fence, at eol.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentBefore(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return contentStart\n }\n\n /**\n * Before code content, not a closing fence.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentStart(code) {\n return initialPrefix > 0 && markdownSpace(code)\n ? factorySpace(\n effects,\n beforeContentChunk,\n 'linePrefix',\n initialPrefix + 1\n )(code)\n : beforeContentChunk(code)\n }\n\n /**\n * Before code content, after optional prefix.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeContentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code)\n }\n effects.enter('codeFlowValue')\n return contentChunk(code)\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^^^^^^^^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFlowValue')\n return beforeContentChunk(code)\n }\n effects.consume(code)\n return contentChunk\n }\n\n /**\n * After code.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n effects.exit('codeFenced')\n return ok(code)\n }\n\n /**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\n function tokenizeCloseStart(effects, ok, nok) {\n let size = 0\n return startBefore\n\n /**\n *\n *\n * @type {State}\n */\n function startBefore(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return start\n }\n\n /**\n * Before closing fence, at optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Always populated by defaults.\n\n // To do: `enter` here or in next state?\n effects.enter('codeFencedFence')\n return markdownSpace(code)\n ? factorySpace(\n effects,\n beforeSequenceClose,\n 'linePrefix',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4\n )(code)\n : beforeSequenceClose(code)\n }\n\n /**\n * In closing fence, after optional whitespace, at sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeSequenceClose(code) {\n if (code === marker) {\n effects.enter('codeFencedFenceSequence')\n return sequenceClose(code)\n }\n return nok(code)\n }\n\n /**\n * In closing fence sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n if (code === marker) {\n size++\n effects.consume(code)\n return sequenceClose\n }\n if (size >= sizeOpen) {\n effects.exit('codeFencedFenceSequence')\n return markdownSpace(code)\n ? factorySpace(effects, sequenceCloseAfter, 'whitespace')(code)\n : sequenceCloseAfter(code)\n }\n return nok(code)\n }\n\n /**\n * After closing fence sequence, after optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceCloseAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFencedFence')\n return ok(code)\n }\n return nok(code)\n }\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuation(effects, ok, nok) {\n const self = this\n return start\n\n /**\n *\n *\n * @type {State}\n */\n function start(code) {\n if (code === null) {\n return nok(code)\n }\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return lineStart\n }\n\n /**\n *\n *\n * @type {State}\n */\n function lineStart(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code)\n }\n}\n","/// \n\n/* eslint-env browser */\n\nconst element = document.createElement('i')\n\n/**\n * @param {string} value\n * @returns {string|false}\n */\nexport function decodeNamedCharacterReference(value) {\n const characterReference = '&' + value + ';'\n element.innerHTML = characterReference\n const char = element.textContent\n\n // Some named character references do not require the closing semicolon\n // (`¬`, for instance), which leads to situations where parsing the assumed\n // named reference of `¬it;` will result in the string `¬it;`.\n // When we encounter a trailing semicolon after parsing, and the character\n // reference to decode was not a semicolon (`;`), we can assume that the\n // matching was not complete.\n // @ts-expect-error: TypeScript is wrong that `textContent` on elements can\n // yield `null`.\n if (char.charCodeAt(char.length - 1) === 59 /* `;` */ && value !== 'semi') {\n return false\n }\n\n // If the decoded string is equal to the input, the character reference was\n // not valid.\n // @ts-expect-error: TypeScript is wrong that `textContent` on elements can\n // yield `null`.\n return char === characterReference ? false : char\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {decodeNamedCharacterReference} from 'decode-named-character-reference'\nimport {\n asciiAlphanumeric,\n asciiDigit,\n asciiHexDigit\n} from 'micromark-util-character'\n/** @type {Construct} */\nexport const characterReference = {\n name: 'characterReference',\n tokenize: tokenizeCharacterReference\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterReference(effects, ok, nok) {\n const self = this\n let size = 0\n /** @type {number} */\n let max\n /** @type {(code: Code) => boolean} */\n let test\n return start\n\n /**\n * Start of character reference.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('characterReference')\n effects.enter('characterReferenceMarker')\n effects.consume(code)\n effects.exit('characterReferenceMarker')\n return open\n }\n\n /**\n * After `&`, at `#` for numeric references or alphanumeric for named\n * references.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 35) {\n effects.enter('characterReferenceMarkerNumeric')\n effects.consume(code)\n effects.exit('characterReferenceMarkerNumeric')\n return numeric\n }\n effects.enter('characterReferenceValue')\n max = 31\n test = asciiAlphanumeric\n return value(code)\n }\n\n /**\n * After `#`, at `x` for hexadecimals or digit for decimals.\n *\n * ```markdown\n * > | a{b\n * ^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function numeric(code) {\n if (code === 88 || code === 120) {\n effects.enter('characterReferenceMarkerHexadecimal')\n effects.consume(code)\n effects.exit('characterReferenceMarkerHexadecimal')\n effects.enter('characterReferenceValue')\n max = 6\n test = asciiHexDigit\n return value\n }\n effects.enter('characterReferenceValue')\n max = 7\n test = asciiDigit\n return value(code)\n }\n\n /**\n * After markers (`&#x`, `&#`, or `&`), in value, before `;`.\n *\n * The character reference kind defines what and how many characters are\n * allowed.\n *\n * ```markdown\n * > | a&b\n * ^^^\n * > | a{b\n * ^^^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function value(code) {\n if (code === 59 && size) {\n const token = effects.exit('characterReferenceValue')\n if (\n test === asciiAlphanumeric &&\n !decodeNamedCharacterReference(self.sliceSerialize(token))\n ) {\n return nok(code)\n }\n\n // To do: `markdown-rs` uses a different name:\n // `CharacterReferenceMarkerSemi`.\n effects.enter('characterReferenceMarker')\n effects.consume(code)\n effects.exit('characterReferenceMarker')\n effects.exit('characterReference')\n return ok\n }\n if (test(code) && size++ < max) {\n effects.consume(code)\n return value\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {asciiPunctuation} from 'micromark-util-character'\n/** @type {Construct} */\nexport const characterEscape = {\n name: 'characterEscape',\n tokenize: tokenizeCharacterEscape\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterEscape(effects, ok, nok) {\n return start\n\n /**\n * Start of character escape.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('characterEscape')\n effects.enter('escapeMarker')\n effects.consume(code)\n effects.exit('escapeMarker')\n return inside\n }\n\n /**\n * After `\\`, at punctuation.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // ASCII punctuation.\n if (asciiPunctuation(code)) {\n effects.enter('characterEscapeValue')\n effects.consume(code)\n effects.exit('characterEscapeValue')\n effects.exit('characterEscape')\n return ok\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\n/** @type {Construct} */\nexport const lineEnding = {\n name: 'lineEnding',\n tokenize: tokenizeLineEnding\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLineEnding(effects, ok) {\n return start\n\n /** @type {State} */\n function start(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, ok, 'linePrefix')\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factoryDestination} from 'micromark-factory-destination'\nimport {factoryLabel} from 'micromark-factory-label'\nimport {factoryTitle} from 'micromark-factory-title'\nimport {factoryWhitespace} from 'micromark-factory-whitespace'\nimport {markdownLineEndingOrSpace} from 'micromark-util-character'\nimport {push, splice} from 'micromark-util-chunked'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nimport {resolveAll} from 'micromark-util-resolve-all'\n/** @type {Construct} */\nexport const labelEnd = {\n name: 'labelEnd',\n tokenize: tokenizeLabelEnd,\n resolveTo: resolveToLabelEnd,\n resolveAll: resolveAllLabelEnd\n}\n\n/** @type {Construct} */\nconst resourceConstruct = {\n tokenize: tokenizeResource\n}\n/** @type {Construct} */\nconst referenceFullConstruct = {\n tokenize: tokenizeReferenceFull\n}\n/** @type {Construct} */\nconst referenceCollapsedConstruct = {\n tokenize: tokenizeReferenceCollapsed\n}\n\n/** @type {Resolver} */\nfunction resolveAllLabelEnd(events) {\n let index = -1\n while (++index < events.length) {\n const token = events[index][1]\n if (\n token.type === 'labelImage' ||\n token.type === 'labelLink' ||\n token.type === 'labelEnd'\n ) {\n // Remove the marker.\n events.splice(index + 1, token.type === 'labelImage' ? 4 : 2)\n token.type = 'data'\n index++\n }\n }\n return events\n}\n\n/** @type {Resolver} */\nfunction resolveToLabelEnd(events, context) {\n let index = events.length\n let offset = 0\n /** @type {Token} */\n let token\n /** @type {number | undefined} */\n let open\n /** @type {number | undefined} */\n let close\n /** @type {Array} */\n let media\n\n // Find an opening.\n while (index--) {\n token = events[index][1]\n if (open) {\n // If we see another link, or inactive link label, we’ve been here before.\n if (\n token.type === 'link' ||\n (token.type === 'labelLink' && token._inactive)\n ) {\n break\n }\n\n // Mark other link openings as inactive, as we can’t have links in\n // links.\n if (events[index][0] === 'enter' && token.type === 'labelLink') {\n token._inactive = true\n }\n } else if (close) {\n if (\n events[index][0] === 'enter' &&\n (token.type === 'labelImage' || token.type === 'labelLink') &&\n !token._balanced\n ) {\n open = index\n if (token.type !== 'labelLink') {\n offset = 2\n break\n }\n }\n } else if (token.type === 'labelEnd') {\n close = index\n }\n }\n const group = {\n type: events[open][1].type === 'labelLink' ? 'link' : 'image',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n }\n const label = {\n type: 'label',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[close][1].end)\n }\n const text = {\n type: 'labelText',\n start: Object.assign({}, events[open + offset + 2][1].end),\n end: Object.assign({}, events[close - 2][1].start)\n }\n media = [\n ['enter', group, context],\n ['enter', label, context]\n ]\n\n // Opening marker.\n media = push(media, events.slice(open + 1, open + offset + 3))\n\n // Text open.\n media = push(media, [['enter', text, context]])\n\n // Always populated by defaults.\n\n // Between.\n media = push(\n media,\n resolveAll(\n context.parser.constructs.insideSpan.null,\n events.slice(open + offset + 4, close - 3),\n context\n )\n )\n\n // Text close, marker close, label close.\n media = push(media, [\n ['exit', text, context],\n events[close - 2],\n events[close - 1],\n ['exit', label, context]\n ])\n\n // Reference, resource, or so.\n media = push(media, events.slice(close + 1))\n\n // Media close.\n media = push(media, [['exit', group, context]])\n splice(events, open, events.length, media)\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLabelEnd(effects, ok, nok) {\n const self = this\n let index = self.events.length\n /** @type {Token} */\n let labelStart\n /** @type {boolean} */\n let defined\n\n // Find an opening.\n while (index--) {\n if (\n (self.events[index][1].type === 'labelImage' ||\n self.events[index][1].type === 'labelLink') &&\n !self.events[index][1]._balanced\n ) {\n labelStart = self.events[index][1]\n break\n }\n }\n return start\n\n /**\n * Start of label end.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // If there is not an okay opening.\n if (!labelStart) {\n return nok(code)\n }\n\n // If the corresponding label (link) start is marked as inactive,\n // it means we’d be wrapping a link, like this:\n //\n // ```markdown\n // > | a [b [c](d) e](f) g.\n // ^\n // ```\n //\n // We can’t have that, so it’s just balanced brackets.\n if (labelStart._inactive) {\n return labelEndNok(code)\n }\n defined = self.parser.defined.includes(\n normalizeIdentifier(\n self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })\n )\n )\n effects.enter('labelEnd')\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelEnd')\n return after\n }\n\n /**\n * After `]`.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Note: `markdown-rs` also parses GFM footnotes here, which for us is in\n // an extension.\n\n // Resource (`[asd](fgh)`)?\n if (code === 40) {\n return effects.attempt(\n resourceConstruct,\n labelEndOk,\n defined ? labelEndOk : labelEndNok\n )(code)\n }\n\n // Full (`[asd][fgh]`) or collapsed (`[asd][]`) reference?\n if (code === 91) {\n return effects.attempt(\n referenceFullConstruct,\n labelEndOk,\n defined ? referenceNotFull : labelEndNok\n )(code)\n }\n\n // Shortcut (`[asd]`) reference?\n return defined ? labelEndOk(code) : labelEndNok(code)\n }\n\n /**\n * After `]`, at `[`, but not at a full reference.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceNotFull(code) {\n return effects.attempt(\n referenceCollapsedConstruct,\n labelEndOk,\n labelEndNok\n )(code)\n }\n\n /**\n * Done, we found something.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndOk(code) {\n // Note: `markdown-rs` does a bunch of stuff here.\n return ok(code)\n }\n\n /**\n * Done, it’s nothing.\n *\n * There was an okay opening, but we didn’t match anything.\n *\n * ```markdown\n * > | [a](b c\n * ^\n * > | [a][b c\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndNok(code) {\n labelStart._balanced = true\n return nok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeResource(effects, ok, nok) {\n return resourceStart\n\n /**\n * At a resource.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceStart(code) {\n effects.enter('resource')\n effects.enter('resourceMarker')\n effects.consume(code)\n effects.exit('resourceMarker')\n return resourceBefore\n }\n\n /**\n * In resource, after `(`, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBefore(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, resourceOpen)(code)\n : resourceOpen(code)\n }\n\n /**\n * In resource, after optional whitespace, at `)` or a destination.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceOpen(code) {\n if (code === 41) {\n return resourceEnd(code)\n }\n return factoryDestination(\n effects,\n resourceDestinationAfter,\n resourceDestinationMissing,\n 'resourceDestination',\n 'resourceDestinationLiteral',\n 'resourceDestinationLiteralMarker',\n 'resourceDestinationRaw',\n 'resourceDestinationString',\n 32\n )(code)\n }\n\n /**\n * In resource, after destination, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationAfter(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, resourceBetween)(code)\n : resourceEnd(code)\n }\n\n /**\n * At invalid destination.\n *\n * ```markdown\n * > | [a](<<) b\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationMissing(code) {\n return nok(code)\n }\n\n /**\n * In resource, after destination and whitespace, at `(` or title.\n *\n * ```markdown\n * > | [a](b ) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBetween(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(\n effects,\n resourceTitleAfter,\n nok,\n 'resourceTitle',\n 'resourceTitleMarker',\n 'resourceTitleString'\n )(code)\n }\n return resourceEnd(code)\n }\n\n /**\n * In resource, after title, at optional whitespace.\n *\n * ```markdown\n * > | [a](b \"c\") d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceTitleAfter(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, resourceEnd)(code)\n : resourceEnd(code)\n }\n\n /**\n * In resource, at `)`.\n *\n * ```markdown\n * > | [a](b) d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceEnd(code) {\n if (code === 41) {\n effects.enter('resourceMarker')\n effects.consume(code)\n effects.exit('resourceMarker')\n effects.exit('resource')\n return ok\n }\n return nok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceFull(effects, ok, nok) {\n const self = this\n return referenceFull\n\n /**\n * In a reference (full), at the `[`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFull(code) {\n return factoryLabel.call(\n self,\n effects,\n referenceFullAfter,\n referenceFullMissing,\n 'reference',\n 'referenceMarker',\n 'referenceString'\n )(code)\n }\n\n /**\n * In a reference (full), after `]`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullAfter(code) {\n return self.parser.defined.includes(\n normalizeIdentifier(\n self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)\n )\n )\n ? ok(code)\n : nok(code)\n }\n\n /**\n * In reference (full) that was missing.\n *\n * ```markdown\n * > | [a][b d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullMissing(code) {\n return nok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceCollapsed(effects, ok, nok) {\n return referenceCollapsedStart\n\n /**\n * In reference (collapsed), at `[`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedStart(code) {\n // We only attempt a collapsed label if there’s a `[`.\n\n effects.enter('reference')\n effects.enter('referenceMarker')\n effects.consume(code)\n effects.exit('referenceMarker')\n return referenceCollapsedOpen\n }\n\n /**\n * In reference (collapsed), at `]`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedOpen(code) {\n if (code === 93) {\n effects.enter('referenceMarker')\n effects.consume(code)\n effects.exit('referenceMarker')\n effects.exit('reference')\n return ok\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {labelEnd} from './label-end.js'\n\n/** @type {Construct} */\nexport const labelStartImage = {\n name: 'labelStartImage',\n tokenize: tokenizeLabelStartImage,\n resolveAll: labelEnd.resolveAll\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartImage(effects, ok, nok) {\n const self = this\n return start\n\n /**\n * Start of label (image) start.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('labelImage')\n effects.enter('labelImageMarker')\n effects.consume(code)\n effects.exit('labelImageMarker')\n return open\n }\n\n /**\n * After `!`, at `[`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 91) {\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelImage')\n return after\n }\n return nok(code)\n }\n\n /**\n * After `![`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * This is needed in because, when GFM footnotes are enabled, images never\n * form when started with a `^`.\n * Instead, links form:\n *\n * ```markdown\n * ![^a](b)\n *\n * ![^a][b]\n *\n * [b]: c\n * ```\n *\n * ```html\n *

!^a

\n *

!^a

\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // To do: use a new field to do this, this is still needed for\n // `micromark-extension-gfm-footnote`, but the `label-start-link`\n // behavior isn’t.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs\n ? nok(code)\n : ok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n */\n\nimport {\n markdownLineEndingOrSpace,\n unicodePunctuation,\n unicodeWhitespace\n} from 'micromark-util-character'\n/**\n * Classify whether a code represents whitespace, punctuation, or something\n * else.\n *\n * Used for attention (emphasis, strong), whose sequences can open or close\n * based on the class of surrounding characters.\n *\n * > 👉 **Note**: eof (`null`) is seen as whitespace.\n *\n * @param {Code} code\n * Code.\n * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}\n * Group.\n */\nexport function classifyCharacter(code) {\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return 1\n }\n if (unicodePunctuation(code)) {\n return 2\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Point} Point\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {push, splice} from 'micromark-util-chunked'\nimport {classifyCharacter} from 'micromark-util-classify-character'\nimport {resolveAll} from 'micromark-util-resolve-all'\n/** @type {Construct} */\nexport const attention = {\n name: 'attention',\n tokenize: tokenizeAttention,\n resolveAll: resolveAllAttention\n}\n\n/**\n * Take all events and resolve attention to emphasis or strong.\n *\n * @type {Resolver}\n */\nfunction resolveAllAttention(events, context) {\n let index = -1\n /** @type {number} */\n let open\n /** @type {Token} */\n let group\n /** @type {Token} */\n let text\n /** @type {Token} */\n let openingSequence\n /** @type {Token} */\n let closingSequence\n /** @type {number} */\n let use\n /** @type {Array} */\n let nextEvents\n /** @type {number} */\n let offset\n\n // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n while (++index < events.length) {\n // Find a token that can close.\n if (\n events[index][0] === 'enter' &&\n events[index][1].type === 'attentionSequence' &&\n events[index][1]._close\n ) {\n open = index\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (\n events[open][0] === 'exit' &&\n events[open][1].type === 'attentionSequence' &&\n events[open][1]._open &&\n // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) ===\n context.sliceSerialize(events[index][1]).charCodeAt(0)\n ) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if (\n (events[open][1]._close || events[index][1]._open) &&\n (events[index][1].end.offset - events[index][1].start.offset) % 3 &&\n !(\n (events[open][1].end.offset -\n events[open][1].start.offset +\n events[index][1].end.offset -\n events[index][1].start.offset) %\n 3\n )\n ) {\n continue\n }\n\n // Number of markers to use from the sequence.\n use =\n events[open][1].end.offset - events[open][1].start.offset > 1 &&\n events[index][1].end.offset - events[index][1].start.offset > 1\n ? 2\n : 1\n const start = Object.assign({}, events[open][1].end)\n const end = Object.assign({}, events[index][1].start)\n movePoint(start, -use)\n movePoint(end, use)\n openingSequence = {\n type: use > 1 ? 'strongSequence' : 'emphasisSequence',\n start,\n end: Object.assign({}, events[open][1].end)\n }\n closingSequence = {\n type: use > 1 ? 'strongSequence' : 'emphasisSequence',\n start: Object.assign({}, events[index][1].start),\n end\n }\n text = {\n type: use > 1 ? 'strongText' : 'emphasisText',\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n }\n group = {\n type: use > 1 ? 'strong' : 'emphasis',\n start: Object.assign({}, openingSequence.start),\n end: Object.assign({}, closingSequence.end)\n }\n events[open][1].end = Object.assign({}, openingSequence.start)\n events[index][1].start = Object.assign({}, closingSequence.end)\n nextEvents = []\n\n // If there are more markers in the opening, add them before.\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [\n ['enter', events[open][1], context],\n ['exit', events[open][1], context]\n ])\n }\n\n // Opening.\n nextEvents = push(nextEvents, [\n ['enter', group, context],\n ['enter', openingSequence, context],\n ['exit', openingSequence, context],\n ['enter', text, context]\n ])\n\n // Always populated by defaults.\n\n // Between.\n nextEvents = push(\n nextEvents,\n resolveAll(\n context.parser.constructs.insideSpan.null,\n events.slice(open + 1, index),\n context\n )\n )\n\n // Closing.\n nextEvents = push(nextEvents, [\n ['exit', text, context],\n ['enter', closingSequence, context],\n ['exit', closingSequence, context],\n ['exit', group, context]\n ])\n\n // If there are more markers in the closing, add them after.\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2\n nextEvents = push(nextEvents, [\n ['enter', events[index][1], context],\n ['exit', events[index][1], context]\n ])\n } else {\n offset = 0\n }\n splice(events, open - 1, index - open + 3, nextEvents)\n index = open + nextEvents.length - offset - 2\n break\n }\n }\n }\n }\n\n // Remove remaining sequences.\n index = -1\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data'\n }\n }\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeAttention(effects, ok) {\n const attentionMarkers = this.parser.constructs.attentionMarkers.null\n const previous = this.previous\n const before = classifyCharacter(previous)\n\n /** @type {NonNullable} */\n let marker\n return start\n\n /**\n * Before a sequence.\n *\n * ```markdown\n * > | **\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n marker = code\n effects.enter('attentionSequence')\n return inside(code)\n }\n\n /**\n * In a sequence.\n *\n * ```markdown\n * > | **\n * ^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code)\n return inside\n }\n const token = effects.exit('attentionSequence')\n\n // To do: next major: move this to resolver, just like `markdown-rs`.\n const after = classifyCharacter(code)\n\n // Always populated by defaults.\n\n const open =\n !after || (after === 2 && before) || attentionMarkers.includes(code)\n const close =\n !before || (before === 2 && after) || attentionMarkers.includes(previous)\n token._open = Boolean(marker === 42 ? open : open && (before || !close))\n token._close = Boolean(marker === 42 ? close : close && (after || !open))\n return ok(code)\n }\n}\n\n/**\n * Move a point a bit.\n *\n * Note: `move` only works inside lines! It’s not possible to move past other\n * chunks (replacement characters, tabs, or line endings).\n *\n * @param {Point} point\n * @param {number} offset\n * @returns {void}\n */\nfunction movePoint(point, offset) {\n point.column += offset\n point.offset += offset\n point._bufferIndex += offset\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n asciiAtext,\n asciiControl\n} from 'micromark-util-character'\n/** @type {Construct} */\nexport const autolink = {\n name: 'autolink',\n tokenize: tokenizeAutolink\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeAutolink(effects, ok, nok) {\n let size = 0\n return start\n\n /**\n * Start of an autolink.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('autolink')\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.enter('autolinkProtocol')\n return open\n }\n\n /**\n * After `<`, at protocol or atext.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (asciiAlpha(code)) {\n effects.consume(code)\n return schemeOrEmailAtext\n }\n return emailAtext(code)\n }\n\n /**\n * At second byte of protocol or atext.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeOrEmailAtext(code) {\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) {\n // Count the previous alphabetical from `open` too.\n size = 1\n return schemeInsideOrEmailAtext(code)\n }\n return emailAtext(code)\n }\n\n /**\n * In ambiguous protocol or atext.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeInsideOrEmailAtext(code) {\n if (code === 58) {\n effects.consume(code)\n size = 0\n return urlInside\n }\n\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if (\n (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) &&\n size++ < 32\n ) {\n effects.consume(code)\n return schemeInsideOrEmailAtext\n }\n size = 0\n return emailAtext(code)\n }\n\n /**\n * After protocol, in URL.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function urlInside(code) {\n if (code === 62) {\n effects.exit('autolinkProtocol')\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.exit('autolink')\n return ok\n }\n\n // ASCII control, space, or `<`.\n if (code === null || code === 32 || code === 60 || asciiControl(code)) {\n return nok(code)\n }\n effects.consume(code)\n return urlInside\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function emailAtext(code) {\n if (code === 64) {\n effects.consume(code)\n return emailAtSignOrDot\n }\n if (asciiAtext(code)) {\n effects.consume(code)\n return emailAtext\n }\n return nok(code)\n }\n\n /**\n * In label, after at-sign or dot.\n *\n * ```markdown\n * > | ab\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function emailAtSignOrDot(code) {\n return asciiAlphanumeric(code) ? emailLabel(code) : nok(code)\n }\n\n /**\n * In label, where `.` and `>` are allowed.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function emailLabel(code) {\n if (code === 46) {\n effects.consume(code)\n size = 0\n return emailAtSignOrDot\n }\n if (code === 62) {\n // Exit, then change the token type.\n effects.exit('autolinkProtocol').type = 'autolinkEmail'\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.exit('autolink')\n return ok\n }\n return emailValue(code)\n }\n\n /**\n * In label, where `.` and `>` are *not* allowed.\n *\n * Though, this is also used in `emailLabel` to parse other values.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function emailValue(code) {\n // ASCII alphanumeric or `-`.\n if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) {\n const next = code === 45 ? emailValue : emailLabel\n effects.consume(code)\n return next\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n markdownLineEnding,\n markdownLineEndingOrSpace,\n markdownSpace\n} from 'micromark-util-character'\n/** @type {Construct} */\nexport const htmlText = {\n name: 'htmlText',\n tokenize: tokenizeHtmlText\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlText(effects, ok, nok) {\n const self = this\n /** @type {NonNullable | undefined} */\n let marker\n /** @type {number} */\n let index\n /** @type {State} */\n let returnState\n return start\n\n /**\n * Start of HTML (text).\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('htmlText')\n effects.enter('htmlTextData')\n effects.consume(code)\n return open\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | a c\n * ^\n * > | a c\n * ^\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code)\n return declarationOpen\n }\n if (code === 47) {\n effects.consume(code)\n return tagCloseStart\n }\n if (code === 63) {\n effects.consume(code)\n return instruction\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code)\n return tagOpen\n }\n return nok(code)\n }\n\n /**\n * After ` | a c\n * ^\n * > | a c\n * ^\n * > | a &<]]> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code)\n return commentOpenInside\n }\n if (code === 91) {\n effects.consume(code)\n index = 0\n return cdataOpenInside\n }\n if (asciiAlpha(code)) {\n effects.consume(code)\n return declaration\n }\n return nok(code)\n }\n\n /**\n * In a comment, after ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code)\n return commentEnd\n }\n return nok(code)\n }\n\n /**\n * In comment.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function comment(code) {\n if (code === null) {\n return nok(code)\n }\n if (code === 45) {\n effects.consume(code)\n return commentClose\n }\n if (markdownLineEnding(code)) {\n returnState = comment\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return comment\n }\n\n /**\n * In comment, after `-`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentClose(code) {\n if (code === 45) {\n effects.consume(code)\n return commentEnd\n }\n return comment(code)\n }\n\n /**\n * In comment, after `--`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentEnd(code) {\n return code === 62\n ? end(code)\n : code === 45\n ? commentClose(code)\n : comment(code)\n }\n\n /**\n * After ` | a &<]]> b\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = 'CDATA['\n if (code === value.charCodeAt(index++)) {\n effects.consume(code)\n return index === value.length ? cdata : cdataOpenInside\n }\n return nok(code)\n }\n\n /**\n * In CDATA.\n *\n * ```markdown\n * > | a &<]]> b\n * ^^^\n * ```\n *\n * @type {State}\n */\n function cdata(code) {\n if (code === null) {\n return nok(code)\n }\n if (code === 93) {\n effects.consume(code)\n return cdataClose\n }\n if (markdownLineEnding(code)) {\n returnState = cdata\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return cdata\n }\n\n /**\n * In CDATA, after `]`, at another `]`.\n *\n * ```markdown\n * > | a &<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataClose(code) {\n if (code === 93) {\n effects.consume(code)\n return cdataEnd\n }\n return cdata(code)\n }\n\n /**\n * In CDATA, after `]]`, at `>`.\n *\n * ```markdown\n * > | a &<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataEnd(code) {\n if (code === 62) {\n return end(code)\n }\n if (code === 93) {\n effects.consume(code)\n return cdataEnd\n }\n return cdata(code)\n }\n\n /**\n * In declaration.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function declaration(code) {\n if (code === null || code === 62) {\n return end(code)\n }\n if (markdownLineEnding(code)) {\n returnState = declaration\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return declaration\n }\n\n /**\n * In instruction.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function instruction(code) {\n if (code === null) {\n return nok(code)\n }\n if (code === 63) {\n effects.consume(code)\n return instructionClose\n }\n if (markdownLineEnding(code)) {\n returnState = instruction\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return instruction\n }\n\n /**\n * In instruction, after `?`, at `>`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function instructionClose(code) {\n return code === 62 ? end(code) : instruction(code)\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code)\n return tagClose\n }\n return nok(code)\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagClose(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n return tagClose\n }\n return tagCloseBetween(code)\n }\n\n /**\n * In closing tag, after tag name.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseBetween(code) {\n if (markdownLineEnding(code)) {\n returnState = tagCloseBetween\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagCloseBetween\n }\n return end(code)\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpen(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n return tagOpen\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n return nok(code)\n }\n\n /**\n * In opening tag, after tag name.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenBetween(code) {\n if (code === 47) {\n effects.consume(code)\n return end\n }\n\n // ASCII alphabetical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code)\n return tagOpenAttributeName\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenBetween\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenBetween\n }\n return end(code)\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | a d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeName(code) {\n // ASCII alphabetical and `-`, `.`, `:`, and `_`.\n if (\n code === 45 ||\n code === 46 ||\n code === 58 ||\n code === 95 ||\n asciiAlphanumeric(code)\n ) {\n effects.consume(code)\n return tagOpenAttributeName\n }\n return tagOpenAttributeNameAfter(code)\n }\n\n /**\n * After attribute name, before initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | a d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code)\n return tagOpenAttributeValueBefore\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeNameAfter\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenAttributeNameAfter\n }\n return tagOpenBetween(code)\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueBefore(code) {\n if (\n code === null ||\n code === 60 ||\n code === 61 ||\n code === 62 ||\n code === 96\n ) {\n return nok(code)\n }\n if (code === 34 || code === 39) {\n effects.consume(code)\n marker = code\n return tagOpenAttributeValueQuoted\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueBefore\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenAttributeValueBefore\n }\n effects.consume(code)\n return tagOpenAttributeValueUnquoted\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuoted(code) {\n if (code === marker) {\n effects.consume(code)\n marker = undefined\n return tagOpenAttributeValueQuotedAfter\n }\n if (code === null) {\n return nok(code)\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueQuoted\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return tagOpenAttributeValueQuoted\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueUnquoted(code) {\n if (\n code === null ||\n code === 34 ||\n code === 39 ||\n code === 60 ||\n code === 61 ||\n code === 96\n ) {\n return nok(code)\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n effects.consume(code)\n return tagOpenAttributeValueUnquoted\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the end\n * of the tag.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n return nok(code)\n }\n\n /**\n * In certain circumstances of a tag where only an `>` is allowed.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function end(code) {\n if (code === 62) {\n effects.consume(code)\n effects.exit('htmlTextData')\n effects.exit('htmlText')\n return ok\n }\n return nok(code)\n }\n\n /**\n * At eol.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * > | a \n * ```\n *\n * @type {State}\n */\n function lineEndingBefore(code) {\n effects.exit('htmlTextData')\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return lineEndingAfter\n }\n\n /**\n * After eol, at optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a \n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfter(code) {\n // Always populated by defaults.\n\n return markdownSpace(code)\n ? factorySpace(\n effects,\n lineEndingAfterPrefix,\n 'linePrefix',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4\n )(code)\n : lineEndingAfterPrefix(code)\n }\n\n /**\n * After eol, after optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a \n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfterPrefix(code) {\n effects.enter('htmlTextData')\n return returnState(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {labelEnd} from './label-end.js'\n\n/** @type {Construct} */\nexport const labelStartLink = {\n name: 'labelStartLink',\n tokenize: tokenizeLabelStartLink,\n resolveAll: labelEnd.resolveAll\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartLink(effects, ok, nok) {\n const self = this\n return start\n\n /**\n * Start of label (link) start.\n *\n * ```markdown\n * > | a [b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('labelLink')\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelLink')\n return after\n }\n\n /** @type {State} */\n function after(code) {\n // To do: this isn’t needed in `micromark-extension-gfm-footnote`,\n // remove.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs\n ? nok(code)\n : ok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {markdownLineEnding} from 'micromark-util-character'\n/** @type {Construct} */\nexport const hardBreakEscape = {\n name: 'hardBreakEscape',\n tokenize: tokenizeHardBreakEscape\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeHardBreakEscape(effects, ok, nok) {\n return start\n\n /**\n * Start of a hard break (escape).\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('hardBreakEscape')\n effects.consume(code)\n return after\n }\n\n /**\n * After `\\`, at eol.\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (markdownLineEnding(code)) {\n effects.exit('hardBreakEscape')\n return ok(code)\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Previous} Previous\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {markdownLineEnding} from 'micromark-util-character'\n/** @type {Construct} */\nexport const codeText = {\n name: 'codeText',\n tokenize: tokenizeCodeText,\n resolve: resolveCodeText,\n previous\n}\n\n// To do: next major: don’t resolve, like `markdown-rs`.\n/** @type {Resolver} */\nfunction resolveCodeText(events) {\n let tailExitIndex = events.length - 4\n let headEnterIndex = 3\n /** @type {number} */\n let index\n /** @type {number | undefined} */\n let enter\n\n // If we start and end with an EOL or a space.\n if (\n (events[headEnterIndex][1].type === 'lineEnding' ||\n events[headEnterIndex][1].type === 'space') &&\n (events[tailExitIndex][1].type === 'lineEnding' ||\n events[tailExitIndex][1].type === 'space')\n ) {\n index = headEnterIndex\n\n // And we have data.\n while (++index < tailExitIndex) {\n if (events[index][1].type === 'codeTextData') {\n // Then we have padding.\n events[headEnterIndex][1].type = 'codeTextPadding'\n events[tailExitIndex][1].type = 'codeTextPadding'\n headEnterIndex += 2\n tailExitIndex -= 2\n break\n }\n }\n }\n\n // Merge adjacent spaces and data.\n index = headEnterIndex - 1\n tailExitIndex++\n while (++index <= tailExitIndex) {\n if (enter === undefined) {\n if (index !== tailExitIndex && events[index][1].type !== 'lineEnding') {\n enter = index\n }\n } else if (\n index === tailExitIndex ||\n events[index][1].type === 'lineEnding'\n ) {\n events[enter][1].type = 'codeTextData'\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end\n events.splice(enter + 2, index - enter - 2)\n tailExitIndex -= index - enter - 2\n index = enter + 2\n }\n enter = undefined\n }\n }\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Previous}\n */\nfunction previous(code) {\n // If there is a previous code, there will always be a tail.\n return (\n code !== 96 ||\n this.events[this.events.length - 1][1].type === 'characterEscape'\n )\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCodeText(effects, ok, nok) {\n const self = this\n let sizeOpen = 0\n /** @type {number} */\n let size\n /** @type {Token} */\n let token\n return start\n\n /**\n * Start of code (text).\n *\n * ```markdown\n * > | `a`\n * ^\n * > | \\`a`\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('codeText')\n effects.enter('codeTextSequence')\n return sequenceOpen(code)\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 96) {\n effects.consume(code)\n sizeOpen++\n return sequenceOpen\n }\n effects.exit('codeTextSequence')\n return between(code)\n }\n\n /**\n * Between something and something else.\n *\n * ```markdown\n * > | `a`\n * ^^\n * ```\n *\n * @type {State}\n */\n function between(code) {\n // EOF.\n if (code === null) {\n return nok(code)\n }\n\n // To do: next major: don’t do spaces in resolve, but when compiling,\n // like `markdown-rs`.\n // Tabs don’t work, and virtual spaces don’t make sense.\n if (code === 32) {\n effects.enter('space')\n effects.consume(code)\n effects.exit('space')\n return between\n }\n\n // Closing fence? Could also be data.\n if (code === 96) {\n token = effects.enter('codeTextSequence')\n size = 0\n return sequenceClose(code)\n }\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return between\n }\n\n // Data.\n effects.enter('codeTextData')\n return data(code)\n }\n\n /**\n * In data.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (\n code === null ||\n code === 32 ||\n code === 96 ||\n markdownLineEnding(code)\n ) {\n effects.exit('codeTextData')\n return between(code)\n }\n effects.consume(code)\n return data\n }\n\n /**\n * In closing sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n // More.\n if (code === 96) {\n effects.consume(code)\n size++\n return sequenceClose\n }\n\n // Done!\n if (size === sizeOpen) {\n effects.exit('codeTextSequence')\n effects.exit('codeText')\n return ok(code)\n }\n\n // More or less accents: mark as data.\n token.type = 'codeTextData'\n return data(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Extension} Extension\n */\n\nimport {\n attention,\n autolink,\n blockQuote,\n characterEscape,\n characterReference,\n codeFenced,\n codeIndented,\n codeText,\n definition,\n hardBreakEscape,\n headingAtx,\n htmlFlow,\n htmlText,\n labelEnd,\n labelStartImage,\n labelStartLink,\n lineEnding,\n list,\n setextUnderline,\n thematicBreak\n} from 'micromark-core-commonmark'\nimport {resolver as resolveText} from './initialize/text.js'\n\n/** @satisfies {Extension['document']} */\nexport const document = {\n [42]: list,\n [43]: list,\n [45]: list,\n [48]: list,\n [49]: list,\n [50]: list,\n [51]: list,\n [52]: list,\n [53]: list,\n [54]: list,\n [55]: list,\n [56]: list,\n [57]: list,\n [62]: blockQuote\n}\n\n/** @satisfies {Extension['contentInitial']} */\nexport const contentInitial = {\n [91]: definition\n}\n\n/** @satisfies {Extension['flowInitial']} */\nexport const flowInitial = {\n [-2]: codeIndented,\n [-1]: codeIndented,\n [32]: codeIndented\n}\n\n/** @satisfies {Extension['flow']} */\nexport const flow = {\n [35]: headingAtx,\n [42]: thematicBreak,\n [45]: [setextUnderline, thematicBreak],\n [60]: htmlFlow,\n [61]: setextUnderline,\n [95]: thematicBreak,\n [96]: codeFenced,\n [126]: codeFenced\n}\n\n/** @satisfies {Extension['string']} */\nexport const string = {\n [38]: characterReference,\n [92]: characterEscape\n}\n\n/** @satisfies {Extension['text']} */\nexport const text = {\n [-5]: lineEnding,\n [-4]: lineEnding,\n [-3]: lineEnding,\n [33]: labelStartImage,\n [38]: characterReference,\n [42]: attention,\n [60]: [autolink, htmlText],\n [91]: labelStartLink,\n [92]: [hardBreakEscape, characterEscape],\n [93]: labelEnd,\n [95]: attention,\n [96]: codeText\n}\n\n/** @satisfies {Extension['insideSpan']} */\nexport const insideSpan = {\n null: [attention, resolveText]\n}\n\n/** @satisfies {Extension['attentionMarkers']} */\nexport const attentionMarkers = {\n null: [42, 95]\n}\n\n/** @satisfies {Extension['disable']} */\nexport const disable = {\n null: []\n}\n","/**\n * @typedef {import('micromark-util-types').Create} Create\n * @typedef {import('micromark-util-types').FullNormalizedExtension} FullNormalizedExtension\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').ParseContext} ParseContext\n * @typedef {import('micromark-util-types').ParseOptions} ParseOptions\n */\n\nimport {combineExtensions} from 'micromark-util-combine-extensions'\nimport {content} from './initialize/content.js'\nimport {document} from './initialize/document.js'\nimport {flow} from './initialize/flow.js'\nimport {text, string} from './initialize/text.js'\nimport {createTokenizer} from './create-tokenizer.js'\nimport * as defaultConstructs from './constructs.js'\n\n/**\n * @param {ParseOptions | null | undefined} [options]\n * @returns {ParseContext}\n */\nexport function parse(options) {\n const settings = options || {}\n const constructs =\n /** @type {FullNormalizedExtension} */\n combineExtensions([defaultConstructs, ...(settings.extensions || [])])\n\n /** @type {ParseContext} */\n const parser = {\n defined: [],\n lazy: {},\n constructs,\n content: create(content),\n document: create(document),\n flow: create(flow),\n string: create(string),\n text: create(text)\n }\n return parser\n\n /**\n * @param {InitialConstruct} initial\n */\n function create(initial) {\n return creator\n /** @type {Create} */\n function creator(from) {\n return createTokenizer(parser, initial, from)\n }\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Chunk} Chunk\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Encoding} Encoding\n * @typedef {import('micromark-util-types').Value} Value\n */\n\n/**\n * @callback Preprocessor\n * @param {Value} value\n * @param {Encoding | null | undefined} [encoding]\n * @param {boolean | null | undefined} [end=false]\n * @returns {Array}\n */\n\nconst search = /[\\0\\t\\n\\r]/g\n\n/**\n * @returns {Preprocessor}\n */\nexport function preprocess() {\n let column = 1\n let buffer = ''\n /** @type {boolean | undefined} */\n let start = true\n /** @type {boolean | undefined} */\n let atCarriageReturn\n return preprocessor\n\n /** @type {Preprocessor} */\n function preprocessor(value, encoding, end) {\n /** @type {Array} */\n const chunks = []\n /** @type {RegExpMatchArray | null} */\n let match\n /** @type {number} */\n let next\n /** @type {number} */\n let startPosition\n /** @type {number} */\n let endPosition\n /** @type {Code} */\n let code\n\n // @ts-expect-error `Buffer` does allow an encoding.\n value = buffer + value.toString(encoding)\n startPosition = 0\n buffer = ''\n if (start) {\n // To do: `markdown-rs` actually parses BOMs (byte order mark).\n if (value.charCodeAt(0) === 65279) {\n startPosition++\n }\n start = undefined\n }\n while (startPosition < value.length) {\n search.lastIndex = startPosition\n match = search.exec(value)\n endPosition =\n match && match.index !== undefined ? match.index : value.length\n code = value.charCodeAt(endPosition)\n if (!match) {\n buffer = value.slice(startPosition)\n break\n }\n if (code === 10 && startPosition === endPosition && atCarriageReturn) {\n chunks.push(-3)\n atCarriageReturn = undefined\n } else {\n if (atCarriageReturn) {\n chunks.push(-5)\n atCarriageReturn = undefined\n }\n if (startPosition < endPosition) {\n chunks.push(value.slice(startPosition, endPosition))\n column += endPosition - startPosition\n }\n switch (code) {\n case 0: {\n chunks.push(65533)\n column++\n break\n }\n case 9: {\n next = Math.ceil(column / 4) * 4\n chunks.push(-2)\n while (column++ < next) chunks.push(-1)\n break\n }\n case 10: {\n chunks.push(-4)\n column = 1\n break\n }\n default: {\n atCarriageReturn = true\n column = 1\n }\n }\n }\n startPosition = endPosition + 1\n }\n if (end) {\n if (atCarriageReturn) chunks.push(-5)\n if (buffer) chunks.push(buffer)\n chunks.push(null)\n }\n return chunks\n }\n}\n","/**\n * Turn the number (in string form as either hexa- or plain decimal) coming from\n * a numeric character reference into a character.\n *\n * Sort of like `String.fromCharCode(Number.parseInt(value, base))`, but makes\n * non-characters and control characters safe.\n *\n * @param {string} value\n * Value to decode.\n * @param {number} base\n * Numeric base.\n * @returns {string}\n * Character.\n */\nexport function decodeNumericCharacterReference(value, base) {\n const code = Number.parseInt(value, base)\n if (\n // C0 except for HT, LF, FF, CR, space.\n code < 9 ||\n code === 11 ||\n (code > 13 && code < 32) ||\n // Control character (DEL) of C0, and C1 controls.\n (code > 126 && code < 160) ||\n // Lone high surrogates and low surrogates.\n (code > 55295 && code < 57344) ||\n // Noncharacters.\n (code > 64975 && code < 65008) /* eslint-disable no-bitwise */ ||\n (code & 65535) === 65535 ||\n (code & 65535) === 65534 /* eslint-enable no-bitwise */ ||\n // Out of range\n code > 1114111\n ) {\n return '\\uFFFD'\n }\n return String.fromCharCode(code)\n}\n","import {decodeNamedCharacterReference} from 'decode-named-character-reference'\nimport {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'\nconst characterEscapeOrReference =\n /\\\\([!-/:-@[-`{-~])|&(#(?:\\d{1,7}|x[\\da-f]{1,6})|[\\da-z]{1,31});/gi\n\n/**\n * Decode markdown strings (which occur in places such as fenced code info\n * strings, destinations, labels, and titles).\n *\n * The “string” content type allows character escapes and -references.\n * This decodes those.\n *\n * @param {string} value\n * Value to decode.\n * @returns {string}\n * Decoded value.\n */\nexport function decodeString(value) {\n return value.replace(characterEscapeOrReference, decode)\n}\n\n/**\n * @param {string} $0\n * @param {string} $1\n * @param {string} $2\n * @returns {string}\n */\nfunction decode($0, $1, $2) {\n if ($1) {\n // Escape.\n return $1\n }\n\n // Reference.\n const head = $2.charCodeAt(0)\n if (head === 35) {\n const head = $2.charCodeAt(1)\n const hex = head === 120 || head === 88\n return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10)\n }\n return decodeNamedCharacterReference($2) || $0\n}\n","/**\n * @typedef {import('micromark-util-types').Encoding} Encoding\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').ParseOptions} ParseOptions\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Value} Value\n *\n * @typedef {import('unist').Parent} UnistParent\n * @typedef {import('unist').Point} Point\n *\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n * @typedef {import('mdast').StaticPhrasingContent} StaticPhrasingContent\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Break} Break\n * @typedef {import('mdast').Blockquote} Blockquote\n * @typedef {import('mdast').Code} Code\n * @typedef {import('mdast').Definition} Definition\n * @typedef {import('mdast').Emphasis} Emphasis\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('mdast').HTML} HTML\n * @typedef {import('mdast').Image} Image\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('mdast').Link} Link\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('mdast').List} List\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').Strong} Strong\n * @typedef {import('mdast').Text} Text\n * @typedef {import('mdast').ThematicBreak} ThematicBreak\n * @typedef {import('mdast').ReferenceType} ReferenceType\n * @typedef {import('../index.js').CompileData} CompileData\n */\n\n/**\n * @typedef {Root | Content} Node\n * @typedef {Extract} Parent\n *\n * @typedef {Omit & {type: 'fragment', children: Array}} Fragment\n */\n\n/**\n * @callback Transform\n * Extra transform, to change the AST afterwards.\n * @param {Root} tree\n * Tree to transform.\n * @returns {Root | undefined | null | void}\n * New tree or nothing (in which case the current tree is used).\n *\n * @callback Handle\n * Handle a token.\n * @param {CompileContext} this\n * Context.\n * @param {Token} token\n * Current token.\n * @returns {void}\n * Nothing.\n *\n * @typedef {Record} Handles\n * Token types mapping to handles\n *\n * @callback OnEnterError\n * Handle the case where the `right` token is open, but it is closed (by the\n * `left` token) or because we reached the end of the document.\n * @param {Omit} this\n * Context.\n * @param {Token | undefined} left\n * Left token.\n * @param {Token} right\n * Right token.\n * @returns {void}\n * Nothing.\n *\n * @callback OnExitError\n * Handle the case where the `right` token is open but it is closed by\n * exiting the `left` token.\n * @param {Omit} this\n * Context.\n * @param {Token} left\n * Left token.\n * @param {Token} right\n * Right token.\n * @returns {void}\n * Nothing.\n *\n * @typedef {[Token, OnEnterError | undefined]} TokenTuple\n * Open token on the stack, with an optional error handler for when\n * that token isn’t closed properly.\n */\n\n/**\n * @typedef Config\n * Configuration.\n *\n * We have our defaults, but extensions will add more.\n * @property {Array} canContainEols\n * Token types where line endings are used.\n * @property {Handles} enter\n * Opening handles.\n * @property {Handles} exit\n * Closing handles.\n * @property {Array} transforms\n * Tree transforms.\n *\n * @typedef {Partial} Extension\n * Change how markdown tokens from micromark are turned into mdast.\n *\n * @typedef CompileContext\n * mdast compiler context.\n * @property {Array} stack\n * Stack of nodes.\n * @property {Array} tokenStack\n * Stack of tokens.\n * @property {(key: Key) => CompileData[Key]} getData\n * Get data from the key/value store.\n * @property {(key: Key, value?: CompileData[Key]) => void} setData\n * Set data into the key/value store.\n * @property {(this: CompileContext) => void} buffer\n * Capture some of the output data.\n * @property {(this: CompileContext) => string} resume\n * Stop capturing and access the output data.\n * @property {(this: CompileContext, node: Kind, token: Token, onError?: OnEnterError) => Kind} enter\n * Enter a token.\n * @property {(this: CompileContext, token: Token, onError?: OnExitError) => Node} exit\n * Exit a token.\n * @property {TokenizeContext['sliceSerialize']} sliceSerialize\n * Get the string value of a token.\n * @property {Config} config\n * Configuration.\n *\n * @typedef FromMarkdownOptions\n * Configuration for how to build mdast.\n * @property {Array> | null | undefined} [mdastExtensions]\n * Extensions for this utility to change how tokens are turned into a tree.\n *\n * @typedef {ParseOptions & FromMarkdownOptions} Options\n * Configuration.\n */\n\n// To do: micromark: create a registry of tokens?\n// To do: next major: don’t return given `Node` from `enter`.\n// To do: next major: remove setter/getter.\n\nimport {toString} from 'mdast-util-to-string'\nimport {parse} from 'micromark/lib/parse.js'\nimport {preprocess} from 'micromark/lib/preprocess.js'\nimport {postprocess} from 'micromark/lib/postprocess.js'\nimport {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'\nimport {decodeString} from 'micromark-util-decode-string'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nimport {decodeNamedCharacterReference} from 'decode-named-character-reference'\nimport {stringifyPosition} from 'unist-util-stringify-position'\nconst own = {}.hasOwnProperty\n\n/**\n * @param value\n * Markdown to parse.\n * @param encoding\n * Character encoding for when `value` is `Buffer`.\n * @param options\n * Configuration.\n * @returns\n * mdast tree.\n */\nexport const fromMarkdown =\n /**\n * @type {(\n * ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) &\n * ((value: Value, options?: Options | null | undefined) => Root)\n * )}\n */\n\n /**\n * @param {Value} value\n * @param {Encoding | Options | null | undefined} [encoding]\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n */\n function (value, encoding, options) {\n if (typeof encoding !== 'string') {\n options = encoding\n encoding = undefined\n }\n return compiler(options)(\n postprocess(\n parse(options).document().write(preprocess()(value, encoding, true))\n )\n )\n }\n\n/**\n * Note this compiler only understand complete buffering, not streaming.\n *\n * @param {Options | null | undefined} [options]\n */\nfunction compiler(options) {\n /** @type {Config} */\n const config = {\n transforms: [],\n canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],\n enter: {\n autolink: opener(link),\n autolinkProtocol: onenterdata,\n autolinkEmail: onenterdata,\n atxHeading: opener(heading),\n blockQuote: opener(blockQuote),\n characterEscape: onenterdata,\n characterReference: onenterdata,\n codeFenced: opener(codeFlow),\n codeFencedFenceInfo: buffer,\n codeFencedFenceMeta: buffer,\n codeIndented: opener(codeFlow, buffer),\n codeText: opener(codeText, buffer),\n codeTextData: onenterdata,\n data: onenterdata,\n codeFlowValue: onenterdata,\n definition: opener(definition),\n definitionDestinationString: buffer,\n definitionLabelString: buffer,\n definitionTitleString: buffer,\n emphasis: opener(emphasis),\n hardBreakEscape: opener(hardBreak),\n hardBreakTrailing: opener(hardBreak),\n htmlFlow: opener(html, buffer),\n htmlFlowData: onenterdata,\n htmlText: opener(html, buffer),\n htmlTextData: onenterdata,\n image: opener(image),\n label: buffer,\n link: opener(link),\n listItem: opener(listItem),\n listItemValue: onenterlistitemvalue,\n listOrdered: opener(list, onenterlistordered),\n listUnordered: opener(list),\n paragraph: opener(paragraph),\n reference: onenterreference,\n referenceString: buffer,\n resourceDestinationString: buffer,\n resourceTitleString: buffer,\n setextHeading: opener(heading),\n strong: opener(strong),\n thematicBreak: opener(thematicBreak)\n },\n exit: {\n atxHeading: closer(),\n atxHeadingSequence: onexitatxheadingsequence,\n autolink: closer(),\n autolinkEmail: onexitautolinkemail,\n autolinkProtocol: onexitautolinkprotocol,\n blockQuote: closer(),\n characterEscapeValue: onexitdata,\n characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,\n characterReferenceMarkerNumeric: onexitcharacterreferencemarker,\n characterReferenceValue: onexitcharacterreferencevalue,\n codeFenced: closer(onexitcodefenced),\n codeFencedFence: onexitcodefencedfence,\n codeFencedFenceInfo: onexitcodefencedfenceinfo,\n codeFencedFenceMeta: onexitcodefencedfencemeta,\n codeFlowValue: onexitdata,\n codeIndented: closer(onexitcodeindented),\n codeText: closer(onexitcodetext),\n codeTextData: onexitdata,\n data: onexitdata,\n definition: closer(),\n definitionDestinationString: onexitdefinitiondestinationstring,\n definitionLabelString: onexitdefinitionlabelstring,\n definitionTitleString: onexitdefinitiontitlestring,\n emphasis: closer(),\n hardBreakEscape: closer(onexithardbreak),\n hardBreakTrailing: closer(onexithardbreak),\n htmlFlow: closer(onexithtmlflow),\n htmlFlowData: onexitdata,\n htmlText: closer(onexithtmltext),\n htmlTextData: onexitdata,\n image: closer(onexitimage),\n label: onexitlabel,\n labelText: onexitlabeltext,\n lineEnding: onexitlineending,\n link: closer(onexitlink),\n listItem: closer(),\n listOrdered: closer(),\n listUnordered: closer(),\n paragraph: closer(),\n referenceString: onexitreferencestring,\n resourceDestinationString: onexitresourcedestinationstring,\n resourceTitleString: onexitresourcetitlestring,\n resource: onexitresource,\n setextHeading: closer(onexitsetextheading),\n setextHeadingLineSequence: onexitsetextheadinglinesequence,\n setextHeadingText: onexitsetextheadingtext,\n strong: closer(),\n thematicBreak: closer()\n }\n }\n configure(config, (options || {}).mdastExtensions || [])\n\n /** @type {CompileData} */\n const data = {}\n return compile\n\n /**\n * Turn micromark events into an mdast tree.\n *\n * @param {Array} events\n * Events.\n * @returns {Root}\n * mdast tree.\n */\n function compile(events) {\n /** @type {Root} */\n let tree = {\n type: 'root',\n children: []\n }\n /** @type {Omit} */\n const context = {\n stack: [tree],\n tokenStack: [],\n config,\n enter,\n exit,\n buffer,\n resume,\n setData,\n getData\n }\n /** @type {Array} */\n const listStack = []\n let index = -1\n while (++index < events.length) {\n // We preprocess lists to add `listItem` tokens, and to infer whether\n // items the list itself are spread out.\n if (\n events[index][1].type === 'listOrdered' ||\n events[index][1].type === 'listUnordered'\n ) {\n if (events[index][0] === 'enter') {\n listStack.push(index)\n } else {\n const tail = listStack.pop()\n index = prepareList(events, tail, index)\n }\n }\n }\n index = -1\n while (++index < events.length) {\n const handler = config[events[index][0]]\n if (own.call(handler, events[index][1].type)) {\n handler[events[index][1].type].call(\n Object.assign(\n {\n sliceSerialize: events[index][2].sliceSerialize\n },\n context\n ),\n events[index][1]\n )\n }\n }\n\n // Handle tokens still being open.\n if (context.tokenStack.length > 0) {\n const tail = context.tokenStack[context.tokenStack.length - 1]\n const handler = tail[1] || defaultOnError\n handler.call(context, undefined, tail[0])\n }\n\n // Figure out `root` position.\n tree.position = {\n start: point(\n events.length > 0\n ? events[0][1].start\n : {\n line: 1,\n column: 1,\n offset: 0\n }\n ),\n end: point(\n events.length > 0\n ? events[events.length - 2][1].end\n : {\n line: 1,\n column: 1,\n offset: 0\n }\n )\n }\n\n // Call transforms.\n index = -1\n while (++index < config.transforms.length) {\n tree = config.transforms[index](tree) || tree\n }\n return tree\n }\n\n /**\n * @param {Array} events\n * @param {number} start\n * @param {number} length\n * @returns {number}\n */\n function prepareList(events, start, length) {\n let index = start - 1\n let containerBalance = -1\n let listSpread = false\n /** @type {Token | undefined} */\n let listItem\n /** @type {number | undefined} */\n let lineIndex\n /** @type {number | undefined} */\n let firstBlankLineIndex\n /** @type {boolean | undefined} */\n let atMarker\n while (++index <= length) {\n const event = events[index]\n if (\n event[1].type === 'listUnordered' ||\n event[1].type === 'listOrdered' ||\n event[1].type === 'blockQuote'\n ) {\n if (event[0] === 'enter') {\n containerBalance++\n } else {\n containerBalance--\n }\n atMarker = undefined\n } else if (event[1].type === 'lineEndingBlank') {\n if (event[0] === 'enter') {\n if (\n listItem &&\n !atMarker &&\n !containerBalance &&\n !firstBlankLineIndex\n ) {\n firstBlankLineIndex = index\n }\n atMarker = undefined\n }\n } else if (\n event[1].type === 'linePrefix' ||\n event[1].type === 'listItemValue' ||\n event[1].type === 'listItemMarker' ||\n event[1].type === 'listItemPrefix' ||\n event[1].type === 'listItemPrefixWhitespace'\n ) {\n // Empty.\n } else {\n atMarker = undefined\n }\n if (\n (!containerBalance &&\n event[0] === 'enter' &&\n event[1].type === 'listItemPrefix') ||\n (containerBalance === -1 &&\n event[0] === 'exit' &&\n (event[1].type === 'listUnordered' ||\n event[1].type === 'listOrdered'))\n ) {\n if (listItem) {\n let tailIndex = index\n lineIndex = undefined\n while (tailIndex--) {\n const tailEvent = events[tailIndex]\n if (\n tailEvent[1].type === 'lineEnding' ||\n tailEvent[1].type === 'lineEndingBlank'\n ) {\n if (tailEvent[0] === 'exit') continue\n if (lineIndex) {\n events[lineIndex][1].type = 'lineEndingBlank'\n listSpread = true\n }\n tailEvent[1].type = 'lineEnding'\n lineIndex = tailIndex\n } else if (\n tailEvent[1].type === 'linePrefix' ||\n tailEvent[1].type === 'blockQuotePrefix' ||\n tailEvent[1].type === 'blockQuotePrefixWhitespace' ||\n tailEvent[1].type === 'blockQuoteMarker' ||\n tailEvent[1].type === 'listItemIndent'\n ) {\n // Empty\n } else {\n break\n }\n }\n if (\n firstBlankLineIndex &&\n (!lineIndex || firstBlankLineIndex < lineIndex)\n ) {\n listItem._spread = true\n }\n\n // Fix position.\n listItem.end = Object.assign(\n {},\n lineIndex ? events[lineIndex][1].start : event[1].end\n )\n events.splice(lineIndex || index, 0, ['exit', listItem, event[2]])\n index++\n length++\n }\n\n // Create a new list item.\n if (event[1].type === 'listItemPrefix') {\n listItem = {\n type: 'listItem',\n _spread: false,\n start: Object.assign({}, event[1].start),\n // @ts-expect-error: we’ll add `end` in a second.\n end: undefined\n }\n // @ts-expect-error: `listItem` is most definitely defined, TS...\n events.splice(index, 0, ['enter', listItem, event[2]])\n index++\n length++\n firstBlankLineIndex = undefined\n atMarker = true\n }\n }\n }\n events[start][1]._spread = listSpread\n return length\n }\n\n /**\n * Set data.\n *\n * @template {keyof CompileData} Key\n * Field type.\n * @param {Key} key\n * Key of field.\n * @param {CompileData[Key]} [value]\n * New value.\n * @returns {void}\n * Nothing.\n */\n function setData(key, value) {\n data[key] = value\n }\n\n /**\n * Get data.\n *\n * @template {keyof CompileData} Key\n * Field type.\n * @param {Key} key\n * Key of field.\n * @returns {CompileData[Key]}\n * Value.\n */\n function getData(key) {\n return data[key]\n }\n\n /**\n * Create an opener handle.\n *\n * @param {(token: Token) => Node} create\n * Create a node.\n * @param {Handle} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function opener(create, and) {\n return open\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {void}\n */\n function open(token) {\n enter.call(this, create(token), token)\n if (and) and.call(this, token)\n }\n }\n\n /**\n * @this {CompileContext}\n * @returns {void}\n */\n function buffer() {\n this.stack.push({\n type: 'fragment',\n children: []\n })\n }\n\n /**\n * @template {Node} Kind\n * Node type.\n * @this {CompileContext}\n * Context.\n * @param {Kind} node\n * Node to enter.\n * @param {Token} token\n * Corresponding token.\n * @param {OnEnterError | undefined} [errorHandler]\n * Handle the case where this token is open, but it is closed by something else.\n * @returns {Kind}\n * The given node.\n */\n function enter(node, token, errorHandler) {\n const parent = this.stack[this.stack.length - 1]\n // @ts-expect-error: Assume `Node` can exist as a child of `parent`.\n parent.children.push(node)\n this.stack.push(node)\n this.tokenStack.push([token, errorHandler])\n // @ts-expect-error: `end` will be patched later.\n node.position = {\n start: point(token.start)\n }\n return node\n }\n\n /**\n * Create a closer handle.\n *\n * @param {Handle} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function closer(and) {\n return close\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {void}\n */\n function close(token) {\n if (and) and.call(this, token)\n exit.call(this, token)\n }\n }\n\n /**\n * @this {CompileContext}\n * Context.\n * @param {Token} token\n * Corresponding token.\n * @param {OnExitError | undefined} [onExitError]\n * Handle the case where another token is open.\n * @returns {Node}\n * The closed node.\n */\n function exit(token, onExitError) {\n const node = this.stack.pop()\n const open = this.tokenStack.pop()\n if (!open) {\n throw new Error(\n 'Cannot close `' +\n token.type +\n '` (' +\n stringifyPosition({\n start: token.start,\n end: token.end\n }) +\n '): it’s not open'\n )\n } else if (open[0].type !== token.type) {\n if (onExitError) {\n onExitError.call(this, token, open[0])\n } else {\n const handler = open[1] || defaultOnError\n handler.call(this, token, open[0])\n }\n }\n node.position.end = point(token.end)\n return node\n }\n\n /**\n * @this {CompileContext}\n * @returns {string}\n */\n function resume() {\n return toString(this.stack.pop())\n }\n\n //\n // Handlers.\n //\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistordered() {\n setData('expectingFirstListItemValue', true)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistitemvalue(token) {\n if (getData('expectingFirstListItemValue')) {\n const ancestor = this.stack[this.stack.length - 2]\n ancestor.start = Number.parseInt(this.sliceSerialize(token), 10)\n setData('expectingFirstListItemValue')\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfenceinfo() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.lang = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfencemeta() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.meta = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfence() {\n // Exit if this is the closing fence.\n if (getData('flowCodeInside')) return\n this.buffer()\n setData('flowCodeInside', true)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefenced() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data.replace(/^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g, '')\n setData('flowCodeInside')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodeindented() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data.replace(/(\\r?\\n|\\r)$/g, '')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitionlabelstring(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.label = label\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiontitlestring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.title = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiondestinationstring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.url = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitatxheadingsequence(token) {\n const node = this.stack[this.stack.length - 1]\n if (!node.depth) {\n const depth = this.sliceSerialize(token).length\n node.depth = depth\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadingtext() {\n setData('setextHeadingSlurpLineEnding', true)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadinglinesequence(token) {\n const node = this.stack[this.stack.length - 1]\n node.depth = this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheading() {\n setData('setextHeadingSlurpLineEnding')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterdata(token) {\n const node = this.stack[this.stack.length - 1]\n let tail = node.children[node.children.length - 1]\n if (!tail || tail.type !== 'text') {\n // Add a new text node.\n tail = text()\n // @ts-expect-error: we’ll add `end` later.\n tail.position = {\n start: point(token.start)\n }\n // @ts-expect-error: Assume `parent` accepts `text`.\n node.children.push(tail)\n }\n this.stack.push(tail)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitdata(token) {\n const tail = this.stack.pop()\n tail.value += this.sliceSerialize(token)\n tail.position.end = point(token.end)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlineending(token) {\n const context = this.stack[this.stack.length - 1]\n // If we’re at a hard break, include the line ending in there.\n if (getData('atHardBreak')) {\n const tail = context.children[context.children.length - 1]\n tail.position.end = point(token.end)\n setData('atHardBreak')\n return\n }\n if (\n !getData('setextHeadingSlurpLineEnding') &&\n config.canContainEols.includes(context.type)\n ) {\n onenterdata.call(this, token)\n onexitdata.call(this, token)\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithardbreak() {\n setData('atHardBreak', true)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmlflow() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmltext() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcodetext() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlink() {\n const node = this.stack[this.stack.length - 1]\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n // To do: clean.\n if (getData('inReference')) {\n /** @type {ReferenceType} */\n const referenceType = getData('referenceType') || 'shortcut'\n node.type += 'Reference'\n // @ts-expect-error: mutate.\n node.referenceType = referenceType\n // @ts-expect-error: mutate.\n delete node.url\n delete node.title\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier\n // @ts-expect-error: mutate.\n delete node.label\n }\n setData('referenceType')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitimage() {\n const node = this.stack[this.stack.length - 1]\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n // To do: clean.\n if (getData('inReference')) {\n /** @type {ReferenceType} */\n const referenceType = getData('referenceType') || 'shortcut'\n node.type += 'Reference'\n // @ts-expect-error: mutate.\n node.referenceType = referenceType\n // @ts-expect-error: mutate.\n delete node.url\n delete node.title\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier\n // @ts-expect-error: mutate.\n delete node.label\n }\n setData('referenceType')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabeltext(token) {\n const string = this.sliceSerialize(token)\n const ancestor = this.stack[this.stack.length - 2]\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n ancestor.label = decodeString(string)\n // @ts-expect-error: same as above.\n ancestor.identifier = normalizeIdentifier(string).toLowerCase()\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabel() {\n const fragment = this.stack[this.stack.length - 1]\n const value = this.resume()\n const node = this.stack[this.stack.length - 1]\n // Assume a reference.\n setData('inReference', true)\n if (node.type === 'link') {\n /** @type {Array} */\n // @ts-expect-error: Assume static phrasing content.\n const children = fragment.children\n node.children = children\n } else {\n node.alt = value\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcedestinationstring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.url = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcetitlestring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.title = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresource() {\n setData('inReference')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterreference() {\n setData('referenceType', 'collapsed')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitreferencestring(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n node.label = label\n // @ts-expect-error: same as above.\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n setData('referenceType', 'full')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcharacterreferencemarker(token) {\n setData('characterReferenceType', token.type)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreferencevalue(token) {\n const data = this.sliceSerialize(token)\n const type = getData('characterReferenceType')\n /** @type {string} */\n let value\n if (type) {\n value = decodeNumericCharacterReference(\n data,\n type === 'characterReferenceMarkerNumeric' ? 10 : 16\n )\n setData('characterReferenceType')\n } else {\n const result = decodeNamedCharacterReference(data)\n value = result\n }\n const tail = this.stack.pop()\n tail.value += value\n tail.position.end = point(token.end)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkprotocol(token) {\n onexitdata.call(this, token)\n const node = this.stack[this.stack.length - 1]\n node.url = this.sliceSerialize(token)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkemail(token) {\n onexitdata.call(this, token)\n const node = this.stack[this.stack.length - 1]\n node.url = 'mailto:' + this.sliceSerialize(token)\n }\n\n //\n // Creaters.\n //\n\n /** @returns {Blockquote} */\n function blockQuote() {\n return {\n type: 'blockquote',\n children: []\n }\n }\n\n /** @returns {Code} */\n function codeFlow() {\n return {\n type: 'code',\n lang: null,\n meta: null,\n value: ''\n }\n }\n\n /** @returns {InlineCode} */\n function codeText() {\n return {\n type: 'inlineCode',\n value: ''\n }\n }\n\n /** @returns {Definition} */\n function definition() {\n return {\n type: 'definition',\n identifier: '',\n label: null,\n title: null,\n url: ''\n }\n }\n\n /** @returns {Emphasis} */\n function emphasis() {\n return {\n type: 'emphasis',\n children: []\n }\n }\n\n /** @returns {Heading} */\n function heading() {\n // @ts-expect-error `depth` will be set later.\n return {\n type: 'heading',\n depth: undefined,\n children: []\n }\n }\n\n /** @returns {Break} */\n function hardBreak() {\n return {\n type: 'break'\n }\n }\n\n /** @returns {HTML} */\n function html() {\n return {\n type: 'html',\n value: ''\n }\n }\n\n /** @returns {Image} */\n function image() {\n return {\n type: 'image',\n title: null,\n url: '',\n alt: null\n }\n }\n\n /** @returns {Link} */\n function link() {\n return {\n type: 'link',\n title: null,\n url: '',\n children: []\n }\n }\n\n /**\n * @param {Token} token\n * @returns {List}\n */\n function list(token) {\n return {\n type: 'list',\n ordered: token.type === 'listOrdered',\n start: null,\n spread: token._spread,\n children: []\n }\n }\n\n /**\n * @param {Token} token\n * @returns {ListItem}\n */\n function listItem(token) {\n return {\n type: 'listItem',\n spread: token._spread,\n checked: null,\n children: []\n }\n }\n\n /** @returns {Paragraph} */\n function paragraph() {\n return {\n type: 'paragraph',\n children: []\n }\n }\n\n /** @returns {Strong} */\n function strong() {\n return {\n type: 'strong',\n children: []\n }\n }\n\n /** @returns {Text} */\n function text() {\n return {\n type: 'text',\n value: ''\n }\n }\n\n /** @returns {ThematicBreak} */\n function thematicBreak() {\n return {\n type: 'thematicBreak'\n }\n }\n}\n\n/**\n * Copy a point-like value.\n *\n * @param {Point} d\n * Point-like value.\n * @returns {Point}\n * unist point.\n */\nfunction point(d) {\n return {\n line: d.line,\n column: d.column,\n offset: d.offset\n }\n}\n\n/**\n * @param {Config} combined\n * @param {Array>} extensions\n * @returns {void}\n */\nfunction configure(combined, extensions) {\n let index = -1\n while (++index < extensions.length) {\n const value = extensions[index]\n if (Array.isArray(value)) {\n configure(combined, value)\n } else {\n extension(combined, value)\n }\n }\n}\n\n/**\n * @param {Config} combined\n * @param {Extension} extension\n * @returns {void}\n */\nfunction extension(combined, extension) {\n /** @type {keyof Extension} */\n let key\n for (key in extension) {\n if (own.call(extension, key)) {\n if (key === 'canContainEols') {\n const right = extension[key]\n if (right) {\n combined[key].push(...right)\n }\n } else if (key === 'transforms') {\n const right = extension[key]\n if (right) {\n combined[key].push(...right)\n }\n } else if (key === 'enter' || key === 'exit') {\n const right = extension[key]\n if (right) {\n Object.assign(combined[key], right)\n }\n }\n }\n }\n}\n\n/** @type {OnEnterError} */\nfunction defaultOnError(left, right) {\n if (left) {\n throw new Error(\n 'Cannot close `' +\n left.type +\n '` (' +\n stringifyPosition({\n start: left.start,\n end: left.end\n }) +\n '): a different token (`' +\n right.type +\n '`, ' +\n stringifyPosition({\n start: right.start,\n end: right.end\n }) +\n ') is open'\n )\n } else {\n throw new Error(\n 'Cannot close document, a token (`' +\n right.type +\n '`, ' +\n stringifyPosition({\n start: right.start,\n end: right.end\n }) +\n ') is still open'\n )\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n */\n\nimport {subtokenize} from 'micromark-util-subtokenize'\n\n/**\n * @param {Array} events\n * @returns {Array}\n */\nexport function postprocess(events) {\n while (!subtokenize(events)) {\n // Empty\n }\n return events\n}\n","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast-util-from-markdown').Options} Options\n */\n\nimport {fromMarkdown} from 'mdast-util-from-markdown'\n\n/**\n * @this {import('unified').Processor}\n * @type {import('unified').Plugin<[Options?] | void[], string, Root>}\n */\nexport default function remarkParse(options) {\n /** @type {import('unified').ParserFunction} */\n const parser = (doc) => {\n // Assume options.\n const settings = /** @type {Options} */ (this.data('settings'))\n\n return fromMarkdown(\n doc,\n Object.assign({}, settings, options, {\n // Note: these options are not in the readme.\n // The goal is for them to be set by plugins on `data` instead of being\n // passed by users.\n extensions: this.data('micromarkExtensions') || [],\n mdastExtensions: this.data('fromMarkdownExtensions') || []\n })\n )\n }\n\n Object.assign(this, {Parser: parser})\n}\n","import {asciiAlphanumeric} from 'micromark-util-character'\nimport {encode} from 'micromark-util-encode'\n/**\n * Make a value safe for injection as a URL.\n *\n * This encodes unsafe characters with percent-encoding and skips already\n * encoded sequences (see `normalizeUri`).\n * Further unsafe characters are encoded as character references (see\n * `micromark-util-encode`).\n *\n * A regex of allowed protocols can be given, in which case the URL is\n * sanitized.\n * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or\n * `/^https?$/i` for `img[src]` (this is what `github.com` allows).\n * If the URL includes an unknown protocol (one not matched by `protocol`, such\n * as a dangerous example, `javascript:`), the value is ignored.\n *\n * @param {string | undefined} url\n * URI to sanitize.\n * @param {RegExp | null | undefined} [protocol]\n * Allowed protocols.\n * @returns {string}\n * Sanitized URI.\n */\nexport function sanitizeUri(url, protocol) {\n const value = encode(normalizeUri(url || ''))\n if (!protocol) {\n return value\n }\n const colon = value.indexOf(':')\n const questionMark = value.indexOf('?')\n const numberSign = value.indexOf('#')\n const slash = value.indexOf('/')\n if (\n // If there is no protocol, it’s relative.\n colon < 0 ||\n // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.\n (slash > -1 && colon > slash) ||\n (questionMark > -1 && colon > questionMark) ||\n (numberSign > -1 && colon > numberSign) ||\n // It is a protocol, it should be allowed.\n protocol.test(value.slice(0, colon))\n ) {\n return value\n }\n return ''\n}\n\n/**\n * Normalize a URL.\n *\n * Encode unsafe characters with percent-encoding, skipping already encoded\n * sequences.\n *\n * @param {string} value\n * URI to normalize.\n * @returns {string}\n * Normalized URI.\n */\nexport function normalizeUri(value) {\n /** @type {Array} */\n const result = []\n let index = -1\n let start = 0\n let skip = 0\n while (++index < value.length) {\n const code = value.charCodeAt(index)\n /** @type {string} */\n let replace = ''\n\n // A correct percent encoded value.\n if (\n code === 37 &&\n asciiAlphanumeric(value.charCodeAt(index + 1)) &&\n asciiAlphanumeric(value.charCodeAt(index + 2))\n ) {\n skip = 2\n }\n // ASCII.\n else if (code < 128) {\n if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {\n replace = String.fromCharCode(code)\n }\n }\n // Astral.\n else if (code > 55295 && code < 57344) {\n const next = value.charCodeAt(index + 1)\n\n // A correct surrogate pair.\n if (code < 56320 && next > 56319 && next < 57344) {\n replace = String.fromCharCode(code, next)\n skip = 1\n }\n // Lone surrogate.\n else {\n replace = '\\uFFFD'\n }\n }\n // Unicode.\n else {\n replace = String.fromCharCode(code)\n }\n if (replace) {\n result.push(value.slice(start, index), encodeURIComponent(replace))\n start = index + skip + 1\n replace = ''\n }\n if (skip) {\n index += skip\n skip = 0\n }\n }\n return result.join('') + value.slice(start)\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n */\n\n/**\n * @typedef {Record} Props\n * @typedef {null | undefined | string | Props | TestFunctionAnything | Array} Test\n * Check for an arbitrary node, unaware of TypeScript inferral.\n *\n * @callback TestFunctionAnything\n * Check if a node passes a test, unaware of TypeScript inferral.\n * @param {unknown} this\n * The given context.\n * @param {Node} node\n * A node.\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {boolean | void}\n * Whether this node passes the test.\n */\n\n/**\n * @template {Node} Kind\n * Node type.\n * @typedef {Kind['type'] | Partial | TestFunctionPredicate | Array | TestFunctionPredicate>} PredicateTest\n * Check for a node that can be inferred by TypeScript.\n */\n\n/**\n * Check if a node passes a certain test.\n *\n * @template {Node} Kind\n * Node type.\n * @callback TestFunctionPredicate\n * Complex test function for a node that can be inferred by TypeScript.\n * @param {Node} node\n * A node.\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {node is Kind}\n * Whether this node passes the test.\n */\n\n/**\n * @callback AssertAnything\n * Check that an arbitrary value is a node, unaware of TypeScript inferral.\n * @param {unknown} [node]\n * Anything (typically a node).\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {boolean}\n * Whether this is a node and passes a test.\n */\n\n/**\n * Check if a node is a node and passes a certain node test.\n *\n * @template {Node} Kind\n * Node type.\n * @callback AssertPredicate\n * Check that an arbitrary value is a specific node, aware of TypeScript.\n * @param {unknown} [node]\n * Anything (typically a node).\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {node is Kind}\n * Whether this is a node and passes a test.\n */\n\n/**\n * Check if `node` is a `Node` and whether it passes the given test.\n *\n * @param node\n * Thing to check, typically `Node`.\n * @param test\n * A check for a specific node.\n * @param index\n * The node’s position in its parent.\n * @param parent\n * The node’s parent.\n * @returns\n * Whether `node` is a node and passes a test.\n */\nexport const is =\n /**\n * @type {(\n * (() => false) &\n * ((node: unknown, test: PredicateTest, index: number, parent: Parent, context?: unknown) => node is Kind) &\n * ((node: unknown, test: PredicateTest, index?: null | undefined, parent?: null | undefined, context?: unknown) => node is Kind) &\n * ((node: unknown, test: Test, index: number, parent: Parent, context?: unknown) => boolean) &\n * ((node: unknown, test?: Test, index?: null | undefined, parent?: null | undefined, context?: unknown) => boolean)\n * )}\n */\n (\n /**\n * @param {unknown} [node]\n * @param {Test} [test]\n * @param {number | null | undefined} [index]\n * @param {Parent | null | undefined} [parent]\n * @param {unknown} [context]\n * @returns {boolean}\n */\n // eslint-disable-next-line max-params\n function is(node, test, index, parent, context) {\n const check = convert(test)\n\n if (\n index !== undefined &&\n index !== null &&\n (typeof index !== 'number' ||\n index < 0 ||\n index === Number.POSITIVE_INFINITY)\n ) {\n throw new Error('Expected positive finite index')\n }\n\n if (\n parent !== undefined &&\n parent !== null &&\n (!is(parent) || !parent.children)\n ) {\n throw new Error('Expected parent node')\n }\n\n if (\n (parent === undefined || parent === null) !==\n (index === undefined || index === null)\n ) {\n throw new Error('Expected both parent and index')\n }\n\n // @ts-expect-error Looks like a node.\n return node && node.type && typeof node.type === 'string'\n ? Boolean(check.call(context, node, index, parent))\n : false\n }\n )\n\n/**\n * Generate an assertion from a test.\n *\n * Useful if you’re going to test many nodes, for example when creating a\n * utility where something else passes a compatible test.\n *\n * The created function is a bit faster because it expects valid input only:\n * a `node`, `index`, and `parent`.\n *\n * @param test\n * * when nullish, checks if `node` is a `Node`.\n * * when `string`, works like passing `(node) => node.type === test`.\n * * when `function` checks if function passed the node is true.\n * * when `object`, checks that all keys in test are in node, and that they have (strictly) equal values.\n * * when `array`, checks if any one of the subtests pass.\n * @returns\n * An assertion.\n */\nexport const convert =\n /**\n * @type {(\n * ((test: PredicateTest) => AssertPredicate) &\n * ((test?: Test) => AssertAnything)\n * )}\n */\n (\n /**\n * @param {Test} [test]\n * @returns {AssertAnything}\n */\n function (test) {\n if (test === undefined || test === null) {\n return ok\n }\n\n if (typeof test === 'string') {\n return typeFactory(test)\n }\n\n if (typeof test === 'object') {\n return Array.isArray(test) ? anyFactory(test) : propsFactory(test)\n }\n\n if (typeof test === 'function') {\n return castFactory(test)\n }\n\n throw new Error('Expected function, string, or object as test')\n }\n )\n\n/**\n * @param {Array} tests\n * @returns {AssertAnything}\n */\nfunction anyFactory(tests) {\n /** @type {Array} */\n const checks = []\n let index = -1\n\n while (++index < tests.length) {\n checks[index] = convert(tests[index])\n }\n\n return castFactory(any)\n\n /**\n * @this {unknown}\n * @param {Array} parameters\n * @returns {boolean}\n */\n function any(...parameters) {\n let index = -1\n\n while (++index < checks.length) {\n if (checks[index].call(this, ...parameters)) return true\n }\n\n return false\n }\n}\n\n/**\n * Turn an object into a test for a node with a certain fields.\n *\n * @param {Props} check\n * @returns {AssertAnything}\n */\nfunction propsFactory(check) {\n return castFactory(all)\n\n /**\n * @param {Node} node\n * @returns {boolean}\n */\n function all(node) {\n /** @type {string} */\n let key\n\n for (key in check) {\n // @ts-expect-error: hush, it sure works as an index.\n if (node[key] !== check[key]) return false\n }\n\n return true\n }\n}\n\n/**\n * Turn a string into a test for a node with a certain type.\n *\n * @param {string} check\n * @returns {AssertAnything}\n */\nfunction typeFactory(check) {\n return castFactory(type)\n\n /**\n * @param {Node} node\n */\n function type(node) {\n return node && node.type === check\n }\n}\n\n/**\n * Turn a custom test into a test for a node that passes that test.\n *\n * @param {TestFunctionAnything} check\n * @returns {AssertAnything}\n */\nfunction castFactory(check) {\n return assertion\n\n /**\n * @this {unknown}\n * @param {unknown} node\n * @param {Array} parameters\n * @returns {boolean}\n */\n function assertion(node, ...parameters) {\n return Boolean(\n node &&\n typeof node === 'object' &&\n 'type' in node &&\n // @ts-expect-error: fine.\n Boolean(check.call(this, node, ...parameters))\n )\n }\n}\n\nfunction ok() {\n return true\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist-util-is').Test} Test\n */\n\n/**\n * @typedef {boolean | 'skip'} Action\n * Union of the action types.\n *\n * @typedef {number} Index\n * Move to the sibling at `index` next (after node itself is completely\n * traversed).\n *\n * Useful if mutating the tree, such as removing the node the visitor is\n * currently on, or any of its previous siblings.\n * Results less than 0 or greater than or equal to `children.length` stop\n * traversing the parent.\n *\n * @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple\n * List with one or two values, the first an action, the second an index.\n *\n * @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult\n * Any value that can be returned from a visitor.\n */\n\n/**\n * @template {Node} [Visited=Node]\n * Visited node type.\n * @template {Parent} [Ancestor=Parent]\n * Ancestor type.\n * @callback Visitor\n * Handle a node (matching `test`, if given).\n *\n * Visitors are free to transform `node`.\n * They can also transform the parent of node (the last of `ancestors`).\n *\n * Replacing `node` itself, if `SKIP` is not returned, still causes its\n * descendants to be walked (which is a bug).\n *\n * When adding or removing previous siblings of `node` (or next siblings, in\n * case of reverse), the `Visitor` should return a new `Index` to specify the\n * sibling to traverse after `node` is traversed.\n * Adding or removing next siblings of `node` (or previous siblings, in case\n * of reverse) is handled as expected without needing to return a new `Index`.\n *\n * Removing the children property of an ancestor still results in them being\n * traversed.\n * @param {Visited} node\n * Found node.\n * @param {Array} ancestors\n * Ancestors of `node`.\n * @returns {VisitorResult}\n * What to do next.\n *\n * An `Index` is treated as a tuple of `[CONTINUE, Index]`.\n * An `Action` is treated as a tuple of `[Action]`.\n *\n * Passing a tuple back only makes sense if the `Action` is `SKIP`.\n * When the `Action` is `EXIT`, that action can be returned.\n * When the `Action` is `CONTINUE`, `Index` can be returned.\n */\n\n/**\n * @template {Node} [Tree=Node]\n * Tree type.\n * @template {Test} [Check=string]\n * Test type.\n * @typedef {Visitor, Check>, Extract, Parent>>} BuildVisitor\n * Build a typed `Visitor` function from a tree and a test.\n *\n * It will infer which values are passed as `node` and which as `parents`.\n */\n\nimport {convert} from 'unist-util-is'\nimport {color} from './color.js'\n\n/**\n * Continue traversing as normal.\n */\nexport const CONTINUE = true\n\n/**\n * Stop traversing immediately.\n */\nexport const EXIT = false\n\n/**\n * Do not traverse this node’s children.\n */\nexport const SKIP = 'skip'\n\n/**\n * Visit nodes, with ancestral information.\n *\n * This algorithm performs *depth-first* *tree traversal* in *preorder*\n * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).\n *\n * You can choose for which nodes `visitor` is called by passing a `test`.\n * For complex tests, you should test yourself in `visitor`, as it will be\n * faster and will have improved type information.\n *\n * Walking the tree is an intensive task.\n * Make use of the return values of the visitor when possible.\n * Instead of walking a tree multiple times, walk it once, use `unist-util-is`\n * to check if a node matches, and then perform different operations.\n *\n * You can change the tree.\n * See `Visitor` for more info.\n *\n * @param tree\n * Tree to traverse.\n * @param test\n * `unist-util-is`-compatible test\n * @param visitor\n * Handle each node.\n * @param reverse\n * Traverse in reverse preorder (NRL) instead of the default preorder (NLR).\n * @returns\n * Nothing.\n */\nexport const visitParents =\n /**\n * @type {(\n * ((tree: Tree, test: Check, visitor: BuildVisitor, reverse?: boolean | null | undefined) => void) &\n * ((tree: Tree, visitor: BuildVisitor, reverse?: boolean | null | undefined) => void)\n * )}\n */\n (\n /**\n * @param {Node} tree\n * @param {Test} test\n * @param {Visitor} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {void}\n */\n function (tree, test, visitor, reverse) {\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor\n // @ts-expect-error no visitor given, so `visitor` is test.\n visitor = test\n test = null\n }\n\n const is = convert(test)\n const step = reverse ? -1 : 1\n\n factory(tree, undefined, [])()\n\n /**\n * @param {Node} node\n * @param {number | undefined} index\n * @param {Array} parents\n */\n function factory(node, index, parents) {\n /** @type {Record} */\n // @ts-expect-error: hush\n const value = node && typeof node === 'object' ? node : {}\n\n if (typeof value.type === 'string') {\n const name =\n // `hast`\n typeof value.tagName === 'string'\n ? value.tagName\n : // `xast`\n typeof value.name === 'string'\n ? value.name\n : undefined\n\n Object.defineProperty(visit, 'name', {\n value:\n 'node (' + color(node.type + (name ? '<' + name + '>' : '')) + ')'\n })\n }\n\n return visit\n\n function visit() {\n /** @type {ActionTuple} */\n let result = []\n /** @type {ActionTuple} */\n let subresult\n /** @type {number} */\n let offset\n /** @type {Array} */\n let grandparents\n\n if (!test || is(node, index, parents[parents.length - 1] || null)) {\n result = toResult(visitor(node, parents))\n\n if (result[0] === EXIT) {\n return result\n }\n }\n\n // @ts-expect-error looks like a parent.\n if (node.children && result[0] !== SKIP) {\n // @ts-expect-error looks like a parent.\n offset = (reverse ? node.children.length : -1) + step\n // @ts-expect-error looks like a parent.\n grandparents = parents.concat(node)\n\n // @ts-expect-error looks like a parent.\n while (offset > -1 && offset < node.children.length) {\n // @ts-expect-error looks like a parent.\n subresult = factory(node.children[offset], offset, grandparents)()\n\n if (subresult[0] === EXIT) {\n return subresult\n }\n\n offset =\n typeof subresult[1] === 'number' ? subresult[1] : offset + step\n }\n }\n\n return result\n }\n }\n }\n )\n\n/**\n * Turn a return value into a clean result.\n *\n * @param {VisitorResult} value\n * Valid return values from visitors.\n * @returns {ActionTuple}\n * Clean result.\n */\nfunction toResult(value) {\n if (Array.isArray(value)) {\n return value\n }\n\n if (typeof value === 'number') {\n return [CONTINUE, value]\n }\n\n return [value]\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist-util-is').Test} Test\n * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult\n */\n\n/**\n * Check if `Child` can be a child of `Ancestor`.\n *\n * Returns the ancestor when `Child` can be a child of `Ancestor`, or returns\n * `never`.\n *\n * @template {Node} Ancestor\n * Node type.\n * @template {Node} Child\n * Node type.\n * @typedef {(\n * Ancestor extends Parent\n * ? Child extends Ancestor['children'][number]\n * ? Ancestor\n * : never\n * : never\n * )} ParentsOf\n */\n\n/**\n * @template {Node} [Visited=Node]\n * Visited node type.\n * @template {Parent} [Ancestor=Parent]\n * Ancestor type.\n * @callback Visitor\n * Handle a node (matching `test`, if given).\n *\n * Visitors are free to transform `node`.\n * They can also transform `parent`.\n *\n * Replacing `node` itself, if `SKIP` is not returned, still causes its\n * descendants to be walked (which is a bug).\n *\n * When adding or removing previous siblings of `node` (or next siblings, in\n * case of reverse), the `Visitor` should return a new `Index` to specify the\n * sibling to traverse after `node` is traversed.\n * Adding or removing next siblings of `node` (or previous siblings, in case\n * of reverse) is handled as expected without needing to return a new `Index`.\n *\n * Removing the children property of `parent` still results in them being\n * traversed.\n * @param {Visited} node\n * Found node.\n * @param {Visited extends Node ? number | null : never} index\n * Index of `node` in `parent`.\n * @param {Ancestor extends Node ? Ancestor | null : never} parent\n * Parent of `node`.\n * @returns {VisitorResult}\n * What to do next.\n *\n * An `Index` is treated as a tuple of `[CONTINUE, Index]`.\n * An `Action` is treated as a tuple of `[Action]`.\n *\n * Passing a tuple back only makes sense if the `Action` is `SKIP`.\n * When the `Action` is `EXIT`, that action can be returned.\n * When the `Action` is `CONTINUE`, `Index` can be returned.\n */\n\n/**\n * Build a typed `Visitor` function from a node and all possible parents.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n *\n * @template {Node} Visited\n * Node type.\n * @template {Parent} Ancestor\n * Parent type.\n * @typedef {Visitor>} BuildVisitorFromMatch\n */\n\n/**\n * Build a typed `Visitor` function from a list of descendants and a test.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n *\n * @template {Node} Descendant\n * Node type.\n * @template {Test} Check\n * Test type.\n * @typedef {(\n * BuildVisitorFromMatch<\n * import('unist-util-visit-parents/complex-types.js').Matches,\n * Extract\n * >\n * )} BuildVisitorFromDescendants\n */\n\n/**\n * Build a typed `Visitor` function from a tree and a test.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n *\n * @template {Node} [Tree=Node]\n * Node type.\n * @template {Test} [Check=string]\n * Test type.\n * @typedef {(\n * BuildVisitorFromDescendants<\n * import('unist-util-visit-parents/complex-types.js').InclusiveDescendant,\n * Check\n * >\n * )} BuildVisitor\n */\n\nimport {visitParents} from 'unist-util-visit-parents'\n\n/**\n * Visit nodes.\n *\n * This algorithm performs *depth-first* *tree traversal* in *preorder*\n * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).\n *\n * You can choose for which nodes `visitor` is called by passing a `test`.\n * For complex tests, you should test yourself in `visitor`, as it will be\n * faster and will have improved type information.\n *\n * Walking the tree is an intensive task.\n * Make use of the return values of the visitor when possible.\n * Instead of walking a tree multiple times, walk it once, use `unist-util-is`\n * to check if a node matches, and then perform different operations.\n *\n * You can change the tree.\n * See `Visitor` for more info.\n *\n * @param tree\n * Tree to traverse.\n * @param test\n * `unist-util-is`-compatible test\n * @param visitor\n * Handle each node.\n * @param reverse\n * Traverse in reverse preorder (NRL) instead of the default preorder (NLR).\n * @returns\n * Nothing.\n */\nexport const visit =\n /**\n * @type {(\n * ((tree: Tree, test: Check, visitor: BuildVisitor, reverse?: boolean | null | undefined) => void) &\n * ((tree: Tree, visitor: BuildVisitor, reverse?: boolean | null | undefined) => void)\n * )}\n */\n (\n /**\n * @param {Node} tree\n * @param {Test} test\n * @param {Visitor} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {void}\n */\n function (tree, test, visitor, reverse) {\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor\n visitor = test\n test = null\n }\n\n visitParents(tree, test, overload, reverse)\n\n /**\n * @param {Node} node\n * @param {Array} parents\n */\n function overload(node, parents) {\n const parent = parents[parents.length - 1]\n return visitor(\n node,\n parent ? parent.children.indexOf(node) : null,\n parent\n )\n }\n }\n )\n\nexport {CONTINUE, EXIT, SKIP} from 'unist-util-visit-parents'\n","/**\n * @typedef {import('unist').Position} Position\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n */\n\n/**\n * @typedef NodeLike\n * @property {string} type\n * @property {PositionLike | null | undefined} [position]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n *\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n */\n\n/**\n * Get the starting point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointStart = point('start')\n\n/**\n * Get the ending point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointEnd = point('end')\n\n/**\n * Get the positional info of `node`.\n *\n * @param {NodeLike | Node | null | undefined} [node]\n * Node.\n * @returns {Position}\n * Position.\n */\nexport function position(node) {\n return {start: pointStart(node), end: pointEnd(node)}\n}\n\n/**\n * Get the positional info of `node`.\n *\n * @param {'start' | 'end'} type\n * Side.\n * @returns\n * Getter.\n */\nfunction point(type) {\n return point\n\n /**\n * Get the point info of `node` at a bound side.\n *\n * @param {NodeLike | Node | null | undefined} [node]\n * @returns {Point}\n */\n function point(node) {\n const point = (node && node.position && node.position[type]) || {}\n\n // To do: next major: don’t return points when invalid.\n return {\n // @ts-expect-error: in practice, null is allowed.\n line: point.line || null,\n // @ts-expect-error: in practice, null is allowed.\n column: point.column || null,\n // @ts-expect-error: in practice, null is allowed.\n offset: point.offset > -1 ? point.offset : null\n }\n }\n}\n","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Definition} Definition\n */\n\n/**\n * @typedef {Root | Content} Node\n *\n * @callback GetDefinition\n * Get a definition by identifier.\n * @param {string | null | undefined} [identifier]\n * Identifier of definition.\n * @returns {Definition | null}\n * Definition corresponding to `identifier` or `null`.\n */\n\nimport {visit} from 'unist-util-visit'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Find definitions in `tree`.\n *\n * Uses CommonMark precedence, which means that earlier definitions are\n * preferred over duplicate later definitions.\n *\n * @param {Node} tree\n * Tree to check.\n * @returns {GetDefinition}\n * Getter.\n */\nexport function definitions(tree) {\n /** @type {Record} */\n const cache = Object.create(null)\n\n if (!tree || !tree.type) {\n throw new Error('mdast-util-definitions expected node')\n }\n\n visit(tree, 'definition', (definition) => {\n const id = clean(definition.identifier)\n if (id && !own.call(cache, id)) {\n cache[id] = definition\n }\n })\n\n return definition\n\n /** @type {GetDefinition} */\n function definition(identifier) {\n const id = clean(identifier)\n // To do: next major: return `undefined` when not found.\n return id && own.call(cache, id) ? cache[id] : null\n }\n}\n\n/**\n * @param {string | null | undefined} [value]\n * @returns {string}\n */\nfunction clean(value) {\n return String(value || '').toUpperCase()\n}\n","/**\n * @typedef {import('mdast').FootnoteReference} FootnoteReference\n * @typedef {import('hast').Element} Element\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `footnoteReference` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {FootnoteReference} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function footnoteReference(state, node) {\n const id = String(node.identifier).toUpperCase()\n const safeId = normalizeUri(id.toLowerCase())\n const index = state.footnoteOrder.indexOf(id)\n /** @type {number} */\n let counter\n\n if (index === -1) {\n state.footnoteOrder.push(id)\n state.footnoteCounts[id] = 1\n counter = state.footnoteOrder.length\n } else {\n state.footnoteCounts[id]++\n counter = index + 1\n }\n\n const reuseCounter = state.footnoteCounts[id]\n\n /** @type {Element} */\n const link = {\n type: 'element',\n tagName: 'a',\n properties: {\n href: '#' + state.clobberPrefix + 'fn-' + safeId,\n id:\n state.clobberPrefix +\n 'fnref-' +\n safeId +\n (reuseCounter > 1 ? '-' + reuseCounter : ''),\n dataFootnoteRef: true,\n ariaDescribedBy: ['footnote-label']\n },\n children: [{type: 'text', value: String(counter)}]\n }\n state.patch(node, link)\n\n /** @type {Element} */\n const sup = {\n type: 'element',\n tagName: 'sup',\n properties: {},\n children: [link]\n }\n state.patch(node, sup)\n return state.applyData(node, sup)\n}\n","/**\n * @typedef {import('hast').ElementContent} ElementContent\n *\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Reference} Reference\n * @typedef {import('mdast').Root} Root\n *\n * @typedef {import('./state.js').State} State\n */\n\n/**\n * @typedef {Root | Content} Nodes\n * @typedef {Extract} References\n */\n\n// To do: next major: always return array.\n\n/**\n * Return the content of a reference without definition as plain text.\n *\n * @param {State} state\n * Info passed around.\n * @param {References} node\n * Reference node (image, link).\n * @returns {ElementContent | Array}\n * hast content.\n */\nexport function revert(state, node) {\n const subtype = node.referenceType\n let suffix = ']'\n\n if (subtype === 'collapsed') {\n suffix += '[]'\n } else if (subtype === 'full') {\n suffix += '[' + (node.label || node.identifier) + ']'\n }\n\n if (node.type === 'imageReference') {\n return {type: 'text', value: '![' + node.alt + suffix}\n }\n\n const contents = state.all(node)\n const head = contents[0]\n\n if (head && head.type === 'text') {\n head.value = '[' + head.value\n } else {\n contents.unshift({type: 'text', value: '['})\n }\n\n const tail = contents[contents.length - 1]\n\n if (tail && tail.type === 'text') {\n tail.value += suffix\n } else {\n contents.push({type: 'text', value: suffix})\n }\n\n return contents\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Parent} Parent\n * @typedef {import('mdast').Root} Root\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * @typedef {Root | Content} Nodes\n * @typedef {Extract} Parents\n */\n\n/**\n * Turn an mdast `listItem` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {ListItem} node\n * mdast node.\n * @param {Parents | null | undefined} parent\n * Parent of `node`.\n * @returns {Element}\n * hast node.\n */\nexport function listItem(state, node, parent) {\n const results = state.all(node)\n const loose = parent ? listLoose(parent) : listItemLoose(node)\n /** @type {Properties} */\n const properties = {}\n /** @type {Array} */\n const children = []\n\n if (typeof node.checked === 'boolean') {\n const head = results[0]\n /** @type {Element} */\n let paragraph\n\n if (head && head.type === 'element' && head.tagName === 'p') {\n paragraph = head\n } else {\n paragraph = {type: 'element', tagName: 'p', properties: {}, children: []}\n results.unshift(paragraph)\n }\n\n if (paragraph.children.length > 0) {\n paragraph.children.unshift({type: 'text', value: ' '})\n }\n\n paragraph.children.unshift({\n type: 'element',\n tagName: 'input',\n properties: {type: 'checkbox', checked: node.checked, disabled: true},\n children: []\n })\n\n // According to github-markdown-css, this class hides bullet.\n // See: .\n properties.className = ['task-list-item']\n }\n\n let index = -1\n\n while (++index < results.length) {\n const child = results[index]\n\n // Add eols before nodes, except if this is a loose, first paragraph.\n if (\n loose ||\n index !== 0 ||\n child.type !== 'element' ||\n child.tagName !== 'p'\n ) {\n children.push({type: 'text', value: '\\n'})\n }\n\n if (child.type === 'element' && child.tagName === 'p' && !loose) {\n children.push(...child.children)\n } else {\n children.push(child)\n }\n }\n\n const tail = results[results.length - 1]\n\n // Add a final eol.\n if (tail && (loose || tail.type !== 'element' || tail.tagName !== 'p')) {\n children.push({type: 'text', value: '\\n'})\n }\n\n /** @type {Element} */\n const result = {type: 'element', tagName: 'li', properties, children}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n\n/**\n * @param {Parents} node\n * @return {Boolean}\n */\nfunction listLoose(node) {\n let loose = false\n if (node.type === 'list') {\n loose = node.spread || false\n const children = node.children\n let index = -1\n\n while (!loose && ++index < children.length) {\n loose = listItemLoose(children[index])\n }\n }\n\n return loose\n}\n\n/**\n * @param {ListItem} node\n * @return {Boolean}\n */\nfunction listItemLoose(node) {\n const spread = node.spread\n\n return spread === undefined || spread === null\n ? node.children.length > 1\n : spread\n}\n","const tab = 9 /* `\\t` */\nconst space = 32 /* ` ` */\n\n/**\n * Remove initial and final spaces and tabs at the line breaks in `value`.\n * Does not trim initial and final spaces and tabs of the value itself.\n *\n * @param {string} value\n * Value to trim.\n * @returns {string}\n * Trimmed value.\n */\nexport function trimLines(value) {\n const source = String(value)\n const search = /\\r?\\n|\\r/g\n let match = search.exec(source)\n let last = 0\n /** @type {Array} */\n const lines = []\n\n while (match) {\n lines.push(\n trimLine(source.slice(last, match.index), last > 0, true),\n match[0]\n )\n\n last = match.index + match[0].length\n match = search.exec(source)\n }\n\n lines.push(trimLine(source.slice(last), last > 0, false))\n\n return lines.join('')\n}\n\n/**\n * @param {string} value\n * Line to trim.\n * @param {boolean} start\n * Whether to trim the start of the line.\n * @param {boolean} end\n * Whether to trim the end of the line.\n * @returns {string}\n * Trimmed line.\n */\nfunction trimLine(value, start, end) {\n let startIndex = 0\n let endIndex = value.length\n\n if (start) {\n let code = value.codePointAt(startIndex)\n\n while (code === tab || code === space) {\n startIndex++\n code = value.codePointAt(startIndex)\n }\n }\n\n if (end) {\n let code = value.codePointAt(endIndex - 1)\n\n while (code === tab || code === space) {\n endIndex--\n code = value.codePointAt(endIndex - 1)\n }\n }\n\n return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''\n}\n","import {blockquote} from './blockquote.js'\nimport {hardBreak} from './break.js'\nimport {code} from './code.js'\nimport {strikethrough} from './delete.js'\nimport {emphasis} from './emphasis.js'\nimport {footnoteReference} from './footnote-reference.js'\nimport {footnote} from './footnote.js'\nimport {heading} from './heading.js'\nimport {html} from './html.js'\nimport {imageReference} from './image-reference.js'\nimport {image} from './image.js'\nimport {inlineCode} from './inline-code.js'\nimport {linkReference} from './link-reference.js'\nimport {link} from './link.js'\nimport {listItem} from './list-item.js'\nimport {list} from './list.js'\nimport {paragraph} from './paragraph.js'\nimport {root} from './root.js'\nimport {strong} from './strong.js'\nimport {table} from './table.js'\nimport {tableRow} from './table-row.js'\nimport {tableCell} from './table-cell.js'\nimport {text} from './text.js'\nimport {thematicBreak} from './thematic-break.js'\n\n/**\n * Default handlers for nodes.\n */\nexport const handlers = {\n blockquote,\n break: hardBreak,\n code,\n delete: strikethrough,\n emphasis,\n footnoteReference,\n footnote,\n heading,\n html,\n imageReference,\n image,\n inlineCode,\n linkReference,\n link,\n listItem,\n list,\n paragraph,\n root,\n strong,\n table,\n tableCell,\n tableRow,\n text,\n thematicBreak,\n toml: ignore,\n yaml: ignore,\n definition: ignore,\n footnoteDefinition: ignore\n}\n\n// Return nothing for nodes that are ignored.\nfunction ignore() {\n // To do: next major: return `undefined`.\n return null\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Blockquote} Blockquote\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `blockquote` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Blockquote} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function blockquote(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'blockquote',\n properties: {},\n children: state.wrap(state.all(node), true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('mdast').Break} Break\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `break` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Break} node\n * mdast node.\n * @returns {Array}\n * hast element content.\n */\nexport function hardBreak(state, node) {\n /** @type {Element} */\n const result = {type: 'element', tagName: 'br', properties: {}, children: []}\n state.patch(node, result)\n return [state.applyData(node, result), {type: 'text', value: '\\n'}]\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Code} Code\n * @typedef {import('../state.js').State} State\n\n */\n\n/**\n * Turn an mdast `code` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Code} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function code(state, node) {\n const value = node.value ? node.value + '\\n' : ''\n // To do: next major, use `node.lang` w/o regex, the splitting’s been going\n // on for years in remark now.\n const lang = node.lang ? node.lang.match(/^[^ \\t]+(?=[ \\t]|$)/) : null\n /** @type {Properties} */\n const properties = {}\n\n if (lang) {\n properties.className = ['language-' + lang]\n }\n\n // Create ``.\n /** @type {Element} */\n let result = {\n type: 'element',\n tagName: 'code',\n properties,\n children: [{type: 'text', value}]\n }\n\n if (node.meta) {\n result.data = {meta: node.meta}\n }\n\n state.patch(node, result)\n result = state.applyData(node, result)\n\n // Create `
`.\n  result = {type: 'element', tagName: 'pre', properties: {}, children: [result]}\n  state.patch(node, result)\n  return result\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Delete} Delete\n * @typedef {import('../state.js').State} State\n\n */\n\n/**\n * Turn an mdast `delete` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Delete} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strikethrough(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'del',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Emphasis} Emphasis\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `emphasis` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Emphasis} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function emphasis(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'em',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Footnote} Footnote\n * @typedef {import('../state.js').State} State\n */\n\nimport {footnoteReference} from './footnote-reference.js'\n\n// To do: when both:\n// * \n// * \n// …are archived, remove this (also from mdast).\n// These inline notes are not used in GFM.\n\n/**\n * Turn an mdast `footnote` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Footnote} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function footnote(state, node) {\n  const footnoteById = state.footnoteById\n  let no = 1\n\n  while (no in footnoteById) no++\n\n  const identifier = String(no)\n\n  footnoteById[identifier] = {\n    type: 'footnoteDefinition',\n    identifier,\n    children: [{type: 'paragraph', children: node.children}],\n    position: node.position\n  }\n\n  return footnoteReference(state, {\n    type: 'footnoteReference',\n    identifier,\n    position: node.position\n  })\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `heading` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Heading} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function heading(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'h' + node.depth,\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').HTML} Html\n * @typedef {import('../state.js').State} State\n * @typedef {import('../../index.js').Raw} Raw\n */\n\n/**\n * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise\n * nothing).\n *\n * @param {State} state\n *   Info passed around.\n * @param {Html} node\n *   mdast node.\n * @returns {Raw | Element | null}\n *   hast node.\n */\nexport function html(state, node) {\n  if (state.dangerous) {\n    /** @type {Raw} */\n    const result = {type: 'raw', value: node.value}\n    state.patch(node, result)\n    return state.applyData(node, result)\n  }\n\n  // To do: next major: return `undefined`.\n  return null\n}\n","/**\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `imageReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ImageReference} node\n *   mdast node.\n * @returns {ElementContent | Array}\n *   hast node.\n */\nexport function imageReference(state, node) {\n  const def = state.definition(node.identifier)\n\n  if (!def) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(def.url || ''), alt: node.alt}\n\n  if (def.title !== null && def.title !== undefined) {\n    properties.title = def.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Image} Image\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `image` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Image} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function image(state, node) {\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(node.url)}\n\n  if (node.alt !== null && node.alt !== undefined) {\n    properties.alt = node.alt\n  }\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `inlineCode` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {InlineCode} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function inlineCode(state, node) {\n  /** @type {Text} */\n  const text = {type: 'text', value: node.value.replace(/\\r?\\n|\\r/g, ' ')}\n  state.patch(node, text)\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'code',\n    properties: {},\n    children: [text]\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `linkReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {LinkReference} node\n *   mdast node.\n * @returns {ElementContent | Array}\n *   hast node.\n */\nexport function linkReference(state, node) {\n  const def = state.definition(node.identifier)\n\n  if (!def) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(def.url || '')}\n\n  if (def.title !== null && def.title !== undefined) {\n    properties.title = def.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Link} Link\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `link` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Link} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function link(state, node) {\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(node.url)}\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').List} List\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `list` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {List} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function list(state, node) {\n  /** @type {Properties} */\n  const properties = {}\n  const results = state.all(node)\n  let index = -1\n\n  if (typeof node.start === 'number' && node.start !== 1) {\n    properties.start = node.start\n  }\n\n  // Like GitHub, add a class for custom styling.\n  while (++index < results.length) {\n    const child = results[index]\n\n    if (\n      child.type === 'element' &&\n      child.tagName === 'li' &&\n      child.properties &&\n      Array.isArray(child.properties.className) &&\n      child.properties.className.includes('task-list-item')\n    ) {\n      properties.className = ['contains-task-list']\n      break\n    }\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: node.ordered ? 'ol' : 'ul',\n    properties,\n    children: state.wrap(results, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `paragraph` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Paragraph} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function paragraph(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'p',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `root` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastRoot} node\n *   mdast node.\n * @returns {HastRoot | HastElement}\n *   hast node.\n */\nexport function root(state, node) {\n  /** @type {HastRoot} */\n  const result = {type: 'root', children: state.wrap(state.all(node))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Strong} Strong\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `strong` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Strong} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strong(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'strong',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Table} Table\n * @typedef {import('../state.js').State} State\n */\n\nimport {pointStart, pointEnd} from 'unist-util-position'\n\n/**\n * Turn an mdast `table` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Table} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function table(state, node) {\n  const rows = state.all(node)\n  const firstRow = rows.shift()\n  /** @type {Array} */\n  const tableContent = []\n\n  if (firstRow) {\n    /** @type {Element} */\n    const head = {\n      type: 'element',\n      tagName: 'thead',\n      properties: {},\n      children: state.wrap([firstRow], true)\n    }\n    state.patch(node.children[0], head)\n    tableContent.push(head)\n  }\n\n  if (rows.length > 0) {\n    /** @type {Element} */\n    const body = {\n      type: 'element',\n      tagName: 'tbody',\n      properties: {},\n      children: state.wrap(rows, true)\n    }\n\n    const start = pointStart(node.children[1])\n    const end = pointEnd(node.children[node.children.length - 1])\n    if (start.line && end.line) body.position = {start, end}\n    tableContent.push(body)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'table',\n    properties: {},\n    children: state.wrap(tableContent, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').TableCell} TableCell\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `tableCell` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableCell} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function tableCell(state, node) {\n  // Note: this function is normally not called: see `table-row` for how rows\n  // and their cells are compiled.\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'td', // Assume body cell.\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Parent} Parent\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').TableRow} TableRow\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * @typedef {Root | Content} Nodes\n * @typedef {Extract} Parents\n */\n\n/**\n * Turn an mdast `tableRow` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableRow} node\n *   mdast node.\n * @param {Parents | null | undefined} parent\n *   Parent of `node`.\n * @returns {Element}\n *   hast node.\n */\nexport function tableRow(state, node, parent) {\n  const siblings = parent ? parent.children : undefined\n  // Generate a body row when without parent.\n  const rowIndex = siblings ? siblings.indexOf(node) : 1\n  const tagName = rowIndex === 0 ? 'th' : 'td'\n  const align = parent && parent.type === 'table' ? parent.align : undefined\n  const length = align ? align.length : node.children.length\n  let cellIndex = -1\n  /** @type {Array} */\n  const cells = []\n\n  while (++cellIndex < length) {\n    // Note: can also be undefined.\n    const cell = node.children[cellIndex]\n    /** @type {Properties} */\n    const properties = {}\n    const alignValue = align ? align[cellIndex] : undefined\n\n    if (alignValue) {\n      properties.align = alignValue\n    }\n\n    /** @type {Element} */\n    let result = {type: 'element', tagName, properties, children: []}\n\n    if (cell) {\n      result.children = state.all(cell)\n      state.patch(cell, result)\n      result = state.applyData(node, result)\n    }\n\n    cells.push(result)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'tr',\n    properties: {},\n    children: state.wrap(cells, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('hast').Text} HastText\n * @typedef {import('mdast').Text} MdastText\n * @typedef {import('../state.js').State} State\n */\n\nimport {trimLines} from 'trim-lines'\n\n/**\n * Turn an mdast `text` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastText} node\n *   mdast node.\n * @returns {HastText | HastElement}\n *   hast node.\n */\nexport function text(state, node) {\n  /** @type {HastText} */\n  const result = {type: 'text', value: trimLines(String(node.value))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').ThematicBreak} ThematicBreak\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `thematicBreak` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ThematicBreak} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function thematicBreak(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'hr',\n    properties: {},\n    children: []\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Content} HastContent\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('hast').ElementContent} HastElementContent\n * @typedef {import('hast').Properties} HastProperties\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('hast').Text} HastText\n *\n * @typedef {import('mdast').Content} MdastContent\n * @typedef {import('mdast').Definition} MdastDefinition\n * @typedef {import('mdast').FootnoteDefinition} MdastFootnoteDefinition\n * @typedef {import('mdast').Parent} MdastParent\n * @typedef {import('mdast').Root} MdastRoot\n */\n\n/**\n * @typedef {HastRoot | HastContent} HastNodes\n * @typedef {MdastRoot | MdastContent} MdastNodes\n * @typedef {Extract} MdastParents\n *\n * @typedef EmbeddedHastFields\n *   hast fields.\n * @property {string | null | undefined} [hName]\n *   Generate a specific element with this tag name instead.\n * @property {HastProperties | null | undefined} [hProperties]\n *   Generate an element with these properties instead.\n * @property {Array | null | undefined} [hChildren]\n *   Generate an element with this content instead.\n *\n * @typedef {Record & EmbeddedHastFields} MdastData\n *   mdast data with embedded hast fields.\n *\n * @typedef {MdastNodes & {data?: MdastData | null | undefined}} MdastNodeWithData\n *   mdast node with embedded hast data.\n *\n * @typedef PointLike\n *   Point-like value.\n * @property {number | null | undefined} [line]\n *   Line.\n * @property {number | null | undefined} [column]\n *   Column.\n * @property {number | null | undefined} [offset]\n *   Offset.\n *\n * @typedef PositionLike\n *   Position-like value.\n * @property {PointLike | null | undefined} [start]\n *   Point-like value.\n * @property {PointLike | null | undefined} [end]\n *   Point-like value.\n *\n * @callback Handler\n *   Handle a node.\n * @param {State} state\n *   Info passed around.\n * @param {any} node\n *   mdast node to handle.\n * @param {MdastParents | null | undefined} parent\n *   Parent of `node`.\n * @returns {HastElementContent | Array | null | undefined}\n *   hast node.\n *\n * @callback HFunctionProps\n *   Signature of `state` for when props are passed.\n * @param {MdastNodes | PositionLike | null | undefined} node\n *   mdast node or unist position.\n * @param {string} tagName\n *   HTML tag name.\n * @param {HastProperties} props\n *   Properties.\n * @param {Array | null | undefined} [children]\n *   hast content.\n * @returns {HastElement}\n *   Compiled element.\n *\n * @callback HFunctionNoProps\n *   Signature of `state` for when no props are passed.\n * @param {MdastNodes | PositionLike | null | undefined} node\n *   mdast node or unist position.\n * @param {string} tagName\n *   HTML tag name.\n * @param {Array | null | undefined} [children]\n *   hast content.\n * @returns {HastElement}\n *   Compiled element.\n *\n * @typedef HFields\n *   Info on `state`.\n * @property {boolean} dangerous\n *   Whether HTML is allowed.\n * @property {string} clobberPrefix\n *   Prefix to use to prevent DOM clobbering.\n * @property {string} footnoteLabel\n *   Label to use to introduce the footnote section.\n * @property {string} footnoteLabelTagName\n *   HTML used for the footnote label.\n * @property {HastProperties} footnoteLabelProperties\n *   Properties on the HTML tag used for the footnote label.\n * @property {string} footnoteBackLabel\n *   Label to use from backreferences back to their footnote call.\n * @property {(identifier: string) => MdastDefinition | null} definition\n *   Definition cache.\n * @property {Record} footnoteById\n *   Footnote definitions by their identifier.\n * @property {Array} footnoteOrder\n *   Identifiers of order when footnote calls first appear in tree order.\n * @property {Record} footnoteCounts\n *   Counts for how often the same footnote was called.\n * @property {Handlers} handlers\n *   Applied handlers.\n * @property {Handler} unknownHandler\n *   Handler for any none not in `passThrough` or otherwise handled.\n * @property {(from: MdastNodes, node: HastNodes) => void} patch\n *   Copy a node’s positional info.\n * @property {(from: MdastNodes, to: Type) => Type | HastElement} applyData\n *   Honor the `data` of `from`, and generate an element instead of `node`.\n * @property {(node: MdastNodes, parent: MdastParents | null | undefined) => HastElementContent | Array | null | undefined} one\n *   Transform an mdast node to hast.\n * @property {(node: MdastNodes) => Array} all\n *   Transform the children of an mdast parent to hast.\n * @property {(nodes: Array, loose?: boolean | null | undefined) => Array} wrap\n *   Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`.\n * @property {(left: MdastNodeWithData | PositionLike | null | undefined, right: HastElementContent) => HastElementContent} augment\n *   Like `state` but lower-level and usable on non-elements.\n *   Deprecated: use `patch` and `applyData`.\n * @property {Array} passThrough\n *   List of node types to pass through untouched (except for their children).\n *\n * @typedef Options\n *   Configuration (optional).\n * @property {boolean | null | undefined} [allowDangerousHtml=false]\n *   Whether to persist raw HTML in markdown in the hast tree.\n * @property {string | null | undefined} [clobberPrefix='user-content-']\n *   Prefix to use before the `id` attribute on footnotes to prevent it from\n *   *clobbering*.\n * @property {string | null | undefined} [footnoteBackLabel='Back to content']\n *   Label to use from backreferences back to their footnote call (affects\n *   screen readers).\n * @property {string | null | undefined} [footnoteLabel='Footnotes']\n *   Label to use for the footnotes section (affects screen readers).\n * @property {HastProperties | null | undefined} [footnoteLabelProperties={className: ['sr-only']}]\n *   Properties to use on the footnote label (note that `id: 'footnote-label'`\n *   is always added as footnote calls use it with `aria-describedby` to\n *   provide an accessible label).\n * @property {string | null | undefined} [footnoteLabelTagName='h2']\n *   Tag name to use for the footnote label.\n * @property {Handlers | null | undefined} [handlers]\n *   Extra handlers for nodes.\n * @property {Array | null | undefined} [passThrough]\n *   List of custom mdast node types to pass through (keep) in hast (note that\n *   the node itself is passed, but eventual children are transformed).\n * @property {Handler | null | undefined} [unknownHandler]\n *   Handler for all unknown nodes.\n *\n * @typedef {Record} Handlers\n *   Handle nodes.\n *\n * @typedef {HFunctionProps & HFunctionNoProps & HFields} State\n *   Info passed around.\n */\n\nimport {visit} from 'unist-util-visit'\nimport {position, pointStart, pointEnd} from 'unist-util-position'\nimport {generated} from 'unist-util-generated'\nimport {definitions} from 'mdast-util-definitions'\nimport {handlers} from './handlers/index.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Create `state` from an mdast tree.\n *\n * @param {MdastNodes} tree\n *   mdast node to transform.\n * @param {Options | null | undefined} [options]\n *   Configuration.\n * @returns {State}\n *   `state` function.\n */\nexport function createState(tree, options) {\n  const settings = options || {}\n  const dangerous = settings.allowDangerousHtml || false\n  /** @type {Record} */\n  const footnoteById = {}\n\n  // To do: next major: add `options` to state, remove:\n  // `dangerous`, `clobberPrefix`, `footnoteLabel`, `footnoteLabelTagName`,\n  // `footnoteLabelProperties`, `footnoteBackLabel`, `passThrough`,\n  // `unknownHandler`.\n\n  // To do: next major: move to `state.options.allowDangerousHtml`.\n  state.dangerous = dangerous\n  // To do: next major: move to `state.options`.\n  state.clobberPrefix =\n    settings.clobberPrefix === undefined || settings.clobberPrefix === null\n      ? 'user-content-'\n      : settings.clobberPrefix\n  // To do: next major: move to `state.options`.\n  state.footnoteLabel = settings.footnoteLabel || 'Footnotes'\n  // To do: next major: move to `state.options`.\n  state.footnoteLabelTagName = settings.footnoteLabelTagName || 'h2'\n  // To do: next major: move to `state.options`.\n  state.footnoteLabelProperties = settings.footnoteLabelProperties || {\n    className: ['sr-only']\n  }\n  // To do: next major: move to `state.options`.\n  state.footnoteBackLabel = settings.footnoteBackLabel || 'Back to content'\n  // To do: next major: move to `state.options`.\n  state.unknownHandler = settings.unknownHandler\n  // To do: next major: move to `state.options`.\n  state.passThrough = settings.passThrough\n\n  state.handlers = {...handlers, ...settings.handlers}\n\n  // To do: next major: replace utility with `definitionById` object, so we\n  // only walk once (as we need footnotes too).\n  state.definition = definitions(tree)\n  state.footnoteById = footnoteById\n  /** @type {Array} */\n  state.footnoteOrder = []\n  /** @type {Record} */\n  state.footnoteCounts = {}\n\n  state.patch = patch\n  state.applyData = applyData\n  state.one = oneBound\n  state.all = allBound\n  state.wrap = wrap\n  // To do: next major: remove `augment`.\n  state.augment = augment\n\n  visit(tree, 'footnoteDefinition', (definition) => {\n    const id = String(definition.identifier).toUpperCase()\n\n    // Mimick CM behavior of link definitions.\n    // See: .\n    if (!own.call(footnoteById, id)) {\n      footnoteById[id] = definition\n    }\n  })\n\n  // @ts-expect-error Hush, it’s fine!\n  return state\n\n  /**\n   * Finalise the created `right`, a hast node, from `left`, an mdast node.\n   *\n   * @param {MdastNodeWithData | PositionLike | null | undefined} left\n   * @param {HastElementContent} right\n   * @returns {HastElementContent}\n   */\n  /* c8 ignore start */\n  // To do: next major: remove.\n  function augment(left, right) {\n    // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n    if (left && 'data' in left && left.data) {\n      /** @type {MdastData} */\n      const data = left.data\n\n      if (data.hName) {\n        if (right.type !== 'element') {\n          right = {\n            type: 'element',\n            tagName: '',\n            properties: {},\n            children: []\n          }\n        }\n\n        right.tagName = data.hName\n      }\n\n      if (right.type === 'element' && data.hProperties) {\n        right.properties = {...right.properties, ...data.hProperties}\n      }\n\n      if ('children' in right && right.children && data.hChildren) {\n        right.children = data.hChildren\n      }\n    }\n\n    if (left) {\n      const ctx = 'type' in left ? left : {position: left}\n\n      if (!generated(ctx)) {\n        // @ts-expect-error: fine.\n        right.position = {start: pointStart(ctx), end: pointEnd(ctx)}\n      }\n    }\n\n    return right\n  }\n  /* c8 ignore stop */\n\n  /**\n   * Create an element for `node`.\n   *\n   * @type {HFunctionProps}\n   */\n  /* c8 ignore start */\n  // To do: next major: remove.\n  function state(node, tagName, props, children) {\n    if (Array.isArray(props)) {\n      children = props\n      props = {}\n    }\n\n    // @ts-expect-error augmenting an element yields an element.\n    return augment(node, {\n      type: 'element',\n      tagName,\n      properties: props || {},\n      children: children || []\n    })\n  }\n  /* c8 ignore stop */\n\n  /**\n   * Transform an mdast node into a hast node.\n   *\n   * @param {MdastNodes} node\n   *   mdast node.\n   * @param {MdastParents | null | undefined} [parent]\n   *   Parent of `node`.\n   * @returns {HastElementContent | Array | null | undefined}\n   *   Resulting hast node.\n   */\n  function oneBound(node, parent) {\n    // @ts-expect-error: that’s a state :)\n    return one(state, node, parent)\n  }\n\n  /**\n   * Transform the children of an mdast node into hast nodes.\n   *\n   * @param {MdastNodes} parent\n   *   mdast node to compile\n   * @returns {Array}\n   *   Resulting hast nodes.\n   */\n  function allBound(parent) {\n    // @ts-expect-error: that’s a state :)\n    return all(state, parent)\n  }\n}\n\n/**\n * Copy a node’s positional info.\n *\n * @param {MdastNodes} from\n *   mdast node to copy from.\n * @param {HastNodes} to\n *   hast node to copy into.\n * @returns {void}\n *   Nothing.\n */\nfunction patch(from, to) {\n  if (from.position) to.position = position(from)\n}\n\n/**\n * Honor the `data` of `from` and maybe generate an element instead of `to`.\n *\n * @template {HastNodes} Type\n *   Node type.\n * @param {MdastNodes} from\n *   mdast node to use data from.\n * @param {Type} to\n *   hast node to change.\n * @returns {Type | HastElement}\n *   Nothing.\n */\nfunction applyData(from, to) {\n  /** @type {Type | HastElement} */\n  let result = to\n\n  // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n  if (from && from.data) {\n    const hName = from.data.hName\n    const hChildren = from.data.hChildren\n    const hProperties = from.data.hProperties\n\n    if (typeof hName === 'string') {\n      // Transforming the node resulted in an element with a different name\n      // than wanted:\n      if (result.type === 'element') {\n        result.tagName = hName\n      }\n      // Transforming the node resulted in a non-element, which happens for\n      // raw, text, and root nodes (unless custom handlers are passed).\n      // The intent is likely to keep the content around (otherwise: pass\n      // `hChildren`).\n      else {\n        result = {\n          type: 'element',\n          tagName: hName,\n          properties: {},\n          children: []\n        }\n\n        // To do: next major: take the children from the `root`, or inject the\n        // raw/text/comment or so into the element?\n        // if ('children' in node) {\n        //   // @ts-expect-error: assume `children` are allowed in elements.\n        //   result.children = node.children\n        // } else {\n        //   // @ts-expect-error: assume `node` is allowed in elements.\n        //   result.children.push(node)\n        // }\n      }\n    }\n\n    if (result.type === 'element' && hProperties) {\n      result.properties = {...result.properties, ...hProperties}\n    }\n\n    if (\n      'children' in result &&\n      result.children &&\n      hChildren !== null &&\n      hChildren !== undefined\n    ) {\n      // @ts-expect-error: assume valid children are defined.\n      result.children = hChildren\n    }\n  }\n\n  return result\n}\n\n/**\n * Transform an mdast node into a hast node.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastNodes} node\n *   mdast node.\n * @param {MdastParents | null | undefined} [parent]\n *   Parent of `node`.\n * @returns {HastElementContent | Array | null | undefined}\n *   Resulting hast node.\n */\n// To do: next major: do not expose, keep bound.\nexport function one(state, node, parent) {\n  const type = node && node.type\n\n  // Fail on non-nodes.\n  if (!type) {\n    throw new Error('Expected node, got `' + node + '`')\n  }\n\n  if (own.call(state.handlers, type)) {\n    return state.handlers[type](state, node, parent)\n  }\n\n  if (state.passThrough && state.passThrough.includes(type)) {\n    // To do: next major: deep clone.\n    // @ts-expect-error: types of passed through nodes are expected to be added manually.\n    return 'children' in node ? {...node, children: all(state, node)} : node\n  }\n\n  if (state.unknownHandler) {\n    return state.unknownHandler(state, node, parent)\n  }\n\n  return defaultUnknownHandler(state, node)\n}\n\n/**\n * Transform the children of an mdast node into hast nodes.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastNodes} parent\n *   mdast node to compile\n * @returns {Array}\n *   Resulting hast nodes.\n */\n// To do: next major: do not expose, keep bound.\nexport function all(state, parent) {\n  /** @type {Array} */\n  const values = []\n\n  if ('children' in parent) {\n    const nodes = parent.children\n    let index = -1\n    while (++index < nodes.length) {\n      const result = one(state, nodes[index], parent)\n\n      // To do: see if we van clean this? Can we merge texts?\n      if (result) {\n        if (index && nodes[index - 1].type === 'break') {\n          if (!Array.isArray(result) && result.type === 'text') {\n            result.value = result.value.replace(/^\\s+/, '')\n          }\n\n          if (!Array.isArray(result) && result.type === 'element') {\n            const head = result.children[0]\n\n            if (head && head.type === 'text') {\n              head.value = head.value.replace(/^\\s+/, '')\n            }\n          }\n        }\n\n        if (Array.isArray(result)) {\n          values.push(...result)\n        } else {\n          values.push(result)\n        }\n      }\n    }\n  }\n\n  return values\n}\n\n/**\n * Transform an unknown node.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastNodes} node\n *   Unknown mdast node.\n * @returns {HastText | HastElement}\n *   Resulting hast node.\n */\nfunction defaultUnknownHandler(state, node) {\n  const data = node.data || {}\n  /** @type {HastText | HastElement} */\n  const result =\n    'value' in node &&\n    !(own.call(data, 'hProperties') || own.call(data, 'hChildren'))\n      ? {type: 'text', value: node.value}\n      : {\n          type: 'element',\n          tagName: 'div',\n          properties: {},\n          children: all(state, node)\n        }\n\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n\n/**\n * Wrap `nodes` with line endings between each node.\n *\n * @template {HastContent} Type\n *   Node type.\n * @param {Array} nodes\n *   List of nodes to wrap.\n * @param {boolean | null | undefined} [loose=false]\n *   Whether to add line endings at start and end.\n * @returns {Array}\n *   Wrapped nodes.\n */\nexport function wrap(nodes, loose) {\n  /** @type {Array} */\n  const result = []\n  let index = -1\n\n  if (loose) {\n    result.push({type: 'text', value: '\\n'})\n  }\n\n  while (++index < nodes.length) {\n    if (index) result.push({type: 'text', value: '\\n'})\n    result.push(nodes[index])\n  }\n\n  if (loose && nodes.length > 0) {\n    result.push({type: 'text', value: '\\n'})\n  }\n\n  return result\n}\n","/**\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n *\n * @typedef NodeLike\n * @property {PositionLike | null | undefined} [position]\n */\n\n/**\n * Check if `node` is generated.\n *\n * @param {NodeLike | null | undefined} [node]\n *   Node to check.\n * @returns {boolean}\n *   Whether `node` is generated (does not have positional info).\n */\nexport function generated(node) {\n  return (\n    !node ||\n    !node.position ||\n    !node.position.start ||\n    !node.position.start.line ||\n    !node.position.start.column ||\n    !node.position.end ||\n    !node.position.end.line ||\n    !node.position.end.column\n  )\n}\n","/**\n * @typedef {import('hast').Content} HastContent\n * @typedef {import('hast').Root} HastRoot\n *\n * @typedef {import('mdast').Content} MdastContent\n * @typedef {import('mdast').Root} MdastRoot\n *\n * @typedef {import('./state.js').Options} Options\n */\n\n/**\n * @typedef {HastRoot | HastContent} HastNodes\n * @typedef {MdastRoot | MdastContent} MdastNodes\n */\n\nimport {footer} from './footer.js'\nimport {createState} from './state.js'\n\n/**\n * Transform mdast to hast.\n *\n * ##### Notes\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most utilities ignore `raw` nodes but two notable ones don’t:\n *\n * *   `hast-util-to-html` also has an option `allowDangerousHtml` which will\n *     output the raw HTML.\n *     This is typically discouraged as noted by the option name but is useful\n *     if you completely trust authors\n * *   `hast-util-raw` can handle the raw embedded HTML strings by parsing them\n *     into standard hast nodes (`element`, `text`, etc).\n *     This is a heavy task as it needs a full HTML parser, but it is the only\n *     way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark, which we follow by default.\n * They are supported by GitHub, so footnotes can be enabled in markdown with\n * `mdast-util-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes, which is hidden for sighted users but shown to\n * assistive technology.\n * When your page is not in English, you must define translated values.\n *\n * Back references use ARIA attributes, but the section label itself uses a\n * heading that is hidden with an `sr-only` class.\n * To show it to sighted users, define different attributes in\n * `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem, as it links footnote calls to footnote\n * definitions on the page through `id` attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n * 

\n * \n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * Example: headings (DOM clobbering) in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value` (and doesn’t have `data.hName`,\n * `data.hProperties`, or `data.hChildren`, see later), create a hast `text`\n * node\n * * otherwise, create a `
` element (which could be changed with\n * `data.hName`), with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @param {MdastNodes} tree\n * mdast tree.\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {HastNodes | null | undefined}\n * hast tree.\n */\n// To do: next major: always return a single `root`.\nexport function toHast(tree, options) {\n const state = createState(tree, options)\n const node = state.one(tree, null)\n const foot = footer(state)\n\n if (foot) {\n // @ts-expect-error If there’s a footer, there were definitions, meaning block\n // content.\n // So assume `node` is a parent node.\n node.children.push({type: 'text', value: '\\n'}, foot)\n }\n\n // To do: next major: always return root?\n return Array.isArray(node) ? {type: 'root', children: node} : node\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n *\n * @typedef {import('./state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Generate a hast footer for called footnote definitions.\n *\n * @param {State} state\n * Info passed around.\n * @returns {Element | undefined}\n * `section` element or `undefined`.\n */\nexport function footer(state) {\n /** @type {Array} */\n const listItems = []\n let index = -1\n\n while (++index < state.footnoteOrder.length) {\n const def = state.footnoteById[state.footnoteOrder[index]]\n\n if (!def) {\n continue\n }\n\n const content = state.all(def)\n const id = String(def.identifier).toUpperCase()\n const safeId = normalizeUri(id.toLowerCase())\n let referenceIndex = 0\n /** @type {Array} */\n const backReferences = []\n\n while (++referenceIndex <= state.footnoteCounts[id]) {\n /** @type {Element} */\n const backReference = {\n type: 'element',\n tagName: 'a',\n properties: {\n href:\n '#' +\n state.clobberPrefix +\n 'fnref-' +\n safeId +\n (referenceIndex > 1 ? '-' + referenceIndex : ''),\n dataFootnoteBackref: true,\n className: ['data-footnote-backref'],\n ariaLabel: state.footnoteBackLabel\n },\n children: [{type: 'text', value: '↩'}]\n }\n\n if (referenceIndex > 1) {\n backReference.children.push({\n type: 'element',\n tagName: 'sup',\n children: [{type: 'text', value: String(referenceIndex)}]\n })\n }\n\n if (backReferences.length > 0) {\n backReferences.push({type: 'text', value: ' '})\n }\n\n backReferences.push(backReference)\n }\n\n const tail = content[content.length - 1]\n\n if (tail && tail.type === 'element' && tail.tagName === 'p') {\n const tailTail = tail.children[tail.children.length - 1]\n if (tailTail && tailTail.type === 'text') {\n tailTail.value += ' '\n } else {\n tail.children.push({type: 'text', value: ' '})\n }\n\n tail.children.push(...backReferences)\n } else {\n content.push(...backReferences)\n }\n\n /** @type {Element} */\n const listItem = {\n type: 'element',\n tagName: 'li',\n properties: {id: state.clobberPrefix + 'fn-' + safeId},\n children: state.wrap(content, true)\n }\n\n state.patch(def, listItem)\n\n listItems.push(listItem)\n }\n\n if (listItems.length === 0) {\n return\n }\n\n return {\n type: 'element',\n tagName: 'section',\n properties: {dataFootnotes: true, className: ['footnotes']},\n children: [\n {\n type: 'element',\n tagName: state.footnoteLabelTagName,\n properties: {\n // To do: use structured clone.\n ...JSON.parse(JSON.stringify(state.footnoteLabelProperties)),\n id: 'footnote-label'\n },\n children: [{type: 'text', value: state.footnoteLabel}]\n },\n {type: 'text', value: '\\n'},\n {\n type: 'element',\n tagName: 'ol',\n properties: {},\n children: state.wrap(listItems, true)\n },\n {type: 'text', value: '\\n'}\n ]\n }\n}\n","/**\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('mdast-util-to-hast').Options} Options\n * @typedef {import('unified').Processor} Processor\n *\n * @typedef {import('mdast-util-to-hast')} DoNotTouchAsThisImportIncludesRawInTree\n */\n\nimport {toHast} from 'mdast-util-to-hast'\n\n// Note: the `` overload doesn’t seem to work :'(\n\n/**\n * Plugin that turns markdown into HTML to support rehype.\n *\n * * If a destination processor is given, that processor runs with a new HTML\n * (hast) tree (bridge-mode).\n * As the given processor runs with a hast tree, and rehype plugins support\n * hast, that means rehype plugins can be used with the given processor.\n * The hast tree is discarded in the end.\n * It’s highly unlikely that you want to do this.\n * * The common case is to not pass a destination processor, in which case the\n * current processor continues running with a new HTML (hast) tree\n * (mutate-mode).\n * As the current processor continues with a hast tree, and rehype plugins\n * support hast, that means rehype plugins can be used after\n * `remark-rehype`.\n * It’s likely that this is what you want to do.\n *\n * @param destination\n * Optional unified processor.\n * @param options\n * Options passed to `mdast-util-to-hast`.\n */\nconst remarkRehype =\n /** @type {(import('unified').Plugin<[Processor, Options?]|[null|undefined, Options?]|[Options]|[], MdastRoot>)} */\n (\n function (destination, options) {\n return destination && 'run' in destination\n ? bridge(destination, options)\n : mutate(destination || options)\n }\n )\n\nexport default remarkRehype\n\n/**\n * Bridge-mode.\n * Runs the destination with the new hast tree.\n *\n * @type {import('unified').Plugin<[Processor, Options?], MdastRoot>}\n */\nfunction bridge(destination, options) {\n return (node, file, next) => {\n destination.run(toHast(node, options), file, (error) => {\n next(error)\n })\n }\n}\n\n/**\n * Mutate-mode.\n * Further plugins run on the hast tree.\n *\n * @type {import('unified').Plugin<[Options?]|void[], MdastRoot, HastRoot>}\n */\nfunction mutate(options) {\n // @ts-expect-error: assume a corresponding node is returned by `toHast`.\n return (node) => toHast(node, options)\n}\n","/**\n * @typedef {import('./info.js').Info} Info\n * @typedef {Record} Properties\n * @typedef {Record} Normal\n */\n\nexport class Schema {\n /**\n * @constructor\n * @param {Properties} property\n * @param {Normal} normal\n * @param {string} [space]\n */\n constructor(property, normal, space) {\n this.property = property\n this.normal = normal\n if (space) {\n this.space = space\n }\n }\n}\n\n/** @type {Properties} */\nSchema.prototype.property = {}\n/** @type {Normal} */\nSchema.prototype.normal = {}\n/** @type {string|null} */\nSchema.prototype.space = null\n","/**\n * @typedef {import('./schema.js').Properties} Properties\n * @typedef {import('./schema.js').Normal} Normal\n */\n\nimport {Schema} from './schema.js'\n\n/**\n * @param {Schema[]} definitions\n * @param {string} [space]\n * @returns {Schema}\n */\nexport function merge(definitions, space) {\n /** @type {Properties} */\n const property = {}\n /** @type {Normal} */\n const normal = {}\n let index = -1\n\n while (++index < definitions.length) {\n Object.assign(property, definitions[index].property)\n Object.assign(normal, definitions[index].normal)\n }\n\n return new Schema(property, normal, space)\n}\n","/**\n * @param {string} value\n * @returns {string}\n */\nexport function normalize(value) {\n return value.toLowerCase()\n}\n","export class Info {\n /**\n * @constructor\n * @param {string} property\n * @param {string} attribute\n */\n constructor(property, attribute) {\n /** @type {string} */\n this.property = property\n /** @type {string} */\n this.attribute = attribute\n }\n}\n\n/** @type {string|null} */\nInfo.prototype.space = null\nInfo.prototype.boolean = false\nInfo.prototype.booleanish = false\nInfo.prototype.overloadedBoolean = false\nInfo.prototype.number = false\nInfo.prototype.commaSeparated = false\nInfo.prototype.spaceSeparated = false\nInfo.prototype.commaOrSpaceSeparated = false\nInfo.prototype.mustUseProperty = false\nInfo.prototype.defined = false\n","let powers = 0\n\nexport const boolean = increment()\nexport const booleanish = increment()\nexport const overloadedBoolean = increment()\nexport const number = increment()\nexport const spaceSeparated = increment()\nexport const commaSeparated = increment()\nexport const commaOrSpaceSeparated = increment()\n\nfunction increment() {\n return 2 ** ++powers\n}\n","import {Info} from './info.js'\nimport * as types from './types.js'\n\n/** @type {Array} */\n// @ts-expect-error: hush.\nconst checks = Object.keys(types)\n\nexport class DefinedInfo extends Info {\n /**\n * @constructor\n * @param {string} property\n * @param {string} attribute\n * @param {number|null} [mask]\n * @param {string} [space]\n */\n constructor(property, attribute, mask, space) {\n let index = -1\n\n super(property, attribute)\n\n mark(this, 'space', space)\n\n if (typeof mask === 'number') {\n while (++index < checks.length) {\n const check = checks[index]\n mark(this, checks[index], (mask & types[check]) === types[check])\n }\n }\n }\n}\n\nDefinedInfo.prototype.defined = true\n\n/**\n * @param {DefinedInfo} values\n * @param {string} key\n * @param {unknown} value\n */\nfunction mark(values, key, value) {\n if (value) {\n // @ts-expect-error: assume `value` matches the expected value of `key`.\n values[key] = value\n }\n}\n","/**\n * @typedef {import('./schema.js').Properties} Properties\n * @typedef {import('./schema.js').Normal} Normal\n *\n * @typedef {Record} Attributes\n *\n * @typedef {Object} Definition\n * @property {Record} properties\n * @property {(attributes: Attributes, property: string) => string} transform\n * @property {string} [space]\n * @property {Attributes} [attributes]\n * @property {Array} [mustUseProperty]\n */\n\nimport {normalize} from '../normalize.js'\nimport {Schema} from './schema.js'\nimport {DefinedInfo} from './defined-info.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * @param {Definition} definition\n * @returns {Schema}\n */\nexport function create(definition) {\n /** @type {Properties} */\n const property = {}\n /** @type {Normal} */\n const normal = {}\n /** @type {string} */\n let prop\n\n for (prop in definition.properties) {\n if (own.call(definition.properties, prop)) {\n const value = definition.properties[prop]\n const info = new DefinedInfo(\n prop,\n definition.transform(definition.attributes || {}, prop),\n value,\n definition.space\n )\n\n if (\n definition.mustUseProperty &&\n definition.mustUseProperty.includes(prop)\n ) {\n info.mustUseProperty = true\n }\n\n property[prop] = info\n\n normal[normalize(prop)] = prop\n normal[normalize(info.attribute)] = prop\n }\n }\n\n return new Schema(property, normal, definition.space)\n}\n","import {create} from './util/create.js'\n\nexport const xlink = create({\n space: 'xlink',\n transform(_, prop) {\n return 'xlink:' + prop.slice(5).toLowerCase()\n },\n properties: {\n xLinkActuate: null,\n xLinkArcRole: null,\n xLinkHref: null,\n xLinkRole: null,\n xLinkShow: null,\n xLinkTitle: null,\n xLinkType: null\n }\n})\n","import {create} from './util/create.js'\n\nexport const xml = create({\n space: 'xml',\n transform(_, prop) {\n return 'xml:' + prop.slice(3).toLowerCase()\n },\n properties: {xmlLang: null, xmlBase: null, xmlSpace: null}\n})\n","/**\n * @param {Record} attributes\n * @param {string} attribute\n * @returns {string}\n */\nexport function caseSensitiveTransform(attributes, attribute) {\n return attribute in attributes ? attributes[attribute] : attribute\n}\n","import {caseSensitiveTransform} from './case-sensitive-transform.js'\n\n/**\n * @param {Record} attributes\n * @param {string} property\n * @returns {string}\n */\nexport function caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase())\n}\n","import {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const xmlns = create({\n space: 'xmlns',\n attributes: {xmlnsxlink: 'xmlns:xlink'},\n transform: caseInsensitiveTransform,\n properties: {xmlns: null, xmlnsXLink: null}\n})\n","import {booleanish, number, spaceSeparated} from './util/types.js'\nimport {create} from './util/create.js'\n\nexport const aria = create({\n transform(_, prop) {\n return prop === 'role' ? prop : 'aria-' + prop.slice(4).toLowerCase()\n },\n properties: {\n ariaActiveDescendant: null,\n ariaAtomic: booleanish,\n ariaAutoComplete: null,\n ariaBusy: booleanish,\n ariaChecked: booleanish,\n ariaColCount: number,\n ariaColIndex: number,\n ariaColSpan: number,\n ariaControls: spaceSeparated,\n ariaCurrent: null,\n ariaDescribedBy: spaceSeparated,\n ariaDetails: null,\n ariaDisabled: booleanish,\n ariaDropEffect: spaceSeparated,\n ariaErrorMessage: null,\n ariaExpanded: booleanish,\n ariaFlowTo: spaceSeparated,\n ariaGrabbed: booleanish,\n ariaHasPopup: null,\n ariaHidden: booleanish,\n ariaInvalid: null,\n ariaKeyShortcuts: null,\n ariaLabel: null,\n ariaLabelledBy: spaceSeparated,\n ariaLevel: number,\n ariaLive: null,\n ariaModal: booleanish,\n ariaMultiLine: booleanish,\n ariaMultiSelectable: booleanish,\n ariaOrientation: null,\n ariaOwns: spaceSeparated,\n ariaPlaceholder: null,\n ariaPosInSet: number,\n ariaPressed: booleanish,\n ariaReadOnly: booleanish,\n ariaRelevant: null,\n ariaRequired: booleanish,\n ariaRoleDescription: spaceSeparated,\n ariaRowCount: number,\n ariaRowIndex: number,\n ariaRowSpan: number,\n ariaSelected: booleanish,\n ariaSetSize: number,\n ariaSort: null,\n ariaValueMax: number,\n ariaValueMin: number,\n ariaValueNow: number,\n ariaValueText: null,\n role: null\n }\n})\n","import {\n boolean,\n overloadedBoolean,\n booleanish,\n number,\n spaceSeparated,\n commaSeparated\n} from './util/types.js'\nimport {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const html = create({\n space: 'html',\n attributes: {\n acceptcharset: 'accept-charset',\n classname: 'class',\n htmlfor: 'for',\n httpequiv: 'http-equiv'\n },\n transform: caseInsensitiveTransform,\n mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],\n properties: {\n // Standard Properties.\n abbr: null,\n accept: commaSeparated,\n acceptCharset: spaceSeparated,\n accessKey: spaceSeparated,\n action: null,\n allow: null,\n allowFullScreen: boolean,\n allowPaymentRequest: boolean,\n allowUserMedia: boolean,\n alt: null,\n as: null,\n async: boolean,\n autoCapitalize: null,\n autoComplete: spaceSeparated,\n autoFocus: boolean,\n autoPlay: boolean,\n blocking: spaceSeparated,\n capture: null,\n charSet: null,\n checked: boolean,\n cite: null,\n className: spaceSeparated,\n cols: number,\n colSpan: null,\n content: null,\n contentEditable: booleanish,\n controls: boolean,\n controlsList: spaceSeparated,\n coords: number | commaSeparated,\n crossOrigin: null,\n data: null,\n dateTime: null,\n decoding: null,\n default: boolean,\n defer: boolean,\n dir: null,\n dirName: null,\n disabled: boolean,\n download: overloadedBoolean,\n draggable: booleanish,\n encType: null,\n enterKeyHint: null,\n fetchPriority: null,\n form: null,\n formAction: null,\n formEncType: null,\n formMethod: null,\n formNoValidate: boolean,\n formTarget: null,\n headers: spaceSeparated,\n height: number,\n hidden: boolean,\n high: number,\n href: null,\n hrefLang: null,\n htmlFor: spaceSeparated,\n httpEquiv: spaceSeparated,\n id: null,\n imageSizes: null,\n imageSrcSet: null,\n inert: boolean,\n inputMode: null,\n integrity: null,\n is: null,\n isMap: boolean,\n itemId: null,\n itemProp: spaceSeparated,\n itemRef: spaceSeparated,\n itemScope: boolean,\n itemType: spaceSeparated,\n kind: null,\n label: null,\n lang: null,\n language: null,\n list: null,\n loading: null,\n loop: boolean,\n low: number,\n manifest: null,\n max: null,\n maxLength: number,\n media: null,\n method: null,\n min: null,\n minLength: number,\n multiple: boolean,\n muted: boolean,\n name: null,\n nonce: null,\n noModule: boolean,\n noValidate: boolean,\n onAbort: null,\n onAfterPrint: null,\n onAuxClick: null,\n onBeforeMatch: null,\n onBeforePrint: null,\n onBeforeToggle: null,\n onBeforeUnload: null,\n onBlur: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onContextLost: null,\n onContextMenu: null,\n onContextRestored: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFormData: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLanguageChange: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadEnd: null,\n onLoadStart: null,\n onMessage: null,\n onMessageError: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRejectionHandled: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onScrollEnd: null,\n onSecurityPolicyViolation: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onSlotChange: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnhandledRejection: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onWheel: null,\n open: boolean,\n optimum: number,\n pattern: null,\n ping: spaceSeparated,\n placeholder: null,\n playsInline: boolean,\n popover: null,\n popoverTarget: null,\n popoverTargetAction: null,\n poster: null,\n preload: null,\n readOnly: boolean,\n referrerPolicy: null,\n rel: spaceSeparated,\n required: boolean,\n reversed: boolean,\n rows: number,\n rowSpan: number,\n sandbox: spaceSeparated,\n scope: null,\n scoped: boolean,\n seamless: boolean,\n selected: boolean,\n shadowRootClonable: boolean,\n shadowRootDelegatesFocus: boolean,\n shadowRootMode: null,\n shape: null,\n size: number,\n sizes: null,\n slot: null,\n span: number,\n spellCheck: booleanish,\n src: null,\n srcDoc: null,\n srcLang: null,\n srcSet: null,\n start: number,\n step: null,\n style: null,\n tabIndex: number,\n target: null,\n title: null,\n translate: null,\n type: null,\n typeMustMatch: boolean,\n useMap: null,\n value: booleanish,\n width: number,\n wrap: null,\n writingSuggestions: null,\n\n // Legacy.\n // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis\n align: null, // Several. Use CSS `text-align` instead,\n aLink: null, // ``. Use CSS `a:active {color}` instead\n archive: spaceSeparated, // ``. List of URIs to archives\n axis: null, // `` and ``. Use `scope` on ``\n background: null, // ``. Use CSS `background-image` instead\n bgColor: null, // `` and table elements. Use CSS `background-color` instead\n border: number, // ``. Use CSS `border-width` instead,\n borderColor: null, // `
`. Use CSS `border-color` instead,\n bottomMargin: number, // ``\n cellPadding: null, // `
`\n cellSpacing: null, // `
`\n char: null, // Several table elements. When `align=char`, sets the character to align on\n charOff: null, // Several table elements. When `char`, offsets the alignment\n classId: null, // ``\n clear: null, // `
`. Use CSS `clear` instead\n code: null, // ``\n codeBase: null, // ``\n codeType: null, // ``\n color: null, // `` and `
`. Use CSS instead\n compact: boolean, // Lists. Use CSS to reduce space between items instead\n declare: boolean, // ``\n event: null, // `\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationRawTagOpen(code) {\n if (code === 47) {\n effects.consume(code)\n buffer = ''\n return continuationRawEndTag\n }\n return continuation(code)\n }\n\n /**\n * In raw continuation, after ` | \n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function continuationRawEndTag(code) {\n if (code === 62) {\n const name = buffer.toLowerCase()\n if (htmlRawNames.includes(name)) {\n effects.consume(code)\n return continuationClose\n }\n return continuation(code)\n }\n if (asciiAlpha(code) && buffer.length < 8) {\n effects.consume(code)\n // @ts-expect-error: not null.\n buffer += String.fromCharCode(code)\n return continuationRawEndTag\n }\n return continuation(code)\n }\n\n /**\n * In cdata continuation, after `]`, expecting `]>`.\n *\n * ```markdown\n * > | &<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCdataInside(code) {\n if (code === 93) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n return continuation(code)\n }\n\n /**\n * In declaration or instruction continuation, at `>`.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | &<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationDeclarationInside(code) {\n if (code === 62) {\n effects.consume(code)\n return continuationClose\n }\n\n // More dashes.\n if (code === 45 && marker === 2) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n return continuation(code)\n }\n\n /**\n * In closed continuation: everything we get until the eol/eof is part of it.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('htmlFlowData')\n return continuationAfter(code)\n }\n effects.consume(code)\n return continuationClose\n }\n\n /**\n * Done.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationAfter(code) {\n effects.exit('htmlFlow')\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n // // No longer concrete.\n // tokenizer.concrete = false\n return ok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuationStart(effects, ok, nok) {\n const self = this\n return start\n\n /**\n * At eol, before continuation.\n *\n * ```markdown\n * > | * ```js\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return after\n }\n return nok(code)\n }\n\n /**\n * A continuation.\n *\n * ```markdown\n * | * ```js\n * > | b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLineBefore(effects, ok, nok) {\n return start\n\n /**\n * Before eol, expecting blank line.\n *\n * ```markdown\n * > |
\n * ^\n * |\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return effects.attempt(blankLine, ok, nok)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding, markdownSpace} from 'micromark-util-character'\n/** @type {Construct} */\nconst nonLazyContinuation = {\n tokenize: tokenizeNonLazyContinuation,\n partial: true\n}\n\n/** @type {Construct} */\nexport const codeFenced = {\n name: 'codeFenced',\n tokenize: tokenizeCodeFenced,\n concrete: true\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCodeFenced(effects, ok, nok) {\n const self = this\n /** @type {Construct} */\n const closeStart = {\n tokenize: tokenizeCloseStart,\n partial: true\n }\n let initialPrefix = 0\n let sizeOpen = 0\n /** @type {NonNullable} */\n let marker\n return start\n\n /**\n * Start of code.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse whitespace like `markdown-rs`.\n return beforeSequenceOpen(code)\n }\n\n /**\n * In opening fence, after prefix, at sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeSequenceOpen(code) {\n const tail = self.events[self.events.length - 1]\n initialPrefix =\n tail && tail[1].type === 'linePrefix'\n ? tail[2].sliceSerialize(tail[1], true).length\n : 0\n marker = code\n effects.enter('codeFenced')\n effects.enter('codeFencedFence')\n effects.enter('codeFencedFenceSequence')\n return sequenceOpen(code)\n }\n\n /**\n * In opening fence sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === marker) {\n sizeOpen++\n effects.consume(code)\n return sequenceOpen\n }\n if (sizeOpen < 3) {\n return nok(code)\n }\n effects.exit('codeFencedFenceSequence')\n return markdownSpace(code)\n ? factorySpace(effects, infoBefore, 'whitespace')(code)\n : infoBefore(code)\n }\n\n /**\n * In opening fence, after the sequence (and optional whitespace), before info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function infoBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFencedFence')\n return self.interrupt\n ? ok(code)\n : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code)\n }\n effects.enter('codeFencedFenceInfo')\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return info(code)\n }\n\n /**\n * In info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function info(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceInfo')\n return infoBefore(code)\n }\n if (markdownSpace(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceInfo')\n return factorySpace(effects, metaBefore, 'whitespace')(code)\n }\n if (code === 96 && code === marker) {\n return nok(code)\n }\n effects.consume(code)\n return info\n }\n\n /**\n * In opening fence, after info and whitespace, before meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function metaBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return infoBefore(code)\n }\n effects.enter('codeFencedFenceMeta')\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return meta(code)\n }\n\n /**\n * In meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceMeta')\n return infoBefore(code)\n }\n if (code === 96 && code === marker) {\n return nok(code)\n }\n effects.consume(code)\n return meta\n }\n\n /**\n * At eol/eof in code, before a non-lazy closing fence or content.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function atNonLazyBreak(code) {\n return effects.attempt(closeStart, after, contentBefore)(code)\n }\n\n /**\n * Before code content, not a closing fence, at eol.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentBefore(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return contentStart\n }\n\n /**\n * Before code content, not a closing fence.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentStart(code) {\n return initialPrefix > 0 && markdownSpace(code)\n ? factorySpace(\n effects,\n beforeContentChunk,\n 'linePrefix',\n initialPrefix + 1\n )(code)\n : beforeContentChunk(code)\n }\n\n /**\n * Before code content, after optional prefix.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeContentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code)\n }\n effects.enter('codeFlowValue')\n return contentChunk(code)\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^^^^^^^^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFlowValue')\n return beforeContentChunk(code)\n }\n effects.consume(code)\n return contentChunk\n }\n\n /**\n * After code.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n effects.exit('codeFenced')\n return ok(code)\n }\n\n /**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\n function tokenizeCloseStart(effects, ok, nok) {\n let size = 0\n return startBefore\n\n /**\n *\n *\n * @type {State}\n */\n function startBefore(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return start\n }\n\n /**\n * Before closing fence, at optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Always populated by defaults.\n\n // To do: `enter` here or in next state?\n effects.enter('codeFencedFence')\n return markdownSpace(code)\n ? factorySpace(\n effects,\n beforeSequenceClose,\n 'linePrefix',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4\n )(code)\n : beforeSequenceClose(code)\n }\n\n /**\n * In closing fence, after optional whitespace, at sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeSequenceClose(code) {\n if (code === marker) {\n effects.enter('codeFencedFenceSequence')\n return sequenceClose(code)\n }\n return nok(code)\n }\n\n /**\n * In closing fence sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n if (code === marker) {\n size++\n effects.consume(code)\n return sequenceClose\n }\n if (size >= sizeOpen) {\n effects.exit('codeFencedFenceSequence')\n return markdownSpace(code)\n ? factorySpace(effects, sequenceCloseAfter, 'whitespace')(code)\n : sequenceCloseAfter(code)\n }\n return nok(code)\n }\n\n /**\n * After closing fence sequence, after optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceCloseAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFencedFence')\n return ok(code)\n }\n return nok(code)\n }\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuation(effects, ok, nok) {\n const self = this\n return start\n\n /**\n *\n *\n * @type {State}\n */\n function start(code) {\n if (code === null) {\n return nok(code)\n }\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return lineStart\n }\n\n /**\n *\n *\n * @type {State}\n */\n function lineStart(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code)\n }\n}\n","/// \n\n/* eslint-env browser */\n\nconst element = document.createElement('i')\n\n/**\n * @param {string} value\n * @returns {string|false}\n */\nexport function decodeNamedCharacterReference(value) {\n const characterReference = '&' + value + ';'\n element.innerHTML = characterReference\n const char = element.textContent\n\n // Some named character references do not require the closing semicolon\n // (`¬`, for instance), which leads to situations where parsing the assumed\n // named reference of `¬it;` will result in the string `¬it;`.\n // When we encounter a trailing semicolon after parsing, and the character\n // reference to decode was not a semicolon (`;`), we can assume that the\n // matching was not complete.\n // @ts-expect-error: TypeScript is wrong that `textContent` on elements can\n // yield `null`.\n if (char.charCodeAt(char.length - 1) === 59 /* `;` */ && value !== 'semi') {\n return false\n }\n\n // If the decoded string is equal to the input, the character reference was\n // not valid.\n // @ts-expect-error: TypeScript is wrong that `textContent` on elements can\n // yield `null`.\n return char === characterReference ? false : char\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {decodeNamedCharacterReference} from 'decode-named-character-reference'\nimport {\n asciiAlphanumeric,\n asciiDigit,\n asciiHexDigit\n} from 'micromark-util-character'\n/** @type {Construct} */\nexport const characterReference = {\n name: 'characterReference',\n tokenize: tokenizeCharacterReference\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterReference(effects, ok, nok) {\n const self = this\n let size = 0\n /** @type {number} */\n let max\n /** @type {(code: Code) => boolean} */\n let test\n return start\n\n /**\n * Start of character reference.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('characterReference')\n effects.enter('characterReferenceMarker')\n effects.consume(code)\n effects.exit('characterReferenceMarker')\n return open\n }\n\n /**\n * After `&`, at `#` for numeric references or alphanumeric for named\n * references.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 35) {\n effects.enter('characterReferenceMarkerNumeric')\n effects.consume(code)\n effects.exit('characterReferenceMarkerNumeric')\n return numeric\n }\n effects.enter('characterReferenceValue')\n max = 31\n test = asciiAlphanumeric\n return value(code)\n }\n\n /**\n * After `#`, at `x` for hexadecimals or digit for decimals.\n *\n * ```markdown\n * > | a{b\n * ^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function numeric(code) {\n if (code === 88 || code === 120) {\n effects.enter('characterReferenceMarkerHexadecimal')\n effects.consume(code)\n effects.exit('characterReferenceMarkerHexadecimal')\n effects.enter('characterReferenceValue')\n max = 6\n test = asciiHexDigit\n return value\n }\n effects.enter('characterReferenceValue')\n max = 7\n test = asciiDigit\n return value(code)\n }\n\n /**\n * After markers (`&#x`, `&#`, or `&`), in value, before `;`.\n *\n * The character reference kind defines what and how many characters are\n * allowed.\n *\n * ```markdown\n * > | a&b\n * ^^^\n * > | a{b\n * ^^^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function value(code) {\n if (code === 59 && size) {\n const token = effects.exit('characterReferenceValue')\n if (\n test === asciiAlphanumeric &&\n !decodeNamedCharacterReference(self.sliceSerialize(token))\n ) {\n return nok(code)\n }\n\n // To do: `markdown-rs` uses a different name:\n // `CharacterReferenceMarkerSemi`.\n effects.enter('characterReferenceMarker')\n effects.consume(code)\n effects.exit('characterReferenceMarker')\n effects.exit('characterReference')\n return ok\n }\n if (test(code) && size++ < max) {\n effects.consume(code)\n return value\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {asciiPunctuation} from 'micromark-util-character'\n/** @type {Construct} */\nexport const characterEscape = {\n name: 'characterEscape',\n tokenize: tokenizeCharacterEscape\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterEscape(effects, ok, nok) {\n return start\n\n /**\n * Start of character escape.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('characterEscape')\n effects.enter('escapeMarker')\n effects.consume(code)\n effects.exit('escapeMarker')\n return inside\n }\n\n /**\n * After `\\`, at punctuation.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // ASCII punctuation.\n if (asciiPunctuation(code)) {\n effects.enter('characterEscapeValue')\n effects.consume(code)\n effects.exit('characterEscapeValue')\n effects.exit('characterEscape')\n return ok\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\n/** @type {Construct} */\nexport const lineEnding = {\n name: 'lineEnding',\n tokenize: tokenizeLineEnding\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLineEnding(effects, ok) {\n return start\n\n /** @type {State} */\n function start(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, ok, 'linePrefix')\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factoryDestination} from 'micromark-factory-destination'\nimport {factoryLabel} from 'micromark-factory-label'\nimport {factoryTitle} from 'micromark-factory-title'\nimport {factoryWhitespace} from 'micromark-factory-whitespace'\nimport {markdownLineEndingOrSpace} from 'micromark-util-character'\nimport {push, splice} from 'micromark-util-chunked'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nimport {resolveAll} from 'micromark-util-resolve-all'\n/** @type {Construct} */\nexport const labelEnd = {\n name: 'labelEnd',\n tokenize: tokenizeLabelEnd,\n resolveTo: resolveToLabelEnd,\n resolveAll: resolveAllLabelEnd\n}\n\n/** @type {Construct} */\nconst resourceConstruct = {\n tokenize: tokenizeResource\n}\n/** @type {Construct} */\nconst referenceFullConstruct = {\n tokenize: tokenizeReferenceFull\n}\n/** @type {Construct} */\nconst referenceCollapsedConstruct = {\n tokenize: tokenizeReferenceCollapsed\n}\n\n/** @type {Resolver} */\nfunction resolveAllLabelEnd(events) {\n let index = -1\n while (++index < events.length) {\n const token = events[index][1]\n if (\n token.type === 'labelImage' ||\n token.type === 'labelLink' ||\n token.type === 'labelEnd'\n ) {\n // Remove the marker.\n events.splice(index + 1, token.type === 'labelImage' ? 4 : 2)\n token.type = 'data'\n index++\n }\n }\n return events\n}\n\n/** @type {Resolver} */\nfunction resolveToLabelEnd(events, context) {\n let index = events.length\n let offset = 0\n /** @type {Token} */\n let token\n /** @type {number | undefined} */\n let open\n /** @type {number | undefined} */\n let close\n /** @type {Array} */\n let media\n\n // Find an opening.\n while (index--) {\n token = events[index][1]\n if (open) {\n // If we see another link, or inactive link label, we’ve been here before.\n if (\n token.type === 'link' ||\n (token.type === 'labelLink' && token._inactive)\n ) {\n break\n }\n\n // Mark other link openings as inactive, as we can’t have links in\n // links.\n if (events[index][0] === 'enter' && token.type === 'labelLink') {\n token._inactive = true\n }\n } else if (close) {\n if (\n events[index][0] === 'enter' &&\n (token.type === 'labelImage' || token.type === 'labelLink') &&\n !token._balanced\n ) {\n open = index\n if (token.type !== 'labelLink') {\n offset = 2\n break\n }\n }\n } else if (token.type === 'labelEnd') {\n close = index\n }\n }\n const group = {\n type: events[open][1].type === 'labelLink' ? 'link' : 'image',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n }\n const label = {\n type: 'label',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[close][1].end)\n }\n const text = {\n type: 'labelText',\n start: Object.assign({}, events[open + offset + 2][1].end),\n end: Object.assign({}, events[close - 2][1].start)\n }\n media = [\n ['enter', group, context],\n ['enter', label, context]\n ]\n\n // Opening marker.\n media = push(media, events.slice(open + 1, open + offset + 3))\n\n // Text open.\n media = push(media, [['enter', text, context]])\n\n // Always populated by defaults.\n\n // Between.\n media = push(\n media,\n resolveAll(\n context.parser.constructs.insideSpan.null,\n events.slice(open + offset + 4, close - 3),\n context\n )\n )\n\n // Text close, marker close, label close.\n media = push(media, [\n ['exit', text, context],\n events[close - 2],\n events[close - 1],\n ['exit', label, context]\n ])\n\n // Reference, resource, or so.\n media = push(media, events.slice(close + 1))\n\n // Media close.\n media = push(media, [['exit', group, context]])\n splice(events, open, events.length, media)\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLabelEnd(effects, ok, nok) {\n const self = this\n let index = self.events.length\n /** @type {Token} */\n let labelStart\n /** @type {boolean} */\n let defined\n\n // Find an opening.\n while (index--) {\n if (\n (self.events[index][1].type === 'labelImage' ||\n self.events[index][1].type === 'labelLink') &&\n !self.events[index][1]._balanced\n ) {\n labelStart = self.events[index][1]\n break\n }\n }\n return start\n\n /**\n * Start of label end.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // If there is not an okay opening.\n if (!labelStart) {\n return nok(code)\n }\n\n // If the corresponding label (link) start is marked as inactive,\n // it means we’d be wrapping a link, like this:\n //\n // ```markdown\n // > | a [b [c](d) e](f) g.\n // ^\n // ```\n //\n // We can’t have that, so it’s just balanced brackets.\n if (labelStart._inactive) {\n return labelEndNok(code)\n }\n defined = self.parser.defined.includes(\n normalizeIdentifier(\n self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })\n )\n )\n effects.enter('labelEnd')\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelEnd')\n return after\n }\n\n /**\n * After `]`.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Note: `markdown-rs` also parses GFM footnotes here, which for us is in\n // an extension.\n\n // Resource (`[asd](fgh)`)?\n if (code === 40) {\n return effects.attempt(\n resourceConstruct,\n labelEndOk,\n defined ? labelEndOk : labelEndNok\n )(code)\n }\n\n // Full (`[asd][fgh]`) or collapsed (`[asd][]`) reference?\n if (code === 91) {\n return effects.attempt(\n referenceFullConstruct,\n labelEndOk,\n defined ? referenceNotFull : labelEndNok\n )(code)\n }\n\n // Shortcut (`[asd]`) reference?\n return defined ? labelEndOk(code) : labelEndNok(code)\n }\n\n /**\n * After `]`, at `[`, but not at a full reference.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceNotFull(code) {\n return effects.attempt(\n referenceCollapsedConstruct,\n labelEndOk,\n labelEndNok\n )(code)\n }\n\n /**\n * Done, we found something.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndOk(code) {\n // Note: `markdown-rs` does a bunch of stuff here.\n return ok(code)\n }\n\n /**\n * Done, it’s nothing.\n *\n * There was an okay opening, but we didn’t match anything.\n *\n * ```markdown\n * > | [a](b c\n * ^\n * > | [a][b c\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndNok(code) {\n labelStart._balanced = true\n return nok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeResource(effects, ok, nok) {\n return resourceStart\n\n /**\n * At a resource.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceStart(code) {\n effects.enter('resource')\n effects.enter('resourceMarker')\n effects.consume(code)\n effects.exit('resourceMarker')\n return resourceBefore\n }\n\n /**\n * In resource, after `(`, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBefore(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, resourceOpen)(code)\n : resourceOpen(code)\n }\n\n /**\n * In resource, after optional whitespace, at `)` or a destination.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceOpen(code) {\n if (code === 41) {\n return resourceEnd(code)\n }\n return factoryDestination(\n effects,\n resourceDestinationAfter,\n resourceDestinationMissing,\n 'resourceDestination',\n 'resourceDestinationLiteral',\n 'resourceDestinationLiteralMarker',\n 'resourceDestinationRaw',\n 'resourceDestinationString',\n 32\n )(code)\n }\n\n /**\n * In resource, after destination, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationAfter(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, resourceBetween)(code)\n : resourceEnd(code)\n }\n\n /**\n * At invalid destination.\n *\n * ```markdown\n * > | [a](<<) b\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationMissing(code) {\n return nok(code)\n }\n\n /**\n * In resource, after destination and whitespace, at `(` or title.\n *\n * ```markdown\n * > | [a](b ) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBetween(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(\n effects,\n resourceTitleAfter,\n nok,\n 'resourceTitle',\n 'resourceTitleMarker',\n 'resourceTitleString'\n )(code)\n }\n return resourceEnd(code)\n }\n\n /**\n * In resource, after title, at optional whitespace.\n *\n * ```markdown\n * > | [a](b \"c\") d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceTitleAfter(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, resourceEnd)(code)\n : resourceEnd(code)\n }\n\n /**\n * In resource, at `)`.\n *\n * ```markdown\n * > | [a](b) d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceEnd(code) {\n if (code === 41) {\n effects.enter('resourceMarker')\n effects.consume(code)\n effects.exit('resourceMarker')\n effects.exit('resource')\n return ok\n }\n return nok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceFull(effects, ok, nok) {\n const self = this\n return referenceFull\n\n /**\n * In a reference (full), at the `[`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFull(code) {\n return factoryLabel.call(\n self,\n effects,\n referenceFullAfter,\n referenceFullMissing,\n 'reference',\n 'referenceMarker',\n 'referenceString'\n )(code)\n }\n\n /**\n * In a reference (full), after `]`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullAfter(code) {\n return self.parser.defined.includes(\n normalizeIdentifier(\n self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)\n )\n )\n ? ok(code)\n : nok(code)\n }\n\n /**\n * In reference (full) that was missing.\n *\n * ```markdown\n * > | [a][b d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullMissing(code) {\n return nok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceCollapsed(effects, ok, nok) {\n return referenceCollapsedStart\n\n /**\n * In reference (collapsed), at `[`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedStart(code) {\n // We only attempt a collapsed label if there’s a `[`.\n\n effects.enter('reference')\n effects.enter('referenceMarker')\n effects.consume(code)\n effects.exit('referenceMarker')\n return referenceCollapsedOpen\n }\n\n /**\n * In reference (collapsed), at `]`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedOpen(code) {\n if (code === 93) {\n effects.enter('referenceMarker')\n effects.consume(code)\n effects.exit('referenceMarker')\n effects.exit('reference')\n return ok\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {labelEnd} from './label-end.js'\n\n/** @type {Construct} */\nexport const labelStartImage = {\n name: 'labelStartImage',\n tokenize: tokenizeLabelStartImage,\n resolveAll: labelEnd.resolveAll\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartImage(effects, ok, nok) {\n const self = this\n return start\n\n /**\n * Start of label (image) start.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('labelImage')\n effects.enter('labelImageMarker')\n effects.consume(code)\n effects.exit('labelImageMarker')\n return open\n }\n\n /**\n * After `!`, at `[`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 91) {\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelImage')\n return after\n }\n return nok(code)\n }\n\n /**\n * After `![`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * This is needed in because, when GFM footnotes are enabled, images never\n * form when started with a `^`.\n * Instead, links form:\n *\n * ```markdown\n * ![^a](b)\n *\n * ![^a][b]\n *\n * [b]: c\n * ```\n *\n * ```html\n *

!^a

\n *

!^a

\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // To do: use a new field to do this, this is still needed for\n // `micromark-extension-gfm-footnote`, but the `label-start-link`\n // behavior isn’t.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs\n ? nok(code)\n : ok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n */\n\nimport {\n markdownLineEndingOrSpace,\n unicodePunctuation,\n unicodeWhitespace\n} from 'micromark-util-character'\n/**\n * Classify whether a code represents whitespace, punctuation, or something\n * else.\n *\n * Used for attention (emphasis, strong), whose sequences can open or close\n * based on the class of surrounding characters.\n *\n * > 👉 **Note**: eof (`null`) is seen as whitespace.\n *\n * @param {Code} code\n * Code.\n * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}\n * Group.\n */\nexport function classifyCharacter(code) {\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return 1\n }\n if (unicodePunctuation(code)) {\n return 2\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Point} Point\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {push, splice} from 'micromark-util-chunked'\nimport {classifyCharacter} from 'micromark-util-classify-character'\nimport {resolveAll} from 'micromark-util-resolve-all'\n/** @type {Construct} */\nexport const attention = {\n name: 'attention',\n tokenize: tokenizeAttention,\n resolveAll: resolveAllAttention\n}\n\n/**\n * Take all events and resolve attention to emphasis or strong.\n *\n * @type {Resolver}\n */\nfunction resolveAllAttention(events, context) {\n let index = -1\n /** @type {number} */\n let open\n /** @type {Token} */\n let group\n /** @type {Token} */\n let text\n /** @type {Token} */\n let openingSequence\n /** @type {Token} */\n let closingSequence\n /** @type {number} */\n let use\n /** @type {Array} */\n let nextEvents\n /** @type {number} */\n let offset\n\n // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n while (++index < events.length) {\n // Find a token that can close.\n if (\n events[index][0] === 'enter' &&\n events[index][1].type === 'attentionSequence' &&\n events[index][1]._close\n ) {\n open = index\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (\n events[open][0] === 'exit' &&\n events[open][1].type === 'attentionSequence' &&\n events[open][1]._open &&\n // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) ===\n context.sliceSerialize(events[index][1]).charCodeAt(0)\n ) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if (\n (events[open][1]._close || events[index][1]._open) &&\n (events[index][1].end.offset - events[index][1].start.offset) % 3 &&\n !(\n (events[open][1].end.offset -\n events[open][1].start.offset +\n events[index][1].end.offset -\n events[index][1].start.offset) %\n 3\n )\n ) {\n continue\n }\n\n // Number of markers to use from the sequence.\n use =\n events[open][1].end.offset - events[open][1].start.offset > 1 &&\n events[index][1].end.offset - events[index][1].start.offset > 1\n ? 2\n : 1\n const start = Object.assign({}, events[open][1].end)\n const end = Object.assign({}, events[index][1].start)\n movePoint(start, -use)\n movePoint(end, use)\n openingSequence = {\n type: use > 1 ? 'strongSequence' : 'emphasisSequence',\n start,\n end: Object.assign({}, events[open][1].end)\n }\n closingSequence = {\n type: use > 1 ? 'strongSequence' : 'emphasisSequence',\n start: Object.assign({}, events[index][1].start),\n end\n }\n text = {\n type: use > 1 ? 'strongText' : 'emphasisText',\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n }\n group = {\n type: use > 1 ? 'strong' : 'emphasis',\n start: Object.assign({}, openingSequence.start),\n end: Object.assign({}, closingSequence.end)\n }\n events[open][1].end = Object.assign({}, openingSequence.start)\n events[index][1].start = Object.assign({}, closingSequence.end)\n nextEvents = []\n\n // If there are more markers in the opening, add them before.\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [\n ['enter', events[open][1], context],\n ['exit', events[open][1], context]\n ])\n }\n\n // Opening.\n nextEvents = push(nextEvents, [\n ['enter', group, context],\n ['enter', openingSequence, context],\n ['exit', openingSequence, context],\n ['enter', text, context]\n ])\n\n // Always populated by defaults.\n\n // Between.\n nextEvents = push(\n nextEvents,\n resolveAll(\n context.parser.constructs.insideSpan.null,\n events.slice(open + 1, index),\n context\n )\n )\n\n // Closing.\n nextEvents = push(nextEvents, [\n ['exit', text, context],\n ['enter', closingSequence, context],\n ['exit', closingSequence, context],\n ['exit', group, context]\n ])\n\n // If there are more markers in the closing, add them after.\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2\n nextEvents = push(nextEvents, [\n ['enter', events[index][1], context],\n ['exit', events[index][1], context]\n ])\n } else {\n offset = 0\n }\n splice(events, open - 1, index - open + 3, nextEvents)\n index = open + nextEvents.length - offset - 2\n break\n }\n }\n }\n }\n\n // Remove remaining sequences.\n index = -1\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data'\n }\n }\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeAttention(effects, ok) {\n const attentionMarkers = this.parser.constructs.attentionMarkers.null\n const previous = this.previous\n const before = classifyCharacter(previous)\n\n /** @type {NonNullable} */\n let marker\n return start\n\n /**\n * Before a sequence.\n *\n * ```markdown\n * > | **\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n marker = code\n effects.enter('attentionSequence')\n return inside(code)\n }\n\n /**\n * In a sequence.\n *\n * ```markdown\n * > | **\n * ^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code)\n return inside\n }\n const token = effects.exit('attentionSequence')\n\n // To do: next major: move this to resolver, just like `markdown-rs`.\n const after = classifyCharacter(code)\n\n // Always populated by defaults.\n\n const open =\n !after || (after === 2 && before) || attentionMarkers.includes(code)\n const close =\n !before || (before === 2 && after) || attentionMarkers.includes(previous)\n token._open = Boolean(marker === 42 ? open : open && (before || !close))\n token._close = Boolean(marker === 42 ? close : close && (after || !open))\n return ok(code)\n }\n}\n\n/**\n * Move a point a bit.\n *\n * Note: `move` only works inside lines! It’s not possible to move past other\n * chunks (replacement characters, tabs, or line endings).\n *\n * @param {Point} point\n * @param {number} offset\n * @returns {void}\n */\nfunction movePoint(point, offset) {\n point.column += offset\n point.offset += offset\n point._bufferIndex += offset\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n asciiAtext,\n asciiControl\n} from 'micromark-util-character'\n/** @type {Construct} */\nexport const autolink = {\n name: 'autolink',\n tokenize: tokenizeAutolink\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeAutolink(effects, ok, nok) {\n let size = 0\n return start\n\n /**\n * Start of an autolink.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('autolink')\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.enter('autolinkProtocol')\n return open\n }\n\n /**\n * After `<`, at protocol or atext.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (asciiAlpha(code)) {\n effects.consume(code)\n return schemeOrEmailAtext\n }\n return emailAtext(code)\n }\n\n /**\n * At second byte of protocol or atext.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeOrEmailAtext(code) {\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) {\n // Count the previous alphabetical from `open` too.\n size = 1\n return schemeInsideOrEmailAtext(code)\n }\n return emailAtext(code)\n }\n\n /**\n * In ambiguous protocol or atext.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeInsideOrEmailAtext(code) {\n if (code === 58) {\n effects.consume(code)\n size = 0\n return urlInside\n }\n\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if (\n (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) &&\n size++ < 32\n ) {\n effects.consume(code)\n return schemeInsideOrEmailAtext\n }\n size = 0\n return emailAtext(code)\n }\n\n /**\n * After protocol, in URL.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function urlInside(code) {\n if (code === 62) {\n effects.exit('autolinkProtocol')\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.exit('autolink')\n return ok\n }\n\n // ASCII control, space, or `<`.\n if (code === null || code === 32 || code === 60 || asciiControl(code)) {\n return nok(code)\n }\n effects.consume(code)\n return urlInside\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function emailAtext(code) {\n if (code === 64) {\n effects.consume(code)\n return emailAtSignOrDot\n }\n if (asciiAtext(code)) {\n effects.consume(code)\n return emailAtext\n }\n return nok(code)\n }\n\n /**\n * In label, after at-sign or dot.\n *\n * ```markdown\n * > | ab\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function emailAtSignOrDot(code) {\n return asciiAlphanumeric(code) ? emailLabel(code) : nok(code)\n }\n\n /**\n * In label, where `.` and `>` are allowed.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function emailLabel(code) {\n if (code === 46) {\n effects.consume(code)\n size = 0\n return emailAtSignOrDot\n }\n if (code === 62) {\n // Exit, then change the token type.\n effects.exit('autolinkProtocol').type = 'autolinkEmail'\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.exit('autolink')\n return ok\n }\n return emailValue(code)\n }\n\n /**\n * In label, where `.` and `>` are *not* allowed.\n *\n * Though, this is also used in `emailLabel` to parse other values.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function emailValue(code) {\n // ASCII alphanumeric or `-`.\n if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) {\n const next = code === 45 ? emailValue : emailLabel\n effects.consume(code)\n return next\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n markdownLineEnding,\n markdownLineEndingOrSpace,\n markdownSpace\n} from 'micromark-util-character'\n/** @type {Construct} */\nexport const htmlText = {\n name: 'htmlText',\n tokenize: tokenizeHtmlText\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlText(effects, ok, nok) {\n const self = this\n /** @type {NonNullable | undefined} */\n let marker\n /** @type {number} */\n let index\n /** @type {State} */\n let returnState\n return start\n\n /**\n * Start of HTML (text).\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('htmlText')\n effects.enter('htmlTextData')\n effects.consume(code)\n return open\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | a c\n * ^\n * > | a c\n * ^\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code)\n return declarationOpen\n }\n if (code === 47) {\n effects.consume(code)\n return tagCloseStart\n }\n if (code === 63) {\n effects.consume(code)\n return instruction\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code)\n return tagOpen\n }\n return nok(code)\n }\n\n /**\n * After ` | a c\n * ^\n * > | a c\n * ^\n * > | a &<]]> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code)\n return commentOpenInside\n }\n if (code === 91) {\n effects.consume(code)\n index = 0\n return cdataOpenInside\n }\n if (asciiAlpha(code)) {\n effects.consume(code)\n return declaration\n }\n return nok(code)\n }\n\n /**\n * In a comment, after ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code)\n return commentEnd\n }\n return nok(code)\n }\n\n /**\n * In comment.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function comment(code) {\n if (code === null) {\n return nok(code)\n }\n if (code === 45) {\n effects.consume(code)\n return commentClose\n }\n if (markdownLineEnding(code)) {\n returnState = comment\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return comment\n }\n\n /**\n * In comment, after `-`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentClose(code) {\n if (code === 45) {\n effects.consume(code)\n return commentEnd\n }\n return comment(code)\n }\n\n /**\n * In comment, after `--`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentEnd(code) {\n return code === 62\n ? end(code)\n : code === 45\n ? commentClose(code)\n : comment(code)\n }\n\n /**\n * After ` | a &<]]> b\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = 'CDATA['\n if (code === value.charCodeAt(index++)) {\n effects.consume(code)\n return index === value.length ? cdata : cdataOpenInside\n }\n return nok(code)\n }\n\n /**\n * In CDATA.\n *\n * ```markdown\n * > | a &<]]> b\n * ^^^\n * ```\n *\n * @type {State}\n */\n function cdata(code) {\n if (code === null) {\n return nok(code)\n }\n if (code === 93) {\n effects.consume(code)\n return cdataClose\n }\n if (markdownLineEnding(code)) {\n returnState = cdata\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return cdata\n }\n\n /**\n * In CDATA, after `]`, at another `]`.\n *\n * ```markdown\n * > | a &<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataClose(code) {\n if (code === 93) {\n effects.consume(code)\n return cdataEnd\n }\n return cdata(code)\n }\n\n /**\n * In CDATA, after `]]`, at `>`.\n *\n * ```markdown\n * > | a &<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataEnd(code) {\n if (code === 62) {\n return end(code)\n }\n if (code === 93) {\n effects.consume(code)\n return cdataEnd\n }\n return cdata(code)\n }\n\n /**\n * In declaration.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function declaration(code) {\n if (code === null || code === 62) {\n return end(code)\n }\n if (markdownLineEnding(code)) {\n returnState = declaration\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return declaration\n }\n\n /**\n * In instruction.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function instruction(code) {\n if (code === null) {\n return nok(code)\n }\n if (code === 63) {\n effects.consume(code)\n return instructionClose\n }\n if (markdownLineEnding(code)) {\n returnState = instruction\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return instruction\n }\n\n /**\n * In instruction, after `?`, at `>`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function instructionClose(code) {\n return code === 62 ? end(code) : instruction(code)\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code)\n return tagClose\n }\n return nok(code)\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagClose(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n return tagClose\n }\n return tagCloseBetween(code)\n }\n\n /**\n * In closing tag, after tag name.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseBetween(code) {\n if (markdownLineEnding(code)) {\n returnState = tagCloseBetween\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagCloseBetween\n }\n return end(code)\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpen(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n return tagOpen\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n return nok(code)\n }\n\n /**\n * In opening tag, after tag name.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenBetween(code) {\n if (code === 47) {\n effects.consume(code)\n return end\n }\n\n // ASCII alphabetical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code)\n return tagOpenAttributeName\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenBetween\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenBetween\n }\n return end(code)\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | a d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeName(code) {\n // ASCII alphabetical and `-`, `.`, `:`, and `_`.\n if (\n code === 45 ||\n code === 46 ||\n code === 58 ||\n code === 95 ||\n asciiAlphanumeric(code)\n ) {\n effects.consume(code)\n return tagOpenAttributeName\n }\n return tagOpenAttributeNameAfter(code)\n }\n\n /**\n * After attribute name, before initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | a d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code)\n return tagOpenAttributeValueBefore\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeNameAfter\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenAttributeNameAfter\n }\n return tagOpenBetween(code)\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueBefore(code) {\n if (\n code === null ||\n code === 60 ||\n code === 61 ||\n code === 62 ||\n code === 96\n ) {\n return nok(code)\n }\n if (code === 34 || code === 39) {\n effects.consume(code)\n marker = code\n return tagOpenAttributeValueQuoted\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueBefore\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenAttributeValueBefore\n }\n effects.consume(code)\n return tagOpenAttributeValueUnquoted\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuoted(code) {\n if (code === marker) {\n effects.consume(code)\n marker = undefined\n return tagOpenAttributeValueQuotedAfter\n }\n if (code === null) {\n return nok(code)\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueQuoted\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return tagOpenAttributeValueQuoted\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueUnquoted(code) {\n if (\n code === null ||\n code === 34 ||\n code === 39 ||\n code === 60 ||\n code === 61 ||\n code === 96\n ) {\n return nok(code)\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n effects.consume(code)\n return tagOpenAttributeValueUnquoted\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the end\n * of the tag.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n return nok(code)\n }\n\n /**\n * In certain circumstances of a tag where only an `>` is allowed.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function end(code) {\n if (code === 62) {\n effects.consume(code)\n effects.exit('htmlTextData')\n effects.exit('htmlText')\n return ok\n }\n return nok(code)\n }\n\n /**\n * At eol.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * > | a \n * ```\n *\n * @type {State}\n */\n function lineEndingBefore(code) {\n effects.exit('htmlTextData')\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return lineEndingAfter\n }\n\n /**\n * After eol, at optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a \n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfter(code) {\n // Always populated by defaults.\n\n return markdownSpace(code)\n ? factorySpace(\n effects,\n lineEndingAfterPrefix,\n 'linePrefix',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4\n )(code)\n : lineEndingAfterPrefix(code)\n }\n\n /**\n * After eol, after optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a \n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfterPrefix(code) {\n effects.enter('htmlTextData')\n return returnState(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {labelEnd} from './label-end.js'\n\n/** @type {Construct} */\nexport const labelStartLink = {\n name: 'labelStartLink',\n tokenize: tokenizeLabelStartLink,\n resolveAll: labelEnd.resolveAll\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartLink(effects, ok, nok) {\n const self = this\n return start\n\n /**\n * Start of label (link) start.\n *\n * ```markdown\n * > | a [b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('labelLink')\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelLink')\n return after\n }\n\n /** @type {State} */\n function after(code) {\n // To do: this isn’t needed in `micromark-extension-gfm-footnote`,\n // remove.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs\n ? nok(code)\n : ok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {markdownLineEnding} from 'micromark-util-character'\n/** @type {Construct} */\nexport const hardBreakEscape = {\n name: 'hardBreakEscape',\n tokenize: tokenizeHardBreakEscape\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeHardBreakEscape(effects, ok, nok) {\n return start\n\n /**\n * Start of a hard break (escape).\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('hardBreakEscape')\n effects.consume(code)\n return after\n }\n\n /**\n * After `\\`, at eol.\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (markdownLineEnding(code)) {\n effects.exit('hardBreakEscape')\n return ok(code)\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Previous} Previous\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {markdownLineEnding} from 'micromark-util-character'\n/** @type {Construct} */\nexport const codeText = {\n name: 'codeText',\n tokenize: tokenizeCodeText,\n resolve: resolveCodeText,\n previous\n}\n\n// To do: next major: don’t resolve, like `markdown-rs`.\n/** @type {Resolver} */\nfunction resolveCodeText(events) {\n let tailExitIndex = events.length - 4\n let headEnterIndex = 3\n /** @type {number} */\n let index\n /** @type {number | undefined} */\n let enter\n\n // If we start and end with an EOL or a space.\n if (\n (events[headEnterIndex][1].type === 'lineEnding' ||\n events[headEnterIndex][1].type === 'space') &&\n (events[tailExitIndex][1].type === 'lineEnding' ||\n events[tailExitIndex][1].type === 'space')\n ) {\n index = headEnterIndex\n\n // And we have data.\n while (++index < tailExitIndex) {\n if (events[index][1].type === 'codeTextData') {\n // Then we have padding.\n events[headEnterIndex][1].type = 'codeTextPadding'\n events[tailExitIndex][1].type = 'codeTextPadding'\n headEnterIndex += 2\n tailExitIndex -= 2\n break\n }\n }\n }\n\n // Merge adjacent spaces and data.\n index = headEnterIndex - 1\n tailExitIndex++\n while (++index <= tailExitIndex) {\n if (enter === undefined) {\n if (index !== tailExitIndex && events[index][1].type !== 'lineEnding') {\n enter = index\n }\n } else if (\n index === tailExitIndex ||\n events[index][1].type === 'lineEnding'\n ) {\n events[enter][1].type = 'codeTextData'\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end\n events.splice(enter + 2, index - enter - 2)\n tailExitIndex -= index - enter - 2\n index = enter + 2\n }\n enter = undefined\n }\n }\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Previous}\n */\nfunction previous(code) {\n // If there is a previous code, there will always be a tail.\n return (\n code !== 96 ||\n this.events[this.events.length - 1][1].type === 'characterEscape'\n )\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCodeText(effects, ok, nok) {\n const self = this\n let sizeOpen = 0\n /** @type {number} */\n let size\n /** @type {Token} */\n let token\n return start\n\n /**\n * Start of code (text).\n *\n * ```markdown\n * > | `a`\n * ^\n * > | \\`a`\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('codeText')\n effects.enter('codeTextSequence')\n return sequenceOpen(code)\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 96) {\n effects.consume(code)\n sizeOpen++\n return sequenceOpen\n }\n effects.exit('codeTextSequence')\n return between(code)\n }\n\n /**\n * Between something and something else.\n *\n * ```markdown\n * > | `a`\n * ^^\n * ```\n *\n * @type {State}\n */\n function between(code) {\n // EOF.\n if (code === null) {\n return nok(code)\n }\n\n // To do: next major: don’t do spaces in resolve, but when compiling,\n // like `markdown-rs`.\n // Tabs don’t work, and virtual spaces don’t make sense.\n if (code === 32) {\n effects.enter('space')\n effects.consume(code)\n effects.exit('space')\n return between\n }\n\n // Closing fence? Could also be data.\n if (code === 96) {\n token = effects.enter('codeTextSequence')\n size = 0\n return sequenceClose(code)\n }\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return between\n }\n\n // Data.\n effects.enter('codeTextData')\n return data(code)\n }\n\n /**\n * In data.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (\n code === null ||\n code === 32 ||\n code === 96 ||\n markdownLineEnding(code)\n ) {\n effects.exit('codeTextData')\n return between(code)\n }\n effects.consume(code)\n return data\n }\n\n /**\n * In closing sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n // More.\n if (code === 96) {\n effects.consume(code)\n size++\n return sequenceClose\n }\n\n // Done!\n if (size === sizeOpen) {\n effects.exit('codeTextSequence')\n effects.exit('codeText')\n return ok(code)\n }\n\n // More or less accents: mark as data.\n token.type = 'codeTextData'\n return data(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Extension} Extension\n */\n\nimport {\n attention,\n autolink,\n blockQuote,\n characterEscape,\n characterReference,\n codeFenced,\n codeIndented,\n codeText,\n definition,\n hardBreakEscape,\n headingAtx,\n htmlFlow,\n htmlText,\n labelEnd,\n labelStartImage,\n labelStartLink,\n lineEnding,\n list,\n setextUnderline,\n thematicBreak\n} from 'micromark-core-commonmark'\nimport {resolver as resolveText} from './initialize/text.js'\n\n/** @satisfies {Extension['document']} */\nexport const document = {\n [42]: list,\n [43]: list,\n [45]: list,\n [48]: list,\n [49]: list,\n [50]: list,\n [51]: list,\n [52]: list,\n [53]: list,\n [54]: list,\n [55]: list,\n [56]: list,\n [57]: list,\n [62]: blockQuote\n}\n\n/** @satisfies {Extension['contentInitial']} */\nexport const contentInitial = {\n [91]: definition\n}\n\n/** @satisfies {Extension['flowInitial']} */\nexport const flowInitial = {\n [-2]: codeIndented,\n [-1]: codeIndented,\n [32]: codeIndented\n}\n\n/** @satisfies {Extension['flow']} */\nexport const flow = {\n [35]: headingAtx,\n [42]: thematicBreak,\n [45]: [setextUnderline, thematicBreak],\n [60]: htmlFlow,\n [61]: setextUnderline,\n [95]: thematicBreak,\n [96]: codeFenced,\n [126]: codeFenced\n}\n\n/** @satisfies {Extension['string']} */\nexport const string = {\n [38]: characterReference,\n [92]: characterEscape\n}\n\n/** @satisfies {Extension['text']} */\nexport const text = {\n [-5]: lineEnding,\n [-4]: lineEnding,\n [-3]: lineEnding,\n [33]: labelStartImage,\n [38]: characterReference,\n [42]: attention,\n [60]: [autolink, htmlText],\n [91]: labelStartLink,\n [92]: [hardBreakEscape, characterEscape],\n [93]: labelEnd,\n [95]: attention,\n [96]: codeText\n}\n\n/** @satisfies {Extension['insideSpan']} */\nexport const insideSpan = {\n null: [attention, resolveText]\n}\n\n/** @satisfies {Extension['attentionMarkers']} */\nexport const attentionMarkers = {\n null: [42, 95]\n}\n\n/** @satisfies {Extension['disable']} */\nexport const disable = {\n null: []\n}\n","/**\n * @typedef {import('micromark-util-types').Create} Create\n * @typedef {import('micromark-util-types').FullNormalizedExtension} FullNormalizedExtension\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').ParseContext} ParseContext\n * @typedef {import('micromark-util-types').ParseOptions} ParseOptions\n */\n\nimport {combineExtensions} from 'micromark-util-combine-extensions'\nimport {content} from './initialize/content.js'\nimport {document} from './initialize/document.js'\nimport {flow} from './initialize/flow.js'\nimport {text, string} from './initialize/text.js'\nimport {createTokenizer} from './create-tokenizer.js'\nimport * as defaultConstructs from './constructs.js'\n\n/**\n * @param {ParseOptions | null | undefined} [options]\n * @returns {ParseContext}\n */\nexport function parse(options) {\n const settings = options || {}\n const constructs =\n /** @type {FullNormalizedExtension} */\n combineExtensions([defaultConstructs, ...(settings.extensions || [])])\n\n /** @type {ParseContext} */\n const parser = {\n defined: [],\n lazy: {},\n constructs,\n content: create(content),\n document: create(document),\n flow: create(flow),\n string: create(string),\n text: create(text)\n }\n return parser\n\n /**\n * @param {InitialConstruct} initial\n */\n function create(initial) {\n return creator\n /** @type {Create} */\n function creator(from) {\n return createTokenizer(parser, initial, from)\n }\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Chunk} Chunk\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Encoding} Encoding\n * @typedef {import('micromark-util-types').Value} Value\n */\n\n/**\n * @callback Preprocessor\n * @param {Value} value\n * @param {Encoding | null | undefined} [encoding]\n * @param {boolean | null | undefined} [end=false]\n * @returns {Array}\n */\n\nconst search = /[\\0\\t\\n\\r]/g\n\n/**\n * @returns {Preprocessor}\n */\nexport function preprocess() {\n let column = 1\n let buffer = ''\n /** @type {boolean | undefined} */\n let start = true\n /** @type {boolean | undefined} */\n let atCarriageReturn\n return preprocessor\n\n /** @type {Preprocessor} */\n function preprocessor(value, encoding, end) {\n /** @type {Array} */\n const chunks = []\n /** @type {RegExpMatchArray | null} */\n let match\n /** @type {number} */\n let next\n /** @type {number} */\n let startPosition\n /** @type {number} */\n let endPosition\n /** @type {Code} */\n let code\n\n // @ts-expect-error `Buffer` does allow an encoding.\n value = buffer + value.toString(encoding)\n startPosition = 0\n buffer = ''\n if (start) {\n // To do: `markdown-rs` actually parses BOMs (byte order mark).\n if (value.charCodeAt(0) === 65279) {\n startPosition++\n }\n start = undefined\n }\n while (startPosition < value.length) {\n search.lastIndex = startPosition\n match = search.exec(value)\n endPosition =\n match && match.index !== undefined ? match.index : value.length\n code = value.charCodeAt(endPosition)\n if (!match) {\n buffer = value.slice(startPosition)\n break\n }\n if (code === 10 && startPosition === endPosition && atCarriageReturn) {\n chunks.push(-3)\n atCarriageReturn = undefined\n } else {\n if (atCarriageReturn) {\n chunks.push(-5)\n atCarriageReturn = undefined\n }\n if (startPosition < endPosition) {\n chunks.push(value.slice(startPosition, endPosition))\n column += endPosition - startPosition\n }\n switch (code) {\n case 0: {\n chunks.push(65533)\n column++\n break\n }\n case 9: {\n next = Math.ceil(column / 4) * 4\n chunks.push(-2)\n while (column++ < next) chunks.push(-1)\n break\n }\n case 10: {\n chunks.push(-4)\n column = 1\n break\n }\n default: {\n atCarriageReturn = true\n column = 1\n }\n }\n }\n startPosition = endPosition + 1\n }\n if (end) {\n if (atCarriageReturn) chunks.push(-5)\n if (buffer) chunks.push(buffer)\n chunks.push(null)\n }\n return chunks\n }\n}\n","/**\n * Turn the number (in string form as either hexa- or plain decimal) coming from\n * a numeric character reference into a character.\n *\n * Sort of like `String.fromCharCode(Number.parseInt(value, base))`, but makes\n * non-characters and control characters safe.\n *\n * @param {string} value\n * Value to decode.\n * @param {number} base\n * Numeric base.\n * @returns {string}\n * Character.\n */\nexport function decodeNumericCharacterReference(value, base) {\n const code = Number.parseInt(value, base)\n if (\n // C0 except for HT, LF, FF, CR, space.\n code < 9 ||\n code === 11 ||\n (code > 13 && code < 32) ||\n // Control character (DEL) of C0, and C1 controls.\n (code > 126 && code < 160) ||\n // Lone high surrogates and low surrogates.\n (code > 55295 && code < 57344) ||\n // Noncharacters.\n (code > 64975 && code < 65008) /* eslint-disable no-bitwise */ ||\n (code & 65535) === 65535 ||\n (code & 65535) === 65534 /* eslint-enable no-bitwise */ ||\n // Out of range\n code > 1114111\n ) {\n return '\\uFFFD'\n }\n return String.fromCharCode(code)\n}\n","import {decodeNamedCharacterReference} from 'decode-named-character-reference'\nimport {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'\nconst characterEscapeOrReference =\n /\\\\([!-/:-@[-`{-~])|&(#(?:\\d{1,7}|x[\\da-f]{1,6})|[\\da-z]{1,31});/gi\n\n/**\n * Decode markdown strings (which occur in places such as fenced code info\n * strings, destinations, labels, and titles).\n *\n * The “string” content type allows character escapes and -references.\n * This decodes those.\n *\n * @param {string} value\n * Value to decode.\n * @returns {string}\n * Decoded value.\n */\nexport function decodeString(value) {\n return value.replace(characterEscapeOrReference, decode)\n}\n\n/**\n * @param {string} $0\n * @param {string} $1\n * @param {string} $2\n * @returns {string}\n */\nfunction decode($0, $1, $2) {\n if ($1) {\n // Escape.\n return $1\n }\n\n // Reference.\n const head = $2.charCodeAt(0)\n if (head === 35) {\n const head = $2.charCodeAt(1)\n const hex = head === 120 || head === 88\n return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10)\n }\n return decodeNamedCharacterReference($2) || $0\n}\n","/**\n * @typedef {import('micromark-util-types').Encoding} Encoding\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').ParseOptions} ParseOptions\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Value} Value\n *\n * @typedef {import('unist').Parent} UnistParent\n * @typedef {import('unist').Point} Point\n *\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n * @typedef {import('mdast').StaticPhrasingContent} StaticPhrasingContent\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Break} Break\n * @typedef {import('mdast').Blockquote} Blockquote\n * @typedef {import('mdast').Code} Code\n * @typedef {import('mdast').Definition} Definition\n * @typedef {import('mdast').Emphasis} Emphasis\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('mdast').HTML} HTML\n * @typedef {import('mdast').Image} Image\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('mdast').Link} Link\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('mdast').List} List\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').Strong} Strong\n * @typedef {import('mdast').Text} Text\n * @typedef {import('mdast').ThematicBreak} ThematicBreak\n * @typedef {import('mdast').ReferenceType} ReferenceType\n * @typedef {import('../index.js').CompileData} CompileData\n */\n\n/**\n * @typedef {Root | Content} Node\n * @typedef {Extract} Parent\n *\n * @typedef {Omit & {type: 'fragment', children: Array}} Fragment\n */\n\n/**\n * @callback Transform\n * Extra transform, to change the AST afterwards.\n * @param {Root} tree\n * Tree to transform.\n * @returns {Root | undefined | null | void}\n * New tree or nothing (in which case the current tree is used).\n *\n * @callback Handle\n * Handle a token.\n * @param {CompileContext} this\n * Context.\n * @param {Token} token\n * Current token.\n * @returns {void}\n * Nothing.\n *\n * @typedef {Record} Handles\n * Token types mapping to handles\n *\n * @callback OnEnterError\n * Handle the case where the `right` token is open, but it is closed (by the\n * `left` token) or because we reached the end of the document.\n * @param {Omit} this\n * Context.\n * @param {Token | undefined} left\n * Left token.\n * @param {Token} right\n * Right token.\n * @returns {void}\n * Nothing.\n *\n * @callback OnExitError\n * Handle the case where the `right` token is open but it is closed by\n * exiting the `left` token.\n * @param {Omit} this\n * Context.\n * @param {Token} left\n * Left token.\n * @param {Token} right\n * Right token.\n * @returns {void}\n * Nothing.\n *\n * @typedef {[Token, OnEnterError | undefined]} TokenTuple\n * Open token on the stack, with an optional error handler for when\n * that token isn’t closed properly.\n */\n\n/**\n * @typedef Config\n * Configuration.\n *\n * We have our defaults, but extensions will add more.\n * @property {Array} canContainEols\n * Token types where line endings are used.\n * @property {Handles} enter\n * Opening handles.\n * @property {Handles} exit\n * Closing handles.\n * @property {Array} transforms\n * Tree transforms.\n *\n * @typedef {Partial} Extension\n * Change how markdown tokens from micromark are turned into mdast.\n *\n * @typedef CompileContext\n * mdast compiler context.\n * @property {Array} stack\n * Stack of nodes.\n * @property {Array} tokenStack\n * Stack of tokens.\n * @property {(key: Key) => CompileData[Key]} getData\n * Get data from the key/value store.\n * @property {(key: Key, value?: CompileData[Key]) => void} setData\n * Set data into the key/value store.\n * @property {(this: CompileContext) => void} buffer\n * Capture some of the output data.\n * @property {(this: CompileContext) => string} resume\n * Stop capturing and access the output data.\n * @property {(this: CompileContext, node: Kind, token: Token, onError?: OnEnterError) => Kind} enter\n * Enter a token.\n * @property {(this: CompileContext, token: Token, onError?: OnExitError) => Node} exit\n * Exit a token.\n * @property {TokenizeContext['sliceSerialize']} sliceSerialize\n * Get the string value of a token.\n * @property {Config} config\n * Configuration.\n *\n * @typedef FromMarkdownOptions\n * Configuration for how to build mdast.\n * @property {Array> | null | undefined} [mdastExtensions]\n * Extensions for this utility to change how tokens are turned into a tree.\n *\n * @typedef {ParseOptions & FromMarkdownOptions} Options\n * Configuration.\n */\n\n// To do: micromark: create a registry of tokens?\n// To do: next major: don’t return given `Node` from `enter`.\n// To do: next major: remove setter/getter.\n\nimport {toString} from 'mdast-util-to-string'\nimport {parse} from 'micromark/lib/parse.js'\nimport {preprocess} from 'micromark/lib/preprocess.js'\nimport {postprocess} from 'micromark/lib/postprocess.js'\nimport {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'\nimport {decodeString} from 'micromark-util-decode-string'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nimport {decodeNamedCharacterReference} from 'decode-named-character-reference'\nimport {stringifyPosition} from 'unist-util-stringify-position'\nconst own = {}.hasOwnProperty\n\n/**\n * @param value\n * Markdown to parse.\n * @param encoding\n * Character encoding for when `value` is `Buffer`.\n * @param options\n * Configuration.\n * @returns\n * mdast tree.\n */\nexport const fromMarkdown =\n /**\n * @type {(\n * ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) &\n * ((value: Value, options?: Options | null | undefined) => Root)\n * )}\n */\n\n /**\n * @param {Value} value\n * @param {Encoding | Options | null | undefined} [encoding]\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n */\n function (value, encoding, options) {\n if (typeof encoding !== 'string') {\n options = encoding\n encoding = undefined\n }\n return compiler(options)(\n postprocess(\n parse(options).document().write(preprocess()(value, encoding, true))\n )\n )\n }\n\n/**\n * Note this compiler only understand complete buffering, not streaming.\n *\n * @param {Options | null | undefined} [options]\n */\nfunction compiler(options) {\n /** @type {Config} */\n const config = {\n transforms: [],\n canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],\n enter: {\n autolink: opener(link),\n autolinkProtocol: onenterdata,\n autolinkEmail: onenterdata,\n atxHeading: opener(heading),\n blockQuote: opener(blockQuote),\n characterEscape: onenterdata,\n characterReference: onenterdata,\n codeFenced: opener(codeFlow),\n codeFencedFenceInfo: buffer,\n codeFencedFenceMeta: buffer,\n codeIndented: opener(codeFlow, buffer),\n codeText: opener(codeText, buffer),\n codeTextData: onenterdata,\n data: onenterdata,\n codeFlowValue: onenterdata,\n definition: opener(definition),\n definitionDestinationString: buffer,\n definitionLabelString: buffer,\n definitionTitleString: buffer,\n emphasis: opener(emphasis),\n hardBreakEscape: opener(hardBreak),\n hardBreakTrailing: opener(hardBreak),\n htmlFlow: opener(html, buffer),\n htmlFlowData: onenterdata,\n htmlText: opener(html, buffer),\n htmlTextData: onenterdata,\n image: opener(image),\n label: buffer,\n link: opener(link),\n listItem: opener(listItem),\n listItemValue: onenterlistitemvalue,\n listOrdered: opener(list, onenterlistordered),\n listUnordered: opener(list),\n paragraph: opener(paragraph),\n reference: onenterreference,\n referenceString: buffer,\n resourceDestinationString: buffer,\n resourceTitleString: buffer,\n setextHeading: opener(heading),\n strong: opener(strong),\n thematicBreak: opener(thematicBreak)\n },\n exit: {\n atxHeading: closer(),\n atxHeadingSequence: onexitatxheadingsequence,\n autolink: closer(),\n autolinkEmail: onexitautolinkemail,\n autolinkProtocol: onexitautolinkprotocol,\n blockQuote: closer(),\n characterEscapeValue: onexitdata,\n characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,\n characterReferenceMarkerNumeric: onexitcharacterreferencemarker,\n characterReferenceValue: onexitcharacterreferencevalue,\n codeFenced: closer(onexitcodefenced),\n codeFencedFence: onexitcodefencedfence,\n codeFencedFenceInfo: onexitcodefencedfenceinfo,\n codeFencedFenceMeta: onexitcodefencedfencemeta,\n codeFlowValue: onexitdata,\n codeIndented: closer(onexitcodeindented),\n codeText: closer(onexitcodetext),\n codeTextData: onexitdata,\n data: onexitdata,\n definition: closer(),\n definitionDestinationString: onexitdefinitiondestinationstring,\n definitionLabelString: onexitdefinitionlabelstring,\n definitionTitleString: onexitdefinitiontitlestring,\n emphasis: closer(),\n hardBreakEscape: closer(onexithardbreak),\n hardBreakTrailing: closer(onexithardbreak),\n htmlFlow: closer(onexithtmlflow),\n htmlFlowData: onexitdata,\n htmlText: closer(onexithtmltext),\n htmlTextData: onexitdata,\n image: closer(onexitimage),\n label: onexitlabel,\n labelText: onexitlabeltext,\n lineEnding: onexitlineending,\n link: closer(onexitlink),\n listItem: closer(),\n listOrdered: closer(),\n listUnordered: closer(),\n paragraph: closer(),\n referenceString: onexitreferencestring,\n resourceDestinationString: onexitresourcedestinationstring,\n resourceTitleString: onexitresourcetitlestring,\n resource: onexitresource,\n setextHeading: closer(onexitsetextheading),\n setextHeadingLineSequence: onexitsetextheadinglinesequence,\n setextHeadingText: onexitsetextheadingtext,\n strong: closer(),\n thematicBreak: closer()\n }\n }\n configure(config, (options || {}).mdastExtensions || [])\n\n /** @type {CompileData} */\n const data = {}\n return compile\n\n /**\n * Turn micromark events into an mdast tree.\n *\n * @param {Array} events\n * Events.\n * @returns {Root}\n * mdast tree.\n */\n function compile(events) {\n /** @type {Root} */\n let tree = {\n type: 'root',\n children: []\n }\n /** @type {Omit} */\n const context = {\n stack: [tree],\n tokenStack: [],\n config,\n enter,\n exit,\n buffer,\n resume,\n setData,\n getData\n }\n /** @type {Array} */\n const listStack = []\n let index = -1\n while (++index < events.length) {\n // We preprocess lists to add `listItem` tokens, and to infer whether\n // items the list itself are spread out.\n if (\n events[index][1].type === 'listOrdered' ||\n events[index][1].type === 'listUnordered'\n ) {\n if (events[index][0] === 'enter') {\n listStack.push(index)\n } else {\n const tail = listStack.pop()\n index = prepareList(events, tail, index)\n }\n }\n }\n index = -1\n while (++index < events.length) {\n const handler = config[events[index][0]]\n if (own.call(handler, events[index][1].type)) {\n handler[events[index][1].type].call(\n Object.assign(\n {\n sliceSerialize: events[index][2].sliceSerialize\n },\n context\n ),\n events[index][1]\n )\n }\n }\n\n // Handle tokens still being open.\n if (context.tokenStack.length > 0) {\n const tail = context.tokenStack[context.tokenStack.length - 1]\n const handler = tail[1] || defaultOnError\n handler.call(context, undefined, tail[0])\n }\n\n // Figure out `root` position.\n tree.position = {\n start: point(\n events.length > 0\n ? events[0][1].start\n : {\n line: 1,\n column: 1,\n offset: 0\n }\n ),\n end: point(\n events.length > 0\n ? events[events.length - 2][1].end\n : {\n line: 1,\n column: 1,\n offset: 0\n }\n )\n }\n\n // Call transforms.\n index = -1\n while (++index < config.transforms.length) {\n tree = config.transforms[index](tree) || tree\n }\n return tree\n }\n\n /**\n * @param {Array} events\n * @param {number} start\n * @param {number} length\n * @returns {number}\n */\n function prepareList(events, start, length) {\n let index = start - 1\n let containerBalance = -1\n let listSpread = false\n /** @type {Token | undefined} */\n let listItem\n /** @type {number | undefined} */\n let lineIndex\n /** @type {number | undefined} */\n let firstBlankLineIndex\n /** @type {boolean | undefined} */\n let atMarker\n while (++index <= length) {\n const event = events[index]\n if (\n event[1].type === 'listUnordered' ||\n event[1].type === 'listOrdered' ||\n event[1].type === 'blockQuote'\n ) {\n if (event[0] === 'enter') {\n containerBalance++\n } else {\n containerBalance--\n }\n atMarker = undefined\n } else if (event[1].type === 'lineEndingBlank') {\n if (event[0] === 'enter') {\n if (\n listItem &&\n !atMarker &&\n !containerBalance &&\n !firstBlankLineIndex\n ) {\n firstBlankLineIndex = index\n }\n atMarker = undefined\n }\n } else if (\n event[1].type === 'linePrefix' ||\n event[1].type === 'listItemValue' ||\n event[1].type === 'listItemMarker' ||\n event[1].type === 'listItemPrefix' ||\n event[1].type === 'listItemPrefixWhitespace'\n ) {\n // Empty.\n } else {\n atMarker = undefined\n }\n if (\n (!containerBalance &&\n event[0] === 'enter' &&\n event[1].type === 'listItemPrefix') ||\n (containerBalance === -1 &&\n event[0] === 'exit' &&\n (event[1].type === 'listUnordered' ||\n event[1].type === 'listOrdered'))\n ) {\n if (listItem) {\n let tailIndex = index\n lineIndex = undefined\n while (tailIndex--) {\n const tailEvent = events[tailIndex]\n if (\n tailEvent[1].type === 'lineEnding' ||\n tailEvent[1].type === 'lineEndingBlank'\n ) {\n if (tailEvent[0] === 'exit') continue\n if (lineIndex) {\n events[lineIndex][1].type = 'lineEndingBlank'\n listSpread = true\n }\n tailEvent[1].type = 'lineEnding'\n lineIndex = tailIndex\n } else if (\n tailEvent[1].type === 'linePrefix' ||\n tailEvent[1].type === 'blockQuotePrefix' ||\n tailEvent[1].type === 'blockQuotePrefixWhitespace' ||\n tailEvent[1].type === 'blockQuoteMarker' ||\n tailEvent[1].type === 'listItemIndent'\n ) {\n // Empty\n } else {\n break\n }\n }\n if (\n firstBlankLineIndex &&\n (!lineIndex || firstBlankLineIndex < lineIndex)\n ) {\n listItem._spread = true\n }\n\n // Fix position.\n listItem.end = Object.assign(\n {},\n lineIndex ? events[lineIndex][1].start : event[1].end\n )\n events.splice(lineIndex || index, 0, ['exit', listItem, event[2]])\n index++\n length++\n }\n\n // Create a new list item.\n if (event[1].type === 'listItemPrefix') {\n listItem = {\n type: 'listItem',\n _spread: false,\n start: Object.assign({}, event[1].start),\n // @ts-expect-error: we’ll add `end` in a second.\n end: undefined\n }\n // @ts-expect-error: `listItem` is most definitely defined, TS...\n events.splice(index, 0, ['enter', listItem, event[2]])\n index++\n length++\n firstBlankLineIndex = undefined\n atMarker = true\n }\n }\n }\n events[start][1]._spread = listSpread\n return length\n }\n\n /**\n * Set data.\n *\n * @template {keyof CompileData} Key\n * Field type.\n * @param {Key} key\n * Key of field.\n * @param {CompileData[Key]} [value]\n * New value.\n * @returns {void}\n * Nothing.\n */\n function setData(key, value) {\n data[key] = value\n }\n\n /**\n * Get data.\n *\n * @template {keyof CompileData} Key\n * Field type.\n * @param {Key} key\n * Key of field.\n * @returns {CompileData[Key]}\n * Value.\n */\n function getData(key) {\n return data[key]\n }\n\n /**\n * Create an opener handle.\n *\n * @param {(token: Token) => Node} create\n * Create a node.\n * @param {Handle} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function opener(create, and) {\n return open\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {void}\n */\n function open(token) {\n enter.call(this, create(token), token)\n if (and) and.call(this, token)\n }\n }\n\n /**\n * @this {CompileContext}\n * @returns {void}\n */\n function buffer() {\n this.stack.push({\n type: 'fragment',\n children: []\n })\n }\n\n /**\n * @template {Node} Kind\n * Node type.\n * @this {CompileContext}\n * Context.\n * @param {Kind} node\n * Node to enter.\n * @param {Token} token\n * Corresponding token.\n * @param {OnEnterError | undefined} [errorHandler]\n * Handle the case where this token is open, but it is closed by something else.\n * @returns {Kind}\n * The given node.\n */\n function enter(node, token, errorHandler) {\n const parent = this.stack[this.stack.length - 1]\n // @ts-expect-error: Assume `Node` can exist as a child of `parent`.\n parent.children.push(node)\n this.stack.push(node)\n this.tokenStack.push([token, errorHandler])\n // @ts-expect-error: `end` will be patched later.\n node.position = {\n start: point(token.start)\n }\n return node\n }\n\n /**\n * Create a closer handle.\n *\n * @param {Handle} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function closer(and) {\n return close\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {void}\n */\n function close(token) {\n if (and) and.call(this, token)\n exit.call(this, token)\n }\n }\n\n /**\n * @this {CompileContext}\n * Context.\n * @param {Token} token\n * Corresponding token.\n * @param {OnExitError | undefined} [onExitError]\n * Handle the case where another token is open.\n * @returns {Node}\n * The closed node.\n */\n function exit(token, onExitError) {\n const node = this.stack.pop()\n const open = this.tokenStack.pop()\n if (!open) {\n throw new Error(\n 'Cannot close `' +\n token.type +\n '` (' +\n stringifyPosition({\n start: token.start,\n end: token.end\n }) +\n '): it’s not open'\n )\n } else if (open[0].type !== token.type) {\n if (onExitError) {\n onExitError.call(this, token, open[0])\n } else {\n const handler = open[1] || defaultOnError\n handler.call(this, token, open[0])\n }\n }\n node.position.end = point(token.end)\n return node\n }\n\n /**\n * @this {CompileContext}\n * @returns {string}\n */\n function resume() {\n return toString(this.stack.pop())\n }\n\n //\n // Handlers.\n //\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistordered() {\n setData('expectingFirstListItemValue', true)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistitemvalue(token) {\n if (getData('expectingFirstListItemValue')) {\n const ancestor = this.stack[this.stack.length - 2]\n ancestor.start = Number.parseInt(this.sliceSerialize(token), 10)\n setData('expectingFirstListItemValue')\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfenceinfo() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.lang = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfencemeta() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.meta = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfence() {\n // Exit if this is the closing fence.\n if (getData('flowCodeInside')) return\n this.buffer()\n setData('flowCodeInside', true)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefenced() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data.replace(/^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g, '')\n setData('flowCodeInside')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodeindented() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data.replace(/(\\r?\\n|\\r)$/g, '')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitionlabelstring(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.label = label\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiontitlestring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.title = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiondestinationstring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.url = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitatxheadingsequence(token) {\n const node = this.stack[this.stack.length - 1]\n if (!node.depth) {\n const depth = this.sliceSerialize(token).length\n node.depth = depth\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadingtext() {\n setData('setextHeadingSlurpLineEnding', true)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadinglinesequence(token) {\n const node = this.stack[this.stack.length - 1]\n node.depth = this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheading() {\n setData('setextHeadingSlurpLineEnding')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterdata(token) {\n const node = this.stack[this.stack.length - 1]\n let tail = node.children[node.children.length - 1]\n if (!tail || tail.type !== 'text') {\n // Add a new text node.\n tail = text()\n // @ts-expect-error: we’ll add `end` later.\n tail.position = {\n start: point(token.start)\n }\n // @ts-expect-error: Assume `parent` accepts `text`.\n node.children.push(tail)\n }\n this.stack.push(tail)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitdata(token) {\n const tail = this.stack.pop()\n tail.value += this.sliceSerialize(token)\n tail.position.end = point(token.end)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlineending(token) {\n const context = this.stack[this.stack.length - 1]\n // If we’re at a hard break, include the line ending in there.\n if (getData('atHardBreak')) {\n const tail = context.children[context.children.length - 1]\n tail.position.end = point(token.end)\n setData('atHardBreak')\n return\n }\n if (\n !getData('setextHeadingSlurpLineEnding') &&\n config.canContainEols.includes(context.type)\n ) {\n onenterdata.call(this, token)\n onexitdata.call(this, token)\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithardbreak() {\n setData('atHardBreak', true)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmlflow() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmltext() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcodetext() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlink() {\n const node = this.stack[this.stack.length - 1]\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n // To do: clean.\n if (getData('inReference')) {\n /** @type {ReferenceType} */\n const referenceType = getData('referenceType') || 'shortcut'\n node.type += 'Reference'\n // @ts-expect-error: mutate.\n node.referenceType = referenceType\n // @ts-expect-error: mutate.\n delete node.url\n delete node.title\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier\n // @ts-expect-error: mutate.\n delete node.label\n }\n setData('referenceType')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitimage() {\n const node = this.stack[this.stack.length - 1]\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n // To do: clean.\n if (getData('inReference')) {\n /** @type {ReferenceType} */\n const referenceType = getData('referenceType') || 'shortcut'\n node.type += 'Reference'\n // @ts-expect-error: mutate.\n node.referenceType = referenceType\n // @ts-expect-error: mutate.\n delete node.url\n delete node.title\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier\n // @ts-expect-error: mutate.\n delete node.label\n }\n setData('referenceType')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabeltext(token) {\n const string = this.sliceSerialize(token)\n const ancestor = this.stack[this.stack.length - 2]\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n ancestor.label = decodeString(string)\n // @ts-expect-error: same as above.\n ancestor.identifier = normalizeIdentifier(string).toLowerCase()\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabel() {\n const fragment = this.stack[this.stack.length - 1]\n const value = this.resume()\n const node = this.stack[this.stack.length - 1]\n // Assume a reference.\n setData('inReference', true)\n if (node.type === 'link') {\n /** @type {Array} */\n // @ts-expect-error: Assume static phrasing content.\n const children = fragment.children\n node.children = children\n } else {\n node.alt = value\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcedestinationstring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.url = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcetitlestring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.title = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresource() {\n setData('inReference')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterreference() {\n setData('referenceType', 'collapsed')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitreferencestring(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n node.label = label\n // @ts-expect-error: same as above.\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n setData('referenceType', 'full')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcharacterreferencemarker(token) {\n setData('characterReferenceType', token.type)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreferencevalue(token) {\n const data = this.sliceSerialize(token)\n const type = getData('characterReferenceType')\n /** @type {string} */\n let value\n if (type) {\n value = decodeNumericCharacterReference(\n data,\n type === 'characterReferenceMarkerNumeric' ? 10 : 16\n )\n setData('characterReferenceType')\n } else {\n const result = decodeNamedCharacterReference(data)\n value = result\n }\n const tail = this.stack.pop()\n tail.value += value\n tail.position.end = point(token.end)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkprotocol(token) {\n onexitdata.call(this, token)\n const node = this.stack[this.stack.length - 1]\n node.url = this.sliceSerialize(token)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkemail(token) {\n onexitdata.call(this, token)\n const node = this.stack[this.stack.length - 1]\n node.url = 'mailto:' + this.sliceSerialize(token)\n }\n\n //\n // Creaters.\n //\n\n /** @returns {Blockquote} */\n function blockQuote() {\n return {\n type: 'blockquote',\n children: []\n }\n }\n\n /** @returns {Code} */\n function codeFlow() {\n return {\n type: 'code',\n lang: null,\n meta: null,\n value: ''\n }\n }\n\n /** @returns {InlineCode} */\n function codeText() {\n return {\n type: 'inlineCode',\n value: ''\n }\n }\n\n /** @returns {Definition} */\n function definition() {\n return {\n type: 'definition',\n identifier: '',\n label: null,\n title: null,\n url: ''\n }\n }\n\n /** @returns {Emphasis} */\n function emphasis() {\n return {\n type: 'emphasis',\n children: []\n }\n }\n\n /** @returns {Heading} */\n function heading() {\n // @ts-expect-error `depth` will be set later.\n return {\n type: 'heading',\n depth: undefined,\n children: []\n }\n }\n\n /** @returns {Break} */\n function hardBreak() {\n return {\n type: 'break'\n }\n }\n\n /** @returns {HTML} */\n function html() {\n return {\n type: 'html',\n value: ''\n }\n }\n\n /** @returns {Image} */\n function image() {\n return {\n type: 'image',\n title: null,\n url: '',\n alt: null\n }\n }\n\n /** @returns {Link} */\n function link() {\n return {\n type: 'link',\n title: null,\n url: '',\n children: []\n }\n }\n\n /**\n * @param {Token} token\n * @returns {List}\n */\n function list(token) {\n return {\n type: 'list',\n ordered: token.type === 'listOrdered',\n start: null,\n spread: token._spread,\n children: []\n }\n }\n\n /**\n * @param {Token} token\n * @returns {ListItem}\n */\n function listItem(token) {\n return {\n type: 'listItem',\n spread: token._spread,\n checked: null,\n children: []\n }\n }\n\n /** @returns {Paragraph} */\n function paragraph() {\n return {\n type: 'paragraph',\n children: []\n }\n }\n\n /** @returns {Strong} */\n function strong() {\n return {\n type: 'strong',\n children: []\n }\n }\n\n /** @returns {Text} */\n function text() {\n return {\n type: 'text',\n value: ''\n }\n }\n\n /** @returns {ThematicBreak} */\n function thematicBreak() {\n return {\n type: 'thematicBreak'\n }\n }\n}\n\n/**\n * Copy a point-like value.\n *\n * @param {Point} d\n * Point-like value.\n * @returns {Point}\n * unist point.\n */\nfunction point(d) {\n return {\n line: d.line,\n column: d.column,\n offset: d.offset\n }\n}\n\n/**\n * @param {Config} combined\n * @param {Array>} extensions\n * @returns {void}\n */\nfunction configure(combined, extensions) {\n let index = -1\n while (++index < extensions.length) {\n const value = extensions[index]\n if (Array.isArray(value)) {\n configure(combined, value)\n } else {\n extension(combined, value)\n }\n }\n}\n\n/**\n * @param {Config} combined\n * @param {Extension} extension\n * @returns {void}\n */\nfunction extension(combined, extension) {\n /** @type {keyof Extension} */\n let key\n for (key in extension) {\n if (own.call(extension, key)) {\n if (key === 'canContainEols') {\n const right = extension[key]\n if (right) {\n combined[key].push(...right)\n }\n } else if (key === 'transforms') {\n const right = extension[key]\n if (right) {\n combined[key].push(...right)\n }\n } else if (key === 'enter' || key === 'exit') {\n const right = extension[key]\n if (right) {\n Object.assign(combined[key], right)\n }\n }\n }\n }\n}\n\n/** @type {OnEnterError} */\nfunction defaultOnError(left, right) {\n if (left) {\n throw new Error(\n 'Cannot close `' +\n left.type +\n '` (' +\n stringifyPosition({\n start: left.start,\n end: left.end\n }) +\n '): a different token (`' +\n right.type +\n '`, ' +\n stringifyPosition({\n start: right.start,\n end: right.end\n }) +\n ') is open'\n )\n } else {\n throw new Error(\n 'Cannot close document, a token (`' +\n right.type +\n '`, ' +\n stringifyPosition({\n start: right.start,\n end: right.end\n }) +\n ') is still open'\n )\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n */\n\nimport {subtokenize} from 'micromark-util-subtokenize'\n\n/**\n * @param {Array} events\n * @returns {Array}\n */\nexport function postprocess(events) {\n while (!subtokenize(events)) {\n // Empty\n }\n return events\n}\n","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast-util-from-markdown').Options} Options\n */\n\nimport {fromMarkdown} from 'mdast-util-from-markdown'\n\n/**\n * @this {import('unified').Processor}\n * @type {import('unified').Plugin<[Options?] | void[], string, Root>}\n */\nexport default function remarkParse(options) {\n /** @type {import('unified').ParserFunction} */\n const parser = (doc) => {\n // Assume options.\n const settings = /** @type {Options} */ (this.data('settings'))\n\n return fromMarkdown(\n doc,\n Object.assign({}, settings, options, {\n // Note: these options are not in the readme.\n // The goal is for them to be set by plugins on `data` instead of being\n // passed by users.\n extensions: this.data('micromarkExtensions') || [],\n mdastExtensions: this.data('fromMarkdownExtensions') || []\n })\n )\n }\n\n Object.assign(this, {Parser: parser})\n}\n","import {asciiAlphanumeric} from 'micromark-util-character'\nimport {encode} from 'micromark-util-encode'\n/**\n * Make a value safe for injection as a URL.\n *\n * This encodes unsafe characters with percent-encoding and skips already\n * encoded sequences (see `normalizeUri`).\n * Further unsafe characters are encoded as character references (see\n * `micromark-util-encode`).\n *\n * A regex of allowed protocols can be given, in which case the URL is\n * sanitized.\n * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or\n * `/^https?$/i` for `img[src]` (this is what `github.com` allows).\n * If the URL includes an unknown protocol (one not matched by `protocol`, such\n * as a dangerous example, `javascript:`), the value is ignored.\n *\n * @param {string | undefined} url\n * URI to sanitize.\n * @param {RegExp | null | undefined} [protocol]\n * Allowed protocols.\n * @returns {string}\n * Sanitized URI.\n */\nexport function sanitizeUri(url, protocol) {\n const value = encode(normalizeUri(url || ''))\n if (!protocol) {\n return value\n }\n const colon = value.indexOf(':')\n const questionMark = value.indexOf('?')\n const numberSign = value.indexOf('#')\n const slash = value.indexOf('/')\n if (\n // If there is no protocol, it’s relative.\n colon < 0 ||\n // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.\n (slash > -1 && colon > slash) ||\n (questionMark > -1 && colon > questionMark) ||\n (numberSign > -1 && colon > numberSign) ||\n // It is a protocol, it should be allowed.\n protocol.test(value.slice(0, colon))\n ) {\n return value\n }\n return ''\n}\n\n/**\n * Normalize a URL.\n *\n * Encode unsafe characters with percent-encoding, skipping already encoded\n * sequences.\n *\n * @param {string} value\n * URI to normalize.\n * @returns {string}\n * Normalized URI.\n */\nexport function normalizeUri(value) {\n /** @type {Array} */\n const result = []\n let index = -1\n let start = 0\n let skip = 0\n while (++index < value.length) {\n const code = value.charCodeAt(index)\n /** @type {string} */\n let replace = ''\n\n // A correct percent encoded value.\n if (\n code === 37 &&\n asciiAlphanumeric(value.charCodeAt(index + 1)) &&\n asciiAlphanumeric(value.charCodeAt(index + 2))\n ) {\n skip = 2\n }\n // ASCII.\n else if (code < 128) {\n if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {\n replace = String.fromCharCode(code)\n }\n }\n // Astral.\n else if (code > 55295 && code < 57344) {\n const next = value.charCodeAt(index + 1)\n\n // A correct surrogate pair.\n if (code < 56320 && next > 56319 && next < 57344) {\n replace = String.fromCharCode(code, next)\n skip = 1\n }\n // Lone surrogate.\n else {\n replace = '\\uFFFD'\n }\n }\n // Unicode.\n else {\n replace = String.fromCharCode(code)\n }\n if (replace) {\n result.push(value.slice(start, index), encodeURIComponent(replace))\n start = index + skip + 1\n replace = ''\n }\n if (skip) {\n index += skip\n skip = 0\n }\n }\n return result.join('') + value.slice(start)\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n */\n\n/**\n * @typedef {Record} Props\n * @typedef {null | undefined | string | Props | TestFunctionAnything | Array} Test\n * Check for an arbitrary node, unaware of TypeScript inferral.\n *\n * @callback TestFunctionAnything\n * Check if a node passes a test, unaware of TypeScript inferral.\n * @param {unknown} this\n * The given context.\n * @param {Node} node\n * A node.\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {boolean | void}\n * Whether this node passes the test.\n */\n\n/**\n * @template {Node} Kind\n * Node type.\n * @typedef {Kind['type'] | Partial | TestFunctionPredicate | Array | TestFunctionPredicate>} PredicateTest\n * Check for a node that can be inferred by TypeScript.\n */\n\n/**\n * Check if a node passes a certain test.\n *\n * @template {Node} Kind\n * Node type.\n * @callback TestFunctionPredicate\n * Complex test function for a node that can be inferred by TypeScript.\n * @param {Node} node\n * A node.\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {node is Kind}\n * Whether this node passes the test.\n */\n\n/**\n * @callback AssertAnything\n * Check that an arbitrary value is a node, unaware of TypeScript inferral.\n * @param {unknown} [node]\n * Anything (typically a node).\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {boolean}\n * Whether this is a node and passes a test.\n */\n\n/**\n * Check if a node is a node and passes a certain node test.\n *\n * @template {Node} Kind\n * Node type.\n * @callback AssertPredicate\n * Check that an arbitrary value is a specific node, aware of TypeScript.\n * @param {unknown} [node]\n * Anything (typically a node).\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {node is Kind}\n * Whether this is a node and passes a test.\n */\n\n/**\n * Check if `node` is a `Node` and whether it passes the given test.\n *\n * @param node\n * Thing to check, typically `Node`.\n * @param test\n * A check for a specific node.\n * @param index\n * The node’s position in its parent.\n * @param parent\n * The node’s parent.\n * @returns\n * Whether `node` is a node and passes a test.\n */\nexport const is =\n /**\n * @type {(\n * (() => false) &\n * ((node: unknown, test: PredicateTest, index: number, parent: Parent, context?: unknown) => node is Kind) &\n * ((node: unknown, test: PredicateTest, index?: null | undefined, parent?: null | undefined, context?: unknown) => node is Kind) &\n * ((node: unknown, test: Test, index: number, parent: Parent, context?: unknown) => boolean) &\n * ((node: unknown, test?: Test, index?: null | undefined, parent?: null | undefined, context?: unknown) => boolean)\n * )}\n */\n (\n /**\n * @param {unknown} [node]\n * @param {Test} [test]\n * @param {number | null | undefined} [index]\n * @param {Parent | null | undefined} [parent]\n * @param {unknown} [context]\n * @returns {boolean}\n */\n // eslint-disable-next-line max-params\n function is(node, test, index, parent, context) {\n const check = convert(test)\n\n if (\n index !== undefined &&\n index !== null &&\n (typeof index !== 'number' ||\n index < 0 ||\n index === Number.POSITIVE_INFINITY)\n ) {\n throw new Error('Expected positive finite index')\n }\n\n if (\n parent !== undefined &&\n parent !== null &&\n (!is(parent) || !parent.children)\n ) {\n throw new Error('Expected parent node')\n }\n\n if (\n (parent === undefined || parent === null) !==\n (index === undefined || index === null)\n ) {\n throw new Error('Expected both parent and index')\n }\n\n // @ts-expect-error Looks like a node.\n return node && node.type && typeof node.type === 'string'\n ? Boolean(check.call(context, node, index, parent))\n : false\n }\n )\n\n/**\n * Generate an assertion from a test.\n *\n * Useful if you’re going to test many nodes, for example when creating a\n * utility where something else passes a compatible test.\n *\n * The created function is a bit faster because it expects valid input only:\n * a `node`, `index`, and `parent`.\n *\n * @param test\n * * when nullish, checks if `node` is a `Node`.\n * * when `string`, works like passing `(node) => node.type === test`.\n * * when `function` checks if function passed the node is true.\n * * when `object`, checks that all keys in test are in node, and that they have (strictly) equal values.\n * * when `array`, checks if any one of the subtests pass.\n * @returns\n * An assertion.\n */\nexport const convert =\n /**\n * @type {(\n * ((test: PredicateTest) => AssertPredicate) &\n * ((test?: Test) => AssertAnything)\n * )}\n */\n (\n /**\n * @param {Test} [test]\n * @returns {AssertAnything}\n */\n function (test) {\n if (test === undefined || test === null) {\n return ok\n }\n\n if (typeof test === 'string') {\n return typeFactory(test)\n }\n\n if (typeof test === 'object') {\n return Array.isArray(test) ? anyFactory(test) : propsFactory(test)\n }\n\n if (typeof test === 'function') {\n return castFactory(test)\n }\n\n throw new Error('Expected function, string, or object as test')\n }\n )\n\n/**\n * @param {Array} tests\n * @returns {AssertAnything}\n */\nfunction anyFactory(tests) {\n /** @type {Array} */\n const checks = []\n let index = -1\n\n while (++index < tests.length) {\n checks[index] = convert(tests[index])\n }\n\n return castFactory(any)\n\n /**\n * @this {unknown}\n * @param {Array} parameters\n * @returns {boolean}\n */\n function any(...parameters) {\n let index = -1\n\n while (++index < checks.length) {\n if (checks[index].call(this, ...parameters)) return true\n }\n\n return false\n }\n}\n\n/**\n * Turn an object into a test for a node with a certain fields.\n *\n * @param {Props} check\n * @returns {AssertAnything}\n */\nfunction propsFactory(check) {\n return castFactory(all)\n\n /**\n * @param {Node} node\n * @returns {boolean}\n */\n function all(node) {\n /** @type {string} */\n let key\n\n for (key in check) {\n // @ts-expect-error: hush, it sure works as an index.\n if (node[key] !== check[key]) return false\n }\n\n return true\n }\n}\n\n/**\n * Turn a string into a test for a node with a certain type.\n *\n * @param {string} check\n * @returns {AssertAnything}\n */\nfunction typeFactory(check) {\n return castFactory(type)\n\n /**\n * @param {Node} node\n */\n function type(node) {\n return node && node.type === check\n }\n}\n\n/**\n * Turn a custom test into a test for a node that passes that test.\n *\n * @param {TestFunctionAnything} check\n * @returns {AssertAnything}\n */\nfunction castFactory(check) {\n return assertion\n\n /**\n * @this {unknown}\n * @param {unknown} node\n * @param {Array} parameters\n * @returns {boolean}\n */\n function assertion(node, ...parameters) {\n return Boolean(\n node &&\n typeof node === 'object' &&\n 'type' in node &&\n // @ts-expect-error: fine.\n Boolean(check.call(this, node, ...parameters))\n )\n }\n}\n\nfunction ok() {\n return true\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist-util-is').Test} Test\n */\n\n/**\n * @typedef {boolean | 'skip'} Action\n * Union of the action types.\n *\n * @typedef {number} Index\n * Move to the sibling at `index` next (after node itself is completely\n * traversed).\n *\n * Useful if mutating the tree, such as removing the node the visitor is\n * currently on, or any of its previous siblings.\n * Results less than 0 or greater than or equal to `children.length` stop\n * traversing the parent.\n *\n * @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple\n * List with one or two values, the first an action, the second an index.\n *\n * @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult\n * Any value that can be returned from a visitor.\n */\n\n/**\n * @template {Node} [Visited=Node]\n * Visited node type.\n * @template {Parent} [Ancestor=Parent]\n * Ancestor type.\n * @callback Visitor\n * Handle a node (matching `test`, if given).\n *\n * Visitors are free to transform `node`.\n * They can also transform the parent of node (the last of `ancestors`).\n *\n * Replacing `node` itself, if `SKIP` is not returned, still causes its\n * descendants to be walked (which is a bug).\n *\n * When adding or removing previous siblings of `node` (or next siblings, in\n * case of reverse), the `Visitor` should return a new `Index` to specify the\n * sibling to traverse after `node` is traversed.\n * Adding or removing next siblings of `node` (or previous siblings, in case\n * of reverse) is handled as expected without needing to return a new `Index`.\n *\n * Removing the children property of an ancestor still results in them being\n * traversed.\n * @param {Visited} node\n * Found node.\n * @param {Array} ancestors\n * Ancestors of `node`.\n * @returns {VisitorResult}\n * What to do next.\n *\n * An `Index` is treated as a tuple of `[CONTINUE, Index]`.\n * An `Action` is treated as a tuple of `[Action]`.\n *\n * Passing a tuple back only makes sense if the `Action` is `SKIP`.\n * When the `Action` is `EXIT`, that action can be returned.\n * When the `Action` is `CONTINUE`, `Index` can be returned.\n */\n\n/**\n * @template {Node} [Tree=Node]\n * Tree type.\n * @template {Test} [Check=string]\n * Test type.\n * @typedef {Visitor, Check>, Extract, Parent>>} BuildVisitor\n * Build a typed `Visitor` function from a tree and a test.\n *\n * It will infer which values are passed as `node` and which as `parents`.\n */\n\nimport {convert} from 'unist-util-is'\nimport {color} from './color.js'\n\n/**\n * Continue traversing as normal.\n */\nexport const CONTINUE = true\n\n/**\n * Stop traversing immediately.\n */\nexport const EXIT = false\n\n/**\n * Do not traverse this node’s children.\n */\nexport const SKIP = 'skip'\n\n/**\n * Visit nodes, with ancestral information.\n *\n * This algorithm performs *depth-first* *tree traversal* in *preorder*\n * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).\n *\n * You can choose for which nodes `visitor` is called by passing a `test`.\n * For complex tests, you should test yourself in `visitor`, as it will be\n * faster and will have improved type information.\n *\n * Walking the tree is an intensive task.\n * Make use of the return values of the visitor when possible.\n * Instead of walking a tree multiple times, walk it once, use `unist-util-is`\n * to check if a node matches, and then perform different operations.\n *\n * You can change the tree.\n * See `Visitor` for more info.\n *\n * @param tree\n * Tree to traverse.\n * @param test\n * `unist-util-is`-compatible test\n * @param visitor\n * Handle each node.\n * @param reverse\n * Traverse in reverse preorder (NRL) instead of the default preorder (NLR).\n * @returns\n * Nothing.\n */\nexport const visitParents =\n /**\n * @type {(\n * ((tree: Tree, test: Check, visitor: BuildVisitor, reverse?: boolean | null | undefined) => void) &\n * ((tree: Tree, visitor: BuildVisitor, reverse?: boolean | null | undefined) => void)\n * )}\n */\n (\n /**\n * @param {Node} tree\n * @param {Test} test\n * @param {Visitor} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {void}\n */\n function (tree, test, visitor, reverse) {\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor\n // @ts-expect-error no visitor given, so `visitor` is test.\n visitor = test\n test = null\n }\n\n const is = convert(test)\n const step = reverse ? -1 : 1\n\n factory(tree, undefined, [])()\n\n /**\n * @param {Node} node\n * @param {number | undefined} index\n * @param {Array} parents\n */\n function factory(node, index, parents) {\n /** @type {Record} */\n // @ts-expect-error: hush\n const value = node && typeof node === 'object' ? node : {}\n\n if (typeof value.type === 'string') {\n const name =\n // `hast`\n typeof value.tagName === 'string'\n ? value.tagName\n : // `xast`\n typeof value.name === 'string'\n ? value.name\n : undefined\n\n Object.defineProperty(visit, 'name', {\n value:\n 'node (' + color(node.type + (name ? '<' + name + '>' : '')) + ')'\n })\n }\n\n return visit\n\n function visit() {\n /** @type {ActionTuple} */\n let result = []\n /** @type {ActionTuple} */\n let subresult\n /** @type {number} */\n let offset\n /** @type {Array} */\n let grandparents\n\n if (!test || is(node, index, parents[parents.length - 1] || null)) {\n result = toResult(visitor(node, parents))\n\n if (result[0] === EXIT) {\n return result\n }\n }\n\n // @ts-expect-error looks like a parent.\n if (node.children && result[0] !== SKIP) {\n // @ts-expect-error looks like a parent.\n offset = (reverse ? node.children.length : -1) + step\n // @ts-expect-error looks like a parent.\n grandparents = parents.concat(node)\n\n // @ts-expect-error looks like a parent.\n while (offset > -1 && offset < node.children.length) {\n // @ts-expect-error looks like a parent.\n subresult = factory(node.children[offset], offset, grandparents)()\n\n if (subresult[0] === EXIT) {\n return subresult\n }\n\n offset =\n typeof subresult[1] === 'number' ? subresult[1] : offset + step\n }\n }\n\n return result\n }\n }\n }\n )\n\n/**\n * Turn a return value into a clean result.\n *\n * @param {VisitorResult} value\n * Valid return values from visitors.\n * @returns {ActionTuple}\n * Clean result.\n */\nfunction toResult(value) {\n if (Array.isArray(value)) {\n return value\n }\n\n if (typeof value === 'number') {\n return [CONTINUE, value]\n }\n\n return [value]\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n * @typedef {import('unist-util-is').Test} Test\n * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult\n */\n\n/**\n * Check if `Child` can be a child of `Ancestor`.\n *\n * Returns the ancestor when `Child` can be a child of `Ancestor`, or returns\n * `never`.\n *\n * @template {Node} Ancestor\n * Node type.\n * @template {Node} Child\n * Node type.\n * @typedef {(\n * Ancestor extends Parent\n * ? Child extends Ancestor['children'][number]\n * ? Ancestor\n * : never\n * : never\n * )} ParentsOf\n */\n\n/**\n * @template {Node} [Visited=Node]\n * Visited node type.\n * @template {Parent} [Ancestor=Parent]\n * Ancestor type.\n * @callback Visitor\n * Handle a node (matching `test`, if given).\n *\n * Visitors are free to transform `node`.\n * They can also transform `parent`.\n *\n * Replacing `node` itself, if `SKIP` is not returned, still causes its\n * descendants to be walked (which is a bug).\n *\n * When adding or removing previous siblings of `node` (or next siblings, in\n * case of reverse), the `Visitor` should return a new `Index` to specify the\n * sibling to traverse after `node` is traversed.\n * Adding or removing next siblings of `node` (or previous siblings, in case\n * of reverse) is handled as expected without needing to return a new `Index`.\n *\n * Removing the children property of `parent` still results in them being\n * traversed.\n * @param {Visited} node\n * Found node.\n * @param {Visited extends Node ? number | null : never} index\n * Index of `node` in `parent`.\n * @param {Ancestor extends Node ? Ancestor | null : never} parent\n * Parent of `node`.\n * @returns {VisitorResult}\n * What to do next.\n *\n * An `Index` is treated as a tuple of `[CONTINUE, Index]`.\n * An `Action` is treated as a tuple of `[Action]`.\n *\n * Passing a tuple back only makes sense if the `Action` is `SKIP`.\n * When the `Action` is `EXIT`, that action can be returned.\n * When the `Action` is `CONTINUE`, `Index` can be returned.\n */\n\n/**\n * Build a typed `Visitor` function from a node and all possible parents.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n *\n * @template {Node} Visited\n * Node type.\n * @template {Parent} Ancestor\n * Parent type.\n * @typedef {Visitor>} BuildVisitorFromMatch\n */\n\n/**\n * Build a typed `Visitor` function from a list of descendants and a test.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n *\n * @template {Node} Descendant\n * Node type.\n * @template {Test} Check\n * Test type.\n * @typedef {(\n * BuildVisitorFromMatch<\n * import('unist-util-visit-parents/complex-types.js').Matches,\n * Extract\n * >\n * )} BuildVisitorFromDescendants\n */\n\n/**\n * Build a typed `Visitor` function from a tree and a test.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n *\n * @template {Node} [Tree=Node]\n * Node type.\n * @template {Test} [Check=string]\n * Test type.\n * @typedef {(\n * BuildVisitorFromDescendants<\n * import('unist-util-visit-parents/complex-types.js').InclusiveDescendant,\n * Check\n * >\n * )} BuildVisitor\n */\n\nimport {visitParents} from 'unist-util-visit-parents'\n\n/**\n * Visit nodes.\n *\n * This algorithm performs *depth-first* *tree traversal* in *preorder*\n * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).\n *\n * You can choose for which nodes `visitor` is called by passing a `test`.\n * For complex tests, you should test yourself in `visitor`, as it will be\n * faster and will have improved type information.\n *\n * Walking the tree is an intensive task.\n * Make use of the return values of the visitor when possible.\n * Instead of walking a tree multiple times, walk it once, use `unist-util-is`\n * to check if a node matches, and then perform different operations.\n *\n * You can change the tree.\n * See `Visitor` for more info.\n *\n * @param tree\n * Tree to traverse.\n * @param test\n * `unist-util-is`-compatible test\n * @param visitor\n * Handle each node.\n * @param reverse\n * Traverse in reverse preorder (NRL) instead of the default preorder (NLR).\n * @returns\n * Nothing.\n */\nexport const visit =\n /**\n * @type {(\n * ((tree: Tree, test: Check, visitor: BuildVisitor, reverse?: boolean | null | undefined) => void) &\n * ((tree: Tree, visitor: BuildVisitor, reverse?: boolean | null | undefined) => void)\n * )}\n */\n (\n /**\n * @param {Node} tree\n * @param {Test} test\n * @param {Visitor} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {void}\n */\n function (tree, test, visitor, reverse) {\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor\n visitor = test\n test = null\n }\n\n visitParents(tree, test, overload, reverse)\n\n /**\n * @param {Node} node\n * @param {Array} parents\n */\n function overload(node, parents) {\n const parent = parents[parents.length - 1]\n return visitor(\n node,\n parent ? parent.children.indexOf(node) : null,\n parent\n )\n }\n }\n )\n\nexport {CONTINUE, EXIT, SKIP} from 'unist-util-visit-parents'\n","/**\n * @typedef {import('unist').Position} Position\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n */\n\n/**\n * @typedef NodeLike\n * @property {string} type\n * @property {PositionLike | null | undefined} [position]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n *\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n */\n\n/**\n * Get the starting point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointStart = point('start')\n\n/**\n * Get the ending point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointEnd = point('end')\n\n/**\n * Get the positional info of `node`.\n *\n * @param {NodeLike | Node | null | undefined} [node]\n * Node.\n * @returns {Position}\n * Position.\n */\nexport function position(node) {\n return {start: pointStart(node), end: pointEnd(node)}\n}\n\n/**\n * Get the positional info of `node`.\n *\n * @param {'start' | 'end'} type\n * Side.\n * @returns\n * Getter.\n */\nfunction point(type) {\n return point\n\n /**\n * Get the point info of `node` at a bound side.\n *\n * @param {NodeLike | Node | null | undefined} [node]\n * @returns {Point}\n */\n function point(node) {\n const point = (node && node.position && node.position[type]) || {}\n\n // To do: next major: don’t return points when invalid.\n return {\n // @ts-expect-error: in practice, null is allowed.\n line: point.line || null,\n // @ts-expect-error: in practice, null is allowed.\n column: point.column || null,\n // @ts-expect-error: in practice, null is allowed.\n offset: point.offset > -1 ? point.offset : null\n }\n }\n}\n","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Definition} Definition\n */\n\n/**\n * @typedef {Root | Content} Node\n *\n * @callback GetDefinition\n * Get a definition by identifier.\n * @param {string | null | undefined} [identifier]\n * Identifier of definition.\n * @returns {Definition | null}\n * Definition corresponding to `identifier` or `null`.\n */\n\nimport {visit} from 'unist-util-visit'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Find definitions in `tree`.\n *\n * Uses CommonMark precedence, which means that earlier definitions are\n * preferred over duplicate later definitions.\n *\n * @param {Node} tree\n * Tree to check.\n * @returns {GetDefinition}\n * Getter.\n */\nexport function definitions(tree) {\n /** @type {Record} */\n const cache = Object.create(null)\n\n if (!tree || !tree.type) {\n throw new Error('mdast-util-definitions expected node')\n }\n\n visit(tree, 'definition', (definition) => {\n const id = clean(definition.identifier)\n if (id && !own.call(cache, id)) {\n cache[id] = definition\n }\n })\n\n return definition\n\n /** @type {GetDefinition} */\n function definition(identifier) {\n const id = clean(identifier)\n // To do: next major: return `undefined` when not found.\n return id && own.call(cache, id) ? cache[id] : null\n }\n}\n\n/**\n * @param {string | null | undefined} [value]\n * @returns {string}\n */\nfunction clean(value) {\n return String(value || '').toUpperCase()\n}\n","/**\n * @typedef {import('mdast').FootnoteReference} FootnoteReference\n * @typedef {import('hast').Element} Element\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `footnoteReference` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {FootnoteReference} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function footnoteReference(state, node) {\n const id = String(node.identifier).toUpperCase()\n const safeId = normalizeUri(id.toLowerCase())\n const index = state.footnoteOrder.indexOf(id)\n /** @type {number} */\n let counter\n\n if (index === -1) {\n state.footnoteOrder.push(id)\n state.footnoteCounts[id] = 1\n counter = state.footnoteOrder.length\n } else {\n state.footnoteCounts[id]++\n counter = index + 1\n }\n\n const reuseCounter = state.footnoteCounts[id]\n\n /** @type {Element} */\n const link = {\n type: 'element',\n tagName: 'a',\n properties: {\n href: '#' + state.clobberPrefix + 'fn-' + safeId,\n id:\n state.clobberPrefix +\n 'fnref-' +\n safeId +\n (reuseCounter > 1 ? '-' + reuseCounter : ''),\n dataFootnoteRef: true,\n ariaDescribedBy: ['footnote-label']\n },\n children: [{type: 'text', value: String(counter)}]\n }\n state.patch(node, link)\n\n /** @type {Element} */\n const sup = {\n type: 'element',\n tagName: 'sup',\n properties: {},\n children: [link]\n }\n state.patch(node, sup)\n return state.applyData(node, sup)\n}\n","/**\n * @typedef {import('hast').ElementContent} ElementContent\n *\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Reference} Reference\n * @typedef {import('mdast').Root} Root\n *\n * @typedef {import('./state.js').State} State\n */\n\n/**\n * @typedef {Root | Content} Nodes\n * @typedef {Extract} References\n */\n\n// To do: next major: always return array.\n\n/**\n * Return the content of a reference without definition as plain text.\n *\n * @param {State} state\n * Info passed around.\n * @param {References} node\n * Reference node (image, link).\n * @returns {ElementContent | Array}\n * hast content.\n */\nexport function revert(state, node) {\n const subtype = node.referenceType\n let suffix = ']'\n\n if (subtype === 'collapsed') {\n suffix += '[]'\n } else if (subtype === 'full') {\n suffix += '[' + (node.label || node.identifier) + ']'\n }\n\n if (node.type === 'imageReference') {\n return {type: 'text', value: '![' + node.alt + suffix}\n }\n\n const contents = state.all(node)\n const head = contents[0]\n\n if (head && head.type === 'text') {\n head.value = '[' + head.value\n } else {\n contents.unshift({type: 'text', value: '['})\n }\n\n const tail = contents[contents.length - 1]\n\n if (tail && tail.type === 'text') {\n tail.value += suffix\n } else {\n contents.push({type: 'text', value: suffix})\n }\n\n return contents\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Parent} Parent\n * @typedef {import('mdast').Root} Root\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * @typedef {Root | Content} Nodes\n * @typedef {Extract} Parents\n */\n\n/**\n * Turn an mdast `listItem` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {ListItem} node\n * mdast node.\n * @param {Parents | null | undefined} parent\n * Parent of `node`.\n * @returns {Element}\n * hast node.\n */\nexport function listItem(state, node, parent) {\n const results = state.all(node)\n const loose = parent ? listLoose(parent) : listItemLoose(node)\n /** @type {Properties} */\n const properties = {}\n /** @type {Array} */\n const children = []\n\n if (typeof node.checked === 'boolean') {\n const head = results[0]\n /** @type {Element} */\n let paragraph\n\n if (head && head.type === 'element' && head.tagName === 'p') {\n paragraph = head\n } else {\n paragraph = {type: 'element', tagName: 'p', properties: {}, children: []}\n results.unshift(paragraph)\n }\n\n if (paragraph.children.length > 0) {\n paragraph.children.unshift({type: 'text', value: ' '})\n }\n\n paragraph.children.unshift({\n type: 'element',\n tagName: 'input',\n properties: {type: 'checkbox', checked: node.checked, disabled: true},\n children: []\n })\n\n // According to github-markdown-css, this class hides bullet.\n // See: .\n properties.className = ['task-list-item']\n }\n\n let index = -1\n\n while (++index < results.length) {\n const child = results[index]\n\n // Add eols before nodes, except if this is a loose, first paragraph.\n if (\n loose ||\n index !== 0 ||\n child.type !== 'element' ||\n child.tagName !== 'p'\n ) {\n children.push({type: 'text', value: '\\n'})\n }\n\n if (child.type === 'element' && child.tagName === 'p' && !loose) {\n children.push(...child.children)\n } else {\n children.push(child)\n }\n }\n\n const tail = results[results.length - 1]\n\n // Add a final eol.\n if (tail && (loose || tail.type !== 'element' || tail.tagName !== 'p')) {\n children.push({type: 'text', value: '\\n'})\n }\n\n /** @type {Element} */\n const result = {type: 'element', tagName: 'li', properties, children}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n\n/**\n * @param {Parents} node\n * @return {Boolean}\n */\nfunction listLoose(node) {\n let loose = false\n if (node.type === 'list') {\n loose = node.spread || false\n const children = node.children\n let index = -1\n\n while (!loose && ++index < children.length) {\n loose = listItemLoose(children[index])\n }\n }\n\n return loose\n}\n\n/**\n * @param {ListItem} node\n * @return {Boolean}\n */\nfunction listItemLoose(node) {\n const spread = node.spread\n\n return spread === undefined || spread === null\n ? node.children.length > 1\n : spread\n}\n","const tab = 9 /* `\\t` */\nconst space = 32 /* ` ` */\n\n/**\n * Remove initial and final spaces and tabs at the line breaks in `value`.\n * Does not trim initial and final spaces and tabs of the value itself.\n *\n * @param {string} value\n * Value to trim.\n * @returns {string}\n * Trimmed value.\n */\nexport function trimLines(value) {\n const source = String(value)\n const search = /\\r?\\n|\\r/g\n let match = search.exec(source)\n let last = 0\n /** @type {Array} */\n const lines = []\n\n while (match) {\n lines.push(\n trimLine(source.slice(last, match.index), last > 0, true),\n match[0]\n )\n\n last = match.index + match[0].length\n match = search.exec(source)\n }\n\n lines.push(trimLine(source.slice(last), last > 0, false))\n\n return lines.join('')\n}\n\n/**\n * @param {string} value\n * Line to trim.\n * @param {boolean} start\n * Whether to trim the start of the line.\n * @param {boolean} end\n * Whether to trim the end of the line.\n * @returns {string}\n * Trimmed line.\n */\nfunction trimLine(value, start, end) {\n let startIndex = 0\n let endIndex = value.length\n\n if (start) {\n let code = value.codePointAt(startIndex)\n\n while (code === tab || code === space) {\n startIndex++\n code = value.codePointAt(startIndex)\n }\n }\n\n if (end) {\n let code = value.codePointAt(endIndex - 1)\n\n while (code === tab || code === space) {\n endIndex--\n code = value.codePointAt(endIndex - 1)\n }\n }\n\n return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''\n}\n","import {blockquote} from './blockquote.js'\nimport {hardBreak} from './break.js'\nimport {code} from './code.js'\nimport {strikethrough} from './delete.js'\nimport {emphasis} from './emphasis.js'\nimport {footnoteReference} from './footnote-reference.js'\nimport {footnote} from './footnote.js'\nimport {heading} from './heading.js'\nimport {html} from './html.js'\nimport {imageReference} from './image-reference.js'\nimport {image} from './image.js'\nimport {inlineCode} from './inline-code.js'\nimport {linkReference} from './link-reference.js'\nimport {link} from './link.js'\nimport {listItem} from './list-item.js'\nimport {list} from './list.js'\nimport {paragraph} from './paragraph.js'\nimport {root} from './root.js'\nimport {strong} from './strong.js'\nimport {table} from './table.js'\nimport {tableRow} from './table-row.js'\nimport {tableCell} from './table-cell.js'\nimport {text} from './text.js'\nimport {thematicBreak} from './thematic-break.js'\n\n/**\n * Default handlers for nodes.\n */\nexport const handlers = {\n blockquote,\n break: hardBreak,\n code,\n delete: strikethrough,\n emphasis,\n footnoteReference,\n footnote,\n heading,\n html,\n imageReference,\n image,\n inlineCode,\n linkReference,\n link,\n listItem,\n list,\n paragraph,\n root,\n strong,\n table,\n tableCell,\n tableRow,\n text,\n thematicBreak,\n toml: ignore,\n yaml: ignore,\n definition: ignore,\n footnoteDefinition: ignore\n}\n\n// Return nothing for nodes that are ignored.\nfunction ignore() {\n // To do: next major: return `undefined`.\n return null\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Blockquote} Blockquote\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `blockquote` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Blockquote} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function blockquote(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'blockquote',\n properties: {},\n children: state.wrap(state.all(node), true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('mdast').Break} Break\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `break` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Break} node\n * mdast node.\n * @returns {Array}\n * hast element content.\n */\nexport function hardBreak(state, node) {\n /** @type {Element} */\n const result = {type: 'element', tagName: 'br', properties: {}, children: []}\n state.patch(node, result)\n return [state.applyData(node, result), {type: 'text', value: '\\n'}]\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Code} Code\n * @typedef {import('../state.js').State} State\n\n */\n\n/**\n * Turn an mdast `code` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Code} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function code(state, node) {\n const value = node.value ? node.value + '\\n' : ''\n // To do: next major, use `node.lang` w/o regex, the splitting’s been going\n // on for years in remark now.\n const lang = node.lang ? node.lang.match(/^[^ \\t]+(?=[ \\t]|$)/) : null\n /** @type {Properties} */\n const properties = {}\n\n if (lang) {\n properties.className = ['language-' + lang]\n }\n\n // Create ``.\n /** @type {Element} */\n let result = {\n type: 'element',\n tagName: 'code',\n properties,\n children: [{type: 'text', value}]\n }\n\n if (node.meta) {\n result.data = {meta: node.meta}\n }\n\n state.patch(node, result)\n result = state.applyData(node, result)\n\n // Create `
`.\n  result = {type: 'element', tagName: 'pre', properties: {}, children: [result]}\n  state.patch(node, result)\n  return result\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Delete} Delete\n * @typedef {import('../state.js').State} State\n\n */\n\n/**\n * Turn an mdast `delete` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Delete} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strikethrough(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'del',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Emphasis} Emphasis\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `emphasis` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Emphasis} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function emphasis(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'em',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Footnote} Footnote\n * @typedef {import('../state.js').State} State\n */\n\nimport {footnoteReference} from './footnote-reference.js'\n\n// To do: when both:\n// * \n// * \n// …are archived, remove this (also from mdast).\n// These inline notes are not used in GFM.\n\n/**\n * Turn an mdast `footnote` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Footnote} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function footnote(state, node) {\n  const footnoteById = state.footnoteById\n  let no = 1\n\n  while (no in footnoteById) no++\n\n  const identifier = String(no)\n\n  footnoteById[identifier] = {\n    type: 'footnoteDefinition',\n    identifier,\n    children: [{type: 'paragraph', children: node.children}],\n    position: node.position\n  }\n\n  return footnoteReference(state, {\n    type: 'footnoteReference',\n    identifier,\n    position: node.position\n  })\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `heading` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Heading} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function heading(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'h' + node.depth,\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').HTML} Html\n * @typedef {import('../state.js').State} State\n * @typedef {import('../../index.js').Raw} Raw\n */\n\n/**\n * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise\n * nothing).\n *\n * @param {State} state\n *   Info passed around.\n * @param {Html} node\n *   mdast node.\n * @returns {Raw | Element | null}\n *   hast node.\n */\nexport function html(state, node) {\n  if (state.dangerous) {\n    /** @type {Raw} */\n    const result = {type: 'raw', value: node.value}\n    state.patch(node, result)\n    return state.applyData(node, result)\n  }\n\n  // To do: next major: return `undefined`.\n  return null\n}\n","/**\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `imageReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ImageReference} node\n *   mdast node.\n * @returns {ElementContent | Array}\n *   hast node.\n */\nexport function imageReference(state, node) {\n  const def = state.definition(node.identifier)\n\n  if (!def) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(def.url || ''), alt: node.alt}\n\n  if (def.title !== null && def.title !== undefined) {\n    properties.title = def.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Image} Image\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `image` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Image} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function image(state, node) {\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(node.url)}\n\n  if (node.alt !== null && node.alt !== undefined) {\n    properties.alt = node.alt\n  }\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `inlineCode` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {InlineCode} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function inlineCode(state, node) {\n  /** @type {Text} */\n  const text = {type: 'text', value: node.value.replace(/\\r?\\n|\\r/g, ' ')}\n  state.patch(node, text)\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'code',\n    properties: {},\n    children: [text]\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `linkReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {LinkReference} node\n *   mdast node.\n * @returns {ElementContent | Array}\n *   hast node.\n */\nexport function linkReference(state, node) {\n  const def = state.definition(node.identifier)\n\n  if (!def) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(def.url || '')}\n\n  if (def.title !== null && def.title !== undefined) {\n    properties.title = def.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Link} Link\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `link` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Link} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function link(state, node) {\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(node.url)}\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').List} List\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `list` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {List} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function list(state, node) {\n  /** @type {Properties} */\n  const properties = {}\n  const results = state.all(node)\n  let index = -1\n\n  if (typeof node.start === 'number' && node.start !== 1) {\n    properties.start = node.start\n  }\n\n  // Like GitHub, add a class for custom styling.\n  while (++index < results.length) {\n    const child = results[index]\n\n    if (\n      child.type === 'element' &&\n      child.tagName === 'li' &&\n      child.properties &&\n      Array.isArray(child.properties.className) &&\n      child.properties.className.includes('task-list-item')\n    ) {\n      properties.className = ['contains-task-list']\n      break\n    }\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: node.ordered ? 'ol' : 'ul',\n    properties,\n    children: state.wrap(results, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `paragraph` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Paragraph} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function paragraph(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'p',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `root` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastRoot} node\n *   mdast node.\n * @returns {HastRoot | HastElement}\n *   hast node.\n */\nexport function root(state, node) {\n  /** @type {HastRoot} */\n  const result = {type: 'root', children: state.wrap(state.all(node))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Strong} Strong\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `strong` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Strong} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strong(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'strong',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Table} Table\n * @typedef {import('../state.js').State} State\n */\n\nimport {pointStart, pointEnd} from 'unist-util-position'\n\n/**\n * Turn an mdast `table` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Table} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function table(state, node) {\n  const rows = state.all(node)\n  const firstRow = rows.shift()\n  /** @type {Array} */\n  const tableContent = []\n\n  if (firstRow) {\n    /** @type {Element} */\n    const head = {\n      type: 'element',\n      tagName: 'thead',\n      properties: {},\n      children: state.wrap([firstRow], true)\n    }\n    state.patch(node.children[0], head)\n    tableContent.push(head)\n  }\n\n  if (rows.length > 0) {\n    /** @type {Element} */\n    const body = {\n      type: 'element',\n      tagName: 'tbody',\n      properties: {},\n      children: state.wrap(rows, true)\n    }\n\n    const start = pointStart(node.children[1])\n    const end = pointEnd(node.children[node.children.length - 1])\n    if (start.line && end.line) body.position = {start, end}\n    tableContent.push(body)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'table',\n    properties: {},\n    children: state.wrap(tableContent, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').TableCell} TableCell\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `tableCell` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableCell} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function tableCell(state, node) {\n  // Note: this function is normally not called: see `table-row` for how rows\n  // and their cells are compiled.\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'td', // Assume body cell.\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Parent} Parent\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').TableRow} TableRow\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * @typedef {Root | Content} Nodes\n * @typedef {Extract} Parents\n */\n\n/**\n * Turn an mdast `tableRow` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableRow} node\n *   mdast node.\n * @param {Parents | null | undefined} parent\n *   Parent of `node`.\n * @returns {Element}\n *   hast node.\n */\nexport function tableRow(state, node, parent) {\n  const siblings = parent ? parent.children : undefined\n  // Generate a body row when without parent.\n  const rowIndex = siblings ? siblings.indexOf(node) : 1\n  const tagName = rowIndex === 0 ? 'th' : 'td'\n  const align = parent && parent.type === 'table' ? parent.align : undefined\n  const length = align ? align.length : node.children.length\n  let cellIndex = -1\n  /** @type {Array} */\n  const cells = []\n\n  while (++cellIndex < length) {\n    // Note: can also be undefined.\n    const cell = node.children[cellIndex]\n    /** @type {Properties} */\n    const properties = {}\n    const alignValue = align ? align[cellIndex] : undefined\n\n    if (alignValue) {\n      properties.align = alignValue\n    }\n\n    /** @type {Element} */\n    let result = {type: 'element', tagName, properties, children: []}\n\n    if (cell) {\n      result.children = state.all(cell)\n      state.patch(cell, result)\n      result = state.applyData(node, result)\n    }\n\n    cells.push(result)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'tr',\n    properties: {},\n    children: state.wrap(cells, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('hast').Text} HastText\n * @typedef {import('mdast').Text} MdastText\n * @typedef {import('../state.js').State} State\n */\n\nimport {trimLines} from 'trim-lines'\n\n/**\n * Turn an mdast `text` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastText} node\n *   mdast node.\n * @returns {HastText | HastElement}\n *   hast node.\n */\nexport function text(state, node) {\n  /** @type {HastText} */\n  const result = {type: 'text', value: trimLines(String(node.value))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').ThematicBreak} ThematicBreak\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `thematicBreak` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ThematicBreak} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function thematicBreak(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'hr',\n    properties: {},\n    children: []\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Content} HastContent\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('hast').ElementContent} HastElementContent\n * @typedef {import('hast').Properties} HastProperties\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('hast').Text} HastText\n *\n * @typedef {import('mdast').Content} MdastContent\n * @typedef {import('mdast').Definition} MdastDefinition\n * @typedef {import('mdast').FootnoteDefinition} MdastFootnoteDefinition\n * @typedef {import('mdast').Parent} MdastParent\n * @typedef {import('mdast').Root} MdastRoot\n */\n\n/**\n * @typedef {HastRoot | HastContent} HastNodes\n * @typedef {MdastRoot | MdastContent} MdastNodes\n * @typedef {Extract} MdastParents\n *\n * @typedef EmbeddedHastFields\n *   hast fields.\n * @property {string | null | undefined} [hName]\n *   Generate a specific element with this tag name instead.\n * @property {HastProperties | null | undefined} [hProperties]\n *   Generate an element with these properties instead.\n * @property {Array | null | undefined} [hChildren]\n *   Generate an element with this content instead.\n *\n * @typedef {Record & EmbeddedHastFields} MdastData\n *   mdast data with embedded hast fields.\n *\n * @typedef {MdastNodes & {data?: MdastData | null | undefined}} MdastNodeWithData\n *   mdast node with embedded hast data.\n *\n * @typedef PointLike\n *   Point-like value.\n * @property {number | null | undefined} [line]\n *   Line.\n * @property {number | null | undefined} [column]\n *   Column.\n * @property {number | null | undefined} [offset]\n *   Offset.\n *\n * @typedef PositionLike\n *   Position-like value.\n * @property {PointLike | null | undefined} [start]\n *   Point-like value.\n * @property {PointLike | null | undefined} [end]\n *   Point-like value.\n *\n * @callback Handler\n *   Handle a node.\n * @param {State} state\n *   Info passed around.\n * @param {any} node\n *   mdast node to handle.\n * @param {MdastParents | null | undefined} parent\n *   Parent of `node`.\n * @returns {HastElementContent | Array | null | undefined}\n *   hast node.\n *\n * @callback HFunctionProps\n *   Signature of `state` for when props are passed.\n * @param {MdastNodes | PositionLike | null | undefined} node\n *   mdast node or unist position.\n * @param {string} tagName\n *   HTML tag name.\n * @param {HastProperties} props\n *   Properties.\n * @param {Array | null | undefined} [children]\n *   hast content.\n * @returns {HastElement}\n *   Compiled element.\n *\n * @callback HFunctionNoProps\n *   Signature of `state` for when no props are passed.\n * @param {MdastNodes | PositionLike | null | undefined} node\n *   mdast node or unist position.\n * @param {string} tagName\n *   HTML tag name.\n * @param {Array | null | undefined} [children]\n *   hast content.\n * @returns {HastElement}\n *   Compiled element.\n *\n * @typedef HFields\n *   Info on `state`.\n * @property {boolean} dangerous\n *   Whether HTML is allowed.\n * @property {string} clobberPrefix\n *   Prefix to use to prevent DOM clobbering.\n * @property {string} footnoteLabel\n *   Label to use to introduce the footnote section.\n * @property {string} footnoteLabelTagName\n *   HTML used for the footnote label.\n * @property {HastProperties} footnoteLabelProperties\n *   Properties on the HTML tag used for the footnote label.\n * @property {string} footnoteBackLabel\n *   Label to use from backreferences back to their footnote call.\n * @property {(identifier: string) => MdastDefinition | null} definition\n *   Definition cache.\n * @property {Record} footnoteById\n *   Footnote definitions by their identifier.\n * @property {Array} footnoteOrder\n *   Identifiers of order when footnote calls first appear in tree order.\n * @property {Record} footnoteCounts\n *   Counts for how often the same footnote was called.\n * @property {Handlers} handlers\n *   Applied handlers.\n * @property {Handler} unknownHandler\n *   Handler for any none not in `passThrough` or otherwise handled.\n * @property {(from: MdastNodes, node: HastNodes) => void} patch\n *   Copy a node’s positional info.\n * @property {(from: MdastNodes, to: Type) => Type | HastElement} applyData\n *   Honor the `data` of `from`, and generate an element instead of `node`.\n * @property {(node: MdastNodes, parent: MdastParents | null | undefined) => HastElementContent | Array | null | undefined} one\n *   Transform an mdast node to hast.\n * @property {(node: MdastNodes) => Array} all\n *   Transform the children of an mdast parent to hast.\n * @property {(nodes: Array, loose?: boolean | null | undefined) => Array} wrap\n *   Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`.\n * @property {(left: MdastNodeWithData | PositionLike | null | undefined, right: HastElementContent) => HastElementContent} augment\n *   Like `state` but lower-level and usable on non-elements.\n *   Deprecated: use `patch` and `applyData`.\n * @property {Array} passThrough\n *   List of node types to pass through untouched (except for their children).\n *\n * @typedef Options\n *   Configuration (optional).\n * @property {boolean | null | undefined} [allowDangerousHtml=false]\n *   Whether to persist raw HTML in markdown in the hast tree.\n * @property {string | null | undefined} [clobberPrefix='user-content-']\n *   Prefix to use before the `id` attribute on footnotes to prevent it from\n *   *clobbering*.\n * @property {string | null | undefined} [footnoteBackLabel='Back to content']\n *   Label to use from backreferences back to their footnote call (affects\n *   screen readers).\n * @property {string | null | undefined} [footnoteLabel='Footnotes']\n *   Label to use for the footnotes section (affects screen readers).\n * @property {HastProperties | null | undefined} [footnoteLabelProperties={className: ['sr-only']}]\n *   Properties to use on the footnote label (note that `id: 'footnote-label'`\n *   is always added as footnote calls use it with `aria-describedby` to\n *   provide an accessible label).\n * @property {string | null | undefined} [footnoteLabelTagName='h2']\n *   Tag name to use for the footnote label.\n * @property {Handlers | null | undefined} [handlers]\n *   Extra handlers for nodes.\n * @property {Array | null | undefined} [passThrough]\n *   List of custom mdast node types to pass through (keep) in hast (note that\n *   the node itself is passed, but eventual children are transformed).\n * @property {Handler | null | undefined} [unknownHandler]\n *   Handler for all unknown nodes.\n *\n * @typedef {Record} Handlers\n *   Handle nodes.\n *\n * @typedef {HFunctionProps & HFunctionNoProps & HFields} State\n *   Info passed around.\n */\n\nimport {visit} from 'unist-util-visit'\nimport {position, pointStart, pointEnd} from 'unist-util-position'\nimport {generated} from 'unist-util-generated'\nimport {definitions} from 'mdast-util-definitions'\nimport {handlers} from './handlers/index.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Create `state` from an mdast tree.\n *\n * @param {MdastNodes} tree\n *   mdast node to transform.\n * @param {Options | null | undefined} [options]\n *   Configuration.\n * @returns {State}\n *   `state` function.\n */\nexport function createState(tree, options) {\n  const settings = options || {}\n  const dangerous = settings.allowDangerousHtml || false\n  /** @type {Record} */\n  const footnoteById = {}\n\n  // To do: next major: add `options` to state, remove:\n  // `dangerous`, `clobberPrefix`, `footnoteLabel`, `footnoteLabelTagName`,\n  // `footnoteLabelProperties`, `footnoteBackLabel`, `passThrough`,\n  // `unknownHandler`.\n\n  // To do: next major: move to `state.options.allowDangerousHtml`.\n  state.dangerous = dangerous\n  // To do: next major: move to `state.options`.\n  state.clobberPrefix =\n    settings.clobberPrefix === undefined || settings.clobberPrefix === null\n      ? 'user-content-'\n      : settings.clobberPrefix\n  // To do: next major: move to `state.options`.\n  state.footnoteLabel = settings.footnoteLabel || 'Footnotes'\n  // To do: next major: move to `state.options`.\n  state.footnoteLabelTagName = settings.footnoteLabelTagName || 'h2'\n  // To do: next major: move to `state.options`.\n  state.footnoteLabelProperties = settings.footnoteLabelProperties || {\n    className: ['sr-only']\n  }\n  // To do: next major: move to `state.options`.\n  state.footnoteBackLabel = settings.footnoteBackLabel || 'Back to content'\n  // To do: next major: move to `state.options`.\n  state.unknownHandler = settings.unknownHandler\n  // To do: next major: move to `state.options`.\n  state.passThrough = settings.passThrough\n\n  state.handlers = {...handlers, ...settings.handlers}\n\n  // To do: next major: replace utility with `definitionById` object, so we\n  // only walk once (as we need footnotes too).\n  state.definition = definitions(tree)\n  state.footnoteById = footnoteById\n  /** @type {Array} */\n  state.footnoteOrder = []\n  /** @type {Record} */\n  state.footnoteCounts = {}\n\n  state.patch = patch\n  state.applyData = applyData\n  state.one = oneBound\n  state.all = allBound\n  state.wrap = wrap\n  // To do: next major: remove `augment`.\n  state.augment = augment\n\n  visit(tree, 'footnoteDefinition', (definition) => {\n    const id = String(definition.identifier).toUpperCase()\n\n    // Mimick CM behavior of link definitions.\n    // See: .\n    if (!own.call(footnoteById, id)) {\n      footnoteById[id] = definition\n    }\n  })\n\n  // @ts-expect-error Hush, it’s fine!\n  return state\n\n  /**\n   * Finalise the created `right`, a hast node, from `left`, an mdast node.\n   *\n   * @param {MdastNodeWithData | PositionLike | null | undefined} left\n   * @param {HastElementContent} right\n   * @returns {HastElementContent}\n   */\n  /* c8 ignore start */\n  // To do: next major: remove.\n  function augment(left, right) {\n    // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n    if (left && 'data' in left && left.data) {\n      /** @type {MdastData} */\n      const data = left.data\n\n      if (data.hName) {\n        if (right.type !== 'element') {\n          right = {\n            type: 'element',\n            tagName: '',\n            properties: {},\n            children: []\n          }\n        }\n\n        right.tagName = data.hName\n      }\n\n      if (right.type === 'element' && data.hProperties) {\n        right.properties = {...right.properties, ...data.hProperties}\n      }\n\n      if ('children' in right && right.children && data.hChildren) {\n        right.children = data.hChildren\n      }\n    }\n\n    if (left) {\n      const ctx = 'type' in left ? left : {position: left}\n\n      if (!generated(ctx)) {\n        // @ts-expect-error: fine.\n        right.position = {start: pointStart(ctx), end: pointEnd(ctx)}\n      }\n    }\n\n    return right\n  }\n  /* c8 ignore stop */\n\n  /**\n   * Create an element for `node`.\n   *\n   * @type {HFunctionProps}\n   */\n  /* c8 ignore start */\n  // To do: next major: remove.\n  function state(node, tagName, props, children) {\n    if (Array.isArray(props)) {\n      children = props\n      props = {}\n    }\n\n    // @ts-expect-error augmenting an element yields an element.\n    return augment(node, {\n      type: 'element',\n      tagName,\n      properties: props || {},\n      children: children || []\n    })\n  }\n  /* c8 ignore stop */\n\n  /**\n   * Transform an mdast node into a hast node.\n   *\n   * @param {MdastNodes} node\n   *   mdast node.\n   * @param {MdastParents | null | undefined} [parent]\n   *   Parent of `node`.\n   * @returns {HastElementContent | Array | null | undefined}\n   *   Resulting hast node.\n   */\n  function oneBound(node, parent) {\n    // @ts-expect-error: that’s a state :)\n    return one(state, node, parent)\n  }\n\n  /**\n   * Transform the children of an mdast node into hast nodes.\n   *\n   * @param {MdastNodes} parent\n   *   mdast node to compile\n   * @returns {Array}\n   *   Resulting hast nodes.\n   */\n  function allBound(parent) {\n    // @ts-expect-error: that’s a state :)\n    return all(state, parent)\n  }\n}\n\n/**\n * Copy a node’s positional info.\n *\n * @param {MdastNodes} from\n *   mdast node to copy from.\n * @param {HastNodes} to\n *   hast node to copy into.\n * @returns {void}\n *   Nothing.\n */\nfunction patch(from, to) {\n  if (from.position) to.position = position(from)\n}\n\n/**\n * Honor the `data` of `from` and maybe generate an element instead of `to`.\n *\n * @template {HastNodes} Type\n *   Node type.\n * @param {MdastNodes} from\n *   mdast node to use data from.\n * @param {Type} to\n *   hast node to change.\n * @returns {Type | HastElement}\n *   Nothing.\n */\nfunction applyData(from, to) {\n  /** @type {Type | HastElement} */\n  let result = to\n\n  // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n  if (from && from.data) {\n    const hName = from.data.hName\n    const hChildren = from.data.hChildren\n    const hProperties = from.data.hProperties\n\n    if (typeof hName === 'string') {\n      // Transforming the node resulted in an element with a different name\n      // than wanted:\n      if (result.type === 'element') {\n        result.tagName = hName\n      }\n      // Transforming the node resulted in a non-element, which happens for\n      // raw, text, and root nodes (unless custom handlers are passed).\n      // The intent is likely to keep the content around (otherwise: pass\n      // `hChildren`).\n      else {\n        result = {\n          type: 'element',\n          tagName: hName,\n          properties: {},\n          children: []\n        }\n\n        // To do: next major: take the children from the `root`, or inject the\n        // raw/text/comment or so into the element?\n        // if ('children' in node) {\n        //   // @ts-expect-error: assume `children` are allowed in elements.\n        //   result.children = node.children\n        // } else {\n        //   // @ts-expect-error: assume `node` is allowed in elements.\n        //   result.children.push(node)\n        // }\n      }\n    }\n\n    if (result.type === 'element' && hProperties) {\n      result.properties = {...result.properties, ...hProperties}\n    }\n\n    if (\n      'children' in result &&\n      result.children &&\n      hChildren !== null &&\n      hChildren !== undefined\n    ) {\n      // @ts-expect-error: assume valid children are defined.\n      result.children = hChildren\n    }\n  }\n\n  return result\n}\n\n/**\n * Transform an mdast node into a hast node.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastNodes} node\n *   mdast node.\n * @param {MdastParents | null | undefined} [parent]\n *   Parent of `node`.\n * @returns {HastElementContent | Array | null | undefined}\n *   Resulting hast node.\n */\n// To do: next major: do not expose, keep bound.\nexport function one(state, node, parent) {\n  const type = node && node.type\n\n  // Fail on non-nodes.\n  if (!type) {\n    throw new Error('Expected node, got `' + node + '`')\n  }\n\n  if (own.call(state.handlers, type)) {\n    return state.handlers[type](state, node, parent)\n  }\n\n  if (state.passThrough && state.passThrough.includes(type)) {\n    // To do: next major: deep clone.\n    // @ts-expect-error: types of passed through nodes are expected to be added manually.\n    return 'children' in node ? {...node, children: all(state, node)} : node\n  }\n\n  if (state.unknownHandler) {\n    return state.unknownHandler(state, node, parent)\n  }\n\n  return defaultUnknownHandler(state, node)\n}\n\n/**\n * Transform the children of an mdast node into hast nodes.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastNodes} parent\n *   mdast node to compile\n * @returns {Array}\n *   Resulting hast nodes.\n */\n// To do: next major: do not expose, keep bound.\nexport function all(state, parent) {\n  /** @type {Array} */\n  const values = []\n\n  if ('children' in parent) {\n    const nodes = parent.children\n    let index = -1\n    while (++index < nodes.length) {\n      const result = one(state, nodes[index], parent)\n\n      // To do: see if we van clean this? Can we merge texts?\n      if (result) {\n        if (index && nodes[index - 1].type === 'break') {\n          if (!Array.isArray(result) && result.type === 'text') {\n            result.value = result.value.replace(/^\\s+/, '')\n          }\n\n          if (!Array.isArray(result) && result.type === 'element') {\n            const head = result.children[0]\n\n            if (head && head.type === 'text') {\n              head.value = head.value.replace(/^\\s+/, '')\n            }\n          }\n        }\n\n        if (Array.isArray(result)) {\n          values.push(...result)\n        } else {\n          values.push(result)\n        }\n      }\n    }\n  }\n\n  return values\n}\n\n/**\n * Transform an unknown node.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastNodes} node\n *   Unknown mdast node.\n * @returns {HastText | HastElement}\n *   Resulting hast node.\n */\nfunction defaultUnknownHandler(state, node) {\n  const data = node.data || {}\n  /** @type {HastText | HastElement} */\n  const result =\n    'value' in node &&\n    !(own.call(data, 'hProperties') || own.call(data, 'hChildren'))\n      ? {type: 'text', value: node.value}\n      : {\n          type: 'element',\n          tagName: 'div',\n          properties: {},\n          children: all(state, node)\n        }\n\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n\n/**\n * Wrap `nodes` with line endings between each node.\n *\n * @template {HastContent} Type\n *   Node type.\n * @param {Array} nodes\n *   List of nodes to wrap.\n * @param {boolean | null | undefined} [loose=false]\n *   Whether to add line endings at start and end.\n * @returns {Array}\n *   Wrapped nodes.\n */\nexport function wrap(nodes, loose) {\n  /** @type {Array} */\n  const result = []\n  let index = -1\n\n  if (loose) {\n    result.push({type: 'text', value: '\\n'})\n  }\n\n  while (++index < nodes.length) {\n    if (index) result.push({type: 'text', value: '\\n'})\n    result.push(nodes[index])\n  }\n\n  if (loose && nodes.length > 0) {\n    result.push({type: 'text', value: '\\n'})\n  }\n\n  return result\n}\n","/**\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n *\n * @typedef NodeLike\n * @property {PositionLike | null | undefined} [position]\n */\n\n/**\n * Check if `node` is generated.\n *\n * @param {NodeLike | null | undefined} [node]\n *   Node to check.\n * @returns {boolean}\n *   Whether `node` is generated (does not have positional info).\n */\nexport function generated(node) {\n  return (\n    !node ||\n    !node.position ||\n    !node.position.start ||\n    !node.position.start.line ||\n    !node.position.start.column ||\n    !node.position.end ||\n    !node.position.end.line ||\n    !node.position.end.column\n  )\n}\n","/**\n * @typedef {import('hast').Content} HastContent\n * @typedef {import('hast').Root} HastRoot\n *\n * @typedef {import('mdast').Content} MdastContent\n * @typedef {import('mdast').Root} MdastRoot\n *\n * @typedef {import('./state.js').Options} Options\n */\n\n/**\n * @typedef {HastRoot | HastContent} HastNodes\n * @typedef {MdastRoot | MdastContent} MdastNodes\n */\n\nimport {footer} from './footer.js'\nimport {createState} from './state.js'\n\n/**\n * Transform mdast to hast.\n *\n * ##### Notes\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most utilities ignore `raw` nodes but two notable ones don’t:\n *\n * *   `hast-util-to-html` also has an option `allowDangerousHtml` which will\n *     output the raw HTML.\n *     This is typically discouraged as noted by the option name but is useful\n *     if you completely trust authors\n * *   `hast-util-raw` can handle the raw embedded HTML strings by parsing them\n *     into standard hast nodes (`element`, `text`, etc).\n *     This is a heavy task as it needs a full HTML parser, but it is the only\n *     way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark, which we follow by default.\n * They are supported by GitHub, so footnotes can be enabled in markdown with\n * `mdast-util-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes, which is hidden for sighted users but shown to\n * assistive technology.\n * When your page is not in English, you must define translated values.\n *\n * Back references use ARIA attributes, but the section label itself uses a\n * heading that is hidden with an `sr-only` class.\n * To show it to sighted users, define different attributes in\n * `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem, as it links footnote calls to footnote\n * definitions on the page through `id` attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n * 

\n * \n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * Example: headings (DOM clobbering) in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value` (and doesn’t have `data.hName`,\n * `data.hProperties`, or `data.hChildren`, see later), create a hast `text`\n * node\n * * otherwise, create a `
` element (which could be changed with\n * `data.hName`), with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @param {MdastNodes} tree\n * mdast tree.\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {HastNodes | null | undefined}\n * hast tree.\n */\n// To do: next major: always return a single `root`.\nexport function toHast(tree, options) {\n const state = createState(tree, options)\n const node = state.one(tree, null)\n const foot = footer(state)\n\n if (foot) {\n // @ts-expect-error If there’s a footer, there were definitions, meaning block\n // content.\n // So assume `node` is a parent node.\n node.children.push({type: 'text', value: '\\n'}, foot)\n }\n\n // To do: next major: always return root?\n return Array.isArray(node) ? {type: 'root', children: node} : node\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n *\n * @typedef {import('./state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Generate a hast footer for called footnote definitions.\n *\n * @param {State} state\n * Info passed around.\n * @returns {Element | undefined}\n * `section` element or `undefined`.\n */\nexport function footer(state) {\n /** @type {Array} */\n const listItems = []\n let index = -1\n\n while (++index < state.footnoteOrder.length) {\n const def = state.footnoteById[state.footnoteOrder[index]]\n\n if (!def) {\n continue\n }\n\n const content = state.all(def)\n const id = String(def.identifier).toUpperCase()\n const safeId = normalizeUri(id.toLowerCase())\n let referenceIndex = 0\n /** @type {Array} */\n const backReferences = []\n\n while (++referenceIndex <= state.footnoteCounts[id]) {\n /** @type {Element} */\n const backReference = {\n type: 'element',\n tagName: 'a',\n properties: {\n href:\n '#' +\n state.clobberPrefix +\n 'fnref-' +\n safeId +\n (referenceIndex > 1 ? '-' + referenceIndex : ''),\n dataFootnoteBackref: true,\n className: ['data-footnote-backref'],\n ariaLabel: state.footnoteBackLabel\n },\n children: [{type: 'text', value: '↩'}]\n }\n\n if (referenceIndex > 1) {\n backReference.children.push({\n type: 'element',\n tagName: 'sup',\n children: [{type: 'text', value: String(referenceIndex)}]\n })\n }\n\n if (backReferences.length > 0) {\n backReferences.push({type: 'text', value: ' '})\n }\n\n backReferences.push(backReference)\n }\n\n const tail = content[content.length - 1]\n\n if (tail && tail.type === 'element' && tail.tagName === 'p') {\n const tailTail = tail.children[tail.children.length - 1]\n if (tailTail && tailTail.type === 'text') {\n tailTail.value += ' '\n } else {\n tail.children.push({type: 'text', value: ' '})\n }\n\n tail.children.push(...backReferences)\n } else {\n content.push(...backReferences)\n }\n\n /** @type {Element} */\n const listItem = {\n type: 'element',\n tagName: 'li',\n properties: {id: state.clobberPrefix + 'fn-' + safeId},\n children: state.wrap(content, true)\n }\n\n state.patch(def, listItem)\n\n listItems.push(listItem)\n }\n\n if (listItems.length === 0) {\n return\n }\n\n return {\n type: 'element',\n tagName: 'section',\n properties: {dataFootnotes: true, className: ['footnotes']},\n children: [\n {\n type: 'element',\n tagName: state.footnoteLabelTagName,\n properties: {\n // To do: use structured clone.\n ...JSON.parse(JSON.stringify(state.footnoteLabelProperties)),\n id: 'footnote-label'\n },\n children: [{type: 'text', value: state.footnoteLabel}]\n },\n {type: 'text', value: '\\n'},\n {\n type: 'element',\n tagName: 'ol',\n properties: {},\n children: state.wrap(listItems, true)\n },\n {type: 'text', value: '\\n'}\n ]\n }\n}\n","/**\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('mdast-util-to-hast').Options} Options\n * @typedef {import('unified').Processor} Processor\n *\n * @typedef {import('mdast-util-to-hast')} DoNotTouchAsThisImportIncludesRawInTree\n */\n\nimport {toHast} from 'mdast-util-to-hast'\n\n// Note: the `` overload doesn’t seem to work :'(\n\n/**\n * Plugin that turns markdown into HTML to support rehype.\n *\n * * If a destination processor is given, that processor runs with a new HTML\n * (hast) tree (bridge-mode).\n * As the given processor runs with a hast tree, and rehype plugins support\n * hast, that means rehype plugins can be used with the given processor.\n * The hast tree is discarded in the end.\n * It’s highly unlikely that you want to do this.\n * * The common case is to not pass a destination processor, in which case the\n * current processor continues running with a new HTML (hast) tree\n * (mutate-mode).\n * As the current processor continues with a hast tree, and rehype plugins\n * support hast, that means rehype plugins can be used after\n * `remark-rehype`.\n * It’s likely that this is what you want to do.\n *\n * @param destination\n * Optional unified processor.\n * @param options\n * Options passed to `mdast-util-to-hast`.\n */\nconst remarkRehype =\n /** @type {(import('unified').Plugin<[Processor, Options?]|[null|undefined, Options?]|[Options]|[], MdastRoot>)} */\n (\n function (destination, options) {\n return destination && 'run' in destination\n ? bridge(destination, options)\n : mutate(destination || options)\n }\n )\n\nexport default remarkRehype\n\n/**\n * Bridge-mode.\n * Runs the destination with the new hast tree.\n *\n * @type {import('unified').Plugin<[Processor, Options?], MdastRoot>}\n */\nfunction bridge(destination, options) {\n return (node, file, next) => {\n destination.run(toHast(node, options), file, (error) => {\n next(error)\n })\n }\n}\n\n/**\n * Mutate-mode.\n * Further plugins run on the hast tree.\n *\n * @type {import('unified').Plugin<[Options?]|void[], MdastRoot, HastRoot>}\n */\nfunction mutate(options) {\n // @ts-expect-error: assume a corresponding node is returned by `toHast`.\n return (node) => toHast(node, options)\n}\n","/**\n * @typedef {import('./info.js').Info} Info\n * @typedef {Record} Properties\n * @typedef {Record} Normal\n */\n\nexport class Schema {\n /**\n * @constructor\n * @param {Properties} property\n * @param {Normal} normal\n * @param {string} [space]\n */\n constructor(property, normal, space) {\n this.property = property\n this.normal = normal\n if (space) {\n this.space = space\n }\n }\n}\n\n/** @type {Properties} */\nSchema.prototype.property = {}\n/** @type {Normal} */\nSchema.prototype.normal = {}\n/** @type {string|null} */\nSchema.prototype.space = null\n","/**\n * @typedef {import('./schema.js').Properties} Properties\n * @typedef {import('./schema.js').Normal} Normal\n */\n\nimport {Schema} from './schema.js'\n\n/**\n * @param {Schema[]} definitions\n * @param {string} [space]\n * @returns {Schema}\n */\nexport function merge(definitions, space) {\n /** @type {Properties} */\n const property = {}\n /** @type {Normal} */\n const normal = {}\n let index = -1\n\n while (++index < definitions.length) {\n Object.assign(property, definitions[index].property)\n Object.assign(normal, definitions[index].normal)\n }\n\n return new Schema(property, normal, space)\n}\n","/**\n * @param {string} value\n * @returns {string}\n */\nexport function normalize(value) {\n return value.toLowerCase()\n}\n","export class Info {\n /**\n * @constructor\n * @param {string} property\n * @param {string} attribute\n */\n constructor(property, attribute) {\n /** @type {string} */\n this.property = property\n /** @type {string} */\n this.attribute = attribute\n }\n}\n\n/** @type {string|null} */\nInfo.prototype.space = null\nInfo.prototype.boolean = false\nInfo.prototype.booleanish = false\nInfo.prototype.overloadedBoolean = false\nInfo.prototype.number = false\nInfo.prototype.commaSeparated = false\nInfo.prototype.spaceSeparated = false\nInfo.prototype.commaOrSpaceSeparated = false\nInfo.prototype.mustUseProperty = false\nInfo.prototype.defined = false\n","let powers = 0\n\nexport const boolean = increment()\nexport const booleanish = increment()\nexport const overloadedBoolean = increment()\nexport const number = increment()\nexport const spaceSeparated = increment()\nexport const commaSeparated = increment()\nexport const commaOrSpaceSeparated = increment()\n\nfunction increment() {\n return 2 ** ++powers\n}\n","import {Info} from './info.js'\nimport * as types from './types.js'\n\n/** @type {Array} */\n// @ts-expect-error: hush.\nconst checks = Object.keys(types)\n\nexport class DefinedInfo extends Info {\n /**\n * @constructor\n * @param {string} property\n * @param {string} attribute\n * @param {number|null} [mask]\n * @param {string} [space]\n */\n constructor(property, attribute, mask, space) {\n let index = -1\n\n super(property, attribute)\n\n mark(this, 'space', space)\n\n if (typeof mask === 'number') {\n while (++index < checks.length) {\n const check = checks[index]\n mark(this, checks[index], (mask & types[check]) === types[check])\n }\n }\n }\n}\n\nDefinedInfo.prototype.defined = true\n\n/**\n * @param {DefinedInfo} values\n * @param {string} key\n * @param {unknown} value\n */\nfunction mark(values, key, value) {\n if (value) {\n // @ts-expect-error: assume `value` matches the expected value of `key`.\n values[key] = value\n }\n}\n","/**\n * @typedef {import('./schema.js').Properties} Properties\n * @typedef {import('./schema.js').Normal} Normal\n *\n * @typedef {Record} Attributes\n *\n * @typedef {Object} Definition\n * @property {Record} properties\n * @property {(attributes: Attributes, property: string) => string} transform\n * @property {string} [space]\n * @property {Attributes} [attributes]\n * @property {Array} [mustUseProperty]\n */\n\nimport {normalize} from '../normalize.js'\nimport {Schema} from './schema.js'\nimport {DefinedInfo} from './defined-info.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * @param {Definition} definition\n * @returns {Schema}\n */\nexport function create(definition) {\n /** @type {Properties} */\n const property = {}\n /** @type {Normal} */\n const normal = {}\n /** @type {string} */\n let prop\n\n for (prop in definition.properties) {\n if (own.call(definition.properties, prop)) {\n const value = definition.properties[prop]\n const info = new DefinedInfo(\n prop,\n definition.transform(definition.attributes || {}, prop),\n value,\n definition.space\n )\n\n if (\n definition.mustUseProperty &&\n definition.mustUseProperty.includes(prop)\n ) {\n info.mustUseProperty = true\n }\n\n property[prop] = info\n\n normal[normalize(prop)] = prop\n normal[normalize(info.attribute)] = prop\n }\n }\n\n return new Schema(property, normal, definition.space)\n}\n","import {create} from './util/create.js'\n\nexport const xlink = create({\n space: 'xlink',\n transform(_, prop) {\n return 'xlink:' + prop.slice(5).toLowerCase()\n },\n properties: {\n xLinkActuate: null,\n xLinkArcRole: null,\n xLinkHref: null,\n xLinkRole: null,\n xLinkShow: null,\n xLinkTitle: null,\n xLinkType: null\n }\n})\n","import {create} from './util/create.js'\n\nexport const xml = create({\n space: 'xml',\n transform(_, prop) {\n return 'xml:' + prop.slice(3).toLowerCase()\n },\n properties: {xmlLang: null, xmlBase: null, xmlSpace: null}\n})\n","/**\n * @param {Record} attributes\n * @param {string} attribute\n * @returns {string}\n */\nexport function caseSensitiveTransform(attributes, attribute) {\n return attribute in attributes ? attributes[attribute] : attribute\n}\n","import {caseSensitiveTransform} from './case-sensitive-transform.js'\n\n/**\n * @param {Record} attributes\n * @param {string} property\n * @returns {string}\n */\nexport function caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase())\n}\n","import {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const xmlns = create({\n space: 'xmlns',\n attributes: {xmlnsxlink: 'xmlns:xlink'},\n transform: caseInsensitiveTransform,\n properties: {xmlns: null, xmlnsXLink: null}\n})\n","import {booleanish, number, spaceSeparated} from './util/types.js'\nimport {create} from './util/create.js'\n\nexport const aria = create({\n transform(_, prop) {\n return prop === 'role' ? prop : 'aria-' + prop.slice(4).toLowerCase()\n },\n properties: {\n ariaActiveDescendant: null,\n ariaAtomic: booleanish,\n ariaAutoComplete: null,\n ariaBusy: booleanish,\n ariaChecked: booleanish,\n ariaColCount: number,\n ariaColIndex: number,\n ariaColSpan: number,\n ariaControls: spaceSeparated,\n ariaCurrent: null,\n ariaDescribedBy: spaceSeparated,\n ariaDetails: null,\n ariaDisabled: booleanish,\n ariaDropEffect: spaceSeparated,\n ariaErrorMessage: null,\n ariaExpanded: booleanish,\n ariaFlowTo: spaceSeparated,\n ariaGrabbed: booleanish,\n ariaHasPopup: null,\n ariaHidden: booleanish,\n ariaInvalid: null,\n ariaKeyShortcuts: null,\n ariaLabel: null,\n ariaLabelledBy: spaceSeparated,\n ariaLevel: number,\n ariaLive: null,\n ariaModal: booleanish,\n ariaMultiLine: booleanish,\n ariaMultiSelectable: booleanish,\n ariaOrientation: null,\n ariaOwns: spaceSeparated,\n ariaPlaceholder: null,\n ariaPosInSet: number,\n ariaPressed: booleanish,\n ariaReadOnly: booleanish,\n ariaRelevant: null,\n ariaRequired: booleanish,\n ariaRoleDescription: spaceSeparated,\n ariaRowCount: number,\n ariaRowIndex: number,\n ariaRowSpan: number,\n ariaSelected: booleanish,\n ariaSetSize: number,\n ariaSort: null,\n ariaValueMax: number,\n ariaValueMin: number,\n ariaValueNow: number,\n ariaValueText: null,\n role: null\n }\n})\n","import {\n boolean,\n overloadedBoolean,\n booleanish,\n number,\n spaceSeparated,\n commaSeparated\n} from './util/types.js'\nimport {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const html = create({\n space: 'html',\n attributes: {\n acceptcharset: 'accept-charset',\n classname: 'class',\n htmlfor: 'for',\n httpequiv: 'http-equiv'\n },\n transform: caseInsensitiveTransform,\n mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],\n properties: {\n // Standard Properties.\n abbr: null,\n accept: commaSeparated,\n acceptCharset: spaceSeparated,\n accessKey: spaceSeparated,\n action: null,\n allow: null,\n allowFullScreen: boolean,\n allowPaymentRequest: boolean,\n allowUserMedia: boolean,\n alt: null,\n as: null,\n async: boolean,\n autoCapitalize: null,\n autoComplete: spaceSeparated,\n autoFocus: boolean,\n autoPlay: boolean,\n blocking: spaceSeparated,\n capture: null,\n charSet: null,\n checked: boolean,\n cite: null,\n className: spaceSeparated,\n cols: number,\n colSpan: null,\n content: null,\n contentEditable: booleanish,\n controls: boolean,\n controlsList: spaceSeparated,\n coords: number | commaSeparated,\n crossOrigin: null,\n data: null,\n dateTime: null,\n decoding: null,\n default: boolean,\n defer: boolean,\n dir: null,\n dirName: null,\n disabled: boolean,\n download: overloadedBoolean,\n draggable: booleanish,\n encType: null,\n enterKeyHint: null,\n fetchPriority: null,\n form: null,\n formAction: null,\n formEncType: null,\n formMethod: null,\n formNoValidate: boolean,\n formTarget: null,\n headers: spaceSeparated,\n height: number,\n hidden: boolean,\n high: number,\n href: null,\n hrefLang: null,\n htmlFor: spaceSeparated,\n httpEquiv: spaceSeparated,\n id: null,\n imageSizes: null,\n imageSrcSet: null,\n inert: boolean,\n inputMode: null,\n integrity: null,\n is: null,\n isMap: boolean,\n itemId: null,\n itemProp: spaceSeparated,\n itemRef: spaceSeparated,\n itemScope: boolean,\n itemType: spaceSeparated,\n kind: null,\n label: null,\n lang: null,\n language: null,\n list: null,\n loading: null,\n loop: boolean,\n low: number,\n manifest: null,\n max: null,\n maxLength: number,\n media: null,\n method: null,\n min: null,\n minLength: number,\n multiple: boolean,\n muted: boolean,\n name: null,\n nonce: null,\n noModule: boolean,\n noValidate: boolean,\n onAbort: null,\n onAfterPrint: null,\n onAuxClick: null,\n onBeforeMatch: null,\n onBeforePrint: null,\n onBeforeToggle: null,\n onBeforeUnload: null,\n onBlur: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onContextLost: null,\n onContextMenu: null,\n onContextRestored: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFormData: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLanguageChange: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadEnd: null,\n onLoadStart: null,\n onMessage: null,\n onMessageError: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRejectionHandled: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onScrollEnd: null,\n onSecurityPolicyViolation: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onSlotChange: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnhandledRejection: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onWheel: null,\n open: boolean,\n optimum: number,\n pattern: null,\n ping: spaceSeparated,\n placeholder: null,\n playsInline: boolean,\n popover: null,\n popoverTarget: null,\n popoverTargetAction: null,\n poster: null,\n preload: null,\n readOnly: boolean,\n referrerPolicy: null,\n rel: spaceSeparated,\n required: boolean,\n reversed: boolean,\n rows: number,\n rowSpan: number,\n sandbox: spaceSeparated,\n scope: null,\n scoped: boolean,\n seamless: boolean,\n selected: boolean,\n shadowRootClonable: boolean,\n shadowRootDelegatesFocus: boolean,\n shadowRootMode: null,\n shape: null,\n size: number,\n sizes: null,\n slot: null,\n span: number,\n spellCheck: booleanish,\n src: null,\n srcDoc: null,\n srcLang: null,\n srcSet: null,\n start: number,\n step: null,\n style: null,\n tabIndex: number,\n target: null,\n title: null,\n translate: null,\n type: null,\n typeMustMatch: boolean,\n useMap: null,\n value: booleanish,\n width: number,\n wrap: null,\n writingSuggestions: null,\n\n // Legacy.\n // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis\n align: null, // Several. Use CSS `text-align` instead,\n aLink: null, // ``. Use CSS `a:active {color}` instead\n archive: spaceSeparated, // ``. List of URIs to archives\n axis: null, // `
` and ``. Use `scope` on ``\n background: null, // ``. Use CSS `background-image` instead\n bgColor: null, // `` and table elements. Use CSS `background-color` instead\n border: number, // ``. Use CSS `border-width` instead,\n borderColor: null, // `
`. Use CSS `border-color` instead,\n bottomMargin: number, // ``\n cellPadding: null, // `
`\n cellSpacing: null, // `
`\n char: null, // Several table elements. When `align=char`, sets the character to align on\n charOff: null, // Several table elements. When `char`, offsets the alignment\n classId: null, // ``\n clear: null, // `
`. Use CSS `clear` instead\n code: null, // ``\n codeBase: null, // ``\n codeType: null, // ``\n color: null, // `` and `
`. Use CSS instead\n compact: boolean, // Lists. Use CSS to reduce space between items instead\n declare: boolean, // ``\n event: null, // `