kordoc 4.22.7 → 4.22.9

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 (128) hide show
  1. package/README.md +7 -5
  2. package/dist/{-O7EP5UQ2.js → -KJW567ZH.js} +11 -11
  3. package/dist/{chunk-CRMEBMMW.js → chunk-3MTKUEA7.js} +4 -4
  4. package/dist/{chunk-DLAPQKGK.js → chunk-55XTFFLH.js} +11 -4
  5. package/dist/chunk-55XTFFLH.js.map +1 -0
  6. package/dist/{chunk-DXJRDFCT.js → chunk-6LM4CAOF.js} +2 -2
  7. package/dist/chunk-6LM4CAOF.js.map +1 -0
  8. package/dist/{chunk-BHSATDA7.js → chunk-7PBVL7NL.js} +2 -2
  9. package/dist/{chunk-CVKSBUIO.js → chunk-7RVYIPLH.js} +2 -2
  10. package/dist/{chunk-PILIRK7O.js → chunk-AX3XT5Y7.js} +10 -3
  11. package/dist/chunk-AX3XT5Y7.js.map +1 -0
  12. package/dist/{chunk-DFBGN2TG.js → chunk-AZUWSGMI.js} +2 -2
  13. package/dist/{chunk-R3T4RTQL.cjs → chunk-BTLQOIES.cjs} +30 -23
  14. package/dist/chunk-BTLQOIES.cjs.map +1 -0
  15. package/dist/{chunk-BIF35Q4D.js → chunk-CKWCSQGW.js} +11 -11
  16. package/dist/{chunk-ZNSWN4JM.js → chunk-D44JWJPI.js} +2 -2
  17. package/dist/{chunk-CEOOL37E.js → chunk-DF6NB52F.js} +4 -4
  18. package/dist/{chunk-FJ45NNLA.cjs → chunk-EREKI4DD.cjs} +2 -2
  19. package/dist/{chunk-FJ45NNLA.cjs.map → chunk-EREKI4DD.cjs.map} +1 -1
  20. package/dist/{chunk-V2SJJHJH.js → chunk-F6C4UO55.js} +5 -3
  21. package/dist/{chunk-V2SJJHJH.js.map → chunk-F6C4UO55.js.map} +1 -1
  22. package/dist/{chunk-BFAYABLC.js → chunk-MLTGRR6C.js} +5 -3
  23. package/dist/{chunk-BFAYABLC.js.map → chunk-MLTGRR6C.js.map} +1 -1
  24. package/dist/{chunk-D4YBFNWK.js → chunk-NT54LN6C.js} +123 -15
  25. package/dist/chunk-NT54LN6C.js.map +1 -0
  26. package/dist/{chunk-QYFBXJGK.js → chunk-OREE2GWG.js} +2 -2
  27. package/dist/{chunk-CIDWITQN.cjs → chunk-Q3GZMZTK.cjs} +24 -24
  28. package/dist/{chunk-CIDWITQN.cjs.map → chunk-Q3GZMZTK.cjs.map} +1 -1
  29. package/dist/{chunk-VYH2ATWU.js → chunk-R5TMMRVG.js} +2 -2
  30. package/dist/{chunk-S34OVRKD.cjs → chunk-SO4ZYWYE.cjs} +9 -7
  31. package/dist/chunk-SO4ZYWYE.cjs.map +1 -0
  32. package/dist/{chunk-F537QK7M.cjs → chunk-SU6ABNIX.cjs} +3 -3
  33. package/dist/{chunk-F537QK7M.cjs.map → chunk-SU6ABNIX.cjs.map} +1 -1
  34. package/dist/{chunk-WBR62IXV.js → chunk-UNFXTOU3.js} +3 -3
  35. package/dist/{chunk-ZW3RY4YT.js → chunk-UPZISYRP.js} +2 -2
  36. package/dist/{chunk-5S4UCIGP.js → chunk-VH2QBIUA.js} +2 -2
  37. package/dist/{chunk-6U2O5LAV.js → chunk-VQ5DOQZO.js} +3 -3
  38. package/dist/{chunk-TN4SSNES.cjs → chunk-VSH7EV3W.cjs} +3 -3
  39. package/dist/{chunk-TN4SSNES.cjs.map → chunk-VSH7EV3W.cjs.map} +1 -1
  40. package/dist/{chunk-OTCH63U3.js → chunk-XSRXVLOL.js} +2 -2
  41. package/dist/{chunk-RHHRVPLL.js → chunk-Z4SUS7JW.js} +2 -2
  42. package/dist/{chunk-YVRARYLN.js → chunk-ZBUOPXGD.js} +2 -2
  43. package/dist/{chunk-5VCZDP2K.js → chunk-ZP6SRHAD.js} +2 -2
  44. package/dist/chunks-YCPWFWFT.js +10 -0
  45. package/dist/cli.js +30 -30
  46. package/dist/{formula-EQ2KQA5T.js → formula-47QIFQ7V.js} +4 -4
  47. package/dist/{formula-RH55FUJF.js → formula-GZEMCXLD.js} +3 -3
  48. package/dist/{formula-3M6U2J7S.cjs → formula-JCG77RAE.cjs} +9 -9
  49. package/dist/{formula-3M6U2J7S.cjs.map → formula-JCG77RAE.cjs.map} +1 -1
  50. package/dist/{image-ocr-KIKAO43E.js → image-ocr-FAHJNFDG.js} +9 -9
  51. package/dist/{image-ocr-LO2GZKA5.js → image-ocr-HEKAORHV.js} +6 -6
  52. package/dist/{image-ocr-DP4YTLGN.cjs → image-ocr-RTS5BZRM.cjs} +17 -17
  53. package/dist/{image-ocr-DP4YTLGN.cjs.map → image-ocr-RTS5BZRM.cjs.map} +1 -1
  54. package/dist/index.cjs +543 -435
  55. package/dist/index.cjs.map +1 -1
  56. package/dist/index.d.cts +2 -0
  57. package/dist/index.d.ts +2 -0
  58. package/dist/index.js +123 -15
  59. package/dist/index.js.map +1 -1
  60. package/dist/mcp.js +22 -22
  61. package/dist/{model-bundle-EAQ6LWS5.js → model-bundle-IN3RQ52S.js} +5 -5
  62. package/dist/{models-ZN6JAI4Q.js → models-FHSKU7WB.js} +5 -5
  63. package/dist/{parse-worker-v2-UKFFINUH.js → parse-worker-v2-I3A77UZB.js} +12 -12
  64. package/dist/{parser-CGKXEB3U.cjs → parser-A4SIJK2I.cjs} +157 -157
  65. package/dist/{parser-CGKXEB3U.cjs.map → parser-A4SIJK2I.cjs.map} +1 -1
  66. package/dist/{parser-DFV3VDWX.js → parser-JDLV2EI4.js} +12 -12
  67. package/dist/{parser-TJFS44BI.js → parser-ZLZRQLZU.js} +9 -9
  68. package/dist/pdf-ocr-MKSW5GJ7.cjs +31 -0
  69. package/dist/{pdf-ocr-U5MFMNCW.cjs.map → pdf-ocr-MKSW5GJ7.cjs.map} +1 -1
  70. package/dist/{pdf-ocr-CATVQJ2I.js → pdf-ocr-SJKJ7JT7.js} +6 -6
  71. package/dist/{pdf-ocr-EQXJAKHB.js → pdf-ocr-VIEII6TD.js} +9 -9
  72. package/dist/{profile-io-5IG6SSMK.js → profile-io-ZPCTNRBM.js} +3 -3
  73. package/dist/{rasterize-W4TJFQBT.js → rasterize-QT7IPC27.js} +3 -3
  74. package/dist/{redact-doc-LZ3PY2LX.js → redact-doc-64PLXN3U.js} +11 -11
  75. package/dist/{render-N2QA335I.js → render-43RSFAGY.js} +7 -7
  76. package/dist/seal-RQZTBH54.js +10 -0
  77. package/dist/{setup-5Y2UAWZG.js → setup-46VYX5XM.js} +3 -3
  78. package/dist/visual-JFUP46UP.js +21 -0
  79. package/dist/{watch-2MLCRQZQ.js → watch-ZBBQKEKD.js} +12 -12
  80. package/package.json +1 -1
  81. package/dist/chunk-D4YBFNWK.js.map +0 -1
  82. package/dist/chunk-DLAPQKGK.js.map +0 -1
  83. package/dist/chunk-DXJRDFCT.js.map +0 -1
  84. package/dist/chunk-PILIRK7O.js.map +0 -1
  85. package/dist/chunk-R3T4RTQL.cjs.map +0 -1
  86. package/dist/chunk-S34OVRKD.cjs.map +0 -1
  87. package/dist/chunks-MPPNEL5A.js +0 -10
  88. package/dist/pdf-ocr-U5MFMNCW.cjs +0 -31
  89. package/dist/seal-FYJZMW4G.js +0 -10
  90. package/dist/visual-VQGE67RU.js +0 -21
  91. /package/dist/{-O7EP5UQ2.js.map → -KJW567ZH.js.map} +0 -0
  92. /package/dist/{chunk-CRMEBMMW.js.map → chunk-3MTKUEA7.js.map} +0 -0
  93. /package/dist/{chunk-BHSATDA7.js.map → chunk-7PBVL7NL.js.map} +0 -0
  94. /package/dist/{chunk-CVKSBUIO.js.map → chunk-7RVYIPLH.js.map} +0 -0
  95. /package/dist/{chunk-DFBGN2TG.js.map → chunk-AZUWSGMI.js.map} +0 -0
  96. /package/dist/{chunk-BIF35Q4D.js.map → chunk-CKWCSQGW.js.map} +0 -0
  97. /package/dist/{chunk-ZNSWN4JM.js.map → chunk-D44JWJPI.js.map} +0 -0
  98. /package/dist/{chunk-CEOOL37E.js.map → chunk-DF6NB52F.js.map} +0 -0
  99. /package/dist/{chunk-QYFBXJGK.js.map → chunk-OREE2GWG.js.map} +0 -0
  100. /package/dist/{chunk-VYH2ATWU.js.map → chunk-R5TMMRVG.js.map} +0 -0
  101. /package/dist/{chunk-WBR62IXV.js.map → chunk-UNFXTOU3.js.map} +0 -0
  102. /package/dist/{chunk-ZW3RY4YT.js.map → chunk-UPZISYRP.js.map} +0 -0
  103. /package/dist/{chunk-5S4UCIGP.js.map → chunk-VH2QBIUA.js.map} +0 -0
  104. /package/dist/{chunk-6U2O5LAV.js.map → chunk-VQ5DOQZO.js.map} +0 -0
  105. /package/dist/{chunk-OTCH63U3.js.map → chunk-XSRXVLOL.js.map} +0 -0
  106. /package/dist/{chunk-RHHRVPLL.js.map → chunk-Z4SUS7JW.js.map} +0 -0
  107. /package/dist/{chunk-YVRARYLN.js.map → chunk-ZBUOPXGD.js.map} +0 -0
  108. /package/dist/{chunk-5VCZDP2K.js.map → chunk-ZP6SRHAD.js.map} +0 -0
  109. /package/dist/{chunks-MPPNEL5A.js.map → chunks-YCPWFWFT.js.map} +0 -0
  110. /package/dist/{formula-EQ2KQA5T.js.map → formula-47QIFQ7V.js.map} +0 -0
  111. /package/dist/{formula-RH55FUJF.js.map → formula-GZEMCXLD.js.map} +0 -0
  112. /package/dist/{image-ocr-KIKAO43E.js.map → image-ocr-FAHJNFDG.js.map} +0 -0
  113. /package/dist/{image-ocr-LO2GZKA5.js.map → image-ocr-HEKAORHV.js.map} +0 -0
  114. /package/dist/{model-bundle-EAQ6LWS5.js.map → model-bundle-IN3RQ52S.js.map} +0 -0
  115. /package/dist/{models-ZN6JAI4Q.js.map → models-FHSKU7WB.js.map} +0 -0
  116. /package/dist/{parse-worker-v2-UKFFINUH.js.map → parse-worker-v2-I3A77UZB.js.map} +0 -0
  117. /package/dist/{parser-DFV3VDWX.js.map → parser-JDLV2EI4.js.map} +0 -0
  118. /package/dist/{parser-TJFS44BI.js.map → parser-ZLZRQLZU.js.map} +0 -0
  119. /package/dist/{pdf-ocr-CATVQJ2I.js.map → pdf-ocr-SJKJ7JT7.js.map} +0 -0
  120. /package/dist/{pdf-ocr-EQXJAKHB.js.map → pdf-ocr-VIEII6TD.js.map} +0 -0
  121. /package/dist/{profile-io-5IG6SSMK.js.map → profile-io-ZPCTNRBM.js.map} +0 -0
  122. /package/dist/{rasterize-W4TJFQBT.js.map → rasterize-QT7IPC27.js.map} +0 -0
  123. /package/dist/{redact-doc-LZ3PY2LX.js.map → redact-doc-64PLXN3U.js.map} +0 -0
  124. /package/dist/{render-N2QA335I.js.map → render-43RSFAGY.js.map} +0 -0
  125. /package/dist/{seal-FYJZMW4G.js.map → seal-RQZTBH54.js.map} +0 -0
  126. /package/dist/{setup-5Y2UAWZG.js.map → setup-46VYX5XM.js.map} +0 -0
  127. /package/dist/{visual-VQGE67RU.js.map → visual-JFUP46UP.js.map} +0 -0
  128. /package/dist/{watch-2MLCRQZQ.js.map → watch-ZBBQKEKD.js.map} +0 -0
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  loadSharp,
4
4
  rasterizePageSvg
