kordoc 4.12.1 → 4.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +11 -0
  2. package/dist/{-BUYIUNW3.js → -EZH6NKTE.js} +8 -8
  3. package/dist/{chunk-WGUVKNBX.js → chunk-2B7OIEJJ.js} +6 -3
  4. package/dist/chunk-2B7OIEJJ.js.map +1 -0
  5. package/dist/{chunk-CJPVVR2Y.js → chunk-2HBYWA5X.js} +2 -2
  6. package/dist/{chunk-EOGPRO3U.cjs → chunk-2LKYJ4G3.cjs} +6 -6
  7. package/dist/{chunk-EOGPRO3U.cjs.map → chunk-2LKYJ4G3.cjs.map} +1 -1
  8. package/dist/{chunk-FNCBOTM5.js → chunk-2LO525TL.js} +2 -2
  9. package/dist/{chunk-WJOWM27X.cjs → chunk-2LPBIW2B.cjs} +3 -3
  10. package/dist/{chunk-WJOWM27X.cjs.map → chunk-2LPBIW2B.cjs.map} +1 -1
  11. package/dist/{chunk-6MF7JRG3.cjs → chunk-62IU4NV3.cjs} +2 -2
  12. package/dist/{chunk-6MF7JRG3.cjs.map → chunk-62IU4NV3.cjs.map} +1 -1
  13. package/dist/{chunk-BPKJTQAW.js → chunk-7XUXSDH5.js} +89 -25
  14. package/dist/chunk-7XUXSDH5.js.map +1 -0
  15. package/dist/{chunk-ST3JBCIL.js → chunk-DBGEUDBY.js} +2 -2
  16. package/dist/{chunk-E37VAV46.js → chunk-FBLMVHDK.js} +2 -2
  17. package/dist/{chunk-EWSH6O6S.js → chunk-FVBR7SC3.js} +2 -2
  18. package/dist/{chunk-F2KL5Z5T.js → chunk-IOJX4Q63.js} +3 -3
  19. package/dist/{chunk-L5DNHSX4.js → chunk-JCMBQC5N.js} +2 -2
  20. package/dist/{chunk-JD4H6Y33.js → chunk-KX7IYCCZ.js} +3 -3
  21. package/dist/{chunk-VO37BVAH.js → chunk-LD2K4K5V.js} +40 -19
  22. package/dist/chunk-LD2K4K5V.js.map +1 -0
  23. package/dist/{chunk-D2XNLIFU.js → chunk-MUYU4JI5.js} +2 -2
  24. package/dist/{chunk-OS2IOI3W.js → chunk-OEYECZGV.js} +89 -25
  25. package/dist/chunk-OEYECZGV.js.map +1 -0
  26. package/dist/{chunk-MXZXZTKW.cjs → chunk-ONNAHSPV.cjs} +104 -40
  27. package/dist/chunk-ONNAHSPV.cjs.map +1 -0
  28. package/dist/{chunk-JQBF4PSF.js → chunk-Q6ETEJFK.js} +6 -3
  29. package/dist/chunk-Q6ETEJFK.js.map +1 -0
  30. package/dist/{chunk-ELCPCTJ6.js → chunk-QBCMFNHS.js} +2 -2
  31. package/dist/{chunk-DXKNPBXX.js → chunk-QM2RSJ2S.js} +3 -3
  32. package/dist/{chunk-L6FIUSD2.js → chunk-UL2MDA5C.js} +3 -3
  33. package/dist/{chunk-CBPO5IZZ.cjs → chunk-V5BUPZ6I.cjs} +20 -17
  34. package/dist/chunk-V5BUPZ6I.cjs.map +1 -0
  35. package/dist/{chunk-7U34YNFR.js → chunk-XXDZ2KTW.js} +2 -2
  36. package/dist/chunks-TT7ZE5QQ.js +10 -0
  37. package/dist/cli.js +20 -20
  38. package/dist/{formula-7TN26AKF.js → formula-6RQX4NMJ.js} +4 -4
  39. package/dist/{formula-XKRMKGAW.cjs → formula-NBEO6CFC.cjs} +9 -9
  40. package/dist/{formula-XKRMKGAW.cjs.map → formula-NBEO6CFC.cjs.map} +1 -1
  41. package/dist/{formula-RZNSECGO.js → formula-NW33S4TA.js} +3 -3
  42. package/dist/{image-ocr-3O34O7XS.js → image-ocr-CAVU2TNZ.js} +5 -5
  43. package/dist/{image-ocr-TNU4ILLU.js → image-ocr-SO56VETS.js} +7 -7
  44. package/dist/{image-ocr-XDZONLD6.cjs → image-ocr-V4KY373B.cjs} +11 -11
  45. package/dist/{image-ocr-XDZONLD6.cjs.map → image-ocr-V4KY373B.cjs.map} +1 -1
  46. package/dist/index.cjs +419 -398
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.js +36 -15
  49. package/dist/index.js.map +1 -1
  50. package/dist/mcp.js +15 -15
  51. package/dist/{model-bundle-NCYN375I.js → model-bundle-EIJF34DR.js} +5 -5
  52. package/dist/{models-J4G4VZMU.js → models-6V4CPQXC.js} +5 -5
  53. package/dist/{parser-6IH62P6U.js → parser-GIREMEPD.js} +6 -6
  54. package/dist/{parser-5WZBCP7H.js → parser-OBHNXEQM.js} +6 -6
  55. package/dist/{parser-LVMTVO2N.cjs → parser-OMT25WH2.cjs} +26 -26
  56. package/dist/{parser-LVMTVO2N.cjs.map → parser-OMT25WH2.cjs.map} +1 -1
  57. package/dist/pdf-ocr-IRXQ5GBM.js +13 -0
  58. package/dist/pdf-ocr-SL4GCOGS.js +16 -0
  59. package/dist/pdf-ocr-TFYVK4FI.cjs +14 -0
  60. package/dist/{pdf-ocr-IAO273AQ.cjs.map → pdf-ocr-TFYVK4FI.cjs.map} +1 -1
  61. package/dist/{profile-io-ANPS7DTT.js → profile-io-PZVMM66V.js} +3 -3
  62. package/dist/{rasterize-FKXCEFHV.js → rasterize-NRWP2C6L.js} +2 -2
  63. package/dist/render-V5ZPTZQ7.js +10 -0
  64. package/dist/seal-LVG2DGAB.js +10 -0
  65. package/dist/{setup-DEAFODGI.js → setup-V55AJP6H.js} +3 -3
  66. package/dist/{watch-B5X7IAMK.js → watch-7CQSMDDP.js} +9 -9
  67. package/package.json +1 -1
  68. package/dist/chunk-BPKJTQAW.js.map +0 -1
  69. package/dist/chunk-CBPO5IZZ.cjs.map +0 -1
  70. package/dist/chunk-JQBF4PSF.js.map +0 -1
  71. package/dist/chunk-MXZXZTKW.cjs.map +0 -1
  72. package/dist/chunk-OS2IOI3W.js.map +0 -1
  73. package/dist/chunk-VO37BVAH.js.map +0 -1
  74. package/dist/chunk-WGUVKNBX.js.map +0 -1
  75. package/dist/chunks-G2U2XUZU.js +0 -10
  76. package/dist/pdf-ocr-5PLJOKGI.js +0 -13
  77. package/dist/pdf-ocr-7FPCZCV7.js +0 -16
  78. package/dist/pdf-ocr-IAO273AQ.cjs +0 -14
  79. package/dist/render-NWQI3AXU.js +0 -10
  80. package/dist/seal-N3GCBTVA.js +0 -10
  81. /package/dist/{-BUYIUNW3.js.map → -EZH6NKTE.js.map} +0 -0
  82. /package/dist/{chunk-CJPVVR2Y.js.map → chunk-2HBYWA5X.js.map} +0 -0
  83. /package/dist/{chunk-FNCBOTM5.js.map → chunk-2LO525TL.js.map} +0 -0
  84. /package/dist/{chunk-ST3JBCIL.js.map → chunk-DBGEUDBY.js.map} +0 -0
  85. /package/dist/{chunk-E37VAV46.js.map → chunk-FBLMVHDK.js.map} +0 -0
  86. /package/dist/{chunk-EWSH6O6S.js.map → chunk-FVBR7SC3.js.map} +0 -0
  87. /package/dist/{chunk-F2KL5Z5T.js.map → chunk-IOJX4Q63.js.map} +0 -0
  88. /package/dist/{chunk-L5DNHSX4.js.map → chunk-JCMBQC5N.js.map} +0 -0
  89. /package/dist/{chunk-JD4H6Y33.js.map → chunk-KX7IYCCZ.js.map} +0 -0
  90. /package/dist/{chunk-D2XNLIFU.js.map → chunk-MUYU4JI5.js.map} +0 -0
  91. /package/dist/{chunk-ELCPCTJ6.js.map → chunk-QBCMFNHS.js.map} +0 -0
  92. /package/dist/{chunk-DXKNPBXX.js.map → chunk-QM2RSJ2S.js.map} +0 -0
  93. /package/dist/{chunk-L6FIUSD2.js.map → chunk-UL2MDA5C.js.map} +0 -0
  94. /package/dist/{chunk-7U34YNFR.js.map → chunk-XXDZ2KTW.js.map} +0 -0
  95. /package/dist/{chunks-G2U2XUZU.js.map → chunks-TT7ZE5QQ.js.map} +0 -0
  96. /package/dist/{formula-7TN26AKF.js.map → formula-6RQX4NMJ.js.map} +0 -0
  97. /package/dist/{formula-RZNSECGO.js.map → formula-NW33S4TA.js.map} +0 -0
  98. /package/dist/{image-ocr-3O34O7XS.js.map → image-ocr-CAVU2TNZ.js.map} +0 -0
  99. /package/dist/{image-ocr-TNU4ILLU.js.map → image-ocr-SO56VETS.js.map} +0 -0
  100. /package/dist/{model-bundle-NCYN375I.js.map → model-bundle-EIJF34DR.js.map} +0 -0
  101. /package/dist/{models-J4G4VZMU.js.map → models-6V4CPQXC.js.map} +0 -0
  102. /package/dist/{parser-6IH62P6U.js.map → parser-GIREMEPD.js.map} +0 -0
  103. /package/dist/{parser-5WZBCP7H.js.map → parser-OBHNXEQM.js.map} +0 -0
  104. /package/dist/{pdf-ocr-5PLJOKGI.js.map → pdf-ocr-IRXQ5GBM.js.map} +0 -0
  105. /package/dist/{pdf-ocr-7FPCZCV7.js.map → pdf-ocr-SL4GCOGS.js.map} +0 -0
  106. /package/dist/{profile-io-ANPS7DTT.js.map → profile-io-PZVMM66V.js.map} +0 -0
  107. /package/dist/{rasterize-FKXCEFHV.js.map → rasterize-NRWP2C6L.js.map} +0 -0
  108. /package/dist/{render-NWQI3AXU.js.map → render-V5ZPTZQ7.js.map} +0 -0
  109. /package/dist/{seal-N3GCBTVA.js.map → seal-LVG2DGAB.js.map} +0 -0
  110. /package/dist/{setup-DEAFODGI.js.map → setup-V55AJP6H.js.map} +0 -0
  111. /package/dist/{watch-B5X7IAMK.js.map → watch-7CQSMDDP.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  // src/utils.ts
2
- var VERSION = true ? "4.12.1" : "0.0.0-dev";
2
+ var VERSION = true ? "4.12.2" : "0.0.0-dev";
3
3
  function toArrayBuffer(buf) {
4
4
  if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
5
5
  return buf.buffer;
@@ -121,4 +121,4 @@ export {
121
121
  safeMax,
122
122
  classifyError
123
123
  };
124
- //# sourceMappingURL=chunk-D2XNLIFU.js.map
124
+ //# sourceMappingURL=chunk-MUYU4JI5.js.map
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  safeMax,
9
9
  safeMin
10
- } from "./chunk-E37VAV46.js";
10
+ } from "./chunk-FBLMVHDK.js";
11
11
 
