pptx-ts 3.7.0 → 4.0.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 (136) hide show
  1. package/README.md +116 -269
  2. package/dist/autopage-odPz7zZO.js +536 -0
  3. package/dist/autopage-odPz7zZO.js.map +1 -0
  4. package/dist/binary-string-CKVAYI3M.js +24 -0
  5. package/dist/binary-string-CKVAYI3M.js.map +1 -0
  6. package/dist/body-insets-Dw_BeWD_.js +54 -0
  7. package/dist/body-insets-Dw_BeWD_.js.map +1 -0
  8. package/dist/browser.d.ts +29 -9
  9. package/dist/browser.d.ts.map +1 -1
  10. package/dist/browser.js +41 -14
  11. package/dist/browser.js.map +1 -1
  12. package/dist/clip-Bl01BPcN.d.ts +67 -0
  13. package/dist/clip-Bl01BPcN.d.ts.map +1 -0
  14. package/dist/diagnostics-D8ot4Ei7.d.ts +244 -0
  15. package/dist/diagnostics-D8ot4Ei7.d.ts.map +1 -0
  16. package/dist/embedded-fonts-DarT9aoa.d.ts +20 -0
  17. package/dist/embedded-fonts-DarT9aoa.d.ts.map +1 -0
  18. package/dist/entry-compose-DCnvBZz2.d.ts +1046 -0
  19. package/dist/entry-compose-DCnvBZz2.d.ts.map +1 -0
  20. package/dist/{enums-CvRYniUA.d.ts → enums-BUKTUB6V.d.ts} +21 -13
  21. package/dist/{enums-CvRYniUA.d.ts.map → enums-BUKTUB6V.d.ts.map} +1 -1
  22. package/dist/{errors-Bvln0H-7.js → errors-C4oENPcu.js} +92 -2
  23. package/dist/errors-C4oENPcu.js.map +1 -0
  24. package/dist/families.d.ts +260 -0
  25. package/dist/families.d.ts.map +1 -0
  26. package/dist/families.js +57 -0
  27. package/dist/families.js.map +1 -0
  28. package/dist/{fit-BKs0zxMI.js → fit-Cb7naFj6.js} +249 -167
  29. package/dist/fit-Cb7naFj6.js.map +1 -0
  30. package/dist/font-metrics-v5fn7s7e.d.ts +613 -0
  31. package/dist/font-metrics-v5fn7s7e.d.ts.map +1 -0
  32. package/dist/grid-DikTjFey.js +187 -0
  33. package/dist/grid-DikTjFey.js.map +1 -0
  34. package/dist/{html-dom-B0I0QSbU.js → html-dom-Iuog2wdK.js} +121 -91
  35. package/dist/html-dom-Iuog2wdK.js.map +1 -0
  36. package/dist/html.d.ts +6 -6
  37. package/dist/html.d.ts.map +1 -1
  38. package/dist/html.js +7 -6
  39. package/dist/html.js.map +1 -1
  40. package/dist/image-size-CvN2iCA4.js +1611 -0
  41. package/dist/image-size-CvN2iCA4.js.map +1 -0
  42. package/dist/index.d.ts +24 -10
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +31 -11
  45. package/dist/index.js.map +1 -1
  46. package/dist/inspect.d.ts +40 -31
  47. package/dist/inspect.d.ts.map +1 -1
  48. package/dist/inspect.js +40 -48
  49. package/dist/inspect.js.map +1 -1
  50. package/dist/math.d.ts +7 -5
  51. package/dist/math.d.ts.map +1 -1
  52. package/dist/math.js +16 -7
  53. package/dist/math.js.map +1 -1
  54. package/dist/measure.d.ts +12 -225
  55. package/dist/measure.d.ts.map +1 -1
  56. package/dist/measure.js +3 -3
  57. package/dist/node.d.ts +22 -8
  58. package/dist/node.d.ts.map +1 -1
  59. package/dist/node.js +27 -7
  60. package/dist/node.js.map +1 -1
  61. package/dist/notes-Dh12JAbn.js +3264 -0
  62. package/dist/notes-Dh12JAbn.js.map +1 -0
  63. package/dist/options-internal-WqgMf720.js +43 -0
  64. package/dist/options-internal-WqgMf720.js.map +1 -0
  65. package/dist/{package-CaOLXSNi.d.ts → package-J49Ck6S2.d.ts} +27 -12
  66. package/dist/package-J49Ck6S2.d.ts.map +1 -0
  67. package/dist/playbtn-CUqQdoDf.js +22 -0
  68. package/dist/playbtn-CUqQdoDf.js.map +1 -0
  69. package/dist/{slide-ZqAdVvHV.d.ts → pres-C6qgOFAa.d.ts} +1021 -1423
  70. package/dist/pres-C6qgOFAa.d.ts.map +1 -0
  71. package/dist/{presentation-DrJtj3-C.js → presentation-DGYlAWhl.js} +3208 -2727
  72. package/dist/presentation-DGYlAWhl.js.map +1 -0
  73. package/dist/{presentation-types-CDjScsev.d.ts → presentation-types-8jLQHI4M.d.ts} +1070 -683
  74. package/dist/presentation-types-8jLQHI4M.d.ts.map +1 -0
  75. package/dist/read.d.ts +9 -9
  76. package/dist/read.d.ts.map +1 -1
  77. package/dist/read.js +4 -4
  78. package/dist/script.d.ts +80 -66
  79. package/dist/script.d.ts.map +1 -1
  80. package/dist/script.js +2399 -1139
  81. package/dist/script.js.map +1 -1
  82. package/dist/{shapes-BemroU-z.js → shapes-re0KyQk_.js} +2807 -1609
  83. package/dist/shapes-re0KyQk_.js.map +1 -0
  84. package/dist/slide-Dx2ZeVZ6.d.ts +1256 -0
  85. package/dist/slide-Dx2ZeVZ6.d.ts.map +1 -0
  86. package/dist/slide-size-BalTjFuv.js +88 -0
  87. package/dist/slide-size-BalTjFuv.js.map +1 -0
  88. package/dist/{units-internal-Dg95w_YD.js → table-cell-margins-EVg0EwxT.js} +235 -273
  89. package/dist/table-cell-margins-EVg0EwxT.js.map +1 -0
  90. package/dist/table-dom-BTDP3lEP.js +21 -0
  91. package/dist/table-dom-BTDP3lEP.js.map +1 -0
  92. package/dist/text-KnLOtEEu.js +3980 -0
  93. package/dist/text-KnLOtEEu.js.map +1 -0
  94. package/dist/text-anchor-CrYXAfUu.js +176 -0
  95. package/dist/text-anchor-CrYXAfUu.js.map +1 -0
  96. package/dist/transition-speed-kUEWDWTx.js +14 -0
  97. package/dist/transition-speed-kUEWDWTx.js.map +1 -0
  98. package/dist/units-internal-XJlf-hOl.js +649 -0
  99. package/dist/units-internal-XJlf-hOl.js.map +1 -0
  100. package/dist/zip-C0leZZMj.d.ts +67 -0
  101. package/dist/zip-C0leZZMj.d.ts.map +1 -0
  102. package/dist/zip-CKd8ihcf.js +177 -0
  103. package/dist/zip-CKd8ihcf.js.map +1 -0
  104. package/dist/zip.d.ts +3 -68
  105. package/dist/zip.js +3 -163
  106. package/dist/zoom-cX9sllpH.js +8865 -0
  107. package/dist/zoom-cX9sllpH.js.map +1 -0
  108. package/package.json +106 -19
  109. package/skills/ts-pptx-upstream/SKILL.md +58 -57
  110. package/dist/autopage-DkjYZUFD.js +0 -423
  111. package/dist/autopage-DkjYZUFD.js.map +0 -1
  112. package/dist/diagnostics-DfBdDHre.d.ts +0 -829
  113. package/dist/diagnostics-DfBdDHre.d.ts.map +0 -1
  114. package/dist/errors-Bvln0H-7.js.map +0 -1
  115. package/dist/errors-PflMPWBn.d.ts +0 -182
  116. package/dist/errors-PflMPWBn.d.ts.map +0 -1
  117. package/dist/fit-BKs0zxMI.js.map +0 -1
  118. package/dist/html-dom-B0I0QSbU.js.map +0 -1
  119. package/dist/namespaces-BVnNu7sg.js +0 -666
  120. package/dist/namespaces-BVnNu7sg.js.map +0 -1
  121. package/dist/notes-CJFJaG6M.js +0 -1724
  122. package/dist/notes-CJFJaG6M.js.map +0 -1
  123. package/dist/package-CaOLXSNi.d.ts.map +0 -1
  124. package/dist/pres-BcBR3CSM.d.ts +0 -202
  125. package/dist/pres-BcBR3CSM.d.ts.map +0 -1
  126. package/dist/presentation-DrJtj3-C.js.map +0 -1
  127. package/dist/presentation-types-CDjScsev.d.ts.map +0 -1
  128. package/dist/shapes-BemroU-z.js.map +0 -1
  129. package/dist/slide-ZqAdVvHV.d.ts.map +0 -1
  130. package/dist/text-B8SLEaZx.js +0 -11327
  131. package/dist/text-B8SLEaZx.js.map +0 -1
  132. package/dist/units-1kRzYShk.js +0 -231
  133. package/dist/units-1kRzYShk.js.map +0 -1
  134. package/dist/units-internal-Dg95w_YD.js.map +0 -1
  135. package/dist/zip.d.ts.map +0 -1
  136. package/dist/zip.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"html-dom-B0I0QSbU.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 (`ptsToEmuLenient`) 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,+DAC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