kordoc 4.24.38 → 4.24.39

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 (182) hide show
  1. package/README.md +3 -3
  2. package/dist/{-LPQSUCWH.js → -7VE547IT.js} +21 -21
  3. package/dist/{chunk-7F63OEHI.js → chunk-2XXTL4S4.js} +2 -2
  4. package/dist/{chunk-MLXVSAR3.js → chunk-346W5O2J.js} +2 -2
  5. package/dist/{chunk-UQ2ZA3X4.js → chunk-3MHRL3OO.js} +2 -2
  6. package/dist/{chunk-XQPF6I6P.js → chunk-4FWLCWNU.js} +2 -2
  7. package/dist/{chunk-TQUO7JR5.js → chunk-7AYP2XO6.js} +3 -3
  8. package/dist/{chunk-SORWBCEP.js → chunk-7BQWFZJO.js} +6 -6
  9. package/dist/{chunk-CDVDRC77.js → chunk-7ZRUR4TZ.js} +2 -2
  10. package/dist/{chunk-G3JUKDMB.js → chunk-BWBR5GWQ.js} +2 -2
  11. package/dist/{chunk-5PONVN46.js → chunk-COH7WXBK.js} +5 -5
  12. package/dist/{chunk-JL5REIEZ.js → chunk-CS76UPUC.js} +67 -14
  13. package/dist/chunk-CS76UPUC.js.map +1 -0
  14. package/dist/{chunk-UJFT2OED.js → chunk-F2JYJ2SP.js} +2 -2
  15. package/dist/{chunk-FA3MQGIF.js → chunk-FRMJTW3C.js} +2 -2
  16. package/dist/{chunk-XVWPMKPH.js → chunk-FZMZUX7B.js} +119 -20
  17. package/dist/chunk-FZMZUX7B.js.map +1 -0
  18. package/dist/{chunk-IDCU74H5.js → chunk-GXED6LJX.js} +2 -2
  19. package/dist/{chunk-FZWI6S7M.cjs → chunk-IM5SIGUN.cjs} +3 -3
  20. package/dist/{chunk-FZWI6S7M.cjs.map → chunk-IM5SIGUN.cjs.map} +1 -1
  21. package/dist/{chunk-YPLKE5WG.js → chunk-IZWZ3RQC.js} +2 -2
  22. package/dist/{chunk-6MTH2EYN.js → chunk-L23XOAKF.js} +6 -6
  23. package/dist/{chunk-SOI7R4LF.cjs → chunk-LE3733C2.cjs} +162 -109
  24. package/dist/chunk-LE3733C2.cjs.map +1 -0
  25. package/dist/{chunk-HWSJAYMR.js → chunk-LOJYJISM.js} +5 -5
  26. package/dist/{chunk-V5CNQSVW.cjs → chunk-LU7X6LLW.cjs} +3 -3
  27. package/dist/{chunk-V5CNQSVW.cjs.map → chunk-LU7X6LLW.cjs.map} +1 -1
  28. package/dist/{chunk-UQTQXXHU.js → chunk-M2ZRTYQ5.js} +5 -5
  29. package/dist/{chunk-6COUUT2E.cjs → chunk-MANE7HAZ.cjs} +2 -2
  30. package/dist/{chunk-6COUUT2E.cjs.map → chunk-MANE7HAZ.cjs.map} +1 -1
  31. package/dist/{chunk-ONL4UTGQ.js → chunk-NL5OTD2E.js} +10 -10
  32. package/dist/{chunk-P4OK4W2F.js → chunk-NQJL3664.js} +3 -3
  33. package/dist/{chunk-ISMJQJOP.js → chunk-PFHMNNW7.js} +118 -19
  34. package/dist/chunk-PFHMNNW7.js.map +1 -0
  35. package/dist/{chunk-WOGL3YQK.js → chunk-PHVAJBHM.js} +2 -2
  36. package/dist/{chunk-OBZV23UV.js → chunk-PQIIYKNL.js} +11 -11
  37. package/dist/{chunk-OYIGWP2N.js → chunk-QDPYTJ4Y.js} +2 -2
  38. package/dist/{chunk-RLED4WS3.js → chunk-QDQPAC4L.js} +2 -2
  39. package/dist/{chunk-Q7WPRN62.cjs → chunk-RJNHXCMP.cjs} +59 -59
  40. package/dist/{chunk-Q7WPRN62.cjs.map → chunk-RJNHXCMP.cjs.map} +1 -1
  41. package/dist/{chunk-MSRDRUOV.js → chunk-RPAEXGWZ.js} +2 -2
  42. package/dist/{chunk-3NZP2VXB.js → chunk-SFLHCRO6.js} +2 -2
  43. package/dist/{chunk-ORIA2IFK.js → chunk-U5OV6D66.js} +15 -15
  44. package/dist/{chunk-JEHCRYUT.cjs → chunk-UKTRLJII.cjs} +98 -98
  45. package/dist/{chunk-JEHCRYUT.cjs.map → chunk-UKTRLJII.cjs.map} +1 -1
  46. package/dist/{chunk-LAKPAL53.js → chunk-V2RIY72D.js} +2 -2
  47. package/dist/{chunk-URSNWPD4.cjs → chunk-V3IMDOZE.cjs} +6 -6
  48. package/dist/{chunk-URSNWPD4.cjs.map → chunk-V3IMDOZE.cjs.map} +1 -1
  49. package/dist/{chunk-5IYRVLGJ.js → chunk-WPIG3KUV.js} +66 -13
  50. package/dist/chunk-WPIG3KUV.js.map +1 -0
  51. package/dist/{chunk-AZ56HT3M.js → chunk-WVER4OWF.js} +3 -3
  52. package/dist/{chunk-ACQBUQB6.cjs → chunk-XYVTCXAG.cjs} +140 -41
  53. package/dist/chunk-XYVTCXAG.cjs.map +1 -0
  54. package/dist/{chunk-MNXKORB5.js → chunk-Y5O4DS56.js} +2 -2
  55. package/dist/{chunk-UPO7Y3KL.js → chunk-YXKU6UJD.js} +2 -2
  56. package/dist/{chunk-ONC5LWD4.js → chunk-ZDMLZRS4.js} +7 -7
  57. package/dist/{chunk-7F42AI4O.js → chunk-ZVAX6E63.js} +2 -2
  58. package/dist/chunks-WTYZ4KG2.js +11 -0
  59. package/dist/cli.js +43 -43
  60. package/dist/{formula-AV7SNRB4.js → formula-MMLDES2Z.js} +4 -4
  61. package/dist/{formula-BMSREXB5.js → formula-PFSZZNPP.js} +3 -3
  62. package/dist/{formula-NQHARDPX.cjs → formula-UI2UR74M.cjs} +9 -9
  63. package/dist/{formula-NQHARDPX.cjs.map → formula-UI2UR74M.cjs.map} +1 -1
  64. package/dist/generator-C3SCP3ZG.js +10 -0
  65. package/dist/generator-CHBOCLYX.cjs +11 -0
  66. package/dist/{generator-OC366G6M.cjs.map → generator-CHBOCLYX.cjs.map} +1 -1
  67. package/dist/generator-RTSNDZJB.js +17 -0
  68. package/dist/{hancom-3CHPVF7H.js → hancom-3V3USCW5.js} +2 -2
  69. package/dist/{hancom-F5OHWSWU.cjs → hancom-GV5TTF5H.cjs} +5 -5
  70. package/dist/{hancom-F5OHWSWU.cjs.map → hancom-GV5TTF5H.cjs.map} +1 -1
  71. package/dist/{hancom-6Z7O3G4K.js → hancom-XO52GNC3.js} +2 -2
  72. package/dist/{image-ocr-JQ4OEBBK.cjs → image-ocr-2WKCFABH.cjs} +43 -23
  73. package/dist/image-ocr-2WKCFABH.cjs.map +1 -0
  74. package/dist/{image-ocr-PE5NAWAR.js → image-ocr-R2ASFKHX.js} +33 -13
  75. package/dist/image-ocr-R2ASFKHX.js.map +1 -0
  76. package/dist/{image-ocr-YJPNUWXR.js → image-ocr-SU4RPHBF.js} +30 -10
  77. package/dist/image-ocr-SU4RPHBF.js.map +1 -0
  78. package/dist/index.cjs +1105 -1105
  79. package/dist/index.js +9 -9
  80. package/dist/mcp.js +36 -36
  81. package/dist/memo-U4RZJRU2.js +17 -0
  82. package/dist/{model-bundle-AXHPS54Q.js → model-bundle-JMSH2F4A.js} +5 -5
  83. package/dist/{models-CYRFBT43.js → models-D5SATVOZ.js} +5 -5
  84. package/dist/{parse-worker-v2-GUJQNNOF.js → parse-worker-v2-WIIZQFRX.js} +22 -22
  85. package/dist/{parser-533OXR3B.js → parser-KCY43TBS.js} +9 -9
  86. package/dist/{parser-JVJSUMCA.cjs → parser-MFBTEGJA.cjs} +159 -159
  87. package/dist/{parser-JVJSUMCA.cjs.map → parser-MFBTEGJA.cjs.map} +1 -1
  88. package/dist/{parser-S56VNTRV.js → parser-SBJKV5GS.js} +12 -12
  89. package/dist/{pdf-ocr-FNW4IJWX.js → pdf-ocr-I6GNQEFS.js} +6 -6
  90. package/dist/pdf-ocr-L2O4SQUK.cjs +40 -0
  91. package/dist/{pdf-ocr-ZBKAXNIE.cjs.map → pdf-ocr-L2O4SQUK.cjs.map} +1 -1
  92. package/dist/{pdf-ocr-JNR4HA7O.js → pdf-ocr-UU5PSZ7Z.js} +9 -9
  93. package/dist/{profile-io-GU5XFVSI.js → profile-io-HZK4ZZ2O.js} +3 -3
  94. package/dist/{rasterize-XOHGVWKM.js → rasterize-VNP4ULXM.js} +3 -3
  95. package/dist/{redact-doc-G5K4NVUN.js → redact-doc-SPHSBCPN.js} +21 -21
  96. package/dist/{render-J7VBXGFV.js → render-CKTTIDU2.js} +12 -12
  97. package/dist/{rewrite-fallback-4QGM5F4V.js → rewrite-fallback-H2KMJV6G.js} +13 -13
  98. package/dist/seal-MSY5G3UR.js +16 -0
  99. package/dist/{setup-R5IH4AGD.js → setup-GJVOXJN7.js} +3 -3
  100. package/dist/{to-hwpx-5ENZWUTU.js → to-hwpx-5UIBNW3D.js} +7 -7
  101. package/dist/to-hwpx-6BQNMA6P.cjs +16 -0
  102. package/dist/{to-hwpx-WCDMFRNN.cjs.map → to-hwpx-6BQNMA6P.cjs.map} +1 -1
  103. package/dist/{to-hwpx-I6LNQ4D4.js → to-hwpx-JJHDCYER.js} +4 -4
  104. package/dist/visual-Q6PIMKSA.js +37 -0
  105. package/dist/{watch-UM5SMZQP.js → watch-YZZES36Q.js} +22 -22
  106. package/package.json +1 -1
  107. package/dist/chunk-5IYRVLGJ.js.map +0 -1
  108. package/dist/chunk-ACQBUQB6.cjs.map +0 -1
  109. package/dist/chunk-ISMJQJOP.js.map +0 -1
  110. package/dist/chunk-JL5REIEZ.js.map +0 -1
  111. package/dist/chunk-SOI7R4LF.cjs.map +0 -1
  112. package/dist/chunk-XVWPMKPH.js.map +0 -1
  113. package/dist/chunks-5L5OU6AI.js +0 -11
  114. package/dist/generator-4CSCP6YH.js +0 -17
  115. package/dist/generator-OC366G6M.cjs +0 -11
  116. package/dist/generator-UPESZL4M.js +0 -10
  117. package/dist/image-ocr-JQ4OEBBK.cjs.map +0 -1
  118. package/dist/image-ocr-PE5NAWAR.js.map +0 -1
  119. package/dist/image-ocr-YJPNUWXR.js.map +0 -1
  120. package/dist/memo-OVXY467W.js +0 -17
  121. package/dist/pdf-ocr-ZBKAXNIE.cjs +0 -40
  122. package/dist/seal-DSMAUDZ4.js +0 -16
  123. package/dist/to-hwpx-WCDMFRNN.cjs +0 -16
  124. package/dist/visual-QFPNYNCF.js +0 -37
  125. /package/dist/{-LPQSUCWH.js.map → -7VE547IT.js.map} +0 -0
  126. /package/dist/{chunk-7F63OEHI.js.map → chunk-2XXTL4S4.js.map} +0 -0
  127. /package/dist/{chunk-MLXVSAR3.js.map → chunk-346W5O2J.js.map} +0 -0
  128. /package/dist/{chunk-UQ2ZA3X4.js.map → chunk-3MHRL3OO.js.map} +0 -0
  129. /package/dist/{chunk-XQPF6I6P.js.map → chunk-4FWLCWNU.js.map} +0 -0
  130. /package/dist/{chunk-TQUO7JR5.js.map → chunk-7AYP2XO6.js.map} +0 -0
  131. /package/dist/{chunk-SORWBCEP.js.map → chunk-7BQWFZJO.js.map} +0 -0
  132. /package/dist/{chunk-CDVDRC77.js.map → chunk-7ZRUR4TZ.js.map} +0 -0
  133. /package/dist/{chunk-G3JUKDMB.js.map → chunk-BWBR5GWQ.js.map} +0 -0
  134. /package/dist/{chunk-5PONVN46.js.map → chunk-COH7WXBK.js.map} +0 -0
  135. /package/dist/{chunk-UJFT2OED.js.map → chunk-F2JYJ2SP.js.map} +0 -0
  136. /package/dist/{chunk-FA3MQGIF.js.map → chunk-FRMJTW3C.js.map} +0 -0
  137. /package/dist/{chunk-IDCU74H5.js.map → chunk-GXED6LJX.js.map} +0 -0
  138. /package/dist/{chunk-YPLKE5WG.js.map → chunk-IZWZ3RQC.js.map} +0 -0
  139. /package/dist/{chunk-6MTH2EYN.js.map → chunk-L23XOAKF.js.map} +0 -0
  140. /package/dist/{chunk-HWSJAYMR.js.map → chunk-LOJYJISM.js.map} +0 -0
  141. /package/dist/{chunk-UQTQXXHU.js.map → chunk-M2ZRTYQ5.js.map} +0 -0
  142. /package/dist/{chunk-ONL4UTGQ.js.map → chunk-NL5OTD2E.js.map} +0 -0
  143. /package/dist/{chunk-P4OK4W2F.js.map → chunk-NQJL3664.js.map} +0 -0
  144. /package/dist/{chunk-WOGL3YQK.js.map → chunk-PHVAJBHM.js.map} +0 -0
  145. /package/dist/{chunk-OBZV23UV.js.map → chunk-PQIIYKNL.js.map} +0 -0
  146. /package/dist/{chunk-OYIGWP2N.js.map → chunk-QDPYTJ4Y.js.map} +0 -0
  147. /package/dist/{chunk-RLED4WS3.js.map → chunk-QDQPAC4L.js.map} +0 -0
  148. /package/dist/{chunk-MSRDRUOV.js.map → chunk-RPAEXGWZ.js.map} +0 -0
  149. /package/dist/{chunk-3NZP2VXB.js.map → chunk-SFLHCRO6.js.map} +0 -0
  150. /package/dist/{chunk-ORIA2IFK.js.map → chunk-U5OV6D66.js.map} +0 -0
  151. /package/dist/{chunk-LAKPAL53.js.map → chunk-V2RIY72D.js.map} +0 -0
  152. /package/dist/{chunk-AZ56HT3M.js.map → chunk-WVER4OWF.js.map} +0 -0
  153. /package/dist/{chunk-MNXKORB5.js.map → chunk-Y5O4DS56.js.map} +0 -0
  154. /package/dist/{chunk-UPO7Y3KL.js.map → chunk-YXKU6UJD.js.map} +0 -0
  155. /package/dist/{chunk-ONC5LWD4.js.map → chunk-ZDMLZRS4.js.map} +0 -0
  156. /package/dist/{chunk-7F42AI4O.js.map → chunk-ZVAX6E63.js.map} +0 -0
  157. /package/dist/{chunks-5L5OU6AI.js.map → chunks-WTYZ4KG2.js.map} +0 -0
  158. /package/dist/{formula-AV7SNRB4.js.map → formula-MMLDES2Z.js.map} +0 -0
  159. /package/dist/{formula-BMSREXB5.js.map → formula-PFSZZNPP.js.map} +0 -0
  160. /package/dist/{generator-4CSCP6YH.js.map → generator-C3SCP3ZG.js.map} +0 -0
  161. /package/dist/{generator-UPESZL4M.js.map → generator-RTSNDZJB.js.map} +0 -0
  162. /package/dist/{hancom-3CHPVF7H.js.map → hancom-3V3USCW5.js.map} +0 -0
  163. /package/dist/{hancom-6Z7O3G4K.js.map → hancom-XO52GNC3.js.map} +0 -0
  164. /package/dist/{memo-OVXY467W.js.map → memo-U4RZJRU2.js.map} +0 -0
  165. /package/dist/{model-bundle-AXHPS54Q.js.map → model-bundle-JMSH2F4A.js.map} +0 -0
  166. /package/dist/{models-CYRFBT43.js.map → models-D5SATVOZ.js.map} +0 -0
  167. /package/dist/{parse-worker-v2-GUJQNNOF.js.map → parse-worker-v2-WIIZQFRX.js.map} +0 -0
  168. /package/dist/{parser-533OXR3B.js.map → parser-KCY43TBS.js.map} +0 -0
  169. /package/dist/{parser-S56VNTRV.js.map → parser-SBJKV5GS.js.map} +0 -0
  170. /package/dist/{pdf-ocr-FNW4IJWX.js.map → pdf-ocr-I6GNQEFS.js.map} +0 -0
  171. /package/dist/{pdf-ocr-JNR4HA7O.js.map → pdf-ocr-UU5PSZ7Z.js.map} +0 -0
  172. /package/dist/{profile-io-GU5XFVSI.js.map → profile-io-HZK4ZZ2O.js.map} +0 -0
  173. /package/dist/{rasterize-XOHGVWKM.js.map → rasterize-VNP4ULXM.js.map} +0 -0
  174. /package/dist/{redact-doc-G5K4NVUN.js.map → redact-doc-SPHSBCPN.js.map} +0 -0
  175. /package/dist/{render-J7VBXGFV.js.map → render-CKTTIDU2.js.map} +0 -0
  176. /package/dist/{rewrite-fallback-4QGM5F4V.js.map → rewrite-fallback-H2KMJV6G.js.map} +0 -0
  177. /package/dist/{seal-DSMAUDZ4.js.map → seal-MSY5G3UR.js.map} +0 -0
  178. /package/dist/{setup-R5IH4AGD.js.map → setup-GJVOXJN7.js.map} +0 -0
  179. /package/dist/{to-hwpx-5ENZWUTU.js.map → to-hwpx-5UIBNW3D.js.map} +0 -0
  180. /package/dist/{to-hwpx-I6LNQ4D4.js.map → to-hwpx-JJHDCYER.js.map} +0 -0
  181. /package/dist/{visual-QFPNYNCF.js.map → visual-Q6PIMKSA.js.map} +0 -0
  182. /package/dist/{watch-UM5SMZQP.js.map → watch-YZZES36Q.js.map} +0 -0
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  parse
4
- } from "./chunk-ORIA2IFK.js";
4
+ } from "./chunk-U5OV6D66.js";
5
5
  import {
6
6
  classifyError,
7
7
  sanitizeError,
8
8
  toArrayBuffer
9
- } from "./chunk-LAKPAL53.js";
9
+ } from "./chunk-V2RIY72D.js";
10
10
 
