kordoc 4.9.1 → 4.9.2
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/README.md +7 -0
- package/dist/{-KIYHEVUW.js → -Z4LCTGQR.js} +8 -8
- package/dist/{chunk-3PY5YCJP.js → chunk-5ZPXRDS2.js} +2 -2
- package/dist/{chunk-JHXAQDXS.js → chunk-6WYMV73J.js} +40 -14
- package/dist/{chunk-JHXAQDXS.js.map → chunk-6WYMV73J.js.map} +1 -1
- package/dist/{chunk-65TL66UD.cjs → chunk-BAJVZXC7.cjs} +3 -3
- package/dist/{chunk-65TL66UD.cjs.map → chunk-BAJVZXC7.cjs.map} +1 -1
- package/dist/{chunk-GNRBCV4R.js → chunk-GL6BCNJV.js} +3 -3
- package/dist/{chunk-Q3IVAWOK.js → chunk-JHPEDWJX.js} +3 -3
- package/dist/{chunk-4R73ASZF.cjs → chunk-KATZTHWA.cjs} +2 -2
- package/dist/{chunk-4R73ASZF.cjs.map → chunk-KATZTHWA.cjs.map} +1 -1
- package/dist/{chunk-SFSB3FAL.js → chunk-LJP3PK2S.js} +2 -2
- package/dist/{chunk-SGTGSV4A.js → chunk-LKZQ4564.js} +2 -2
- package/dist/{chunk-5CAKNM2K.js → chunk-LREEDIEF.js} +2 -2
- package/dist/{chunk-HG7GXBVP.js → chunk-LUY46O7O.js} +2 -2
- package/dist/{chunk-55Q76S6S.js → chunk-NIBRVLGS.js} +2 -2
- package/dist/{chunk-D7EMDOX7.cjs → chunk-NIQ4JCQF.cjs} +6 -6
- package/dist/{chunk-D7EMDOX7.cjs.map → chunk-NIQ4JCQF.cjs.map} +1 -1
- package/dist/{chunk-UIQWUYOJ.js → chunk-NOEYLJGJ.js} +3 -3
- package/dist/{chunk-INV3W43Y.js → chunk-OOT54JF2.js} +2 -2
- package/dist/{chunk-VGRIWMTQ.js → chunk-OYQL3D4B.js} +2 -2
- package/dist/{chunk-L27YEW3T.js → chunk-PIUPP3FL.js} +3 -3
- package/dist/{chunk-TC7EDYZD.js → chunk-PKCDYIIJ.js} +2 -2
- package/dist/{chunk-HOSNMNKU.cjs → chunk-SHBVD23C.cjs} +7 -7
- package/dist/{chunk-HOSNMNKU.cjs.map → chunk-SHBVD23C.cjs.map} +1 -1
- package/dist/{chunk-HFZIYAQQ.js → chunk-TK7WUS47.js} +2 -2
- package/dist/{chunk-2ULV2DX4.cjs → chunk-V3Q6I2AQ.cjs} +4 -4
- package/dist/{chunk-2ULV2DX4.cjs.map → chunk-V3Q6I2AQ.cjs.map} +1 -1
- package/dist/{chunk-TN6AALZG.js → chunk-VYGNPB2X.js} +2 -2
- package/dist/{chunk-Z2SX4E7K.js → chunk-WLZX2HTC.js} +2 -2
- package/dist/{chunk-GU4NCNCT.js → chunk-Y7QB4IB6.js} +2 -2
- package/dist/chunks-TRJGNO4N.js +10 -0
- package/dist/cli.js +20 -20
- package/dist/{formula-S4O7SBN3.js → formula-77TJPACH.js} +3 -3
- package/dist/{formula-I5D3UNLV.cjs → formula-JVBJ6QRG.cjs} +9 -9
- package/dist/{formula-I5D3UNLV.cjs.map → formula-JVBJ6QRG.cjs.map} +1 -1
- package/dist/{formula-5DQQ4MFT.js → formula-LFWZG7T7.js} +4 -4
- package/dist/{image-ocr-SQXFTNYR.js → image-ocr-6SY623KL.js} +7 -7
- package/dist/{image-ocr-BKUYR4WU.cjs → image-ocr-YTGAUHEP.cjs} +11 -11
- package/dist/{image-ocr-BKUYR4WU.cjs.map → image-ocr-YTGAUHEP.cjs.map} +1 -1
- package/dist/{image-ocr-LIH2E7WC.js → image-ocr-YZ56O63S.js} +5 -5
- package/dist/index.cjs +207 -181
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +36 -10
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +15 -15
- package/dist/{model-bundle-4JMY5E37.js → model-bundle-W7B3BIYS.js} +5 -5
- package/dist/{models-D7X5YBWX.js → models-FUKPEVPE.js} +5 -5
- package/dist/{parser-MY7JJISJ.js → parser-6UL2HLDH.js} +6 -6
- package/dist/{parser-GHRXWFJN.js → parser-GDYZDBZI.js} +6 -6
- package/dist/{parser-ZLHOAZAA.cjs → parser-WIRWVN5E.cjs} +26 -26
- package/dist/{parser-ZLHOAZAA.cjs.map → parser-WIRWVN5E.cjs.map} +1 -1
- package/dist/pdf-ocr-O373AAN6.cjs +14 -0
- package/dist/{pdf-ocr-FESGFQYN.cjs.map → pdf-ocr-O373AAN6.cjs.map} +1 -1
- package/dist/pdf-ocr-OHUAQQMN.js +16 -0
- package/dist/pdf-ocr-XTE234WC.js +13 -0
- package/dist/{profile-io-EAPI6M7O.js → profile-io-4EE64K6Y.js} +3 -3
- package/dist/{rasterize-UIDZAEWB.js → rasterize-QW7SSKHB.js} +2 -2
- package/dist/render-2NID54BX.js +10 -0
- package/dist/seal-PTP4TWYR.js +10 -0
- package/dist/{setup-UHX3HHWY.js → setup-JS7E2HFM.js} +3 -3
- package/dist/{watch-23MV3PBX.js → watch-YISVPGW3.js} +9 -9
- package/package.json +1 -1
- package/dist/chunks-FB344JZT.js +0 -10
- package/dist/pdf-ocr-FESGFQYN.cjs +0 -14
- package/dist/pdf-ocr-IEAXGG3D.js +0 -13
- package/dist/pdf-ocr-Z6CHIYEM.js +0 -16
- package/dist/render-XL7ZVAHK.js +0 -10
- package/dist/seal-CY7EIWDJ.js +0 -10
- /package/dist/{-KIYHEVUW.js.map → -Z4LCTGQR.js.map} +0 -0
- /package/dist/{chunk-3PY5YCJP.js.map → chunk-5ZPXRDS2.js.map} +0 -0
- /package/dist/{chunk-GNRBCV4R.js.map → chunk-GL6BCNJV.js.map} +0 -0
- /package/dist/{chunk-Q3IVAWOK.js.map → chunk-JHPEDWJX.js.map} +0 -0
- /package/dist/{chunk-SFSB3FAL.js.map → chunk-LJP3PK2S.js.map} +0 -0
- /package/dist/{chunk-SGTGSV4A.js.map → chunk-LKZQ4564.js.map} +0 -0
- /package/dist/{chunk-5CAKNM2K.js.map → chunk-LREEDIEF.js.map} +0 -0
- /package/dist/{chunk-HG7GXBVP.js.map → chunk-LUY46O7O.js.map} +0 -0
- /package/dist/{chunk-55Q76S6S.js.map → chunk-NIBRVLGS.js.map} +0 -0
- /package/dist/{chunk-UIQWUYOJ.js.map → chunk-NOEYLJGJ.js.map} +0 -0
- /package/dist/{chunk-INV3W43Y.js.map → chunk-OOT54JF2.js.map} +0 -0
- /package/dist/{chunk-VGRIWMTQ.js.map → chunk-OYQL3D4B.js.map} +0 -0
- /package/dist/{chunk-L27YEW3T.js.map → chunk-PIUPP3FL.js.map} +0 -0
- /package/dist/{chunk-TC7EDYZD.js.map → chunk-PKCDYIIJ.js.map} +0 -0
- /package/dist/{chunk-HFZIYAQQ.js.map → chunk-TK7WUS47.js.map} +0 -0
- /package/dist/{chunk-TN6AALZG.js.map → chunk-VYGNPB2X.js.map} +0 -0
- /package/dist/{chunk-Z2SX4E7K.js.map → chunk-WLZX2HTC.js.map} +0 -0
- /package/dist/{chunk-GU4NCNCT.js.map → chunk-Y7QB4IB6.js.map} +0 -0
- /package/dist/{chunks-FB344JZT.js.map → chunks-TRJGNO4N.js.map} +0 -0
- /package/dist/{formula-S4O7SBN3.js.map → formula-77TJPACH.js.map} +0 -0
- /package/dist/{formula-5DQQ4MFT.js.map → formula-LFWZG7T7.js.map} +0 -0
- /package/dist/{image-ocr-SQXFTNYR.js.map → image-ocr-6SY623KL.js.map} +0 -0
- /package/dist/{image-ocr-LIH2E7WC.js.map → image-ocr-YZ56O63S.js.map} +0 -0
- /package/dist/{model-bundle-4JMY5E37.js.map → model-bundle-W7B3BIYS.js.map} +0 -0
- /package/dist/{models-D7X5YBWX.js.map → models-FUKPEVPE.js.map} +0 -0
- /package/dist/{parser-MY7JJISJ.js.map → parser-6UL2HLDH.js.map} +0 -0
- /package/dist/{parser-GHRXWFJN.js.map → parser-GDYZDBZI.js.map} +0 -0
- /package/dist/{pdf-ocr-IEAXGG3D.js.map → pdf-ocr-OHUAQQMN.js.map} +0 -0
- /package/dist/{pdf-ocr-Z6CHIYEM.js.map → pdf-ocr-XTE234WC.js.map} +0 -0
- /package/dist/{profile-io-EAPI6M7O.js.map → profile-io-4EE64K6Y.js.map} +0 -0
- /package/dist/{rasterize-UIDZAEWB.js.map → rasterize-QW7SSKHB.js.map} +0 -0
- /package/dist/{render-XL7ZVAHK.js.map → render-2NID54BX.js.map} +0 -0
- /package/dist/{seal-CY7EIWDJ.js.map → seal-PTP4TWYR.js.map} +0 -0
- /package/dist/{setup-UHX3HHWY.js.map → setup-JS7E2HFM.js.map} +0 -0
- /package/dist/{watch-23MV3PBX.js.map → watch-YISVPGW3.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkV3Q6I2AQcjs = require('./chunk-V3Q6I2AQ.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
var _chunkDCZVOIEOcjs = require('./chunk-DCZVOIEO.cjs');
|
|
@@ -29,7 +29,7 @@ var _chunkL5CDTOC3cjs = require('./chunk-L5CDTOC3.cjs');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkKATZTHWAcjs = require('./chunk-KATZTHWA.cjs');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
var _chunkGS7T56RPcjs = require('./chunk-GS7T56RP.cjs');
|
|
@@ -484,7 +484,7 @@ function rawTextContent(node, depth = 0) {
|
|
|
484
484
|
// src/hwpx/parser-shared.ts
|
|
485
485
|
var MAX_DECOMPRESS_SIZE = 256 * 1024 * 1024;
|
|
486
486
|
var MAX_ZIP_ENTRIES = 500;
|
|
487
|
-
var ZipBombError = class extends
|
|
487
|
+
var ZipBombError = class extends _chunkKATZTHWAcjs.KordocError {
|
|
488
488
|
constructor(message) {
|
|
489
489
|
super(message);
|
|
490
490
|
this.name = "ZipBombError";
|
|
@@ -504,7 +504,7 @@ function createSectionShared() {
|
|
|
504
504
|
function createXmlParser(warnings) {
|
|
505
505
|
return new (0, _xmldom.DOMParser)({
|
|
506
506
|
onError(level, msg2) {
|
|
507
|
-
if (level === "fatalError") throw new (0,
|
|
507
|
+
if (level === "fatalError") throw new (0, _chunkKATZTHWAcjs.KordocError)(`XML \uD30C\uC2F1 \uC2E4\uD328: ${msg2}`);
|
|
508
508
|
_optionalChain([warnings, 'optionalAccess', _3 => _3.push, 'call', _4 => _4({ code: "MALFORMED_XML", message: `XML ${level === "warning" ? "\uACBD\uACE0" : "\uC624\uB958"}: ${msg2}` })]);
|
|
509
509
|
}
|
|
510
510
|
});
|
|
@@ -539,13 +539,13 @@ function parseEncryptionManifest(manifestXml) {
|
|
|
539
539
|
const startKey = attrOf(inner, "start-key-generation-name");
|
|
540
540
|
const checksumType = attrOf(inner, "checksum-type");
|
|
541
541
|
if (algorithm !== AES256_CBC) {
|
|
542
|
-
throw new (0,
|
|
542
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWPX \uC554\uD638\uD654 \uBC29\uC2DD\uC785\uB2C8\uB2E4: ${_nullishCoalesce(algorithm, () => ( "(\uBBF8\uC0C1)"))}`);
|
|
543
543
|
}
|
|
544
544
|
if (startKey !== START_KEY_SHA256) {
|
|
545
|
-
throw new (0,
|
|
545
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWPX \uC2DC\uC791\uD0A4 \uC0DD\uC131 \uBC29\uC2DD\uC785\uB2C8\uB2E4: ${_nullishCoalesce(startKey, () => ( "(\uBBF8\uC0C1)"))}`);
|
|
546
546
|
}
|
|
547
547
|
if (!_optionalChain([checksumType, 'optionalAccess', _8 => _8.endsWith, 'call', _9 => _9(CHECKSUM_SHA256_1K)])) {
|
|
548
|
-
throw new (0,
|
|
548
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWPX \uCCB4\uD06C\uC12C \uBC29\uC2DD\uC785\uB2C8\uB2E4: ${_nullishCoalesce(checksumType, () => ( "(\uBBF8\uC0C1)"))}`);
|
|
549
549
|
}
|
|
550
550
|
const iterations = parseInt(_nullishCoalesce(attrOf(inner, "iteration-count"), () => ( "")), 10);
|
|
551
551
|
const keySize = parseInt(_nullishCoalesce(attrOf(inner, "key-size"), () => ( "")), 10);
|
|
@@ -553,10 +553,10 @@ function parseEncryptionManifest(manifestXml) {
|
|
|
553
553
|
const salt = Buffer.from(_nullishCoalesce(attrOf(inner, "salt"), () => ( "")), "base64");
|
|
554
554
|
const checksum = Buffer.from(_nullishCoalesce(attrOf(inner, "checksum"), () => ( "")), "base64");
|
|
555
555
|
if (!(iterations > 0 && iterations <= MAX_ITERATION_COUNT)) {
|
|
556
|
-
throw new (0,
|
|
556
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(`HWPX \uC554\uD638\uD654 \uBC18\uBCF5 \uD69F\uC218\uAC00 \uD5C8\uC6A9 \uBC94\uC704\uB97C \uBC97\uC5B4\uB0AC\uC2B5\uB2C8\uB2E4: ${iterations}`);
|
|
557
557
|
}
|
|
558
558
|
if (keySize !== 32 || iv.length !== 16 || salt.length === 0 || checksum.length !== 32) {
|
|
559
|
-
throw new (0,
|
|
559
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(`HWPX \uC554\uD638\uD654 \uD30C\uB77C\uBBF8\uD130\uAC00 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 (${path})`);
|
|
560
560
|
}
|
|
561
561
|
entries.push({ path, checksum, iv, salt, iterations, keySize });
|
|
562
562
|
}
|
|
@@ -589,11 +589,11 @@ async function decryptHwpxInPlace(zip, manifestXml, password) {
|
|
|
589
589
|
for (const entry of entries) {
|
|
590
590
|
const file = zip.file(entry.path);
|
|
591
591
|
if (!file) {
|
|
592
|
-
throw new (0,
|
|
592
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(`\uC554\uD638 \uBAA9\uB85D\uC5D0 \uC788\uB294 \uD30C\uC77C\uC774 \uBB38\uC11C\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4: ${entry.path}`);
|
|
593
593
|
}
|
|
594
594
|
const plain2 = decryptEntry(await file.async("nodebuffer"), entry, startKey);
|
|
595
595
|
if (!plain2) {
|
|
596
|
-
throw new (0,
|
|
596
|
+
throw new (0, _chunkKATZTHWAcjs.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.");
|
|
597
597
|
}
|
|
598
598
|
decrypted.push({ path: entry.path, plain: plain2 });
|
|
599
599
|
}
|
|
@@ -641,10 +641,10 @@ async function extractHwpxStyles(zip, decompressed) {
|
|
|
641
641
|
const xml = await file.async("text");
|
|
642
642
|
if (decompressed) {
|
|
643
643
|
decompressed.total += xml.length * 2;
|
|
644
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
644
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkKATZTHWAcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
645
645
|
}
|
|
646
646
|
const parser = createXmlParser();
|
|
647
|
-
const doc = parser.parseFromString(
|
|
647
|
+
const doc = parser.parseFromString(_chunkKATZTHWAcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
648
648
|
if (!doc.documentElement) continue;
|
|
649
649
|
const domDoc = doc;
|
|
650
650
|
parseCharProperties(domDoc, result.charProperties);
|
|
@@ -1428,7 +1428,7 @@ function resolveParaHeading(paraEl, ctx) {
|
|
|
1428
1428
|
|
|
1429
1429
|
// src/hwpx/table-build.ts
|
|
1430
1430
|
function buildTableWithCellMeta(state, keepAnchoredEmptyCols, keepEmptyParagraphs) {
|
|
1431
|
-
const table2 =
|
|
1431
|
+
const table2 = _chunkV3Q6I2AQcjs.buildTable.call(void 0, state.rows, { keepAnchoredEmptyCols, keepEmptyParagraphs });
|
|
1432
1432
|
if (state.caption) table2.caption = state.caption;
|
|
1433
1433
|
if (_optionalChain([state, 'access', _21 => _21.captionBlocks, 'optionalAccess', _22 => _22.length])) table2.captionBlocks = state.captionBlocks;
|
|
1434
1434
|
const anchors = [];
|
|
@@ -1499,7 +1499,7 @@ function completeTable(newTable, tableStack, blocks, ctx) {
|
|
|
1499
1499
|
const cell2 = parentTable.cell;
|
|
1500
1500
|
(cell2.blocks ??= []).push(block);
|
|
1501
1501
|
cell2.hasStructure = true;
|
|
1502
|
-
let flat =
|
|
1502
|
+
let flat = _chunkV3Q6I2AQcjs.convertTableToText.call(void 0, newTable.rows);
|
|
1503
1503
|
if (newTable.caption) flat = newTable.caption + (flat ? "\n" + flat : "");
|
|
1504
1504
|
if (flat) {
|
|
1505
1505
|
const inlineJoin = newTable.inline === true && cell2.lineOpen === true;
|
|
@@ -1642,7 +1642,7 @@ function detectHwpxSectionPages(root) {
|
|
|
1642
1642
|
// src/hwpx/section-walker.ts
|
|
1643
1643
|
function parseSectionXml(xml, styleMap, warnings, sectionNum, shared) {
|
|
1644
1644
|
const parser = createXmlParser(warnings);
|
|
1645
|
-
const doc = parser.parseFromString(
|
|
1645
|
+
const doc = parser.parseFromString(_chunkKATZTHWAcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
1646
1646
|
if (!doc.documentElement) return [];
|
|
1647
1647
|
const ctx = { styleMap, warnings, sectionNum, shared: _nullishCoalesce(shared, () => ( createSectionShared())) };
|
|
1648
1648
|
ctx.shared.track.deleteDepth = 0;
|
|
@@ -1756,8 +1756,8 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
|
|
|
1756
1756
|
const cs = isNaN(rawCs) ? 1 : rawCs;
|
|
1757
1757
|
const rawRs = parseInt(el.getAttribute("rowSpan") || "1", 10);
|
|
1758
1758
|
const rs = isNaN(rawRs) ? 1 : rawRs;
|
|
1759
|
-
tableCtx.cell.colSpan = clampSpan(cs,
|
|
1760
|
-
tableCtx.cell.rowSpan = clampSpan(rs,
|
|
1759
|
+
tableCtx.cell.colSpan = clampSpan(cs, _chunkV3Q6I2AQcjs.MAX_COLS);
|
|
1760
|
+
tableCtx.cell.rowSpan = clampSpan(rs, _chunkV3Q6I2AQcjs.MAX_ROWS);
|
|
1761
1761
|
}
|
|
1762
1762
|
break;
|
|
1763
1763
|
case "p": {
|
|
@@ -2030,7 +2030,7 @@ function buildSubListTable(el, ctx, depth) {
|
|
|
2030
2030
|
const sink = [];
|
|
2031
2031
|
const st = { rows: [], currentRow: [], cell: null };
|
|
2032
2032
|
walkSection(el, sink, st, [], ctx, depth + 1);
|
|
2033
|
-
let flat =
|
|
2033
|
+
let flat = _chunkV3Q6I2AQcjs.convertTableToText.call(void 0, st.rows);
|
|
2034
2034
|
if (st.caption) flat = st.caption + (flat ? "\n" + flat : "");
|
|
2035
2035
|
const built = [];
|
|
2036
2036
|
completeTable(st, [], built, ctx);
|
|
@@ -2185,7 +2185,7 @@ function extractHyperlinkHref(fieldBegin) {
|
|
|
2185
2185
|
let url = (ch.textContent || "").trim();
|
|
2186
2186
|
if (!url) continue;
|
|
2187
2187
|
url = url.replace(/^https?:\/\/(?=https?:\/\/)/i, "");
|
|
2188
|
-
const safe =
|
|
2188
|
+
const safe = _chunkKATZTHWAcjs.sanitizeHref.call(void 0, url);
|
|
2189
2189
|
if (safe) return safe;
|
|
2190
2190
|
}
|
|
2191
2191
|
return void 0;
|
|
@@ -2345,7 +2345,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
|
|
|
2345
2345
|
case "hyperlink": {
|
|
2346
2346
|
const url = child.getAttribute("url") || child.getAttribute("href") || "";
|
|
2347
2347
|
if (url) {
|
|
2348
|
-
const safe =
|
|
2348
|
+
const safe = _chunkKATZTHWAcjs.sanitizeHref.call(void 0, url);
|
|
2349
2349
|
if (safe) href = safe;
|
|
2350
2350
|
}
|
|
2351
2351
|
walk(child, depth + 1);
|
|
@@ -2628,7 +2628,7 @@ function decompressStream(data) {
|
|
|
2628
2628
|
return _zlib.inflateRawSync.call(void 0, data, opts);
|
|
2629
2629
|
}
|
|
2630
2630
|
function parseFileHeader(data) {
|
|
2631
|
-
if (data.length < 40) throw new (0,
|
|
2631
|
+
if (data.length < 40) throw new (0, _chunkKATZTHWAcjs.KordocError)("FileHeader\uAC00 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4 (\uCD5C\uC18C 40\uBC14\uC774\uD2B8)");
|
|
2632
2632
|
const sig = data.subarray(0, 32).toString("utf8").replace(/\0+$/, "");
|
|
2633
2633
|
return {
|
|
2634
2634
|
signature: sig,
|
|
@@ -3080,13 +3080,13 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
3080
3080
|
}
|
|
3081
3081
|
const allCandidates = resolvedPath ? [resolvedPath, ...candidates] : candidates;
|
|
3082
3082
|
for (const path of allCandidates) {
|
|
3083
|
-
if (
|
|
3083
|
+
if (_chunkKATZTHWAcjs.isPathTraversal.call(void 0, path)) continue;
|
|
3084
3084
|
const file = zip.file(path);
|
|
3085
3085
|
if (!file) continue;
|
|
3086
3086
|
try {
|
|
3087
3087
|
const data = await file.async("uint8array");
|
|
3088
3088
|
decompressed.total += data.length;
|
|
3089
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
3089
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkKATZTHWAcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
3090
3090
|
const ext = path.includes(".") ? path.split(".").pop() || "png" : "png";
|
|
3091
3091
|
const mimeType = imageExtToMime(ext);
|
|
3092
3092
|
imageIndex++;
|
|
@@ -3096,7 +3096,7 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
3096
3096
|
usedPaths.add(path);
|
|
3097
3097
|
break;
|
|
3098
3098
|
} catch (err) {
|
|
3099
|
-
if (err instanceof
|
|
3099
|
+
if (err instanceof _chunkKATZTHWAcjs.KordocError) throw err;
|
|
3100
3100
|
}
|
|
3101
3101
|
}
|
|
3102
3102
|
if (!img) _optionalChain([warnings, 'optionalAccess', _84 => _84.push, 'call', _85 => _85({ page: block.pageNumber, message: `\uC774\uBBF8\uC9C0 \uD30C\uC77C \uC5C6\uC74C: ${ref}`, code: "SKIPPED_IMAGE" })]);
|
|
@@ -3116,11 +3116,11 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
3116
3116
|
if (sweepUnreferenced) {
|
|
3117
3117
|
const binEntries = zip.file(/(?:^|\/)BinData\//i);
|
|
3118
3118
|
for (const file of binEntries) {
|
|
3119
|
-
if (file.dir || usedPaths.has(file.name) ||
|
|
3119
|
+
if (file.dir || usedPaths.has(file.name) || _chunkKATZTHWAcjs.isPathTraversal.call(void 0, file.name)) continue;
|
|
3120
3120
|
try {
|
|
3121
3121
|
const data = await file.async("uint8array");
|
|
3122
3122
|
decompressed.total += data.length;
|
|
3123
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
3123
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkKATZTHWAcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
3124
3124
|
const ext = file.name.includes(".") ? file.name.split(".").pop() || "" : "";
|
|
3125
3125
|
let mimeType = imageExtToMime(ext);
|
|
3126
3126
|
if (mimeType === "application/octet-stream") {
|
|
@@ -3134,7 +3134,7 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
3134
3134
|
images.push(img);
|
|
3135
3135
|
blocks.push({ type: "image", text: filename, imageData: { data, mimeType, filename: file.name } });
|
|
3136
3136
|
} catch (err) {
|
|
3137
|
-
if (err instanceof
|
|
3137
|
+
if (err instanceof _chunkKATZTHWAcjs.KordocError) throw err;
|
|
3138
3138
|
_optionalChain([warnings, 'optionalAccess', _86 => _86.push, 'call', _87 => _87({ message: `\uC774\uBBF8\uC9C0 \uCD94\uCD9C \uC2E4\uD328: ${file.name}`, code: "SKIPPED_IMAGE" })]);
|
|
3139
3139
|
}
|
|
3140
3140
|
}
|
|
@@ -3185,7 +3185,7 @@ function extractFromBrokenZip(buffer) {
|
|
|
3185
3185
|
}
|
|
3186
3186
|
const nameBytes = data.slice(pos + 30, pos + 30 + nameLen);
|
|
3187
3187
|
const name = new TextDecoder().decode(nameBytes);
|
|
3188
|
-
if (
|
|
3188
|
+
if (_chunkKATZTHWAcjs.isPathTraversal.call(void 0, name)) {
|
|
3189
3189
|
pos = fileStart + compSize;
|
|
3190
3190
|
continue;
|
|
3191
3191
|
}
|
|
@@ -3203,7 +3203,7 @@ function extractFromBrokenZip(buffer) {
|
|
|
3203
3203
|
continue;
|
|
3204
3204
|
}
|
|
3205
3205
|
totalDecompressed += content.length * 2;
|
|
3206
|
-
if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
3206
|
+
if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0, _chunkKATZTHWAcjs.KordocError)("\uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC");
|
|
3207
3207
|
sectionNum++;
|
|
3208
3208
|
const secBlocks = parseSectionXml(content, void 0, warnings, sectionNum, shared);
|
|
3209
3209
|
for (const b of secBlocks) b.pageNumber = sectionNum;
|
|
@@ -3212,9 +3212,9 @@ function extractFromBrokenZip(buffer) {
|
|
|
3212
3212
|
continue;
|
|
3213
3213
|
}
|
|
3214
3214
|
}
|
|
3215
|
-
if (blocks.length === 0) throw new (0,
|
|
3215
|
+
if (blocks.length === 0) throw new (0, _chunkKATZTHWAcjs.KordocError)("\uC190\uC0C1\uB41C HWPX\uC5D0\uC11C \uC139\uC158 \uB370\uC774\uD130\uB97C \uBCF5\uAD6C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
3216
3216
|
applyPageText(blocks, shared);
|
|
3217
|
-
const markdown =
|
|
3217
|
+
const markdown = _chunkV3Q6I2AQcjs.blocksToMarkdown.call(void 0, blocks);
|
|
3218
3218
|
return { markdown, blocks, warnings: warnings.length > 0 ? warnings : void 0 };
|
|
3219
3219
|
}
|
|
3220
3220
|
async function readKordocLayout(zip) {
|
|
@@ -3239,18 +3239,18 @@ async function resolveSectionPaths(zip) {
|
|
|
3239
3239
|
if (paths.length > 0) return paths;
|
|
3240
3240
|
}
|
|
3241
3241
|
const sectionFiles = zip.file(/[Ss]ection\d+\.xml$/);
|
|
3242
|
-
return sectionFiles.map((f) => f.name).sort(
|
|
3242
|
+
return sectionFiles.map((f) => f.name).sort(_chunkKATZTHWAcjs.compareSectionPaths);
|
|
3243
3243
|
}
|
|
3244
3244
|
function parseSectionPathsFromManifest(xml) {
|
|
3245
3245
|
const parser = createXmlParser();
|
|
3246
|
-
const doc = parser.parseFromString(
|
|
3246
|
+
const doc = parser.parseFromString(_chunkKATZTHWAcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
3247
3247
|
const items = doc.getElementsByTagName("opf:item");
|
|
3248
3248
|
const spine = doc.getElementsByTagName("opf:itemref");
|
|
3249
3249
|
const idToHref = /* @__PURE__ */ new Map();
|
|
3250
3250
|
for (let i = 0; i < items.length; i++) {
|
|
3251
3251
|
const item = items[i];
|
|
3252
3252
|
const id = item.getAttribute("id") || "";
|
|
3253
|
-
const href =
|
|
3253
|
+
const href = _chunkKATZTHWAcjs.normalizeSectionHref.call(void 0, item.getAttribute("href") || "");
|
|
3254
3254
|
if (id && href) idToHref.set(id, href);
|
|
3255
3255
|
}
|
|
3256
3256
|
if (spine.length > 0) {
|
|
@@ -3261,7 +3261,7 @@ function parseSectionPathsFromManifest(xml) {
|
|
|
3261
3261
|
}
|
|
3262
3262
|
if (ordered.length > 0) return ordered;
|
|
3263
3263
|
}
|
|
3264
|
-
return Array.from(idToHref.values()).sort(
|
|
3264
|
+
return Array.from(idToHref.values()).sort(_chunkKATZTHWAcjs.compareSectionPaths);
|
|
3265
3265
|
}
|
|
3266
3266
|
|
|
3267
3267
|
// src/hwpx/metadata.ts
|
|
@@ -3274,7 +3274,7 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
|
|
|
3274
3274
|
const xml = await file.async("text");
|
|
3275
3275
|
if (decompressed) {
|
|
3276
3276
|
decompressed.total += xml.length * 2;
|
|
3277
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
3277
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkKATZTHWAcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
3278
3278
|
}
|
|
3279
3279
|
parseDublinCoreMetadata(xml, metadata);
|
|
3280
3280
|
if (metadata.title || metadata.author) return;
|
|
@@ -3284,7 +3284,7 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
|
|
|
3284
3284
|
}
|
|
3285
3285
|
function parseDublinCoreMetadata(xml, metadata) {
|
|
3286
3286
|
const parser = createXmlParser();
|
|
3287
|
-
const doc = parser.parseFromString(
|
|
3287
|
+
const doc = parser.parseFromString(_chunkKATZTHWAcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
3288
3288
|
if (!doc.documentElement) return;
|
|
3289
3289
|
const getText = (tagNames) => {
|
|
3290
3290
|
for (const tag of tagNames) {
|
|
@@ -3309,7 +3309,7 @@ function parseDublinCoreMetadata(xml, metadata) {
|
|
|
3309
3309
|
|
|
3310
3310
|
// src/hwpx/parser.ts
|
|
3311
3311
|
async function parseHwpxDocument(buffer, options) {
|
|
3312
|
-
|
|
3312
|
+
_chunkKATZTHWAcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
|
|
3313
3313
|
let zip;
|
|
3314
3314
|
try {
|
|
3315
3315
|
zip = await _jszip2.default.loadAsync(buffer);
|
|
@@ -3318,7 +3318,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3318
3318
|
}
|
|
3319
3319
|
const actualEntryCount = Object.keys(zip.files).length;
|
|
3320
3320
|
if (actualEntryCount > MAX_ZIP_ENTRIES) {
|
|
3321
|
-
throw new (0,
|
|
3321
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("ZIP \uC5D4\uD2B8\uB9AC \uC218 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
3322
3322
|
}
|
|
3323
3323
|
const manifestFile = zip.file("META-INF/manifest.xml");
|
|
3324
3324
|
if (manifestFile) {
|
|
@@ -3333,7 +3333,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3333
3333
|
return comResultToParseResult(pages, pageCount, warnings2);
|
|
3334
3334
|
}
|
|
3335
3335
|
}
|
|
3336
|
-
throw new (0,
|
|
3336
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(
|
|
3337
3337
|
"\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."
|
|
3338
3338
|
);
|
|
3339
3339
|
}
|
|
@@ -3345,7 +3345,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3345
3345
|
const styleMap = await extractHwpxStyles(zip, decompressed);
|
|
3346
3346
|
const warnings = [];
|
|
3347
3347
|
const sectionPaths = await resolveSectionPaths(zip);
|
|
3348
|
-
if (sectionPaths.length === 0) throw new (0,
|
|
3348
|
+
if (sectionPaths.length === 0) throw new (0, _chunkKATZTHWAcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
3349
3349
|
let allBlocks = [];
|
|
3350
3350
|
const shared = createSectionShared();
|
|
3351
3351
|
shared.kordocLayout = await readKordocLayout(zip);
|
|
@@ -3390,7 +3390,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3390
3390
|
const images = await extractImagesFromZip(zip, blocks, decompressed, warnings, !_optionalChain([options, 'optionalAccess', _102 => _102.pages]));
|
|
3391
3391
|
detectHwpxHeadings(blocks, styleMap);
|
|
3392
3392
|
const outline = blocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
|
|
3393
|
-
const markdown =
|
|
3393
|
+
const markdown = _chunkV3Q6I2AQcjs.blocksToMarkdown.call(void 0, blocks);
|
|
3394
3394
|
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 };
|
|
3395
3395
|
}
|
|
3396
3396
|
|
|
@@ -4390,7 +4390,7 @@ function decryptPasswordStream(raw, password) {
|
|
|
4390
4390
|
var TAG_DOCUMENT_PROPERTIES = 16;
|
|
4391
4391
|
var TAG_ID_MAPPINGS = 17;
|
|
4392
4392
|
function assertDecryptedDocInfo(data, readRecords3) {
|
|
4393
|
-
const wrong = () => new (0,
|
|
4393
|
+
const wrong = () => new (0, _chunkKATZTHWAcjs.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.");
|
|
4394
4394
|
let records;
|
|
4395
4395
|
try {
|
|
4396
4396
|
records = readRecords3(data);
|
|
@@ -4402,7 +4402,7 @@ function assertDecryptedDocInfo(data, readRecords3) {
|
|
|
4402
4402
|
}
|
|
4403
4403
|
function assertSupportedEncryptVersion(version) {
|
|
4404
4404
|
if (version !== SUPPORTED_ENCRYPT_VERSION) {
|
|
4405
|
-
throw new (0,
|
|
4405
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(
|
|
4406
4406
|
`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWP \uC554\uD638\uD654 \uBC84\uC804\uC785\uB2C8\uB2E4 (EncryptVersion=${version}, \uC9C0\uC6D0: ${SUPPORTED_ENCRYPT_VERSION})`
|
|
4407
4407
|
);
|
|
4408
4408
|
}
|
|
@@ -4591,7 +4591,7 @@ function parseHwp5Document(buffer, options) {
|
|
|
4591
4591
|
lenientCfb = parseLenientCfb(buffer);
|
|
4592
4592
|
warnings.push({ message: "\uC190\uC0C1\uB41C CFB \uCEE8\uD14C\uC774\uB108 \u2014 lenient \uBAA8\uB4DC\uB85C \uBCF5\uAD6C", code: "LENIENT_CFB_RECOVERY" });
|
|
4593
4593
|
} catch (e24) {
|
|
4594
|
-
throw new (0,
|
|
4594
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("CFB \uCEE8\uD14C\uC774\uB108 \uD30C\uC2F1 \uC2E4\uD328 (strict \uBC0F lenient \uBAA8\uB450)");
|
|
4595
4595
|
}
|
|
4596
4596
|
}
|
|
4597
4597
|
const readRawStream = (path) => {
|
|
@@ -4602,14 +4602,14 @@ function parseHwp5Document(buffer, options) {
|
|
|
4602
4602
|
return lenientCfb.findStream(path);
|
|
4603
4603
|
};
|
|
4604
4604
|
const headerData = readRawStream("/FileHeader");
|
|
4605
|
-
if (!headerData) throw new (0,
|
|
4605
|
+
if (!headerData) throw new (0, _chunkKATZTHWAcjs.KordocError)("FileHeader \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
|
|
4606
4606
|
const header = parseFileHeader(headerData);
|
|
4607
|
-
if (header.signature !== "HWP Document File") throw new (0,
|
|
4608
|
-
if (header.flags & FLAG_DRM) throw new (0,
|
|
4607
|
+
if (header.signature !== "HWP Document File") throw new (0, _chunkKATZTHWAcjs.KordocError)("HWP \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
|
|
4608
|
+
if (header.flags & FLAG_DRM) throw new (0, _chunkKATZTHWAcjs.KordocError)("DRM \uBCF4\uD638\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
4609
4609
|
const encrypted = (header.flags & FLAG_ENCRYPTED) !== 0;
|
|
4610
4610
|
if (encrypted) {
|
|
4611
4611
|
if (!_optionalChain([options, 'optionalAccess', _106 => _106.password])) {
|
|
4612
|
-
throw new (0,
|
|
4612
|
+
throw new (0, _chunkKATZTHWAcjs.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.");
|
|
4613
4613
|
}
|
|
4614
4614
|
assertSupportedEncryptVersion(readEncryptVersion(headerData));
|
|
4615
4615
|
}
|
|
@@ -4627,18 +4627,18 @@ function parseHwp5Document(buffer, options) {
|
|
|
4627
4627
|
if (cfb) extractHwp5Metadata(cfb, metadata);
|
|
4628
4628
|
if (encrypted) {
|
|
4629
4629
|
const rawDocInfo = findStream("/DocInfo");
|
|
4630
|
-
if (!rawDocInfo) throw new (0,
|
|
4630
|
+
if (!rawDocInfo) throw new (0, _chunkKATZTHWAcjs.KordocError)("DocInfo \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
|
|
4631
4631
|
let docInfoData;
|
|
4632
4632
|
try {
|
|
4633
4633
|
docInfoData = compressed ? decompressStream(rawDocInfo) : rawDocInfo;
|
|
4634
4634
|
} catch (e25) {
|
|
4635
|
-
throw new (0,
|
|
4635
|
+
throw new (0, _chunkKATZTHWAcjs.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.");
|
|
4636
4636
|
}
|
|
4637
4637
|
assertDecryptedDocInfo(docInfoData, readRecords);
|
|
4638
4638
|
}
|
|
4639
4639
|
const docInfo = cfb && !encrypted ? parseDocInfoStream(cfb, compressed) : parseDocInfoFromStream(findStream("/DocInfo"), compressed);
|
|
4640
4640
|
const sections = distribution ? cfb ? findViewTextSections(cfb, compressed) : findViewTextSectionsLenient(lenientCfb, compressed) : encrypted ? findSectionsVia(findStream) : cfb ? findSections(cfb) : findSectionsLenient(lenientCfb, compressed);
|
|
4641
|
-
if (sections.length === 0) throw new (0,
|
|
4641
|
+
if (sections.length === 0) throw new (0, _chunkKATZTHWAcjs.KordocError)("\uC139\uC158 \uC2A4\uD2B8\uB9BC\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
4642
4642
|
const sectionRecords = [];
|
|
4643
4643
|
const sectionDetects = [];
|
|
4644
4644
|
let totalDecompressed = 0;
|
|
@@ -4646,12 +4646,12 @@ function parseHwp5Document(buffer, options) {
|
|
|
4646
4646
|
try {
|
|
4647
4647
|
const data = !distribution && compressed ? decompressStream(Buffer.from(sections[si])) : Buffer.from(sections[si]);
|
|
4648
4648
|
totalDecompressed += data.length;
|
|
4649
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
4649
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkKATZTHWAcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
4650
4650
|
const records = readRecords(data);
|
|
4651
4651
|
sectionRecords.push(records);
|
|
4652
4652
|
sectionDetects.push(detectHwp5SectionPages(records));
|
|
4653
4653
|
} catch (secErr) {
|
|
4654
|
-
if (secErr instanceof
|
|
4654
|
+
if (secErr instanceof _chunkKATZTHWAcjs.KordocError) throw secErr;
|
|
4655
4655
|
sectionRecords.push(null);
|
|
4656
4656
|
sectionDetects.push(null);
|
|
4657
4657
|
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" });
|
|
@@ -4687,7 +4687,7 @@ function parseHwp5Document(buffer, options) {
|
|
|
4687
4687
|
parsedSections++;
|
|
4688
4688
|
_optionalChain([options, 'optionalAccess', _110 => _110.onProgress, 'optionalCall', _111 => _111(parsedSections, sections.length)]);
|
|
4689
4689
|
} catch (secErr) {
|
|
4690
|
-
if (secErr instanceof
|
|
4690
|
+
if (secErr instanceof _chunkKATZTHWAcjs.KordocError) throw secErr;
|
|
4691
4691
|
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" });
|
|
4692
4692
|
} finally {
|
|
4693
4693
|
pageBase += detect.pages;
|
|
@@ -4698,9 +4698,9 @@ function parseHwp5Document(buffer, options) {
|
|
|
4698
4698
|
}
|
|
4699
4699
|
const blocks = [...doc.headerBlocks, ...bodyBlocks, ...doc.footerBlocks];
|
|
4700
4700
|
const images = cfb ? extractHwp5Images(cfb.FileIndex, blocks, warnings, !pageFilter) : extractHwp5ImagesLenient(lenientCfb, blocks, warnings, !pageFilter);
|
|
4701
|
-
let flatBlocks =
|
|
4701
|
+
let flatBlocks = _chunkV3Q6I2AQcjs.flattenLayoutTables.call(void 0, blocks);
|
|
4702
4702
|
if (_optionalChain([options, 'optionalAccess', _112 => _112.dedupeRunningHeaders])) {
|
|
4703
|
-
const deduped =
|
|
4703
|
+
const deduped = _chunkV3Q6I2AQcjs.dedupeRunningHeaders.call(void 0, flatBlocks);
|
|
4704
4704
|
const removed = flatBlocks.length - deduped.length;
|
|
4705
4705
|
if (removed > 0) warnings.push({ message: `\uBC18\uBCF5 \uB7EC\uB2DD \uD5E4\uB354 ${removed}\uAC1C \uC81C\uAC70`, code: "HIDDEN_TEXT_FILTERED" });
|
|
4706
4706
|
flatBlocks = deduped;
|
|
@@ -4709,10 +4709,10 @@ function parseHwp5Document(buffer, options) {
|
|
|
4709
4709
|
detectHwp5Headings(flatBlocks, docInfo);
|
|
4710
4710
|
}
|
|
4711
4711
|
const outline = flatBlocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
|
|
4712
|
-
let markdown =
|
|
4712
|
+
let markdown = _chunkV3Q6I2AQcjs.blocksToMarkdown.call(void 0, flatBlocks);
|
|
4713
4713
|
if (_optionalChain([options, 'optionalAccess', _113 => _113.inlineImages]) && images.length > 0) {
|
|
4714
4714
|
try {
|
|
4715
|
-
markdown =
|
|
4715
|
+
markdown = _chunkV3Q6I2AQcjs.inlineImagesIntoMarkdown.call(void 0, markdown, images, { compress: true });
|
|
4716
4716
|
} catch (inlineErr) {
|
|
4717
4717
|
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" });
|
|
4718
4718
|
}
|
|
@@ -4872,7 +4872,7 @@ function findSectionsLenient(lcfb, compressed) {
|
|
|
4872
4872
|
if (!raw) break;
|
|
4873
4873
|
const content = compressed ? decompressStream(raw) : raw;
|
|
4874
4874
|
totalDecompressed += content.length;
|
|
4875
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
4875
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkKATZTHWAcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
4876
4876
|
sections.push({ idx: i, content });
|
|
4877
4877
|
}
|
|
4878
4878
|
if (sections.length === 0) {
|
|
@@ -4884,7 +4884,7 @@ function findSectionsLenient(lcfb, compressed) {
|
|
|
4884
4884
|
if (raw) {
|
|
4885
4885
|
const content = compressed ? decompressStream(raw) : raw;
|
|
4886
4886
|
totalDecompressed += content.length;
|
|
4887
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
4887
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkKATZTHWAcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
4888
4888
|
sections.push({ idx, content });
|
|
4889
4889
|
}
|
|
4890
4890
|
}
|
|
@@ -4901,7 +4901,7 @@ function findViewTextSectionsLenient(lcfb, compressed) {
|
|
|
4901
4901
|
try {
|
|
4902
4902
|
const content = decryptViewText(raw, compressed);
|
|
4903
4903
|
totalDecompressed += content.length;
|
|
4904
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
4904
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkKATZTHWAcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
4905
4905
|
sections.push({ idx: i, content });
|
|
4906
4906
|
} catch (e30) {
|
|
4907
4907
|
break;
|
|
@@ -5018,7 +5018,7 @@ function parseParagraph(records, start, end, ctx) {
|
|
|
5018
5018
|
const ctrl = ctrls[r.ctrlIdx];
|
|
5019
5019
|
if (!_optionalChain([ctrl, 'optionalAccess', _126 => _126.href]) || r.end <= r.start) continue;
|
|
5020
5020
|
if (applied.some(([s, e]) => r.start < e && r.end > s)) continue;
|
|
5021
|
-
const href =
|
|
5021
|
+
const href = _chunkKATZTHWAcjs.sanitizeHref.call(void 0, ctrl.href);
|
|
5022
5022
|
if (!href) continue;
|
|
5023
5023
|
const anchor = text.slice(r.start, r.end);
|
|
5024
5024
|
if (!anchor.trim()) continue;
|
|
@@ -5258,8 +5258,8 @@ function parseTableControl(ctrl, records, ctx) {
|
|
|
5258
5258
|
let tableIdx = -1;
|
|
5259
5259
|
for (let i2 = childStart; i2 < childEnd; i2++) {
|
|
5260
5260
|
if (records[i2].tagId === TAG_TABLE && records[i2].data.length >= 8) {
|
|
5261
|
-
rows = Math.min(records[i2].data.readUInt16LE(4),
|
|
5262
|
-
cols = Math.min(records[i2].data.readUInt16LE(6),
|
|
5261
|
+
rows = Math.min(records[i2].data.readUInt16LE(4), _chunkV3Q6I2AQcjs.MAX_ROWS);
|
|
5262
|
+
cols = Math.min(records[i2].data.readUInt16LE(6), _chunkV3Q6I2AQcjs.MAX_COLS);
|
|
5263
5263
|
tableIdx = i2;
|
|
5264
5264
|
break;
|
|
5265
5265
|
}
|
|
@@ -5308,7 +5308,7 @@ function parseTableControl(ctrl, records, ctx) {
|
|
|
5308
5308
|
return table3;
|
|
5309
5309
|
}
|
|
5310
5310
|
const cellRows = arrangeCells(rows, cols, cells);
|
|
5311
|
-
const table2 =
|
|
5311
|
+
const table2 = _chunkV3Q6I2AQcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: ctx.doc.keepTrailingEmptyCols });
|
|
5312
5312
|
if (caption && table2.rows > 0) table2.caption = caption;
|
|
5313
5313
|
return table2.rows > 0 ? table2 : null;
|
|
5314
5314
|
}
|
|
@@ -5325,8 +5325,8 @@ function parseCell(records, lhIdx, end, ctx) {
|
|
|
5325
5325
|
rowAddr = rec.data.readUInt16LE(10);
|
|
5326
5326
|
const cs = rec.data.readUInt16LE(12);
|
|
5327
5327
|
const rs = rec.data.readUInt16LE(14);
|
|
5328
|
-
if (cs > 0) colSpan = Math.min(cs,
|
|
5329
|
-
if (rs > 0) rowSpan = Math.min(rs,
|
|
5328
|
+
if (cs > 0) colSpan = Math.min(cs, _chunkV3Q6I2AQcjs.MAX_COLS);
|
|
5329
|
+
if (rs > 0) rowSpan = Math.min(rs, _chunkV3Q6I2AQcjs.MAX_ROWS);
|
|
5330
5330
|
}
|
|
5331
5331
|
const blocks = ctx.depth < MAX_NEST_DEPTH ? parseParagraphList(records, lhIdx + 1, end, { ...ctx, depth: ctx.depth + 1 }) : [];
|
|
5332
5332
|
const parts = [];
|
|
@@ -5336,7 +5336,7 @@ function parseCell(records, lhIdx, end, ctx) {
|
|
|
5336
5336
|
parts.push(``);
|
|
5337
5337
|
hasStructure = true;
|
|
5338
5338
|
} else if (b.type === "table" && b.table) {
|
|
5339
|
-
const flat =
|
|
5339
|
+
const flat = _chunkV3Q6I2AQcjs.convertTableToText.call(void 0, b.table.cells);
|
|
5340
5340
|
if (flat) parts.push(flat);
|
|
5341
5341
|
hasStructure = true;
|
|
5342
5342
|
} else if (b.text) {
|
|
@@ -17611,25 +17611,25 @@ function desEcbDecrypt(data, key) {
|
|
|
17611
17611
|
}
|
|
17612
17612
|
function readLayout(data) {
|
|
17613
17613
|
if (data.length < FIXED_HEADER_BYTES) {
|
|
17614
|
-
throw new (0,
|
|
17614
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("HWP3 \uC554\uD638 \uBB38\uC11C: \uD5E4\uB354\uAC00 \uC798\uB838\uC2B5\uB2C8\uB2E4");
|
|
17615
17615
|
}
|
|
17616
17616
|
const infoBlockLength = data[INFO_BLOCK_LENGTH_OFFSET] | data[INFO_BLOCK_LENGTH_OFFSET + 1] << 8;
|
|
17617
17617
|
const payloadOffset = FIXED_HEADER_BYTES + infoBlockLength;
|
|
17618
17618
|
if (payloadOffset >= data.length) {
|
|
17619
|
-
throw new (0,
|
|
17619
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("HWP3 \uC554\uD638 \uBB38\uC11C: \uBCF8\uBB38\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
17620
17620
|
}
|
|
17621
17621
|
return { payloadOffset, compressed: data[COMPRESSION_FLAG_OFFSET] !== 0 };
|
|
17622
17622
|
}
|
|
17623
17623
|
function decryptHwp3Document(input, password) {
|
|
17624
17624
|
const { payloadOffset, compressed } = readLayout(input);
|
|
17625
17625
|
if (!compressed) {
|
|
17626
|
-
throw new (0,
|
|
17626
|
+
throw new (0, _chunkKATZTHWAcjs.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)");
|
|
17627
17627
|
}
|
|
17628
17628
|
const source = Buffer.from(input);
|
|
17629
17629
|
const payload = source.subarray(payloadOffset);
|
|
17630
17630
|
const aligned = payload.subarray(0, payload.length - payload.length % 8);
|
|
17631
17631
|
if (aligned.length === 0) {
|
|
17632
|
-
throw new (0,
|
|
17632
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("HWP3 \uC554\uD638 \uBB38\uC11C: \uBCF8\uBB38\uC774 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4");
|
|
17633
17633
|
}
|
|
17634
17634
|
const decrypted = desEcbDecrypt(aligned, deriveDesKey(password));
|
|
17635
17635
|
let inflated;
|
|
@@ -17637,14 +17637,14 @@ function decryptHwp3Document(input, password) {
|
|
|
17637
17637
|
inflated = _zlib.inflateRawSync.call(void 0, decrypted, { maxOutputLength: MAX_DECOMPRESSED_BYTES });
|
|
17638
17638
|
} catch (err) {
|
|
17639
17639
|
if (_optionalChain([err, 'optionalAccess', _139 => _139.code]) === "ERR_BUFFER_TOO_LARGE") {
|
|
17640
|
-
throw new (0,
|
|
17640
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(
|
|
17641
17641
|
`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`
|
|
17642
17642
|
);
|
|
17643
17643
|
}
|
|
17644
|
-
throw new (0,
|
|
17644
|
+
throw new (0, _chunkKATZTHWAcjs.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.");
|
|
17645
17645
|
}
|
|
17646
17646
|
if (inflated.length <= PASSWORD_PREFIX_BYTES) {
|
|
17647
|
-
throw new (0,
|
|
17647
|
+
throw new (0, _chunkKATZTHWAcjs.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.");
|
|
17648
17648
|
}
|
|
17649
17649
|
const body = inflated.subarray(PASSWORD_PREFIX_BYTES);
|
|
17650
17650
|
const out = Buffer.concat([source.subarray(0, payloadOffset), body]);
|
|
@@ -17679,7 +17679,7 @@ function parseHwp3Document(buffer, options) {
|
|
|
17679
17679
|
let source = Buffer.from(buffer);
|
|
17680
17680
|
if (isEncryptedHwp3(source)) {
|
|
17681
17681
|
if (!_optionalChain([options, 'optionalAccess', _140 => _140.password])) {
|
|
17682
|
-
throw new (0,
|
|
17682
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(
|
|
17683
17683
|
"\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."
|
|
17684
17684
|
);
|
|
17685
17685
|
}
|
|
@@ -17696,10 +17696,10 @@ function parseHwp3Document(buffer, options) {
|
|
|
17696
17696
|
body = _zlib.inflateRawSync.call(void 0, tail, { maxOutputLength: MAX_DECOMPRESS_SIZE3 });
|
|
17697
17697
|
} catch (err) {
|
|
17698
17698
|
if (_optionalChain([err, 'optionalAccess', _141 => _141.code]) === "ERR_BUFFER_TOO_LARGE") {
|
|
17699
|
-
throw new (0,
|
|
17699
|
+
throw new (0, _chunkKATZTHWAcjs.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`);
|
|
17700
17700
|
}
|
|
17701
17701
|
const msg2 = err instanceof Error ? err.message : String(err);
|
|
17702
|
-
throw new (0,
|
|
17702
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(`HWP3 \uC555\uCD95 \uD574\uC81C \uC2E4\uD328: ${msg2}`);
|
|
17703
17703
|
}
|
|
17704
17704
|
} else {
|
|
17705
17705
|
body = tail;
|
|
@@ -17941,7 +17941,7 @@ function getTextContent(el) {
|
|
|
17941
17941
|
return _nullishCoalesce(_optionalChain([el, 'access', _144 => _144.textContent, 'optionalAccess', _145 => _145.trim, 'call', _146 => _146()]), () => ( ""));
|
|
17942
17942
|
}
|
|
17943
17943
|
function parseXml(text) {
|
|
17944
|
-
return new (0, _xmldom.DOMParser)().parseFromString(
|
|
17944
|
+
return new (0, _xmldom.DOMParser)().parseFromString(_chunkKATZTHWAcjs.stripDtd.call(void 0, text), "text/xml");
|
|
17945
17945
|
}
|
|
17946
17946
|
function collectRichText(root) {
|
|
17947
17947
|
let out = "";
|
|
@@ -18176,7 +18176,7 @@ function sheetToBlocks(sheetName, grid, merges, maxRow, maxCol, sheetIndex, keep
|
|
|
18176
18176
|
cellRows.push(row);
|
|
18177
18177
|
}
|
|
18178
18178
|
if (cellRows.length > 0) {
|
|
18179
|
-
const table2 =
|
|
18179
|
+
const table2 = _chunkV3Q6I2AQcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols });
|
|
18180
18180
|
if (table2.rows > 0) {
|
|
18181
18181
|
blocks.push({ type: "table", table: table2, pageNumber: sheetIndex + 1 });
|
|
18182
18182
|
}
|
|
@@ -18184,12 +18184,12 @@ function sheetToBlocks(sheetName, grid, merges, maxRow, maxCol, sheetIndex, keep
|
|
|
18184
18184
|
return blocks;
|
|
18185
18185
|
}
|
|
18186
18186
|
async function parseXlsxDocument(buffer, options) {
|
|
18187
|
-
|
|
18187
|
+
_chunkKATZTHWAcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE4);
|
|
18188
18188
|
const zip = await _jszip2.default.loadAsync(buffer);
|
|
18189
18189
|
const warnings = [];
|
|
18190
18190
|
const workbookFile = zip.file("xl/workbook.xml");
|
|
18191
18191
|
if (!workbookFile) {
|
|
18192
|
-
throw new (0,
|
|
18192
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 XLSX \uD30C\uC77C: xl/workbook.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
18193
18193
|
}
|
|
18194
18194
|
let sharedStrings = [];
|
|
18195
18195
|
const ssFile = zip.file("xl/sharedStrings.xml");
|
|
@@ -18198,7 +18198,7 @@ async function parseXlsxDocument(buffer, options) {
|
|
|
18198
18198
|
}
|
|
18199
18199
|
const { sheets, date1904 } = parseWorkbook(await workbookFile.async("text"));
|
|
18200
18200
|
if (sheets.length === 0) {
|
|
18201
|
-
throw new (0,
|
|
18201
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("XLSX \uD30C\uC77C\uC5D0 \uC2DC\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
18202
18202
|
}
|
|
18203
18203
|
let dateXfs = /* @__PURE__ */ new Map();
|
|
18204
18204
|
const stylesFile = zip.file("xl/styles.xml");
|
|
@@ -18282,7 +18282,7 @@ async function parseXlsxDocument(buffer, options) {
|
|
|
18282
18282
|
} catch (e32) {
|
|
18283
18283
|
}
|
|
18284
18284
|
}
|
|
18285
|
-
const markdown =
|
|
18285
|
+
const markdown = _chunkV3Q6I2AQcjs.blocksToMarkdown.call(void 0, blocks);
|
|
18286
18286
|
return { markdown, blocks, metadata, warnings: warnings.length > 0 ? warnings : void 0 };
|
|
18287
18287
|
}
|
|
18288
18288
|
|
|
@@ -18733,11 +18733,11 @@ function processGlobals(records) {
|
|
|
18733
18733
|
const xfFmtIds = [];
|
|
18734
18734
|
const firstBof = records[0];
|
|
18735
18735
|
if (!firstBof || firstBof.opcode !== OP_BOF) {
|
|
18736
|
-
throw new (0,
|
|
18736
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("XLS: \uCCAB \uB808\uCF54\uB4DC\uAC00 BOF\uAC00 \uC544\uB2D8");
|
|
18737
18737
|
}
|
|
18738
18738
|
const bof = decodeBof(firstBof.data);
|
|
18739
18739
|
if (!bof || bof.dt !== DT_GLOBALS) {
|
|
18740
|
-
throw new (0,
|
|
18740
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("XLS: Globals \uC11C\uBE0C\uC2A4\uD2B8\uB9BC BOF \uB204\uB77D");
|
|
18741
18741
|
}
|
|
18742
18742
|
let i = 1;
|
|
18743
18743
|
while (i < records.length) {
|
|
@@ -18872,7 +18872,7 @@ function sheetToBlocks2(sheetName, sheet, sheetIndex, keepAnchoredEmptyCols) {
|
|
|
18872
18872
|
cellRows.push(row);
|
|
18873
18873
|
}
|
|
18874
18874
|
if (cellRows.length > 0) {
|
|
18875
|
-
const table2 =
|
|
18875
|
+
const table2 = _chunkV3Q6I2AQcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols });
|
|
18876
18876
|
if (table2.rows > 0) {
|
|
18877
18877
|
blocks.push({ type: "table", table: table2, pageNumber: sheetIndex + 1 });
|
|
18878
18878
|
}
|
|
@@ -18885,28 +18885,28 @@ async function parseXlsDocument(buffer, options) {
|
|
|
18885
18885
|
try {
|
|
18886
18886
|
cfb = parseLenientCfb(buf);
|
|
18887
18887
|
} catch (e) {
|
|
18888
|
-
throw new (0,
|
|
18888
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(
|
|
18889
18889
|
`XLS: OLE2 \uC2DC\uADF8\uB2C8\uCC98 \uAC80\uC99D \uC2E4\uD328 \u2014 ${e instanceof Error ? e.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`
|
|
18890
18890
|
);
|
|
18891
18891
|
}
|
|
18892
18892
|
const wb = _nullishCoalesce(cfb.findStream("/Workbook"), () => ( cfb.findStream("/Book")));
|
|
18893
18893
|
if (!wb) {
|
|
18894
|
-
throw new (0,
|
|
18894
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("XLS: Workbook \uC2A4\uD2B8\uB9BC\uC774 \uC5C6\uC74C (BIFF5 \uB610\uB294 \uBE44\uD45C\uC900 \uD30C\uC77C)");
|
|
18895
18895
|
}
|
|
18896
18896
|
const records = readRecords2(wb);
|
|
18897
18897
|
if (records.length === 0) {
|
|
18898
|
-
throw new (0,
|
|
18898
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("XLS: \uC2DC\uADF8\uB2C8\uCC98 \uB808\uCF54\uB4DC\uAC00 \uC5C6\uC74C (Workbook \uC2A4\uD2B8\uB9BC \uC190\uC0C1)");
|
|
18899
18899
|
}
|
|
18900
18900
|
const firstBof = decodeBof(records[0].data);
|
|
18901
18901
|
if (firstBof && firstBof.vers !== 1536) {
|
|
18902
|
-
throw new (0,
|
|
18902
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(
|
|
18903
18903
|
`XLS: BIFF8(0x0600)\uB9CC \uC9C0\uC6D0 \u2014 \uBCF8 \uD30C\uC77C\uC740 0x${firstBof.vers.toString(16)}`
|
|
18904
18904
|
);
|
|
18905
18905
|
}
|
|
18906
18906
|
const globals = processGlobals(records);
|
|
18907
18907
|
const warnings = [];
|
|
18908
18908
|
if (globals.encrypted) {
|
|
18909
|
-
throw new (0,
|
|
18909
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("XLS \uD30C\uC77C\uC774 \uC554\uD638\uD654\uB418\uC5B4 \uC788\uC5B4 \uD30C\uC2F1\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
18910
18910
|
}
|
|
18911
18911
|
const convertNum = globals.dateXfs.size > 0 ? (n, ixfe) => {
|
|
18912
18912
|
const kind = globals.dateXfs.get(ixfe);
|
|
@@ -18957,7 +18957,7 @@ async function parseXlsDocument(buffer, options) {
|
|
|
18957
18957
|
pageCount: totalSheets
|
|
18958
18958
|
};
|
|
18959
18959
|
return {
|
|
18960
|
-
markdown:
|
|
18960
|
+
markdown: _chunkV3Q6I2AQcjs.blocksToMarkdown.call(void 0, allBlocks),
|
|
18961
18961
|
blocks: allBlocks,
|
|
18962
18962
|
metadata,
|
|
18963
18963
|
warnings: warnings.length > 0 ? warnings : void 0
|
|
@@ -19385,7 +19385,7 @@ function getAttr(el, localName3) {
|
|
|
19385
19385
|
return null;
|
|
19386
19386
|
}
|
|
19387
19387
|
function parseXml2(text) {
|
|
19388
|
-
return new (0, _xmldom.DOMParser)().parseFromString(
|
|
19388
|
+
return new (0, _xmldom.DOMParser)().parseFromString(_chunkKATZTHWAcjs.stripDtd.call(void 0, text), "text/xml");
|
|
19389
19389
|
}
|
|
19390
19390
|
function parseStyles(xml) {
|
|
19391
19391
|
const doc = parseXml2(xml);
|
|
@@ -19543,7 +19543,7 @@ function fieldUrlFromInstr(instr) {
|
|
|
19543
19543
|
function makeLink(text, rawHref) {
|
|
19544
19544
|
if (!text) return "";
|
|
19545
19545
|
if (!rawHref) return text;
|
|
19546
|
-
const href =
|
|
19546
|
+
const href = _chunkKATZTHWAcjs.sanitizeHref.call(void 0, rawHref);
|
|
19547
19547
|
return href ? `[${text}](${href})` : text;
|
|
19548
19548
|
}
|
|
19549
19549
|
function collectInline(p, footnotes, rels) {
|
|
@@ -19737,7 +19737,7 @@ ${cell2.text}` : cell2.text;
|
|
|
19737
19737
|
return { text: cell2.text, colSpan: cell2.colSpan, rowSpan, colAddr: cell2.col, rowAddr: r };
|
|
19738
19738
|
})
|
|
19739
19739
|
);
|
|
19740
|
-
const table2 =
|
|
19740
|
+
const table2 = _chunkV3Q6I2AQcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keepEmptyCols });
|
|
19741
19741
|
if (table2.rows === 0 || table2.cols === 0) return null;
|
|
19742
19742
|
return { type: "table", table: table2 };
|
|
19743
19743
|
}
|
|
@@ -19839,12 +19839,12 @@ function emitParagraphImages(p, imageMap, linked, out) {
|
|
|
19839
19839
|
}
|
|
19840
19840
|
}
|
|
19841
19841
|
async function parseDocxDocument(buffer, options) {
|
|
19842
|
-
|
|
19842
|
+
_chunkKATZTHWAcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE5);
|
|
19843
19843
|
const zip = await _jszip2.default.loadAsync(buffer);
|
|
19844
19844
|
const warnings = [];
|
|
19845
19845
|
const docFile = zip.file("word/document.xml");
|
|
19846
19846
|
if (!docFile) {
|
|
19847
|
-
throw new (0,
|
|
19847
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 DOCX \uD30C\uC77C: word/document.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
19848
19848
|
}
|
|
19849
19849
|
let rels = /* @__PURE__ */ new Map();
|
|
19850
19850
|
const relsFile = zip.file("word/_rels/document.xml.rels");
|
|
@@ -19891,7 +19891,7 @@ async function parseDocxDocument(buffer, options) {
|
|
|
19891
19891
|
const doc = parseXml2(docXml);
|
|
19892
19892
|
const body = findElements(doc, "body");
|
|
19893
19893
|
if (body.length === 0) {
|
|
19894
|
-
throw new (0,
|
|
19894
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("DOCX \uBCF8\uBB38(w:body)\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
19895
19895
|
}
|
|
19896
19896
|
const { imageMap, images } = await buildImageMap(zip, rels, doc, warnings);
|
|
19897
19897
|
const linkedImages = /* @__PURE__ */ new Set();
|
|
@@ -19942,7 +19942,7 @@ async function parseDocxDocument(buffer, options) {
|
|
|
19942
19942
|
}
|
|
19943
19943
|
}
|
|
19944
19944
|
const outline = blocks.filter((b) => b.type === "heading").map((b) => ({ level: _nullishCoalesce(b.level, () => ( 2)), text: _nullishCoalesce(b.text, () => ( "")) }));
|
|
19945
|
-
const markdown =
|
|
19945
|
+
const markdown = _chunkV3Q6I2AQcjs.blocksToMarkdown.call(void 0, blocks);
|
|
19946
19946
|
return {
|
|
19947
19947
|
markdown,
|
|
19948
19948
|
blocks,
|
|
@@ -19960,11 +19960,11 @@ var MAX_TABLE_COLS = 500;
|
|
|
19960
19960
|
var MAX_HWPML_BYTES = 50 * 1024 * 1024;
|
|
19961
19961
|
function parseHwpmlDocument(buffer, options) {
|
|
19962
19962
|
if (buffer.byteLength > MAX_HWPML_BYTES) {
|
|
19963
|
-
throw new (0,
|
|
19963
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(`HWPML \uD30C\uC77C \uD06C\uAE30 \uCD08\uACFC (${(buffer.byteLength / 1024 / 1024).toFixed(1)}MB > 50MB)`);
|
|
19964
19964
|
}
|
|
19965
19965
|
const text = new TextDecoder("utf-8").decode(buffer).replace(/^\uFEFF/, "");
|
|
19966
19966
|
const normalized = text.replace(/ /g, " ");
|
|
19967
|
-
const xml =
|
|
19967
|
+
const xml = _chunkKATZTHWAcjs.stripDtd.call(void 0, normalized);
|
|
19968
19968
|
const warnings = [];
|
|
19969
19969
|
const parser = new (0, _xmldom.DOMParser)({
|
|
19970
19970
|
onError: (_level, msg2) => {
|
|
@@ -20004,7 +20004,7 @@ function parseHwpmlDocument(buffer, options) {
|
|
|
20004
20004
|
parseSection2(el, blocks, paraShapeMap, sectionIdx, warnings, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _190 => _190.keepTrailingEmptyCols]), () => ( false)));
|
|
20005
20005
|
}
|
|
20006
20006
|
const outline = blocks.filter((b) => b.type === "heading" && b.text).map((b) => ({ level: _nullishCoalesce(b.level, () => ( 1)), text: b.text, pageNumber: b.pageNumber }));
|
|
20007
|
-
const markdown =
|
|
20007
|
+
const markdown = _chunkV3Q6I2AQcjs.blocksToMarkdown.call(void 0, blocks);
|
|
20008
20008
|
return {
|
|
20009
20009
|
markdown,
|
|
20010
20010
|
blocks,
|
|
@@ -20169,7 +20169,7 @@ function buildHmlTable(el, warnings, keep, tableDepth) {
|
|
|
20169
20169
|
const r = Math.min(Math.max(_nullishCoalesce(cell2.rowAddr, () => ( 0)), 0), rowCount - 1);
|
|
20170
20170
|
cellRows[r].push(cell2);
|
|
20171
20171
|
}
|
|
20172
|
-
const table2 =
|
|
20172
|
+
const table2 = _chunkV3Q6I2AQcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keep });
|
|
20173
20173
|
if (structured.length > 0) {
|
|
20174
20174
|
const claimed = /* @__PURE__ */ new Set();
|
|
20175
20175
|
for (const { ctx, cellBlocks } of structured) {
|
|
@@ -21680,7 +21680,7 @@ function fillClickHereInXml(xml, cursor, blockedLabels) {
|
|
|
21680
21680
|
};
|
|
21681
21681
|
}
|
|
21682
21682
|
async function extractClickHereFields(hwpxBuffer) {
|
|
21683
|
-
|
|
21683
|
+
_chunkKATZTHWAcjs.precheckZipSize.call(void 0, hwpxBuffer);
|
|
21684
21684
|
const zip = await _jszip2.default.loadAsync(hwpxBuffer);
|
|
21685
21685
|
const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort();
|
|
21686
21686
|
const fields = [];
|
|
@@ -21728,19 +21728,19 @@ function parseCentralDirectory(buf) {
|
|
|
21728
21728
|
}
|
|
21729
21729
|
}
|
|
21730
21730
|
}
|
|
21731
|
-
if (eocdOffset < 0) throw new (0,
|
|
21731
|
+
if (eocdOffset < 0) throw new (0, _chunkKATZTHWAcjs.KordocError)("ZIP EOCD\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
21732
21732
|
const totalEntries = view.getUint16(eocdOffset + 10, true);
|
|
21733
21733
|
const cdSize = view.getUint32(eocdOffset + 12, true);
|
|
21734
21734
|
const cdOffset = view.getUint32(eocdOffset + 16, true);
|
|
21735
|
-
if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0,
|
|
21735
|
+
if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0, _chunkKATZTHWAcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
21736
21736
|
if (eocdOffset >= 20 && view.getUint32(eocdOffset - 20, true) === ZIP64_EOCD_LOC_SIG) {
|
|
21737
|
-
throw new (0,
|
|
21737
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
21738
21738
|
}
|
|
21739
21739
|
const decoder = new TextDecoder("utf-8");
|
|
21740
21740
|
const entries = [];
|
|
21741
21741
|
let pos = cdOffset;
|
|
21742
21742
|
for (let i = 0; i < totalEntries; i++) {
|
|
21743
|
-
if (view.getUint32(pos, true) !== CD_SIG) throw new (0,
|
|
21743
|
+
if (view.getUint32(pos, true) !== CD_SIG) throw new (0, _chunkKATZTHWAcjs.KordocError)("ZIP Central Directory \uC190\uC0C1");
|
|
21744
21744
|
const flags = view.getUint16(pos + 8, true);
|
|
21745
21745
|
const method = view.getUint16(pos + 10, true);
|
|
21746
21746
|
const crc = view.getUint32(pos + 16, true);
|
|
@@ -21751,7 +21751,7 @@ function parseCentralDirectory(buf) {
|
|
|
21751
21751
|
const commentLen = view.getUint16(pos + 32, true);
|
|
21752
21752
|
const localOffset = view.getUint32(pos + 42, true);
|
|
21753
21753
|
if (compSize === 4294967295 || uncompSize === 4294967295 || localOffset === 4294967295) {
|
|
21754
|
-
throw new (0,
|
|
21754
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
21755
21755
|
}
|
|
21756
21756
|
const name = decoder.decode(buf.subarray(pos + 46, pos + 46 + nameLen));
|
|
21757
21757
|
const cdEnd = pos + 46 + nameLen + extraLen + commentLen;
|
|
@@ -21780,11 +21780,11 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
21780
21780
|
const { entries, cdOffset, eocdOffset } = parseCentralDirectory(original);
|
|
21781
21781
|
const view = new DataView(original.buffer, original.byteOffset, original.byteLength);
|
|
21782
21782
|
for (const name of replacements.keys()) {
|
|
21783
|
-
if (!entries.some((e) => e.name === name)) throw new (0,
|
|
21783
|
+
if (!entries.some((e) => e.name === name)) throw new (0, _chunkKATZTHWAcjs.KordocError)(`ZIP\uC5D0 \uC5C6\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
|
|
21784
21784
|
}
|
|
21785
21785
|
if (additions) {
|
|
21786
21786
|
for (const name of additions.keys()) {
|
|
21787
|
-
if (entries.some((e) => e.name === name)) throw new (0,
|
|
21787
|
+
if (entries.some((e) => e.name === name)) throw new (0, _chunkKATZTHWAcjs.KordocError)(`ZIP\uC5D0 \uC774\uBBF8 \uC788\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
|
|
21788
21788
|
}
|
|
21789
21789
|
}
|
|
21790
21790
|
const byLocal = [...entries].sort((a, b) => a.localOffset - b.localOffset);
|
|
@@ -21803,7 +21803,7 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
21803
21803
|
offset += seg.length;
|
|
21804
21804
|
continue;
|
|
21805
21805
|
}
|
|
21806
|
-
if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0,
|
|
21806
|
+
if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0, _chunkKATZTHWAcjs.KordocError)("ZIP \uB85C\uCEEC \uD5E4\uB354 \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
|
|
21807
21807
|
const nameLen = view.getUint16(e.localOffset + 26, true);
|
|
21808
21808
|
const extraLen = view.getUint16(e.localOffset + 28, true);
|
|
21809
21809
|
const headerLen = 30 + nameLen + extraLen;
|
|
@@ -21811,7 +21811,7 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
21811
21811
|
const hview = new DataView(header.buffer, header.byteOffset, header.byteLength);
|
|
21812
21812
|
const method = e.method;
|
|
21813
21813
|
if (method !== 0 && method !== 8) {
|
|
21814
|
-
throw new (0,
|
|
21814
|
+
throw new (0, _chunkKATZTHWAcjs.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`);
|
|
21815
21815
|
}
|
|
21816
21816
|
const compData = method === 0 ? newData : new Uint8Array(_zlib.deflateRawSync.call(void 0, newData));
|
|
21817
21817
|
const crc = crc32(newData);
|
|
@@ -21909,11 +21909,11 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
21909
21909
|
// src/form/filler-hwpx.ts
|
|
21910
21910
|
async function fillHwpx(hwpxBuffer, values, blockedLabels) {
|
|
21911
21911
|
const u8 = new Uint8Array(hwpxBuffer);
|
|
21912
|
-
|
|
21912
|
+
_chunkKATZTHWAcjs.precheckZipSize.call(void 0, hwpxBuffer);
|
|
21913
21913
|
const zip = await _jszip2.default.loadAsync(hwpxBuffer);
|
|
21914
21914
|
const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort();
|
|
21915
21915
|
if (sectionPaths.length === 0) {
|
|
21916
|
-
throw new (0,
|
|
21916
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
21917
21917
|
}
|
|
21918
21918
|
const warnings = [];
|
|
21919
21919
|
const normalizedValues = normalizeValues(values, warnings);
|
|
@@ -22226,7 +22226,7 @@ function blocksToPages(blocks) {
|
|
|
22226
22226
|
const pages = [];
|
|
22227
22227
|
for (let pageNumber = min; pageNumber <= max; pageNumber++) {
|
|
22228
22228
|
const pageBlocks = byPage.get(pageNumber);
|
|
22229
|
-
pages.push({ pageNumber, markdown: pageBlocks ?
|
|
22229
|
+
pages.push({ pageNumber, markdown: pageBlocks ? _chunkV3Q6I2AQcjs.blocksToMarkdown.call(void 0, pageBlocks) : "" });
|
|
22230
22230
|
}
|
|
22231
22231
|
return pages;
|
|
22232
22232
|
}
|
|
@@ -22678,7 +22678,7 @@ function needsGaejosikAssets(gongmun) {
|
|
|
22678
22678
|
}
|
|
22679
22679
|
function assertFiniteRange(name, value, min, max) {
|
|
22680
22680
|
if (!Number.isFinite(value) || value < min || value > max) {
|
|
22681
|
-
throw new (0,
|
|
22681
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(`${name} must be a finite number between ${min} and ${max}`);
|
|
22682
22682
|
}
|
|
22683
22683
|
}
|
|
22684
22684
|
function validateGongmunOptions(opts) {
|
|
@@ -22693,10 +22693,10 @@ function validateGongmunOptions(opts) {
|
|
|
22693
22693
|
assertFiniteRange(`margins.${side}`, value, 0, 200);
|
|
22694
22694
|
}
|
|
22695
22695
|
if (opts.margins.left + opts.margins.right >= 210) {
|
|
22696
|
-
throw new (0,
|
|
22696
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("margins.left + margins.right must be less than 210");
|
|
22697
22697
|
}
|
|
22698
22698
|
if (opts.margins.top + opts.margins.bottom >= 297) {
|
|
22699
|
-
throw new (0,
|
|
22699
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("margins.top + margins.bottom must be less than 297");
|
|
22700
22700
|
}
|
|
22701
22701
|
}
|
|
22702
22702
|
if (opts.sizes) {
|
|
@@ -22705,7 +22705,7 @@ function validateGongmunOptions(opts) {
|
|
|
22705
22705
|
}
|
|
22706
22706
|
}
|
|
22707
22707
|
if (opts.approval && opts.approval.length > 6) {
|
|
22708
|
-
throw new (0,
|
|
22708
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("approval must contain at most 6 labels");
|
|
22709
22709
|
}
|
|
22710
22710
|
}
|
|
22711
22711
|
function incompatibleGongmunWarnings(opts) {
|
|
@@ -22956,7 +22956,9 @@ var GJ_CHAR_BAR = 24;
|
|
|
22956
22956
|
var GJ_CHAR_BODY_TITLE = 25;
|
|
22957
22957
|
var GJ_CHAR_TITLE_BAR = 26;
|
|
22958
22958
|
var GJ_CHAR_APPROVAL = 27;
|
|
22959
|
-
var
|
|
22959
|
+
var GJ_CHAR_SRC = 28;
|
|
22960
|
+
var GJ_CHAR_SRC_BOLD = 29;
|
|
22961
|
+
var GJ_CHAR_COUNT = GJ_CHAR_SRC_BOLD - GJ_CHAR_DAE + 1;
|
|
22960
22962
|
var GJ_PARA_CHAM = 20;
|
|
22961
22963
|
var GJ_PARA_COVER = 21;
|
|
22962
22964
|
var GJ_PARA_TOC_ITEM = 22;
|
|
@@ -22964,7 +22966,8 @@ var GJ_PARA_CHAPTER = 23;
|
|
|
22964
22966
|
var GJ_PARA_BAR = 24;
|
|
22965
22967
|
var GONGMUN_LIST_PLAIN_BASE = 25;
|
|
22966
22968
|
var GONGMUN_PARA_APPROVAL = GONGMUN_LIST_PLAIN_BASE + GONGMUN_LIST_LEVELS;
|
|
22967
|
-
var
|
|
22969
|
+
var GONGMUN_SRC_LEFT = GONGMUN_PARA_APPROVAL + 1;
|
|
22970
|
+
var GONGMUN_LIST_VARIANT_BASE = GONGMUN_SRC_LEFT + 1;
|
|
22968
22971
|
var GJ_BF_CHAPTER_NUM = 3;
|
|
22969
22972
|
var GJ_BF_CHAPTER_GAP = 4;
|
|
22970
22973
|
var GJ_BF_CHAPTER_TITLE = 5;
|
|
@@ -23008,10 +23011,15 @@ var GONGMUN_TBL_CHAR_BOLD = 12;
|
|
|
23008
23011
|
var GONGMUN_TBL_PT = 1200;
|
|
23009
23012
|
var GONGMUN_TITLE_BAR_CHAR = 13;
|
|
23010
23013
|
var GONGMUN_APPROVAL_CHAR = 14;
|
|
23014
|
+
var GONGMUN_SRC_CHAR = 15;
|
|
23015
|
+
var GONGMUN_SRC_CHAR_BOLD = 16;
|
|
23016
|
+
function srcCaptionPt(bodyHeight) {
|
|
23017
|
+
return Math.max(bodyHeight - 300, 1e3);
|
|
23018
|
+
}
|
|
23011
23019
|
var CHAR_VARIANT_BASE = CHAR_QUOTE + 1;
|
|
23012
23020
|
function charVariantBase(richAssets, isGongmun = true) {
|
|
23013
23021
|
if (!isGongmun) return CHAR_VARIANT_BASE;
|
|
23014
|
-
return richAssets ? CHAR_VARIANT_BASE + GJ_CHAR_COUNT : CHAR_VARIANT_BASE + (
|
|
23022
|
+
return richAssets ? CHAR_VARIANT_BASE + GJ_CHAR_COUNT : CHAR_VARIANT_BASE + (GONGMUN_SRC_CHAR_BOLD - GONGMUN_TBL_CHAR + 1);
|
|
23015
23023
|
}
|
|
23016
23024
|
var GONGMUN_BODY_RATIO = 95;
|
|
23017
23025
|
|
|
@@ -23259,7 +23267,7 @@ function parseInlineMarkdown(text) {
|
|
|
23259
23267
|
else spans.push(...emphasisSpans(m[0]));
|
|
23260
23268
|
} else {
|
|
23261
23269
|
const anchor = m[2] || m[3];
|
|
23262
|
-
const href = _nullishCoalesce(
|
|
23270
|
+
const href = _nullishCoalesce(_chunkKATZTHWAcjs.sanitizeHref.call(void 0, m[3].trim()), () => ( void 0));
|
|
23263
23271
|
const sub = emphasisSpans(anchor);
|
|
23264
23272
|
if (href) for (const s of sub) s.href = href;
|
|
23265
23273
|
spans.push(...sub);
|
|
@@ -23473,7 +23481,7 @@ function assertSequentialIds(rows, label, startId) {
|
|
|
23473
23481
|
const m = rows[i].match(/\bid="(\d+)"/);
|
|
23474
23482
|
const got = m ? Number(m[1]) : NaN;
|
|
23475
23483
|
if (got !== startId + i) {
|
|
23476
|
-
throw new (0,
|
|
23484
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(
|
|
23477
23485
|
`\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)`
|
|
23478
23486
|
);
|
|
23479
23487
|
}
|
|
@@ -23513,7 +23521,10 @@ function buildCharProperties(theme, gongmun, ratioVariants = [], extraCharPrXmls
|
|
|
23513
23521
|
charPr(11, GONGMUN_TBL_PT, false, false, bodyFont, theme.body),
|
|
23514
23522
|
charPr(12, GONGMUN_TBL_PT, true, false, bodyFont, theme.body),
|
|
23515
23523
|
charPr(GONGMUN_TITLE_BAR_CHAR, 100, false, false, bodyFont, theme.body),
|
|
23516
|
-
charPr(GONGMUN_APPROVAL_CHAR, 1e3, false, false, bodyFont, theme.body)
|
|
23524
|
+
charPr(GONGMUN_APPROVAL_CHAR, 1e3, false, false, bodyFont, theme.body),
|
|
23525
|
+
// 출처행 캡션 — 본문 폰트 -3pt (실무 보고서: 표 아래 출처는 본문과 구분되는 작은 글씨)
|
|
23526
|
+
charPr(GONGMUN_SRC_CHAR, srcCaptionPt(body), false, false, bodyFont, theme.body),
|
|
23527
|
+
charPr(GONGMUN_SRC_CHAR_BOLD, srcCaptionPt(body), true, false, bodyFont, theme.body)
|
|
23517
23528
|
);
|
|
23518
23529
|
}
|
|
23519
23530
|
if (richAssets) {
|
|
@@ -23551,13 +23562,17 @@ function buildCharProperties(theme, gongmun, ratioVariants = [], extraCharPrXmls
|
|
|
23551
23562
|
// 본문 제목박스(HY헤드라인M 22pt, 실측 GT3 표④)
|
|
23552
23563
|
charPr(GJ_CHAR_TITLE_BAR, 100, false, false, 4),
|
|
23553
23564
|
// 1페이지형 제목박스 바(1pt)
|
|
23554
|
-
charPr(GJ_CHAR_APPROVAL, 1e3, false, false, 7)
|
|
23565
|
+
charPr(GJ_CHAR_APPROVAL, 1e3, false, false, 7),
|
|
23555
23566
|
// 결재란 라벨(맑은 고딕 10pt)
|
|
23567
|
+
charPr(GJ_CHAR_SRC, srcCaptionPt(body), false, false, 5),
|
|
23568
|
+
// 출처행 캡션(한양중고딕 본문-3pt)
|
|
23569
|
+
charPr(GJ_CHAR_SRC_BOLD, srcCaptionPt(body), true, false, 5)
|
|
23570
|
+
// 출처행 캡션 bold
|
|
23556
23571
|
);
|
|
23557
23572
|
}
|
|
23558
23573
|
const expectedBase = charVariantBase(richAssets, !!gongmun);
|
|
23559
23574
|
if (rows.length !== expectedBase) {
|
|
23560
|
-
throw new (0,
|
|
23575
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(
|
|
23561
23576
|
`\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`
|
|
23562
23577
|
);
|
|
23563
23578
|
}
|
|
@@ -23640,6 +23655,7 @@ ${base2.join("\n")}
|
|
|
23640
23655
|
base.push(paraPr(GONGMUN_LIST_PLAIN_BASE + d, { align: listAlign, lineSpacing: ls, left, indent: 0, spaceBefore: sectionGap, keepWord: true }));
|
|
23641
23656
|
}
|
|
23642
23657
|
base.push(paraPr(GONGMUN_PARA_APPROVAL, { align: "CENTER", lineSpacing: 100, keepWord: true }));
|
|
23658
|
+
base.push(paraPr(GONGMUN_SRC_LEFT, { align: "LEFT", lineSpacing: ls, keepWord: true }));
|
|
23643
23659
|
for (let vi = 0; vi < listIndentVariants.length; vi++) {
|
|
23644
23660
|
const { depth, widthHu } = listIndentVariants[vi];
|
|
23645
23661
|
const { left } = levelIndent(depth, gongmun.bodyHeight, gongmun.numbering, gongmun.sizes, gongmun.bullet2, usesAsteriskThird(gongmun.preset));
|
|
@@ -24458,7 +24474,7 @@ function escapeGfm(text) {
|
|
|
24458
24474
|
}
|
|
24459
24475
|
var HWP_SHAPE_ALT_TEXT_RE = /^(?:모서리가 둥근 |둥근 )?(?:사각형|직사각형|정사각형|원|타원|삼각형|이등변 삼각형|직각 삼각형|선|직선|곡선|화살표|굵은 화살표|이중 화살표|오각형|육각형|팔각형|별|[4-8]점별|십자|십자형|구름|구름형|마름모|도넛|평행사변형|사다리꼴|부채꼴|호|반원|물결|번개|하트|빗금|블록 화살표|수식|표|그림|개체|그리기\s?개체|묶음\s?개체|글상자|수식\s?개체|OLE\s?개체)\s?입니다\.?$/gm;
|
|
24460
24476
|
function sanitizeText(text) {
|
|
24461
|
-
let result =
|
|
24477
|
+
let result = _chunkV3Q6I2AQcjs.mapPuaText.call(void 0, text).replace(/[\u{F0000}-\u{FFFFD}]/gu, "").replace(HWP_SHAPE_ALT_TEXT_RE, "").replace(/ +/g, " ").trim();
|
|
24462
24478
|
if (result.length <= 30 && result.includes(" ")) {
|
|
24463
24479
|
const tokens = result.split(" ");
|
|
24464
24480
|
const koreanSingleCharCount = tokens.filter((t) => t.length === 1 && /[가-ㄱ-ㆎ]/.test(t)).length;
|
|
@@ -24630,7 +24646,7 @@ function parseHtmlTable(raw) {
|
|
|
24630
24646
|
const cs = parseInt(_optionalChain([attrs, 'access', _318 => _318.match, 'call', _319 => _319(/colspan\s*=\s*["']?(\d+)/i), 'optionalAccess', _320 => _320[1]]) || "1", 10);
|
|
24631
24647
|
const rs = parseInt(_optionalChain([attrs, 'access', _321 => _321.match, 'call', _322 => _322(/rowspan\s*=\s*["']?(\d+)/i), 'optionalAccess', _323 => _323[1]]) || "1", 10);
|
|
24632
24648
|
cellStart = m.index + m[0].length;
|
|
24633
|
-
cellInfo = { colSpan: clampSpan(isNaN(cs) ? 1 : cs,
|
|
24649
|
+
cellInfo = { colSpan: clampSpan(isNaN(cs) ? 1 : cs, _chunkV3Q6I2AQcjs.MAX_COLS), rowSpan: clampSpan(isNaN(rs) ? 1 : rs, _chunkV3Q6I2AQcjs.MAX_ROWS) };
|
|
24634
24650
|
} else if (cellStart >= 0 && cellInfo && currentRow) {
|
|
24635
24651
|
currentRow.push({ inner: raw.slice(cellStart, m.index), colSpan: cellInfo.colSpan, rowSpan: cellInfo.rowSpan });
|
|
24636
24652
|
cellStart = -1;
|
|
@@ -25372,8 +25388,8 @@ function layoutHtmlRows(rows) {
|
|
|
25372
25388
|
let c = 0;
|
|
25373
25389
|
for (const cell2 of rows[r].cells) {
|
|
25374
25390
|
while (occupied.has(`${r},${c}`)) c++;
|
|
25375
|
-
const colSpan = clampSpan(cell2.colSpan,
|
|
25376
|
-
const rowSpan = clampSpan(cell2.rowSpan,
|
|
25391
|
+
const colSpan = clampSpan(cell2.colSpan, _chunkV3Q6I2AQcjs.MAX_COLS);
|
|
25392
|
+
const rowSpan = clampSpan(cell2.rowSpan, _chunkV3Q6I2AQcjs.MAX_ROWS);
|
|
25377
25393
|
placed.push({ r, c, colSpan, rowSpan, inner: cell2.inner, isHeader: rows[r].tag === "th" });
|
|
25378
25394
|
for (let dr = 0; dr < rowSpan; dr++) {
|
|
25379
25395
|
for (let dc = 0; dc < colSpan; dc++) occupied.add(`${r + dr},${c + dc}`);
|
|
@@ -26215,7 +26231,17 @@ function renderParagraph(block, blockIdx, ctx) {
|
|
|
26215
26231
|
const ctr = gongmun && /^<center>([\s\S]*)<\/center>$/i.exec((block.text || "").trim());
|
|
26216
26232
|
const rgt = gongmun && /^<right>([\s\S]*)<\/right>$/i.exec((block.text || "").trim());
|
|
26217
26233
|
if (ctr) return generateParagraph(ctr[1].trim(), GONGMUN_CENTER);
|
|
26218
|
-
if (rgt)
|
|
26234
|
+
if (rgt) {
|
|
26235
|
+
const t = rgt[1].trim();
|
|
26236
|
+
const isSrc = /^(출처|자료)\s*[::]/.test(t);
|
|
26237
|
+
const srcChar = ctx.richAssets ? GJ_CHAR_SRC : GONGMUN_SRC_CHAR;
|
|
26238
|
+
const srcBold = ctx.richAssets ? GJ_CHAR_SRC_BOLD : GONGMUN_SRC_CHAR_BOLD;
|
|
26239
|
+
const h = isSrc ? srcCaptionPt(gongmun.bodyHeight) : gongmun.bodyHeight;
|
|
26240
|
+
const fits = measureTextWidth(t, h, isSrc ? 100 : GONGMUN_BODY_RATIO) <= ctx.gjBodyW + 0.5;
|
|
26241
|
+
const paraId = fits ? GONGMUN_RIGHT : GONGMUN_SRC_LEFT;
|
|
26242
|
+
if (!isSrc) return generateParagraph(t, paraId);
|
|
26243
|
+
return generateParagraph(t, paraId, srcChar, (id) => id === CHAR_BOLD ? srcBold : id);
|
|
26244
|
+
}
|
|
26219
26245
|
return generateParagraph(block.text || "", PARA_NORMAL, CHAR_NORMAL, fit ? variantMapper(fit, blockIdx, vBase) : void 0);
|
|
26220
26246
|
}
|
|
26221
26247
|
function renderCodeBlock(block, blockIdx, ctx) {
|
|
@@ -26684,7 +26710,7 @@ function builtinTemplateDir() {
|
|
|
26684
26710
|
for (const c of candidates) {
|
|
26685
26711
|
if (_fs.existsSync.call(void 0, _path.join.call(void 0, c, BUILTIN_TEMPLATES[0].file))) return c;
|
|
26686
26712
|
}
|
|
26687
|
-
throw new (0,
|
|
26713
|
+
throw new (0, _chunkKATZTHWAcjs.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)");
|
|
26688
26714
|
}
|
|
26689
26715
|
function readBuiltinTemplate(t) {
|
|
26690
26716
|
const buf = _fs.readFileSync.call(void 0, _path.join.call(void 0, builtinTemplateDir(), t.file));
|
|
@@ -27027,12 +27053,12 @@ function buildFloatPicXml(itemId, sizeHu, posXHu, posYHu, ids) {
|
|
|
27027
27053
|
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>`;
|
|
27028
27054
|
}
|
|
27029
27055
|
async function placeSealHwpx(hwpxBuffer, ops) {
|
|
27030
|
-
if (ops.length === 0) throw new (0,
|
|
27056
|
+
if (ops.length === 0) throw new (0, _chunkKATZTHWAcjs.KordocError)("place_seal: \uBC30\uCE58\uD560 \uB3C4\uC7A5\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
27031
27057
|
const u8 = new Uint8Array(hwpxBuffer);
|
|
27032
|
-
|
|
27058
|
+
_chunkKATZTHWAcjs.precheckZipSize.call(void 0, hwpxBuffer);
|
|
27033
27059
|
const zip = await _jszip2.default.loadAsync(hwpxBuffer);
|
|
27034
27060
|
const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort((a, b) => Number(_nullishCoalesce(_optionalChain([a, 'access', _436 => _436.match, 'call', _437 => _437(/(\d+)\.xml$/i), 'optionalAccess', _438 => _438[1]]), () => ( 0))) - Number(_nullishCoalesce(_optionalChain([b, 'access', _439 => _439.match, 'call', _440 => _440(/(\d+)\.xml$/i), 'optionalAccess', _441 => _441[1]]), () => ( 0))));
|
|
27035
|
-
if (sectionPaths.length === 0) throw new (0,
|
|
27061
|
+
if (sectionPaths.length === 0) throw new (0, _chunkKATZTHWAcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
27036
27062
|
const manifestPath = Object.keys(zip.files).find((name) => /\.hpf$/i.test(name));
|
|
27037
27063
|
const headerPath = Object.keys(zip.files).find((name) => /(^|\/)header\.xml$/i.test(name));
|
|
27038
27064
|
const styles = headerPath ? parseRenderStyles(await zip.file(headerPath).async("text")) : null;
|
|
@@ -27073,11 +27099,11 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
27073
27099
|
const manifestItems = [];
|
|
27074
27100
|
const placed = [];
|
|
27075
27101
|
for (const op of ops) {
|
|
27076
|
-
if (!op.anchor) throw new (0,
|
|
27077
|
-
if (!op.image || op.image.length === 0) throw new (0,
|
|
27102
|
+
if (!op.anchor) throw new (0, _chunkKATZTHWAcjs.KordocError)("place_seal: anchor \uBB38\uAD6C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
|
|
27103
|
+
if (!op.image || op.image.length === 0) throw new (0, _chunkKATZTHWAcjs.KordocError)("place_seal: \uB3C4\uC7A5 \uC774\uBBF8\uC9C0\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
|
|
27078
27104
|
const ext = (_nullishCoalesce(op.ext, () => ( "png"))).toLowerCase();
|
|
27079
|
-
if (!MIME[ext]) throw new (0,
|
|
27080
|
-
if (!imageMagicMatches(op.image, ext)) throw new (0,
|
|
27105
|
+
if (!MIME[ext]) throw new (0, _chunkKATZTHWAcjs.KordocError)(`place_seal: \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uC774\uBBF8\uC9C0 \uD655\uC7A5\uC790 .${ext} (png/jpg/bmp/gif)`);
|
|
27106
|
+
if (!imageMagicMatches(op.image, ext)) throw new (0, _chunkKATZTHWAcjs.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)`);
|
|
27081
27107
|
const wantOcc = _nullishCoalesce(op.occurrence, () => ( 0));
|
|
27082
27108
|
let found = null;
|
|
27083
27109
|
let total = 0;
|
|
@@ -27110,7 +27136,7 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
27110
27136
|
}
|
|
27111
27137
|
}
|
|
27112
27138
|
}
|
|
27113
|
-
throw new (0,
|
|
27139
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(
|
|
27114
27140
|
`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)})`
|
|
27115
27141
|
);
|
|
27116
27142
|
}
|
|
@@ -27118,7 +27144,7 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
27118
27144
|
const xml = sectionXmls[si];
|
|
27119
27145
|
const run = anchorRunInfo(xml, site.para, op.anchor);
|
|
27120
27146
|
if (!run) {
|
|
27121
|
-
throw new (0,
|
|
27147
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(`place_seal: \uC575\uCEE4 "${op.anchor}" \uBB38\uB2E8\uC5D0\uC11C run\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4`);
|
|
27122
27148
|
}
|
|
27123
27149
|
const charPrHeight = _nullishCoalesce(_optionalChain([styles, 'optionalAccess', _442 => _442.charPr, 'access', _443 => _443.get, 'call', _444 => _444(run.charPr), 'optionalAccess', _445 => _445.height]), () => ( 1e3));
|
|
27124
27150
|
const fontPt = charPrHeight / 100;
|
|
@@ -27396,7 +27422,7 @@ function pick(map, keys) {
|
|
|
27396
27422
|
return out;
|
|
27397
27423
|
}
|
|
27398
27424
|
async function hwpxToProfile(input) {
|
|
27399
|
-
const buf = input instanceof ArrayBuffer ? input :
|
|
27425
|
+
const buf = input instanceof ArrayBuffer ? input : _chunkKATZTHWAcjs.toArrayBuffer.call(void 0, input);
|
|
27400
27426
|
const zip = await _jszip2.default.loadAsync(buf);
|
|
27401
27427
|
const parser = createXmlParser();
|
|
27402
27428
|
const headerFile = _nullishCoalesce(zip.file("Contents/header.xml"), () => ( _optionalChain([zip, 'access', _467 => _467.file, 'call', _468 => _468(/[Hh]eader\.xml$/), 'optionalAccess', _469 => _469[0]])));
|
|
@@ -28570,7 +28596,7 @@ async function resolveSectionEntryNames(zip) {
|
|
|
28570
28596
|
const paths = sectionPathsFromManifest(xml).filter((p) => zip.file(p) !== null);
|
|
28571
28597
|
if (paths.length > 0) return paths;
|
|
28572
28598
|
}
|
|
28573
|
-
return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort(
|
|
28599
|
+
return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort(_chunkKATZTHWAcjs.compareSectionPaths);
|
|
28574
28600
|
}
|
|
28575
28601
|
function sectionPathsFromManifest(xml) {
|
|
28576
28602
|
const attr = (tag, name) => {
|
|
@@ -28580,7 +28606,7 @@ function sectionPathsFromManifest(xml) {
|
|
|
28580
28606
|
const idToHref = /* @__PURE__ */ new Map();
|
|
28581
28607
|
for (const m of xml.matchAll(/<opf:item(\s(?:"[^"]*"|'[^']*'|[^>"'])*?)\/?>/g)) {
|
|
28582
28608
|
const id = attr(m[1], "id");
|
|
28583
|
-
const href =
|
|
28609
|
+
const href = _chunkKATZTHWAcjs.normalizeSectionHref.call(void 0, attr(m[1], "href"));
|
|
28584
28610
|
if (id && href) idToHref.set(id, href);
|
|
28585
28611
|
}
|
|
28586
28612
|
const ordered = [];
|
|
@@ -28589,7 +28615,7 @@ function sectionPathsFromManifest(xml) {
|
|
|
28589
28615
|
if (href) ordered.push(href);
|
|
28590
28616
|
}
|
|
28591
28617
|
if (ordered.length > 0) return ordered;
|
|
28592
|
-
return Array.from(idToHref.values()).sort(
|
|
28618
|
+
return Array.from(idToHref.values()).sort(_chunkKATZTHWAcjs.compareSectionPaths);
|
|
28593
28619
|
}
|
|
28594
28620
|
|
|
28595
28621
|
// src/roundtrip/patcher.ts
|
|
@@ -28700,9 +28726,9 @@ function buildOrigUnits(blocks) {
|
|
|
28700
28726
|
if (block.type === "paragraph" && block.text && /^\[별표\s*\d+/.test(sanitizeText(block.text))) {
|
|
28701
28727
|
const next = blocks[i + 1];
|
|
28702
28728
|
if (_optionalChain([next, 'optionalAccess', _502 => _502.type]) === "paragraph" && next.text && /관련\)?$/.test(next.text)) consume = 2;
|
|
28703
|
-
chunk =
|
|
28729
|
+
chunk = _chunkV3Q6I2AQcjs.blocksToMarkdown.call(void 0, blocks.slice(i, i + consume));
|
|
28704
28730
|
} else {
|
|
28705
|
-
chunk =
|
|
28731
|
+
chunk = _chunkV3Q6I2AQcjs.blocksToMarkdown.call(void 0, [block]);
|
|
28706
28732
|
}
|
|
28707
28733
|
if (chunk) {
|
|
28708
28734
|
const subUnits = splitMarkdownUnits(chunk);
|
|
@@ -30322,12 +30348,12 @@ function blocksToChunks(blocks, options) {
|
|
|
30322
30348
|
let run = null;
|
|
30323
30349
|
const flushRun = () => {
|
|
30324
30350
|
if (!run) return;
|
|
30325
|
-
push("text", run.breadcrumb,
|
|
30351
|
+
push("text", run.breadcrumb, _chunkV3Q6I2AQcjs.blocksToMarkdown.call(void 0, run.blocks), [run.start, run.end], run.page);
|
|
30326
30352
|
run = null;
|
|
30327
30353
|
};
|
|
30328
30354
|
for (let i = 0; i < blocks.length; i++) {
|
|
30329
30355
|
const block = blocks[i];
|
|
30330
|
-
const md2 =
|
|
30356
|
+
const md2 = _chunkV3Q6I2AQcjs.blocksToMarkdown.call(void 0, [block]);
|
|
30331
30357
|
if (!md2) continue;
|
|
30332
30358
|
if (block.type === "heading") {
|
|
30333
30359
|
flushRun();
|
|
@@ -30797,13 +30823,13 @@ async function htmlToPdf(html, options) {
|
|
|
30797
30823
|
try {
|
|
30798
30824
|
puppeteer = await Promise.resolve().then(() => _interopRequireWildcard(require("puppeteer-core")));
|
|
30799
30825
|
} catch (e37) {
|
|
30800
|
-
throw new (0,
|
|
30826
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(
|
|
30801
30827
|
"PDF \uC0DD\uC131\uC5D0 puppeteer-core\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. \uC124\uCE58: npm install puppeteer-core"
|
|
30802
30828
|
);
|
|
30803
30829
|
}
|
|
30804
30830
|
const executablePath = _nullishCoalesce(process.env.PUPPETEER_EXECUTABLE_PATH, () => ( findChromiumPath()));
|
|
30805
30831
|
if (!executablePath) {
|
|
30806
|
-
throw new (0,
|
|
30832
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)(
|
|
30807
30833
|
"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."
|
|
30808
30834
|
);
|
|
30809
30835
|
}
|
|
@@ -30862,7 +30888,7 @@ async function markdownToPdf(markdown, options) {
|
|
|
30862
30888
|
return htmlToPdf(html, options);
|
|
30863
30889
|
}
|
|
30864
30890
|
async function blocksToPdf(blocks, options) {
|
|
30865
|
-
const markdown =
|
|
30891
|
+
const markdown = _chunkV3Q6I2AQcjs.blocksToMarkdown.call(void 0, blocks);
|
|
30866
30892
|
return markdownToPdf(markdown, options);
|
|
30867
30893
|
}
|
|
30868
30894
|
|
|
@@ -31761,15 +31787,15 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode) {
|
|
|
31761
31787
|
async function renderHwpxToSvg(input, options) {
|
|
31762
31788
|
const maxImg = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _599 => _599.maxImageBytes]), () => ( 40 * 1024 * 1024));
|
|
31763
31789
|
const ab = input instanceof Uint8Array ? input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength) : input;
|
|
31764
|
-
|
|
31790
|
+
_chunkKATZTHWAcjs.precheckZipSize.call(void 0, ab, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
|
|
31765
31791
|
let zip;
|
|
31766
31792
|
try {
|
|
31767
31793
|
zip = await _jszip2.default.loadAsync(input);
|
|
31768
31794
|
} catch (e38) {
|
|
31769
|
-
throw new (0,
|
|
31795
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("HWPX(ZIP) \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4 \u2014 \uB80C\uB354\uB294 HWPX\uB9CC \uC9C0\uC6D0");
|
|
31770
31796
|
}
|
|
31771
31797
|
const secFiles = zip.file(/Contents\/section\d+\.xml$/i).sort((a, b) => a.name.localeCompare(b.name));
|
|
31772
|
-
if (secFiles.length === 0) throw new (0,
|
|
31798
|
+
if (secFiles.length === 0) throw new (0, _chunkKATZTHWAcjs.KordocError)("Contents/section0.xml \uC5C6\uC74C \u2014 HWPX\uAC00 \uC544\uB2C8\uAC70\uB098 \uC190\uC0C1\uB428");
|
|
31773
31799
|
const warnings = [];
|
|
31774
31800
|
const headFile = _nullishCoalesce(zip.file("Contents/header.xml"), () => ( zip.file("Contents/head.xml")));
|
|
31775
31801
|
const styles = headFile ? parseRenderStyles(await headFile.async("string")) : { charPr: /* @__PURE__ */ new Map(), paraAlign: /* @__PURE__ */ new Map(), paraGeom: /* @__PURE__ */ new Map(), borderFill: /* @__PURE__ */ new Map() };
|
|
@@ -31777,7 +31803,7 @@ async function renderHwpxToSvg(input, options) {
|
|
|
31777
31803
|
const secXmls = [];
|
|
31778
31804
|
for (const f of secFiles) {
|
|
31779
31805
|
const xml = await f.async("string");
|
|
31780
|
-
if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
31806
|
+
if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0, _chunkKATZTHWAcjs.KordocError)("\uC139\uC158 XML\uC774 \uD5C8\uC6A9 \uD06C\uAE30\uB97C \uCD08\uACFC");
|
|
31781
31807
|
secXmls.push(xml);
|
|
31782
31808
|
}
|
|
31783
31809
|
const binmap = /* @__PURE__ */ new Map();
|
|
@@ -31850,9 +31876,9 @@ async function renderHwpxToSvg(input, options) {
|
|
|
31850
31876
|
}
|
|
31851
31877
|
if (rendered.length === 0) {
|
|
31852
31878
|
if (noCacheSkipped) {
|
|
31853
|
-
throw new (0,
|
|
31879
|
+
throw new (0, _chunkKATZTHWAcjs.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)");
|
|
31854
31880
|
}
|
|
31855
|
-
throw new (0,
|
|
31881
|
+
throw new (0, _chunkKATZTHWAcjs.KordocError)("\uB80C\uB354\uD560 \uAD6C\uC5ED\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 HWPX\uAC00 \uC190\uC0C1\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4");
|
|
31856
31882
|
}
|
|
31857
31883
|
const GAP = 2400;
|
|
31858
31884
|
const clipDefs = [];
|
|
@@ -31888,13 +31914,13 @@ async function parse(input, options) {
|
|
|
31888
31914
|
if (typeof input === "string") {
|
|
31889
31915
|
try {
|
|
31890
31916
|
const buf = await _promises.readFile.call(void 0, input);
|
|
31891
|
-
buffer =
|
|
31917
|
+
buffer = _chunkKATZTHWAcjs.toArrayBuffer.call(void 0, buf);
|
|
31892
31918
|
} catch (err) {
|
|
31893
31919
|
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}`;
|
|
31894
31920
|
return { success: false, fileType: "unknown", error: msg2, code: "PARSE_ERROR" };
|
|
31895
31921
|
}
|
|
31896
31922
|
} else if (Buffer.isBuffer(input)) {
|
|
31897
|
-
buffer =
|
|
31923
|
+
buffer = _chunkKATZTHWAcjs.toArrayBuffer.call(void 0, input);
|
|
31898
31924
|
} else {
|
|
31899
31925
|
buffer = input;
|
|
31900
31926
|
}
|
|
@@ -31936,18 +31962,18 @@ async function dispatch(format, buffer, opts) {
|
|
|
31936
31962
|
}
|
|
31937
31963
|
async function parseImage(buffer, options) {
|
|
31938
31964
|
try {
|
|
31939
|
-
const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-
|
|
31965
|
+
const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-YTGAUHEP.cjs")));
|
|
31940
31966
|
const { blocks, warnings } = await parseImageDocument(buffer, options);
|
|
31941
31967
|
return {
|
|
31942
31968
|
success: true,
|
|
31943
31969
|
fileType: "image",
|
|
31944
|
-
markdown:
|
|
31970
|
+
markdown: _chunkV3Q6I2AQcjs.blocksToMarkdown.call(void 0, blocks),
|
|
31945
31971
|
blocks,
|
|
31946
31972
|
warnings: warnings.length ? warnings : void 0,
|
|
31947
31973
|
pageCount: 1
|
|
31948
31974
|
};
|
|
31949
31975
|
} catch (err) {
|
|
31950
|
-
return { success: false, fileType: "image", error:
|
|
31976
|
+
return { success: false, fileType: "image", error: _chunkKATZTHWAcjs.sanitizeError.call(void 0, err), code: _chunkKATZTHWAcjs.classifyError.call(void 0, err) };
|
|
31951
31977
|
}
|
|
31952
31978
|
}
|
|
31953
31979
|
async function parseHwp3(buffer, options) {
|
|
@@ -31955,7 +31981,7 @@ async function parseHwp3(buffer, options) {
|
|
|
31955
31981
|
const { markdown, blocks, metadata, outline, warnings } = parseHwp3Document(buffer, options);
|
|
31956
31982
|
return { success: true, fileType: "hwp3", markdown, blocks, metadata, outline, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _606 => _606.pageCount]) };
|
|
31957
31983
|
} catch (err) {
|
|
31958
|
-
return { success: false, fileType: "hwp3", error:
|
|
31984
|
+
return { success: false, fileType: "hwp3", error: _chunkKATZTHWAcjs.sanitizeError.call(void 0, err), code: _chunkKATZTHWAcjs.classifyError.call(void 0, err) };
|
|
31959
31985
|
}
|
|
31960
31986
|
}
|
|
31961
31987
|
async function parseHwpx(buffer, options) {
|
|
@@ -31963,7 +31989,7 @@ async function parseHwpx(buffer, options) {
|
|
|
31963
31989
|
const { markdown, blocks, metadata, outline, warnings, images } = await parseHwpxDocument(buffer, options);
|
|
31964
31990
|
return { success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _607 => _607.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _608 => _608.pageCount]) };
|
|
31965
31991
|
} catch (err) {
|
|
31966
|
-
return { success: false, fileType: "hwpx", error:
|
|
31992
|
+
return { success: false, fileType: "hwpx", error: _chunkKATZTHWAcjs.sanitizeError.call(void 0, err), code: _chunkKATZTHWAcjs.classifyError.call(void 0, err) };
|
|
31967
31993
|
}
|
|
31968
31994
|
}
|
|
31969
31995
|
async function parseHwp(buffer, options) {
|
|
@@ -31989,13 +32015,13 @@ async function parseHwp(buffer, options) {
|
|
|
31989
32015
|
}
|
|
31990
32016
|
return { success: true, fileType: "hwp", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _610 => _610.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _611 => _611.pageCount]) };
|
|
31991
32017
|
} catch (err) {
|
|
31992
|
-
return { success: false, fileType: "hwp", error:
|
|
32018
|
+
return { success: false, fileType: "hwp", error: _chunkKATZTHWAcjs.sanitizeError.call(void 0, err), code: _chunkKATZTHWAcjs.classifyError.call(void 0, err) };
|
|
31993
32019
|
}
|
|
31994
32020
|
}
|
|
31995
32021
|
async function parsePdf(buffer, options) {
|
|
31996
32022
|
let parsePdfDocument;
|
|
31997
32023
|
try {
|
|
31998
|
-
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-
|
|
32024
|
+
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-WIRWVN5E.cjs")));
|
|
31999
32025
|
parsePdfDocument = mod.parsePdfDocument;
|
|
32000
32026
|
} catch (e40) {
|
|
32001
32027
|
return {
|
|
@@ -32010,7 +32036,7 @@ async function parsePdf(buffer, options) {
|
|
|
32010
32036
|
return { success: true, fileType: "pdf", markdown, blocks, metadata, outline, warnings, isImageBased, pageQuality, qualitySummary, images, pageCount: _optionalChain([metadata, 'optionalAccess', _612 => _612.pageCount]) };
|
|
32011
32037
|
} catch (err) {
|
|
32012
32038
|
const isImageBased = err instanceof Error && "isImageBased" in err ? true : void 0;
|
|
32013
|
-
return { success: false, fileType: "pdf", error:
|
|
32039
|
+
return { success: false, fileType: "pdf", error: _chunkKATZTHWAcjs.sanitizeError.call(void 0, err), code: _chunkKATZTHWAcjs.classifyError.call(void 0, err), isImageBased };
|
|
32014
32040
|
}
|
|
32015
32041
|
}
|
|
32016
32042
|
async function parseXlsx(buffer, options) {
|
|
@@ -32018,7 +32044,7 @@ async function parseXlsx(buffer, options) {
|
|
|
32018
32044
|
const { markdown, blocks, metadata, warnings } = await parseXlsxDocument(buffer, options);
|
|
32019
32045
|
return { success: true, fileType: "xlsx", markdown, blocks, metadata, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _613 => _613.pageCount]) };
|
|
32020
32046
|
} catch (err) {
|
|
32021
|
-
return { success: false, fileType: "xlsx", error:
|
|
32047
|
+
return { success: false, fileType: "xlsx", error: _chunkKATZTHWAcjs.sanitizeError.call(void 0, err), code: _chunkKATZTHWAcjs.classifyError.call(void 0, err) };
|
|
32022
32048
|
}
|
|
32023
32049
|
}
|
|
32024
32050
|
async function parseXls(buffer, options) {
|
|
@@ -32026,7 +32052,7 @@ async function parseXls(buffer, options) {
|
|
|
32026
32052
|
const { markdown, blocks, metadata, warnings } = await parseXlsDocument(buffer, options);
|
|
32027
32053
|
return { success: true, fileType: "xls", markdown, blocks, metadata, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _614 => _614.pageCount]) };
|
|
32028
32054
|
} catch (err) {
|
|
32029
|
-
return { success: false, fileType: "xls", error:
|
|
32055
|
+
return { success: false, fileType: "xls", error: _chunkKATZTHWAcjs.sanitizeError.call(void 0, err), code: _chunkKATZTHWAcjs.classifyError.call(void 0, err) };
|
|
32030
32056
|
}
|
|
32031
32057
|
}
|
|
32032
32058
|
async function parseDocx(buffer, options) {
|
|
@@ -32034,7 +32060,7 @@ async function parseDocx(buffer, options) {
|
|
|
32034
32060
|
const { markdown, blocks, metadata, outline, warnings, images } = await parseDocxDocument(buffer, options);
|
|
32035
32061
|
return { success: true, fileType: "docx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _615 => _615.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _616 => _616.pageCount]) };
|
|
32036
32062
|
} catch (err) {
|
|
32037
|
-
return { success: false, fileType: "docx", error:
|
|
32063
|
+
return { success: false, fileType: "docx", error: _chunkKATZTHWAcjs.sanitizeError.call(void 0, err), code: _chunkKATZTHWAcjs.classifyError.call(void 0, err) };
|
|
32038
32064
|
}
|
|
32039
32065
|
}
|
|
32040
32066
|
async function parseHwpml(buffer, options) {
|
|
@@ -32042,16 +32068,16 @@ async function parseHwpml(buffer, options) {
|
|
|
32042
32068
|
const { markdown, blocks, metadata, outline, warnings } = parseHwpmlDocument(buffer, options);
|
|
32043
32069
|
return { success: true, fileType: "hwpml", markdown, blocks, metadata, outline, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _617 => _617.pageCount]) };
|
|
32044
32070
|
} catch (err) {
|
|
32045
|
-
return { success: false, fileType: "hwpml", error:
|
|
32071
|
+
return { success: false, fileType: "hwpml", error: _chunkKATZTHWAcjs.sanitizeError.call(void 0, err), code: _chunkKATZTHWAcjs.classifyError.call(void 0, err) };
|
|
32046
32072
|
}
|
|
32047
32073
|
}
|
|
32048
32074
|
async function fillForm(input, values, outputFormat = "markdown") {
|
|
32049
32075
|
let buffer;
|
|
32050
32076
|
if (typeof input === "string") {
|
|
32051
32077
|
const buf = await _promises.readFile.call(void 0, input);
|
|
32052
|
-
buffer =
|
|
32078
|
+
buffer = _chunkKATZTHWAcjs.toArrayBuffer.call(void 0, buf);
|
|
32053
32079
|
} else if (Buffer.isBuffer(input)) {
|
|
32054
|
-
buffer =
|
|
32080
|
+
buffer = _chunkKATZTHWAcjs.toArrayBuffer.call(void 0, input);
|
|
32055
32081
|
} else {
|
|
32056
32082
|
buffer = input;
|
|
32057
32083
|
}
|
|
@@ -32077,7 +32103,7 @@ async function fillForm(input, values, outputFormat = "markdown") {
|
|
|
32077
32103
|
throw new Error(`\uC11C\uC2DD \uD30C\uC2F1 \uC2E4\uD328: ${parsed.error}`);
|
|
32078
32104
|
}
|
|
32079
32105
|
const fill = fillFormFields(parsed.blocks, values);
|
|
32080
|
-
const markdown =
|
|
32106
|
+
const markdown = _chunkV3Q6I2AQcjs.blocksToMarkdown.call(void 0, fill.blocks);
|
|
32081
32107
|
if (outputFormat === "hwpx") {
|
|
32082
32108
|
const hwpxBuffer = await markdownToHwpx(markdown);
|
|
32083
32109
|
return { output: hwpxBuffer, format: "hwpx", fill };
|
|
@@ -32160,5 +32186,5 @@ async function fillForm(input, values, outputFormat = "markdown") {
|
|
|
32160
32186
|
|
|
32161
32187
|
|
|
32162
32188
|
|
|
32163
|
-
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 =
|
|
32189
|
+
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 = _chunkKATZTHWAcjs.VERSION; exports.ValueCursor = ValueCursor; exports.applySplices = applySplices; exports.blocksToChunks = blocksToChunks; exports.blocksToMarkdown = _chunkV3Q6I2AQcjs.blocksToMarkdown; exports.blocksToPages = blocksToPages; 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.lintMuncheText = lintMuncheText; exports.markdownToHwpx = markdownToHwpx; exports.markdownToPdf = markdownToPdf; exports.measureTextWidth = measureTextWidth; exports.muncheLintWarnings = muncheLintWarnings; 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.usesGaejosikMunche = usesGaejosikMunche; exports.validateHwpx = validateHwpx;
|
|
32164
32190
|
//# sourceMappingURL=index.cjs.map
|