kordoc 4.24.82 → 4.24.83

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 +2 -2
  2. package/dist/{-DOI2WS2X.js → -BF7WL3JN.js} +22 -22
  3. package/dist/{chunk-YH74TGTU.js → chunk-2CMM3NUX.js} +2 -2
  4. package/dist/{chunk-YQ3FNNH3.js → chunk-57LHDGWG.js} +3 -3
  5. package/dist/{chunk-G7ERL37A.cjs → chunk-5CHRWBM5.cjs} +58 -58
  6. package/dist/{chunk-G7ERL37A.cjs.map → chunk-5CHRWBM5.cjs.map} +1 -1
  7. package/dist/{chunk-RW6YV66W.cjs → chunk-5TLGD2TN.cjs} +6 -6
  8. package/dist/{chunk-RW6YV66W.cjs.map → chunk-5TLGD2TN.cjs.map} +1 -1
  9. package/dist/{chunk-WGBQGATZ.js → chunk-6DJCICPV.js} +6 -6
  10. package/dist/{chunk-HURH2Q3V.cjs → chunk-776M4SB3.cjs} +104 -104
  11. package/dist/{chunk-HURH2Q3V.cjs.map → chunk-776M4SB3.cjs.map} +1 -1
  12. package/dist/{chunk-HHOGCXPD.cjs → chunk-7O4AKNCQ.cjs} +3 -3
  13. package/dist/{chunk-HHOGCXPD.cjs.map → chunk-7O4AKNCQ.cjs.map} +1 -1
  14. package/dist/{chunk-VKX2R7NH.js → chunk-7TTHU25Z.js} +2 -2
  15. package/dist/{chunk-BBPVSM5G.js → chunk-AQX6XIQR.js} +11 -11
  16. package/dist/{chunk-E3TTZQCH.js → chunk-AUF45FZZ.js} +2 -2
  17. package/dist/{chunk-WPILSYFA.cjs → chunk-BI22HR52.cjs} +88 -88
  18. package/dist/{chunk-WPILSYFA.cjs.map → chunk-BI22HR52.cjs.map} +1 -1
  19. package/dist/{chunk-R67KB3VI.js → chunk-DPVVBMJO.js} +2 -2
  20. package/dist/{chunk-D6O3STKQ.js → chunk-DRFP3HZT.js} +10 -10
  21. package/dist/{chunk-JJIUF3BO.js → chunk-FOQ5FUQC.js} +3 -3
  22. package/dist/{chunk-4EQZ7S7Q.js → chunk-FVGCQ62L.js} +2 -2
  23. package/dist/{chunk-IK2ZHZIK.js → chunk-G6E2QFG5.js} +12 -8
  24. package/dist/chunk-G6E2QFG5.js.map +1 -0
  25. package/dist/{chunk-BVNYRR2Q.js → chunk-GWDMGZK5.js} +2 -2
  26. package/dist/{chunk-PF4X6Q2A.js → chunk-HN2OUCZW.js} +6 -6
  27. package/dist/{chunk-FDNNYTES.js → chunk-HULWSNPW.js} +2 -2
  28. package/dist/{chunk-MEOVK2T4.js → chunk-J5LQYKAQ.js} +2 -2
  29. package/dist/{chunk-OPFB4HIV.js → chunk-JDPRSJ5N.js} +2 -2
  30. package/dist/{chunk-MN67UQWM.js → chunk-JHV4WTF6.js} +2 -2
  31. package/dist/{chunk-LLTWOQHF.js → chunk-JTXZ5P3I.js} +2 -2
  32. package/dist/{chunk-L7IGFD7A.js → chunk-K2RVJ2MU.js} +2 -2
  33. package/dist/{chunk-GCIY73JI.js → chunk-KEREZG6B.js} +2 -2
  34. package/dist/{chunk-FP4YQ6PH.js → chunk-KIQFTC2A.js} +2 -2
  35. package/dist/{chunk-VTLJ7GQ6.js → chunk-L74KT62X.js} +5 -5
  36. package/dist/{chunk-WCCO4LDT.js → chunk-LD3YMVJF.js} +2 -2
  37. package/dist/{chunk-HJZ26CTR.js → chunk-NHWWANLE.js} +2 -2
  38. package/dist/{chunk-3CLLAJTD.js → chunk-O57YUC4A.js} +2 -2
  39. package/dist/{chunk-RI7RJQHA.js → chunk-OEI6K6XD.js} +2 -2
  40. package/dist/{chunk-FG3SD2G3.cjs → chunk-Q35XK5YB.cjs} +33 -29
  41. package/dist/chunk-Q35XK5YB.cjs.map +1 -0
  42. package/dist/{chunk-RUKITL4B.js → chunk-QGHEKT6I.js} +5 -5
  43. package/dist/{chunk-YIATOFKC.cjs → chunk-QXLGV6TW.cjs} +8 -8
  44. package/dist/{chunk-YIATOFKC.cjs.map → chunk-QXLGV6TW.cjs.map} +1 -1
  45. package/dist/{chunk-AIAWKYBK.cjs → chunk-RWGJWWIH.cjs} +3 -3
  46. package/dist/{chunk-AIAWKYBK.cjs.map → chunk-RWGJWWIH.cjs.map} +1 -1
  47. package/dist/{chunk-AWCNLRD7.js → chunk-SFAAXBQP.js} +11 -7
  48. package/dist/chunk-SFAAXBQP.js.map +1 -0
  49. package/dist/{chunk-5M5BK2KR.js → chunk-T7R44YHT.js} +3 -3
  50. package/dist/{chunk-4C6EU227.js → chunk-TL4EQHSB.js} +5 -5
  51. package/dist/{chunk-LHEA3T5U.js → chunk-TR67XDWU.js} +2 -2
  52. package/dist/{chunk-7LARA6JJ.js → chunk-TY762KOP.js} +3 -3
  53. package/dist/{chunk-6XIIPA2N.js → chunk-VBGNOJEH.js} +16 -16
  54. package/dist/{chunk-UBZROOIA.cjs → chunk-VEROU5AE.cjs} +2 -2
  55. package/dist/{chunk-UBZROOIA.cjs.map → chunk-VEROU5AE.cjs.map} +1 -1
  56. package/dist/{chunk-I3XQFXW3.js → chunk-XKAJ7BKS.js} +2 -2
  57. package/dist/{chunk-D5EQXF3A.js → chunk-XOCL63H5.js} +4 -4
  58. package/dist/{chunk-3LCJVBNH.js → chunk-Y4NVU4BD.js} +7 -7
  59. package/dist/{chunk-UVDXETZT.js → chunk-YXT2X5QP.js} +2 -2
  60. package/dist/chunks-RMZPBJIR.js +11 -0
  61. package/dist/cli.js +46 -46
  62. package/dist/{formula-Y35QOUQG.js → formula-FT7MPPA2.js} +4 -4
  63. package/dist/{formula-J4LHFTZY.js → formula-NN2TGSH4.js} +3 -3
  64. package/dist/{formula-EOGDE2KW.cjs → formula-QH6MCHWS.cjs} +9 -9
  65. package/dist/{formula-EOGDE2KW.cjs.map → formula-QH6MCHWS.cjs.map} +1 -1
  66. package/dist/generator-AO2GJH36.js +11 -0
  67. package/dist/generator-PXZESMLC.js +18 -0
  68. package/dist/generator-WMJOULV4.cjs +12 -0
  69. package/dist/{generator-GFZKAOIU.cjs.map → generator-WMJOULV4.cjs.map} +1 -1
  70. package/dist/{hancom-S2AZ3HZK.cjs → hancom-AZ5H6V3R.cjs} +5 -5
  71. package/dist/{hancom-S2AZ3HZK.cjs.map → hancom-AZ5H6V3R.cjs.map} +1 -1
  72. package/dist/{hancom-CYTGBQMY.js → hancom-OIIWEJYT.js} +2 -2
  73. package/dist/{hancom-K3DXLFM7.js → hancom-PWZK7UG3.js} +2 -2
  74. package/dist/{image-ocr-4FN5XYX5.cjs → image-ocr-BKEAB6BT.cjs} +36 -36
  75. package/dist/{image-ocr-4FN5XYX5.cjs.map → image-ocr-BKEAB6BT.cjs.map} +1 -1
  76. package/dist/{image-ocr-2TDI2P6X.js → image-ocr-DWRJDWKC.js} +11 -11
  77. package/dist/{image-ocr-OKGTS42T.js → image-ocr-MFSQUSJY.js} +8 -8
  78. package/dist/index.cjs +1115 -1115
  79. package/dist/index.js +10 -10
  80. package/dist/mcp.js +37 -37
  81. package/dist/memo-SOTG6YLU.js +17 -0
  82. package/dist/{model-bundle-4B2TOR2Y.js → model-bundle-2DHXCZBM.js} +5 -5
  83. package/dist/{models-3VJKRFZA.js → models-LJIUYEB6.js} +5 -5
  84. package/dist/{parse-worker-v2-KB2MQD24.js → parse-worker-v2-Y4MEARVU.js} +23 -23
  85. package/dist/{parser-GNNRTTBQ.js → parser-6LKPNLD4.js} +12 -12
  86. package/dist/{parser-RIXKUWYL.js → parser-QQWXPOZE.js} +9 -9
  87. package/dist/{parser-WP6URQHZ.cjs → parser-TSPLEFJ5.cjs} +283 -283
  88. package/dist/{parser-WP6URQHZ.cjs.map → parser-TSPLEFJ5.cjs.map} +1 -1
  89. package/dist/{pdf-ocr-YUIYIQ3V.js → pdf-ocr-DQVUSS3U.js} +6 -6
  90. package/dist/{pdf-ocr-YQ3EO3MU.js → pdf-ocr-F7K2DVLI.js} +9 -9
  91. package/dist/pdf-ocr-JFH3QLUM.cjs +43 -0
  92. package/dist/{pdf-ocr-KZHDUVLH.cjs.map → pdf-ocr-JFH3QLUM.cjs.map} +1 -1
  93. package/dist/{profile-io-TERSCXHN.js → profile-io-BNMFO3T5.js} +3 -3
  94. package/dist/{rasterize-37XS6Q7N.js → rasterize-JLSIA2RT.js} +3 -3
  95. package/dist/{redact-doc-4JKKOFR7.js → redact-doc-Y3CGWLFS.js} +22 -22
  96. package/dist/{render-ITR44KDL.js → render-2DTALMRC.js} +12 -12
  97. package/dist/{rewrite-fallback-HDPR4FHH.js → rewrite-fallback-F7R74E4G.js} +13 -13
  98. package/dist/seal-GHG447R7.js +16 -0
  99. package/dist/{setup-VQJ5E4C7.js → setup-FN6GXQ2N.js} +3 -3
  100. package/dist/to-hwpx-AJJQUD3W.cjs +16 -0
  101. package/dist/{to-hwpx-LHHVLGBY.cjs.map → to-hwpx-AJJQUD3W.cjs.map} +1 -1
  102. package/dist/{to-hwpx-AOJP2SOM.js → to-hwpx-CVTYEB6F.js} +7 -7
  103. package/dist/{to-hwpx-6TMP7TXQ.js → to-hwpx-MMKOHYIV.js} +4 -4
  104. package/dist/visual-LD4ZRRYI.js +40 -0
  105. package/dist/{watch-AM2GZPBV.js → watch-RISOIKZX.js} +23 -23
  106. package/package.json +1 -1
  107. package/dist/chunk-AWCNLRD7.js.map +0 -1
  108. package/dist/chunk-FG3SD2G3.cjs.map +0 -1
  109. package/dist/chunk-IK2ZHZIK.js.map +0 -1
  110. package/dist/chunks-SPCEB5T5.js +0 -11
  111. package/dist/generator-GFZKAOIU.cjs +0 -12
  112. package/dist/generator-TNUWCZBX.js +0 -11
  113. package/dist/generator-YERQXN6P.js +0 -18
  114. package/dist/memo-WYTLFL7W.js +0 -17
  115. package/dist/pdf-ocr-KZHDUVLH.cjs +0 -43
  116. package/dist/seal-RLAVI3L6.js +0 -16
  117. package/dist/to-hwpx-LHHVLGBY.cjs +0 -16
  118. package/dist/visual-H5ADD24W.js +0 -40
  119. /package/dist/{-DOI2WS2X.js.map → -BF7WL3JN.js.map} +0 -0
  120. /package/dist/{chunk-YH74TGTU.js.map → chunk-2CMM3NUX.js.map} +0 -0
  121. /package/dist/{chunk-YQ3FNNH3.js.map → chunk-57LHDGWG.js.map} +0 -0
  122. /package/dist/{chunk-WGBQGATZ.js.map → chunk-6DJCICPV.js.map} +0 -0
  123. /package/dist/{chunk-VKX2R7NH.js.map → chunk-7TTHU25Z.js.map} +0 -0
  124. /package/dist/{chunk-BBPVSM5G.js.map → chunk-AQX6XIQR.js.map} +0 -0
  125. /package/dist/{chunk-E3TTZQCH.js.map → chunk-AUF45FZZ.js.map} +0 -0
  126. /package/dist/{chunk-R67KB3VI.js.map → chunk-DPVVBMJO.js.map} +0 -0
  127. /package/dist/{chunk-D6O3STKQ.js.map → chunk-DRFP3HZT.js.map} +0 -0
  128. /package/dist/{chunk-JJIUF3BO.js.map → chunk-FOQ5FUQC.js.map} +0 -0
  129. /package/dist/{chunk-4EQZ7S7Q.js.map → chunk-FVGCQ62L.js.map} +0 -0
  130. /package/dist/{chunk-BVNYRR2Q.js.map → chunk-GWDMGZK5.js.map} +0 -0
  131. /package/dist/{chunk-PF4X6Q2A.js.map → chunk-HN2OUCZW.js.map} +0 -0
  132. /package/dist/{chunk-FDNNYTES.js.map → chunk-HULWSNPW.js.map} +0 -0
  133. /package/dist/{chunk-MEOVK2T4.js.map → chunk-J5LQYKAQ.js.map} +0 -0
  134. /package/dist/{chunk-OPFB4HIV.js.map → chunk-JDPRSJ5N.js.map} +0 -0
  135. /package/dist/{chunk-MN67UQWM.js.map → chunk-JHV4WTF6.js.map} +0 -0
  136. /package/dist/{chunk-LLTWOQHF.js.map → chunk-JTXZ5P3I.js.map} +0 -0
  137. /package/dist/{chunk-L7IGFD7A.js.map → chunk-K2RVJ2MU.js.map} +0 -0
  138. /package/dist/{chunk-GCIY73JI.js.map → chunk-KEREZG6B.js.map} +0 -0
  139. /package/dist/{chunk-FP4YQ6PH.js.map → chunk-KIQFTC2A.js.map} +0 -0
  140. /package/dist/{chunk-VTLJ7GQ6.js.map → chunk-L74KT62X.js.map} +0 -0
  141. /package/dist/{chunk-WCCO4LDT.js.map → chunk-LD3YMVJF.js.map} +0 -0
  142. /package/dist/{chunk-HJZ26CTR.js.map → chunk-NHWWANLE.js.map} +0 -0
  143. /package/dist/{chunk-3CLLAJTD.js.map → chunk-O57YUC4A.js.map} +0 -0
  144. /package/dist/{chunk-RI7RJQHA.js.map → chunk-OEI6K6XD.js.map} +0 -0
  145. /package/dist/{chunk-RUKITL4B.js.map → chunk-QGHEKT6I.js.map} +0 -0
  146. /package/dist/{chunk-5M5BK2KR.js.map → chunk-T7R44YHT.js.map} +0 -0
  147. /package/dist/{chunk-4C6EU227.js.map → chunk-TL4EQHSB.js.map} +0 -0
  148. /package/dist/{chunk-LHEA3T5U.js.map → chunk-TR67XDWU.js.map} +0 -0
  149. /package/dist/{chunk-7LARA6JJ.js.map → chunk-TY762KOP.js.map} +0 -0
  150. /package/dist/{chunk-6XIIPA2N.js.map → chunk-VBGNOJEH.js.map} +0 -0
  151. /package/dist/{chunk-I3XQFXW3.js.map → chunk-XKAJ7BKS.js.map} +0 -0
  152. /package/dist/{chunk-D5EQXF3A.js.map → chunk-XOCL63H5.js.map} +0 -0
  153. /package/dist/{chunk-3LCJVBNH.js.map → chunk-Y4NVU4BD.js.map} +0 -0
  154. /package/dist/{chunk-UVDXETZT.js.map → chunk-YXT2X5QP.js.map} +0 -0
  155. /package/dist/{chunks-SPCEB5T5.js.map → chunks-RMZPBJIR.js.map} +0 -0
  156. /package/dist/{formula-Y35QOUQG.js.map → formula-FT7MPPA2.js.map} +0 -0
  157. /package/dist/{formula-J4LHFTZY.js.map → formula-NN2TGSH4.js.map} +0 -0
  158. /package/dist/{generator-TNUWCZBX.js.map → generator-AO2GJH36.js.map} +0 -0
  159. /package/dist/{generator-YERQXN6P.js.map → generator-PXZESMLC.js.map} +0 -0
  160. /package/dist/{hancom-CYTGBQMY.js.map → hancom-OIIWEJYT.js.map} +0 -0
  161. /package/dist/{hancom-K3DXLFM7.js.map → hancom-PWZK7UG3.js.map} +0 -0
  162. /package/dist/{image-ocr-2TDI2P6X.js.map → image-ocr-DWRJDWKC.js.map} +0 -0
  163. /package/dist/{image-ocr-OKGTS42T.js.map → image-ocr-MFSQUSJY.js.map} +0 -0
  164. /package/dist/{memo-WYTLFL7W.js.map → memo-SOTG6YLU.js.map} +0 -0
  165. /package/dist/{model-bundle-4B2TOR2Y.js.map → model-bundle-2DHXCZBM.js.map} +0 -0
  166. /package/dist/{models-3VJKRFZA.js.map → models-LJIUYEB6.js.map} +0 -0
  167. /package/dist/{parse-worker-v2-KB2MQD24.js.map → parse-worker-v2-Y4MEARVU.js.map} +0 -0
  168. /package/dist/{parser-GNNRTTBQ.js.map → parser-6LKPNLD4.js.map} +0 -0
  169. /package/dist/{parser-RIXKUWYL.js.map → parser-QQWXPOZE.js.map} +0 -0
  170. /package/dist/{pdf-ocr-YQ3EO3MU.js.map → pdf-ocr-DQVUSS3U.js.map} +0 -0
  171. /package/dist/{pdf-ocr-YUIYIQ3V.js.map → pdf-ocr-F7K2DVLI.js.map} +0 -0
  172. /package/dist/{profile-io-TERSCXHN.js.map → profile-io-BNMFO3T5.js.map} +0 -0
  173. /package/dist/{rasterize-37XS6Q7N.js.map → rasterize-JLSIA2RT.js.map} +0 -0
  174. /package/dist/{redact-doc-4JKKOFR7.js.map → redact-doc-Y3CGWLFS.js.map} +0 -0
  175. /package/dist/{render-ITR44KDL.js.map → render-2DTALMRC.js.map} +0 -0
  176. /package/dist/{rewrite-fallback-HDPR4FHH.js.map → rewrite-fallback-F7R74E4G.js.map} +0 -0
  177. /package/dist/{seal-RLAVI3L6.js.map → seal-GHG447R7.js.map} +0 -0
  178. /package/dist/{setup-VQJ5E4C7.js.map → setup-FN6GXQ2N.js.map} +0 -0
  179. /package/dist/{to-hwpx-6TMP7TXQ.js.map → to-hwpx-CVTYEB6F.js.map} +0 -0
  180. /package/dist/{to-hwpx-AOJP2SOM.js.map → to-hwpx-MMKOHYIV.js.map} +0 -0
  181. /package/dist/{visual-H5ADD24W.js.map → visual-LD4ZRRYI.js.map} +0 -0
  182. /package/dist/{watch-AM2GZPBV.js.map → watch-RISOIKZX.js.map} +0 -0