11
11
  // src/cli/worker-parse.ts
12
12
  import { readFileSync, statSync } from "fs";
@@ -26,4 +26,4 @@ async function parseWorkerFile(absPath, options) {
26
26
  export {
27
27
  parseWorkerFile
28
28
  };
29
- //# sourceMappingURL=chunk-AZ56HT3M.js.map
29
+ //# sourceMappingURL=chunk-WVER4OWF.js.map
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
2
2
 
3
3
 
4
- var _chunkFZWI6S7Mcjs = require('./chunk-FZWI6S7M.cjs');
4
+ var _chunkIM5SIGUNcjs = require('./chunk-IM5SIGUN.cjs');
5
5
 
6
6
 
7
7
 
@@ -9,11 +9,11 @@ var _chunkFZWI6S7Mcjs = require('./chunk-FZWI6S7M.cjs');
9
9
 
10
10
 
11
11
 
12
- var _chunkURSNWPD4cjs = require('./chunk-URSNWPD4.cjs');
12
+ var _chunkV3IMDOZEcjs = require('./chunk-V3IMDOZE.cjs');
13
13
 
14
14
 
15
15
 
16
- var _chunk6COUUT2Ecjs = require('./chunk-6COUUT2E.cjs');
16
+ var _chunkMANE7HAZcjs = require('./chunk-MANE7HAZ.cjs');
17
17
 
18
18
  // src/ocr/models.ts
19
19
  var _path = require('path');
@@ -65,7 +65,7 @@ var OCR_REC_DICT = {
65
65
  sizeMb: 1
66
66
  };
67
67
  function getOcrModelsDir() {
68
- return _chunkFZWI6S7Mcjs.getModelsDir.call(void 0, "ppocr");
68
+ return _chunkIM5SIGUNcjs.getModelsDir.call(void 0, "ppocr");
69
69
  }
70
70
  var DEFAULT_OCR_MODELS = Object.freeze({
71
71
  det: { spec: OCR_DET_MODEL },
@@ -110,7 +110,7 @@ async function ensureOcrModelsFor(sel, onProgress) {
110
110
  if (!stamp || verifiedInProcess.get(path) !== stamp) todo.push(s.spec);
111
111
  }
112
112
  if (!todo.length) return;
113
- await _chunkFZWI6S7Mcjs.ensureModelsIn.call(void 0, dir, todo, onProgress);
113
+ await _chunkIM5SIGUNcjs.ensureModelsIn.call(void 0, dir, todo, onProgress);
114
114
  for (const spec of todo) {
115
115
  const path = _path.join.call(void 0, dir, spec.filename), stamp = await fileStamp(path);
116
116
  if (stamp) verifiedInProcess.set(path, stamp);
@@ -3201,16 +3201,16 @@ function recordOpenEndCellEdges(grid, cells, horizontals) {
3201
3201
  }
3202
3202
  function takeClipCellEdges(from, to) {
3203
3203
  const e = CLIP_CELL_EDGES.get(from);
3204
- if (e) _chunkURSNWPD4cjs.CELL_EDGES.set(to, e);
3204
+ if (e) _chunkV3IMDOZEcjs.CELL_EDGES.set(to, e);
3205
3205
  }
3206
3206
  function hasOpenCellSeam(a, b) {
3207
- const u = _chunkURSNWPD4cjs.CELL_EDGES.get(a), d = _chunkURSNWPD4cjs.CELL_EDGES.get(b);
3207
+ const u = _chunkV3IMDOZEcjs.CELL_EDGES.get(a), d = _chunkV3IMDOZEcjs.CELL_EDGES.get(b);
3208
3208
  return !!u && !!d && u.t && !u.b && !d.t && d.b && u.l && u.r && d.l && d.r;
3209
3209
  }
3210
3210
  function joinCellEdges(a, b) {
3211
- const u = _chunkURSNWPD4cjs.CELL_EDGES.get(a), d = _chunkURSNWPD4cjs.CELL_EDGES.get(b);
3211
+ const u = _chunkV3IMDOZEcjs.CELL_EDGES.get(a), d = _chunkV3IMDOZEcjs.CELL_EDGES.get(b);
3212
3212
  if (!u || !d) return;
3213
- _chunkURSNWPD4cjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
3213
+ _chunkV3IMDOZEcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
3214
3214
  }
3215
3215
 
3216
3216
  // src/pdf/cell-extract.ts
@@ -3386,7 +3386,7 @@ function tagScripts(text, lines) {
3386
3386
  const [s, e, kind] = marks[m];
3387
3387
  out = out.slice(0, s) + `<${kind}>` + out.slice(s, e) + `</${kind}>` + out.slice(e);
3388
3388
  }
3389
- return _chunkURSNWPD4cjs.tidyScriptTags.call(void 0, out);
3389
+ return _chunkV3IMDOZEcjs.tidyScriptTags.call(void 0, out);
3390
3390
  }
3391
3391
 
3392
3392
  // src/pdf/line-wrap.ts
@@ -4090,12 +4090,12 @@ function groupItemsToVisualLines(items) {
4090
4090
  var MIN_ALIGNED_COLUMNS = 3;
4091
4091
  var MIN_ALIGNED_LINES = 3;
4092
4092
  var ALIGNED_LINE_TOL = 0.5;
4093
- function alignedSubRows(itemsByCol) {
4093
+ function alignedSubRows(itemsByCol, minLines = MIN_ALIGNED_LINES) {
4094
4094
  const byCol = itemsByCol.map(groupItemsToVisualLines);
4095
4095
  const cols = byCol.filter((lines) => lines.length);
4096
4096
  if (cols.length < MIN_ALIGNED_COLUMNS) return null;
4097
4097
  const k = cols[0].length;
4098
- if (k < MIN_ALIGNED_LINES || cols.some((lines) => lines.length !== k)) return null;
4098
+ if (k < minLines || cols.some((lines) => lines.length !== k)) return null;
4099
4099
  const cy = (line) => line.reduce((s, it) => s + itemCenterY(it), 0) / line.length;
4100
4100
  for (let i = 0; i < k; i++) {
4101
4101
  const ys = cols.map((lines) => cy(lines[i]));
@@ -4104,7 +4104,7 @@ function alignedSubRows(itemsByCol) {
4104
4104
  }
4105
4105
  return Array.from({ length: k }, (_, i) => byCol.map((lines) => lines.length ? cellTextToString(lines[i]) : ""));
4106
4106
  }
4107
- function normalizeUndersegmentedTable(originalCells, colXs, items, rowYs, kept, maxRows = MAX_UNDERSEGMENTED_ROWS) {
4107
+ function normalizeUndersegmentedTable(originalCells, colXs, items, rowYs, kept, maxRows = MAX_UNDERSEGMENTED_ROWS, minAlignedLines = MIN_ALIGNED_LINES) {
4108
4108
  const numRows = originalCells.length;
4109
4109
  const numCols = colXs.length - 1;
4110
4110
  if (numRows > maxRows || numCols < MIN_UNDERSEGMENTED_COLUMNS) return null;
@@ -4120,11 +4120,14 @@ function normalizeUndersegmentedTable(originalCells, colXs, items, rowYs, kept,
4120
4120
  rebuilt2.push(row);
4121
4121
  continue;
4122
4122
  }
4123
- const rowItems = items.filter((item) => itemCenterY(item) <= rowYs[r] + 1 && itemCenterY(item) >= rowYs[r + 1] - 1);
4124
- const body = normalizeUndersegmentedTable([originalCells[r]], colXs, rowItems);
4123
+ const span2 = Math.min(numRows - r, Math.max(1, ...originalCells[r].map((cell) => _nullishCoalesce(cell.rowSpan, () => ( 1)))));
4124
+ const band = span2 > 1 && originalCells.slice(r + 1, r + span2).every((cells) => cells.every((cell) => !cell.text.trim())) ? span2 : 1;
4125
+ const rowItems = items.filter((item) => itemCenterY(item) <= rowYs[r] + 1 && itemCenterY(item) >= rowYs[r + band] - 1);
4126
+ const body = normalizeUndersegmentedTable([originalCells[r]], colXs, rowItems, void 0, void 0, void 0, band > 1 ? 2 : MIN_ALIGNED_LINES);
4125
4127
  if (body) {
4126
4128
  rebuilt2.push(...body);
4127
4129
  expanded++;
4130
+ r += band - 1;
4128
4131
  } else {
4129
4132
  _optionalChain([kept, 'optionalAccess', _116 => _116.set, 'call', _117 => _117(rebuilt2.length, r)]);
4130
4133
  rebuilt2.push(row);
@@ -4141,7 +4144,7 @@ function normalizeUndersegmentedTable(originalCells, colXs, items, rowYs, kept,
4141
4144
  for (const colItems of itemsByCol) {
4142
4145
  if (groupItemsToVisualLines(colItems).length >= MIN_UNDERSEGMENTED_TEXT_LINES) denseColumns++;
4143
4146
  }
4144
- if (denseColumns < 2) return numRows === 1 ? alignedSubRows(itemsByCol) : null;
4147
+ if (denseColumns < 2) return numRows === 1 ? alignedSubRows(itemsByCol, minAlignedLines) : null;
4145
4148
  const allLines = groupItemsToVisualLines(items.filter((i) => i.text.trim()));
4146
4149
  const bands = [];
4147
4150
  for (const line of allLines) {
@@ -4751,7 +4754,7 @@ function isChartTable(table, ocr = false) {
4751
4754
  if (table.rows < 3 || texts.length === 0) return false;
4752
4755
  const numeric = texts.filter((text) => NUMERIC_CELL.test(text)).length;
4753
4756
  if (numeric < texts.length * 0.5) return false;
4754
- if (ocr && table.cols >= 3 && (_nullishCoalesce(table.cells[0], () => ( []))).filter((cell) => /[가-힣]{2}/.test(cell.text)).length >= 2) return false;
4757
+ if (ocr && table.cols >= 3 && table.cells.slice(0, 3).some((row) => row.filter((cell) => /[가-힣]{2}/.test(cell.text)).length >= 2)) return false;
4755
4758
  for (let c = 0; c < table.cols; c++) {
4756
4759
  if (!ocr ? isValueAxisColumn(table, c) : hasValueAxis(table.cells.flatMap((row) => (_nullishCoalesce(_optionalChain([row, 'access', _139 => _139[c], 'optionalAccess', _140 => _140.text]), () => ( ""))).split(/\s+/)).filter((t) => TICK.test(t)).map((t) => Number(t.replace(/[,%]/g, ""))))) return true;
4757
4760
  }
@@ -4940,8 +4943,23 @@ function detectClusterTables(items, pageNum, rejected, lex) {
4940
4943
  }
4941
4944
  }
4942
4945
  return results.filter((r) => {
4943
- const prose = isTwoColumnProse(r) || isProseTable(r.table) || [...r.usedItems].every((it) => it.fontName === "ocr") && isProseFragmentTable(r.table);
4946
+ const twoColumns = isTwoColumnProse(r);
4947
+ const prose = twoColumns || isProseTable(r.table) || [...r.usedItems].every((it) => it.fontName === "ocr") && isProseFragmentTable(r.table);
4944
4948
  if (prose && rejected) rejected.prose++;
4949
+ if (twoColumns && rejected && [...r.usedItems].every((it) => it.fontName === "ocr")) {
4950
+ const used = [...r.usedItems].sort((a, b) => a.x - b.x);
4951
+ const total = used.reduce((n, it) => n + it.text.length, 0);
4952
+ let reach = used[0].x + used[0].w, chars = used[0].text.length, best = 0;
4953
+ for (const it of used.slice(1)) {
4954
+ const gap = it.x - reach, share = chars / total;
4955
+ if (gap >= 8 && gap > best && share >= 0.25 && share <= 0.75) {
4956
+ best = gap;
4957
+ rejected.cutX = (it.x + reach) / 2;
4958
+ }
4959
+ reach = Math.max(reach, it.x + it.w);
4960
+ chars += it.text.length;
4961
+ }
4962
+ }
4945
4963
  return !prose;
4946
4964
  });
4947
4965
  }
@@ -5138,7 +5156,8 @@ function detectSparseTwoColumnTables(rows, pageNum) {
5138
5156
  }
5139
5157
  function isTwoColumnProse(r) {
5140
5158
  const t = r.table;
5141
- if (t.rows < 8) return false;
5159
+ const ocr = [...r.usedItems].every((it) => it.fontName === "ocr");
5160
+ if (t.rows < (ocr ? 6 : 8)) return false;
5142
5161
  const dense = [];
5143
5162
  for (let c = 0; c < t.cols; c++) {
5144
5163
  const filled = t.cells.filter((row) => _optionalChain([row, 'access', _148 => _148[c], 'optionalAccess', _149 => _149.text, 'access', _150 => _150.trim, 'call', _151 => _151()])).length;
@@ -5148,9 +5167,9 @@ function isTwoColumnProse(r) {
5148
5167
  for (const c of dense) {
5149
5168
  const lens = t.cells.map((row) => _nullishCoalesce(_optionalChain([row, 'access', _152 => _152[c], 'optionalAccess', _153 => _153.text, 'access', _154 => _154.replace, 'call', _155 => _155(/\s+/g, ""), 'access', _156 => _156.length]), () => ( 0))).filter((n) => n > 0);
5150
5169
  const avg = lens.reduce((s, v) => s + v, 0) / (lens.length || 1);
5151
- if (avg < 12) return false;
5170
+ if (avg < (ocr ? 15 : 12)) return false;
5152
5171
  }
5153
- return findTwoColumnProseCutX([...r.usedItems]) !== null;
5172
+ return ocr || findTwoColumnProseCutX([...r.usedItems]) !== null;
5154
5173
  }
5155
5174
  function findTwoColumnProseCutX(items) {
5156
5175
  const lines = groupByBaseline(items);
@@ -6711,9 +6730,9 @@ function detectHeadings(blocks, medianFontSize) {
6711
6730
  if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
6712
6731
  const ratio = block.style.fontSize / medianFontSize;
6713
6732
  let level = 0;
6714
- if (ratio >= _chunkURSNWPD4cjs.HEADING_RATIO_H1) level = 1;
6715
- else if (ratio >= _chunkURSNWPD4cjs.HEADING_RATIO_H2) level = 2;
6716
- else if (ratio >= _chunkURSNWPD4cjs.HEADING_RATIO_H3) level = 3;
6733
+ if (ratio >= _chunkV3IMDOZEcjs.HEADING_RATIO_H1) level = 1;
6734
+ else if (ratio >= _chunkV3IMDOZEcjs.HEADING_RATIO_H2) level = 2;
6735
+ else if (ratio >= _chunkV3IMDOZEcjs.HEADING_RATIO_H3) level = 3;
6717
6736
  if (level > 0) {
6718
6737
  block.type = "heading";
6719
6738
  block.level = level;
@@ -6726,7 +6745,7 @@ function isChapterNumber(block, next, medianFontSize) {
6726
6745
  const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _187 => _187.style, 'optionalAccess', _188 => _188.fontSize]), () => ( 0));
6727
6746
  const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _189 => _189.text, 'optionalAccess', _190 => _190.trim, 'call', _191 => _191()]), () => ( ""));
6728
6747
  const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _192 => _192.bbox]);
6729
- return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _193 => _193.text, 'optionalAccess', _194 => _194.trim, 'call', _195 => _195()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkURSNWPD4cjs.HEADING_RATIO_H1 && text.length > 0 && text.length <= 80 && !/^[\d\s.]+$/.test(text) && !!a && !!b && a.y > b.y && a.y - (b.y + b.height) <= size * 2;
6748
+ return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _193 => _193.text, 'optionalAccess', _194 => _194.trim, 'call', _195 => _195()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkV3IMDOZEcjs.HEADING_RATIO_H1 && text.length > 0 && text.length <= 80 && !/^[\d\s.]+$/.test(text) && !!a && !!b && a.y > b.y && a.y - (b.y + b.height) <= size * 2;
6730
6749
  }
6731
6750
  function mergeStackedHeadingLines(blocks, medianFontSize) {
6732
6751
  for (let i = 0; i < blocks.length - 1; ) {
@@ -8464,16 +8483,16 @@ function isProseSpread(items) {
8464
8483
  for (let i = 1; i < sorted.length; i++) {
8465
8484
  gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
8466
8485
  }
8467
- const maxGap = _chunk6COUUT2Ecjs.safeMax.call(void 0, gaps);
8486
+ const maxGap = _chunkMANE7HAZcjs.safeMax.call(void 0, gaps);
8468
8487
  const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
8469
8488
  if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
8470
- const minGap = _chunk6COUUT2Ecjs.safeMin.call(void 0, gaps);
8489
+ const minGap = _chunkMANE7HAZcjs.safeMin.call(void 0, gaps);
8471
8490
  return minGap > 0 && maxGap - minGap <= Math.max(2, maxGap * 0.15) && (items.filter((i) => /^\P{L}*\p{Ll}/u.test(i.text)).length * 2 >= items.length || items.some((i) => /\p{L}[,.;:]["”’)]?$/u.test(i.text)));
8472
8491
  }
8473
8492
  function detectColumns(yLines) {
8474
8493
  const allItems = yLines.flat();
8475
8494
  if (allItems.length === 0) return null;
8476
- const pageWidth = _chunk6COUUT2Ecjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunk6COUUT2Ecjs.safeMin.call(void 0, allItems.map((i) => i.x));
8495
+ const pageWidth = _chunkMANE7HAZcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkMANE7HAZcjs.safeMin.call(void 0, allItems.map((i) => i.x));
8477
8496
  if (pageWidth < 100) return null;
8478
8497
  let bigoLineIdx = -1;
8479
8498
  for (let i = 0; i < yLines.length; i++) {
@@ -8871,13 +8890,13 @@ function partTex(group) {
8871
8890
  const base = Math.min(...g.filter((i) => i.fontSize >= size * SCRIPT_SIZE_RATIO).map((i) => i.y));
8872
8891
  let s = "", run = "";
8873
8892
  const flush = () => {
8874
- if (run) s += _chunkURSNWPD4cjs.toTex.call(void 0, run);
8893
+ if (run) s += _chunkV3IMDOZEcjs.toTex.call(void 0, run);
8875
8894
  run = "";
8876
8895
  };
8877
8896
  g.forEach((it, k) => {
8878
8897
  if (it.fontSize < size * SCRIPT_SIZE_RATIO && it.y - base >= size * SCRIPT_RISE_EM) {
8879
8898
  flush();
8880
- s += `^{${_chunkURSNWPD4cjs.toTex.call(void 0, it.text)}}`;
8899
+ s += `^{${_chunkV3IMDOZEcjs.toTex.call(void 0, it.text)}}`;
8881
8900
  return;
8882
8901
  }
8883
8902
  if (k && it.x - (g[k - 1].x + g[k - 1].w) > spaceGapThreshold(it.fontSize)) run += " ";
@@ -9050,7 +9069,7 @@ function rebuildUnitLine(items, grid) {
9050
9069
  function prependUnitRow(cells, cols, line, usedItems) {
9051
9070
  const text = cleanCellText(line.map((item) => item.text).join(""));
9052
9071
  cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
9053
- for (const cell of cells[0]) _chunkURSNWPD4cjs.CELL_EDGES.set(cell, NO_EDGES);
9072
+ for (const cell of cells[0]) _chunkV3IMDOZEcjs.CELL_EDGES.set(cell, NO_EDGES);
9054
9073
  for (const item of line) usedItems.add(item);
9055
9074
  }
9056
9075
  function attachUnitRow(items, grid, cells, cols, usedItems) {
@@ -9632,7 +9651,7 @@ function recordFrameTitle(table, source, pageNum) {
9632
9651
  const [label, spacer, title] = cells;
9633
9652
  if (!/^(?:붙임|별첨|첨부|부록)\s*\d{1,3}$/.test(label.text.trim()) || spacer.text.trim() || !title.text.trim()) return;
9634
9653
  if (cells.some((c) => {
9635
- const e = _chunkURSNWPD4cjs.CELL_EDGES.get(c);
9654
+ const e = _chunkV3IMDOZEcjs.CELL_EDGES.get(c);
9636
9655
  return !e || e.t || e.b || e.l || e.r;
9637
9656
  })) return;
9638
9657
  const xs = TABLE_COLXS.get(table), style = dominantStyle(source), fs = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _387 => _387.fontSize]), () => ( 0));
@@ -9820,6 +9839,7 @@ function extractPageBlocksWithLines(items, pageNum, opList, pageWidth, pageHeigh
9820
9839
  const ocrItems = items.length > 0 && items.every((it) => it.fontName === "ocr");
9821
9840
  let lineGrids = detectTables ? buildTableGrids(horizontals, verticals, !ocrItems) : [];
9822
9841
  if (ocrItems && lineGrids.length) {
9842
+ lineGrids = lineGrids.map((g) => openSideColumns(g, horizontals, verticals, items, lineGrids));
9823
9843
  for (const [grid, gutters] of ocrGutterVerticals(lineGrids, items)) {
9824
9844
  const { x1, y1, x2, y2 } = grid.bbox, tol = 1.5;
9825
9845
  const within = (l) => Math.min(l.x1, l.x2) >= x1 - tol && Math.max(l.x1, l.x2) <= x2 + tol && Math.min(l.y1, l.y2) >= y1 - tol && Math.max(l.y1, l.y2) <= y2 + tol;
@@ -9846,8 +9866,24 @@ function extractPageBlocksWithLines(items, pageNum, opList, pageWidth, pageHeigh
9846
9866
  return extractPageBlocksFallback(items, pageNum, true, detectTables, lex, figures());
9847
9867
  }
9848
9868
  const ocrSpan = ocrItems ? Math.max(...items.map((it) => it.y + it.h)) - Math.min(...items.map((it) => it.y)) : 0;
9849
- if (ocrItems && ocrSpan >= pageHeight * 0.5 && grids.length > 0 && grids.every((g) => g.rowYs.length === 2 && g.colXs.length === 2 && !g.cells && (g.bbox.x2 - g.bbox.x1) * (g.bbox.y2 - g.bbox.y1) < pageWidth * pageHeight * 0.02)) {
9850
- return extractPageBlocksFallback(items, pageNum, true, detectTables, lex, figures());
9869
+ if (ocrItems && ocrSpan >= pageHeight * 0.5) {
9870
+ for (let i = grids.length - 1; i >= 0; i--) {
9871
+ const g = grids[i];
9872
+ if (g.rowYs.length !== 2 || g.colXs.length !== 2 || g.cells || (g.bbox.x2 - g.bbox.x1) * (g.bbox.y2 - g.bbox.y1) < pageWidth * pageHeight * 0.5) continue;
9873
+ const inner = grids.filter((o) => o !== g && o.bbox.x1 >= g.bbox.x1 - 2 && o.bbox.x2 <= g.bbox.x2 + 2 && o.bbox.y1 >= g.bbox.y1 - 2 && o.bbox.y2 <= g.bbox.y2 + 2);
9874
+ if (inner.length === 0) continue;
9875
+ grids.splice(i, 1);
9876
+ for (const o of inner) {
9877
+ const spans = (x, toX) => [o.bbox.y1, o.bbox.y2].every((y) => horizontals.some((h) => Math.abs(h.y1 - y) < 3 && Math.min(h.x1, h.x2) <= Math.min(x, toX) + 4 && Math.max(h.x1, h.x2) >= Math.max(x, toX) - 4));
9878
+ let colXs = o.colXs;
9879
+ if (o.bbox.x1 - g.bbox.x1 > 20 && spans(g.bbox.x1, o.bbox.x2)) colXs = [g.bbox.x1, ...colXs];
9880
+ if (g.bbox.x2 - o.bbox.x2 > 20 && spans(o.bbox.x1, g.bbox.x2)) colXs = [...colXs, g.bbox.x2];
9881
+ if (colXs !== o.colXs) grids[grids.indexOf(o)] = { ...o, colXs, bbox: { ...o.bbox, x1: colXs[0], x2: colXs[colXs.length - 1] } };
9882
+ }
9883
+ }
9884
+ }
9885
+ if (ocrItems && ocrSpan >= pageHeight * 0.5 && grids.length > 0 && grids.every((g) => g.rowYs.length === 2 && g.colXs.length === 2 && !g.cells && ((g.bbox.x2 - g.bbox.x1) * (g.bbox.y2 - g.bbox.y1) < pageWidth * pageHeight * 0.02 || g.bbox.x2 - g.bbox.x1 < pageWidth * 0.55))) {
9886
+ return _nullishCoalesce(ruledColumnBlocks(items, horizontals, verticals, pageWidth, pageHeight, pageNum, detectTables, lex), () => ( extractPageBlocksFallback(items, pageNum, true, detectTables, lex, figures())));
9851
9887
  }
9852
9888
  const ruled = detectTables && clipGrids.length === 0 ? detectRuledBandTables(horizontals, verticals, items, pageNum) : [];
9853
9889
  if (detectTables && clipGrids.length === 0 && ruled.length === 0 && lineGrids.length === 0) ruled.push(...detectTextBoxTables(extracted.hiddenBoxes, items, pageNum));
@@ -9866,7 +9902,23 @@ function extractPageBlocksWithLines(items, pageNum, opList, pageWidth, pageHeigh
9866
9902
  const imageRegions = extractImageRegions(opList.fnArray, opList.argsArray).filter((r) => r.x2 - r.x1 >= 8 && r.y2 - r.y1 >= 8);
9867
9903
  return extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, horizontals, verticals, imageRegions, lex, [], rawRules, verifiedRightArrows);
9868
9904
  }
9869
- return extractPageBlocksFallback(items, pageNum, true, detectTables, lex, figures());
9905
+ return _nullishCoalesce((ocrItems ? ruledColumnBlocks(items, horizontals, verticals, pageWidth, pageHeight, pageNum, detectTables, lex) : null), () => ( extractPageBlocksFallback(items, pageNum, true, detectTables, lex, figures())));
9906
+ }
9907
+ function ruledColumnBlocks(items, horizontals, verticals, pageWidth, pageHeight, pageNum, detectTables, lex) {
9908
+ const rule = verticals.find((v) => {
9909
+ const x2 = v.x1, top2 = Math.max(v.y1, v.y2), bottom2 = Math.min(v.y1, v.y2);
9910
+ if (x2 < pageWidth * 0.4 || x2 > pageWidth * 0.6 || top2 - bottom2 < pageHeight * 0.45) return false;
9911
+ return !horizontals.some((h) => Math.min(h.x1, h.x2) < x2 - 5 && Math.max(h.x1, h.x2) > x2 + 5 && h.y1 > bottom2 + 5 && h.y1 < top2 - 5);
9912
+ });
9913
+ if (!rule) return null;
9914
+ const x = rule.x1, top = Math.max(rule.y1, rule.y2), bottom = Math.min(rule.y1, rule.y2);
9915
+ const mid = (it) => it.y + it.h / 2;
9916
+ const head = items.filter((it) => mid(it) > top), foot = items.filter((it) => mid(it) < bottom);
9917
+ const body = items.filter((it) => mid(it) <= top && mid(it) >= bottom);
9918
+ const left = body.filter((it) => it.x + it.w <= x + 2), right = body.filter((it) => it.x >= x - 2);
9919
+ if (left.length < 3 || right.length < 3 || left.length + right.length < body.length) return null;
9920
+ const read = (group, full) => group.length ? extractPageBlocksFallback(group, pageNum, full, detectTables, lex) : [];
9921
+ return [...read(head, false), ...read(left, false), ...read(right, false), ...read(foot, false)];
9870
9922
  }
9871
9923
  var STRIKE_MAX_THICKNESS = 2;
9872
9924
  var STRIKE_MAX_THICKNESS_RATIO = 0.25;
@@ -9926,7 +9978,38 @@ function rotatedGridBlocks(grid, tableItems, horizontals, verticals, pageNum, pa
9926
9978
  const bbox = { page: pageNum, x: b.x1, y: b.y1, width: b.x2 - b.x1, height: b.y2 - b.y1 };
9927
9979
  return out.map((blk) => ({ ...blk, bbox }));
9928
9980
  }
9929
- var OCR_NUMERIC_MAX_ROWS = 12;
9981
+ function openSideColumns(g, horizontals, verticals, items, grids = []) {
9982
+ if (g.cells || g.colXs.length < 4) return g;
9983
+ const { x1, x2, y1, y2 } = g.bbox;
9984
+ const inside = items.filter((it) => it.text.trim() && it.x >= x1 - 2 && it.x + it.w <= x2 + 2 && it.y >= y1 && it.y + it.h <= y2);
9985
+ if (!inside.length || inside.filter((it) => /^[\d.,%()+\-−–△▲▽▼\s]+$/.test(it.text.trim())).length < inside.length * 0.5) return g;
9986
+ const free = (a, b) => !grids.some((o) => o !== g && o.bbox.x1 < b - 2 && o.bbox.x2 > a + 2 && o.bbox.y1 < y2 - 2 && o.bbox.y2 > y1 + 2);
9987
+ const reach = (y, side) => {
9988
+ const ends = horizontals.filter((h) => Math.abs(h.y1 - y) <= 3).map((h) => [Math.min(h.x1, h.x2), Math.max(h.x1, h.x2)]).filter(([a, b]) => side < 0 ? a <= x1 - 15 && b >= x1 - 3 : b >= x2 + 15 && a <= x2 + 3).map(([a, b]) => side < 0 ? a : b);
9989
+ return ends.length ? side < 0 ? Math.min(...ends) : Math.max(...ends) : null;
9990
+ };
9991
+ const textBetween = (a, b) => free(a, b) && items.some((it) => it.text.trim() && it.x >= a - 2 && it.x + it.w <= b + 2 && it.y >= y1 && it.y + it.h <= y2);
9992
+ let colXs = g.colXs;
9993
+ const lt = reach(y2, -1), lb = reach(y1, -1);
9994
+ if (lt !== null && lb !== null) {
9995
+ const left = Math.max(lt, lb);
9996
+ if (textBetween(left, x1)) {
9997
+ colXs = [left, ...colXs];
9998
+ verticals.push({ x1: left, y1, x2: left, y2, lineWidth: 1 });
9999
+ }
10000
+ }
10001
+ const rt = reach(y2, 1), rb = reach(y1, 1);
10002
+ if (rt !== null && rb !== null) {
10003
+ const right = Math.min(rt, rb);
10004
+ if (textBetween(x2, right)) {
10005
+ colXs = [...colXs, right];
10006
+ verticals.push({ x1: right, y1, x2: right, y2, lineWidth: 1 });
10007
+ }
10008
+ }
10009
+ return colXs === g.colXs ? g : { ...g, colXs, bbox: { ...g.bbox, x1: colXs[0], x2: colXs[colXs.length - 1] } };
10010
+ }
10011
+ var OCR_NUMERIC_MAX_ROWS = 40;
10012
+ var OCR_NUMERIC_MAX_ROWS_FRAMED = 12;
9930
10013
  function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, horizontals, verticals, imageRegions = [], lex, ruled = [], rawRules = horizontals, verifiedRightArrows = []) {
9931
10014
  const ocrPage = items.length > 0 && items.every((i) => i.fontName === "ocr");
9932
10015
  const blocks = [];
@@ -10048,6 +10131,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
10048
10131
  let finalGrid = irGrid;
10049
10132
  let finalRows = numRows;
10050
10133
  let rebuiltUsed = false;
10134
+ let keptRows = null;
10051
10135
  const unitLine = !grid.cells && numRows >= 3 && numRows <= 5 && numCols >= 3 ? rebuildUnitLine(items, grid) : [];
10052
10136
  const numericBody = ocrPage && numRows >= 3 && (() => {
10053
10137
  const ls = irGrid.slice(1).flat().flatMap((c) => c.text.split("\n")).map((t) => t.trim()).filter(Boolean);
@@ -10058,12 +10142,14 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
10058
10142
  const bulletList = irGrid.slice(1).flat().some((c) => c.text.split("\n").filter((t) => /^\s*(?:[○◦•□■▪]|-\s*[^\d\s.,−-])/.test(t)).length >= 2);
10059
10143
  return !bulletList && ls.length > 0 && ls.filter(numericLine).length >= ls.length * 0.5;
10060
10144
  })();
10061
- const maxRows = numericBody ? OCR_NUMERIC_MAX_ROWS : 5;
10145
+ const layoutProse = irGrid.some((row) => row.some((c) => c.colSpan >= numCols - 1 && c.text.length > 60));
10146
+ const maxRows = numericBody ? layoutProse ? OCR_NUMERIC_MAX_ROWS_FRAMED : OCR_NUMERIC_MAX_ROWS : 5;
10062
10147
  if (!grid.cells && numRows <= maxRows && numCols >= 3 && !nestedAttached && (numRows <= 2 || unitLine.length > 0 || numericBody)) {
10063
10148
  const kept = /* @__PURE__ */ new Map();
10064
10149
  const rebuilt = normalizeUndersegmentedTable(irGrid, grid.colXs, textItems, grid.rowYs, kept, maxRows);
10065
10150
  if (rebuilt) {
10066
10151
  rebuiltUsed = true;
10152
+ if (ocrPage && numRows >= 3) keptRows = new Set(kept.values());
10067
10153
  if (!ocrPage) kept.clear();
10068
10154
  const newRow = new Map([...kept].map(([n, o]) => [o, n]));
10069
10155
  const spanRows = (r, span2) => {
@@ -10084,6 +10170,15 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
10084
10170
  for (let ti = 0; ti < textItems.length; ti++) {
10085
10171
  if (!assignedItems.has(textItems[ti])) usedItems.delete(owners[ti]);
10086
10172
  }
10173
+ } else if (keptRows) {
10174
+ const inExpanded = (it) => {
10175
+ const cy = it.y + (it.h > 0 ? it.h : it.fontSize) / 2;
10176
+ for (let r = 1; r < numRows; r++) if (!keptRows.has(r) && cy <= grid.rowYs[r] + 1 && cy >= grid.rowYs[r + 1] - 1) return true;
10177
+ return false;
10178
+ };
10179
+ for (let ti = 0; ti < textItems.length; ti++) {
10180
+ if (!assignedItems.has(textItems[ti]) && !inExpanded(textItems[ti])) usedItems.delete(owners[ti]);
10181
+ }
10087
10182
  }
10088
10183
  if (unitLine.length > 0 && rebuiltUsed && !/^\s*\(\s*단위\s*[::]/.test(_nullishCoalesce(_optionalChain([finalGrid, 'access', _411 => _411[0], 'optionalAccess', _412 => _412[0], 'optionalAccess', _413 => _413.text]), () => ( "")))) {
10089
10184
  prependUnitRow(finalGrid, numCols, unitLine, usedItems);
@@ -10294,7 +10389,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
10294
10389
  groupSizes.push(1);
10295
10390
  }
10296
10391
  const allY = remaining.map((i) => i.y);
10297
- const pageH = _chunk6COUUT2Ecjs.safeMax.call(void 0, allY) - _chunk6COUUT2Ecjs.safeMin.call(void 0, allY);
10392
+ const pageH = _chunkMANE7HAZcjs.safeMax.call(void 0, allY) - _chunkMANE7HAZcjs.safeMin.call(void 0, allY);
10298
10393
  const gapThreshold = Math.max(15, pageH * 0.03);
10299
10394
  const sides = frameColumnTextBands(remaining, spanning, gx);
10300
10395
  const textBlocks = [];
@@ -10310,7 +10405,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
10310
10405
  finalTextBlocks.push(...detectListBlocks(textBlocks));
10311
10406
  } else {
10312
10407
  const allY = remaining.map((i) => i.y);
10313
- const pageH = _chunk6COUUT2Ecjs.safeMax.call(void 0, allY) - _chunk6COUUT2Ecjs.safeMin.call(void 0, allY);
10408
+ const pageH = _chunkMANE7HAZcjs.safeMax.call(void 0, allY) - _chunkMANE7HAZcjs.safeMin.call(void 0, allY);
10314
10409
  const gapThreshold = Math.max(15, pageH * 0.03);
10315
10410
  const groups = xyCutOrder(remaining, gapThreshold);
10316
10411
  const textBlocks = [];
@@ -10611,6 +10706,10 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
10611
10706
  }
10612
10707
  const rejected = { prose: 0 };
10613
10708
  const clusterResults = detectTables ? detectClusterTables(clusterItems, pageNum, rejected, lex) : [];
10709
+ if (rejected.cutX !== void 0) {
10710
+ const groups = splitTwoColumnProse(items, rejected.cutX);
10711
+ if (groups.length > 1 && groups.every((g) => g.length < items.length)) return groups.flatMap((g) => extractPageBlocksFallback(g, pageNum, false, detectTables, lex));
10712
+ }
10614
10713
  if (clusterResults.length > 0) {
10615
10714
  const ciToIdx = /* @__PURE__ */ new Map();
10616
10715
  for (let ci = 0; ci < clusterItems.length; ci++) ciToIdx.set(clusterItems[ci], ci);
@@ -10642,7 +10741,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
10642
10741
  blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
10643
10742
  } else {
10644
10743
  const allY = items.map((i) => i.y);
10645
- const pageHeight = _chunk6COUUT2Ecjs.safeMax.call(void 0, allY) - _chunk6COUUT2Ecjs.safeMin.call(void 0, allY);
10744
+ const pageHeight = _chunkMANE7HAZcjs.safeMax.call(void 0, allY) - _chunkMANE7HAZcjs.safeMin.call(void 0, allY);
10646
10745
  const gapThreshold = Math.max(15, pageHeight * 0.03);
10647
10746
  const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold, 0, void 0, minGap);
10648
10747
  for (const group of orderedGroups) {
@@ -10885,4 +10984,4 @@ function rowParagraphs(block) {
10885
10984
 
10886
10985
 
10887
10986
  exports.DEFAULT_OCR_MODELS = DEFAULT_OCR_MODELS; exports.resolveOcrModels = resolveOcrModels; exports.handwritingFallbackModels = handwritingFallbackModels; exports.ocrSelectionKey = ocrSelectionKey; exports.ocrSourcePath = ocrSourcePath; exports.ensureOcrModelsFor = ensureOcrModelsFor; exports.ocrModelsCached = ocrModelsCached; exports.parseCharacterDict = parseCharacterDict; exports.grayCrop = grayCrop; exports.inkStats = inkStats; exports.splitRowBands = splitRowBands; exports.leadingTriangle = leadingTriangle; exports.arrowGlyph = arrowGlyph; exports.leaderRuns = leaderRuns; exports.inkBounds = inkBounds; exports.bracketFeatures = bracketFeatures; exports.slantedPair = slantedPair; exports.romanStems = romanStems; exports.circledAt = circledAt; exports.quoteHead = quoteHead; exports.edgeTrim = edgeTrim; exports.tallInkCount = tallInkCount; exports.gapGlyphs = gapGlyphs; exports.ringBullet = ringBullet; exports.dashRatio = dashRatio; exports.leadingRing = leadingRing; exports.discAt = discAt; exports.serifOne = serifOne; exports.starRun = starRun; exports.bracketShape = bracketShape; exports.leadingBullet = leadingBullet; exports.rememberOcrTextGaps = rememberOcrTextGaps; exports.copyOcrTextGaps = copyOcrTextGaps; exports.findOcrTextGaps = findOcrTextGaps; exports.extractLines = extractLines; exports.extractImageRegions = extractImageRegions; exports.NO_EDGES = NO_EDGES; exports.hasOpenCellSeam = hasOpenCellSeam; exports.joinCellEdges = joinCellEdges; exports.filterHiddenText = filterHiddenText; exports.collapseEvenSpacing = collapseEvenSpacing; exports.computeBBox = computeBBox; exports.dominantStyle = dominantStyle; exports.normalizeItems = normalizeItems; exports.groupByY = groupByY; exports.mergeLineSimple = mergeLineSimple; exports.WrapLexicon = WrapLexicon; exports.startsNewItem = startsNewItem; exports.wrapJoiner = wrapJoiner; exports.joinPageBreakWraps = joinPageBreakWraps; exports.splitPageBreakWraps = splitPageBreakWraps; exports.latinSoftWrap = latinSoftWrap; exports.TOC_BLOCKS = TOC_BLOCKS; exports.computeMedianFontSizeFromFreq = computeMedianFontSizeFromFreq; exports.detectHeadings = detectHeadings; exports.mergeStackedHeadingLines = mergeStackedHeadingLines; exports.detectTypographyHeadings = detectTypographyHeadings; exports.detectDocumentStyleHeadings = detectDocumentStyleHeadings; exports.detectSiblingStyleHeadings = detectSiblingStyleHeadings; exports.detectRepeatedPageLabels = detectRepeatedPageLabels; exports.detectPageLeadHeadings = detectPageLeadHeadings; exports.refineDocumentStyleHeadings = refineDocumentStyleHeadings; exports.detectMarkerHeadings = detectMarkerHeadings; exports.detectTableCaptions = detectTableCaptions; exports.detectKoreanListBlocks = detectKoreanListBlocks; exports.removeHeaderFooterBlocks = removeHeaderFooterBlocks; exports.runningLinePatterns = runningLinePatterns; exports.stripAbsorbedRunningLines = stripAbsorbedRunningLines; exports.CLIP_TABLES = CLIP_TABLES; exports.FRAME_TITLE_BLOCKS = FRAME_TITLE_BLOCKS; exports.TABLE_COLXS = TABLE_COLXS; exports.TABLE_ROWYS = TABLE_ROWYS; exports.TABLE_TAIL = TABLE_TAIL; exports.PART_COLXS = PART_COLXS; exports.EMPTY_PARTS = EMPTY_PARTS; exports.IMAGE_CELLS = IMAGE_CELLS; exports.FILLER_CELLS = FILLER_CELLS; exports.CONT_PARTS = CONT_PARTS; exports.CELL_LINES = CELL_LINES; exports.ROW_RULES = ROW_RULES; exports.trimTrailingEmptyTableCols = trimTrailingEmptyTableCols; exports.restoreImageBullets = restoreImageBullets; exports.detectRightArrowRegions = detectRightArrowRegions; exports.removeSideTabs = removeSideTabs; exports.extractPageBlocksWithLines = extractPageBlocksWithLines; exports.UNRULED_REGION_TABLES = UNRULED_REGION_TABLES; exports.mergeOcrImageRegions = mergeOcrImageRegions;
10888
- //# sourceMappingURL=chunk-ACQBUQB6.cjs.map
10987
+ //# sourceMappingURL=chunk-XYVTCXAG.cjs.map