@shbernal/ts-pptx 3.3.0 → 3.4.0

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 (60) hide show
  1. package/dist/{autopage-D1sqK6j7.js → autopage-BYlTzX-l.js} +8 -5
  2. package/dist/autopage-BYlTzX-l.js.map +1 -0
  3. package/dist/browser.d.ts +4 -4
  4. package/dist/browser.js +11 -11
  5. package/dist/browser.js.map +1 -1
  6. package/dist/{diagnostics-B2yWpcjB.d.ts → diagnostics-B0OmTOoz.d.ts} +38 -6
  7. package/dist/diagnostics-B0OmTOoz.d.ts.map +1 -0
  8. package/dist/{diagnostics-H1QzgRSw.js → diagnostics-CPVADSL1.js} +29 -3
  9. package/dist/{diagnostics-H1QzgRSw.js.map → diagnostics-CPVADSL1.js.map} +1 -1
  10. package/dist/{fit-CYJ1jkQI.js → fit-TjpNbMru.js} +3 -3
  11. package/dist/{fit-CYJ1jkQI.js.map → fit-TjpNbMru.js.map} +1 -1
  12. package/dist/{html-dom-CzewEdE1.js → html-dom-yUSdCExA.js} +5 -5
  13. package/dist/html-dom-yUSdCExA.js.map +1 -0
  14. package/dist/html.d.ts +2 -2
  15. package/dist/html.js +1 -1
  16. package/dist/index.d.ts +4 -4
  17. package/dist/index.js +16 -33
  18. package/dist/index.js.map +1 -1
  19. package/dist/inspect.js +5 -4
  20. package/dist/inspect.js.map +1 -1
  21. package/dist/measure.d.ts +1 -1
  22. package/dist/measure.js +1 -1
  23. package/dist/{st-enums-bVnezkMJ.js → namespaces-Sy_m7Nhd.js} +288 -200
  24. package/dist/namespaces-Sy_m7Nhd.js.map +1 -0
  25. package/dist/node.d.ts +4 -4
  26. package/dist/node.js +7 -19
  27. package/dist/node.js.map +1 -1
  28. package/dist/{notes-SCvpJz0l.js → notes-bWApshah.js} +221 -140
  29. package/dist/notes-bWApshah.js.map +1 -0
  30. package/dist/{pres-Cb-1xDne.d.ts → pres-Dybf7ZUl.d.ts} +2 -2
  31. package/dist/{pres-Cb-1xDne.d.ts.map → pres-Dybf7ZUl.d.ts.map} +1 -1
  32. package/dist/{presentation-DeKTJGHf.js → presentation-3rAKKRfm.js} +154 -230
  33. package/dist/presentation-3rAKKRfm.js.map +1 -0
  34. package/dist/{presentation-types-B50aOUFI.d.ts → presentation-types-D7cgT-eG.d.ts} +191 -16
  35. package/dist/presentation-types-D7cgT-eG.d.ts.map +1 -0
  36. package/dist/read.d.ts +3 -3
  37. package/dist/read.js +3 -3
  38. package/dist/script.d.ts +1 -1
  39. package/dist/script.d.ts.map +1 -1
  40. package/dist/script.js +67 -40
  41. package/dist/script.js.map +1 -1
  42. package/dist/{shapes-BXVgsk0F.js → shapes-Dyw5bxwO.js} +371 -52
  43. package/dist/shapes-Dyw5bxwO.js.map +1 -0
  44. package/dist/{slide-DWw9UoI6.d.ts → slide-B_aInw3N.d.ts} +208 -180
  45. package/dist/slide-B_aInw3N.d.ts.map +1 -0
  46. package/dist/{text-uM-zGton.js → text-DSN3anEh.js} +3563 -3437
  47. package/dist/text-DSN3anEh.js.map +1 -0
  48. package/dist/{units-internal-CGf4VrXy.js → units-internal-DNvK2I6o.js} +54 -34
  49. package/dist/{units-internal-CGf4VrXy.js.map → units-internal-DNvK2I6o.js.map} +1 -1
  50. package/package.json +4 -4
  51. package/dist/autopage-D1sqK6j7.js.map +0 -1
  52. package/dist/diagnostics-B2yWpcjB.d.ts.map +0 -1
  53. package/dist/html-dom-CzewEdE1.js.map +0 -1
  54. package/dist/notes-SCvpJz0l.js.map +0 -1
  55. package/dist/presentation-DeKTJGHf.js.map +0 -1
  56. package/dist/presentation-types-B50aOUFI.d.ts.map +0 -1
  57. package/dist/shapes-BXVgsk0F.js.map +0 -1
  58. package/dist/slide-DWw9UoI6.d.ts.map +0 -1
  59. package/dist/st-enums-bVnezkMJ.js.map +0 -1
  60. package/dist/text-uM-zGton.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shbernal/ts-pptx",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "author": {
5
5
  "name": "shbernal",
6
6
  "url": "https://github.com/shbernal/"
@@ -176,7 +176,7 @@
176
176
  "@types/istanbul-lib-coverage": "^2.0.6",
177
177
  "@types/istanbul-lib-report": "^3.0.3",
178
178
  "@types/istanbul-reports": "^3.0.4",
179
- "@types/node": "^26.2.0",
179
+ "@types/node": "^26.3.0",
180
180
  "@types/opentype.js": "^1.3.10",
181
181
  "@vitest/coverage-v8": "^4.1.11",
182
182
  "@vue/compiler-sfc": "^3.5.41",
@@ -192,8 +192,8 @@
192
192
  "mathml2omml": "^0.5.0",
193
193
  "micromark": "^4.0.2",
194
194
  "ooxml-validate": "^0.0.3",
195
- "oxfmt": "^0.64.0",
196
- "oxlint": "^1.79.0",
195
+ "oxfmt": "^0.65.0",
196
+ "oxlint": "^1.80.0",
197
197
  "oxlint-tsgolint": "7.0.2001",
198
198
  "pptx-html": "^0.1.2",
199
199
  "publint": "^0.3.24",