12
12
  // src/pdf/image-regions.ts
13
13
  import { OPS } from "pdfjs-dist/legacy/build/pdf.mjs";
@@ -1010,8 +1010,14 @@ function edgeStroked(lines, dir, pos, a1, a2) {
1010
1010
  }
1011
1011
  function buildClipCellGrids(rects, strokedH, strokedV, pageWidth, pageHeight) {
1012
1012
  const pageArea = pageWidth * pageHeight;
1013
- const cells = rects.filter((r) => r.x2 - r.x1 >= CLIP_MIN_W2 && r.y2 - r.y1 >= CLIP_MIN_H2 && (pageArea <= 0 || (r.x2 - r.x1) * (r.y2 - r.y1) < pageArea * CLIP_MAX_PAGE_FRAC));
1014
- if (cells.length < CLIP_MIN_GROUP) return { grids: [], containers: [] };
1013
+ const sameRect = (a, b) => Math.abs(a.x1 - b.x1) <= CLIP_EDGE_TOL && Math.abs(a.x2 - b.x2) <= CLIP_EDGE_TOL && Math.abs(a.y1 - b.y1) <= CLIP_EDGE_TOL && Math.abs(a.y2 - b.y2) <= CLIP_EDGE_TOL;
1014
+ const cells = [];
1015
+ for (const r of rects) {
1016
+ if (r.x2 - r.x1 < CLIP_MIN_W2 || r.y2 - r.y1 < CLIP_MIN_H2) continue;
1017
+ if (pageArea > 0 && (r.x2 - r.x1) * (r.y2 - r.y1) >= pageArea * CLIP_MAX_PAGE_FRAC) continue;
1018
+ if (!cells.some((c) => sameRect(c, r))) cells.push(r);
1019
+ }
1020
+ if (cells.length < 1) return { grids: [], containers: [] };
1015
1021
  const parent = new Array(cells.length).fill(-1);
1016
1022
  for (let i = 0; i < cells.length; i++) {
1017
1023
  for (let j = 0; j < cells.length; j++) {
@@ -1046,15 +1052,30 @@ function buildClipCellGrids(rects, strokedH, strokedV, pageWidth, pageHeight) {
1046
1052
  if (g) g.push(i);
1047
1053
  else groups.set(r, [i]);
1048
1054
  }
1049
- const containers = [];
1050
- for (let i = 0; i < cells.length; i++) {
1051
- if (!isContainer[i]) continue;
1052
- const r = cells[i];
1053
- if (!containers.some((c) => Math.abs(c.x1 - r.x1) <= CLIP_EDGE_TOL && Math.abs(c.x2 - r.x2) <= CLIP_EDGE_TOL && Math.abs(c.y1 - r.y1) <= CLIP_EDGE_TOL && Math.abs(c.y2 - r.y2) <= CLIP_EDGE_TOL)) containers.push(r);
1054
- }
1055
+ const containers = cells.filter((_, i) => isContainer[i]);
1056
+ const groupSize = (i) => groups.get(find(i))?.length ?? 0;
1057
+ const isGridMember = (i) => groupSize(i) >= CLIP_MIN_GROUP;
1058
+ const framed = (r) => edgeStroked(strokedH, "h", r.y1, r.x1, r.x2) && edgeStroked(strokedH, "h", r.y2, r.x1, r.x2) && edgeStroked(strokedV, "v", r.x1, r.y1, r.y2) && edgeStroked(strokedV, "v", r.x2, r.y1, r.y2);
1059
+ const loneFrame = (i) => isContainer[i] && !isGridMember(i) && framed(cells[i]);
1060
+ const parentAttachable = (i) => parent[i] >= 0 && (isGridMember(parent[i]) || loneFrame(parent[i]));
1061
+ const onlyChild = (i) => parent[i] >= 0 && parent.filter((p) => p === parent[i]).length === 1;
1055
1062
  const grids = [];
1056
1063
  for (const idxs of groups.values()) {
1057
- if (idxs.length < CLIP_MIN_GROUP) continue;
1064
+ const first = idxs[0];
1065
+ const parentRect = parentAttachable(first) ? cells[parent[first]] : void 0;
1066
+ if (idxs.length < CLIP_MIN_GROUP) {
1067
+ if (!loneFrame(first) && !((parentRect || onlyChild(first)) && framed(cells[first]))) continue;
1068
+ const r = cells[first];
1069
+ grids.push({
1070
+ rowYs: [r.y2, r.y1],
1071
+ colXs: [r.x1, r.x2],
1072
+ bbox: { x1: r.x1, y1: r.y1, x2: r.x2, y2: r.y2 },
1073
+ vertexRadius: 1,
1074
+ cells: [{ row: 0, col: 0, rowSpan: 1, colSpan: 1, bbox: { x1: r.x1, y1: r.y1, x2: r.x2, y2: r.y2 } }],
1075
+ ...parentRect ? { clipParent: parentRect } : {}
1076
+ });
1077
+ continue;
1078
+ }
1058
1079
  const members = idxs.map((i) => cells[i]);
1059
1080
  let edges = 0, invisible = 0;
1060
1081
  for (const r of members) {
@@ -1095,7 +1116,8 @@ function buildClipCellGrids(rects, strokedH, strokedV, pageWidth, pageHeight) {
1095
1116
  colXs,
1096
1117
  bbox: { x1: colXs[0], y1: rowYs[numRows], x2: colXs[numCols], y2: rowYs[0] },
1097
1118
  vertexRadius: 1,
1098
- cells: out
1119
+ cells: out,
1120
+ ...parentRect ? { clipParent: parentRect } : {}
1099
1121
  });
1100
1122
  }
1101
1123
  return { grids, containers };
@@ -3464,9 +3486,47 @@ function isProseBoxGrid(grid, verticals, table) {
3464
3486
  if (longCells < PROSEBOX_LONG_CELL_MIN || longCells < texts.length * PROSEBOX_LONG_CELL_RATIO) return false;
3465
3487
  return true;
3466
3488
  }
3489
+ function cleanCellText(text) {
3490
+ const stripped = text.replace(/^[\s]*[-–—]\s*\d+\s*[-–—][\s]*$/gm, "").trim();
3491
+ return stripped.split("\n").map((line) => collapseEvenSpacing(line)).join("\n");
3492
+ }
3493
+ var FRAME_RECT_TOL = 1.5;
3494
+ function takePendingNested(pending, cellBox) {
3495
+ const out = [];
3496
+ for (let i = pending.length - 1; i >= 0; i--) {
3497
+ const p = pending[i].parent;
3498
+ if (Math.abs(p.x1 - cellBox.x1) <= FRAME_RECT_TOL && Math.abs(p.x2 - cellBox.x2) <= FRAME_RECT_TOL && Math.abs(p.y1 - cellBox.y1) <= FRAME_RECT_TOL && Math.abs(p.y2 - cellBox.y2) <= FRAME_RECT_TOL) {
3499
+ out.push(pending[i].block);
3500
+ pending.splice(i, 1);
3501
+ }
3502
+ }
3503
+ return out;
3504
+ }
3505
+ function buildFrameCellBlocks(cellItems, nested, pageNum) {
3506
+ const tables = [...nested].sort((a, b) => b.bbox.y + b.bbox.height - (a.bbox.y + a.bbox.height));
3507
+ const blocks = [];
3508
+ let rest = [...cellItems];
3509
+ const pushParagraphs = (items) => {
3510
+ if (items.length === 0) return;
3511
+ for (const line of cleanCellText(cellTextToString(items)).split("\n")) {
3512
+ const t = line.trim();
3513
+ if (t) blocks.push({ type: "paragraph", text: t, pageNumber: pageNum });
3514
+ }
3515
+ };
3516
+ for (const tb of tables) {
3517
+ const bottom = tb.bbox.y;
3518
+ pushParagraphs(rest.filter((it) => it.y >= bottom));
3519
+ rest = rest.filter((it) => it.y < bottom);
3520
+ blocks.push(tb);
3521
+ }
3522
+ pushParagraphs(rest);
3523
+ const text = blocks.map((b) => b.type === "table" && b.table ? b.table.cells.flat().map((c) => c.text).filter(Boolean).join("\n") : b.text ?? "").filter(Boolean).join("\n");
3524
+ return { blocks, text };
3525
+ }
3467
3526
  function extractBlocksWithGrids(items, pageNum, grids, horizontals, verticals) {
3468
3527
  const blocks = [];
3469
3528
  const usedItems = /* @__PURE__ */ new Set();
3529
+ const pendingNested = [];
3470
3530
  const gridArea = (g) => (g.bbox.x2 - g.bbox.x1) * (g.bbox.y2 - g.bbox.y1);
3471
3531
  const sortedGrids = [...grids].sort((a, b) => (b.cells ? 1 : 0) - (a.cells ? 1 : 0) || (a.cells && b.cells ? gridArea(a) - gridArea(b) : 0) || b.bbox.y2 - a.bbox.y2);
3472
3532
  for (const grid of sortedGrids) {
@@ -3506,13 +3566,18 @@ function extractBlocksWithGrids(items, pageNum, grids, horizontals, verticals) {
3506
3566
  { length: numRows },
3507
3567
  () => Array.from({ length: numCols }, () => ({ text: "", colSpan: 1, rowSpan: 1 }))
3508
3568
  );
3569
+ let nestedAttached = false;
3509
3570
  for (const cell of cells) {
3510
3571
  const cellItems = cellTextMap.get(cell) || [];
3511
- let text = cellTextToString(cellItems);
3512
- text = text.replace(/^[\s]*[-–—]\s*\d+\s*[-–—][\s]*$/gm, "").trim();
3513
- text = text.split("\n").map((line) => collapseEvenSpacing(line)).join("\n");
3572
+ const nested = grid.cells ? takePendingNested(pendingNested, cell.bbox) : [];
3573
+ if (nested.length > 0) {
3574
+ nestedAttached = true;
3575
+ const built = buildFrameCellBlocks(cellItems, nested, pageNum);
3576
+ irGrid[cell.row][cell.col] = { text: built.text, colSpan: cell.colSpan, rowSpan: cell.rowSpan, blocks: built.blocks };
3577
+ continue;
3578
+ }
3514
3579
  irGrid[cell.row][cell.col] = {
3515
- text,
3580
+ text: cleanCellText(cellTextToString(cellItems)),
3516
3581
  colSpan: cell.colSpan,
3517
3582
  rowSpan: cell.rowSpan
3518
3583
  };
@@ -3520,18 +3585,11 @@ function extractBlocksWithGrids(items, pageNum, grids, horizontals, verticals) {
3520
3585
  let finalGrid = irGrid;
3521
3586
  let finalRows = numRows;
3522
3587
  let rebuiltUsed = false;
3523
- if (numRows <= 2 && numCols >= 3) {
3588
+ if (numRows <= 2 && numCols >= 3 && !nestedAttached) {
3524
3589
  const rebuilt = normalizeUndersegmentedTable(irGrid, grid.colXs, textItems);
3525
3590
  if (rebuilt) {
3526
3591
  rebuiltUsed = true;
3527
- finalGrid = rebuilt.map((row) => row.map((rawText) => {
3528
- const cleaned = rawText.replace(/^[\s]*[-–—]\s*\d+\s*[-–—][\s]*$/gm, "").trim();
3529
- return {
3530
- text: cleaned.split("\n").map((line) => collapseEvenSpacing(line)).join("\n"),
3531
- colSpan: 1,
3532
- rowSpan: 1
3533
- };
3534
- }));
3592
+ finalGrid = rebuilt.map((row) => row.map((rawText) => ({ text: cleanCellText(rawText), colSpan: 1, rowSpan: 1 })));
3535
3593
  finalRows = finalGrid.length;
3536
3594
  }
3537
3595
  }
@@ -3548,6 +3606,11 @@ function extractBlocksWithGrids(items, pageNum, grids, horizontals, verticals) {
3548
3606
  };
3549
3607
  const hasContent = finalGrid.some((row) => row.some((cell) => cell.text.trim() !== ""));
3550
3608
  if (!hasContent) continue;
3609
+ if (grid.clipParent) {
3610
+ const nb = { page: pageNum, x: grid.bbox.x1, y: grid.bbox.y1, width: grid.bbox.x2 - grid.bbox.x1, height: grid.bbox.y2 - grid.bbox.y1 };
3611
+ pendingNested.push({ parent: grid.clipParent, block: { type: "table", table: irTable, pageNumber: pageNum, bbox: nb } });
3612
+ continue;
3613
+ }
3551
3614
  if (!grid.cells && isProseBoxGrid(grid, verticals, irTable)) {
3552
3615
  for (const it of tableItems) usedItems.delete(it);
3553
3616
  continue;
@@ -3569,6 +3632,7 @@ function extractBlocksWithGrids(items, pageNum, grids, horizontals, verticals) {
3569
3632
  }
3570
3633
  blocks.push({ type: "table", table: irTable, pageNumber: pageNum, bbox: tableBbox });
3571
3634
  }
3635
+ for (const p of pendingNested) blocks.push(p.block);
3572
3636
  let remaining = items.filter((i) => !usedItems.has(i));
3573
3637
  const groupSizes = [];
3574
3638
  let finalTextBlocks = [];
@@ -3878,4 +3942,4 @@ export {
3878
3942
  extractPageBlocksWithLines,
3879
3943
  mergeCrossPageTables
3880
3944
  };
3881
- //# sourceMappingURL=chunk-OS2IOI3W.js.map
3945
+ //# sourceMappingURL=chunk-OEYECZGV.js.map