5
- } from "./chunk-5S4UCIGP.js";
5
+ } from "./chunk-VH2QBIUA.js";
6
6
  import {
7
7
  inlineImagesIntoMarkdown
8
8
  } from "./chunk-VKVDMH7X.js";
@@ -16,7 +16,7 @@ import {
16
16
  HEADING_RATIO_H3,
17
17
  tidyScriptTags,
18
18
  unframeLayoutTables
19
- } from "./chunk-DXJRDFCT.js";
19
+ } from "./chunk-6LM4CAOF.js";
20
20
  import {
21
21
  MAX_COLS,
22
22
  MAX_ROWS,
@@ -32,7 +32,7 @@ import {
32
32
  mapPuaText,
33
33
  markNonLayoutTable,
34
34
  romanNumeral
35
- } from "./chunk-V2SJJHJH.js";
35
+ } from "./chunk-F6C4UO55.js";
36
36
  import {
37
37
  DEFAULT_CHAR,
38
38
  DEFAULT_PARA_GEOM,
@@ -46,7 +46,7 @@ import {
46
46
  hwpxAppMajor,
47
47
  parseRenderStyles,
48
48
  readZipEntry
49
- } from "./chunk-CVKSBUIO.js";
49
+ } from "./chunk-7RVYIPLH.js";
50
50
  import {
51
51
  KordocError,
52
52
  compareSectionPaths,
@@ -54,7 +54,7 @@ import {
54
54
  precheckZipSize,
55
55
  sanitizeHref,
56
56
  toArrayBuffer
57
- } from "./chunk-DFBGN2TG.js";
57
+ } from "./chunk-AZUWSGMI.js";
58
58
 