@@ -1 +0,0 @@
1
- {"version":3,"file":"autopage-D1sqK6j7.js","names":[],"sources":["../src/gen/table/autopage.ts"],"sourcesContent":["/**\n * ts-pptx: Table auto-paging core\n *\n * The DOM-independent heart of table generation: given rows that overflow a slide,\n * split them across as many slides as needed, measuring wrapped text to compute line\n * counts and row heights. `getSlidesForTableRows` is the in-memory core (fully\n * Node-testable); `parseTextToLines` is its private cell-wrapping helper.\n */\n\nimport { SlideObjectType } from '../../enums.js'\nimport { DEF_FONT_SIZE, DEF_SLIDE_MARGIN_IN, LINEH_MODIFIER } from '../../constants-internal.js'\nimport type {\n\tPresLayout,\n\tTableCell,\n\tTableToSlidesProps,\n\tTableRow,\n\tTableRowSlide,\n\tTableCellProps,\n} from '../../types/index.js'\nimport type { SlideLayoutInternal } from '../../types/internal.js'\nimport { getSmartParseNumber, inch2Emu, marginToEmu } from '../../units-internal.js'\nimport { warn } from '../../diagnostics.js'\nimport { EMU_PER_INCH, EMU_PER_POINT } from '../../units.js'\n\ntype AutoPageCell = TableCell & {\n\t_lineHeight: number\n\t_lines: TableCell[][]\n\toptions: TableCellProps\n\ttext: TableCell[]\n}\n\n// ===== Cell text wrapping =====\n\n/**\n * Break cell text into lines based upon table column width (e.g.: Magic Happens Here(tm))\n * @param {TableCell} cell - table cell\n * @param {number} colWidth - table column width (inches)\n * @return {TableRow[]} - cell's text objects grouped into lines\n */\nfunction parseTextToLines(cell: TableCell, colWidth: number, verbose?: boolean): TableCell[][] {\n\t// FYI: CPL = Width / (font-size / font-constant)\n\t// FYI: CHAR:2.3, colWidth:10, fontSize:12 => CPL=138, (actual chars per line in PPT)=145 [14.5 CPI]\n\t// FYI: CHAR:2.3, colWidth:7 , fontSize:12 => CPL= 97, (actual chars per line in PPT)=100 [14.3 CPI]\n\t// FYI: CHAR:2.3, colWidth:9 , fontSize:16 => CPL= 96, (actual chars per line in PPT)=84 [ 9.3 CPI]\n\tconst FOCO = 2.3 + (cell.options?.autoPageCharWeight ? cell.options.autoPageCharWeight : 0) // Character Constant\n\tconst CPL =\n\t\tMath.floor((colWidth / EMU_PER_POINT) * EMU_PER_INCH) /\n\t\t((cell.options?.fontSize ? cell.options.fontSize : DEF_FONT_SIZE) / FOCO) // Chars-Per-Line\n\n\tconst parsedLines: TableCell[][] = []\n\tlet inputCells: TableCell[] = []\n\tconst inputLines1: TableCell[][] = []\n\tconst inputLines2: TableCell[][] = []\n\t/*\n\t\tif (cell.options && cell.options.autoPageCharWeight) {\n\t\t\tlet CHR1 = 2.3 + (cell.options && cell.options.autoPageCharWeight ? cell.options.autoPageCharWeight : 0) // Character Constant\n\t\t\tlet CPL1 = ((colWidth / EMU_PER_POINT) * EMU_PER_INCH) / ((cell.options && cell.options.fontSize ? cell.options.fontSize : DEF_FONT_SIZE) / CHR1) // Chars-Per-Line\n\t\t\tconsole.log(`cell.options.autoPageCharWeight: '${cell.options.autoPageCharWeight}' => CPL: ${CPL1}`)\n\t\t\tlet CHR2 = 2.3 + 0\n\t\t\tlet CPL2 = ((colWidth / EMU_PER_POINT) * EMU_PER_INCH) / ((cell.options && cell.options.fontSize ? cell.options.fontSize : DEF_FONT_SIZE) / CHR2) // Chars-Per-Line\n\t\t\tconsole.log(`cell.options.autoPageCharWeight: '0' => CPL: ${CPL2}`)\n\t\t}\n\t*/\n\n\t/**\n\t * EX INPUTS: `cell.text`\n\t * - string....: \"Account Name Column\"\n\t * - object....: { text:\"Account Name Column\" }\n\t * - object[]..: [{ text:\"Account Name\", options:{ bold:true } }, { text:\" Column\" }]\n\t * - object[]..: [{ text:\"Account Name\", options:{ breakLine:true } }, { text:\"Input\" }]\n\t */\n\n\t/**\n\t * EX OUTPUTS:\n\t * - string....: [{ text:\"Account Name Column\" }]\n\t * - object....: [{ text:\"Account Name Column\" }]\n\t * - object[]..: [{ text:\"Account Name\", options:{ breakLine:true } }, { text:\"Input\" }]\n\t * - object[]..: [{ text:\"Account Name\", options:{ breakLine:true } }, { text:\"Input\" }]\n\t */\n\n\t// STEP 1: Ensure inputCells is an array of TableCells\n\tif (cell.text && cell.text.toString().trim().length === 0) {\n\t\t// Allow a single space/whitespace as cell text (user-requested feature)\n\t\tinputCells.push({ _type: SlideObjectType.tablecell, text: ' ' })\n\t} else if (typeof cell.text === 'number' || typeof cell.text === 'string') {\n\t\tinputCells.push({ _type: SlideObjectType.tablecell, text: (cell.text || '').toString().trim() })\n\t} else if (Array.isArray(cell.text)) {\n\t\tinputCells = cell.text\n\t}\n\tif (verbose) {\n\t\tconsole.log('[1/4] inputCells')\n\t\tinputCells.forEach((cell, idx) => console.log(`[1/4] [${idx + 1}] cell: ${JSON.stringify(cell)}`))\n\t}\n\n\t// STEP 2: Group table cells into lines based on \"\\n\" or `breakLine` prop\n\t/**\n\t * - EX: `[{ text:\"Input Output\" }, { text:\"Extra\" }]` == 1 line\n\t * - EX: `[{ text:\"Input\" }, { text:\"Output\", options:{ breakLine:true } }]` == 1 line\n\t * - EX: `[{ text:\"Input\\nOutput\" }]` == 2 lines\n\t * - EX: `[{ text:\"Input\", options:{ breakLine:true } }, { text:\"Output\" }]` == 2 lines\n\t */\n\tlet newLine: TableCell[] = []\n\tinputCells.forEach((cell) => {\n\t\tif (typeof cell.text !== 'string') return\n\n\t\tif (cell.text.includes('\\n')) {\n\t\t\t// Each non-last \\n-split part ends with a forced paragraph break; the last\n\t\t\t// part accumulates in newLine so subsequent runs stay on the same paragraph.\n\t\t\tconst parts = cell.text.split('\\n')\n\t\t\tparts.forEach((part, partIdx) => {\n\t\t\t\tconst isLastPart = partIdx === parts.length - 1\n\t\t\t\tif (isLastPart) {\n\t\t\t\t\tnewLine.push({ _type: SlideObjectType.tablecell, text: part, options: cell.options })\n\t\t\t\t} else {\n\t\t\t\t\tnewLine.push({\n\t\t\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\t\t\ttext: part,\n\t\t\t\t\t\toptions: { ...cell.options, breakLine: true },\n\t\t\t\t\t})\n\t\t\t\t\tinputLines1.push(newLine)\n\t\t\t\t\tnewLine = []\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tnewLine.push({ _type: SlideObjectType.tablecell, text: cell.text.trim(), options: cell.options })\n\t\t}\n\n\t\tif (cell.options?.breakLine) {\n\t\t\tif (verbose) console.log(`inputCells: new line > ${JSON.stringify(newLine)}`)\n\t\t\tinputLines1.push(newLine)\n\t\t\tnewLine = []\n\t\t}\n\t})\n\t// Flush remaining buffer after all cells are processed\n\tif (newLine.length > 0) {\n\t\tinputLines1.push(newLine)\n\t\tnewLine = []\n\t}\n\tif (verbose) {\n\t\tconsole.log(`[2/4] inputLines1 (${inputLines1.length})`)\n\t\tinputLines1.forEach((line, idx) => console.log(`[2/4] [${idx + 1}] line: ${JSON.stringify(line)}`))\n\t}\n\n\t// STEP 3: Tokenize every text object into words. All runs of one logical paragraph\n\t// are flattened into a single token list so step 4 tracks column position across\n\t// styled-run boundaries (fixes independent-reset bug for rich-text cells).\n\tinputLines1.forEach((line) => {\n\t\tconst lineTokens: TableCell[] = []\n\t\tline.forEach((cell) => {\n\t\t\tconst cellTextStr = String(cell.text) // force convert to string (compiled JS is better with this than a cast)\n\t\t\tconst lineWords = cellTextStr.split(' ')\n\n\t\t\tlineWords.forEach((word, idx) => {\n\t\t\t\tconst cellProps = { ...cell.options }\n\t\t\t\t// IMPORTANT: Handle `breakLine` prop - we cannot apply to each word - only apply to very last word!\n\t\t\t\tif (cellProps?.breakLine) cellProps.breakLine = idx + 1 === lineWords.length\n\t\t\t\tlineTokens.push({\n\t\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\t\ttext: word + (idx + 1 < lineWords.length ? ' ' : ''),\n\t\t\t\t\toptions: cellProps,\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t\tinputLines2.push(lineTokens)\n\t})\n\tif (verbose) {\n\t\tconsole.log(`[3/4] inputLines2 (${inputLines2.length})`)\n\t\tinputLines2.forEach((line) => console.log(`[3/4] line: ${JSON.stringify(line)}`))\n\t}\n\n\t// STEP 4: Group cells/words into lines based upon space consumed by word letters\n\tinputLines2.forEach((line) => {\n\t\tlet lineCells: TableCell[] = []\n\t\tlet strCurrLine = ''\n\n\t\tline.forEach((word) => {\n\t\t\tconst wordText = String(word.text || '')\n\t\t\t// A: create new line when horizontal space is exhausted\n\t\t\tif (strCurrLine.length + wordText.length > CPL) {\n\t\t\t\tparsedLines.push(lineCells)\n\t\t\t\tlineCells = []\n\t\t\t\tstrCurrLine = ''\n\t\t\t}\n\n\t\t\t// B: add current word to line cells\n\t\t\tlineCells.push(word)\n\n\t\t\t// C: add current word to `strCurrLine` which we use to keep track of line's char length\n\t\t\tstrCurrLine += wordText\n\t\t})\n\n\t\t// Flush buffer: Only create a line when there's text to avoid empty row\n\t\tif (lineCells.length > 0) parsedLines.push(lineCells)\n\t})\n\tif (verbose) {\n\t\tconsole.log(`[4/4] parsedLines (${parsedLines.length})`)\n\t\tparsedLines.forEach((line, idx) => console.log(`[4/4] [Line ${idx + 1}]:\\n${JSON.stringify(line)}`))\n\t\tconsole.log('...............................................\\n\\n')\n\t}\n\n\t// Done:\n\treturn parsedLines\n}\n\n// ===== Auto-page engine =====\n// The in-memory core (fully Node-testable). Internally signposted by the\n// `// STEP 1..7` markers below: margins → column count → widths → the main\n// row-iteration/overflow loop (STEP 6) → final-slide flush (STEP 7).\n\n/**\n * Takes an array of table rows and breaks into an array of slides, which contain the calculated amount of table rows that fit on that slide\n * @param {TableCell[][]} tableRows - table rows\n * @param {TableToSlidesProps} tableProps - table2slides properties\n * @param {PresLayout} presLayout - presentation layout\n * @param {SlideLayoutInternal} masterSlide - master slide\n * @return {TableRowSlide[]} array of table rows\n */\nexport function getSlidesForTableRows(\n\ttableRows: TableCell[][] = [],\n\ttableProps: TableToSlidesProps = {},\n\tpresLayout: PresLayout,\n\tmasterSlide?: SlideLayoutInternal | null\n): TableRowSlide[] {\n\tlet arrInchMargins = DEF_SLIDE_MARGIN_IN\n\tlet emuSlideTabW: number\n\tlet emuSlideTabH = EMU_PER_INCH * 1\n\tlet emuTabCurrH = 0\n\tlet numCols = 0\n\tlet warnedNoTabH = false\n\tconst tableRowSlides: TableRowSlide[] = []\n\tconst tablePropX = getSmartParseNumber(tableProps.x, 'X', presLayout)\n\tconst tablePropY = getSmartParseNumber(tableProps.y, 'Y', presLayout)\n\tconst tablePropW = getSmartParseNumber(tableProps.w, 'X', presLayout)\n\tconst tablePropH = getSmartParseNumber(tableProps.h, 'Y', presLayout)\n\tlet tableCalcW: number = tablePropW\n\n\tfunction calcSlideTabH(): void {\n\t\tlet emuStartY = 0\n\t\tif (tableRowSlides.length === 0) emuStartY = tablePropY || inch2Emu(arrInchMargins[0])\n\t\tif (tableRowSlides.length > 0) emuStartY = inch2Emu(tableProps.autoPageSlideStartY || arrInchMargins[0])\n\t\temuSlideTabH = (tablePropH || presLayout.height) - emuStartY - inch2Emu(arrInchMargins[2])\n\t\t// EXPLICIT-H FIX: an explicit `h` is the table's height (an extent), not a\n\t\t// bottom coordinate, so — unlike `presLayout.height` — the first slide must NOT subtract the\n\t\t// start-Y from it. Otherwise a table that begins mid-slide gets a tiny first page (only a few\n\t\t// rows) while later pages, which already clamp to `h`, render normally. Mirror the\n\t\t// subsequent-slide rule below: never let an explicit `h` shrink the usable height below `h`.\n\t\tif (tableRowSlides.length === 0 && tablePropH && emuSlideTabH < tablePropH) emuSlideTabH = tablePropH\n\t\tif (tableRowSlides.length > 1) {\n\t\t\t// D: RULE: Use margins for starting point after the initial Slide, not `opt.y`\n\t\t\tif (typeof tableProps.autoPageSlideStartY === 'number') {\n\t\t\t\temuSlideTabH = (tablePropH || presLayout.height) - inch2Emu(tableProps.autoPageSlideStartY + arrInchMargins[2])\n\t\t\t} else if (tablePropY) {\n\t\t\t\temuSlideTabH =\n\t\t\t\t\t(tablePropH || presLayout.height) -\n\t\t\t\t\tinch2Emu(\n\t\t\t\t\t\t(tablePropY / EMU_PER_INCH < arrInchMargins[0] ? tablePropY / EMU_PER_INCH : arrInchMargins[0]) +\n\t\t\t\t\t\t\tarrInchMargins[2]\n\t\t\t\t\t)\n\t\t\t\t// Use whichever is greater: area between margins or the table H provided (dont shrink usable area - the whole point of over-riding Y on paging is to *increase* usable space)\n\t\t\t\tif (emuSlideTabH < tablePropH) emuSlideTabH = tablePropH\n\t\t\t}\n\t\t}\n\n\t\t// GUARD: a non-positive height, or one too small to fit even a single line of the base font,\n\t\t// means no row ever fits. That previously emitted degenerate empty overflow pages (rows:[]),\n\t\t// which made the recursive addTable throw \"Array expected\", or — with `h` smaller than one\n\t\t// line — placed one row per slide forever. Ignore the unusable height, fall back to the full\n\t\t// slide area between margins, and warn once rather than emit a broken table.\n\t\tconst emuBaseLineH = inch2Emu(\n\t\t\t((typeof tableProps.fontSize === 'number' ? tableProps.fontSize : DEF_FONT_SIZE) *\n\t\t\t\t(LINEH_MODIFIER + (tableProps.autoPageLineWeight || 0))) /\n\t\t\t\t100\n\t\t)\n\t\tif (emuSlideTabH < emuBaseLineH) {\n\t\t\tconst emuStartY =\n\t\t\t\ttableRowSlides.length === 0\n\t\t\t\t\t? tablePropY || inch2Emu(arrInchMargins[0])\n\t\t\t\t\t: inch2Emu(tableProps.autoPageSlideStartY || arrInchMargins[0])\n\t\t\tconst fallbackH = presLayout.height - emuStartY - inch2Emu(arrInchMargins[2])\n\t\t\tif (!warnedNoTabH) {\n\t\t\t\twarn(\n\t\t\t\t\t'table/autopage-height-too-small',\n\t\t\t\t\t'addTable/autoPage: the table height (`h`) leaves no room to paginate; ignoring it and using the slide height. Increase `h` or decrease `y`.'\n\t\t\t\t)\n\t\t\t\twarnedNoTabH = true\n\t\t\t}\n\t\t\temuSlideTabH = fallbackH > 0 ? fallbackH : presLayout.height\n\t\t}\n\t}\n\n\tif (tableProps.verbose) {\n\t\tconsole.log('[[VERBOSE MODE]]')\n\t\tconsole.log('|-- TABLE PROPS --------------------------------------------------------|')\n\t\tconsole.log(`| presLayout.width ................................ = ${(presLayout.width / EMU_PER_INCH).toFixed(1)}`)\n\t\tconsole.log(\n\t\t\t`| presLayout.height ............................... = ${(presLayout.height / EMU_PER_INCH).toFixed(1)}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| tableProps.x .................................... = ${typeof tableProps.x === 'number' ? (tableProps.x / EMU_PER_INCH).toFixed(1) : tableProps.x}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| tableProps.y .................................... = ${typeof tableProps.y === 'number' ? (tableProps.y / EMU_PER_INCH).toFixed(1) : tableProps.y}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| tableProps.w .................................... = ${typeof tableProps.w === 'number' ? (tableProps.w / EMU_PER_INCH).toFixed(1) : tableProps.w}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| tableProps.h .................................... = ${typeof tableProps.h === 'number' ? (tableProps.h / EMU_PER_INCH).toFixed(1) : tableProps.h}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| tableProps.slideMargin .......................... = ${tableProps.slideMargin ? String(tableProps.slideMargin) : ''}`\n\t\t)\n\t\tconsole.log(`| tableProps.margin ............................... = ${String(tableProps.margin)}`)\n\t\tconsole.log(`| tableProps.colW ................................. = ${String(tableProps.colW)}`)\n\t\tconsole.log(`| tableProps.autoPageSlideStartY .................. = ${tableProps.autoPageSlideStartY}`)\n\t\tconsole.log(`| tableProps.autoPageCharWeight ................... = ${tableProps.autoPageCharWeight}`)\n\t\tconsole.log('|-- CALCULATIONS -------------------------------------------------------|')\n\t\tconsole.log(`| tablePropX ...................................... = ${tablePropX / EMU_PER_INCH}`)\n\t\tconsole.log(`| tablePropY ...................................... = ${tablePropY / EMU_PER_INCH}`)\n\t\tconsole.log(`| tablePropW ...................................... = ${tablePropW / EMU_PER_INCH}`)\n\t\tconsole.log(`| tablePropH ...................................... = ${tablePropH / EMU_PER_INCH}`)\n\t\tconsole.log(`| tableCalcW ...................................... = ${tableCalcW / EMU_PER_INCH}`)\n\t}\n\n\t// STEP 1: Calculate margins\n\t{\n\t\t// Important: Use default size as zero cell margin is causing our tables to be too large and touch bottom of slide!\n\t\tif (!tableProps.slideMargin && tableProps.slideMargin !== 0) tableProps.slideMargin = DEF_SLIDE_MARGIN_IN[0]\n\n\t\tif (masterSlide && typeof masterSlide._margin !== 'undefined') {\n\t\t\tif (Array.isArray(masterSlide._margin)) arrInchMargins = masterSlide._margin\n\t\t\telse if (!isNaN(Number(masterSlide._margin))) {\n\t\t\t\tarrInchMargins = [\n\t\t\t\t\tNumber(masterSlide._margin),\n\t\t\t\t\tNumber(masterSlide._margin),\n\t\t\t\t\tNumber(masterSlide._margin),\n\t\t\t\t\tNumber(masterSlide._margin),\n\t\t\t\t]\n\t\t\t}\n\t\t} else if (tableProps.slideMargin || tableProps.slideMargin === 0) {\n\t\t\tif (Array.isArray(tableProps.slideMargin)) arrInchMargins = tableProps.slideMargin\n\t\t\telse if (!isNaN(tableProps.slideMargin))\n\t\t\t\tarrInchMargins = [\n\t\t\t\t\ttableProps.slideMargin,\n\t\t\t\t\ttableProps.slideMargin,\n\t\t\t\t\ttableProps.slideMargin,\n\t\t\t\t\ttableProps.slideMargin,\n\t\t\t\t]\n\t\t}\n\n\t\tif (tableProps.verbose)\n\t\t\tconsole.log(`| arrInchMargins .................................. = [${arrInchMargins.join(', ')}]`)\n\t}\n\n\t// STEP 2: Calculate number of columns\n\t{\n\t\t// NOTE: Cells may have a colspan, so merely taking the length of the [0] (or any other) row is not\n\t\t// ....: sufficient to determine column count. Therefore, check each cell for a colspan and total cols as reqd\n\t\tconst firstRow = tableRows[0] || []\n\t\tfirstRow.forEach((cell) => {\n\t\t\tif (!cell) cell = { _type: SlideObjectType.tablecell }\n\t\t\tconst cellOpts = cell.options || null\n\t\t\tnumCols += Number(cellOpts?.colspan ? cellOpts.colspan : 1)\n\t\t})\n\t\tif (tableProps.verbose) console.log(`| numCols ......................................... = ${numCols}`)\n\t}\n\n\t// Track per-column remaining rowspan depths so we can suppress page breaks that would\n\t// fall inside a rowspan group. colSpanDepths[c] = how many more rows column c is still\n\t// occupied by a rowspan that started in a previous row.\n\tconst colSpanDepths: number[] = new Array<number>(numCols).fill(0)\n\n\t// STEP 3: Calculate width using tableProps.colW if possible\n\tif (!tablePropW && tableProps.colW) {\n\t\ttableCalcW = Array.isArray(tableProps.colW)\n\t\t\t? tableProps.colW.reduce((p, n) => p + n) * EMU_PER_INCH\n\t\t\t: tableProps.colW * numCols || 0\n\t\tif (tableProps.verbose)\n\t\t\tconsole.log(`| tableCalcW ...................................... = ${tableCalcW / EMU_PER_INCH}`)\n\t}\n\n\t// STEP 4: Calculate usable width now that total usable space is known (`emuSlideTabW`)\n\t{\n\t\temuSlideTabW =\n\t\t\ttableCalcW || inch2Emu((tablePropX ? tablePropX / EMU_PER_INCH : arrInchMargins[1]) + arrInchMargins[3])\n\t\tif (tableProps.verbose)\n\t\t\tconsole.log(`| emuSlideTabW .................................... = ${(emuSlideTabW / EMU_PER_INCH).toFixed(1)}`)\n\t}\n\n\t// STEP 5: Calculate column widths if not provided (emuSlideTabW will be used below to determine lines-per-col)\n\tif (!tableProps.colW || !Array.isArray(tableProps.colW)) {\n\t\tif (tableProps.colW && !isNaN(Number(tableProps.colW))) {\n\t\t\tconst arrColW: number[] = []\n\t\t\tconst colW = Number(tableProps.colW)\n\t\t\tconst firstRow = tableRows[0] || []\n\t\t\tfirstRow.forEach(() => arrColW.push(colW))\n\t\t\ttableProps.colW = []\n\t\t\tarrColW.forEach((val) => {\n\t\t\t\tif (Array.isArray(tableProps.colW)) tableProps.colW.push(val)\n\t\t\t})\n\t\t} else {\n\t\t\t// No column widths provided? Then distribute cols.\n\t\t\ttableProps.colW = []\n\t\t\tfor (let iCol = 0; iCol < numCols; iCol++) {\n\t\t\t\ttableProps.colW.push(emuSlideTabW / EMU_PER_INCH / numCols)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Resolve a row's explicit height (inches) from the original `rowH` *array*, keyed by original\n\t// row index. A single-number `rowH` is left to propagate via table options (it applies uniformly,\n\t// so it needs no per-row remapping); only the array form is index-sensitive after pagination.\n\tconst resolveRowH = (origRowIdx: number): number | undefined =>\n\t\tArray.isArray(tableProps.rowH) && typeof tableProps.rowH[origRowIdx] === 'number'\n\t\t\t? tableProps.rowH[origRowIdx]\n\t\t\t: undefined\n\n\t// STEP 6: **MAIN** Iterate over rows, add table content, create new slides as rows overflow\n\tlet newTableRowSlide: TableRowSlide = { rows: [] as TableRow[], rowH: [] as Array<number | undefined> }\n\ttableRows.forEach((row, iRow) => {\n\t\t// A: Row variables — detect active rowspan at the start of this row so we can\n\t\t// suppress page breaks that would split a rowspan group across slides.\n\t\tconst hasActiveRowSpan = colSpanDepths.some((d) => d > 0)\n\t\tconst rowCellLines: AutoPageCell[] = []\n\t\tlet maxCellMarTopEmu = 0\n\t\tlet maxCellMarBtmEmu = 0\n\n\t\t// B: Create new row in data model, calc `maxCellMar*`\n\t\tlet currTableRow: TableRow = []\n\t\trow.forEach((cell) => {\n\t\t\tcurrTableRow.push({\n\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\ttext: [],\n\t\t\t\toptions: cell.options,\n\t\t\t})\n\n\t\t\t// Cell margins are inches (see `marginToEmu`); prefer the cell's own top/bottom margin, else the table's.\n\t\t\tconst cellMargin = Array.isArray(cell.options?.margin) ? cell.options.margin : undefined\n\t\t\tconst tableMargin = Array.isArray(tableProps.margin) ? tableProps.margin : null\n\t\t\tif (cellMargin?.[0] && marginToEmu(cellMargin[0]) > maxCellMarTopEmu)\n\t\t\t\tmaxCellMarTopEmu = marginToEmu(cellMargin[0])\n\t\t\telse if (tableMargin?.[0] && marginToEmu(tableMargin[0]) > maxCellMarTopEmu)\n\t\t\t\tmaxCellMarTopEmu = marginToEmu(tableMargin[0])\n\t\t\tif (cellMargin?.[2] && marginToEmu(cellMargin[2]) > maxCellMarBtmEmu)\n\t\t\t\tmaxCellMarBtmEmu = marginToEmu(cellMargin[2])\n\t\t\telse if (tableMargin?.[2] && marginToEmu(tableMargin[2]) > maxCellMarBtmEmu)\n\t\t\t\tmaxCellMarBtmEmu = marginToEmu(tableMargin[2])\n\t\t})\n\n\t\t// C: Calc usable vertical space/table height. Set default value first, adjust below when necessary.\n\t\tcalcSlideTabH()\n\t\temuTabCurrH += maxCellMarTopEmu + maxCellMarBtmEmu // Start row height with margins\n\t\tif (tableProps.verbose && iRow === 0)\n\t\t\tconsole.log(\n\t\t\t\t`| SLIDE [${tableRowSlides.length}]: emuSlideTabH ...... = ${(emuSlideTabH / EMU_PER_INCH).toFixed(1)} `\n\t\t\t)\n\n\t\t// D: --==[[ BUILD DATA SET ]]==-- (iterate over cells: split text into lines[], set `lineHeight`)\n\t\trow.forEach((cell, iCell) => {\n\t\t\tconst newCellOptions = cell.options || {}\n\t\t\tconst newCell: AutoPageCell = {\n\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\t_lines: [],\n\t\t\t\t_lineHeight: inch2Emu(\n\t\t\t\t\t((cell.options?.fontSize\n\t\t\t\t\t\t? cell.options.fontSize\n\t\t\t\t\t\t: tableProps.fontSize\n\t\t\t\t\t\t\t? tableProps.fontSize\n\t\t\t\t\t\t\t: DEF_FONT_SIZE) *\n\t\t\t\t\t\t(LINEH_MODIFIER + (tableProps.autoPageLineWeight ? tableProps.autoPageLineWeight : 0))) /\n\t\t\t\t\t\t100\n\t\t\t\t),\n\t\t\t\ttext: [],\n\t\t\t\toptions: newCellOptions,\n\t\t\t}\n\n\t\t\t// E-1: Exempt cells with `rowspan` from increasing lineHeight (or we could create a new slide when unecessary!)\n\t\t\tif (newCellOptions.rowspan) newCell._lineHeight = 0\n\n\t\t\t// E-2: The parseTextToLines method uses `autoPageCharWeight`, so inherit from table options\n\t\t\tnewCellOptions.autoPageCharWeight = tableProps.autoPageCharWeight || undefined\n\n\t\t\t// E-3: **MAIN** Parse cell contents into lines based upon col width, font, etc\n\t\t\tconst tableColW = Array.isArray(tableProps.colW) ? tableProps.colW : []\n\t\t\tlet totalColW = tableColW[iCell] ?? 0\n\t\t\tconst cellColspan = cell.options?.colspan\n\t\t\tif (cellColspan) {\n\t\t\t\ttotalColW = tableColW\n\t\t\t\t\t.filter((_cell, idx) => idx >= iCell && idx < idx + cellColspan)\n\t\t\t\t\t.reduce((prev, curr) => prev + curr)\n\t\t\t}\n\n\t\t\t// E-4: Create lines based upon available column width\n\t\t\tnewCell._lines = parseTextToLines(cell, totalColW, false)\n\n\t\t\t// E-5: Add cell to array\n\t\t\trowCellLines.push(newCell)\n\t\t})\n\n\t\t/** E: --==[[ PAGE DATA SET ]]==--\n\t\t * Add text one-line-a-time to this row's cells until: lines are exhausted OR table height limit is hit\n\t\t *\n\t\t * Design:\n\t\t * - Building cells L-to-R/loop style wont work as one could be 100 lines and another 1 line\n\t\t * - Therefore, build the whole row, one-line-at-a-time, across each table columns\n\t\t * - Then, when the vertical size limit is hit is by any of the cells, make a new slide and continue adding any remaining lines\n\t\t *\n\t\t * Implementation:\n\t\t * - `rowCellLines` is an array of cells, one for each column in the table, with each cell containing an array of lines\n\t\t *\n\t\t * Sample Data:\n\t\t * - `rowCellLines` ..: [ TableCell, TableCell, TableCell ]\n\t\t * - `TableCell` .....: { _type: 'tablecell', _lines: TableCell[], _lineHeight: 10 }\n\t\t * - `_lines` ........: [ {_type: 'tablecell', text: 'cell-1,line-1', options: {…}}, {_type: 'tablecell', text: 'cell-1,line-2', options: {…}} }\n\t\t * - `_lines` is TableCell[] (the 1-N words in the line)\n\t\t * {\n\t\t * _lines: [{ text:'cell-1,line-1' }, { text:'cell-1,line-2' }], // TOTAL-CELL-HEIGHT = 2\n\t\t * _lines: [{ text:'cell-2,line-1' }, { text:'cell-2,line-2' }], // TOTAL-CELL-HEIGHT = 2\n\t\t * _lines: [{ text:'cell-3,line-1' }, { text:'cell-3,line-2' }, { text:'cell-3,line-3' }, { text:'cell-3,line-4' }], // TOTAL-CELL-HEIGHT = 4\n\t\t * }\n\t\t *\n\t\t * Example: 2 rows, with the firstrow overflowing onto a new slide\n\t\t * SLIDE 1:\n\t\t * |--------|--------|--------|--------|\n\t\t * | line-1 | line-1 | line-1 | line-1 |\n\t\t * | | | line-2 | |\n\t\t * | | | line-3 | |\n\t\t * |--------|--------|--------|--------|\n\t\t *\n\t\t * SLIDE 2:\n\t\t * |--------|--------|--------|--------|\n\t\t * | | | line-4 | |\n\t\t * |--------|--------|--------|--------|\n\t\t * | line-1 | line-1 | line-1 | line-1 |\n\t\t * |--------|--------|--------|--------|\n\t\t */\n\t\tif (tableProps.verbose) console.log(`\\n| SLIDE [${tableRowSlides.length}]: ROW [${iRow}]: START...`)\n\t\tlet currCellIdx = 0\n\t\tlet emuLineMaxH = 0\n\t\tlet isDone = false\n\t\twhile (!isDone) {\n\t\t\tconst srcCell = rowCellLines[currCellIdx]\n\t\t\tif (!srcCell) break\n\t\t\tlet tgtCell = currTableRow[currCellIdx] // NOTE: may be redefined below (a new row may be created, thus changing this value)\n\n\t\t\t// 1: calc emuLineMaxH\n\t\t\trowCellLines.forEach((cell) => {\n\t\t\t\tif (cell._lineHeight >= emuLineMaxH) emuLineMaxH = cell._lineHeight\n\t\t\t})\n\n\t\t\t// 2: create a new slide if there is insufficient room for the current row,\n\t\t\t// but never break inside a rowspan group — keep spanned rows together.\n\t\t\tif (emuTabCurrH + emuLineMaxH > emuSlideTabH && !hasActiveRowSpan) {\n\t\t\t\tif (tableProps.verbose) {\n\t\t\t\t\tconsole.log('\\n|-----------------------------------------------------------------------|')\n\t\t\t\t\t// prettier-ignore\n\t\t\t\t\tconsole.log(`|-- NEW SLIDE CREATED (currTabH+currLineH > maxH) => ${(emuTabCurrH / EMU_PER_INCH).toFixed(2)} + ${(srcCell._lineHeight / EMU_PER_INCH).toFixed(2)} > ${emuSlideTabH / EMU_PER_INCH}`)\n\t\t\t\t\tconsole.log('|-----------------------------------------------------------------------|\\n\\n')\n\t\t\t\t}\n\n\t\t\t\t// A: add current row slide or it will be lost (only if it has rows and text)\n\t\t\t\tif (\n\t\t\t\t\tcurrTableRow.length > 0 &&\n\t\t\t\t\tcurrTableRow.map((cell) => (Array.isArray(cell.text) ? cell.text.length : 0)).reduce((p, n) => p + n) > 0\n\t\t\t\t) {\n\t\t\t\t\tnewTableRowSlide.rows.push(currTableRow)\n\t\t\t\t\tnewTableRowSlide.rowH?.push(resolveRowH(iRow))\n\t\t\t\t}\n\n\t\t\t\t// B: add current slide to Slides array (never push an empty page: a row that does not\n\t\t\t\t// fit yet has no content here, and an empty `rows` slide crashes the recursive addTable)\n\t\t\t\tif (newTableRowSlide.rows.length > 0) tableRowSlides.push(newTableRowSlide)\n\n\t\t\t\t// C: reset working/curr slide to hold rows as they're created\n\t\t\t\tconst newRows: TableRow[] = []\n\t\t\t\tnewTableRowSlide = { rows: newRows, rowH: [] as Array<number | undefined> }\n\n\t\t\t\t// D: reset working/curr row\n\t\t\t\tcurrTableRow = []\n\t\t\t\trow.forEach((cell) => currTableRow.push({ _type: SlideObjectType.tablecell, text: [], options: cell.options }))\n\n\t\t\t\t// E: Calc usable vertical space/table height now as we may still be in the same row and code above (\"C: Calc usable vertical space/table height.\") calc may now be invalid\n\t\t\t\tcalcSlideTabH()\n\n\t\t\t\t// F: reset current table height for this new Slide, then re-charge the row's cell\n\t\t\t\t// margins onto it — the row is starting over here, so it owes them again.\n\t\t\t\t//\n\t\t\t\t// ORDER IS LOAD-BEARING. These two statements used to run the other way round: the\n\t\t\t\t// margins were added and then wiped by the reset, so the first row of every\n\t\t\t\t// continuation slide was the only row in the table that paid no margin. That let a\n\t\t\t\t// continuation slide accept one row more than it had room for, and the extra row\n\t\t\t\t// hung off the bottom of the slide (upstream gitbrent/PptxGenJS#1200). The symptom\n\t\t\t\t// is easy to miss because the pager is *self*-consistent per slide: it only shows\n\t\t\t\t// up as the first slide and the continuation slides disagreeing about how many\n\t\t\t\t// identical rows fit the identical space — which is what\n\t\t\t\t// test/regression/table-autopage-continuation-budget.test.js pins.\n\t\t\t\temuTabCurrH = maxCellMarTopEmu + maxCellMarBtmEmu\n\t\t\t\tif (tableProps.verbose)\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t`| SLIDE [${tableRowSlides.length}]: emuSlideTabH ...... = ${(emuSlideTabH / EMU_PER_INCH).toFixed(1)} `\n\t\t\t\t\t)\n\n\t\t\t\t// G: handle repeat headers option /or/ Add new empty row to continue current lines into\n\t\t\t\tif (tableProps.autoPageRepeatHeader && tableProps._arrObjTabHeadRows) {\n\t\t\t\t\ttableProps._arrObjTabHeadRows.forEach((row, headIdx) => {\n\t\t\t\t\t\tconst newHeadRow: TableRow = []\n\t\t\t\t\t\tlet maxLineHeight = 0\n\t\t\t\t\t\trow.forEach((cell) => {\n\t\t\t\t\t\t\tnewHeadRow.push(cell)\n\t\t\t\t\t\t\tif ((cell._lineHeight || 0) > maxLineHeight) maxLineHeight = cell._lineHeight || 0\n\t\t\t\t\t\t})\n\t\t\t\t\t\tnewTableRowSlide.rows.push(newHeadRow)\n\t\t\t\t\t\t// Repeated header rows are the original leading rows, so carry their configured height.\n\t\t\t\t\t\tnewTableRowSlide.rowH?.push(resolveRowH(headIdx))\n\t\t\t\t\t\t// NOTE: possible imprecision — this accumulates line height only; cell top/bottom\n\t\t\t\t\t\t// margins are not added, so autoPage row-height estimates can run slightly short.\n\t\t\t\t\t\temuTabCurrH += maxLineHeight\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t// WIP: NEW: TEST THIS!!\n\t\t\t\ttgtCell = currTableRow[currCellIdx]\n\t\t\t}\n\n\t\t\t// 3: set array of words that comprise this line\n\t\t\tconst currLine = srcCell._lines.shift()\n\n\t\t\t// 4: create new line by adding all words from curr line (or add empty if there are no words to avoid \"needs repair\" issue triggered when cells have null content)\n\t\t\tif (tgtCell && Array.isArray(tgtCell.text)) {\n\t\t\t\tif (currLine) tgtCell.text = tgtCell.text.concat(currLine)\n\t\t\t\telse if (tgtCell.text.length === 0)\n\t\t\t\t\ttgtCell.text = tgtCell.text.concat({ _type: SlideObjectType.tablecell, text: '' })\n\t\t\t\t// IMPORTANT: ^^^ add empty if there are no words to avoid \"needs repair\" issue triggered when cells have null content\n\t\t\t}\n\n\t\t\t// 5: increase table height by the curr line height (if we're on the last column)\n\t\t\tif (currCellIdx === rowCellLines.length - 1) emuTabCurrH += emuLineMaxH\n\n\t\t\t// 6: advance column/cell index (or circle back to first one to continue adding lines)\n\t\t\tcurrCellIdx = currCellIdx < rowCellLines.length - 1 ? currCellIdx + 1 : 0\n\n\t\t\t// 7: WIP: done?\n\t\t\tconst brent = rowCellLines.map((cell) => cell._lines.length).reduce((prev, next) => prev + next)\n\t\t\tif (brent === 0) isDone = true\n\t\t}\n\n\t\t// F: Flush/capture row buffer before it resets at the top of this loop\n\t\tif (currTableRow.length > 0) {\n\t\t\tnewTableRowSlide.rows.push(currTableRow)\n\t\t\tnewTableRowSlide.rowH?.push(resolveRowH(iRow))\n\t\t}\n\n\t\t// G: Update colSpanDepths for the next row's hasActiveRowSpan check.\n\t\t// Snapshot occupied columns *before* adding new spans from this row so that\n\t\t// cells in this row are placed correctly even when the row itself starts spans.\n\t\tconst occupiedBefore = [...colSpanDepths]\n\t\tlet colCursor = 0\n\t\trow.forEach((cell) => {\n\t\t\twhile (colCursor < numCols && (occupiedBefore[colCursor] ?? 0) > 0) colCursor++\n\t\t\tconst cellColspan = cell.options?.colspan ?? 1\n\t\t\tconst cellRowspan = cell.options?.rowspan ?? 1\n\t\t\tif (cellRowspan > 1) {\n\t\t\t\tfor (let c = 0; c < cellColspan && colCursor + c < numCols; c++) {\n\t\t\t\t\tcolSpanDepths[colCursor + c] = cellRowspan\n\t\t\t\t}\n\t\t\t}\n\t\t\tcolCursor += cellColspan\n\t\t})\n\t\t// Consume one row from every active span (including ones just opened above).\n\t\tfor (let c = 0; c < numCols; c++) {\n\t\t\tconst depth = colSpanDepths[c] ?? 0\n\t\t\tif (depth > 0) colSpanDepths[c] = depth - 1\n\t\t}\n\n\t\tif (tableProps.verbose) {\n\t\t\tconsole.log(\n\t\t\t\t`- SLIDE [${tableRowSlides.length}]: ROW [${iRow}]: ...COMPLETE ...... emuTabCurrH = ${(emuTabCurrH / EMU_PER_INCH).toFixed(2)} ( emuSlideTabH = ${(\n\t\t\t\t\temuSlideTabH / EMU_PER_INCH\n\t\t\t\t).toFixed(2)} )`\n\t\t\t)\n\t\t}\n\t})\n\n\t// STEP 7: Flush buffer / add final slide (skip an empty trailing buffer; always keep at least\n\t// one slide so a non-empty table is never reduced to zero pages)\n\tif (newTableRowSlide.rows.length > 0 || tableRowSlides.length === 0) tableRowSlides.push(newTableRowSlide)\n\n\tif (tableProps.verbose) {\n\t\tconsole.log('\\n|================================================|')\n\t\tconsole.log(`| FINAL: tableRowSlides.length = ${tableRowSlides.length}`)\n\t\ttableRowSlides.forEach((slide) => console.log(slide))\n\t\tconsole.log('|================================================|\\n\\n')\n\t}\n\n\t// LAST:\n\treturn tableRowSlides\n}\n"],"mappings":";;;;;;;;;AAuCA,SAAS,iBAAiB,MAAiB,UAAkB,SAAkC;CAK9F,MAAM,OAAO,OAAO,KAAK,SAAS,qBAAqB,KAAK,QAAQ,qBAAqB;CACzF,MAAM,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5B,iBAAiB,KAAK,KAAK,YAAY;GACvC,iBAAiB,MAAM,KAAK,YAAY,IAAI,CAAC;EAC9C;EAKA,MAAM,iBAAiB,CAAC,GAAG,aAAa;EACxC,IAAI,YAAY;EAChB,IAAI,SAAS,SAAS;GACrB,OAAO,YAAY,YAAY,eAAe,cAAc,KAAK,GAAG;GACpE,MAAM,cAAc,KAAK,SAAS,WAAW;GAC7C,MAAM,cAAc,KAAK,SAAS,WAAW;GAC7C,IAAI,cAAc,GACjB,KAAK,IAAI,IAAI,GAAG,IAAI,eAAe,YAAY,IAAI,SAAS,KAC3D,cAAc,YAAY,KAAK;GAGjC,aAAa;EACd,CAAC;EAED,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,KAAK;GACjC,MAAM,QAAQ,cAAc,MAAM;GAClC,IAAI,QAAQ,GAAG,cAAc,KAAK,QAAQ;EAC3C;EAEA,IAAI,WAAW,SACd,QAAQ,IACP,YAAY,eAAe,OAAO,UAAU,KAAK,uCAAuC,cAAc,aAAA,CAAc,QAAQ,CAAC,EAAE,qBAC9H,eAAe,aAAA,CACd,QAAQ,CAAC,EAAE,GACd;CAEF,CAAC;CAID,IAAI,iBAAiB,KAAK,SAAS,KAAK,eAAe,WAAW,GAAG,eAAe,KAAK,gBAAgB;CAEzG,IAAI,WAAW,SAAS;EACvB,QAAQ,IAAI,sDAAsD;EAClE,QAAQ,IAAI,oCAAoC,eAAe,QAAQ;EACvE,eAAe,SAAS,UAAU,QAAQ,IAAI,KAAK,CAAC;EACpD,QAAQ,IAAI,wDAAwD;CACrE;CAGA,OAAO;AACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"diagnostics-B2yWpcjB.d.ts","names":[],"sources":["../src/types/zoom.ts","../src/types/internal.ts","../src/runtime/types.ts","../src/units.ts","../src/presentation.ts","../src/clip.ts","../src/diagnostics.ts"],"mappings":";;;;;;;UAiBiB,sBAAsB;;EAEtC;;;;;EAKA;IAAe;IAAe;;;;;;EAK9B;;EAEA;;;UA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AAkB;MACzC;;;;;;;;;;;;;;;;;;;;;;;EAmCG,UAAU;IACf;IACA,OAAO,cAAc;IACrB;IACA,QAAQ;MACL;;;;;;;;;;;;;;;;EA6DJ,YAAY,eAAe,aAAa,MAAM,qBAAqB;;;;;;;;;;;EAcnE,aAAa,eAAe,aAAa,MAAM;;;;;;;;;;;;;;;;;;;EAuB/C,YAAY,MAAM,YAAY,MAAM,aAAa;;;;;;;;;EAc3C,QAAQ,QAAQ,iBAAiB,QAAQ;;;;;;EAazC,MAAM,QAAQ,aAAa,iBAAiB,cAAc,OAAO;;;;;;;;;;;;;;;;;EAwBjE,QAAQ,QAAQ,aAAa,QAAQ;;;;;;;EAYrC,UAAU,QAAQ,iBAAiB;;;;;;;EAoBzC,kBAAkB,cAAc,OAAO;;;;;;EAUvC,WAAW,SAAS;;;;;;EA+BpB,SAAS,UAAU,gBAAgB;;;;;;EAsEnC,aAAa,QAAQ;;;;;EAwBrB,kBAAkB,OAAO;;;;;;;;KCp9Bd;;;;;;;KAQA;;KAGA;;;;;;EAKT;EAAmB,MAAM;EAAU,SAAS;;;;;;;;;;;;;;;;;;;;;iBAiH/B,SAAS,OAAO,WAAW,WAAW,YAAY;;;;UC1IjD;;WAEP,MAAM;;WAEN;;;;;WAKA,SAAS,SAAS;;;KAIhB,qBAAqB,YAAY;;;;;;;;;;;;;;;;;;;;;iBAgC7B,qBAAqB,MAAM"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"html-dom-CzewEdE1.js","names":[],"sources":["../src/gen/table/html-dom.ts"],"sourcesContent":["/**\n * ts-pptx: HTML-table → slides (browser DOM path)\n *\n * The tableToSlides() flow: reproduce an HTML table as a PowerPoint table across as many\n * slides as needed. The DOM-independent parts are factored into pure helpers\n * (`resolveHtmlColWidth`, `pickColWidthBasis`, `htmlBorderToProps`, `cssColorToHex`) that\n * are unit-tested directly, and the whole flow runs anywhere there is a DOM.\n *\n * Only real *measurement* is out of active scope (see AGENTS.md): without a layout engine\n * `offsetWidth` is `0`, so widths fall back to computed CSS then to an equal split. A fallback\n * rather than a degradation, and the distinction is load-bearing — see {@link pickColWidthBasis},\n * whose two bases measure different boxes.\n *\n * **Coverage.** This file used to be excluded from the report, on the grounds that only the\n * browser entry imported it and the `dist/browser*.js` globs therefore swallowed it. Both\n * halves of that are stale: `ts-pptx/html` imports it too, so tsdown emits it as its own\n * `dist/html-dom-*.js` chunk, and those globs are gone from `vitest.config.ts` entirely. It\n * is covered code now — against happy-dom by the Node suite\n * (test/regression/html-to-slides-node.test.js) and, for the measured width basis that no\n * Node DOM can produce, in a real Chromium (test/browser/table-widths.spec.mjs).\n */\n\nimport { SlideObjectType } from '../../enums.js'\nimport type {\n\tAddSlideProps,\n\tBorderProps,\n\tPresLayout,\n\tTableCell,\n\tTableToSlidesDocument,\n\tTableToSlidesElement,\n\tTableToSlidesProps,\n\tTableCellProps,\n} from '../../types/index.js'\nimport type { Slide } from '../../types/slide.js'\nimport type { SlideLayoutInternal } from '../../types/internal.js'\nimport { inch2Emu } from '../../units-internal.js'\nimport { warn } from '../../diagnostics.js'\nimport { DEFAULT_PX_PER_INCH, EMU_PER_INCH } from '../../units.js'\nimport { getSlidesForTableRows } from './autopage.js'\nimport { InvalidOptionError } from '../../errors.js'\n\ntype MarginTuple = [number, number, number, number]\ntype BorderTuple = [BorderProps, BorderProps, BorderProps, BorderProps]\n/**\n * What `tableToSlides` needs a presentation to be: somewhere to put slides, and a layout to\n * size them against. Structural on purpose — stating the two members rather than naming the\n * class is what lets the free function on `ts-pptx/html` take any presentation instance\n * (Node, browser, or standalone) without the entry importing one.\n */\nexport type TableToSlidesHost = {\n\taddSlide: (options?: AddSlideProps) => Slide\n\tpresLayout: PresLayout\n}\n\n/**\n * The whole DOM surface `genTableToSlides` needs: the table element, and a way to read a\n * cell's computed style.\n *\n * Resolving this once up front is what decouples the flow from `window`/`document`. Given the\n * element itself, both halves come from the element's own `ownerDocument`/`defaultView`, so no\n * global is read at all — which is what lets the same implementation run outside a browser.\n */\ntype DomContext = {\n\ttable: Element\n\tgetComputedStyle: (el: Element) => CSSStyleDeclaration\n}\n\n/**\n * Stand-in for `getComputedStyle` on a document that has no view — a document produced by\n * parsing rather than by a browsing context has a `null` `defaultView` and therefore no\n * cascade to compute against. Every property reads as `''`, which every consumer below\n * already treats as \"not set\", so styling degrades to defaults instead of throwing.\n */\nconst NO_COMPUTED_STYLE = {\n\tgetPropertyValue: () => '',\n} as unknown as CSSStyleDeclaration\n\n/**\n * Bind a style reader to the document's own view, falling back to {@link NO_COMPUTED_STYLE}.\n * @param {Document | null} doc - the table's owner document\n * @returns {(el: Element) => CSSStyleDeclaration} computed-style reader\n */\nfunction resolveStyleReader(doc: Document | null): (el: Element) => CSSStyleDeclaration {\n\tconst view = doc?.defaultView\n\treturn view ? view.getComputedStyle.bind(view) : () => NO_COMPUTED_STYLE\n}\n\n/**\n * Resolve the table element and its style reader from whatever the caller passed.\n *\n * An **element** needs no ambient DOM: the document and its view are reached through\n * `ownerDocument`/`defaultView`. A **string id** does need one, taken from `options.document`\n * when supplied and otherwise from `globalThis.document`; with neither, the error names both\n * remedies rather than surfacing a bare `document is not defined`.\n *\n * This is the one place the public structural element type ({@link TableToSlidesElement},\n * which any DOM satisfies) is narrowed to `lib.dom`'s `Element`, so the rest of the flow can\n * be written against ordinary DOM types. The cast is safe in the only sense that matters here:\n * everything downstream reads standard members and tolerates them being absent — that is what\n * makes the conversion portable in the first place.\n * @param {TableToSlidesElement | string} target - the table element, or the id of one\n * @param {TableToSlidesProps} options - generation options (may carry an explicit `document`)\n * @returns {DomContext} resolved DOM context\n */\nfunction resolveDomContext(target: TableToSlidesElement | string, options: TableToSlidesProps): DomContext {\n\tconst asElement = (element: TableToSlidesElement): Element => element as unknown as Element\n\n\tif (typeof target !== 'string') {\n\t\tconst table = asElement(target)\n\t\treturn { table, getComputedStyle: resolveStyleReader(table.ownerDocument) }\n\t}\n\n\tconst doc = options.document ?? (globalThis as { document?: TableToSlidesDocument }).document\n\tif (!doc) {\n\t\tthrow new InvalidOptionError(\n\t\t\t'html/no-document',\n\t\t\t'tableToSlides: no DOM available to resolve the table id \"' +\n\t\t\t\ttarget +\n\t\t\t\t'\" — pass the <table> element itself, or supply a document via `options.document`.'\n\t\t)\n\t}\n\tconst found = doc.getElementById(target)\n\tif (!found)\n\t\tthrow new InvalidOptionError('html/table-not-found', 'tableToSlides: Table ID \"' + target + '\" does not exist!')\n\tconst table = asElement(found)\n\treturn { table, getComputedStyle: resolveStyleReader(table.ownerDocument) }\n}\n\n// ===== DOM-table helpers (browser path) =====\n// DOM-independent helpers factored out of the browser-only tableToSlides() flow\n// so they can be unit-tested without a rendered page (see AGENTS.md scope note).\n\n/**\n * Convert one 0-255 RGB component to its two-digit hex form.\n *\n * Lives here rather than beside the other color code in `gen/drawingml/color.ts` because\n * `getComputedStyle` colors are the only thing in the package that arrives as RGB\n * components — nothing else in the library calls this.\n * @param {number} c - component color\n * @returns {string} hex string\n */\nfunction componentToHex(c: number): string {\n\tconst hex = c.toString(16)\n\treturn hex.length === 1 ? '0' + hex : hex\n}\n\n/**\n * Converts RGB colors from css selectors to Hex for Presentation colors\n * @param {number} r - red value\n * @param {number} g - green value\n * @param {number} b - blue value\n * @returns {string} XML string\n */\nfunction rgbToHex(r: number, g: number, b: number): string {\n\treturn (componentToHex(r) + componentToHex(g) + componentToHex(b)).toUpperCase()\n}\n\n/**\n * Convert a computed CSS border (width string + color string) from `getComputedStyle` into a\n * pptx `BorderProps`.\n *\n * Preserves *fractional* widths: a hairline CSS border such as `0.5px` must not be rounded to\n * `0pt` and silently vanish — the table serializer (`valToPts`) emits fractional points just\n * fine, so there is no reason to integer-round here. A\n * computed width of `0` (or a non-finite value) yields `{ type: 'none' }` so we never emit a\n * zero-width line.\n * @param {string} widthStr - computed `border-<side>-width`, e.g. `\"0.5px\"`\n * @param {string} colorStr - computed `border-<side>-color`, e.g. `\"rgb(102, 102, 102)\"`\n * @returns {BorderProps} border props for the cell side\n */\nexport function htmlBorderToProps(widthStr: string, colorStr: string): BorderProps {\n\tconst pt = Number(String(widthStr).replace('px', ''))\n\tif (!isFinite(pt) || pt <= 0) return { type: 'none' }\n\treturn { width: pt, color: cssColorToHex(colorStr) ?? '000000' }\n}\n\n/**\n * Convert a computed CSS color to a pptx hex color, or report that it has none.\n *\n * A browser normalizes every computed color to `rgb()`/`rgba()`, which is why the flow below\n * originally only parsed that form. Outside a browser there is no normalization step, so a\n * computed color comes back however the stylesheet wrote it — `#ff0000` is what happy-dom\n * returns. Feeding that to the `rgb()` parser produced `Number('#ff0000')` → `NaN` → the\n * literal color string `\"NANNANNAN\"`, an invalid value emitted without complaint.\n *\n * Handles `rgb()`/`rgba()` and `#rgb`/`#rrggbb`. Everything else — a named color, a `color()`\n * function, an empty string — returns `undefined` rather than a guess, so the caller can\n * apply its own default instead of emitting nonsense.\n *\n * A fully transparent color (`alpha === 0`) also returns `undefined`: it states the absence of\n * a color, and pptx has no way to say \"transparent\" in a solid fill.\n * @param {string} value - computed CSS color, e.g. `\"rgb(255, 0, 0)\"` or `\"#ff0000\"`\n * @returns {string | undefined} six-digit uppercase hex, or `undefined` when unparseable\n */\nexport function cssColorToHex(value: string): string | undefined {\n\tconst raw = String(value ?? '').trim()\n\n\tconst rgbMatch = /^rgba?\\(([^)]*)\\)$/i.exec(raw)\n\tif (rgbMatch) {\n\t\tconst parts = (rgbMatch[1] ?? '').split(/[,/\\s]+/).filter((part) => part.length > 0)\n\t\tif (parts.length < 3) return undefined\n\t\tconst channels = parts.slice(0, 3).map((part) => Number(part.replace('%', '')))\n\t\tif (channels.some((channel) => !isFinite(channel))) return undefined\n\t\tif (parts.length > 3 && Number(parts[3]) === 0) return undefined\n\t\t// Clamp and round before hex conversion: a browser always computes whole 0-255\n\t\t// channels, but nothing guarantees another DOM does, and `(255.5).toString(16)`\n\t\t// is `\"ff.8\"` — a malformed color rather than a wrong one.\n\t\tconst [r = 0, g = 0, b = 0] = channels.map((channel) => Math.max(0, Math.min(255, Math.round(channel))))\n\t\treturn rgbToHex(r, g, b)\n\t}\n\n\tconst hexMatch = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(raw)\n\tif (hexMatch) {\n\t\tconst digits = hexMatch[1] ?? ''\n\t\tconst full =\n\t\t\tdigits.length === 3\n\t\t\t\t? digits\n\t\t\t\t\t\t.split('')\n\t\t\t\t\t\t.map((digit) => digit + digit)\n\t\t\t\t\t\t.join('')\n\t\t\t\t: digits\n\t\treturn full.toUpperCase()\n\t}\n\n\treturn undefined\n}\n\n/**\n * Resolve a single HTML-table column width for `tableToSlides`.\n *\n * Precedence: an explicit `data-pptx-width` wins outright; otherwise the proportional width\n * derived from the live table is used, raised to `data-pptx-min-width` when that floor is larger.\n *\n * Hidden tables report `offsetWidth` 0 for every cell, which makes `calcWidth` non-finite (a 0/0\n * proportional calc). Fall back to `0` there so an explicit `data-pptx-width` / `data-pptx-min-width`\n * override still drives the column instead of emitting a `NaN` width.\n * @param {number} calcWidth - proportional width derived from `offsetWidth` (may be `NaN` for hidden tables)\n * @param {number} setWidth - `data-pptx-width` override (`0`/`NaN` when absent or invalid)\n * @param {number} minWidth - `data-pptx-min-width` floor (`0`/`NaN` when absent or invalid)\n * @returns {number} resolved column width\n */\nexport function resolveHtmlColWidth(calcWidth: number, setWidth: number, minWidth: number): number {\n\tconst safeCalc = isFinite(calcWidth) ? calcWidth : 0\n\tif (isFinite(setWidth) && setWidth > 0) return setWidth\n\treturn isFinite(minWidth) && minWidth > safeCalc ? minWidth : safeCalc\n}\n\n/** A CSS value that is a bare number, or a number with a `px`/`%` unit. Nothing else parses. */\nconst CSS_LENGTH = /^\\s*(-?(?:\\d+\\.?\\d*|\\.\\d+))\\s*(px|%)?\\s*$/i\n\n/**\n * Parse a single computed CSS length in **px** to its numeric magnitude.\n *\n * A bare number is read as px (computed styles do not emit one, but an inline `style` read\n * back by a non-browser DOM can). Everything else — `''`, `auto`, `3em`, and deliberately\n * `30%` — is `NaN`: a percentage is meaningful only relative to something, so it cannot be\n * turned into an absolute length here. (Percentages *are* usable as a proportional column\n * basis; that is {@link parseCssWidthBasis}'s job, not this one's.) Callers decide what a\n * `NaN` means for them.\n * @param {string} value - computed CSS value, e.g. `\"1.5px\"`\n * @returns {number} magnitude in px, or `NaN` when the value is not an absolute px length\n */\nexport function parseCssPx(value: string): number {\n\tconst match = CSS_LENGTH.exec(String(value ?? ''))\n\tif (!match || match[2] === '%') return NaN\n\treturn Number(match[1])\n}\n\n/**\n * Parse a whole row of computed CSS widths into a column basis, or reject the set.\n *\n * The result is only ever used *proportionally* (each column's share of the total), so the\n * unit does not have to be absolute — it only has to be the same for every column. Hence:\n *\n * - all `px` (or bare numbers) → their magnitudes\n * - all `%` → their magnitudes; `[25%, 25%, 50%]` is a perfectly good 1:1:2 basis\n * - anything else, or a **mix** of units, or a single unparseable entry (`auto`, `''`,\n * `3em`) → `[]`, meaning \"no usable basis\"\n *\n * Rejecting the whole set on one bad entry is deliberate: a partial basis would silently\n * give the unparseable columns zero width, which is worse than falling back to an equal\n * split. Negative magnitudes reject for the same reason.\n * @param {readonly string[]} values - computed `width` per column, in column order\n * @returns {number[]} per-column basis, or `[]` when the set is not usable\n */\nexport function parseCssWidthBasis(values: readonly string[]): number[] {\n\tconst basis: number[] = []\n\tlet unit = ''\n\tfor (const value of values) {\n\t\tconst match = CSS_LENGTH.exec(String(value ?? ''))\n\t\tif (!match) return []\n\t\tconst magnitude = Number(match[1])\n\t\tif (!isFinite(magnitude) || magnitude < 0) return []\n\t\tconst valueUnit = (match[2] ?? 'px').toLowerCase()\n\t\tif (!unit) unit = valueUnit\n\t\telse if (unit !== valueUnit) return []\n\t\tbasis.push(magnitude)\n\t}\n\treturn basis\n}\n\n/**\n * Choose which vector the proportional column math runs on, falling back as bases run out.\n *\n * `offsetWidth` is the ideal basis — it is the width the table actually rendered at — but it\n * requires a layout engine, and reports `0` for every cell both in a hidden table and on any\n * DOM outside a browser. So:\n *\n * 1. **measured** (`offsetWidth`) when it carries any width at all — the browser path, unchanged\n * 2. **CSS widths** when the stylesheet states them (see {@link parseCssWidthBasis})\n * 3. **equal split** otherwise — a basis of all-ones, which the existing proportional math\n * turns into equal columns for free\n *\n * Only the basis changes; `data-pptx-width` / `data-pptx-min-width` overrides still apply\n * downstream via {@link resolveHtmlColWidth} and still win outright.\n *\n * **The first two bases do not measure the same box, and the docs used to imply they did.**\n * `offsetWidth` is the border box; a computed `width` is the content box. Padding alone\n * separates them — `test/browser/harness/table.html` is built so it does, giving 1:1 measured\n * against 2:1 from CSS on one table — so choosing arm 2 over arm 1 can change a table's column\n * *proportions*, not just their precision. That is why the fixture discriminates at all, and why\n * \"degrades to computed CSS\" was the wrong word for it everywhere it appeared.\n *\n * Left as-is rather than reconciled. Normalizing arm 2 to the border box would need the computed\n * padding and border widths, which the DOMs that reach arm 2 need not resolve either (a `%`\n * padding computes to nothing usable without layout), so it would converge the two only\n * sometimes — and it would collapse the one discriminator the browser lane has, turning\n * `table-widths.spec.mjs` back into a test that passes whether or not the measured arm ran.\n * A caller who needs both runtimes to agree on a column states it with `data-pptx-width`.\n * @param {readonly number[]} measured - per-column `offsetWidth`\n * @param {readonly number[]} cssWidths - per-column CSS width basis (`[]` when unusable)\n * @returns {number[]} the basis vector to run the proportional calc on\n */\nexport function pickColWidthBasis(measured: readonly number[], cssWidths: readonly number[]): number[] {\n\tconst sum = (arr: readonly number[]): number => arr.reduce((acc, n) => acc + (isFinite(n) ? n : 0), 0)\n\tif (sum(measured) > 0) return [...measured]\n\tif (cssWidths.length === measured.length && sum(cssWidths) > 0) return [...cssWidths]\n\treturn measured.map(() => 1)\n}\n\n/** One cell's span attributes, as far as the grid walk cares. */\ntype GridCellSpans = { colspan?: number; rowspan?: number }\n\n/**\n * Read a `colspan`/`rowspan` as the number of grid tracks it covers.\n *\n * Lenient on purpose: `0`, a negative, a fraction, an unparseable attribute and an absent one all\n * mean `1`. A bad span attribute should cost its own cell nothing and the rest of the grid nothing\n * — the alternative, propagating a `NaN` or a negative into the column walk, shifts every\n * subsequent column.\n * @param {unknown} value - the raw attribute value\n * @returns {number} tracks covered, at least 1\n */\nfunction gridSpan(value: unknown): number {\n\tconst num = Math.floor(Number(value))\n\treturn isFinite(num) && num > 1 ? num : 1\n}\n\n/**\n * Measure the column grid a set of table rows actually occupies.\n *\n * An HTML table is not a rectangle of cells — a row states only the cells it *starts*, so its\n * length says nothing about how many grid columns it fills: a `colspan` fills several, and a\n * `rowspan` started higher up fills one without the row mentioning it. The pptx side has no such\n * model: `<a:tblGrid>` declares N columns and every `<a:tr>` must carry N `<a:tc>`. Something has\n * to translate, and that is a walk of the standard HTML table model — cells pack left to right,\n * skipping columns still held by a rowspan above.\n *\n * Returns the grid width and, per row, how many columns that row reaches. The difference between\n * the two is exactly the padding a ragged row needs; the merge cells for `colspan`/`rowspan` are\n * *not* padding — the table emitter synthesizes those itself, so they are counted as filled here.\n *\n * Spans are read through {@link gridSpan}, so a bad attribute cannot shift the whole grid.\n * @param {readonly (readonly GridCellSpans[])[]} rows - per-row cell spans, in emission order\n * @returns {{ columns: number, filled: number[] }} grid width, and columns reached per row\n */\nexport function measureGridColumns(rows: readonly (readonly GridCellSpans[])[]): { columns: number; filled: number[] } {\n\t// carry[c] = how many further rows column c is still held by a rowspan started above.\n\tconst carry: number[] = []\n\tconst filled: number[] = []\n\n\tfor (const row of rows) {\n\t\tlet col = 0\n\t\tfor (const cell of row) {\n\t\t\twhile ((carry[col] ?? 0) > 0) col++\n\t\t\tconst colspan = gridSpan(cell?.colspan)\n\t\t\t// Written now, decremented at the end of this row, so it leaves `rowspan - 1` behind.\n\t\t\tfor (let idx = 0; idx < colspan; idx++) carry[col + idx] = gridSpan(cell?.rowspan)\n\t\t\tcol += colspan\n\t\t}\n\t\t// Trailing columns held from above count too: a row whose last cells are all rowspan\n\t\t// continuations reaches past its own final cell.\n\t\twhile ((carry[col] ?? 0) > 0) col++\n\t\tfilled.push(col)\n\t\tfor (let idx = 0; idx < carry.length; idx++) {\n\t\t\tconst held = carry[idx] ?? 0\n\t\t\tif (held > 0) carry[idx] = held - 1\n\t\t}\n\t}\n\n\treturn { columns: filled.reduce((max, reached) => (reached > max ? reached : max), 0), filled }\n}\n\n/**\n * Widen a column-width basis to cover a grid wider than the row it was derived from.\n *\n * The basis comes from one row — the first with cells — but the grid is as wide as the *widest*\n * row, and those need not agree (a single spanning header over a wider body is the common shape).\n * The columns the source row never described get the average of the ones it did, so they read as\n * ordinary columns rather than as a zero-width sliver; with no usable basis at all they get `1`,\n * which the proportional calc downstream turns into an equal split.\n * @param {readonly number[]} basis - per-column basis derived from the width-source row\n * @param {number} columns - the full grid width\n * @returns {number[]} basis covering every grid column\n */\nexport function extendColBasis(basis: readonly number[], columns: number): number[] {\n\tconst extended = [...basis]\n\tconst total = extended.reduce((acc, width) => acc + (isFinite(width) ? width : 0), 0)\n\tconst share = extended.length > 0 && total > 0 ? total / extended.length : 1\n\twhile (extended.length < columns) extended.push(share)\n\treturn extended\n}\n\n/**\n * The minimum a cell has to look like for {@link readCellText}. Any DOM's element satisfies it;\n * stating it structurally is what lets the fallback walk be unit-tested without a DOM at all.\n */\ntype TextCell = {\n\tinnerText?: string\n\tnodeType?: number\n\tnodeValue?: string | null\n\tnodeName?: string\n\tchildNodes?: ArrayLike<TextCell>\n}\n\n/**\n * Read a cell's text, with `<br>` surviving as a newline.\n *\n * `innerText` is the right answer in a browser — it is the *rendered* text, so it already\n * collapses whitespace, honors `display: none`, and turns `<br>` into `\"\\n\"`. But it is an\n * HTML-spec extra tied to rendering, and outside a browser it is either absent (jsdom does not\n * implement it, so every cell would come out empty) or present but not actually rendered\n * (happy-dom returns `\"ab\"` for `a<br>b`, so every cell would come out on one line).\n *\n * So both are computed and the better one wins: a `childNodes` walk that maps `<br>` to a line\n * break and collapses whitespace per line, and `innerText`. `innerText` is preferred unless it\n * dropped a line break the walk found — the one thing that provably makes it not the rendered\n * text. Neither can know about `text-transform` without a browser.\n * @param {TextCell} cell - the table cell element\n * @returns {string} cell text, `<br>`-separated lines joined by `\"\\n\"`\n */\nexport function readCellText(cell: TextCell): string {\n\t// Accumulate one bucket per line rather than one string with \"\\n\" separators: the source's\n\t// own indentation contains newlines, and only a `<br>` may actually start a new line. A\n\t// separator character could not tell those two apart; separate buckets never have to.\n\tconst lines: string[] = ['']\n\tconst append = (text: string): void => {\n\t\tlines[lines.length - 1] = (lines[lines.length - 1] ?? '') + text\n\t}\n\tconst walk = (node: TextCell): void => {\n\t\tif (node.nodeType === 3) {\n\t\t\tappend(node.nodeValue ?? '')\n\t\t\treturn\n\t\t}\n\t\tif (node.nodeType !== 1) return\n\t\tif ((node.nodeName ?? '').toUpperCase() === 'BR') {\n\t\t\tlines.push('')\n\t\t\treturn\n\t\t}\n\t\tconst children = node.childNodes\n\t\tfor (let idx = 0; idx < (children?.length ?? 0); idx++) {\n\t\t\tconst child = children?.[idx]\n\t\t\tif (child) walk(child)\n\t\t}\n\t}\n\n\t// Walk from the cell's children: the cell itself is an element, and can never be a BR.\n\tconst children = cell.childNodes\n\tfor (let idx = 0; idx < (children?.length ?? 0); idx++) {\n\t\tconst child = children?.[idx]\n\t\tif (child) walk(child)\n\t}\n\tconst walked = lines.map((line) => line.replace(/\\s+/g, ' ').trim()).join('\\n')\n\n\t// Prefer `innerText` — except when the walk found line breaks it dropped. A DOM that does\n\t// not render can still expose an `innerText` property that is really just `textContent`\n\t// (happy-dom returns `\"ab\"` for `a<br>b`), and that one is not the rendered text this\n\t// wants: it has silently lost the cell's line structure. Where it kept the breaks, it is\n\t// the better answer, because it also knows about `display:none` and `text-transform`.\n\tconst rendered = cell.innerText\n\tif (typeof rendered !== 'string') return walked\n\treturn walked.includes('\\n') && !rendered.includes('\\n') ? walked : rendered\n}\n\n// ===== Live-DOM tableToSlides() flow =====\n// Browser-only entry (reads a rendered table via getComputedStyle/offsetWidth);\n// out of active scope — see AGENTS.md. Internally signposted by `// STEP 1..5`.\n\n/**\n * Resolve `options.masterTitle` to the slide layout it names, so the auto-pager can take that\n * master's margins.\n *\n * The layout registry is a presentation *internal* — it is not on {@link TableToSlidesHost},\n * and the public `slideLayouts` getter deliberately hides the `_name` this matches on. Rather\n * than widen either, read it defensively: a host that has no registry simply resolves no\n * master, which is what a caller passing a bare `{ addSlide, presLayout }` object should get.\n * The alternative — dropping the lookup on the free-function path — would make `masterTitle`\n * silently do nothing there, which is a trap.\n * @param {TableToSlidesHost} pptx - the presentation the slides are being added to\n * @param {string} masterTitle - the `title` passed to `defineSlideMaster`\n * @returns {SlideLayoutInternal | undefined} the named layout, if this host has one\n */\nfunction resolveMasterSlide(pptx: TableToSlidesHost, masterTitle?: string): SlideLayoutInternal | undefined {\n\tif (!masterTitle) return undefined\n\tconst layouts = (pptx as { _slideLayouts?: SlideLayoutInternal[] })._slideLayouts\n\tif (!Array.isArray(layouts)) return undefined\n\treturn layouts.find((layout) => layout._name === masterTitle)\n}\n\n/** Which of the three logical sections a row belongs to. A section-less row counts as body. */\ntype TablePart = 'thead' | 'tbody' | 'tfoot'\n\n/**\n * A row's cells, via `HTMLTableRowElement.cells`.\n *\n * Read off the structural shape rather than the `lib.dom` type so a DOM that does not implement\n * the collection degrades to \"this row has no cells\" instead of throwing — the same tolerance\n * every other DOM read in this file has.\n * @param {Element} row - a `<tr>`\n * @returns {HTMLTableCellElement[]} the row's cells, in document order\n */\nfunction rowCells(row: Element): HTMLTableCellElement[] {\n\tconst cells = (row as { cells?: ArrayLike<Element> }).cells\n\treturn cells ? (Array.from(cells) as HTMLTableCellElement[]) : []\n}\n\n/**\n * Collect every row of the table, bucketed head → body → foot.\n *\n * `HTMLTableElement.rows` is the right source and a `thead tr`/`tbody tr`/`tfoot tr` query is not,\n * for two reasons the query cannot fix:\n *\n * - **A row need not be in a section.** `<table><tr>…` is valid authored markup, and a table built\n * with `createElement`/`appendChild` has no `<tbody>` at all — the HTML *parser* inserts one, the\n * DOM API does not. Those rows matched none of the three selectors and were silently dropped,\n * which is how a perfectly good table reached `addTable` with zero rows and threw\n * `addTable: Array expected!` (upstream gitbrent/PptxGenJS#1005).\n * - **A descendant query reaches into nested tables.** `tbody tr` matches the rows of a table\n * inside a cell of this one, folding them into the outer table as extra rows.\n *\n * Each row's own parentage settles both questions: it names the section the row belongs to (the\n * head/body/foot split still matters downstream, for repeating header rows on auto-paged slides),\n * and it says whether the row is this table's at all. The ownership check is not redundant with\n * using `rows` — happy-dom's `rows` is itself a descendant walk, so a nested table's rows arrive\n * there too. Checking is what makes the answer the same on every DOM.\n * @param {Element} table - the `<table>` being converted\n * @returns {Array<{ row: Element, part: TablePart }>} rows in emission order\n */\nfunction collectTableRows(table: Element): Array<{ row: Element; part: TablePart }> {\n\tconst head: Array<{ row: Element; part: TablePart }> = []\n\tconst body: Array<{ row: Element; part: TablePart }> = []\n\tconst foot: Array<{ row: Element; part: TablePart }> = []\n\tconst place = (row: Element): void => {\n\t\tconst parent = row.parentElement\n\t\tconst section = (parent?.nodeName ?? '').toUpperCase()\n\t\tconst sectioned = section === 'THEAD' || section === 'TBODY' || section === 'TFOOT'\n\t\tif ((sectioned ? parent?.parentElement : parent) !== table) return\n\t\tif (section === 'THEAD') head.push({ row, part: 'thead' })\n\t\telse if (section === 'TFOOT') foot.push({ row, part: 'tfoot' })\n\t\telse body.push({ row, part: 'tbody' })\n\t}\n\n\tconst rows = (table as { rows?: ArrayLike<Element> }).rows\n\tif (rows) {\n\t\tfor (let idx = 0; idx < rows.length; idx++) {\n\t\t\tconst row = rows[idx]\n\t\t\tif (row) place(row)\n\t\t}\n\t} else {\n\t\t// A DOM without `rows` is not one this library has ever run on, but the section query is\n\t\t// still a truthful fallback for the sectioned tables it can see.\n\t\tfor (const part of ['thead', 'tbody', 'tfoot']) {\n\t\t\ttable.querySelectorAll(`${part} tr`).forEach(place)\n\t\t}\n\t}\n\n\treturn [...head, ...body, ...foot]\n}\n\n/**\n * Reproduces an HTML table as a PowerPoint table - including column widths, style, etc. - creates 1 or more slides as needed\n * @param {TableToSlidesHost} pptx - ts-pptx instance\n * @param {TableToSlidesElement | string} target - the table element, or the HTMLElementID of the table\n * @param {TableToSlidesProps} options - array of options (e.g.: tabsize)\n */\nexport function genTableToSlides(\n\tpptx: TableToSlidesHost,\n\ttarget: TableToSlidesElement | string,\n\toptions: TableToSlidesProps = {}\n): void {\n\tconst opts = options || {}\n\tconst masterSlide = resolveMasterSlide(pptx, opts.masterTitle)\n\topts.slideMargin = opts.slideMargin || opts.slideMargin === 0 ? opts.slideMargin : 0.5\n\tlet emuSlideTabW = opts.w || pptx.presLayout.width\n\tconst arrObjTabHeadRows: TableCell[][] = []\n\tconst arrObjTabBodyRows: TableCell[][] = []\n\tconst arrObjTabFootRows: TableCell[][] = []\n\tconst arrColW: number[] = []\n\tconst arrTabColW: number[] = []\n\tconst arrTabColCssW: string[] = []\n\tlet arrInchMargins: [number, number, number, number] = [0.5, 0.5, 0.5, 0.5] // TRBL-style\n\tlet intTabW = 0\n\n\t// REALITY-CHECK: resolve the table (and its style reader) before anything else — this is\n\t// also where a missing/unresolvable table id fails.\n\tconst ctx = resolveDomContext(target, opts)\n\n\t// STEP 1: Set margins\n\tif (masterSlide?._margin) {\n\t\tif (Array.isArray(masterSlide._margin)) arrInchMargins = masterSlide._margin\n\t\telse if (!isNaN(masterSlide._margin))\n\t\t\tarrInchMargins = [masterSlide._margin, masterSlide._margin, masterSlide._margin, masterSlide._margin]\n\t\topts.slideMargin = arrInchMargins\n\t} else if (opts?.slideMargin) {\n\t\tif (Array.isArray(opts.slideMargin)) arrInchMargins = opts.slideMargin\n\t\telse if (!isNaN(opts.slideMargin))\n\t\t\tarrInchMargins = [opts.slideMargin, opts.slideMargin, opts.slideMargin, opts.slideMargin]\n\t}\n\temuSlideTabW = (opts.w ? inch2Emu(opts.w) : pptx.presLayout.width) - inch2Emu(arrInchMargins[1] + arrInchMargins[3])\n\n\tif (opts.verbose) {\n\t\tconsole.log('[[VERBOSE MODE]]')\n\t\tconsole.log('|-- `tableToSlides` ----------------------------------------------------|')\n\t\tconsole.log(`| tableProps.h .................................... = ${opts.h}`)\n\t\tconsole.log(`| tableProps.w .................................... = ${opts.w}`)\n\t\tconsole.log(\n\t\t\t`| pptx.presLayout.width ........................... = ${(pptx.presLayout.width / EMU_PER_INCH).toFixed(1)}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| pptx.presLayout.height .......................... = ${(pptx.presLayout.height / EMU_PER_INCH).toFixed(1)}`\n\t\t)\n\t\tconsole.log(`| emuSlideTabW .................................... = ${(emuSlideTabW / EMU_PER_INCH).toFixed(1)}`)\n\t}\n\n\t// STEP 2: Resolve the rows and the grid they occupy, then take the column widths from the\n\t// first row that has any cells (others may have colspans, who cares, we only need col widths from 1).\n\t// Two bases are collected in the same pass: the rendered `offsetWidth` (what a browser\n\t// reports) and the computed CSS `width` (the only width statement available where nothing\n\t// laid the table out). `pickColWidthBasis` decides which one STEP 3 runs on.\n\tconst domRows = collectTableRows(ctx.table)\n\tconst { columns: intColCnt, filled: arrRowFilled } = measureGridColumns(\n\t\tdomRows.map(({ row }) =>\n\t\t\trowCells(row).map((cell) => ({\n\t\t\t\tcolspan: Number(cell.getAttribute('colspan')),\n\t\t\t\trowspan: Number(cell.getAttribute('rowspan')),\n\t\t\t}))\n\t\t)\n\t)\n\t// A table with no rows — or only empty ones — has nothing to convert. Say so here: the failure\n\t// used to surface far downstream as `Reduce of empty array with no initial value` out of the\n\t// auto-pager, or as `addTable: Array expected!`, neither of which names the table.\n\tconst srcRow = domRows.find(({ row }) => rowCells(row).length > 0)\n\tif (!srcRow) {\n\t\tthrow new InvalidOptionError(\n\t\t\t'html/table-has-no-cells',\n\t\t\t'tableToSlides: the table has no cells to convert - expected at least one <tr> with a <td>/<th>.'\n\t\t)\n\t}\n\n\t// Per grid column, the width-source cell it came from and that cell's colspan. Built here so\n\t// STEP 3 can read a column's overrides off the *right* cell: with a colspan in play, column\n\t// index and cell index part ways, and indexing the row by column silently applied one cell's\n\t// `data-pptx-width` to the next column along (upstream gitbrent/PptxGenJS#1244).\n\tconst arrColSrc: Array<{ cell: HTMLTableCellElement; span: number }> = []\n\tconst arrCellSpans: number[] = []\n\trowCells(srcRow.row).forEach((cell) => {\n\t\tconst offsetW = Number(cell.offsetWidth)\n\t\tconst measured = isFinite(offsetW) ? offsetW : 0\n\t\tarrTabColCssW.push(ctx.getComputedStyle(cell).getPropertyValue('width'))\n\t\t// Guesstimate (divide evenly) col widths across a spanned cell.\n\t\t// NOTE: both j$query and vanilla selectors return {0} when table is not visible)\n\t\tconst span = gridSpan(cell.getAttribute('colspan'))\n\t\tarrCellSpans.push(span)\n\t\tfor (let idxc = 0; idxc < span; idxc++) {\n\t\t\tarrTabColW.push(Math.round(measured / span))\n\t\t\tarrColSrc.push({ cell, span })\n\t\t}\n\t})\n\n\t// The CSS basis is parsed per *cell* (unit uniformity is a property of the row as authored),\n\t// then expanded across each cell's colspan the same way `offsetWidth` is.\n\tconst parsedCellCssW = parseCssWidthBasis(arrTabColCssW)\n\tconst arrCssColW: number[] = []\n\tif (parsedCellCssW.length === arrCellSpans.length) {\n\t\tparsedCellCssW.forEach((cssW, idxC) => {\n\t\t\tconst span = arrCellSpans[idxC] ?? 1\n\t\t\tfor (let idxc = 0; idxc < span; idxc++) arrCssColW.push(cssW / span)\n\t\t})\n\t}\n\n\t// The width-source row can be narrower than the grid (one spanning header over a wider body),\n\t// so widen the basis to the full grid before the proportional calc — that way the calc still\n\t// divides the slide across *every* column instead of overflowing it by the missing ones.\n\tconst arrBasisColW = extendColBasis(pickColWidthBasis(arrTabColW, arrCssColW), intColCnt)\n\tarrBasisColW.forEach((colW) => {\n\t\tintTabW += colW\n\t})\n\n\t// STEP 3: Calc/Set column widths by using same column width percent from HTML table\n\tarrBasisColW.forEach((colW, idxW) => {\n\t\tconst intCalcWidth = Number(((Number(emuSlideTabW) * ((colW / intTabW) * 100)) / 100 / EMU_PER_INCH).toFixed(2))\n\t\t// A `data-pptx-width` on a spanning cell states that *cell's* width, so it divides across\n\t\t// the columns the cell covers — exactly as its `offsetWidth` and its CSS width do above.\n\t\t// A column past the source row's reach has no cell to be overridden by.\n\t\tconst src = arrColSrc[idxW]\n\t\tconst intSetWidth = src ? Number(src.cell.getAttribute('data-pptx-width')) / src.span : 0\n\t\tconst intMinWidth = src ? Number(src.cell.getAttribute('data-pptx-min-width')) / src.span : 0\n\t\tarrColW.push(resolveHtmlColWidth(intCalcWidth, intSetWidth, intMinWidth))\n\t})\n\tif (opts.verbose) {\n\t\tconsole.log(`| arrColW ......................................... = [${arrColW.join(', ')}]`)\n\t}\n\n\t// STEP 4: Iterate over each table element and create data arrays (text and opts)\n\t// NOTE: We create 3 arrays instead of one so we can loop over body then show header/footer rows on first and last page\n\tdomRows.forEach(({ row, part }, idxRow) => {\n\t\tconst arrObjTabCells: TableCell[] = []\n\t\trowCells(row).forEach((cell) => {\n\t\t\t// The computed style is read a dozen times below; resolve it once per cell.\n\t\t\tconst style = ctx.getComputedStyle(cell)\n\n\t\t\t// A: Get text/bkgd colors\n\t\t\t// NOTE: an unparseable or fully transparent background is the default for an\n\t\t\t// unstyled table; pptx has no \"transparent\" solid fill, so use white instead.\n\t\t\tconst textColor = cssColorToHex(style.getPropertyValue('color')) ?? '000000'\n\t\t\tconst fillColor = cssColorToHex(style.getPropertyValue('background-color')) ?? 'FFFFFF'\n\n\t\t\t// B: Create option object\n\t\t\tconst cellOpts: TableCellProps = {\n\t\t\t\tbold: !!(\n\t\t\t\t\tstyle.getPropertyValue('font-weight') === 'bold' || Number(style.getPropertyValue('font-weight')) >= 500\n\t\t\t\t),\n\t\t\t\tcolor: textColor,\n\t\t\t\tfill: { color: fillColor },\n\t\t\t\tfontSize: Number(style.getPropertyValue('font-size').replace(/[a-z]/gi, '')),\n\t\t\t}\n\t\t\tconst fontFace = ((style.getPropertyValue('font-family') || '').split(',')[0] ?? '')\n\t\t\t\t.replace(/\"/g, '')\n\t\t\t\t.replace('inherit', '')\n\t\t\t\t.replace('initial', '')\n\t\t\t// Read through the same `gridSpan` the grid walk used, so what is emitted and what\n\t\t\t// was measured cannot disagree: a `colspan=\"-2\"` counted as one column above must\n\t\t\t// not reach the table definition as `-2` and corrupt its own column count.\n\t\t\tconst colspan = gridSpan(cell.getAttribute('colspan'))\n\t\t\tconst rowspan = gridSpan(cell.getAttribute('rowspan'))\n\t\t\tif (fontFace) cellOpts.fontFace = fontFace\n\t\t\tif (colspan > 1) cellOpts.colspan = colspan\n\t\t\tif (rowspan > 1) cellOpts.rowspan = rowspan\n\n\t\t\tif (['left', 'center', 'right', 'start', 'end'].includes(style.getPropertyValue('text-align'))) {\n\t\t\t\tconst align = style.getPropertyValue('text-align').replace('start', 'left').replace('end', 'right')\n\t\t\t\tcellOpts.align =\n\t\t\t\t\talign === 'center' ? 'center' : align === 'left' ? 'left' : align === 'right' ? 'right' : undefined\n\t\t\t}\n\t\t\tif (['top', 'middle', 'bottom'].includes(style.getPropertyValue('vertical-align'))) {\n\t\t\t\tconst valign = style.getPropertyValue('vertical-align')\n\t\t\t\tcellOpts.valign =\n\t\t\t\t\tvalign === 'top' ? 'top' : valign === 'middle' ? 'middle' : valign === 'bottom' ? 'bottom' : undefined\n\t\t\t}\n\n\t\t\t// C: Add padding [margin] (if any)\n\t\t\t// NOTE: `TableCellProps.margin` is INCHES, so computed px must be converted, not copied.\n\t\t\t// CSS defines the reference pixel as 1/96in, and mirroring what the browser rendered is\n\t\t\t// this conversion's whole job — so resolve at `DEFAULT_PX_PER_INCH`, the same density the\n\t\t\t// `\"<n>px\"` coordinate unit uses. (Until 2026-07-31 the px magnitude was assigned straight\n\t\t\t// through under a stale \"px->pt 1:1\" note left from when cell margin was points; that made\n\t\t\t// a 4px pad a *4 inch* inset and tripped the legacy-points warning on any pad >= 1px.)\n\t\t\t// No rounding to whole px: the browser's computed value can be fractional, and `inch2Emu`\n\t\t\t// already does the one rounding that matters, at EMU precision.\n\t\t\tif (style.getPropertyValue('padding-left')) {\n\t\t\t\tconst cellMargin: MarginTuple = [0, 0, 0, 0]\n\t\t\t\tconst sidesPad = ['padding-top', 'padding-right', 'padding-bottom', 'padding-left']\n\t\t\t\tsidesPad.forEach((val, idxs) => {\n\t\t\t\t\t// Anything that is not an absolute px length (a `%` padding, a keyword) has no\n\t\t\t\t\t// meaning as a fixed inset, so it insets by nothing rather than by its digits.\n\t\t\t\t\tconst pad = parseCssPx(style.getPropertyValue(val))\n\t\t\t\t\tcellMargin[idxs] = isFinite(pad) ? pad / DEFAULT_PX_PER_INCH : 0\n\t\t\t\t})\n\t\t\t\tcellOpts.margin = cellMargin\n\t\t\t}\n\n\t\t\t// D: Add border (if any)\n\t\t\tif (\n\t\t\t\tstyle.getPropertyValue('border-top-width') ||\n\t\t\t\tstyle.getPropertyValue('border-right-width') ||\n\t\t\t\tstyle.getPropertyValue('border-bottom-width') ||\n\t\t\t\tstyle.getPropertyValue('border-left-width')\n\t\t\t) {\n\t\t\t\tconst cellBorder: BorderTuple = [{ type: 'none' }, { type: 'none' }, { type: 'none' }, { type: 'none' }]\n\t\t\t\tconst sidesBor = ['top', 'right', 'bottom', 'left']\n\t\t\t\tsidesBor.forEach((val, idxb) => {\n\t\t\t\t\tcellBorder[idxb] = htmlBorderToProps(\n\t\t\t\t\t\tstyle.getPropertyValue('border-' + val + '-width'),\n\t\t\t\t\t\tstyle.getPropertyValue('border-' + val + '-color')\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t\tcellOpts.border = cellBorder\n\t\t\t}\n\n\t\t\t// LAST: Add cell\n\t\t\tarrObjTabCells.push({\n\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\ttext: readCellText(cell), // <br> must survive as \"\\n\", so linebreak etc. work later!\n\t\t\t\toptions: cellOpts,\n\t\t\t})\n\t\t})\n\n\t\t// Normalize a ragged row up to the grid width. HTML tolerates a short row and just leaves\n\t\t// the tail of the grid empty; pptx does not — `<a:tblGrid>` declares the column count and a\n\t\t// row with fewer `<a:tc>` is a malformed table PowerPoint has to repair. The missing cells\n\t\t// are blank rather than a copy of a neighbour: the source table never stated them, so there\n\t\t// is nothing to carry over. Columns held by a `rowspan` from above are already counted as\n\t\t// filled — the table emitter synthesizes those merge cells itself.\n\t\tfor (let idxPad = arrRowFilled[idxRow] ?? 0; idxPad < intColCnt; idxPad++) {\n\t\t\tarrObjTabCells.push({ _type: SlideObjectType.tablecell, text: '', options: {} })\n\t\t}\n\n\t\tif (part === 'thead') arrObjTabHeadRows.push(arrObjTabCells)\n\t\telse if (part === 'tfoot') arrObjTabFootRows.push(arrObjTabCells)\n\t\telse arrObjTabBodyRows.push(arrObjTabCells)\n\t})\n\n\t// STEP 5: Break table into Slides as needed\n\t// Pass head-rows as there is an option to add to each table and the parse func needs this data to fulfill that option\n\topts._arrObjTabHeadRows = arrObjTabHeadRows\n\topts.colW = arrColW\n\tgetSlidesForTableRows(\n\t\t[...arrObjTabHeadRows, ...arrObjTabBodyRows, ...arrObjTabFootRows],\n\t\topts,\n\t\tpptx.presLayout,\n\t\tmasterSlide\n\t).forEach((slide, idxTr) => {\n\t\t// A: Create new Slide\n\t\tconst newSlide = pptx.addSlide({ masterTitle: opts.masterTitle || undefined })\n\n\t\t// B: DESIGN: Reset `y` to startY or margin after first Slide\n\t\tif (idxTr === 0) opts.y = opts.y || arrInchMargins[0]\n\t\tif (idxTr > 0) opts.y = opts.autoPageSlideStartY || arrInchMargins[0]\n\t\tif (opts.verbose)\n\t\t\tconsole.log(\n\t\t\t\t`| opts.autoPageSlideStartY: ${opts.autoPageSlideStartY} / arrInchMargins[0]: ${arrInchMargins[0]} => opts.y = ${opts.y}`\n\t\t\t)\n\n\t\t// C: Add table to Slide\n\t\tnewSlide.addTable(slide.rows, {\n\t\t\tx: opts.x || arrInchMargins[3],\n\t\t\ty: opts.y,\n\t\t\tw: Number(emuSlideTabW) / EMU_PER_INCH,\n\t\t\tcolW: arrColW,\n\t\t\tautoPage: false,\n\t\t})\n\n\t\t// D: Add any additional objects\n\t\tif (opts.addImage) {\n\t\t\topts.addImage.options = opts.addImage.options || {}\n\t\t\tif (!opts.addImage.image || (!opts.addImage.image.path && !opts.addImage.image.data)) {\n\t\t\t\twarn('html/image-missing-source', 'tableToSlides.addImage requires either `path` or `data`')\n\t\t\t} else {\n\t\t\t\tconst imageProps = opts.addImage.image.path\n\t\t\t\t\t? { path: opts.addImage.image.path }\n\t\t\t\t\t: { data: opts.addImage.image.data as string }\n\t\t\t\tnewSlide.addImage({\n\t\t\t\t\t...imageProps,\n\t\t\t\t\tx: opts.addImage.options.x,\n\t\t\t\t\ty: opts.addImage.options.y,\n\t\t\t\t\tw: opts.addImage.options.w,\n\t\t\t\t\th: opts.addImage.options.h,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif (opts.addShape) newSlide.addShape(opts.addShape.shapeName, opts.addShape.options || {})\n\t\tif (opts.addTable) newSlide.addTable(opts.addTable.rows, opts.addTable.options || {})\n\t\tif (opts.addText) newSlide.addText(opts.addText.text, opts.addText.options || {})\n\t})\n}\n"],"mappings":";;;;;;;;;;;AAyEA,MAAM,oBAAoB,EACzB,wBAAwB,GACzB;;;;;;AAOA,SAAS,mBAAmB,KAA4D;CACvF,MAAM,OAAO,KAAK;CAClB,OAAO,OAAO,KAAK,iBAAiB,KAAK,IAAI,UAAU;AACxD;;;;;;;;;;;;;;;;;;AAmBA,SAAS,kBAAkB,QAAuC,SAAyC;CAC1G,MAAM,aAAa,YAA2C;CAE9D,IAAI,OAAO,WAAW,UAAU;EAC/B,MAAM,QAAQ,UAAU,MAAM;EAC9B,OAAO;GAAE;GAAO,kBAAkB,mBAAmB,MAAM,aAAa;EAAE;CAC3E;CAEA,MAAM,MAAM,QAAQ,YAAa,WAAoD;CACrF,IAAI,CAAC,KACJ,MAAM,IAAI,mBACT,oBACA,+DACC,SACA,oFACF;CAED,MAAM,QAAQ,IAAI,eAAe,MAAM;CACvC,IAAI,CAAC,OACJ,MAAM,IAAI,mBAAmB,wBAAwB,+BAA8B,SAAS,oBAAmB;CAChH,MAAM,QAAQ,UAAU,KAAK;CAC7B,OAAO;EAAE;EAAO,kBAAkB,mBAAm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