kordoc 4.22.2 → 4.22.3

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.
Files changed (127) hide show
  1. package/README.md +10 -6
  2. package/dist/{-C437ZARA.js → -AOWV7MNY.js} +11 -11
  3. package/dist/{chunk-UMNKY2EZ.js → chunk-24YLYR6Q.js} +4 -4
  4. package/dist/{chunk-EKKZNKJD.cjs → chunk-2BCQVQO2.cjs} +3 -3
  5. package/dist/{chunk-EKKZNKJD.cjs.map → chunk-2BCQVQO2.cjs.map} +1 -1
  6. package/dist/{chunk-GFQIKYBV.js → chunk-3ANXRVI2.js} +3 -3
  7. package/dist/{chunk-CNMUT5YW.js → chunk-3H2IEU4V.js} +2 -2
  8. package/dist/{chunk-GVBQVXXB.js → chunk-4NQ4EZEE.js} +14 -4
  9. package/dist/chunk-4NQ4EZEE.js.map +1 -0
  10. package/dist/{chunk-56GBOIOE.js → chunk-6LIBF2ZB.js} +2 -2
  11. package/dist/{chunk-2X64TI7I.js → chunk-6QBBGZST.js} +2 -2
  12. package/dist/{chunk-FPUBEM3F.js → chunk-7XITVUAK.js} +11 -11
  13. package/dist/{chunk-S4KQUVBV.js → chunk-AXX5AQT4.js} +4 -4
  14. package/dist/{chunk-U3TZVR7A.js → chunk-BS2XWGT5.js} +2 -2
  15. package/dist/{chunk-4BJZGXNM.js → chunk-DKJ2RNDG.js} +2 -2
  16. package/dist/{chunk-IRP6QS3K.js → chunk-FDFXL7VJ.js} +3 -3
  17. package/dist/{chunk-YOFKJ7IM.js → chunk-IRNWAHHZ.js} +2 -2
  18. package/dist/{chunk-QFJCEHY7.js → chunk-J5PYESLX.js} +14 -4
  19. package/dist/chunk-J5PYESLX.js.map +1 -0
  20. package/dist/{chunk-AXR7OKQY.js → chunk-KBGNPGVY.js} +2 -2
  21. package/dist/{chunk-UV2G6XFA.js → chunk-M2X766AY.js} +2 -2
  22. package/dist/{chunk-YTEMFVZB.js → chunk-MEIQ476H.js} +2 -2
  23. package/dist/{chunk-AUWO57ED.cjs → chunk-MI655NV5.cjs} +2 -2
  24. package/dist/{chunk-AUWO57ED.cjs.map → chunk-MI655NV5.cjs.map} +1 -1
  25. package/dist/{chunk-ENV25MPM.cjs → chunk-NJEMRAIF.cjs} +24 -24
  26. package/dist/{chunk-ENV25MPM.cjs.map → chunk-NJEMRAIF.cjs.map} +1 -1
  27. package/dist/{chunk-I4BS4BXE.cjs → chunk-NLGOMLGU.cjs} +23 -23
  28. package/dist/{chunk-I4BS4BXE.cjs.map → chunk-NLGOMLGU.cjs.map} +1 -1
  29. package/dist/{chunk-ZLFUZM7H.cjs → chunk-O3OS6FAW.cjs} +3 -3
  30. package/dist/{chunk-ZLFUZM7H.cjs.map → chunk-O3OS6FAW.cjs.map} +1 -1
  31. package/dist/{chunk-4GCS7WJJ.js → chunk-O5E25RHU.js} +2 -2
  32. package/dist/{chunk-NGDMJICC.js → chunk-OIF5HRVP.js} +4 -4
  33. package/dist/{chunk-MED2MR6O.cjs → chunk-SJ5OZXEL.cjs} +23 -13
  34. package/dist/chunk-SJ5OZXEL.cjs.map +1 -0
  35. package/dist/{chunk-3LJ6QO53.js → chunk-SKRWKVVW.js} +3 -3
  36. package/dist/{chunk-VUC4JJUM.js → chunk-UCLDUUBX.js} +2 -2
  37. package/dist/{chunk-L6PFPBTK.js → chunk-VJCQOSMT.js} +2 -2
  38. package/dist/{chunk-DQXP3ELP.js → chunk-X45Q7EAC.js} +2 -2
  39. package/dist/{chunk-L6N4OMKR.js → chunk-YOGMCRM7.js} +54 -7
  40. package/dist/chunk-YOGMCRM7.js.map +1 -0
  41. package/dist/chunks-7KXTS7IV.js +10 -0
  42. package/dist/cli.js +30 -30
  43. package/dist/{formula-3TVRNJ66.cjs → formula-5V2WG4BH.cjs} +9 -9
  44. package/dist/{formula-3TVRNJ66.cjs.map → formula-5V2WG4BH.cjs.map} +1 -1
  45. package/dist/{formula-HUENRCPJ.js → formula-C26FMMGO.js} +3 -3
  46. package/dist/{formula-43QBPAL5.js → formula-W4OL33YQ.js} +4 -4
  47. package/dist/{image-ocr-OC3TCXMV.cjs → image-ocr-BELHEWPX.cjs} +17 -17
  48. package/dist/{image-ocr-OC3TCXMV.cjs.map → image-ocr-BELHEWPX.cjs.map} +1 -1
  49. package/dist/{image-ocr-HYAKWJGE.js → image-ocr-NSQ34Y6T.js} +9 -9
  50. package/dist/{image-ocr-BAHDLDV5.js → image-ocr-T72HMX2W.js} +6 -6
  51. package/dist/index.cjs +453 -406
  52. package/dist/index.cjs.map +1 -1
  53. package/dist/index.js +54 -7
  54. package/dist/index.js.map +1 -1
  55. package/dist/mcp.js +22 -22
  56. package/dist/{model-bundle-23WBSECG.js → model-bundle-34T2LJB4.js} +5 -5
  57. package/dist/{models-NRZQY45P.js → models-TQH5EM6V.js} +5 -5
  58. package/dist/{parse-worker-v2-DPNXGJ73.js → parse-worker-v2-YEYLILGJ.js} +12 -12
  59. package/dist/{parser-XNOLC3MZ.js → parser-E6BG3ECD.js} +72 -12
  60. package/dist/parser-E6BG3ECD.js.map +1 -0
  61. package/dist/{parser-OKAQRZKM.cjs → parser-OAXCXVQ4.cjs} +327 -267
  62. package/dist/parser-OAXCXVQ4.cjs.map +1 -0
  63. package/dist/{parser-FNUQW2F3.js → parser-SJHCBL7T.js} +75 -15
  64. package/dist/parser-SJHCBL7T.js.map +1 -0
  65. package/dist/{pdf-ocr-FAGA3O6B.js → pdf-ocr-LGPSJM22.js} +6 -6
  66. package/dist/pdf-ocr-RKXDY3ZA.cjs +31 -0
  67. package/dist/{pdf-ocr-6UXBIQE6.cjs.map → pdf-ocr-RKXDY3ZA.cjs.map} +1 -1
  68. package/dist/{pdf-ocr-N5LYC5LA.js → pdf-ocr-T5ASSUKK.js} +9 -9
  69. package/dist/{profile-io-HC6FMYX4.js → profile-io-KMCAFTMG.js} +3 -3
  70. package/dist/{rasterize-QLTROEV2.js → rasterize-M52AKY7R.js} +3 -3
  71. package/dist/{redact-doc-V4KMM2QV.js → redact-doc-SWJC27LL.js} +11 -11
  72. package/dist/{render-V4S3QLTR.js → render-45AB5YZR.js} +7 -7
  73. package/dist/seal-7KWG6VHS.js +10 -0
  74. package/dist/{setup-HU7ZOQNM.js → setup-5PBMUI6M.js} +3 -3
  75. package/dist/visual-OMJNXLNZ.js +21 -0
  76. package/dist/{watch-NPIZ6DSJ.js → watch-QOGKV52T.js} +12 -12
  77. package/package.json +1 -1
  78. package/dist/chunk-GVBQVXXB.js.map +0 -1
  79. package/dist/chunk-L6N4OMKR.js.map +0 -1
  80. package/dist/chunk-MED2MR6O.cjs.map +0 -1
  81. package/dist/chunk-QFJCEHY7.js.map +0 -1
  82. package/dist/chunks-MPOOHZVO.js +0 -10
  83. package/dist/parser-FNUQW2F3.js.map +0 -1
  84. package/dist/parser-OKAQRZKM.cjs.map +0 -1
  85. package/dist/parser-XNOLC3MZ.js.map +0 -1
  86. package/dist/pdf-ocr-6UXBIQE6.cjs +0 -31
  87. package/dist/seal-MQ5TB5YZ.js +0 -10
  88. package/dist/visual-RLIFC4XC.js +0 -21
  89. /package/dist/{-C437ZARA.js.map → -AOWV7MNY.js.map} +0 -0
  90. /package/dist/{chunk-UMNKY2EZ.js.map → chunk-24YLYR6Q.js.map} +0 -0
  91. /package/dist/{chunk-GFQIKYBV.js.map → chunk-3ANXRVI2.js.map} +0 -0
  92. /package/dist/{chunk-CNMUT5YW.js.map → chunk-3H2IEU4V.js.map} +0 -0
  93. /package/dist/{chunk-56GBOIOE.js.map → chunk-6LIBF2ZB.js.map} +0 -0
  94. /package/dist/{chunk-2X64TI7I.js.map → chunk-6QBBGZST.js.map} +0 -0
  95. /package/dist/{chunk-FPUBEM3F.js.map → chunk-7XITVUAK.js.map} +0 -0
  96. /package/dist/{chunk-S4KQUVBV.js.map → chunk-AXX5AQT4.js.map} +0 -0
  97. /package/dist/{chunk-U3TZVR7A.js.map → chunk-BS2XWGT5.js.map} +0 -0
  98. /package/dist/{chunk-4BJZGXNM.js.map → chunk-DKJ2RNDG.js.map} +0 -0
  99. /package/dist/{chunk-IRP6QS3K.js.map → chunk-FDFXL7VJ.js.map} +0 -0
  100. /package/dist/{chunk-YOFKJ7IM.js.map → chunk-IRNWAHHZ.js.map} +0 -0
  101. /package/dist/{chunk-AXR7OKQY.js.map → chunk-KBGNPGVY.js.map} +0 -0
  102. /package/dist/{chunk-UV2G6XFA.js.map → chunk-M2X766AY.js.map} +0 -0
  103. /package/dist/{chunk-YTEMFVZB.js.map → chunk-MEIQ476H.js.map} +0 -0
  104. /package/dist/{chunk-4GCS7WJJ.js.map → chunk-O5E25RHU.js.map} +0 -0
  105. /package/dist/{chunk-NGDMJICC.js.map → chunk-OIF5HRVP.js.map} +0 -0
  106. /package/dist/{chunk-3LJ6QO53.js.map → chunk-SKRWKVVW.js.map} +0 -0
  107. /package/dist/{chunk-VUC4JJUM.js.map → chunk-UCLDUUBX.js.map} +0 -0
  108. /package/dist/{chunk-L6PFPBTK.js.map → chunk-VJCQOSMT.js.map} +0 -0
  109. /package/dist/{chunk-DQXP3ELP.js.map → chunk-X45Q7EAC.js.map} +0 -0
  110. /package/dist/{chunks-MPOOHZVO.js.map → chunks-7KXTS7IV.js.map} +0 -0
  111. /package/dist/{formula-HUENRCPJ.js.map → formula-C26FMMGO.js.map} +0 -0
  112. /package/dist/{formula-43QBPAL5.js.map → formula-W4OL33YQ.js.map} +0 -0
  113. /package/dist/{image-ocr-HYAKWJGE.js.map → image-ocr-NSQ34Y6T.js.map} +0 -0
  114. /package/dist/{image-ocr-BAHDLDV5.js.map → image-ocr-T72HMX2W.js.map} +0 -0
  115. /package/dist/{model-bundle-23WBSECG.js.map → model-bundle-34T2LJB4.js.map} +0 -0
  116. /package/dist/{models-NRZQY45P.js.map → models-TQH5EM6V.js.map} +0 -0
  117. /package/dist/{parse-worker-v2-DPNXGJ73.js.map → parse-worker-v2-YEYLILGJ.js.map} +0 -0
  118. /package/dist/{pdf-ocr-FAGA3O6B.js.map → pdf-ocr-LGPSJM22.js.map} +0 -0
  119. /package/dist/{pdf-ocr-N5LYC5LA.js.map → pdf-ocr-T5ASSUKK.js.map} +0 -0
  120. /package/dist/{profile-io-HC6FMYX4.js.map → profile-io-KMCAFTMG.js.map} +0 -0
  121. /package/dist/{rasterize-QLTROEV2.js.map → rasterize-M52AKY7R.js.map} +0 -0
  122. /package/dist/{redact-doc-V4KMM2QV.js.map → redact-doc-SWJC27LL.js.map} +0 -0
  123. /package/dist/{render-V4S3QLTR.js.map → render-45AB5YZR.js.map} +0 -0
  124. /package/dist/{seal-MQ5TB5YZ.js.map → seal-7KWG6VHS.js.map} +0 -0
  125. /package/dist/{setup-HU7ZOQNM.js.map → setup-5PBMUI6M.js.map} +0 -0
  126. /package/dist/{visual-RLIFC4XC.js.map → visual-OMJNXLNZ.js.map} +0 -0
  127. /package/dist/{watch-NPIZ6DSJ.js.map → watch-QOGKV52T.js.map} +0 -0
