kordoc 4.2.2 → 4.2.4

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 (103) hide show
  1. package/README.md +15 -3
  2. package/dist/{-NFHVGTVM.js → -2M56QRNH.js} +9 -9
  3. package/dist/{chunk-MYD3QLBL.js → chunk-7KRCQE3P.js} +2 -2
  4. package/dist/{chunk-OLDIDBJ2.js → chunk-7Z3NHIRR.js} +3 -3
  5. package/dist/{chunk-KKZATKQW.cjs → chunk-BLNOGMIM.cjs} +2 -2
  6. package/dist/chunk-BLNOGMIM.cjs.map +1 -0
  7. package/dist/{chunk-TXYQJXOV.js → chunk-CAA6DVEE.js} +91 -30
  8. package/dist/chunk-CAA6DVEE.js.map +1 -0
  9. package/dist/chunk-DCZVOIEO.cjs.map +1 -1
  10. package/dist/{chunk-MOOVF6CT.js → chunk-DOLK5KIS.js} +2 -2
  11. package/dist/{chunk-2L7MIKOM.js → chunk-E2K4SNMD.js} +2 -2
  12. package/dist/{chunk-X77U36TV.js → chunk-GFTAPAJS.js} +2 -2
  13. package/dist/{chunk-ZF7QL4IY.js → chunk-GJO3ORFW.js} +1 -1
  14. package/dist/chunk-GJO3ORFW.js.map +1 -0
  15. package/dist/chunk-GS7T56RP.cjs.map +1 -1
  16. package/dist/{chunk-FHYLLKIP.js → chunk-H6O65EPK.js} +2 -2
  17. package/dist/chunk-H7OWEYH2.cjs.map +1 -1
  18. package/dist/{chunk-DSL6EVFJ.js → chunk-I53FOXZR.js} +2 -2
  19. package/dist/{chunk-GHMVNMUN.js → chunk-LWNFAIYG.js} +3 -3
  20. package/dist/{chunk-EFF2JPPA.cjs → chunk-LXUZUUUG.cjs} +9 -9
  21. package/dist/chunk-LXUZUUUG.cjs.map +1 -0
  22. package/dist/{chunk-GUYIXVV7.js → chunk-OBX3VSIZ.js} +2 -2
  23. package/dist/chunk-OBX3VSIZ.js.map +1 -0
  24. package/dist/{chunk-T4AWY45Q.js → chunk-PMBWFYZQ.js} +2 -2
  25. package/dist/{chunk-IXHBRMDB.js → chunk-PQ46DC6Y.js} +2 -2
  26. package/dist/{chunk-WMU2KJHF.cjs → chunk-SCJLAOY3.cjs} +4 -4
  27. package/dist/chunk-SCJLAOY3.cjs.map +1 -0
  28. package/dist/{chunk-L5B7PQOP.js → chunk-WMM6XVQX.js} +2 -2
  29. package/dist/{chunk-DLFZAU4X.cjs → chunk-YFSYLEXO.cjs} +3 -3
  30. package/dist/chunk-YFSYLEXO.cjs.map +1 -0
  31. package/dist/{chunk-LUJN3VFB.js → chunk-ZHRYLT3N.js} +3 -3
  32. package/dist/chunks-GT45ALC5.js +10 -0
  33. package/dist/cli.js +18 -18
  34. package/dist/formula-SB3NHDUM.cjs.map +1 -1
  35. package/dist/{image-ocr-S4REURLR.js → image-ocr-HY42AVXC.js} +5 -5
  36. package/dist/{image-ocr-3AFBDDJI.cjs → image-ocr-JWAX5EOB.cjs} +9 -9
  37. package/dist/image-ocr-JWAX5EOB.cjs.map +1 -0
  38. package/dist/{image-ocr-TGHAMIQL.js → image-ocr-WCIDB6RY.js} +4 -4
  39. package/dist/index.cjs +508 -447
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.d.cts +7 -2
  42. package/dist/index.d.ts +7 -2
  43. package/dist/index.js +86 -25
  44. package/dist/index.js.map +1 -1
  45. package/dist/mcp.js +15 -15
  46. package/dist/page-range-P7SDW6LR.cjs.map +1 -1
  47. package/dist/{parser-MRM6WICO.cjs → parser-6RDEBLSB.cjs} +24 -24
  48. package/dist/parser-6RDEBLSB.cjs.map +1 -0
  49. package/dist/{parser-C3APVZGT.js → parser-SVZPCCRG.js} +6 -6
  50. package/dist/{parser-KMC4YOZH.js → parser-WRNS6MX2.js} +5 -5
  51. package/dist/pdf-ocr-4SGVLUNL.cjs +13 -0
  52. package/dist/pdf-ocr-4SGVLUNL.cjs.map +1 -0
  53. package/dist/pdf-ocr-7AAHJOXQ.js +12 -0
  54. package/dist/{pdf-ocr-UURMV6FD.js → pdf-ocr-WM3RZMZY.js} +5 -5
  55. package/dist/{profile-io-RLQ62KS5.js → profile-io-SWGUQSCL.js} +3 -3
  56. package/dist/{rasterize-LBABF2WI.js → rasterize-QA7W6QUF.js} +2 -2
  57. package/dist/render-DRUIPV77.js +10 -0
  58. package/dist/seal-3M4ZSW66.js +10 -0
  59. package/dist/{setup-Q2PRE7UA.js → setup-GUQT5ELJ.js} +23 -3
  60. package/dist/setup-GUQT5ELJ.js.map +1 -0
  61. package/dist/{watch-XEUEGOXW.js → watch-SFQNFU7Q.js} +9 -9
  62. package/package.json +1 -1
  63. package/dist/chunk-DLFZAU4X.cjs.map +0 -1
  64. package/dist/chunk-EFF2JPPA.cjs.map +0 -1
  65. package/dist/chunk-GUYIXVV7.js.map +0 -1
  66. package/dist/chunk-KKZATKQW.cjs.map +0 -1
  67. package/dist/chunk-TXYQJXOV.js.map +0 -1
  68. package/dist/chunk-WMU2KJHF.cjs.map +0 -1
  69. package/dist/chunk-ZF7QL4IY.js.map +0 -1
  70. package/dist/chunks-N4CWHTJI.js +0 -10
  71. package/dist/image-ocr-3AFBDDJI.cjs.map +0 -1
  72. package/dist/parser-MRM6WICO.cjs.map +0 -1
  73. package/dist/pdf-ocr-5BRMIJAT.cjs +0 -13
  74. package/dist/pdf-ocr-5BRMIJAT.cjs.map +0 -1
  75. package/dist/pdf-ocr-UDTEQEWA.js +0 -12
  76. package/dist/render-CYXQEHS7.js +0 -10
  77. package/dist/seal-SV6PFFYU.js +0 -10
  78. package/dist/setup-Q2PRE7UA.js.map +0 -1
  79. /package/dist/{-NFHVGTVM.js.map → -2M56QRNH.js.map} +0 -0
  80. /package/dist/{chunk-MYD3QLBL.js.map → chunk-7KRCQE3P.js.map} +0 -0
  81. /package/dist/{chunk-OLDIDBJ2.js.map → chunk-7Z3NHIRR.js.map} +0 -0
  82. /package/dist/{chunk-MOOVF6CT.js.map → chunk-DOLK5KIS.js.map} +0 -0
  83. /package/dist/{chunk-2L7MIKOM.js.map → chunk-E2K4SNMD.js.map} +0 -0
  84. /package/dist/{chunk-X77U36TV.js.map → chunk-GFTAPAJS.js.map} +0 -0
  85. /package/dist/{chunk-FHYLLKIP.js.map → chunk-H6O65EPK.js.map} +0 -0
  86. /package/dist/{chunk-DSL6EVFJ.js.map → chunk-I53FOXZR.js.map} +0 -0
  87. /package/dist/{chunk-GHMVNMUN.js.map → chunk-LWNFAIYG.js.map} +0 -0
  88. /package/dist/{chunk-T4AWY45Q.js.map → chunk-PMBWFYZQ.js.map} +0 -0
  89. /package/dist/{chunk-IXHBRMDB.js.map → chunk-PQ46DC6Y.js.map} +0 -0
  90. /package/dist/{chunk-L5B7PQOP.js.map → chunk-WMM6XVQX.js.map} +0 -0
  91. /package/dist/{chunk-LUJN3VFB.js.map → chunk-ZHRYLT3N.js.map} +0 -0
  92. /package/dist/{chunks-N4CWHTJI.js.map → chunks-GT45ALC5.js.map} +0 -0
  93. /package/dist/{image-ocr-S4REURLR.js.map → image-ocr-HY42AVXC.js.map} +0 -0
  94. /package/dist/{image-ocr-TGHAMIQL.js.map → image-ocr-WCIDB6RY.js.map} +0 -0
  95. /package/dist/{parser-C3APVZGT.js.map → parser-SVZPCCRG.js.map} +0 -0
  96. /package/dist/{parser-KMC4YOZH.js.map → parser-WRNS6MX2.js.map} +0 -0
  97. /package/dist/{pdf-ocr-UDTEQEWA.js.map → pdf-ocr-7AAHJOXQ.js.map} +0 -0
  98. /package/dist/{pdf-ocr-UURMV6FD.js.map → pdf-ocr-WM3RZMZY.js.map} +0 -0
  99. /package/dist/{profile-io-RLQ62KS5.js.map → profile-io-SWGUQSCL.js.map} +0 -0
  100. /package/dist/{rasterize-LBABF2WI.js.map → rasterize-QA7W6QUF.js.map} +0 -0
  101. /package/dist/{render-CYXQEHS7.js.map → render-DRUIPV77.js.map} +0 -0
  102. /package/dist/{seal-SV6PFFYU.js.map → seal-3M4ZSW66.js.map} +0 -0
  103. /package/dist/{watch-XEUEGOXW.js.map → watch-SFQNFU7Q.js.map} +0 -0
package/dist/index.cjs CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkWMU2KJHFcjs = require('./chunk-WMU2KJHF.cjs');
11
+ var _chunkSCJLAOY3cjs = require('./chunk-SCJLAOY3.cjs');
12
12
 
13
13
 
14
14
  var _chunkDCZVOIEOcjs = require('./chunk-DCZVOIEO.cjs');
@@ -27,7 +27,7 @@ var _chunkDCZVOIEOcjs = require('./chunk-DCZVOIEO.cjs');
27
27
 
28
28
 
29
29
 
30
- var _chunkKKZATKQWcjs = require('./chunk-KKZATKQW.cjs');
30
+ var _chunkBLNOGMIMcjs = require('./chunk-BLNOGMIM.cjs');
31
31
 
32
32
 
33
33
  var _chunkGS7T56RPcjs = require('./chunk-GS7T56RP.cjs');
@@ -413,7 +413,7 @@ function comResultToParseResult(pages, pageCount, warnings) {
413
413
  var _xmldom = require('@xmldom/xmldom');
414
414
  var MAX_DECOMPRESS_SIZE = 256 * 1024 * 1024;
415
415
  var MAX_ZIP_ENTRIES = 500;
416
- var ZipBombError = class extends _chunkKKZATKQWcjs.KordocError {
416
+ var ZipBombError = class extends _chunkBLNOGMIMcjs.KordocError {
417
417
  constructor(message) {
418
418
  super(message);
419
419
  this.name = "ZipBombError";
@@ -429,7 +429,7 @@ function createSectionShared() {
429
429
  function createXmlParser(warnings) {
430
430
  return new (0, _xmldom.DOMParser)({
431
431
  onError(level, msg2) {
432
- if (level === "fatalError") throw new (0, _chunkKKZATKQWcjs.KordocError)(`XML \uD30C\uC2F1 \uC2E4\uD328: ${msg2}`);
432
+ if (level === "fatalError") throw new (0, _chunkBLNOGMIMcjs.KordocError)(`XML \uD30C\uC2F1 \uC2E4\uD328: ${msg2}`);
433
433
  _optionalChain([warnings, 'optionalAccess', _3 => _3.push, 'call', _4 => _4({ code: "MALFORMED_XML", message: `XML ${level === "warning" ? "\uACBD\uACE0" : "\uC624\uB958"}: ${msg2}` })]);
434
434
  }
435
435
  });
@@ -506,10 +506,10 @@ async function extractHwpxStyles(zip, decompressed) {
506
506
  const xml = await file.async("text");
507
507
  if (decompressed) {
508
508
  decompressed.total += xml.length * 2;
509
- if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkKKZATKQWcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
509
+ if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkBLNOGMIMcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
510
510
  }
511
511
  const parser = createXmlParser();
512
- const doc = parser.parseFromString(_chunkKKZATKQWcjs.stripDtd.call(void 0, xml), "text/xml");
512
+ const doc = parser.parseFromString(_chunkBLNOGMIMcjs.stripDtd.call(void 0, xml), "text/xml");
513
513
  if (!doc.documentElement) continue;
514
514
  const domDoc = doc;
515
515
  parseCharProperties(domDoc, result.charProperties);
@@ -696,9 +696,9 @@ function detectHwpxHeadings(blocks, styleMap) {
696
696
  let level = 0;
697
697
  if (baseFontSize > 0 && _optionalChain([block, 'access', _11 => _11.style, 'optionalAccess', _12 => _12.fontSize])) {
698
698
  const ratio = block.style.fontSize / baseFontSize;
699
- if (ratio >= _chunkKKZATKQWcjs.HEADING_RATIO_H1) level = 1;
700
- else if (ratio >= _chunkKKZATKQWcjs.HEADING_RATIO_H2) level = 2;
701
- else if (ratio >= _chunkKKZATKQWcjs.HEADING_RATIO_H3) level = 3;
699
+ if (ratio >= _chunkBLNOGMIMcjs.HEADING_RATIO_H1) level = 1;
700
+ else if (ratio >= _chunkBLNOGMIMcjs.HEADING_RATIO_H2) level = 2;
701
+ else if (ratio >= _chunkBLNOGMIMcjs.HEADING_RATIO_H3) level = 3;
702
702
  }
703
703
  const compactText = text.replace(/\s+/g, "");
704
704
  if (/^제\d+[조장절편]/.test(compactText) && text.length <= 50) {
@@ -1623,7 +1623,7 @@ function needsGaejosikAssets(gongmun) {
1623
1623
  }
1624
1624
  function assertFiniteRange(name, value, min, max) {
1625
1625
  if (!Number.isFinite(value) || value < min || value > max) {
1626
- throw new (0, _chunkKKZATKQWcjs.KordocError)(`${name} must be a finite number between ${min} and ${max}`);
1626
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)(`${name} must be a finite number between ${min} and ${max}`);
1627
1627
  }
1628
1628
  }
1629
1629
  function validateGongmunOptions(opts) {
@@ -1638,10 +1638,10 @@ function validateGongmunOptions(opts) {
1638
1638
  assertFiniteRange(`margins.${side}`, value, 0, 200);
1639
1639
  }
1640
1640
  if (opts.margins.left + opts.margins.right >= 210) {
1641
- throw new (0, _chunkKKZATKQWcjs.KordocError)("margins.left + margins.right must be less than 210");
1641
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("margins.left + margins.right must be less than 210");
1642
1642
  }
1643
1643
  if (opts.margins.top + opts.margins.bottom >= 297) {
1644
- throw new (0, _chunkKKZATKQWcjs.KordocError)("margins.top + margins.bottom must be less than 297");
1644
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("margins.top + margins.bottom must be less than 297");
1645
1645
  }
1646
1646
  }
1647
1647
  if (opts.sizes) {
@@ -1650,7 +1650,7 @@ function validateGongmunOptions(opts) {
1650
1650
  }
1651
1651
  }
1652
1652
  if (opts.approval && opts.approval.length > 6) {
1653
- throw new (0, _chunkKKZATKQWcjs.KordocError)("approval must contain at most 6 labels");
1653
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("approval must contain at most 6 labels");
1654
1654
  }
1655
1655
  }
1656
1656
  function incompatibleGongmunWarnings(opts) {
@@ -1915,7 +1915,7 @@ function resolveParaHeading(paraEl, ctx) {
1915
1915
 
1916
1916
  // src/hwpx/table-build.ts
1917
1917
  function buildTableWithCellMeta(state, keepAnchoredEmptyCols) {
1918
- const table2 = _chunkWMU2KJHFcjs.buildTable.call(void 0, state.rows, { keepAnchoredEmptyCols });
1918
+ const table2 = _chunkSCJLAOY3cjs.buildTable.call(void 0, state.rows, { keepAnchoredEmptyCols });
1919
1919
  if (state.caption) table2.caption = state.caption;
1920
1920
  const anchors = [];
1921
1921
  {
@@ -1985,7 +1985,7 @@ function completeTable(newTable, tableStack, blocks, ctx) {
1985
1985
  const cell2 = parentTable.cell;
1986
1986
  (cell2.blocks ??= []).push(block);
1987
1987
  cell2.hasStructure = true;
1988
- let flat = _chunkWMU2KJHFcjs.convertTableToText.call(void 0, newTable.rows);
1988
+ let flat = _chunkSCJLAOY3cjs.convertTableToText.call(void 0, newTable.rows);
1989
1989
  if (newTable.caption) flat = newTable.caption + (flat ? "\n" + flat : "");
1990
1990
  if (flat) cell2.text += (cell2.text ? "\n" : "") + flat;
1991
1991
  } else {
@@ -1997,7 +1997,7 @@ function completeTable(newTable, tableStack, blocks, ctx) {
1997
1997
  // src/hwpx/section-walker.ts
1998
1998
  function parseSectionXml(xml, styleMap, warnings, sectionNum, shared) {
1999
1999
  const parser = createXmlParser(warnings);
2000
- const doc = parser.parseFromString(_chunkKKZATKQWcjs.stripDtd.call(void 0, xml), "text/xml");
2000
+ const doc = parser.parseFromString(_chunkBLNOGMIMcjs.stripDtd.call(void 0, xml), "text/xml");
2001
2001
  if (!doc.documentElement) return [];
2002
2002
  const ctx = { styleMap, warnings, sectionNum, shared: _nullishCoalesce(shared, () => ( createSectionShared())) };
2003
2003
  ctx.shared.track.deleteDepth = 0;
@@ -2103,12 +2103,12 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
2103
2103
  const cs = isNaN(rawCs) ? 1 : rawCs;
2104
2104
  const rawRs = parseInt(el.getAttribute("rowSpan") || "1", 10);
2105
2105
  const rs = isNaN(rawRs) ? 1 : rawRs;
2106
- tableCtx.cell.colSpan = clampSpan(cs, _chunkWMU2KJHFcjs.MAX_COLS);
2107
- tableCtx.cell.rowSpan = clampSpan(rs, _chunkWMU2KJHFcjs.MAX_ROWS);
2106
+ tableCtx.cell.colSpan = clampSpan(cs, _chunkSCJLAOY3cjs.MAX_COLS);
2107
+ tableCtx.cell.rowSpan = clampSpan(rs, _chunkSCJLAOY3cjs.MAX_ROWS);
2108
2108
  }
2109
2109
  break;
2110
2110
  case "p": {
2111
- const { text: rawText, href, footnote, style } = extractParagraphInfo(el, ctx.styleMap, ctx);
2111
+ const { text: rawText, href, footnote, style, segments } = extractParagraphInfo(el, ctx.styleMap, ctx);
2112
2112
  let text = rawText;
2113
2113
  let headingLevel;
2114
2114
  const ph = resolveParaHeading(el, ctx);
@@ -2116,14 +2116,43 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
2116
2116
  if (_optionalChain([ph, 'optionalAccess', _34 => _34.prefix])) text = ph.prefix + " " + text;
2117
2117
  headingLevel = _optionalChain([ph, 'optionalAccess', _35 => _35.headingLevel]);
2118
2118
  }
2119
+ if (segments) {
2120
+ const cell2 = _nullishCoalesce(_optionalChain([tableCtx, 'optionalAccess', _36 => _36.cell]), () => ( null));
2121
+ const segs = [...segments];
2122
+ if (_optionalChain([ph, 'optionalAccess', _37 => _37.prefix])) {
2123
+ const fi = segs.findIndex((s) => s);
2124
+ if (fi >= 0) segs[fi] = ph.prefix + " " + segs[fi];
2125
+ }
2126
+ let segIdx = 0;
2127
+ let first = true;
2128
+ const flush = () => {
2129
+ const s = segs[segIdx++];
2130
+ if (!s) return;
2131
+ const block = { type: "paragraph", text: s, pageNumber: ctx.sectionNum };
2132
+ if (first && !cell2) {
2133
+ first = false;
2134
+ if (style) block.style = style;
2135
+ if (href) block.href = href;
2136
+ if (footnote) block.footnoteText = footnote;
2137
+ }
2138
+ if (cell2) {
2139
+ cell2.text += (cell2.text ? "\n" : "") + s;
2140
+ (cell2.blocks ??= []).push(block);
2141
+ } else blocks.push(block);
2142
+ };
2143
+ tableCtx = walkParagraphChildren(el, blocks, tableCtx, tableStack, ctx, depth + 1, flush);
2144
+ while (segIdx < segs.length) flush();
2145
+ if (footnote && cell2) cell2.text += (cell2.text ? "\n" : "") + `(\uC8FC: ${footnote})`;
2146
+ break;
2147
+ }
2119
2148
  if (text) {
2120
- if (_optionalChain([tableCtx, 'optionalAccess', _36 => _36.cell])) {
2149
+ if (_optionalChain([tableCtx, 'optionalAccess', _38 => _38.cell])) {
2121
2150
  const cell2 = tableCtx.cell;
2122
2151
  if (footnote) text += ` (\uC8FC: ${footnote})`;
2123
2152
  cell2.text += (cell2.text ? "\n" : "") + text;
2124
2153
  const cellBlock = { type: "paragraph", text, pageNumber: ctx.sectionNum };
2125
2154
  const cellSpanMode = spanModeOf(ctx.shared.kordocLayout);
2126
- if (cellSpanMode && !_optionalChain([ph, 'optionalAccess', _37 => _37.prefix])) {
2155
+ if (cellSpanMode && !_optionalChain([ph, 'optionalAccess', _39 => _39.prefix])) {
2127
2156
  const spans = extractRunSpans(el, ctx, cellSpanMode, cellSpanMode !== "kordoc");
2128
2157
  if (spans && spans.map((s) => s.text).join("").replace(/[ \t]+/g, " ").trim() === text) {
2129
2158
  cellBlock.spans = spans;
@@ -2142,7 +2171,7 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
2142
2171
  if (style) block.style = style;
2143
2172
  if (href) block.href = href;
2144
2173
  if (footnote) block.footnoteText = footnote;
2145
- const ind = _optionalChain([ctx, 'access', _38 => _38.styleMap, 'optionalAccess', _39 => _39.paraIndents, 'access', _40 => _40.get, 'call', _41 => _41(_nullishCoalesce(el.getAttribute("paraPrIDRef"), () => ( "")))]);
2174
+ const ind = _optionalChain([ctx, 'access', _40 => _40.styleMap, 'optionalAccess', _41 => _41.paraIndents, 'access', _42 => _42.get, 'call', _43 => _43(_nullishCoalesce(el.getAttribute("paraPrIDRef"), () => ( "")))]);
2146
2175
  if (ind) {
2147
2176
  const eff = ind.left + Math.max(0, ind.intent);
2148
2177
  if (eff > 0) block.indent = eff;
@@ -2153,7 +2182,7 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
2153
2182
  }
2154
2183
  const spanMode = spanModeOf(ctx.shared.kordocLayout);
2155
2184
  if (!headingLevel && spanMode) {
2156
- if (!_optionalChain([ph, 'optionalAccess', _42 => _42.prefix])) {
2185
+ if (!_optionalChain([ph, 'optionalAccess', _44 => _44.prefix])) {
2157
2186
  const spans = extractRunSpans(el, ctx, spanMode, spanMode === "gongmun");
2158
2187
  if (spans && spans.map((s) => s.text).join("").replace(/[ \t]+/g, " ").trim() === text) {
2159
2188
  block.spans = spans;
@@ -2173,7 +2202,7 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
2173
2202
  case "pic":
2174
2203
  case "shape":
2175
2204
  case "drawingObject": {
2176
- if (_optionalChain([tableCtx, 'optionalAccess', _43 => _43.cell])) {
2205
+ if (_optionalChain([tableCtx, 'optionalAccess', _45 => _45.cell])) {
2177
2206
  const sink = [];
2178
2207
  handleShape(el, sink, ctx);
2179
2208
  mergeBlocksIntoCell(tableCtx.cell, sink);
@@ -2278,7 +2307,7 @@ function hasPageAutoNum(el, depth = 0) {
2278
2307
  const ch = children[i];
2279
2308
  if (ch.nodeType !== 1) continue;
2280
2309
  const tag = (ch.tagName || ch.localName || "").replace(/^[^:]+:/, "");
2281
- if (tag === "autoNum" && _optionalChain([ch, 'access', _44 => _44.getAttribute, 'optionalCall', _45 => _45("numType")]) === "PAGE") return true;
2310
+ if (tag === "autoNum" && _optionalChain([ch, 'access', _46 => _46.getAttribute, 'optionalCall', _47 => _47("numType")]) === "PAGE") return true;
2282
2311
  if (hasPageAutoNum(ch, depth + 1)) return true;
2283
2312
  }
2284
2313
  return false;
@@ -2315,7 +2344,7 @@ function flattenSubListTable(el, ctx, depth) {
2315
2344
  const sink = [];
2316
2345
  const st = { rows: [], currentRow: [], cell: null };
2317
2346
  walkSection(el, sink, st, [], ctx, depth + 1);
2318
- let flat = _chunkWMU2KJHFcjs.convertTableToText.call(void 0, st.rows);
2347
+ let flat = _chunkSCJLAOY3cjs.convertTableToText.call(void 0, st.rows);
2319
2348
  if (st.caption) flat = st.caption + (flat ? "\n" + flat : "");
2320
2349
  return flat;
2321
2350
  }
@@ -2334,7 +2363,7 @@ function findTopLevelTbls(el, out, depth = 0) {
2334
2363
  findTopLevelTbls(ch, out, depth + 1);
2335
2364
  }
2336
2365
  }
2337
- function walkParagraphChildren(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
2366
+ function walkParagraphChildren(node, blocks, tableCtx, tableStack, ctx, depth = 0, onTbl) {
2338
2367
  if (depth > MAX_XML_DEPTH) return tableCtx;
2339
2368
  const children = node.childNodes;
2340
2369
  if (!children) return tableCtx;
@@ -2348,6 +2377,7 @@ function walkParagraphChildren(node, blocks, tableCtx, tableStack, ctx, depth =
2348
2377
  const tag = el.tagName || el.localName || "";
2349
2378
  const localTag = tag.replace(/^[^:]+:/, "");
2350
2379
  if (localTag === "tbl") {
2380
+ if (onTbl) onTbl();
2351
2381
  if (!tableCtx) {
2352
2382
  const chan = kordocTableChannel(el, ctx);
2353
2383
  if (chan) {
@@ -2364,12 +2394,12 @@ function walkParagraphChildren(node, blocks, tableCtx, tableStack, ctx, depth =
2364
2394
  } else if (localTag === "caption" && !inShape) {
2365
2395
  const capText = collectSubListText(el, ctx);
2366
2396
  if (capText) {
2367
- if (_optionalChain([tableCtx, 'optionalAccess', _46 => _46.cell])) mergeBlocksIntoCell(tableCtx.cell, [{ type: "paragraph", text: capText, pageNumber: ctx.sectionNum }]);
2397
+ if (_optionalChain([tableCtx, 'optionalAccess', _48 => _48.cell])) mergeBlocksIntoCell(tableCtx.cell, [{ type: "paragraph", text: capText, pageNumber: ctx.sectionNum }]);
2368
2398
  else if (tableCtx) tableCtx.caption = (tableCtx.caption ? tableCtx.caption + "\n" : "") + capText;
2369
2399
  else blocks.push({ type: "paragraph", text: capText, pageNumber: ctx.sectionNum });
2370
2400
  }
2371
2401
  } else if (localTag === "pic" || localTag === "shape" || localTag === "drawingObject") {
2372
- if (_optionalChain([tableCtx, 'optionalAccess', _47 => _47.cell])) {
2402
+ if (_optionalChain([tableCtx, 'optionalAccess', _49 => _49.cell])) {
2373
2403
  const sink = [];
2374
2404
  handleShape(el, sink, ctx);
2375
2405
  mergeBlocksIntoCell(tableCtx.cell, sink);
@@ -2377,7 +2407,7 @@ function walkParagraphChildren(node, blocks, tableCtx, tableStack, ctx, depth =
2377
2407
  handleShape(el, blocks, ctx);
2378
2408
  }
2379
2409
  } else if (localTag === "drawText") {
2380
- if (_optionalChain([tableCtx, 'optionalAccess', _48 => _48.cell])) {
2410
+ if (_optionalChain([tableCtx, 'optionalAccess', _50 => _50.cell])) {
2381
2411
  const sink = [];
2382
2412
  extractDrawTextBlocks(el, sink, ctx);
2383
2413
  mergeBlocksIntoCell(tableCtx.cell, sink);
@@ -2394,6 +2424,9 @@ function walkParagraphChildren(node, blocks, tableCtx, tableStack, ctx, depth =
2394
2424
  walkChildren(node, depth);
2395
2425
  return tableCtx;
2396
2426
  }
2427
+ function isInlineTbl(tbl2) {
2428
+ return _optionalChain([findChildByLocalName, 'call', _51 => _51(tbl2, "pos"), 'optionalAccess', _52 => _52.getAttribute, 'call', _53 => _53("treatAsChar")]) === "1";
2429
+ }
2397
2430
  function findDescendant(node, targetTag, depth = 0) {
2398
2431
  if (depth > 5) return null;
2399
2432
  const children = node.childNodes;
@@ -2423,7 +2456,7 @@ function extractDrawTextBlocks(drawTextNode, blocks, ctx) {
2423
2456
  let text = info.text.trim();
2424
2457
  const ph = resolveParaHeading(child, ctx);
2425
2458
  if (text) {
2426
- if (_optionalChain([ph, 'optionalAccess', _49 => _49.prefix])) text = ph.prefix + " " + text;
2459
+ if (_optionalChain([ph, 'optionalAccess', _54 => _54.prefix])) text = ph.prefix + " " + text;
2427
2460
  const block = { type: "paragraph", text, style: _nullishCoalesce(info.style, () => ( void 0)), pageNumber: ctx.sectionNum };
2428
2461
  if (info.href) block.href = info.href;
2429
2462
  if (info.footnote) block.footnoteText = info.footnote;
@@ -2448,13 +2481,13 @@ function extractHyperlinkHref(fieldBegin) {
2448
2481
  let url = (ch.textContent || "").trim();
2449
2482
  if (!url) continue;
2450
2483
  url = url.replace(/^https?:\/\/(?=https?:\/\/)/i, "");
2451
- const safe = _chunkKKZATKQWcjs.sanitizeHref.call(void 0, url);
2484
+ const safe = _chunkBLNOGMIMcjs.sanitizeHref.call(void 0, url);
2452
2485
  if (safe) return safe;
2453
2486
  }
2454
2487
  return void 0;
2455
2488
  }
2456
2489
  function isInDeletedRange(ctx) {
2457
- return (_nullishCoalesce(_optionalChain([ctx, 'optionalAccess', _50 => _50.shared, 'access', _51 => _51.track, 'access', _52 => _52.deleteDepth]), () => ( 0))) > 0;
2490
+ return (_nullishCoalesce(_optionalChain([ctx, 'optionalAccess', _55 => _55.shared, 'access', _56 => _56.track, 'access', _57 => _57.deleteDepth]), () => ( 0))) > 0;
2458
2491
  }
2459
2492
  function extractParagraphInfo(para2, styleMap, ctx) {
2460
2493
  let text = "";
@@ -2475,7 +2508,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
2475
2508
  };
2476
2509
  const onFieldEnd = () => {
2477
2510
  const open = openFields.pop();
2478
- if (_optionalChain([open, 'optionalAccess', _53 => _53.rangeIdx]) !== void 0) linkRanges[open.rangeIdx].end = text.length;
2511
+ if (_optionalChain([open, 'optionalAccess', _58 => _58.rangeIdx]) !== void 0) linkRanges[open.rangeIdx].end = text.length;
2479
2512
  };
2480
2513
  const handleCtrl = (ctrlEl) => {
2481
2514
  const kids2 = ctrlEl.childNodes;
@@ -2526,7 +2559,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
2526
2559
  // 삽입분은 최종본에 포함
2527
2560
  // 숨은 설명 — 본문 혼입 차단
2528
2561
  case "hiddenComment": {
2529
- if (_optionalChain([ctx, 'optionalAccess', _54 => _54.warnings]) && extractTextFromNode(k)) {
2562
+ if (_optionalChain([ctx, 'optionalAccess', _59 => _59.warnings]) && extractTextFromNode(k)) {
2530
2563
  ctx.warnings.push({ page: ctx.sectionNum, message: "\uC228\uC740 \uC124\uBA85 \uD14D\uC2A4\uD2B8 \uC81C\uC678: hiddenComment", code: "HIDDEN_TEXT_FILTERED" });
2531
2564
  }
2532
2565
  break;
@@ -2546,7 +2579,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
2546
2579
  break;
2547
2580
  // 미지원 요소 — 텍스트를 가졌으면 무음 손실 대신 경고
2548
2581
  default: {
2549
- if (_optionalChain([ctx, 'optionalAccess', _55 => _55.warnings]) && extractTextFromNode(k)) {
2582
+ if (_optionalChain([ctx, 'optionalAccess', _60 => _60.warnings]) && extractTextFromNode(k)) {
2550
2583
  ctx.warnings.push({ page: ctx.sectionNum, message: `\uBBF8\uC9C0\uC6D0 \uC81C\uC5B4 \uC694\uC18C\uC758 \uD14D\uC2A4\uD2B8 \uC190\uC2E4: ${ktag}`, code: "UNSUPPORTED_ELEMENT" });
2551
2584
  }
2552
2585
  }
@@ -2564,10 +2597,10 @@ function extractParagraphInfo(para2, styleMap, ctx) {
2564
2597
  if (isInDeletedRange(ctx)) {
2565
2598
  if (t && ctx && !ctx.shared.track.warned) {
2566
2599
  ctx.shared.track.warned = true;
2567
- _optionalChain([ctx, 'access', _56 => _56.warnings, 'optionalAccess', _57 => _57.push, 'call', _58 => _58({ page: ctx.sectionNum, message: "\uBCC0\uACBD\uCD94\uC801 \uC0AD\uC81C \uD14D\uC2A4\uD2B8 \uCD9C\uB825 \uC81C\uC678", code: "HIDDEN_TEXT_FILTERED" })]);
2600
+ _optionalChain([ctx, 'access', _61 => _61.warnings, 'optionalAccess', _62 => _62.push, 'call', _63 => _63({ page: ctx.sectionNum, message: "\uBCC0\uACBD\uCD94\uC801 \uC0AD\uC81C \uD14D\uC2A4\uD2B8 \uCD9C\uB825 \uC81C\uC678", code: "HIDDEN_TEXT_FILTERED" })]);
2568
2601
  }
2569
2602
  } else {
2570
- text += t;
2603
+ text += t.replace(/\x1E/g, "");
2571
2604
  }
2572
2605
  continue;
2573
2606
  }
@@ -2598,14 +2631,17 @@ function extractParagraphInfo(para2, styleMap, ctx) {
2598
2631
  case "hwSpace":
2599
2632
  text += " ";
2600
2633
  break;
2634
+ // 테이블 자체는 walkSection에서 처리 — 글자취급(inline) 표만 경계 마커를 남겨
2635
+ // 표 앞뒤 텍스트를 문서 순서대로 분할 방출할 수 있게 한다 (#49/#50).
2636
+ // float·페이지 앵커 표는 텍스트 흐름 불참(reflow 모델 정합) — 종전대로 텍스트 뒤 방출
2601
2637
  case "tbl":
2638
+ if (isInlineTbl(child)) text += "";
2602
2639
  break;
2603
- // 테이블은 walkSection에서 처리
2604
2640
  // 하이퍼링크
2605
2641
  case "hyperlink": {
2606
2642
  const url = child.getAttribute("url") || child.getAttribute("href") || "";
2607
2643
  if (url) {
2608
- const safe = _chunkKKZATKQWcjs.sanitizeHref.call(void 0, url);
2644
+ const safe = _chunkBLNOGMIMcjs.sanitizeHref.call(void 0, url);
2609
2645
  if (safe) href = safe;
2610
2646
  }
2611
2647
  walk(child, depth + 1);
@@ -2695,7 +2731,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
2695
2731
  for (const r of closed) {
2696
2732
  if (applied.some(([s, e]) => r.start < e && r.end > s)) continue;
2697
2733
  const anchor = text.slice(r.start, r.end);
2698
- if (!anchor.trim() || /[\n\x1F\[\]]/.test(anchor)) continue;
2734
+ if (!anchor.trim() || /[\n\x1F\x1E\[\]]/.test(anchor)) continue;
2699
2735
  text = text.slice(0, r.start) + `[${anchor}](${r.url})` + text.slice(r.end);
2700
2736
  applied.push([r.start, r.end]);
2701
2737
  }
@@ -2703,10 +2739,18 @@ function extractParagraphInfo(para2, styleMap, ctx) {
2703
2739
  }
2704
2740
  const leaderIdx = text.indexOf("");
2705
2741
  if (leaderIdx >= 0) text = text.substring(0, leaderIdx);
2706
- let cleanText = text.replace(/[ \t]+/g, " ").trim();
2707
- if (/^그림입니다\.?\s*원본\s*그림의\s*(이름|크기)/.test(cleanText)) cleanText = "";
2708
- cleanText = cleanText.replace(/그림입니다\.?\s*원본\s*그림의\s*(이름|크기)[^\n]*(\n[^\n]*원본\s*그림의\s*(이름|크기)[^\n]*)*/g, "").trim();
2709
- cleanText = cleanText.replace(/^(?:모서리가 둥근 |둥근 )?(?:사각형|직사각형|정사각형|원|타원|삼각형|선|직선|곡선|화살표|오각형|육각형|팔각형|별|십자|구름|마름모|도넛|평행사변형|사다리꼴|개체|그리기\s?개체|묶음\s?개체|글상자|표|그림|OLE\s?개체)\s?입니다\.?$/gm, "").trim();
2742
+ const cleanParaText = (raw) => {
2743
+ let t = raw.replace(/[ \t]+/g, " ").trim();
2744
+ if (/^그림입니다\.?\s*원본\s*그림의\s*(이름|크기)/.test(t)) t = "";
2745
+ t = t.replace(/그림입니다\.?\s*원본\s*그림의\s*(이름|크기)[^\n]*(\n[^\n]*원본\s*그림의\s*(이름|크기)[^\n]*)*/g, "").trim();
2746
+ return t.replace(/^(?:모서리가 둥근 |둥근 )?(?:사각형|직사각형|정사각형|원|타원|삼각형|선|직선|곡선|화살표|오각형|육각형|팔각형|별|십자|구름|마름모|도넛|평행사변형|사다리꼴|개체|그리기\s?개체|묶음\s?개체|글상자|표|그림|OLE\s?개체)\s?입니다\.?$/gm, "").trim();
2747
+ };
2748
+ let segments;
2749
+ if (text.includes("")) {
2750
+ segments = text.split("").map(cleanParaText);
2751
+ text = text.replace(/\x1E/g, "");
2752
+ }
2753
+ const cleanText = cleanParaText(text);
2710
2754
  let style;
2711
2755
  if (styleMap && charPrId) {
2712
2756
  const charProp = styleMap.charProperties.get(charPrId);
@@ -2719,7 +2763,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
2719
2763
  if (!style.fontSize && !style.bold && !style.italic) style = void 0;
2720
2764
  }
2721
2765
  }
2722
- return { text: cleanText, href, footnote, style };
2766
+ return { text: cleanText, href, footnote, style, segments };
2723
2767
  }
2724
2768
  var KORDOC_CHAR_CODE = "4";
2725
2769
  var KORDOC_PARA_QUOTE = "6";
@@ -2744,13 +2788,13 @@ function extractRunSpans(para2, ctx, mode, requireMixed) {
2744
2788
  if (tag !== "run" && tag !== "r") return null;
2745
2789
  let text = "";
2746
2790
  const rkids = child.childNodes;
2747
- for (let j = 0; j < (_nullishCoalesce(_optionalChain([rkids, 'optionalAccess', _59 => _59.length]), () => ( 0))); j++) {
2791
+ for (let j = 0; j < (_nullishCoalesce(_optionalChain([rkids, 'optionalAccess', _64 => _64.length]), () => ( 0))); j++) {
2748
2792
  const rc = rkids[j];
2749
2793
  if (rc.nodeType !== 1) continue;
2750
2794
  const rtag = (rc.tagName || rc.localName || "").replace(/^[^:]+:/, "");
2751
2795
  if (rtag === "t") {
2752
2796
  const tkids = rc.childNodes;
2753
- for (let k = 0; k < (_nullishCoalesce(_optionalChain([tkids, 'optionalAccess', _60 => _60.length]), () => ( 0))); k++) {
2797
+ for (let k = 0; k < (_nullishCoalesce(_optionalChain([tkids, 'optionalAccess', _65 => _65.length]), () => ( 0))); k++) {
2754
2798
  const tk = tkids[k];
2755
2799
  if (tk.nodeType === 3) text += tk.textContent || "";
2756
2800
  else if (tk.nodeType === 1) return null;
@@ -2768,9 +2812,9 @@ function extractRunSpans(para2, ctx, mode, requireMixed) {
2768
2812
  const span = { text };
2769
2813
  if (mode !== "foreign" && prId === KORDOC_CHAR_CODE) span.code = true;
2770
2814
  else {
2771
- if (_optionalChain([cp, 'optionalAccess', _61 => _61.bold])) span.bold = true;
2772
- if (_optionalChain([cp, 'optionalAccess', _62 => _62.italic])) span.italic = true;
2773
- if (_optionalChain([cp, 'optionalAccess', _63 => _63.strike])) span.strike = true;
2815
+ if (_optionalChain([cp, 'optionalAccess', _66 => _66.bold])) span.bold = true;
2816
+ if (_optionalChain([cp, 'optionalAccess', _67 => _67.italic])) span.italic = true;
2817
+ if (_optionalChain([cp, 'optionalAccess', _68 => _68.strike])) span.strike = true;
2774
2818
  }
2775
2819
  if (span.bold || span.italic || span.strike || span.code) styled = true;
2776
2820
  spans.push(span);
@@ -2793,12 +2837,12 @@ function gongmunDepthFromIndent(para2, left, ctx) {
2793
2837
  if (!styleMap) return null;
2794
2838
  let unit = 0;
2795
2839
  const kids2 = para2.childNodes;
2796
- for (let i = 0; i < (_nullishCoalesce(_optionalChain([kids2, 'optionalAccess', _64 => _64.length]), () => ( 0))); i++) {
2840
+ for (let i = 0; i < (_nullishCoalesce(_optionalChain([kids2, 'optionalAccess', _69 => _69.length]), () => ( 0))); i++) {
2797
2841
  const child = kids2[i];
2798
2842
  if (child.nodeType !== 1) continue;
2799
2843
  const tag = (child.tagName || child.localName || "").replace(/^[^:]+:/, "");
2800
2844
  if (tag !== "run" && tag !== "r") continue;
2801
- const size = _optionalChain([styleMap, 'access', _65 => _65.charProperties, 'access', _66 => _66.get, 'call', _67 => _67(_nullishCoalesce(child.getAttribute("charPrIDRef"), () => ( ""))), 'optionalAccess', _68 => _68.fontSize]);
2845
+ const size = _optionalChain([styleMap, 'access', _70 => _70.charProperties, 'access', _71 => _71.get, 'call', _72 => _72(_nullishCoalesce(child.getAttribute("charPrIDRef"), () => ( ""))), 'optionalAccess', _73 => _73.fontSize]);
2802
2846
  if (size) unit = size * 100;
2803
2847
  break;
2804
2848
  }
@@ -2871,7 +2915,7 @@ function decompressStream(data) {
2871
2915
  return _zlib.inflateRawSync.call(void 0, data, opts);
2872
2916
  }
2873
2917
  function parseFileHeader(data) {
2874
- if (data.length < 40) throw new (0, _chunkKKZATKQWcjs.KordocError)("FileHeader\uAC00 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4 (\uCD5C\uC18C 40\uBC14\uC774\uD2B8)");
2918
+ if (data.length < 40) throw new (0, _chunkBLNOGMIMcjs.KordocError)("FileHeader\uAC00 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4 (\uCD5C\uC18C 40\uBC14\uC774\uD2B8)");
2875
2919
  const sig = data.subarray(0, 32).toString("utf8").replace(/\0+$/, "");
2876
2920
  return {
2877
2921
  signature: sig,
@@ -3004,7 +3048,7 @@ function appendParaText(state, data, resolveControl) {
3004
3048
  const resolveAt = (byteOffset, extended) => {
3005
3049
  const ctrlId = data.readUInt32LE(byteOffset);
3006
3050
  const idx = extended ? state.ctrlIdx : -1;
3007
- const replacement = _optionalChain([resolveControl, 'optionalCall', _69 => _69(idx, ctrlId)]);
3051
+ const replacement = _optionalChain([resolveControl, 'optionalCall', _74 => _74(idx, ctrlId)]);
3008
3052
  if (replacement) result += replacement;
3009
3053
  if (extended) state.ctrlIdx++;
3010
3054
  };
@@ -3206,7 +3250,7 @@ function extractHwp5Images(fileIndex, blocks, warnings, sweepUnreferenced) {
3206
3250
  const binDataMap = /* @__PURE__ */ new Map();
3207
3251
  if (fileIndex) {
3208
3252
  for (const entry of fileIndex) {
3209
- if (!_optionalChain([entry, 'optionalAccess', _70 => _70.name]) || !entry.content) continue;
3253
+ if (!_optionalChain([entry, 'optionalAccess', _75 => _75.name]) || !entry.content) continue;
3210
3254
  const match = entry.name.match(BIN_ENTRY_RE);
3211
3255
  if (!match) continue;
3212
3256
  const idx = parseInt(match[1], 16);
@@ -3282,7 +3326,7 @@ function collectImageBlocks2(blocks, out, ownerCell, depth = 0) {
3282
3326
  } else if (block.type === "table" && block.table) {
3283
3327
  for (const row of block.table.cells) {
3284
3328
  for (const cell2 of row) {
3285
- if (_optionalChain([cell2, 'access', _71 => _71.blocks, 'optionalAccess', _72 => _72.length])) collectImageBlocks2(cell2.blocks, out, cell2, depth + 1);
3329
+ if (_optionalChain([cell2, 'access', _76 => _76.blocks, 'optionalAccess', _77 => _77.length])) collectImageBlocks2(cell2.blocks, out, cell2, depth + 1);
3286
3330
  }
3287
3331
  }
3288
3332
  }
@@ -3320,13 +3364,13 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
3320
3364
  }
3321
3365
  const allCandidates = resolvedPath ? [resolvedPath, ...candidates] : candidates;
3322
3366
  for (const path of allCandidates) {
3323
- if (_chunkKKZATKQWcjs.isPathTraversal.call(void 0, path)) continue;
3367
+ if (_chunkBLNOGMIMcjs.isPathTraversal.call(void 0, path)) continue;
3324
3368
  const file = zip.file(path);
3325
3369
  if (!file) continue;
3326
3370
  try {
3327
3371
  const data = await file.async("uint8array");
3328
3372
  decompressed.total += data.length;
3329
- if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkKKZATKQWcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
3373
+ if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkBLNOGMIMcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
3330
3374
  const ext = path.includes(".") ? path.split(".").pop() || "png" : "png";
3331
3375
  const mimeType = imageExtToMime(ext);
3332
3376
  imageIndex++;
@@ -3336,10 +3380,10 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
3336
3380
  usedPaths.add(path);
3337
3381
  break;
3338
3382
  } catch (err) {
3339
- if (err instanceof _chunkKKZATKQWcjs.KordocError) throw err;
3383
+ if (err instanceof _chunkBLNOGMIMcjs.KordocError) throw err;
3340
3384
  }
3341
3385
  }
3342
- if (!img) _optionalChain([warnings, 'optionalAccess', _73 => _73.push, 'call', _74 => _74({ page: block.pageNumber, message: `\uC774\uBBF8\uC9C0 \uD30C\uC77C \uC5C6\uC74C: ${ref}`, code: "SKIPPED_IMAGE" })]);
3386
+ if (!img) _optionalChain([warnings, 'optionalAccess', _78 => _78.push, 'call', _79 => _79({ page: block.pageNumber, message: `\uC774\uBBF8\uC9C0 \uD30C\uC77C \uC5C6\uC74C: ${ref}`, code: "SKIPPED_IMAGE" })]);
3343
3387
  resolved.set(ref, img);
3344
3388
  }
3345
3389
  if (!img) {
@@ -3356,11 +3400,11 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
3356
3400
  if (sweepUnreferenced) {
3357
3401
  const binEntries = zip.file(/(?:^|\/)BinData\//i);
3358
3402
  for (const file of binEntries) {
3359
- if (file.dir || usedPaths.has(file.name) || _chunkKKZATKQWcjs.isPathTraversal.call(void 0, file.name)) continue;
3403
+ if (file.dir || usedPaths.has(file.name) || _chunkBLNOGMIMcjs.isPathTraversal.call(void 0, file.name)) continue;
3360
3404
  try {
3361
3405
  const data = await file.async("uint8array");
3362
3406
  decompressed.total += data.length;
3363
- if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkKKZATKQWcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
3407
+ if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkBLNOGMIMcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
3364
3408
  const ext = file.name.includes(".") ? file.name.split(".").pop() || "" : "";
3365
3409
  let mimeType = imageExtToMime(ext);
3366
3410
  if (mimeType === "application/octet-stream") {
@@ -3374,8 +3418,8 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
3374
3418
  images.push(img);
3375
3419
  blocks.push({ type: "image", text: filename, imageData: { data, mimeType, filename: file.name } });
3376
3420
  } catch (err) {
3377
- if (err instanceof _chunkKKZATKQWcjs.KordocError) throw err;
3378
- _optionalChain([warnings, 'optionalAccess', _75 => _75.push, 'call', _76 => _76({ message: `\uC774\uBBF8\uC9C0 \uCD94\uCD9C \uC2E4\uD328: ${file.name}`, code: "SKIPPED_IMAGE" })]);
3421
+ if (err instanceof _chunkBLNOGMIMcjs.KordocError) throw err;
3422
+ _optionalChain([warnings, 'optionalAccess', _80 => _80.push, 'call', _81 => _81({ message: `\uC774\uBBF8\uC9C0 \uCD94\uCD9C \uC2E4\uD328: ${file.name}`, code: "SKIPPED_IMAGE" })]);
3379
3423
  }
3380
3424
  }
3381
3425
  }
@@ -3425,7 +3469,7 @@ function extractFromBrokenZip(buffer) {
3425
3469
  }
3426
3470
  const nameBytes = data.slice(pos + 30, pos + 30 + nameLen);
3427
3471
  const name = new TextDecoder().decode(nameBytes);
3428
- if (_chunkKKZATKQWcjs.isPathTraversal.call(void 0, name)) {
3472
+ if (_chunkBLNOGMIMcjs.isPathTraversal.call(void 0, name)) {
3429
3473
  pos = fileStart + compSize;
3430
3474
  continue;
3431
3475
  }
@@ -3443,16 +3487,16 @@ function extractFromBrokenZip(buffer) {
3443
3487
  continue;
3444
3488
  }
3445
3489
  totalDecompressed += content.length * 2;
3446
- if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0, _chunkKKZATKQWcjs.KordocError)("\uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC");
3490
+ if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0, _chunkBLNOGMIMcjs.KordocError)("\uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC");
3447
3491
  sectionNum++;
3448
3492
  blocks.push(...parseSectionXml(content, void 0, warnings, sectionNum, shared));
3449
3493
  } catch (e16) {
3450
3494
  continue;
3451
3495
  }
3452
3496
  }
3453
- if (blocks.length === 0) throw new (0, _chunkKKZATKQWcjs.KordocError)("\uC190\uC0C1\uB41C HWPX\uC5D0\uC11C \uC139\uC158 \uB370\uC774\uD130\uB97C \uBCF5\uAD6C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
3497
+ if (blocks.length === 0) throw new (0, _chunkBLNOGMIMcjs.KordocError)("\uC190\uC0C1\uB41C HWPX\uC5D0\uC11C \uC139\uC158 \uB370\uC774\uD130\uB97C \uBCF5\uAD6C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
3454
3498
  applyPageText(blocks, shared);
3455
- const markdown = _chunkWMU2KJHFcjs.blocksToMarkdown.call(void 0, blocks);
3499
+ const markdown = _chunkSCJLAOY3cjs.blocksToMarkdown.call(void 0, blocks);
3456
3500
  return { markdown, blocks, warnings: warnings.length > 0 ? warnings : void 0 };
3457
3501
  }
3458
3502
  async function readKordocLayout(zip) {
@@ -3461,7 +3505,7 @@ async function readKordocLayout(zip) {
3461
3505
  try {
3462
3506
  const xml = await file.async("text");
3463
3507
  if (!/<opf:meta\b[^>]*name="generator"[^>]*content="kordoc"/.test(xml)) return null;
3464
- return _nullishCoalesce(_optionalChain([xml, 'access', _77 => _77.match, 'call', _78 => _78(/<opf:meta\b[^>]*name="kordoc-layout"[^>]*content="([^"]*)"/), 'optionalAccess', _79 => _79[1]]), () => ( null));
3508
+ return _nullishCoalesce(_optionalChain([xml, 'access', _82 => _82.match, 'call', _83 => _83(/<opf:meta\b[^>]*name="kordoc-layout"[^>]*content="([^"]*)"/), 'optionalAccess', _84 => _84[1]]), () => ( null));
3465
3509
  } catch (e17) {
3466
3510
  return null;
3467
3511
  }
@@ -3477,18 +3521,18 @@ async function resolveSectionPaths(zip) {
3477
3521
  if (paths.length > 0) return paths;
3478
3522
  }
3479
3523
  const sectionFiles = zip.file(/[Ss]ection\d+\.xml$/);
3480
- return sectionFiles.map((f) => f.name).sort(_chunkKKZATKQWcjs.compareSectionPaths);
3524
+ return sectionFiles.map((f) => f.name).sort(_chunkBLNOGMIMcjs.compareSectionPaths);
3481
3525
  }
3482
3526
  function parseSectionPathsFromManifest(xml) {
3483
3527
  const parser = createXmlParser();
3484
- const doc = parser.parseFromString(_chunkKKZATKQWcjs.stripDtd.call(void 0, xml), "text/xml");
3528
+ const doc = parser.parseFromString(_chunkBLNOGMIMcjs.stripDtd.call(void 0, xml), "text/xml");
3485
3529
  const items = doc.getElementsByTagName("opf:item");
3486
3530
  const spine = doc.getElementsByTagName("opf:itemref");
3487
3531
  const idToHref = /* @__PURE__ */ new Map();
3488
3532
  for (let i = 0; i < items.length; i++) {
3489
3533
  const item = items[i];
3490
3534
  const id = item.getAttribute("id") || "";
3491
- const href = _chunkKKZATKQWcjs.normalizeSectionHref.call(void 0, item.getAttribute("href") || "");
3535
+ const href = _chunkBLNOGMIMcjs.normalizeSectionHref.call(void 0, item.getAttribute("href") || "");
3492
3536
  if (id && href) idToHref.set(id, href);
3493
3537
  }
3494
3538
  if (spine.length > 0) {
@@ -3499,7 +3543,7 @@ function parseSectionPathsFromManifest(xml) {
3499
3543
  }
3500
3544
  if (ordered.length > 0) return ordered;
3501
3545
  }
3502
- return Array.from(idToHref.values()).sort(_chunkKKZATKQWcjs.compareSectionPaths);
3546
+ return Array.from(idToHref.values()).sort(_chunkBLNOGMIMcjs.compareSectionPaths);
3503
3547
  }
3504
3548
 
3505
3549
  // src/hwpx/metadata.ts
@@ -3512,7 +3556,7 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
3512
3556
  const xml = await file.async("text");
3513
3557
  if (decompressed) {
3514
3558
  decompressed.total += xml.length * 2;
3515
- if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkKKZATKQWcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
3559
+ if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkBLNOGMIMcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
3516
3560
  }
3517
3561
  parseDublinCoreMetadata(xml, metadata);
3518
3562
  if (metadata.title || metadata.author) return;
@@ -3522,13 +3566,13 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
3522
3566
  }
3523
3567
  function parseDublinCoreMetadata(xml, metadata) {
3524
3568
  const parser = createXmlParser();
3525
- const doc = parser.parseFromString(_chunkKKZATKQWcjs.stripDtd.call(void 0, xml), "text/xml");
3569
+ const doc = parser.parseFromString(_chunkBLNOGMIMcjs.stripDtd.call(void 0, xml), "text/xml");
3526
3570
  if (!doc.documentElement) return;
3527
3571
  const getText = (tagNames) => {
3528
3572
  for (const tag of tagNames) {
3529
3573
  const els = doc.getElementsByTagName(tag);
3530
3574
  if (els.length > 0) {
3531
- const text = _optionalChain([els, 'access', _80 => _80[0], 'access', _81 => _81.textContent, 'optionalAccess', _82 => _82.trim, 'call', _83 => _83()]);
3575
+ const text = _optionalChain([els, 'access', _85 => _85[0], 'access', _86 => _86.textContent, 'optionalAccess', _87 => _87.trim, 'call', _88 => _88()]);
3532
3576
  if (text) return text;
3533
3577
  }
3534
3578
  }
@@ -3547,7 +3591,7 @@ function parseDublinCoreMetadata(xml, metadata) {
3547
3591
 
3548
3592
  // src/hwpx/parser.ts
3549
3593
  async function parseHwpxDocument(buffer, options) {
3550
- _chunkKKZATKQWcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
3594
+ _chunkBLNOGMIMcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
3551
3595
  let zip;
3552
3596
  try {
3553
3597
  zip = await _jszip2.default.loadAsync(buffer);
@@ -3556,19 +3600,19 @@ async function parseHwpxDocument(buffer, options) {
3556
3600
  }
3557
3601
  const actualEntryCount = Object.keys(zip.files).length;
3558
3602
  if (actualEntryCount > MAX_ZIP_ENTRIES) {
3559
- throw new (0, _chunkKKZATKQWcjs.KordocError)("ZIP \uC5D4\uD2B8\uB9AC \uC218 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
3603
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("ZIP \uC5D4\uD2B8\uB9AC \uC218 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
3560
3604
  }
3561
3605
  const manifestFile = zip.file("META-INF/manifest.xml");
3562
3606
  if (manifestFile) {
3563
3607
  const manifestXml = await manifestFile.async("text");
3564
3608
  if (isEncryptedHwpx(manifestXml)) {
3565
- if (isComFallbackAvailable() && _optionalChain([options, 'optionalAccess', _84 => _84.filePath])) {
3609
+ if (isComFallbackAvailable() && _optionalChain([options, 'optionalAccess', _89 => _89.filePath])) {
3566
3610
  const { pages, pageCount, warnings: warnings2 } = extractTextViaCom(options.filePath);
3567
3611
  if (pages.some((p) => p && p.trim().length > 0)) {
3568
3612
  return comResultToParseResult(pages, pageCount, warnings2);
3569
3613
  }
3570
3614
  }
3571
- throw new (0, _chunkKKZATKQWcjs.KordocError)("DRM \uC554\uD638\uD654\uB41C HWPX \uD30C\uC77C\uC785\uB2C8\uB2E4. Windows + \uD55C\uCEF4 \uC624\uD53C\uC2A4 \uC124\uCE58 \uC2DC \uC790\uB3D9 \uCD94\uCD9C\uB429\uB2C8\uB2E4.");
3615
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("DRM \uC554\uD638\uD654\uB41C HWPX \uD30C\uC77C\uC785\uB2C8\uB2E4. Windows + \uD55C\uCEF4 \uC624\uD53C\uC2A4 \uC124\uCE58 \uC2DC \uC790\uB3D9 \uCD94\uCD9C\uB429\uB2C8\uB2E4.");
3572
3616
  }
3573
3617
  }
3574
3618
  const decompressed = { total: 0 };
@@ -3577,14 +3621,14 @@ async function parseHwpxDocument(buffer, options) {
3577
3621
  const styleMap = await extractHwpxStyles(zip, decompressed);
3578
3622
  const warnings = [];
3579
3623
  const sectionPaths = await resolveSectionPaths(zip);
3580
- if (sectionPaths.length === 0) throw new (0, _chunkKKZATKQWcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
3624
+ if (sectionPaths.length === 0) throw new (0, _chunkBLNOGMIMcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
3581
3625
  metadata.pageCount = sectionPaths.length;
3582
- const pageFilter = _optionalChain([options, 'optionalAccess', _85 => _85.pages]) ? _chunkDCZVOIEOcjs.parsePageRange.call(void 0, options.pages, sectionPaths.length) : null;
3626
+ const pageFilter = _optionalChain([options, 'optionalAccess', _90 => _90.pages]) ? _chunkDCZVOIEOcjs.parsePageRange.call(void 0, options.pages, sectionPaths.length) : null;
3583
3627
  const totalTarget = pageFilter ? pageFilter.size : sectionPaths.length;
3584
3628
  const blocks = [];
3585
3629
  const shared = createSectionShared();
3586
3630
  shared.kordocLayout = await readKordocLayout(zip);
3587
- shared.keepTrailingEmptyCols = _optionalChain([options, 'optionalAccess', _86 => _86.keepTrailingEmptyCols]);
3631
+ shared.keepTrailingEmptyCols = _optionalChain([options, 'optionalAccess', _91 => _91.keepTrailingEmptyCols]);
3588
3632
  let parsedSections = 0;
3589
3633
  for (let si = 0; si < sectionPaths.length; si++) {
3590
3634
  if (pageFilter && !pageFilter.has(si + 1)) continue;
@@ -3596,7 +3640,7 @@ async function parseHwpxDocument(buffer, options) {
3596
3640
  if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new ZipBombError("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
3597
3641
  blocks.push(...parseSectionXml(xml, styleMap, warnings, si + 1, shared));
3598
3642
  parsedSections++;
3599
- _optionalChain([options, 'optionalAccess', _87 => _87.onProgress, 'optionalCall', _88 => _88(parsedSections, totalTarget)]);
3643
+ _optionalChain([options, 'optionalAccess', _92 => _92.onProgress, 'optionalCall', _93 => _93(parsedSections, totalTarget)]);
3600
3644
  } catch (secErr) {
3601
3645
  if (secErr instanceof ZipBombError) throw secErr;
3602
3646
  warnings.push({ page: si + 1, message: `\uC139\uC158 ${si + 1} \uD30C\uC2F1 \uC2E4\uD328: ${secErr instanceof Error ? secErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "PARTIAL_PARSE" });
@@ -3606,7 +3650,7 @@ async function parseHwpxDocument(buffer, options) {
3606
3650
  const images = await extractImagesFromZip(zip, blocks, decompressed, warnings, !pageFilter);
3607
3651
  detectHwpxHeadings(blocks, styleMap);
3608
3652
  const outline = blocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
3609
- const markdown = _chunkWMU2KJHFcjs.blocksToMarkdown.call(void 0, blocks);
3653
+ const markdown = _chunkSCJLAOY3cjs.blocksToMarkdown.call(void 0, blocks);
3610
3654
  return { markdown, blocks, metadata, outline: outline.length > 0 ? outline : void 0, warnings: warnings.length > 0 ? warnings : void 0, images: images.length > 0 ? images : void 0 };
3611
3655
  }
3612
3656
 
@@ -4785,22 +4829,22 @@ function parseHwp5Document(buffer, options) {
4785
4829
  lenientCfb = parseLenientCfb(buffer);
4786
4830
  warnings.push({ message: "\uC190\uC0C1\uB41C CFB \uCEE8\uD14C\uC774\uB108 \u2014 lenient \uBAA8\uB4DC\uB85C \uBCF5\uAD6C", code: "LENIENT_CFB_RECOVERY" });
4787
4831
  } catch (e22) {
4788
- throw new (0, _chunkKKZATKQWcjs.KordocError)("CFB \uCEE8\uD14C\uC774\uB108 \uD30C\uC2F1 \uC2E4\uD328 (strict \uBC0F lenient \uBAA8\uB450)");
4832
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("CFB \uCEE8\uD14C\uC774\uB108 \uD30C\uC2F1 \uC2E4\uD328 (strict \uBC0F lenient \uBAA8\uB450)");
4789
4833
  }
4790
4834
  }
4791
4835
  const findStream = (path) => {
4792
4836
  if (cfb) {
4793
4837
  const entry = CFB.find(cfb, path);
4794
- return _optionalChain([entry, 'optionalAccess', _89 => _89.content]) ? Buffer.from(entry.content) : null;
4838
+ return _optionalChain([entry, 'optionalAccess', _94 => _94.content]) ? Buffer.from(entry.content) : null;
4795
4839
  }
4796
4840
  return lenientCfb.findStream(path);
4797
4841
  };
4798
4842
  const headerData = findStream("/FileHeader");
4799
- if (!headerData) throw new (0, _chunkKKZATKQWcjs.KordocError)("FileHeader \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
4843
+ if (!headerData) throw new (0, _chunkBLNOGMIMcjs.KordocError)("FileHeader \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
4800
4844
  const header = parseFileHeader(headerData);
4801
- if (header.signature !== "HWP Document File") throw new (0, _chunkKKZATKQWcjs.KordocError)("HWP \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
4802
- if (header.flags & FLAG_ENCRYPTED) throw new (0, _chunkKKZATKQWcjs.KordocError)("\uC554\uD638\uD654\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
4803
- if (header.flags & FLAG_DRM) throw new (0, _chunkKKZATKQWcjs.KordocError)("DRM \uBCF4\uD638\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
4845
+ if (header.signature !== "HWP Document File") throw new (0, _chunkBLNOGMIMcjs.KordocError)("HWP \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
4846
+ if (header.flags & FLAG_ENCRYPTED) throw new (0, _chunkBLNOGMIMcjs.KordocError)("\uC554\uD638\uD654\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
4847
+ if (header.flags & FLAG_DRM) throw new (0, _chunkBLNOGMIMcjs.KordocError)("DRM \uBCF4\uD638\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
4804
4848
  const compressed = (header.flags & FLAG_COMPRESSED) !== 0;
4805
4849
  const distribution = (header.flags & FLAG_DISTRIBUTION) !== 0;
4806
4850
  const metadata = {
@@ -4809,13 +4853,13 @@ function parseHwp5Document(buffer, options) {
4809
4853
  if (cfb) extractHwp5Metadata(cfb, metadata);
4810
4854
  const docInfo = cfb ? parseDocInfoStream(cfb, compressed) : parseDocInfoFromStream(findStream("/DocInfo"), compressed);
4811
4855
  const sections = distribution ? cfb ? findViewTextSections(cfb, compressed) : findViewTextSectionsLenient(lenientCfb, compressed) : cfb ? findSections(cfb) : findSectionsLenient(lenientCfb, compressed);
4812
- if (sections.length === 0) throw new (0, _chunkKKZATKQWcjs.KordocError)("\uC139\uC158 \uC2A4\uD2B8\uB9BC\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
4856
+ if (sections.length === 0) throw new (0, _chunkBLNOGMIMcjs.KordocError)("\uC139\uC158 \uC2A4\uD2B8\uB9BC\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
4813
4857
  metadata.pageCount = sections.length;
4814
- const pageFilter = _optionalChain([options, 'optionalAccess', _90 => _90.pages]) ? _chunkDCZVOIEOcjs.parsePageRange.call(void 0, options.pages, sections.length) : null;
4858
+ const pageFilter = _optionalChain([options, 'optionalAccess', _95 => _95.pages]) ? _chunkDCZVOIEOcjs.parsePageRange.call(void 0, options.pages, sections.length) : null;
4815
4859
  const totalTarget = pageFilter ? pageFilter.size : sections.length;
4816
4860
  const bodyBlocks = [];
4817
4861
  const doc = createHwp5DocState();
4818
- doc.keepTrailingEmptyCols = _optionalChain([options, 'optionalAccess', _91 => _91.keepTrailingEmptyCols]);
4862
+ doc.keepTrailingEmptyCols = _optionalChain([options, 'optionalAccess', _96 => _96.keepTrailingEmptyCols]);
4819
4863
  let totalDecompressed = 0;
4820
4864
  let parsedSections = 0;
4821
4865
  for (let si = 0; si < sections.length; si++) {
@@ -4824,22 +4868,22 @@ function parseHwp5Document(buffer, options) {
4824
4868
  const sectionData = sections[si];
4825
4869
  const data = !distribution && compressed ? decompressStream(Buffer.from(sectionData)) : Buffer.from(sectionData);
4826
4870
  totalDecompressed += data.length;
4827
- if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkKKZATKQWcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
4871
+ if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkBLNOGMIMcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
4828
4872
  const records = readRecords(data);
4829
4873
  const sectionBlocks = parseSection(records, docInfo, warnings, si + 1, doc);
4830
4874
  bodyBlocks.push(...sectionBlocks);
4831
4875
  parsedSections++;
4832
- _optionalChain([options, 'optionalAccess', _92 => _92.onProgress, 'optionalCall', _93 => _93(parsedSections, totalTarget)]);
4876
+ _optionalChain([options, 'optionalAccess', _97 => _97.onProgress, 'optionalCall', _98 => _98(parsedSections, totalTarget)]);
4833
4877
  } catch (secErr) {
4834
- if (secErr instanceof _chunkKKZATKQWcjs.KordocError) throw secErr;
4878
+ if (secErr instanceof _chunkBLNOGMIMcjs.KordocError) throw secErr;
4835
4879
  warnings.push({ page: si + 1, message: `\uC139\uC158 ${si + 1} \uD30C\uC2F1 \uC2E4\uD328: ${secErr instanceof Error ? secErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "PARTIAL_PARSE" });
4836
4880
  }
4837
4881
  }
4838
4882
  const blocks = [...doc.headerBlocks, ...bodyBlocks, ...doc.footerBlocks];
4839
4883
  const images = cfb ? extractHwp5Images(cfb.FileIndex, blocks, warnings, !pageFilter) : extractHwp5ImagesLenient(lenientCfb, blocks, warnings, !pageFilter);
4840
- let flatBlocks = _chunkWMU2KJHFcjs.flattenLayoutTables.call(void 0, blocks);
4841
- if (_optionalChain([options, 'optionalAccess', _94 => _94.dedupeRunningHeaders])) {
4842
- const deduped = _chunkWMU2KJHFcjs.dedupeRunningHeaders.call(void 0, flatBlocks);
4884
+ let flatBlocks = _chunkSCJLAOY3cjs.flattenLayoutTables.call(void 0, blocks);
4885
+ if (_optionalChain([options, 'optionalAccess', _99 => _99.dedupeRunningHeaders])) {
4886
+ const deduped = _chunkSCJLAOY3cjs.dedupeRunningHeaders.call(void 0, flatBlocks);
4843
4887
  const removed = flatBlocks.length - deduped.length;
4844
4888
  if (removed > 0) warnings.push({ message: `\uBC18\uBCF5 \uB7EC\uB2DD \uD5E4\uB354 ${removed}\uAC1C \uC81C\uAC70`, code: "HIDDEN_TEXT_FILTERED" });
4845
4889
  flatBlocks = deduped;
@@ -4848,10 +4892,10 @@ function parseHwp5Document(buffer, options) {
4848
4892
  detectHwp5Headings(flatBlocks, docInfo);
4849
4893
  }
4850
4894
  const outline = flatBlocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
4851
- let markdown = _chunkWMU2KJHFcjs.blocksToMarkdown.call(void 0, flatBlocks);
4852
- if (_optionalChain([options, 'optionalAccess', _95 => _95.inlineImages]) && images.length > 0) {
4895
+ let markdown = _chunkSCJLAOY3cjs.blocksToMarkdown.call(void 0, flatBlocks);
4896
+ if (_optionalChain([options, 'optionalAccess', _100 => _100.inlineImages]) && images.length > 0) {
4853
4897
  try {
4854
- markdown = _chunkWMU2KJHFcjs.inlineImagesIntoMarkdown.call(void 0, markdown, images, { compress: true });
4898
+ markdown = _chunkSCJLAOY3cjs.inlineImagesIntoMarkdown.call(void 0, markdown, images, { compress: true });
4855
4899
  } catch (inlineErr) {
4856
4900
  warnings.push({ message: `\uC774\uBBF8\uC9C0 \uC778\uB77C\uC778 \uC2E4\uD328 \u2014 \uC6D0\uBCF8 \uD30C\uC77C \uCC38\uC870\uB85C \uD3F4\uBC31: ${inlineErr instanceof Error ? inlineErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "SKIPPED_IMAGE" });
4857
4901
  }
@@ -4861,7 +4905,7 @@ function parseHwp5Document(buffer, options) {
4861
4905
  function parseDocInfoStream(cfb, compressed) {
4862
4906
  try {
4863
4907
  const entry = CFB.find(cfb, "/DocInfo");
4864
- if (!_optionalChain([entry, 'optionalAccess', _96 => _96.content])) return null;
4908
+ if (!_optionalChain([entry, 'optionalAccess', _101 => _101.content])) return null;
4865
4909
  const data = compressed ? decompressStream(Buffer.from(entry.content)) : Buffer.from(entry.content);
4866
4910
  const records = readRecords(data);
4867
4911
  return parseDocInfo(records);
@@ -4882,7 +4926,7 @@ function detectHwp5Headings(blocks, docInfo) {
4882
4926
  let baseFontSize = 0;
4883
4927
  const sizeFreq = /* @__PURE__ */ new Map();
4884
4928
  for (const b of blocks) {
4885
- if (_optionalChain([b, 'access', _97 => _97.style, 'optionalAccess', _98 => _98.fontSize]) && b.text) {
4929
+ if (_optionalChain([b, 'access', _102 => _102.style, 'optionalAccess', _103 => _103.fontSize]) && b.text) {
4886
4930
  sizeFreq.set(b.style.fontSize, (sizeFreq.get(b.style.fontSize) || 0) + b.text.length);
4887
4931
  }
4888
4932
  }
@@ -4898,7 +4942,7 @@ function detectHwp5Headings(blocks, docInfo) {
4898
4942
  const name = (style.nameKo || style.name).toLowerCase();
4899
4943
  if (name.includes("\uBC14\uD0D5") || name.includes("\uBCF8\uBB38") || name === "normal" || name === "body") {
4900
4944
  const cs = docInfo.charShapes[style.charShapeId];
4901
- if (_optionalChain([cs, 'optionalAccess', _99 => _99.fontSize]) > 0) {
4945
+ if (_optionalChain([cs, 'optionalAccess', _104 => _104.fontSize]) > 0) {
4902
4946
  baseFontSize = cs.fontSize / 10;
4903
4947
  break;
4904
4948
  }
@@ -4913,11 +4957,11 @@ function detectHwp5Headings(blocks, docInfo) {
4913
4957
  if (text.length === 0 || text.length > 200) continue;
4914
4958
  if (/^\d+$/.test(text)) continue;
4915
4959
  let level = 0;
4916
- if (_optionalChain([block, 'access', _100 => _100.style, 'optionalAccess', _101 => _101.fontSize]) && baseFontSize > 0) {
4960
+ if (_optionalChain([block, 'access', _105 => _105.style, 'optionalAccess', _106 => _106.fontSize]) && baseFontSize > 0) {
4917
4961
  const ratio = block.style.fontSize / baseFontSize;
4918
- if (ratio >= _chunkKKZATKQWcjs.HEADING_RATIO_H1) level = 1;
4919
- else if (ratio >= _chunkKKZATKQWcjs.HEADING_RATIO_H2) level = 2;
4920
- else if (ratio >= _chunkKKZATKQWcjs.HEADING_RATIO_H3) level = 3;
4962
+ if (ratio >= _chunkBLNOGMIMcjs.HEADING_RATIO_H1) level = 1;
4963
+ else if (ratio >= _chunkBLNOGMIMcjs.HEADING_RATIO_H2) level = 2;
4964
+ else if (ratio >= _chunkBLNOGMIMcjs.HEADING_RATIO_H3) level = 3;
4921
4965
  }
4922
4966
  if (/^제\d+[장절편]\s/.test(text) && text.length <= 50) {
4923
4967
  if (level === 0) level = 2;
@@ -4933,7 +4977,7 @@ function detectHwp5Headings(blocks, docInfo) {
4933
4977
  function extractHwp5Metadata(cfb, metadata) {
4934
4978
  try {
4935
4979
  const summaryEntry = CFB.find(cfb, "/HwpSummaryInformation") || CFB.find(cfb, "/SummaryInformation");
4936
- if (!_optionalChain([summaryEntry, 'optionalAccess', _102 => _102.content])) return;
4980
+ if (!_optionalChain([summaryEntry, 'optionalAccess', _107 => _107.content])) return;
4937
4981
  const data = Buffer.from(summaryEntry.content);
4938
4982
  if (data.length < 48) return;
4939
4983
  const numSets = data.readUInt32LE(24);
@@ -4966,7 +5010,7 @@ function findViewTextSections(cfb, compressed) {
4966
5010
  const sections = [];
4967
5011
  for (let i = 0; i < MAX_SECTIONS; i++) {
4968
5012
  const entry = CFB.find(cfb, `/ViewText/Section${i}`);
4969
- if (!_optionalChain([entry, 'optionalAccess', _103 => _103.content])) break;
5013
+ if (!_optionalChain([entry, 'optionalAccess', _108 => _108.content])) break;
4970
5014
  try {
4971
5015
  const decrypted = decryptViewText(Buffer.from(entry.content), compressed);
4972
5016
  sections.push({ idx: i, content: decrypted });
@@ -4980,13 +5024,13 @@ function findSections(cfb) {
4980
5024
  const sections = [];
4981
5025
  for (let i = 0; i < MAX_SECTIONS; i++) {
4982
5026
  const entry = CFB.find(cfb, `/BodyText/Section${i}`);
4983
- if (!_optionalChain([entry, 'optionalAccess', _104 => _104.content])) break;
5027
+ if (!_optionalChain([entry, 'optionalAccess', _109 => _109.content])) break;
4984
5028
  sections.push({ idx: i, content: Buffer.from(entry.content) });
4985
5029
  }
4986
5030
  if (sections.length === 0 && cfb.FileIndex) {
4987
5031
  for (const entry of cfb.FileIndex) {
4988
5032
  if (sections.length >= MAX_SECTIONS) break;
4989
- if (_optionalChain([entry, 'access', _105 => _105.name, 'optionalAccess', _106 => _106.startsWith, 'call', _107 => _107("Section")]) && entry.content) {
5033
+ if (_optionalChain([entry, 'access', _110 => _110.name, 'optionalAccess', _111 => _111.startsWith, 'call', _112 => _112("Section")]) && entry.content) {
4990
5034
  const idx = parseInt(entry.name.replace("Section", ""), 10) || 0;
4991
5035
  sections.push({ idx, content: Buffer.from(entry.content) });
4992
5036
  }
@@ -5002,7 +5046,7 @@ function findSectionsLenient(lcfb, compressed) {
5002
5046
  if (!raw) break;
5003
5047
  const content = compressed ? decompressStream(raw) : raw;
5004
5048
  totalDecompressed += content.length;
5005
- if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkKKZATKQWcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
5049
+ if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkBLNOGMIMcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
5006
5050
  sections.push({ idx: i, content });
5007
5051
  }
5008
5052
  if (sections.length === 0) {
@@ -5014,7 +5058,7 @@ function findSectionsLenient(lcfb, compressed) {
5014
5058
  if (raw) {
5015
5059
  const content = compressed ? decompressStream(raw) : raw;
5016
5060
  totalDecompressed += content.length;
5017
- if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkKKZATKQWcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
5061
+ if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkBLNOGMIMcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
5018
5062
  sections.push({ idx, content });
5019
5063
  }
5020
5064
  }
@@ -5031,7 +5075,7 @@ function findViewTextSectionsLenient(lcfb, compressed) {
5031
5075
  try {
5032
5076
  const content = decryptViewText(raw, compressed);
5033
5077
  totalDecompressed += content.length;
5034
- if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkKKZATKQWcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
5078
+ if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkBLNOGMIMcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
5035
5079
  sections.push({ idx: i, content });
5036
5080
  } catch (e27) {
5037
5081
  break;
@@ -5132,9 +5176,9 @@ function parseParagraph(records, start, end, ctx) {
5132
5176
  const applied = [];
5133
5177
  for (const r of ranges) {
5134
5178
  const ctrl = ctrls[r.ctrlIdx];
5135
- if (!_optionalChain([ctrl, 'optionalAccess', _108 => _108.href]) || r.end <= r.start) continue;
5179
+ if (!_optionalChain([ctrl, 'optionalAccess', _113 => _113.href]) || r.end <= r.start) continue;
5136
5180
  if (applied.some(([s, e]) => r.start < e && r.end > s)) continue;
5137
- const href = _chunkKKZATKQWcjs.sanitizeHref.call(void 0, ctrl.href);
5181
+ const href = _chunkBLNOGMIMcjs.sanitizeHref.call(void 0, ctrl.href);
5138
5182
  if (!href) continue;
5139
5183
  const anchor = text.slice(r.start, r.end);
5140
5184
  if (!anchor.trim()) continue;
@@ -5152,7 +5196,7 @@ function parseParagraph(records, start, end, ctx) {
5152
5196
  }
5153
5197
  if (ps.headType === 1 || ps.headType === 2) {
5154
5198
  const nid = ps.numberingId || (ps.headType === 1 ? ctx.doc.outlineNumberingId : 0);
5155
- const numbering = nid >= 1 ? _optionalChain([ctx, 'access', _109 => _109.docInfo, 'optionalAccess', _110 => _110.numberings, 'access', _111 => _111[nid - 1]]) : void 0;
5199
+ const numbering = nid >= 1 ? _optionalChain([ctx, 'access', _114 => _114.docInfo, 'optionalAccess', _115 => _115.numberings, 'access', _116 => _116[nid - 1]]) : void 0;
5156
5200
  if (numbering) {
5157
5201
  const counters = ctx.doc.numbering.advance(nid, ps.paraLevel);
5158
5202
  const fmt = numbering.levelFormats[Math.min(ps.paraLevel, 6)];
@@ -5162,7 +5206,7 @@ function parseParagraph(records, start, end, ctx) {
5162
5206
  }
5163
5207
  }
5164
5208
  } else if (ps.headType === 3) {
5165
- const bullet = ps.numberingId >= 1 ? _optionalChain([ctx, 'access', _112 => _112.docInfo, 'optionalAccess', _113 => _113.bullets, 'access', _114 => _114[ps.numberingId - 1]]) : void 0;
5209
+ const bullet = ps.numberingId >= 1 ? _optionalChain([ctx, 'access', _117 => _117.docInfo, 'optionalAccess', _118 => _118.bullets, 'access', _119 => _119[ps.numberingId - 1]]) : void 0;
5166
5210
  if (bullet && bullet.char !== "\uFFFF") headMarker = bullet.char;
5167
5211
  }
5168
5212
  }
@@ -5370,8 +5414,8 @@ function parseTableControl(ctrl, records, ctx) {
5370
5414
  let tableIdx = -1;
5371
5415
  for (let i2 = childStart; i2 < childEnd; i2++) {
5372
5416
  if (records[i2].tagId === TAG_TABLE && records[i2].data.length >= 8) {
5373
- rows = Math.min(records[i2].data.readUInt16LE(4), _chunkWMU2KJHFcjs.MAX_ROWS);
5374
- cols = Math.min(records[i2].data.readUInt16LE(6), _chunkWMU2KJHFcjs.MAX_COLS);
5417
+ rows = Math.min(records[i2].data.readUInt16LE(4), _chunkSCJLAOY3cjs.MAX_ROWS);
5418
+ cols = Math.min(records[i2].data.readUInt16LE(6), _chunkSCJLAOY3cjs.MAX_COLS);
5375
5419
  tableIdx = i2;
5376
5420
  break;
5377
5421
  }
@@ -5411,7 +5455,7 @@ function parseTableControl(ctrl, records, ctx) {
5411
5455
  const cellRows2 = arrangeCells(rows, cols, cells);
5412
5456
  const irCells = cellRows2.map((row) => row.map((c) => {
5413
5457
  const ir = { text: c.text.trim(), colSpan: c.colSpan, rowSpan: c.rowSpan };
5414
- if (_optionalChain([c, 'access', _115 => _115.blocks, 'optionalAccess', _116 => _116.length])) ir.blocks = c.blocks;
5458
+ if (_optionalChain([c, 'access', _120 => _120.blocks, 'optionalAccess', _121 => _121.length])) ir.blocks = c.blocks;
5415
5459
  if (c.isHeader) ir.isHeader = true;
5416
5460
  return ir;
5417
5461
  }));
@@ -5420,7 +5464,7 @@ function parseTableControl(ctrl, records, ctx) {
5420
5464
  return table3;
5421
5465
  }
5422
5466
  const cellRows = arrangeCells(rows, cols, cells);
5423
- const table2 = _chunkWMU2KJHFcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: ctx.doc.keepTrailingEmptyCols });
5467
+ const table2 = _chunkSCJLAOY3cjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: ctx.doc.keepTrailingEmptyCols });
5424
5468
  if (caption && table2.rows > 0) table2.caption = caption;
5425
5469
  return table2.rows > 0 ? table2 : null;
5426
5470
  }
@@ -5437,8 +5481,8 @@ function parseCell(records, lhIdx, end, ctx) {
5437
5481
  rowAddr = rec.data.readUInt16LE(10);
5438
5482
  const cs = rec.data.readUInt16LE(12);
5439
5483
  const rs = rec.data.readUInt16LE(14);
5440
- if (cs > 0) colSpan = Math.min(cs, _chunkWMU2KJHFcjs.MAX_COLS);
5441
- if (rs > 0) rowSpan = Math.min(rs, _chunkWMU2KJHFcjs.MAX_ROWS);
5484
+ if (cs > 0) colSpan = Math.min(cs, _chunkSCJLAOY3cjs.MAX_COLS);
5485
+ if (rs > 0) rowSpan = Math.min(rs, _chunkSCJLAOY3cjs.MAX_ROWS);
5442
5486
  }
5443
5487
  const blocks = ctx.depth < MAX_NEST_DEPTH ? parseParagraphList(records, lhIdx + 1, end, { ...ctx, depth: ctx.depth + 1 }) : [];
5444
5488
  const parts = [];
@@ -5448,7 +5492,7 @@ function parseCell(records, lhIdx, end, ctx) {
5448
5492
  parts.push(`![image](hwp5bin:${b.text})`);
5449
5493
  hasStructure = true;
5450
5494
  } else if (b.type === "table" && b.table) {
5451
- const flat = _chunkWMU2KJHFcjs.convertTableToText.call(void 0, b.table.cells);
5495
+ const flat = _chunkSCJLAOY3cjs.convertTableToText.call(void 0, b.table.cells);
5452
5496
  if (flat) parts.push(flat);
5453
5497
  hasStructure = true;
5454
5498
  } else if (b.text) {
@@ -5545,8 +5589,8 @@ function pictureToImageBlock(data, ctx) {
5545
5589
  if (data.length < 73) return null;
5546
5590
  const binDataId = data.readUInt16LE(71);
5547
5591
  if (binDataId === 0) return null;
5548
- const item = _optionalChain([ctx, 'access', _117 => _117.docInfo, 'optionalAccess', _118 => _118.binData, 'access', _119 => _119[binDataId - 1]]);
5549
- if (_optionalChain([item, 'optionalAccess', _120 => _120.kind]) === "link") {
5592
+ const item = _optionalChain([ctx, 'access', _122 => _122.docInfo, 'optionalAccess', _123 => _123.binData, 'access', _124 => _124[binDataId - 1]]);
5593
+ if (_optionalChain([item, 'optionalAccess', _125 => _125.kind]) === "link") {
5550
5594
  ctx.warnings.push({ page: ctx.sectionNum, message: `\uC678\uBD80 \uC5F0\uACB0 \uC774\uBBF8\uC9C0 (binDataId ${binDataId})`, code: "SKIPPED_IMAGE" });
5551
5595
  return null;
5552
5596
  }
@@ -17700,7 +17744,7 @@ function parseHwp3Document(buffer, _options) {
17700
17744
  try {
17701
17745
  body = _zlib.inflateRawSync.call(void 0, tail, { maxOutputLength: MAX_DECOMPRESS_SIZE3 });
17702
17746
  } catch (err) {
17703
- if (_optionalChain([err, 'optionalAccess', _121 => _121.code]) === "ERR_BUFFER_TOO_LARGE") {
17747
+ if (_optionalChain([err, 'optionalAccess', _126 => _126.code]) === "ERR_BUFFER_TOO_LARGE") {
17704
17748
  throw new Error(`HWP3 \uC555\uCD95 \uD574\uC81C \uACB0\uACFC\uAC00 \uCD5C\uB300 \uD5C8\uC6A9 \uD06C\uAE30(${MAX_DECOMPRESS_SIZE3 / 1024 / 1024}MB)\uB97C \uCD08\uACFC\uD588\uC2B5\uB2C8\uB2E4`);
17705
17749
  }
17706
17750
  const msg2 = err instanceof Error ? err.message : String(err);
@@ -17935,15 +17979,15 @@ function getElements(parent, tagName) {
17935
17979
  const result = [];
17936
17980
  for (let i = 0; i < nodes.length; i++) result.push(nodes[i]);
17937
17981
  if (result.length > 0) return result;
17938
- const nsNodes = _optionalChain([parent, 'access', _122 => _122.getElementsByTagNameNS, 'optionalCall', _123 => _123("*", tagName)]);
17982
+ const nsNodes = _optionalChain([parent, 'access', _127 => _127.getElementsByTagNameNS, 'optionalCall', _128 => _128("*", tagName)]);
17939
17983
  if (nsNodes) for (let i = 0; i < nsNodes.length; i++) result.push(nsNodes[i]);
17940
17984
  return result;
17941
17985
  }
17942
17986
  function getTextContent(el) {
17943
- return _nullishCoalesce(_optionalChain([el, 'access', _124 => _124.textContent, 'optionalAccess', _125 => _125.trim, 'call', _126 => _126()]), () => ( ""));
17987
+ return _nullishCoalesce(_optionalChain([el, 'access', _129 => _129.textContent, 'optionalAccess', _130 => _130.trim, 'call', _131 => _131()]), () => ( ""));
17944
17988
  }
17945
17989
  function parseXml(text) {
17946
- return new (0, _xmldom.DOMParser)().parseFromString(_chunkKKZATKQWcjs.stripDtd.call(void 0, text), "text/xml");
17990
+ return new (0, _xmldom.DOMParser)().parseFromString(_chunkBLNOGMIMcjs.stripDtd.call(void 0, text), "text/xml");
17947
17991
  }
17948
17992
  function collectRichText(root) {
17949
17993
  let out = "";
@@ -17952,7 +17996,7 @@ function collectRichText(root) {
17952
17996
  for (let i = 0; i < children.length; i++) {
17953
17997
  if (children[i].nodeType !== 1) continue;
17954
17998
  const el = children[i];
17955
- const local = el.localName || _optionalChain([el, 'access', _127 => _127.tagName, 'optionalAccess', _128 => _128.replace, 'call', _129 => _129(/^[^:]+:/, "")]) || "";
17999
+ const local = el.localName || _optionalChain([el, 'access', _132 => _132.tagName, 'optionalAccess', _133 => _133.replace, 'call', _134 => _134(/^[^:]+:/, "")]) || "";
17956
18000
  if (local === "rPh") continue;
17957
18001
  if (local === "t") out += _nullishCoalesce(el.textContent, () => ( ""));
17958
18002
  else walk(el);
@@ -18171,14 +18215,14 @@ function sheetToBlocks(sheetName, grid, merges, maxRow, maxCol, sheetIndex, keep
18171
18215
  const merge = mergeMap.get(key);
18172
18216
  row.push({
18173
18217
  text,
18174
- colSpan: _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _130 => _130.colSpan]), () => ( 1)),
18175
- rowSpan: _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _131 => _131.rowSpan]), () => ( 1))
18218
+ colSpan: _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _135 => _135.colSpan]), () => ( 1)),
18219
+ rowSpan: _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _136 => _136.rowSpan]), () => ( 1))
18176
18220
  });
18177
18221
  }
18178
18222
  cellRows.push(row);
18179
18223
  }
18180
18224
  if (cellRows.length > 0) {
18181
- const table2 = _chunkWMU2KJHFcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols });
18225
+ const table2 = _chunkSCJLAOY3cjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols });
18182
18226
  if (table2.rows > 0) {
18183
18227
  blocks.push({ type: "table", table: table2, pageNumber: sheetIndex + 1 });
18184
18228
  }
@@ -18186,12 +18230,12 @@ function sheetToBlocks(sheetName, grid, merges, maxRow, maxCol, sheetIndex, keep
18186
18230
  return blocks;
18187
18231
  }
18188
18232
  async function parseXlsxDocument(buffer, options) {
18189
- _chunkKKZATKQWcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE4);
18233
+ _chunkBLNOGMIMcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE4);
18190
18234
  const zip = await _jszip2.default.loadAsync(buffer);
18191
18235
  const warnings = [];
18192
18236
  const workbookFile = zip.file("xl/workbook.xml");
18193
18237
  if (!workbookFile) {
18194
- throw new (0, _chunkKKZATKQWcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 XLSX \uD30C\uC77C: xl/workbook.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
18238
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 XLSX \uD30C\uC77C: xl/workbook.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
18195
18239
  }
18196
18240
  let sharedStrings = [];
18197
18241
  const ssFile = zip.file("xl/sharedStrings.xml");
@@ -18200,7 +18244,7 @@ async function parseXlsxDocument(buffer, options) {
18200
18244
  }
18201
18245
  const { sheets, date1904 } = parseWorkbook(await workbookFile.async("text"));
18202
18246
  if (sheets.length === 0) {
18203
- throw new (0, _chunkKKZATKQWcjs.KordocError)("XLSX \uD30C\uC77C\uC5D0 \uC2DC\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4");
18247
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("XLSX \uD30C\uC77C\uC5D0 \uC2DC\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4");
18204
18248
  }
18205
18249
  let dateXfs = /* @__PURE__ */ new Map();
18206
18250
  const stylesFile = zip.file("xl/styles.xml");
@@ -18216,7 +18260,7 @@ async function parseXlsxDocument(buffer, options) {
18216
18260
  relsMap = parseRels(await relsFile.async("text"));
18217
18261
  }
18218
18262
  let pageFilter = null;
18219
- if (_optionalChain([options, 'optionalAccess', _132 => _132.pages])) {
18263
+ if (_optionalChain([options, 'optionalAccess', _137 => _137.pages])) {
18220
18264
  const { parsePageRange: parsePageRange2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./page-range-P7SDW6LR.cjs")));
18221
18265
  pageFilter = parsePageRange2(options.pages, sheets.length);
18222
18266
  }
@@ -18225,7 +18269,7 @@ async function parseXlsxDocument(buffer, options) {
18225
18269
  for (let i = 0; i < processedSheets; i++) {
18226
18270
  if (pageFilter && !pageFilter.has(i + 1)) continue;
18227
18271
  const sheet = sheets[i];
18228
- _optionalChain([options, 'optionalAccess', _133 => _133.onProgress, 'optionalCall', _134 => _134(i + 1, processedSheets)]);
18272
+ _optionalChain([options, 'optionalAccess', _138 => _138.onProgress, 'optionalCall', _139 => _139(i + 1, processedSheets)]);
18229
18273
  let sheetPath = relsMap.get(sheet.rId);
18230
18274
  if (sheetPath) {
18231
18275
  if (!sheetPath.startsWith("xl/") && !sheetPath.startsWith("/")) {
@@ -18248,7 +18292,7 @@ async function parseXlsxDocument(buffer, options) {
18248
18292
  try {
18249
18293
  const sheetXml = await sheetFile.async("text");
18250
18294
  const { grid, merges, maxRow, maxCol } = parseWorksheet(sheetXml, sharedStrings, dateXfs, date1904);
18251
- const sheetBlocks = sheetToBlocks(sheet.name, grid, merges, maxRow, maxCol, i, _optionalChain([options, 'optionalAccess', _135 => _135.keepTrailingEmptyCols]));
18295
+ const sheetBlocks = sheetToBlocks(sheet.name, grid, merges, maxRow, maxCol, i, _optionalChain([options, 'optionalAccess', _140 => _140.keepTrailingEmptyCols]));
18252
18296
  blocks.push(...sheetBlocks);
18253
18297
  } catch (err) {
18254
18298
  warnings.push({
@@ -18280,7 +18324,7 @@ async function parseXlsxDocument(buffer, options) {
18280
18324
  } catch (e29) {
18281
18325
  }
18282
18326
  }
18283
- const markdown = _chunkWMU2KJHFcjs.blocksToMarkdown.call(void 0, blocks);
18327
+ const markdown = _chunkSCJLAOY3cjs.blocksToMarkdown.call(void 0, blocks);
18284
18328
  return { markdown, blocks, metadata, warnings: warnings.length > 0 ? warnings : void 0 };
18285
18329
  }
18286
18330
 
@@ -18731,11 +18775,11 @@ function processGlobals(records) {
18731
18775
  const xfFmtIds = [];
18732
18776
  const firstBof = records[0];
18733
18777
  if (!firstBof || firstBof.opcode !== OP_BOF) {
18734
- throw new (0, _chunkKKZATKQWcjs.KordocError)("XLS: \uCCAB \uB808\uCF54\uB4DC\uAC00 BOF\uAC00 \uC544\uB2D8");
18778
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("XLS: \uCCAB \uB808\uCF54\uB4DC\uAC00 BOF\uAC00 \uC544\uB2D8");
18735
18779
  }
18736
18780
  const bof = decodeBof(firstBof.data);
18737
18781
  if (!bof || bof.dt !== DT_GLOBALS) {
18738
- throw new (0, _chunkKKZATKQWcjs.KordocError)("XLS: Globals \uC11C\uBE0C\uC2A4\uD2B8\uB9BC BOF \uB204\uB77D");
18782
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("XLS: Globals \uC11C\uBE0C\uC2A4\uD2B8\uB9BC BOF \uB204\uB77D");
18739
18783
  }
18740
18784
  let i = 1;
18741
18785
  while (i < records.length) {
@@ -18863,14 +18907,14 @@ function sheetToBlocks2(sheetName, sheet, sheetIndex, keepAnchoredEmptyCols) {
18863
18907
  const merge = mergeMap.get(key);
18864
18908
  row.push({
18865
18909
  text: grid[r][c],
18866
- colSpan: _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _136 => _136.colSpan]), () => ( 1)),
18867
- rowSpan: _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _137 => _137.rowSpan]), () => ( 1))
18910
+ colSpan: _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _141 => _141.colSpan]), () => ( 1)),
18911
+ rowSpan: _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _142 => _142.rowSpan]), () => ( 1))
18868
18912
  });
18869
18913
  }
18870
18914
  cellRows.push(row);
18871
18915
  }
18872
18916
  if (cellRows.length > 0) {
18873
- const table2 = _chunkWMU2KJHFcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols });
18917
+ const table2 = _chunkSCJLAOY3cjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols });
18874
18918
  if (table2.rows > 0) {
18875
18919
  blocks.push({ type: "table", table: table2, pageNumber: sheetIndex + 1 });
18876
18920
  }
@@ -18883,21 +18927,21 @@ async function parseXlsDocument(buffer, options) {
18883
18927
  try {
18884
18928
  cfb = parseLenientCfb(buf);
18885
18929
  } catch (e) {
18886
- throw new (0, _chunkKKZATKQWcjs.KordocError)(
18930
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)(
18887
18931
  `XLS: OLE2 \uC2DC\uADF8\uB2C8\uCC98 \uAC80\uC99D \uC2E4\uD328 \u2014 ${e instanceof Error ? e.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`
18888
18932
  );
18889
18933
  }
18890
18934
  const wb = _nullishCoalesce(cfb.findStream("/Workbook"), () => ( cfb.findStream("/Book")));
18891
18935
  if (!wb) {
18892
- throw new (0, _chunkKKZATKQWcjs.KordocError)("XLS: Workbook \uC2A4\uD2B8\uB9BC\uC774 \uC5C6\uC74C (BIFF5 \uB610\uB294 \uBE44\uD45C\uC900 \uD30C\uC77C)");
18936
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("XLS: Workbook \uC2A4\uD2B8\uB9BC\uC774 \uC5C6\uC74C (BIFF5 \uB610\uB294 \uBE44\uD45C\uC900 \uD30C\uC77C)");
18893
18937
  }
18894
18938
  const records = readRecords2(wb);
18895
18939
  if (records.length === 0) {
18896
- throw new (0, _chunkKKZATKQWcjs.KordocError)("XLS: \uC2DC\uADF8\uB2C8\uCC98 \uB808\uCF54\uB4DC\uAC00 \uC5C6\uC74C (Workbook \uC2A4\uD2B8\uB9BC \uC190\uC0C1)");
18940
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("XLS: \uC2DC\uADF8\uB2C8\uCC98 \uB808\uCF54\uB4DC\uAC00 \uC5C6\uC74C (Workbook \uC2A4\uD2B8\uB9BC \uC190\uC0C1)");
18897
18941
  }
18898
18942
  const firstBof = decodeBof(records[0].data);
18899
18943
  if (firstBof && firstBof.vers !== 1536) {
18900
- throw new (0, _chunkKKZATKQWcjs.KordocError)(
18944
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)(
18901
18945
  `XLS: BIFF8(0x0600)\uB9CC \uC9C0\uC6D0 \u2014 \uBCF8 \uD30C\uC77C\uC740 0x${firstBof.vers.toString(16)}`
18902
18946
  );
18903
18947
  }
@@ -18926,7 +18970,7 @@ async function parseXlsDocument(buffer, options) {
18926
18970
  } : void 0;
18927
18971
  const totalSheets = Math.min(globals.sheets.length, MAX_SHEETS2);
18928
18972
  let pageFilter = null;
18929
- if (_optionalChain([options, 'optionalAccess', _138 => _138.pages])) {
18973
+ if (_optionalChain([options, 'optionalAccess', _143 => _143.pages])) {
18930
18974
  const { parsePageRange: parsePageRange2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./page-range-P7SDW6LR.cjs")));
18931
18975
  pageFilter = parsePageRange2(options.pages, totalSheets);
18932
18976
  }
@@ -18935,7 +18979,7 @@ async function parseXlsDocument(buffer, options) {
18935
18979
  if (pageFilter && !pageFilter.has(i + 1)) continue;
18936
18980
  const meta = globals.sheets[i];
18937
18981
  if (meta.dt !== 0) continue;
18938
- _optionalChain([options, 'optionalAccess', _139 => _139.onProgress, 'optionalCall', _140 => _140(i + 1, totalSheets)]);
18982
+ _optionalChain([options, 'optionalAccess', _144 => _144.onProgress, 'optionalCall', _145 => _145(i + 1, totalSheets)]);
18939
18983
  const bofIdx = findSheetBofIndex(records, meta.lbPlyPos);
18940
18984
  if (bofIdx < 0) {
18941
18985
  warnings.push({
@@ -18951,7 +18995,7 @@ async function parseXlsDocument(buffer, options) {
18951
18995
  }
18952
18996
  try {
18953
18997
  const { sheet } = extractSheetCells(records, bofIdx, globals.sst, convertNum);
18954
- const blocks = sheetToBlocks2(meta.name, sheet, i, _optionalChain([options, 'optionalAccess', _141 => _141.keepTrailingEmptyCols]));
18998
+ const blocks = sheetToBlocks2(meta.name, sheet, i, _optionalChain([options, 'optionalAccess', _146 => _146.keepTrailingEmptyCols]));
18955
18999
  allBlocks.push(...blocks);
18956
19000
  } catch (e) {
18957
19001
  warnings.push({
@@ -18965,7 +19009,7 @@ async function parseXlsDocument(buffer, options) {
18965
19009
  pageCount: totalSheets
18966
19010
  };
18967
19011
  return {
18968
- markdown: _chunkWMU2KJHFcjs.blocksToMarkdown.call(void 0, allBlocks),
19012
+ markdown: _chunkSCJLAOY3cjs.blocksToMarkdown.call(void 0, allBlocks),
18969
19013
  blocks: allBlocks,
18970
19014
  metadata,
18971
19015
  warnings: warnings.length > 0 ? warnings : void 0
@@ -18978,7 +19022,7 @@ async function parseXlsDocument(buffer, options) {
18978
19022
 
18979
19023
  // src/docx/equation.ts
18980
19024
  function lname(el) {
18981
- return el.localName || _optionalChain([el, 'access', _142 => _142.tagName, 'optionalAccess', _143 => _143.replace, 'call', _144 => _144(/^[^:]+:/, "")]) || "";
19025
+ return el.localName || _optionalChain([el, 'access', _147 => _147.tagName, 'optionalAccess', _148 => _148.replace, 'call', _149 => _149(/^[^:]+:/, "")]) || "";
18982
19026
  }
18983
19027
  function kids(parent, name) {
18984
19028
  const out = [];
@@ -19367,7 +19411,7 @@ function isDisplayMath(el) {
19367
19411
  // src/docx/parser.ts
19368
19412
  var MAX_DECOMPRESS_SIZE5 = 100 * 1024 * 1024;
19369
19413
  function matchesLocal(el, localName2) {
19370
- return el.localName === localName2 || (_nullishCoalesce(_optionalChain([el, 'access', _145 => _145.tagName, 'optionalAccess', _146 => _146.endsWith, 'call', _147 => _147(`:${localName2}`)]), () => ( false)));
19414
+ return el.localName === localName2 || (_nullishCoalesce(_optionalChain([el, 'access', _150 => _150.tagName, 'optionalAccess', _151 => _151.endsWith, 'call', _152 => _152(`:${localName2}`)]), () => ( false)));
19371
19415
  }
19372
19416
  function effectiveChildElements(parent) {
19373
19417
  const result = [];
@@ -19402,7 +19446,7 @@ function findElements(parent, localName2) {
19402
19446
  const child = children[i];
19403
19447
  if (child.nodeType === 1) {
19404
19448
  const el = child;
19405
- if (el.localName === localName2 || _optionalChain([el, 'access', _148 => _148.tagName, 'optionalAccess', _149 => _149.endsWith, 'call', _150 => _150(`:${localName2}`)])) {
19449
+ if (el.localName === localName2 || _optionalChain([el, 'access', _153 => _153.tagName, 'optionalAccess', _154 => _154.endsWith, 'call', _155 => _155(`:${localName2}`)])) {
19406
19450
  result.push(el);
19407
19451
  }
19408
19452
  walk(el);
@@ -19421,7 +19465,7 @@ function getAttr(el, localName2) {
19421
19465
  return null;
19422
19466
  }
19423
19467
  function parseXml2(text) {
19424
- return new (0, _xmldom.DOMParser)().parseFromString(_chunkKKZATKQWcjs.stripDtd.call(void 0, text), "text/xml");
19468
+ return new (0, _xmldom.DOMParser)().parseFromString(_chunkBLNOGMIMcjs.stripDtd.call(void 0, text), "text/xml");
19425
19469
  }
19426
19470
  function parseStyles(xml) {
19427
19471
  const doc = parseXml2(xml);
@@ -19538,7 +19582,7 @@ function collectOmmlRoots(p) {
19538
19582
  const child = children[i];
19539
19583
  if (child.nodeType !== 1) continue;
19540
19584
  const el = child;
19541
- const tag = el.localName || _optionalChain([el, 'access', _151 => _151.tagName, 'optionalAccess', _152 => _152.replace, 'call', _153 => _153(/^[^:]+:/, "")]) || "";
19585
+ const tag = el.localName || _optionalChain([el, 'access', _156 => _156.tagName, 'optionalAccess', _157 => _157.replace, 'call', _158 => _158(/^[^:]+:/, "")]) || "";
19542
19586
  if (tag === "oMath" || tag === "oMathPara") {
19543
19587
  out.push(el);
19544
19588
  } else if (tag === "txbxContent" || tag === "Fallback") {
@@ -19579,7 +19623,7 @@ function fieldUrlFromInstr(instr) {
19579
19623
  function makeLink(text, rawHref) {
19580
19624
  if (!text) return "";
19581
19625
  if (!rawHref) return text;
19582
- const href = _chunkKKZATKQWcjs.sanitizeHref.call(void 0, rawHref);
19626
+ const href = _chunkBLNOGMIMcjs.sanitizeHref.call(void 0, rawHref);
19583
19627
  return href ? `[${text}](${href})` : text;
19584
19628
  }
19585
19629
  function collectInline(p, footnotes, rels) {
@@ -19681,7 +19725,7 @@ function parseParagraph2(p, styles, numbering, footnotes, rels) {
19681
19725
  const { text, bold: hasBold, italic: hasItalic, footnoteText } = collectInline(p, footnotes, rels);
19682
19726
  if (!text) return null;
19683
19727
  const style = styles.get(styleId);
19684
- if (_optionalChain([style, 'optionalAccess', _154 => _154.outlineLevel]) !== void 0 && style.outlineLevel >= 0 && style.outlineLevel <= 5) {
19728
+ if (_optionalChain([style, 'optionalAccess', _159 => _159.outlineLevel]) !== void 0 && style.outlineLevel >= 0 && style.outlineLevel <= 5) {
19685
19729
  return {
19686
19730
  type: "heading",
19687
19731
  text,
@@ -19690,8 +19734,8 @@ function parseParagraph2(p, styles, numbering, footnotes, rels) {
19690
19734
  }
19691
19735
  if (numId && numId !== "0") {
19692
19736
  const numDef = numbering.get(numId);
19693
- const levelInfo = _optionalChain([numDef, 'optionalAccess', _155 => _155.get, 'call', _156 => _156(ilvl)]);
19694
- const listType = _optionalChain([levelInfo, 'optionalAccess', _157 => _157.numFmt]) === "bullet" ? "unordered" : "ordered";
19737
+ const levelInfo = _optionalChain([numDef, 'optionalAccess', _160 => _160.get, 'call', _161 => _161(ilvl)]);
19738
+ const listType = _optionalChain([levelInfo, 'optionalAccess', _162 => _162.numFmt]) === "bullet" ? "unordered" : "ordered";
19695
19739
  return { type: "list", text, listType };
19696
19740
  }
19697
19741
  const block = { type: "paragraph", text };
@@ -19773,7 +19817,7 @@ ${cell2.text}` : cell2.text;
19773
19817
  return { text: cell2.text, colSpan: cell2.colSpan, rowSpan, colAddr: cell2.col, rowAddr: r };
19774
19818
  })
19775
19819
  );
19776
- const table2 = _chunkWMU2KJHFcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keepEmptyCols });
19820
+ const table2 = _chunkSCJLAOY3cjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keepEmptyCols });
19777
19821
  if (table2.rows === 0 || table2.cols === 0) return null;
19778
19822
  return { type: "table", table: table2 };
19779
19823
  }
@@ -19783,10 +19827,10 @@ function collectCellText(tc2, styles, numbering, footnotes, rels, depth) {
19783
19827
  for (const el of effectiveChildElements(tc2)) {
19784
19828
  if (matchesLocal(el, "p")) {
19785
19829
  const block = parseParagraph2(el, styles, numbering, footnotes, rels);
19786
- if (_optionalChain([block, 'optionalAccess', _158 => _158.text])) parts.push(block.text);
19830
+ if (_optionalChain([block, 'optionalAccess', _163 => _163.text])) parts.push(block.text);
19787
19831
  for (const tp of collectTextboxParagraphs(el)) {
19788
19832
  const tb = parseParagraph2(tp, styles, numbering, footnotes, rels);
19789
- if (_optionalChain([tb, 'optionalAccess', _159 => _159.text])) parts.push(tb.text);
19833
+ if (_optionalChain([tb, 'optionalAccess', _164 => _164.text])) parts.push(tb.text);
19790
19834
  }
19791
19835
  } else if (matchesLocal(el, "tbl")) {
19792
19836
  for (const tr of getChildElements(el, "tr")) {
@@ -19821,7 +19865,7 @@ async function buildImageMap(zip, rels, doc, warnings) {
19821
19865
  try {
19822
19866
  const data = await imgFile.async("uint8array");
19823
19867
  imgIdx++;
19824
- const ext = _nullishCoalesce(_optionalChain([imgPath, 'access', _160 => _160.split, 'call', _161 => _161("."), 'access', _162 => _162.pop, 'call', _163 => _163(), 'optionalAccess', _164 => _164.toLowerCase, 'call', _165 => _165()]), () => ( "png"));
19868
+ const ext = _nullishCoalesce(_optionalChain([imgPath, 'access', _165 => _165.split, 'call', _166 => _166("."), 'access', _167 => _167.pop, 'call', _168 => _168(), 'optionalAccess', _169 => _169.toLowerCase, 'call', _170 => _170()]), () => ( "png"));
19825
19869
  const mimeMap = {
19826
19870
  png: "image/png",
19827
19871
  jpg: "image/jpeg",
@@ -19875,12 +19919,12 @@ function emitParagraphImages(p, imageMap, linked, out) {
19875
19919
  }
19876
19920
  }
19877
19921
  async function parseDocxDocument(buffer, options) {
19878
- _chunkKKZATKQWcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE5);
19922
+ _chunkBLNOGMIMcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE5);
19879
19923
  const zip = await _jszip2.default.loadAsync(buffer);
19880
19924
  const warnings = [];
19881
19925
  const docFile = zip.file("word/document.xml");
19882
19926
  if (!docFile) {
19883
- throw new (0, _chunkKKZATKQWcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 DOCX \uD30C\uC77C: word/document.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
19927
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 DOCX \uD30C\uC77C: word/document.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
19884
19928
  }
19885
19929
  let rels = /* @__PURE__ */ new Map();
19886
19930
  const relsFile = zip.file("word/_rels/document.xml.rels");
@@ -19927,7 +19971,7 @@ async function parseDocxDocument(buffer, options) {
19927
19971
  const doc = parseXml2(docXml);
19928
19972
  const body = findElements(doc, "body");
19929
19973
  if (body.length === 0) {
19930
- throw new (0, _chunkKKZATKQWcjs.KordocError)("DOCX \uBCF8\uBB38(w:body)\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
19974
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("DOCX \uBCF8\uBB38(w:body)\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
19931
19975
  }
19932
19976
  const { imageMap, images } = await buildImageMap(zip, rels, doc, warnings);
19933
19977
  const linkedImages = /* @__PURE__ */ new Set();
@@ -19935,7 +19979,7 @@ async function parseDocxDocument(buffer, options) {
19935
19979
  const bodyEl = body[0];
19936
19980
  const topLevel = effectiveChildElements(bodyEl);
19937
19981
  for (const el of topLevel) {
19938
- const localName2 = _nullishCoalesce(el.localName, () => ( _optionalChain([el, 'access', _166 => _166.tagName, 'optionalAccess', _167 => _167.split, 'call', _168 => _168(":"), 'access', _169 => _169.pop, 'call', _170 => _170()])));
19982
+ const localName2 = _nullishCoalesce(el.localName, () => ( _optionalChain([el, 'access', _171 => _171.tagName, 'optionalAccess', _172 => _172.split, 'call', _173 => _173(":"), 'access', _174 => _174.pop, 'call', _175 => _175()])));
19939
19983
  if (localName2 === "p") {
19940
19984
  const block = parseParagraph2(el, styles, numbering, footnotes, rels);
19941
19985
  if (block) blocks.push(block);
@@ -19946,7 +19990,7 @@ async function parseDocxDocument(buffer, options) {
19946
19990
  if (imageMap.size > 0) emitParagraphImages(tp, imageMap, linkedImages, blocks);
19947
19991
  }
19948
19992
  } else if (localName2 === "tbl") {
19949
- const block = parseTable(el, styles, numbering, footnotes, rels, _optionalChain([options, 'optionalAccess', _171 => _171.keepTrailingEmptyCols]));
19993
+ const block = parseTable(el, styles, numbering, footnotes, rels, _optionalChain([options, 'optionalAccess', _176 => _176.keepTrailingEmptyCols]));
19950
19994
  if (block) blocks.push(block);
19951
19995
  }
19952
19996
  }
@@ -19978,7 +20022,7 @@ async function parseDocxDocument(buffer, options) {
19978
20022
  }
19979
20023
  }
19980
20024
  const outline = blocks.filter((b) => b.type === "heading").map((b) => ({ level: _nullishCoalesce(b.level, () => ( 2)), text: _nullishCoalesce(b.text, () => ( "")) }));
19981
- const markdown = _chunkWMU2KJHFcjs.blocksToMarkdown.call(void 0, blocks);
20025
+ const markdown = _chunkSCJLAOY3cjs.blocksToMarkdown.call(void 0, blocks);
19982
20026
  return {
19983
20027
  markdown,
19984
20028
  blocks,
@@ -20001,7 +20045,7 @@ function parseHwpmlDocument(buffer, options) {
20001
20045
  }
20002
20046
  const text = new TextDecoder("utf-8").decode(buffer).replace(/^\uFEFF/, "");
20003
20047
  const normalized = text.replace(/&nbsp;/g, "&#160;");
20004
- const xml = _chunkKKZATKQWcjs.stripDtd.call(void 0, normalized);
20048
+ const xml = _chunkBLNOGMIMcjs.stripDtd.call(void 0, normalized);
20005
20049
  const warnings = [];
20006
20050
  const parser = new (0, _xmldom.DOMParser)({
20007
20051
  onError: (_level, msg2) => {
@@ -20029,7 +20073,7 @@ function parseHwpmlDocument(buffer, options) {
20029
20073
  return { markdown: "", blocks: [], metadata, warnings };
20030
20074
  }
20031
20075
  const blocks = [];
20032
- const pageFilter = _optionalChain([options, 'optionalAccess', _172 => _172.pages]) ? _chunkDCZVOIEOcjs.parsePageRange.call(void 0, options.pages, countSections(body)) : null;
20076
+ const pageFilter = _optionalChain([options, 'optionalAccess', _177 => _177.pages]) ? _chunkDCZVOIEOcjs.parsePageRange.call(void 0, options.pages, countSections(body)) : null;
20033
20077
  let sectionIdx = 0;
20034
20078
  const children = body.childNodes;
20035
20079
  for (let i = 0; i < children.length; i++) {
@@ -20038,10 +20082,10 @@ function parseHwpmlDocument(buffer, options) {
20038
20082
  if (localName(el) !== "SECTION") continue;
20039
20083
  sectionIdx++;
20040
20084
  if (pageFilter && !pageFilter.has(sectionIdx)) continue;
20041
- parseSection2(el, blocks, paraShapeMap, sectionIdx, warnings, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _173 => _173.keepTrailingEmptyCols]), () => ( false)));
20085
+ parseSection2(el, blocks, paraShapeMap, sectionIdx, warnings, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _178 => _178.keepTrailingEmptyCols]), () => ( false)));
20042
20086
  }
20043
20087
  const outline = blocks.filter((b) => b.type === "heading" && b.text).map((b) => ({ level: _nullishCoalesce(b.level, () => ( 1)), text: b.text, pageNumber: b.pageNumber }));
20044
- const markdown = _chunkWMU2KJHFcjs.blocksToMarkdown.call(void 0, blocks);
20088
+ const markdown = _chunkSCJLAOY3cjs.blocksToMarkdown.call(void 0, blocks);
20045
20089
  return {
20046
20090
  markdown,
20047
20091
  blocks,
@@ -20127,7 +20171,7 @@ function parseParagraph3(el, blocks, paraShapeMap, sectionNum) {
20127
20171
  const shapeInfo = paraShapeMap.get(paraShapeId);
20128
20172
  const text = extractParagraphText(el);
20129
20173
  if (!text) return;
20130
- if (_optionalChain([shapeInfo, 'optionalAccess', _174 => _174.headingLevel]) != null) {
20174
+ if (_optionalChain([shapeInfo, 'optionalAccess', _179 => _179.headingLevel]) != null) {
20131
20175
  blocks.push({ type: "heading", text, level: shapeInfo.headingLevel, pageNumber: sectionNum });
20132
20176
  } else {
20133
20177
  blocks.push({ type: "paragraph", text, pageNumber: sectionNum });
@@ -20186,7 +20230,7 @@ function parseTable2(el, blocks, paraShapeMap, sectionNum, warnings, keep) {
20186
20230
  const r = Math.min(Math.max(_nullishCoalesce(cell2.rowAddr, () => ( 0)), 0), rowCount - 1);
20187
20231
  cellRows[r].push(cell2);
20188
20232
  }
20189
- const table2 = _chunkWMU2KJHFcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keep });
20233
+ const table2 = _chunkSCJLAOY3cjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keep });
20190
20234
  const caption = extractShapeCaption(el);
20191
20235
  if (caption.text && caption.before) {
20192
20236
  blocks.push({ type: "paragraph", text: caption.text, pageNumber: sectionNum });
@@ -20446,7 +20490,7 @@ function fillInCellPatterns(cellText, values, matchedLabels, blockedLabels) {
20446
20490
  (match, prefix, suffix) => {
20447
20491
  const label = prefix + suffix;
20448
20492
  const normalizedLabel = normalizeLabel(label);
20449
- if (_optionalChain([blockedLabels, 'optionalAccess', _175 => _175.has, 'call', _176 => _176(normalizedLabel)])) return match;
20493
+ if (_optionalChain([blockedLabels, 'optionalAccess', _180 => _180.has, 'call', _181 => _181(normalizedLabel)])) return match;
20450
20494
  const matchKey = values.available(normalizedLabel) ? normalizedLabel : values.available(normalizeLabel(prefix)) ? normalizeLabel(prefix) : void 0;
20451
20495
  if (matchKey === void 0) return match;
20452
20496
  const newValue = values.consume(matchKey);
@@ -20525,17 +20569,17 @@ function matchInlineSegment(seg, values, blockedLabels) {
20525
20569
  const nlabel = normalizeLabel(seg.label);
20526
20570
  if (seg.extLabel !== void 0) {
20527
20571
  const nExt = normalizeLabel(seg.extLabel);
20528
- if (nExt !== nlabel && !_optionalChain([blockedLabels, 'optionalAccess', _177 => _177.has, 'call', _178 => _178(nExt)]) && values.has(nExt)) {
20572
+ if (nExt !== nlabel && !_optionalChain([blockedLabels, 'optionalAccess', _182 => _182.has, 'call', _183 => _183(nExt)]) && values.has(nExt)) {
20529
20573
  return { key: nExt, label: seg.extLabel, viaExt: true };
20530
20574
  }
20531
20575
  }
20532
- if (_optionalChain([blockedLabels, 'optionalAccess', _179 => _179.has, 'call', _180 => _180(nlabel)])) return void 0;
20576
+ if (_optionalChain([blockedLabels, 'optionalAccess', _184 => _184.has, 'call', _185 => _185(nlabel)])) return void 0;
20533
20577
  const key = findMatchingKey(nlabel, values);
20534
20578
  return key !== void 0 ? { key, label: seg.label, viaExt: false } : void 0;
20535
20579
  }
20536
20580
  function clampSegmentEnd(text, seg, next, nextViaExt) {
20537
20581
  let ve = seg.valueEnd;
20538
- if (nextViaExt && _optionalChain([next, 'optionalAccess', _181 => _181.extStart]) !== void 0 && next.extStart < ve) ve = next.extStart;
20582
+ if (nextViaExt && _optionalChain([next, 'optionalAccess', _186 => _186.extStart]) !== void 0 && next.extStart < ve) ve = next.extStart;
20539
20583
  while (ve > seg.valueStart && /\s/.test(text[ve - 1])) ve--;
20540
20584
  return ve;
20541
20585
  }
@@ -20550,7 +20594,7 @@ function normalizeValues(values, warnings) {
20550
20594
  const { value, format } = typeof raw === "object" && !Array.isArray(raw) ? raw : { value: raw, format: void 0 };
20551
20595
  const key = normalizeLabel(label);
20552
20596
  if (map.has(key)) {
20553
- _optionalChain([warnings, 'optionalAccess', _182 => _182.push, 'call', _183 => _183(`\uC785\uB825 \uB77C\uBCA8 "${label}"\uC774 \uC815\uADDC\uD654 \uD0A4 "${key}"\uC5D0\uC11C \uB2E4\uB978 \uB77C\uBCA8\uACFC \uCDA9\uB3CC \u2014 \uB4A4 \uAC12\uC73C\uB85C \uB36E\uC5B4\uC500`)]);
20597
+ _optionalChain([warnings, 'optionalAccess', _187 => _187.push, 'call', _188 => _188(`\uC785\uB825 \uB77C\uBCA8 "${label}"\uC774 \uC815\uADDC\uD654 \uD0A4 "${key}"\uC5D0\uC11C \uB2E4\uB978 \uB77C\uBCA8\uACFC \uCDA9\uB3CC \u2014 \uB4A4 \uAC12\uC73C\uB85C \uB36E\uC5B4\uC500`)]);
20554
20598
  }
20555
20599
  map.set(key, Array.isArray(value) ? value.map((v) => formatFillValue(v, format)) : formatFillValue(value, format));
20556
20600
  }
@@ -20725,8 +20769,8 @@ function extractFromTable(table2) {
20725
20769
  if (table2.cols >= 2) {
20726
20770
  for (let r = 0; r < table2.rows; r++) {
20727
20771
  for (let c = 0; c < table2.cols - 1; c++) {
20728
- const labelCell = _optionalChain([table2, 'access', _184 => _184.cells, 'access', _185 => _185[r], 'optionalAccess', _186 => _186[c]]);
20729
- const valueCell = _optionalChain([table2, 'access', _187 => _187.cells, 'access', _188 => _188[r], 'optionalAccess', _189 => _189[c + 1]]);
20772
+ const labelCell = _optionalChain([table2, 'access', _189 => _189.cells, 'access', _190 => _190[r], 'optionalAccess', _191 => _191[c]]);
20773
+ const valueCell = _optionalChain([table2, 'access', _192 => _192.cells, 'access', _193 => _193[r], 'optionalAccess', _194 => _194[c + 1]]);
20730
20774
  if (!labelCell || !valueCell) continue;
20731
20775
  if (isLabelCell(labelCell.text)) {
20732
20776
  fields.push({
@@ -20741,15 +20785,15 @@ function extractFromTable(table2) {
20741
20785
  }
20742
20786
  if (fields.length === 0 && table2.rows >= 2 && table2.cols >= 2) {
20743
20787
  const headerRow = table2.cells[0];
20744
- const allLabels = _nullishCoalesce(_optionalChain([headerRow, 'optionalAccess', _190 => _190.every, 'call', _191 => _191((cell2) => {
20745
- const t = _nullishCoalesce(_optionalChain([cell2, 'optionalAccess', _192 => _192.text, 'access', _193 => _193.trim, 'call', _194 => _194()]), () => ( ""));
20788
+ const allLabels = _nullishCoalesce(_optionalChain([headerRow, 'optionalAccess', _195 => _195.every, 'call', _196 => _196((cell2) => {
20789
+ const t = _nullishCoalesce(_optionalChain([cell2, 'optionalAccess', _197 => _197.text, 'access', _198 => _198.trim, 'call', _199 => _199()]), () => ( ""));
20746
20790
  return t.length > 0 && t.length <= 20;
20747
20791
  })]), () => ( false));
20748
20792
  if (allLabels) {
20749
20793
  for (let r = 1; r < table2.rows; r++) {
20750
20794
  for (let c = 0; c < table2.cols; c++) {
20751
- const label = _nullishCoalesce(_optionalChain([headerRow, 'access', _195 => _195[c], 'optionalAccess', _196 => _196.text, 'access', _197 => _197.trim, 'call', _198 => _198()]), () => ( ""));
20752
- const value = _nullishCoalesce(_optionalChain([table2, 'access', _199 => _199.cells, 'access', _200 => _200[r], 'optionalAccess', _201 => _201[c], 'optionalAccess', _202 => _202.text, 'access', _203 => _203.trim, 'call', _204 => _204()]), () => ( ""));
20795
+ const label = _nullishCoalesce(_optionalChain([headerRow, 'access', _200 => _200[c], 'optionalAccess', _201 => _201.text, 'access', _202 => _202.trim, 'call', _203 => _203()]), () => ( ""));
20796
+ const value = _nullishCoalesce(_optionalChain([table2, 'access', _204 => _204.cells, 'access', _205 => _205[r], 'optionalAccess', _206 => _206[c], 'optionalAccess', _207 => _207.text, 'access', _208 => _208.trim, 'call', _209 => _209()]), () => ( ""));
20753
20797
  if (label && value) {
20754
20798
  fields.push({ label, value, row: r, col: c });
20755
20799
  }
@@ -20843,7 +20887,7 @@ function fillFormFields(blocks, values, blockedLabels) {
20843
20887
  for (const table2 of allTables) {
20844
20888
  for (let r = 0; r < table2.rows; r++) {
20845
20889
  for (let c = 0; c < table2.cols; c++) {
20846
- const cell2 = _optionalChain([table2, 'access', _205 => _205.cells, 'access', _206 => _206[r], 'optionalAccess', _207 => _207[c]]);
20890
+ const cell2 = _optionalChain([table2, 'access', _210 => _210.cells, 'access', _211 => _211[r], 'optionalAccess', _212 => _212[c]]);
20847
20891
  if (!cell2) continue;
20848
20892
  const result = fillInCellPatterns(cell2.text, cursor, matchedLabels, blockedLabels);
20849
20893
  if (result) {
@@ -20875,7 +20919,7 @@ function collectIRTables(blocks, depth) {
20875
20919
  out.push(block.table);
20876
20920
  for (const row of block.table.cells) {
20877
20921
  for (const cell2 of row) {
20878
- if (_optionalChain([cell2, 'optionalAccess', _208 => _208.blocks, 'optionalAccess', _209 => _209.length])) out.push(...collectIRTables(cell2.blocks, depth + 1));
20922
+ if (_optionalChain([cell2, 'optionalAccess', _213 => _213.blocks, 'optionalAccess', _214 => _214.length])) out.push(...collectIRTables(cell2.blocks, depth + 1));
20879
20923
  }
20880
20924
  }
20881
20925
  }
@@ -20886,7 +20930,7 @@ function coveredPositions(table2) {
20886
20930
  for (let r = 0; r < table2.rows; r++) {
20887
20931
  for (let c = 0; c < table2.cols; c++) {
20888
20932
  if (covered.has(`${r},${c}`)) continue;
20889
- const cell2 = _optionalChain([table2, 'access', _210 => _210.cells, 'access', _211 => _211[r], 'optionalAccess', _212 => _212[c]]);
20933
+ const cell2 = _optionalChain([table2, 'access', _215 => _215.cells, 'access', _216 => _216[r], 'optionalAccess', _217 => _217[c]]);
20890
20934
  if (!cell2) continue;
20891
20935
  for (let dr = 0; dr < cell2.rowSpan; dr++) {
20892
20936
  for (let dc = 0; dc < cell2.colSpan; dc++) {
@@ -20902,15 +20946,15 @@ function coveredPositions(table2) {
20902
20946
  function isHeaderDataTable(table2, covered) {
20903
20947
  if (table2.rows < 2) return false;
20904
20948
  const headerRow = table2.cells[0];
20905
- if (!_optionalChain([headerRow, 'optionalAccess', _213 => _213.length])) return false;
20949
+ if (!_optionalChain([headerRow, 'optionalAccess', _218 => _218.length])) return false;
20906
20950
  const allLabels = headerRow.every((cell2) => {
20907
- const t = _nullishCoalesce(_optionalChain([cell2, 'optionalAccess', _214 => _214.text, 'access', _215 => _215.trim, 'call', _216 => _216()]), () => ( ""));
20951
+ const t = _nullishCoalesce(_optionalChain([cell2, 'optionalAccess', _219 => _219.text, 'access', _220 => _220.trim, 'call', _221 => _221()]), () => ( ""));
20908
20952
  return t.length > 0 && t.length <= 20 && isLabelCell(t);
20909
20953
  });
20910
20954
  if (!allLabels) return false;
20911
20955
  for (let c = 0; c < table2.cols; c++) {
20912
20956
  if (covered.has(`1,${c}`)) continue;
20913
- const cell2 = _optionalChain([table2, 'access', _217 => _217.cells, 'access', _218 => _218[1], 'optionalAccess', _219 => _219[c]]);
20957
+ const cell2 = _optionalChain([table2, 'access', _222 => _222.cells, 'access', _223 => _223[1], 'optionalAccess', _224 => _224[c]]);
20914
20958
  if (!cell2) break;
20915
20959
  return !isLabelCell(cell2.text);
20916
20960
  }
@@ -20923,7 +20967,7 @@ function fillTable(table2, values, filled, matchedLabels, patternFilledCells, bl
20923
20967
  for (let r = skipHeaderRow ? 1 : 0; r < table2.rows; r++) {
20924
20968
  for (let c = 0; c < table2.cols; c++) {
20925
20969
  if (covered.has(`${r},${c}`)) continue;
20926
- const labelCell = _optionalChain([table2, 'access', _220 => _220.cells, 'access', _221 => _221[r], 'optionalAccess', _222 => _222[c]]);
20970
+ const labelCell = _optionalChain([table2, 'access', _225 => _225.cells, 'access', _226 => _226[r], 'optionalAccess', _227 => _227[c]]);
20927
20971
  if (!labelCell) continue;
20928
20972
  if (!isLabelCell(labelCell.text)) continue;
20929
20973
  let vc = c + labelCell.colSpan;
@@ -20934,12 +20978,12 @@ function fillTable(table2, values, filled, matchedLabels, patternFilledCells, bl
20934
20978
  if (isKeywordLabel(valueCell.text)) continue;
20935
20979
  const normalizedCellLabel = normalizeLabel(labelCell.text);
20936
20980
  if (!normalizedCellLabel) continue;
20937
- if (_optionalChain([blockedLabels, 'optionalAccess', _223 => _223.has, 'call', _224 => _224(normalizedCellLabel)])) continue;
20981
+ if (_optionalChain([blockedLabels, 'optionalAccess', _228 => _228.has, 'call', _229 => _229(normalizedCellLabel)])) continue;
20938
20982
  const matchKey = findMatchingKey(normalizedCellLabel, values);
20939
20983
  if (matchKey === void 0) continue;
20940
20984
  const newValue = values.consume(matchKey);
20941
20985
  if (newValue === void 0) continue;
20942
- if (_optionalChain([patternFilledCells, 'optionalAccess', _225 => _225.has, 'call', _226 => _226(valueCell)])) {
20986
+ if (_optionalChain([patternFilledCells, 'optionalAccess', _230 => _230.has, 'call', _231 => _231(valueCell)])) {
20943
20987
  valueCell.text = newValue + " " + valueCell.text;
20944
20988
  } else {
20945
20989
  valueCell.text = newValue;
@@ -20956,8 +21000,8 @@ function fillTable(table2, values, filled, matchedLabels, patternFilledCells, bl
20956
21000
  }
20957
21001
  if (table2.rows >= 2 && table2.cols >= 2) {
20958
21002
  const headerRow = table2.cells[0];
20959
- const allLabels = _nullishCoalesce(_optionalChain([headerRow, 'optionalAccess', _227 => _227.every, 'call', _228 => _228((cell2) => {
20960
- const t = _nullishCoalesce(_optionalChain([cell2, 'optionalAccess', _229 => _229.text, 'access', _230 => _230.trim, 'call', _231 => _231()]), () => ( ""));
21003
+ const allLabels = _nullishCoalesce(_optionalChain([headerRow, 'optionalAccess', _232 => _232.every, 'call', _233 => _233((cell2) => {
21004
+ const t = _nullishCoalesce(_optionalChain([cell2, 'optionalAccess', _234 => _234.text, 'access', _235 => _235.trim, 'call', _236 => _236()]), () => ( ""));
20961
21005
  return t.length > 0 && t.length <= 20 && isLabelCell(t);
20962
21006
  })]), () => ( false));
20963
21007
  if (!allLabels) return;
@@ -20965,16 +21009,16 @@ function fillTable(table2, values, filled, matchedLabels, patternFilledCells, bl
20965
21009
  for (let c = 0; c < table2.cols; c++) {
20966
21010
  if (covered.has(`${r},${c}`)) continue;
20967
21011
  const headerCell = headerRow[c];
20968
- const valueCell = _optionalChain([table2, 'access', _232 => _232.cells, 'access', _233 => _233[r], 'optionalAccess', _234 => _234[c]]);
21012
+ const valueCell = _optionalChain([table2, 'access', _237 => _237.cells, 'access', _238 => _238[r], 'optionalAccess', _239 => _239[c]]);
20969
21013
  if (!headerCell || !valueCell) continue;
20970
21014
  const headerLabel = normalizeLabel(headerCell.text);
20971
- if (_optionalChain([blockedLabels, 'optionalAccess', _235 => _235.has, 'call', _236 => _236(headerLabel)])) continue;
21015
+ if (_optionalChain([blockedLabels, 'optionalAccess', _240 => _240.has, 'call', _241 => _241(headerLabel)])) continue;
20972
21016
  const matchKey = findMatchingKey(headerLabel, values);
20973
21017
  if (matchKey === void 0) continue;
20974
21018
  if (!values.isArray(matchKey) && matchedLabels.has(matchKey)) continue;
20975
21019
  const newValue = values.consume(matchKey);
20976
21020
  if (newValue === void 0) continue;
20977
- if (_optionalChain([patternFilledCells, 'optionalAccess', _237 => _237.has, 'call', _238 => _238(valueCell)])) {
21021
+ if (_optionalChain([patternFilledCells, 'optionalAccess', _242 => _242.has, 'call', _243 => _243(valueCell)])) {
20978
21022
  valueCell.text = newValue + " " + valueCell.text;
20979
21023
  } else {
20980
21024
  valueCell.text = newValue;
@@ -21006,7 +21050,7 @@ function fillInlineFields(text, values, filled, matchedLabels, blockedLabels) {
21006
21050
  if (newValue === void 0) continue;
21007
21051
  matchedLabels.add(matchKey);
21008
21052
  filled.push({ label: matched.label.trim(), value: newValue, row: -1, col: -1, key: matchKey });
21009
- const ve = clampSegmentEnd(text, seg, segments[i + 1], _nullishCoalesce(_optionalChain([matches, 'access', _239 => _239[i + 1], 'optionalAccess', _240 => _240.viaExt]), () => ( false)));
21053
+ const ve = clampSegmentEnd(text, seg, segments[i + 1], _nullishCoalesce(_optionalChain([matches, 'access', _244 => _244[i + 1], 'optionalAccess', _245 => _245.viaExt]), () => ( false)));
21010
21054
  out += text.slice(pos, seg.valueStart);
21011
21055
  out += seg.valueStart === ve ? padInsertion(text, seg.valueStart, newValue) : newValue;
21012
21056
  pos = ve;
@@ -21568,19 +21612,19 @@ function parseCentralDirectory(buf) {
21568
21612
  }
21569
21613
  }
21570
21614
  }
21571
- if (eocdOffset < 0) throw new (0, _chunkKKZATKQWcjs.KordocError)("ZIP EOCD\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
21615
+ if (eocdOffset < 0) throw new (0, _chunkBLNOGMIMcjs.KordocError)("ZIP EOCD\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
21572
21616
  const totalEntries = view.getUint16(eocdOffset + 10, true);
21573
21617
  const cdSize = view.getUint32(eocdOffset + 12, true);
21574
21618
  const cdOffset = view.getUint32(eocdOffset + 16, true);
21575
- if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0, _chunkKKZATKQWcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
21619
+ if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0, _chunkBLNOGMIMcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
21576
21620
  if (eocdOffset >= 20 && view.getUint32(eocdOffset - 20, true) === ZIP64_EOCD_LOC_SIG) {
21577
- throw new (0, _chunkKKZATKQWcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
21621
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
21578
21622
  }
21579
21623
  const decoder = new TextDecoder("utf-8");
21580
21624
  const entries = [];
21581
21625
  let pos = cdOffset;
21582
21626
  for (let i = 0; i < totalEntries; i++) {
21583
- if (view.getUint32(pos, true) !== CD_SIG) throw new (0, _chunkKKZATKQWcjs.KordocError)("ZIP Central Directory \uC190\uC0C1");
21627
+ if (view.getUint32(pos, true) !== CD_SIG) throw new (0, _chunkBLNOGMIMcjs.KordocError)("ZIP Central Directory \uC190\uC0C1");
21584
21628
  const flags = view.getUint16(pos + 8, true);
21585
21629
  const method = view.getUint16(pos + 10, true);
21586
21630
  const crc = view.getUint32(pos + 16, true);
@@ -21591,7 +21635,7 @@ function parseCentralDirectory(buf) {
21591
21635
  const commentLen = view.getUint16(pos + 32, true);
21592
21636
  const localOffset = view.getUint32(pos + 42, true);
21593
21637
  if (compSize === 4294967295 || uncompSize === 4294967295 || localOffset === 4294967295) {
21594
- throw new (0, _chunkKKZATKQWcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
21638
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
21595
21639
  }
21596
21640
  const name = decoder.decode(buf.subarray(pos + 46, pos + 46 + nameLen));
21597
21641
  const cdEnd = pos + 46 + nameLen + extraLen + commentLen;
@@ -21620,11 +21664,11 @@ function patchZipEntries(original, replacements, additions) {
21620
21664
  const { entries, cdOffset, eocdOffset } = parseCentralDirectory(original);
21621
21665
  const view = new DataView(original.buffer, original.byteOffset, original.byteLength);
21622
21666
  for (const name of replacements.keys()) {
21623
- if (!entries.some((e) => e.name === name)) throw new (0, _chunkKKZATKQWcjs.KordocError)(`ZIP\uC5D0 \uC5C6\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
21667
+ if (!entries.some((e) => e.name === name)) throw new (0, _chunkBLNOGMIMcjs.KordocError)(`ZIP\uC5D0 \uC5C6\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
21624
21668
  }
21625
21669
  if (additions) {
21626
21670
  for (const name of additions.keys()) {
21627
- if (entries.some((e) => e.name === name)) throw new (0, _chunkKKZATKQWcjs.KordocError)(`ZIP\uC5D0 \uC774\uBBF8 \uC788\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
21671
+ if (entries.some((e) => e.name === name)) throw new (0, _chunkBLNOGMIMcjs.KordocError)(`ZIP\uC5D0 \uC774\uBBF8 \uC788\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
21628
21672
  }
21629
21673
  }
21630
21674
  const byLocal = [...entries].sort((a, b) => a.localOffset - b.localOffset);
@@ -21643,7 +21687,7 @@ function patchZipEntries(original, replacements, additions) {
21643
21687
  offset += seg.length;
21644
21688
  continue;
21645
21689
  }
21646
- if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0, _chunkKKZATKQWcjs.KordocError)("ZIP \uB85C\uCEEC \uD5E4\uB354 \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
21690
+ if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0, _chunkBLNOGMIMcjs.KordocError)("ZIP \uB85C\uCEEC \uD5E4\uB354 \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
21647
21691
  const nameLen = view.getUint16(e.localOffset + 26, true);
21648
21692
  const extraLen = view.getUint16(e.localOffset + 28, true);
21649
21693
  const headerLen = 30 + nameLen + extraLen;
@@ -21651,7 +21695,7 @@ function patchZipEntries(original, replacements, additions) {
21651
21695
  const hview = new DataView(header.buffer, header.byteOffset, header.byteLength);
21652
21696
  const method = e.method;
21653
21697
  if (method !== 0 && method !== 8) {
21654
- throw new (0, _chunkKKZATKQWcjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 ZIP \uC555\uCD95 \uBC29\uC2DD(method=${method}): ${e.name} \u2014 STORE(0)/DEFLATE(8)\uB9CC \uAD50\uCCB4 \uAC00\uB2A5`);
21698
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 ZIP \uC555\uCD95 \uBC29\uC2DD(method=${method}): ${e.name} \u2014 STORE(0)/DEFLATE(8)\uB9CC \uAD50\uCCB4 \uAC00\uB2A5`);
21655
21699
  }
21656
21700
  const compData = method === 0 ? newData : new Uint8Array(_zlib.deflateRawSync.call(void 0, newData));
21657
21701
  const crc = crc32(newData);
@@ -21752,7 +21796,7 @@ async function fillHwpx(hwpxBuffer, values, blockedLabels) {
21752
21796
  const zip = await _jszip2.default.loadAsync(hwpxBuffer);
21753
21797
  const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort();
21754
21798
  if (sectionPaths.length === 0) {
21755
- throw new (0, _chunkKKZATKQWcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
21799
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
21756
21800
  }
21757
21801
  const warnings = [];
21758
21802
  const normalizedValues = normalizeValues(values, warnings);
@@ -21836,7 +21880,7 @@ async function fillHwpx(hwpxBuffer, values, blockedLabels) {
21836
21880
  if (isKeywordLabel(cellLabelText(valueCell))) continue;
21837
21881
  const normalizedCellLabel = normalizeLabel(labelText);
21838
21882
  if (!normalizedCellLabel) continue;
21839
- if (_optionalChain([blockedLabels, 'optionalAccess', _241 => _241.has, 'call', _242 => _242(normalizedCellLabel)])) continue;
21883
+ if (_optionalChain([blockedLabels, 'optionalAccess', _246 => _246.has, 'call', _247 => _247(normalizedCellLabel)])) continue;
21840
21884
  const matchKey = findMatchingKey(normalizedCellLabel, cursor);
21841
21885
  if (matchKey === void 0) continue;
21842
21886
  if (patternApplied.has(valueCell)) {
@@ -21894,7 +21938,7 @@ async function fillHwpx(hwpxBuffer, values, blockedLabels) {
21894
21938
  const dataCells = table2.rows[rowIdx];
21895
21939
  for (let colIdx = 0; colIdx < Math.min(headerCells.length, dataCells.length); colIdx++) {
21896
21940
  const headerLabel = normalizeLabel(cellLabelText(headerCells[colIdx]));
21897
- if (_optionalChain([blockedLabels, 'optionalAccess', _243 => _243.has, 'call', _244 => _244(headerLabel)])) continue;
21941
+ if (_optionalChain([blockedLabels, 'optionalAccess', _248 => _248.has, 'call', _249 => _249(headerLabel)])) continue;
21898
21942
  const matchKey = findMatchingKey(headerLabel, cursor);
21899
21943
  if (matchKey === void 0) continue;
21900
21944
  if (!cursor.isArray(matchKey) && matchedLabels.has(matchKey)) continue;
@@ -21948,7 +21992,7 @@ async function fillHwpx(hwpxBuffer, values, blockedLabels) {
21948
21992
  }
21949
21993
  for (const para2 of [...scan.bodyParagraphs, ...scan.excludedParagraphs]) {
21950
21994
  const existing = ledger.get(para2);
21951
- if (_optionalChain([existing, 'optionalAccess', _245 => _245.fullText]) !== void 0) continue;
21995
+ if (_optionalChain([existing, 'optionalAccess', _250 => _250.fullText]) !== void 0) continue;
21952
21996
  const text = matchText(para2);
21953
21997
  const segments = scanInlineSegments(text);
21954
21998
  const matches = segments.map((seg) => matchInlineSegment(seg, cursor, blockedLabels));
@@ -21959,7 +22003,7 @@ async function fillHwpx(hwpxBuffer, values, blockedLabels) {
21959
22003
  const matchKey = matched.key;
21960
22004
  const newValue = cursor.consume(matchKey);
21961
22005
  if (newValue === void 0) continue;
21962
- const ve = clampSegmentEnd(text, seg, segments[i + 1], _nullishCoalesce(_optionalChain([matches, 'access', _246 => _246[i + 1], 'optionalAccess', _247 => _247.viaExt]), () => ( false)));
22006
+ const ve = clampSegmentEnd(text, seg, segments[i + 1], _nullishCoalesce(_optionalChain([matches, 'access', _251 => _251[i + 1], 'optionalAccess', _252 => _252.viaExt]), () => ( false)));
21963
22007
  const replacement = seg.valueStart === ve ? padInsertion(text, seg.valueStart, newValue) : newValue;
21964
22008
  const l = led(para2);
21965
22009
  l.ranges.push({ start: seg.valueStart, end: ve, replacement });
@@ -22065,16 +22109,16 @@ var PARA_LIST = 7;
22065
22109
  var DEFAULT_TEXT_COLOR = "#000000";
22066
22110
  function resolveTheme(theme) {
22067
22111
  return {
22068
- h1: _nullishCoalesce(_optionalChain([theme, 'optionalAccess', _248 => _248.headingColors, 'optionalAccess', _249 => _249[1]]), () => ( DEFAULT_TEXT_COLOR)),
22069
- h2: _nullishCoalesce(_optionalChain([theme, 'optionalAccess', _250 => _250.headingColors, 'optionalAccess', _251 => _251[2]]), () => ( DEFAULT_TEXT_COLOR)),
22070
- h3: _nullishCoalesce(_optionalChain([theme, 'optionalAccess', _252 => _252.headingColors, 'optionalAccess', _253 => _253[3]]), () => ( DEFAULT_TEXT_COLOR)),
22071
- h4: _nullishCoalesce(_nullishCoalesce(_optionalChain([theme, 'optionalAccess', _254 => _254.headingColors, 'optionalAccess', _255 => _255[4]]), () => ( _optionalChain([theme, 'optionalAccess', _256 => _256.headingColors, 'optionalAccess', _257 => _257[3]]))), () => ( DEFAULT_TEXT_COLOR)),
22072
- body: _nullishCoalesce(_optionalChain([theme, 'optionalAccess', _258 => _258.bodyColor]), () => ( DEFAULT_TEXT_COLOR)),
22073
- quote: _nullishCoalesce(_optionalChain([theme, 'optionalAccess', _259 => _259.quoteColor]), () => ( DEFAULT_TEXT_COLOR)),
22112
+ h1: _nullishCoalesce(_optionalChain([theme, 'optionalAccess', _253 => _253.headingColors, 'optionalAccess', _254 => _254[1]]), () => ( DEFAULT_TEXT_COLOR)),
22113
+ h2: _nullishCoalesce(_optionalChain([theme, 'optionalAccess', _255 => _255.headingColors, 'optionalAccess', _256 => _256[2]]), () => ( DEFAULT_TEXT_COLOR)),
22114
+ h3: _nullishCoalesce(_optionalChain([theme, 'optionalAccess', _257 => _257.headingColors, 'optionalAccess', _258 => _258[3]]), () => ( DEFAULT_TEXT_COLOR)),
22115
+ h4: _nullishCoalesce(_nullishCoalesce(_optionalChain([theme, 'optionalAccess', _259 => _259.headingColors, 'optionalAccess', _260 => _260[4]]), () => ( _optionalChain([theme, 'optionalAccess', _261 => _261.headingColors, 'optionalAccess', _262 => _262[3]]))), () => ( DEFAULT_TEXT_COLOR)),
22116
+ body: _nullishCoalesce(_optionalChain([theme, 'optionalAccess', _263 => _263.bodyColor]), () => ( DEFAULT_TEXT_COLOR)),
22117
+ quote: _nullishCoalesce(_optionalChain([theme, 'optionalAccess', _264 => _264.quoteColor]), () => ( DEFAULT_TEXT_COLOR)),
22074
22118
  /** quoteColor가 명시되었는지 — blockquote charPr 분기에 사용 (baseline 호환) */
22075
- hasQuoteOption: _optionalChain([theme, 'optionalAccess', _260 => _260.quoteColor]) !== void 0,
22076
- tableHeader: _nullishCoalesce(_nullishCoalesce(_optionalChain([theme, 'optionalAccess', _261 => _261.tableHeaderColor]), () => ( _optionalChain([theme, 'optionalAccess', _262 => _262.bodyColor]))), () => ( DEFAULT_TEXT_COLOR)),
22077
- tableHeaderBold: !!_optionalChain([theme, 'optionalAccess', _263 => _263.tableHeaderBold])
22119
+ hasQuoteOption: _optionalChain([theme, 'optionalAccess', _265 => _265.quoteColor]) !== void 0,
22120
+ tableHeader: _nullishCoalesce(_nullishCoalesce(_optionalChain([theme, 'optionalAccess', _266 => _266.tableHeaderColor]), () => ( _optionalChain([theme, 'optionalAccess', _267 => _267.bodyColor]))), () => ( DEFAULT_TEXT_COLOR)),
22121
+ tableHeaderBold: !!_optionalChain([theme, 'optionalAccess', _268 => _268.tableHeaderBold])
22078
22122
  };
22079
22123
  }
22080
22124
  function escapeXml(text) {
@@ -22489,7 +22533,7 @@ function assertSequentialIds(rows, label, startId) {
22489
22533
  const m = rows[i].match(/\bid="(\d+)"/);
22490
22534
  const got = m ? Number(m[1]) : NaN;
22491
22535
  if (got !== startId + i) {
22492
- throw new (0, _chunkKKZATKQWcjs.KordocError)(
22536
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)(
22493
22537
  `\uB0B4\uBD80 \uC624\uB958: ${label} id \uD30C\uD2F0\uC158 \uB4DC\uB9AC\uD504\uD2B8 \u2014 ${startId + i} \uC704\uCE58\uC5D0 id=${m ? m[1] : "?"} \uBC29\uCD9C. id \uC0C1\uC218(gen-ids)\uC640 \uC2E4\uC81C \uBC29\uCD9C \uC218\uAC00 \uC5B4\uAE0B\uB0AC\uB2E4 (GJ_CHAR_COUNT\uB958 \uCE74\uC6B4\uD2B8\xB7base \uC0B0\uC220 \uD655\uC778)`
22494
22538
  );
22495
22539
  }
@@ -22573,7 +22617,7 @@ function buildCharProperties(theme, gongmun, ratioVariants = [], extraCharPrXmls
22573
22617
  }
22574
22618
  const expectedBase = charVariantBase(richAssets, !!gongmun);
22575
22619
  if (rows.length !== expectedBase) {
22576
- throw new (0, _chunkKKZATKQWcjs.KordocError)(
22620
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)(
22577
22621
  `\uB0B4\uBD80 \uC624\uB958: charPr \uAE30\uBCF8 \uBE14\uB85D \uBC29\uCD9C \uC218(${rows.length}) \u2260 charVariantBase(${expectedBase}) \u2014 gen-header \uBC29\uCD9C \uD589\uACFC gen-ids \uCE74\uC6B4\uD2B8 \uC0C1\uC218\uAC00 \uC5B4\uAE0B\uB0AC\uB2E4`
22578
22622
  );
22579
22623
  }
@@ -22800,7 +22844,7 @@ function buildStyles(gongmun) {
22800
22844
  </hh:styles>`;
22801
22845
  }
22802
22846
  function generateHeaderXml(theme, gongmun, ratioVariants = [], extraBorderFills = [], extraCharPrXmls = [], listIndentVariants = [], extraFonts = []) {
22803
- const bodyFace = _nullishCoalesce(_optionalChain([gongmun, 'optionalAccess', _264 => _264.fonts, 'access', _265 => _265.body]), () => ( (_optionalChain([gongmun, 'optionalAccess', _266 => _266.bodyFont]) === "gothic" ? "\uB9D1\uC740 \uACE0\uB515" : "\uD568\uCD08\uB86C\uBC14\uD0D5")));
22847
+ const bodyFace = _nullishCoalesce(_optionalChain([gongmun, 'optionalAccess', _269 => _269.fonts, 'access', _270 => _270.body]), () => ( (_optionalChain([gongmun, 'optionalAccess', _271 => _271.bodyFont]) === "gothic" ? "\uB9D1\uC740 \uACE0\uB515" : "\uD568\uCD08\uB86C\uBC14\uD0D5")));
22804
22848
  const charPropsXml = buildCharProperties(theme, gongmun, ratioVariants, extraCharPrXmls);
22805
22849
  const paraPropsXml = buildParaProperties(gongmun, gongmun ? listIndentVariants : []);
22806
22850
  return `<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
@@ -22929,8 +22973,8 @@ function parseChartFence(text) {
22929
22973
  const spec = chartSpec(type);
22930
22974
  let finalSeries = spec.pie ? [series[0]] : series;
22931
22975
  finalSeries = finalSeries.map((s) => ({ ...s }));
22932
- const ptLen = Math.max(_nullishCoalesce(_optionalChain([cat, 'optionalAccess', _267 => _267.length]), () => ( 0)), ...finalSeries.map((s) => s.values.length));
22933
- const catFinal = Array.from({ length: ptLen }, (_, i) => _nullishCoalesce(_optionalChain([cat, 'optionalAccess', _268 => _268[i]]), () => ( `\uD56D\uBAA9 ${i + 1}`)));
22976
+ const ptLen = Math.max(_nullishCoalesce(_optionalChain([cat, 'optionalAccess', _272 => _272.length]), () => ( 0)), ...finalSeries.map((s) => s.values.length));
22977
+ const catFinal = Array.from({ length: ptLen }, (_, i) => _nullishCoalesce(_optionalChain([cat, 'optionalAccess', _273 => _273[i]]), () => ( `\uD56D\uBAA9 ${i + 1}`)));
22934
22978
  if (!spec.scatter) {
22935
22979
  finalSeries = finalSeries.map((s) => ({ ...s, values: catFinal.map((_, i) => _nullishCoalesce(s.values[i], () => ( 0))) }));
22936
22980
  }
@@ -22972,7 +23016,7 @@ function serSpPr(color, stroke) {
22972
23016
  return stroke ? `<c:spPr><a:ln w="28575" cap="flat" cmpd="sng" algn="ctr">${f}<a:prstDash val="solid"/><a:round/></a:ln></c:spPr>` : `<c:spPr>${f}</c:spPr>`;
22973
23017
  }
22974
23018
  function dPtXml(pointColors, pie) {
22975
- if (!_optionalChain([pointColors, 'optionalAccess', _269 => _269.length])) return "";
23019
+ if (!_optionalChain([pointColors, 'optionalAccess', _274 => _274.length])) return "";
22976
23020
  return pointColors.map((col, i) => {
22977
23021
  const f = chartColorFill(col);
22978
23022
  if (!f) return "";
@@ -23211,8 +23255,8 @@ function buildGaejosikCover(title, gongmun, bodyWidth = GAEJOSIK_BASE_WIDTH) {
23211
23255
  const botRow = cell({ bf: GJ_BF_BAR_DARK, col: 0, row: 2, w: g.botDarkW, h: g.botBarH, paras: barEmpty }) + cell({ bf: GJ_BF_BAR_LIGHT, col: 1, colSpan: 2, row: 2, w: g.botLightW, h: g.botBarH, paras: barEmpty });
23212
23256
  const tbl2 = table([topRow, titleRow, botRow], g.totalW, g.barH + g.titleH + g.botBarH, 3, 1, bodyWidth);
23213
23257
  const host = `<hp:p paraPrIDRef="${PARA_NORMAL}" styleIDRef="0"><hp:run charPrIDRef="${CHAR_NORMAL}">${tbl2}</hp:run></hp:p>`;
23214
- const date = _nullishCoalesce(_optionalChain([gongmun, 'access', _270 => _270.cover, 'optionalAccess', _271 => _271.date]), () => ( formatGaejosikDate(/* @__PURE__ */ new Date())));
23215
- const org = _nullishCoalesce(_optionalChain([gongmun, 'access', _272 => _272.cover, 'optionalAccess', _273 => _273.org]), () => ( ""));
23258
+ const date = _nullishCoalesce(_optionalChain([gongmun, 'access', _275 => _275.cover, 'optionalAccess', _276 => _276.date]), () => ( formatGaejosikDate(/* @__PURE__ */ new Date())));
23259
+ const org = _nullishCoalesce(_optionalChain([gongmun, 'access', _277 => _277.cover, 'optionalAccess', _278 => _278.org]), () => ( ""));
23216
23260
  const sub = (t) => `<hp:p paraPrIDRef="${GJ_PARA_COVER}" styleIDRef="0"><hp:run charPrIDRef="${GJ_CHAR_COVER_SUB}"><hp:t>${escapeXml(t)}</hp:t></hp:run></hp:p>`;
23217
23261
  const subEmpty = emptyPara(GJ_PARA_COVER, false, GJ_CHAR_COVER_SUB);
23218
23262
  return [
@@ -23468,7 +23512,7 @@ function escapeGfm(text) {
23468
23512
  }
23469
23513
  var HWP_SHAPE_ALT_TEXT_RE = /^(?:모서리가 둥근 |둥근 )?(?:사각형|직사각형|정사각형|원|타원|삼각형|이등변 삼각형|직각 삼각형|선|직선|곡선|화살표|굵은 화살표|이중 화살표|오각형|육각형|팔각형|별|[4-8]점별|십자|십자형|구름|구름형|마름모|도넛|평행사변형|사다리꼴|부채꼴|호|반원|물결|번개|하트|빗금|블록 화살표|수식|표|그림|개체|그리기\s?개체|묶음\s?개체|글상자|수식\s?개체|OLE\s?개체)\s?입니다\.?$/gm;
23470
23514
  function sanitizeText(text) {
23471
- let result = _chunkWMU2KJHFcjs.mapPuaText.call(void 0, text).replace(/[\u{F0000}-\u{FFFFD}]/gu, "").replace(HWP_SHAPE_ALT_TEXT_RE, "").replace(/ +/g, " ").trim();
23515
+ let result = _chunkSCJLAOY3cjs.mapPuaText.call(void 0, text).replace(/[\u{F0000}-\u{FFFFD}]/gu, "").replace(HWP_SHAPE_ALT_TEXT_RE, "").replace(/ +/g, " ").trim();
23472
23516
  if (result.length <= 30 && result.includes(" ")) {
23473
23517
  const tokens = result.split(" ");
23474
23518
  const koreanSingleCharCount = tokens.filter((t) => t.length === 1 && /[가-힯ㄱ-ㆎ]/.test(t)).length;
@@ -23498,7 +23542,7 @@ function replicateGfmTable(table2) {
23498
23542
  for (let r = 0; r < numRows; r++) {
23499
23543
  for (let c = 0; c < numCols; c++) {
23500
23544
  if (skip.has(`${r},${c}`)) continue;
23501
- const cell2 = _optionalChain([cells, 'access', _274 => _274[r], 'optionalAccess', _275 => _275[c]]);
23545
+ const cell2 = _optionalChain([cells, 'access', _279 => _279[r], 'optionalAccess', _280 => _280[c]]);
23502
23546
  if (!cell2) continue;
23503
23547
  display[r][c] = {
23504
23548
  text: escapeGfm(sanitizeText(cell2.text)).replace(/\|/g, "\\|").replace(/\n/g, "<br>"),
@@ -23552,7 +23596,7 @@ function unescapeGfmCell(text) {
23552
23596
  return text.replace(/<br\s*\/?>/gi, "\n").replace(/\\\|/g, "|").replace(/\\([~*_`])/g, "$1");
23553
23597
  }
23554
23598
  function replicateCellInnerHtml(cell2) {
23555
- if (_optionalChain([cell2, 'access', _276 => _276.blocks, 'optionalAccess', _277 => _277.length])) {
23599
+ if (_optionalChain([cell2, 'access', _281 => _281.blocks, 'optionalAccess', _282 => _282.length])) {
23556
23600
  return cell2.blocks.map((b) => {
23557
23601
  if (b.type === "table" && b.table) {
23558
23602
  const cap = b.table.caption ? sanitizeText(b.table.caption) : "";
@@ -23591,7 +23635,7 @@ function replicateHtmlTable(table2) {
23591
23635
  const rowCells = [];
23592
23636
  for (let c = 0; c < numCols; c++) {
23593
23637
  if (skip.has(`${r},${c}`)) continue;
23594
- const cell2 = _optionalChain([cells, 'access', _278 => _278[r], 'optionalAccess', _279 => _279[c]]);
23638
+ const cell2 = _optionalChain([cells, 'access', _283 => _283[r], 'optionalAccess', _284 => _284[c]]);
23595
23639
  if (!cell2) continue;
23596
23640
  for (let dr = 0; dr < cell2.rowSpan; dr++) {
23597
23641
  for (let dc = 0; dc < cell2.colSpan; dc++) {
@@ -23637,10 +23681,10 @@ function parseHtmlTable(raw) {
23637
23681
  }
23638
23682
  } else {
23639
23683
  if (!isClose) {
23640
- const cs = parseInt(_optionalChain([attrs, 'access', _280 => _280.match, 'call', _281 => _281(/colspan\s*=\s*["']?(\d+)/i), 'optionalAccess', _282 => _282[1]]) || "1", 10);
23641
- const rs = parseInt(_optionalChain([attrs, 'access', _283 => _283.match, 'call', _284 => _284(/rowspan\s*=\s*["']?(\d+)/i), 'optionalAccess', _285 => _285[1]]) || "1", 10);
23684
+ const cs = parseInt(_optionalChain([attrs, 'access', _285 => _285.match, 'call', _286 => _286(/colspan\s*=\s*["']?(\d+)/i), 'optionalAccess', _287 => _287[1]]) || "1", 10);
23685
+ const rs = parseInt(_optionalChain([attrs, 'access', _288 => _288.match, 'call', _289 => _289(/rowspan\s*=\s*["']?(\d+)/i), 'optionalAccess', _290 => _290[1]]) || "1", 10);
23642
23686
  cellStart = m.index + m[0].length;
23643
- cellInfo = { colSpan: clampSpan(isNaN(cs) ? 1 : cs, _chunkWMU2KJHFcjs.MAX_COLS), rowSpan: clampSpan(isNaN(rs) ? 1 : rs, _chunkWMU2KJHFcjs.MAX_ROWS) };
23687
+ cellInfo = { colSpan: clampSpan(isNaN(cs) ? 1 : cs, _chunkSCJLAOY3cjs.MAX_COLS), rowSpan: clampSpan(isNaN(rs) ? 1 : rs, _chunkSCJLAOY3cjs.MAX_ROWS) };
23644
23688
  } else if (cellStart >= 0 && cellInfo && currentRow) {
23645
23689
  currentRow.push({ inner: raw.slice(cellStart, m.index), colSpan: cellInfo.colSpan, rowSpan: cellInfo.rowSpan });
23646
23690
  cellStart = -1;
@@ -23664,7 +23708,7 @@ function htmlCellInnerToLines(inner) {
23664
23708
  hadNonText = true;
23665
23709
  work = work.replace(/<img\s(?:"[^"]*"|'[^']*'|[^>"'])*?>/gi, (tag) => {
23666
23710
  const m = /\bsrc\s*=\s*(?:"([^"]*)"|'([^']*)')/i.exec(tag);
23667
- const src = _nullishCoalesce(_optionalChain([m, 'optionalAccess', _286 => _286[1]]), () => ( _optionalChain([m, 'optionalAccess', _287 => _287[2]])));
23711
+ const src = _nullishCoalesce(_optionalChain([m, 'optionalAccess', _291 => _291[1]]), () => ( _optionalChain([m, 'optionalAccess', _292 => _292[2]])));
23668
23712
  if (src) imgSrcs.push(src);
23669
23713
  return "";
23670
23714
  });
@@ -23672,6 +23716,18 @@ function htmlCellInnerToLines(inner) {
23672
23716
  const lines = work.split(/<br\s*\/?>/gi).map((s) => s.trim()).filter((s) => s.length > 0);
23673
23717
  return { lines, hadNonText, imgSrcs };
23674
23718
  }
23719
+ function splitCellByTopLevelTables(html) {
23720
+ const tables = extractTopLevelTables(html);
23721
+ const texts = [];
23722
+ let rest = html;
23723
+ for (const t of tables) {
23724
+ const i = rest.indexOf(t);
23725
+ texts.push(rest.slice(0, i));
23726
+ rest = rest.slice(i + t.length);
23727
+ }
23728
+ texts.push(rest);
23729
+ return { texts, tables };
23730
+ }
23675
23731
  function extractTopLevelTables(html) {
23676
23732
  const result = [];
23677
23733
  let depth = 0;
@@ -23795,7 +23851,7 @@ function edgeXml(tag, d) {
23795
23851
  return d ? `<hh:${tag} type="${escapeXml(d.type)}" width="${escapeXml(d.width)}" color="${escapeXml(d.color)}"/>` : `<hh:${tag} type="NONE" width="0.1 mm" color="#000000"/>`;
23796
23852
  }
23797
23853
  function borderFillDefToXml(id, def) {
23798
- const fill = _optionalChain([def, 'access', _288 => _288.fill, 'optionalAccess', _289 => _289.faceColor]) ? `<hh:fillBrush><hh:winBrush faceColor="${escapeXml(def.fill.faceColor)}" hatchColor="#000000" alpha="0"/></hh:fillBrush>` : "";
23854
+ const fill = _optionalChain([def, 'access', _293 => _293.fill, 'optionalAccess', _294 => _294.faceColor]) ? `<hh:fillBrush><hh:winBrush faceColor="${escapeXml(def.fill.faceColor)}" hatchColor="#000000" alpha="0"/></hh:fillBrush>` : "";
23799
23855
  return ` <hh:borderFill id="${id}" threeD="0" shadow="0" centerLine="NONE" breakCellSeparateLine="0">
23800
23856
  <hh:slash type="NONE" Crooked="0" isCounter="0"/>
23801
23857
  <hh:backSlash type="NONE" Crooked="0" isCounter="0"/>
@@ -24200,11 +24256,11 @@ function estimateRowHeight(cells, widths, charHeight) {
24200
24256
  function generateTable(rows, theme, style = null, remap = null, seq = 0, images = null) {
24201
24257
  const rowCnt = rows.length;
24202
24258
  const colCnt = Math.max(...rows.map((r) => r.length), 1);
24203
- const reg = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _290 => _290.bfRegistry]), () => ( null));
24259
+ const reg = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _295 => _295.bfRegistry]), () => ( null));
24204
24260
  const totalW = style ? reg ? style.totalWidth - DATA_TABLE_INSET : style.totalWidth : 44e3;
24205
- const measureH = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _291 => _291.charHeight]), () => ( 1e3));
24261
+ const measureH = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _296 => _296.charHeight]), () => ( 1e3));
24206
24262
  const rowAnchor = normalizeRowAnchor((_nullishCoalesce(rows[0], () => ( []))).map((c) => c.replace(/!\[[^\]]*\]\([^)]*\)/g, "")));
24207
- const prof = takeProfile(remap, rowCnt, colCnt, anchorOfMarkdownCell(_nullishCoalesce(_optionalChain([rows, 'access', _292 => _292[0], 'optionalAccess', _293 => _293[0]]), () => ( ""))), seq, rowAnchor);
24263
+ const prof = takeProfile(remap, rowCnt, colCnt, anchorOfMarkdownCell(_nullishCoalesce(_optionalChain([rows, 'access', _297 => _297[0], 'optionalAccess', _298 => _298[0]]), () => ( ""))), seq, rowAnchor);
24208
24264
  const colMax = Array(colCnt).fill(0);
24209
24265
  const colMaxBody = Array(colCnt).fill(0);
24210
24266
  const colMinWord = Array(colCnt).fill(0);
@@ -24232,7 +24288,7 @@ function generateTable(rows, theme, style = null, remap = null, seq = 0, images
24232
24288
  const k = `${rowIdx},${colIdx}`;
24233
24289
  const isLabelCell2 = labelCol0 && colIdx === 0;
24234
24290
  const defaultCharPr = style ? reg && (isHeaderRow || isLabelCell2) ? style.boldCharPr : style.charPr : isHeaderRow ? headerCharPr : baseCharPr;
24235
- const cellCharPr = _nullishCoalesce(_optionalChain([prof, 'optionalAccess', _294 => _294.cellChar, 'access', _295 => _295.get, 'call', _296 => _296(k)]), () => ( defaultCharPr));
24291
+ const cellCharPr = _nullishCoalesce(_optionalChain([prof, 'optionalAccess', _299 => _299.cellChar, 'access', _300 => _300.get, 'call', _301 => _301(k)]), () => ( defaultCharPr));
24236
24292
  const centered = isHeaderRow || colCentered[colIdx];
24237
24293
  const paraPrId = style ? centered ? _nullishCoalesce(style.tblCenterParaPr, () => ( style.centerParaPr)) : reg ? _nullishCoalesce(style.tblLeftParaPr, () => ( PARA_NORMAL)) : PARA_NORMAL : PARA_NORMAL;
24238
24294
  const p = cell2.split(/<br\s*\/?>/i).map((seg) => {
@@ -24250,11 +24306,11 @@ function generateTable(rows, theme, style = null, remap = null, seq = 0, images
24250
24306
  }
24251
24307
  }
24252
24308
  }
24253
- const runs = generateRuns(seg, cellCharPr, _optionalChain([prof, 'optionalAccess', _297 => _297.cellChar, 'access', _298 => _298.has, 'call', _299 => _299(k)]) ? void 0 : mapId);
24309
+ const runs = generateRuns(seg, cellCharPr, _optionalChain([prof, 'optionalAccess', _302 => _302.cellChar, 'access', _303 => _303.has, 'call', _304 => _304(k)]) ? void 0 : mapId);
24254
24310
  const body = (runs || (picRuns ? "" : `<hp:run charPrIDRef="${cellCharPr}"><hp:t></hp:t></hp:run>`)) + picRuns;
24255
24311
  return `<hp:p paraPrIDRef="${paraPrId}" styleIDRef="0">${body}</hp:p>`;
24256
24312
  }).join("");
24257
- const bf = _nullishCoalesce(_optionalChain([prof, 'optionalAccess', _300 => _300.cellBf, 'access', _301 => _301.get, 'call', _302 => _302(k)]), () => ( (reg ? reg.get(dataCellSpec({
24313
+ const bf = _nullishCoalesce(_optionalChain([prof, 'optionalAccess', _305 => _305.cellBf, 'access', _306 => _306.get, 'call', _307 => _307(k)]), () => ( (reg ? reg.get(dataCellSpec({
24258
24314
  row: rowIdx,
24259
24315
  rowEnd: rowIdx,
24260
24316
  col: colIdx,
@@ -24264,7 +24320,7 @@ function generateTable(rows, theme, style = null, remap = null, seq = 0, images
24264
24320
  headerRows: 1,
24265
24321
  fill: isHeaderRow ? _nullishCoalesce(style.headerFill, () => ( "#E6E6E6")) : isLabelCell2 ? _nullishCoalesce(style.labelFill, () => ( "#E7E7E7")) : void 0
24266
24322
  })) : style && isHeaderRow ? style.headerBf : 2)));
24267
- const h = _nullishCoalesce(_optionalChain([prof, 'optionalAccess', _303 => _303.cellH, 'access', _304 => _304.get, 'call', _305 => _305(k)]), () => ( cellH));
24323
+ const h = _nullishCoalesce(_optionalChain([prof, 'optionalAccess', _308 => _308.cellH, 'access', _309 => _309.get, 'call', _310 => _310(k)]), () => ( cellH));
24268
24324
  return `<hp:tc name="" header="${isHeaderRow ? 1 : 0}" hasMargin="0" protect="0" editable="1" dirty="0" borderFillIDRef="${bf}"><hp:subList id="" textDirection="HORIZONTAL" lineWrap="BREAK" vertAlign="${style ? "CENTER" : "TOP"}" linkListIDRef="0" linkListNextIDRef="0" textWidth="0" textHeight="0" hasTextRef="0" hasNumRef="0">${p}</hp:subList><hp:cellAddr colAddr="${colIdx}" rowAddr="${rowIdx}"/><hp:cellSpan colSpan="1" rowSpan="1"/><hp:cellSz width="${colWidths[colIdx]}" height="${h}"/><hp:cellMargin left="141" right="141" top="141" bottom="141"/></hp:tc>`;
24269
24325
  }).join("");
24270
24326
  return `<hp:tr>${tdElements}</hp:tr>`;
@@ -24273,7 +24329,7 @@ function generateTable(rows, theme, style = null, remap = null, seq = 0, images
24273
24329
  const tblH = rowHeights.reduce((a, b) => a + b, 0);
24274
24330
  const tblInner = `<hp:sz width="${tblW}" widthRelTo="ABSOLUTE" height="${tblH}" heightRelTo="ABSOLUTE" protect="0"/><hp:pos treatAsChar="1" affectLSpacing="0" flowWithText="0" allowOverlap="0" holdAnchorAndSO="0" vertRelTo="PARA" horzRelTo="PARA" vertAlign="TOP" horzAlign="LEFT" vertOffset="0" horzOffset="0"/><hp:outMargin left="0" right="0" top="0" bottom="0"/><hp:inMargin left="510" right="510" top="141" bottom="141"/>` + trElements;
24275
24331
  const tbl2 = `<hp:tbl id="${tblId}" zOrder="0" numberingType="TABLE" pageBreak="CELL" repeatHeader="${style ? 1 : 0}" rowCnt="${rowCnt}" colCnt="${colCnt}" cellSpacing="0" borderFillIDRef="2" noShading="0">${tblInner}</hp:tbl>`;
24276
- const hostPr = reg && _optionalChain([style, 'optionalAccess', _306 => _306.rightParaPr]) !== void 0 ? style.rightParaPr : 0;
24332
+ const hostPr = reg && _optionalChain([style, 'optionalAccess', _311 => _311.rightParaPr]) !== void 0 ? style.rightParaPr : 0;
24277
24333
  return `<hp:p paraPrIDRef="${hostPr}" styleIDRef="0"><hp:run charPrIDRef="0">${tbl2}</hp:run></hp:p>`;
24278
24334
  }
24279
24335
  function layoutHtmlRows(rows) {
@@ -24284,8 +24340,8 @@ function layoutHtmlRows(rows) {
24284
24340
  let c = 0;
24285
24341
  for (const cell2 of rows[r].cells) {
24286
24342
  while (occupied.has(`${r},${c}`)) c++;
24287
- const colSpan = clampSpan(cell2.colSpan, _chunkWMU2KJHFcjs.MAX_COLS);
24288
- const rowSpan = clampSpan(cell2.rowSpan, _chunkWMU2KJHFcjs.MAX_ROWS);
24343
+ const colSpan = clampSpan(cell2.colSpan, _chunkSCJLAOY3cjs.MAX_COLS);
24344
+ const rowSpan = clampSpan(cell2.rowSpan, _chunkSCJLAOY3cjs.MAX_ROWS);
24289
24345
  placed.push({ r, c, colSpan, rowSpan, inner: cell2.inner, isHeader: rows[r].tag === "th" });
24290
24346
  for (let dr = 0; dr < rowSpan; dr++) {
24291
24347
  for (let dc = 0; dc < colSpan; dc++) occupied.add(`${r + dr},${c + dc}`);
@@ -24313,7 +24369,7 @@ function generateHtmlTableXml(rawHtml, theme, totalWidth = 44e3, style = null, r
24313
24369
  if (!rows || rows.length === 0) return null;
24314
24370
  const { placed, rowCnt, colCnt } = layoutHtmlRows(rows);
24315
24371
  if (rowCnt === 0 || colCnt === 0) return null;
24316
- const measureH = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _307 => _307.charHeight]), () => ( 1e3));
24372
+ const measureH = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _312 => _312.charHeight]), () => ( 1e3));
24317
24373
  const first = _nullishCoalesce(placed.find((p) => p.r === 0 && p.c === 0), () => ( placed[0]));
24318
24374
  const row0 = Array.from({ length: colCnt }, () => "");
24319
24375
  for (const cell2 of placed) {
@@ -24342,7 +24398,7 @@ function generateHtmlTableXml(rawHtml, theme, totalWidth = 44e3, style = null, r
24342
24398
  const tblId = nextTableId();
24343
24399
  const useHeaderStyle = !style && (theme.tableHeader !== theme.body || theme.tableHeaderBold);
24344
24400
  const spanW = (cell2) => colWidths.slice(cell2.c, cell2.c + cell2.colSpan).reduce((a, b) => a + b, 0);
24345
- const reg = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _308 => _308.bfRegistry]), () => ( null));
24401
+ const reg = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _313 => _313.bfRegistry]), () => ( null));
24346
24402
  let htmlHeaderRows = 0;
24347
24403
  while (htmlHeaderRows < rows.length && rows[htmlHeaderRows].tag === "th") htmlHeaderRows++;
24348
24404
  const tableRowHeights = Array(rowCnt).fill(cellH);
@@ -24350,39 +24406,40 @@ function generateHtmlTableXml(rawHtml, theme, totalWidth = 44e3, style = null, r
24350
24406
  const rowSpan = Math.min(cell2.rowSpan, rowCnt - cell2.r);
24351
24407
  const lines = cellLines[i];
24352
24408
  let nestedH = 0;
24353
- const nestedXmls = [];
24354
- for (const nested of extractTopLevelTables(cell2.inner)) {
24409
+ const { texts: segTexts, tables: nestedTables } = splitCellByTopLevelTables(cell2.inner);
24410
+ const nestedXmls = nestedTables.map((nested) => {
24355
24411
  const sw = spanW(cell2);
24356
24412
  const nestedW = Math.max(Math.min(Math.max(sw - 1020, 4e3), sw - 282), 500);
24357
24413
  const nestedXml = generateHtmlTableXml(nested, theme, nestedW, style ? { ...style, totalWidth: nestedW } : null);
24358
24414
  if (nestedXml) {
24359
- nestedXmls.push(nestedXml);
24360
- const szH = _optionalChain([nestedXml, 'access', _309 => _309.match, 'call', _310 => _310(/<hp:sz [^>]*height="(\d+)"/), 'optionalAccess', _311 => _311[1]]);
24415
+ const szH = _optionalChain([nestedXml, 'access', _314 => _314.match, 'call', _315 => _315(/<hp:sz [^>]*height="(\d+)"/), 'optionalAccess', _316 => _316[1]]);
24361
24416
  nestedH += (szH ? Number(szH) : (_nullishCoalesce(nested.match(/<tr[\s>]/gi), () => ( []))).length * cellH) + 300;
24362
24417
  }
24363
- }
24418
+ return nestedXml;
24419
+ });
24420
+ const segLines = segTexts.map((t) => htmlCellInnerToLines(t).lines);
24364
24421
  const usable = Math.max(spanW(cell2) - CELL_PAD, 1e3);
24365
24422
  let wrapLines = 0;
24366
24423
  for (const line of lines) wrapLines += Math.max(1, Math.ceil(measureTextWidth(unescapeHtml(line).trim(), measureH, 100) / usable));
24367
24424
  const lineH = style ? Math.round(measureH * 1.6) : 800;
24368
24425
  const contentH = Math.max(cellH * rowSpan, Math.max(wrapLines, 1) * lineH + nestedH);
24369
- const cellHeight = Math.max(_nullishCoalesce(_optionalChain([prof, 'optionalAccess', _312 => _312.cellH, 'access', _313 => _313.get, 'call', _314 => _314(`${cell2.r},${cell2.c}`)]), () => ( 0)), contentH);
24426
+ const cellHeight = Math.max(_nullishCoalesce(_optionalChain([prof, 'optionalAccess', _317 => _317.cellH, 'access', _318 => _318.get, 'call', _319 => _319(`${cell2.r},${cell2.c}`)]), () => ( 0)), contentH);
24370
24427
  const perRow = Math.ceil(cellHeight / rowSpan);
24371
24428
  for (let r = cell2.r; r < cell2.r + rowSpan; r++) tableRowHeights[r] = Math.max(tableRowHeights[r], perRow);
24372
- return { cell: cell2, rowSpan, lines, nestedXmls, imgSrcs: cellParsed[i].imgSrcs };
24429
+ return { cell: cell2, rowSpan, lines, nestedXmls, segLines, imgSrcs: cellParsed[i].imgSrcs };
24373
24430
  });
24374
- const tcXmls = meta.map(({ cell: cell2, rowSpan, lines, nestedXmls, imgSrcs }) => {
24431
+ const tcXmls = meta.map(({ cell: cell2, rowSpan, nestedXmls, segLines, imgSrcs }) => {
24375
24432
  const k = `${cell2.r},${cell2.c}`;
24376
24433
  const isHeader = cell2.isHeader;
24377
24434
  const baseCharPr = style ? style.charPr : CHAR_NORMAL;
24378
24435
  const headerCharPr = isHeader && useHeaderStyle ? CHAR_TABLE_HEADER : baseCharPr;
24379
24436
  const defaultCharPr = style && reg && isHeader ? style.boldCharPr : isHeader ? headerCharPr : baseCharPr;
24380
- const charPrId = _nullishCoalesce(_optionalChain([prof, 'optionalAccess', _315 => _315.cellChar, 'access', _316 => _316.get, 'call', _317 => _317(k)]), () => ( defaultCharPr));
24437
+ const charPrId = _nullishCoalesce(_optionalChain([prof, 'optionalAccess', _320 => _320.cellChar, 'access', _321 => _321.get, 'call', _322 => _322(k)]), () => ( defaultCharPr));
24381
24438
  const centered = isHeader || colCentered[cell2.c];
24382
24439
  const paraPrId = style ? centered ? reg ? _nullishCoalesce(style.tblCenterParaPr, () => ( style.centerParaPr)) : style.centerParaPr : reg ? _nullishCoalesce(style.tblLeftParaPr, () => ( PARA_NORMAL)) : PARA_NORMAL : PARA_NORMAL;
24383
24440
  const picUrls = images ? [...imgSrcs] : [];
24384
24441
  const paras = [];
24385
- for (const line of lines) {
24442
+ const pushTextLine = (line) => {
24386
24443
  let text = unescapeHtml(line);
24387
24444
  if (images) {
24388
24445
  const { text: rest, urls } = splitImageRefs(text);
@@ -24394,7 +24451,14 @@ function generateHtmlTableXml(rawHtml, theme, totalWidth = 44e3, style = null, r
24394
24451
  if (!images || text.trim() || picUrls.length === 0) {
24395
24452
  paras.push(`<hp:p paraPrIDRef="${paraPrId}" styleIDRef="0"><hp:run charPrIDRef="${charPrId}"><hp:t>${escapeXml(text)}</hp:t></hp:run></hp:p>`);
24396
24453
  }
24397
- }
24454
+ };
24455
+ segLines.forEach((seg, si) => {
24456
+ for (const line of seg) pushTextLine(line);
24457
+ const nestedXml = nestedXmls[si];
24458
+ if (nestedXml) {
24459
+ paras.push(`<hp:p paraPrIDRef="0" styleIDRef="0"><hp:run charPrIDRef="0">${nestedXml}</hp:run></hp:p>`);
24460
+ }
24461
+ });
24398
24462
  if (images && picUrls.length > 0) {
24399
24463
  const pics = picUrls.map((u) => {
24400
24464
  const part = images.take(u);
@@ -24404,16 +24468,13 @@ function generateHtmlTableXml(rawHtml, theme, totalWidth = 44e3, style = null, r
24404
24468
  paras.push(`<hp:p paraPrIDRef="${paraPrId}" styleIDRef="0"><hp:run charPrIDRef="${charPrId}">${pics.join("")}</hp:run></hp:p>`);
24405
24469
  }
24406
24470
  }
24407
- for (const nestedXml of nestedXmls) {
24408
- paras.push(`<hp:p paraPrIDRef="0" styleIDRef="0"><hp:run charPrIDRef="0">${nestedXml}</hp:run></hp:p>`);
24409
- }
24410
24471
  if (paras.length === 0) {
24411
24472
  paras.push(`<hp:p paraPrIDRef="${paraPrId}" styleIDRef="0"><hp:run charPrIDRef="${charPrId}"><hp:t></hp:t></hp:run></hp:p>`);
24412
24473
  }
24413
24474
  let cellHeight = 0;
24414
24475
  for (let r = cell2.r; r < cell2.r + rowSpan; r++) cellHeight += tableRowHeights[r];
24415
24476
  const rowEnd = cell2.r + rowSpan - 1;
24416
- const bf = _nullishCoalesce(_optionalChain([prof, 'optionalAccess', _318 => _318.cellBf, 'access', _319 => _319.get, 'call', _320 => _320(k)]), () => ( (reg ? reg.get(dataCellSpec({
24477
+ const bf = _nullishCoalesce(_optionalChain([prof, 'optionalAccess', _323 => _323.cellBf, 'access', _324 => _324.get, 'call', _325 => _325(k)]), () => ( (reg ? reg.get(dataCellSpec({
24417
24478
  row: cell2.r,
24418
24479
  rowEnd,
24419
24480
  col: cell2.c,
@@ -24583,7 +24644,7 @@ function buildPressHead(g, ids, bodyWidth, reg) {
24583
24644
  return [`<hp:p paraPrIDRef="${PARA_NORMAL}" styleIDRef="0"><hp:run charPrIDRef="${CHAR_NORMAL}">${table2}</hp:run></hp:p>`, blank()];
24584
24645
  }
24585
24646
  function buildPressContact(g, ids, bodyWidth, reg) {
24586
- const c = _optionalChain([g, 'access', _321 => _321.press, 'optionalAccess', _322 => _322.contact]);
24647
+ const c = _optionalChain([g, 'access', _326 => _326.press, 'optionalAccess', _327 => _327.contact]);
24587
24648
  if (!c || !c.dept && !c.manager && !c.phone) return [];
24588
24649
  const w = bodyWidth - 280;
24589
24650
  const cells = [["\uB2F4\uB2F9 \uBD80\uC11C", _nullishCoalesce(c.dept, () => ( ""))], ["\uB2F4\uB2F9\uC790", _nullishCoalesce(c.manager, () => ( ""))], ["\uC5F0\uB77D\uCC98", _nullishCoalesce(c.phone, () => ( ""))]];
@@ -24964,7 +25025,7 @@ function generateSecPr(gongmun) {
24964
25025
  }
24965
25026
  const secPr = `<hp:secPr textDirection="HORIZONTAL" spaceColumns="1134" tabStop="8000" outlineShapeIDRef="1" memoShapeIDRef="0" textVerticalWidthHead="0" masterPageCnt="0"><hp:grid lineGrid="0" charGrid="0" wonggojiFormat="0"/><hp:startNum pageStartsOn="BOTH" page="0" pic="0" tbl="0" equation="0"/><hp:visibility hideFirstHeader="0" hideFirstFooter="0" hideFirstMasterPage="0" border="SHOW_ALL" fill="SHOW_ALL" hideFirstPageNum="0" hideFirstEmptyLine="0" showLineNumber="0"/><hp:pagePr landscape="WIDELY" width="${A4_W_HU}" height="${A4_H_HU}" gutterType="LEFT_ONLY"><hp:margin header="${m.header}" footer="${m.footer}" gutter="0" left="${m.left}" right="${m.right}" top="${m.top}" bottom="${m.bottom}"/></hp:pagePr><hp:footNotePr><hp:autoNumFormat type="DIGIT" userChar="" prefixChar="" suffixChar=")" supscript="0"/><hp:noteLine length="-1" type="SOLID" width="0.12 mm" color="#000000"/><hp:noteSpacing betweenNotes="283" belowLine="567" aboveLine="850"/><hp:numbering type="CONTINUOUS" newNum="1"/><hp:placement place="EACH_COLUMN" beneathText="0"/></hp:footNotePr><hp:endNotePr><hp:autoNumFormat type="DIGIT" userChar="" prefixChar="" suffixChar=")" supscript="0"/><hp:noteLine length="14692344" type="SOLID" width="0.12 mm" color="#000000"/><hp:noteSpacing betweenNotes="0" belowLine="567" aboveLine="850"/><hp:numbering type="CONTINUOUS" newNum="1"/><hp:placement place="END_OF_DOCUMENT" beneathText="0"/></hp:endNotePr></hp:secPr>`;
24966
25027
  const colPr = `<hp:ctrl><hp:colPr id="" type="NEWSPAPER" layout="LEFT" colCount="1" sameSz="1" sameGap="0"/></hp:ctrl>`;
24967
- return secPr + colPr + (_optionalChain([gongmun, 'optionalAccess', _323 => _323.pageNumbers]) ? pageNumCtrl() : "");
25028
+ return secPr + colPr + (_optionalChain([gongmun, 'optionalAccess', _328 => _328.pageNumbers]) ? pageNumCtrl() : "");
24968
25029
  }
24969
25030
  var SectionOpener = (_class6 = class {
24970
25031
  constructor(gongmun) {;_class6.prototype.__init12.call(this);
@@ -25003,19 +25064,19 @@ function buildPreamble(blocks, ctx) {
25003
25064
  const { gongmun, dfIds, bfReg, tableStyle, richAssets, gjBodyW } = ctx;
25004
25065
  const preamble = [];
25005
25066
  let hasFrontPages = false;
25006
- if (_optionalChain([gongmun, 'optionalAccess', _324 => _324.reportInfo]) && dfIds) {
25067
+ if (_optionalChain([gongmun, 'optionalAccess', _329 => _329.reportInfo]) && dfIds) {
25007
25068
  preamble.push(buildReportInfo(gongmun, dfIds));
25008
25069
  }
25009
- if (_optionalChain([gongmun, 'optionalAccess', _325 => _325.approval]) && bfReg) {
25070
+ if (_optionalChain([gongmun, 'optionalAccess', _330 => _330.approval]) && bfReg) {
25010
25071
  preamble.push(buildApprovalTable(gongmun.approval, bfReg, richAssets ? GJ_CHAR_APPROVAL : GONGMUN_APPROVAL_CHAR));
25011
25072
  }
25012
- if (_optionalChain([gongmun, 'optionalAccess', _326 => _326.docHead]) && dfIds) {
25073
+ if (_optionalChain([gongmun, 'optionalAccess', _331 => _331.docHead]) && dfIds) {
25013
25074
  preamble.push(...buildDocHead(gongmun, dfIds));
25014
25075
  }
25015
- if (_optionalChain([gongmun, 'optionalAccess', _327 => _327.noticeHead]) && dfIds) {
25076
+ if (_optionalChain([gongmun, 'optionalAccess', _332 => _332.noticeHead]) && dfIds) {
25016
25077
  preamble.push(...buildNoticeHead(gongmun));
25017
25078
  }
25018
- if (_optionalChain([gongmun, 'optionalAccess', _328 => _328.press]) && dfIds && bfReg && tableStyle) {
25079
+ if (_optionalChain([gongmun, 'optionalAccess', _333 => _333.press]) && dfIds && bfReg && tableStyle) {
25019
25080
  preamble.push(...buildPressHead(gongmun, dfIds, tableStyle.totalWidth, bfReg));
25020
25081
  }
25021
25082
  if (gongmun && (gongmun.cover || gongmun.toc)) {
@@ -25044,7 +25105,7 @@ function buildPreamble(blocks, ctx) {
25044
25105
  }
25045
25106
  if (gongmun && !ctx.gaejosik && ctx.coverH1Idx < 0 && bfReg && (gongmun.preset === "report" || gongmun.preset === "plan" || gongmun.preset === "notice")) {
25046
25107
  ctx.titleBoxH1Idx = blocks.findIndex((b) => b.type === "heading" && (_nullishCoalesce(b.level, () => ( 1))) === 1);
25047
- } else if (_optionalChain([gongmun, 'optionalAccess', _329 => _329.press]) && ctx.coverH1Idx < 0 && dfIds) {
25108
+ } else if (_optionalChain([gongmun, 'optionalAccess', _334 => _334.press]) && ctx.coverH1Idx < 0 && dfIds) {
25048
25109
  ctx.pressH1Idx = blocks.findIndex((b) => b.type === "heading" && (_nullishCoalesce(b.level, () => ( 1))) === 1);
25049
25110
  }
25050
25111
  if (preamble.length > 0) {
@@ -25059,7 +25120,7 @@ function renderHeading(block, blockIdx, ctx) {
25059
25120
  if (gongmun && blockIdx === ctx.coverH1Idx) return "";
25060
25121
  if (gongmun && blockIdx === ctx.pressH1Idx && dfIds) {
25061
25122
  const parts = [generateParagraph((block.text || "").trim(), GONGMUN_CENTER, dfIds.pressTitle)];
25062
- for (const s of _nullishCoalesce(_optionalChain([gongmun, 'access', _330 => _330.press, 'optionalAccess', _331 => _331.sub]), () => ( []))) {
25123
+ for (const s of _nullishCoalesce(_optionalChain([gongmun, 'access', _335 => _335.press, 'optionalAccess', _336 => _336.sub]), () => ( []))) {
25063
25124
  parts.push(generateParagraph(`- ${s} -`, GONGMUN_CENTER, dfIds.pressSub));
25064
25125
  }
25065
25126
  return parts.join("\n ");
@@ -25153,8 +25214,8 @@ function renderListItem(block, blockIdx, ctx) {
25153
25214
  const { gongmun, gongmunList, measured, fit, vBase, dfIds } = ctx;
25154
25215
  if (gongmun && gongmunList) {
25155
25216
  const info = gongmunList.items.get(blockIdx);
25156
- const depth = _nullishCoalesce(_optionalChain([info, 'optionalAccess', _332 => _332.depth]), () => ( 0));
25157
- const marker2 = _nullishCoalesce(_optionalChain([info, 'optionalAccess', _333 => _333.marker]), () => ( ""));
25217
+ const depth = _nullishCoalesce(_optionalChain([info, 'optionalAccess', _337 => _337.depth]), () => ( 0));
25218
+ const marker2 = _nullishCoalesce(_optionalChain([info, 'optionalAccess', _338 => _338.marker]), () => ( ""));
25158
25219
  const content = block.text || "";
25159
25220
  if (measured && content.trimStart().startsWith("\u203B")) {
25160
25221
  return generateParagraph(content.trim(), GJ_PARA_CHAM, GJ_CHAR_CHAM, ctx.chamMap);
@@ -25163,7 +25224,7 @@ function renderListItem(block, blockIdx, ctx) {
25163
25224
  return generateParagraph(`* ${content.trim()}`, GJ_PARA_CHAM, GJ_CHAR_CHAM, ctx.chamMap);
25164
25225
  }
25165
25226
  const text = marker2 ? `${marker2} ${content}` : content;
25166
- const listParaPr = marker2 ? _optionalChain([info, 'optionalAccess', _334 => _334.indentVariant]) !== void 0 ? GONGMUN_LIST_VARIANT_BASE + info.indentVariant : GONGMUN_LIST_BASE + depth : GONGMUN_LIST_PLAIN_BASE + depth;
25227
+ const listParaPr = marker2 ? _optionalChain([info, 'optionalAccess', _339 => _339.indentVariant]) !== void 0 ? GONGMUN_LIST_VARIANT_BASE + info.indentVariant : GONGMUN_LIST_BASE + depth : GONGMUN_LIST_PLAIN_BASE + depth;
25167
25228
  let listCharPr = gongmun.numbering === "report" && depth === 0 ? CHAR_BOLD : CHAR_NORMAL;
25168
25229
  let mapId = fit ? variantMapper(fit, blockIdx, vBase) : void 0;
25169
25230
  if (measured && depth === 0 && gongmun.numbering !== "standard") {
@@ -25222,18 +25283,18 @@ function renderHtmlTable(block, ctx) {
25222
25283
  }
25223
25284
  function appendPostamble(blocks, ctx) {
25224
25285
  const { gongmun, dfIds, bfReg, tableStyle, paraXmls } = ctx;
25225
- if (_optionalChain([gongmun, 'optionalAccess', _335 => _335.noticeHead]) && dfIds) {
25286
+ if (_optionalChain([gongmun, 'optionalAccess', _340 => _340.noticeHead]) && dfIds) {
25226
25287
  paraXmls.push(...buildNoticeFoot(gongmun));
25227
25288
  }
25228
- if (_optionalChain([gongmun, 'optionalAccess', _336 => _336.endMark]) && paraXmls.length > 0) {
25229
- const lastBlock = [...blocks].reverse().find((b) => (b.text || "").trim() || b.type === "table" && _optionalChain([b, 'access', _337 => _337.rows, 'optionalAccess', _338 => _338.length]));
25289
+ if (_optionalChain([gongmun, 'optionalAccess', _341 => _341.endMark]) && paraXmls.length > 0) {
25290
+ const lastBlock = [...blocks].reverse().find((b) => (b.text || "").trim() || b.type === "table" && _optionalChain([b, 'access', _342 => _342.rows, 'optionalAccess', _343 => _343.length]));
25230
25291
  const lastText = lastBlock && (lastBlock.type === "paragraph" || lastBlock.type === "list_item") ? lastBlock.text || "" : "";
25231
25292
  if (!hasEndMark(lastText)) paraXmls.push(buildEndMark());
25232
25293
  }
25233
- if (_optionalChain([gongmun, 'optionalAccess', _339 => _339.docFoot]) && dfIds) {
25294
+ if (_optionalChain([gongmun, 'optionalAccess', _344 => _344.docFoot]) && dfIds) {
25234
25295
  paraXmls.push(...buildDocFoot(gongmun, dfIds));
25235
25296
  }
25236
- if (_optionalChain([gongmun, 'optionalAccess', _340 => _340.press]) && dfIds && bfReg && tableStyle) {
25297
+ if (_optionalChain([gongmun, 'optionalAccess', _345 => _345.press]) && dfIds && bfReg && tableStyle) {
25237
25298
  paraXmls.push(...buildPressContact(gongmun, dfIds, tableStyle.totalWidth, bfReg));
25238
25299
  }
25239
25300
  }
@@ -25253,7 +25314,7 @@ function blocksToSectionXml(blocks, theme, gongmun, gongmunList = gongmun ? prec
25253
25314
  remap,
25254
25315
  dfIds,
25255
25316
  images,
25256
- gaejosik: _optionalChain([gongmun, 'optionalAccess', _341 => _341.preset]) === "gaejosik",
25317
+ gaejosik: _optionalChain([gongmun, 'optionalAccess', _346 => _346.preset]) === "gaejosik",
25257
25318
  measured,
25258
25319
  richAssets,
25259
25320
  vBase: charVariantBase(richAssets, !!gongmun),
@@ -25359,18 +25420,18 @@ function blocksToSectionXml(blocks, theme, gongmun, gongmunList = gongmun ? prec
25359
25420
 
25360
25421
  // src/hwpx/generator.ts
25361
25422
  async function markdownToHwpx(markdown, options) {
25362
- const theme = resolveTheme(_optionalChain([options, 'optionalAccess', _342 => _342.theme]));
25363
- const gongmun = _optionalChain([options, 'optionalAccess', _343 => _343.gongmun]) ? resolveGongmun(options.gongmun) : null;
25423
+ const theme = resolveTheme(_optionalChain([options, 'optionalAccess', _347 => _347.theme]));
25424
+ const gongmun = _optionalChain([options, 'optionalAccess', _348 => _348.gongmun]) ? resolveGongmun(options.gongmun) : null;
25364
25425
  const measured = !!gongmun && usesReportFonts(gongmun.preset);
25365
25426
  const richAssets = !!gongmun && needsGaejosikAssets(gongmun);
25366
25427
  const blocks = parseMarkdownToBlocks(markdown);
25367
25428
  const gongmunList = gongmun ? precomputeGongmunList(blocks, gongmun) : null;
25368
25429
  const fit = gongmun && gongmunList ? computeGongmunFitPlan(blocks, gongmun, gongmunList) : null;
25369
25430
  const staticBfEnd = staticBorderFillNext(gongmun);
25370
- const remap = _optionalChain([options, 'optionalAccess', _344 => _344.profile]) ? buildProfileRemap(options.profile, charVariantBase(richAssets, !!gongmun) + (_nullishCoalesce(_optionalChain([fit, 'optionalAccess', _345 => _345.variants, 'optionalAccess', _346 => _346.length]), () => ( 0))) * 4, staticBfEnd, staticFontNext(gongmun)) : null;
25371
- const bfReg = gongmun ? new TableBfRegistry(staticBfEnd + (_nullishCoalesce(_optionalChain([remap, 'optionalAccess', _347 => _347.borderFillXmls, 'access', _348 => _348.length]), () => ( 0)))) : null;
25431
+ const remap = _optionalChain([options, 'optionalAccess', _349 => _349.profile]) ? buildProfileRemap(options.profile, charVariantBase(richAssets, !!gongmun) + (_nullishCoalesce(_optionalChain([fit, 'optionalAccess', _350 => _350.variants, 'optionalAccess', _351 => _351.length]), () => ( 0))) * 4, staticBfEnd, staticFontNext(gongmun)) : null;
25432
+ const bfReg = gongmun ? new TableBfRegistry(staticBfEnd + (_nullishCoalesce(_optionalChain([remap, 'optionalAccess', _352 => _352.borderFillXmls, 'access', _353 => _353.length]), () => ( 0)))) : null;
25372
25433
  const dfActive = !!gongmun && docframeActive(gongmun);
25373
- const dfBase = charVariantBase(richAssets, !!gongmun) + (_nullishCoalesce(_optionalChain([fit, 'optionalAccess', _349 => _349.variants, 'optionalAccess', _350 => _350.length]), () => ( 0))) * 4 + (_nullishCoalesce(_optionalChain([remap, 'optionalAccess', _351 => _351.charPrXmls, 'access', _352 => _352.length]), () => ( 0)));
25434
+ const dfBase = charVariantBase(richAssets, !!gongmun) + (_nullishCoalesce(_optionalChain([fit, 'optionalAccess', _354 => _354.variants, 'optionalAccess', _355 => _355.length]), () => ( 0))) * 4 + (_nullishCoalesce(_optionalChain([remap, 'optionalAccess', _356 => _356.charPrXmls, 'access', _357 => _357.length]), () => ( 0)));
25374
25435
  const dfIds = dfActive ? docframeIds(dfBase) : null;
25375
25436
  const chartParts = [];
25376
25437
  const images = new ImageRegistry();
@@ -25381,7 +25442,7 @@ async function markdownToHwpx(markdown, options) {
25381
25442
  console.warn(`[kordoc] format profile: \uD504\uB85C\uD544 \uD45C ${unused}\uAC1C\uAC00 \uBB38\uC11C \uD45C\uC640 \uB9E4\uCE6D\uB418\uC9C0 \uC54A\uC544 \uBBF8\uC801\uC6A9 (\uD589\xB7\uC5F4/\uCCAB \uC140 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58)`);
25382
25443
  }
25383
25444
  }
25384
- const extraBorderFills = [..._nullishCoalesce(_optionalChain([remap, 'optionalAccess', _353 => _353.borderFillXmls]), () => ( [])), ..._nullishCoalesce(_optionalChain([bfReg, 'optionalAccess', _354 => _354.emit, 'call', _355 => _355()]), () => ( []))];
25445
+ const extraBorderFills = [..._nullishCoalesce(_optionalChain([remap, 'optionalAccess', _358 => _358.borderFillXmls]), () => ( [])), ..._nullishCoalesce(_optionalChain([bfReg, 'optionalAccess', _359 => _359.emit, 'call', _360 => _360()]), () => ( []))];
25385
25446
  const zip = new (0, _jszip2.default)();
25386
25447
  zip.file("mimetype", "application/hwp+zip", { compression: "STORE" });
25387
25448
  zip.file("META-INF/container.xml", generateContainerXml());
@@ -25390,11 +25451,11 @@ async function markdownToHwpx(markdown, options) {
25390
25451
  zip.file("Contents/header.xml", generateHeaderXml(
25391
25452
  theme,
25392
25453
  gongmun,
25393
- _nullishCoalesce(_optionalChain([fit, 'optionalAccess', _356 => _356.variants]), () => ( [])),
25454
+ _nullishCoalesce(_optionalChain([fit, 'optionalAccess', _361 => _361.variants]), () => ( [])),
25394
25455
  extraBorderFills,
25395
- [..._nullishCoalesce(_optionalChain([remap, 'optionalAccess', _357 => _357.charPrXmls]), () => ( [])), ...dfActive ? docframeCharPrXmls(dfBase, richAssets) : []],
25396
- _nullishCoalesce(_optionalChain([gongmunList, 'optionalAccess', _358 => _358.indentVariants]), () => ( [])),
25397
- _nullishCoalesce(_optionalChain([remap, 'optionalAccess', _359 => _359.fontFaces]), () => ( []))
25456
+ [..._nullishCoalesce(_optionalChain([remap, 'optionalAccess', _362 => _362.charPrXmls]), () => ( [])), ...dfActive ? docframeCharPrXmls(dfBase, richAssets) : []],
25457
+ _nullishCoalesce(_optionalChain([gongmunList, 'optionalAccess', _363 => _363.indentVariants]), () => ( [])),
25458
+ _nullishCoalesce(_optionalChain([remap, 'optionalAccess', _364 => _364.fontFaces]), () => ( []))
25398
25459
  ));
25399
25460
  zip.file("Contents/section0.xml", sectionXml);
25400
25461
  for (const part of chartParts) zip.file(part.name, part.xml);
@@ -25445,7 +25506,7 @@ function alignBlocks(a, b) {
25445
25506
  const m = a.length, n = b.length;
25446
25507
  if (m * n > 1e7) return fallbackAlign(a, b);
25447
25508
  const lenOf = (blk) => {
25448
- const t = blk.text !== void 0 ? blk.text : blk.type === "table" && blk.table ? blk.table.cells.flat().map((c) => _nullishCoalesce(_optionalChain([c, 'optionalAccess', _360 => _360.text]), () => ( ""))).join(" ") : "";
25509
+ const t = blk.text !== void 0 ? blk.text : blk.type === "table" && blk.table ? blk.table.cells.flat().map((c) => _nullishCoalesce(_optionalChain([c, 'optionalAccess', _365 => _365.text]), () => ( ""))).join(" ") : "";
25449
25510
  return t.replace(/\s+/g, " ").trim().length;
25450
25511
  };
25451
25512
  const aLen = a.map(lenOf);
@@ -25518,8 +25579,8 @@ function blockSimilarity(a, b) {
25518
25579
  }
25519
25580
  function tableSimilarity(a, b) {
25520
25581
  const dimSim = 1 - Math.abs(a.rows * a.cols - b.rows * b.cols) / Math.max(a.rows * a.cols, b.rows * b.cols, 1);
25521
- const textsA = a.cells.flat().map((c) => _nullishCoalesce(_optionalChain([c, 'optionalAccess', _361 => _361.text]), () => ( ""))).join(" ");
25522
- const textsB = b.cells.flat().map((c) => _nullishCoalesce(_optionalChain([c, 'optionalAccess', _362 => _362.text]), () => ( ""))).join(" ");
25582
+ const textsA = a.cells.flat().map((c) => _nullishCoalesce(_optionalChain([c, 'optionalAccess', _366 => _366.text]), () => ( ""))).join(" ");
25583
+ const textsB = b.cells.flat().map((c) => _nullishCoalesce(_optionalChain([c, 'optionalAccess', _367 => _367.text]), () => ( ""))).join(" ");
25523
25584
  const contentSim = normalizedSimilarity(textsA, textsB);
25524
25585
  return dimSim * 0.3 + contentSim * 0.7;
25525
25586
  }
@@ -25530,8 +25591,8 @@ function diffTableCells(a, b) {
25530
25591
  for (let r = 0; r < maxRows; r++) {
25531
25592
  const row = [];
25532
25593
  for (let c = 0; c < maxCols; c++) {
25533
- const cellA = r < a.rows && c < a.cols ? _optionalChain([a, 'access', _363 => _363.cells, 'access', _364 => _364[r], 'optionalAccess', _365 => _365[c], 'optionalAccess', _366 => _366.text]) : void 0;
25534
- const cellB = r < b.rows && c < b.cols ? _optionalChain([b, 'access', _367 => _367.cells, 'access', _368 => _368[r], 'optionalAccess', _369 => _369[c], 'optionalAccess', _370 => _370.text]) : void 0;
25594
+ const cellA = r < a.rows && c < a.cols ? _optionalChain([a, 'access', _368 => _368.cells, 'access', _369 => _369[r], 'optionalAccess', _370 => _370[c], 'optionalAccess', _371 => _371.text]) : void 0;
25595
+ const cellB = r < b.rows && c < b.cols ? _optionalChain([b, 'access', _372 => _372.cells, 'access', _373 => _373[r], 'optionalAccess', _374 => _374[c], 'optionalAccess', _375 => _375.text]) : void 0;
25535
25596
  let type;
25536
25597
  if (cellA === void 0) type = "added";
25537
25598
  else if (cellB === void 0) type = "removed";
@@ -25697,7 +25758,7 @@ function parseRenderStyles(headXml) {
25697
25758
  const underlineEl = findChildByLocalName(el, "underline");
25698
25759
  const textColor = el.getAttribute("textColor");
25699
25760
  const fontRef = findChildByLocalName(el, "fontRef");
25700
- const fontId = _nullishCoalesce(_optionalChain([fontRef, 'optionalAccess', _371 => _371.getAttribute, 'call', _372 => _372("hangul")]), () => ( _optionalChain([fontRef, 'optionalAccess', _373 => _373.getAttribute, 'call', _374 => _374("latin")])));
25761
+ const fontId = _nullishCoalesce(_optionalChain([fontRef, 'optionalAccess', _376 => _376.getAttribute, 'call', _377 => _377("hangul")]), () => ( _optionalChain([fontRef, 'optionalAccess', _378 => _378.getAttribute, 'call', _379 => _379("latin")])));
25701
25762
  const face = fontId != null ? hangulFonts.get(fontId) : void 0;
25702
25763
  styles.charPr.set(id, {
25703
25764
  height: Number(el.getAttribute("height")) || 1e3,
@@ -25705,8 +25766,8 @@ function parseRenderStyles(headXml) {
25705
25766
  italic: findChildByLocalName(el, "italic") != null,
25706
25767
  underline: underlineEl != null && (_nullishCoalesce(underlineEl.getAttribute("type"), () => ( "NONE"))) !== "NONE",
25707
25768
  color: textColor && textColor !== "#000000" && textColor.toLowerCase() !== "none" ? textColor : void 0,
25708
- ratio: Number(_optionalChain([ratioEl, 'optionalAccess', _375 => _375.getAttribute, 'call', _376 => _376("hangul")])) || 100,
25709
- spacing: Number(_optionalChain([spacingEl, 'optionalAccess', _377 => _377.getAttribute, 'call', _378 => _378("hangul")])) || 0,
25769
+ ratio: Number(_optionalChain([ratioEl, 'optionalAccess', _380 => _380.getAttribute, 'call', _381 => _381("hangul")])) || 100,
25770
+ spacing: Number(_optionalChain([spacingEl, 'optionalAccess', _382 => _382.getAttribute, 'call', _383 => _383("hangul")])) || 0,
25710
25771
  fontFamily: face ? hwpFaceToCssStack(face) : void 0,
25711
25772
  face
25712
25773
  });
@@ -25715,7 +25776,7 @@ function parseRenderStyles(headXml) {
25715
25776
  const id = el.getAttribute("id");
25716
25777
  if (id != null) {
25717
25778
  const align = findChildByLocalName(el, "align");
25718
- styles.paraAlign.set(id, _optionalChain([align, 'optionalAccess', _379 => _379.getAttribute, 'call', _380 => _380("horizontal")]) || "JUSTIFY");
25779
+ styles.paraAlign.set(id, _optionalChain([align, 'optionalAccess', _384 => _384.getAttribute, 'call', _385 => _385("horizontal")]) || "JUSTIFY");
25719
25780
  styles.paraGeom.set(id, parseParaGeom(el));
25720
25781
  }
25721
25782
  } else if (tag === "borderFill") {
@@ -25729,7 +25790,7 @@ function parseRenderStyles(headXml) {
25729
25790
  };
25730
25791
  const fillBrush = findChildByLocalName(el, "fillBrush");
25731
25792
  const winBrush = fillBrush ? findChildByLocalName(fillBrush, "winBrush") : null;
25732
- const face = _optionalChain([winBrush, 'optionalAccess', _381 => _381.getAttribute, 'call', _382 => _382("faceColor")]);
25793
+ const face = _optionalChain([winBrush, 'optionalAccess', _386 => _386.getAttribute, 'call', _387 => _387("faceColor")]);
25733
25794
  if (face && face.toLowerCase() !== "none") bf.fill = face;
25734
25795
  styles.borderFill.set(id, bf);
25735
25796
  }
@@ -25801,7 +25862,7 @@ function collectSites(scan) {
25801
25862
  }
25802
25863
  function attrOf(openTag, name) {
25803
25864
  const m = openTag.match(new RegExp(`\\b${name}="([^"]*)"`));
25804
- return _optionalChain([m, 'optionalAccess', _383 => _383[1]]);
25865
+ return _optionalChain([m, 'optionalAccess', _388 => _388[1]]);
25805
25866
  }
25806
25867
  function paraOpenTag(xml, para2) {
25807
25868
  const end = xml.indexOf(">", para2.start);
@@ -25816,7 +25877,7 @@ function anchorRunInfo(xml, para2, anchor) {
25816
25877
  if (!tr) return null;
25817
25878
  const before = xml.slice(Math.max(0, para2.start), tr.contentStart);
25818
25879
  const runOpen = [...before.matchAll(/<([A-Za-z0-9]+):run\b[^>]*>/g)].pop();
25819
- const prefix = _nullishCoalesce(_nullishCoalesce(_optionalChain([runOpen, 'optionalAccess', _384 => _384[1]]), () => ( tr.prefix)), () => ( "hp"));
25880
+ const prefix = _nullishCoalesce(_nullishCoalesce(_optionalChain([runOpen, 'optionalAccess', _389 => _389[1]]), () => ( tr.prefix)), () => ( "hp"));
25820
25881
  const charPr2 = runOpen && attrOf(runOpen[0], "charPrIDRef") || "0";
25821
25882
  const close = xml.indexOf(`</${prefix}:run>`, tr.contentEnd);
25822
25883
  if (close === -1) return null;
@@ -25843,7 +25904,7 @@ function cellContentWidthMm(xml, cell2) {
25843
25904
  if (width === null) return null;
25844
25905
  let content = width;
25845
25906
  const win = cellAddrWindow(xml, cell2);
25846
- const mg = _optionalChain([win, 'optionalAccess', _385 => _385.match, 'call', _386 => _386(/<[A-Za-z0-9]+:cellMargin\b[^>]*>/)]);
25907
+ const mg = _optionalChain([win, 'optionalAccess', _390 => _390.match, 'call', _391 => _391(/<[A-Za-z0-9]+:cellMargin\b[^>]*>/)]);
25847
25908
  if (mg) {
25848
25909
  content -= Number(_nullishCoalesce(attrOf(mg[0], "left"), () => ( 0))) + Number(_nullishCoalesce(attrOf(mg[0], "right"), () => ( 0)));
25849
25910
  }
@@ -25877,11 +25938,11 @@ function buildFloatPicXml(itemId, sizeHu, posXHu, posYHu, ids) {
25877
25938
  return `<hp:pic xmlns:hc="http://www.hancom.co.kr/hwpml/2011/core" id="${ids.id}" zOrder="0" numberingType="PICTURE" textWrap="IN_FRONT_OF_TEXT" textFlow="BOTH_SIDES" lock="0" dropcapstyle="None" href="" groupLevel="0" instid="${ids.instid}" reverse="0"><hp:offset x="0" y="0"/><hp:orgSz width="${w}" height="${h}"/><hp:curSz width="${w}" height="${h}"/><hp:flip horizontal="0" vertical="0"/><hp:rotationInfo angle="0" centerX="${Math.round(w / 2)}" centerY="${Math.round(h / 2)}" rotateimage="1"/><hp:renderingInfo><hc:transMatrix e1="1" e2="0" e3="0" e4="0" e5="1" e6="0"/><hc:scaMatrix e1="1" e2="0" e3="0" e4="0" e5="1" e6="0"/><hc:rotMatrix e1="1" e2="0" e3="0" e4="0" e5="1" e6="0"/></hp:renderingInfo><hp:imgRect><hc:pt0 x="0" y="0"/><hc:pt1 x="${w}" y="0"/><hc:pt2 x="${w}" y="${h}"/><hc:pt3 x="0" y="${h}"/></hp:imgRect><hp:imgClip left="0" right="${w}" top="0" bottom="${h}"/><hp:inMargin left="0" right="0" top="0" bottom="0"/><hp:imgDim dimwidth="${w}" dimheight="${h}"/><hc:img binaryItemIDRef="${itemId}" bright="0" contrast="0" effect="REAL_PIC" alpha="0"/><hp:effects/><hp:sz width="${w}" widthRelTo="ABSOLUTE" height="${h}" heightRelTo="ABSOLUTE" protect="0"/><hp:pos treatAsChar="0" affectLSpacing="0" flowWithText="0" allowOverlap="1" holdAnchorAndSO="0" vertRelTo="PARA" horzRelTo="COLUMN" vertAlign="TOP" horzAlign="LEFT" vertOffset="${posYHu}" horzOffset="${posXHu}"/><hp:outMargin left="0" right="0" top="0" bottom="0"/><hp:shapeComment>kordoc seal</hp:shapeComment></hp:pic>`;
25878
25939
  }
25879
25940
  async function placeSealHwpx(hwpxBuffer, ops) {
25880
- if (ops.length === 0) throw new (0, _chunkKKZATKQWcjs.KordocError)("place_seal: \uBC30\uCE58\uD560 \uB3C4\uC7A5\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
25941
+ if (ops.length === 0) throw new (0, _chunkBLNOGMIMcjs.KordocError)("place_seal: \uBC30\uCE58\uD560 \uB3C4\uC7A5\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
25881
25942
  const u8 = new Uint8Array(hwpxBuffer);
25882
25943
  const zip = await _jszip2.default.loadAsync(hwpxBuffer);
25883
- const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort((a, b) => Number(_nullishCoalesce(_optionalChain([a, 'access', _387 => _387.match, 'call', _388 => _388(/(\d+)\.xml$/i), 'optionalAccess', _389 => _389[1]]), () => ( 0))) - Number(_nullishCoalesce(_optionalChain([b, 'access', _390 => _390.match, 'call', _391 => _391(/(\d+)\.xml$/i), 'optionalAccess', _392 => _392[1]]), () => ( 0))));
25884
- if (sectionPaths.length === 0) throw new (0, _chunkKKZATKQWcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
25944
+ const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort((a, b) => Number(_nullishCoalesce(_optionalChain([a, 'access', _392 => _392.match, 'call', _393 => _393(/(\d+)\.xml$/i), 'optionalAccess', _394 => _394[1]]), () => ( 0))) - Number(_nullishCoalesce(_optionalChain([b, 'access', _395 => _395.match, 'call', _396 => _396(/(\d+)\.xml$/i), 'optionalAccess', _397 => _397[1]]), () => ( 0))));
25945
+ if (sectionPaths.length === 0) throw new (0, _chunkBLNOGMIMcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
25885
25946
  const manifestPath = Object.keys(zip.files).find((name) => /\.hpf$/i.test(name));
25886
25947
  const headerPath = Object.keys(zip.files).find((name) => /(^|\/)header\.xml$/i.test(name));
25887
25948
  const styles = headerPath ? parseRenderStyles(await zip.file(headerPath).async("text")) : null;
@@ -25922,11 +25983,11 @@ async function placeSealHwpx(hwpxBuffer, ops) {
25922
25983
  const manifestItems = [];
25923
25984
  const placed = [];
25924
25985
  for (const op of ops) {
25925
- if (!op.anchor) throw new (0, _chunkKKZATKQWcjs.KordocError)("place_seal: anchor \uBB38\uAD6C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
25926
- if (!op.image || op.image.length === 0) throw new (0, _chunkKKZATKQWcjs.KordocError)("place_seal: \uB3C4\uC7A5 \uC774\uBBF8\uC9C0\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
25986
+ if (!op.anchor) throw new (0, _chunkBLNOGMIMcjs.KordocError)("place_seal: anchor \uBB38\uAD6C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
25987
+ if (!op.image || op.image.length === 0) throw new (0, _chunkBLNOGMIMcjs.KordocError)("place_seal: \uB3C4\uC7A5 \uC774\uBBF8\uC9C0\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
25927
25988
  const ext = (_nullishCoalesce(op.ext, () => ( "png"))).toLowerCase();
25928
- if (!MIME[ext]) throw new (0, _chunkKKZATKQWcjs.KordocError)(`place_seal: \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uC774\uBBF8\uC9C0 \uD655\uC7A5\uC790 .${ext} (png/jpg/bmp/gif)`);
25929
- if (!imageMagicMatches(op.image, ext)) throw new (0, _chunkKKZATKQWcjs.KordocError)(`place_seal: \uC774\uBBF8\uC9C0 \uB0B4\uC6A9\uC774 .${ext} \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4 (\uB9E4\uC9C1\uBC14\uC774\uD2B8 \uBD88\uC77C\uCE58)`);
25989
+ if (!MIME[ext]) throw new (0, _chunkBLNOGMIMcjs.KordocError)(`place_seal: \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uC774\uBBF8\uC9C0 \uD655\uC7A5\uC790 .${ext} (png/jpg/bmp/gif)`);
25990
+ if (!imageMagicMatches(op.image, ext)) throw new (0, _chunkBLNOGMIMcjs.KordocError)(`place_seal: \uC774\uBBF8\uC9C0 \uB0B4\uC6A9\uC774 .${ext} \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4 (\uB9E4\uC9C1\uBC14\uC774\uD2B8 \uBD88\uC77C\uCE58)`);
25930
25991
  const wantOcc = _nullishCoalesce(op.occurrence, () => ( 0));
25931
25992
  let found = null;
25932
25993
  let total = 0;
@@ -25959,7 +26020,7 @@ async function placeSealHwpx(hwpxBuffer, ops) {
25959
26020
  }
25960
26021
  }
25961
26022
  }
25962
- throw new (0, _chunkKKZATKQWcjs.KordocError)(
26023
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)(
25963
26024
  `place_seal: \uC575\uCEE4 "${op.anchor}" ${wantOcc}\uBC88\uC9F8 \uB4F1\uC7A5\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4 (\uBCF8\uBB38 \uB0B4 ${total}\uD68C \uB4F1\uC7A5 \u2014 occurrence 0..${Math.max(0, total - 1)})`
25964
26025
  );
25965
26026
  }
@@ -25967,9 +26028,9 @@ async function placeSealHwpx(hwpxBuffer, ops) {
25967
26028
  const xml = sectionXmls[si];
25968
26029
  const run = anchorRunInfo(xml, site.para, op.anchor);
25969
26030
  if (!run) {
25970
- throw new (0, _chunkKKZATKQWcjs.KordocError)(`place_seal: \uC575\uCEE4 "${op.anchor}" \uBB38\uB2E8\uC5D0\uC11C run\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4`);
26031
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)(`place_seal: \uC575\uCEE4 "${op.anchor}" \uBB38\uB2E8\uC5D0\uC11C run\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4`);
25971
26032
  }
25972
- const charPrHeight = _nullishCoalesce(_optionalChain([styles, 'optionalAccess', _393 => _393.charPr, 'access', _394 => _394.get, 'call', _395 => _395(run.charPr), 'optionalAccess', _396 => _396.height]), () => ( 1e3));
26033
+ const charPrHeight = _nullishCoalesce(_optionalChain([styles, 'optionalAccess', _398 => _398.charPr, 'access', _399 => _399.get, 'call', _400 => _400(run.charPr), 'optionalAccess', _401 => _401.height]), () => ( 1e3));
25973
26034
  const fontPt = charPrHeight / 100;
25974
26035
  const emMm = fontPt * 25.4 / 72;
25975
26036
  const lineHMm = emMm;
@@ -25978,7 +26039,7 @@ async function placeSealHwpx(hwpxBuffer, ops) {
25978
26039
  const sizeMm = op.sizeMm != null && Number.isFinite(op.sizeMm) && op.sizeMm > 0 ? op.sizeMm : Math.max(7, Math.min(18, lineHMm * 1.6));
25979
26040
  const availMm = _nullishCoalesce((site.cell ? cellContentWidthMm(xml, site.cell) : null), () => ( bodyColumnWidthMm(xml)));
25980
26041
  const paraPrId = _nullishCoalesce(attrOf(paraOpenTag(xml, site.para), "paraPrIDRef"), () => ( "0"));
25981
- const align = _optionalChain([styles, 'optionalAccess', _397 => _397.paraAlign, 'access', _398 => _398.get, 'call', _399 => _399(paraPrId)]);
26042
+ const align = _optionalChain([styles, 'optionalAccess', _402 => _402.paraAlign, 'access', _403 => _403.get, 'call', _404 => _404(paraPrId)]);
25982
26043
  let alignShiftMm = 0;
25983
26044
  if (align === "CENTER" || align === "RIGHT") {
25984
26045
  const paraWMm = measureMm(site.para.text, emMm);
@@ -26074,7 +26135,7 @@ function parseBorderFills(headerDoc) {
26074
26135
  };
26075
26136
  const fillBrush = findChildByLocalName(bf, "fillBrush");
26076
26137
  const winBrush = fillBrush ? findChildByLocalName(fillBrush, "winBrush") : null;
26077
- const face = _optionalChain([winBrush, 'optionalAccess', _400 => _400.getAttribute, 'call', _401 => _401("faceColor")]);
26138
+ const face = _optionalChain([winBrush, 'optionalAccess', _405 => _405.getAttribute, 'call', _406 => _406("faceColor")]);
26078
26139
  if (face && face !== "none") def.fill = { faceColor: face };
26079
26140
  map.set(id, def);
26080
26141
  }
@@ -26106,7 +26167,7 @@ function parseCharPrs(headerDoc, hangulFonts) {
26106
26167
  if (cp.getAttribute("italic") === "1") def.italic = true;
26107
26168
  if (findChildByLocalName(cp, "underline")) def.underline = true;
26108
26169
  const fontRef = findChildByLocalName(cp, "fontRef");
26109
- const hangul = _optionalChain([fontRef, 'optionalAccess', _402 => _402.getAttribute, 'call', _403 => _403("hangul")]);
26170
+ const hangul = _optionalChain([fontRef, 'optionalAccess', _407 => _407.getAttribute, 'call', _408 => _408("hangul")]);
26110
26171
  if (hangul) {
26111
26172
  def.fontRef_hangul = hangul;
26112
26173
  const face = hangulFonts.get(hangul);
@@ -26134,7 +26195,7 @@ function parseTable3(tbl2, tableIndex, borderFills, charPrs) {
26134
26195
  const rows = _nullishCoalesce(num(tbl2.getAttribute("rowCnt")), () => ( 0));
26135
26196
  const cols = _nullishCoalesce(num(tbl2.getAttribute("colCnt")), () => ( 0));
26136
26197
  const sz = findChildByLocalName(tbl2, "sz");
26137
- const width = _optionalChain([sz, 'optionalAccess', _404 => _404.getAttribute, 'call', _405 => _405("width")]) || void 0;
26198
+ const width = _optionalChain([sz, 'optionalAccess', _409 => _409.getAttribute, 'call', _410 => _410("width")]) || void 0;
26138
26199
  const cells = [];
26139
26200
  const usedBf = /* @__PURE__ */ new Set();
26140
26201
  const usedCp = /* @__PURE__ */ new Set();
@@ -26147,17 +26208,17 @@ function parseTable3(tbl2, tableIndex, borderFills, charPrs) {
26147
26208
  const addr = findChildByLocalName(tc2, "cellAddr");
26148
26209
  const span = findChildByLocalName(tc2, "cellSpan");
26149
26210
  const csz = findChildByLocalName(tc2, "cellSz");
26150
- const row = _nullishCoalesce(num(_optionalChain([addr, 'optionalAccess', _406 => _406.getAttribute, 'call', _407 => _407("rowAddr")])), () => ( 0));
26151
- const col = _nullishCoalesce(num(_optionalChain([addr, 'optionalAccess', _408 => _408.getAttribute, 'call', _409 => _409("colAddr")])), () => ( 0));
26211
+ const row = _nullishCoalesce(num(_optionalChain([addr, 'optionalAccess', _411 => _411.getAttribute, 'call', _412 => _412("rowAddr")])), () => ( 0));
26212
+ const col = _nullishCoalesce(num(_optionalChain([addr, 'optionalAccess', _413 => _413.getAttribute, 'call', _414 => _414("colAddr")])), () => ( 0));
26152
26213
  if (row === 0 && col === 0 && !anchorText) anchorText = directCellText(tc2);
26153
26214
  if (row === 0) row0Texts.set(col, directCellText(tc2));
26154
- const colSpan = _nullishCoalesce(num(_optionalChain([span, 'optionalAccess', _410 => _410.getAttribute, 'call', _411 => _411("colSpan")])), () => ( 1));
26155
- const rowSpan = _nullishCoalesce(num(_optionalChain([span, 'optionalAccess', _412 => _412.getAttribute, 'call', _413 => _413("rowSpan")])), () => ( 1));
26215
+ const colSpan = _nullishCoalesce(num(_optionalChain([span, 'optionalAccess', _415 => _415.getAttribute, 'call', _416 => _416("colSpan")])), () => ( 1));
26216
+ const rowSpan = _nullishCoalesce(num(_optionalChain([span, 'optionalAccess', _417 => _417.getAttribute, 'call', _418 => _418("rowSpan")])), () => ( 1));
26156
26217
  const bfId = tc2.getAttribute("borderFillIDRef") || void 0;
26157
26218
  const cpId = firstRunCharPr(tc2);
26158
26219
  const cell2 = { row, col, rowSpan, colSpan };
26159
- const w = _optionalChain([csz, 'optionalAccess', _414 => _414.getAttribute, 'call', _415 => _415("width")]);
26160
- const hh = _optionalChain([csz, 'optionalAccess', _416 => _416.getAttribute, 'call', _417 => _417("height")]);
26220
+ const w = _optionalChain([csz, 'optionalAccess', _419 => _419.getAttribute, 'call', _420 => _420("width")]);
26221
+ const hh = _optionalChain([csz, 'optionalAccess', _421 => _421.getAttribute, 'call', _422 => _422("height")]);
26161
26222
  if (w) cell2.width_hwpunit = w;
26162
26223
  if (hh) cell2.height_hwpunit = hh;
26163
26224
  if (bfId) {
@@ -26245,16 +26306,16 @@ function pick(map, keys) {
26245
26306
  return out;
26246
26307
  }
26247
26308
  async function hwpxToProfile(input) {
26248
- const buf = input instanceof ArrayBuffer ? input : _chunkKKZATKQWcjs.toArrayBuffer.call(void 0, input);
26309
+ const buf = input instanceof ArrayBuffer ? input : _chunkBLNOGMIMcjs.toArrayBuffer.call(void 0, input);
26249
26310
  const zip = await _jszip2.default.loadAsync(buf);
26250
26311
  const parser = createXmlParser();
26251
- const headerFile = _nullishCoalesce(zip.file("Contents/header.xml"), () => ( _optionalChain([zip, 'access', _418 => _418.file, 'call', _419 => _419(/[Hh]eader\.xml$/), 'optionalAccess', _420 => _420[0]])));
26312
+ const headerFile = _nullishCoalesce(zip.file("Contents/header.xml"), () => ( _optionalChain([zip, 'access', _423 => _423.file, 'call', _424 => _424(/[Hh]eader\.xml$/), 'optionalAccess', _425 => _425[0]])));
26252
26313
  let headerXml = "<root/>";
26253
26314
  if (headerFile) headerXml = await headerFile.async("text");
26254
26315
  const headerDoc = parser.parseFromString(headerXml, "text/xml");
26255
26316
  const borderFills = parseBorderFills(headerDoc);
26256
26317
  const charPrs = parseCharPrs(headerDoc, parseHangulFonts(headerDoc));
26257
- const sectionFiles = zip.file(/[Ss]ection\d+\.xml$/).sort((a, b) => (_nullishCoalesce(num(_nullishCoalesce(_optionalChain([a, 'access', _421 => _421.name, 'access', _422 => _422.match, 'call', _423 => _423(/(\d+)\.xml$/), 'optionalAccess', _424 => _424[1]]), () => ( null))), () => ( 0))) - (_nullishCoalesce(num(_nullishCoalesce(_optionalChain([b, 'access', _425 => _425.name, 'access', _426 => _426.match, 'call', _427 => _427(/(\d+)\.xml$/), 'optionalAccess', _428 => _428[1]]), () => ( null))), () => ( 0))));
26318
+ const sectionFiles = zip.file(/[Ss]ection\d+\.xml$/).sort((a, b) => (_nullishCoalesce(num(_nullishCoalesce(_optionalChain([a, 'access', _426 => _426.name, 'access', _427 => _427.match, 'call', _428 => _428(/(\d+)\.xml$/), 'optionalAccess', _429 => _429[1]]), () => ( null))), () => ( 0))) - (_nullishCoalesce(num(_nullishCoalesce(_optionalChain([b, 'access', _430 => _430.name, 'access', _431 => _431.match, 'call', _432 => _432(/(\d+)\.xml$/), 'optionalAccess', _433 => _433[1]]), () => ( null))), () => ( 0))));
26258
26319
  const tables = [];
26259
26320
  let tableIndex = 0;
26260
26321
  for (const f of sectionFiles) {
@@ -26568,7 +26629,7 @@ var ROW_OBJECT_RE = /<(?:[A-Za-z0-9_]+:)?(?:tbl|pic|equation|ole|container|shape
26568
26629
  var TAG_AT_RE = /<[A-Za-z0-9_:]+(?:"[^"]*"|'[^']*'|[^>"'])*>/y;
26569
26630
  function patchTableRows(input) {
26570
26631
  const { table: table2, scanTable, ctx, skip, origKeys, editedKeys } = input;
26571
- const xml = _optionalChain([ctx, 'access', _429 => _429.scans, 'access', _430 => _430[scanTable.sectionIndex], 'optionalAccess', _431 => _431.xml]);
26632
+ const xml = _optionalChain([ctx, 'access', _434 => _434.scans, 'access', _435 => _435[scanTable.sectionIndex], 'optionalAccess', _436 => _436.xml]);
26572
26633
  if (!xml) return skip("\uC139\uC158 XML \uB9E4\uD551 \uC2E4\uD328");
26573
26634
  const numRows = table2.rows;
26574
26635
  if (origKeys.length !== numRows) return skip("\uD45C \uD589 \uC88C\uD45C \uBD88\uC77C\uCE58 \u2014 \uD589 \uCD94\uAC00/\uC0AD\uC81C \uBBF8\uC9C0\uC6D0");
@@ -26735,7 +26796,7 @@ function buildRowFragment(xml, scanTable, template, cells, finalRow, hasExplicit
26735
26796
  const rr = scanTable.rowRanges[template];
26736
26797
  const wrapped = FRAG_OPEN + xml.slice(rr.start, rr.end) + FRAG_CLOSE;
26737
26798
  const scan = scanSectionXml(wrapped, 0);
26738
- const row = _optionalChain([scan, 'access', _432 => _432.tables, 'access', _433 => _433[0], 'optionalAccess', _434 => _434.rows, 'access', _435 => _435[0]]);
26799
+ const row = _optionalChain([scan, 'access', _437 => _437.tables, 'access', _438 => _438[0], 'optionalAccess', _439 => _439.rows, 'access', _440 => _440[0]]);
26739
26800
  if (!row || row.length !== cells.length) return null;
26740
26801
  const splices = allLinesegRemovalSplices(wrapped);
26741
26802
  for (let i = 0; i < cells.length; i++) {
@@ -26778,7 +26839,7 @@ function rowHeightOf(fragment) {
26778
26839
  }
26779
26840
  function tableSzHeightSplice(xml, scanTable, tblOpenLen, delta) {
26780
26841
  const from = scanTable.start + tblOpenLen;
26781
- const to = _nullishCoalesce(_optionalChain([scanTable, 'access', _436 => _436.rowRanges, 'access', _437 => _437[0], 'optionalAccess', _438 => _438.start]), () => ( from));
26842
+ const to = _nullishCoalesce(_optionalChain([scanTable, 'access', _441 => _441.rowRanges, 'access', _442 => _442[0], 'optionalAccess', _443 => _443.start]), () => ( from));
26782
26843
  const slice = xml.slice(from, to);
26783
26844
  const szM = slice.match(/<(?:[A-Za-z0-9_]+:)?sz\b(?:"[^"]*"|'[^']*'|[^>"'])*>/);
26784
26845
  if (!szM || szM.index === void 0) return null;
@@ -26967,9 +27028,9 @@ function patchHtmlTableRows(table2, scanTable, replica, editedRows, ctx, skip, d
26967
27028
  });
26968
27029
  }
26969
27030
  function patchNestedTables(table2, scanTable, oc, origTables, editedTables, ctx, skip, depth) {
26970
- const irCell = _optionalChain([table2, 'access', _439 => _439.cells, 'access', _440 => _440[oc.gridR], 'optionalAccess', _441 => _441[oc.gridC]]);
27031
+ const irCell = _optionalChain([table2, 'access', _444 => _444.cells, 'access', _445 => _445[oc.gridR], 'optionalAccess', _446 => _446[oc.gridC]]);
26971
27032
  const scanCell = scanTable.cellByAnchor.get(`${oc.gridR},${oc.gridC}`);
26972
- const nestedIRs = (_nullishCoalesce(_optionalChain([irCell, 'optionalAccess', _442 => _442.blocks]), () => ( []))).filter((b) => b.type === "table" && b.table).map((b) => b.table);
27033
+ const nestedIRs = (_nullishCoalesce(_optionalChain([irCell, 'optionalAccess', _447 => _447.blocks]), () => ( []))).filter((b) => b.type === "table" && b.table).map((b) => b.table);
26973
27034
  if (!scanCell || nestedIRs.length !== origTables.length || scanCell.tables.length !== origTables.length) {
26974
27035
  return skip("\uC911\uCCA9\uD45C \uC18C\uC2A4\uB9F5 \uB9E4\uD551 \uC2E4\uD328");
26975
27036
  }
@@ -27037,7 +27098,7 @@ function applyCellEdit(table2, scanTable, gridR, gridC, newLines, ctx, before, a
27037
27098
  };
27038
27099
  const cell2 = scanTable.cellByAnchor.get(`${gridR},${gridC}`);
27039
27100
  if (!cell2) return skip("\uC140 \uC88C\uD45C \uB9E4\uD551 \uC2E4\uD328 (\uBCD1\uD569 \uC601\uC5ED\uC758 \uBE48 \uCE78\uC774\uAC70\uB098 \uC88C\uD45C \uBD88\uC77C\uCE58)");
27040
- const irCell = _optionalChain([table2, 'access', _443 => _443.cells, 'access', _444 => _444[gridR], 'optionalAccess', _445 => _445[gridC]]);
27101
+ const irCell = _optionalChain([table2, 'access', _448 => _448.cells, 'access', _449 => _449[gridR], 'optionalAccess', _450 => _450[gridC]]);
27041
27102
  const scanJoined = cell2.paragraphs.map((p) => p.text).filter((t) => normForMatch(t)).join("\n");
27042
27103
  if (irCell && normForMatch(scanJoined) !== normForMatch(stripCellTokens(irCell.text))) {
27043
27104
  if (normForMatch(irCell.text) !== "" || normForMatch(scanJoined) !== "") {
@@ -27060,7 +27121,7 @@ function applyCellEdit(table2, scanTable, gridR, gridC, newLines, ctx, before, a
27060
27121
  if (newLines.length === 0) return 0;
27061
27122
  const target = cell2.paragraphs[0];
27062
27123
  if (!target) return skip("\uBE48 \uC140\uC5D0 \uBB38\uB2E8\uC774 \uC5C6\uC5B4 \uD14D\uC2A4\uD2B8 \uC0BD\uC785 \uBD88\uAC00");
27063
- const sp = buildParagraphSplices(target, newLines.join(" "), _optionalChain([ctx, 'access', _446 => _446.scans, 'access', _447 => _447[target.sectionIndex], 'optionalAccess', _448 => _448.xml]));
27124
+ const sp = buildParagraphSplices(target, newLines.join(" "), _optionalChain([ctx, 'access', _451 => _451.scans, 'access', _452 => _452[target.sectionIndex], 'optionalAccess', _453 => _453.xml]));
27064
27125
  if (sp === null) return skip("\uC140 \uBB38\uB2E8\uC5D0 \uD14D\uC2A4\uD2B8 \uB178\uB4DC\uB97C \uB9CC\uB4E4 \uC218 \uC5C6\uC74C");
27065
27126
  splices.push(...sp);
27066
27127
  sectionIndex = target.sectionIndex;
@@ -27083,7 +27144,7 @@ function applyCellEdit(table2, scanTable, gridR, gridC, newLines, ctx, before, a
27083
27144
  }
27084
27145
  for (let i = 0; i < nonEmpty.length; i++) {
27085
27146
  if (assigned[i] === nonEmpty[i].text || normForMatch(assigned[i]) === normForMatch(nonEmpty[i].text)) continue;
27086
- const sp = buildParagraphSplices(nonEmpty[i], assigned[i], _optionalChain([ctx, 'access', _449 => _449.scans, 'access', _450 => _450[nonEmpty[i].sectionIndex], 'optionalAccess', _451 => _451.xml]));
27147
+ const sp = buildParagraphSplices(nonEmpty[i], assigned[i], _optionalChain([ctx, 'access', _454 => _454.scans, 'access', _455 => _455[nonEmpty[i].sectionIndex], 'optionalAccess', _456 => _456.xml]));
27087
27148
  if (sp === null) return skip("\uC140 \uBB38\uB2E8\uC5D0 \uD14D\uC2A4\uD2B8 \uB178\uB4DC\uB97C \uB9CC\uB4E4 \uC218 \uC5C6\uC74C");
27088
27149
  splices.push(...sp);
27089
27150
  sectionIndex = nonEmpty[i].sectionIndex;
@@ -27164,7 +27225,7 @@ async function resolveSectionEntryNames(zip) {
27164
27225
  const paths = sectionPathsFromManifest(xml).filter((p) => zip.file(p) !== null);
27165
27226
  if (paths.length > 0) return paths;
27166
27227
  }
27167
- return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort(_chunkKKZATKQWcjs.compareSectionPaths);
27228
+ return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort(_chunkBLNOGMIMcjs.compareSectionPaths);
27168
27229
  }
27169
27230
  function sectionPathsFromManifest(xml) {
27170
27231
  const attr = (tag, name) => {
@@ -27174,7 +27235,7 @@ function sectionPathsFromManifest(xml) {
27174
27235
  const idToHref = /* @__PURE__ */ new Map();
27175
27236
  for (const m of xml.matchAll(/<opf:item(\s(?:"[^"]*"|'[^']*'|[^>"'])*?)\/?>/g)) {
27176
27237
  const id = attr(m[1], "id");
27177
- const href = _chunkKKZATKQWcjs.normalizeSectionHref.call(void 0, attr(m[1], "href"));
27238
+ const href = _chunkBLNOGMIMcjs.normalizeSectionHref.call(void 0, attr(m[1], "href"));
27178
27239
  if (id && href) idToHref.set(id, href);
27179
27240
  }
27180
27241
  const ordered = [];
@@ -27183,7 +27244,7 @@ function sectionPathsFromManifest(xml) {
27183
27244
  if (href) ordered.push(href);
27184
27245
  }
27185
27246
  if (ordered.length > 0) return ordered;
27186
- return Array.from(idToHref.values()).sort(_chunkKKZATKQWcjs.compareSectionPaths);
27247
+ return Array.from(idToHref.values()).sort(_chunkBLNOGMIMcjs.compareSectionPaths);
27187
27248
  }
27188
27249
 
27189
27250
  // src/roundtrip/patcher.ts
@@ -27275,7 +27336,7 @@ async function patchHwpx(original, editedMarkdown, options) {
27275
27336
  }
27276
27337
  }
27277
27338
  let verification;
27278
- if (_optionalChain([options, 'optionalAccess', _452 => _452.verify]) !== false) {
27339
+ if (_optionalChain([options, 'optionalAccess', _457 => _457.verify]) !== false) {
27279
27340
  try {
27280
27341
  const reparsed = await parseHwpxDocument(u8ToArrayBuffer(data));
27281
27342
  verification = diffUnitLists(splitMarkdownUnits(reparsed.markdown), editedUnits);
@@ -27293,17 +27354,17 @@ function buildOrigUnits(blocks) {
27293
27354
  let chunk;
27294
27355
  if (block.type === "paragraph" && block.text && /^\[별표\s*\d+/.test(sanitizeText(block.text))) {
27295
27356
  const next = blocks[i + 1];
27296
- if (_optionalChain([next, 'optionalAccess', _453 => _453.type]) === "paragraph" && next.text && /관련\)?$/.test(next.text)) consume = 2;
27297
- chunk = _chunkWMU2KJHFcjs.blocksToMarkdown.call(void 0, blocks.slice(i, i + consume));
27357
+ if (_optionalChain([next, 'optionalAccess', _458 => _458.type]) === "paragraph" && next.text && /관련\)?$/.test(next.text)) consume = 2;
27358
+ chunk = _chunkSCJLAOY3cjs.blocksToMarkdown.call(void 0, blocks.slice(i, i + consume));
27298
27359
  } else {
27299
- chunk = _chunkWMU2KJHFcjs.blocksToMarkdown.call(void 0, [block]);
27360
+ chunk = _chunkSCJLAOY3cjs.blocksToMarkdown.call(void 0, [block]);
27300
27361
  }
27301
27362
  if (chunk) {
27302
27363
  const subUnits = splitMarkdownUnits(chunk);
27303
27364
  const isFragment = consume === 2 || (block.type === "paragraph" || block.type === "heading") && subUnits.length > 1;
27304
27365
  for (let s = 0; s < subUnits.length; s++) {
27305
27366
  const u = { ...subUnits[s], blockIdx: i, fragment: isFragment || void 0 };
27306
- if (block.type === "table" && _optionalChain([block, 'access', _454 => _454.table, 'optionalAccess', _455 => _455.caption]) && s === 0 && subUnits.length > 1 && u.kind === "text" && u.raw.startsWith("**")) {
27367
+ if (block.type === "table" && _optionalChain([block, 'access', _459 => _459.table, 'optionalAccess', _460 => _460.caption]) && s === 0 && subUnits.length > 1 && u.kind === "text" && u.raw.startsWith("**")) {
27307
27368
  u.role = "caption";
27308
27369
  }
27309
27370
  units.push(u);
@@ -27414,7 +27475,7 @@ function convertParagraphToTable(block, orig, edited, ctx, skip) {
27414
27475
  const ti = ctx.tableInsert;
27415
27476
  if (!ti) return skip("\uBB38\uB2E8\u2192\uD45C \uBCC0\uD658 \uBD88\uAC00 \u2014 header \uC5D4\uD2B8\uB9AC(borderFills) \uD574\uC11D \uC2E4\uD328");
27416
27477
  const mapping = ctx.paraMap.get(orig.blockIdx);
27417
- if (!_optionalChain([mapping, 'optionalAccess', _456 => _456.para])) return skip("\uBB38\uB2E8 \uC18C\uC2A4\uB9F5 \uB9E4\uD551 \uC2E4\uD328 (\uBA38\uB9AC\uB9D0/\uAE00\uC0C1\uC790/\uCEA1\uC158 \uC601\uC5ED) \u2014 \uD45C \uBCC0\uD658 \uBD88\uAC00");
27478
+ if (!_optionalChain([mapping, 'optionalAccess', _461 => _461.para])) return skip("\uBB38\uB2E8 \uC18C\uC2A4\uB9F5 \uB9E4\uD551 \uC2E4\uD328 (\uBA38\uB9AC\uB9D0/\uAE00\uC0C1\uC790/\uCEA1\uC158 \uC601\uC5ED) \u2014 \uD45C \uBCC0\uD658 \uBD88\uAC00");
27418
27479
  const para2 = mapping.para;
27419
27480
  if (para2.kind !== "body") return skip("\uBCF8\uBB38 \uC678 \uC601\uC5ED(\uD45C \uC140/\uAE00\uC0C1\uC790) \uBB38\uB2E8\uC758 \uD45C \uBCC0\uD658\uC740 \uBBF8\uC9C0\uC6D0");
27420
27481
  const scan = ctx.scans[para2.sectionIndex];
@@ -27442,7 +27503,7 @@ function convertParagraphToTable(block, orig, edited, ctx, skip) {
27442
27503
  }
27443
27504
  function patchParagraphUnit(block, orig, edited, ctx, skip) {
27444
27505
  const mapping = ctx.paraMap.get(orig.blockIdx);
27445
- if (!_optionalChain([mapping, 'optionalAccess', _457 => _457.para])) return skip("\uBB38\uB2E8 \uC18C\uC2A4\uB9F5 \uB9E4\uD551 \uC2E4\uD328 (\uBA38\uB9AC\uB9D0/\uAE00\uC0C1\uC790/\uCEA1\uC158 \uC601\uC5ED\uC774\uAC70\uB098 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58)");
27506
+ if (!_optionalChain([mapping, 'optionalAccess', _462 => _462.para])) return skip("\uBB38\uB2E8 \uC18C\uC2A4\uB9F5 \uB9E4\uD551 \uC2E4\uD328 (\uBA38\uB9AC\uB9D0/\uAE00\uC0C1\uC790/\uCEA1\uC158 \uC601\uC5ED\uC774\uAC70\uB098 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58)");
27446
27507
  if (block.text && block.text.includes("\n")) {
27447
27508
  return skip("\uBB38\uB2E8 \uB0B4 \uAC15\uC81C \uC904\uBC14\uAFC8 \uD3EC\uD568 \u2014 \uC218\uC815 \uC2DC \uC904\uBC14\uAFC8 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0 (v1)");
27448
27509
  }
@@ -27473,7 +27534,7 @@ function patchParagraphUnit(block, orig, edited, ctx, skip) {
27473
27534
  if (sanitizeText(newPlain) !== newPlain) {
27474
27535
  return skip("\uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uD328\uCE58 \uC2DC \uC6D0\uBB38 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0");
27475
27536
  }
27476
- const splices = buildParagraphSplices(mapping.para, newPlain, _optionalChain([ctx, 'access', _458 => _458.scans, 'access', _459 => _459[mapping.para.sectionIndex], 'optionalAccess', _460 => _460.xml]));
27537
+ const splices = buildParagraphSplices(mapping.para, newPlain, _optionalChain([ctx, 'access', _463 => _463.scans, 'access', _464 => _464[mapping.para.sectionIndex], 'optionalAccess', _465 => _465.xml]));
27477
27538
  if (splices === null) return skip("\uBB38\uB2E8\uC5D0 \uD14D\uC2A4\uD2B8 \uB178\uB4DC\uB97C \uB9CC\uB4E4 \uC218 \uC5C6\uC74C");
27478
27539
  ctx.sectionSplices[mapping.para.sectionIndex].push(...splices);
27479
27540
  return 1;
@@ -27662,7 +27723,7 @@ var Surgeon = (_class7 = class {
27662
27723
  /** 디렉토리 트리에서 경로 해석 (형제 = L/R 이진 트리, 자식 = child) */
27663
27724
  findEntry(path) {
27664
27725
  const parts = path.replace(/^\//, "").split("/");
27665
- let scope = _nullishCoalesce(_optionalChain([this, 'access', _461 => _461.entries, 'access', _462 => _462[0], 'optionalAccess', _463 => _463.child]), () => ( -1));
27726
+ let scope = _nullishCoalesce(_optionalChain([this, 'access', _466 => _466.entries, 'access', _467 => _467[0], 'optionalAccess', _468 => _468.child]), () => ( -1));
27666
27727
  let current;
27667
27728
  for (const part of parts) {
27668
27729
  const search = (idx) => {
@@ -27901,8 +27962,8 @@ function serializeRecords(recs, repl, inserts) {
27901
27962
  parts.push(header, data);
27902
27963
  };
27903
27964
  for (let i = 0; i < recs.length; i++) {
27904
- for (const ins of _nullishCoalesce(_optionalChain([inserts, 'optionalAccess', _464 => _464.get, 'call', _465 => _465(i)]), () => ( []))) push(ins.tagId, ins.level, ins.data);
27905
- push(recs[i].tagId, recs[i].level, _nullishCoalesce(_optionalChain([repl, 'optionalAccess', _466 => _466.get, 'call', _467 => _467(i)]), () => ( recs[i].data)));
27965
+ for (const ins of _nullishCoalesce(_optionalChain([inserts, 'optionalAccess', _469 => _469.get, 'call', _470 => _470(i)]), () => ( []))) push(ins.tagId, ins.level, ins.data);
27966
+ push(recs[i].tagId, recs[i].level, _nullishCoalesce(_optionalChain([repl, 'optionalAccess', _471 => _471.get, 'call', _472 => _472(i)]), () => ( recs[i].data)));
27906
27967
  }
27907
27968
  return Buffer.concat(parts);
27908
27969
  }
@@ -28020,7 +28081,7 @@ async function patchHwp(original, editedMarkdown, options) {
28020
28081
  return fail(`CFB \uCEE8\uD14C\uC774\uB108 \uD30C\uC2F1 \uC2E4\uD328: ${msg(err)}`);
28021
28082
  }
28022
28083
  const fhEntry = CFB2.find(cfb, "/FileHeader");
28023
- if (!_optionalChain([fhEntry, 'optionalAccess', _468 => _468.content])) return fail("FileHeader \uC2A4\uD2B8\uB9BC\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 HWP 5.x \uD30C\uC77C\uC774 \uC544\uB2D9\uB2C8\uB2E4");
28084
+ if (!_optionalChain([fhEntry, 'optionalAccess', _473 => _473.content])) return fail("FileHeader \uC2A4\uD2B8\uB9BC\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 HWP 5.x \uD30C\uC77C\uC774 \uC544\uB2D9\uB2C8\uB2E4");
28024
28085
  let flags;
28025
28086
  try {
28026
28087
  flags = parseFileHeader(Buffer.from(fhEntry.content)).flags;
@@ -28042,7 +28103,7 @@ async function patchHwp(original, editedMarkdown, options) {
28042
28103
  const scans = [];
28043
28104
  for (let i = 0; i < sectionPaths.length; i++) {
28044
28105
  const entry = CFB2.find(cfb, sectionPaths[i]);
28045
- if (!_optionalChain([entry, 'optionalAccess', _469 => _469.content])) return fail(`\uC139\uC158 \uC2A4\uD2B8\uB9BC \uC77D\uAE30 \uC2E4\uD328: ${sectionPaths[i]}`);
28106
+ if (!_optionalChain([entry, 'optionalAccess', _474 => _474.content])) return fail(`\uC139\uC158 \uC2A4\uD2B8\uB9BC \uC77D\uAE30 \uC2E4\uD328: ${sectionPaths[i]}`);
28046
28107
  let stream;
28047
28108
  try {
28048
28109
  stream = compressed ? decompressStream(Buffer.from(entry.content)) : Buffer.from(entry.content);
@@ -28093,7 +28154,7 @@ async function patchHwp(original, editedMarkdown, options) {
28093
28154
  }
28094
28155
  }
28095
28156
  let verification;
28096
- if (_optionalChain([options, 'optionalAccess', _470 => _470.verify]) !== false) {
28157
+ if (_optionalChain([options, 'optionalAccess', _475 => _475.verify]) !== false) {
28097
28158
  try {
28098
28159
  const reparsed = parseHwp5Document(Buffer.from(data));
28099
28160
  const normBr = (u) => ({ ...u, raw: u.raw.replace(/<br\s*\/?\s*>/gi, "\n") });
@@ -28183,7 +28244,7 @@ function tableContentScore(irTable, scanTable) {
28183
28244
  for (const [key, scanCell] of scanTable.cells) {
28184
28245
  const comma = key.indexOf(",");
28185
28246
  const r = Number(key.slice(0, comma)), c = Number(key.slice(comma + 1));
28186
- const irCell = _optionalChain([irTable, 'access', _471 => _471.cells, 'access', _472 => _472[r], 'optionalAccess', _473 => _473[c]]);
28247
+ const irCell = _optionalChain([irTable, 'access', _476 => _476.cells, 'access', _477 => _477[r], 'optionalAccess', _478 => _478[c]]);
28187
28248
  if (!irCell) continue;
28188
28249
  const a = normForMatch(scanCell.paras.map((p) => p.rawText).join(" "));
28189
28250
  const b = normForMatch(stripCellTokens(irCell.text));
@@ -28219,7 +28280,7 @@ function handleModified(orig, edited, ctx) {
28219
28280
  }
28220
28281
  function patchParagraph(block, orig, edited, ctx, skip) {
28221
28282
  const mapping = ctx.paraMap.get(orig.blockIdx);
28222
- if (!_optionalChain([mapping, 'optionalAccess', _474 => _474.para])) return skip("\uBB38\uB2E8 \uC18C\uC2A4\uB9F5 \uB9E4\uD551 \uC2E4\uD328 (\uBA38\uB9AC\uB9D0/\uAE00\uC0C1\uC790/\uCEA1\uC158 \uC601\uC5ED\uC774\uAC70\uB098 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58)");
28283
+ if (!_optionalChain([mapping, 'optionalAccess', _479 => _479.para])) return skip("\uBB38\uB2E8 \uC18C\uC2A4\uB9F5 \uB9E4\uD551 \uC2E4\uD328 (\uBA38\uB9AC\uB9D0/\uAE00\uC0C1\uC790/\uCEA1\uC158 \uC601\uC5ED\uC774\uAC70\uB098 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58)");
28223
28284
  const restoreBr = (s) => s.replace(/(?:\s*<br\s*\/?\s*>\s*)+/gi, "\n");
28224
28285
  let newPlain = restoreBr(textUnitToPlain(edited.raw, block));
28225
28286
  if (block.text && block.text.includes("\n") && !newPlain.includes("\n")) {
@@ -28418,7 +28479,7 @@ function applyCellEdit5(table2, scanTable, gridR, gridC, newLines, ctx, before,
28418
28479
  };
28419
28480
  const cell2 = scanTable.cells.get(`${gridR},${gridC}`);
28420
28481
  if (!cell2) return skip("\uC140 \uC88C\uD45C \uB9E4\uD551 \uC2E4\uD328 (\uBCD1\uD569 \uC601\uC5ED\uC758 \uBE48 \uCE78\uC774\uAC70\uB098 \uC88C\uD45C \uBD88\uC77C\uCE58)");
28421
- const irCell = _optionalChain([table2, 'access', _475 => _475.cells, 'access', _476 => _476[gridR], 'optionalAccess', _477 => _477[gridC]]);
28482
+ const irCell = _optionalChain([table2, 'access', _480 => _480.cells, 'access', _481 => _481[gridR], 'optionalAccess', _482 => _482[gridC]]);
28422
28483
  const scanJoined = cell2.paras.map((p) => p.rawText).filter((t) => normForMatch(t)).join("\n");
28423
28484
  if (irCell && normForMatch(scanJoined) !== normForMatch(stripCellTokens(irCell.text))) {
28424
28485
  if (normForMatch(irCell.text) !== "" || normForMatch(scanJoined) !== "") {
@@ -28825,11 +28886,11 @@ var RULES2 = {
28825
28886
  }
28826
28887
  };
28827
28888
  function redactText(text, options) {
28828
- const maskChar = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _478 => _478.maskChar]), () => ( "\u25CF"));
28889
+ const maskChar = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _483 => _483.maskChar]), () => ( "\u25CF"));
28829
28890
  if (maskChar.length !== 1 || /[0-9A-Za-z]/.test(maskChar)) {
28830
28891
  throw new Error(`maskChar\uB294 \uC601\uC22B\uC790\uAC00 \uC544\uB2CC 1\uAE00\uC790\uC5EC\uC57C \uD568: ${JSON.stringify(maskChar)}`);
28831
28892
  }
28832
- const enabled = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _479 => _479.rules]), () => ( DEFAULT_REDACT_RULES));
28893
+ const enabled = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _484 => _484.rules]), () => ( DEFAULT_REDACT_RULES));
28833
28894
  const hits = [];
28834
28895
  if (text === "" || enabled.length === 0) return { text, hits };
28835
28896
  const occupied = [];
@@ -28884,8 +28945,8 @@ function sameBreadcrumb(a, b) {
28884
28945
  return a.length === b.length && a.every((v, i) => v === b[i]);
28885
28946
  }
28886
28947
  function blocksToChunks(blocks, options) {
28887
- const granularity = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _480 => _480.granularity]), () => ( "section"));
28888
- const includeCells = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _481 => _481.includeTableCells]), () => ( false));
28948
+ const granularity = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _485 => _485.granularity]), () => ( "section"));
28949
+ const includeCells = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _486 => _486.includeTableCells]), () => ( false));
28889
28950
  const chunks = [];
28890
28951
  const headingStack = [];
28891
28952
  const listStack = [];
@@ -28899,12 +28960,12 @@ function blocksToChunks(blocks, options) {
28899
28960
  let run = null;
28900
28961
  const flushRun = () => {
28901
28962
  if (!run) return;
28902
- push("text", run.breadcrumb, _chunkWMU2KJHFcjs.blocksToMarkdown.call(void 0, run.blocks), [run.start, run.end], run.page);
28963
+ push("text", run.breadcrumb, _chunkSCJLAOY3cjs.blocksToMarkdown.call(void 0, run.blocks), [run.start, run.end], run.page);
28903
28964
  run = null;
28904
28965
  };
28905
28966
  for (let i = 0; i < blocks.length; i++) {
28906
28967
  const block = blocks[i];
28907
- const md2 = _chunkWMU2KJHFcjs.blocksToMarkdown.call(void 0, [block]);
28968
+ const md2 = _chunkSCJLAOY3cjs.blocksToMarkdown.call(void 0, [block]);
28908
28969
  if (!md2) continue;
28909
28970
  if (block.type === "heading") {
28910
28971
  flushRun();
@@ -29020,7 +29081,7 @@ var HwpxSession = (_class8 = class _HwpxSession {
29020
29081
  const block = st.blocks[blockIndex];
29021
29082
  if (!block) return void 0;
29022
29083
  if (block.type === "paragraph" || block.type === "heading") {
29023
- const para2 = _optionalChain([st, 'access', _482 => _482.paraMap, 'access', _483 => _483.get, 'call', _484 => _484(blockIndex), 'optionalAccess', _485 => _485.para]);
29084
+ const para2 = _optionalChain([st, 'access', _487 => _487.paraMap, 'access', _488 => _488.get, 'call', _489 => _489(blockIndex), 'optionalAccess', _490 => _490.para]);
29024
29085
  if (!para2) return void 0;
29025
29086
  return { kind: "paragraph", sectionIndex: para2.sectionIndex, xmlStart: para2.start };
29026
29087
  }
@@ -29045,7 +29106,7 @@ var HwpxSession = (_class8 = class _HwpxSession {
29045
29106
  if (block.text && block.text.includes("\n")) {
29046
29107
  return { capability: "locked", reason: "\uBB38\uB2E8 \uB0B4 \uAC15\uC81C \uC904\uBC14\uAFC8 \uD3EC\uD568 \u2014 \uC218\uC815 \uC2DC \uC904\uBC14\uAFC8 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0 (v1)" };
29047
29108
  }
29048
- if (!_optionalChain([st, 'access', _486 => _486.paraMap, 'access', _487 => _487.get, 'call', _488 => _488(blockIndex), 'optionalAccess', _489 => _489.para])) {
29109
+ if (!_optionalChain([st, 'access', _491 => _491.paraMap, 'access', _492 => _492.get, 'call', _493 => _493(blockIndex), 'optionalAccess', _494 => _494.para])) {
29049
29110
  return { capability: "locked", reason: "\uBB38\uB2E8 \uC18C\uC2A4\uB9F5 \uB9E4\uD551 \uC2E4\uD328 (\uBA38\uB9AC\uB9D0/\uAE00\uC0C1\uC790/\uCEA1\uC158 \uC601\uC5ED\uC774\uAC70\uB098 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58)" };
29050
29111
  }
29051
29112
  return { capability: "text" };
@@ -29111,7 +29172,7 @@ var HwpxSession = (_class8 = class _HwpxSession {
29111
29172
  continue;
29112
29173
  }
29113
29174
  if (block.type === "table" && block.table) {
29114
- if (!_optionalChain([edit, 'access', _490 => _490.cells, 'optionalAccess', _491 => _491.length])) {
29175
+ if (!_optionalChain([edit, 'access', _495 => _495.cells, 'optionalAccess', _496 => _496.length])) {
29115
29176
  skipped.push({ reason: "\uD45C \uBE14\uB85D\uC5D0\uB294 cells \uD3B8\uC9D1\uB9CC \uC9C0\uC6D0", before: summarize(_nullishCoalesce(block.table.caption, () => ( "(\uD45C)"))) });
29116
29177
  continue;
29117
29178
  }
@@ -29131,7 +29192,7 @@ var HwpxSession = (_class8 = class _HwpxSession {
29131
29192
  skipped.push({ reason: "\uAC19\uC740 \uC140\uC5D0 \uC911\uBCF5 \uD3B8\uC9D1 \u2014 \uBA3C\uC800 \uC801\uC6A9\uB41C \uD3B8\uC9D1 \uC720\uC9C0", after: summarize(cellEdit.text) });
29132
29193
  continue;
29133
29194
  }
29134
- const irCell = _optionalChain([block, 'access', _492 => _492.table, 'access', _493 => _493.cells, 'access', _494 => _494[cellEdit.row], 'optionalAccess', _495 => _495[cellEdit.col]]);
29195
+ const irCell = _optionalChain([block, 'access', _497 => _497.table, 'access', _498 => _498.cells, 'access', _499 => _499[cellEdit.row], 'optionalAccess', _500 => _500[cellEdit.col]]);
29135
29196
  if (!irCell) {
29136
29197
  skipped.push({ reason: `\uC140 \uC88C\uD45C \uBC94\uC704 \uBC16: ${cellEdit.row},${cellEdit.col}`, after: summarize(cellEdit.text) });
29137
29198
  continue;
@@ -29187,7 +29248,7 @@ var HwpxSession = (_class8 = class _HwpxSession {
29187
29248
  }
29188
29249
  if (replacements.size === 0) {
29189
29250
  let changes2;
29190
- if (_optionalChain([options, 'optionalAccess', _496 => _496.verify]) !== false) {
29251
+ if (_optionalChain([options, 'optionalAccess', _501 => _501.verify]) !== false) {
29191
29252
  const units = splitMarkdownUnits(st.markdown);
29192
29253
  changes2 = diffUnitLists(units, units);
29193
29254
  }
@@ -29208,7 +29269,7 @@ var HwpxSession = (_class8 = class _HwpxSession {
29208
29269
  }
29209
29270
  this.state = newState;
29210
29271
  let changes;
29211
- if (_optionalChain([options, 'optionalAccess', _497 => _497.verify]) !== false) {
29272
+ if (_optionalChain([options, 'optionalAccess', _502 => _502.verify]) !== false) {
29212
29273
  changes = diffUnitLists(splitMarkdownUnits(beforeMarkdown), splitMarkdownUnits(newState.markdown));
29213
29274
  }
29214
29275
  return { success: true, data: new Uint8Array(data), applied, skipped, changes };
@@ -29228,7 +29289,7 @@ var HwpxSession = (_class8 = class _HwpxSession {
29228
29289
  return skip("\uBB38\uB2E8 \uB0B4 \uAC15\uC81C \uC904\uBC14\uAFC8 \uD3EC\uD568 \u2014 \uC218\uC815 \uC2DC \uC904\uBC14\uAFC8 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0 (v1)");
29229
29290
  }
29230
29291
  const mapping = st.paraMap.get(blockIndex);
29231
- if (!_optionalChain([mapping, 'optionalAccess', _498 => _498.para])) {
29292
+ if (!_optionalChain([mapping, 'optionalAccess', _503 => _503.para])) {
29232
29293
  return skip("\uBB38\uB2E8 \uC18C\uC2A4\uB9F5 \uB9E4\uD551 \uC2E4\uD328 (\uBA38\uB9AC\uB9D0/\uAE00\uC0C1\uC790/\uCEA1\uC158 \uC601\uC5ED\uC774\uAC70\uB098 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58)");
29233
29294
  }
29234
29295
  let newPlain = newTextRaw.split("\n").map((l) => l.trim()).filter(Boolean).join(" ");
@@ -29248,14 +29309,14 @@ var HwpxSession = (_class8 = class _HwpxSession {
29248
29309
  if (sanitizeText(newPlain) !== newPlain) {
29249
29310
  return skip("\uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uD328\uCE58 \uC2DC \uC6D0\uBB38 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0");
29250
29311
  }
29251
- const splices = buildParagraphSplices(mapping.para, newPlain, _optionalChain([st, 'access', _499 => _499.scans, 'access', _500 => _500[mapping.para.sectionIndex], 'optionalAccess', _501 => _501.xml]));
29312
+ const splices = buildParagraphSplices(mapping.para, newPlain, _optionalChain([st, 'access', _504 => _504.scans, 'access', _505 => _505[mapping.para.sectionIndex], 'optionalAccess', _506 => _506.xml]));
29252
29313
  if (splices === null) return skip("\uBB38\uB2E8\uC5D0 \uD14D\uC2A4\uD2B8 \uB178\uB4DC\uB97C \uB9CC\uB4E4 \uC218 \uC5C6\uC74C");
29253
29314
  sectionSplices[mapping.para.sectionIndex].push(...splices);
29254
29315
  return 1;
29255
29316
  }
29256
29317
  }, _class8);
29257
29318
  function cellStaticCheck(table2, scanTable, r, c) {
29258
- const irCell = _optionalChain([table2, 'access', _502 => _502.cells, 'access', _503 => _503[r], 'optionalAccess', _504 => _504[c]]);
29319
+ const irCell = _optionalChain([table2, 'access', _507 => _507.cells, 'access', _508 => _508[r], 'optionalAccess', _509 => _509[c]]);
29259
29320
  if (!irCell) return { editable: false, reason: "\uC140 \uC88C\uD45C \uBC94\uC704 \uBC16" };
29260
29321
  const cell2 = scanTable.cellByAnchor.get(`${r},${c}`);
29261
29322
  if (!cell2) return { editable: false, reason: "\uBCD1\uD569 \uC601\uC5ED\uC758 \uBE48 \uCE78\uC774\uAC70\uB098 \uC88C\uD45C \uBD88\uC77C\uCE58" };
@@ -29339,11 +29400,11 @@ var md = new (0, _markdownit2.default)({
29339
29400
  breaks: false
29340
29401
  });
29341
29402
  function renderHtml(markdown, options) {
29342
- const preset = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _505 => _505.preset]), () => ( "default"));
29343
- const css = PRESETS[preset] + (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _506 => _506.extraCss]), () => ( "")));
29403
+ const preset = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _510 => _510.preset]), () => ( "default"));
29404
+ const css = PRESETS[preset] + (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _511 => _511.extraCss]), () => ( "")));
29344
29405
  const body = md.render(markdown);
29345
- const watermark = _optionalChain([options, 'optionalAccess', _507 => _507.watermark]) ? `<div class="watermark">${escapeHtml(options.watermark)}</div>` : "";
29346
- const watermarkCss = _optionalChain([options, 'optionalAccess', _508 => _508.watermark]) ? `
29406
+ const watermark = _optionalChain([options, 'optionalAccess', _512 => _512.watermark]) ? `<div class="watermark">${escapeHtml(options.watermark)}</div>` : "";
29407
+ const watermarkCss = _optionalChain([options, 'optionalAccess', _513 => _513.watermark]) ? `
29347
29408
  .watermark {
29348
29409
  position: fixed;
29349
29410
  top: 50%; left: 50%;
@@ -29374,13 +29435,13 @@ async function htmlToPdf(html, options) {
29374
29435
  try {
29375
29436
  puppeteer = await Promise.resolve().then(() => _interopRequireWildcard(require("puppeteer-core")));
29376
29437
  } catch (e32) {
29377
- throw new (0, _chunkKKZATKQWcjs.KordocError)(
29438
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)(
29378
29439
  "PDF \uC0DD\uC131\uC5D0 puppeteer-core\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. \uC124\uCE58: npm install puppeteer-core"
29379
29440
  );
29380
29441
  }
29381
29442
  const executablePath = _nullishCoalesce(process.env.PUPPETEER_EXECUTABLE_PATH, () => ( findChromiumPath()));
29382
29443
  if (!executablePath) {
29383
- throw new (0, _chunkKKZATKQWcjs.KordocError)(
29444
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)(
29384
29445
  "Chromium \uC2E4\uD589 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. PUPPETEER_EXECUTABLE_PATH \uD658\uACBD\uBCC0\uC218\uB97C \uC124\uC815\uD558\uC138\uC694."
29385
29446
  );
29386
29447
  }
@@ -29392,10 +29453,10 @@ async function htmlToPdf(html, options) {
29392
29453
  try {
29393
29454
  const page = await browser.newPage();
29394
29455
  await page.setContent(html, { waitUntil: "networkidle0" });
29395
- const margin = _optionalChain([options, 'optionalAccess', _509 => _509.margin]);
29456
+ const margin = _optionalChain([options, 'optionalAccess', _514 => _514.margin]);
29396
29457
  const pdf = await page.pdf({
29397
- format: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _510 => _510.pageSize]), () => ( "A4")),
29398
- landscape: _optionalChain([options, 'optionalAccess', _511 => _511.orientation]) === "landscape",
29458
+ format: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _515 => _515.pageSize]), () => ( "A4")),
29459
+ landscape: _optionalChain([options, 'optionalAccess', _516 => _516.orientation]) === "landscape",
29399
29460
  printBackground: true,
29400
29461
  margin: margin ? {
29401
29462
  top: toCss(margin.top),
@@ -29403,9 +29464,9 @@ async function htmlToPdf(html, options) {
29403
29464
  bottom: toCss(margin.bottom),
29404
29465
  left: toCss(margin.left)
29405
29466
  } : void 0,
29406
- displayHeaderFooter: !!(_optionalChain([options, 'optionalAccess', _512 => _512.header]) || _optionalChain([options, 'optionalAccess', _513 => _513.footer])),
29407
- headerTemplate: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _514 => _514.header]), () => ( "<div></div>")),
29408
- footerTemplate: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _515 => _515.footer]), () => ( '<div style="font-size:8pt;width:100%;text-align:center;color:#777;"><span class="pageNumber"></span>/<span class="totalPages"></span></div>'))
29467
+ displayHeaderFooter: !!(_optionalChain([options, 'optionalAccess', _517 => _517.header]) || _optionalChain([options, 'optionalAccess', _518 => _518.footer])),
29468
+ headerTemplate: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _519 => _519.header]), () => ( "<div></div>")),
29469
+ footerTemplate: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _520 => _520.footer]), () => ( '<div style="font-size:8pt;width:100%;text-align:center;color:#777;"><span class="pageNumber"></span>/<span class="totalPages"></span></div>'))
29409
29470
  });
29410
29471
  return Buffer.from(pdf);
29411
29472
  } finally {
@@ -29439,7 +29500,7 @@ async function markdownToPdf(markdown, options) {
29439
29500
  return htmlToPdf(html, options);
29440
29501
  }
29441
29502
  async function blocksToPdf(blocks, options) {
29442
- const markdown = _chunkWMU2KJHFcjs.blocksToMarkdown.call(void 0, blocks);
29503
+ const markdown = _chunkSCJLAOY3cjs.blocksToMarkdown.call(void 0, blocks);
29443
29504
  return markdownToPdf(markdown, options);
29444
29505
  }
29445
29506
 
@@ -29618,7 +29679,7 @@ function reflowPara(p, doc, styles, areaW, startV, mode) {
29618
29679
  }
29619
29680
  const wrapAttr = _nullishCoalesce(o.el.getAttribute("textWrap"), () => ( ""));
29620
29681
  if (wrapAttr === "BEHIND_TEXT" || wrapAttr === "IN_FRONT_OF_TEXT") continue;
29621
- const vertRel = _nullishCoalesce(_optionalChain([pos, 'optionalAccess', _516 => _516.getAttribute, 'call', _517 => _517("vertRelTo")]), () => ( "PARA"));
29682
+ const vertRel = _nullishCoalesce(_optionalChain([pos, 'optionalAccess', _521 => _521.getAttribute, 'call', _522 => _522("vertRelTo")]), () => ( "PARA"));
29622
29683
  if (vertRel === "PAGE" || vertRel === "PAPER") continue;
29623
29684
  const vo = Math.max(0, num2(pos, "vertOffset"));
29624
29685
  if (wrapAttr === "TOP_AND_BOTTOM") {
@@ -29679,7 +29740,7 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
29679
29740
  if (ln(p) !== "p") continue;
29680
29741
  reflowTablesIn(p, doc, styles, mode, counter);
29681
29742
  const g = styles.paraGeom.get(_nullishCoalesce(p.getAttribute("paraPrIDRef"), () => ( "")));
29682
- const startV = cursorV + prevSpaceAfter + (_nullishCoalesce(_optionalChain([g, 'optionalAccess', _518 => _518.spaceBefore]), () => ( 0)));
29743
+ const startV = cursorV + prevSpaceAfter + (_nullishCoalesce(_optionalChain([g, 'optionalAccess', _523 => _523.spaceBefore]), () => ( 0)));
29683
29744
  const res = reflowPara(p, doc, styles, areaW, startV, mode);
29684
29745
  if (!res) {
29685
29746
  const lsa = findChildByLocalName(p, "linesegarray");
@@ -29692,7 +29753,7 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
29692
29753
  }
29693
29754
  if (Number.isFinite(bottom)) {
29694
29755
  cursorV = bottom;
29695
- prevSpaceAfter = _nullishCoalesce(_optionalChain([g, 'optionalAccess', _519 => _519.spaceAfter]), () => ( 0));
29756
+ prevSpaceAfter = _nullishCoalesce(_optionalChain([g, 'optionalAccess', _524 => _524.spaceAfter]), () => ( 0));
29696
29757
  }
29697
29758
  }
29698
29759
  continue;
@@ -29802,7 +29863,7 @@ function buildPara(p) {
29802
29863
  el: ch,
29803
29864
  tag: cn,
29804
29865
  index: chars.length,
29805
- inline: _optionalChain([pos, 'optionalAccess', _520 => _520.getAttribute, 'call', _521 => _521("treatAsChar")]) === "1",
29866
+ inline: _optionalChain([pos, 'optionalAccess', _525 => _525.getAttribute, 'call', _526 => _526("treatAsChar")]) === "1",
29806
29867
  width: w,
29807
29868
  height: h
29808
29869
  });
@@ -30054,15 +30115,15 @@ function drawShape(o, x, y, ctx, depth) {
30054
30115
  const sx = ow > 0 ? w / ow : 1;
30055
30116
  const sy = oh > 0 ? h / oh : 1;
30056
30117
  const lineShape = findChildByLocalName(el, "lineShape");
30057
- const lstyle = _nullishCoalesce(_optionalChain([lineShape, 'optionalAccess', _522 => _522.getAttribute, 'call', _523 => _523("style")]), () => ( "SOLID"));
30058
- const strokeCol = _optionalChain([lineShape, 'optionalAccess', _524 => _524.getAttribute, 'call', _525 => _525("color")]) || "#000000";
30118
+ const lstyle = _nullishCoalesce(_optionalChain([lineShape, 'optionalAccess', _527 => _527.getAttribute, 'call', _528 => _528("style")]), () => ( "SOLID"));
30119
+ const strokeCol = _optionalChain([lineShape, 'optionalAccess', _529 => _529.getAttribute, 'call', _530 => _530("color")]) || "#000000";
30059
30120
  const hasStroke = lstyle !== "NONE";
30060
30121
  const strokeW = hasStroke ? shapeStrokePt(lineShape ? num3(lineShape, "width") : 33) : 0;
30061
30122
  const dash = /DASH|DOT/.test(lstyle) ? ` stroke-dasharray="${lstyle.includes("DOT") ? "1,1.5" : "3,1.5"}"` : "";
30062
30123
  const strokeAttr = hasStroke ? ` stroke="${escapeXml3(strokeCol)}" stroke-width="${strokeW.toFixed(2)}"${dash}` : "";
30063
30124
  const fillBrush = findChildByLocalName(el, "fillBrush");
30064
30125
  const winBrush = fillBrush ? findChildByLocalName(fillBrush, "winBrush") : null;
30065
- const face = _optionalChain([winBrush, 'optionalAccess', _526 => _526.getAttribute, 'call', _527 => _527("faceColor")]);
30126
+ const face = _optionalChain([winBrush, 'optionalAccess', _531 => _531.getAttribute, 'call', _532 => _532("faceColor")]);
30066
30127
  const fill = face && face.toLowerCase() !== "none" ? face : "none";
30067
30128
  const fillAttr = ` fill="${fill === "none" ? "none" : escapeXml3(fill)}"`;
30068
30129
  if (o.tag === "rect") {
@@ -30089,14 +30150,14 @@ function drawShape(o, x, y, ctx, depth) {
30089
30150
  }
30090
30151
  function cellContentExtent(cell2, memo) {
30091
30152
  if (!cell2.sub) return 0;
30092
- const hit = _optionalChain([memo, 'optionalAccess', _528 => _528.cell, 'access', _529 => _529.get, 'call', _530 => _530(cell2.el)]);
30153
+ const hit = _optionalChain([memo, 'optionalAccess', _533 => _533.cell, 'access', _534 => _534.get, 'call', _535 => _535(cell2.el)]);
30093
30154
  if (hit !== void 0) return hit;
30094
30155
  let ext = 0;
30095
30156
  for (const p of elements2(cell2.sub)) {
30096
30157
  if (ln2(p) !== "p") continue;
30097
30158
  const m = buildPara(p);
30098
30159
  for (const s of m.segs) ext = Math.max(ext, s.vertpos + s.textheight);
30099
- const baseV = _nullishCoalesce(_optionalChain([m, 'access', _531 => _531.segs, 'access', _532 => _532[0], 'optionalAccess', _533 => _533.vertpos]), () => ( 0));
30160
+ const baseV = _nullishCoalesce(_optionalChain([m, 'access', _536 => _536.segs, 'access', _537 => _537[0], 'optionalAccess', _538 => _538.vertpos]), () => ( 0));
30100
30161
  for (const o of m.objs) {
30101
30162
  if (o.inline) {
30102
30163
  const h = o.tag === "tbl" ? Math.max(o.height, measureTableHeight(o.el, memo)) : o.height;
@@ -30104,14 +30165,14 @@ function cellContentExtent(cell2, memo) {
30104
30165
  continue;
30105
30166
  }
30106
30167
  const pos = findChildByLocalName(o.el, "pos");
30107
- if ((_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _534 => _534.getAttribute, 'call', _535 => _535("vertRelTo")]), () => ( "PARA"))) !== "PARA") continue;
30168
+ if ((_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _539 => _539.getAttribute, 'call', _540 => _540("vertRelTo")]), () => ( "PARA"))) !== "PARA") continue;
30108
30169
  const om = findChildByLocalName(o.el, "outMargin");
30109
30170
  const pushed = baseV - (num3(om, "top") + o.height + num3(om, "bottom"));
30110
30171
  const anchor = pushed >= -100 ? pushed : baseV;
30111
30172
  ext = Math.max(ext, anchor + num3(om, "top") + num3(pos, "vertOffset") + o.height);
30112
30173
  }
30113
30174
  }
30114
- _optionalChain([memo, 'optionalAccess', _536 => _536.cell, 'access', _537 => _537.set, 'call', _538 => _538(cell2.el, ext)]);
30175
+ _optionalChain([memo, 'optionalAccess', _541 => _541.cell, 'access', _542 => _542.set, 'call', _543 => _543(cell2.el, ext)]);
30115
30176
  return ext;
30116
30177
  }
30117
30178
  function edgeLine(x1, y1, x2, y2, e) {
@@ -30153,7 +30214,7 @@ function collectCells(tbl2) {
30153
30214
  return cells;
30154
30215
  }
30155
30216
  function measureTableHeight(tbl2, memo) {
30156
- const hit = _optionalChain([memo, 'optionalAccess', _539 => _539.table, 'access', _540 => _540.get, 'call', _541 => _541(tbl2)]);
30217
+ const hit = _optionalChain([memo, 'optionalAccess', _544 => _544.table, 'access', _545 => _545.get, 'call', _546 => _546(tbl2)]);
30157
30218
  if (hit !== void 0) return hit;
30158
30219
  const cells = collectCells(tbl2);
30159
30220
  if (cells.length === 0 || cells.length > 4096) return 0;
@@ -30164,7 +30225,7 @@ function measureTableHeight(tbl2, memo) {
30164
30225
  );
30165
30226
  let sum = 0;
30166
30227
  for (const h of rowH) sum += h;
30167
- _optionalChain([memo, 'optionalAccess', _542 => _542.table, 'access', _543 => _543.set, 'call', _544 => _544(tbl2, sum)]);
30228
+ _optionalChain([memo, 'optionalAccess', _547 => _547.table, 'access', _548 => _548.set, 'call', _549 => _549(tbl2, sum)]);
30168
30229
  return sum;
30169
30230
  }
30170
30231
  function drawTable(tbl2, tx, ty, ctx, depth) {
@@ -30195,7 +30256,7 @@ function drawTable(tbl2, tx, ty, ctx, depth) {
30195
30256
  }));
30196
30257
  for (const g of geom) {
30197
30258
  const bf = g.c.bfId != null ? ctx.styles.borderFill.get(g.c.bfId) : void 0;
30198
- if (_optionalChain([bf, 'optionalAccess', _545 => _545.fill])) emit(ctx, `<rect x="${pt(g.x)}" y="${pt(g.y)}" width="${pt(g.w)}" height="${pt(g.h)}" fill="${escapeXml3(bf.fill)}"/>`);
30259
+ if (_optionalChain([bf, 'optionalAccess', _550 => _550.fill])) emit(ctx, `<rect x="${pt(g.x)}" y="${pt(g.y)}" width="${pt(g.w)}" height="${pt(g.h)}" fill="${escapeXml3(bf.fill)}"/>`);
30199
30260
  }
30200
30261
  for (const g of geom) {
30201
30262
  const { c } = g;
@@ -30233,7 +30294,7 @@ function drawPic(pic, x, y, ctx) {
30233
30294
  const sz = findChildByLocalName(pic, "sz");
30234
30295
  const w = num3(sz, "width", 5669), h = num3(sz, "height", 5669);
30235
30296
  const img = findFirst(pic, "img");
30236
- const ref = _optionalChain([img, 'optionalAccess', _546 => _546.getAttribute, 'call', _547 => _547("binaryItemIDRef")]);
30297
+ const ref = _optionalChain([img, 'optionalAccess', _551 => _551.getAttribute, 'call', _552 => _552("binaryItemIDRef")]);
30237
30298
  const loaded = ref != null ? ctx.images.get(ref) : void 0;
30238
30299
  if (!loaded) {
30239
30300
  emit(ctx, `<rect x="${pt(x)}" y="${pt(y)}" width="${pt(w)}" height="${pt(h)}" fill="#eee" stroke="#c00" stroke-width="0.5"/>`);
@@ -30273,7 +30334,7 @@ function readSectionGeom(root) {
30273
30334
  const pagePr = findFirst(root, "pagePr");
30274
30335
  const margin = pagePr ? findChildByLocalName(pagePr, "margin") : null;
30275
30336
  let PW = num3(pagePr, "width", 59528), PH = num3(pagePr, "height", 84188);
30276
- if (_optionalChain([pagePr, 'optionalAccess', _548 => _548.getAttribute, 'call', _549 => _549("landscape")]) === "NARROWLY" && PW < PH) {
30337
+ if (_optionalChain([pagePr, 'optionalAccess', _553 => _553.getAttribute, 'call', _554 => _554("landscape")]) === "NARROWLY" && PW < PH) {
30277
30338
  const t = PW;
30278
30339
  PW = PH;
30279
30340
  PH = t;
@@ -30331,17 +30392,17 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode) {
30331
30392
  return { pages: ctx.pages, pageH };
30332
30393
  }
30333
30394
  async function renderHwpxToSvg(input, options) {
30334
- const maxImg = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _550 => _550.maxImageBytes]), () => ( 40 * 1024 * 1024));
30395
+ const maxImg = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _555 => _555.maxImageBytes]), () => ( 40 * 1024 * 1024));
30335
30396
  const ab = input instanceof Uint8Array ? input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength) : input;
30336
- _chunkKKZATKQWcjs.precheckZipSize.call(void 0, ab, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
30397
+ _chunkBLNOGMIMcjs.precheckZipSize.call(void 0, ab, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
30337
30398
  let zip;
30338
30399
  try {
30339
30400
  zip = await _jszip2.default.loadAsync(input);
30340
30401
  } catch (e33) {
30341
- throw new (0, _chunkKKZATKQWcjs.KordocError)("HWPX(ZIP) \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4 \u2014 \uB80C\uB354\uB294 HWPX\uB9CC \uC9C0\uC6D0");
30402
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("HWPX(ZIP) \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4 \u2014 \uB80C\uB354\uB294 HWPX\uB9CC \uC9C0\uC6D0");
30342
30403
  }
30343
30404
  const secFiles = zip.file(/Contents\/section\d+\.xml$/i).sort((a, b) => a.name.localeCompare(b.name));
30344
- if (secFiles.length === 0) throw new (0, _chunkKKZATKQWcjs.KordocError)("Contents/section0.xml \uC5C6\uC74C \u2014 HWPX\uAC00 \uC544\uB2C8\uAC70\uB098 \uC190\uC0C1\uB428");
30405
+ if (secFiles.length === 0) throw new (0, _chunkBLNOGMIMcjs.KordocError)("Contents/section0.xml \uC5C6\uC74C \u2014 HWPX\uAC00 \uC544\uB2C8\uAC70\uB098 \uC190\uC0C1\uB428");
30345
30406
  const warnings = [];
30346
30407
  const headFile = _nullishCoalesce(zip.file("Contents/header.xml"), () => ( zip.file("Contents/head.xml")));
30347
30408
  const styles = headFile ? parseRenderStyles(await headFile.async("string")) : { charPr: /* @__PURE__ */ new Map(), paraAlign: /* @__PURE__ */ new Map(), paraGeom: /* @__PURE__ */ new Map(), borderFill: /* @__PURE__ */ new Map() };
@@ -30349,7 +30410,7 @@ async function renderHwpxToSvg(input, options) {
30349
30410
  const secXmls = [];
30350
30411
  for (const f of secFiles) {
30351
30412
  const xml = await f.async("string");
30352
- if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0, _chunkKKZATKQWcjs.KordocError)("\uC139\uC158 XML\uC774 \uD5C8\uC6A9 \uD06C\uAE30\uB97C \uCD08\uACFC");
30413
+ if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0, _chunkBLNOGMIMcjs.KordocError)("\uC139\uC158 XML\uC774 \uD5C8\uC6A9 \uD06C\uAE30\uB97C \uCD08\uACFC");
30353
30414
  secXmls.push(xml);
30354
30415
  }
30355
30416
  const binmap = /* @__PURE__ */ new Map();
@@ -30373,7 +30434,7 @@ async function renderHwpxToSvg(input, options) {
30373
30434
  let href = binmap.get(ref);
30374
30435
  if (!href) {
30375
30436
  const cand = zip.file(new RegExp(`BinData/.*${ref.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`, "i"))[0];
30376
- href = _optionalChain([cand, 'optionalAccess', _551 => _551.name]);
30437
+ href = _optionalChain([cand, 'optionalAccess', _556 => _556.name]);
30377
30438
  }
30378
30439
  if (!href) continue;
30379
30440
  const f = _nullishCoalesce(zip.file(href), () => ( zip.file("Contents/" + href)));
@@ -30394,7 +30455,7 @@ async function renderHwpxToSvg(input, options) {
30394
30455
  styles,
30395
30456
  images,
30396
30457
  defs: [],
30397
- highlights: (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _552 => _552.highlights]), () => ( []))).map((s) => s.trim().toLowerCase()).filter((s) => s.length > 0),
30458
+ highlights: (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _557 => _557.highlights]), () => ( []))).map((s) => s.trim().toLowerCase()).filter((s) => s.length > 0),
30398
30459
  warnings,
30399
30460
  warned: /* @__PURE__ */ new Set(),
30400
30461
  stats: { texts: 0, images: 0, tables: 0 },
@@ -30405,7 +30466,7 @@ async function renderHwpxToSvg(input, options) {
30405
30466
  for (let si = 0; si < secXmls.length; si++) {
30406
30467
  const secXml = secXmls[si];
30407
30468
  const hasCache = /<(?:[A-Za-z][\w.-]*:)?linesegarray[\s/>]/.test(secXml);
30408
- if (!hasCache && !_optionalChain([options, 'optionalAccess', _553 => _553.reflow])) {
30469
+ if (!hasCache && !_optionalChain([options, 'optionalAccess', _558 => _558.reflow])) {
30409
30470
  noCacheSkipped = true;
30410
30471
  warnings.push(`\uAD6C\uC5ED ${si}: \uC870\uD310 \uCE90\uC2DC \uC5C6\uC74C \u2014 reflow \uC635\uC158 \uD544\uC694, \uC0DD\uB7B5`);
30411
30472
  continue;
@@ -30417,14 +30478,14 @@ async function renderHwpxToSvg(input, options) {
30417
30478
  continue;
30418
30479
  }
30419
30480
  const geom = readSectionGeom(root);
30420
- const { pages, pageH } = renderSectionToPages(root, geom, ctxBase, !!_optionalChain([options, 'optionalAccess', _554 => _554.reflow]), _nullishCoalesce(_optionalChain([options, 'optionalAccess', _555 => _555.reflowMode]), () => ( "keep")));
30481
+ const { pages, pageH } = renderSectionToPages(root, geom, ctxBase, !!_optionalChain([options, 'optionalAccess', _559 => _559.reflow]), _nullishCoalesce(_optionalChain([options, 'optionalAccess', _560 => _560.reflowMode]), () => ( "keep")));
30421
30482
  rendered.push({ pages, PW: geom.PW, pageH, clipId: `pgclip${si}` });
30422
30483
  }
30423
30484
  if (rendered.length === 0) {
30424
30485
  if (noCacheSkipped) {
30425
- throw new (0, _chunkKKZATKQWcjs.KordocError)("\uC870\uD310 \uCE90\uC2DC(linesegarray) \uC5C6\uC74C \u2014 \uD55C\uCEF4\uC5D0\uC11C \uC800\uC7A5\uD55C HWPX\uB9CC \uB80C\uB354 \uAC00\uB2A5 (reflow \uC635\uC158\uC73C\uB85C \uD569\uC131 \uB80C\uB354 \uAC00\uB2A5)");
30486
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("\uC870\uD310 \uCE90\uC2DC(linesegarray) \uC5C6\uC74C \u2014 \uD55C\uCEF4\uC5D0\uC11C \uC800\uC7A5\uD55C HWPX\uB9CC \uB80C\uB354 \uAC00\uB2A5 (reflow \uC635\uC158\uC73C\uB85C \uD569\uC131 \uB80C\uB354 \uAC00\uB2A5)");
30426
30487
  }
30427
- throw new (0, _chunkKKZATKQWcjs.KordocError)("\uB80C\uB354\uD560 \uAD6C\uC5ED\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 HWPX\uAC00 \uC190\uC0C1\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4");
30488
+ throw new (0, _chunkBLNOGMIMcjs.KordocError)("\uB80C\uB354\uD560 \uAD6C\uC5ED\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 HWPX\uAC00 \uC190\uC0C1\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4");
30428
30489
  }
30429
30490
  const GAP = 2400;
30430
30491
  const clipDefs = [];
@@ -30456,17 +30517,17 @@ ${groups.join("\n")}
30456
30517
  // src/index.ts
30457
30518
  async function parse(input, options) {
30458
30519
  let buffer;
30459
- const opts = typeof input === "string" && !_optionalChain([options, 'optionalAccess', _556 => _556.filePath]) ? { ...options, filePath: input } : options;
30520
+ const opts = typeof input === "string" && !_optionalChain([options, 'optionalAccess', _561 => _561.filePath]) ? { ...options, filePath: input } : options;
30460
30521
  if (typeof input === "string") {
30461
30522
  try {
30462
30523
  const buf = await _promises.readFile.call(void 0, input);
30463
- buffer = _chunkKKZATKQWcjs.toArrayBuffer.call(void 0, buf);
30524
+ buffer = _chunkBLNOGMIMcjs.toArrayBuffer.call(void 0, buf);
30464
30525
  } catch (err) {
30465
30526
  const msg2 = err instanceof Error && "code" in err && err.code === "ENOENT" ? `\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${input}` : `\uD30C\uC77C \uC77D\uAE30 \uC2E4\uD328: ${input}`;
30466
30527
  return { success: false, fileType: "unknown", error: msg2, code: "PARSE_ERROR" };
30467
30528
  }
30468
30529
  } else if (Buffer.isBuffer(input)) {
30469
- buffer = _chunkKKZATKQWcjs.toArrayBuffer.call(void 0, input);
30530
+ buffer = _chunkBLNOGMIMcjs.toArrayBuffer.call(void 0, input);
30470
30531
  } else {
30471
30532
  buffer = input;
30472
30533
  }
@@ -30500,18 +30561,18 @@ async function parse(input, options) {
30500
30561
  }
30501
30562
  async function parseImage(buffer, options) {
30502
30563
  try {
30503
- const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-3AFBDDJI.cjs")));
30564
+ const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-JWAX5EOB.cjs")));
30504
30565
  const { blocks, warnings } = await parseImageDocument(buffer, options);
30505
30566
  return {
30506
30567
  success: true,
30507
30568
  fileType: "image",
30508
- markdown: _chunkWMU2KJHFcjs.blocksToMarkdown.call(void 0, blocks),
30569
+ markdown: _chunkSCJLAOY3cjs.blocksToMarkdown.call(void 0, blocks),
30509
30570
  blocks,
30510
30571
  warnings: warnings.length ? warnings : void 0,
30511
30572
  pageCount: 1
30512
30573
  };
30513
30574
  } catch (err) {
30514
- return { success: false, fileType: "image", error: _chunkKKZATKQWcjs.sanitizeError.call(void 0, err), code: _chunkKKZATKQWcjs.classifyError.call(void 0, err) };
30575
+ return { success: false, fileType: "image", error: _chunkBLNOGMIMcjs.sanitizeError.call(void 0, err), code: _chunkBLNOGMIMcjs.classifyError.call(void 0, err) };
30515
30576
  }
30516
30577
  }
30517
30578
  async function parseHwp3(buffer, options) {
@@ -30519,21 +30580,21 @@ async function parseHwp3(buffer, options) {
30519
30580
  const { markdown, blocks, metadata, outline, warnings } = parseHwp3Document(buffer, options);
30520
30581
  return { success: true, fileType: "hwp3", markdown, blocks, metadata, outline, warnings };
30521
30582
  } catch (err) {
30522
- return { success: false, fileType: "hwp3", error: _chunkKKZATKQWcjs.sanitizeError.call(void 0, err), code: _chunkKKZATKQWcjs.classifyError.call(void 0, err) };
30583
+ return { success: false, fileType: "hwp3", error: _chunkBLNOGMIMcjs.sanitizeError.call(void 0, err), code: _chunkBLNOGMIMcjs.classifyError.call(void 0, err) };
30523
30584
  }
30524
30585
  }
30525
30586
  async function parseHwpx(buffer, options) {
30526
30587
  try {
30527
30588
  const { markdown, blocks, metadata, outline, warnings, images } = await parseHwpxDocument(buffer, options);
30528
- return { success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _557 => _557.length]) ? images : void 0 };
30589
+ return { success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _562 => _562.length]) ? images : void 0 };
30529
30590
  } catch (err) {
30530
- return { success: false, fileType: "hwpx", error: _chunkKKZATKQWcjs.sanitizeError.call(void 0, err), code: _chunkKKZATKQWcjs.classifyError.call(void 0, err) };
30591
+ return { success: false, fileType: "hwpx", error: _chunkBLNOGMIMcjs.sanitizeError.call(void 0, err), code: _chunkBLNOGMIMcjs.classifyError.call(void 0, err) };
30531
30592
  }
30532
30593
  }
30533
30594
  async function parseHwp(buffer, options) {
30534
30595
  try {
30535
30596
  const { markdown, blocks, metadata, outline, warnings, images } = parseHwp5Document(Buffer.from(buffer), options);
30536
- if (isDistributionSentinel(markdown) && isComFallbackAvailable() && _optionalChain([options, 'optionalAccess', _558 => _558.filePath])) {
30597
+ if (isDistributionSentinel(markdown) && isComFallbackAvailable() && _optionalChain([options, 'optionalAccess', _563 => _563.filePath])) {
30537
30598
  try {
30538
30599
  const { pages, pageCount, warnings: comWarns } = extractTextViaCom(options.filePath);
30539
30600
  if (pages.some((p) => p && p.trim().length > 0)) {
@@ -30550,15 +30611,15 @@ async function parseHwp(buffer, options) {
30550
30611
  } catch (e34) {
30551
30612
  }
30552
30613
  }
30553
- return { success: true, fileType: "hwp", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _559 => _559.length]) ? images : void 0 };
30614
+ return { success: true, fileType: "hwp", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _564 => _564.length]) ? images : void 0 };
30554
30615
  } catch (err) {
30555
- return { success: false, fileType: "hwp", error: _chunkKKZATKQWcjs.sanitizeError.call(void 0, err), code: _chunkKKZATKQWcjs.classifyError.call(void 0, err) };
30616
+ return { success: false, fileType: "hwp", error: _chunkBLNOGMIMcjs.sanitizeError.call(void 0, err), code: _chunkBLNOGMIMcjs.classifyError.call(void 0, err) };
30556
30617
  }
30557
30618
  }
30558
30619
  async function parsePdf(buffer, options) {
30559
30620
  let parsePdfDocument;
30560
30621
  try {
30561
- const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-MRM6WICO.cjs")));
30622
+ const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-6RDEBLSB.cjs")));
30562
30623
  parsePdfDocument = mod.parsePdfDocument;
30563
30624
  } catch (e35) {
30564
30625
  return {
@@ -30573,7 +30634,7 @@ async function parsePdf(buffer, options) {
30573
30634
  return { success: true, fileType: "pdf", markdown, blocks, metadata, outline, warnings, isImageBased, pageQuality, qualitySummary, images };
30574
30635
  } catch (err) {
30575
30636
  const isImageBased = err instanceof Error && "isImageBased" in err ? true : void 0;
30576
- return { success: false, fileType: "pdf", error: _chunkKKZATKQWcjs.sanitizeError.call(void 0, err), code: _chunkKKZATKQWcjs.classifyError.call(void 0, err), isImageBased };
30637
+ return { success: false, fileType: "pdf", error: _chunkBLNOGMIMcjs.sanitizeError.call(void 0, err), code: _chunkBLNOGMIMcjs.classifyError.call(void 0, err), isImageBased };
30577
30638
  }
30578
30639
  }
30579
30640
  async function parseXlsx(buffer, options) {
@@ -30581,7 +30642,7 @@ async function parseXlsx(buffer, options) {
30581
30642
  const { markdown, blocks, metadata, warnings } = await parseXlsxDocument(buffer, options);
30582
30643
  return { success: true, fileType: "xlsx", markdown, blocks, metadata, warnings };
30583
30644
  } catch (err) {
30584
- return { success: false, fileType: "xlsx", error: _chunkKKZATKQWcjs.sanitizeError.call(void 0, err), code: _chunkKKZATKQWcjs.classifyError.call(void 0, err) };
30645
+ return { success: false, fileType: "xlsx", error: _chunkBLNOGMIMcjs.sanitizeError.call(void 0, err), code: _chunkBLNOGMIMcjs.classifyError.call(void 0, err) };
30585
30646
  }
30586
30647
  }
30587
30648
  async function parseXls(buffer, options) {
@@ -30589,15 +30650,15 @@ async function parseXls(buffer, options) {
30589
30650
  const { markdown, blocks, metadata, warnings } = await parseXlsDocument(buffer, options);
30590
30651
  return { success: true, fileType: "xls", markdown, blocks, metadata, warnings };
30591
30652
  } catch (err) {
30592
- return { success: false, fileType: "xls", error: _chunkKKZATKQWcjs.sanitizeError.call(void 0, err), code: _chunkKKZATKQWcjs.classifyError.call(void 0, err) };
30653
+ return { success: false, fileType: "xls", error: _chunkBLNOGMIMcjs.sanitizeError.call(void 0, err), code: _chunkBLNOGMIMcjs.classifyError.call(void 0, err) };
30593
30654
  }
30594
30655
  }
30595
30656
  async function parseDocx(buffer, options) {
30596
30657
  try {
30597
30658
  const { markdown, blocks, metadata, outline, warnings, images } = await parseDocxDocument(buffer, options);
30598
- return { success: true, fileType: "docx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _560 => _560.length]) ? images : void 0 };
30659
+ return { success: true, fileType: "docx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _565 => _565.length]) ? images : void 0 };
30599
30660
  } catch (err) {
30600
- return { success: false, fileType: "docx", error: _chunkKKZATKQWcjs.sanitizeError.call(void 0, err), code: _chunkKKZATKQWcjs.classifyError.call(void 0, err) };
30661
+ return { success: false, fileType: "docx", error: _chunkBLNOGMIMcjs.sanitizeError.call(void 0, err), code: _chunkBLNOGMIMcjs.classifyError.call(void 0, err) };
30601
30662
  }
30602
30663
  }
30603
30664
  async function parseHwpml(buffer, options) {
@@ -30605,16 +30666,16 @@ async function parseHwpml(buffer, options) {
30605
30666
  const { markdown, blocks, metadata, outline, warnings } = parseHwpmlDocument(buffer, options);
30606
30667
  return { success: true, fileType: "hwpml", markdown, blocks, metadata, outline, warnings };
30607
30668
  } catch (err) {
30608
- return { success: false, fileType: "hwpml", error: _chunkKKZATKQWcjs.sanitizeError.call(void 0, err), code: _chunkKKZATKQWcjs.classifyError.call(void 0, err) };
30669
+ return { success: false, fileType: "hwpml", error: _chunkBLNOGMIMcjs.sanitizeError.call(void 0, err), code: _chunkBLNOGMIMcjs.classifyError.call(void 0, err) };
30609
30670
  }
30610
30671
  }
30611
30672
  async function fillForm(input, values, outputFormat = "markdown") {
30612
30673
  let buffer;
30613
30674
  if (typeof input === "string") {
30614
30675
  const buf = await _promises.readFile.call(void 0, input);
30615
- buffer = _chunkKKZATKQWcjs.toArrayBuffer.call(void 0, buf);
30676
+ buffer = _chunkBLNOGMIMcjs.toArrayBuffer.call(void 0, buf);
30616
30677
  } else if (Buffer.isBuffer(input)) {
30617
- buffer = _chunkKKZATKQWcjs.toArrayBuffer.call(void 0, input);
30678
+ buffer = _chunkBLNOGMIMcjs.toArrayBuffer.call(void 0, input);
30618
30679
  } else {
30619
30680
  buffer = input;
30620
30681
  }
@@ -30640,7 +30701,7 @@ async function fillForm(input, values, outputFormat = "markdown") {
30640
30701
  throw new Error(`\uC11C\uC2DD \uD30C\uC2F1 \uC2E4\uD328: ${parsed.error}`);
30641
30702
  }
30642
30703
  const fill = fillFormFields(parsed.blocks, values);
30643
- const markdown = _chunkWMU2KJHFcjs.blocksToMarkdown.call(void 0, fill.blocks);
30704
+ const markdown = _chunkSCJLAOY3cjs.blocksToMarkdown.call(void 0, fill.blocks);
30644
30705
  if (outputFormat === "hwpx") {
30645
30706
  const hwpxBuffer = await markdownToHwpx(markdown);
30646
30707
  return { output: hwpxBuffer, format: "hwpx", fill };
@@ -30714,5 +30775,5 @@ async function fillForm(input, values, outputFormat = "markdown") {
30714
30775
 
30715
30776
 
30716
30777
 
30717
- exports.DEFAULT_REDACT_RULES = DEFAULT_REDACT_RULES; exports.HwpxSession = HwpxSession; exports.PRESET_ALIAS = PRESET_ALIAS; exports.SPACE_EM_FIXED = SPACE_EM_FIXED; exports.SPACE_EM_FONT = SPACE_EM_FONT; exports.VERSION = _chunkKKZATKQWcjs.VERSION; exports.ValueCursor = ValueCursor; exports.applySplices = applySplices; exports.blocksToChunks = blocksToChunks; exports.blocksToMarkdown = _chunkWMU2KJHFcjs.blocksToMarkdown; exports.blocksToPdf = blocksToPdf; exports.buildParagraphSplices = buildParagraphSplices; exports.buildRangeSplices = buildRangeSplices; exports.charWidthEm1000 = charWidthEm1000; exports.compare = compare; exports.detectFormat = detectFormat; exports.detectOle2Format = detectOle2Format; exports.detectZipFormat = detectZipFormat; exports.diffBlocks = diffBlocks; exports.extractFormFields = extractFormFields; exports.extractFormSchema = extractFormSchema; exports.fillForm = fillForm; exports.fillFormFields = fillFormFields; exports.fillHwpx = fillHwpx; exports.fillWithUniqueGuard = fillWithUniqueGuard; exports.fitRatioForFewerLines = fitRatioForFewerLines; exports.formatFillValue = formatFillValue; exports.gongmunLintWarnings = gongmunLintWarnings; exports.hwpxToProfile = hwpxToProfile; exports.incompatibleGongmunWarnings = incompatibleGongmunWarnings; exports.inferFieldType = inferFieldType; exports.isHwpxFile = isHwpxFile; exports.isKnownFont = isKnownFont; exports.isLabelCell = isLabelCell; exports.isOldHwpFile = isOldHwpFile; exports.isPdfFile = isPdfFile; exports.isZipFile = isZipFile; exports.lintGongmunText = lintGongmunText; exports.markdownToHwpx = markdownToHwpx; exports.markdownToPdf = markdownToPdf; exports.measureTextWidth = measureTextWidth; exports.normalizeGongmunPreset = normalizeGongmunPreset; exports.openHwpxDocument = openHwpxDocument; exports.parse = parse; exports.parseDocx = parseDocx; exports.parseHwp = parseHwp; exports.parseHwp3 = parseHwp3; exports.parseHwpml = parseHwpml; exports.parseHwpx = parseHwpx; exports.parseImage = parseImage; exports.parsePdf = parsePdf; exports.parseXls = parseXls; exports.parseXlsx = parseXlsx; exports.patchHwp = patchHwp; exports.patchHwpx = patchHwpx; exports.patchHwpxBlocks = patchHwpxBlocks; exports.placeSealHwpx = placeSealHwpx; exports.redactMarkdown = redactMarkdown; exports.redactText = redactText; exports.renderHtml = renderHtml; exports.renderHwpxToSvg = renderHwpxToSvg; exports.scanSectionXml = scanSectionXml; exports.simulateWrap = simulateWrap; exports.simulateWrapKeepWord = simulateWrapKeepWord; exports.unknownFontWarnings = unknownFontWarnings; exports.validateHwpx = validateHwpx;
30778
+ exports.DEFAULT_REDACT_RULES = DEFAULT_REDACT_RULES; exports.HwpxSession = HwpxSession; exports.PRESET_ALIAS = PRESET_ALIAS; exports.SPACE_EM_FIXED = SPACE_EM_FIXED; exports.SPACE_EM_FONT = SPACE_EM_FONT; exports.VERSION = _chunkBLNOGMIMcjs.VERSION; exports.ValueCursor = ValueCursor; exports.applySplices = applySplices; exports.blocksToChunks = blocksToChunks; exports.blocksToMarkdown = _chunkSCJLAOY3cjs.blocksToMarkdown; exports.blocksToPdf = blocksToPdf; exports.buildParagraphSplices = buildParagraphSplices; exports.buildRangeSplices = buildRangeSplices; exports.charWidthEm1000 = charWidthEm1000; exports.compare = compare; exports.detectFormat = detectFormat; exports.detectOle2Format = detectOle2Format; exports.detectZipFormat = detectZipFormat; exports.diffBlocks = diffBlocks; exports.extractFormFields = extractFormFields; exports.extractFormSchema = extractFormSchema; exports.fillForm = fillForm; exports.fillFormFields = fillFormFields; exports.fillHwpx = fillHwpx; exports.fillWithUniqueGuard = fillWithUniqueGuard; exports.fitRatioForFewerLines = fitRatioForFewerLines; exports.formatFillValue = formatFillValue; exports.gongmunLintWarnings = gongmunLintWarnings; exports.hwpxToProfile = hwpxToProfile; exports.incompatibleGongmunWarnings = incompatibleGongmunWarnings; exports.inferFieldType = inferFieldType; exports.isHwpxFile = isHwpxFile; exports.isKnownFont = isKnownFont; exports.isLabelCell = isLabelCell; exports.isOldHwpFile = isOldHwpFile; exports.isPdfFile = isPdfFile; exports.isZipFile = isZipFile; exports.lintGongmunText = lintGongmunText; exports.markdownToHwpx = markdownToHwpx; exports.markdownToPdf = markdownToPdf; exports.measureTextWidth = measureTextWidth; exports.normalizeGongmunPreset = normalizeGongmunPreset; exports.openHwpxDocument = openHwpxDocument; exports.parse = parse; exports.parseDocx = parseDocx; exports.parseHwp = parseHwp; exports.parseHwp3 = parseHwp3; exports.parseHwpml = parseHwpml; exports.parseHwpx = parseHwpx; exports.parseImage = parseImage; exports.parsePdf = parsePdf; exports.parseXls = parseXls; exports.parseXlsx = parseXlsx; exports.patchHwp = patchHwp; exports.patchHwpx = patchHwpx; exports.patchHwpxBlocks = patchHwpxBlocks; exports.placeSealHwpx = placeSealHwpx; exports.redactMarkdown = redactMarkdown; exports.redactText = redactText; exports.renderHtml = renderHtml; exports.renderHwpxToSvg = renderHwpxToSvg; exports.scanSectionXml = scanSectionXml; exports.simulateWrap = simulateWrap; exports.simulateWrapKeepWord = simulateWrapKeepWord; exports.unknownFontWarnings = unknownFontWarnings; exports.validateHwpx = validateHwpx;
30718
30779
  //# sourceMappingURL=index.cjs.map