kordoc 4.6.0 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/NOTICE +176 -176
- package/README.md +962 -958
- package/THIRD_PARTY/apache-2.0.LICENSE +201 -201
- package/THIRD_PARTY/claw-hwp.LICENSE +21 -21
- package/THIRD_PARTY/hml-equation-parser.LICENSE +201 -201
- package/THIRD_PARTY/hml-equation-parser.txt +35 -35
- package/THIRD_PARTY/opendataloader-pdf.txt +32 -32
- package/THIRD_PARTY/pix2text.txt +17 -17
- package/THIRD_PARTY/rhwp-forms.txt +35 -35
- package/dist/{-DEVLQKIT.js → -MK2223RL.js} +12 -12
- package/dist/{chunk-3FFPHTXD.js → chunk-3H5X63BQ.js} +1 -1
- package/dist/chunk-3H5X63BQ.js.map +1 -0
- package/dist/{chunk-IBVMJIHR.js → chunk-3VTMSSDW.js} +2 -2
- package/dist/chunk-3VTMSSDW.js.map +1 -0
- package/dist/{chunk-HPRGVU6A.cjs → chunk-5QTHHQQE.cjs} +6 -6
- package/dist/chunk-5QTHHQQE.cjs.map +1 -0
- package/dist/{chunk-6GBLFQMA.js → chunk-5RPYBC2Q.js} +1 -1
- package/dist/chunk-5RPYBC2Q.js.map +1 -0
- package/dist/{chunk-7BTO44Q7.js → chunk-6PIR74EA.js} +13 -13
- package/dist/chunk-6PIR74EA.js.map +1 -0
- package/dist/{chunk-W34QSJFF.js → chunk-7FCNOKOR.js} +1 -1
- package/dist/chunk-7FCNOKOR.js.map +1 -0
- package/dist/{chunk-MSMSHU2F.js → chunk-AEYNY6FG.js} +3 -3
- package/dist/chunk-AEYNY6FG.js.map +1 -0
- package/dist/{chunk-KC63W72C.js → chunk-AFPD74JJ.js} +2 -2
- package/dist/chunk-AFPD74JJ.js.map +1 -0
- package/dist/{chunk-IHK5LCYX.js → chunk-BCG2PKQU.js} +2 -2
- package/dist/chunk-BCG2PKQU.js.map +1 -0
- package/dist/{chunk-I42DND3B.cjs → chunk-C27PPXRZ.cjs} +342 -29
- package/dist/chunk-C27PPXRZ.cjs.map +1 -0
- package/dist/{chunk-X34YWRL5.cjs → chunk-DCZVOIEO.cjs} +1 -1
- package/dist/chunk-DCZVOIEO.cjs.map +1 -0
- package/dist/{chunk-O5EK52TG.js → chunk-DZIXKL7E.js} +1 -1
- package/dist/chunk-DZIXKL7E.js.map +1 -0
- package/dist/{chunk-AIQ3ISQU.js → chunk-GE43BE46.js} +1 -1
- package/dist/chunk-GE43BE46.js.map +1 -0
- package/dist/{chunk-2CENWSAW.js → chunk-GIWKBPII.js} +335 -22
- package/dist/chunk-GIWKBPII.js.map +1 -0
- package/dist/chunk-GS7T56RP.cjs.map +1 -1
- package/dist/{chunk-6XPXIG57.js → chunk-GZDOWYJM.js} +2 -2
- package/dist/chunk-GZDOWYJM.js.map +1 -0
- package/dist/{chunk-OPL22SYF.js → chunk-IDHBO6AG.js} +3 -3
- package/dist/chunk-IDHBO6AG.js.map +1 -0
- package/dist/{chunk-3TBUDJDE.js → chunk-MOL7MDBG.js} +1 -1
- package/dist/chunk-MOL7MDBG.js.map +1 -0
- package/dist/{chunk-PSAHY5XW.js → chunk-MVTX6ODZ.js} +1 -1
- package/dist/chunk-MVTX6ODZ.js.map +1 -0
- package/dist/{chunk-2CABQYTT.js → chunk-P2NWNJMR.js} +3 -3
- package/dist/chunk-P2NWNJMR.js.map +1 -0
- package/dist/{chunk-PQDNCWAZ.js → chunk-PEVPKD6Z.js} +336 -23
- package/dist/chunk-PEVPKD6Z.js.map +1 -0
- package/dist/{chunk-UQ4NSK66.js → chunk-PV2EXXGI.js} +3 -3
- package/dist/chunk-PV2EXXGI.js.map +1 -0
- package/dist/{chunk-WX7WQTOT.cjs → chunk-TUU535RB.cjs} +2 -2
- package/dist/chunk-TUU535RB.cjs.map +1 -0
- package/dist/{chunk-YNJDNP44.js → chunk-UAFSPWU7.js} +1 -1
- package/dist/chunk-UAFSPWU7.js.map +1 -0
- package/dist/{chunk-CARNWWGI.cjs → chunk-W5KRKBYR.cjs} +4 -4
- package/dist/chunk-W5KRKBYR.cjs.map +1 -0
- package/dist/{chunk-VNEV6VKD.js → chunk-XZDJXYUC.js} +2 -2
- package/dist/chunk-XZDJXYUC.js.map +1 -0
- package/dist/{chunk-UGKXJA3W.js → chunk-YUVKU5CW.js} +2 -2
- package/dist/chunk-YUVKU5CW.js.map +1 -0
- package/dist/{chunk-KQOTL4WI.js → chunk-YXXHH6WC.js} +2 -2
- package/dist/chunk-YXXHH6WC.js.map +1 -0
- package/dist/{chunk-MGGU3ZRK.cjs → chunk-ZV5OKQ3Z.cjs} +1 -1
- package/dist/chunk-ZV5OKQ3Z.cjs.map +1 -0
- package/dist/{chunk-ZYQ5X6PG.js → chunk-ZYVULRYF.js} +2 -2
- package/dist/chunk-ZYVULRYF.js.map +1 -0
- package/dist/chunks-4HEG6ZPG.js +10 -0
- package/dist/cli.js +24 -24
- package/dist/cli.js.map +1 -1
- package/dist/{formula-WKGP3D3Y.cjs → formula-CG4S7TWO.cjs} +8 -8
- package/dist/formula-CG4S7TWO.cjs.map +1 -0
- package/dist/{formula-ETB6MESN.js → formula-JLYS73QL.js} +2 -2
- package/dist/formula-JLYS73QL.js.map +1 -0
- package/dist/{formula-KW4NI5IO.js → formula-LIVQSCMM.js} +2 -2
- package/dist/formula-LIVQSCMM.js.map +1 -0
- package/dist/{image-ocr-C6U7YHRC.js → image-ocr-3A3HZX6O.js} +5 -5
- package/dist/image-ocr-3A3HZX6O.js.map +1 -0
- package/dist/{image-ocr-YIBJCOUQ.js → image-ocr-4MHEX4MN.js} +7 -7
- package/dist/image-ocr-4MHEX4MN.js.map +1 -0
- package/dist/{image-ocr-YID6TDN5.cjs → image-ocr-OB5PCQUU.cjs} +11 -11
- package/dist/image-ocr-OB5PCQUU.cjs.map +1 -0
- package/dist/index.cjs +185 -185
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +20 -20
- package/dist/mcp.js.map +1 -1
- package/dist/{models-6VMAVZR6.js → models-6SIKLKRH.js} +3 -3
- package/dist/page-range-737B4EZW.js +8 -0
- package/dist/page-range-LNMXJU6W.js +7 -0
- package/dist/page-range-P7SDW6LR.cjs +8 -0
- package/dist/page-range-P7SDW6LR.cjs.map +1 -0
- package/dist/{parser-GFXZV2VJ.js → parser-EIVCD4NS.js} +10 -10
- package/dist/parser-EIVCD4NS.js.map +1 -0
- package/dist/{parser-SHM3JEH6.js → parser-EQN4YKU4.js} +8 -8
- package/dist/parser-EQN4YKU4.js.map +1 -0
- package/dist/{parser-EYCVDUJA.cjs → parser-VACM3DFR.cjs} +28 -28
- package/dist/parser-VACM3DFR.cjs.map +1 -0
- package/dist/pdf-ocr-N62EWEX4.js +12 -0
- package/dist/pdf-ocr-NPYDUIC5.js +15 -0
- package/dist/pdf-ocr-OBPQ4F4D.cjs +13 -0
- package/dist/pdf-ocr-OBPQ4F4D.cjs.map +1 -0
- package/dist/{profile-io-FQZNNA3O.js → profile-io-L5EH4JAD.js} +3 -3
- package/dist/{rasterize-QGKFNTXO.js → rasterize-7AR662AL.js} +2 -2
- package/dist/rasterize-7AR662AL.js.map +1 -0
- package/dist/{redact-W5K3ILQH.js → redact-7ILEAUTS.js} +2 -2
- package/dist/render-CAFQT7S4.js +10 -0
- package/dist/seal-ESAC3IZR.js +10 -0
- package/dist/{setup-I4I75QJU.js → setup-GUQT5ELJ.js} +1 -1
- package/dist/setup-GUQT5ELJ.js.map +1 -0
- package/dist/{watch-OIVXH2RN.js → watch-MONT6CGI.js} +12 -12
- package/dist/watch-MONT6CGI.js.map +1 -0
- package/package.json +103 -103
- package/templates//352/260/204/354/235/264/352/270/260/354/225/210/353/254/270_/354/230/210/354/213/234/352/260/222.json +9 -9
- package/templates//354/235/274/353/260/230/352/270/260/354/225/210/353/254/270_/354/230/210/354/213/234/352/260/222.json +24 -24
- package/dist/chunk-2CABQYTT.js.map +0 -1
- package/dist/chunk-2CENWSAW.js.map +0 -1
- package/dist/chunk-3FFPHTXD.js.map +0 -1
- package/dist/chunk-3TBUDJDE.js.map +0 -1
- package/dist/chunk-6GBLFQMA.js.map +0 -1
- package/dist/chunk-6XPXIG57.js.map +0 -1
- package/dist/chunk-7BTO44Q7.js.map +0 -1
- package/dist/chunk-AIQ3ISQU.js.map +0 -1
- package/dist/chunk-CARNWWGI.cjs.map +0 -1
- package/dist/chunk-HPRGVU6A.cjs.map +0 -1
- package/dist/chunk-I42DND3B.cjs.map +0 -1
- package/dist/chunk-IBVMJIHR.js.map +0 -1
- package/dist/chunk-IHK5LCYX.js.map +0 -1
- package/dist/chunk-KC63W72C.js.map +0 -1
- package/dist/chunk-KQOTL4WI.js.map +0 -1
- package/dist/chunk-MGGU3ZRK.cjs.map +0 -1
- package/dist/chunk-MSMSHU2F.js.map +0 -1
- package/dist/chunk-O5EK52TG.js.map +0 -1
- package/dist/chunk-OPL22SYF.js.map +0 -1
- package/dist/chunk-PQDNCWAZ.js.map +0 -1
- package/dist/chunk-PSAHY5XW.js.map +0 -1
- package/dist/chunk-UGKXJA3W.js.map +0 -1
- package/dist/chunk-UQ4NSK66.js.map +0 -1
- package/dist/chunk-VNEV6VKD.js.map +0 -1
- package/dist/chunk-W34QSJFF.js.map +0 -1
- package/dist/chunk-WX7WQTOT.cjs.map +0 -1
- package/dist/chunk-X34YWRL5.cjs.map +0 -1
- package/dist/chunk-YNJDNP44.js.map +0 -1
- package/dist/chunk-ZYQ5X6PG.js.map +0 -1
- package/dist/chunks-Y2VE2WCJ.js +0 -10
- package/dist/formula-ETB6MESN.js.map +0 -1
- package/dist/formula-KW4NI5IO.js.map +0 -1
- package/dist/formula-WKGP3D3Y.cjs.map +0 -1
- package/dist/image-ocr-C6U7YHRC.js.map +0 -1
- package/dist/image-ocr-YIBJCOUQ.js.map +0 -1
- package/dist/image-ocr-YID6TDN5.cjs.map +0 -1
- package/dist/page-range-CIRRJPXJ.js +0 -7
- package/dist/page-range-OF5I4PQY.js +0 -8
- package/dist/page-range-TPIRSA3J.cjs +0 -8
- package/dist/page-range-TPIRSA3J.cjs.map +0 -1
- package/dist/parser-EYCVDUJA.cjs.map +0 -1
- package/dist/parser-GFXZV2VJ.js.map +0 -1
- package/dist/parser-SHM3JEH6.js.map +0 -1
- package/dist/pdf-ocr-TMAWPOHC.cjs +0 -13
- package/dist/pdf-ocr-TMAWPOHC.cjs.map +0 -1
- package/dist/pdf-ocr-UKFYODLP.js +0 -15
- package/dist/pdf-ocr-ZG4UVUIT.js +0 -12
- package/dist/rasterize-QGKFNTXO.js.map +0 -1
- package/dist/render-YFIWQYVB.js +0 -10
- package/dist/seal-GZ7NDWLR.js +0 -10
- package/dist/setup-I4I75QJU.js.map +0 -1
- package/dist/watch-OIVXH2RN.js.map +0 -1
- /package/dist/{-DEVLQKIT.js.map → -MK2223RL.js.map} +0 -0
- /package/dist/{chunks-Y2VE2WCJ.js.map → chunks-4HEG6ZPG.js.map} +0 -0
- /package/dist/{models-6VMAVZR6.js.map → models-6SIKLKRH.js.map} +0 -0
- /package/dist/{page-range-CIRRJPXJ.js.map → page-range-737B4EZW.js.map} +0 -0
- /package/dist/{page-range-OF5I4PQY.js.map → page-range-LNMXJU6W.js.map} +0 -0
- /package/dist/{pdf-ocr-UKFYODLP.js.map → pdf-ocr-N62EWEX4.js.map} +0 -0
- /package/dist/{pdf-ocr-ZG4UVUIT.js.map → pdf-ocr-NPYDUIC5.js.map} +0 -0
- /package/dist/{profile-io-FQZNNA3O.js.map → profile-io-L5EH4JAD.js.map} +0 -0
- /package/dist/{redact-W5K3ILQH.js.map → redact-7ILEAUTS.js.map} +0 -0
- /package/dist/{render-YFIWQYVB.js.map → render-CAFQT7S4.js.map} +0 -0
- /package/dist/{seal-GZ7NDWLR.js.map → seal-ESAC3IZR.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkW5KRKBYRcjs = require('./chunk-W5KRKBYR.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkDCZVOIEOcjs = require('./chunk-DCZVOIEO.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -27,7 +27,7 @@ var _chunkX34YWRL5cjs = require('./chunk-X34YWRL5.cjs');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkTUU535RBcjs = require('./chunk-TUU535RB.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
var _chunkGS7T56RPcjs = require('./chunk-GS7T56RP.cjs');
|
|
@@ -482,7 +482,7 @@ function rawTextContent(node, depth = 0) {
|
|
|
482
482
|
// src/hwpx/parser-shared.ts
|
|
483
483
|
var MAX_DECOMPRESS_SIZE = 256 * 1024 * 1024;
|
|
484
484
|
var MAX_ZIP_ENTRIES = 500;
|
|
485
|
-
var ZipBombError = class extends
|
|
485
|
+
var ZipBombError = class extends _chunkTUU535RBcjs.KordocError {
|
|
486
486
|
constructor(message) {
|
|
487
487
|
super(message);
|
|
488
488
|
this.name = "ZipBombError";
|
|
@@ -497,7 +497,7 @@ function createSectionShared() {
|
|
|
497
497
|
function createXmlParser(warnings) {
|
|
498
498
|
return new (0, _xmldom.DOMParser)({
|
|
499
499
|
onError(level, msg2) {
|
|
500
|
-
if (level === "fatalError") throw new (0,
|
|
500
|
+
if (level === "fatalError") throw new (0, _chunkTUU535RBcjs.KordocError)(`XML \uD30C\uC2F1 \uC2E4\uD328: ${msg2}`);
|
|
501
501
|
_optionalChain([warnings, 'optionalAccess', _3 => _3.push, 'call', _4 => _4({ code: "MALFORMED_XML", message: `XML ${level === "warning" ? "\uACBD\uACE0" : "\uC624\uB958"}: ${msg2}` })]);
|
|
502
502
|
}
|
|
503
503
|
});
|
|
@@ -532,13 +532,13 @@ function parseEncryptionManifest(manifestXml) {
|
|
|
532
532
|
const startKey = attrOf(inner, "start-key-generation-name");
|
|
533
533
|
const checksumType = attrOf(inner, "checksum-type");
|
|
534
534
|
if (algorithm !== AES256_CBC) {
|
|
535
|
-
throw new (0,
|
|
535
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWPX \uC554\uD638\uD654 \uBC29\uC2DD\uC785\uB2C8\uB2E4: ${_nullishCoalesce(algorithm, () => ( "(\uBBF8\uC0C1)"))}`);
|
|
536
536
|
}
|
|
537
537
|
if (startKey !== START_KEY_SHA256) {
|
|
538
|
-
throw new (0,
|
|
538
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWPX \uC2DC\uC791\uD0A4 \uC0DD\uC131 \uBC29\uC2DD\uC785\uB2C8\uB2E4: ${_nullishCoalesce(startKey, () => ( "(\uBBF8\uC0C1)"))}`);
|
|
539
539
|
}
|
|
540
540
|
if (!_optionalChain([checksumType, 'optionalAccess', _8 => _8.endsWith, 'call', _9 => _9(CHECKSUM_SHA256_1K)])) {
|
|
541
|
-
throw new (0,
|
|
541
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWPX \uCCB4\uD06C\uC12C \uBC29\uC2DD\uC785\uB2C8\uB2E4: ${_nullishCoalesce(checksumType, () => ( "(\uBBF8\uC0C1)"))}`);
|
|
542
542
|
}
|
|
543
543
|
const iterations = parseInt(_nullishCoalesce(attrOf(inner, "iteration-count"), () => ( "")), 10);
|
|
544
544
|
const keySize = parseInt(_nullishCoalesce(attrOf(inner, "key-size"), () => ( "")), 10);
|
|
@@ -546,10 +546,10 @@ function parseEncryptionManifest(manifestXml) {
|
|
|
546
546
|
const salt = Buffer.from(_nullishCoalesce(attrOf(inner, "salt"), () => ( "")), "base64");
|
|
547
547
|
const checksum = Buffer.from(_nullishCoalesce(attrOf(inner, "checksum"), () => ( "")), "base64");
|
|
548
548
|
if (!(iterations > 0 && iterations <= MAX_ITERATION_COUNT)) {
|
|
549
|
-
throw new (0,
|
|
549
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(`HWPX \uC554\uD638\uD654 \uBC18\uBCF5 \uD69F\uC218\uAC00 \uD5C8\uC6A9 \uBC94\uC704\uB97C \uBC97\uC5B4\uB0AC\uC2B5\uB2C8\uB2E4: ${iterations}`);
|
|
550
550
|
}
|
|
551
551
|
if (keySize !== 32 || iv.length !== 16 || salt.length === 0 || checksum.length !== 32) {
|
|
552
|
-
throw new (0,
|
|
552
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(`HWPX \uC554\uD638\uD654 \uD30C\uB77C\uBBF8\uD130\uAC00 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 (${path})`);
|
|
553
553
|
}
|
|
554
554
|
entries.push({ path, checksum, iv, salt, iterations, keySize });
|
|
555
555
|
}
|
|
@@ -582,11 +582,11 @@ async function decryptHwpxInPlace(zip, manifestXml, password) {
|
|
|
582
582
|
for (const entry of entries) {
|
|
583
583
|
const file = zip.file(entry.path);
|
|
584
584
|
if (!file) {
|
|
585
|
-
throw new (0,
|
|
585
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(`\uC554\uD638 \uBAA9\uB85D\uC5D0 \uC788\uB294 \uD30C\uC77C\uC774 \uBB38\uC11C\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4: ${entry.path}`);
|
|
586
586
|
}
|
|
587
587
|
const plain = decryptEntry(await file.async("nodebuffer"), entry, startKey);
|
|
588
588
|
if (!plain) {
|
|
589
|
-
throw new (0,
|
|
589
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("\uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uAC70\uB098 \uC554\uD638\uD654 \uB370\uC774\uD130\uAC00 \uC190\uC0C1\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
590
590
|
}
|
|
591
591
|
decrypted.push({ path: entry.path, plain });
|
|
592
592
|
}
|
|
@@ -634,10 +634,10 @@ async function extractHwpxStyles(zip, decompressed) {
|
|
|
634
634
|
const xml = await file.async("text");
|
|
635
635
|
if (decompressed) {
|
|
636
636
|
decompressed.total += xml.length * 2;
|
|
637
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
637
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkTUU535RBcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
638
638
|
}
|
|
639
639
|
const parser = createXmlParser();
|
|
640
|
-
const doc = parser.parseFromString(
|
|
640
|
+
const doc = parser.parseFromString(_chunkTUU535RBcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
641
641
|
if (!doc.documentElement) continue;
|
|
642
642
|
const domDoc = doc;
|
|
643
643
|
parseCharProperties(domDoc, result.charProperties);
|
|
@@ -824,9 +824,9 @@ function detectHwpxHeadings(blocks, styleMap) {
|
|
|
824
824
|
let level = 0;
|
|
825
825
|
if (baseFontSize > 0 && _optionalChain([block, 'access', _16 => _16.style, 'optionalAccess', _17 => _17.fontSize])) {
|
|
826
826
|
const ratio = block.style.fontSize / baseFontSize;
|
|
827
|
-
if (ratio >=
|
|
828
|
-
else if (ratio >=
|
|
829
|
-
else if (ratio >=
|
|
827
|
+
if (ratio >= _chunkTUU535RBcjs.HEADING_RATIO_H1) level = 1;
|
|
828
|
+
else if (ratio >= _chunkTUU535RBcjs.HEADING_RATIO_H2) level = 2;
|
|
829
|
+
else if (ratio >= _chunkTUU535RBcjs.HEADING_RATIO_H3) level = 3;
|
|
830
830
|
}
|
|
831
831
|
const compactText = text.replace(/\s+/g, "");
|
|
832
832
|
if (/^제\d+[조장절편]/.test(compactText) && text.length <= 50) {
|
|
@@ -1419,7 +1419,7 @@ function resolveParaHeading(paraEl, ctx) {
|
|
|
1419
1419
|
|
|
1420
1420
|
// src/hwpx/table-build.ts
|
|
1421
1421
|
function buildTableWithCellMeta(state, keepAnchoredEmptyCols, keepEmptyParagraphs) {
|
|
1422
|
-
const table2 =
|
|
1422
|
+
const table2 = _chunkW5KRKBYRcjs.buildTable.call(void 0, state.rows, { keepAnchoredEmptyCols, keepEmptyParagraphs });
|
|
1423
1423
|
if (state.caption) table2.caption = state.caption;
|
|
1424
1424
|
if (_optionalChain([state, 'access', _21 => _21.captionBlocks, 'optionalAccess', _22 => _22.length])) table2.captionBlocks = state.captionBlocks;
|
|
1425
1425
|
const anchors = [];
|
|
@@ -1490,7 +1490,7 @@ function completeTable(newTable, tableStack, blocks, ctx) {
|
|
|
1490
1490
|
const cell2 = parentTable.cell;
|
|
1491
1491
|
(cell2.blocks ??= []).push(block);
|
|
1492
1492
|
cell2.hasStructure = true;
|
|
1493
|
-
let flat =
|
|
1493
|
+
let flat = _chunkW5KRKBYRcjs.convertTableToText.call(void 0, newTable.rows);
|
|
1494
1494
|
if (newTable.caption) flat = newTable.caption + (flat ? "\n" + flat : "");
|
|
1495
1495
|
if (flat) {
|
|
1496
1496
|
const inlineJoin = newTable.inline === true && cell2.lineOpen === true;
|
|
@@ -1506,7 +1506,7 @@ function completeTable(newTable, tableStack, blocks, ctx) {
|
|
|
1506
1506
|
// src/hwpx/section-walker.ts
|
|
1507
1507
|
function parseSectionXml(xml, styleMap, warnings, sectionNum, shared) {
|
|
1508
1508
|
const parser = createXmlParser(warnings);
|
|
1509
|
-
const doc = parser.parseFromString(
|
|
1509
|
+
const doc = parser.parseFromString(_chunkTUU535RBcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
1510
1510
|
if (!doc.documentElement) return [];
|
|
1511
1511
|
const ctx = { styleMap, warnings, sectionNum, shared: _nullishCoalesce(shared, () => ( createSectionShared())) };
|
|
1512
1512
|
ctx.shared.track.deleteDepth = 0;
|
|
@@ -1613,8 +1613,8 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
|
|
|
1613
1613
|
const cs = isNaN(rawCs) ? 1 : rawCs;
|
|
1614
1614
|
const rawRs = parseInt(el.getAttribute("rowSpan") || "1", 10);
|
|
1615
1615
|
const rs = isNaN(rawRs) ? 1 : rawRs;
|
|
1616
|
-
tableCtx.cell.colSpan = clampSpan(cs,
|
|
1617
|
-
tableCtx.cell.rowSpan = clampSpan(rs,
|
|
1616
|
+
tableCtx.cell.colSpan = clampSpan(cs, _chunkW5KRKBYRcjs.MAX_COLS);
|
|
1617
|
+
tableCtx.cell.rowSpan = clampSpan(rs, _chunkW5KRKBYRcjs.MAX_ROWS);
|
|
1618
1618
|
}
|
|
1619
1619
|
break;
|
|
1620
1620
|
case "p": {
|
|
@@ -1885,7 +1885,7 @@ function buildSubListTable(el, ctx, depth) {
|
|
|
1885
1885
|
const sink = [];
|
|
1886
1886
|
const st = { rows: [], currentRow: [], cell: null };
|
|
1887
1887
|
walkSection(el, sink, st, [], ctx, depth + 1);
|
|
1888
|
-
let flat =
|
|
1888
|
+
let flat = _chunkW5KRKBYRcjs.convertTableToText.call(void 0, st.rows);
|
|
1889
1889
|
if (st.caption) flat = st.caption + (flat ? "\n" + flat : "");
|
|
1890
1890
|
const built = [];
|
|
1891
1891
|
completeTable(st, [], built, ctx);
|
|
@@ -2040,7 +2040,7 @@ function extractHyperlinkHref(fieldBegin) {
|
|
|
2040
2040
|
let url = (ch.textContent || "").trim();
|
|
2041
2041
|
if (!url) continue;
|
|
2042
2042
|
url = url.replace(/^https?:\/\/(?=https?:\/\/)/i, "");
|
|
2043
|
-
const safe =
|
|
2043
|
+
const safe = _chunkTUU535RBcjs.sanitizeHref.call(void 0, url);
|
|
2044
2044
|
if (safe) return safe;
|
|
2045
2045
|
}
|
|
2046
2046
|
return void 0;
|
|
@@ -2200,7 +2200,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
|
|
|
2200
2200
|
case "hyperlink": {
|
|
2201
2201
|
const url = child.getAttribute("url") || child.getAttribute("href") || "";
|
|
2202
2202
|
if (url) {
|
|
2203
|
-
const safe =
|
|
2203
|
+
const safe = _chunkTUU535RBcjs.sanitizeHref.call(void 0, url);
|
|
2204
2204
|
if (safe) href = safe;
|
|
2205
2205
|
}
|
|
2206
2206
|
walk(child, depth + 1);
|
|
@@ -2481,7 +2481,7 @@ function decompressStream(data) {
|
|
|
2481
2481
|
return _zlib.inflateRawSync.call(void 0, data, opts);
|
|
2482
2482
|
}
|
|
2483
2483
|
function parseFileHeader(data) {
|
|
2484
|
-
if (data.length < 40) throw new (0,
|
|
2484
|
+
if (data.length < 40) throw new (0, _chunkTUU535RBcjs.KordocError)("FileHeader\uAC00 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4 (\uCD5C\uC18C 40\uBC14\uC774\uD2B8)");
|
|
2485
2485
|
const sig = data.subarray(0, 32).toString("utf8").replace(/\0+$/, "");
|
|
2486
2486
|
return {
|
|
2487
2487
|
signature: sig,
|
|
@@ -2933,13 +2933,13 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
2933
2933
|
}
|
|
2934
2934
|
const allCandidates = resolvedPath ? [resolvedPath, ...candidates] : candidates;
|
|
2935
2935
|
for (const path of allCandidates) {
|
|
2936
|
-
if (
|
|
2936
|
+
if (_chunkTUU535RBcjs.isPathTraversal.call(void 0, path)) continue;
|
|
2937
2937
|
const file = zip.file(path);
|
|
2938
2938
|
if (!file) continue;
|
|
2939
2939
|
try {
|
|
2940
2940
|
const data = await file.async("uint8array");
|
|
2941
2941
|
decompressed.total += data.length;
|
|
2942
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
2942
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkTUU535RBcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
2943
2943
|
const ext = path.includes(".") ? path.split(".").pop() || "png" : "png";
|
|
2944
2944
|
const mimeType = imageExtToMime(ext);
|
|
2945
2945
|
imageIndex++;
|
|
@@ -2949,7 +2949,7 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
2949
2949
|
usedPaths.add(path);
|
|
2950
2950
|
break;
|
|
2951
2951
|
} catch (err) {
|
|
2952
|
-
if (err instanceof
|
|
2952
|
+
if (err instanceof _chunkTUU535RBcjs.KordocError) throw err;
|
|
2953
2953
|
}
|
|
2954
2954
|
}
|
|
2955
2955
|
if (!img) _optionalChain([warnings, 'optionalAccess', _80 => _80.push, 'call', _81 => _81({ page: block.pageNumber, message: `\uC774\uBBF8\uC9C0 \uD30C\uC77C \uC5C6\uC74C: ${ref}`, code: "SKIPPED_IMAGE" })]);
|
|
@@ -2969,11 +2969,11 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
2969
2969
|
if (sweepUnreferenced) {
|
|
2970
2970
|
const binEntries = zip.file(/(?:^|\/)BinData\//i);
|
|
2971
2971
|
for (const file of binEntries) {
|
|
2972
|
-
if (file.dir || usedPaths.has(file.name) ||
|
|
2972
|
+
if (file.dir || usedPaths.has(file.name) || _chunkTUU535RBcjs.isPathTraversal.call(void 0, file.name)) continue;
|
|
2973
2973
|
try {
|
|
2974
2974
|
const data = await file.async("uint8array");
|
|
2975
2975
|
decompressed.total += data.length;
|
|
2976
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
2976
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkTUU535RBcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
2977
2977
|
const ext = file.name.includes(".") ? file.name.split(".").pop() || "" : "";
|
|
2978
2978
|
let mimeType = imageExtToMime(ext);
|
|
2979
2979
|
if (mimeType === "application/octet-stream") {
|
|
@@ -2987,7 +2987,7 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
2987
2987
|
images.push(img);
|
|
2988
2988
|
blocks.push({ type: "image", text: filename, imageData: { data, mimeType, filename: file.name } });
|
|
2989
2989
|
} catch (err) {
|
|
2990
|
-
if (err instanceof
|
|
2990
|
+
if (err instanceof _chunkTUU535RBcjs.KordocError) throw err;
|
|
2991
2991
|
_optionalChain([warnings, 'optionalAccess', _82 => _82.push, 'call', _83 => _83({ message: `\uC774\uBBF8\uC9C0 \uCD94\uCD9C \uC2E4\uD328: ${file.name}`, code: "SKIPPED_IMAGE" })]);
|
|
2992
2992
|
}
|
|
2993
2993
|
}
|
|
@@ -3038,7 +3038,7 @@ function extractFromBrokenZip(buffer) {
|
|
|
3038
3038
|
}
|
|
3039
3039
|
const nameBytes = data.slice(pos + 30, pos + 30 + nameLen);
|
|
3040
3040
|
const name = new TextDecoder().decode(nameBytes);
|
|
3041
|
-
if (
|
|
3041
|
+
if (_chunkTUU535RBcjs.isPathTraversal.call(void 0, name)) {
|
|
3042
3042
|
pos = fileStart + compSize;
|
|
3043
3043
|
continue;
|
|
3044
3044
|
}
|
|
@@ -3056,16 +3056,16 @@ function extractFromBrokenZip(buffer) {
|
|
|
3056
3056
|
continue;
|
|
3057
3057
|
}
|
|
3058
3058
|
totalDecompressed += content.length * 2;
|
|
3059
|
-
if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
3059
|
+
if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0, _chunkTUU535RBcjs.KordocError)("\uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC");
|
|
3060
3060
|
sectionNum++;
|
|
3061
3061
|
blocks.push(...parseSectionXml(content, void 0, warnings, sectionNum, shared));
|
|
3062
3062
|
} catch (e17) {
|
|
3063
3063
|
continue;
|
|
3064
3064
|
}
|
|
3065
3065
|
}
|
|
3066
|
-
if (blocks.length === 0) throw new (0,
|
|
3066
|
+
if (blocks.length === 0) throw new (0, _chunkTUU535RBcjs.KordocError)("\uC190\uC0C1\uB41C HWPX\uC5D0\uC11C \uC139\uC158 \uB370\uC774\uD130\uB97C \uBCF5\uAD6C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
3067
3067
|
applyPageText(blocks, shared);
|
|
3068
|
-
const markdown =
|
|
3068
|
+
const markdown = _chunkW5KRKBYRcjs.blocksToMarkdown.call(void 0, blocks);
|
|
3069
3069
|
return { markdown, blocks, warnings: warnings.length > 0 ? warnings : void 0 };
|
|
3070
3070
|
}
|
|
3071
3071
|
async function readKordocLayout(zip) {
|
|
@@ -3090,18 +3090,18 @@ async function resolveSectionPaths(zip) {
|
|
|
3090
3090
|
if (paths.length > 0) return paths;
|
|
3091
3091
|
}
|
|
3092
3092
|
const sectionFiles = zip.file(/[Ss]ection\d+\.xml$/);
|
|
3093
|
-
return sectionFiles.map((f) => f.name).sort(
|
|
3093
|
+
return sectionFiles.map((f) => f.name).sort(_chunkTUU535RBcjs.compareSectionPaths);
|
|
3094
3094
|
}
|
|
3095
3095
|
function parseSectionPathsFromManifest(xml) {
|
|
3096
3096
|
const parser = createXmlParser();
|
|
3097
|
-
const doc = parser.parseFromString(
|
|
3097
|
+
const doc = parser.parseFromString(_chunkTUU535RBcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
3098
3098
|
const items = doc.getElementsByTagName("opf:item");
|
|
3099
3099
|
const spine = doc.getElementsByTagName("opf:itemref");
|
|
3100
3100
|
const idToHref = /* @__PURE__ */ new Map();
|
|
3101
3101
|
for (let i = 0; i < items.length; i++) {
|
|
3102
3102
|
const item = items[i];
|
|
3103
3103
|
const id = item.getAttribute("id") || "";
|
|
3104
|
-
const href =
|
|
3104
|
+
const href = _chunkTUU535RBcjs.normalizeSectionHref.call(void 0, item.getAttribute("href") || "");
|
|
3105
3105
|
if (id && href) idToHref.set(id, href);
|
|
3106
3106
|
}
|
|
3107
3107
|
if (spine.length > 0) {
|
|
@@ -3112,7 +3112,7 @@ function parseSectionPathsFromManifest(xml) {
|
|
|
3112
3112
|
}
|
|
3113
3113
|
if (ordered.length > 0) return ordered;
|
|
3114
3114
|
}
|
|
3115
|
-
return Array.from(idToHref.values()).sort(
|
|
3115
|
+
return Array.from(idToHref.values()).sort(_chunkTUU535RBcjs.compareSectionPaths);
|
|
3116
3116
|
}
|
|
3117
3117
|
|
|
3118
3118
|
// src/hwpx/metadata.ts
|
|
@@ -3125,7 +3125,7 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
|
|
|
3125
3125
|
const xml = await file.async("text");
|
|
3126
3126
|
if (decompressed) {
|
|
3127
3127
|
decompressed.total += xml.length * 2;
|
|
3128
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
3128
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkTUU535RBcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
3129
3129
|
}
|
|
3130
3130
|
parseDublinCoreMetadata(xml, metadata);
|
|
3131
3131
|
if (metadata.title || metadata.author) return;
|
|
@@ -3135,7 +3135,7 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
|
|
|
3135
3135
|
}
|
|
3136
3136
|
function parseDublinCoreMetadata(xml, metadata) {
|
|
3137
3137
|
const parser = createXmlParser();
|
|
3138
|
-
const doc = parser.parseFromString(
|
|
3138
|
+
const doc = parser.parseFromString(_chunkTUU535RBcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
3139
3139
|
if (!doc.documentElement) return;
|
|
3140
3140
|
const getText = (tagNames) => {
|
|
3141
3141
|
for (const tag of tagNames) {
|
|
@@ -3160,7 +3160,7 @@ function parseDublinCoreMetadata(xml, metadata) {
|
|
|
3160
3160
|
|
|
3161
3161
|
// src/hwpx/parser.ts
|
|
3162
3162
|
async function parseHwpxDocument(buffer, options) {
|
|
3163
|
-
|
|
3163
|
+
_chunkTUU535RBcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
|
|
3164
3164
|
let zip;
|
|
3165
3165
|
try {
|
|
3166
3166
|
zip = await _jszip2.default.loadAsync(buffer);
|
|
@@ -3169,7 +3169,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3169
3169
|
}
|
|
3170
3170
|
const actualEntryCount = Object.keys(zip.files).length;
|
|
3171
3171
|
if (actualEntryCount > MAX_ZIP_ENTRIES) {
|
|
3172
|
-
throw new (0,
|
|
3172
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("ZIP \uC5D4\uD2B8\uB9AC \uC218 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
3173
3173
|
}
|
|
3174
3174
|
const manifestFile = zip.file("META-INF/manifest.xml");
|
|
3175
3175
|
if (manifestFile) {
|
|
@@ -3184,7 +3184,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3184
3184
|
return comResultToParseResult(pages, pageCount, warnings2);
|
|
3185
3185
|
}
|
|
3186
3186
|
}
|
|
3187
|
-
throw new (0,
|
|
3187
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(
|
|
3188
3188
|
"\uC554\uD638\uB85C \uBCF4\uD638\uB41C HWPX \uD30C\uC77C\uC785\uB2C8\uB2E4. password \uC635\uC158\uC5D0 \uC5F4\uAE30 \uC554\uD638\uB97C \uC9C0\uC815\uD558\uC138\uC694."
|
|
3189
3189
|
);
|
|
3190
3190
|
}
|
|
@@ -3196,9 +3196,9 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3196
3196
|
const styleMap = await extractHwpxStyles(zip, decompressed);
|
|
3197
3197
|
const warnings = [];
|
|
3198
3198
|
const sectionPaths = await resolveSectionPaths(zip);
|
|
3199
|
-
if (sectionPaths.length === 0) throw new (0,
|
|
3199
|
+
if (sectionPaths.length === 0) throw new (0, _chunkTUU535RBcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
3200
3200
|
metadata.pageCount = sectionPaths.length;
|
|
3201
|
-
const pageFilter = _optionalChain([options, 'optionalAccess', _93 => _93.pages]) ?
|
|
3201
|
+
const pageFilter = _optionalChain([options, 'optionalAccess', _93 => _93.pages]) ? _chunkDCZVOIEOcjs.parsePageRange.call(void 0, options.pages, sectionPaths.length) : null;
|
|
3202
3202
|
const totalTarget = pageFilter ? pageFilter.size : sectionPaths.length;
|
|
3203
3203
|
const blocks = [];
|
|
3204
3204
|
const shared = createSectionShared();
|
|
@@ -3226,7 +3226,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3226
3226
|
const images = await extractImagesFromZip(zip, blocks, decompressed, warnings, !pageFilter);
|
|
3227
3227
|
detectHwpxHeadings(blocks, styleMap);
|
|
3228
3228
|
const outline = blocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
|
|
3229
|
-
const markdown =
|
|
3229
|
+
const markdown = _chunkW5KRKBYRcjs.blocksToMarkdown.call(void 0, blocks);
|
|
3230
3230
|
return { markdown, blocks, metadata, outline: outline.length > 0 ? outline : void 0, warnings: warnings.length > 0 ? warnings : void 0, images: images.length > 0 ? images : void 0 };
|
|
3231
3231
|
}
|
|
3232
3232
|
|
|
@@ -4226,7 +4226,7 @@ function decryptPasswordStream(raw, password) {
|
|
|
4226
4226
|
var TAG_DOCUMENT_PROPERTIES = 16;
|
|
4227
4227
|
var TAG_ID_MAPPINGS = 17;
|
|
4228
4228
|
function assertDecryptedDocInfo(data, readRecords3) {
|
|
4229
|
-
const wrong = () => new (0,
|
|
4229
|
+
const wrong = () => new (0, _chunkTUU535RBcjs.KordocError)("\uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uAC70\uB098 \uC554\uD638\uD654 \uB370\uC774\uD130\uAC00 \uC190\uC0C1\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
4230
4230
|
let records;
|
|
4231
4231
|
try {
|
|
4232
4232
|
records = readRecords3(data);
|
|
@@ -4238,7 +4238,7 @@ function assertDecryptedDocInfo(data, readRecords3) {
|
|
|
4238
4238
|
}
|
|
4239
4239
|
function assertSupportedEncryptVersion(version) {
|
|
4240
4240
|
if (version !== SUPPORTED_ENCRYPT_VERSION) {
|
|
4241
|
-
throw new (0,
|
|
4241
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(
|
|
4242
4242
|
`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWP \uC554\uD638\uD654 \uBC84\uC804\uC785\uB2C8\uB2E4 (EncryptVersion=${version}, \uC9C0\uC6D0: ${SUPPORTED_ENCRYPT_VERSION})`
|
|
4243
4243
|
);
|
|
4244
4244
|
}
|
|
@@ -4321,7 +4321,7 @@ function parseHwp5Document(buffer, options) {
|
|
|
4321
4321
|
lenientCfb = parseLenientCfb(buffer);
|
|
4322
4322
|
warnings.push({ message: "\uC190\uC0C1\uB41C CFB \uCEE8\uD14C\uC774\uB108 \u2014 lenient \uBAA8\uB4DC\uB85C \uBCF5\uAD6C", code: "LENIENT_CFB_RECOVERY" });
|
|
4323
4323
|
} catch (e24) {
|
|
4324
|
-
throw new (0,
|
|
4324
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("CFB \uCEE8\uD14C\uC774\uB108 \uD30C\uC2F1 \uC2E4\uD328 (strict \uBC0F lenient \uBAA8\uB450)");
|
|
4325
4325
|
}
|
|
4326
4326
|
}
|
|
4327
4327
|
const readRawStream = (path) => {
|
|
@@ -4332,14 +4332,14 @@ function parseHwp5Document(buffer, options) {
|
|
|
4332
4332
|
return lenientCfb.findStream(path);
|
|
4333
4333
|
};
|
|
4334
4334
|
const headerData = readRawStream("/FileHeader");
|
|
4335
|
-
if (!headerData) throw new (0,
|
|
4335
|
+
if (!headerData) throw new (0, _chunkTUU535RBcjs.KordocError)("FileHeader \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
|
|
4336
4336
|
const header = parseFileHeader(headerData);
|
|
4337
|
-
if (header.signature !== "HWP Document File") throw new (0,
|
|
4338
|
-
if (header.flags & FLAG_DRM) throw new (0,
|
|
4337
|
+
if (header.signature !== "HWP Document File") throw new (0, _chunkTUU535RBcjs.KordocError)("HWP \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
|
|
4338
|
+
if (header.flags & FLAG_DRM) throw new (0, _chunkTUU535RBcjs.KordocError)("DRM \uBCF4\uD638\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
4339
4339
|
const encrypted = (header.flags & FLAG_ENCRYPTED) !== 0;
|
|
4340
4340
|
if (encrypted) {
|
|
4341
4341
|
if (!_optionalChain([options, 'optionalAccess', _101 => _101.password])) {
|
|
4342
|
-
throw new (0,
|
|
4342
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("\uC554\uD638\uB85C \uBCF4\uD638\uB41C HWP \uBB38\uC11C\uC785\uB2C8\uB2E4. password \uC635\uC158\uC5D0 \uC5F4\uAE30 \uC554\uD638\uB97C \uC9C0\uC815\uD558\uC138\uC694.");
|
|
4343
4343
|
}
|
|
4344
4344
|
assertSupportedEncryptVersion(readEncryptVersion(headerData));
|
|
4345
4345
|
}
|
|
@@ -4357,20 +4357,20 @@ function parseHwp5Document(buffer, options) {
|
|
|
4357
4357
|
if (cfb) extractHwp5Metadata(cfb, metadata);
|
|
4358
4358
|
if (encrypted) {
|
|
4359
4359
|
const rawDocInfo = findStream("/DocInfo");
|
|
4360
|
-
if (!rawDocInfo) throw new (0,
|
|
4360
|
+
if (!rawDocInfo) throw new (0, _chunkTUU535RBcjs.KordocError)("DocInfo \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
|
|
4361
4361
|
let docInfoData;
|
|
4362
4362
|
try {
|
|
4363
4363
|
docInfoData = compressed ? decompressStream(rawDocInfo) : rawDocInfo;
|
|
4364
4364
|
} catch (e25) {
|
|
4365
|
-
throw new (0,
|
|
4365
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("\uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uAC70\uB098 \uC554\uD638\uD654 \uB370\uC774\uD130\uAC00 \uC190\uC0C1\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
4366
4366
|
}
|
|
4367
4367
|
assertDecryptedDocInfo(docInfoData, readRecords);
|
|
4368
4368
|
}
|
|
4369
4369
|
const docInfo = cfb && !encrypted ? parseDocInfoStream(cfb, compressed) : parseDocInfoFromStream(findStream("/DocInfo"), compressed);
|
|
4370
4370
|
const sections = distribution ? cfb ? findViewTextSections(cfb, compressed) : findViewTextSectionsLenient(lenientCfb, compressed) : encrypted ? findSectionsVia(findStream) : cfb ? findSections(cfb) : findSectionsLenient(lenientCfb, compressed);
|
|
4371
|
-
if (sections.length === 0) throw new (0,
|
|
4371
|
+
if (sections.length === 0) throw new (0, _chunkTUU535RBcjs.KordocError)("\uC139\uC158 \uC2A4\uD2B8\uB9BC\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
4372
4372
|
metadata.pageCount = sections.length;
|
|
4373
|
-
const pageFilter = _optionalChain([options, 'optionalAccess', _102 => _102.pages]) ?
|
|
4373
|
+
const pageFilter = _optionalChain([options, 'optionalAccess', _102 => _102.pages]) ? _chunkDCZVOIEOcjs.parsePageRange.call(void 0, options.pages, sections.length) : null;
|
|
4374
4374
|
const totalTarget = pageFilter ? pageFilter.size : sections.length;
|
|
4375
4375
|
const bodyBlocks = [];
|
|
4376
4376
|
const doc = createHwp5DocState();
|
|
@@ -4383,22 +4383,22 @@ function parseHwp5Document(buffer, options) {
|
|
|
4383
4383
|
const sectionData = sections[si];
|
|
4384
4384
|
const data = !distribution && compressed ? decompressStream(Buffer.from(sectionData)) : Buffer.from(sectionData);
|
|
4385
4385
|
totalDecompressed += data.length;
|
|
4386
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
4386
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkTUU535RBcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
4387
4387
|
const records = readRecords(data);
|
|
4388
4388
|
const sectionBlocks = parseSection(records, docInfo, warnings, si + 1, doc);
|
|
4389
4389
|
bodyBlocks.push(...sectionBlocks);
|
|
4390
4390
|
parsedSections++;
|
|
4391
4391
|
_optionalChain([options, 'optionalAccess', _104 => _104.onProgress, 'optionalCall', _105 => _105(parsedSections, totalTarget)]);
|
|
4392
4392
|
} catch (secErr) {
|
|
4393
|
-
if (secErr instanceof
|
|
4393
|
+
if (secErr instanceof _chunkTUU535RBcjs.KordocError) throw secErr;
|
|
4394
4394
|
warnings.push({ page: si + 1, message: `\uC139\uC158 ${si + 1} \uD30C\uC2F1 \uC2E4\uD328: ${secErr instanceof Error ? secErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "PARTIAL_PARSE" });
|
|
4395
4395
|
}
|
|
4396
4396
|
}
|
|
4397
4397
|
const blocks = [...doc.headerBlocks, ...bodyBlocks, ...doc.footerBlocks];
|
|
4398
4398
|
const images = cfb ? extractHwp5Images(cfb.FileIndex, blocks, warnings, !pageFilter) : extractHwp5ImagesLenient(lenientCfb, blocks, warnings, !pageFilter);
|
|
4399
|
-
let flatBlocks =
|
|
4399
|
+
let flatBlocks = _chunkW5KRKBYRcjs.flattenLayoutTables.call(void 0, blocks);
|
|
4400
4400
|
if (_optionalChain([options, 'optionalAccess', _106 => _106.dedupeRunningHeaders])) {
|
|
4401
|
-
const deduped =
|
|
4401
|
+
const deduped = _chunkW5KRKBYRcjs.dedupeRunningHeaders.call(void 0, flatBlocks);
|
|
4402
4402
|
const removed = flatBlocks.length - deduped.length;
|
|
4403
4403
|
if (removed > 0) warnings.push({ message: `\uBC18\uBCF5 \uB7EC\uB2DD \uD5E4\uB354 ${removed}\uAC1C \uC81C\uAC70`, code: "HIDDEN_TEXT_FILTERED" });
|
|
4404
4404
|
flatBlocks = deduped;
|
|
@@ -4407,10 +4407,10 @@ function parseHwp5Document(buffer, options) {
|
|
|
4407
4407
|
detectHwp5Headings(flatBlocks, docInfo);
|
|
4408
4408
|
}
|
|
4409
4409
|
const outline = flatBlocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
|
|
4410
|
-
let markdown =
|
|
4410
|
+
let markdown = _chunkW5KRKBYRcjs.blocksToMarkdown.call(void 0, flatBlocks);
|
|
4411
4411
|
if (_optionalChain([options, 'optionalAccess', _107 => _107.inlineImages]) && images.length > 0) {
|
|
4412
4412
|
try {
|
|
4413
|
-
markdown =
|
|
4413
|
+
markdown = _chunkW5KRKBYRcjs.inlineImagesIntoMarkdown.call(void 0, markdown, images, { compress: true });
|
|
4414
4414
|
} catch (inlineErr) {
|
|
4415
4415
|
warnings.push({ message: `\uC774\uBBF8\uC9C0 \uC778\uB77C\uC778 \uC2E4\uD328 \u2014 \uC6D0\uBCF8 \uD30C\uC77C \uCC38\uC870\uB85C \uD3F4\uBC31: ${inlineErr instanceof Error ? inlineErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "SKIPPED_IMAGE" });
|
|
4416
4416
|
}
|
|
@@ -4474,9 +4474,9 @@ function detectHwp5Headings(blocks, docInfo) {
|
|
|
4474
4474
|
let level = 0;
|
|
4475
4475
|
if (_optionalChain([block, 'access', _112 => _112.style, 'optionalAccess', _113 => _113.fontSize]) && baseFontSize > 0) {
|
|
4476
4476
|
const ratio = block.style.fontSize / baseFontSize;
|
|
4477
|
-
if (ratio >=
|
|
4478
|
-
else if (ratio >=
|
|
4479
|
-
else if (ratio >=
|
|
4477
|
+
if (ratio >= _chunkTUU535RBcjs.HEADING_RATIO_H1) level = 1;
|
|
4478
|
+
else if (ratio >= _chunkTUU535RBcjs.HEADING_RATIO_H2) level = 2;
|
|
4479
|
+
else if (ratio >= _chunkTUU535RBcjs.HEADING_RATIO_H3) level = 3;
|
|
4480
4480
|
}
|
|
4481
4481
|
if (/^제\d+[장절편]\s/.test(text) && text.length <= 50) {
|
|
4482
4482
|
if (level === 0) level = 2;
|
|
@@ -4570,7 +4570,7 @@ function findSectionsLenient(lcfb, compressed) {
|
|
|
4570
4570
|
if (!raw) break;
|
|
4571
4571
|
const content = compressed ? decompressStream(raw) : raw;
|
|
4572
4572
|
totalDecompressed += content.length;
|
|
4573
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
4573
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkTUU535RBcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
4574
4574
|
sections.push({ idx: i, content });
|
|
4575
4575
|
}
|
|
4576
4576
|
if (sections.length === 0) {
|
|
@@ -4582,7 +4582,7 @@ function findSectionsLenient(lcfb, compressed) {
|
|
|
4582
4582
|
if (raw) {
|
|
4583
4583
|
const content = compressed ? decompressStream(raw) : raw;
|
|
4584
4584
|
totalDecompressed += content.length;
|
|
4585
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
4585
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkTUU535RBcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
4586
4586
|
sections.push({ idx, content });
|
|
4587
4587
|
}
|
|
4588
4588
|
}
|
|
@@ -4599,7 +4599,7 @@ function findViewTextSectionsLenient(lcfb, compressed) {
|
|
|
4599
4599
|
try {
|
|
4600
4600
|
const content = decryptViewText(raw, compressed);
|
|
4601
4601
|
totalDecompressed += content.length;
|
|
4602
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
4602
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkTUU535RBcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
4603
4603
|
sections.push({ idx: i, content });
|
|
4604
4604
|
} catch (e30) {
|
|
4605
4605
|
break;
|
|
@@ -4702,7 +4702,7 @@ function parseParagraph(records, start, end, ctx) {
|
|
|
4702
4702
|
const ctrl = ctrls[r.ctrlIdx];
|
|
4703
4703
|
if (!_optionalChain([ctrl, 'optionalAccess', _120 => _120.href]) || r.end <= r.start) continue;
|
|
4704
4704
|
if (applied.some(([s, e]) => r.start < e && r.end > s)) continue;
|
|
4705
|
-
const href =
|
|
4705
|
+
const href = _chunkTUU535RBcjs.sanitizeHref.call(void 0, ctrl.href);
|
|
4706
4706
|
if (!href) continue;
|
|
4707
4707
|
const anchor = text.slice(r.start, r.end);
|
|
4708
4708
|
if (!anchor.trim()) continue;
|
|
@@ -4938,8 +4938,8 @@ function parseTableControl(ctrl, records, ctx) {
|
|
|
4938
4938
|
let tableIdx = -1;
|
|
4939
4939
|
for (let i2 = childStart; i2 < childEnd; i2++) {
|
|
4940
4940
|
if (records[i2].tagId === TAG_TABLE && records[i2].data.length >= 8) {
|
|
4941
|
-
rows = Math.min(records[i2].data.readUInt16LE(4),
|
|
4942
|
-
cols = Math.min(records[i2].data.readUInt16LE(6),
|
|
4941
|
+
rows = Math.min(records[i2].data.readUInt16LE(4), _chunkW5KRKBYRcjs.MAX_ROWS);
|
|
4942
|
+
cols = Math.min(records[i2].data.readUInt16LE(6), _chunkW5KRKBYRcjs.MAX_COLS);
|
|
4943
4943
|
tableIdx = i2;
|
|
4944
4944
|
break;
|
|
4945
4945
|
}
|
|
@@ -4988,7 +4988,7 @@ function parseTableControl(ctrl, records, ctx) {
|
|
|
4988
4988
|
return table3;
|
|
4989
4989
|
}
|
|
4990
4990
|
const cellRows = arrangeCells(rows, cols, cells);
|
|
4991
|
-
const table2 =
|
|
4991
|
+
const table2 = _chunkW5KRKBYRcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: ctx.doc.keepTrailingEmptyCols });
|
|
4992
4992
|
if (caption && table2.rows > 0) table2.caption = caption;
|
|
4993
4993
|
return table2.rows > 0 ? table2 : null;
|
|
4994
4994
|
}
|
|
@@ -5005,8 +5005,8 @@ function parseCell(records, lhIdx, end, ctx) {
|
|
|
5005
5005
|
rowAddr = rec.data.readUInt16LE(10);
|
|
5006
5006
|
const cs = rec.data.readUInt16LE(12);
|
|
5007
5007
|
const rs = rec.data.readUInt16LE(14);
|
|
5008
|
-
if (cs > 0) colSpan = Math.min(cs,
|
|
5009
|
-
if (rs > 0) rowSpan = Math.min(rs,
|
|
5008
|
+
if (cs > 0) colSpan = Math.min(cs, _chunkW5KRKBYRcjs.MAX_COLS);
|
|
5009
|
+
if (rs > 0) rowSpan = Math.min(rs, _chunkW5KRKBYRcjs.MAX_ROWS);
|
|
5010
5010
|
}
|
|
5011
5011
|
const blocks = ctx.depth < MAX_NEST_DEPTH ? parseParagraphList(records, lhIdx + 1, end, { ...ctx, depth: ctx.depth + 1 }) : [];
|
|
5012
5012
|
const parts = [];
|
|
@@ -5016,7 +5016,7 @@ function parseCell(records, lhIdx, end, ctx) {
|
|
|
5016
5016
|
parts.push(``);
|
|
5017
5017
|
hasStructure = true;
|
|
5018
5018
|
} else if (b.type === "table" && b.table) {
|
|
5019
|
-
const flat =
|
|
5019
|
+
const flat = _chunkW5KRKBYRcjs.convertTableToText.call(void 0, b.table.cells);
|
|
5020
5020
|
if (flat) parts.push(flat);
|
|
5021
5021
|
hasStructure = true;
|
|
5022
5022
|
} else if (b.text) {
|
|
@@ -17287,25 +17287,25 @@ function desEcbDecrypt(data, key) {
|
|
|
17287
17287
|
}
|
|
17288
17288
|
function readLayout(data) {
|
|
17289
17289
|
if (data.length < FIXED_HEADER_BYTES) {
|
|
17290
|
-
throw new (0,
|
|
17290
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("HWP3 \uC554\uD638 \uBB38\uC11C: \uD5E4\uB354\uAC00 \uC798\uB838\uC2B5\uB2C8\uB2E4");
|
|
17291
17291
|
}
|
|
17292
17292
|
const infoBlockLength = data[INFO_BLOCK_LENGTH_OFFSET] | data[INFO_BLOCK_LENGTH_OFFSET + 1] << 8;
|
|
17293
17293
|
const payloadOffset = FIXED_HEADER_BYTES + infoBlockLength;
|
|
17294
17294
|
if (payloadOffset >= data.length) {
|
|
17295
|
-
throw new (0,
|
|
17295
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("HWP3 \uC554\uD638 \uBB38\uC11C: \uBCF8\uBB38\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
17296
17296
|
}
|
|
17297
17297
|
return { payloadOffset, compressed: data[COMPRESSION_FLAG_OFFSET] !== 0 };
|
|
17298
17298
|
}
|
|
17299
17299
|
function decryptHwp3Document(input, password) {
|
|
17300
17300
|
const { payloadOffset, compressed } = readLayout(input);
|
|
17301
17301
|
if (!compressed) {
|
|
17302
|
-
throw new (0,
|
|
17302
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWP3 \uC554\uD638\uD654 \uBC29\uC2DD\uC785\uB2C8\uB2E4 (\uC555\uCD95\uB418\uC9C0 \uC54A\uC740 \uC554\uD638 \uBCF8\uBB38)");
|
|
17303
17303
|
}
|
|
17304
17304
|
const source = Buffer.from(input);
|
|
17305
17305
|
const payload = source.subarray(payloadOffset);
|
|
17306
17306
|
const aligned = payload.subarray(0, payload.length - payload.length % 8);
|
|
17307
17307
|
if (aligned.length === 0) {
|
|
17308
|
-
throw new (0,
|
|
17308
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("HWP3 \uC554\uD638 \uBB38\uC11C: \uBCF8\uBB38\uC774 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4");
|
|
17309
17309
|
}
|
|
17310
17310
|
const decrypted = desEcbDecrypt(aligned, deriveDesKey(password));
|
|
17311
17311
|
let inflated;
|
|
@@ -17313,14 +17313,14 @@ function decryptHwp3Document(input, password) {
|
|
|
17313
17313
|
inflated = _zlib.inflateRawSync.call(void 0, decrypted, { maxOutputLength: MAX_DECOMPRESSED_BYTES });
|
|
17314
17314
|
} catch (err) {
|
|
17315
17315
|
if (_optionalChain([err, 'optionalAccess', _133 => _133.code]) === "ERR_BUFFER_TOO_LARGE") {
|
|
17316
|
-
throw new (0,
|
|
17316
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(
|
|
17317
17317
|
`HWP3 \uC554\uD638 \uBCF8\uBB38\uC758 \uC555\uCD95 \uD574\uC81C \uACB0\uACFC\uAC00 \uCD5C\uB300 \uD5C8\uC6A9 \uD06C\uAE30(${MAX_DECOMPRESSED_BYTES / 1024 / 1024}MB)\uB97C \uCD08\uACFC\uD588\uC2B5\uB2C8\uB2E4`
|
|
17318
17318
|
);
|
|
17319
17319
|
}
|
|
17320
|
-
throw new (0,
|
|
17320
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("\uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uAC70\uB098 \uC554\uD638\uD654 \uB370\uC774\uD130\uAC00 \uC190\uC0C1\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
17321
17321
|
}
|
|
17322
17322
|
if (inflated.length <= PASSWORD_PREFIX_BYTES) {
|
|
17323
|
-
throw new (0,
|
|
17323
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("\uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uAC70\uB098 \uC554\uD638\uD654 \uB370\uC774\uD130\uAC00 \uC190\uC0C1\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
17324
17324
|
}
|
|
17325
17325
|
const body = inflated.subarray(PASSWORD_PREFIX_BYTES);
|
|
17326
17326
|
const out = Buffer.concat([source.subarray(0, payloadOffset), body]);
|
|
@@ -17355,7 +17355,7 @@ function parseHwp3Document(buffer, options) {
|
|
|
17355
17355
|
let source = Buffer.from(buffer);
|
|
17356
17356
|
if (isEncryptedHwp3(source)) {
|
|
17357
17357
|
if (!_optionalChain([options, 'optionalAccess', _134 => _134.password])) {
|
|
17358
|
-
throw new (0,
|
|
17358
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(
|
|
17359
17359
|
"\uC554\uD638\uB85C \uBCF4\uD638\uB41C HWP3 \uBB38\uC11C\uC785\uB2C8\uB2E4. password \uC635\uC158\uC5D0 \uC5F4\uAE30 \uC554\uD638\uB97C \uC9C0\uC815\uD558\uC138\uC694."
|
|
17360
17360
|
);
|
|
17361
17361
|
}
|
|
@@ -17372,10 +17372,10 @@ function parseHwp3Document(buffer, options) {
|
|
|
17372
17372
|
body = _zlib.inflateRawSync.call(void 0, tail, { maxOutputLength: MAX_DECOMPRESS_SIZE3 });
|
|
17373
17373
|
} catch (err) {
|
|
17374
17374
|
if (_optionalChain([err, 'optionalAccess', _135 => _135.code]) === "ERR_BUFFER_TOO_LARGE") {
|
|
17375
|
-
throw new (0,
|
|
17375
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(`HWP3 \uC555\uCD95 \uD574\uC81C \uACB0\uACFC\uAC00 \uCD5C\uB300 \uD5C8\uC6A9 \uD06C\uAE30(${MAX_DECOMPRESS_SIZE3 / 1024 / 1024}MB)\uB97C \uCD08\uACFC\uD588\uC2B5\uB2C8\uB2E4`);
|
|
17376
17376
|
}
|
|
17377
17377
|
const msg2 = err instanceof Error ? err.message : String(err);
|
|
17378
|
-
throw new (0,
|
|
17378
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(`HWP3 \uC555\uCD95 \uD574\uC81C \uC2E4\uD328: ${msg2}`);
|
|
17379
17379
|
}
|
|
17380
17380
|
} else {
|
|
17381
17381
|
body = tail;
|
|
@@ -17617,7 +17617,7 @@ function getTextContent(el) {
|
|
|
17617
17617
|
return _nullishCoalesce(_optionalChain([el, 'access', _138 => _138.textContent, 'optionalAccess', _139 => _139.trim, 'call', _140 => _140()]), () => ( ""));
|
|
17618
17618
|
}
|
|
17619
17619
|
function parseXml(text) {
|
|
17620
|
-
return new (0, _xmldom.DOMParser)().parseFromString(
|
|
17620
|
+
return new (0, _xmldom.DOMParser)().parseFromString(_chunkTUU535RBcjs.stripDtd.call(void 0, text), "text/xml");
|
|
17621
17621
|
}
|
|
17622
17622
|
function collectRichText(root) {
|
|
17623
17623
|
let out = "";
|
|
@@ -17852,7 +17852,7 @@ function sheetToBlocks(sheetName, grid, merges, maxRow, maxCol, sheetIndex, keep
|
|
|
17852
17852
|
cellRows.push(row);
|
|
17853
17853
|
}
|
|
17854
17854
|
if (cellRows.length > 0) {
|
|
17855
|
-
const table2 =
|
|
17855
|
+
const table2 = _chunkW5KRKBYRcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols });
|
|
17856
17856
|
if (table2.rows > 0) {
|
|
17857
17857
|
blocks.push({ type: "table", table: table2, pageNumber: sheetIndex + 1 });
|
|
17858
17858
|
}
|
|
@@ -17860,12 +17860,12 @@ function sheetToBlocks(sheetName, grid, merges, maxRow, maxCol, sheetIndex, keep
|
|
|
17860
17860
|
return blocks;
|
|
17861
17861
|
}
|
|
17862
17862
|
async function parseXlsxDocument(buffer, options) {
|
|
17863
|
-
|
|
17863
|
+
_chunkTUU535RBcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE4);
|
|
17864
17864
|
const zip = await _jszip2.default.loadAsync(buffer);
|
|
17865
17865
|
const warnings = [];
|
|
17866
17866
|
const workbookFile = zip.file("xl/workbook.xml");
|
|
17867
17867
|
if (!workbookFile) {
|
|
17868
|
-
throw new (0,
|
|
17868
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 XLSX \uD30C\uC77C: xl/workbook.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
17869
17869
|
}
|
|
17870
17870
|
let sharedStrings = [];
|
|
17871
17871
|
const ssFile = zip.file("xl/sharedStrings.xml");
|
|
@@ -17874,7 +17874,7 @@ async function parseXlsxDocument(buffer, options) {
|
|
|
17874
17874
|
}
|
|
17875
17875
|
const { sheets, date1904 } = parseWorkbook(await workbookFile.async("text"));
|
|
17876
17876
|
if (sheets.length === 0) {
|
|
17877
|
-
throw new (0,
|
|
17877
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("XLSX \uD30C\uC77C\uC5D0 \uC2DC\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
17878
17878
|
}
|
|
17879
17879
|
let dateXfs = /* @__PURE__ */ new Map();
|
|
17880
17880
|
const stylesFile = zip.file("xl/styles.xml");
|
|
@@ -17895,7 +17895,7 @@ async function parseXlsxDocument(buffer, options) {
|
|
|
17895
17895
|
}
|
|
17896
17896
|
let pageFilter = null;
|
|
17897
17897
|
if (_optionalChain([options, 'optionalAccess', _146 => _146.pages])) {
|
|
17898
|
-
const { parsePageRange: parsePageRange2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./page-range-
|
|
17898
|
+
const { parsePageRange: parsePageRange2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./page-range-P7SDW6LR.cjs")));
|
|
17899
17899
|
pageFilter = parsePageRange2(options.pages, sheets.length);
|
|
17900
17900
|
}
|
|
17901
17901
|
const blocks = [];
|
|
@@ -17958,7 +17958,7 @@ async function parseXlsxDocument(buffer, options) {
|
|
|
17958
17958
|
} catch (e32) {
|
|
17959
17959
|
}
|
|
17960
17960
|
}
|
|
17961
|
-
const markdown =
|
|
17961
|
+
const markdown = _chunkW5KRKBYRcjs.blocksToMarkdown.call(void 0, blocks);
|
|
17962
17962
|
return { markdown, blocks, metadata, warnings: warnings.length > 0 ? warnings : void 0 };
|
|
17963
17963
|
}
|
|
17964
17964
|
|
|
@@ -18409,11 +18409,11 @@ function processGlobals(records) {
|
|
|
18409
18409
|
const xfFmtIds = [];
|
|
18410
18410
|
const firstBof = records[0];
|
|
18411
18411
|
if (!firstBof || firstBof.opcode !== OP_BOF) {
|
|
18412
|
-
throw new (0,
|
|
18412
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("XLS: \uCCAB \uB808\uCF54\uB4DC\uAC00 BOF\uAC00 \uC544\uB2D8");
|
|
18413
18413
|
}
|
|
18414
18414
|
const bof = decodeBof(firstBof.data);
|
|
18415
18415
|
if (!bof || bof.dt !== DT_GLOBALS) {
|
|
18416
|
-
throw new (0,
|
|
18416
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("XLS: Globals \uC11C\uBE0C\uC2A4\uD2B8\uB9BC BOF \uB204\uB77D");
|
|
18417
18417
|
}
|
|
18418
18418
|
let i = 1;
|
|
18419
18419
|
while (i < records.length) {
|
|
@@ -18548,7 +18548,7 @@ function sheetToBlocks2(sheetName, sheet, sheetIndex, keepAnchoredEmptyCols) {
|
|
|
18548
18548
|
cellRows.push(row);
|
|
18549
18549
|
}
|
|
18550
18550
|
if (cellRows.length > 0) {
|
|
18551
|
-
const table2 =
|
|
18551
|
+
const table2 = _chunkW5KRKBYRcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols });
|
|
18552
18552
|
if (table2.rows > 0) {
|
|
18553
18553
|
blocks.push({ type: "table", table: table2, pageNumber: sheetIndex + 1 });
|
|
18554
18554
|
}
|
|
@@ -18561,28 +18561,28 @@ async function parseXlsDocument(buffer, options) {
|
|
|
18561
18561
|
try {
|
|
18562
18562
|
cfb = parseLenientCfb(buf);
|
|
18563
18563
|
} catch (e) {
|
|
18564
|
-
throw new (0,
|
|
18564
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(
|
|
18565
18565
|
`XLS: OLE2 \uC2DC\uADF8\uB2C8\uCC98 \uAC80\uC99D \uC2E4\uD328 \u2014 ${e instanceof Error ? e.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`
|
|
18566
18566
|
);
|
|
18567
18567
|
}
|
|
18568
18568
|
const wb = _nullishCoalesce(cfb.findStream("/Workbook"), () => ( cfb.findStream("/Book")));
|
|
18569
18569
|
if (!wb) {
|
|
18570
|
-
throw new (0,
|
|
18570
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("XLS: Workbook \uC2A4\uD2B8\uB9BC\uC774 \uC5C6\uC74C (BIFF5 \uB610\uB294 \uBE44\uD45C\uC900 \uD30C\uC77C)");
|
|
18571
18571
|
}
|
|
18572
18572
|
const records = readRecords2(wb);
|
|
18573
18573
|
if (records.length === 0) {
|
|
18574
|
-
throw new (0,
|
|
18574
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("XLS: \uC2DC\uADF8\uB2C8\uCC98 \uB808\uCF54\uB4DC\uAC00 \uC5C6\uC74C (Workbook \uC2A4\uD2B8\uB9BC \uC190\uC0C1)");
|
|
18575
18575
|
}
|
|
18576
18576
|
const firstBof = decodeBof(records[0].data);
|
|
18577
18577
|
if (firstBof && firstBof.vers !== 1536) {
|
|
18578
|
-
throw new (0,
|
|
18578
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(
|
|
18579
18579
|
`XLS: BIFF8(0x0600)\uB9CC \uC9C0\uC6D0 \u2014 \uBCF8 \uD30C\uC77C\uC740 0x${firstBof.vers.toString(16)}`
|
|
18580
18580
|
);
|
|
18581
18581
|
}
|
|
18582
18582
|
const globals = processGlobals(records);
|
|
18583
18583
|
const warnings = [];
|
|
18584
18584
|
if (globals.encrypted) {
|
|
18585
|
-
throw new (0,
|
|
18585
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("XLS \uD30C\uC77C\uC774 \uC554\uD638\uD654\uB418\uC5B4 \uC788\uC5B4 \uD30C\uC2F1\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
18586
18586
|
}
|
|
18587
18587
|
const convertNum = globals.dateXfs.size > 0 ? (n, ixfe) => {
|
|
18588
18588
|
const kind = globals.dateXfs.get(ixfe);
|
|
@@ -18595,7 +18595,7 @@ async function parseXlsDocument(buffer, options) {
|
|
|
18595
18595
|
const totalSheets = Math.min(globals.sheets.length, MAX_SHEETS2);
|
|
18596
18596
|
let pageFilter = null;
|
|
18597
18597
|
if (_optionalChain([options, 'optionalAccess', _152 => _152.pages])) {
|
|
18598
|
-
const { parsePageRange: parsePageRange2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./page-range-
|
|
18598
|
+
const { parsePageRange: parsePageRange2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./page-range-P7SDW6LR.cjs")));
|
|
18599
18599
|
pageFilter = parsePageRange2(options.pages, totalSheets);
|
|
18600
18600
|
}
|
|
18601
18601
|
const allBlocks = [];
|
|
@@ -18633,7 +18633,7 @@ async function parseXlsDocument(buffer, options) {
|
|
|
18633
18633
|
pageCount: totalSheets
|
|
18634
18634
|
};
|
|
18635
18635
|
return {
|
|
18636
|
-
markdown:
|
|
18636
|
+
markdown: _chunkW5KRKBYRcjs.blocksToMarkdown.call(void 0, allBlocks),
|
|
18637
18637
|
blocks: allBlocks,
|
|
18638
18638
|
metadata,
|
|
18639
18639
|
warnings: warnings.length > 0 ? warnings : void 0
|
|
@@ -19061,7 +19061,7 @@ function getAttr(el, localName2) {
|
|
|
19061
19061
|
return null;
|
|
19062
19062
|
}
|
|
19063
19063
|
function parseXml2(text) {
|
|
19064
|
-
return new (0, _xmldom.DOMParser)().parseFromString(
|
|
19064
|
+
return new (0, _xmldom.DOMParser)().parseFromString(_chunkTUU535RBcjs.stripDtd.call(void 0, text), "text/xml");
|
|
19065
19065
|
}
|
|
19066
19066
|
function parseStyles(xml) {
|
|
19067
19067
|
const doc = parseXml2(xml);
|
|
@@ -19219,7 +19219,7 @@ function fieldUrlFromInstr(instr) {
|
|
|
19219
19219
|
function makeLink(text, rawHref) {
|
|
19220
19220
|
if (!text) return "";
|
|
19221
19221
|
if (!rawHref) return text;
|
|
19222
|
-
const href =
|
|
19222
|
+
const href = _chunkTUU535RBcjs.sanitizeHref.call(void 0, rawHref);
|
|
19223
19223
|
return href ? `[${text}](${href})` : text;
|
|
19224
19224
|
}
|
|
19225
19225
|
function collectInline(p, footnotes, rels) {
|
|
@@ -19413,7 +19413,7 @@ ${cell2.text}` : cell2.text;
|
|
|
19413
19413
|
return { text: cell2.text, colSpan: cell2.colSpan, rowSpan, colAddr: cell2.col, rowAddr: r };
|
|
19414
19414
|
})
|
|
19415
19415
|
);
|
|
19416
|
-
const table2 =
|
|
19416
|
+
const table2 = _chunkW5KRKBYRcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keepEmptyCols });
|
|
19417
19417
|
if (table2.rows === 0 || table2.cols === 0) return null;
|
|
19418
19418
|
return { type: "table", table: table2 };
|
|
19419
19419
|
}
|
|
@@ -19515,12 +19515,12 @@ function emitParagraphImages(p, imageMap, linked, out) {
|
|
|
19515
19515
|
}
|
|
19516
19516
|
}
|
|
19517
19517
|
async function parseDocxDocument(buffer, options) {
|
|
19518
|
-
|
|
19518
|
+
_chunkTUU535RBcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE5);
|
|
19519
19519
|
const zip = await _jszip2.default.loadAsync(buffer);
|
|
19520
19520
|
const warnings = [];
|
|
19521
19521
|
const docFile = zip.file("word/document.xml");
|
|
19522
19522
|
if (!docFile) {
|
|
19523
|
-
throw new (0,
|
|
19523
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 DOCX \uD30C\uC77C: word/document.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
19524
19524
|
}
|
|
19525
19525
|
let rels = /* @__PURE__ */ new Map();
|
|
19526
19526
|
const relsFile = zip.file("word/_rels/document.xml.rels");
|
|
@@ -19567,7 +19567,7 @@ async function parseDocxDocument(buffer, options) {
|
|
|
19567
19567
|
const doc = parseXml2(docXml);
|
|
19568
19568
|
const body = findElements(doc, "body");
|
|
19569
19569
|
if (body.length === 0) {
|
|
19570
|
-
throw new (0,
|
|
19570
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("DOCX \uBCF8\uBB38(w:body)\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
19571
19571
|
}
|
|
19572
19572
|
const { imageMap, images } = await buildImageMap(zip, rels, doc, warnings);
|
|
19573
19573
|
const linkedImages = /* @__PURE__ */ new Set();
|
|
@@ -19618,7 +19618,7 @@ async function parseDocxDocument(buffer, options) {
|
|
|
19618
19618
|
}
|
|
19619
19619
|
}
|
|
19620
19620
|
const outline = blocks.filter((b) => b.type === "heading").map((b) => ({ level: _nullishCoalesce(b.level, () => ( 2)), text: _nullishCoalesce(b.text, () => ( "")) }));
|
|
19621
|
-
const markdown =
|
|
19621
|
+
const markdown = _chunkW5KRKBYRcjs.blocksToMarkdown.call(void 0, blocks);
|
|
19622
19622
|
return {
|
|
19623
19623
|
markdown,
|
|
19624
19624
|
blocks,
|
|
@@ -19636,11 +19636,11 @@ var MAX_TABLE_COLS = 500;
|
|
|
19636
19636
|
var MAX_HWPML_BYTES = 50 * 1024 * 1024;
|
|
19637
19637
|
function parseHwpmlDocument(buffer, options) {
|
|
19638
19638
|
if (buffer.byteLength > MAX_HWPML_BYTES) {
|
|
19639
|
-
throw new (0,
|
|
19639
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(`HWPML \uD30C\uC77C \uD06C\uAE30 \uCD08\uACFC (${(buffer.byteLength / 1024 / 1024).toFixed(1)}MB > 50MB)`);
|
|
19640
19640
|
}
|
|
19641
19641
|
const text = new TextDecoder("utf-8").decode(buffer).replace(/^\uFEFF/, "");
|
|
19642
19642
|
const normalized = text.replace(/ /g, " ");
|
|
19643
|
-
const xml =
|
|
19643
|
+
const xml = _chunkTUU535RBcjs.stripDtd.call(void 0, normalized);
|
|
19644
19644
|
const warnings = [];
|
|
19645
19645
|
const parser = new (0, _xmldom.DOMParser)({
|
|
19646
19646
|
onError: (_level, msg2) => {
|
|
@@ -19668,7 +19668,7 @@ function parseHwpmlDocument(buffer, options) {
|
|
|
19668
19668
|
return { markdown: "", blocks: [], metadata, warnings };
|
|
19669
19669
|
}
|
|
19670
19670
|
const blocks = [];
|
|
19671
|
-
const pageFilter = _optionalChain([options, 'optionalAccess', _183 => _183.pages]) ?
|
|
19671
|
+
const pageFilter = _optionalChain([options, 'optionalAccess', _183 => _183.pages]) ? _chunkDCZVOIEOcjs.parsePageRange.call(void 0, options.pages, countSections(body)) : null;
|
|
19672
19672
|
let sectionIdx = 0;
|
|
19673
19673
|
const children = body.childNodes;
|
|
19674
19674
|
for (let i = 0; i < children.length; i++) {
|
|
@@ -19680,7 +19680,7 @@ function parseHwpmlDocument(buffer, options) {
|
|
|
19680
19680
|
parseSection2(el, blocks, paraShapeMap, sectionIdx, warnings, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _184 => _184.keepTrailingEmptyCols]), () => ( false)));
|
|
19681
19681
|
}
|
|
19682
19682
|
const outline = blocks.filter((b) => b.type === "heading" && b.text).map((b) => ({ level: _nullishCoalesce(b.level, () => ( 1)), text: b.text, pageNumber: b.pageNumber }));
|
|
19683
|
-
const markdown =
|
|
19683
|
+
const markdown = _chunkW5KRKBYRcjs.blocksToMarkdown.call(void 0, blocks);
|
|
19684
19684
|
return {
|
|
19685
19685
|
markdown,
|
|
19686
19686
|
blocks,
|
|
@@ -19845,7 +19845,7 @@ function buildHmlTable(el, warnings, keep, tableDepth) {
|
|
|
19845
19845
|
const r = Math.min(Math.max(_nullishCoalesce(cell2.rowAddr, () => ( 0)), 0), rowCount - 1);
|
|
19846
19846
|
cellRows[r].push(cell2);
|
|
19847
19847
|
}
|
|
19848
|
-
const table2 =
|
|
19848
|
+
const table2 = _chunkW5KRKBYRcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keep });
|
|
19849
19849
|
if (structured.length > 0) {
|
|
19850
19850
|
const claimed = /* @__PURE__ */ new Set();
|
|
19851
19851
|
for (const { ctx, cellBlocks } of structured) {
|
|
@@ -21356,7 +21356,7 @@ function fillClickHereInXml(xml, cursor, blockedLabels) {
|
|
|
21356
21356
|
};
|
|
21357
21357
|
}
|
|
21358
21358
|
async function extractClickHereFields(hwpxBuffer) {
|
|
21359
|
-
|
|
21359
|
+
_chunkTUU535RBcjs.precheckZipSize.call(void 0, hwpxBuffer);
|
|
21360
21360
|
const zip = await _jszip2.default.loadAsync(hwpxBuffer);
|
|
21361
21361
|
const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort();
|
|
21362
21362
|
const fields = [];
|
|
@@ -21404,19 +21404,19 @@ function parseCentralDirectory(buf) {
|
|
|
21404
21404
|
}
|
|
21405
21405
|
}
|
|
21406
21406
|
}
|
|
21407
|
-
if (eocdOffset < 0) throw new (0,
|
|
21407
|
+
if (eocdOffset < 0) throw new (0, _chunkTUU535RBcjs.KordocError)("ZIP EOCD\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
21408
21408
|
const totalEntries = view.getUint16(eocdOffset + 10, true);
|
|
21409
21409
|
const cdSize = view.getUint32(eocdOffset + 12, true);
|
|
21410
21410
|
const cdOffset = view.getUint32(eocdOffset + 16, true);
|
|
21411
|
-
if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0,
|
|
21411
|
+
if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0, _chunkTUU535RBcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
21412
21412
|
if (eocdOffset >= 20 && view.getUint32(eocdOffset - 20, true) === ZIP64_EOCD_LOC_SIG) {
|
|
21413
|
-
throw new (0,
|
|
21413
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
21414
21414
|
}
|
|
21415
21415
|
const decoder = new TextDecoder("utf-8");
|
|
21416
21416
|
const entries = [];
|
|
21417
21417
|
let pos = cdOffset;
|
|
21418
21418
|
for (let i = 0; i < totalEntries; i++) {
|
|
21419
|
-
if (view.getUint32(pos, true) !== CD_SIG) throw new (0,
|
|
21419
|
+
if (view.getUint32(pos, true) !== CD_SIG) throw new (0, _chunkTUU535RBcjs.KordocError)("ZIP Central Directory \uC190\uC0C1");
|
|
21420
21420
|
const flags = view.getUint16(pos + 8, true);
|
|
21421
21421
|
const method = view.getUint16(pos + 10, true);
|
|
21422
21422
|
const crc = view.getUint32(pos + 16, true);
|
|
@@ -21427,7 +21427,7 @@ function parseCentralDirectory(buf) {
|
|
|
21427
21427
|
const commentLen = view.getUint16(pos + 32, true);
|
|
21428
21428
|
const localOffset = view.getUint32(pos + 42, true);
|
|
21429
21429
|
if (compSize === 4294967295 || uncompSize === 4294967295 || localOffset === 4294967295) {
|
|
21430
|
-
throw new (0,
|
|
21430
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
21431
21431
|
}
|
|
21432
21432
|
const name = decoder.decode(buf.subarray(pos + 46, pos + 46 + nameLen));
|
|
21433
21433
|
const cdEnd = pos + 46 + nameLen + extraLen + commentLen;
|
|
@@ -21456,11 +21456,11 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
21456
21456
|
const { entries, cdOffset, eocdOffset } = parseCentralDirectory(original);
|
|
21457
21457
|
const view = new DataView(original.buffer, original.byteOffset, original.byteLength);
|
|
21458
21458
|
for (const name of replacements.keys()) {
|
|
21459
|
-
if (!entries.some((e) => e.name === name)) throw new (0,
|
|
21459
|
+
if (!entries.some((e) => e.name === name)) throw new (0, _chunkTUU535RBcjs.KordocError)(`ZIP\uC5D0 \uC5C6\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
|
|
21460
21460
|
}
|
|
21461
21461
|
if (additions) {
|
|
21462
21462
|
for (const name of additions.keys()) {
|
|
21463
|
-
if (entries.some((e) => e.name === name)) throw new (0,
|
|
21463
|
+
if (entries.some((e) => e.name === name)) throw new (0, _chunkTUU535RBcjs.KordocError)(`ZIP\uC5D0 \uC774\uBBF8 \uC788\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
|
|
21464
21464
|
}
|
|
21465
21465
|
}
|
|
21466
21466
|
const byLocal = [...entries].sort((a, b) => a.localOffset - b.localOffset);
|
|
@@ -21479,7 +21479,7 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
21479
21479
|
offset += seg.length;
|
|
21480
21480
|
continue;
|
|
21481
21481
|
}
|
|
21482
|
-
if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0,
|
|
21482
|
+
if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0, _chunkTUU535RBcjs.KordocError)("ZIP \uB85C\uCEEC \uD5E4\uB354 \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
|
|
21483
21483
|
const nameLen = view.getUint16(e.localOffset + 26, true);
|
|
21484
21484
|
const extraLen = view.getUint16(e.localOffset + 28, true);
|
|
21485
21485
|
const headerLen = 30 + nameLen + extraLen;
|
|
@@ -21487,7 +21487,7 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
21487
21487
|
const hview = new DataView(header.buffer, header.byteOffset, header.byteLength);
|
|
21488
21488
|
const method = e.method;
|
|
21489
21489
|
if (method !== 0 && method !== 8) {
|
|
21490
|
-
throw new (0,
|
|
21490
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 ZIP \uC555\uCD95 \uBC29\uC2DD(method=${method}): ${e.name} \u2014 STORE(0)/DEFLATE(8)\uB9CC \uAD50\uCCB4 \uAC00\uB2A5`);
|
|
21491
21491
|
}
|
|
21492
21492
|
const compData = method === 0 ? newData : new Uint8Array(_zlib.deflateRawSync.call(void 0, newData));
|
|
21493
21493
|
const crc = crc32(newData);
|
|
@@ -21585,11 +21585,11 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
21585
21585
|
// src/form/filler-hwpx.ts
|
|
21586
21586
|
async function fillHwpx(hwpxBuffer, values, blockedLabels) {
|
|
21587
21587
|
const u8 = new Uint8Array(hwpxBuffer);
|
|
21588
|
-
|
|
21588
|
+
_chunkTUU535RBcjs.precheckZipSize.call(void 0, hwpxBuffer);
|
|
21589
21589
|
const zip = await _jszip2.default.loadAsync(hwpxBuffer);
|
|
21590
21590
|
const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort();
|
|
21591
21591
|
if (sectionPaths.length === 0) {
|
|
21592
|
-
throw new (0,
|
|
21592
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
21593
21593
|
}
|
|
21594
21594
|
const warnings = [];
|
|
21595
21595
|
const normalizedValues = normalizeValues(values, warnings);
|
|
@@ -22331,7 +22331,7 @@ function needsGaejosikAssets(gongmun) {
|
|
|
22331
22331
|
}
|
|
22332
22332
|
function assertFiniteRange(name, value, min, max) {
|
|
22333
22333
|
if (!Number.isFinite(value) || value < min || value > max) {
|
|
22334
|
-
throw new (0,
|
|
22334
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(`${name} must be a finite number between ${min} and ${max}`);
|
|
22335
22335
|
}
|
|
22336
22336
|
}
|
|
22337
22337
|
function validateGongmunOptions(opts) {
|
|
@@ -22346,10 +22346,10 @@ function validateGongmunOptions(opts) {
|
|
|
22346
22346
|
assertFiniteRange(`margins.${side}`, value, 0, 200);
|
|
22347
22347
|
}
|
|
22348
22348
|
if (opts.margins.left + opts.margins.right >= 210) {
|
|
22349
|
-
throw new (0,
|
|
22349
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("margins.left + margins.right must be less than 210");
|
|
22350
22350
|
}
|
|
22351
22351
|
if (opts.margins.top + opts.margins.bottom >= 297) {
|
|
22352
|
-
throw new (0,
|
|
22352
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("margins.top + margins.bottom must be less than 297");
|
|
22353
22353
|
}
|
|
22354
22354
|
}
|
|
22355
22355
|
if (opts.sizes) {
|
|
@@ -22358,7 +22358,7 @@ function validateGongmunOptions(opts) {
|
|
|
22358
22358
|
}
|
|
22359
22359
|
}
|
|
22360
22360
|
if (opts.approval && opts.approval.length > 6) {
|
|
22361
|
-
throw new (0,
|
|
22361
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("approval must contain at most 6 labels");
|
|
22362
22362
|
}
|
|
22363
22363
|
}
|
|
22364
22364
|
function incompatibleGongmunWarnings(opts) {
|
|
@@ -22895,7 +22895,7 @@ function parseInlineMarkdown(text) {
|
|
|
22895
22895
|
else spans.push(...emphasisSpans(m[0]));
|
|
22896
22896
|
} else {
|
|
22897
22897
|
const anchor = m[2] || m[3];
|
|
22898
|
-
const href = _nullishCoalesce(
|
|
22898
|
+
const href = _nullishCoalesce(_chunkTUU535RBcjs.sanitizeHref.call(void 0, m[3].trim()), () => ( void 0));
|
|
22899
22899
|
const sub = emphasisSpans(anchor);
|
|
22900
22900
|
if (href) for (const s of sub) s.href = href;
|
|
22901
22901
|
spans.push(...sub);
|
|
@@ -23109,7 +23109,7 @@ function assertSequentialIds(rows, label, startId) {
|
|
|
23109
23109
|
const m = rows[i].match(/\bid="(\d+)"/);
|
|
23110
23110
|
const got = m ? Number(m[1]) : NaN;
|
|
23111
23111
|
if (got !== startId + i) {
|
|
23112
|
-
throw new (0,
|
|
23112
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(
|
|
23113
23113
|
`\uB0B4\uBD80 \uC624\uB958: ${label} id \uD30C\uD2F0\uC158 \uB4DC\uB9AC\uD504\uD2B8 \u2014 ${startId + i} \uC704\uCE58\uC5D0 id=${m ? m[1] : "?"} \uBC29\uCD9C. id \uC0C1\uC218(gen-ids)\uC640 \uC2E4\uC81C \uBC29\uCD9C \uC218\uAC00 \uC5B4\uAE0B\uB0AC\uB2E4 (GJ_CHAR_COUNT\uB958 \uCE74\uC6B4\uD2B8\xB7base \uC0B0\uC220 \uD655\uC778)`
|
|
23114
23114
|
);
|
|
23115
23115
|
}
|
|
@@ -23193,7 +23193,7 @@ function buildCharProperties(theme, gongmun, ratioVariants = [], extraCharPrXmls
|
|
|
23193
23193
|
}
|
|
23194
23194
|
const expectedBase = charVariantBase(richAssets, !!gongmun);
|
|
23195
23195
|
if (rows.length !== expectedBase) {
|
|
23196
|
-
throw new (0,
|
|
23196
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(
|
|
23197
23197
|
`\uB0B4\uBD80 \uC624\uB958: charPr \uAE30\uBCF8 \uBE14\uB85D \uBC29\uCD9C \uC218(${rows.length}) \u2260 charVariantBase(${expectedBase}) \u2014 gen-header \uBC29\uCD9C \uD589\uACFC gen-ids \uCE74\uC6B4\uD2B8 \uC0C1\uC218\uAC00 \uC5B4\uAE0B\uB0AC\uB2E4`
|
|
23198
23198
|
);
|
|
23199
23199
|
}
|
|
@@ -24089,7 +24089,7 @@ function escapeGfm(text) {
|
|
|
24089
24089
|
}
|
|
24090
24090
|
var HWP_SHAPE_ALT_TEXT_RE = /^(?:모서리가 둥근 |둥근 )?(?:사각형|직사각형|정사각형|원|타원|삼각형|이등변 삼각형|직각 삼각형|선|직선|곡선|화살표|굵은 화살표|이중 화살표|오각형|육각형|팔각형|별|[4-8]점별|십자|십자형|구름|구름형|마름모|도넛|평행사변형|사다리꼴|부채꼴|호|반원|물결|번개|하트|빗금|블록 화살표|수식|표|그림|개체|그리기\s?개체|묶음\s?개체|글상자|수식\s?개체|OLE\s?개체)\s?입니다\.?$/gm;
|
|
24091
24091
|
function sanitizeText(text) {
|
|
24092
|
-
let result =
|
|
24092
|
+
let result = _chunkW5KRKBYRcjs.mapPuaText.call(void 0, text).replace(/[\u{F0000}-\u{FFFFD}]/gu, "").replace(HWP_SHAPE_ALT_TEXT_RE, "").replace(/ +/g, " ").trim();
|
|
24093
24093
|
if (result.length <= 30 && result.includes(" ")) {
|
|
24094
24094
|
const tokens = result.split(" ");
|
|
24095
24095
|
const koreanSingleCharCount = tokens.filter((t) => t.length === 1 && /[가-ㄱ-ㆎ]/.test(t)).length;
|
|
@@ -24261,7 +24261,7 @@ function parseHtmlTable(raw) {
|
|
|
24261
24261
|
const cs = parseInt(_optionalChain([attrs, 'access', _309 => _309.match, 'call', _310 => _310(/colspan\s*=\s*["']?(\d+)/i), 'optionalAccess', _311 => _311[1]]) || "1", 10);
|
|
24262
24262
|
const rs = parseInt(_optionalChain([attrs, 'access', _312 => _312.match, 'call', _313 => _313(/rowspan\s*=\s*["']?(\d+)/i), 'optionalAccess', _314 => _314[1]]) || "1", 10);
|
|
24263
24263
|
cellStart = m.index + m[0].length;
|
|
24264
|
-
cellInfo = { colSpan: clampSpan(isNaN(cs) ? 1 : cs,
|
|
24264
|
+
cellInfo = { colSpan: clampSpan(isNaN(cs) ? 1 : cs, _chunkW5KRKBYRcjs.MAX_COLS), rowSpan: clampSpan(isNaN(rs) ? 1 : rs, _chunkW5KRKBYRcjs.MAX_ROWS) };
|
|
24265
24265
|
} else if (cellStart >= 0 && cellInfo && currentRow) {
|
|
24266
24266
|
currentRow.push({ inner: raw.slice(cellStart, m.index), colSpan: cellInfo.colSpan, rowSpan: cellInfo.rowSpan });
|
|
24267
24267
|
cellStart = -1;
|
|
@@ -25003,8 +25003,8 @@ function layoutHtmlRows(rows) {
|
|
|
25003
25003
|
let c = 0;
|
|
25004
25004
|
for (const cell2 of rows[r].cells) {
|
|
25005
25005
|
while (occupied.has(`${r},${c}`)) c++;
|
|
25006
|
-
const colSpan = clampSpan(cell2.colSpan,
|
|
25007
|
-
const rowSpan = clampSpan(cell2.rowSpan,
|
|
25006
|
+
const colSpan = clampSpan(cell2.colSpan, _chunkW5KRKBYRcjs.MAX_COLS);
|
|
25007
|
+
const rowSpan = clampSpan(cell2.rowSpan, _chunkW5KRKBYRcjs.MAX_ROWS);
|
|
25008
25008
|
placed.push({ r, c, colSpan, rowSpan, inner: cell2.inner, isHeader: rows[r].tag === "th" });
|
|
25009
25009
|
for (let dr = 0; dr < rowSpan; dr++) {
|
|
25010
25010
|
for (let dc = 0; dc < colSpan; dc++) occupied.add(`${r + dr},${c + dc}`);
|
|
@@ -26315,7 +26315,7 @@ function builtinTemplateDir() {
|
|
|
26315
26315
|
for (const c of candidates) {
|
|
26316
26316
|
if (_fs.existsSync.call(void 0, _path.join.call(void 0, c, BUILTIN_TEMPLATES[0].file))) return c;
|
|
26317
26317
|
}
|
|
26318
|
-
throw new (0,
|
|
26318
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("\uB0B4\uC7A5 templates \uB514\uB809\uD1A0\uB9AC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 (\uD328\uD0A4\uC9C0 \uC124\uCE58\uAC00 \uC190\uC0C1\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4)");
|
|
26319
26319
|
}
|
|
26320
26320
|
function readBuiltinTemplate(t) {
|
|
26321
26321
|
const buf = _fs.readFileSync.call(void 0, _path.join.call(void 0, builtinTemplateDir(), t.file));
|
|
@@ -26658,12 +26658,12 @@ function buildFloatPicXml(itemId, sizeHu, posXHu, posYHu, ids) {
|
|
|
26658
26658
|
return `<hp:pic xmlns:hc="http://www.hancom.co.kr/hwpml/2011/core" id="${ids.id}" zOrder="0" numberingType="PICTURE" textWrap="IN_FRONT_OF_TEXT" textFlow="BOTH_SIDES" lock="0" dropcapstyle="None" href="" groupLevel="0" instid="${ids.instid}" reverse="0"><hp:offset x="0" y="0"/><hp:orgSz width="${w}" height="${h}"/><hp:curSz width="${w}" height="${h}"/><hp:flip horizontal="0" vertical="0"/><hp:rotationInfo angle="0" centerX="${Math.round(w / 2)}" centerY="${Math.round(h / 2)}" rotateimage="1"/><hp:renderingInfo><hc:transMatrix e1="1" e2="0" e3="0" e4="0" e5="1" e6="0"/><hc:scaMatrix e1="1" e2="0" e3="0" e4="0" e5="1" e6="0"/><hc:rotMatrix e1="1" e2="0" e3="0" e4="0" e5="1" e6="0"/></hp:renderingInfo><hp:imgRect><hc:pt0 x="0" y="0"/><hc:pt1 x="${w}" y="0"/><hc:pt2 x="${w}" y="${h}"/><hc:pt3 x="0" y="${h}"/></hp:imgRect><hp:imgClip left="0" right="${w}" top="0" bottom="${h}"/><hp:inMargin left="0" right="0" top="0" bottom="0"/><hp:imgDim dimwidth="${w}" dimheight="${h}"/><hc:img binaryItemIDRef="${itemId}" bright="0" contrast="0" effect="REAL_PIC" alpha="0"/><hp:effects/><hp:sz width="${w}" widthRelTo="ABSOLUTE" height="${h}" heightRelTo="ABSOLUTE" protect="0"/><hp:pos treatAsChar="0" affectLSpacing="0" flowWithText="0" allowOverlap="1" holdAnchorAndSO="0" vertRelTo="PARA" horzRelTo="COLUMN" vertAlign="TOP" horzAlign="LEFT" vertOffset="${posYHu}" horzOffset="${posXHu}"/><hp:outMargin left="0" right="0" top="0" bottom="0"/><hp:shapeComment>kordoc seal</hp:shapeComment></hp:pic>`;
|
|
26659
26659
|
}
|
|
26660
26660
|
async function placeSealHwpx(hwpxBuffer, ops) {
|
|
26661
|
-
if (ops.length === 0) throw new (0,
|
|
26661
|
+
if (ops.length === 0) throw new (0, _chunkTUU535RBcjs.KordocError)("place_seal: \uBC30\uCE58\uD560 \uB3C4\uC7A5\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
26662
26662
|
const u8 = new Uint8Array(hwpxBuffer);
|
|
26663
|
-
|
|
26663
|
+
_chunkTUU535RBcjs.precheckZipSize.call(void 0, hwpxBuffer);
|
|
26664
26664
|
const zip = await _jszip2.default.loadAsync(hwpxBuffer);
|
|
26665
26665
|
const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort((a, b) => Number(_nullishCoalesce(_optionalChain([a, 'access', _427 => _427.match, 'call', _428 => _428(/(\d+)\.xml$/i), 'optionalAccess', _429 => _429[1]]), () => ( 0))) - Number(_nullishCoalesce(_optionalChain([b, 'access', _430 => _430.match, 'call', _431 => _431(/(\d+)\.xml$/i), 'optionalAccess', _432 => _432[1]]), () => ( 0))));
|
|
26666
|
-
if (sectionPaths.length === 0) throw new (0,
|
|
26666
|
+
if (sectionPaths.length === 0) throw new (0, _chunkTUU535RBcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
26667
26667
|
const manifestPath = Object.keys(zip.files).find((name) => /\.hpf$/i.test(name));
|
|
26668
26668
|
const headerPath = Object.keys(zip.files).find((name) => /(^|\/)header\.xml$/i.test(name));
|
|
26669
26669
|
const styles = headerPath ? parseRenderStyles(await zip.file(headerPath).async("text")) : null;
|
|
@@ -26704,11 +26704,11 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
26704
26704
|
const manifestItems = [];
|
|
26705
26705
|
const placed = [];
|
|
26706
26706
|
for (const op of ops) {
|
|
26707
|
-
if (!op.anchor) throw new (0,
|
|
26708
|
-
if (!op.image || op.image.length === 0) throw new (0,
|
|
26707
|
+
if (!op.anchor) throw new (0, _chunkTUU535RBcjs.KordocError)("place_seal: anchor \uBB38\uAD6C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
|
|
26708
|
+
if (!op.image || op.image.length === 0) throw new (0, _chunkTUU535RBcjs.KordocError)("place_seal: \uB3C4\uC7A5 \uC774\uBBF8\uC9C0\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
|
|
26709
26709
|
const ext = (_nullishCoalesce(op.ext, () => ( "png"))).toLowerCase();
|
|
26710
|
-
if (!MIME[ext]) throw new (0,
|
|
26711
|
-
if (!imageMagicMatches(op.image, ext)) throw new (0,
|
|
26710
|
+
if (!MIME[ext]) throw new (0, _chunkTUU535RBcjs.KordocError)(`place_seal: \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uC774\uBBF8\uC9C0 \uD655\uC7A5\uC790 .${ext} (png/jpg/bmp/gif)`);
|
|
26711
|
+
if (!imageMagicMatches(op.image, ext)) throw new (0, _chunkTUU535RBcjs.KordocError)(`place_seal: \uC774\uBBF8\uC9C0 \uB0B4\uC6A9\uC774 .${ext} \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4 (\uB9E4\uC9C1\uBC14\uC774\uD2B8 \uBD88\uC77C\uCE58)`);
|
|
26712
26712
|
const wantOcc = _nullishCoalesce(op.occurrence, () => ( 0));
|
|
26713
26713
|
let found = null;
|
|
26714
26714
|
let total = 0;
|
|
@@ -26741,7 +26741,7 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
26741
26741
|
}
|
|
26742
26742
|
}
|
|
26743
26743
|
}
|
|
26744
|
-
throw new (0,
|
|
26744
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(
|
|
26745
26745
|
`place_seal: \uC575\uCEE4 "${op.anchor}" ${wantOcc}\uBC88\uC9F8 \uB4F1\uC7A5\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4 (\uBCF8\uBB38 \uB0B4 ${total}\uD68C \uB4F1\uC7A5 \u2014 occurrence 0..${Math.max(0, total - 1)})`
|
|
26746
26746
|
);
|
|
26747
26747
|
}
|
|
@@ -26749,7 +26749,7 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
26749
26749
|
const xml = sectionXmls[si];
|
|
26750
26750
|
const run = anchorRunInfo(xml, site.para, op.anchor);
|
|
26751
26751
|
if (!run) {
|
|
26752
|
-
throw new (0,
|
|
26752
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(`place_seal: \uC575\uCEE4 "${op.anchor}" \uBB38\uB2E8\uC5D0\uC11C run\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4`);
|
|
26753
26753
|
}
|
|
26754
26754
|
const charPrHeight = _nullishCoalesce(_optionalChain([styles, 'optionalAccess', _433 => _433.charPr, 'access', _434 => _434.get, 'call', _435 => _435(run.charPr), 'optionalAccess', _436 => _436.height]), () => ( 1e3));
|
|
26755
26755
|
const fontPt = charPrHeight / 100;
|
|
@@ -27027,7 +27027,7 @@ function pick(map, keys) {
|
|
|
27027
27027
|
return out;
|
|
27028
27028
|
}
|
|
27029
27029
|
async function hwpxToProfile(input) {
|
|
27030
|
-
const buf = input instanceof ArrayBuffer ? input :
|
|
27030
|
+
const buf = input instanceof ArrayBuffer ? input : _chunkTUU535RBcjs.toArrayBuffer.call(void 0, input);
|
|
27031
27031
|
const zip = await _jszip2.default.loadAsync(buf);
|
|
27032
27032
|
const parser = createXmlParser();
|
|
27033
27033
|
const headerFile = _nullishCoalesce(zip.file("Contents/header.xml"), () => ( _optionalChain([zip, 'access', _458 => _458.file, 'call', _459 => _459(/[Hh]eader\.xml$/), 'optionalAccess', _460 => _460[0]])));
|
|
@@ -27958,7 +27958,7 @@ async function resolveSectionEntryNames(zip) {
|
|
|
27958
27958
|
const paths = sectionPathsFromManifest(xml).filter((p) => zip.file(p) !== null);
|
|
27959
27959
|
if (paths.length > 0) return paths;
|
|
27960
27960
|
}
|
|
27961
|
-
return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort(
|
|
27961
|
+
return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort(_chunkTUU535RBcjs.compareSectionPaths);
|
|
27962
27962
|
}
|
|
27963
27963
|
function sectionPathsFromManifest(xml) {
|
|
27964
27964
|
const attr = (tag, name) => {
|
|
@@ -27968,7 +27968,7 @@ function sectionPathsFromManifest(xml) {
|
|
|
27968
27968
|
const idToHref = /* @__PURE__ */ new Map();
|
|
27969
27969
|
for (const m of xml.matchAll(/<opf:item(\s(?:"[^"]*"|'[^']*'|[^>"'])*?)\/?>/g)) {
|
|
27970
27970
|
const id = attr(m[1], "id");
|
|
27971
|
-
const href =
|
|
27971
|
+
const href = _chunkTUU535RBcjs.normalizeSectionHref.call(void 0, attr(m[1], "href"));
|
|
27972
27972
|
if (id && href) idToHref.set(id, href);
|
|
27973
27973
|
}
|
|
27974
27974
|
const ordered = [];
|
|
@@ -27977,7 +27977,7 @@ function sectionPathsFromManifest(xml) {
|
|
|
27977
27977
|
if (href) ordered.push(href);
|
|
27978
27978
|
}
|
|
27979
27979
|
if (ordered.length > 0) return ordered;
|
|
27980
|
-
return Array.from(idToHref.values()).sort(
|
|
27980
|
+
return Array.from(idToHref.values()).sort(_chunkTUU535RBcjs.compareSectionPaths);
|
|
27981
27981
|
}
|
|
27982
27982
|
|
|
27983
27983
|
// src/roundtrip/patcher.ts
|
|
@@ -28088,9 +28088,9 @@ function buildOrigUnits(blocks) {
|
|
|
28088
28088
|
if (block.type === "paragraph" && block.text && /^\[별표\s*\d+/.test(sanitizeText(block.text))) {
|
|
28089
28089
|
const next = blocks[i + 1];
|
|
28090
28090
|
if (_optionalChain([next, 'optionalAccess', _493 => _493.type]) === "paragraph" && next.text && /관련\)?$/.test(next.text)) consume = 2;
|
|
28091
|
-
chunk =
|
|
28091
|
+
chunk = _chunkW5KRKBYRcjs.blocksToMarkdown.call(void 0, blocks.slice(i, i + consume));
|
|
28092
28092
|
} else {
|
|
28093
|
-
chunk =
|
|
28093
|
+
chunk = _chunkW5KRKBYRcjs.blocksToMarkdown.call(void 0, [block]);
|
|
28094
28094
|
}
|
|
28095
28095
|
if (chunk) {
|
|
28096
28096
|
const subUnits = splitMarkdownUnits(chunk);
|
|
@@ -29710,12 +29710,12 @@ function blocksToChunks(blocks, options) {
|
|
|
29710
29710
|
let run = null;
|
|
29711
29711
|
const flushRun = () => {
|
|
29712
29712
|
if (!run) return;
|
|
29713
|
-
push("text", run.breadcrumb,
|
|
29713
|
+
push("text", run.breadcrumb, _chunkW5KRKBYRcjs.blocksToMarkdown.call(void 0, run.blocks), [run.start, run.end], run.page);
|
|
29714
29714
|
run = null;
|
|
29715
29715
|
};
|
|
29716
29716
|
for (let i = 0; i < blocks.length; i++) {
|
|
29717
29717
|
const block = blocks[i];
|
|
29718
|
-
const md2 =
|
|
29718
|
+
const md2 = _chunkW5KRKBYRcjs.blocksToMarkdown.call(void 0, [block]);
|
|
29719
29719
|
if (!md2) continue;
|
|
29720
29720
|
if (block.type === "heading") {
|
|
29721
29721
|
flushRun();
|
|
@@ -30185,13 +30185,13 @@ async function htmlToPdf(html, options) {
|
|
|
30185
30185
|
try {
|
|
30186
30186
|
puppeteer = await Promise.resolve().then(() => _interopRequireWildcard(require("puppeteer-core")));
|
|
30187
30187
|
} catch (e37) {
|
|
30188
|
-
throw new (0,
|
|
30188
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(
|
|
30189
30189
|
"PDF \uC0DD\uC131\uC5D0 puppeteer-core\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. \uC124\uCE58: npm install puppeteer-core"
|
|
30190
30190
|
);
|
|
30191
30191
|
}
|
|
30192
30192
|
const executablePath = _nullishCoalesce(process.env.PUPPETEER_EXECUTABLE_PATH, () => ( findChromiumPath()));
|
|
30193
30193
|
if (!executablePath) {
|
|
30194
|
-
throw new (0,
|
|
30194
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)(
|
|
30195
30195
|
"Chromium \uC2E4\uD589 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. PUPPETEER_EXECUTABLE_PATH \uD658\uACBD\uBCC0\uC218\uB97C \uC124\uC815\uD558\uC138\uC694."
|
|
30196
30196
|
);
|
|
30197
30197
|
}
|
|
@@ -30250,7 +30250,7 @@ async function markdownToPdf(markdown, options) {
|
|
|
30250
30250
|
return htmlToPdf(html, options);
|
|
30251
30251
|
}
|
|
30252
30252
|
async function blocksToPdf(blocks, options) {
|
|
30253
|
-
const markdown =
|
|
30253
|
+
const markdown = _chunkW5KRKBYRcjs.blocksToMarkdown.call(void 0, blocks);
|
|
30254
30254
|
return markdownToPdf(markdown, options);
|
|
30255
30255
|
}
|
|
30256
30256
|
|
|
@@ -31148,15 +31148,15 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode) {
|
|
|
31148
31148
|
async function renderHwpxToSvg(input, options) {
|
|
31149
31149
|
const maxImg = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _590 => _590.maxImageBytes]), () => ( 40 * 1024 * 1024));
|
|
31150
31150
|
const ab = input instanceof Uint8Array ? input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength) : input;
|
|
31151
|
-
|
|
31151
|
+
_chunkTUU535RBcjs.precheckZipSize.call(void 0, ab, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
|
|
31152
31152
|
let zip;
|
|
31153
31153
|
try {
|
|
31154
31154
|
zip = await _jszip2.default.loadAsync(input);
|
|
31155
31155
|
} catch (e38) {
|
|
31156
|
-
throw new (0,
|
|
31156
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("HWPX(ZIP) \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4 \u2014 \uB80C\uB354\uB294 HWPX\uB9CC \uC9C0\uC6D0");
|
|
31157
31157
|
}
|
|
31158
31158
|
const secFiles = zip.file(/Contents\/section\d+\.xml$/i).sort((a, b) => a.name.localeCompare(b.name));
|
|
31159
|
-
if (secFiles.length === 0) throw new (0,
|
|
31159
|
+
if (secFiles.length === 0) throw new (0, _chunkTUU535RBcjs.KordocError)("Contents/section0.xml \uC5C6\uC74C \u2014 HWPX\uAC00 \uC544\uB2C8\uAC70\uB098 \uC190\uC0C1\uB428");
|
|
31160
31160
|
const warnings = [];
|
|
31161
31161
|
const headFile = _nullishCoalesce(zip.file("Contents/header.xml"), () => ( zip.file("Contents/head.xml")));
|
|
31162
31162
|
const styles = headFile ? parseRenderStyles(await headFile.async("string")) : { charPr: /* @__PURE__ */ new Map(), paraAlign: /* @__PURE__ */ new Map(), paraGeom: /* @__PURE__ */ new Map(), borderFill: /* @__PURE__ */ new Map() };
|
|
@@ -31164,7 +31164,7 @@ async function renderHwpxToSvg(input, options) {
|
|
|
31164
31164
|
const secXmls = [];
|
|
31165
31165
|
for (const f of secFiles) {
|
|
31166
31166
|
const xml = await f.async("string");
|
|
31167
|
-
if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
31167
|
+
if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0, _chunkTUU535RBcjs.KordocError)("\uC139\uC158 XML\uC774 \uD5C8\uC6A9 \uD06C\uAE30\uB97C \uCD08\uACFC");
|
|
31168
31168
|
secXmls.push(xml);
|
|
31169
31169
|
}
|
|
31170
31170
|
const binmap = /* @__PURE__ */ new Map();
|
|
@@ -31237,9 +31237,9 @@ async function renderHwpxToSvg(input, options) {
|
|
|
31237
31237
|
}
|
|
31238
31238
|
if (rendered.length === 0) {
|
|
31239
31239
|
if (noCacheSkipped) {
|
|
31240
|
-
throw new (0,
|
|
31240
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("\uC870\uD310 \uCE90\uC2DC(linesegarray) \uC5C6\uC74C \u2014 \uD55C\uCEF4\uC5D0\uC11C \uC800\uC7A5\uD55C HWPX\uB9CC \uB80C\uB354 \uAC00\uB2A5 (reflow \uC635\uC158\uC73C\uB85C \uD569\uC131 \uB80C\uB354 \uAC00\uB2A5)");
|
|
31241
31241
|
}
|
|
31242
|
-
throw new (0,
|
|
31242
|
+
throw new (0, _chunkTUU535RBcjs.KordocError)("\uB80C\uB354\uD560 \uAD6C\uC5ED\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 HWPX\uAC00 \uC190\uC0C1\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4");
|
|
31243
31243
|
}
|
|
31244
31244
|
const GAP = 2400;
|
|
31245
31245
|
const clipDefs = [];
|
|
@@ -31275,13 +31275,13 @@ async function parse(input, options) {
|
|
|
31275
31275
|
if (typeof input === "string") {
|
|
31276
31276
|
try {
|
|
31277
31277
|
const buf = await _promises.readFile.call(void 0, input);
|
|
31278
|
-
buffer =
|
|
31278
|
+
buffer = _chunkTUU535RBcjs.toArrayBuffer.call(void 0, buf);
|
|
31279
31279
|
} catch (err) {
|
|
31280
31280
|
const msg2 = err instanceof Error && "code" in err && err.code === "ENOENT" ? `\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${input}` : `\uD30C\uC77C \uC77D\uAE30 \uC2E4\uD328: ${input}`;
|
|
31281
31281
|
return { success: false, fileType: "unknown", error: msg2, code: "PARSE_ERROR" };
|
|
31282
31282
|
}
|
|
31283
31283
|
} else if (Buffer.isBuffer(input)) {
|
|
31284
|
-
buffer =
|
|
31284
|
+
buffer = _chunkTUU535RBcjs.toArrayBuffer.call(void 0, input);
|
|
31285
31285
|
} else {
|
|
31286
31286
|
buffer = input;
|
|
31287
31287
|
}
|
|
@@ -31315,18 +31315,18 @@ async function parse(input, options) {
|
|
|
31315
31315
|
}
|
|
31316
31316
|
async function parseImage(buffer, options) {
|
|
31317
31317
|
try {
|
|
31318
|
-
const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-
|
|
31318
|
+
const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-OB5PCQUU.cjs")));
|
|
31319
31319
|
const { blocks, warnings } = await parseImageDocument(buffer, options);
|
|
31320
31320
|
return {
|
|
31321
31321
|
success: true,
|
|
31322
31322
|
fileType: "image",
|
|
31323
|
-
markdown:
|
|
31323
|
+
markdown: _chunkW5KRKBYRcjs.blocksToMarkdown.call(void 0, blocks),
|
|
31324
31324
|
blocks,
|
|
31325
31325
|
warnings: warnings.length ? warnings : void 0,
|
|
31326
31326
|
pageCount: 1
|
|
31327
31327
|
};
|
|
31328
31328
|
} catch (err) {
|
|
31329
|
-
return { success: false, fileType: "image", error:
|
|
31329
|
+
return { success: false, fileType: "image", error: _chunkTUU535RBcjs.sanitizeError.call(void 0, err), code: _chunkTUU535RBcjs.classifyError.call(void 0, err) };
|
|
31330
31330
|
}
|
|
31331
31331
|
}
|
|
31332
31332
|
async function parseHwp3(buffer, options) {
|
|
@@ -31334,7 +31334,7 @@ async function parseHwp3(buffer, options) {
|
|
|
31334
31334
|
const { markdown, blocks, metadata, outline, warnings } = parseHwp3Document(buffer, options);
|
|
31335
31335
|
return { success: true, fileType: "hwp3", markdown, blocks, metadata, outline, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _597 => _597.pageCount]) };
|
|
31336
31336
|
} catch (err) {
|
|
31337
|
-
return { success: false, fileType: "hwp3", error:
|
|
31337
|
+
return { success: false, fileType: "hwp3", error: _chunkTUU535RBcjs.sanitizeError.call(void 0, err), code: _chunkTUU535RBcjs.classifyError.call(void 0, err) };
|
|
31338
31338
|
}
|
|
31339
31339
|
}
|
|
31340
31340
|
async function parseHwpx(buffer, options) {
|
|
@@ -31342,7 +31342,7 @@ async function parseHwpx(buffer, options) {
|
|
|
31342
31342
|
const { markdown, blocks, metadata, outline, warnings, images } = await parseHwpxDocument(buffer, options);
|
|
31343
31343
|
return { success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _598 => _598.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _599 => _599.pageCount]) };
|
|
31344
31344
|
} catch (err) {
|
|
31345
|
-
return { success: false, fileType: "hwpx", error:
|
|
31345
|
+
return { success: false, fileType: "hwpx", error: _chunkTUU535RBcjs.sanitizeError.call(void 0, err), code: _chunkTUU535RBcjs.classifyError.call(void 0, err) };
|
|
31346
31346
|
}
|
|
31347
31347
|
}
|
|
31348
31348
|
async function parseHwp(buffer, options) {
|
|
@@ -31368,13 +31368,13 @@ async function parseHwp(buffer, options) {
|
|
|
31368
31368
|
}
|
|
31369
31369
|
return { success: true, fileType: "hwp", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _601 => _601.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _602 => _602.pageCount]) };
|
|
31370
31370
|
} catch (err) {
|
|
31371
|
-
return { success: false, fileType: "hwp", error:
|
|
31371
|
+
return { success: false, fileType: "hwp", error: _chunkTUU535RBcjs.sanitizeError.call(void 0, err), code: _chunkTUU535RBcjs.classifyError.call(void 0, err) };
|
|
31372
31372
|
}
|
|
31373
31373
|
}
|
|
31374
31374
|
async function parsePdf(buffer, options) {
|
|
31375
31375
|
let parsePdfDocument;
|
|
31376
31376
|
try {
|
|
31377
|
-
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-
|
|
31377
|
+
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-VACM3DFR.cjs")));
|
|
31378
31378
|
parsePdfDocument = mod.parsePdfDocument;
|
|
31379
31379
|
} catch (e40) {
|
|
31380
31380
|
return {
|
|
@@ -31389,7 +31389,7 @@ async function parsePdf(buffer, options) {
|
|
|
31389
31389
|
return { success: true, fileType: "pdf", markdown, blocks, metadata, outline, warnings, isImageBased, pageQuality, qualitySummary, images, pageCount: _optionalChain([metadata, 'optionalAccess', _603 => _603.pageCount]) };
|
|
31390
31390
|
} catch (err) {
|
|
31391
31391
|
const isImageBased = err instanceof Error && "isImageBased" in err ? true : void 0;
|
|
31392
|
-
return { success: false, fileType: "pdf", error:
|
|
31392
|
+
return { success: false, fileType: "pdf", error: _chunkTUU535RBcjs.sanitizeError.call(void 0, err), code: _chunkTUU535RBcjs.classifyError.call(void 0, err), isImageBased };
|
|
31393
31393
|
}
|
|
31394
31394
|
}
|
|
31395
31395
|
async function parseXlsx(buffer, options) {
|
|
@@ -31397,7 +31397,7 @@ async function parseXlsx(buffer, options) {
|
|
|
31397
31397
|
const { markdown, blocks, metadata, warnings } = await parseXlsxDocument(buffer, options);
|
|
31398
31398
|
return { success: true, fileType: "xlsx", markdown, blocks, metadata, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _604 => _604.pageCount]) };
|
|
31399
31399
|
} catch (err) {
|
|
31400
|
-
return { success: false, fileType: "xlsx", error:
|
|
31400
|
+
return { success: false, fileType: "xlsx", error: _chunkTUU535RBcjs.sanitizeError.call(void 0, err), code: _chunkTUU535RBcjs.classifyError.call(void 0, err) };
|
|
31401
31401
|
}
|
|
31402
31402
|
}
|
|
31403
31403
|
async function parseXls(buffer, options) {
|
|
@@ -31405,7 +31405,7 @@ async function parseXls(buffer, options) {
|
|
|
31405
31405
|
const { markdown, blocks, metadata, warnings } = await parseXlsDocument(buffer, options);
|
|
31406
31406
|
return { success: true, fileType: "xls", markdown, blocks, metadata, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _605 => _605.pageCount]) };
|
|
31407
31407
|
} catch (err) {
|
|
31408
|
-
return { success: false, fileType: "xls", error:
|
|
31408
|
+
return { success: false, fileType: "xls", error: _chunkTUU535RBcjs.sanitizeError.call(void 0, err), code: _chunkTUU535RBcjs.classifyError.call(void 0, err) };
|
|
31409
31409
|
}
|
|
31410
31410
|
}
|
|
31411
31411
|
async function parseDocx(buffer, options) {
|
|
@@ -31413,7 +31413,7 @@ async function parseDocx(buffer, options) {
|
|
|
31413
31413
|
const { markdown, blocks, metadata, outline, warnings, images } = await parseDocxDocument(buffer, options);
|
|
31414
31414
|
return { success: true, fileType: "docx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _606 => _606.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _607 => _607.pageCount]) };
|
|
31415
31415
|
} catch (err) {
|
|
31416
|
-
return { success: false, fileType: "docx", error:
|
|
31416
|
+
return { success: false, fileType: "docx", error: _chunkTUU535RBcjs.sanitizeError.call(void 0, err), code: _chunkTUU535RBcjs.classifyError.call(void 0, err) };
|
|
31417
31417
|
}
|
|
31418
31418
|
}
|
|
31419
31419
|
async function parseHwpml(buffer, options) {
|
|
@@ -31421,16 +31421,16 @@ async function parseHwpml(buffer, options) {
|
|
|
31421
31421
|
const { markdown, blocks, metadata, outline, warnings } = parseHwpmlDocument(buffer, options);
|
|
31422
31422
|
return { success: true, fileType: "hwpml", markdown, blocks, metadata, outline, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _608 => _608.pageCount]) };
|
|
31423
31423
|
} catch (err) {
|
|
31424
|
-
return { success: false, fileType: "hwpml", error:
|
|
31424
|
+
return { success: false, fileType: "hwpml", error: _chunkTUU535RBcjs.sanitizeError.call(void 0, err), code: _chunkTUU535RBcjs.classifyError.call(void 0, err) };
|
|
31425
31425
|
}
|
|
31426
31426
|
}
|
|
31427
31427
|
async function fillForm(input, values, outputFormat = "markdown") {
|
|
31428
31428
|
let buffer;
|
|
31429
31429
|
if (typeof input === "string") {
|
|
31430
31430
|
const buf = await _promises.readFile.call(void 0, input);
|
|
31431
|
-
buffer =
|
|
31431
|
+
buffer = _chunkTUU535RBcjs.toArrayBuffer.call(void 0, buf);
|
|
31432
31432
|
} else if (Buffer.isBuffer(input)) {
|
|
31433
|
-
buffer =
|
|
31433
|
+
buffer = _chunkTUU535RBcjs.toArrayBuffer.call(void 0, input);
|
|
31434
31434
|
} else {
|
|
31435
31435
|
buffer = input;
|
|
31436
31436
|
}
|
|
@@ -31456,7 +31456,7 @@ async function fillForm(input, values, outputFormat = "markdown") {
|
|
|
31456
31456
|
throw new Error(`\uC11C\uC2DD \uD30C\uC2F1 \uC2E4\uD328: ${parsed.error}`);
|
|
31457
31457
|
}
|
|
31458
31458
|
const fill = fillFormFields(parsed.blocks, values);
|
|
31459
|
-
const markdown =
|
|
31459
|
+
const markdown = _chunkW5KRKBYRcjs.blocksToMarkdown.call(void 0, fill.blocks);
|
|
31460
31460
|
if (outputFormat === "hwpx") {
|
|
31461
31461
|
const hwpxBuffer = await markdownToHwpx(markdown);
|
|
31462
31462
|
return { output: hwpxBuffer, format: "hwpx", fill };
|
|
@@ -31535,5 +31535,5 @@ async function fillForm(input, values, outputFormat = "markdown") {
|
|
|
31535
31535
|
|
|
31536
31536
|
|
|
31537
31537
|
|
|
31538
|
-
exports.BUILTIN_TEMPLATES = BUILTIN_TEMPLATES; exports.DEFAULT_REDACT_RULES = DEFAULT_REDACT_RULES; exports.HwpxSession = HwpxSession; exports.PRESET_ALIAS = PRESET_ALIAS; exports.SPACE_EM_FIXED = SPACE_EM_FIXED; exports.SPACE_EM_FONT = SPACE_EM_FONT; exports.VERSION =
|
|
31538
|
+
exports.BUILTIN_TEMPLATES = BUILTIN_TEMPLATES; exports.DEFAULT_REDACT_RULES = DEFAULT_REDACT_RULES; exports.HwpxSession = HwpxSession; exports.PRESET_ALIAS = PRESET_ALIAS; exports.SPACE_EM_FIXED = SPACE_EM_FIXED; exports.SPACE_EM_FONT = SPACE_EM_FONT; exports.VERSION = _chunkTUU535RBcjs.VERSION; exports.ValueCursor = ValueCursor; exports.applySplices = applySplices; exports.blocksToChunks = blocksToChunks; exports.blocksToMarkdown = _chunkW5KRKBYRcjs.blocksToMarkdown; exports.blocksToPdf = blocksToPdf; exports.buildParagraphSplices = buildParagraphSplices; exports.buildRangeSplices = buildRangeSplices; exports.charWidthEm1000 = charWidthEm1000; exports.compare = compare; exports.detectFormat = detectFormat; exports.detectOle2Format = detectOle2Format; exports.detectZipFormat = detectZipFormat; exports.diffBlocks = diffBlocks; exports.extractClickHereFields = extractClickHereFields; exports.extractFormFields = extractFormFields; exports.extractFormSchema = extractFormSchema; exports.fillForm = fillForm; exports.fillFormFields = fillFormFields; exports.fillHwpx = fillHwpx; exports.fillWithUniqueGuard = fillWithUniqueGuard; exports.fitRatioForFewerLines = fitRatioForFewerLines; exports.formatFillValue = formatFillValue; exports.gongmunLintWarnings = gongmunLintWarnings; exports.hwpxToProfile = hwpxToProfile; exports.incompatibleGongmunWarnings = incompatibleGongmunWarnings; exports.inferFieldType = inferFieldType; exports.isHwpxFile = isHwpxFile; exports.isKnownFont = isKnownFont; exports.isLabelCell = isLabelCell; exports.isOldHwpFile = isOldHwpFile; exports.isPdfFile = isPdfFile; exports.isZipFile = isZipFile; exports.lintGongmunText = lintGongmunText; exports.markdownToHwpx = markdownToHwpx; exports.markdownToPdf = markdownToPdf; exports.measureTextWidth = measureTextWidth; exports.normalizeGongmunPreset = normalizeGongmunPreset; exports.openHwpxDocument = openHwpxDocument; exports.parse = parse; exports.parseDocx = parseDocx; exports.parseHwp = parseHwp; exports.parseHwp3 = parseHwp3; exports.parseHwpml = parseHwpml; exports.parseHwpx = parseHwpx; exports.parseImage = parseImage; exports.parsePdf = parsePdf; exports.parseXls = parseXls; exports.parseXlsx = parseXlsx; exports.patchHwp = patchHwp; exports.patchHwpx = patchHwpx; exports.patchHwpxBlocks = patchHwpxBlocks; exports.placeSealHwpx = placeSealHwpx; exports.readBuiltinTemplate = readBuiltinTemplate; exports.readBuiltinTemplateSample = readBuiltinTemplateSample; exports.redactMarkdown = redactMarkdown; exports.redactText = redactText; exports.renderHtml = renderHtml; exports.renderHwpxToSvg = renderHwpxToSvg; exports.resolveBuiltinTemplate = resolveBuiltinTemplate; exports.scanSectionXml = scanSectionXml; exports.simulateWrap = simulateWrap; exports.simulateWrapKeepWord = simulateWrapKeepWord; exports.unknownFontWarnings = unknownFontWarnings; exports.validateHwpx = validateHwpx;
|
|
31539
31539
|
//# sourceMappingURL=index.cjs.map
|