package/dist/mcp.js CHANGED
@@ -38,33 +38,33 @@ import {
38
38
  resolveBuiltinTemplate,
39
39
  unknownFontWarnings,
40
40
  usesGaejosikMunche
41
- } from "./chunk-FPUBEM3F.js";
42
- import "./chunk-56GBOIOE.js";
41
+ } from "./chunk-7XITVUAK.js";
42
+ import "./chunk-6LIBF2ZB.js";
43
43
  import {
44
44
  detectFormat,
45
45
  detectOle2Format,
46
46
  detectZipFormat,
47
47
  extractHwp5MetadataOnly
48
- } from "./chunk-L6N4OMKR.js";
49
- import "./chunk-2X64TI7I.js";
50
- import "./chunk-AXR7OKQY.js";
48
+ } from "./chunk-YOGMCRM7.js";
49
+ import "./chunk-6QBBGZST.js";
50
+ import "./chunk-KBGNPGVY.js";
51
51
  import "./chunk-VKVDMH7X.js";
52
52
  import "./chunk-VQFA55IC.js";
53
53
  import "./chunk-BHVOY6V4.js";
54
- import "./chunk-GVBQVXXB.js";
54
+ import "./chunk-4NQ4EZEE.js";
55
55
  import {
56
56
  blocksToMarkdown
57
- } from "./chunk-U3TZVR7A.js";
57
+ } from "./chunk-BS2XWGT5.js";
58
58
  import {
59
59
  assertWithinRoot,
60
60
  getAccessRoot,
61
61
  isOfflineMode
62
- } from "./chunk-CNMUT5YW.js";
62
+ } from "./chunk-3H2IEU4V.js";
63
63
  import {
64
64
  extractFormFields,
65
65
  fillWithUniqueGuard
66
- } from "./chunk-GFQIKYBV.js";
67
- import "./chunk-VUC4JJUM.js";
66
+ } from "./chunk-3ANXRVI2.js";
67
+ import "./chunk-UCLDUUBX.js";
68
68
  import {
69
69
  KordocError,
70
70
  VERSION,
@@ -72,7 +72,7 @@ import {
72
72
  routeConsoleToStderr,
73
73
  sanitizeError,
74
74
  toArrayBuffer
75
- } from "./chunk-4BJZGXNM.js";
75
+ } from "./chunk-DKJ2RNDG.js";
76
76
  import "./chunk-3WSNLH4B.js";