59
59
  // src/render/svg-render.ts
60
60
  import JSZip from "jszip";
@@ -10412,6 +10412,13 @@ for (const [face, fix] of Object.entries(FACE_WIDTH_FIX)) {
10412
10412
  }
10413
10413
  FONTS[face] = { ...m, ascii, ex };
10414
10414
  }
10415
+ var CHE_HALF = "0-1f 7f a0 a2-a3 a5-a6 a9 ab-ac af b5 bb c0-c5 c7-cf d1-d6 d9-dd e0-e5 e7-ef f1-f6 f9-fd ff-110 112-125 128-130 134-137 139-13e 143-148 14c-151 154-165 168-17f 192 1fa-1ff 2c6 2c9 2dc 37e 384-38a 38c 38e-390 3aa-3b0 3c2 3ca-3ce 402-40c 40e-40f 452-45c 45e-45f 490-491 1e80-1e85 1ef2-1ef3 2013-2014 2017 201a-201b 201e 2022 2039-203a 203c 203e 2044 20a3-20a4 20a7 20a9 2105 212e 21a8 2206 2212 2215 2219 221f 2248 2302 2310 2320-2321 2550-256c 2580 2584 2588 258c 2590-2591 2593 25aa-25ac 25ba 25c4 25ca 25d8-25d9 25e6 263a-263c 2666 266b fb01-fb02";
10416
+ var cheEx = { ...FONTS["\uAD74\uB9BC\uCCB4"].ex };
10417
+ for (const r of CHE_HALF.split(" ")) {
10418
+ const [a, b] = r.split("-").map((x) => parseInt(x, 16));
10419
+ for (let c = a; c <= (b ?? a); c++) cheEx[c] = 500;
10420
+ }
10421
+ FONTS["\uAD74\uB9BC\uCCB4"] = FONTS["\uB3CB\uC6C0\uCCB4"] = { ...FONTS["\uAD74\uB9BC\uCCB4"], ex: cheEx };
10415
10422
  for (const [face, wm] of Object.entries(seoulFontWidths())) {
10416
10423
  const m = FONTS[face], ascii = m ? [...m.ascii] : new Array(95).fill(500), ex = m ? { ...m.ex } : {};
10417
10424
  for (const [cp, w] of wm) {
@@ -10432,13 +10439,97 @@ function fontHasGlyph(face, cp) {
10432
10439
  return cp >= 32 && cp <= 126 || FONTS[face.trim()].ex[cp] !== void 0;
10433
10440
  }
10434
10441
  var HANCOM_FALLBACK_W = { 8228: 173, 8231: 173, 8211: 430, 8680: 1e3, 8728: 500, 8227: 465, 12295: 1e3, 61607: 937 / 2048 * 1e3, 61599: 937 / 2048 * 1e3, 61550: 1529 / 2048 * 1e3 };
10442
+ var WINGDINGS_ADV = {
10443
+ 641: "9e a0",
10444
+ 789: "fa",
10445
+ 937: "73 9f a7",
10446
+ 938: "27",
10447
+ 987: "f9",
10448
+ 1086: "7d 7e",
10449
+ 1124: "47 48",
10450
+ 1135: "35",
10451
+ 1183: "77",
10452
+ 1203: "41",
10453
+ 1233: "36",
10454
+ 1301: "fb",
10455
+ 1332: "53",
10456
+ 1352: "4e",
10457
+ 1381: "43 44",
10458
+ 1420: "58",
10459
+ 1431: "32 33",
10460
+ 1480: "57",
10461
+ 1529: "55 56 6c 6e 74",
10462
+ 1589: "e3 e4 e5 e6",
10463
+ 1597: "69",
10464
+ 1601: "f5 f6 f7 f8",
10465
+ 1609: "fc",
10466
+ 1624: "42",
10467
+ 1627: "59 d7 d8",
10468
+ 1660: "f1 f2 f4",
10469
+ 1665: "54",
10470
+ 1727: "4a 4b 4c",
10471
+ 1739: "4f",
10472
+ 1787: "eb ec ed ee",
10473
+ 1803: "52",
10474
+ 1813: "5a",
10475
+ 1819: "51",
10476
+ 1825: "3b 3e 5d 6f 70 71 72 76 7a a1 a2 a3 a4 a5 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 d9 da db dc dd de e1 e2 e9 ea ef f0",
10477
+ 1826: "29 34 3c 3d 49 5b 7b 7c 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 fd fe",
10478
+ 1830: "25",
10479
+ 1834: "5c",
10480
+ 1863: "3f 40",
10481
+ 1902: "66",
10482
+ 1911: "63",
10483
+ 1924: "3a",
10484
+ 1927: "62",
10485
+ 1929: "45 46",
10486
+ 1937: "64",
10487
+ 1941: "38",
10488
+ 1951: "6d a6",
10489
+ 1974: "60",
10490
+ 2006: "df e0",
10491
+ 2020: "75",
10492
+ 2048: "20 96 97 98 99 9a 9b 9c 9d cb cc cd ce cf d0 d1 d2 d3 d4",
10493
+ 2099: "65",
10494
+ 2110: "21",
10495
+ 2119: "ff",
10496
+ 2146: "c7 c8 c9 ca",
10497
+ 2150: "6a",
10498
+ 2159: "5f",
10499
+ 2171: "78 79 f3",
10500
+ 2181: "68",
10501
+ 2186: "e7 e8",
10502
+ 2196: "37",
10503
+ 2208: "39",
10504
+ 2220: "28",
10505
+ 2230: "50",
10506
+ 2233: "61",
10507
+ 2245: "30 67",
10508
+ 2275: "4d",
10509
+ 2319: "2a 2b",
10510
+ 2344: "22",
10511
+ 2368: "5e",
10512
+ 2399: "2c 2d",
10513
+ 2492: "26",
10514
+ 2566: "d5 d6",
10515
+ 2603: "6b",
10516
+ 2665: "23",
10517
+ 2751: "31",
10518
+ 2752: "24",
10519
+ 2951: "2e",
10520
+ 2956: "2f"
10521
+ };
10522
+ for (const [adv, list] of Object.entries(WINGDINGS_ADV)) for (const c of list.split(" ")) {
10523
+ const cp = 61440 + parseInt(c, 16);
10524
+ if (cp !== 61600 && !(cp in HANCOM_FALLBACK_W)) HANCOM_FALLBACK_W[cp] = Number(adv) / 2048 * 1e3;
10525
+ }
10435
10526
  function isHanja(cp) {
10436
10527
  return cp >= 19968 && cp <= 40959 || cp >= 13312 && cp <= 19903 || cp >= 63744 && cp <= 64255;
10437
10528
  }
10438
10529
  function fontWidthFn(face, fallback = true) {
10439
10530
  if (!hasFontMetrics(face)) return null;
10440
10531
  const m = FONTS[face.trim()];
10441
- return (cp) => cp >= 32 && cp <= 126 ? m.ascii[cp - 32] : m.ex[cp] ?? ((fallback ? HANCOM_FALLBACK_W[cp] : void 0) ?? (isHalfwidthForm(cp) ? 500 : m.han !== void 0 && isHanja(cp) ? m.han : m.cjk));
10532
+ return (cp) => cp >= 32 && cp <= 126 ? m.ascii[cp - 32] : (fallback ? m.ex[cp] ?? HANCOM_FALLBACK_W[cp] : void 0) ?? (isHalfwidthForm(cp) ? 500 : m.han !== void 0 && isHanja(cp) ? m.han : m.cjk);
10442
10533
  }
10443
10534
  function isHalfwidthForm(cp) {
10444
10535
  return cp >= 65377 && cp <= 65500 || cp >= 65512 && cp <= 65518;
@@ -11497,7 +11588,8 @@ function splitTableRows(tbl, top, lim, bodyH, styles, notes) {
11497
11588
  if (mode === "CELL") {
11498
11589
  const from = /* @__PURE__ */ new Map(), bases = /* @__PURE__ */ new Map();
11499
11590
  while (y + h + outB > fl() && bodyH - outT - outB > 0) {
11500
- const rem = cellRowRemainder(cells, r, fl() - outB - y - (moved ? 100 : 20) - 2 * sp, from, record, bases, carries, styles, bodyH - outT - outB, fl() - outB - y - 101 - 2 * sp);
11591
+ const fixedRows = tbl.getAttribute("noAdjust") === "1";
11592
+ const rem = cellRowRemainder(cells, r, fl() - outB - y - (moved ? 100 : 20) - 2 * sp, from, record, bases, carries, styles, bodyH - outT - outB, fl() - outB - y - (fixedRows ? 2 : 101) - 2 * sp, fixedRows);
11501
11593
  if (rem === 0 && r === rows.length - 1) break;
11502
11594
  if (rem === void 0 || rem + sp + (r === rows.length - 1 ? sp : 0) >= h) {
11503
11595
  if (moved && y === outT + headH) break;
@@ -11529,7 +11621,7 @@ function splitTableRows(tbl, top, lim, bodyH, styles, notes) {
11529
11621
  splitMovedLast = moved;
11530
11622
  return y + capBottom + outB;
11531
11623
  }
11532
- function cellRowRemainder(cells, row, avail, from, record, bases, carries, styles, contH = 0, piece = Infinity) {
11624
+ function cellRowRemainder(cells, row, avail, from, record, bases, carries, styles, contH = 0, piece = Infinity, fixedRows = false) {
11533
11625
  let rem = 0, any = false, placed = false;
11534
11626
  const cuts = [];
11535
11627
  for (const c of cells) {
@@ -11597,7 +11689,7 @@ function cellRowRemainder(cells, row, avail, from, record, bases, carries, style
11597
11689
  }
11598
11690
  cuts.push([c.el, base + lines[k][0], nb]);
11599
11691
  rem = Math.max(rem, end + base - nb + c.marginT + c.marginB);
11600
- if (off === 0 && /^(CENTER|BOTTOM)$/.test(c.sub.getAttribute("vertAlign") ?? "")) rem = Math.max(rem, c.h - piece);
11692
+ if (off === 0 && (fixedRows || /^(CENTER|BOTTOM)$/.test(c.sub.getAttribute("vertAlign") ?? ""))) rem = Math.max(rem, c.h - piece);
11601
11693
  }
11602
11694
  if (!(any && placed)) return void 0;
11603
11695
  for (const [el, v, nb] of cuts) {
@@ -12382,7 +12474,8 @@ function reflowPara(p, doc, styles, areaW, startV, mode, zones = [], nums = /* @
12382
12474
  }
12383
12475
  return m.objs.some((o) => o.inline && o.tag === "equation" && lineOf(o.index) === li);
12384
12476
  })();
12385
- const lineH = objOnly ? lineObjH[li] : Math.max(textH, lineObjH[li]);
12477
+ const endH = li === wrap.starts.length - 1 && lineObjH[li] > 0 && lineObjH[li] < textH && !m.chars.slice(textposOf[li]).some((c) => c.ch && c.ch.trim() !== "") && m.objs.some((o) => o.inline && o.tag === "tbl" && lineOf(o.index) === li) ? heightOf(m.runs[m.runs.length - 1]?.prId ?? null) : -1;
12478
+ const lineH = objOnly ? lineObjH[li] : endH >= 0 ? Math.max(lineObjH[li], endH) : Math.max(textH, lineObjH[li]);
12386
12479
  const spBase = lineObjLs[li] || geom.lineSpacingType === "FIXED" ? lineH : textH;
12387
12480
  const spacing = pitchFor(spBase, geom) - spBase;
12388
12481
  if (band && v < band[1] && v + lineH > band[0]) v = band[1];
@@ -12404,7 +12497,7 @@ function reflowPara(p, doc, styles, areaW, startV, mode, zones = [], nums = /* @
12404
12497
  seg.setAttribute("vertpos", String(vertpos));
12405
12498
  seg.setAttribute("vertsize", String(emptyBorder ? textH0 : occupiedH === textH && boxAll > textH0 ? Math.max(textH0, boxTop) : occupiedH));
12406
12499
  seg.setAttribute("textheight", String(lineH));
12407
- seg.setAttribute("baseline", String(geom.vertAlign === "TOP" ? 0 : geom.vertAlign === "CENTER" || verticalCenter && (!geom.vertAlign || geom.vertAlign === "BASELINE") ? Math.floor(lineH / 2) : geom.vertAlign === "BOTTOM" ? lineH : Math.max(fl ? fl[1] : Math.round(textH0 * BASELINE_RATIO), boxTop > textH0 ? Math.round(boxTop * BASELINE_RATIO) : 0, lineObjAsc[li])));
12500
+ seg.setAttribute("baseline", String(geom.vertAlign === "TOP" ? 0 : geom.vertAlign === "CENTER" || verticalCenter && (!geom.vertAlign || geom.vertAlign === "BASELINE") ? Math.floor(lineH / 2) : geom.vertAlign === "BOTTOM" ? lineH : endH >= 0 ? Math.max(Math.round(endH * BASELINE_RATIO), lineObjAsc[li]) : Math.max(fl ? fl[1] : Math.round(textH0 * BASELINE_RATIO), boxTop > textH0 ? Math.round(boxTop * BASELINE_RATIO) : 0, lineObjAsc[li])));
12408
12501
  seg.setAttribute("spacing", String(spacing));
12409
12502
  let box = boxAt(li);
12410
12503
  const fit = wrap.starts.length === 1 && lineObjH[li] === 0 ? lineParts[li]?.filter(([a, b]) => b - a >= 1440) : void 0;
@@ -12727,7 +12820,14 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
12727
12820
  const split3 = splitFloatTableRemainder(p, startV, lim, bodyH, styles, true);
12728
12821
  const lsa = findChildByLocalName(p, "linesegarray");
12729
12822
  const own = lsa ? elements2(lsa).filter((e) => ln2(e) === "lineseg") : [];
12730
- if (split3 !== void 0 && own.length) {
12823
+ const sq = m0Objs(p), sqPos = sq ? findChildByLocalName(sq, "pos") : null;
12824
+ const sqVo = num2(sqPos, "vertOffset"), sqTop = startV + Math.max(0, sqVo >= 2 ** 31 ? sqVo - 2 ** 32 : sqVo) + num2(sq ? findChildByLocalName(sq, "outMargin") : null, "top");
12825
+ if (split3 !== void 0 && sq && own.length && own.every((sg) => num2(sg, "vertpos") + num2(sg, "vertsize") <= sqTop)) {
12826
+ cursorV = 0;
12827
+ floatFloor = split3;
12828
+ zones.length = 0;
12829
+ splitPage = true;
12830
+ } else if (split3 !== void 0 && own.length) {
12731
12831
  const d = split3 - num2(own[0], "vertpos");
12732
12832
  for (const sg of own) sg.setAttribute("vertpos", String(num2(sg, "vertpos") + d));
12733
12833
  cursorV = res.textBottom + d;
@@ -13132,6 +13232,7 @@ function planTableRows(tbl, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan, n
13132
13232
  let hdrRows = 0;
13133
13233
  if (tbl.getAttribute("repeatHeader") === "1") while (hdrRows < nRows && cells.some((c) => c.ra === hdrRows) && cells.filter((c) => c.ra === hdrRows).every((c) => c.el.getAttribute("header") === "1")) hdrRows++;
13134
13234
  const contTop = MT + num(findChildByLocalName(tbl, "outMargin"), "top") + rowY[hdrRows];
13235
+ const outB = num(findChildByLocalName(tbl, "outMargin"), "bottom");
13135
13236
  const cellSplit = tbl.getAttribute("pageBreak") === "CELL";
13136
13237
  const out = [];
13137
13238
  let page = 0, y = ty, first = true;
@@ -13308,7 +13409,7 @@ function planTableRows(tbl, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan, n
13308
13409
  first = false;
13309
13410
  continue;
13310
13411
  }
13311
- if (!first && y + h > pageBottom && r >= hdrRows) {
13412
+ if (!first && y + h + (cellSplit ? 0 : outB) > pageBottom && r >= hdrRows) {
13312
13413
  page++;
13313
13414
  y = contTop;
13314
13415
  first = true;
@@ -14290,6 +14391,8 @@ function planLines(m, styles, numText = "") {
14290
14391
  const headW = bu?.useInstWidth === false ? [...bu.ch].reduce((w, ch) => w + glyphWidth(ch, bst, false).w, 0) : bu ? measureTextWidth(bu.ch, bst.height, bst.ratio, { spacingPct: bst.spacing, faceClass: faceClassOf(bst.face) }) : 0;
14291
14392
  const bulletW = bu ? paraHeadAdvance(bu, bst.height, headW) : 0;
14292
14393
  const plans = [];
14394
+ const inlineW = /* @__PURE__ */ new Map();
14395
+ for (const o of m.objs) if (o.inline) inlineW.set(o.index, o.omL + o.width + o.omR);
14293
14396
  for (let i = 0; i < m.segs.length; i++) {
14294
14397
  const seg = m.segs[i];
14295
14398
  const start = seg.textpos;
@@ -14301,6 +14404,11 @@ function planLines(m, styles, numText = "") {
14301
14404
  let fixedW = 0;
14302
14405
  for (let k = start; k < end && k < m.chars.length; k++) {
14303
14406
  const c = m.chars[k];
14407
+ const ow = inlineW.get(k);
14408
+ if (ow !== void 0) {
14409
+ x += ow;
14410
+ continue;
14411
+ }
14304
14412
  if (!c.tab) {
14305
14413
  x += charW(c, styles);
14306
14414
  continue;
@@ -14822,7 +14930,7 @@ function drawTable(tbl, tx, ty, ctx, depth) {
14822
14930
  }));
14823
14931
  const va2 = c.sub.getAttribute("vertAlign") ?? "TOP";
14824
14932
  const pieceOff = g.pieces.map((pc, k) => {
14825
- if (va2 === "TOP") return 0;
14933
+ if (va2 === "TOP" || k > 0) return 0;
14826
14934
  const from = pc.range?.get(c.el)?.[0] ?? 0;
14827
14935
  const bottoms = boxes.filter((b) => pieceOf(b.top) === k).map((b) => b.bottom - from);
14828
14936
  if (!bottoms.length) return 0;
@@ -19650,4 +19758,4 @@ export {
19650
19758
  cropRect,
19651
19759
  extractRenderedRegions
19652
19760
  };
19653
- //# sourceMappingURL=chunk-D4YBFNWK.js.map
19761
+ //# sourceMappingURL=chunk-NT54LN6C.js.map