@@ -37,7 +37,7 @@
37
37
 
38
38
 
39
39
 
40
- var _chunkFG3SD2G3cjs = require('./chunk-FG3SD2G3.cjs');
40
+ var _chunkQ35XK5YBcjs = require('./chunk-Q35XK5YB.cjs');
41
41
 
42
42
 
43
43
  var _chunkMMK32GPDcjs = require('./chunk-MMK32GPD.cjs');
@@ -50,7 +50,7 @@ var _chunk64H2FCYFcjs = require('./chunk-64H2FCYF.cjs');
50
50
 
51
51
 
52
52
 
53
- var _chunkUBZROOIAcjs = require('./chunk-UBZROOIA.cjs');
53
+ var _chunkVEROU5AEcjs = require('./chunk-VEROU5AE.cjs');
54
54
 
55
55
  // src/ocr/ocr-stacked-rows.ts
56
56
  var NUMERIC = /^[-+−△▲▽▼]?[\d.,]+[%p원]?$|^[-–—·∼~]원?$|^\([-+−△▲▽▼]?[\d.,]+%?\)$/;
@@ -852,8 +852,8 @@ var INKLESS_DELTA = 32;
852
852
  function ringAsks(rgba, pageW, box, text, steps, stepPx) {
853
853
  const chars = [...text];
854
854
  if (chars.length !== steps.length || !/[가-힣]/.test(text)) return [];
855
- const gray = _chunkFG3SD2G3cjs.grayCrop.call(void 0, rgba, pageW, box);
856
- const rings = _chunkFG3SD2G3cjs.ringBoxes.call(void 0, gray, box.w, box.h, _chunkFG3SD2G3cjs.inkStats.call(void 0, gray));
855
+ const gray = _chunkQ35XK5YBcjs.grayCrop.call(void 0, rgba, pageW, box);
856
+ const rings = _chunkQ35XK5YBcjs.ringBoxes.call(void 0, gray, box.w, box.h, _chunkQ35XK5YBcjs.inkStats.call(void 0, gray));
857
857
  const owner = ringOwners(chars, (i) => (steps[i] + 0.5) * stepPx, rings);
858
858
  return rings.flatMap((r, k) => {
859
859
  const at = owner.indexOf(k);
@@ -893,8 +893,8 @@ function ringGlyph(read, jamo = null, confidence = 1) {
893
893
  function restoreGlyphs(rgba, pageW, box, text, steps, stepPx, note = {}, rings = []) {
894
894
  const chars = [...text];
895
895
  if (chars.length !== steps.length) return text;
896
- const gray = _chunkFG3SD2G3cjs.grayCrop.call(void 0, rgba, pageW, box);
897
- const c = { chars, cx: (i) => (steps[i] + 0.5) * stepPx, gray, w: box.w, h: box.h, ink: _chunkFG3SD2G3cjs.inkStats.call(void 0, gray) };
896
+ const gray = _chunkQ35XK5YBcjs.grayCrop.call(void 0, rgba, pageW, box);
897
+ const c = { chars, cx: (i) => (steps[i] + 0.5) * stepPx, gray, w: box.w, h: box.h, ink: _chunkQ35XK5YBcjs.inkStats.call(void 0, gray) };
898
898
  if (/[[\]]/.test(text)) brackets(c);
899
899
  if (text.includes("'")) cornerQuotes(c);
900
900
  if (/['"]/.test(text)) quotes(c);
@@ -924,7 +924,7 @@ function restoreGlyphs(rgba, pageW, box, text, steps, stepPx, note = {}, rings =
924
924
  function trimInklessEnds(rgba, pageW, box, text, steps, stepPx) {
925
925
  const chars = [...text], { w, h } = box;
926
926
  if (chars.length !== steps.length || steps.some((s) => (s + 0.5) * stepPx > w + stepPx)) return { text, steps };
927
- const gray = _chunkFG3SD2G3cjs.grayCrop.call(void 0, rgba, pageW, box);
927
+ const gray = _chunkQ35XK5YBcjs.grayCrop.call(void 0, rgba, pageW, box);
928
928
  const hist = new Uint32Array(256);
929
929
  for (const v of gray) hist[v]++;
930
930
  let bg = 0;
@@ -955,8 +955,8 @@ function cornerCommas({ chars, cx, gray, w, h, ink }) {
955
955
  continue;
956
956
  }
957
957
  if (open > 0) {
958
- const f = _chunkFG3SD2G3cjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
959
- if (f && _chunkFG3SD2G3cjs.bracketShape.call(void 0, f, true) === "\u300D") {
958
+ const f = _chunkQ35XK5YBcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
959
+ if (f && _chunkQ35XK5YBcjs.bracketShape.call(void 0, f, true) === "\u300D") {
960
960
  chars[i] = "\u300D";
961
961
  open--;
962
962
  }
@@ -966,12 +966,12 @@ function cornerCommas({ chars, cx, gray, w, h, ink }) {
966
966
  function cornerQuotes({ chars, cx, gray, w, h, ink }) {
967
967
  for (let i = 0; i < chars.length; i++) {
968
968
  if (chars[i] !== "'" || !/^[가-힣]/.test(_nullishCoalesce(chars[i + 1], () => ( "")))) continue;
969
- const f = _chunkFG3SD2G3cjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
970
- if (!f || f.ch < f.charH * 0.45 || _chunkFG3SD2G3cjs.bracketShape.call(void 0, f, false) !== "\u300C") continue;
969
+ const f = _chunkQ35XK5YBcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
970
+ if (!f || f.ch < f.charH * 0.45 || _chunkQ35XK5YBcjs.bracketShape.call(void 0, f, false) !== "\u300C") continue;
971
971
  const rest = chars.slice(i + 1), end = rest.findIndex((c) => c === "'" || c === "\u300D" || c === ",");
972
972
  const pair = end >= 0 && rest[end] !== "'" && (rest[end] === "\u300D" || (() => {
973
- const g = _chunkFG3SD2G3cjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i + 1 + end));
974
- return !!g && _chunkFG3SD2G3cjs.bracketShape.call(void 0, g, true) === "\u300D";
973
+ const g = _chunkQ35XK5YBcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i + 1 + end));
974
+ return !!g && _chunkQ35XK5YBcjs.bracketShape.call(void 0, g, true) === "\u300D";
975
975
  })());
976
976
  if (pair) chars[i] = "\u300C";
977
977
  }
@@ -979,8 +979,8 @@ function cornerQuotes({ chars, cx, gray, w, h, ink }) {
979
979
  function brackets({ chars, cx, gray, w, h, ink }) {
980
980
  const shape = chars.map((c, i) => {
981
981
  if (c !== "[" && c !== "]") return null;
982
- const f = _chunkFG3SD2G3cjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
983
- return f && _chunkFG3SD2G3cjs.bracketShape.call(void 0, f, c === "]");
982
+ const f = _chunkQ35XK5YBcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
983
+ return f && _chunkQ35XK5YBcjs.bracketShape.call(void 0, f, c === "]");
984
984
  });
985
985
  for (let i = 0; i < chars.length; i++) {
986
986
  if (chars[i] !== "[") continue;
@@ -1012,7 +1012,7 @@ function quotes({ chars, cx, gray, w, h, ink }) {
1012
1012
  continue;
1013
1013
  }
1014
1014
  if (!year(i) && !single[kind]) continue;
1015
- const r = _chunkFG3SD2G3cjs.quoteHead.call(void 0, gray, w, h, ink, cx(i));
1015
+ const r = _chunkQ35XK5YBcjs.quoteHead.call(void 0, gray, w, h, ink, cx(i));
1016
1016
  if (r !== null && r >= 0.47) {
1017
1017
  chars[i] = kind === "'" ? "\u2018" : "\u201C";
1018
1018
  open[kind] = true;
@@ -1023,7 +1023,7 @@ function dashes({ chars, cx, gray, w, h, ink }) {
1023
1023
  const head = chars.findIndex((c) => c.trim()), letters = chars.some((c) => /[가-힣A-Za-z]/.test(c));
1024
1024
  for (let i = 0; i < chars.length; i++) {
1025
1025
  if (!/^[-\u2013\u2014]$/.test(chars[i])) continue;
1026
- const r = _chunkFG3SD2G3cjs.dashRatio.call(void 0, gray, w, h, ink, cx(i));
1026
+ const r = _chunkQ35XK5YBcjs.dashRatio.call(void 0, gray, w, h, ink, cx(i));
1027
1027
  if (r === null) continue;
1028
1028
  if (r < 0.65) chars[i] = "-";
1029
1029
  else if (r > 0.75 && i === head && letters) chars[i] = "\u2014";
@@ -1033,7 +1033,7 @@ function circled({ chars, cx, gray, w, h, ink }) {
1033
1033
  const alone = (re, i) => re.test(chars[i]) && !re.test(_nullishCoalesce(chars[i - 1], () => ( ""))) && !re.test(_nullishCoalesce(chars[i + 1], () => ( "")));
1034
1034
  const at = chars.flatMap((_, i) => alone(/^\d$/, i) && chars[i] !== "0" || alone(/^[ㄱ-ㅎ]$/, i) || alone(/^[A-Za-z]$/, i) && /[a-zCSUVWXZ]/.test(chars[i]) ? [i] : []);
1035
1035
  if (!at.length) return;
1036
- const hit = _chunkFG3SD2G3cjs.circledAt.call(void 0, gray, w, h, ink, at.map(cx));
1036
+ const hit = _chunkQ35XK5YBcjs.circledAt.call(void 0, gray, w, h, ink, at.map(cx));
1037
1037
  const JAMO = "\u3131\u3134\u3137\u3139\u3141\u3142\u3145\u3147\u3148\u314A\u314B\u314C\u314D\u314E";
1038
1038
  at.forEach((i, k) => {
1039
1039
  if (!hit[k]) return;
@@ -1046,16 +1046,16 @@ function stars({ chars, cx, gray, w, h, ink }) {
1046
1046
  if (chars[i] !== "*" || chars[i - 1] === "*") continue;
1047
1047
  let e = i;
1048
1048
  while (chars[e + 1] === "*") e++;
1049
- const n = _chunkFG3SD2G3cjs.starRun.call(void 0, gray, w, h, ink, cx(i));
1049
+ const n = _chunkQ35XK5YBcjs.starRun.call(void 0, gray, w, h, ink, cx(i));
1050
1050
  if (n > e - i + 1 && n <= 4) chars[e] += "*".repeat(n - (e - i + 1));
1051
1051
  i = e;
1052
1052
  }
1053
1053
  }
1054
1054
  function discs({ chars, cx, gray, w, h, ink }) {
1055
- for (let i = 0; i < chars.length; i++) if (/^[\u00b7\u2022]$/.test(chars[i]) && _chunkFG3SD2G3cjs.discAt.call(void 0, gray, w, h, ink, cx(i))) chars[i] = "\u25CF";
1055
+ for (let i = 0; i < chars.length; i++) if (/^[\u00b7\u2022]$/.test(chars[i]) && _chunkQ35XK5YBcjs.discAt.call(void 0, gray, w, h, ink, cx(i))) chars[i] = "\u25CF";
1056
1056
  }
1057
1057
  function gaps({ chars, cx, gray, w, h, ink }) {
1058
- const { glyphs, bandH } = _chunkFG3SD2G3cjs.gapGlyphs.call(void 0, gray, w, h, ink);
1058
+ const { glyphs, bandH } = _chunkQ35XK5YBcjs.gapGlyphs.call(void 0, gray, w, h, ink);
1059
1059
  if (!glyphs.length) return;
1060
1060
  const live = chars.map((c, i) => i).filter((i) => chars[i].trim());
1061
1061
  if (!live.length) return;
@@ -1126,18 +1126,18 @@ function ring({ chars, cx, gray, w, h, ink }) {
1126
1126
  const rest = chars.slice(k + 1).join("").trimStart();
1127
1127
  const live = chars.map((c, i) => i).filter((i) => chars[i].trim());
1128
1128
  if (live.length <= 3 && live.every((i) => /^[Oo]$/.test(chars[i]))) {
1129
- if (_optionalChain([_chunkFG3SD2G3cjs.leadingBullet.call(void 0, gray, w, h, ink, cx(live[0])), 'optionalAccess', _11 => _11.mark]) === "\u25CE") return false;
1130
- if (!live.every((i) => _chunkFG3SD2G3cjs.ringBullet.call(void 0, gray, w, h, ink, cx(i)) === "\u25CB")) return false;
1129
+ if (_optionalChain([_chunkQ35XK5YBcjs.leadingBullet.call(void 0, gray, w, h, ink, cx(live[0])), 'optionalAccess', _11 => _11.mark]) === "\u25CE") return false;
1130
+ if (!live.every((i) => _chunkQ35XK5YBcjs.ringBullet.call(void 0, gray, w, h, ink, cx(i)) === "\u25CB")) return false;
1131
1131
  for (const i of live) chars[i] = "\u25CB";
1132
1132
  return true;
1133
1133
  }
1134
1134
  if (/^[A-Z]{2,}/.test(rest) && /^[Oo0]$/.test(chars[k])) {
1135
- if (_chunkFG3SD2G3cjs.ringBullet.call(void 0, gray, w, h, ink, cx(k)) !== "\u25CB") return false;
1135
+ if (_chunkQ35XK5YBcjs.ringBullet.call(void 0, gray, w, h, ink, cx(k)) !== "\u25CB") return false;
1136
1136
  chars[k] = chars[k + 1] === " " ? "\u25CB" : "\u25CB ";
1137
1137
  return true;
1138
1138
  }
1139
1139
  if (!/^[(\[「【<]?\d*[가-힣]/.test(rest)) return false;
1140
- const r = _chunkFG3SD2G3cjs.ringBullet.call(void 0, gray, w, h, ink, cx(k));
1140
+ const r = _chunkQ35XK5YBcjs.ringBullet.call(void 0, gray, w, h, ink, cx(k));
1141
1141
  if (/^[Cc]$/.test(chars[k]) && r !== "\u25CB") return false;
1142
1142
  if (r) chars[k] = r;
1143
1143
  return r !== null;
@@ -1154,7 +1154,7 @@ function parallels({ chars, cx, gray, w, h, ink }) {
1154
1154
  let p = s - 1, q = e + 1;
1155
1155
  while (p >= 0 && !chars[p].trim()) p--;
1156
1156
  while (q < chars.length && !chars[q].trim()) q++;
1157
- if (_chunkFG3SD2G3cjs.slantedPair.call(void 0, gray, w, h, ink, p >= 0 ? cx(p) : -Infinity, q < chars.length ? cx(q) : Infinity)) {
1157
+ if (_chunkQ35XK5YBcjs.slantedPair.call(void 0, gray, w, h, ink, p >= 0 ? cx(p) : -Infinity, q < chars.length ? cx(q) : Infinity)) {
1158
1158
  chars[s] = "\u2225";
1159
1159
  for (let k = s + 1; k <= e; k++) chars[k] = "";
1160
1160
  }
@@ -1166,7 +1166,7 @@ function roman({ chars, cx, gray, w, h, ink }) {
1166
1166
  const ROMAN = /^[IⅠ-Ⅲ]$/, LATIN = /[A-Za-z]$/;
1167
1167
  for (let i = 0; i < chars.length; i++) {
1168
1168
  if (chars[i] !== "1" || /[\dA-Za-z]$/.test(_nullishCoalesce(chars[i - 1], () => ( ""))) || /^[\dA-Za-z,]/.test(_nullishCoalesce(chars[i + 1], () => ( "")))) continue;
1169
- if (_chunkFG3SD2G3cjs.serifOne.call(void 0, gray, w, h, ink, cx(i))) chars[i] = "\u2160";
1169
+ if (_chunkQ35XK5YBcjs.serifOne.call(void 0, gray, w, h, ink, cx(i))) chars[i] = "\u2160";
1170
1170
  }
1171
1171
  for (let i = 0; i < chars.length; i++) {
1172
1172
  const hangul = /^[파피]$/.test(chars[i]);
@@ -1176,13 +1176,13 @@ function roman({ chars, cx, gray, w, h, ink }) {
1176
1176
  while (q < chars.length && !chars[q].trim()) q++;
1177
1177
  const glued = hangul ? chars[p] === "(" && chars[q] === "-" : /[가-힣]$/.test(_nullishCoalesce(chars[i - 1], () => ( ""))) || (_nullishCoalesce(chars[i + 1], () => ( ""))) === "." || chars[p] === "-" && chars[q] === "-";
1178
1178
  if (!glued) continue;
1179
- const n = _chunkFG3SD2G3cjs.romanStems.call(void 0, gray, w, h, ink, p >= 0 ? cx(p) : -Infinity, q < chars.length ? cx(q) : Infinity, /[가-힣]$/.test(_nullishCoalesce(chars[p], () => ( ""))));
1179
+ const n = _chunkQ35XK5YBcjs.romanStems.call(void 0, gray, w, h, ink, p >= 0 ? cx(p) : -Infinity, q < chars.length ? cx(q) : Infinity, /[가-힣]$/.test(_nullishCoalesce(chars[p], () => ( ""))));
1180
1180
  if (n) chars[i] = String.fromCharCode(8543 + n);
1181
1181
  }
1182
1182
  const inRoman = (i) => ROMAN.test(chars[i]) || chars[i] === "1" && (ROMAN.test(_nullishCoalesce(chars[i - 1], () => ( ""))) || ROMAN.test(_nullishCoalesce(chars[i + 1], () => ( ""))));
1183
1183
  const k = chars.findIndex((c) => c.trim());
1184
1184
  if (chars[k] === "." && chars.slice(k + 1).some((c) => /[가-힣A-Za-z0-9]/.test(c))) {
1185
- const n = _chunkFG3SD2G3cjs.romanStems.call(void 0, gray, w, h, ink, -Infinity, cx(k));
1185
+ const n = _chunkQ35XK5YBcjs.romanStems.call(void 0, gray, w, h, ink, -Infinity, cx(k));
1186
1186
  if (n) chars[k] = String.fromCharCode(8543 + n) + chars[k];
1187
1187
  }
1188
1188
  for (let s = 0; s < chars.length; ) {
@@ -1200,7 +1200,7 @@ function roman({ chars, cx, gray, w, h, ink }) {
1200
1200
  let p = s - 1, q = e;
1201
1201
  while (p >= 0 && !chars[p].trim()) p--;
1202
1202
  while (q < chars.length && !chars[q].trim()) q++;
1203
- const n = _chunkFG3SD2G3cjs.romanStems.call(void 0, gray, w, h, ink, p >= 0 ? cx(p) : -Infinity, q < chars.length ? cx(q) : Infinity, /[가-힣]$/.test(_nullishCoalesce(chars[p], () => ( ""))));
1203
+ const n = _chunkQ35XK5YBcjs.romanStems.call(void 0, gray, w, h, ink, p >= 0 ? cx(p) : -Infinity, q < chars.length ? cx(q) : Infinity, /[가-힣]$/.test(_nullishCoalesce(chars[p], () => ( ""))));
1204
1204
  const canon = n ? [["\u2160", "I"], ["\u2161", "II"], ["\u2162", "III"]][n - 1] : null;
1205
1205
  if (canon && !canon.includes(tok)) {
1206
1206
  chars[s] = canon[0];
@@ -1629,8 +1629,8 @@ function joinGapLeaders(rgba, width, items) {
1629
1629
  if (g1 - g0 < h * 3) continue;
1630
1630
  const pad = Math.round(h * 0.25), y = Math.max(0, Math.min(left.y, num.y) - pad), x = Math.max(0, Math.round(g0 - h));
1631
1631
  const box = { x, y, w: Math.min(width, Math.round(g1 + h)) - x, h: Math.min(Math.floor(rgba.length / 4 / width), Math.max(left.y + left.h, num.y + num.h) + pad) - y };
1632
- const gray = _chunkFG3SD2G3cjs.grayCrop.call(void 0, rgba, width, box);
1633
- const runs = _chunkFG3SD2G3cjs.leaderRuns.call(void 0, gray, box.w, box.h, _chunkFG3SD2G3cjs.inkStats.call(void 0, gray), LEADER_MIN_DOTS);
1632
+ const gray = _chunkQ35XK5YBcjs.grayCrop.call(void 0, rgba, width, box);
1633
+ const runs = _chunkQ35XK5YBcjs.leaderRuns.call(void 0, gray, box.w, box.h, _chunkQ35XK5YBcjs.inkStats.call(void 0, gray), LEADER_MIN_DOTS);
1634
1634
  const cover = runs.reduce((k, [a, b]) => k + Math.max(0, Math.min(b, g1 - box.x) - Math.max(a, g0 - box.x)), 0);
1635
1635
  if (cover < (g1 - g0) * 0.6) continue;
1636
1636
  for (const o of items) if (junk(o) && sameLine(o, num) && o.x >= g0 - 2 && o.x + o.w <= g1 + 2) gone.add(o);
@@ -1913,7 +1913,7 @@ var OcrEngine = class _OcrEngine {
1913
1913
  this.ort = parts.ort;
1914
1914
  this.sharp = parts.sharp;
1915
1915
  }
1916
- static async create(models = _chunkFG3SD2G3cjs.DEFAULT_OCR_MODELS) {
1916
+ static async create(models = _chunkQ35XK5YBcjs.DEFAULT_OCR_MODELS) {
1917
1917
  _chunkTK3FDAEEcjs.disableOrtTelemetry.call(void 0, );
1918
1918
  const [ortMod, sharpModRaw] = await Promise.all([
1919
1919
  tryImport("onnxruntime-node", () => Promise.resolve().then(() => _interopRequireWildcard(require("onnxruntime-node")))),
@@ -1933,16 +1933,16 @@ var OcrEngine = class _OcrEngine {
1933
1933
  const local = (s) => "spec" in s ? Promise.resolve(null) : verifiedBytes(s);
1934
1934
  const [detBytes, recBytes, dictBytes] = await Promise.all([local(models.det), local(models.rec), local(models.dict)]);
1935
1935
  const session = (s, bytes) => bytes ? ortMod.InferenceSession.create(bytes, sessionOpts).catch(() => {
1936
- throw new (0, _chunkUBZROOIAcjs.KordocError)(`OCR \uBAA8\uB378\uC744 \uC5F4\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${_path.basename.call(void 0, _chunkFG3SD2G3cjs.ocrSourcePath.call(void 0, s))} \u2014 ONNX \uBAA8\uB378\uC774 \uC544\uB2C8\uAC70\uB098 \uC190\uC0C1\uB410\uC2B5\uB2C8\uB2E4`);
1937
- }) : ortMod.InferenceSession.create(_chunkFG3SD2G3cjs.ocrSourcePath.call(void 0, s), sessionOpts);
1936
+ throw new (0, _chunkVEROU5AEcjs.KordocError)(`OCR \uBAA8\uB378\uC744 \uC5F4\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${_path.basename.call(void 0, _chunkQ35XK5YBcjs.ocrSourcePath.call(void 0, s))} \u2014 ONNX \uBAA8\uB378\uC774 \uC544\uB2C8\uAC70\uB098 \uC190\uC0C1\uB410\uC2B5\uB2C8\uB2E4`);
1937
+ }) : ortMod.InferenceSession.create(_chunkQ35XK5YBcjs.ocrSourcePath.call(void 0, s), sessionOpts);
1938
1938
  const [det, rec, dictYml] = await Promise.all([
1939
1939
  session(models.det, detBytes),
1940
1940
  session(models.rec, recBytes),
1941
- dictBytes ? new TextDecoder().decode(dictBytes) : _promises.readFile.call(void 0, _chunkFG3SD2G3cjs.ocrSourcePath.call(void 0, models.dict), "utf-8")
1941
+ dictBytes ? new TextDecoder().decode(dictBytes) : _promises.readFile.call(void 0, _chunkQ35XK5YBcjs.ocrSourcePath.call(void 0, models.dict), "utf-8")
1942
1942
  ]);
1943
- const dict = _chunkFG3SD2G3cjs.parseCharacterDict.call(void 0, dictYml);
1943
+ const dict = _chunkQ35XK5YBcjs.parseCharacterDict.call(void 0, dictYml);
1944
1944
  if (dict.length === 0) {
1945
- throw "spec" in models.dict ? new Error("OCR \uC0AC\uC804 \uD30C\uC2F1 \uC2E4\uD328 \u2014 \uBAA8\uB378 \uCE90\uC2DC\uB97C \uC0AD\uC81C \uD6C4 \uC7AC\uB2E4\uC6B4\uB85C\uB4DC\uD558\uC138\uC694") : new (0, _chunkUBZROOIAcjs.KordocError)(`OCR \uC0AC\uC804 \uD30C\uC2F1 \uC2E4\uD328 \u2014 ${_path.basename.call(void 0, models.dict.file.path)} \uC5D0 PostProcess.character_dict \uBAA9\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4`);
1945
+ throw "spec" in models.dict ? new Error("OCR \uC0AC\uC804 \uD30C\uC2F1 \uC2E4\uD328 \u2014 \uBAA8\uB378 \uCE90\uC2DC\uB97C \uC0AD\uC81C \uD6C4 \uC7AC\uB2E4\uC6B4\uB85C\uB4DC\uD558\uC138\uC694") : new (0, _chunkVEROU5AEcjs.KordocError)(`OCR \uC0AC\uC804 \uD30C\uC2F1 \uC2E4\uD328 \u2014 ${_path.basename.call(void 0, models.dict.file.path)} \uC5D0 PostProcess.character_dict \uBAA9\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4`);
1946
1946
  }
1947
1947
  return new _OcrEngine({ det, rec, dict, ort: ortMod, sharp: sharpMod });
1948
1948
  }
@@ -1974,10 +1974,10 @@ var OcrEngine = class _OcrEngine {
1974
1974
  if (it.x - x < it.h * 0.8) return;
1975
1975
  if (items.some((o) => o !== it && o.x < it.x && o.x + o.w > x && o.y < it.y + it.h && o.y + o.h > it.y)) return;
1976
1976
  const box = { x, y: it.y, w: it.x + it.w - x, h: it.h };
1977
- const g = _chunkFG3SD2G3cjs.grayCrop.call(void 0, rgba, width, box);
1978
- const b = _chunkFG3SD2G3cjs.leadingBullet.call(void 0, g, box.w, box.h, _chunkFG3SD2G3cjs.inkStats.call(void 0, g), it.x - x, 1.05);
1977
+ const g = _chunkQ35XK5YBcjs.grayCrop.call(void 0, rgba, width, box);
1978
+ const b = _chunkQ35XK5YBcjs.leadingBullet.call(void 0, g, box.w, box.h, _chunkQ35XK5YBcjs.inkStats.call(void 0, g), it.x - x, 1.05);
1979
1979
  if (_optionalChain([b, 'optionalAccess', _36 => _36.mark]) !== "\u25A1" || b.covers) return;
1980
- const ink = _chunkFG3SD2G3cjs.inkStats.call(void 0, g), on = (v) => ink.darkInk ? v <= ink.threshold : v > ink.threshold;
1980
+ const ink = _chunkQ35XK5YBcjs.inkStats.call(void 0, g), on = (v) => ink.darkInk ? v <= ink.threshold : v > ink.threshold;
1981
1981
  let left = 0;
1982
1982
  while (left < it.x - x && !Array.from({ length: box.h }, (_, y) => g[y * box.w + left]).some(on)) left++;
1983
1983
  it.text = "\u25A1 " + it.text;
@@ -2009,12 +2009,12 @@ var OcrEngine = class _OcrEngine {
2009
2009
  const joins = [];
2010
2010
  let group = 0;
2011
2011
  for (const b of boxes) {
2012
- const gray = _chunkFG3SD2G3cjs.grayCrop.call(void 0, rgba, width, b);
2013
- const ink = _chunkFG3SD2G3cjs.inkStats.call(void 0, gray);
2012
+ const gray = _chunkQ35XK5YBcjs.grayCrop.call(void 0, rgba, width, b);
2013
+ const ink = _chunkQ35XK5YBcjs.inkStats.call(void 0, gray);
2014
2014
  if (tuning.minInkContrast > 0 && ink.contrast < tuning.minInkContrast) continue;
2015
2015
  if (tuning.minInkContrast > 0 && ink.inkRatio < MIN_INK_RATIO) continue;
2016
2016
  if (tuning.splitTall && b.h >= b.w * TALL_RATIO) {
2017
- const bands = _chunkFG3SD2G3cjs.splitRowBands.call(void 0, gray, b.w, b.h, ink, 0.45);
2017
+ const bands = _chunkQ35XK5YBcjs.splitRowBands.call(void 0, gray, b.w, b.h, ink, 0.45);
2018
2018
  if (bands.length >= 2) {
2019
2019
  for (const sub of bandBoxes(b, bands, height)) jobs.push({ box: sub, rot: 0, group: group++ });
2020
2020
  continue;
@@ -2038,9 +2038,9 @@ var OcrEngine = class _OcrEngine {
2038
2038
  continue;
2039
2039
  }
2040
2040
  }
2041
- const trim = tuning.trimEdges ? _chunkFG3SD2G3cjs.edgeTrim.call(void 0, gray, b.w, b.h, ink) : null;
2041
+ const trim = tuning.trimEdges ? _chunkQ35XK5YBcjs.edgeTrim.call(void 0, gray, b.w, b.h, ink) : null;
2042
2042
  const keep = trim ? { ...trim, bg: median(gray) } : void 0;
2043
- const leaders = tuning.splitLeaders ? _chunkFG3SD2G3cjs.leaderRuns.call(void 0, gray, b.w, b.h, ink, LEADER_MIN_DOTS) : [];
2043
+ const leaders = tuning.splitLeaders ? _chunkQ35XK5YBcjs.leaderRuns.call(void 0, gray, b.w, b.h, ink, LEADER_MIN_DOTS) : [];
2044
2044
  if (leaders.length) {
2045
2045
  const join = joins.length;
2046
2046
  joins.push({ box: b, parts: [], trailDots: false });
@@ -2049,7 +2049,7 @@ var OcrEngine = class _OcrEngine {
2049
2049
  const bare = { x: b.x + x0, y: b.y, w: a - x0, h: b.h };
2050
2050
  const end = c > a ? Math.min(c, a + Math.round(b.h * LEADER_CONTEXT)) : a;
2051
2051
  x0 = c;
2052
- if (bare.w >= DET_MIN_SIZE && _chunkFG3SD2G3cjs.inkStats.call(void 0, _chunkFG3SD2G3cjs.grayCrop.call(void 0, rgba, width, bare)).contrast >= Math.max(1, tuning.minInkContrast)) {
2052
+ if (bare.w >= DET_MIN_SIZE && _chunkQ35XK5YBcjs.inkStats.call(void 0, _chunkQ35XK5YBcjs.grayCrop.call(void 0, rgba, width, bare)).contrast >= Math.max(1, tuning.minInkContrast)) {
2053
2053
  jobs.push({ box: { ...bare, w: end - (bare.x - b.x) }, rot: 0, group: group++, join, dotsBefore: dots, trimDots: end > a });
2054
2054
  dots = false;
2055
2055
  }
@@ -2098,15 +2098,15 @@ var OcrEngine = class _OcrEngine {
2098
2098
  let text = tuning.postprocess ? restoreSymbols(raw.trim(), note.ringLead) : raw;
2099
2099
  if (!text.trim()) continue;
2100
2100
  if (tuning.postprocess && job.rot === 0 && text !== "/" && /^[(:;/)]+$/.test(text) && text.includes("/")) {
2101
- const g = _chunkFG3SD2G3cjs.grayCrop.call(void 0, rgba, width, job.box);
2102
- if (_chunkFG3SD2G3cjs.tallInkCount.call(void 0, g, job.box.w, job.box.h, _chunkFG3SD2G3cjs.inkStats.call(void 0, g)) === 1) text = "/";
2101
+ const g = _chunkQ35XK5YBcjs.grayCrop.call(void 0, rgba, width, job.box);
2102
+ if (_chunkQ35XK5YBcjs.tallInkCount.call(void 0, g, job.box.w, job.box.h, _chunkQ35XK5YBcjs.inkStats.call(void 0, g)) === 1) text = "/";
2103
2103
  }
2104
2104
  let ringByShape = false;
2105
2105
  if (tuning.postprocess && job.rot === 0 && !/^[◎●▪□■▣❐❏○ㅇ◆◇◈]/.test(text)) {
2106
2106
  const chars = [...read], k = chars.findIndex((c) => c.trim());
2107
2107
  if (k >= 0 && steps.length === chars.length) {
2108
- const g = _chunkFG3SD2G3cjs.grayCrop.call(void 0, rgba, width, job.box);
2109
- const b = _chunkFG3SD2G3cjs.leadingBullet.call(void 0, g, job.box.w, job.box.h, _chunkFG3SD2G3cjs.inkStats.call(void 0, g), (steps[k] + 0.5) * stepPx);
2108
+ const g = _chunkQ35XK5YBcjs.grayCrop.call(void 0, rgba, width, job.box);
2109
+ const b = _chunkQ35XK5YBcjs.leadingBullet.call(void 0, g, job.box.w, job.box.h, _chunkQ35XK5YBcjs.inkStats.call(void 0, g), (steps[k] + 0.5) * stepPx);
2110
2110
  const body = (_nullishCoalesce(text.match(/[가-힣]/g), () => ( []))).length >= 4;
2111
2111
  const miss = /^[Oo0•·ㆍ∙‧○]/.test(text);
2112
2112
  if (_optionalChain([b, 'optionalAccess', _39 => _39.mark]) === "\u25CE" && b.covers && /^[Oo0○©]/.test(text)) {
@@ -2121,17 +2121,17 @@ var OcrEngine = class _OcrEngine {
2121
2121
  } else if (_optionalChain([b, 'optionalAccess', _46 => _46.mark]) === "\u2750" || _optionalChain([b, 'optionalAccess', _47 => _47.mark]) === "\u274F") {
2122
2122
  if (b.covers ? /^[ㅁ口]/.test(text) : body) text = b.covers ? b.mark + text.slice(1) : b.mark + " " + text;
2123
2123
  } else if (b && b.mark !== "\u25CE" && body) text = b.covers ? miss ? b.mark + " " + text.slice(1).trimStart() : text : b.mark + " " + text;
2124
- else if (!b && body && /^[가-힣]/.test(chars[k]) && _chunkFG3SD2G3cjs.leadingRing.call(void 0, g, job.box.w, job.box.h, _chunkFG3SD2G3cjs.inkStats.call(void 0, g), (steps[k] + 0.5) * stepPx)) text = "\u25CB " + text;
2124
+ else if (!b && body && /^[가-힣]/.test(chars[k]) && _chunkQ35XK5YBcjs.leadingRing.call(void 0, g, job.box.w, job.box.h, _chunkQ35XK5YBcjs.inkStats.call(void 0, g), (steps[k] + 0.5) * stepPx)) text = "\u25CB " + text;
2125
2125
  }
2126
2126
  }
2127
2127
  if (tuning.postprocess && /^\d/.test(text) && job.rot === 0) {
2128
- const g = _chunkFG3SD2G3cjs.grayCrop.call(void 0, rgba, width, job.box);
2129
- const tri = _chunkFG3SD2G3cjs.leadingTriangle.call(void 0, g, job.box.w, job.box.h, _chunkFG3SD2G3cjs.inkStats.call(void 0, g));
2128
+ const g = _chunkQ35XK5YBcjs.grayCrop.call(void 0, rgba, width, job.box);
2129
+ const tri = _chunkQ35XK5YBcjs.leadingTriangle.call(void 0, g, job.box.w, job.box.h, _chunkQ35XK5YBcjs.inkStats.call(void 0, g));
2130
2130
  if (tri) text = tri + text;
2131
2131
  }
2132
2132
  if (tuning.postprocess && text === "\u2192" && job.rot === 0 && job.join === void 0) {
2133
- const g = _chunkFG3SD2G3cjs.grayCrop.call(void 0, rgba, width, job.box);
2134
- text = _nullishCoalesce(_chunkFG3SD2G3cjs.arrowGlyph.call(void 0, g, job.box.w, job.box.h, _chunkFG3SD2G3cjs.inkStats.call(void 0, g)), () => ( text));
2133
+ const g = _chunkQ35XK5YBcjs.grayCrop.call(void 0, rgba, width, job.box);
2134
+ text = _nullishCoalesce(_chunkQ35XK5YBcjs.arrowGlyph.call(void 0, g, job.box.w, job.box.h, _chunkQ35XK5YBcjs.inkStats.call(void 0, g)), () => ( text));
2135
2135
  }
2136
2136
  if (job.footer) {
2137
2137
  if (!/^[-\u2013\u2014]?\s*(?:\d{1,4}|[ivxIVXⅰ-ⅹⅠ-Ⅹ]{1,4})\s*[-\u2013\u2014]?$/.test(text.trim())) continue;
@@ -2155,7 +2155,7 @@ var OcrEngine = class _OcrEngine {
2155
2155
  continue;
2156
2156
  }
2157
2157
  const item = { text, ...this.itemBox(rgba, width, job.box, tuning), confidence };
2158
- if (job.rot === 0) _chunkFG3SD2G3cjs.rememberOcrTextGaps.call(void 0, item, _chunkFG3SD2G3cjs.findOcrTextGaps.call(void 0, rgba, width, job.box, read, text, steps, stepPx));
2158
+ if (job.rot === 0) _chunkQ35XK5YBcjs.rememberOcrTextGaps.call(void 0, item, _chunkQ35XK5YBcjs.findOcrTextGaps.call(void 0, rgba, width, job.box, read, text, steps, stepPx));
2159
2159
  if (job.rot === 0 && job.keep === void 0) boxOf.set(item, job.box);
2160
2160
  items.push(item);
2161
2161
  }
@@ -2169,7 +2169,7 @@ var OcrEngine = class _OcrEngine {
2169
2169
  const merged = rereadNumberText(it.text, r.text);
2170
2170
  if (merged === null) return;
2171
2171
  it.text = merged;
2172
- _chunkFG3SD2G3cjs.rememberOcrTextGaps.call(void 0, it, _chunkFG3SD2G3cjs.findOcrTextGaps.call(void 0, rgba, width, boxOf.get(it), r.text, it.text, r.steps, r.stepPx));
2172
+ _chunkQ35XK5YBcjs.rememberOcrTextGaps.call(void 0, it, _chunkQ35XK5YBcjs.findOcrTextGaps.call(void 0, rgba, width, boxOf.get(it), r.text, it.text, r.steps, r.stepPx));
2173
2173
  });
2174
2174
  }
2175
2175
  const pairs = tuning.postprocess ? items.filter((it) => boxOf.has(it) && NUMBER_PAIR.test(it.text.trim())) : [];
@@ -2197,8 +2197,8 @@ var OcrEngine = class _OcrEngine {
2197
2197
  const halves = [];
2198
2198
  for (const it of tall) {
2199
2199
  const b = boxOf.get(it);
2200
- const gray = _chunkFG3SD2G3cjs.grayCrop.call(void 0, rgba, width, b);
2201
- const cut = _nullishCoalesce(midBlankRow(gray, b.w, b.h, _chunkFG3SD2G3cjs.inkStats.call(void 0, gray)), () => ( valleyRow(gray, b.w, b.h, _chunkFG3SD2G3cjs.inkStats.call(void 0, gray))));
2200
+ const gray = _chunkQ35XK5YBcjs.grayCrop.call(void 0, rgba, width, b);
2201
+ const cut = _nullishCoalesce(midBlankRow(gray, b.w, b.h, _chunkQ35XK5YBcjs.inkStats.call(void 0, gray)), () => ( valleyRow(gray, b.w, b.h, _chunkQ35XK5YBcjs.inkStats.call(void 0, gray))));
2202
2202
  if (cut) halves.push({ it, top: { ...b, h: cut[0] }, bottom: { ...b, y: b.y + cut[1], h: b.h - cut[1] } });
2203
2203
  }
2204
2204
  const res = halves.length ? await this.recognizeJobs(rgba, width, halves.flatMap((hv, k) => [{ box: hv.top, rot: 0, group: 2 * k }, { box: hv.bottom, rot: 0, group: 2 * k + 1 }]), tuning.recBatch) : [];
@@ -2219,15 +2219,15 @@ var OcrEngine = class _OcrEngine {
2219
2219
  const subs = [];
2220
2220
  const stacks = [];
2221
2221
  for (const b of [...retry, ...blank2]) {
2222
- const gray = _chunkFG3SD2G3cjs.grayCrop.call(void 0, rgba, width, b);
2223
- const ink = _chunkFG3SD2G3cjs.inkStats.call(void 0, gray);
2222
+ const gray = _chunkQ35XK5YBcjs.grayCrop.call(void 0, rgba, width, b);
2223
+ const ink = _chunkQ35XK5YBcjs.inkStats.call(void 0, gray);
2224
2224
  const cut = retry.includes(b) ? midBlankRow(gray, b.w, b.h, ink) : null;
2225
2225
  const inCell = cellRules.some((r) => r.x1 <= b.x + 2 && r.y1 <= b.y && r.y2 >= b.y + b.h) && cellRules.some((r) => r.x1 >= b.x + b.w - 2 && r.y1 <= b.y && r.y2 >= b.y + b.h);
2226
2226
  if (cut && b.w >= (inCell ? 2 : 3) * Math.max(cut[0], b.h - cut[1])) {
2227
2227
  subs.push({ ...b, h: cut[0] }, { ...b, y: b.y + cut[1], h: b.h - cut[1] });
2228
2228
  continue;
2229
2229
  }
2230
- const bands = _chunkFG3SD2G3cjs.stackedGlyphBands.call(void 0, gray, b.w, b.h, ink);
2230
+ const bands = _chunkQ35XK5YBcjs.stackedGlyphBands.call(void 0, gray, b.w, b.h, ink);
2231
2231
  if (bands) stacks.push({ box: b, parts: bandBoxes(b, bands, height), word: bands.every((x, i) => i === 0 || x.y0 - bands[i - 1].y1 <= STACK_WORD_GAP * Math.max(x.y1 - x.y0, bands[i - 1].y1 - bands[i - 1].y0)) });
2232
2232
  }
2233
2233
  const overlap = (a, o) => Math.max(0, Math.min(a.x + a.w, o.x + o.w) - Math.max(a.x, o.x)) * Math.max(0, Math.min(a.y + a.h, o.y + o.h) - Math.max(a.y, o.y));
@@ -2306,8 +2306,8 @@ var OcrEngine = class _OcrEngine {
2306
2306
  /** 결과 좌표 — det 박스 그대로 또는 박스 안 잉크 외곽 (tightBoxes) */
2307
2307
  itemBox(rgba, width, b, tuning) {
2308
2308
  if (!tuning.tightBoxes) return b;
2309
- const gray = _chunkFG3SD2G3cjs.grayCrop.call(void 0, rgba, width, b);
2310
- const t = _chunkFG3SD2G3cjs.inkBounds.call(void 0, gray, b.w, b.h, _chunkFG3SD2G3cjs.inkStats.call(void 0, gray));
2309
+ const gray = _chunkQ35XK5YBcjs.grayCrop.call(void 0, rgba, width, b);
2310
+ const t = _chunkQ35XK5YBcjs.inkBounds.call(void 0, gray, b.w, b.h, _chunkQ35XK5YBcjs.inkStats.call(void 0, gray));
2311
2311
  return { x: b.x + t.x0, y: b.y + t.y0, w: t.x1 - t.x0, h: t.y1 - t.y0 };
2312
2312
  }
2313
2313
  // ─── det ─────────────────────────────────────────────
@@ -2378,7 +2378,7 @@ var OcrEngine = class _OcrEngine {
2378
2378
  const out = await this.rec.run({ [this.rec.inputNames[0]]: tensor });
2379
2379
  const logits = out[this.rec.outputNames[0]];
2380
2380
  const [, T, C] = logits.dims;
2381
- if (C !== this.dict.length + 2) throw new (0, _chunkUBZROOIAcjs.KordocError)(`OCR rec \uCD9C\uB825 \uD074\uB798\uC2A4 ${C}\uAC1C\uAC00 \uC0AC\uC804 ${this.dict.length}\uC790 + 2 \uC640 \uB2E4\uB985\uB2C8\uB2E4 \u2014 \uBAA8\uB378\uC5D0 \uB9DE\uB294 \uC0AC\uC804(ocrRecDict)\uC744 \uC9C0\uC815\uD558\uC138\uC694`);
2381
+ if (C !== this.dict.length + 2) throw new (0, _chunkVEROU5AEcjs.KordocError)(`OCR rec \uCD9C\uB825 \uD074\uB798\uC2A4 ${C}\uAC1C\uAC00 \uC0AC\uC804 ${this.dict.length}\uC790 + 2 \uC640 \uB2E4\uB985\uB2C8\uB2E4 \u2014 \uBAA8\uB378\uC5D0 \uB9DE\uB294 \uC0AC\uC804(ocrRecDict)\uC744 \uC9C0\uC815\uD558\uC138\uC694`);
2382
2382
  const data = logits.data;
2383
2383
  idx.forEach((ci, k) => {
2384
2384
  const r = ctcDecode(data.subarray(k * T * C, (k + 1) * T * C), T, C, this.dict);
@@ -2388,9 +2388,9 @@ var OcrEngine = class _OcrEngine {
2388
2388
  const chars = r ? [...r.text] : [];
2389
2389
  if (r && job.rot === 0 && chars.length === r.steps.length && r.steps.some((t) => t > last) && !r.text.includes("(cid:")) {
2390
2390
  const tallCh = (c) => !/[\s.,:;\u00b7\u2026'"\u2018-\u201d`\-_~]/.test(c);
2391
- const g = _chunkFG3SD2G3cjs.grayCrop.call(void 0, rgba, pageW, job.box);
2391
+ const g = _chunkQ35XK5YBcjs.grayCrop.call(void 0, rgba, pageW, job.box);
2392
2392
  const inside = chars.filter((c, i) => r.steps[i] <= last && tallCh(c)).length;
2393
- let budget = inside <= 2 ? _chunkFG3SD2G3cjs.tallInkCount.call(void 0, g, job.box.w, job.box.h, _chunkFG3SD2G3cjs.inkStats.call(void 0, g)) - inside : Infinity;
2393
+ let budget = inside <= 2 ? _chunkQ35XK5YBcjs.tallInkCount.call(void 0, g, job.box.w, job.box.h, _chunkQ35XK5YBcjs.inkStats.call(void 0, g)) - inside : Infinity;
2394
2394
  const keep = chars.map((c, i) => r.steps[i] <= last || !tallCh(c) || budget-- > 0);
2395
2395
  if (!keep.every(Boolean)) kept = { ...r, text: chars.filter((_, i) => keep[i]).join(""), steps: r.steps.filter((_, i) => keep[i]) };
2396
2396
  }
@@ -2501,13 +2501,13 @@ async function tryImport(name, loader) {
2501
2501
  return await loader();
2502
2502
  } catch (e) {
2503
2503
  throw new Error(
2504
- `\uB0B4\uC7A5 OCR \uC744 \uC0AC\uC6A9\uD558\uB824\uBA74 optional dependency '${name}' \uC774 \uD544\uC694\uD569\uB2C8\uB2E4. \`npm install ${name}\` \uD6C4 \uB2E4\uC2DC \uC2E4\uD589\uD558\uC138\uC694.${_chunkUBZROOIAcjs.OPTIONAL_DEP_INSTALL_HINT} \uC6D0\uC778: ${e.message}`
2504
+ `\uB0B4\uC7A5 OCR \uC744 \uC0AC\uC6A9\uD558\uB824\uBA74 optional dependency '${name}' \uC774 \uD544\uC694\uD569\uB2C8\uB2E4. \`npm install ${name}\` \uD6C4 \uB2E4\uC2DC \uC2E4\uD589\uD558\uC138\uC694.${_chunkVEROU5AEcjs.OPTIONAL_DEP_INSTALL_HINT} \uC6D0\uC778: ${e.message}`
2505
2505
  );
2506
2506
  }
2507
2507
  }
2508
2508
  async function verifiedBytes(s) {
2509
2509
  const name = _path.basename.call(void 0, s.file.path);
2510
- const fail = (why2) => new (0, _chunkUBZROOIAcjs.KordocError)(`OCR \uBAA8\uB378 \uD30C\uC77C\uC744 \uC77D\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${name} (${why2})`);
2510
+ const fail = (why2) => new (0, _chunkVEROU5AEcjs.KordocError)(`OCR \uBAA8\uB378 \uD30C\uC77C\uC744 \uC77D\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${name} (${why2})`);
2511
2511
  const why = (e) => {
2512
2512
  const code = e.code;
2513
2513
  return code === "ENOENT" ? "\uD30C\uC77C\uC774 \uC5C6\uC74C" : code === "EACCES" || code === "EPERM" ? "\uAD8C\uD55C \uC5C6\uC74C" : "\uC77D\uAE30 \uC2E4\uD328";
@@ -2528,13 +2528,13 @@ async function verifiedBytes(s) {
2528
2528
  }
2529
2529
  const actual = _crypto.createHash.call(void 0, "sha256").update(bytes).digest("hex");
2530
2530
  if (actual !== s.file.sha256) {
2531
- throw new (0, _chunkUBZROOIAcjs.KordocError)(`OCR \uBAA8\uB378 SHA256 mismatch: ${_path.basename.call(void 0, s.file.path)} \u2014 expected ${s.file.sha256}, got ${actual} (\uB85C\uB4DC \uAC70\uBD80)`);
2531
+ throw new (0, _chunkVEROU5AEcjs.KordocError)(`OCR \uBAA8\uB378 SHA256 mismatch: ${_path.basename.call(void 0, s.file.path)} \u2014 expected ${s.file.sha256}, got ${actual} (\uB85C\uB4DC \uAC70\uBD80)`);
2532
2532
  }
2533
2533
  return bytes;
2534
2534
  }
2535
2535
  var engines = /* @__PURE__ */ new Map();
2536
- function getOcrEngine(models = _chunkFG3SD2G3cjs.DEFAULT_OCR_MODELS) {
2537
- const key = _chunkFG3SD2G3cjs.ocrSelectionKey.call(void 0, models);
2536
+ function getOcrEngine(models = _chunkQ35XK5YBcjs.DEFAULT_OCR_MODELS) {
2537
+ const key = _chunkQ35XK5YBcjs.ocrSelectionKey.call(void 0, models);
2538
2538
  let p = engines.get(key);
2539
2539
  if (!p) {
2540
2540
  p = OcrEngine.create(models).catch((err) => {
@@ -3010,20 +3010,20 @@ var REDETECT = { minDropped: 15, minShare: 0.15, scale: 5 / 3 };
3010
3010
  var AUTO_REC = { pageConf: 0.9, gain: 0.06 };
3011
3011
  var DEFAULT_AUTO_REC = { pageConf: 0.9, gain: 0.08, altConf: 0.95, sureGain: 0.1, minDiff: 0.08, minChars: 80, lazy: true };
3012
3012
  var DEFAULT_BUILTIN_OCR = Object.freeze({
3013
- models: _chunkFG3SD2G3cjs.DEFAULT_OCR_MODELS,
3013
+ models: _chunkQ35XK5YBcjs.DEFAULT_OCR_MODELS,
3014
3014
  tuning: DEFAULT_OCR_TUNING,
3015
- handwriting: _chunkFG3SD2G3cjs.handwritingFallbackModels.call(void 0, _chunkFG3SD2G3cjs.DEFAULT_OCR_MODELS),
3015
+ handwriting: _chunkQ35XK5YBcjs.handwritingFallbackModels.call(void 0, _chunkQ35XK5YBcjs.DEFAULT_OCR_MODELS),
3016
3016
  autoRec: DEFAULT_AUTO_REC
3017
3017
  });
3018
3018
  var DEFAULT_BUILTIN_OCR_FETCH = Object.freeze({ ...DEFAULT_BUILTIN_OCR, autoRec: { ...DEFAULT_AUTO_REC, fetch: true } });
3019
3019
  function builtinOcrConfig(o) {
3020
3020
  if (!o || o.ocrDet === void 0 && o.ocrDetLongSide === void 0 && o.ocrRec === void 0 && o.ocrRecDict === void 0 && !o.ocrLines) return _optionalChain([o, 'optionalAccess', _78 => _78.ocr]) ? DEFAULT_BUILTIN_OCR_FETCH : DEFAULT_BUILTIN_OCR;
3021
3021
  const bad = _chunkMMK32GPDcjs.validateOcrOptions.call(void 0, o);
3022
- if (bad) throw new (0, _chunkUBZROOIAcjs.KordocError)(bad);
3023
- const models = _chunkFG3SD2G3cjs.resolveOcrModels.call(void 0, o);
3022
+ if (bad) throw new (0, _chunkVEROU5AEcjs.KordocError)(bad);
3023
+ const models = _chunkQ35XK5YBcjs.resolveOcrModels.call(void 0, o);
3024
3024
  return {
3025
3025
  models,
3026
- ...o.ocrRec === "auto" ? { handwriting: _chunkFG3SD2G3cjs.handwritingFallbackModels.call(void 0, models), autoRec: AUTO_REC } : o.ocrRec === void 0 ? { handwriting: _chunkFG3SD2G3cjs.handwritingFallbackModels.call(void 0, models), autoRec: o.ocr ? { ...DEFAULT_AUTO_REC, fetch: true } : DEFAULT_AUTO_REC } : {},
3026
+ ...o.ocrRec === "auto" ? { handwriting: _chunkQ35XK5YBcjs.handwritingFallbackModels.call(void 0, models), autoRec: AUTO_REC } : o.ocrRec === void 0 ? { handwriting: _chunkQ35XK5YBcjs.handwritingFallbackModels.call(void 0, models), autoRec: o.ocr ? { ...DEFAULT_AUTO_REC, fetch: true } : DEFAULT_AUTO_REC } : {},
3027
3027
  tuning: o.ocrDetLongSide === void 0 ? DEFAULT_OCR_TUNING : { ...DEFAULT_OCR_TUNING, detLongSide: o.ocrDetLongSide },
3028
3028
  lines: o.ocrLines === "all" ? "all" : o.ocrLines ? "kept" : void 0
3029
3029
  };
@@ -3049,8 +3049,8 @@ async function withHandwritingRec(items, config, tuning, rgba, width, height, st
3049
3049
  const altStats = { droppedLowConf: 0, ...stats.dropped ? { dropped: [] } : {} };
3050
3050
  let alt;
3051
3051
  try {
3052
- if (auto.lazy && !auto.fetch && !await _chunkFG3SD2G3cjs.ocrModelsCached.call(void 0, config.handwriting)) return items;
3053
- if (auto.lazy) await _chunkFG3SD2G3cjs.ensureOcrModelsFor.call(void 0, config.handwriting, reportModelDownload);
3052
+ if (auto.lazy && !auto.fetch && !await _chunkQ35XK5YBcjs.ocrModelsCached.call(void 0, config.handwriting)) return items;
3053
+ if (auto.lazy) await _chunkQ35XK5YBcjs.ensureOcrModelsFor.call(void 0, config.handwriting, reportModelDownload);
3054
3054
  alt = await (await getOcrEngine(config.handwriting)).recognizePage(rgba, width, height, altStats, tuning, cellRules, rowRules);
3055
3055
  } catch (e) {
3056
3056
  if (!auto.lazy) throw e;
@@ -3096,8 +3096,8 @@ async function runPdfOcr(buffer, targets, mode, warnings, onProgress, detectTabl
3096
3096
  "@hyzyla/pdfium",
3097
3097
  () => Promise.resolve().then(() => _interopRequireWildcard(require("@hyzyla/pdfium")))
3098
3098
  );
3099
- if (mode === "builtin") await _chunkFG3SD2G3cjs.ensureOcrModelsFor.call(void 0, config.models, reportModelDownload);
3100
- if (mode === "builtin" && config.handwriting && !_optionalChain([config, 'access', _79 => _79.autoRec, 'optionalAccess', _80 => _80.lazy])) await _chunkFG3SD2G3cjs.ensureOcrModelsFor.call(void 0, config.handwriting, reportModelDownload);
3099
+ if (mode === "builtin") await _chunkQ35XK5YBcjs.ensureOcrModelsFor.call(void 0, config.models, reportModelDownload);
3100
+ if (mode === "builtin" && config.handwriting && !_optionalChain([config, 'access', _79 => _79.autoRec, 'optionalAccess', _80 => _80.lazy])) await _chunkQ35XK5YBcjs.ensureOcrModelsFor.call(void 0, config.handwriting, reportModelDownload);
3101
3101
  const engine = mode === "builtin" ? await getOcrEngine(config.models) : null;
3102
3102
  const pdfium = await pdfiumMod.PDFiumLibrary.init();
3103
3103
  const doc = await pdfium.loadDocument(new Uint8Array(buffer));
@@ -3210,7 +3210,7 @@ async function ocrOnePage(page, pageNo, mode, engine, warnings, detectTables, ve
3210
3210
  const x1 = r.x1 * scale - 2, x2 = r.x2 * scale + 2, y1 = (pdfH - r.y2) * scale - 2, y2 = (pdfH - r.y1) * scale + 2;
3211
3211
  const columnRules = _nullishCoalesce(_optionalChain([ruling, 'optionalAccess', _89 => _89.verticals, 'access', _90 => _90.filter, 'call', _91 => _91((s) => Math.min(s.x1, s.x2) >= x1 && Math.max(s.x1, s.x2) <= x2 && Math.min(s.y1, s.y2) >= y1 && Math.max(s.y1, s.y2) <= y2), 'access', _92 => _92.length]), () => ( 0));
3212
3212
  if (columnRules < 2) {
3213
- for (const b of blocks) if (b.type === "table") _chunkFG3SD2G3cjs.UNRULED_REGION_TABLES.add(b);
3213
+ for (const b of blocks) if (b.type === "table") _chunkQ35XK5YBcjs.UNRULED_REGION_TABLES.add(b);
3214
3214
  }
3215
3215
  return blocks;
3216
3216
  });
@@ -3282,7 +3282,7 @@ async function closerReads(rgba, rw, rh, pdfH, hi, regions, engine, tuning = REG
3282
3282
  const items = await engine.recognizePage(crop, cw, ch, void 0, tuning);
3283
3283
  out.push(items.map((it) => {
3284
3284
  const placed = { ...it, x: (it.x + x0) / 2, y: (it.y + y0) / 2, w: it.w / 2, h: it.h / 2 };
3285
- _chunkFG3SD2G3cjs.copyOcrTextGaps.call(void 0, it, placed, 0.5, x0 / 2);
3285
+ _chunkQ35XK5YBcjs.copyOcrTextGaps.call(void 0, it, placed, 0.5, x0 / 2);
3286
3286
  return placed;
3287
3287
  }));
3288
3288
  }
@@ -3374,7 +3374,7 @@ function ocrItemsToBlocks(items, pageNumber, pdfW, pdfH, scale, extraLines, dete
3374
3374
  isHidden: false,
3375
3375
  ...xs[i].space ? { hasSpaceBefore: true } : {}
3376
3376
  };
3377
- _chunkFG3SD2G3cjs.copyOcrTextGaps.call(void 0, it, normalized, 1 / scale);
3377
+ _chunkQ35XK5YBcjs.copyOcrTextGaps.call(void 0, it, normalized, 1 / scale);
3378
3378
  return normalized;
3379
3379
  }).filter((it) => it.text);
3380
3380
  if (_optionalChain([extraLines, 'optionalAccess', _96 => _96.verticals, 'access', _97 => _97.length]) && items.length) {
@@ -3390,7 +3390,7 @@ function ocrItemsToBlocks(items, pageNumber, pdfW, pdfH, scale, extraLines, dete
3390
3390
  })
3391
3391
  };
3392
3392
  }
3393
- const laid = unframeOcrLayoutTables(splitOcrJoinedHeaders(splitOcrContactColumns(splitOcrNameValueColumns(splitStackedOcrRows(_chunkFG3SD2G3cjs.extractPageBlocksWithLines.call(void 0, norm, pageNumber, opList, pdfW, pdfH, extraLines, detectTables))))), pdfH);
3393
+ const laid = unframeOcrLayoutTables(splitOcrJoinedHeaders(splitOcrContactColumns(splitOcrNameValueColumns(splitStackedOcrRows(_chunkQ35XK5YBcjs.extractPageBlocksWithLines.call(void 0, norm, pageNumber, opList, pdfW, pdfH, extraLines, detectTables))))), pdfH);
3394
3394
  const blocks = figureRegion ? laid : splitOcrProseRows(laid);
3395
3395
  if (!figureRegion) markOcrHeadings(blocks);
3396
3396
  return blocks;
@@ -3451,7 +3451,7 @@ async function tryImport2(name, loader) {
3451
3451
  return await loader();
3452
3452
  } catch (e) {
3453
3453
  throw new Error(
3454
- `OCR \uC744 \uC0AC\uC6A9\uD558\uB824\uBA74 optional dependency '${name}' \uC774 \uD544\uC694\uD569\uB2C8\uB2E4. \`npm install ${name}\` \uD6C4 \uB2E4\uC2DC \uC2E4\uD589\uD558\uC138\uC694.${_chunkUBZROOIAcjs.OPTIONAL_DEP_INSTALL_HINT} \uC6D0\uC778: ${e.message}`
3454
+ `OCR \uC744 \uC0AC\uC6A9\uD558\uB824\uBA74 optional dependency '${name}' \uC774 \uD544\uC694\uD569\uB2C8\uB2E4. \`npm install ${name}\` \uD6C4 \uB2E4\uC2DC \uC2E4\uD589\uD558\uC138\uC694.${_chunkVEROU5AEcjs.OPTIONAL_DEP_INSTALL_HINT} \uC6D0\uC778: ${e.message}`
3455
3455
  );
3456
3456
  }
3457
3457
  }
@@ -3504,4 +3504,4 @@ function bgraToRgba(bgra) {
3504
3504
 
3505
3505
 
3506
3506
  exports.rescueEmptyCells = rescueEmptyCells; exports.getOcrEngine = getOcrEngine; exports.detectRulingLines = detectRulingLines; exports.rulingToPdfLines = rulingToPdfLines; exports.deskewPage = deskewPage; exports.rotateQuarter = rotateQuarter; exports.MAX_OCR_PIXELS = MAX_OCR_PIXELS; exports.DEFAULT_BUILTIN_OCR = DEFAULT_BUILTIN_OCR; exports.builtinOcrConfig = builtinOcrConfig; exports.recognizeOcrPage = recognizeOcrPage; exports.reportModelDownload = reportModelDownload; exports.toOcrLine = toOcrLine; exports.pageLines = pageLines; exports.cellEdgeVerticals = cellEdgeVerticals; exports.cellEdgeHorizontals = cellEdgeHorizontals; exports.runPdfOcr = runPdfOcr; exports.ocrOnePage = ocrOnePage; exports.stretchFaintCrop = stretchFaintCrop; exports.groupOcrLines = groupOcrLines; exports.ocrItemsToBlocks = ocrItemsToBlocks; exports.markOcrHeadings = markOcrHeadings;
3507
- //# sourceMappingURL=chunk-WPILSYFA.cjs.map
3507
+ //# sourceMappingURL=chunk-BI22HR52.cjs.map