77
77
 
78
78
  // src/mcp.ts
@@ -371,7 +371,7 @@ ${markdown}`);
371
371
  break;
372
372
  case "pdf":
373
373
  try {
374
- const { extractPdfMetadataOnly } = await import("./parser-FNUQW2F3.js");
374
+ const { extractPdfMetadataOnly } = await import("./parser-SJHCBL7T.js");
375
375
  metadata = await extractPdfMetadataOnly(buffer);
376
376
  } catch {
377
377
  metadata = void 0;
@@ -548,7 +548,7 @@ ${tableMarkdown}` }]
548
548
  if (!parsed.success) {
549
549
  return { content: [{ type: "text", text: `\uD30C\uC2F1 \uC2E4\uD328: ${parsed.error}` }], isError: true };
550
550
  }
551
- const { blocksToChunks } = await import("./chunks-MPOOHZVO.js");
551
+ const { blocksToChunks } = await import("./chunks-7KXTS7IV.js");
552
552
  const chunks = blocksToChunks(parsed.blocks, { granularity, includeTableCells: include_table_cells });
553
553
  return { content: [{ type: "text", text: capResponseText(JSON.stringify(chunks, null, 2)) }] };
554
554
  } catch (err) {
@@ -818,7 +818,7 @@ ${previewMd}` }]
818
818
  }
819
819
  const image = new Uint8Array(await readFile2(imgResolved));
820
820
  const ext = extname2(imgResolved).slice(1).toLowerCase();
821
- const { placeSealHwpx } = await import("./seal-MQ5TB5YZ.js");
821
+ const { placeSealHwpx } = await import("./seal-7KWG6VHS.js");
822
822
  const result = await placeSealHwpx(buffer, [{
823
823
  anchor,
824
824
  occurrence,
@@ -935,7 +935,7 @@ ${previewMd}` }]
935
935
  if (outPath && await isSameFile(outPath, resolved)) {
936
936
  return { content: [{ type: "text", text: "output_path\uAC00 \uC785\uB825 \uD30C\uC77C\uACFC \uAC19\uC2B5\uB2C8\uB2E4 \u2014 \uC6D0\uBCF8\uC744 \uB36E\uC5B4\uC4F0\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uB2E4\uB978 \uACBD\uB85C\uB97C \uC9C0\uC815\uD558\uC138\uC694." }], isError: true };
937
937
  }
