kordoc 3.5.1 → 3.5.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/dist/index.cjs CHANGED
@@ -19,7 +19,7 @@
19
19
 
20
20
 
21
21
 
22
- var _chunkRWSGBXSAcjs = require('./chunk-RWSGBXSA.cjs');
22
+ var _chunkG44XLS26cjs = require('./chunk-G44XLS26.cjs');
23
23
 
24
24
 
25
25
  var _chunkDCZVOIEOcjs = require('./chunk-DCZVOIEO.cjs');
@@ -845,7 +845,7 @@ function createSectionShared() {
845
845
  function createXmlParser(warnings) {
846
846
  return new (0, _xmldom.DOMParser)({
847
847
  onError(level, msg2) {
848
- if (level === "fatalError") throw new (0, _chunkRWSGBXSAcjs.KordocError)(`XML \uD30C\uC2F1 \uC2E4\uD328: ${msg2}`);
848
+ if (level === "fatalError") throw new (0, _chunkG44XLS26cjs.KordocError)(`XML \uD30C\uC2F1 \uC2E4\uD328: ${msg2}`);
849
849
  _optionalChain([warnings, 'optionalAccess', _3 => _3.push, 'call', _4 => _4({ code: "MALFORMED_XML", message: `XML ${level === "warn" ? "\uACBD\uACE0" : "\uC624\uB958"}: ${msg2}` })]);
850
850
  }
851
851
  });
@@ -867,10 +867,10 @@ async function extractHwpxStyles(zip, decompressed) {
867
867
  const xml = await file.async("text");
868
868
  if (decompressed) {
869
869
  decompressed.total += xml.length * 2;
870
- if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkRWSGBXSAcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
870
+ if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkG44XLS26cjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
871
871
  }
872
872
  const parser = createXmlParser();
873
- const doc = parser.parseFromString(_chunkRWSGBXSAcjs.stripDtd.call(void 0, xml), "text/xml");
873
+ const doc = parser.parseFromString(_chunkG44XLS26cjs.stripDtd.call(void 0, xml), "text/xml");
874
874
  if (!doc.documentElement) continue;
875
875
  parseCharProperties(doc, result.charProperties);
876
876
  parseStyleElements(doc, result.styles);
@@ -1092,7 +1092,7 @@ function resolveParaHeading(paraEl, ctx) {
1092
1092
  return { prefix, headingLevel };
1093
1093
  }
1094
1094
  async function parseHwpxDocument(buffer, options) {
1095
- _chunkRWSGBXSAcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
1095
+ _chunkG44XLS26cjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
1096
1096
  let zip;
1097
1097
  try {
1098
1098
  zip = await _jszip2.default.loadAsync(buffer);
@@ -1101,7 +1101,7 @@ async function parseHwpxDocument(buffer, options) {
1101
1101
  }
1102
1102
  const actualEntryCount = Object.keys(zip.files).length;
1103
1103
  if (actualEntryCount > MAX_ZIP_ENTRIES) {
1104
- throw new (0, _chunkRWSGBXSAcjs.KordocError)("ZIP \uC5D4\uD2B8\uB9AC \uC218 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1104
+ throw new (0, _chunkG44XLS26cjs.KordocError)("ZIP \uC5D4\uD2B8\uB9AC \uC218 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1105
1105
  }
1106
1106
  const manifestFile = zip.file("META-INF/manifest.xml");
1107
1107
  if (manifestFile) {
@@ -1113,7 +1113,7 @@ async function parseHwpxDocument(buffer, options) {
1113
1113
  return comResultToParseResult(pages, pageCount, warnings2);
1114
1114
  }
1115
1115
  }
1116
- throw new (0, _chunkRWSGBXSAcjs.KordocError)("DRM \uC554\uD638\uD654\uB41C HWPX \uD30C\uC77C\uC785\uB2C8\uB2E4. Windows + \uD55C\uCEF4 \uC624\uD53C\uC2A4 \uC124\uCE58 \uC2DC \uC790\uB3D9 \uCD94\uCD9C\uB429\uB2C8\uB2E4.");
1116
+ throw new (0, _chunkG44XLS26cjs.KordocError)("DRM \uC554\uD638\uD654\uB41C HWPX \uD30C\uC77C\uC785\uB2C8\uB2E4. Windows + \uD55C\uCEF4 \uC624\uD53C\uC2A4 \uC124\uCE58 \uC2DC \uC790\uB3D9 \uCD94\uCD9C\uB429\uB2C8\uB2E4.");
1117
1117
  }
1118
1118
  }
1119
1119
  const decompressed = { total: 0 };
@@ -1122,7 +1122,7 @@ async function parseHwpxDocument(buffer, options) {
1122
1122
  const styleMap = await extractHwpxStyles(zip, decompressed);
1123
1123
  const warnings = [];
1124
1124
  const sectionPaths = await resolveSectionPaths(zip);
1125
- if (sectionPaths.length === 0) throw new (0, _chunkRWSGBXSAcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
1125
+ if (sectionPaths.length === 0) throw new (0, _chunkG44XLS26cjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
1126
1126
  metadata.pageCount = sectionPaths.length;
1127
1127
  const pageFilter = _optionalChain([options, 'optionalAccess', _12 => _12.pages]) ? _chunkDCZVOIEOcjs.parsePageRange.call(void 0, options.pages, sectionPaths.length) : null;
1128
1128
  const totalTarget = pageFilter ? pageFilter.size : sectionPaths.length;
@@ -1136,12 +1136,12 @@ async function parseHwpxDocument(buffer, options) {
1136
1136
  try {
1137
1137
  const xml = await file.async("text");
1138
1138
  decompressed.total += xml.length * 2;
1139
- if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkRWSGBXSAcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1139
+ if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkG44XLS26cjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1140
1140
  blocks.push(...parseSectionXml(xml, styleMap, warnings, si + 1, shared));
1141
1141
  parsedSections++;
1142
1142
  _optionalChain([options, 'optionalAccess', _13 => _13.onProgress, 'optionalCall', _14 => _14(parsedSections, totalTarget)]);
1143
1143
  } catch (secErr) {
1144
- if (secErr instanceof _chunkRWSGBXSAcjs.KordocError) throw secErr;
1144
+ if (secErr instanceof _chunkG44XLS26cjs.KordocError) throw secErr;
1145
1145
  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" });
1146
1146
  }
1147
1147
  }
@@ -1149,7 +1149,7 @@ async function parseHwpxDocument(buffer, options) {
1149
1149
  const images = await extractImagesFromZip(zip, blocks, decompressed, warnings);
1150
1150
  detectHwpxHeadings(blocks, styleMap);
1151
1151
  const outline = blocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
1152
- const markdown = _chunkRWSGBXSAcjs.blocksToMarkdown.call(void 0, blocks);
1152
+ const markdown = _chunkG44XLS26cjs.blocksToMarkdown.call(void 0, blocks);
1153
1153
  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 };
1154
1154
  }
1155
1155
  function applyPageText(blocks, shared) {
@@ -1238,13 +1238,13 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings) {
1238
1238
  let found = false;
1239
1239
  const allCandidates = resolvedPath ? [resolvedPath, ...candidates] : candidates;
1240
1240
  for (const path of allCandidates) {
1241
- if (_chunkRWSGBXSAcjs.isPathTraversal.call(void 0, path)) continue;
1241
+ if (_chunkG44XLS26cjs.isPathTraversal.call(void 0, path)) continue;
1242
1242
  const file = zip.file(path);
1243
1243
  if (!file) continue;
1244
1244
  try {
1245
1245
  const data = await file.async("uint8array");
1246
1246
  decompressed.total += data.length;
1247
- if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkRWSGBXSAcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1247
+ if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkG44XLS26cjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1248
1248
  const actualPath = path;
1249
1249
  const ext = actualPath.includes(".") ? actualPath.split(".").pop() || "png" : "png";
1250
1250
  const mimeType = imageExtToMime(ext);
@@ -1257,7 +1257,7 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings) {
1257
1257
  found = true;
1258
1258
  break;
1259
1259
  } catch (err) {
1260
- if (err instanceof _chunkRWSGBXSAcjs.KordocError) throw err;
1260
+ if (err instanceof _chunkG44XLS26cjs.KordocError) throw err;
1261
1261
  }
1262
1262
  }
1263
1263
  if (!found) {
@@ -1278,7 +1278,7 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
1278
1278
  const xml = await file.async("text");
1279
1279
  if (decompressed) {
1280
1280
  decompressed.total += xml.length * 2;
1281
- if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkRWSGBXSAcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1281
+ if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkG44XLS26cjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
1282
1282
  }
1283
1283
  parseDublinCoreMetadata(xml, metadata);
1284
1284
  if (metadata.title || metadata.author) return;
@@ -1288,7 +1288,7 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
1288
1288
  }
1289
1289
  function parseDublinCoreMetadata(xml, metadata) {
1290
1290
  const parser = createXmlParser();
1291
- const doc = parser.parseFromString(_chunkRWSGBXSAcjs.stripDtd.call(void 0, xml), "text/xml");
1291
+ const doc = parser.parseFromString(_chunkG44XLS26cjs.stripDtd.call(void 0, xml), "text/xml");
1292
1292
  if (!doc.documentElement) return;
1293
1293
  const getText = (tagNames) => {
1294
1294
  for (const tag of tagNames) {
@@ -1348,7 +1348,7 @@ function extractFromBrokenZip(buffer) {
1348
1348
  }
1349
1349
  const nameBytes = data.slice(pos + 30, pos + 30 + nameLen);
1350
1350
  const name = new TextDecoder().decode(nameBytes);
1351
- if (_chunkRWSGBXSAcjs.isPathTraversal.call(void 0, name)) {
1351
+ if (_chunkG44XLS26cjs.isPathTraversal.call(void 0, name)) {
1352
1352
  pos = fileStart + compSize;
1353
1353
  continue;
1354
1354
  }
@@ -1366,16 +1366,16 @@ function extractFromBrokenZip(buffer) {
1366
1366
  continue;
1367
1367
  }
1368
1368
  totalDecompressed += content.length * 2;
1369
- if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0, _chunkRWSGBXSAcjs.KordocError)("\uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC");
1369
+ if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0, _chunkG44XLS26cjs.KordocError)("\uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC");
1370
1370
  sectionNum++;
1371
1371
  blocks.push(...parseSectionXml(content, void 0, warnings, sectionNum, shared));
1372
1372
  } catch (e14) {
1373
1373
  continue;
1374
1374
  }
1375
1375
  }
1376
- if (blocks.length === 0) throw new (0, _chunkRWSGBXSAcjs.KordocError)("\uC190\uC0C1\uB41C HWPX\uC5D0\uC11C \uC139\uC158 \uB370\uC774\uD130\uB97C \uBCF5\uAD6C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
1376
+ if (blocks.length === 0) throw new (0, _chunkG44XLS26cjs.KordocError)("\uC190\uC0C1\uB41C HWPX\uC5D0\uC11C \uC139\uC158 \uB370\uC774\uD130\uB97C \uBCF5\uAD6C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
1377
1377
  applyPageText(blocks, shared);
1378
- const markdown = _chunkRWSGBXSAcjs.blocksToMarkdown.call(void 0, blocks);
1378
+ const markdown = _chunkG44XLS26cjs.blocksToMarkdown.call(void 0, blocks);
1379
1379
  return { markdown, blocks, warnings: warnings.length > 0 ? warnings : void 0 };
1380
1380
  }
1381
1381
  async function resolveSectionPaths(zip) {
@@ -1389,18 +1389,18 @@ async function resolveSectionPaths(zip) {
1389
1389
  if (paths.length > 0) return paths;
1390
1390
  }
1391
1391
  const sectionFiles = zip.file(/[Ss]ection\d+\.xml$/);
1392
- return sectionFiles.map((f) => f.name).sort(_chunkRWSGBXSAcjs.compareSectionPaths);
1392
+ return sectionFiles.map((f) => f.name).sort(_chunkG44XLS26cjs.compareSectionPaths);
1393
1393
  }
1394
1394
  function parseSectionPathsFromManifest(xml) {
1395
1395
  const parser = createXmlParser();
1396
- const doc = parser.parseFromString(_chunkRWSGBXSAcjs.stripDtd.call(void 0, xml), "text/xml");
1396
+ const doc = parser.parseFromString(_chunkG44XLS26cjs.stripDtd.call(void 0, xml), "text/xml");
1397
1397
  const items = doc.getElementsByTagName("opf:item");
1398
1398
  const spine = doc.getElementsByTagName("opf:itemref");
1399
1399
  const idToHref = /* @__PURE__ */ new Map();
1400
1400
  for (let i = 0; i < items.length; i++) {
1401
1401
  const item = items[i];
1402
1402
  const id = item.getAttribute("id") || "";
1403
- const href = _chunkRWSGBXSAcjs.normalizeSectionHref.call(void 0, item.getAttribute("href") || "");
1403
+ const href = _chunkG44XLS26cjs.normalizeSectionHref.call(void 0, item.getAttribute("href") || "");
1404
1404
  if (id && href) idToHref.set(id, href);
1405
1405
  }
1406
1406
  if (spine.length > 0) {
@@ -1411,7 +1411,7 @@ function parseSectionPathsFromManifest(xml) {
1411
1411
  }
1412
1412
  if (ordered.length > 0) return ordered;
1413
1413
  }
1414
- return Array.from(idToHref.values()).sort(_chunkRWSGBXSAcjs.compareSectionPaths);
1414
+ return Array.from(idToHref.values()).sort(_chunkG44XLS26cjs.compareSectionPaths);
1415
1415
  }
1416
1416
  function detectHwpxHeadings(blocks, styleMap) {
1417
1417
  if (blocks.some((b) => b.type === "heading")) return;
@@ -1436,9 +1436,9 @@ function detectHwpxHeadings(blocks, styleMap) {
1436
1436
  let level = 0;
1437
1437
  if (baseFontSize > 0 && _optionalChain([block, 'access', _25 => _25.style, 'optionalAccess', _26 => _26.fontSize])) {
1438
1438
  const ratio = block.style.fontSize / baseFontSize;
1439
- if (ratio >= _chunkRWSGBXSAcjs.HEADING_RATIO_H1) level = 1;
1440
- else if (ratio >= _chunkRWSGBXSAcjs.HEADING_RATIO_H2) level = 2;
1441
- else if (ratio >= _chunkRWSGBXSAcjs.HEADING_RATIO_H3) level = 3;
1439
+ if (ratio >= _chunkG44XLS26cjs.HEADING_RATIO_H1) level = 1;
1440
+ else if (ratio >= _chunkG44XLS26cjs.HEADING_RATIO_H2) level = 2;
1441
+ else if (ratio >= _chunkG44XLS26cjs.HEADING_RATIO_H3) level = 3;
1442
1442
  }
1443
1443
  const compactText = text.replace(/\s+/g, "");
1444
1444
  if (/^제\d+[조장절편]/.test(compactText) && text.length <= 50) {
@@ -1451,7 +1451,7 @@ function detectHwpxHeadings(blocks, styleMap) {
1451
1451
  }
1452
1452
  }
1453
1453
  function buildTableWithCellMeta(state) {
1454
- const table = _chunkRWSGBXSAcjs.buildTable.call(void 0, state.rows);
1454
+ const table = _chunkG44XLS26cjs.buildTable.call(void 0, state.rows);
1455
1455
  if (state.caption) table.caption = state.caption;
1456
1456
  const claimed = /* @__PURE__ */ new Set();
1457
1457
  for (const row of state.rows) {
@@ -1494,7 +1494,7 @@ function completeTable(newTable, tableStack, blocks, ctx) {
1494
1494
  const cell = parentTable.cell;
1495
1495
  (cell.blocks ??= []).push(block);
1496
1496
  cell.hasStructure = true;
1497
- let flat = _chunkRWSGBXSAcjs.convertTableToText.call(void 0, newTable.rows);
1497
+ let flat = _chunkG44XLS26cjs.convertTableToText.call(void 0, newTable.rows);
1498
1498
  if (newTable.caption) flat = newTable.caption + (flat ? "\n" + flat : "");
1499
1499
  if (flat) cell.text += (cell.text ? "\n" : "") + flat;
1500
1500
  } else {
@@ -1504,7 +1504,7 @@ function completeTable(newTable, tableStack, blocks, ctx) {
1504
1504
  }
1505
1505
  function parseSectionXml(xml, styleMap, warnings, sectionNum, shared) {
1506
1506
  const parser = createXmlParser(warnings);
1507
- const doc = parser.parseFromString(_chunkRWSGBXSAcjs.stripDtd.call(void 0, xml), "text/xml");
1507
+ const doc = parser.parseFromString(_chunkG44XLS26cjs.stripDtd.call(void 0, xml), "text/xml");
1508
1508
  if (!doc.documentElement) return [];
1509
1509
  const ctx = { styleMap, warnings, sectionNum, shared: _nullishCoalesce(shared, () => ( createSectionShared())) };
1510
1510
  ctx.shared.track.deleteDepth = 0;
@@ -1595,8 +1595,8 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
1595
1595
  const cs = isNaN(rawCs) ? 1 : rawCs;
1596
1596
  const rawRs = parseInt(el.getAttribute("rowSpan") || "1", 10);
1597
1597
  const rs = isNaN(rawRs) ? 1 : rawRs;
1598
- tableCtx.cell.colSpan = clampSpan(cs, _chunkRWSGBXSAcjs.MAX_COLS);
1599
- tableCtx.cell.rowSpan = clampSpan(rs, _chunkRWSGBXSAcjs.MAX_ROWS);
1598
+ tableCtx.cell.colSpan = clampSpan(cs, _chunkG44XLS26cjs.MAX_COLS);
1599
+ tableCtx.cell.rowSpan = clampSpan(rs, _chunkG44XLS26cjs.MAX_ROWS);
1600
1600
  }
1601
1601
  break;
1602
1602
  case "p": {
@@ -1818,7 +1818,7 @@ function extractHyperlinkHref(fieldBegin) {
1818
1818
  let url = (ch.textContent || "").trim();
1819
1819
  if (!url) continue;
1820
1820
  url = url.replace(/^https?:\/\/(?=https?:\/\/)/i, "");
1821
- const safe = _chunkRWSGBXSAcjs.sanitizeHref.call(void 0, url);
1821
+ const safe = _chunkG44XLS26cjs.sanitizeHref.call(void 0, url);
1822
1822
  if (safe) return safe;
1823
1823
  }
1824
1824
  return void 0;
@@ -1953,7 +1953,7 @@ function extractParagraphInfo(para, styleMap, ctx) {
1953
1953
  case "hyperlink": {
1954
1954
  const url = child.getAttribute("url") || child.getAttribute("href") || "";
1955
1955
  if (url) {
1956
- const safe = _chunkRWSGBXSAcjs.sanitizeHref.call(void 0, url);
1956
+ const safe = _chunkG44XLS26cjs.sanitizeHref.call(void 0, url);
1957
1957
  if (safe) href = safe;
1958
1958
  }
1959
1959
  walk(child);
@@ -2143,7 +2143,7 @@ function decompressStream(data) {
2143
2143
  return _zlib.inflateRawSync.call(void 0, data, opts);
2144
2144
  }
2145
2145
  function parseFileHeader(data) {
2146
- if (data.length < 40) throw new (0, _chunkRWSGBXSAcjs.KordocError)("FileHeader\uAC00 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4 (\uCD5C\uC18C 40\uBC14\uC774\uD2B8)");
2146
+ if (data.length < 40) throw new (0, _chunkG44XLS26cjs.KordocError)("FileHeader\uAC00 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4 (\uCD5C\uC18C 40\uBC14\uC774\uD2B8)");
2147
2147
  const sig = data.subarray(0, 32).toString("utf8").replace(/\0+$/, "");
2148
2148
  return {
2149
2149
  signature: sig,
@@ -3667,7 +3667,7 @@ function parseHwp5Document(buffer, options) {
3667
3667
  lenientCfb = parseLenientCfb(buffer);
3668
3668
  warnings.push({ message: "\uC190\uC0C1\uB41C CFB \uCEE8\uD14C\uC774\uB108 \u2014 lenient \uBAA8\uB4DC\uB85C \uBCF5\uAD6C", code: "LENIENT_CFB_RECOVERY" });
3669
3669
  } catch (e21) {
3670
- throw new (0, _chunkRWSGBXSAcjs.KordocError)("CFB \uCEE8\uD14C\uC774\uB108 \uD30C\uC2F1 \uC2E4\uD328 (strict \uBC0F lenient \uBAA8\uB450)");
3670
+ throw new (0, _chunkG44XLS26cjs.KordocError)("CFB \uCEE8\uD14C\uC774\uB108 \uD30C\uC2F1 \uC2E4\uD328 (strict \uBC0F lenient \uBAA8\uB450)");
3671
3671
  }
3672
3672
  }
3673
3673
  const findStream = (path) => {
@@ -3678,11 +3678,11 @@ function parseHwp5Document(buffer, options) {
3678
3678
  return lenientCfb.findStream(path);
3679
3679
  };
3680
3680
  const headerData = findStream("/FileHeader");
3681
- if (!headerData) throw new (0, _chunkRWSGBXSAcjs.KordocError)("FileHeader \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
3681
+ if (!headerData) throw new (0, _chunkG44XLS26cjs.KordocError)("FileHeader \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
3682
3682
  const header = parseFileHeader(headerData);
3683
- if (header.signature !== "HWP Document File") throw new (0, _chunkRWSGBXSAcjs.KordocError)("HWP \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
3684
- if (header.flags & FLAG_ENCRYPTED) throw new (0, _chunkRWSGBXSAcjs.KordocError)("\uC554\uD638\uD654\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
3685
- if (header.flags & FLAG_DRM) throw new (0, _chunkRWSGBXSAcjs.KordocError)("DRM \uBCF4\uD638\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
3683
+ if (header.signature !== "HWP Document File") throw new (0, _chunkG44XLS26cjs.KordocError)("HWP \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
3684
+ if (header.flags & FLAG_ENCRYPTED) throw new (0, _chunkG44XLS26cjs.KordocError)("\uC554\uD638\uD654\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
3685
+ if (header.flags & FLAG_DRM) throw new (0, _chunkG44XLS26cjs.KordocError)("DRM \uBCF4\uD638\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
3686
3686
  const compressed = (header.flags & FLAG_COMPRESSED) !== 0;
3687
3687
  const distribution = (header.flags & FLAG_DISTRIBUTION) !== 0;
3688
3688
  const metadata = {
@@ -3691,7 +3691,7 @@ function parseHwp5Document(buffer, options) {
3691
3691
  if (cfb) extractHwp5Metadata(cfb, metadata);
3692
3692
  const docInfo = cfb ? parseDocInfoStream(cfb, compressed) : parseDocInfoFromStream(findStream("/DocInfo"), compressed);
3693
3693
  const sections = distribution ? cfb ? findViewTextSections(cfb, compressed) : findViewTextSectionsLenient(lenientCfb, compressed) : cfb ? findSections(cfb) : findSectionsLenient(lenientCfb, compressed);
3694
- if (sections.length === 0) throw new (0, _chunkRWSGBXSAcjs.KordocError)("\uC139\uC158 \uC2A4\uD2B8\uB9BC\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
3694
+ if (sections.length === 0) throw new (0, _chunkG44XLS26cjs.KordocError)("\uC139\uC158 \uC2A4\uD2B8\uB9BC\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
3695
3695
  metadata.pageCount = sections.length;
3696
3696
  const pageFilter = _optionalChain([options, 'optionalAccess', _51 => _51.pages]) ? _chunkDCZVOIEOcjs.parsePageRange.call(void 0, options.pages, sections.length) : null;
3697
3697
  const totalTarget = pageFilter ? pageFilter.size : sections.length;
@@ -3705,25 +3705,25 @@ function parseHwp5Document(buffer, options) {
3705
3705
  const sectionData = sections[si];
3706
3706
  const data = !distribution && compressed ? decompressStream(Buffer.from(sectionData)) : Buffer.from(sectionData);
3707
3707
  totalDecompressed += data.length;
3708
- if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkRWSGBXSAcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3708
+ if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkG44XLS26cjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3709
3709
  const records = readRecords(data);
3710
3710
  const sectionBlocks = parseSection(records, docInfo, warnings, si + 1, doc);
3711
3711
  bodyBlocks.push(...sectionBlocks);
3712
3712
  parsedSections++;
3713
3713
  _optionalChain([options, 'optionalAccess', _52 => _52.onProgress, 'optionalCall', _53 => _53(parsedSections, totalTarget)]);
3714
3714
  } catch (secErr) {
3715
- if (secErr instanceof _chunkRWSGBXSAcjs.KordocError) throw secErr;
3715
+ if (secErr instanceof _chunkG44XLS26cjs.KordocError) throw secErr;
3716
3716
  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" });
3717
3717
  }
3718
3718
  }
3719
3719
  const blocks = [...doc.headerBlocks, ...bodyBlocks, ...doc.footerBlocks];
3720
3720
  const images = cfb ? extractHwp5Images(cfb.FileIndex, blocks, warnings) : extractHwp5ImagesLenient(lenientCfb, blocks, warnings);
3721
- const flatBlocks = _chunkRWSGBXSAcjs.flattenLayoutTables.call(void 0, blocks);
3721
+ const flatBlocks = _chunkG44XLS26cjs.flattenLayoutTables.call(void 0, blocks);
3722
3722
  if (docInfo) {
3723
3723
  detectHwp5Headings(flatBlocks, docInfo);
3724
3724
  }
3725
3725
  const outline = flatBlocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
3726
- const markdown = _chunkRWSGBXSAcjs.blocksToMarkdown.call(void 0, flatBlocks);
3726
+ const markdown = _chunkG44XLS26cjs.blocksToMarkdown.call(void 0, flatBlocks);
3727
3727
  return { markdown, blocks: flatBlocks, metadata, outline: outline.length > 0 ? outline : void 0, warnings: warnings.length > 0 ? warnings : void 0, images: images.length > 0 ? images : void 0 };
3728
3728
  }
3729
3729
  function parseDocInfoStream(cfb, compressed) {
@@ -3783,9 +3783,9 @@ function detectHwp5Headings(blocks, docInfo) {
3783
3783
  let level = 0;
3784
3784
  if (_optionalChain([block, 'access', _58 => _58.style, 'optionalAccess', _59 => _59.fontSize]) && baseFontSize > 0) {
3785
3785
  const ratio = block.style.fontSize / baseFontSize;
3786
- if (ratio >= _chunkRWSGBXSAcjs.HEADING_RATIO_H1) level = 1;
3787
- else if (ratio >= _chunkRWSGBXSAcjs.HEADING_RATIO_H2) level = 2;
3788
- else if (ratio >= _chunkRWSGBXSAcjs.HEADING_RATIO_H3) level = 3;
3786
+ if (ratio >= _chunkG44XLS26cjs.HEADING_RATIO_H1) level = 1;
3787
+ else if (ratio >= _chunkG44XLS26cjs.HEADING_RATIO_H2) level = 2;
3788
+ else if (ratio >= _chunkG44XLS26cjs.HEADING_RATIO_H3) level = 3;
3789
3789
  }
3790
3790
  if (/^제\d+[장절편]\s/.test(text) && text.length <= 50) {
3791
3791
  if (level === 0) level = 2;
@@ -3870,7 +3870,7 @@ function findSectionsLenient(lcfb, compressed) {
3870
3870
  if (!raw) break;
3871
3871
  const content = compressed ? decompressStream(raw) : raw;
3872
3872
  totalDecompressed += content.length;
3873
- if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkRWSGBXSAcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3873
+ if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkG44XLS26cjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3874
3874
  sections.push({ idx: i, content });
3875
3875
  }
3876
3876
  if (sections.length === 0) {
@@ -3882,7 +3882,7 @@ function findSectionsLenient(lcfb, compressed) {
3882
3882
  if (raw) {
3883
3883
  const content = compressed ? decompressStream(raw) : raw;
3884
3884
  totalDecompressed += content.length;
3885
- if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkRWSGBXSAcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3885
+ if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkG44XLS26cjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3886
3886
  sections.push({ idx, content });
3887
3887
  }
3888
3888
  }
@@ -3899,7 +3899,7 @@ function findViewTextSectionsLenient(lcfb, compressed) {
3899
3899
  try {
3900
3900
  const content = decryptViewText(raw, compressed);
3901
3901
  totalDecompressed += content.length;
3902
- if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkRWSGBXSAcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3902
+ if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkG44XLS26cjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
3903
3903
  sections.push({ idx: i, content });
3904
3904
  } catch (e26) {
3905
3905
  break;
@@ -4002,7 +4002,7 @@ function parseParagraph(records, start, end, ctx) {
4002
4002
  const ctrl = ctrls[r.ctrlIdx];
4003
4003
  if (!_optionalChain([ctrl, 'optionalAccess', _66 => _66.href]) || r.end <= r.start) continue;
4004
4004
  if (applied.some(([s, e]) => r.start < e && r.end > s)) continue;
4005
- const href = _chunkRWSGBXSAcjs.sanitizeHref.call(void 0, ctrl.href);
4005
+ const href = _chunkG44XLS26cjs.sanitizeHref.call(void 0, ctrl.href);
4006
4006
  if (!href) continue;
4007
4007
  const anchor = text.slice(r.start, r.end);
4008
4008
  if (!anchor.trim()) continue;
@@ -4235,8 +4235,8 @@ function parseTableControl(ctrl, records, ctx) {
4235
4235
  let tableIdx = -1;
4236
4236
  for (let i2 = childStart; i2 < childEnd; i2++) {
4237
4237
  if (records[i2].tagId === TAG_TABLE && records[i2].data.length >= 8) {
4238
- rows = Math.min(records[i2].data.readUInt16LE(4), _chunkRWSGBXSAcjs.MAX_ROWS);
4239
- cols = Math.min(records[i2].data.readUInt16LE(6), _chunkRWSGBXSAcjs.MAX_COLS);
4238
+ rows = Math.min(records[i2].data.readUInt16LE(4), _chunkG44XLS26cjs.MAX_ROWS);
4239
+ cols = Math.min(records[i2].data.readUInt16LE(6), _chunkG44XLS26cjs.MAX_COLS);
4240
4240
  tableIdx = i2;
4241
4241
  break;
4242
4242
  }
@@ -4285,7 +4285,7 @@ function parseTableControl(ctrl, records, ctx) {
4285
4285
  return table2;
4286
4286
  }
4287
4287
  const cellRows = arrangeCells(rows, cols, cells);
4288
- const table = _chunkRWSGBXSAcjs.buildTable.call(void 0, cellRows);
4288
+ const table = _chunkG44XLS26cjs.buildTable.call(void 0, cellRows);
4289
4289
  if (caption && table.rows > 0) table.caption = caption;
4290
4290
  return table.rows > 0 ? table : null;
4291
4291
  }
@@ -4302,8 +4302,8 @@ function parseCell(records, lhIdx, end, ctx) {
4302
4302
  rowAddr = rec.data.readUInt16LE(10);
4303
4303
  const cs = rec.data.readUInt16LE(12);
4304
4304
  const rs = rec.data.readUInt16LE(14);
4305
- if (cs > 0) colSpan = Math.min(cs, _chunkRWSGBXSAcjs.MAX_COLS);
4306
- if (rs > 0) rowSpan = Math.min(rs, _chunkRWSGBXSAcjs.MAX_ROWS);
4305
+ if (cs > 0) colSpan = Math.min(cs, _chunkG44XLS26cjs.MAX_COLS);
4306
+ if (rs > 0) rowSpan = Math.min(rs, _chunkG44XLS26cjs.MAX_ROWS);
4307
4307
  }
4308
4308
  const blocks = ctx.depth < MAX_NEST_DEPTH ? parseParagraphList(records, lhIdx + 1, end, { ...ctx, depth: ctx.depth + 1 }) : [];
4309
4309
  const parts = [];
@@ -4313,7 +4313,7 @@ function parseCell(records, lhIdx, end, ctx) {
4313
4313
  parts.push(`![image](hwp5bin:${b.text})`);
4314
4314
  hasStructure = true;
4315
4315
  } else if (b.type === "table" && b.table) {
4316
- const flat = _chunkRWSGBXSAcjs.convertTableToText.call(void 0, b.table.cells);
4316
+ const flat = _chunkG44XLS26cjs.convertTableToText.call(void 0, b.table.cells);
4317
4317
  if (flat) parts.push(flat);
4318
4318
  hasStructure = true;
4319
4319
  } else if (b.text) {
@@ -16747,7 +16747,7 @@ function getTextContent(el) {
16747
16747
  return _nullishCoalesce(_optionalChain([el, 'access', _79 => _79.textContent, 'optionalAccess', _80 => _80.trim, 'call', _81 => _81()]), () => ( ""));
16748
16748
  }
16749
16749
  function parseXml(text) {
16750
- return new (0, _xmldom.DOMParser)().parseFromString(_chunkRWSGBXSAcjs.stripDtd.call(void 0, text), "text/xml");
16750
+ return new (0, _xmldom.DOMParser)().parseFromString(_chunkG44XLS26cjs.stripDtd.call(void 0, text), "text/xml");
16751
16751
  }
16752
16752
  function parseSharedStrings(xml) {
16753
16753
  const doc = parseXml(xml);
@@ -16891,7 +16891,7 @@ function sheetToBlocks(sheetName, grid, merges, maxRow, maxCol, sheetIndex) {
16891
16891
  cellRows.push(row);
16892
16892
  }
16893
16893
  if (cellRows.length > 0) {
16894
- const table = _chunkRWSGBXSAcjs.buildTable.call(void 0, cellRows);
16894
+ const table = _chunkG44XLS26cjs.buildTable.call(void 0, cellRows);
16895
16895
  if (table.rows > 0) {
16896
16896
  blocks.push({ type: "table", table, pageNumber: sheetIndex + 1 });
16897
16897
  }
@@ -16899,12 +16899,12 @@ function sheetToBlocks(sheetName, grid, merges, maxRow, maxCol, sheetIndex) {
16899
16899
  return blocks;
16900
16900
  }
16901
16901
  async function parseXlsxDocument(buffer, options) {
16902
- _chunkRWSGBXSAcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE3);
16902
+ _chunkG44XLS26cjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE3);
16903
16903
  const zip = await _jszip2.default.loadAsync(buffer);
16904
16904
  const warnings = [];
16905
16905
  const workbookFile = zip.file("xl/workbook.xml");
16906
16906
  if (!workbookFile) {
16907
- throw new (0, _chunkRWSGBXSAcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 XLSX \uD30C\uC77C: xl/workbook.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
16907
+ throw new (0, _chunkG44XLS26cjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 XLSX \uD30C\uC77C: xl/workbook.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
16908
16908
  }
16909
16909
  let sharedStrings = [];
16910
16910
  const ssFile = zip.file("xl/sharedStrings.xml");
@@ -16913,7 +16913,7 @@ async function parseXlsxDocument(buffer, options) {
16913
16913
  }
16914
16914
  const sheets = parseWorkbook(await workbookFile.async("text"));
16915
16915
  if (sheets.length === 0) {
16916
- throw new (0, _chunkRWSGBXSAcjs.KordocError)("XLSX \uD30C\uC77C\uC5D0 \uC2DC\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4");
16916
+ throw new (0, _chunkG44XLS26cjs.KordocError)("XLSX \uD30C\uC77C\uC5D0 \uC2DC\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4");
16917
16917
  }
16918
16918
  let relsMap = /* @__PURE__ */ new Map();
16919
16919
  const relsFile = zip.file("xl/_rels/workbook.xml.rels");
@@ -16985,7 +16985,7 @@ async function parseXlsxDocument(buffer, options) {
16985
16985
  } catch (e27) {
16986
16986
  }
16987
16987
  }
16988
- const markdown = _chunkRWSGBXSAcjs.blocksToMarkdown.call(void 0, blocks);
16988
+ const markdown = _chunkG44XLS26cjs.blocksToMarkdown.call(void 0, blocks);
16989
16989
  return { markdown, blocks, metadata, warnings: warnings.length > 0 ? warnings : void 0 };
16990
16990
  }
16991
16991
 
@@ -17392,11 +17392,11 @@ function processGlobals(records) {
17392
17392
  let encrypted = false;
17393
17393
  const firstBof = records[0];
17394
17394
  if (!firstBof || firstBof.opcode !== OP_BOF) {
17395
- throw new (0, _chunkRWSGBXSAcjs.KordocError)("XLS: \uCCAB \uB808\uCF54\uB4DC\uAC00 BOF\uAC00 \uC544\uB2D8");
17395
+ throw new (0, _chunkG44XLS26cjs.KordocError)("XLS: \uCCAB \uB808\uCF54\uB4DC\uAC00 BOF\uAC00 \uC544\uB2D8");
17396
17396
  }
17397
17397
  const bof = decodeBof(firstBof.data);
17398
17398
  if (!bof || bof.dt !== DT_GLOBALS) {
17399
- throw new (0, _chunkRWSGBXSAcjs.KordocError)("XLS: Globals \uC11C\uBE0C\uC2A4\uD2B8\uB9BC BOF \uB204\uB77D");
17399
+ throw new (0, _chunkG44XLS26cjs.KordocError)("XLS: Globals \uC11C\uBE0C\uC2A4\uD2B8\uB9BC BOF \uB204\uB77D");
17400
17400
  }
17401
17401
  let i = 1;
17402
17402
  while (i < records.length) {
@@ -17511,7 +17511,7 @@ function sheetToBlocks2(sheetName, sheet, sheetIndex) {
17511
17511
  cellRows.push(row);
17512
17512
  }
17513
17513
  if (cellRows.length > 0) {
17514
- const table = _chunkRWSGBXSAcjs.buildTable.call(void 0, cellRows);
17514
+ const table = _chunkG44XLS26cjs.buildTable.call(void 0, cellRows);
17515
17515
  if (table.rows > 0) {
17516
17516
  blocks.push({ type: "table", table, pageNumber: sheetIndex + 1 });
17517
17517
  }
@@ -17524,21 +17524,21 @@ async function parseXlsDocument(buffer, options) {
17524
17524
  try {
17525
17525
  cfb = parseLenientCfb(buf);
17526
17526
  } catch (e) {
17527
- throw new (0, _chunkRWSGBXSAcjs.KordocError)(
17527
+ throw new (0, _chunkG44XLS26cjs.KordocError)(
17528
17528
  `XLS: OLE2 \uC2DC\uADF8\uB2C8\uCC98 \uAC80\uC99D \uC2E4\uD328 \u2014 ${e instanceof Error ? e.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`
17529
17529
  );
17530
17530
  }
17531
17531
  const wb = _nullishCoalesce(cfb.findStream("/Workbook"), () => ( cfb.findStream("/Book")));
17532
17532
  if (!wb) {
17533
- throw new (0, _chunkRWSGBXSAcjs.KordocError)("XLS: Workbook \uC2A4\uD2B8\uB9BC\uC774 \uC5C6\uC74C (BIFF5 \uB610\uB294 \uBE44\uD45C\uC900 \uD30C\uC77C)");
17533
+ throw new (0, _chunkG44XLS26cjs.KordocError)("XLS: Workbook \uC2A4\uD2B8\uB9BC\uC774 \uC5C6\uC74C (BIFF5 \uB610\uB294 \uBE44\uD45C\uC900 \uD30C\uC77C)");
17534
17534
  }
17535
17535
  const records = readRecords2(wb);
17536
17536
  if (records.length === 0) {
17537
- throw new (0, _chunkRWSGBXSAcjs.KordocError)("XLS: \uC2DC\uADF8\uB2C8\uCC98 \uB808\uCF54\uB4DC\uAC00 \uC5C6\uC74C (Workbook \uC2A4\uD2B8\uB9BC \uC190\uC0C1)");
17537
+ throw new (0, _chunkG44XLS26cjs.KordocError)("XLS: \uC2DC\uADF8\uB2C8\uCC98 \uB808\uCF54\uB4DC\uAC00 \uC5C6\uC74C (Workbook \uC2A4\uD2B8\uB9BC \uC190\uC0C1)");
17538
17538
  }
17539
17539
  const firstBof = decodeBof(records[0].data);
17540
17540
  if (firstBof && firstBof.vers !== 1536) {
17541
- throw new (0, _chunkRWSGBXSAcjs.KordocError)(
17541
+ throw new (0, _chunkG44XLS26cjs.KordocError)(
17542
17542
  `XLS: BIFF8(0x0600)\uB9CC \uC9C0\uC6D0 \u2014 \uBCF8 \uD30C\uC77C\uC740 0x${firstBof.vers.toString(16)}`
17543
17543
  );
17544
17544
  }
@@ -17598,7 +17598,7 @@ async function parseXlsDocument(buffer, options) {
17598
17598
  pageCount: totalSheets
17599
17599
  };
17600
17600
  return {
17601
- markdown: _chunkRWSGBXSAcjs.blocksToMarkdown.call(void 0, allBlocks),
17601
+ markdown: _chunkG44XLS26cjs.blocksToMarkdown.call(void 0, allBlocks),
17602
17602
  blocks: allBlocks,
17603
17603
  metadata,
17604
17604
  warnings: warnings.length > 0 ? warnings : void 0
@@ -18036,7 +18036,7 @@ function getAttr(el, localName2) {
18036
18036
  return null;
18037
18037
  }
18038
18038
  function parseXml2(text) {
18039
- return new (0, _xmldom.DOMParser)().parseFromString(_chunkRWSGBXSAcjs.stripDtd.call(void 0, text), "text/xml");
18039
+ return new (0, _xmldom.DOMParser)().parseFromString(_chunkG44XLS26cjs.stripDtd.call(void 0, text), "text/xml");
18040
18040
  }
18041
18041
  function parseStyles(xml) {
18042
18042
  const doc = parseXml2(xml);
@@ -18355,12 +18355,12 @@ async function extractImages(zip, rels, doc) {
18355
18355
  return { blocks, images };
18356
18356
  }
18357
18357
  async function parseDocxDocument(buffer, options) {
18358
- _chunkRWSGBXSAcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE4);
18358
+ _chunkG44XLS26cjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE4);
18359
18359
  const zip = await _jszip2.default.loadAsync(buffer);
18360
18360
  const warnings = [];
18361
18361
  const docFile = zip.file("word/document.xml");
18362
18362
  if (!docFile) {
18363
- throw new (0, _chunkRWSGBXSAcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 DOCX \uD30C\uC77C: word/document.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
18363
+ throw new (0, _chunkG44XLS26cjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 DOCX \uD30C\uC77C: word/document.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
18364
18364
  }
18365
18365
  let rels = /* @__PURE__ */ new Map();
18366
18366
  const relsFile = zip.file("word/_rels/document.xml.rels");
@@ -18395,7 +18395,7 @@ async function parseDocxDocument(buffer, options) {
18395
18395
  const doc = parseXml2(docXml);
18396
18396
  const body = findElements(doc, "body");
18397
18397
  if (body.length === 0) {
18398
- throw new (0, _chunkRWSGBXSAcjs.KordocError)("DOCX \uBCF8\uBB38(w:body)\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
18398
+ throw new (0, _chunkG44XLS26cjs.KordocError)("DOCX \uBCF8\uBB38(w:body)\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
18399
18399
  }
18400
18400
  const blocks = [];
18401
18401
  const bodyEl = body[0];
@@ -18432,7 +18432,7 @@ async function parseDocxDocument(buffer, options) {
18432
18432
  }
18433
18433
  }
18434
18434
  const outline = blocks.filter((b) => b.type === "heading").map((b) => ({ level: _nullishCoalesce(b.level, () => ( 2)), text: _nullishCoalesce(b.text, () => ( "")) }));
18435
- const markdown = _chunkRWSGBXSAcjs.blocksToMarkdown.call(void 0, blocks);
18435
+ const markdown = _chunkG44XLS26cjs.blocksToMarkdown.call(void 0, blocks);
18436
18436
  return {
18437
18437
  markdown,
18438
18438
  blocks,
@@ -18455,7 +18455,7 @@ function parseHwpmlDocument(buffer, options) {
18455
18455
  }
18456
18456
  const text = new TextDecoder("utf-8").decode(buffer).replace(/^\uFEFF/, "");
18457
18457
  const normalized = text.replace(/&nbsp;/g, "&#160;");
18458
- const xml = _chunkRWSGBXSAcjs.stripDtd.call(void 0, normalized);
18458
+ const xml = _chunkG44XLS26cjs.stripDtd.call(void 0, normalized);
18459
18459
  const warnings = [];
18460
18460
  const parser = new (0, _xmldom.DOMParser)({
18461
18461
  onError: (_level, msg2) => {
@@ -18495,7 +18495,7 @@ function parseHwpmlDocument(buffer, options) {
18495
18495
  parseSection2(el, blocks, paraShapeMap, sectionIdx, warnings);
18496
18496
  }
18497
18497
  const outline = blocks.filter((b) => b.type === "heading" && b.text).map((b) => ({ level: _nullishCoalesce(b.level, () => ( 1)), text: b.text, pageNumber: b.pageNumber }));
18498
- const markdown = _chunkRWSGBXSAcjs.blocksToMarkdown.call(void 0, blocks);
18498
+ const markdown = _chunkG44XLS26cjs.blocksToMarkdown.call(void 0, blocks);
18499
18499
  return {
18500
18500
  markdown,
18501
18501
  blocks,
@@ -18637,7 +18637,7 @@ function parseTable2(el, blocks, paraShapeMap, sectionNum, warnings) {
18637
18637
  const cellRows = grid.map(
18638
18638
  (row) => row.map((cell) => _nullishCoalesce(cell, () => ( { text: "", colSpan: 1, rowSpan: 1 })))
18639
18639
  );
18640
- const table = _chunkRWSGBXSAcjs.buildTable.call(void 0, cellRows);
18640
+ const table = _chunkG44XLS26cjs.buildTable.call(void 0, cellRows);
18641
18641
  blocks.push({ type: "table", table, pageNumber: sectionNum });
18642
18642
  }
18643
18643
  function extractCellText(cellEl) {
@@ -19664,19 +19664,19 @@ function parseCentralDirectory(buf) {
19664
19664
  }
19665
19665
  }
19666
19666
  }
19667
- if (eocdOffset < 0) throw new (0, _chunkRWSGBXSAcjs.KordocError)("ZIP EOCD\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
19667
+ if (eocdOffset < 0) throw new (0, _chunkG44XLS26cjs.KordocError)("ZIP EOCD\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
19668
19668
  const totalEntries = view.getUint16(eocdOffset + 10, true);
19669
19669
  const cdSize = view.getUint32(eocdOffset + 12, true);
19670
19670
  const cdOffset = view.getUint32(eocdOffset + 16, true);
19671
- if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0, _chunkRWSGBXSAcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
19671
+ if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0, _chunkG44XLS26cjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
19672
19672
  if (eocdOffset >= 20 && view.getUint32(eocdOffset - 20, true) === ZIP64_EOCD_LOC_SIG) {
19673
- throw new (0, _chunkRWSGBXSAcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
19673
+ throw new (0, _chunkG44XLS26cjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
19674
19674
  }
19675
19675
  const decoder = new TextDecoder("utf-8");
19676
19676
  const entries = [];
19677
19677
  let pos = cdOffset;
19678
19678
  for (let i = 0; i < totalEntries; i++) {
19679
- if (view.getUint32(pos, true) !== CD_SIG) throw new (0, _chunkRWSGBXSAcjs.KordocError)("ZIP Central Directory \uC190\uC0C1");
19679
+ if (view.getUint32(pos, true) !== CD_SIG) throw new (0, _chunkG44XLS26cjs.KordocError)("ZIP Central Directory \uC190\uC0C1");
19680
19680
  const flags = view.getUint16(pos + 8, true);
19681
19681
  const method = view.getUint16(pos + 10, true);
19682
19682
  const crc = view.getUint32(pos + 16, true);
@@ -19687,7 +19687,7 @@ function parseCentralDirectory(buf) {
19687
19687
  const commentLen = view.getUint16(pos + 32, true);
19688
19688
  const localOffset = view.getUint32(pos + 42, true);
19689
19689
  if (compSize === 4294967295 || uncompSize === 4294967295 || localOffset === 4294967295) {
19690
- throw new (0, _chunkRWSGBXSAcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
19690
+ throw new (0, _chunkG44XLS26cjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
19691
19691
  }
19692
19692
  const name = decoder.decode(buf.subarray(pos + 46, pos + 46 + nameLen));
19693
19693
  const cdEnd = pos + 46 + nameLen + extraLen + commentLen;
@@ -19716,7 +19716,7 @@ function patchZipEntries(original, replacements) {
19716
19716
  const { entries, cdOffset, eocdOffset } = parseCentralDirectory(original);
19717
19717
  const view = new DataView(original.buffer, original.byteOffset, original.byteLength);
19718
19718
  for (const name of replacements.keys()) {
19719
- if (!entries.some((e) => e.name === name)) throw new (0, _chunkRWSGBXSAcjs.KordocError)(`ZIP\uC5D0 \uC5C6\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
19719
+ if (!entries.some((e) => e.name === name)) throw new (0, _chunkG44XLS26cjs.KordocError)(`ZIP\uC5D0 \uC5C6\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
19720
19720
  }
19721
19721
  const byLocal = [...entries].sort((a, b) => a.localOffset - b.localOffset);
19722
19722
  const segments = [];
@@ -19734,7 +19734,7 @@ function patchZipEntries(original, replacements) {
19734
19734
  offset += seg.length;
19735
19735
  continue;
19736
19736
  }
19737
- if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0, _chunkRWSGBXSAcjs.KordocError)("ZIP \uB85C\uCEEC \uD5E4\uB354 \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
19737
+ if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0, _chunkG44XLS26cjs.KordocError)("ZIP \uB85C\uCEEC \uD5E4\uB354 \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
19738
19738
  const nameLen = view.getUint16(e.localOffset + 26, true);
19739
19739
  const extraLen = view.getUint16(e.localOffset + 28, true);
19740
19740
  const headerLen = 30 + nameLen + extraLen;
@@ -19789,7 +19789,7 @@ async function fillHwpx(hwpxBuffer, values) {
19789
19789
  const zip = await _jszip2.default.loadAsync(hwpxBuffer);
19790
19790
  const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort();
19791
19791
  if (sectionPaths.length === 0) {
19792
- throw new (0, _chunkRWSGBXSAcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
19792
+ throw new (0, _chunkG44XLS26cjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
19793
19793
  }
19794
19794
  const normalizedValues = normalizeValues(values);
19795
19795
  const matchedLabels = /* @__PURE__ */ new Set();
@@ -20456,7 +20456,8 @@ ${base2.join("\n")}
20456
20456
  ];
20457
20457
  for (let d = 0; d < GONGMUN_LIST_LEVELS; d++) {
20458
20458
  const { left, indent } = levelIndent(d, gongmun.bodyHeight, gongmun.numbering);
20459
- base.push(paraPr(GONGMUN_LIST_BASE + d, { align: "JUSTIFY", lineSpacing: ls, left, indent }));
20459
+ const sectionGap = gongmun.numbering === "report" && d === 0 ? Math.round(gongmun.bodyHeight * 0.5) : 0;
20460
+ base.push(paraPr(GONGMUN_LIST_BASE + d, { align: "JUSTIFY", lineSpacing: ls, left, indent, spaceBefore: sectionGap }));
20460
20461
  }
20461
20462
  base.push(paraPr(GONGMUN_CENTER, { align: "CENTER", lineSpacing: ls }));
20462
20463
  return `<hh:paraProperties itemCnt="${base.length}">
@@ -20667,7 +20668,8 @@ function blocksToSectionXml(blocks, theme, gongmun) {
20667
20668
  const marker2 = _nullishCoalesce(_optionalChain([info, 'optionalAccess', _171 => _171.marker]), () => ( ""));
20668
20669
  const content = block.text || "";
20669
20670
  const text = marker2 ? `${marker2} ${content}` : content;
20670
- xml = generateParagraph(text, GONGMUN_LIST_BASE + depth);
20671
+ const listCharPr = gongmun.numbering === "report" && depth === 0 ? CHAR_BOLD : CHAR_NORMAL;
20672
+ xml = generateParagraph(text, GONGMUN_LIST_BASE + depth, listCharPr);
20671
20673
  break;
20672
20674
  }
20673
20675
  const indent = block.indent || 0;
@@ -20961,7 +20963,7 @@ function escapeGfm(text) {
20961
20963
  }
20962
20964
  var HWP_SHAPE_ALT_TEXT_RE = /(?:모서리가 둥근 |둥근 )?(?:사각형|직사각형|정사각형|원|타원|삼각형|이등변 삼각형|직각 삼각형|선|직선|곡선|화살표|굵은 화살표|이중 화살표|오각형|육각형|팔각형|별|[4-8]점별|십자|십자형|구름|구름형|마름모|도넛|평행사변형|사다리꼴|부채꼴|호|반원|물결|번개|하트|빗금|블록 화살표|수식|표|그림|개체|그리기\s?개체|묶음\s?개체|글상자|수식\s?개체|OLE\s?개체)\s?입니다\.?/g;
20963
20965
  function sanitizeText(text) {
20964
- let result = _chunkRWSGBXSAcjs.mapPuaText.call(void 0, text).replace(/[\u{F0000}-\u{FFFFD}]/gu, "").replace(HWP_SHAPE_ALT_TEXT_RE, "").replace(/ +/g, " ").trim();
20966
+ let result = _chunkG44XLS26cjs.mapPuaText.call(void 0, text).replace(/[\u{F0000}-\u{FFFFD}]/gu, "").replace(HWP_SHAPE_ALT_TEXT_RE, "").replace(/ +/g, " ").trim();
20965
20967
  if (result.length <= 30 && result.includes(" ")) {
20966
20968
  const tokens = result.split(" ");
20967
20969
  const koreanSingleCharCount = tokens.filter((t) => t.length === 1 && /[가-힯ㄱ-ㆎ]/.test(t)).length;
@@ -21488,7 +21490,7 @@ async function resolveSectionEntryNames(zip) {
21488
21490
  const paths = sectionPathsFromManifest(xml).filter((p) => zip.file(p) !== null);
21489
21491
  if (paths.length > 0) return paths;
21490
21492
  }
21491
- return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort(_chunkRWSGBXSAcjs.compareSectionPaths);
21493
+ return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort(_chunkG44XLS26cjs.compareSectionPaths);
21492
21494
  }
21493
21495
  function sectionPathsFromManifest(xml) {
21494
21496
  const attr = (tag, name) => {
@@ -21498,7 +21500,7 @@ function sectionPathsFromManifest(xml) {
21498
21500
  const idToHref = /* @__PURE__ */ new Map();
21499
21501
  for (const m of xml.matchAll(/<opf:item(\s(?:"[^"]*"|'[^']*'|[^>"'])*?)\/?>/g)) {
21500
21502
  const id = attr(m[1], "id");
21501
- const href = _chunkRWSGBXSAcjs.normalizeSectionHref.call(void 0, attr(m[1], "href"));
21503
+ const href = _chunkG44XLS26cjs.normalizeSectionHref.call(void 0, attr(m[1], "href"));
21502
21504
  if (id && href) idToHref.set(id, href);
21503
21505
  }
21504
21506
  const ordered = [];
@@ -21507,7 +21509,7 @@ function sectionPathsFromManifest(xml) {
21507
21509
  if (href) ordered.push(href);
21508
21510
  }
21509
21511
  if (ordered.length > 0) return ordered;
21510
- return Array.from(idToHref.values()).sort(_chunkRWSGBXSAcjs.compareSectionPaths);
21512
+ return Array.from(idToHref.values()).sort(_chunkG44XLS26cjs.compareSectionPaths);
21511
21513
  }
21512
21514
 
21513
21515
  // src/roundtrip/patcher.ts
@@ -21617,9 +21619,9 @@ function buildOrigUnits(blocks) {
21617
21619
  if (block.type === "paragraph" && block.text && /^\[별표\s*\d+/.test(sanitizeText(block.text))) {
21618
21620
  const next = blocks[i + 1];
21619
21621
  if (_optionalChain([next, 'optionalAccess', _198 => _198.type]) === "paragraph" && next.text && /관련\)?$/.test(next.text)) consume = 2;
21620
- chunk = _chunkRWSGBXSAcjs.blocksToMarkdown.call(void 0, blocks.slice(i, i + consume));
21622
+ chunk = _chunkG44XLS26cjs.blocksToMarkdown.call(void 0, blocks.slice(i, i + consume));
21621
21623
  } else {
21622
- chunk = _chunkRWSGBXSAcjs.blocksToMarkdown.call(void 0, [block]);
21624
+ chunk = _chunkG44XLS26cjs.blocksToMarkdown.call(void 0, [block]);
21623
21625
  }
21624
21626
  if (chunk) {
21625
21627
  const subUnits = splitMarkdownUnits(chunk);
@@ -23360,13 +23362,13 @@ async function htmlToPdf(html, options) {
23360
23362
  try {
23361
23363
  puppeteer = await Promise.resolve().then(() => _interopRequireWildcard(require("puppeteer-core")));
23362
23364
  } catch (e35) {
23363
- throw new (0, _chunkRWSGBXSAcjs.KordocError)(
23365
+ throw new (0, _chunkG44XLS26cjs.KordocError)(
23364
23366
  "PDF \uC0DD\uC131\uC5D0 puppeteer-core\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. \uC124\uCE58: npm install puppeteer-core"
23365
23367
  );
23366
23368
  }
23367
23369
  const executablePath = _nullishCoalesce(process.env.PUPPETEER_EXECUTABLE_PATH, () => ( findChromiumPath()));
23368
23370
  if (!executablePath) {
23369
- throw new (0, _chunkRWSGBXSAcjs.KordocError)(
23371
+ throw new (0, _chunkG44XLS26cjs.KordocError)(
23370
23372
  "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."
23371
23373
  );
23372
23374
  }
@@ -23425,7 +23427,7 @@ async function markdownToPdf(markdown, options) {
23425
23427
  return htmlToPdf(html, options);
23426
23428
  }
23427
23429
  async function blocksToPdf(blocks, options) {
23428
- const markdown = _chunkRWSGBXSAcjs.blocksToMarkdown.call(void 0, blocks);
23430
+ const markdown = _chunkG44XLS26cjs.blocksToMarkdown.call(void 0, blocks);
23429
23431
  return markdownToPdf(markdown, options);
23430
23432
  }
23431
23433
 
@@ -23436,13 +23438,13 @@ async function parse(input, options) {
23436
23438
  if (typeof input === "string") {
23437
23439
  try {
23438
23440
  const buf = await _promises.readFile.call(void 0, input);
23439
- buffer = _chunkRWSGBXSAcjs.toArrayBuffer.call(void 0, buf);
23441
+ buffer = _chunkG44XLS26cjs.toArrayBuffer.call(void 0, buf);
23440
23442
  } catch (err) {
23441
23443
  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}`;
23442
23444
  return { success: false, fileType: "unknown", error: msg2, code: "PARSE_ERROR" };
23443
23445
  }
23444
23446
  } else if (Buffer.isBuffer(input)) {
23445
- buffer = _chunkRWSGBXSAcjs.toArrayBuffer.call(void 0, input);
23447
+ buffer = _chunkG44XLS26cjs.toArrayBuffer.call(void 0, input);
23446
23448
  } else {
23447
23449
  buffer = input;
23448
23450
  }
@@ -23477,7 +23479,7 @@ async function parseHwp3(buffer, options) {
23477
23479
  const { markdown, blocks, metadata, outline, warnings } = parseHwp3Document(buffer, options);
23478
23480
  return { success: true, fileType: "hwp3", markdown, blocks, metadata, outline, warnings };
23479
23481
  } catch (err) {
23480
- return { success: false, fileType: "hwp3", error: err instanceof Error ? err.message : "HWP3 \uD30C\uC2F1 \uC2E4\uD328", code: _chunkRWSGBXSAcjs.classifyError.call(void 0, err) };
23482
+ return { success: false, fileType: "hwp3", error: err instanceof Error ? err.message : "HWP3 \uD30C\uC2F1 \uC2E4\uD328", code: _chunkG44XLS26cjs.classifyError.call(void 0, err) };
23481
23483
  }
23482
23484
  }
23483
23485
  async function parseHwpx(buffer, options) {
@@ -23485,7 +23487,7 @@ async function parseHwpx(buffer, options) {
23485
23487
  const { markdown, blocks, metadata, outline, warnings, images } = await parseHwpxDocument(buffer, options);
23486
23488
  return { success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _256 => _256.length]) ? images : void 0 };
23487
23489
  } catch (err) {
23488
- return { success: false, fileType: "hwpx", error: err instanceof Error ? err.message : "HWPX \uD30C\uC2F1 \uC2E4\uD328", code: _chunkRWSGBXSAcjs.classifyError.call(void 0, err) };
23490
+ return { success: false, fileType: "hwpx", error: err instanceof Error ? err.message : "HWPX \uD30C\uC2F1 \uC2E4\uD328", code: _chunkG44XLS26cjs.classifyError.call(void 0, err) };
23489
23491
  }
23490
23492
  }
23491
23493
  async function parseHwp(buffer, options) {
@@ -23510,13 +23512,13 @@ async function parseHwp(buffer, options) {
23510
23512
  }
23511
23513
  return { success: true, fileType: "hwp", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _258 => _258.length]) ? images : void 0 };
23512
23514
  } catch (err) {
23513
- return { success: false, fileType: "hwp", error: err instanceof Error ? err.message : "HWP \uD30C\uC2F1 \uC2E4\uD328", code: _chunkRWSGBXSAcjs.classifyError.call(void 0, err) };
23515
+ return { success: false, fileType: "hwp", error: err instanceof Error ? err.message : "HWP \uD30C\uC2F1 \uC2E4\uD328", code: _chunkG44XLS26cjs.classifyError.call(void 0, err) };
23514
23516
  }
23515
23517
  }
23516
23518
  async function parsePdf(buffer, options) {
23517
23519
  let parsePdfDocument;
23518
23520
  try {
23519
- const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-ZLFOUVR4.cjs")));
23521
+ const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-2O276TRF.cjs")));
23520
23522
  parsePdfDocument = mod.parsePdfDocument;
23521
23523
  } catch (e37) {
23522
23524
  return {
@@ -23531,7 +23533,7 @@ async function parsePdf(buffer, options) {
23531
23533
  return { success: true, fileType: "pdf", markdown, blocks, metadata, outline, warnings, isImageBased, pageQuality, qualitySummary };
23532
23534
  } catch (err) {
23533
23535
  const isImageBased = err instanceof Error && "isImageBased" in err ? true : void 0;
23534
- return { success: false, fileType: "pdf", error: err instanceof Error ? err.message : "PDF \uD30C\uC2F1 \uC2E4\uD328", code: _chunkRWSGBXSAcjs.classifyError.call(void 0, err), isImageBased };
23536
+ return { success: false, fileType: "pdf", error: err instanceof Error ? err.message : "PDF \uD30C\uC2F1 \uC2E4\uD328", code: _chunkG44XLS26cjs.classifyError.call(void 0, err), isImageBased };
23535
23537
  }
23536
23538
  }
23537
23539
  async function parseXlsx(buffer, options) {
@@ -23539,7 +23541,7 @@ async function parseXlsx(buffer, options) {
23539
23541
  const { markdown, blocks, metadata, warnings } = await parseXlsxDocument(buffer, options);
23540
23542
  return { success: true, fileType: "xlsx", markdown, blocks, metadata, warnings };
23541
23543
  } catch (err) {
23542
- return { success: false, fileType: "xlsx", error: err instanceof Error ? err.message : "XLSX \uD30C\uC2F1 \uC2E4\uD328", code: _chunkRWSGBXSAcjs.classifyError.call(void 0, err) };
23544
+ return { success: false, fileType: "xlsx", error: err instanceof Error ? err.message : "XLSX \uD30C\uC2F1 \uC2E4\uD328", code: _chunkG44XLS26cjs.classifyError.call(void 0, err) };
23543
23545
  }
23544
23546
  }
23545
23547
  async function parseXls(buffer, options) {
@@ -23547,7 +23549,7 @@ async function parseXls(buffer, options) {
23547
23549
  const { markdown, blocks, metadata, warnings } = await parseXlsDocument(buffer, options);
23548
23550
  return { success: true, fileType: "xls", markdown, blocks, metadata, warnings };
23549
23551
  } catch (err) {
23550
- return { success: false, fileType: "xls", error: err instanceof Error ? err.message : "XLS \uD30C\uC2F1 \uC2E4\uD328", code: _chunkRWSGBXSAcjs.classifyError.call(void 0, err) };
23552
+ return { success: false, fileType: "xls", error: err instanceof Error ? err.message : "XLS \uD30C\uC2F1 \uC2E4\uD328", code: _chunkG44XLS26cjs.classifyError.call(void 0, err) };
23551
23553
  }
23552
23554
  }
23553
23555
  async function parseDocx(buffer, options) {
@@ -23555,7 +23557,7 @@ async function parseDocx(buffer, options) {
23555
23557
  const { markdown, blocks, metadata, outline, warnings, images } = await parseDocxDocument(buffer, options);
23556
23558
  return { success: true, fileType: "docx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _259 => _259.length]) ? images : void 0 };
23557
23559
  } catch (err) {
23558
- return { success: false, fileType: "docx", error: err instanceof Error ? err.message : "DOCX \uD30C\uC2F1 \uC2E4\uD328", code: _chunkRWSGBXSAcjs.classifyError.call(void 0, err) };
23560
+ return { success: false, fileType: "docx", error: err instanceof Error ? err.message : "DOCX \uD30C\uC2F1 \uC2E4\uD328", code: _chunkG44XLS26cjs.classifyError.call(void 0, err) };
23559
23561
  }
23560
23562
  }
23561
23563
  async function parseHwpml(buffer, options) {
@@ -23563,16 +23565,16 @@ async function parseHwpml(buffer, options) {
23563
23565
  const { markdown, blocks, metadata, outline, warnings } = parseHwpmlDocument(buffer, options);
23564
23566
  return { success: true, fileType: "hwpml", markdown, blocks, metadata, outline, warnings };
23565
23567
  } catch (err) {
23566
- return { success: false, fileType: "hwpml", error: err instanceof Error ? err.message : "HWPML \uD30C\uC2F1 \uC2E4\uD328", code: _chunkRWSGBXSAcjs.classifyError.call(void 0, err) };
23568
+ return { success: false, fileType: "hwpml", error: err instanceof Error ? err.message : "HWPML \uD30C\uC2F1 \uC2E4\uD328", code: _chunkG44XLS26cjs.classifyError.call(void 0, err) };
23567
23569
  }
23568
23570
  }
23569
23571
  async function fillForm(input, values, outputFormat = "markdown") {
23570
23572
  let buffer;
23571
23573
  if (typeof input === "string") {
23572
23574
  const buf = await _promises.readFile.call(void 0, input);
23573
- buffer = _chunkRWSGBXSAcjs.toArrayBuffer.call(void 0, buf);
23575
+ buffer = _chunkG44XLS26cjs.toArrayBuffer.call(void 0, buf);
23574
23576
  } else if (Buffer.isBuffer(input)) {
23575
- buffer = _chunkRWSGBXSAcjs.toArrayBuffer.call(void 0, input);
23577
+ buffer = _chunkG44XLS26cjs.toArrayBuffer.call(void 0, input);
23576
23578
  } else {
23577
23579
  buffer = input;
23578
23580
  }
@@ -23598,7 +23600,7 @@ async function fillForm(input, values, outputFormat = "markdown") {
23598
23600
  throw new Error(`\uC11C\uC2DD \uD30C\uC2F1 \uC2E4\uD328: ${parsed.error}`);
23599
23601
  }
23600
23602
  const fill = fillFormFields(parsed.blocks, values);
23601
- const markdown = _chunkRWSGBXSAcjs.blocksToMarkdown.call(void 0, fill.blocks);
23603
+ const markdown = _chunkG44XLS26cjs.blocksToMarkdown.call(void 0, fill.blocks);
23602
23604
  if (outputFormat === "hwpx") {
23603
23605
  const hwpxBuffer = await markdownToHwpx(markdown);
23604
23606
  return { output: hwpxBuffer, format: "hwpx", fill };
@@ -23648,5 +23650,5 @@ async function fillForm(input, values, outputFormat = "markdown") {
23648
23650
 
23649
23651
 
23650
23652
 
23651
- exports.HwpxSession = HwpxSession; exports.PRESET_ALIAS = PRESET_ALIAS; exports.VERSION = _chunkRWSGBXSAcjs.VERSION; exports.applySplices = applySplices; exports.blocksToMarkdown = _chunkRWSGBXSAcjs.blocksToMarkdown; exports.blocksToPdf = blocksToPdf; exports.buildParagraphSplices = buildParagraphSplices; exports.buildRangeSplices = buildRangeSplices; exports.compare = compare; exports.detectFormat = detectFormat; exports.detectOle2Format = detectOle2Format; exports.detectZipFormat = detectZipFormat; exports.diffBlocks = diffBlocks; exports.extractFormFields = extractFormFields; exports.extractFormSchema = extractFormSchema; exports.fillForm = fillForm; exports.fillFormFields = fillFormFields; exports.fillHwpx = fillHwpx; exports.inferFieldType = inferFieldType; exports.isHwpxFile = isHwpxFile; exports.isLabelCell = isLabelCell; exports.isOldHwpFile = isOldHwpFile; exports.isPdfFile = isPdfFile; exports.isZipFile = isZipFile; exports.markdownToHwpx = markdownToHwpx; exports.markdownToPdf = markdownToPdf; 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.parsePdf = parsePdf; exports.parseXls = parseXls; exports.parseXlsx = parseXlsx; exports.patchHwp = patchHwp; exports.patchHwpx = patchHwpx; exports.patchHwpxBlocks = patchHwpxBlocks; exports.renderHtml = renderHtml; exports.scanSectionXml = scanSectionXml;
23653
+ exports.HwpxSession = HwpxSession; exports.PRESET_ALIAS = PRESET_ALIAS; exports.VERSION = _chunkG44XLS26cjs.VERSION; exports.applySplices = applySplices; exports.blocksToMarkdown = _chunkG44XLS26cjs.blocksToMarkdown; exports.blocksToPdf = blocksToPdf; exports.buildParagraphSplices = buildParagraphSplices; exports.buildRangeSplices = buildRangeSplices; exports.compare = compare; exports.detectFormat = detectFormat; exports.detectOle2Format = detectOle2Format; exports.detectZipFormat = detectZipFormat; exports.diffBlocks = diffBlocks; exports.extractFormFields = extractFormFields; exports.extractFormSchema = extractFormSchema; exports.fillForm = fillForm; exports.fillFormFields = fillFormFields; exports.fillHwpx = fillHwpx; exports.inferFieldType = inferFieldType; exports.isHwpxFile = isHwpxFile; exports.isLabelCell = isLabelCell; exports.isOldHwpFile = isOldHwpFile; exports.isPdfFile = isPdfFile; exports.isZipFile = isZipFile; exports.markdownToHwpx = markdownToHwpx; exports.markdownToPdf = markdownToPdf; 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.parsePdf = parsePdf; exports.parseXls = parseXls; exports.parseXlsx = parseXlsx; exports.patchHwp = patchHwp; exports.patchHwpx = patchHwpx; exports.patchHwpxBlocks = patchHwpxBlocks; exports.renderHtml = renderHtml; exports.scanSectionXml = scanSectionXml;
23652
23654
  //# sourceMappingURL=index.cjs.map