938
- const { redactDocument } = await import("./redact-doc-V4KMM2QV.js");
938
+ const { redactDocument } = await import("./redact-doc-SWJC27LL.js");
939
939
  const r = await redactDocument(buffer, { rules, maskChar: mask_char, filePath: file_path, dryRun: dry_run });
940
940
  const MAX_LINES = 50;
941
941
  const listed = r.fileHits.length > 0 ? r.fileHits.map((h) => ` - [${h.rule}] ${h.masked} (${h.where} @ ${h.part})`) : r.markdownHits.map((h) => ` - [${h.rule}] ${h.masked}`);
@@ -1009,7 +1009,7 @@ function registerRenderTools(server2) {
1009
1009
  const { buffer, resolved } = await readValidatedFile(file_path, MAX_FILE_SIZE, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
1010
1010
  const isHwp5 = resolved.toLowerCase().endsWith(".hwp");
1011
1011
  if (!isHwp5 && !pages && (format === "png" || format === "svg")) {
1012
- const { renderHwpxToSvg } = await import("./render-V4S3QLTR.js");
1012
+ const { renderHwpxToSvg } = await import("./render-45AB5YZR.js");
1013
1013
  const result = await renderHwpxToSvg(buffer, { highlights, reflow: true, reflowMode: reflow_mode });
1014
1014
  const summary2 = [
1015
1015
  `\uB80C\uB354 \uC644\uB8CC: ${result.pageCount}\uD398\uC774\uC9C0, ${Math.round(result.width)}x${Math.round(result.height)}pt (\uD14D\uC2A4\uD2B8 ${result.stats.texts}\xB7\uC774\uBBF8\uC9C0 ${result.stats.images}\xB7\uD45C ${result.stats.tables})`,
@@ -1021,7 +1021,7 @@ function registerRenderTools(server2) {
1021
1021
  summary2.push(`\uC800\uC7A5: ${outPath}`);
1022
1022
  return { content: [{ type: "text", text: summary2.join("\n") }] };
1023
1023
  }
1024
- const { rasterizeSvg } = await import("./rasterize-QLTROEV2.js");
1024
+ const { rasterizeSvg } = await import("./rasterize-M52AKY7R.js");
1025
1025
  const raster = await rasterizeSvg(result.svg, result.width, result.height, max_width_px ? { maxWidthPx: max_width_px } : void 0);
1026
1026
  if (outPath) {
1027
1027
  await mkdir2(dirname3(outPath), { recursive: true });
@@ -1036,7 +1036,7 @@ function registerRenderTools(server2) {
1036
1036
  ]
1037
1037
  };
1038
1038
  }
1039
- const { renderDocument } = await import("./render-V4S3QLTR.js");
1039
+ const { renderDocument } = await import("./render-45AB5YZR.js");
1040
1040
  const { scene, assets } = await renderDocument(buffer, { format, pages, highlights, reflow: true, reflowMode: reflow_mode, maxWidthPx: max_width_px });
1041
1041
  const summary = [
1042
1042
  `\uB80C\uB354 \uC644\uB8CC: \uBB38\uC11C ${scene.pages.length}\uD398\uC774\uC9C0 \uC911 ${assets.filter((a) => a.page !== void 0).length || 1}\uAC74 (\uD14D\uC2A4\uD2B8 ${scene.stats.texts}\xB7\uC774\uBBF8\uC9C0 ${scene.stats.images}\xB7\uD45C ${scene.stats.tables}\xB7\uB3C4\uD615 ${scene.stats.shapes})`,
@@ -1086,7 +1086,7 @@ function registerRenderTools(server2) {
1086
1086
  try {
1087
1087
  const { buffer } = await readValidatedFile(file_path, MAX_FILE_SIZE, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
1088
1088
  const dir = safeOutputPath(join2(output_dir, "regions.json"), /* @__PURE__ */ new Set([".json"])).replace(/[\\/]regions\.json$/, "");
1089
- const { extractRenderedRegions } = await import("./render-V4S3QLTR.js");
1089
+ const { extractRenderedRegions } = await import("./render-45AB5YZR.js");
1090
1090
  const regions = await extractRenderedRegions(buffer, { types: target, format, pages, paddingPt: padding_pt, reflow: true });
1091
1091
  await mkdir2(dir, { recursive: true });
1092
1092
  const ext = format === "jpeg" ? "jpg" : "png";
@@ -1122,7 +1122,7 @@ function registerRenderTools(server2) {
1122
1122
  }
1123
1123
  const { buffer } = await readValidatedFile(file_path, MAX_FILE_SIZE, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
1124
1124
  const dir = output_dir ? safeOutputPath(join2(output_dir, "tables.json"), /* @__PURE__ */ new Set([".json"])).replace(/[\\/]tables\.json$/, "") : void 0;
1125
- const { extractTables } = await import("./visual-RLIFC4XC.js");
1125
+ const { extractTables } = await import("./visual-OMJNXLNZ.js");
1126
1126
  const tables = await extractTables(buffer, { policy: visual, format, paddingPt: padding_pt });
1127
1127
  if (dir) await mkdir2(dir, { recursive: true });
1128
1128
  const ext = format === "jpeg" ? "jpg" : "png";
@@ -1179,7 +1179,7 @@ function registerGenerateTools(server2) {
1179
1179
  try {
1180
1180
  const out = safeOutputPath(output_path, PROFILE_EXTENSIONS);
1181
1181
  const { buffer } = await readValidatedFile(hwpx_path);
1182
- const { hwpxToProfile } = await import("./-C437ZARA.js");
1182
+ const { hwpxToProfile } = await import("./-AOWV7MNY.js");
1183
1183
  const profile = await hwpxToProfile(buffer);
1184
1184
  await mkdir3(dirname4(out), { recursive: true });
1185
1185
  await writeOutputFile(out, JSON.stringify(profile, null, 2));
@@ -1292,7 +1292,7 @@ function registerGenerateTools(server2) {
1292
1292
  }
1293
1293
  let profile;
1294
1294
  if (profile_path) {
1295
- const { parseFormatProfileJson } = await import("./profile-io-HC6FMYX4.js");
1295
+ const { parseFormatProfileJson } = await import("./profile-io-KMCAFTMG.js");
1296
1296
  profile = parseFormatProfileJson(await readFile3(safePath(profile_path, PROFILE_EXTENSIONS), "utf-8"));
1297
1297
  }
1298
1298
  const out = safeOutputPath(output_path, /* @__PURE__ */ new Set([".hwpx"]));
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ALL_OCR_MODELS
4
- } from "./chunk-L6PFPBTK.js";
4
+ } from "./chunk-VJCQOSMT.js";
5
5
  import {
6
6
  ALL_FORMULA_MODELS,
7
7
  getModelStatusIn,
8
8
  getModelsDir
9
- } from "./chunk-UV2G6XFA.js";
10
- import "./chunk-CNMUT5YW.js";
11
- import "./chunk-4BJZGXNM.js";
9
+ } from "./chunk-M2X766AY.js";
10
+ import "./chunk-3H2IEU4V.js";
11
+ import "./chunk-DKJ2RNDG.js";
12
12
 
13
13
  // src/shared/model-bundle.ts
14
14
  import { copyFile, mkdir } from "fs/promises";
@@ -101,4 +101,4 @@ export {
101
101
  importModels,
102
102
  modelCacheStatus
103
103
  };
104
- //# sourceMappingURL=model-bundle-23WBSECG.js.map
104
+ //# sourceMappingURL=model-bundle-34T2LJB4.js.map
@@ -16,10 +16,10 @@ import {
16
16
  ocrSourcePath,
17
17
  parseCharacterDict,
18
18
  resolveOcrModels
19
- } from "./chunk-L6PFPBTK.js";
20
- import "./chunk-UV2G6XFA.js";
21
- import "./chunk-CNMUT5YW.js";
22
- import "./chunk-4BJZGXNM.js";
19
+ } from "./chunk-VJCQOSMT.js";
20
+ import "./chunk-M2X766AY.js";
21
+ import "./chunk-3H2IEU4V.js";
22
+ import "./chunk-DKJ2RNDG.js";
23
23
  export {
24
24
  ALL_OCR_MODELS,
25
25
  DEFAULT_OCR_MODELS,
@@ -38,4 +38,4 @@ export {
38
38
  parseCharacterDict,
39
39
  resolveOcrModels
40
40
  };
41
- //# sourceMappingURL=models-NRZQY45P.js.map
41
+ //# sourceMappingURL=models-TQH5EM6V.js.map
@@ -1,25 +1,25 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  parseWorkerFile
4
- } from "./chunk-IRP6QS3K.js";
5
- import "./chunk-FPUBEM3F.js";
6
- import "./chunk-56GBOIOE.js";
7
- import "./chunk-L6N4OMKR.js";
8
- import "./chunk-2X64TI7I.js";
9
- import "./chunk-AXR7OKQY.js";
4
+ } from "./chunk-FDFXL7VJ.js";
5
+ import "./chunk-7XITVUAK.js";
6
+ import "./chunk-6LIBF2ZB.js";
7
+ import "./chunk-YOGMCRM7.js";
8
+ import "./chunk-6QBBGZST.js";
9
+ import "./chunk-KBGNPGVY.js";
10
10
  import "./chunk-VKVDMH7X.js";
11
11
  import "./chunk-VQFA55IC.js";
12
12
  import {
13
13
  validateOcrOptions
14
14
  } from "./chunk-BHVOY6V4.js";
15
- import "./chunk-GVBQVXXB.js";
16
- import "./chunk-U3TZVR7A.js";
17
- import "./chunk-GFQIKYBV.js";
18
- import "./chunk-VUC4JJUM.js";
15
+ import "./chunk-4NQ4EZEE.js";
16
+ import "./chunk-BS2XWGT5.js";
17
+ import "./chunk-3ANXRVI2.js";
18
+ import "./chunk-UCLDUUBX.js";
19
19
  import {
20
20
  VERSION,
21
21
  sanitizeError
22
- } from "./chunk-4BJZGXNM.js";
22
+ } from "./chunk-DKJ2RNDG.js";
23
23
  import "./chunk-3WSNLH4B.js";
24
24
 
25
25
  // src/cli/parse-worker-v2.ts
@@ -311,4 +311,4 @@ export {
311
311
  runParseWorkerV2,
312
312
  toParseOptions
313
313
  };
314
- //# sourceMappingURL=parse-worker-v2-DPNXGJ73.js.map
314
+ //# sourceMappingURL=parse-worker-v2-YEYLILGJ.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  blocksToPages,
3
3
  encodePng
4
- } from "./chunk-YOFKJ7IM.js";
4
+ } from "./chunk-IRNWAHHZ.js";
5
5
  import {
6
6
  hasRequestedPagesAfter,
7
7
  parsePageRange
@@ -61,7 +61,7 @@ import {
61
61
  stripAbsorbedRunningLines,
62
62
  trimTrailingEmptyTableCols,
63
63
  wrapJoiner
64
- } from "./chunk-NGDMJICC.js";
64
+ } from "./chunk-OIF5HRVP.js";
65
65
  import {
66
66
  CELL_BASELINES,
67
67
  CELL_EDGES,
@@ -75,12 +75,12 @@ import {
75
75
  stripScriptTags,
76
76
  unframeLayoutTables,
77
77
  validateOcrOptions
78
- } from "./chunk-QFJCEHY7.js";
79
- import "./chunk-4GCS7WJJ.js";
78
+ } from "./chunk-J5PYESLX.js";
79
+ import "./chunk-O5E25RHU.js";
80
80
  import {
81
81
  KordocError,
82
82
  sanitizeHref
83
- } from "./chunk-DQXP3ELP.js";
83
+ } from "./chunk-X45Q7EAC.js";
84
84
 
85
85
  // src/pdf/image-extract.ts
86
86
  import { createHash } from "crypto";
@@ -611,6 +611,61 @@ function ocrVectorOps(opList, paths) {
611
611
  // src/pdf/split-row-pattern.ts
612
612
  var textOf = (cell) => cell.text.replace(/<\/?u>|~~/g, "").trim();
613
613
  var plain = (cell) => !cell.blocks?.length && !IMAGE_CELLS.has(cell);
614
+ function matchesIndependentRowPair(table, owner, first) {
615
+ const norm = (cell) => textOf(cell).replace(/\s+/g, "");
616
+ const pairs = [];
617
+ for (let c = 0; c < table.cols; ) {
618
+ const u = owner[first - 1]?.[c], d = owner[first]?.[c];
619
+ if (u && u === d) {
620
+ c = u.c + u.cs;
621
+ continue;
622
+ }
623
+ const upper = u ? table.cells[u.r][u.c] : void 0, lower = d ? table.cells[d.r][d.c] : void 0;
624
+ if (!upper?.text.trim() && !lower?.text.trim()) {
625
+ c++;
626
+ continue;
627
+ }
628
+ if (!u || !d || !upper || !lower || u.r !== first - 1 || d.r !== first || u.c !== c || d.c !== c || u.rs !== 1 || d.rs !== 1 || u.cs !== d.cs || !plain(upper) || !plain(lower) || !norm(upper) || !norm(lower)) return false;
629
+ pairs.push({ c, cs: u.cs, upper: norm(upper), lower: norm(lower) });
630
+ c += u.cs;
631
+ }
632
+ if (pairs.length < 2 || pairs.every((p) => p.upper === p.lower)) return false;
633
+ return table.cells.some((_, r) => {
634
+ if (r + 1 >= table.rows || r + 1 >= first - 1 && r <= first) return false;
635
+ return pairs.every((p) => [p.upper, p.lower].every((text, i) => {
636
+ const a = owner[r + i]?.[p.c], cell = table.cells[r + i]?.[p.c];
637
+ return a?.r === r + i && a.c === p.c && a.rs === 1 && a.cs === p.cs && !!cell && plain(cell) && norm(cell) === text;
638
+ }));
639
+ });
640
+ }
641
+ function matchesCompleteContextRow(table, owner, first) {
642
+ const norm = (s) => s.replace(/\s+/g, "");
643
+ const context = [];
644
+ let value;
645
+ for (let c = 0; c < table.cols; ) {
646
+ const u = owner[first - 1]?.[c], d = owner[first]?.[c];
647
+ if (u && u === d) {
648
+ const cell = table.cells[u.r][u.c];
649
+ if (u.r === first - 1 && u.rs === 2 && plain(cell) && textOf(cell)) context.push({ c, cs: u.cs, text: norm(textOf(cell)) });
650
+ c = u.c + u.cs;
651
+ continue;
652
+ }
653
+ const upper = u ? table.cells[u.r][u.c] : void 0, lower = d ? table.cells[d.r][d.c] : void 0;
654
+ if (!upper?.text.trim() && !lower?.text.trim()) {
655
+ c++;
656
+ continue;
657
+ }
658
+ if (value || !u || !d || !upper || !lower || u.r !== first - 1 || d.r !== first || u.c !== c || d.c !== c || u.rs !== 1 || d.rs !== 1 || u.cs !== d.cs || !plain(upper) || !plain(lower) || !textOf(upper) || !textOf(lower)) return false;
659
+ value = { c, cs: u.cs, text: norm(textOf(upper) + textOf(lower)) };
660
+ c += u.cs;
661
+ }
662
+ if (!value || !context.length) return false;
663
+ const proof = [...context, value];
664
+ return table.cells.some((row, r) => r !== first - 1 && r !== first && proof.every((p) => {
665
+ const a = owner[r]?.[p.c], cell = row[p.c];
666
+ return a?.r === r && a.c === p.c && a.rs === 1 && a.cs === p.cs && !!cell && plain(cell) && norm(textOf(cell)) === p.text;
667
+ }));
668
+ }
614
669
  function matchesCompleteSiblingRow(table, owner, first) {
615
670
  const pairs = [];
616
671
  for (let c = 0; c < table.cols; ) {
@@ -1328,6 +1383,7 @@ function mergeSplitRow(table, owner, first, colXs, textOnly = false, cut = NO_CU
1328
1383
  return a !== null && b === a + 1;
1329
1384
  })) return false;
1330
1385
  if (cut.ruled && hasNumberedRowSequence(table, owner, first)) return false;
1386
+ if (cut.ruled && matchesIndependentRowPair(table, owner, first)) return false;
1331
1387
  const contentPairs = pairs.filter(([u, d]) => hasContent(u.cell) && hasContent(d.cell));
1332
1388
  const carriedSplit = !textOnly && carried && !newCell && (contentPairs.length <= 1 || contentPairs.every(([, d]) => d.rs > 1) || !cut.ruled && contentPairs.some(([u, d]) => wordOverflows(cell(u), cell(d), colXs[u.c], colXs[u.c + u.cs])));
1333
1389
  if (!carriedSplit) {
@@ -1339,7 +1395,7 @@ function mergeSplitRow(table, owner, first, colXs, textOnly = false, cut = NO_CU
1339
1395
  if (!(cut.open && !newCell)) {
1340
1396
  if (pairs.some((p) => p[1].rs > 1 && !flows(p))) return false;
1341
1397
  const one = pairs.filter(([, d]) => d.rs === 1);
1342
- if (!matchesCompleteSiblingRow(table, owner, first) && !matchesCompleteRubricRow(table, owner, first) && !outlineOnly(pairs, cell) && !one.some(flows) && (cut.list === "none" || !one.some(([u, d]) => listContinues(cell(u), cell(d), cut.list === "multi")))) return false;
1398
+ if (!matchesCompleteSiblingRow(table, owner, first) && !matchesCompleteRubricRow(table, owner, first) && !(cut.ruled && matchesCompleteContextRow(table, owner, first)) && !outlineOnly(pairs, cell) && !one.some(flows) && (cut.list === "none" || !one.some(([u, d]) => listContinues(cell(u), cell(d), cut.list === "multi")))) return false;
1343
1399
  }
1344
1400
  }
1345
1401
  for (const [u, d] of pairs) {
@@ -1727,7 +1783,10 @@ function mergeContinuedCells(blocks, pageHeights) {
1727
1783
  for (let j = blocks.length - 1; j > 0; j--) {
1728
1784
  const part = blocks[j];
1729
1785
  const from = part.table ? CONT_PARTS.get(part.table) : void 0;
1730
- if (!from || !part.table) continue;
1786
+ if (!from || !part.table) {
1787
+ unwrapContinuedTable(blocks, j, pageHeights, true);
1788
+ continue;
1789
+ }
1731
1790
  let i = j - 1;
1732
1791
  while (i >= 0 && blocks[i].type !== "table") i--;
1733
1792
  const prev = blocks[i];
@@ -1754,7 +1813,7 @@ function mergeContinuedCells(blocks, pageHeights) {
1754
1813
  if (cell.blocks) mergeCrossPageTables(cell.blocks, pageHeights);
1755
1814
  }
1756
1815
  }
1757
- function unwrapContinuedTable(blocks, at, pageHeights) {
1816
+ function unwrapContinuedTable(blocks, at, pageHeights, splitOnly = false) {
1758
1817
  const prev = blocks[at - 1], frame = blocks[at];
1759
1818
  if (!prev?.table || !frame?.table || frame.table.rows !== 1 || frame.table.cols !== 1 || !CLIP_TABLES.has(frame.table)) return;
1760
1819
  const inner = frame.table.cells[0]?.[0]?.blocks;
@@ -1764,6 +1823,7 @@ function unwrapContinuedTable(blocks, at, pageHeights) {
1764
1823
  if (!px || !nx || px.length !== nx.length || px.some((x, i) => Math.abs(x - nx[i]) > COL_MATCH_TOL)) return;
1765
1824
  const ph = pageHeights?.get(prev.pageNumber), nh = pageHeights?.get(next.pageNumber);
1766
1825
  if (!ph || !nh || prev.bbox.y > ph * CONTINUED_TABLE_PAGE_BAND || next.bbox.y + next.bbox.height < nh * (1 - CONTINUED_TABLE_PAGE_BAND)) return;
1826
+ if (splitOnly && (inner.length !== 1 || !joinSplitParts(prev.table, px, next.table, nx, 0, prev.bbox.y)?.split)) return;
1767
1827
  blocks.splice(at, 1, ...inner);
1768
1828
  }
1769
1829
  function fillNestedContinuation(blocks, at) {
@@ -3363,7 +3423,7 @@ function mergeLinkRuns(markdown) {
3363
3423
 
3364
3424
  // src/pdf/formula-ocr.ts
3365
3425
  async function applyFormulaOcr(buffer, blocks, pageFilter, effectivePageCount, warnings, _onProgress) {
3366
- const formulaMod = await import("./formula-HUENRCPJ.js");
3426
+ const formulaMod = await import("./formula-C26FMMGO.js");
3367
3427
  const { FormulaPipeline, ensureFormulaModels } = formulaMod;
3368
3428
  await ensureFormulaModels((p) => {
3369
3429
  if (p.phase === "download" && p.total) {
@@ -3789,10 +3849,10 @@ async function parsePdfDocument(buffer, options) {
3789
3849
  }
3790
3850
  if (targets.size > 0) {
3791
3851
  try {
3792
- const { runPdfOcr } = await import("./pdf-ocr-FAGA3O6B.js");
3852
+ const { runPdfOcr } = await import("./pdf-ocr-LGPSJM22.js");
3793
3853
  const mode = typeof options?.ocr === "function" ? options.ocr : "builtin";
3794
3854
  const regionPages = new Map([...ocrRegions].filter(([p]) => options?.ocr !== "force" && !isImageBased && !pageQuality.find((q) => q.page === p)?.needsOcr));
3795
- const { builtinOcrConfig } = await import("./pdf-ocr-FAGA3O6B.js");
3855
+ const { builtinOcrConfig } = await import("./pdf-ocr-LGPSJM22.js");
3796
3856
  const ocrPageBlocks = await runPdfOcr(ocrBuffer, targets, mode, warnings, options?.onProgress, options?.tables !== false, vectorPageOps, regionPages, builtinOcrConfig(options), ocrLinesOut);
3797
3857
  for (const obs of ocrPageBlocks.values()) stripScriptTags({ blocks: obs });
3798
3858
  if (ocrPageBlocks.size > 0) {
@@ -4037,4 +4097,4 @@ export {
4037
4097
  parsePdfDocument,
4038
4098
  removeHeaderFooterBlocks
4039
4099
  };
4040
- //# sourceMappingURL=parser-XNOLC3MZ.js.map
4100
+ //# sourceMappingURL=parser-E6BG3ECD.js.map