@shbernal/pptxgenjs 5.3.0 → 5.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.
- package/dist/{browser-CzGC6NnM.js → browser-DGH8T04O.js} +3 -3
- package/dist/{browser-CzGC6NnM.js.map → browser-DGH8T04O.js.map} +1 -1
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +3 -3
- package/dist/{core-interfaces-BFXQk67T.js → core-interfaces-C091uvh_.js} +13 -2
- package/dist/core-interfaces-C091uvh_.js.map +1 -0
- package/dist/core.d.ts +2 -2
- package/dist/core.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/node.d.ts +3 -3
- package/dist/node.js +3 -3
- package/dist/{pptxgen-B-mAxCRC.js → pptxgen-S8dEuBnC.js} +270 -36
- package/dist/pptxgen-S8dEuBnC.js.map +1 -0
- package/dist/{pptxgen-Clv3zz3l.d.ts → pptxgen-ZuXXUvB-.d.ts} +2 -2
- package/dist/{pptxgen-Clv3zz3l.d.ts.map → pptxgen-ZuXXUvB-.d.ts.map} +1 -1
- package/dist/standalone.d.ts +156 -5
- package/dist/standalone.d.ts.map +1 -1
- package/dist/standalone.js +280 -35
- package/dist/standalone.js.map +1 -1
- package/dist/{units-BPRPrYRg.d.ts → units-DlsWUw1U.d.ts} +157 -6
- package/dist/units-DlsWUw1U.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/core-interfaces-BFXQk67T.js.map +0 -1
- package/dist/pptxgen-B-mAxCRC.js.map +0 -1
- package/dist/units-BPRPrYRg.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pptxgen-S8dEuBnC.js","names":["createShadowElement","neverLineCap","genObj.addTableDefinition","createShadowElement","genCharts.createExcelWorksheet","genMedia.encodeSlideMediaRels","genXml.makeXmlContTypes","genXml.makeXmlRootRels","genXml.makeXmlApp","genXml.makeXmlCore","genXml.makeXmlCustomProperties","genXml.makeXmlPresentationRels","genXml.makeXmlTheme","genXml.makeXmlPresentation","genXml.makeXmlPresProps","genXml.makeXmlTableStyles","genXml.makeXmlViewProps","genXml.makeXmlLayout","genXml.makeXmlSlideLayoutRel","genXml.makeXmlSlide","genXml.makeXmlSlideRel","genXml.makeXmlNotesSlide","genXml.makeXmlNotesSlideRel","genXml.makeXmlMaster","genXml.makeXmlMasterRel","genXml.makeXmlNotesMaster","genXml.makeXmlNotesMasterRel"],"sources":["../src/gen-utils.ts","../src/gen-tables.ts","../src/gen-objects.ts","../src/slide.ts","../src/gen-charts.ts","../src/gen-media.ts","../src/gen-xml.ts","../src/pptxgen.ts"],"sourcesContent":["/**\n * PptxGenJS: Utility Methods\n */\n\nimport { REGEX_HEX_COLOR, DEF_FONT_COLOR, ONEPT, SchemeColor, SCHEME_COLORS } from './core-enums.js'\nimport { coordToEmu, inchesToEmu, type Emu } from './units.js'\nimport type { PresLayout, TextGlowProps, PresSlideInternal, ShapeFillProps, Color, ShapeLineProps, Coord, ShadowProps, GradientFillProps, GradientStopProps, PatternFillProps, LineCap } from './core-interfaces.js'\n\n/**\n * Resolve a user `Coord` (x/y/w/h) to EMU — the single user-coordinate → EMU boundary.\n * - bare `number` → **inches** (no magnitude guessing); `\"<n>%\"` → percent of the slide axis;\n * `\"<n>in\"`/`\"<n>pt\"`/`\"<n>emu\"` → explicit units (see {@link Coord} / {@link coordToEmu})\n * - `null`/`undefined` → 0 (callers may omit a coordinate)\n * - throws on a non-finite number rather than silently collapsing the object to zero size\n * @param {Coord|null|undefined} size - user coordinate\n * @param {'X' | 'Y'} xyDir - axis (selects slide width vs height for percentages)\n * @param {PresLayout} layout - presentation layout (EMU dimensions)\n * @returns {Emu} resolved EMU value\n */\nexport function getSmartParseNumber (size: Coord | null | undefined, xyDir: 'X' | 'Y', layout: PresLayout): Emu {\n\tif (size === null || size === undefined) return 0 as Emu\n\n\t// GUARD: A NaN/Infinity coordinate is always a mistake (commonly arithmetic on an\n\t// `undefined` layout dimension). Fail loud with a targeted hint instead of the generic\n\t// converter message, since this is the most common way a deck collapses to zero-size.\n\tif (typeof size === 'number' && !isFinite(size)) {\n\t\tthrow new Error(\n\t\t\t`Invalid ${xyDir || 'coordinate'} value: expected a finite number but received ${String(size)}. ` +\n\t\t\t\t'This usually means a layout dimension was read from a missing property (e.g. `layout.width` returning `undefined`). ' +\n\t\t\t\t'Use `slide.width`/`slide.height` or `STANDARD_LAYOUTS.<NAME>.width`/`.height` (inches).'\n\t\t)\n\t}\n\n\treturn coordToEmu(size, xyDir === 'Y' ? layout.height : layout.width)\n}\n\n/**\n * Basic UUID Generator Adapted\n * @link https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript#answer-2117523\n * @param {string} uuidFormat - UUID format\n * @returns {string} UUID\n */\nexport function getUuid (uuidFormat: string): string {\n\treturn uuidFormat.replace(/[xy]/g, function (c) {\n\t\tconst r = (Math.random() * 16) | 0\n\t\tconst v = c === 'x' ? r : (r & 0x3) | 0x8\n\t\treturn v.toString(16)\n\t})\n}\n\n/**\n * Replace special XML characters with HTML-encoded strings\n * @param {string} xml - XML string to encode\n * @returns {string} escaped XML\n */\nexport function encodeXmlEntities (xml: string): string {\n\t// NOTE: Dont use short-circuit eval here as value c/b \"0\" (zero) etc.!\n\tif (typeof xml === 'undefined' || xml == null) return ''\n\t// Strip XML 1.0 illegal control chars (e.g. \\v) before escaping to prevent PowerPoint repair dialogs.\n\t// Pattern built from String.fromCharCode so no-control-regex cannot flag it statically.\n\tconst cc = String.fromCharCode\n\tconst illegalXmlCharsRe = new RegExp(`[${cc(0)}-${cc(8)}${cc(11)}${cc(12)}${cc(14)}-${cc(31)}${cc(127)}]`, 'g')\n\treturn xml\n\t\t.toString()\n\t\t.replace(illegalXmlCharsRe, '')\n\t\t.replace(/&/g, '&')\n\t\t.replace(/</g, '<')\n\t\t.replace(/>/g, '>')\n\t\t.replace(/\"/g, '"')\n\t\t.replace(/'/g, ''')\n}\n\n/**\n * Practical maximum length for a `p:cNvPr` object name. PowerPoint does not\n * enforce a hard spec limit, but very long names are a strong signal of a bug\n * and are unwieldy in the Selection Pane.\n */\nconst MAX_OBJECT_NAME_LENGTH = 255\n\n/**\n * Validate a user-supplied object name and warn (does not throw) when the value\n * cannot be preserved as a stable PowerPoint Selection Pane identity. This keeps\n * semantic-identity bugs visible at generation time without breaking existing\n * decks that pass loose names.\n * - Empty/whitespace-only names provide no usable identity.\n * - Control characters are stripped by `encodeXmlEntities`, silently changing\n * the stored name.\n * - Excessively long names may not round-trip through PowerPoint/consumers.\n * @param {string} name - the raw (pre-encoding) object name\n * @param {string} kind - object kind for the warning message (e.g. 'text')\n * @returns {string} the name unchanged (validation only)\n */\nexport function validateObjectName (name: string, kind: string): string {\n\tif (typeof name !== 'string') return name\n\tif (name.trim().length === 0) {\n\t\tconsole.warn(`Warning: ${kind} objectName is empty or whitespace-only; it will not provide a stable Selection Pane identity.`)\n\t\treturn name\n\t}\n\t// Same illegal-XML-char set that `encodeXmlEntities` strips; detect so the caller knows the name will change.\n\tconst cc = String.fromCharCode\n\tconst illegalXmlCharsRe = new RegExp(`[${cc(0)}-${cc(8)}${cc(11)}${cc(12)}${cc(14)}-${cc(31)}${cc(127)}]`)\n\tif (illegalXmlCharsRe.test(name)) {\n\t\tconsole.warn(`Warning: ${kind} objectName \"${name}\" contains control characters that will be stripped, changing the stored name.`)\n\t}\n\tif (name.length > MAX_OBJECT_NAME_LENGTH) {\n\t\tconsole.warn(`Warning: ${kind} objectName exceeds ${MAX_OBJECT_NAME_LENGTH} characters and may not be preserved by PowerPoint.`)\n\t}\n\treturn name\n}\n\n/**\n * Return object names that appear more than once in the given list. Used to warn\n * when duplicate Selection Pane identities would be emitted on a single slide,\n * which breaks consumers (e.g. semantic manifests) that rely on unique names.\n * @param {string[]} names - object names emitted on one slide\n * @returns {string[]} the duplicated names (each listed once)\n */\nexport function getDuplicateObjectNames (names: string[]): string[] {\n\tconst seen = new Set<string>()\n\tconst dupes = new Set<string>()\n\tnames.forEach(name => {\n\t\tif (typeof name !== 'string' || name.length === 0) return\n\t\tif (seen.has(name)) dupes.add(name)\n\t\telse seen.add(name)\n\t})\n\treturn Array.from(dupes)\n}\n\n/**\n * Convert inches into EMU.\n * - accepts a number (inches) or a numeric/`\"<n>in\"` string\n * - no magnitude guessing: values are always treated as inches (use {@link coordToEmu} for\n * user coordinates that may carry other units)\n * @param {number|string} inches - inches as number or string\n * @returns {Emu} EMU value\n */\nexport function inch2Emu (inches: number | string): Emu {\n\tif (typeof inches === 'string') inches = Number(inches.replace(/in*/gi, ''))\n\treturn inchesToEmu(inches)\n}\n\n/**\n * Convert `pt` into points (using `ONEPT`)\n * @param {number|string} pt\n * @returns {number} value in points (`ONEPT`)\n */\nexport function valToPts (pt: number | string): number {\n\tconst points = Number(pt) || 0\n\treturn isNaN(points) ? 0 : Math.round(points * ONEPT)\n}\n\n/**\n * Convert a transparency percentage (0-100) into a schema-valid `<a:alpha>` value\n * (ST_PositiveFixedPercentage, 0-100000). Out-of-range transparency yields an\n * alpha that PowerPoint rejects as needing repair, so clamp into range and warn.\n */\nexport function transparencyToAlpha (transparency: number): number {\n\tconst pct = Math.min(100, Math.max(0, transparency))\n\tif (pct !== transparency) console.warn(`Warning: transparency ${transparency} is outside the valid range 0-100; using ${pct}.`)\n\treturn Math.round((100 - pct) * 1000)\n}\n\n/** Convert an opacity (0-1) into a schema-valid `<a:alpha>` value (0-100000); clamps + warns on out-of-range input. */\nexport function opacityToAlpha (opacity: number): number {\n\tconst o = Math.min(1, Math.max(0, opacity))\n\tif (o !== opacity) console.warn(`Warning: opacity ${opacity} is outside the valid range 0-1; using ${o}.`)\n\treturn Math.round(o * 100000)\n}\n\n/**\n * Convert a line width (points) to EMU clamped into ST_LineWidth (0..20116800 EMU,\n * i.e. 0-1584pt). Out-of-range widths make PowerPoint report the package as needing\n * repair, so clamp into range and warn.\n */\nexport function lineWidthToEmu (widthPts: number | string): number {\n\tconst raw = valToPts(widthPts)\n\tconst clamped = Math.min(20116800, Math.max(0, raw))\n\tif (clamped !== raw) console.warn(`Warning: line width ${widthPts} is outside the valid range 0-1584pt; using ${clamped / ONEPT}.`)\n\treturn clamped\n}\n\n/**\n * Convert degrees (0..360) to PowerPoint `rot` value\n * @param {number} d degrees\n * @returns {number} calculated `rot` value\n */\nexport function convertRotationDegrees (d: number): number {\n\td = d || 0\n\treturn Math.round((d > 360 ? d - 360 : d) * 60000)\n}\n\n/**\n * Converts component value to hex value\n * @param {number} c - component color\n * @returns {string} hex string\n */\nexport function 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 */\nexport function rgbToHex (r: number, g: number, b: number): string {\n\treturn (componentToHex(r) + componentToHex(g) + componentToHex(b)).toUpperCase()\n}\n\n/** TODO: FUTURE: TODO-4.0:\n * @date 2022-04-10\n * @tldr this s/b a private method with all current calls switched to `genXmlColorSelection()`\n * @desc lots of code calls this method\n * @example [gen-charts.tx] `strXml += '<a:solidFill>' + createColorElement(seriesColor, `<a:alpha val=\"${Math.round(opts.chartColorsOpacity * 1000)}\"/>`) + '</a:solidFill>'`\n * Thi sis wrong. We s/b calling `genXmlColorSelection()` instead as it returns `<a:solidfill>BLAH</a:solidFill>`!!\n */\n/**\n * Create either a `a:schemeClr` - (scheme color) or `a:srgbClr` (hexa representation).\n * @param {string|SCHEME_COLORS} colorStr - hexa representation (eg. \"FFFF00\") or a scheme color constant (eg. pptx.SchemeColor.ACCENT1)\n * @param {string} innerElements - additional elements that adjust the color and are enclosed by the color element\n * @returns {string} XML string\n */\nexport function createColorElement (colorStr: string | SCHEME_COLORS, innerElements?: string): string {\n\tif (typeof colorStr !== 'string') {\n\t\tconsole.warn(`createColorElement: expected a string color value, got ${typeof colorStr}. \"${DEF_FONT_COLOR}\" used instead.`)\n\t\tcolorStr = DEF_FONT_COLOR\n\t}\n\tlet colorVal = (colorStr || '').replace('#', '')\n\n\t// 8-char hex (RGBA) — strip the alpha byte to a sibling <a:alpha val=\"N\"/>,\n\t// continue with the leading 6-char RGB through the existing validation. This keeps\n\t// fill/text/line/glow paths from silently falling back to DEF_FONT_COLOR on RGBA input.\n\tif (/^[0-9a-fA-F]{8}$/.test(colorVal)) {\n\t\t// If the caller already supplied an explicit <a:alpha> (e.g. shadow/glow `opacity`),\n\t\t// it wins — do NOT add a second alpha from the RGBA byte, which would emit two\n\t\t// <a:alpha> children and produce schema-invalid OOXML (CT_SRgbColor allows one).\n\t\tif (!innerElements?.includes('<a:alpha')) {\n\t\t\tconst alphaHex = colorVal.slice(6, 8)\n\t\t\tconst alphaVal = Math.round((parseInt(alphaHex, 16) / 255) * 100000)\n\t\t\tinnerElements = `<a:alpha val=\"${alphaVal}\"/>${innerElements || ''}`\n\t\t}\n\t\tcolorVal = colorVal.slice(0, 6)\n\t}\n\n\tif (\n\t\t!REGEX_HEX_COLOR.test(colorVal) &&\n\t\tcolorVal !== SchemeColor.background1 &&\n\t\tcolorVal !== SchemeColor.background2 &&\n\t\tcolorVal !== SchemeColor.text1 &&\n\t\tcolorVal !== SchemeColor.text2 &&\n\t\tcolorVal !== SchemeColor.accent1 &&\n\t\tcolorVal !== SchemeColor.accent2 &&\n\t\tcolorVal !== SchemeColor.accent3 &&\n\t\tcolorVal !== SchemeColor.accent4 &&\n\t\tcolorVal !== SchemeColor.accent5 &&\n\t\tcolorVal !== SchemeColor.accent6\n\t) {\n\t\tconsole.warn(`\"${colorVal}\" is not a valid scheme color or hex RGB! \"${DEF_FONT_COLOR}\" used instead. Only provide 6-digit RGB or 'pptx.SchemeColor' values!`)\n\t\tcolorVal = DEF_FONT_COLOR\n\t}\n\n\tconst tagName = REGEX_HEX_COLOR.test(colorVal) ? 'srgbClr' : 'schemeClr'\n\tconst colorAttr = 'val=\"' + (REGEX_HEX_COLOR.test(colorVal) ? colorVal.toUpperCase() : colorVal) + '\"'\n\n\treturn innerElements ? `<a:${tagName} ${colorAttr}>${innerElements}</a:${tagName}>` : `<a:${tagName} ${colorAttr}/>`\n}\n\n/**\n * Creates `a:glow` element\n * @param {TextGlowProps} options glow properties\n * @param {TextGlowProps} defaults defaults for unspecified properties in `opts`\n * @see http://officeopenxml.com/drwSp-effects.php\n * { size: 8, color: 'FFFFFF', opacity: 0.75 };\n */\nexport function createGlowElement (options: TextGlowProps, defaults: TextGlowProps): string {\n\tlet strXml = ''\n\tconst opts = { ...defaults, ...options }\n\tconst size = Math.round(opts.size * ONEPT)\n\tconst color = opts.color || DEF_FONT_COLOR\n\tconst opacity = opacityToAlpha(opts.opacity ?? 0)\n\n\tstrXml += `<a:glow rad=\"${size}\">`\n\tstrXml += createColorElement(color, `<a:alpha val=\"${opacity}\"/>`)\n\tstrXml += '</a:glow>'\n\n\treturn strXml\n}\n\n/**\n * Creates an `a:outerShdw`/`a:innerShdw` element for a text run or shape.\n * Returns the shadow element only (no wrapping `a:effectLst`) so callers can\n * combine it with other effects (e.g. glow) inside a single `a:effectLst`.\n * @param {ShadowProps} options shadow properties\n * @param {ShadowProps} defaults defaults for unspecified properties in `options`\n * @see http://officeopenxml.com/drwSp-effects.php\n * @returns {string} XML string, or '' when type is 'none'\n */\nexport function createShadowElement (options: ShadowProps, defaults: ShadowProps): string {\n\tconst opts = { ...defaults, ...options }\n\tif (opts.type === 'none') return ''\n\n\t// NOTE: read into locals so we never mutate the caller's options (re-emission\n\t// would otherwise re-convert pt→EMU and produce absurd values).\n\tconst type = opts.type || 'outer'\n\tconst blur = valToPts(opts.blur ?? 0)\n\tconst offset = valToPts(opts.offset ?? 0)\n\tconst angle = Math.round((opts.angle ?? 0) * 60000)\n\tconst opacity = Math.round((opts.opacity ?? 0.75) * 100000)\n\tconst color = opts.color || DEF_FONT_COLOR\n\n\tconst extraAttrs = type === 'outer' ? 'sx=\"100000\" sy=\"100000\" kx=\"0\" ky=\"0\" algn=\"bl\" rotWithShape=\"0\" ' : ''\n\tlet strXml = `<a:${type}Shdw ${extraAttrs}blurRad=\"${blur}\" dist=\"${offset}\" dir=\"${angle}\">`\n\tstrXml += createColorElement(color, `<a:alpha val=\"${opacity}\"/>`)\n\tstrXml += `</a:${type}Shdw>`\n\n\treturn strXml\n}\n\nfunction boolToXml (value: boolean): string {\n\treturn value ? '1' : '0'\n}\n\nfunction normalizeGradientAngle (angle: number | undefined): number {\n\tconst degrees = angle ?? 0\n\tif (typeof degrees !== 'number' || !Number.isFinite(degrees)) throw new Error('Gradient angle must be a finite number.')\n\treturn convertRotationDegrees(((degrees % 360) + 360) % 360)\n}\n\nfunction gradientStopColorAdjustments (stop: GradientStopProps): string {\n\tlet internalElements = ''\n\tif (stop.alpha) internalElements += `<a:alpha val=\"${transparencyToAlpha(stop.alpha)}\"/>` // DEPRECATED: @deprecated v3.3.0\n\tif (stop.transparency) internalElements += `<a:alpha val=\"${transparencyToAlpha(stop.transparency)}\"/>`\n\treturn internalElements\n}\n\nfunction normalizeGradientStops (stops: GradientStopProps[] | undefined): GradientStopProps[] {\n\tif (!Array.isArray(stops) || stops.length < 2) throw new Error('Gradient fill requires at least two stops.')\n\n\treturn stops\n\t\t.map(stop => {\n\t\t\tif (!stop || typeof stop.position !== 'number' || !Number.isFinite(stop.position)) {\n\t\t\t\tthrow new Error('Gradient stop position must be a finite number from 0 to 100.')\n\t\t\t}\n\t\t\tif (stop.position < 0 || stop.position > 100) throw new Error('Gradient stop position must be from 0 to 100.')\n\t\t\treturn stop\n\t\t})\n\t\t.sort((a, b) => a.position - b.position)\n}\n\n/**\n * Create a native DrawingML gradient fill.\n * @param {GradientFillProps} gradient gradient fill options\n * @returns XML string\n */\nexport function genXmlGradientFill (gradient: GradientFillProps | undefined): string {\n\tif (!gradient || gradient.kind !== 'linear') throw new Error('Gradient fill currently supports only linear gradients.')\n\tif (typeof gradient.rotateWithShape !== 'undefined' && typeof gradient.rotateWithShape !== 'boolean') {\n\t\tthrow new Error('Gradient rotateWithShape must be a boolean.')\n\t}\n\tif (typeof gradient.scaled !== 'undefined' && typeof gradient.scaled !== 'boolean') throw new Error('Gradient scaled must be a boolean.')\n\n\tconst stops = normalizeGradientStops(gradient.stops)\n\tconst rotWithShape = gradient.rotateWithShape ?? true\n\tconst scaledAttr = typeof gradient.scaled === 'boolean' ? ` scaled=\"${boolToXml(gradient.scaled)}\"` : ''\n\n\tlet strXml = `<a:gradFill rotWithShape=\"${boolToXml(rotWithShape)}\">`\n\tstrXml += '<a:gsLst>'\n\tstops.forEach(stop => {\n\t\tconst position = Math.round(stop.position * 1000)\n\t\tstrXml += `<a:gs pos=\"${position}\">${createColorElement(stop.color, gradientStopColorAdjustments(stop))}</a:gs>`\n\t})\n\tstrXml += '</a:gsLst>'\n\tstrXml += `<a:lin ang=\"${normalizeGradientAngle(gradient.angle)}\"${scaledAttr}/>`\n\tstrXml += '</a:gradFill>'\n\n\treturn strXml\n}\n\n/**\n * Create a native DrawingML pattern fill.\n * @param {PatternFillProps} pattern pattern fill options\n * @returns XML string\n */\nexport function genXmlPatternFill (pattern: PatternFillProps | undefined): string {\n\tif (!pattern) throw new Error('Pattern fill requires a pattern object.')\n\tconst fgColor = pattern.fgColor ?? '000000'\n\tconst bgColor = pattern.bgColor ?? 'FFFFFF'\n\treturn (\n\t\t`<a:pattFill prst=\"${pattern.preset}\">` +\n\t\t`<a:fgClr>${createColorElement(fgColor)}</a:fgClr>` +\n\t\t`<a:bgClr>${createColorElement(bgColor)}</a:bgClr>` +\n\t\t'</a:pattFill>'\n\t)\n}\n\n/**\n * Create color selection\n * @param {Color | ShapeFillProps | ShapeLineProps} props fill props\n * @returns XML string\n */\n/**\n * Map a friendly `LineCap` value to the OOXML `cap` attribute value (`flat`/`sq`/`rnd`).\n * @param {LineCap} [lineCap] - line cap style (defaults to `flat`)\n * @returns {string} value for the `cap` attribute on `<a:ln>`\n */\nexport function createLineCap (lineCap?: LineCap): string {\n\tif (!lineCap || lineCap === 'flat') {\n\t\treturn 'flat'\n\t} else if (lineCap === 'square') {\n\t\treturn 'sq'\n\t} else if (lineCap === 'round') {\n\t\treturn 'rnd'\n\t} else {\n\t\tconst neverLineCap: never = lineCap\n\t\tthrow new Error(`Invalid line cap: ${String(neverLineCap)}`)\n\t}\n}\n\nexport function genXmlColorSelection (props: Color | ShapeFillProps | ShapeLineProps): string {\n\tlet fillType = 'solid'\n\tlet colorVal = ''\n\tlet internalElements = ''\n\tlet outText = ''\n\n\tif (props) {\n\t\tif (typeof props === 'string') colorVal = props\n\t\telse {\n\t\t\tif (props.type) fillType = props.type\n\t\t\tif (props.color) colorVal = props.color\n\t\t\tif (props.alpha) internalElements += `<a:alpha val=\"${transparencyToAlpha(props.alpha)}\"/>` // DEPRECATED: @deprecated v3.3.0\n\t\t\tif (props.transparency) internalElements += `<a:alpha val=\"${transparencyToAlpha(props.transparency)}\"/>`\n\t\t}\n\n\t\tswitch (fillType) {\n\t\t\tcase 'solid':\n\t\t\t\toutText += `<a:solidFill>${createColorElement(colorVal, internalElements)}</a:solidFill>`\n\t\t\t\tbreak\n\t\t\tcase 'gradient':\n\t\t\t\toutText += genXmlGradientFill(typeof props === 'string' ? undefined : props.gradient)\n\t\t\t\tbreak\n\t\t\tcase 'pattern':\n\t\t\t\toutText += genXmlPatternFill(typeof props === 'string' ? undefined : props.pattern)\n\t\t\t\tbreak\n\t\t\tdefault: // @note need a statement as having only \"break\" can be removed by bundlers, then triggers \"no-default\" js-linter\n\t\t\t\toutText += ''\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\treturn outText\n}\n\n/**\n * Get a new rel ID (rId) for charts, media, etc.\n * @param {PresSlideInternal} target - the slide to use\n * @returns {number} count of all current rels plus 1 for the caller to use as its \"rId\"\n */\nexport function getNewRelId (target: PresSlideInternal): number {\n\treturn target._rels.length + target._relsChart.length + target._relsMedia.length + 1\n}\n\n/**\n * Checks shadow options passed by user and performs corrections if needed.\n * @param {ShadowProps} ShadowProps - shadow options\n */\nexport function correctShadowOptions (ShadowProps?: ShadowProps | null): ShadowProps | undefined {\n\tif (!ShadowProps || typeof ShadowProps !== 'object') {\n\t\t// console.warn(\"`shadow` options must be an object. Ex: `{shadow: {type:'none'}}`\")\n\t\treturn\n\t}\n\n\t// OPT: `type`\n\tif (ShadowProps.type !== 'outer' && ShadowProps.type !== 'inner' && ShadowProps.type !== 'none') {\n\t\tconsole.warn('Warning: shadow.type options are `outer`, `inner` or `none`.')\n\t\tShadowProps.type = 'outer'\n\t}\n\n\t// OPT: `angle`\n\tif (ShadowProps.angle) {\n\t\t// A: REALITY-CHECK\n\t\tif (isNaN(Number(ShadowProps.angle)) || ShadowProps.angle < 0 || ShadowProps.angle > 359) {\n\t\t\tconsole.warn('Warning: shadow.angle can only be 0-359')\n\t\t\tShadowProps.angle = 270\n\t\t}\n\n\t\t// B: ROBUST: Cast any type of valid arg to int: '12', 12.3, etc. -> 12\n\t\tShadowProps.angle = Math.round(Number(ShadowProps.angle))\n\t}\n\n\t// OPT: `opacity`\n\tif (ShadowProps.opacity) {\n\t\t// A: REALITY-CHECK\n\t\tif (isNaN(Number(ShadowProps.opacity)) || ShadowProps.opacity < 0 || ShadowProps.opacity > 1) {\n\t\t\tconsole.warn('Warning: shadow.opacity can only be 0-1')\n\t\t\tShadowProps.opacity = 0.75\n\t\t}\n\n\t\t// B: ROBUST: Cast any type of valid arg to int: '12', 12.3, etc. -> 12\n\t\tShadowProps.opacity = Number(ShadowProps.opacity)\n\t}\n\n\t// OPT: `color`\n\tif (ShadowProps.color) {\n\t\t// INCORRECT FORMAT\n\t\tif (ShadowProps.color.startsWith('#')) {\n\t\t\tconsole.warn('Warning: shadow.color should not include hash (#) character, , e.g. \"FF0000\"')\n\t\t\tShadowProps.color = ShadowProps.color.replace('#', '')\n\t\t}\n\n\t\t// 8-char hex (RGBA) — derive `opacity` from the alpha byte (only when caller\n\t\t// did not pass an explicit opacity), then strip the alpha byte from the color so\n\t\t// emit sites produce valid 6-char `<a:srgbClr val=\"…\"/>`.\n\t\tif (/^[0-9a-fA-F]{8}$/.test(ShadowProps.color)) {\n\t\t\tconst alphaHex = ShadowProps.color.slice(6, 8)\n\t\t\tif (ShadowProps.opacity === undefined) {\n\t\t\t\tShadowProps.opacity = parseInt(alphaHex, 16) / 255\n\t\t\t}\n\t\t\tShadowProps.color = ShadowProps.color.slice(0, 6)\n\t\t}\n\t}\n\n\treturn ShadowProps\n}\n\n/**\n * Encode raw SVG markup as a base64 `image/svg+xml` data URI.\n * - lets callers pass inline SVG to `addImage({ svg })` without hand-rolling base64\n * - isomorphic and UTF-8 safe: uses the global `TextEncoder`/`btoa` (Node >=16, browsers)\n * @param {string} svg - SVG markup, e.g. `'<svg ...>...</svg>'`\n * @returns {string} a `data:image/svg+xml;base64,...` URI\n */\nexport function svgMarkupToDataUri (svg: string): string {\n\tconst bytes = new TextEncoder().encode(svg)\n\tlet binary = ''\n\tfor (let i = 0; i < bytes.length; i++) {\n\t\tbinary += String.fromCharCode(bytes[i])\n\t}\n\treturn `data:image/svg+xml;base64,${btoa(binary)}`\n}\n\n/**\n * Decode a base64 image payload (raw base64 or a `data:` URI) to bytes.\n * - tolerant of the `data:[mime];base64,` prefix and of whitespace in the payload\n * @param {string} b64 - base64 string or data URI\n * @returns {Uint8Array | null} decoded bytes, or `null` when the payload is empty/undecodable\n */\nfunction decodeBase64ToBytes (b64: string): Uint8Array | null {\n\tif (!b64) return null\n\t// Strip any `data:...;base64,` prefix and surrounding whitespace\n\tconst comma = b64.indexOf('base64,')\n\tconst payload = (comma >= 0 ? b64.slice(comma + 'base64,'.length) : b64).replace(/\\s/g, '')\n\tif (!payload) return null\n\ttry {\n\t\tconst binary = atob(payload)\n\t\tconst bytes = new Uint8Array(binary.length)\n\t\tfor (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i)\n\t\treturn bytes\n\t} catch {\n\t\treturn null\n\t}\n}\n\n/**\n * Read the intrinsic dimensions of an image from its header bytes.\n * - synchronous: parses only file-format headers, never decodes pixels\n * - raster: PNG, JPEG, GIF, BMP, and WebP (VP8 / VP8L / VP8X) — natural pixels\n * - vector: SVG — intrinsic size from the root `<svg>` width/height or viewBox\n * - unrecognized formats return `null` (no measurable intrinsic size)\n *\n * Used by image `sizing: 'cover' | 'contain'` to compute an aspect-correct\n * `<a:srcRect>` crop from the *natural* image ratio rather than the displayed box.\n * @param {string} dataB64 - base64 image payload or `data:` URI\n * @returns {{ w: number, h: number } | null} natural size, or `null` when unmeasurable\n */\nexport function getImageSizeFromBase64 (dataB64: string): { w: number, h: number } | null {\n\tconst b = decodeBase64ToBytes(dataB64)\n\tif (!b || b.length < 24) return null\n\n\t// PNG: 8-byte signature, then IHDR with width@16 / height@20 (big-endian uint32)\n\tif (b[0] === 0x89 && b[1] === 0x50 && b[2] === 0x4e && b[3] === 0x47) {\n\t\tconst w = (b[16] << 24) | (b[17] << 16) | (b[18] << 8) | b[19]\n\t\tconst h = (b[20] << 24) | (b[21] << 16) | (b[22] << 8) | b[23]\n\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t}\n\n\t// GIF: \"GIF87a\"/\"GIF89a\", width@6 / height@8 (little-endian uint16)\n\tif (b[0] === 0x47 && b[1] === 0x49 && b[2] === 0x46) {\n\t\tconst w = b[6] | (b[7] << 8)\n\t\tconst h = b[8] | (b[9] << 8)\n\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t}\n\n\t// BMP: \"BM\", width@18 / height@22 (little-endian int32; height may be negative for top-down)\n\tif (b[0] === 0x42 && b[1] === 0x4d) {\n\t\tconst w = b[18] | (b[19] << 8) | (b[20] << 16) | (b[21] << 24)\n\t\tconst h = b[22] | (b[23] << 8) | (b[24] << 16) | (b[25] << 24)\n\t\tconst aw = Math.abs(w)\n\t\tconst ah = Math.abs(h)\n\t\treturn aw > 0 && ah > 0 ? { w: aw, h: ah } : null\n\t}\n\n\t// WebP: \"RIFF\"....\"WEBP\" then a VP8 / VP8L / VP8X chunk\n\tif (b[0] === 0x52 && b[1] === 0x49 && b[2] === 0x46 && b[3] === 0x46 && b[8] === 0x57 && b[9] === 0x45 && b[10] === 0x42 && b[11] === 0x50) {\n\t\tconst fourCC = String.fromCharCode(b[12], b[13], b[14], b[15])\n\t\tif (fourCC === 'VP8 ' && b.length >= 30) {\n\t\t\t// Lossy: 14-bit width/height at offset 26/28 (little-endian, mask off scale bits)\n\t\t\tconst w = ((b[26] | (b[27] << 8)) & 0x3fff)\n\t\t\tconst h = ((b[28] | (b[29] << 8)) & 0x3fff)\n\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t}\n\t\tif (fourCC === 'VP8L' && b.length >= 25) {\n\t\t\t// Lossless: 14-bit width/height packed starting at bit 0 of offset 21\n\t\t\tconst bits = b[21] | (b[22] << 8) | (b[23] << 16) | (b[24] << 24)\n\t\t\tconst w = (bits & 0x3fff) + 1\n\t\t\tconst h = ((bits >> 14) & 0x3fff) + 1\n\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t}\n\t\tif (fourCC === 'VP8X' && b.length >= 30) {\n\t\t\t// Extended: 24-bit canvas width/height minus one at offset 24/27 (little-endian)\n\t\t\tconst w = (b[24] | (b[25] << 8) | (b[26] << 16)) + 1\n\t\t\tconst h = (b[27] | (b[28] << 8) | (b[29] << 16)) + 1\n\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t}\n\t\treturn null\n\t}\n\n\t// JPEG: \"FFD8\", scan segment markers for a Start-Of-Frame (SOFn) and read height@5 / width@7\n\tif (b[0] === 0xff && b[1] === 0xd8) {\n\t\tlet i = 2\n\t\twhile (i + 9 < b.length) {\n\t\t\tif (b[i] !== 0xff) { i++; continue }\n\t\t\tconst marker = b[i + 1]\n\t\t\t// SOF0..SOF15 carry frame dimensions, excluding DHT(C4)/JPG(C8)/DAC(CC)\n\t\t\tif (marker >= 0xc0 && marker <= 0xcf && marker !== 0xc4 && marker !== 0xc8 && marker !== 0xcc) {\n\t\t\t\tconst h = (b[i + 5] << 8) | b[i + 6]\n\t\t\t\tconst w = (b[i + 7] << 8) | b[i + 8]\n\t\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t\t}\n\t\t\t// Standalone markers (RSTn / SOI / EOI / TEM) have no length payload\n\t\t\tif ((marker >= 0xd0 && marker <= 0xd9) || marker === 0x01) { i += 2; continue }\n\t\t\t// Otherwise skip this segment using its 2-byte big-endian length\n\t\t\tconst segLen = (b[i + 2] << 8) | b[i + 3]\n\t\t\tif (segLen < 2) break\n\t\t\ti += 2 + segLen\n\t\t}\n\t\treturn null\n\t}\n\n\t// SVG: text-based vector with no binary signature. When the payload is an\n\t// `<svg>` document, read its intrinsic size from the root element so that\n\t// `sizing: 'cover' | 'contain'` is aspect-correct for SVG, not just rasters.\n\tconst text = utf8Decode(b)\n\tif (/<svg[\\s>]/i.test(text)) return getSvgSizeFromMarkup(text)\n\n\treturn null\n}\n\n/**\n * Read the intrinsic size of an SVG document from its root `<svg>` element.\n * Follows the SVG sizing model: an explicit absolute `width`/`height` pair wins;\n * otherwise the `viewBox` width/height defines the size (and thus aspect ratio).\n * Percentage or missing `width`/`height` fall through to `viewBox`.\n * @param {string} svg - SVG markup\n * @returns {{ w: number, h: number } | null} intrinsic size, or `null` when undeterminable\n */\nfunction getSvgSizeFromMarkup (svg: string): { w: number, h: number } | null {\n\tconst openTag = /<svg\\b[^>]*>/i.exec(svg)?.[0]\n\tif (!openTag) return null\n\tconst attr = (name: string): string | null => new RegExp(`\\\\b${name}\\\\s*=\\\\s*[\"']([^\"']*)[\"']`, 'i').exec(openTag)?.[1] ?? null\n\t// Leading number with an optional absolute unit; a percentage is not an intrinsic length.\n\tconst absLength = (val: string | null): number => {\n\t\tif (val == null || /%\\s*$/.test(val)) return NaN\n\t\tconst m = /^\\s*\\+?(\\d*\\.?\\d+)/.exec(val)\n\t\treturn m ? parseFloat(m[1]) : NaN\n\t}\n\tlet w = absLength(attr('width'))\n\tlet h = absLength(attr('height'))\n\tif (!(w > 0 && h > 0)) {\n\t\tconst vb = attr('viewBox')\n\t\tconst p = vb ? vb.trim().split(/[\\s,]+/).map(Number) : []\n\t\tif (p.length === 4 && p[2] > 0 && p[3] > 0) { w = p[2]; h = p[3] }\n\t}\n\treturn w > 0 && h > 0 ? { w, h } : null\n}\n\n/** Decode UTF-8 bytes to a string, isomorphic across Node and browsers. */\nfunction utf8Decode (bytes: Uint8Array): string {\n\treturn new TextDecoder().decode(bytes)\n}\n","/**\n * PptxGenJS: Table Generation\n */\n\nimport { DEF_FONT_SIZE, DEF_SLIDE_MARGIN_IN, EMU, LINEH_MODIFIER, ONEPT, SLIDE_OBJECT_TYPES } from './core-enums.js'\nimport type {\n\tAddSlideProps,\n\tBorderProps,\n\tPresLayout,\n\tPresSlide,\n\tSlideLayoutInternal,\n\tTableCell,\n\tTableToSlidesProps,\n\tTableRow,\n\tTableRowSlide,\n\tTableCellProps,\n} from './core-interfaces.js'\nimport { getSmartParseNumber, inch2Emu, rgbToHex, valToPts } from './gen-utils.js'\n\ntype MarginTuple = [number, number, number, number]\ntype BorderTuple = [BorderProps, BorderProps, BorderProps, BorderProps]\ntype AutoPageCell = TableCell & {\n\t_lineHeight: number\n\t_lines: TableCell[][]\n\toptions: TableCellProps\n\ttext: TableCell[]\n}\ntype TableToSlidesHost = {\n\taddSlide: (options?: AddSlideProps) => PresSlide\n\tpresLayout: PresLayout\n}\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 = Math.floor((colWidth / ONEPT) * EMU) / ((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 / ONEPT) * EMU) / ((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 / ONEPT) * EMU) / ((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: SLIDE_OBJECT_TYPES.tablecell, text: ' ' })\n\t} else if (typeof cell.text === 'number' || typeof cell.text === 'string') {\n\t\tinputCells.push({ _type: SLIDE_OBJECT_TYPES.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\t// console.log('...............................................\\n\\n')\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: SLIDE_OBJECT_TYPES.tablecell, text: part, options: cell.options })\n\t\t\t\t} else {\n\t\t\t\t\tnewLine.push({ _type: SLIDE_OBJECT_TYPES.tablecell, text: part, options: { ...cell.options, breakLine: true } })\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: SLIDE_OBJECT_TYPES.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\t// console.log('...............................................\\n\\n')\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({ _type: SLIDE_OBJECT_TYPES.tablecell, text: word + (idx + 1 < lineWords.length ? ' ' : ''), options: cellProps })\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\t// console.log('...............................................\\n\\n')\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\t// if (verbose) console.log(`STEP 4: New line added: (${strCurrLine.length} + ${word.text.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/**\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(tableRows: TableCell[][] = [], tableProps: TableToSlidesProps = {}, presLayout: PresLayout, masterSlide?: SlideLayoutInternal | null): TableRowSlide[] {\n\tlet arrInchMargins = DEF_SLIDE_MARGIN_IN\n\tlet emuSlideTabW: number\n\tlet emuSlideTabH = EMU * 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 || tableProps.newSlideStartY || arrInchMargins[0])\n\t\temuSlideTabH = (tablePropH || presLayout.height) - emuStartY - inch2Emu(arrInchMargins[2])\n\t\t// console.log(`| startY .......................................... = ${(emuStartY / EMU).toFixed(1)}`)\n\t\t// console.log(`| emuSlideTabH .................................... = ${(emuSlideTabH / EMU).toFixed(1)}`)\n\t\tif (tableRowSlides.length > 1) {\n\t\t\t// D: RULE: Use margins for starting point after the initial Slide, not `opt.y` (ISSUE #43, ISSUE #47, ISSUE #48)\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 (typeof tableProps.newSlideStartY === 'number') {\n\t\t\t\t// @deprecated v3.3.0\n\t\t\t\temuSlideTabH = (tablePropH || presLayout.height) - inch2Emu(tableProps.newSlideStartY + arrInchMargins[2])\n\t\t\t} else if (tablePropY) {\n\t\t\t\temuSlideTabH = (tablePropH || presLayout.height) - inch2Emu((tablePropY / EMU < arrInchMargins[0] ? tablePropY / EMU : arrInchMargins[0]) + arrInchMargins[2])\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 small explicit `h` (or a large `y`) can leave zero/negative usable height, so no\n\t\t// row ever fits. That previously emitted degenerate empty overflow pages (rows:[]), which made\n\t\t// the recursive addTable throw \"Array expected\". Ignore the unusable height, fall back to the\n\t\t// full slide area between margins, and warn once rather than emit a broken table.\n\t\tif (emuSlideTabH <= 0) {\n\t\t\tconst emuStartY = tableRowSlides.length === 0\n\t\t\t\t? (tablePropY || inch2Emu(arrInchMargins[0]))\n\t\t\t\t: inch2Emu(tableProps.autoPageSlideStartY || tableProps.newSlideStartY || arrInchMargins[0])\n\t\t\tconst fallbackH = presLayout.height - emuStartY - inch2Emu(arrInchMargins[2])\n\t\t\tif (!warnedNoTabH) {\n\t\t\t\tconsole.warn('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\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).toFixed(1)}`)\n\t\tconsole.log(`| presLayout.height ............................... = ${(presLayout.height / EMU).toFixed(1)}`)\n\t\tconsole.log(`| tableProps.x .................................... = ${typeof tableProps.x === 'number' ? (tableProps.x / EMU).toFixed(1) : tableProps.x}`)\n\t\tconsole.log(`| tableProps.y .................................... = ${typeof tableProps.y === 'number' ? (tableProps.y / EMU).toFixed(1) : tableProps.y}`)\n\t\tconsole.log(`| tableProps.w .................................... = ${typeof tableProps.w === 'number' ? (tableProps.w / EMU).toFixed(1) : tableProps.w}`)\n\t\tconsole.log(`| tableProps.h .................................... = ${typeof tableProps.h === 'number' ? (tableProps.h / EMU).toFixed(1) : tableProps.h}`)\n\t\tconsole.log(`| tableProps.slideMargin .......................... = ${tableProps.slideMargin ? String(tableProps.slideMargin) : ''}`)\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}`)\n\t\tconsole.log(`| tablePropY ...................................... = ${tablePropY / EMU}`)\n\t\tconsole.log(`| tablePropW ...................................... = ${tablePropW / EMU}`)\n\t\tconsole.log(`| tablePropH ...................................... = ${tablePropH / EMU}`)\n\t\tconsole.log(`| tableCalcW ...................................... = ${tableCalcW / EMU}`)\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))) { arrInchMargins = [Number(masterSlide._margin), Number(masterSlide._margin), Number(masterSlide._margin), Number(masterSlide._margin)] }\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)) arrInchMargins = [tableProps.slideMargin, tableProps.slideMargin, tableProps.slideMargin, tableProps.slideMargin]\n\t\t}\n\n\t\tif (tableProps.verbose) console.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: SLIDE_OBJECT_TYPES.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(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) ? tableProps.colW.reduce((p, n) => p + n) * EMU : tableProps.colW * numCols || 0\n\t\tif (tableProps.verbose) console.log(`| tableCalcW ...................................... = ${tableCalcW / EMU}`)\n\t}\n\n\t// STEP 4: Calculate usable width now that total usable space is known (`emuSlideTabW`)\n\t{\n\t\temuSlideTabW = tableCalcW || inch2Emu((tablePropX ? tablePropX / EMU : arrInchMargins[1]) + arrInchMargins[3])\n\t\tif (tableProps.verbose) console.log(`| emuSlideTabW .................................... = ${(emuSlideTabW / EMU).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 / numCols)\n\t\t\t}\n\t\t}\n\t}\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[] }\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: SLIDE_OBJECT_TYPES.tablecell,\n\t\t\t\ttext: [],\n\t\t\t\toptions: cell.options,\n\t\t\t})\n\n\t\t\t/** FUTURE: DEPRECATED:\n\t\t\t * - Backwards-Compat: Oops! Discovered we were still using points for cell margin before v3.8.0 (UGH!)\n\t\t\t * - We cant introduce a breaking change before v4.0, so...\n\t\t\t */\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 && cellMargin[0] >= 1) {\n\t\t\t\tif (cellMargin[0] && valToPts(cellMargin[0]) > maxCellMarTopEmu) maxCellMarTopEmu = valToPts(cellMargin[0])\n\t\t\t\telse if (tableMargin?.[0] && valToPts(tableMargin[0]) > maxCellMarTopEmu) maxCellMarTopEmu = valToPts(tableMargin[0])\n\t\t\t\tif (cellMargin[2] && valToPts(cellMargin[2]) > maxCellMarBtmEmu) maxCellMarBtmEmu = valToPts(cellMargin[2])\n\t\t\t\telse if (tableMargin?.[2] && valToPts(tableMargin[2]) > maxCellMarBtmEmu) maxCellMarBtmEmu = valToPts(tableMargin[2])\n\t\t\t} else {\n\t\t\t\tif (cellMargin?.[0] && inch2Emu(cellMargin[0]) > maxCellMarTopEmu) maxCellMarTopEmu = inch2Emu(cellMargin[0])\n\t\t\t\telse if (tableMargin?.[0] && inch2Emu(tableMargin[0]) > maxCellMarTopEmu) maxCellMarTopEmu = inch2Emu(tableMargin[0])\n\t\t\t\tif (cellMargin?.[2] && inch2Emu(cellMargin[2]) > maxCellMarBtmEmu) maxCellMarBtmEmu = inch2Emu(cellMargin[2])\n\t\t\t\telse if (tableMargin?.[2] && inch2Emu(tableMargin[2]) > maxCellMarBtmEmu) maxCellMarBtmEmu = inch2Emu(tableMargin[2])\n\t\t\t}\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) console.log(`| SLIDE [${tableRowSlides.length}]: emuSlideTabH ...... = ${(emuSlideTabH / EMU).toFixed(1)} `)\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: SLIDE_OBJECT_TYPES.tablecell,\n\t\t\t\t_lines: [],\n\t\t\t\t_lineHeight: inch2Emu(\n\t\t\t\t\t((cell.options?.fontSize ? cell.options.fontSize : tableProps.fontSize ? tableProps.fontSize : DEF_FONT_SIZE) *\n\t\t\t\t\t\t(LINEH_MODIFIER + (tableProps.autoPageLineWeight ? tableProps.autoPageLineWeight : 0))) /\n\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]\n\t\t\tconst cellColspan = cell.options?.colspan\n\t\t\tif (cellColspan) {\n\t\t\t\ttotalColW = tableColW.filter((_cell, idx) => idx >= iCell && idx < idx + cellColspan).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\tlet tgtCell: TableCell = 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).toFixed(2)} + ${(srcCell._lineHeight / EMU).toFixed(2)} > ${emuSlideTabH / EMU}`)\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 (currTableRow.length > 0 && currTableRow.map(cell => Array.isArray(cell.text) ? cell.text.length : 0).reduce((p, n) => p + n) > 0) newTableRowSlide.rows.push(currTableRow)\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 }\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: SLIDE_OBJECT_TYPES.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\t\t\t\temuTabCurrH += maxCellMarTopEmu + maxCellMarBtmEmu // Start row height with margins\n\t\t\t\tif (tableProps.verbose) console.log(`| SLIDE [${tableRowSlides.length}]: emuSlideTabH ...... = ${(emuSlideTabH / EMU).toFixed(1)} `)\n\n\t\t\t\t// F: reset current table height for this new Slide\n\t\t\t\temuTabCurrH = 0\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.addHeaderToEach || tableProps.autoPageRepeatHeader) && tableProps._arrObjTabHeadRows) {\n\t\t\t\t\ttableProps._arrObjTabHeadRows.forEach(row => {\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\temuTabCurrH += maxLineHeight // TODO: what about margins? dont we need to include cell margin in line height?\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 (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) tgtCell.text = tgtCell.text.concat({ _type: SLIDE_OBJECT_TYPES.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) newTableRowSlide.rows.push(currTableRow)\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) 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\tif (colSpanDepths[c] > 0) colSpanDepths[c]--\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).toFixed(2)} ( emuSlideTabH = ${(\n\t\t\t\t\temuSlideTabH / EMU\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\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 (upstream gitbrent/PptxGenJS#1235). 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\tconst arrRGB = String(colorStr).replace(/\\s+/gi, '').replace('rgba(', '').replace('rgb(', '').replace(')', '').split(',')\n\treturn { pt, color: rgbToHex(Number(arrRGB[0]), Number(arrRGB[1]), Number(arrRGB[2])) }\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 (upstream gitbrent/PptxGenJS#1157).\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/**\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 - pptxgenjs instance\n * @param {string} tabEleId - HTMLElementID of the table\n * @param {ITableToSlidesOpts} options - array of options (e.g.: tabsize)\n * @param {SlideLayoutInternal} masterSlide - masterSlide\n */\nexport function genTableToSlides(pptx: TableToSlidesHost, tabEleId: string, options: TableToSlidesProps = {}, masterSlide?: SlideLayoutInternal): void {\n\tconst opts = options || {}\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\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:\n\tif (!document.getElementById(tabEleId)) throw new Error('tableToSlides: Table ID \"' + tabEleId + '\" does not exist!')\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)) arrInchMargins = [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)) arrInchMargins = [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(`| pptx.presLayout.width ........................... = ${(pptx.presLayout.width / EMU).toFixed(1)}`)\n\t\tconsole.log(`| pptx.presLayout.height .......................... = ${(pptx.presLayout.height / EMU).toFixed(1)}`)\n\t\tconsole.log(`| emuSlideTabW .................................... = ${(emuSlideTabW / EMU).toFixed(1)}`)\n\t}\n\n\t// STEP 2: Grab table col widths - just find the first availble row, either thead/tbody/tfoot, others may have colspans, who cares, we only need col widths from 1\n\tlet firstRowCells = document.querySelectorAll(`#${tabEleId} tr:first-child th`)\n\tif (firstRowCells.length === 0) firstRowCells = document.querySelectorAll(`#${tabEleId} tr:first-child td`)\n\tfirstRowCells.forEach((cellEle: Element) => {\n\t\tconst cell = cellEle as HTMLTableCellElement\n\t\tif (cell.getAttribute('colspan')) {\n\t\t\t// Guesstimate (divide evenly) col widths\n\t\t\t// NOTE: both j$query and vanilla selectors return {0} when table is not visible)\n\t\t\tfor (let idxc = 0; idxc < Number(cell.getAttribute('colspan')); idxc++) {\n\t\t\t\tarrTabColW.push(Math.round(cell.offsetWidth / Number(cell.getAttribute('colspan'))))\n\t\t\t}\n\t\t} else {\n\t\t\tarrTabColW.push(cell.offsetWidth)\n\t\t}\n\t})\n\tarrTabColW.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\tarrTabColW.forEach((colW, idxW) => {\n\t\tconst intCalcWidth = Number(((Number(emuSlideTabW) * ((colW / intTabW) * 100)) / 100 / EMU).toFixed(2))\n\t\tconst headCell = document.querySelector(`#${tabEleId} thead tr:first-child th:nth-child(${idxW + 1})`)\n\t\tconst intSetWidth = headCell ? Number(headCell.getAttribute('data-pptx-width')) : 0\n\t\tconst intMinWidth = headCell ? Number(headCell.getAttribute('data-pptx-min-width')) : 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\tconst tableParts = ['thead', 'tbody', 'tfoot']\n\ttableParts.forEach(part => {\n\t\tdocument.querySelectorAll(`#${tabEleId} ${part} tr`).forEach((row: Element) => {\n\t\t\tconst htmlRow = row as HTMLTableRowElement\n\t\t\tconst arrObjTabCells: TableCell[] = []\n\t\t\tArray.from(htmlRow.cells).forEach(cell => {\n\t\t\t\t// A: Get RGB text/bkgd colors\n\t\t\t\tconst arrRGB1 = window.getComputedStyle(cell).getPropertyValue('color').replace(/\\s+/gi, '').replace('rgba(', '').replace('rgb(', '').replace(')', '').split(',')\n\t\t\t\tlet arrRGB2 = window\n\t\t\t\t\t.getComputedStyle(cell)\n\t\t\t\t\t.getPropertyValue('background-color')\n\t\t\t\t\t.replace(/\\s+/gi, '')\n\t\t\t\t\t.replace('rgba(', '')\n\t\t\t\t\t.replace('rgb(', '')\n\t\t\t\t\t.replace(')', '')\n\t\t\t\t\t.split(',')\n\t\t\t\tif (\n\t\t\t\t\t// NOTE: (ISSUE#57): Default for unstyled tables is black bkgd, so use white instead\n\t\t\t\t\twindow.getComputedStyle(cell).getPropertyValue('background-color') === 'rgba(0, 0, 0, 0)' ||\n\t\t\t\t\twindow.getComputedStyle(cell).getPropertyValue('transparent')\n\t\t\t\t) {\n\t\t\t\t\tarrRGB2 = ['255', '255', '255']\n\t\t\t\t}\n\n\t\t\t\t// B: Create option object\n\t\t\t\tconst cellOpts: TableCellProps = {\n\t\t\t\t\tbold: !!(\n\t\t\t\t\t\twindow.getComputedStyle(cell).getPropertyValue('font-weight') === 'bold' ||\n\t\t\t\t\t\tNumber(window.getComputedStyle(cell).getPropertyValue('font-weight')) >= 500\n\t\t\t\t\t),\n\t\t\t\t\tcolor: rgbToHex(Number(arrRGB1[0]), Number(arrRGB1[1]), Number(arrRGB1[2])),\n\t\t\t\t\tfill: { color: rgbToHex(Number(arrRGB2[0]), Number(arrRGB2[1]), Number(arrRGB2[2])) },\n\t\t\t\t\tfontSize: Number(window.getComputedStyle(cell).getPropertyValue('font-size').replace(/[a-z]/gi, '')),\n\t\t\t\t}\n\t\t\t\tconst fontFace = (window.getComputedStyle(cell).getPropertyValue('font-family') || '').split(',')[0].replace(/\"/g, '').replace('inherit', '').replace('initial', '')\n\t\t\t\tconst colspan = Number(cell.getAttribute('colspan')) || undefined\n\t\t\t\tconst rowspan = Number(cell.getAttribute('rowspan')) || undefined\n\t\t\t\tif (fontFace) cellOpts.fontFace = fontFace\n\t\t\t\tif (colspan) cellOpts.colspan = colspan\n\t\t\t\tif (rowspan) cellOpts.rowspan = rowspan\n\n\t\t\t\tif (['left', 'center', 'right', 'start', 'end'].includes(window.getComputedStyle(cell).getPropertyValue('text-align'))) {\n\t\t\t\t\tconst align = window.getComputedStyle(cell).getPropertyValue('text-align').replace('start', 'left').replace('end', 'right')\n\t\t\t\t\tcellOpts.align = align === 'center' ? 'center' : align === 'left' ? 'left' : align === 'right' ? 'right' : undefined\n\t\t\t\t}\n\t\t\t\tif (['top', 'middle', 'bottom'].includes(window.getComputedStyle(cell).getPropertyValue('vertical-align'))) {\n\t\t\t\t\tconst valign = window.getComputedStyle(cell).getPropertyValue('vertical-align')\n\t\t\t\t\tcellOpts.valign = valign === 'top' ? 'top' : valign === 'middle' ? 'middle' : valign === 'bottom' ? 'bottom' : undefined\n\t\t\t\t}\n\n\t\t\t\t// C: Add padding [margin] (if any)\n\t\t\t\t// NOTE: Margins translate: px->pt 1:1 (e.g.: a 20px padded cell looks the same in PPTX as 20pt Text Inset/Padding)\n\t\t\t\tif (window.getComputedStyle(cell).getPropertyValue('padding-left')) {\n\t\t\t\t\tconst cellMargin: MarginTuple = [0, 0, 0, 0]\n\t\t\t\t\tconst sidesPad = ['padding-top', 'padding-right', 'padding-bottom', 'padding-left']\n\t\t\t\t\tsidesPad.forEach((val, idxs) => {\n\t\t\t\t\t\tcellMargin[idxs] = Math.round(Number(window.getComputedStyle(cell).getPropertyValue(val).replace(/\\D/gi, '')))\n\t\t\t\t\t})\n\t\t\t\t\tcellOpts.margin = cellMargin\n\t\t\t\t}\n\n\t\t\t\t// D: Add border (if any)\n\t\t\t\tif (\n\t\t\t\t\twindow.getComputedStyle(cell).getPropertyValue('border-top-width') ||\n\t\t\t\t\twindow.getComputedStyle(cell).getPropertyValue('border-right-width') ||\n\t\t\t\t\twindow.getComputedStyle(cell).getPropertyValue('border-bottom-width') ||\n\t\t\t\t\twindow.getComputedStyle(cell).getPropertyValue('border-left-width')\n\t\t\t\t) {\n\t\t\t\t\tconst cellBorder: BorderTuple = [{ type: 'none' }, { type: 'none' }, { type: 'none' }, { type: 'none' }]\n\t\t\t\t\tconst sidesBor = ['top', 'right', 'bottom', 'left']\n\t\t\t\t\tsidesBor.forEach((val, idxb) => {\n\t\t\t\t\t\tconst style = window.getComputedStyle(cell)\n\t\t\t\t\t\tcellBorder[idxb] = htmlBorderToProps(style.getPropertyValue('border-' + val + '-width'), style.getPropertyValue('border-' + val + '-color'))\n\t\t\t\t\t})\n\t\t\t\t\tcellOpts.border = cellBorder\n\t\t\t\t}\n\n\t\t\t\t// LAST: Add cell\n\t\t\t\tarrObjTabCells.push({\n\t\t\t\t\t_type: SLIDE_OBJECT_TYPES.tablecell,\n\t\t\t\t\ttext: cell.innerText, // `innerText` returns <br> as \"\\n\", so linebreak etc. work later!\n\t\t\t\t\toptions: cellOpts,\n\t\t\t\t})\n\t\t\t})\n\t\t\tswitch (part) {\n\t\t\t\tcase 'thead':\n\t\t\t\t\tarrObjTabHeadRows.push(arrObjTabCells)\n\t\t\t\t\tbreak\n\t\t\t\tcase 'tbody':\n\t\t\t\t\tarrObjTabBodyRows.push(arrObjTabCells)\n\t\t\t\t\tbreak\n\t\t\t\tcase 'tfoot':\n\t\t\t\t\tarrObjTabFootRows.push(arrObjTabCells)\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.log(`table parsing: unexpected table part: ${part}`)\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t})\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([...arrObjTabHeadRows, ...arrObjTabBodyRows, ...arrObjTabFootRows], opts, pptx.presLayout, masterSlide).forEach((slide, idxTr) => {\n\t\t// A: Create new Slide\n\t\tconst newSlide = pptx.addSlide({ masterName: opts.masterSlideName || undefined })\n\n\t\t// B: DESIGN: Reset `y` to startY or margin after first Slide (ISSUE#43, ISSUE#47, ISSUE#48)\n\t\tif (idxTr === 0) opts.y = opts.y || arrInchMargins[0]\n\t\tif (idxTr > 0) opts.y = opts.autoPageSlideStartY || opts.newSlideStartY || arrInchMargins[0]\n\t\tif (opts.verbose) console.log(`| opts.autoPageSlideStartY: ${opts.autoPageSlideStartY} / arrInchMargins[0]: ${arrInchMargins[0]} => opts.y = ${opts.y}`)\n\n\t\t// C: Add table to Slide\n\t\tnewSlide.addTable(slide.rows, { x: opts.x || arrInchMargins[3], y: opts.y, w: Number(emuSlideTabW) / EMU, colW: arrColW, autoPage: false })\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\tconsole.warn('Warning: 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","/**\n * PptxGenJS: Slide Object Generators\n */\n\nimport {\n\tBARCHART_COLORS,\n\tCHART_NAME,\n\tCHART_TYPE,\n\tCONNECTOR_PRESETS,\n\tDEF_CELL_BORDER,\n\tDEF_CELL_MARGIN_IN,\n\tDEF_CHART_BORDER,\n\tDEF_FONT_COLOR,\n\tDEF_FONT_SIZE,\n\tDEF_SHAPE_LINE_COLOR,\n\tDEF_SLIDE_MARGIN_IN,\n\tEMU,\n\tIMG_PLAYBTN,\n\tPIECHART_COLORS,\n\tSCHEME_COLOR_NAMES,\n\tSHAPE_NAME,\n\tSHAPE_TYPE,\n\tSLIDE_OBJECT_TYPES,\n\tTEXT_HALIGN,\n\tTEXT_VALIGN,\n\tVALID_SHAPE_PRESETS,\n} from './core-enums.js'\nimport type {\n\tAddSlideProps,\n\tBackgroundProps,\n\tBorderProps,\n\tConnectorProps,\n\tIChartMulti,\n\tIChartOpts,\n\tIChartOptsLib,\n\tIOptsChartData,\n\tISlideObject,\n\tImageProps,\n\tMediaProps,\n\tObjectOptions,\n\tOptsChartData,\n\tOptsChartGridLine,\n\tPresLayout,\n\tPresSlideInternal,\n\tShapeLineProps,\n\tShapeProps,\n\tSlideLayoutInternal,\n\tSlideMasterProps,\n\tTableCell,\n\tTableProps,\n\tTableRow,\n\tTextProps,\n\tTextPropsOptions,\n} from './core-interfaces.js'\nimport { getSlidesForTableRows } from './gen-tables.js'\nimport { encodeXmlEntities, getNewRelId, getSmartParseNumber, inch2Emu, valToPts, correctShadowOptions, validateObjectName, svgMarkupToDataUri, getImageSizeFromBase64 } from './gen-utils.js'\n\n/** counter for included charts (used for index in their filenames) */\nlet _chartCounter = 0\n\n/** DPI PowerPoint assumes when sizing an inserted raster image (natural pixels / 96 == inches) */\nconst IMAGE_NATURAL_DPI = 96\n\ntype BorderTuple = [BorderProps, BorderProps, BorderProps, BorderProps]\ntype HyperlinkTextObject = (TextProps | ISlideObject | TableCell) & {\n\toptions?: TextPropsOptions | ObjectOptions\n\ttext?: string | number | TextProps[] | TableCell[]\n}\n\nfunction normalizeBorderTuple(border: BorderProps | BorderTuple): BorderTuple {\n\treturn Array.isArray(border) ? border : [border, border, border, border]\n}\n\n/**\n * Transforms a slide definition to a slide object that is then passed to the XML transformation process.\n * @param {SlideMasterProps} props - slide definition\n * @param {PresSlideInternal|SlideLayoutInternal} target - empty slide object that should be updated by the passed definition\n */\nexport function createSlideMaster(props: SlideMasterProps, target: SlideLayoutInternal): void {\n\t// STEP 1: Add background if either the slide or layout has background props\n\t// if (props.background || target.background) addBackgroundDefinition(props.background, target)\n\tif (props.bkgd) target.bkgd = props.bkgd // DEPRECATED: (remove in v4.0.0)\n\n\t// STEP 2: Add all Slide Master objects in the order they were given\n\tif (props.objects && Array.isArray(props.objects) && props.objects.length > 0) {\n\t\tprops.objects.forEach((object, idx) => {\n\t\t\tconst tgt = target as PresSlideInternal\n\t\t\tif ('chart' in object) addChartDefinition(tgt, object.chart.type, object.chart.data, object.chart.opts || object.chart.options || {})\n\t\t\telse if ('image' in object) addImageDefinition(tgt, object.image)\n\t\t\telse if ('line' in object) addShapeDefinition(tgt, SHAPE_TYPE.LINE, object.line)\n\t\t\telse if ('rect' in object) addShapeDefinition(tgt, SHAPE_TYPE.RECTANGLE, object.rect)\n\t\t\telse if ('roundRect' in object) addShapeDefinition(tgt, SHAPE_TYPE.ROUNDED_RECTANGLE, object.roundRect)\n\t\t\telse if ('text' in object) addTextDefinition(tgt, Array.isArray(object.text.text) ? object.text.text : [{ text: object.text.text }], object.text.options || {}, false)\n\t\t\telse if ('placeholder' in object) {\n\t\t\t\t// TODO: 20180820: Check for existing `name`?\n\t\t\t\tconst placeholder = object.placeholder\n\t\t\t\tconst { name, type, ...rawPlaceholderOptions } = placeholder.options\n\t\t\t\tconst placeholderOptions = rawPlaceholderOptions as TextPropsOptions & ObjectOptions\n\t\t\t\tplaceholderOptions.placeholder = name\n\t\t\t\tplaceholderOptions._placeholderType = type\n\t\t\t\tplaceholderOptions._placeholderIdx = 100 + idx\n\t\t\t\taddTextDefinition(tgt, [{ text: placeholder.text }], placeholderOptions, true)\n\t\t\t\t// TODO: ISSUE#599 - only text is suported now (add more below)\n\t\t\t\t// else if (placeholder.image) addImageDefinition(tgt, placeholder.image)\n\t\t\t\t/* 20200120: So... image placeholders go into the \"slideLayoutN.xml\" file and addImage doesnt do this yet...\n\t\t\t\t\t<p:sp>\n\t\t\t\t <p:nvSpPr>\n\t\t\t\t\t<p:cNvPr id=\"7\" name=\"Picture Placeholder 6\">\n\t\t\t\t\t <a:extLst>\n\t\t\t\t\t\t<a:ext uri=\"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}\">\n\t\t\t\t\t\t <a16:creationId xmlns:a16=\"http://schemas.microsoft.com/office/drawing/2014/main\" id=\"{CE1AE45D-8641-0F4F-BDB5-080E69CCB034}\"/>\n\t\t\t\t\t\t</a:ext>\n\t\t\t\t\t </a:extLst>\n\t\t\t\t\t</p:cNvPr>\n\t\t\t\t\t<p:cNvSpPr>\n\t\t\t\t*/\n\t\t\t}\n\t\t})\n\t}\n\n\t// STEP 3: Add Slide Numbers (NOTE: Do this last so numbers are not covered by objects!)\n\tif (props.slideNumber && typeof props.slideNumber === 'object') target._slideNumberProps = props.slideNumber\n}\n\n/**\n * Round and clamp an integer chart percentage/angle option into a schema-valid range.\n *\n * Several chart attributes are bounded integer types whose out-of-range values make\n * PowerPoint report the package as needing repair: `<c:overlap>` (ST_Overlap, -100..100),\n * `<c:gapWidth>`/`<c:gapDepth>` (ST_GapAmount, 0..500), `<c:holeSize>` (ST_HoleSize, 10..90)\n * and `<c:firstSliceAng>` (ST_FirstSliceAng, 0..360). Missing/non-numeric input returns\n * `undefined` so the caller can apply its own default; an out-of-range value is clamped\n * and a warning is emitted (per the library's warn-rather-than-degrade policy).\n * @param value - caller-supplied option value\n * @param min - inclusive lower bound\n * @param max - inclusive upper bound\n * @param name - option name, for the warning message\n */\nfunction clampChartPct(value: number | undefined, min: number, max: number, name: string): number | undefined {\n\tif (typeof value !== 'number' || isNaN(value)) return undefined\n\tconst clamped = Math.min(max, Math.max(min, Math.round(value)))\n\tif (clamped !== value) console.warn(`Warning: ${name} ${value} is outside the valid range ${min}-${max}; using ${clamped}.`)\n\treturn clamped\n}\n\n/**\n * Generate the chart based on input data.\n * OOXML Chart Spec: ISO/IEC 29500-1:2016(E)\n *\n * @param {CHART_NAME | IChartMulti[]} `type` should belong to: 'column', 'pie'\n * @param {[]} `data` a JSON object with follow the following format\n * @param {IChartOptsLib} `opt` chart options\n * @param {PresSlideInternal} `target` slide object that the chart will be added to\n * @return {object} chart object\n * {\n * title: 'eSurvey chart',\n * data: [\n * {\n * name: 'Income',\n * labels: ['2005', '2006', '2007', '2008', '2009'],\n * values: [23.5, 26.2, 30.1, 29.5, 24.6]\n * },\n * {\n * name: 'Expense',\n * labels: ['2005', '2006', '2007', '2008', '2009'],\n * values: [18.1, 22.8, 23.9, 25.1, 25]\n * }\n * ]\n * }\n */\nexport function addChartDefinition(target: PresSlideInternal, type: CHART_NAME | IChartMulti[], data: OptsChartData[] | IChartOpts, opt?: IChartOptsLib): object {\n\tfunction correctGridLineOptions(glOpts: OptsChartGridLine): void {\n\t\tif (!glOpts || glOpts.style === 'none') return\n\t\tif (glOpts.size !== undefined && (isNaN(Number(glOpts.size)) || glOpts.size <= 0)) {\n\t\t\tconsole.warn('Warning: chart.gridLine.size must be greater than 0.')\n\t\t\tdelete glOpts.size // delete prop to used defaults\n\t\t}\n\t\tif (glOpts.style && !['solid', 'dash', 'dot'].includes(glOpts.style)) {\n\t\t\tconsole.warn('Warning: chart.gridLine.style options: `solid`, `dash`, `dot`.')\n\t\t\tdelete glOpts.style\n\t\t}\n\t\tif (glOpts.cap && !['flat', 'square', 'round'].includes(glOpts.cap)) {\n\t\t\tconsole.warn('Warning: chart.gridLine.cap options: `flat`, `square`, `round`.')\n\t\t\tdelete glOpts.cap\n\t\t}\n\t}\n\n\tconst chartId = ++_chartCounter\n\tconst resultObject: ISlideObject = {\n\t\t_type: SLIDE_OBJECT_TYPES.chart,\n\t}\n\t// DESIGN: `type` can an object (ex: `pptx.charts.DOUGHNUT`) or an array of chart objects\n\t// EX: addChartDefinition([ { type:pptx.charts.BAR, data:{name:'', labels:[], values[]} }, {<etc>} ])\n\t// Multi-Type Charts\n\tlet tmpOpt: IChartOpts | IChartOptsLib | undefined\n\tlet tmpData: OptsChartData[] = []\n\tif (Array.isArray(type)) {\n\t\t// For multi-type charts there needs to be data for each type,\n\t\t// as well as a single data source for non-series operations.\n\t\t// The data is indexed below to keep the data in order when segmented\n\t\t// into types.\n\t\ttype.forEach(obj => {\n\t\t\ttmpData = tmpData.concat(obj.data)\n\t\t})\n\t\ttmpOpt = !Array.isArray(data) && data && typeof data === 'object' ? data : opt\n\t} else {\n\t\ttmpData = Array.isArray(data) ? data : []\n\t\ttmpOpt = opt\n\t}\n\ttmpData.forEach((item, i) => {\n\t\titem._dataIndex = i\n\n\t\t// Converts the 'labels' array from string[] to string[][] (or the respective primitive type), if needed\n\t\tif (item.labels !== undefined && !Array.isArray(item.labels[0])) {\n\t\t\titem.labels = [item.labels as string[]]\n\t\t}\n\t})\n\tconst options: IChartOptsLib = tmpOpt && typeof tmpOpt === 'object' ? tmpOpt : {}\n\n\t// STEP 1: TODO: check for reqd fields, correct type, etc\n\t// `type` exists in CHART_TYPE\n\t// Array.isArray(data)\n\t/*\n\t\tif ( Array.isArray(rel.data) && rel.data.length > 0 && typeof rel.data[0] === 'object'\n\t\t\t&& rel.data[0].labels && Array.isArray(rel.data[0].labels)\n\t\t\t&& rel.data[0].values && Array.isArray(rel.data[0].values) ) {\n\t\t\tobj = rel.data[0];\n\t\t}\n\t\telse {\n\t\t\tconsole.warn(\"USAGE: addChart( 'pie', [ {name:'Sales', labels:['Jan','Feb'], values:[10,20]} ], {x:1, y:1} )\");\n\t\t\treturn;\n\t\t}\n\t\t*/\n\n\t// STEP 2: Set default options/decode user options\n\t// A: Core\n\toptions._type = type\n\toptions.x = typeof options.x !== 'undefined' && options.x != null && !isNaN(Number(options.x)) ? options.x : 1\n\toptions.y = typeof options.y !== 'undefined' && options.y != null && !isNaN(Number(options.y)) ? options.y : 1\n\toptions.w = options.w || '50%'\n\toptions.h = options.h || '50%'\n\toptions.objectName = options.objectName\n\t\t? encodeXmlEntities(validateObjectName(options.objectName, 'chart'))\n\t\t: `Chart ${target._slideObjects.filter(obj => obj._type === SLIDE_OBJECT_TYPES.chart).length}`\n\n\t// B: Options: misc\n\tif (!['bar', 'col'].includes(options.barDir || '')) options.barDir = 'col'\n\n\t// barGrouping: \"21.2.3.17 ST_Grouping (Grouping)\"\n\t// barGrouping must be handled before data label validation as it can affect valid label positioning\n\tif (options._type === CHART_TYPE.AREA) {\n\t\tif (!['stacked', 'standard', 'percentStacked'].includes(options.barGrouping || '')) options.barGrouping = 'standard'\n\t}\n\tif (options._type === CHART_TYPE.BAR) {\n\t\tif (!['clustered', 'stacked', 'percentStacked'].includes(options.barGrouping || '')) options.barGrouping = 'clustered'\n\t}\n\tif (options._type === CHART_TYPE.BAR3D) {\n\t\tif (!['clustered', 'stacked', 'standard', 'percentStacked'].includes(options.barGrouping || '')) options.barGrouping = 'standard'\n\t}\n\tif (options.barGrouping?.includes('tacked')) {\n\t\tif (!options.barGapWidthPct) options.barGapWidthPct = 50\n\t}\n\t// Clean up and validate data label positions\n\t// REFERENCE: https://docs.microsoft.com/en-us/openspecs/office_standards/ms-oi29500/e2b1697c-7adc-463d-9081-3daef72f656f?redirectedfrom=MSDN\n\tif (options.dataLabelPosition) {\n\t\tconst dataLabelPosition = options.dataLabelPosition\n\t\tif (options._type === CHART_TYPE.AREA || options._type === CHART_TYPE.BAR3D || options._type === CHART_TYPE.DOUGHNUT || options._type === CHART_TYPE.RADAR) { delete options.dataLabelPosition }\n\t\tif (options._type === CHART_TYPE.PIE) {\n\t\t\tif (!['bestFit', 'ctr', 'inEnd', 'outEnd'].includes(dataLabelPosition)) delete options.dataLabelPosition\n\t\t}\n\t\tif (options._type === CHART_TYPE.BUBBLE || options._type === CHART_TYPE.BUBBLE3D || options._type === CHART_TYPE.LINE || options._type === CHART_TYPE.SCATTER) {\n\t\t\tif (!['b', 'ctr', 'l', 'r', 't'].includes(dataLabelPosition)) delete options.dataLabelPosition\n\t\t}\n\t\tif (options._type === CHART_TYPE.BAR) {\n\t\t\tif (!['stacked', 'percentStacked'].includes(options.barGrouping || '')) {\n\t\t\t\tif (!['ctr', 'inBase', 'inEnd'].includes(dataLabelPosition)) delete options.dataLabelPosition\n\t\t\t}\n\t\t\tif (!['clustered'].includes(options.barGrouping || '')) {\n\t\t\t\tif (!['ctr', 'inBase', 'inEnd', 'outEnd'].includes(dataLabelPosition)) delete options.dataLabelPosition\n\t\t\t}\n\t\t}\n\t}\n\toptions.dataLabelBkgrdColors = options.dataLabelBkgrdColors || !options.dataLabelBkgrdColors ? options.dataLabelBkgrdColors : false\n\tif (!['b', 'l', 'r', 't', 'tr'].includes(options.legendPos || '')) options.legendPos = 'r'\n\n\t// 3D bar: ST_Shape\n\tif (!['cone', 'coneToMax', 'box', 'cylinder', 'pyramid', 'pyramidToMax'].includes(options.bar3DShape || '')) options.bar3DShape = 'box'\n\t// lineDataSymbol: http://www.datypic.com/sc/ooxml/a-val-32.html\n\t// Spec has [plus,star,x] however neither PPT2013 nor PPT-Online support them\n\tif (!['circle', 'dash', 'diamond', 'dot', 'none', 'square', 'triangle'].includes(options.lineDataSymbol || '')) options.lineDataSymbol = 'circle'\n\tif (!['gap', 'span', 'zero'].includes(options.displayBlanksAs || '')) options.displayBlanksAs = 'gap'\n\tif (!['standard', 'marker', 'filled'].includes(options.radarStyle || '')) options.radarStyle = 'standard'\n\t// Marker size emits as `<c:size val>` (ST_MarkerSize): an integer in [2,72] points.\n\t// Out-of-range or non-integer values make PowerPoint report the file as needing\n\t// repair, so round and clamp into range and warn when the input is coerced.\n\t{\n\t\tconst rawSymbolSize = options.lineDataSymbolSize\n\t\tconst hasSymbolSize = rawSymbolSize != null && !isNaN(rawSymbolSize)\n\t\tconst symbolSize = Math.min(72, Math.max(2, Math.round(hasSymbolSize ? rawSymbolSize : 6)))\n\t\tif (hasSymbolSize && symbolSize !== rawSymbolSize) {\n\t\t\tconsole.warn(`Warning: lineDataSymbolSize ${rawSymbolSize} is outside the valid marker size range (integer 2-72); using ${symbolSize}.`)\n\t\t}\n\t\toptions.lineDataSymbolSize = symbolSize\n\t}\n\toptions.lineDataSymbolLineSize = options.lineDataSymbolLineSize && !isNaN(options.lineDataSymbolLineSize) ? valToPts(options.lineDataSymbolLineSize) : valToPts(0.75)\n\t// `layout` allows the override of PPT defaults to maximize space\n\tconst chartLayout = options.layout\n\tif (chartLayout) {\n\t\t;(['x', 'y', 'w', 'h'] as const).forEach(key => {\n\t\t\tconst val = chartLayout[key]\n\t\t\tconst numVal = Number(val)\n\t\t\tif (isNaN(numVal) || numVal < 0 || numVal > 1) {\n\t\t\t\tconsole.warn('Warning: chart.layout.' + key + ' can only be 0-1')\n\t\t\t\tdelete chartLayout[key] // remove invalid value so that default will be used\n\t\t\t}\n\t\t})\n\t}\n\n\t// Set gridline defaults\n\toptions.catGridLine = options.catGridLine || (options._type === CHART_TYPE.SCATTER ? { color: 'D9D9D9', size: 1 } : { style: 'none' })\n\toptions.valGridLine = options.valGridLine || (options._type === CHART_TYPE.SCATTER ? { color: 'D9D9D9', size: 1 } : {})\n\toptions.serGridLine = options.serGridLine || (options._type === CHART_TYPE.SCATTER ? { color: 'D9D9D9', size: 1 } : { style: 'none' })\n\tcorrectGridLineOptions(options.catGridLine)\n\tcorrectGridLineOptions(options.valGridLine)\n\tcorrectGridLineOptions(options.serGridLine)\n\tcorrectShadowOptions(options.shadow)\n\n\t// C: Options: plotArea\n\toptions.showDataTable = options.showDataTable || !options.showDataTable ? options.showDataTable : false\n\toptions.showDataTableHorzBorder = options.showDataTableHorzBorder || !options.showDataTableHorzBorder ? options.showDataTableHorzBorder : true\n\toptions.showDataTableVertBorder = options.showDataTableVertBorder || !options.showDataTableVertBorder ? options.showDataTableVertBorder : true\n\toptions.showDataTableOutline = options.showDataTableOutline || !options.showDataTableOutline ? options.showDataTableOutline : true\n\toptions.showDataTableKeys = options.showDataTableKeys || !options.showDataTableKeys ? options.showDataTableKeys : true\n\toptions.showLabel = options.showLabel || !options.showLabel ? options.showLabel : false\n\toptions.showLegend = options.showLegend || !options.showLegend ? options.showLegend : false\n\toptions.showPercent = options.showPercent || !options.showPercent ? options.showPercent : true\n\toptions.showTitle = options.showTitle || !options.showTitle ? options.showTitle : false\n\toptions.showValue = options.showValue || !options.showValue ? options.showValue : false\n\toptions.showLeaderLines = options.showLeaderLines || !options.showLeaderLines ? options.showLeaderLines : false\n\toptions.catAxisLineShow = typeof options.catAxisLineShow !== 'undefined' ? options.catAxisLineShow : true\n\toptions.valAxisLineShow = typeof options.valAxisLineShow !== 'undefined' ? options.valAxisLineShow : true\n\toptions.serAxisLineShow = typeof options.serAxisLineShow !== 'undefined' ? options.serAxisLineShow : true\n\n\toptions.v3DRotX = typeof options.v3DRotX === 'number' && !isNaN(options.v3DRotX) && options.v3DRotX >= -90 && options.v3DRotX <= 90 ? options.v3DRotX : 30\n\toptions.v3DRotY = typeof options.v3DRotY === 'number' && !isNaN(options.v3DRotY) && options.v3DRotY >= 0 && options.v3DRotY <= 360 ? options.v3DRotY : 30\n\toptions.v3DRAngAx = options.v3DRAngAx || !options.v3DRAngAx ? options.v3DRAngAx : true\n\toptions.v3DPerspective = typeof options.v3DPerspective === 'number' && !isNaN(options.v3DPerspective) && options.v3DPerspective >= 0 && options.v3DPerspective <= 240 ? options.v3DPerspective : 30\n\n\t// D: Options: chart\n\t// `<c:gapWidth>`/`<c:gapDepth>` are ST_GapAmount (integer 0..500); `<c:overlap>` is\n\t// ST_Overlap (integer -100..100). Out-of-range values trigger PowerPoint repair.\n\toptions.barGapWidthPct = clampChartPct(options.barGapWidthPct, 0, 500, 'barGapWidthPct') ?? 150\n\toptions.barGapDepthPct = clampChartPct(options.barGapDepthPct, 0, 500, 'barGapDepthPct') ?? 150\n\toptions.barOverlapPct = clampChartPct(options.barOverlapPct, -100, 100, 'barOverlapPct')\n\t// `<c:holeSize>` is ST_HoleSize (10..90); `<c:firstSliceAng>` is ST_FirstSliceAng (0..360).\n\toptions.holeSize = clampChartPct(options.holeSize, 10, 90, 'holeSize')\n\toptions.firstSliceAng = clampChartPct(options.firstSliceAng, 0, 360, 'firstSliceAng')\n\n\toptions.chartColors = Array.isArray(options.chartColors)\n\t\t? options.chartColors\n\t\t: options._type === CHART_TYPE.PIE || options._type === CHART_TYPE.DOUGHNUT\n\t\t\t? PIECHART_COLORS\n\t\t\t: BARCHART_COLORS\n\toptions.chartColorsOpacity = options.chartColorsOpacity && !isNaN(options.chartColorsOpacity) ? options.chartColorsOpacity : undefined\n\t// DEPRECATED: v3.11.0 - use `plotArea.border` vvv\n\toptions.border = options.border && typeof options.border === 'object' ? options.border : undefined\n\tif (options.border && (!options.border.pt || isNaN(options.border.pt))) options.border.pt = DEF_CHART_BORDER.pt\n\tif (options.border && (!options.border.color || typeof options.border.color !== 'string')) options.border.color = DEF_CHART_BORDER.color\n\t// DEPRECATED: (remove above in v4.0) ^^^\n\toptions.plotArea = options.plotArea || {}\n\toptions.plotArea.border = options.plotArea.border && typeof options.plotArea.border === 'object' ? options.plotArea.border : undefined\n\tif (options.plotArea.border && (!options.plotArea.border.pt || isNaN(options.plotArea.border.pt))) options.plotArea.border.pt = DEF_CHART_BORDER.pt\n\tif (options.plotArea.border && (!options.plotArea.border.color || typeof options.plotArea.border.color !== 'string')) { options.plotArea.border.color = DEF_CHART_BORDER.color }\n\tif (options.border) options.plotArea.border = options.border // @deprecated [[remove in v4.0]]\n\toptions.plotArea.fill = options.plotArea.fill || {}\n\tif (options.fill) options.plotArea.fill.color = options.fill // @deprecated [[remove in v4.0]]\n\t//\n\toptions.chartArea = options.chartArea || {}\n\toptions.chartArea.border = options.chartArea.border && typeof options.chartArea.border === 'object' ? options.chartArea.border : undefined\n\tif (options.chartArea.border) {\n\t\toptions.chartArea.border = {\n\t\t\tcolor: options.chartArea.border.color || DEF_CHART_BORDER.color,\n\t\t\tpt: options.chartArea.border.pt || DEF_CHART_BORDER.pt,\n\t\t}\n\t}\n\toptions.chartArea.roundedCorners = typeof options.chartArea.roundedCorners === 'boolean' ? options.chartArea.roundedCorners : true\n\t//\n\toptions.dataBorder = options.dataBorder && typeof options.dataBorder === 'object' ? options.dataBorder : undefined\n\tif (options.dataBorder && (!options.dataBorder.pt || isNaN(options.dataBorder.pt))) options.dataBorder.pt = 0.75\n\tif (options.dataBorder && options.dataBorder.color) {\n\t\tconst isHexColor = typeof options.dataBorder.color === 'string' && options.dataBorder.color.length === 6 && /^[0-9A-Fa-f]{6}$/.test(options.dataBorder.color)\n\t\tconst isSchemeColor = Object.values(SCHEME_COLOR_NAMES).includes(options.dataBorder.color as SCHEME_COLOR_NAMES)\n\t\tif (!isHexColor && !isSchemeColor) {\n\t\t\toptions.dataBorder.color = 'F9F9F9' // Fallback if neither hex nor scheme color\n\t\t}\n\t}\n\t//\n\tif (!options.dataLabelFormatCode && options._type === CHART_TYPE.SCATTER) options.dataLabelFormatCode = 'General'\n\tif (!options.dataLabelFormatCode && (options._type === CHART_TYPE.PIE || options._type === CHART_TYPE.DOUGHNUT)) { options.dataLabelFormatCode = options.showPercent ? '0%' : 'General' }\n\toptions.dataLabelFormatCode = options.dataLabelFormatCode && typeof options.dataLabelFormatCode === 'string' ? options.dataLabelFormatCode : '#,##0'\n\t//\n\t// Set default format for Scatter chart labels to custom string if not defined\n\tif (!options.dataLabelFormatScatter && options._type === CHART_TYPE.SCATTER) options.dataLabelFormatScatter = 'custom'\n\t//\n\toptions.lineSize = typeof options.lineSize === 'number' ? options.lineSize : 2\n\toptions.valAxisMajorUnit = typeof options.valAxisMajorUnit === 'number' ? options.valAxisMajorUnit : undefined\n\n\tif (options._type === CHART_TYPE.AREA || options._type === CHART_TYPE.BAR || options._type === CHART_TYPE.BAR3D || options._type === CHART_TYPE.LINE) {\n\t\toptions.catAxisMultiLevelLabels = !!options.catAxisMultiLevelLabels\n\t} else {\n\t\tdelete options.catAxisMultiLevelLabels\n\t}\n\n\t// STEP 4: Set props\n\tresultObject._type = SLIDE_OBJECT_TYPES.chart\n\tresultObject.options = options as unknown as ObjectOptions\n\tresultObject.chartRid = getNewRelId(target)\n\n\t// STEP 5: Add this chart to this Slide Rels (rId/rels count spans all slides! Count all images to get next rId)\n\ttarget._relsChart.push({\n\t\trId: getNewRelId(target),\n\t\tdata: tmpData as IOptsChartData[],\n\t\topts: options,\n\t\ttype: options._type,\n\t\tglobalId: chartId,\n\t\tfileName: `chart${chartId}.xml`,\n\t\tTarget: `/ppt/charts/chart${chartId}.xml`,\n\t})\n\n\ttarget._slideObjects.push(resultObject)\n\treturn resultObject\n}\n\n/**\n * Adds an image object to a slide definition.\n * This method can be called with only two args (opt, target) - this is supposed to be the only way in future.\n * @param {ImageProps} `opt` - object containing `path`/`data`, `x`, `y`, etc.\n * @param {PresSlideInternal} `target` - slide that the image should be added to (if not specified as the 2nd arg)\n * @note: Remote images (eg: \"http://whatev.com/blah\"/from web and/or remote server arent supported yet - we'd need to create an <img>, load it, then send to canvas\n * @see: https://stackoverflow.com/questions/164181/how-to-fetch-a-remote-image-to-display-in-a-canvas)\n */\nexport function addImageDefinition(target: PresSlideInternal, opt: ImageProps): void {\n\tconst newObject: ISlideObject = {\n\t\t_type: SLIDE_OBJECT_TYPES.image,\n\t}\n\t// FIRST: Set vars for this image (object param replaces positional args in 1.1.0)\n\tconst intPosX = opt.x || 0\n\tconst intPosY = opt.y || 0\n\tconst intWidth = opt.w || 0\n\tconst intHeight = opt.h || 0\n\tconst sizing = opt.sizing\n\tconst objHyperlink = opt.hyperlink || ''\n\t// Convenience: accept raw SVG markup via `svg` and encode it to a data URI.\n\t// `data`/`path` win when also supplied, matching the documented precedence.\n\tconst strImageData = opt.data || (opt.svg && !opt.path ? svgMarkupToDataUri(opt.svg) : '')\n\tconst strImagePath = opt.path || ''\n\tlet imageRelId = getNewRelId(target)\n\tconst objectName = opt.objectName ? encodeXmlEntities(validateObjectName(opt.objectName, 'image')) : `Image ${target._slideObjects.filter(obj => obj._type === SLIDE_OBJECT_TYPES.image).length}`\n\n\t// REALITY-CHECK:\n\tif (!strImagePath && !strImageData) {\n\t\tconsole.error('ERROR: addImage() requires either \\'data\\' or \\'path\\' parameter!')\n\t\treturn\n\t} else if (strImagePath && typeof strImagePath !== 'string') {\n\t\tconsole.error(`ERROR: addImage() 'path' should be a string, ex: {path:'/img/sample.png'} - you sent ${String(strImagePath)}`)\n\t\treturn\n\t} else if (strImageData && typeof strImageData !== 'string') {\n\t\tconsole.error(`ERROR: addImage() 'data' should be a string, ex: {data:'image/png;base64,NMP[...]'} - you sent ${String(strImageData)}`)\n\t\treturn\n\t} else if (strImageData && typeof strImageData === 'string' && !strImageData.toLowerCase().includes('base64,')) {\n\t\tconsole.error('ERROR: Image `data` value lacks a base64 header! Ex: \\'image/png;base64,NMP[...]\\')')\n\t\treturn\n\t}\n\n\t// STEP 1: Set extension\n\t// NOTE: Split to address URLs with params (eg: `path/brent.jpg?someParam=true`)\n\tconst imagePathFile = strImagePath.slice(strImagePath.lastIndexOf('/') + 1).split('?')[0] || ''\n\tlet strImgExtn = ((imagePathFile.split('.').pop() || 'png').split('#')[0] || 'png').toLowerCase()\n\n\t// However, pre-encoded images can be whatever mime-type they want (and good for them!)\n\tconst imageMimeMatch = /image\\/(\\w+);/.exec(strImageData)\n\tif (strImageData && imageMimeMatch) {\n\t\tstrImgExtn = imageMimeMatch[1]\n\t} else if (strImageData?.toLowerCase().includes('image/svg+xml')) {\n\t\tstrImgExtn = 'svg'\n\t}\n\n\t// STEP 2: Set type/path\n\tnewObject._type = SLIDE_OBJECT_TYPES.image\n\tnewObject.image = strImagePath || 'preencoded.png'\n\n\t// STEP 3: Default any missing dimension from the image's intrinsic (natural) size.\n\t// For base64 `data` images the bytes are already in hand, so we can read the\n\t// natural pixel size synchronously and avoid the legacy 1x1 fallback that\n\t// squished data-only images into a 1in square (issue #1351). Path images\n\t// can't be measured synchronously, so they keep the 1in fallback below.\n\t// PowerPoint inserts images at 96 DPI, so natural pixels / 96 == inches.\n\tlet defWidth = intWidth\n\tlet defHeight = intHeight\n\tif ((!intWidth || !intHeight) && strImageData && strImgExtn !== 'svg') {\n\t\tconst natural = getImageSizeFromBase64(strImageData)\n\t\tif (natural) {\n\t\t\tif (!intWidth && !intHeight) {\n\t\t\t\t// Neither given: use the natural size (inches @ 96 DPI)\n\t\t\t\tdefWidth = natural.w / IMAGE_NATURAL_DPI\n\t\t\t\tdefHeight = natural.h / IMAGE_NATURAL_DPI\n\t\t\t} else if (typeof intWidth === 'number' && intWidth && !intHeight) {\n\t\t\t\t// Only width given: preserve aspect ratio for height (same unit as width)\n\t\t\t\tdefHeight = intWidth * (natural.h / natural.w)\n\t\t\t} else if (typeof intHeight === 'number' && intHeight && !intWidth) {\n\t\t\t\t// Only height given: preserve aspect ratio for width (same unit as height)\n\t\t\t\tdefWidth = intHeight * (natural.w / natural.h)\n\t\t\t}\n\t\t}\n\t}\n\n\t// STEP 4: Set image properties & options\n\tconst objectOptions: ObjectOptions = {\n\t\tx: intPosX || 0,\n\t\ty: intPosY || 0,\n\t\tw: defWidth || 1,\n\t\th: defHeight || 1,\n\t\taltText: opt.altText || '',\n\t\trounding: typeof opt.rounding === 'boolean' ? opt.rounding : false,\n\t\tshape: opt.shape,\n\t\tpoints: opt.points,\n\t\trectRadius: opt.rectRadius,\n\t\tshapeAdjust: opt.shapeAdjust,\n\t\tsizing,\n\t\tplaceholder: opt.placeholder,\n\t\trotate: opt.rotate || 0,\n\t\tflipV: opt.flipV || false,\n\t\tflipH: opt.flipH || false,\n\t\ttransparency: opt.transparency || 0,\n\t\tduotone: opt.duotone,\n\t\tobjectName,\n\t\tobjectLock: opt.objectLock,\n\t\tshadow: correctShadowOptions(opt.shadow),\n\t}\n\tnewObject.options = objectOptions\n\n\t// STEP 5: Add this image to this Slide Rels (rId/rels count spans all slides! Count all images to get next rId)\n\t// Use a namespaced key for media targets so slide master (sm) and slide layouts (sl-N, _slideNum >= 1000)\n\t// never collide with regular slide media names in large decks (issue #1416).\n\tconst mediaSlideKey = target._slideNum == null ? 'sm' : target._slideNum >= 1000 ? `sl-${target._slideNum}` : target._slideNum\n\tif (strImgExtn === 'svg') {\n\t\t// SVG files consume *TWO* rId's: (a png version and the svg image)\n\t\t// <Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\" Target=\"../media/image1.png\"/>\n\t\t// <Relationship Id=\"rId4\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\" Target=\"../media/image2.svg\"/>\n\t\ttarget._relsMedia.push({\n\t\t\tpath: strImagePath || strImageData + 'png',\n\t\t\ttype: 'image/png',\n\t\t\textn: 'png',\n\t\t\tdata: strImageData || '',\n\t\t\trId: imageRelId,\n\t\t\tTarget: `../media/image-${mediaSlideKey}-${target._relsMedia.length + 1}.png`,\n\t\t\tisSvgPng: true,\n\t\t\tsvgSize: { w: getSmartParseNumber(objectOptions.w, 'X', target._presLayout), h: getSmartParseNumber(objectOptions.h, 'Y', target._presLayout) },\n\t\t})\n\t\tnewObject.imageRid = imageRelId\n\t\ttarget._relsMedia.push({\n\t\t\tpath: strImagePath || strImageData,\n\t\t\ttype: 'image/svg+xml',\n\t\t\textn: strImgExtn,\n\t\t\tdata: strImageData || '',\n\t\t\trId: imageRelId + 1,\n\t\t\tTarget: `../media/image-${mediaSlideKey}-${target._relsMedia.length + 1}.${strImgExtn}`,\n\t\t})\n\t\tnewObject.imageRid = imageRelId + 1\n\t} else {\n\t\t// PERF: Duplicate media should reuse existing `Target` value and not create an additional copy.\n\t\t// File-path images are matched by `path`; base64/`data` images have no real path\n\t\t// (all share the `preencoded.<extn>` placeholder), so they are matched by their data\n\t\t// payload instead so identical inline images are embedded once (issue #1339).\n\t\tconst dupeItem = target._relsMedia.find(item => {\n\t\t\tif (item.isDuplicate || !item.Target || item.type !== 'image/' + strImgExtn) return false\n\t\t\treturn strImagePath ? item.path === strImagePath : !!strImageData && item.data === strImageData\n\t\t})\n\n\t\ttarget._relsMedia.push({\n\t\t\tpath: strImagePath || 'preencoded.' + strImgExtn,\n\t\t\ttype: 'image/' + strImgExtn,\n\t\t\textn: strImgExtn,\n\t\t\tdata: strImageData || '',\n\t\t\trId: imageRelId,\n\t\t\tisDuplicate: !!(dupeItem?.Target),\n\t\t\tTarget: dupeItem?.Target ? dupeItem.Target : `../media/image-${mediaSlideKey}-${target._relsMedia.length + 1}.${strImgExtn}`,\n\t\t})\n\t\tnewObject.imageRid = imageRelId\n\t}\n\n\t// STEP 6: Hyperlink support\n\tif (typeof objHyperlink === 'object') {\n\t\tif (!objHyperlink.url && !objHyperlink.slide) throw new Error('ERROR: `hyperlink` option requires either: `url` or `slide`')\n\t\telse {\n\t\t\timageRelId++\n\n\t\t\ttarget._rels.push({\n\t\t\t\ttype: SLIDE_OBJECT_TYPES.hyperlink,\n\t\t\t\tdata: objHyperlink.slide ? 'slide' : 'dummy',\n\t\t\t\trId: imageRelId,\n\t\t\t\tTarget: objHyperlink.url ? encodeXmlEntities(objHyperlink.url) : String(objHyperlink.slide),\n\t\t\t})\n\n\t\t\tobjHyperlink._rId = imageRelId\n\t\t\tnewObject.hyperlink = objHyperlink\n\t\t}\n\t}\n\n\t// STEP 7: Add object to slide\n\ttarget._slideObjects.push(newObject)\n}\n\n/**\n * Adds a media object to a slide definition.\n * @param {PresSlideInternal} `target` - slide object that the media will be added to\n * @param {MediaProps} `opt` - media options\n */\nexport function addMediaDefinition(target: PresSlideInternal, opt: MediaProps): void {\n\tconst intPosX = opt.x || 0\n\tconst intPosY = opt.y || 0\n\tconst intSizeX = opt.w || 2\n\tconst intSizeY = opt.h || 2\n\tconst strData = opt.data || ''\n\tconst strLink = opt.link || ''\n\tconst strPath = opt.path || ''\n\tconst strType = opt.type || 'audio'\n\tlet strExtn = ''\n\tconst strCover = opt.cover || IMG_PLAYBTN\n\tconst objectName = opt.objectName ? encodeXmlEntities(validateObjectName(opt.objectName, 'media')) : `Media ${target._slideObjects.filter(obj => obj._type === SLIDE_OBJECT_TYPES.media).length}`\n\tconst slideData: ISlideObject = { _type: SLIDE_OBJECT_TYPES.media }\n\n\t// STEP 1: REALITY-CHECK\n\tif (!strPath && !strData && strType !== 'online') {\n\t\tthrow new Error('addMedia() error: either `data` or `path` are required!')\n\t} else if (strData && !strData.toLowerCase().includes('base64,')) {\n\t\tthrow new Error('addMedia() error: `data` value lacks a base64 header! Ex: \\'video/mpeg;base64,NMP[...]\\')')\n\t} else if (strCover && !strCover.toLowerCase().includes('base64,')) {\n\t\tthrow new Error('addMedia() error: `cover` value lacks a base64 header! Ex: \\'data:image/png;base64,iV[...]\\')')\n\t}\n\t// Online Video: requires `link`\n\tif (strType === 'online' && !strLink) {\n\t\tthrow new Error('addMedia() error: online videos require `link` value')\n\t}\n\n\t// FIXME: 20190707\n\t// strType = strData ? strData.split(';')[0].split('/')[0] : strType\n\tstrExtn = opt.extn || (strData ? strData.split(';')[0].split('/')[1] : strPath.split('.').pop()) || 'mp3'\n\n\t// STEP 2: Set type, media\n\tslideData.mtype = strType\n\tslideData.media = strPath || 'preencoded.mov'\n\tslideData.options = {}\n\n\t// STEP 3: Set media properties & options\n\tslideData.options.x = intPosX\n\tslideData.options.y = intPosY\n\tslideData.options.w = intSizeX\n\tslideData.options.h = intSizeY\n\tslideData.options.objectName = objectName\n\tif (opt.altText) slideData.options.altText = opt.altText\n\tif (opt.objectLock) slideData.options.objectLock = opt.objectLock\n\n\t// STEP 4: Add this media to this Slide Rels (rId/rels count spans all slides! Count all media to get next rId)\n\t/**\n\t * NOTE:\n\t * - rId starts at 2 (hence the intRels+1 below) as slideLayout.xml is rId=1!\n\t *\n\t * NOTE:\n\t * - Audio/Video files consume *TWO* rId's:\n\t * <Relationship Id=\"rId2\" Target=\"../media/media1.mov\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video\"/>\n\t * <Relationship Id=\"rId3\" Target=\"../media/media1.mov\" Type=\"http://schemas.microsoft.com/office/2007/relationships/media\"/>\n\t */\n\tif (strType === 'online') {\n\t\tconst relId1 = getNewRelId(target)\n\t\t// A: Add video\n\t\ttarget._relsMedia.push({\n\t\t\tpath: strPath || 'preencoded' + strExtn,\n\t\t\tdata: 'dummy',\n\t\t\ttype: 'online',\n\t\t\textn: strExtn,\n\t\t\trId: relId1,\n\t\t\tTarget: strLink,\n\t\t})\n\t\tslideData.mediaRid = relId1\n\n\t\t// B: Add cover (preview/overlay) image\n\t\ttarget._relsMedia.push({\n\t\t\tpath: 'preencoded.png',\n\t\t\tdata: strCover,\n\t\t\ttype: 'image/png',\n\t\t\textn: 'png',\n\t\t\trId: getNewRelId(target),\n\t\t\tTarget: `../media/image-${target._slideNum}-${target._relsMedia.length + 1}.png`,\n\t\t})\n\t} else {\n\t\t// PERF: Duplicate media should reuse existing `Target` value and not create an additional copy.\n\t\t// Path-based media match by `path`; base64/`data` media (which share the `preencoded`\n\t\t// placeholder path) match by their data payload so identical inline media embed once (issue #1339).\n\t\tconst dupeItem = target._relsMedia.find(item => {\n\t\t\tif (item.isDuplicate || !item.Target || item.type !== strType + '/' + strExtn) return false\n\t\t\treturn strPath ? item.path === strPath : !!strData && item.data === strData\n\t\t})\n\n\t\t// A: \"relationships/video\"\n\t\tconst relId1 = getNewRelId(target)\n\t\ttarget._relsMedia.push({\n\t\t\tpath: strPath || 'preencoded' + strExtn,\n\t\t\ttype: strType + '/' + strExtn,\n\t\t\textn: strExtn,\n\t\t\tdata: strData || '',\n\t\t\trId: relId1,\n\t\t\tisDuplicate: !!(dupeItem?.Target),\n\t\t\tTarget: dupeItem?.Target ? dupeItem.Target : `../media/media-${target._slideNum}-${target._relsMedia.length + 1}.${strExtn}`,\n\t\t})\n\t\tslideData.mediaRid = relId1\n\n\t\t// B: \"relationships/media\"\n\t\ttarget._relsMedia.push({\n\t\t\tpath: strPath || 'preencoded' + strExtn,\n\t\t\ttype: strType + '/' + strExtn,\n\t\t\textn: strExtn,\n\t\t\tdata: strData || '',\n\t\t\trId: getNewRelId(target),\n\t\t\tisDuplicate: !!(dupeItem?.Target),\n\t\t\tTarget: dupeItem?.Target ? dupeItem.Target : `../media/media-${target._slideNum}-${target._relsMedia.length + 0}.${strExtn}`,\n\t\t})\n\n\t\t// C: Add cover (preview/overlay) image\n\t\ttarget._relsMedia.push({\n\t\t\tpath: 'preencoded.png',\n\t\t\ttype: 'image/png',\n\t\t\textn: 'png',\n\t\t\tdata: strCover,\n\t\t\trId: getNewRelId(target),\n\t\t\tTarget: `../media/image-${target._slideNum}-${target._relsMedia.length + 1}.png`,\n\t\t})\n\t}\n\n\t// LAST\n\ttarget._slideObjects.push(slideData)\n}\n\n/**\n * Adds Notes to a slide.\n * @param {PresSlideInternal} `target` slide object\n * @param {string} `notes`\n * @since 2.3.0\n */\nexport function addNotesDefinition(target: PresSlideInternal, notes: string): void {\n\ttarget._slideObjects.push({\n\t\t_type: SLIDE_OBJECT_TYPES.notes,\n\t\ttext: [{ text: notes }],\n\t})\n}\n\n/**\n * Map of common friendly shape names users pass as bare strings to their\n * valid OOXML preset values. PowerPoint can't parse the friendly spellings\n * and removes the shape during repair .\n */\nconst SHAPE_NAME_ALIASES: { [key: string]: SHAPE_NAME } = {\n\toval: 'ellipse',\n\trectangle: 'rect',\n\troundedRectangle: 'roundRect',\n\troundedrectangle: 'roundRect',\n}\n\n/**\n * Adds a shape object to a slide definition.\n * @param {PresSlideInternal} target slide object that the shape should be added to\n * @param {SHAPE_NAME} shapeName shape name\n * @param {ShapeProps} opts shape options\n */\nexport function addShapeDefinition(target: PresSlideInternal, shapeName: SHAPE_NAME, opts: ShapeProps): void {\n\tconst options = typeof opts === 'object' ? opts : {}\n\toptions.line = options.line || { type: 'none' }\n\toptions.shadow = correctShadowOptions(options.shadow)\n\t// Normalize friendly shape names (e.g. \"oval\" -> \"ellipse\") to their valid\n\t// OOXML preset spellings before storing on the slide object.\n\tconst resolvedShapeName: SHAPE_NAME = (typeof shapeName === 'string' && SHAPE_NAME_ALIASES[shapeName])\n\t\t? SHAPE_NAME_ALIASES[shapeName]\n\t\t: shapeName\n\tconst newObject: ISlideObject = {\n\t\t_type: SLIDE_OBJECT_TYPES.text,\n\t\tshape: resolvedShapeName || SHAPE_TYPE.RECTANGLE,\n\t\toptions,\n\t}\n\n\t// Reality check\n\tif (!shapeName) throw new Error('Missing/Invalid shape parameter! Example: `addShape(pptxgen.shapes.LINE, {x:1, y:1, w:1, h:1});`')\n\n\t// Reject presets PowerPoint can't parse. An invalid `prst` value (a typo or an\n\t// unmapped friendly name) corrupts the package and triggers the repair dialog,\n\t// so fail loudly here rather than emit degenerate OOXML. Use `pptxgen.shapes.*`\n\t// for the canonical names.\n\tif (!VALID_SHAPE_PRESETS.has(resolvedShapeName)) {\n\t\tthrow new Error(`Invalid shape \"${String(shapeName)}\"! Use a value from \\`pptxgen.shapes.*\\` (e.g. \\`pptxgen.shapes.RECTANGLE\\`). PowerPoint can't render unknown preset geometries and will drop the shape during repair.`)\n\t}\n\n\t// 1: ShapeLineProps defaults\n\tconst newLineOpts: ShapeLineProps = {\n\t\ttype: options.line.type || 'solid',\n\t\tcolor: options.line.color || DEF_SHAPE_LINE_COLOR,\n\t\ttransparency: options.line.transparency || 0,\n\t\twidth: options.line.width || 1,\n\t\tdashType: options.line.dashType || 'solid',\n\t\tbeginArrowType: options.line.beginArrowType,\n\t\tendArrowType: options.line.endArrowType,\n\t}\n\tif (typeof options.line === 'object' && options.line.type !== 'none') options.line = newLineOpts\n\n\t// 2: Set options defaults\n\toptions.x = options.x || (options.x === 0 ? 0 : 1)\n\toptions.y = options.y || (options.y === 0 ? 0 : 1)\n\toptions.w = options.w || (options.w === 0 ? 0 : 1)\n\toptions.h = options.h || (options.h === 0 ? 0 : 1)\n\toptions.objectName = options.objectName\n\t\t? encodeXmlEntities(validateObjectName(options.objectName, 'shape'))\n\t\t: `Shape ${target._slideObjects.filter(obj => obj._type === SLIDE_OBJECT_TYPES.text).length}`\n\n\t// 3: Handle line (lots of deprecated opts)\n\tif (typeof options.line === 'string') {\n\t\tconst tmpOpts = newLineOpts\n\t\ttmpOpts.color = String(options.line) // @deprecated `options.line` string (was line color)\n\t\toptions.line = tmpOpts\n\t}\n\tif (typeof options.lineSize === 'number') options.line.width = options.lineSize // @deprecated (part of `ShapeLineProps` now)\n\tif (typeof options.lineDash === 'string') options.line.dashType = options.lineDash // @deprecated (part of `ShapeLineProps` now)\n\tif (typeof options.lineHead === 'string') options.line.beginArrowType = options.lineHead // @deprecated (part of `ShapeLineProps` now)\n\tif (typeof options.lineTail === 'string') options.line.endArrowType = options.lineTail // @deprecated (part of `ShapeLineProps` now)\n\n\t// 4: Create hyperlink rels\n\tcreateHyperlinkRels(target, newObject)\n\n\t// LAST: Add object to slide\n\ttarget._slideObjects.push(newObject)\n}\n\n/**\n * Adds a connector object to a slide definition.\n * A connector is a line between two points emitted as a PowerPoint connector (`<p:cxnSp>`).\n * Endpoints are converted to a bounding box (`x/y/w/h`) plus `flipH`/`flipV` so the box can be\n * oriented from any corner; the connector preset geometry is derived from `type`.\n * @param {PresSlideInternal} target - slide the connector is added to\n * @param {ConnectorProps} opts - connector options (endpoints + line styling)\n */\nexport function addConnectorDefinition(target: PresSlideInternal, opts: ConnectorProps): void {\n\tif (!opts || [opts.x1, opts.y1, opts.x2, opts.y2].some(v => typeof v === 'undefined')) {\n\t\tthrow new Error('addConnector requires { x1, y1, x2, y2 }. Example: `slide.addConnector({ x1:1, y1:1, x2:4, y2:3 })`')\n\t}\n\n\tconst preset = CONNECTOR_PRESETS[opts.type || 'straight']\n\tif (!preset) {\n\t\tthrow new Error(`Invalid connector type \"${String(opts.type)}\". Use 'straight', 'elbow', or 'curved'.`)\n\t}\n\n\t// Resolve all four endpoints to inches up front (handles every `Coord` form: number,\n\t// '50%', '2in', etc.). The connector box uses the min corner as its origin and flips\n\t// horizontally/vertically when the end point is left of / above the start point.\n\tconst x1 = getSmartParseNumber(opts.x1, 'X', target._presLayout) / EMU\n\tconst y1 = getSmartParseNumber(opts.y1, 'Y', target._presLayout) / EMU\n\tconst x2 = getSmartParseNumber(opts.x2, 'X', target._presLayout) / EMU\n\tconst y2 = getSmartParseNumber(opts.y2, 'Y', target._presLayout) / EMU\n\n\tconst newObject: ISlideObject = {\n\t\t_type: SLIDE_OBJECT_TYPES.connector,\n\t\t// store the connector preset on `shape`; the serializer emits it as the prstGeom `prst`\n\t\tshape: preset as SHAPE_NAME,\n\t\toptions: {\n\t\t\tx: Math.min(x1, x2),\n\t\t\ty: Math.min(y1, y2),\n\t\t\tw: Math.abs(x2 - x1),\n\t\t\th: Math.abs(y2 - y1),\n\t\t\tflipH: x2 < x1,\n\t\t\tflipV: y2 < y1,\n\t\t\tline: {\n\t\t\t\ttype: 'solid',\n\t\t\t\tcolor: opts.color || DEF_SHAPE_LINE_COLOR,\n\t\t\t\twidth: typeof opts.width === 'number' ? opts.width : 1,\n\t\t\t\tdashType: opts.dashType || 'solid',\n\t\t\t\tbeginArrowType: opts.beginArrowType,\n\t\t\t\tendArrowType: opts.endArrowType,\n\t\t\t},\n\t\t\taltText: opts.altText,\n\t\t\tobjectName: opts.objectName\n\t\t\t\t? encodeXmlEntities(validateObjectName(opts.objectName, 'connector'))\n\t\t\t\t: `Connector ${target._slideObjects.filter(obj => obj._type === SLIDE_OBJECT_TYPES.connector).length}`,\n\t\t},\n\t}\n\n\ttarget._slideObjects.push(newObject)\n}\n\n/**\n * Adds a table object to a slide definition.\n * @param {PresSlideInternal} target - slide object that the table should be added to\n * @param {TableRow[]} tableRows - table data\n * @param {TableProps} options - table options\n * @param {SlideLayoutInternal} slideLayout - Slide layout\n * @param {PresLayout} presLayout - Presentation layout\n * @param {Function} addSlide - method\n * @param {Function} getSlide - method\n */\nexport function addTableDefinition(\n\ttarget: PresSlideInternal,\n\ttableRows: TableRow[],\n\toptions: TableProps,\n\tslideLayout: SlideLayoutInternal | null,\n\tpresLayout: PresLayout,\n\taddSlide: (options?: AddSlideProps) => PresSlideInternal,\n\tgetSlide: (slideNumber: number) => PresSlideInternal\n): PresSlideInternal[] {\n\tconst slides: PresSlideInternal[] = [target] // Create array of Slides as more may be added by auto-paging\n\tconst opt: TableProps = options && typeof options === 'object' ? options : {}\n\topt.objectName = opt.objectName ? encodeXmlEntities(validateObjectName(opt.objectName, 'table')) : `Table ${target._slideObjects.filter(obj => obj._type === SLIDE_OBJECT_TYPES.table).length}`\n\n\t// STEP 1: REALITY-CHECK\n\t{\n\t\t// A: check for empty\n\t\tif (tableRows === null || tableRows.length === 0 || !Array.isArray(tableRows)) {\n\t\t\tthrow new Error('addTable: Array expected! EX: \\'slide.addTable( [rows], {options} );\\' (https://gitbrent.github.io/PptxGenJS/docs/api-tables.html)')\n\t\t}\n\n\t\t// B: check for non-well-formatted array (ex: rows=['a','b'] instead of [['a','b']])\n\t\tif (!tableRows[0] || !Array.isArray(tableRows[0])) {\n\t\t\tthrow new Error(\n\t\t\t\t'addTable: \\'rows\\' should be an array of cells! EX: \\'slide.addTable( [ [\\'A\\'], [\\'B\\'], {text:\\'C\\',options:{align:\\'center\\'}} ] );\\' (https://gitbrent.github.io/PptxGenJS/docs/api-tables.html)'\n\t\t\t)\n\t\t}\n\n\t\t// TODO: FUTURE: This is wacky and wont function right (shows .w value when there is none from demo.js?!) 20191219\n\t\t/*\n\t\tif (opt.w && opt.colW) {\n\t\t\tconsole.warn('addTable: please use either `colW` or `w` - not both (table will use `colW` and ignore `w`)')\n\t\t\tconsole.log(`${opt.w} ${opt.colW}`)\n\t\t}\n\t\t*/\n\t}\n\n\t// STEP 2: Transform `tableRows` into well-formatted TableCell's\n\t// tableRows can be object or plain text array: `[{text:'cell 1'}, {text:'cell 2', options:{color:'ff0000'}}]` | `[\"cell 1\", \"cell 2\"]`\n\tconst arrRows: TableCell[][] = []\n\ttableRows.forEach(row => {\n\t\tconst newRow: TableCell[] = []\n\n\t\tif (Array.isArray(row)) {\n\t\t\trow.forEach((cell: number | string | TableCell) => {\n\t\t\t\t// A:\n\t\t\t\tconst newCellOptions = typeof cell === 'object' && cell.options ? cell.options : {}\n\t\t\t\tconst newCell: TableCell = {\n\t\t\t\t\t_type: SLIDE_OBJECT_TYPES.tablecell,\n\t\t\t\t\ttext: '',\n\t\t\t\t\toptions: newCellOptions,\n\t\t\t\t}\n\n\t\t\t\t// B:\n\t\t\t\tif (typeof cell === 'string' || typeof cell === 'number') newCell.text = cell.toString()\n\t\t\t\telse if (cell.text) {\n\t\t\t\t\t// Cell can contain complex text type, or string, or number\n\t\t\t\t\tif (typeof cell.text === 'string' || typeof cell.text === 'number') newCell.text = cell.text.toString()\n\t\t\t\t\telse if (cell.text) newCell.text = cell.text\n\t\t\t\t\t// Capture options\n\t\t\t\t\tif (cell.options && typeof cell.options === 'object') newCell.options = cell.options\n\t\t\t\t}\n\n\t\t\t\t// C: Set cell borders\n\t\t\t\tnewCellOptions.border = newCellOptions.border || opt.border || [{ type: 'none' }, { type: 'none' }, { type: 'none' }, { type: 'none' }]\n\t\t\t\tlet cellBorder = newCellOptions.border\n\n\t\t\t\t// CASE 1: border interface is: BorderOptions | [BorderOptions, BorderOptions, BorderOptions, BorderOptions]\n\t\t\t\tif (cellBorder && typeof cellBorder === 'object') {\n\t\t\t\t\tcellBorder = normalizeBorderTuple(cellBorder)\n\t\t\t\t\tnewCellOptions.border = cellBorder\n\t\t\t\t}\n\t\t\t\t// Handle: [null, null, {type:'solid'}, null]\n\t\t\t\tconst cellBorderTuple = newCellOptions.border as BorderTuple\n\t\t\t\tif (!cellBorderTuple[0]) cellBorderTuple[0] = { type: 'none' }\n\t\t\t\tif (!cellBorderTuple[1]) cellBorderTuple[1] = { type: 'none' }\n\t\t\t\tif (!cellBorderTuple[2]) cellBorderTuple[2] = { type: 'none' }\n\t\t\t\tif (!cellBorderTuple[3]) cellBorderTuple[3] = { type: 'none' }\n\n\t\t\t\t// set complete BorderOptions for all sides\n\t\t\t\tconst arrSides = [0, 1, 2, 3] as const\n\t\t\t\tarrSides.forEach(idx => {\n\t\t\t\t\tcellBorderTuple[idx] = {\n\t\t\t\t\t\ttype: cellBorderTuple[idx].type || DEF_CELL_BORDER.type,\n\t\t\t\t\t\tcolor: cellBorderTuple[idx].color || DEF_CELL_BORDER.color,\n\t\t\t\t\t\tpt: typeof cellBorderTuple[idx].pt === 'number' ? cellBorderTuple[idx].pt : DEF_CELL_BORDER.pt,\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tnewCellOptions.border = cellBorderTuple\n\n\t\t\t\t// LAST:\n\t\t\t\tnewRow.push(newCell)\n\t\t\t})\n\t\t} else {\n\t\t\tconsole.log('addTable: tableRows has a bad row. A row should be an array of cells. You provided:')\n\t\t\tconsole.log(row)\n\t\t}\n\n\t\tarrRows.push(newRow)\n\t})\n\n\t// STEP 3: Set options\n\t// Keep x/y/w/h as raw user `Coord` (inches/percent/unit-string). They are resolved to EMU\n\t// exactly once at emission (gen-xml) and by the auto-pager (getSlidesForTableRows); no\n\t// pre-conversion here, so a value is never parsed twice. Default position is 0.5in.\n\tif (opt.x === undefined || opt.x === null) opt.x = 0.5\n\tif (opt.y === undefined || opt.y === null) opt.y = 0.5\n\t// NOTE: Dont set default `h` - leaving it null triggers auto-rowH in `makeXMLSlide()`\n\topt.fontSize = opt.fontSize || DEF_FONT_SIZE\n\topt.margin = opt.margin === 0 || opt.margin ? opt.margin : DEF_CELL_MARGIN_IN\n\tif (typeof opt.margin === 'number') opt.margin = [Number(opt.margin), Number(opt.margin), Number(opt.margin), Number(opt.margin)]\n\t// defensive fallback - if `opt.margin` is not a 4-element array of finite numbers, use defaults so non-numeric table-level margins don't leak NaN into <a:tcPr>\n\tif (!Array.isArray(opt.margin) || opt.margin.length !== 4 || opt.margin.some((v: unknown) => typeof v !== 'number' || !Number.isFinite(v))) {\n\t\topt.margin = DEF_CELL_MARGIN_IN\n\t}\n\t// NOTE: dont add default color on tables with hyperlinks! (it causes any textObj's with hyperlinks to have subsequent words to be black)\n\tif (!JSON.stringify({ arrRows }).includes('hyperlink')) {\n\t\tif (!opt.color) opt.color = opt.color || DEF_FONT_COLOR // Set default color if needed (table option > inherit from Slide > default to black)\n\t}\n\tif (typeof opt.border === 'string') {\n\t\tconsole.warn('addTable `border` option must be an object. Ex: `{border: {type:\\'none\\'}}`')\n\t\topt.border = undefined\n\t} else if (Array.isArray(opt.border)) {\n\t\tconst border = opt.border\n\t\t;([0, 1, 2, 3] as const).forEach(idx => {\n\t\t\tborder[idx] = border[idx]\n\t\t\t\t? { type: border[idx].type || DEF_CELL_BORDER.type, color: border[idx].color || DEF_CELL_BORDER.color, pt: border[idx].pt || DEF_CELL_BORDER.pt }\n\t\t\t\t: { type: 'none' }\n\t\t})\n\t}\n\n\topt.autoPage = typeof opt.autoPage === 'boolean' ? opt.autoPage : false\n\topt.autoPagePlaceholder = typeof opt.autoPagePlaceholder === 'boolean' ? opt.autoPagePlaceholder : false\n\topt.autoPageRepeatHeader = typeof opt.autoPageRepeatHeader === 'boolean' ? opt.autoPageRepeatHeader : false\n\topt.autoPageHeaderRows = typeof opt.autoPageHeaderRows !== 'undefined' && !isNaN(Number(opt.autoPageHeaderRows)) ? Number(opt.autoPageHeaderRows) : 1\n\topt.autoPageLineWeight = typeof opt.autoPageLineWeight !== 'undefined' && !isNaN(Number(opt.autoPageLineWeight)) ? Number(opt.autoPageLineWeight) : 0\n\tif (opt.autoPageLineWeight) {\n\t\tif (opt.autoPageLineWeight > 1) opt.autoPageLineWeight = 1\n\t\telse if (opt.autoPageLineWeight < -1) opt.autoPageLineWeight = -1\n\t}\n\t// autoPage ^^^\n\n\t// Set/Calc table width\n\t// Get slide margins - start with default values, then adjust if master or slide margins exist\n\tlet arrTableMargin = DEF_SLIDE_MARGIN_IN\n\t// Case 1: Master margins\n\tif (slideLayout && typeof slideLayout._margin !== 'undefined') {\n\t\tif (Array.isArray(slideLayout._margin)) arrTableMargin = slideLayout._margin\n\t\telse if (!isNaN(Number(slideLayout._margin))) { arrTableMargin = [Number(slideLayout._margin), Number(slideLayout._margin), Number(slideLayout._margin), Number(slideLayout._margin)] }\n\t}\n\t// Case 2: Table margins\n\t/* FIXME: add `_margin` option to slide options\n\t\telse if ( addNewSlide._margin ) {\n\t\t\tif ( Array.isArray(addNewSlide._margin) ) arrTableMargin = addNewSlide._margin;\n\t\t\telse if ( !isNaN(Number(addNewSlide._margin)) ) arrTableMargin = [Number(addNewSlide._margin), Number(addNewSlide._margin), Number(addNewSlide._margin), Number(addNewSlide._margin)];\n\t\t}\n\t*/\n\n\t/**\n\t * Calc table width depending upon what data we have - several scenarios exist (including bad data, eg: colW doesnt match col count)\n\t * The API does not require a `w` value, but XML generation does, hence, code to calc a width below using colW value(s)\n\t */\n\tif (opt.colW) {\n\t\tconst firstRowColCnt = arrRows[0].reduce((totalLen, c) => {\n\t\t\tif (c?.options?.colspan && typeof c.options.colspan === 'number') {\n\t\t\t\ttotalLen += c.options.colspan\n\t\t\t} else {\n\t\t\t\ttotalLen += 1\n\t\t\t}\n\t\t\treturn totalLen\n\t\t}, 0)\n\n\t\tif (typeof opt.colW === 'string' || typeof opt.colW === 'number') {\n\t\t\t// Ex: `colW = 3` or `colW = '3'`\n\t\t\topt.w = Math.floor(Number(opt.colW) * firstRowColCnt)\n\t\t\topt.colW = undefined // IMPORTANT: Unset `colW` so table is created using `opt.w`, which will evenly divide cols\n\t\t} else if (opt.colW && Array.isArray(opt.colW) && opt.colW.length === 1 && firstRowColCnt > 1) {\n\t\t\t// Ex: `colW=[3]` but with >1 cols (same as above, user is saying \"use this width for all\")\n\t\t\topt.w = Math.floor(Number(opt.colW) * firstRowColCnt)\n\t\t\topt.colW = undefined // IMPORTANT: Unset `colW` so table is created using `opt.w`, which will evenly divide cols\n\t\t} else if (opt.colW && Array.isArray(opt.colW) && opt.colW.length !== firstRowColCnt) {\n\t\t\t// Err: Mismatched colW and cols count\n\t\t\tconsole.warn('addTable: mismatch: (colW.length != data.length) Therefore, defaulting to evenly distributed col widths.')\n\t\t\topt.colW = undefined\n\t\t}\n\t} else if (opt.w) {\n\t\t// Keep raw user `Coord` — resolved to EMU once at emission. (No pre-conversion.)\n\t} else {\n\t\topt.w = Math.floor((presLayout._sizeW || presLayout.width) / EMU - arrTableMargin[1] - arrTableMargin[3])\n\t}\n\n\t// STEP 5: Loop over cells: transform each to ITableCell; check to see whether to unset `autoPage` while here\n\tarrRows.forEach(row => {\n\t\trow.forEach((cell, idy) => {\n\t\t\t// A: Transform cell data if needed\n\t\t\t/* Table rows can be an object or plain text - transform into object when needed\n\t\t\t\t// EX:\n\t\t\t\tconst arrTabRows1 = [\n\t\t\t\t\t[ { text:'A1\\nA2', options:{rowspan:2, fill:'99FFCC'} } ]\n\t\t\t\t\t,[ 'B2', 'C2', 'D2', 'E2' ]\n\t\t\t\t]\n\t\t\t*/\n\t\t\tif (typeof cell === 'number' || typeof cell === 'string') {\n\t\t\t\t// Grab table formatting `opts` to use here so text style/format inherits as it should\n\t\t\t\trow[idy] = { _type: SLIDE_OBJECT_TYPES.tablecell, text: String(row[idy]), options: opt }\n\t\t\t} else if (typeof cell === 'object') {\n\t\t\t\t// ARG0: `text`\n\t\t\t\tif (typeof cell.text === 'number') row[idy].text = cell.text.toString()\n\t\t\t\telse if (typeof cell.text === 'undefined' || cell.text === null) row[idy].text = ''\n\n\t\t\t\t// ARG1: `options`: ensure options exists\n\t\t\t\trow[idy].options = cell.options || {}\n\n\t\t\t\t// Set type to tabelcell\n\t\t\t\trow[idy]._type = SLIDE_OBJECT_TYPES.tablecell\n\t\t\t}\n\n\t\t\t// B: Check for fine-grained formatting, disable auto-page when found\n\t\t\t// Since genXmlTextBody already checks for text array ( text:[{},..{}] ) we're done!\n\t\t\t// Text in individual cells will be formatted as they are added by calls to genXmlTextBody within table builder\n\t\t\t// if (cell.text && Array.isArray(cell.text)) opt.autoPage = false\n\t\t\t// TODO: FIXME: WIP: 20210807: We cant do this anymore\n\t\t})\n\t})\n\n\t// If autoPage = true, we need to return references to newly created slides if any\n\tconst newAutoPagedSlides: PresSlideInternal[] = []\n\n\t// STEP 6: Auto-Paging: (via {options} and used internally)\n\t// (used internally by `tableToSlides()` to not engage recursion - we've already paged the table data, just add this one)\n\tif (opt && !opt.autoPage) {\n\t\t// Create hyperlink rels (IMPORTANT: Wait until table has been shredded across Slides or all rels will end-up on Slide 1!)\n\t\tcreateHyperlinkRels(target, arrRows)\n\n\t\t// Add slideObjects (NOTE: Use `extend` to avoid mutation)\n\t\ttarget._slideObjects.push({\n\t\t\t_type: SLIDE_OBJECT_TYPES.table,\n\t\t\tarrTabRows: arrRows,\n\t\t\toptions: { ...opt },\n\t\t})\n\t} else {\n\t\tif (opt.autoPageRepeatHeader) opt._arrObjTabHeadRows = arrRows.filter((_row, idx) => idx < (opt.autoPageHeaderRows || 1))\n\n\t\t// #1136: snapshot populated placeholders on the source slide (e.g. a title added via\n\t\t// `addText(text, { placeholder })`) so they can be re-rendered on each overflow slide.\n\t\t// Overflow slides otherwise inherit only the layout's empty placeholders. Captured before\n\t\t// the loop so the table object added per-slide below is never included.\n\t\tconst sourcePlaceholders =\n\t\t\topt.autoPagePlaceholder && Array.isArray(target._slideObjects)\n\t\t\t\t? target._slideObjects.filter(obj => obj._type !== SLIDE_OBJECT_TYPES.table && obj.options?.placeholder)\n\t\t\t\t: []\n\n\t\t// Loop over rows and create 1-N tables as needed (ISSUE#21)\n\t\tgetSlidesForTableRows(arrRows, opt, presLayout, slideLayout).forEach((slide, idx) => {\n\t\t\t// A: Create new Slide when needed, otherwise, use existing (NOTE: More than 1 table can be on a Slide, so we will go up AND down the Slide chain)\n\t\t\tif (!getSlide(target._slideNum + idx)) slides.push(addSlide({ masterName: slideLayout?._name || undefined }))\n\n\t\t\t// B: Reset opt.y to `option`/`margin` after first Slide (ISSUE#43, ISSUE#47, ISSUE#48)\n\t\t\t// Keep raw inches — resolved to EMU once at emission. (No pre-conversion.)\n\t\t\tif (idx > 0) opt.y = opt.autoPageSlideStartY || opt.newSlideStartY || arrTableMargin[0]\n\n\t\t\t// C: Add this table to new Slide\n\t\t\t{\n\t\t\t\tconst newSlide: PresSlideInternal = getSlide(target._slideNum + idx)\n\n\t\t\t\topt.autoPage = false\n\n\t\t\t\t// #1136: copy the source slide's populated placeholders onto each overflow slide\n\t\t\t\t// (idx 0 is the source slide itself and already has them).\n\t\t\t\tif (idx > 0 && sourcePlaceholders.length > 0) {\n\t\t\t\t\tsourcePlaceholders.forEach(ph => newSlide._slideObjects.push(structuredClone(ph)))\n\t\t\t\t}\n\n\t\t\t\t// Create hyperlink rels (IMPORTANT: Wait until table has been shredded across Slides or all rels will end-up on Slide 1!)\n\t\t\t\tcreateHyperlinkRels(newSlide, slide.rows)\n\n\t\t\t\t// Add rows to new slide\n\t\t\t\tnewSlide.addTable(slide.rows, { ...opt })\n\n\t\t\t\t// Add reference to the new slide so it can be returned, but don't add the first one because the user already has a reference to that one.\n\t\t\t\tif (idx > 0) newAutoPagedSlides.push(newSlide)\n\t\t\t}\n\t\t})\n\t}\n\treturn newAutoPagedSlides\n}\n\n/**\n * Adds a text object to a slide definition.\n * @param {PresSlideInternal} target - slide object that the text should be added to\n * @param {string|TextProps[]} text text string or object\n * @param {TextPropsOptions} opts text options\n * @param {boolean} isPlaceholder whether this a placeholder object\n * @since: 1.0.0\n */\nexport function addTextDefinition(target: PresSlideInternal, text: TextProps[], opts: TextPropsOptions, isPlaceholder: boolean): void {\n\tconst textObjects = !text || text.length === 0 ? [{ text: '' }] : text\n\tconst objectOptions: ObjectOptions = opts || {}\n\tconst newObject: ISlideObject = {\n\t\t_type: isPlaceholder ? SLIDE_OBJECT_TYPES.placeholder : SLIDE_OBJECT_TYPES.text,\n\t\tshape: opts.shape || SHAPE_TYPE.RECTANGLE,\n\t\ttext: textObjects,\n\t\toptions: objectOptions,\n\t}\n\n\tfunction cleanOpts(itemOpts: ObjectOptions): TextPropsOptions {\n\t\t// STEP 1: Set some options\n\t\t{\n\t\t\t// A.1: Color (placeholders should inherit their colors or override them, so don't default them)\n\t\t\tif (!itemOpts.placeholder) {\n\t\t\t\titemOpts.color = itemOpts.color || objectOptions.color || target.color || DEF_FONT_COLOR\n\t\t\t}\n\n\t\t\t// A.2: Placeholder should inherit their bullets or override them, so don't default them\n\t\t\tif (itemOpts.placeholder || isPlaceholder) {\n\t\t\t\titemOpts.bullet = itemOpts.bullet || false\n\t\t\t}\n\n\t\t\t// A.3: Text targeting a placeholder need to inherit the placeholders options (eg: margin, valign, etc.) (Issue #640)\n\t\t\tif (itemOpts.placeholder && target._slideLayout && target._slideLayout._slideObjects) {\n\t\t\t\tconst placeHold = target._slideLayout._slideObjects.filter(\n\t\t\t\t\titem => item._type === 'placeholder' && item.options && item.options.placeholder && item.options.placeholder === itemOpts.placeholder\n\t\t\t\t)[0]\n\t\t\t\tif (placeHold?.options) itemOpts = { ...itemOpts, ...placeHold.options }\n\t\t\t}\n\n\t\t\t// A.4: Other options\n\t\t\titemOpts.objectName = itemOpts.objectName\n\t\t\t\t? encodeXmlEntities(validateObjectName(itemOpts.objectName, 'text'))\n\t\t\t\t: `Text ${target._slideObjects.filter(obj => obj._type === SLIDE_OBJECT_TYPES.text).length}`\n\n\t\t\t// B:\n\t\t\tif (itemOpts.shape === SHAPE_TYPE.LINE) {\n\t\t\t\tconst itemLine = typeof itemOpts.line === 'object' && itemOpts.line ? itemOpts.line : {}\n\t\t\t\t// ShapeLineProps defaults\n\t\t\t\tconst newLineOpts: ShapeLineProps = {\n\t\t\t\t\ttype: itemLine.type || 'solid',\n\t\t\t\t\tcolor: itemLine.color || DEF_SHAPE_LINE_COLOR,\n\t\t\t\t\ttransparency: itemLine.transparency || 0,\n\t\t\t\t\twidth: itemLine.width || 1,\n\t\t\t\t\tdashType: itemLine.dashType || 'solid',\n\t\t\t\t\tbeginArrowType: itemLine.beginArrowType,\n\t\t\t\t\tendArrowType: itemLine.endArrowType,\n\t\t\t\t}\n\t\t\t\tif (typeof itemOpts.line === 'object') itemOpts.line = newLineOpts\n\n\t\t\t\t// 3: Handle line (lots of deprecated opts)\n\t\t\t\tif (typeof itemOpts.line === 'string') {\n\t\t\t\t\tconst tmpOpts = newLineOpts\n\t\t\t\t\tif (typeof itemOpts.line === 'string') tmpOpts.color = itemOpts.line // @deprecated [remove in v4.0]\n\t\t\t\t\t// tmpOpts.color = itemOpts.line!.toString() // @deprecated `itemOpts.line`:[string] (was line color)\n\t\t\t\t\titemOpts.line = tmpOpts\n\t\t\t\t}\n\t\t\t\tconst lineOpts = itemOpts.line || newLineOpts\n\t\t\t\titemOpts.line = lineOpts\n\t\t\t\tif (typeof itemOpts.lineSize === 'number') lineOpts.width = itemOpts.lineSize // @deprecated (part of `ShapeLineProps` now)\n\t\t\t\tif (typeof itemOpts.lineDash === 'string') lineOpts.dashType = itemOpts.lineDash // @deprecated (part of `ShapeLineProps` now)\n\t\t\t\tif (typeof itemOpts.lineHead === 'string') lineOpts.beginArrowType = itemOpts.lineHead // @deprecated (part of `ShapeLineProps` now)\n\t\t\t\tif (typeof itemOpts.lineTail === 'string') lineOpts.endArrowType = itemOpts.lineTail // @deprecated (part of `ShapeLineProps` now)\n\t\t\t}\n\n\t\t\t// C: Line opts\n\t\t\titemOpts.line = itemOpts.line || {}\n\t\t\titemOpts.lineSpacing = itemOpts.lineSpacing && !isNaN(itemOpts.lineSpacing) ? itemOpts.lineSpacing : undefined\n\t\t\titemOpts.lineSpacingMultiple = itemOpts.lineSpacingMultiple && !isNaN(itemOpts.lineSpacingMultiple) ? itemOpts.lineSpacingMultiple : undefined\n\n\t\t\t// D: Transform text options to bodyProperties as thats how we build XML\n\t\t\titemOpts._bodyProp = itemOpts._bodyProp || {}\n\t\t\titemOpts._bodyProp.autoFit = itemOpts.autoFit || false // DEPRECATED: (3.3.0) If true, shape will collapse to text size (Fit To shape)\n\t\t\titemOpts._bodyProp.anchor = !itemOpts.placeholder ? TEXT_VALIGN.ctr : undefined // VALS: [t,ctr,b]\n\t\t\titemOpts._bodyProp.vert = itemOpts.vert // VALS: [eaVert,horz,mongolianVert,vert,vert270,wordArtVert,wordArtVertRtl]\n\t\t\titemOpts._bodyProp.wrap = typeof itemOpts.wrap === 'boolean' ? itemOpts.wrap : true\n\n\t\t\t// D.1: Text columns (`numCol` range is 1-16 per ECMA-376 ST_TextColumnCount)\n\t\t\tif (itemOpts.columns !== undefined) {\n\t\t\t\tif (typeof itemOpts.columns !== 'number' || isNaN(itemOpts.columns) || itemOpts.columns < 1 || itemOpts.columns > 16) {\n\t\t\t\t\tconsole.warn('Warning: text `columns` must be a number 1-16 (ignoring value)')\n\t\t\t\t} else {\n\t\t\t\t\titemOpts._bodyProp.numCol = Math.round(itemOpts.columns)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (itemOpts.columnSpacing !== undefined) {\n\t\t\t\tif (typeof itemOpts.columnSpacing !== 'number' || isNaN(itemOpts.columnSpacing) || itemOpts.columnSpacing < 0) {\n\t\t\t\t\tconsole.warn('Warning: text `columnSpacing` must be a number >= 0 (ignoring value)')\n\t\t\t\t} else {\n\t\t\t\t\titemOpts._bodyProp.spcCol = valToPts(itemOpts.columnSpacing)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// E: Inset\n\t\t\t// @deprecated 3.10.0 (`inset` - use `margin`)\n\t\t\tif ((itemOpts.inset && !isNaN(Number(itemOpts.inset))) || itemOpts.inset === 0) {\n\t\t\t\titemOpts._bodyProp.lIns = inch2Emu(itemOpts.inset)\n\t\t\t\titemOpts._bodyProp.rIns = inch2Emu(itemOpts.inset)\n\t\t\t\titemOpts._bodyProp.tIns = inch2Emu(itemOpts.inset)\n\t\t\t\titemOpts._bodyProp.bIns = inch2Emu(itemOpts.inset)\n\t\t\t}\n\n\t\t\t// F: Transform @deprecated props\n\t\t\tif (typeof itemOpts.underline === 'boolean' && itemOpts.underline === true) itemOpts.underline = { style: 'sng' }\n\t\t}\n\n\t\t// STEP 2: Transform `align`/`valign` to XML values, store in _bodyProp for XML gen\n\t\t{\n\t\t\tconst align = (itemOpts.align || '').toLowerCase()\n\t\t\tconst valign = (itemOpts.valign || '').toLowerCase()\n\t\t\tif (align.startsWith('c')) itemOpts._bodyProp.align = TEXT_HALIGN.center\n\t\t\telse if (align.startsWith('l')) itemOpts._bodyProp.align = TEXT_HALIGN.left\n\t\t\telse if (align.startsWith('r')) itemOpts._bodyProp.align = TEXT_HALIGN.right\n\t\t\telse if (align.startsWith('j')) itemOpts._bodyProp.align = TEXT_HALIGN.justify\n\n\t\t\tif (valign.startsWith('b')) itemOpts._bodyProp.anchor = TEXT_VALIGN.b\n\t\t\telse if (valign.startsWith('m')) itemOpts._bodyProp.anchor = TEXT_VALIGN.ctr\n\t\t\telse if (valign.startsWith('t')) itemOpts._bodyProp.anchor = TEXT_VALIGN.t\n\t\t}\n\n\t\t// STEP 3: ROBUST: Set rational values for some shadow props if needed\n\t\tcorrectShadowOptions(itemOpts.shadow)\n\n\t\treturn itemOpts\n\t}\n\n\t// STEP 1: Create/Clean object options\n\tnewObject.options = cleanOpts(objectOptions)\n\n\t// STEP 2: Create/Clean text options\n\ttextObjects.forEach(item => (item.options = cleanOpts(item.options || {})))\n\n\t// STEP 3: Create hyperlinks\n\tcreateHyperlinkRels(target, textObjects)\n\n\t// LAST: Add object to Slide\n\ttarget._slideObjects.push(newObject)\n}\n\n/**\n * Adds placeholder objects to slide\n * @param {PresSlideInternal} slide - slide object containing layouts\n */\nexport function addPlaceholdersToSlideLayouts(slide: PresSlideInternal): void {\n\tif (!slide._slideLayout) return\n\t// Add all placeholders on this Slide that dont already exist\n\t(slide._slideLayout._slideObjects || []).forEach(slideLayoutObj => {\n\t\tif (slideLayoutObj._type === SLIDE_OBJECT_TYPES.placeholder) {\n\t\t\tconst slideLayoutOptions = slideLayoutObj.options || {}\n\t\t\t// A: Search for this placeholder on Slide before we add\n\t\t\t// NOTE: Check to ensure a placeholder does not already exist on the Slide\n\t\t\t// They are created when they have been populated with text (ex: `slide.addText('Hi', { placeholder:'title' });`)\n\t\t\tif (!slide._slideObjects.some(slideObj => slideObj.options && slideObj.options.placeholder === slideLayoutOptions.placeholder)) {\n\t\t\t\taddTextDefinition(slide, [{ text: '' }], slideLayoutOptions, true)\n\t\t\t}\n\t\t}\n\t})\n}\n\n/* -------------------------------------------------------------------------------- */\n\n/**\n * Adds a background image or color to a slide definition.\n * @param {BackgroundProps} props - color string or an object with image definition\n * @param {PresSlideInternal} target - slide object that the background is set to\n */\nexport function addBackgroundDefinition(props: BackgroundProps, target: SlideLayoutInternal): void {\n\t// A: @deprecated\n\tif (target.bkgd) {\n\t\tif (!target.background) target.background = {}\n\n\t\tif (typeof target.bkgd === 'string') target.background.color = target.bkgd\n\t\telse {\n\t\t\tif (target.bkgd.data) target.background.data = target.bkgd.data\n\t\t\tif (target.bkgd.path) target.background.path = target.bkgd.path\n\t\t\tif (target.bkgd.src) target.background.path = target.bkgd.src // @deprecated (drop in 4.x)\n\t\t}\n\t}\n\tif (target.background?.fill) target.background.color = target.background.fill\n\n\t// B: Handle media\n\tif (props && (props.path || props.data)) {\n\t\t// Allow the use of only the data key (`path` isnt reqd)\n\t\tprops.path = props.path || 'preencoded.png'\n\t\tlet strImgExtn = (props.path.split('.').pop() || 'png').split('?')[0] // Handle \"blah.jpg?width=540\" etc.\n\t\tif (strImgExtn === 'jpg') strImgExtn = 'jpeg' // base64-encoded jpg's come out as \"data:image/jpeg;base64,/9j/[...]\", so correct exttnesion to avoid content warnings at PPT startup\n\n\t\ttarget._relsMedia = target._relsMedia || []\n\t\tconst intRels = target._relsMedia.length + 1\n\t\t// NOTE: `Target` cannot have spaces (eg:\"Slide 1-image-1.jpg\") or a \"presentation is corrupt\" warning comes up\n\t\ttarget._relsMedia.push({\n\t\t\tpath: props.path,\n\t\t\ttype: SLIDE_OBJECT_TYPES.image,\n\t\t\textn: strImgExtn,\n\t\t\tdata: props.data || undefined,\n\t\t\trId: intRels,\n\t\t\tTarget: `../media/${(target._name || '').replace(/\\s+/gi, '-')}-image-${target._relsMedia.length + 1}.${strImgExtn}`,\n\t\t})\n\t\ttarget._bkgdImgRid = intRels\n\t}\n}\n\n/**\n * Parses text/text-objects from `addText()` and `addTable()` methods; creates 'hyperlink'-type Slide Rels for each hyperlink found\n * @param {PresSlideInternal} target - slide object that any hyperlinks will be be added to\n * @param {number | string | TextProps | TextProps[] | ITableCell[][]} text - text to parse\n */\nfunction createHyperlinkRels(\n\ttarget: PresSlideInternal,\n\ttext: number | string | ISlideObject | TextProps | TextProps[] | TableCell[] | TableCell[][],\n\toptions?: TextPropsOptions[],\n): void {\n\tlet textObjs: Array<HyperlinkTextObject | TableCell[]> = []\n\n\t// Only text objects can have hyperlinks, bail when text param is plain text\n\tif (typeof text === 'string' || typeof text === 'number') return\n\t// IMPORTANT: \"else if\" Array.isArray must come before typeof===object! Otherwise, code will exhaust recursion!\n\telse if (Array.isArray(text)) textObjs = text\n\telse if (typeof text === 'object') textObjs = [text as HyperlinkTextObject]\n\n\ttextObjs.forEach((text: HyperlinkTextObject | TableCell[], idx: number) => {\n\t\t// NOTE: `text` can be an array of other `text` objects (table cell word-level formatting), continue parsing using recursion\n\t\tif (Array.isArray(text)) {\n\t\t\tconst cellOpts: TextPropsOptions[] = []\n\t\t\ttext.forEach((tablecell) => {\n\t\t\t\tif (tablecell.options) {\n\t\t\t\t\tcellOpts.push(tablecell.options)\n\t\t\t\t}\n\t\t\t})\n\t\t\tcreateHyperlinkRels(target, text, cellOpts)\n\t\t\treturn\n\t\t}\n\n\t\t// IMPORTANT: `options` are lost due to recursion/copy!\n\t\tif (options && options[idx] && options[idx].hyperlink) text.options = { ...text.options, ...options[idx] }\n\t\tif (Array.isArray(text.text)) {\n\t\t\tcreateHyperlinkRels(target, text.text, options && options[idx] ? [options[idx]] : undefined)\n\t\t} else if (text && typeof text === 'object' && text.options && text.options.hyperlink && !text.options.hyperlink._rId) {\n\t\t\tconst hyperlink = text.options.hyperlink\n\t\t\tif (typeof hyperlink !== 'object') {\n\t\t\t\tconsole.log('ERROR: text `hyperlink` option should be an object. Ex: `hyperlink: {url:\\'https://github.com\\'}` ')\n\t\t\t}\n\t\t\telse if (!hyperlink.url && !hyperlink.slide) {\n\t\t\t\tconsole.log('ERROR: \\'hyperlink requires either: `url` or `slide`\\'')\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst relId = getNewRelId(target)\n\n\t\t\t\ttarget._rels.push({\n\t\t\t\t\ttype: SLIDE_OBJECT_TYPES.hyperlink,\n\t\t\t\t\tdata: hyperlink.slide ? 'slide' : 'dummy',\n\t\t\t\t\trId: relId,\n\t\t\t\t\tTarget: hyperlink.url ? encodeXmlEntities(hyperlink.url) : String(hyperlink.slide),\n\t\t\t\t})\n\n\t\t\t\thyperlink._rId = relId\n\t\t\t}\n\t\t}\n\t\telse if (text && typeof text === 'object' && text.options && text.options.hyperlink && text.options.hyperlink._rId) {\n\t\t\tconst hyperlink = text.options.hyperlink\n\t\t\tconst hyperlinkRelId = hyperlink._rId\n\t\t\t// NOTE: auto-paging will create new slides, but skip above as _rId exists, BUT this is a new slide, so add rels!\n\t\t\tif (hyperlinkRelId && !target._rels.some(rel => rel.rId === hyperlinkRelId)) {\n\t\t\t\ttarget._rels.push({\n\t\t\t\t\ttype: SLIDE_OBJECT_TYPES.hyperlink,\n\t\t\t\t\tdata: hyperlink.slide ? 'slide' : 'dummy',\n\t\t\t\t\trId: hyperlinkRelId,\n\t\t\t\t\tTarget: hyperlink.url ? encodeXmlEntities(hyperlink.url) : String(hyperlink.slide),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t})\n}\n","/**\n * PptxGenJS: Slide Class\n */\n\nimport { CHART_NAME, SHAPE_NAME } from './core-enums.js'\nimport {\n\tAddSlideProps,\n\tBackgroundProps,\n\tConnectorProps,\n\tHexColor,\n\tIChartMulti,\n\tIChartOpts,\n\tIChartOptsLib,\n\tISlideObject,\n\tISlideRel,\n\tISlideRelChart,\n\tISlideRelMedia,\n\tImageProps,\n\tMediaProps,\n\tPresLayout,\n\tPresSlide,\n\tPresSlideInternal,\n\tShapeProps,\n\tSlideLayoutInternal,\n\tSlideNumberProps,\n\tOptsChartData,\n\tTableProps,\n\tTableRow,\n\tTextProps,\n\tTextPropsOptions,\n} from './core-interfaces.js'\nimport * as genObj from './gen-objects.js'\nimport { emuToInches } from './units.js'\n\nexport default class Slide {\n\tprivate readonly _setSlideNum: (value: SlideNumberProps) => void\n\n\tpublic addSlide: (options?: AddSlideProps) => PresSlideInternal\n\tpublic getSlide: (slideNum: number) => PresSlideInternal\n\tpublic _name: string\n\tpublic _presLayout: PresLayout\n\tpublic _rels: ISlideRel[]\n\tpublic _relsChart: ISlideRelChart[]\n\tpublic _relsMedia: ISlideRelMedia[]\n\tpublic _rId: number\n\tpublic _slideId: number\n\tpublic _slideLayout: SlideLayoutInternal | null\n\tpublic _slideNum: number\n\tpublic _slideNumberProps: SlideNumberProps | null\n\tpublic _slideObjects: ISlideObject[]\n\tpublic _newAutoPagedSlides: PresSlideInternal[] = []\n\n\tconstructor(params: {\n\t\taddSlide: (options?: AddSlideProps) => PresSlideInternal\n\t\tgetSlide: (slideNum: number) => PresSlideInternal\n\t\tpresLayout: PresLayout\n\t\tsetSlideNum: (value: SlideNumberProps) => void\n\t\tslideId: number\n\t\tslideRId: number\n\t\tslideNumber: number\n\t\tslideLayout?: SlideLayoutInternal\n\t}) {\n\t\tthis.addSlide = params.addSlide\n\t\tthis.getSlide = params.getSlide\n\t\tthis._name = `Slide ${params.slideNumber}`\n\t\tthis._presLayout = params.presLayout\n\t\tthis._rId = params.slideRId\n\t\tthis._rels = []\n\t\tthis._relsChart = []\n\t\tthis._relsMedia = []\n\t\tthis._setSlideNum = params.setSlideNum\n\t\tthis._slideId = params.slideId\n\t\tthis._slideLayout = params.slideLayout || null\n\t\tthis._slideNum = params.slideNumber\n\t\tthis._slideObjects = []\n\t\t/** NOTE: Slide Numbers: In order for Slide Numbers to function they need to be in all 3 files: master/layout/slide\n\t\t * `defineSlideMaster` and `addNewSlide.slideNumber` will add {slideNumber} to `this.masterSlide` and `this.slideLayouts`\n\t\t * so, lastly, add to the Slide now.\n\t\t */\n\t\tthis._slideNumberProps = this._slideLayout?._slideNumberProps ? this._slideLayout._slideNumberProps : null\n\t}\n\n\t/**\n\t * Background color\n\t * @type {string|BackgroundProps}\n\t * @deprecated in v3.3.0 - use `background` instead\n\t */\n\tprivate _bkgd?: string | BackgroundProps\n\tpublic set bkgd(value: string | BackgroundProps) {\n\t\tthis._bkgd = value\n\t\tif (!this._background || !this._background.color) {\n\t\t\tif (!this._background) this._background = {}\n\t\t\tif (typeof value === 'string') this._background.color = value\n\t\t}\n\t}\n\n\tpublic get bkgd(): string | BackgroundProps | undefined {\n\t\treturn this._bkgd\n\t}\n\n\t/**\n\t * Background color or image\n\t * @type {BackgroundProps}\n\t * @example solid color `background: { color:'FF0000' }`\n\t * @example color+trans `background: { color:'FF0000', transparency:0.5 }`\n\t * @example base64 `background: { data:'image/png;base64,ABC[...]123' }`\n\t * @example url `background: { path:'https://some.url/image.jpg'}`\n\t * @since v3.3.0\n\t */\n\tprivate _background?: BackgroundProps\n\tpublic set background(props: BackgroundProps) {\n\t\tthis._background = props\n\t\t// Add background (image data/path must be captured before `exportPresentation()` is called)\n\t\tif (props) genObj.addBackgroundDefinition(props, this)\n\t}\n\n\tpublic get background(): BackgroundProps | undefined {\n\t\treturn this._background\n\t}\n\n\t/**\n\t * Default font color\n\t * @type {HexColor}\n\t */\n\tprivate _color?: HexColor\n\tpublic set color(value: HexColor) {\n\t\tthis._color = value\n\t}\n\n\tpublic get color(): HexColor | undefined {\n\t\treturn this._color\n\t}\n\n\t/**\n\t * @type {boolean}\n\t */\n\tprivate _hidden = false\n\tpublic set hidden(value: boolean) {\n\t\tthis._hidden = value\n\t}\n\n\tpublic get hidden(): boolean {\n\t\treturn this._hidden\n\t}\n\n\t/**\n\t * @type {SlideNumberProps}\n\t */\n\tpublic set slideNumber(value: SlideNumberProps) {\n\t\t// NOTE: Slide Numbers: In order for Slide Numbers to function they need to be in all 3 files: master/layout/slide\n\t\tthis._slideNumberProps = value\n\t\tthis._setSlideNum(value)\n\t}\n\n\tpublic get slideNumber(): SlideNumberProps | undefined {\n\t\treturn this._slideNumberProps ?? undefined\n\t}\n\n\tpublic get newAutoPagedSlides(): PresSlide[] {\n\t\treturn this._newAutoPagedSlides\n\t}\n\n\t/** Slide width in inches (resolved from the active presentation layout). */\n\tpublic get width(): number {\n\t\treturn emuToInches(this._presLayout.width)\n\t}\n\n\t/** Slide height in inches (resolved from the active presentation layout). */\n\tpublic get height(): number {\n\t\treturn emuToInches(this._presLayout.height)\n\t}\n\n\t/**\n\t * Add chart to Slide\n\t * @param {CHART_NAME|IChartMulti[]} type - chart type\n\t * @param {object[]} data - data object\n\t * @param {IChartOpts} options - chart options\n\t * @return {Slide} this Slide\n\t */\n\taddChart(type: CHART_NAME, data: OptsChartData[], options?: IChartOpts): Slide\n\taddChart(type: IChartMulti[], options?: IChartOpts): Slide\n\taddChart(type: CHART_NAME | IChartMulti[], dataOrOptions: OptsChartData[] | IChartOpts = [], options?: IChartOpts): Slide {\n\t\t// FUTURE: TODO-VERSION-4: Remove first arg - only take data and opts, with \"type\" required on opts\n\t\t// Set `_type` on IChartOptsLib as its what is used as object is passed around\n\t\tconst optionsWithType = (Array.isArray(type) && !Array.isArray(dataOrOptions) ? dataOrOptions : options) as IChartOptsLib | undefined\n\t\tif (optionsWithType) optionsWithType._type = type\n\t\tgenObj.addChartDefinition(this, type, dataOrOptions, options)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add image to Slide\n\t * @param {ImageProps} options - image options\n\t * @return {Slide} this Slide\n\t */\n\taddImage(options: ImageProps): Slide {\n\t\tgenObj.addImageDefinition(this, options)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add media (audio/video) to Slide\n\t * @param {MediaProps} options - media options\n\t * @return {Slide} this Slide\n\t */\n\taddMedia(options: MediaProps): Slide {\n\t\tgenObj.addMediaDefinition(this, options)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add speaker notes to Slide\n\t * @docs https://gitbrent.github.io/PptxGenJS/docs/speaker-notes.html\n\t * @param {string} notes - notes to add to slide\n\t * @return {Slide} this Slide\n\t */\n\taddNotes(notes: string): Slide {\n\t\tgenObj.addNotesDefinition(this, notes)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add shape to Slide\n\t * @param {SHAPE_NAME} shapeName - shape name\n\t * @param {ShapeProps} options - shape options\n\t * @return {Slide} this Slide\n\t */\n\taddShape(shapeName: SHAPE_NAME, options?: ShapeProps): Slide {\n\t\t// NOTE: As of v3.1.0, <script> users are passing the old shape object from the shapes file (orig to the project)\n\t\t// But React/TypeScript users are passing the shapeName from an enum, which is a simple string, so lets cast\n\t\t// <script./> => `pptx.shapes.RECTANGLE` [string] \"rect\" ... shapeName['name'] = 'rect'\n\t\t// TypeScript => `pptxgen.shapes.RECTANGLE` [string] \"rect\" ... shapeName = 'rect'\n\t\t// let shapeNameDecode = typeof shapeName === 'object' && shapeName['name'] ? shapeName['name'] : shapeName\n\t\tgenObj.addShapeDefinition(this, shapeName, options || {})\n\t\treturn this\n\t}\n\n\t/**\n\t * Add a connector (a line drawn between two points, emitted as a PowerPoint `<p:cxnSp>`).\n\t * @param {ConnectorProps} options - connector endpoints (`x1,y1,x2,y2`) and line styling\n\t * @return {Slide} this Slide\n\t * @example slide.addConnector({ type: 'elbow', x1: 1, y1: 1, x2: 5, y2: 3, endArrowType: 'triangle' })\n\t */\n\taddConnector(options: ConnectorProps): Slide {\n\t\tgenObj.addConnectorDefinition(this, options)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add table to Slide\n\t * @param {TableRow[]} tableRows - table rows\n\t * @param {TableProps} options - table options\n\t * @return {Slide} this Slide\n\t */\n\taddTable(tableRows: TableRow[], options?: TableProps): Slide {\n\t\t// FUTURE: we pass `this` - we dont need to pass layouts - they can be read from this!\n\t\tthis._newAutoPagedSlides = genObj.addTableDefinition(this, tableRows, options || {}, this._slideLayout, this._presLayout, this.addSlide, this.getSlide)\n\t\treturn this\n\t}\n\n\t/**\n\t * Add text to Slide\n\t * @param {string|TextProps[]} text - text string or complex object\n\t * @param {TextPropsOptions} options - text options\n\t * @return {Slide} this Slide\n\t */\n\taddText(text: string | number | TextProps[], options?: TextPropsOptions): Slide {\n\t\tconst textParam = typeof text === 'string' || typeof text === 'number' ? [{ text, options }] : text\n\t\tgenObj.addTextDefinition(this, textParam, options || {}, false)\n\t\treturn this\n\t}\n}\n","/**\n * PptxGenJS: Chart Generation\n */\n\nimport {\n\tAXIS_ID_CATEGORY_PRIMARY,\n\tAXIS_ID_CATEGORY_SECONDARY,\n\tAXIS_ID_SERIES_PRIMARY,\n\tAXIS_ID_VALUE_PRIMARY,\n\tAXIS_ID_VALUE_SECONDARY,\n\tBARCHART_COLORS,\n\tCHART_NAME,\n\tCHART_TYPE,\n\tDEF_CHART_GRIDLINE,\n\tDEF_FONT_COLOR,\n\tDEF_FONT_SIZE,\n\tDEF_FONT_TITLE_SIZE,\n\tDEF_SHAPE_SHADOW,\n\tLETTERS,\n\tONEPT,\n} from './core-enums.js'\nimport type { IChartOptsLib, ISlideRelChart, ShadowProps, IChartPropsTitle, OptsChartGridLine, IOptsChartData, BorderProps } from './core-interfaces.js'\nimport { createColorElement, createLineCap, genXmlColorSelection, convertRotationDegrees, encodeXmlEntities, getUuid, valToPts } from './gen-utils.js'\nimport JSZip from 'jszip'\n\nconst VALID_CHART_TIME_UNITS = ['days', 'months', 'years']\n\n/**\n * Based on passed data, creates Excel Worksheet that is used as a data source for a chart.\n * @param {ISlideRelChart} chartObject - chart object\n * @param {JSZip} zip - file that the resulting XLSX should be added to\n * @return {Promise} promise of generating the XLSX file\n */\nexport async function createExcelWorksheet (chartObject: ISlideRelChart, zip: JSZip): Promise<string> {\n\tconst data = chartObject.data\n\n\treturn await new Promise((resolve, reject) => {\n\t\tconst zipExcel = new JSZip()\n\t\tconst intBubbleCols = (data.length - 1) * 2 + 1 // 1 for \"X-Values\", then 2 for every Y-Axis\n\t\tconst IS_MULTI_CAT_AXES = data[0]?.labels?.length > 1\n\n\t\t// A: Add folders\n\t\tzipExcel.folder('_rels')\n\t\tzipExcel.folder('docProps')\n\t\tzipExcel.folder('xl/_rels')\n\t\tzipExcel.folder('xl/tables')\n\t\tzipExcel.folder('xl/theme')\n\t\tzipExcel.folder('xl/worksheets')\n\t\tzipExcel.folder('xl/worksheets/_rels')\n\n\t\t// B: Add core contents\n\t\t{\n\t\t\tzipExcel.file(\n\t\t\t\t'[Content_Types].xml',\n\t\t\t\t'<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">' +\n\t\t\t\t' <Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/>' +\n\t\t\t\t' <Default Extension=\"xml\" ContentType=\"application/xml\"/>' +\n\t\t\t\t' <Override PartName=\"/xl/workbook.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\"/>' +\n\t\t\t\t' <Override PartName=\"/xl/worksheets/sheet1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\"/>' +\n\t\t\t\t' <Override PartName=\"/xl/theme/theme1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/>' +\n\t\t\t\t' <Override PartName=\"/xl/styles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\"/>' +\n\t\t\t\t' <Override PartName=\"/xl/sharedStrings.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml\"/>' +\n\t\t\t\t' <Override PartName=\"/xl/tables/table1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml\"/>' +\n\t\t\t\t' <Override PartName=\"/docProps/core.xml\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\"/>' +\n\t\t\t\t' <Override PartName=\"/docProps/app.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\"/>' +\n\t\t\t\t'</Types>\\n'\n\t\t\t)\n\t\t\tzipExcel.file(\n\t\t\t\t'_rels/.rels',\n\t\t\t\t'<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">' +\n\t\t\t\t'<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\" Target=\"docProps/core.xml\"/>' +\n\t\t\t\t'<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\"/>' +\n\t\t\t\t'<Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"xl/workbook.xml\"/>' +\n\t\t\t\t'</Relationships>\\n'\n\t\t\t)\n\t\t\tzipExcel.file(\n\t\t\t\t'docProps/app.xml',\n\t\t\t\t'<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\" xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\">' +\n\t\t\t\t'<Application>Microsoft Macintosh Excel</Application>' +\n\t\t\t\t'<DocSecurity>0</DocSecurity>' +\n\t\t\t\t'<ScaleCrop>false</ScaleCrop>' +\n\t\t\t\t'<HeadingPairs><vt:vector size=\"2\" baseType=\"variant\"><vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant><vt:variant><vt:i4>1</vt:i4></vt:variant></vt:vector></HeadingPairs>' +\n\t\t\t\t'<TitlesOfParts><vt:vector size=\"1\" baseType=\"lpstr\"><vt:lpstr>Sheet1</vt:lpstr></vt:vector></TitlesOfParts>' +\n\t\t\t\t'<Company></Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>16.0300</AppVersion>' +\n\t\t\t\t'</Properties>\\n'\n\t\t\t)\n\t\t\tzipExcel.file(\n\t\t\t\t'docProps/core.xml',\n\t\t\t\t'<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">' +\n\t\t\t\t'<dc:creator>PptxGenJS</dc:creator>' +\n\t\t\t\t'<cp:lastModifiedBy>PptxGenJS</cp:lastModifiedBy>' +\n\t\t\t\t'<dcterms:created xsi:type=\"dcterms:W3CDTF\">' +\n\t\t\t\tnew Date().toISOString() +\n\t\t\t\t'</dcterms:created>' +\n\t\t\t\t'<dcterms:modified xsi:type=\"dcterms:W3CDTF\">' +\n\t\t\t\tnew Date().toISOString() +\n\t\t\t\t'</dcterms:modified>' +\n\t\t\t\t'</cp:coreProperties>'\n\t\t\t)\n\t\t\tzipExcel.file(\n\t\t\t\t'xl/_rels/workbook.xml.rels',\n\t\t\t\t'<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>' +\n\t\t\t\t'<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">' +\n\t\t\t\t'<Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\" Target=\"styles.xml\"/>' +\n\t\t\t\t'<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"theme/theme1.xml\"/>' +\n\t\t\t\t'<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet\" Target=\"worksheets/sheet1.xml\"/>' +\n\t\t\t\t'<Relationship Id=\"rId4\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings\" Target=\"sharedStrings.xml\"/>' +\n\t\t\t\t'</Relationships>'\n\t\t\t)\n\t\t\tzipExcel.file(\n\t\t\t\t'xl/styles.xml',\n\t\t\t\t'<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><styleSheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"><numFmts count=\"1\"><numFmt numFmtId=\"0\" formatCode=\"General\"/></numFmts><fonts count=\"4\"><font><sz val=\"9\"/><color indexed=\"8\"/><name val=\"Geneva\"/></font><font><sz val=\"9\"/><color indexed=\"8\"/><name val=\"Geneva\"/></font><font><sz val=\"10\"/><color indexed=\"8\"/><name val=\"Geneva\"/></font><font><sz val=\"18\"/><color indexed=\"8\"/>' +\n\t\t\t\t'<name val=\"Arial\"/></font></fonts><fills count=\"2\"><fill><patternFill patternType=\"none\"/></fill><fill><patternFill patternType=\"gray125\"/></fill></fills><borders count=\"1\"><border><left/><right/><top/><bottom/><diagonal/></border></borders><dxfs count=\"0\"/><tableStyles count=\"0\"/><colors><indexedColors><rgbColor rgb=\"ff000000\"/><rgbColor rgb=\"ffffffff\"/><rgbColor rgb=\"ffff0000\"/><rgbColor rgb=\"ff00ff00\"/><rgbColor rgb=\"ff0000ff\"/>' +\n\t\t\t\t'<rgbColor rgb=\"ffffff00\"/><rgbColor rgb=\"ffff00ff\"/><rgbColor rgb=\"ff00ffff\"/><rgbColor rgb=\"ff000000\"/><rgbColor rgb=\"ffffffff\"/><rgbColor rgb=\"ff878787\"/><rgbColor rgb=\"fff9f9f9\"/></indexedColors></colors></styleSheet>\\n'\n\t\t\t)\n\t\t\tzipExcel.file(\n\t\t\t\t'xl/theme/theme1.xml',\n\t\t\t\t'<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office Theme\"><a:themeElements><a:clrScheme name=\"Office\"><a:dk1><a:sysClr val=\"windowText\" lastClr=\"000000\"/></a:dk1><a:lt1><a:sysClr val=\"window\" lastClr=\"FFFFFF\"/></a:lt1><a:dk2><a:srgbClr val=\"44546A\"/></a:dk2><a:lt2><a:srgbClr val=\"E7E6E6\"/></a:lt2><a:accent1><a:srgbClr val=\"4472C4\"/></a:accent1><a:accent2><a:srgbClr val=\"ED7D31\"/></a:accent2><a:accent3><a:srgbClr val=\"A5A5A5\"/></a:accent3><a:accent4><a:srgbClr val=\"FFC000\"/></a:accent4><a:accent5><a:srgbClr val=\"5B9BD5\"/></a:accent5><a:accent6><a:srgbClr val=\"70AD47\"/></a:accent6><a:hlink><a:srgbClr val=\"0563C1\"/></a:hlink><a:folHlink><a:srgbClr val=\"954F72\"/></a:folHlink></a:clrScheme><a:fontScheme name=\"Office\"><a:majorFont><a:latin typeface=\"Calibri Light\" panose=\"020F0302020204030204\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"Yu Gothic Light\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"DengXian Light\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Times New Roman\"/><a:font script=\"Hebr\" typeface=\"Times New Roman\"/><a:font script=\"Thai\" typeface=\"Tahoma\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"MoolBoran\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Times New Roman\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/></a:majorFont><a:minorFont><a:latin typeface=\"Calibri\" panose=\"020F0502020204030204\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"Yu Gothic\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"DengXian\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Arial\"/><a:font script=\"Hebr\" typeface=\"Arial\"/><a:font script=\"Thai\" typeface=\"Tahoma\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"DaunPenh\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Arial\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/></a:minorFont></a:fontScheme><a:fmtScheme name=\"Office\"><a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"110000\"/><a:satMod val=\"105000\"/><a:tint val=\"67000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"103000\"/><a:tint val=\"73000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"109000\"/><a:tint val=\"81000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:satMod val=\"103000\"/><a:lumMod val=\"102000\"/><a:tint val=\"94000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:satMod val=\"110000\"/><a:lumMod val=\"100000\"/><a:shade val=\"100000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"99000\"/><a:satMod val=\"120000\"/><a:shade val=\"78000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w=\"6350\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"12700\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"19050\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"57150\" dist=\"19050\" dir=\"5400000\" algn=\"ctr\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"63000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:solidFill><a:schemeClr val=\"phClr\"><a:tint val=\"95000\"/><a:satMod val=\"170000\"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"93000\"/><a:satMod val=\"150000\"/><a:shade val=\"98000\"/><a:lumMod val=\"102000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:tint val=\"98000\"/><a:satMod val=\"130000\"/><a:shade val=\"90000\"/><a:lumMod val=\"103000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"63000\"/><a:satMod val=\"120000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults/><a:extraClrSchemeLst/><a:extLst><a:ext uri=\"{05A4C25C-085E-4340-85A3-A5531E510DB2}\"><thm15:themeFamily xmlns:thm15=\"http://schemas.microsoft.com/office/thememl/2012/main\" name=\"Office Theme\" id=\"{62F939B6-93AF-4DB8-9C6B-D6C7DFDC589F}\" vid=\"{4A3C46E8-61CC-4603-A589-7422A47A8E4A}\"/></a:ext></a:extLst></a:theme>'\n\t\t\t)\n\t\t\tzipExcel.file(\n\t\t\t\t'xl/workbook.xml',\n\t\t\t\t'<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>' +\n\t\t\t\t'<workbook xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" mc:Ignorable=\"x15\" xmlns:x15=\"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main\">' +\n\t\t\t\t'<fileVersion appName=\"xl\" lastEdited=\"7\" lowestEdited=\"6\" rupBuild=\"10507\"/>' +\n\t\t\t\t'<workbookPr/>' +\n\t\t\t\t'<bookViews><workbookView xWindow=\"0\" yWindow=\"500\" windowWidth=\"20960\" windowHeight=\"15960\"/></bookViews>' +\n\t\t\t\t'<sheets><sheet name=\"Sheet1\" sheetId=\"1\" r:id=\"rId1\"/></sheets>' +\n\t\t\t\t'<calcPr calcId=\"0\" concurrentCalc=\"0\"/>' +\n\t\t\t\t'</workbook>\\n'\n\t\t\t)\n\t\t\tzipExcel.file(\n\t\t\t\t'xl/worksheets/_rels/sheet1.xml.rels',\n\t\t\t\t'<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>' +\n\t\t\t\t'<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">' +\n\t\t\t\t'<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table\" Target=\"../tables/table1.xml\"/>' +\n\t\t\t\t'</Relationships>\\n'\n\t\t\t)\n\t\t}\n\n\t\t// sharedStrings.xml\n\t\t{\n\t\t\t// A: Start XML\n\t\t\tlet strSharedStrings = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>'\n\t\t\tif (chartObject.opts._type === CHART_TYPE.BUBBLE || chartObject.opts._type === CHART_TYPE.BUBBLE3D) {\n\t\t\t\tstrSharedStrings += `<sst xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" count=\"${intBubbleCols}\" uniqueCount=\"${intBubbleCols}\">`\n\t\t\t} else if (chartObject.opts._type === CHART_TYPE.SCATTER) {\n\t\t\t\tstrSharedStrings += `<sst xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" count=\"${data.length}\" uniqueCount=\"${data.length}\">`\n\t\t\t} else if (IS_MULTI_CAT_AXES) {\n\t\t\t\tlet totCount = data.length + 1 // +1 for the blank entry at index 0\n\t\t\t\tdata[0].labels.forEach(arrLabel => (totCount += arrLabel.filter(label => label && label !== '').length))\n\t\t\t\tstrSharedStrings += `<sst xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" count=\"${totCount}\" uniqueCount=\"${totCount}\">`\n\t\t\t\tstrSharedStrings += '<si><t/></si>'\n\t\t\t} else {\n\t\t\t\t// series names + all labels of one series + number of label groups (data.labels.length) of one series (i.e. how many times the blank string is used)\n\t\t\t\tconst totCount = data.length + data[0].labels.length * data[0].labels[0].length + data[0].labels.length\n\t\t\t\t// series names + labels of one series + blank string (same for all label groups)\n\t\t\t\tconst unqCount = data.length + data[0].labels.length * data[0].labels[0].length + 1\n\t\t\t\t// start `sst`\n\t\t\t\tstrSharedStrings += `<sst xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" count=\"${totCount}\" uniqueCount=\"${unqCount}\">`\n\t\t\t\t// B: Add 'blank' for A1, B1, ..., of every label group inside data[n].labels\n\t\t\t\tstrSharedStrings += '<si><t xml:space=\"preserve\"></t></si>'\n\t\t\t}\n\n\t\t\t// C: Add `name`/Series\n\t\t\tif (chartObject.opts._type === CHART_TYPE.BUBBLE || chartObject.opts._type === CHART_TYPE.BUBBLE3D) {\n\t\t\t\tdata.forEach((objData, idx) => {\n\t\t\t\t\tif (idx === 0) strSharedStrings += '<si><t>X-Axis</t></si>'\n\t\t\t\t\telse {\n\t\t\t\t\t\tstrSharedStrings += `<si><t>${encodeXmlEntities(objData.name || `Y-Axis${idx}`)}</t></si>`\n\t\t\t\t\t\tstrSharedStrings += `<si><t>${encodeXmlEntities(`Size${idx}`)}</t></si>`\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tdata.forEach(objData => {\n\t\t\t\t\tstrSharedStrings += `<si><t>${encodeXmlEntities((objData.name || ' ').replace('X-Axis', 'X-Values'))}</t></si>`\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// D: Add `labels`/Categories\n\t\t\tif (chartObject.opts._type !== CHART_TYPE.BUBBLE && chartObject.opts._type !== CHART_TYPE.BUBBLE3D && chartObject.opts._type !== CHART_TYPE.SCATTER) {\n\t\t\t\t// Use forEach backwards & check for '' to support multi-cat axes\n\t\t\t\tdata[0].labels\n\t\t\t\t\t.slice()\n\t\t\t\t\t.reverse()\n\t\t\t\t\t.forEach(labelsGroup => {\n\t\t\t\t\t\tlabelsGroup\n\t\t\t\t\t\t\t.filter(label => label && label !== '')\n\t\t\t\t\t\t\t.forEach(label => {\n\t\t\t\t\t\t\t\tstrSharedStrings += `<si><t>${encodeXmlEntities(label)}</t></si>`\n\t\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t}\n\n\t\t\t// DONE:\n\t\t\tstrSharedStrings += '</sst>\\n'\n\t\t\tzipExcel.file('xl/sharedStrings.xml', strSharedStrings)\n\t\t}\n\n\t\t// tables/table1.xml\n\t\t{\n\t\t\tlet strTableXml = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>'\n\t\t\tif (chartObject.opts._type === CHART_TYPE.BUBBLE || chartObject.opts._type === CHART_TYPE.BUBBLE3D) {\n\t\t\t\tstrTableXml += `<table xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" id=\"1\" name=\"Table1\" displayName=\"Table1\" ref=\"A1:${getExcelColName(intBubbleCols)}${intBubbleCols}\" totalsRowShown=\"0\">`\n\t\t\t\tstrTableXml += `<tableColumns count=\"${intBubbleCols}\">`\n\t\t\t\tlet idxColLtr = 1\n\t\t\t\tdata.forEach((obj, idx) => {\n\t\t\t\t\tif (idx === 0) {\n\t\t\t\t\t\tstrTableXml += `<tableColumn id=\"${idx + 1}\" name=\"X-Values\"/>`\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstrTableXml += `<tableColumn id=\"${idx + idxColLtr}\" name=\"${obj.name}\"/>`\n\t\t\t\t\t\tidxColLtr++\n\t\t\t\t\t\tstrTableXml += `<tableColumn id=\"${idx + idxColLtr}\" name=\"Size${idx}\"/>`\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else if (chartObject.opts._type === CHART_TYPE.SCATTER) {\n\t\t\t\tstrTableXml += `<table xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" id=\"1\" name=\"Table1\" displayName=\"Table1\" ref=\"A1:${getExcelColName(data.length)}${data[0].values.length + 1}\" totalsRowShown=\"0\">`\n\t\t\t\tstrTableXml += `<tableColumns count=\"${data.length}\">`\n\t\t\t\tdata.forEach((_obj, idx) => {\n\t\t\t\t\tstrTableXml += `<tableColumn id=\"${idx + 1}\" name=\"${idx === 0 ? 'X-Values' : 'Y-Value '}${idx}\"/>`\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tstrTableXml += `<table xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" id=\"1\" name=\"Table1\" displayName=\"Table1\" ref=\"A1:${getExcelColName(data.length + data[0].labels.length)}${data[0].labels[0].length + 1}\" totalsRowShown=\"0\">`\n\t\t\t\tstrTableXml += `<tableColumns count=\"${data.length + data[0].labels.length}\">`\n\t\t\t\tdata[0].labels.forEach((_labelsGroup, idx) => {\n\t\t\t\t\tstrTableXml += `<tableColumn id=\"${idx + 1}\" name=\"Column${idx + 1}\"/>`\n\t\t\t\t})\n\t\t\t\tdata.forEach((obj, idx) => {\n\t\t\t\t\tstrTableXml += `<tableColumn id=\"${idx + data[0].labels.length + 1}\" name=\"${encodeXmlEntities(obj.name)}\"/>`\n\t\t\t\t})\n\t\t\t}\n\t\t\tstrTableXml += '</tableColumns>'\n\t\t\tstrTableXml += '<tableStyleInfo showFirstColumn=\"0\" showLastColumn=\"0\" showRowStripes=\"1\" showColumnStripes=\"0\"/>'\n\t\t\tstrTableXml += '</table>'\n\t\t\tzipExcel.file('xl/tables/table1.xml', strTableXml)\n\t\t}\n\n\t\t// worksheets/sheet1.xml\n\t\t{\n\t\t\tlet strSheetXml = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>'\n\t\t\tstrSheetXml +=\n\t\t\t\t'<worksheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" mc:Ignorable=\"x14ac\" xmlns:x14ac=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac\">'\n\n\t\t\tif (chartObject.opts._type === CHART_TYPE.BUBBLE || chartObject.opts._type === CHART_TYPE.BUBBLE3D) {\n\t\t\t\tstrSheetXml += `<dimension ref=\"A1:${getExcelColName(intBubbleCols)}${data[0].values.length + 1}\"/>`\n\t\t\t} else if (chartObject.opts._type === CHART_TYPE.SCATTER) {\n\t\t\t\tstrSheetXml += `<dimension ref=\"A1:${getExcelColName(data.length)}${data[0].values.length + 1}\"/>`\n\t\t\t} else {\n\t\t\t\tstrSheetXml += `<dimension ref=\"A1:${getExcelColName(data.length + data[0].labels.length)}${data[0].values.length + 1}\"/>`\n\t\t\t}\n\n\t\t\tstrSheetXml += '<sheetViews><sheetView tabSelected=\"1\" workbookViewId=\"0\"><selection activeCell=\"B1\" sqref=\"B1\"/></sheetView></sheetViews>'\n\t\t\tstrSheetXml += '<sheetFormatPr baseColWidth=\"10\" defaultRowHeight=\"16\"/>'\n\t\t\tif (chartObject.opts._type === CHART_TYPE.BUBBLE || chartObject.opts._type === CHART_TYPE.BUBBLE3D) {\n\t\t\t\t// UNUSED: strSheetXml += `<cols><col min=\"1\" max=\"${data.length}\" width=\"11\" customWidth=\"1\" /></cols>`\n\n\t\t\t\t/* EX: INPUT: `data`\n\t\t\t\t[\n\t\t\t\t\t{ name:'X-Axis' , values:[10,11,12,13,14,15,16,17,18,19,20] },\n\t\t\t\t\t{ name:'Y-Axis 1', values:[ 1, 6, 7, 8, 9], sizes:[ 4, 5, 6, 7, 8] },\n\t\t\t\t\t{ name:'Y-Axis 2', values:[33,32,42,53,63], sizes:[11,12,13,14,15] }\n\t\t\t\t];\n\t\t\t\t*/\n\t\t\t\t/* EX: OUTPUT: bubbleChart Worksheet:\n\t\t\t\t\t-|----A-----|------B-----|------C-----|------D-----|------E-----|\n\t\t\t\t\t1| X-Values | Y-Values 1 | Y-Sizes 1 | Y-Values 2 | Y-Sizes 2 |\n\t\t\t\t\t2| 11 | 22 | 4 | 33 | 8 |\n\t\t\t\t\t-|----------|------------|------------|------------|------------|\n\t\t\t\t*/\n\t\t\t\tstrSheetXml += '<sheetData>'\n\n\t\t\t\t// A: Create header row first (NOTE: Start at index=1 as headers cols start with 'B')\n\t\t\t\tstrSheetXml += `<row r=\"1\" spans=\"1:${intBubbleCols}\">`\n\t\t\t\tstrSheetXml += '<c r=\"A1\" t=\"s\"><v>0</v></c>'\n\t\t\t\tfor (let idx = 1; idx < intBubbleCols; idx++) {\n\t\t\t\t\tstrSheetXml += `<c r=\"${getExcelColName(idx + 1)}1\" t=\"s\"><v>${idx}</v></c>` // NOTE: add `t=\"s\"` for label cols!\n\t\t\t\t}\n\t\t\t\tstrSheetXml += '</row>'\n\n\t\t\t\t// B: Add row for each X-Axis value (Y-Axis* value is optional)\n\t\t\t\tdata[0].values.forEach((val, idx) => {\n\t\t\t\t\t// Leading col is reserved for the 'X-Axis' value, so hard-code it, then loop over col values\n\t\t\t\t\tstrSheetXml += `<row r=\"${idx + 2}\" spans=\"1:${intBubbleCols}\">`\n\t\t\t\t\tstrSheetXml += `<c r=\"A${idx + 2}\"><v>${val}</v></c>`\n\t\t\t\t\t// Add Y-Axis 1->N (idy=0 = Xaxis)\n\t\t\t\t\tlet idxColLtr = 2\n\t\t\t\t\tfor (let idy = 1; idy < data.length; idy++) {\n\t\t\t\t\t\t// y-value\n\t\t\t\t\t\tstrSheetXml += `<c r=\"${getExcelColName(idxColLtr)}${idx + 2}\"><v>${data[idy].values[idx] ?? ''}</v></c>`\n\t\t\t\t\t\tidxColLtr++\n\t\t\t\t\t\t// y-size\n\t\t\t\t\t\tstrSheetXml += `<c r=\"${getExcelColName(idxColLtr)}${idx + 2}\"><v>${data[idy].sizes[idx] ?? ''}</v></c>`\n\t\t\t\t\t\tidxColLtr++\n\t\t\t\t\t}\n\t\t\t\t\tstrSheetXml += '</row>'\n\t\t\t\t})\n\t\t\t} else if (chartObject.opts._type === CHART_TYPE.SCATTER) {\n\t\t\t\t/* UNUSED:\n\t\t\t\t\tstrSheetXml += '<cols>'\n\t\t\t\t\tstrSheetXml += '<col min=\"1\" max=\"' + data.length + '\" width=\"11\" customWidth=\"1\" />'\n\t\t\t\t\t//data.forEach((obj,idx)=>{ strSheetXml += '<col min=\"'+(idx+1)+'\" max=\"'+(idx+1)+'\" width=\"11\" customWidth=\"1\" />' });\n\t\t\t\t\tstrSheetXml += '</cols>'\n\t\t\t\t*/\n\t\t\t\t/* EX: INPUT: `data`\n\t\t\t\t\t[\n\t\t\t\t\t\t{ name:'X-AxisA', values:[ 1, 2, 3, 4, 5] },\n\t\t\t\t\t\t{ name:'Y-AxisB', values:[ 2,22,42,52,62] },\n\t\t\t\t\t\t{ name:'Y-AxisC', values:[ 3,33,43,53,63] }\n\t\t\t\t\t];\n\t\t\t\t*/\n\t\t\t\t/* EX: OUTPUT: sheet1.xml:\n\t\t\t\t\t-|----A----|----B----|----C----|\n\t\t\t\t\t1| X-AxisA | Y-AxisB | Y-AxisC |\n\t\t\t\t\t2| 1 | 2 | 3 |\n\t\t\t\t\t-|---------|---------|---------|\n\t\t\t\t*/\n\t\t\t\tstrSheetXml += '<sheetData>'\n\n\t\t\t\t// A: Create header row first (every `name` row provided)\n\t\t\t\tstrSheetXml += `<row r=\"1\" spans=\"1:${data.length}\">`\n\t\t\t\tfor (let idx = 0; idx < data.length; idx++) {\n\t\t\t\t\tstrSheetXml += `<c r=\"${getExcelColName(idx + 1)}1\" t=\"s\"><v>${idx}</v></c>` // NOTE: add `t=\"s\"` for label cols!\n\t\t\t\t}\n\t\t\t\tstrSheetXml += '</row>'\n\n\t\t\t\t// B: Add row for each X-Axis value (Y-Axis* value is optional)\n\t\t\t\tdata[0].values.forEach((val, idx) => {\n\t\t\t\t\t// Leading col is reserved for the 'X-Axis' value, so hard-code it, then loop over col values\n\t\t\t\t\tstrSheetXml += `<row r=\"${idx + 2}\" spans=\"1:${data.length}\">`\n\t\t\t\t\tstrSheetXml += `<c r=\"A${idx + 2}\"><v>${val}</v></c>`\n\t\t\t\t\t// Add Y-Axis 1->N\n\t\t\t\t\tfor (let idy = 1; idy < data.length; idy++) {\n\t\t\t\t\t\tstrSheetXml += `<c r=\"${getExcelColName(idy + 1)}${idx + 2}\"><v>${data[idy].values[idx] || data[idy].values[idx] === 0 ? data[idy].values[idx] : ''\n\t\t\t\t\t\t}</v></c>`\n\t\t\t\t\t}\n\t\t\t\t\tstrSheetXml += '</row>'\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\t// strSheetXml += '<cols><col min=\"1\" max=\"1\" width=\"11\" customWidth=\"1\" /></cols>'\n\t\t\t\tstrSheetXml += '<sheetData>'\n\n\t\t\t\t/* EX: INPUT: `data`\n\t\t\t\t\t[\n\t\t\t\t\t\t{ name:'Red', labels:['Jan..May-17'], values:[11,13,14,15,16] },\n\t\t\t\t\t\t{ name:'Amb', labels:['Jan..May-17'], values:[22, 6, 7, 8, 9] },\n\t\t\t\t\t\t{ name:'Grn', labels:['Jan..May-17'], values:[33,32,42,53,63] }\n\t\t\t\t\t];\n\t\t\t\t*/\n\t\t\t\t/* EX: OUTPUT: lineChart Worksheet:\n\t\t\t\t\t-|---A---|--B--|--C--|--D--|\n\t\t\t\t\t1| | Red | Amb | Grn |\n\t\t\t\t\t2|Jan-17 | 11| 22| 33|\n\t\t\t\t\t3|Feb-17 | 55| 43| 70|\n\t\t\t\t\t4|Mar-17 | 56| 143| 99|\n\t\t\t\t\t5|Apr-17 | 65| 3| 120|\n\t\t\t\t\t6|May-17 | 75| 93| 170|\n\t\t\t\t\t-|-------|-----|-----|-----|\n\t\t\t\t*/\n\n\t\t\t\tif (!IS_MULTI_CAT_AXES) {\n\t\t\t\t\t// A: Create header row first\n\t\t\t\t\tstrSheetXml += `<row r=\"1\" spans=\"1:${data.length + data[0].labels.length}\">`\n\t\t\t\t\tdata[0].labels.forEach((_labelsGroup, idx) => {\n\t\t\t\t\t\tstrSheetXml += `<c r=\"${getExcelColName(idx + 1)}1\" t=\"s\"><v>0</v></c>`\n\t\t\t\t\t})\n\t\t\t\t\tfor (let idx = 0; idx < data.length; idx++) {\n\t\t\t\t\t\tstrSheetXml += `<c r=\"${getExcelColName(idx + 1 + data[0].labels.length)}1\" t=\"s\"><v>${idx + 1}</v></c>` // NOTE: use `t=\"s\"` for label cols!\n\t\t\t\t\t}\n\t\t\t\t\tstrSheetXml += '</row>'\n\n\t\t\t\t\t// B: Add data row(s) for each category\n\t\t\t\t\tdata[0].labels[0].forEach((_cat, idx) => {\n\t\t\t\t\t\tstrSheetXml += `<row r=\"${idx + 2}\" spans=\"1:${data.length + data[0].labels.length}\">`\n\t\t\t\t\t\t// Leading cols are reserved for the label groups\n\t\t\t\t\t\tfor (let idx2 = data[0].labels.length - 1; idx2 >= 0; idx2--) {\n\t\t\t\t\t\t\tstrSheetXml += `<c r=\"${getExcelColName(data[0].labels.length - idx2)}${idx + 2}\" t=\"s\">`\n\t\t\t\t\t\t\tstrSheetXml += `<v>${data.length + idx + 1}</v>`\n\t\t\t\t\t\t\tstrSheetXml += '</c>'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (let idy = 0; idy < data.length; idy++) {\n\t\t\t\t\t\t\tstrSheetXml += `<c r=\"${getExcelColName(data[0].labels.length + idy + 1)}${idx + 2}\"><v>${data[idy].values[idx] ?? ''}</v></c>`\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstrSheetXml += '</row>'\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tconst TOT_SER = data.length\n\t\t\t\t\tconst TOT_CAT = data[0].labels[0].length\n\t\t\t\t\tconst TOT_LVL = data[0].labels.length\n\t\t\t\t\t// labels[0] is the leaf (inner) level; labels[TOT_LVL-1] is the outermost.\n\t\t\t\t\t// Reversed so that the outermost group occupies column A and the leaf occupies column TOT_LVL.\n\t\t\t\t\tconst revLabelGroups = data[0].labels.slice().reverse()\n\n\t\t\t\t\t// Pre-build a map from (revLevelIdx, rowIdx) -> shared-string index.\n\t\t\t\t\t// SST layout: 0=blank, 1..TOT_SER=series names, then non-empty labels per\n\t\t\t\t\t// reversed level in appearance order.\n\t\t\t\t\tconst ssLabelMap = new Map<string, number>()\n\t\t\t\t\tlet ssIdx = TOT_SER + 1\n\t\t\t\t\trevLabelGroups.forEach((labelsGroup, revLevelIdx) => {\n\t\t\t\t\t\tlabelsGroup.forEach((label, rowIdx) => {\n\t\t\t\t\t\t\tif (label && label !== '') ssLabelMap.set(`${revLevelIdx}:${rowIdx}`, ssIdx++)\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\n\t\t\t\t\t// Header row: label columns blank (index 0), series name columns use indices 1..TOT_SER\n\t\t\t\t\tstrSheetXml += `<row r=\"1\" spans=\"1:${TOT_SER + TOT_LVL}\">`\n\t\t\t\t\tfor (let col = 1; col <= TOT_LVL; col++) {\n\t\t\t\t\t\tstrSheetXml += `<c r=\"${getExcelColName(col)}1\" t=\"s\"><v>0</v></c>`\n\t\t\t\t\t}\n\t\t\t\t\tfor (let ser = 0; ser < TOT_SER; ser++) {\n\t\t\t\t\t\tstrSheetXml += `<c r=\"${getExcelColName(TOT_LVL + ser + 1)}1\" t=\"s\"><v>${ser + 1}</v></c>`\n\t\t\t\t\t}\n\t\t\t\t\tstrSheetXml += '</row>'\n\n\t\t\t\t\t// One data row per leaf category\n\t\t\t\t\tfor (let idx = 0; idx < TOT_CAT; idx++) {\n\t\t\t\t\t\tstrSheetXml += `<row r=\"${idx + 2}\" spans=\"1:${TOT_SER + TOT_LVL}\">`\n\t\t\t\t\t\t// Label columns: column idy+1 holds revLabelGroups[idy]; emit only non-empty cells\n\t\t\t\t\t\trevLabelGroups.forEach((labelsGroup, idy) => {\n\t\t\t\t\t\t\tconst colLabel = labelsGroup[idx]\n\t\t\t\t\t\t\tif (colLabel && colLabel !== '') {\n\t\t\t\t\t\t\t\tstrSheetXml += `<c r=\"${getExcelColName(idy + 1)}${idx + 2}\" t=\"s\"><v>${ssLabelMap.get(`${idy}:${idx}`)}</v></c>`\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t// Data columns\n\t\t\t\t\t\tfor (let idy = 0; idy < TOT_SER; idy++) {\n\t\t\t\t\t\t\tstrSheetXml += `<c r=\"${getExcelColName(TOT_LVL + idy + 1)}${idx + 2}\"><v>${data[idy].values[idx] ?? ''}</v></c>`\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstrSheetXml += '</row>'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tstrSheetXml += '</sheetData>'\n\n\t\t\t/* FIXME: support multi-level\n if (IS_MULTI_CAT_AXES) {\n\t\t\t\tstrSheetXml += '<mergeCells count=\"3\">'\n\t\t\t\tstrSheetXml += ' <mergeCell ref=\"A2:A4\"/>'\n\t\t\t\tstrSheetXml += ' <mergeCell ref=\"A10:A12\"/>'\n\t\t\t\tstrSheetXml += ' <mergeCell ref=\"A5:A9\"/>'\n\t\t\t\tstrSheetXml += '</mergeCells>'\n }\n */\n\n\t\t\tstrSheetXml += '<pageMargins left=\"0.7\" right=\"0.7\" top=\"0.75\" bottom=\"0.75\" header=\"0.3\" footer=\"0.3\"/>'\n\t\t\t// Link the `table1.xml` file to define an actual Table in Excel\n\t\t\t// NOTE: This only works with scatter charts - all others give a \"cannot find linked file\" error\n\t\t\t// ....: Since we dont need the table anyway (chart data can be edited/range selected, etc.), just dont use this\n\t\t\t// ....: Leaving this so nobody foolishly attempts to add this in the future\n\t\t\t// strSheetXml += '<tableParts count=\"1\"><tablePart r:id=\"rId1\"/></tableParts>'\n\t\t\tstrSheetXml += '</worksheet>\\n'\n\t\t\tzipExcel.file('xl/worksheets/sheet1.xml', strSheetXml)\n\t\t}\n\n\t\t// C: Add XLSX to PPTX export\n\t\tzipExcel\n\t\t\t.generateAsync({ type: 'base64' })\n\t\t\t.then(content => {\n\t\t\t\t// 1: Create the embedded Excel worksheet with labels and data\n\t\t\t\tzip.file(`ppt/embeddings/Microsoft_Excel_Worksheet${chartObject.globalId}.xlsx`, content, { base64: true })\n\n\t\t\t\t// 2: Create the chart.xml and rel files\n\t\t\t\tzip.file(\n\t\t\t\t\t'ppt/charts/_rels/' + chartObject.fileName + '.rels',\n\t\t\t\t\t'<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>' +\n\t\t\t\t\t'<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">' +\n\t\t\t\t\t`<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package\" Target=\"../embeddings/Microsoft_Excel_Worksheet${chartObject.globalId}.xlsx\"/>` +\n\t\t\t\t\t'</Relationships>'\n\t\t\t\t)\n\t\t\t\tzip.file(`ppt/charts/${chartObject.fileName}`, makeXmlCharts(chartObject))\n\n\t\t\t\t// 3: Done\n\t\t\t\tresolve('')\n\t\t\t})\n\t\t\t.catch(strErr => {\n\t\t\t\treject(strErr)\n\t\t\t})\n\t})\n}\n\n/**\n * Emit the `<a:latin>/<a:ea>/<a:cs>` font trio for a chart text run.\n *\n * In DrawingML run properties a typeface applies only to the script class of\n * its element: `<a:latin>` covers Latin/ASCII, `<a:ea>` covers East Asian, and\n * `<a:cs>` covers complex scripts. Emitting `<a:latin>` alone leaves East Asian\n * (e.g. Chinese) and complex-script glyphs falling back to the theme font, so a\n * user-specified font never takes effect for that text — most visibly on\n * PowerPoint for Mac. Stamping the same typeface onto all three classes is what\n * choosing a font in PowerPoint's UI does (upstream gitbrent/PptxGenJS#1420).\n * @param {string} typeface - font face name\n * @return {string} `<a:latin/><a:ea/><a:cs/>` XML\n */\nfunction createChartTextFonts (typeface: string): string {\n\treturn `<a:latin typeface=\"${typeface}\"/><a:ea typeface=\"${typeface}\"/><a:cs typeface=\"${typeface}\"/>`\n}\n\n/**\n * Main entry point method for create charts\n * @see: http://www.datypic.com/sc/ooxml/s-dml-chart.xsd.html\n * @param {ISlideRelChart} rel - chart object\n * @return {string} XML\n */\nexport function makeXmlCharts (rel: ISlideRelChart): string {\n\tlet strXml = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>'\n\tlet usesSecondaryValAxis = false\n\tlet usesSecondaryCatAxis = false\n\t// Combo charts: a scatter/bubble subchart draws numbers on its category (X)\n\t// axis, so that axis must be emitted as a `<c:valAx>` rather than a `<c:catAx>`\n\t// or PowerPoint flags the file for repair (#1355). Track, per category axis,\n\t// the scatter/bubble subchart type that owns it (if any) and whether a\n\t// category-based subchart also references it (an unsatisfiable conflict).\n\tlet primaryCatAxisValType: CHART_NAME | null = null\n\tlet secondaryCatAxisValType: CHART_NAME | null = null\n\tlet primaryCatAxisHasCategoryChart = false\n\tlet secondaryCatAxisHasCategoryChart = false\n\n\t// STEP 1: Create chart\n\t{\n\t\t// CHARTSPACE: BEGIN vvv\n\t\tstrXml +=\n\t\t\t'<c:chartSpace xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">'\n\t\tstrXml += '<c:date1904 val=\"0\"/>' // ppt defaults to 1904 dates, excel to 1900\n\t\tstrXml += `<c:roundedCorners val=\"${rel.opts.chartArea.roundedCorners ? '1' : '0'}\"/>`\n\t\tstrXml += '<c:chart>'\n\n\t\t// OPTION: Title\n\t\tif (rel.opts.showTitle) {\n\t\t\tstrXml += genXmlTitle(\n\t\t\t\t{\n\t\t\t\t\ttitle: rel.opts.title || 'Chart Title',\n\t\t\t\t\tcolor: rel.opts.titleColor,\n\t\t\t\t\tfontFace: rel.opts.titleFontFace,\n\t\t\t\t\tfontSize: rel.opts.titleFontSize || DEF_FONT_TITLE_SIZE,\n\t\t\t\t\ttitleAlign: rel.opts.titleAlign,\n\t\t\t\t\ttitleBold: rel.opts.titleBold,\n\t\t\t\t\ttitleItalic: rel.opts.titleItalic,\n\t\t\t\t\ttitleUnderline: rel.opts.titleUnderline,\n\t\t\t\t\ttitlePos: rel.opts.titlePos,\n\t\t\t\t\ttitleRotate: rel.opts.titleRotate,\n\t\t\t\t},\n\t\t\t\trel.opts.x as number,\n\t\t\t\trel.opts.y as number\n\t\t\t)\n\t\t\tstrXml += '<c:autoTitleDeleted val=\"0\"/>'\n\t\t} else {\n\t\t\t// NOTE: Add autoTitleDeleted tag in else to prevent default creation of chart title even when showTitle is set to false\n\t\t\tstrXml += '<c:autoTitleDeleted val=\"1\"/>'\n\t\t}\n\t\t/** Add 3D view tag\n * @see: https://c-rex.net/projects/samples/ooxml/e1/Part4/OOXML_P4_DOCX_perspective_topic_ID0E6BUQB.html\n */\n\t\tif (rel.opts._type === CHART_TYPE.BAR3D) {\n\t\t\tstrXml += `<c:view3D><c:rotX val=\"${rel.opts.v3DRotX}\"/><c:rotY val=\"${rel.opts.v3DRotY}\"/><c:rAngAx val=\"${!rel.opts.v3DRAngAx ? 0 : 1}\"/><c:perspective val=\"${rel.opts.v3DPerspective}\"/></c:view3D>`\n\t\t}\n\n\t\tstrXml += '<c:plotArea>'\n\t\t// IMPORTANT: Dont specify layout to enable auto-fit: PPT does a great job maximizing space with all 4 TRBL locations\n\t\tif (rel.opts.layout) {\n\t\t\tstrXml += '<c:layout>'\n\t\t\tstrXml += ' <c:manualLayout>'\n\t\t\tstrXml += ' <c:layoutTarget val=\"inner\" />'\n\t\t\tstrXml += ' <c:xMode val=\"edge\" />'\n\t\t\tstrXml += ' <c:yMode val=\"edge\" />'\n\t\t\tstrXml += ' <c:x val=\"' + (rel.opts.layout.x || 0) + '\" />'\n\t\t\tstrXml += ' <c:y val=\"' + (rel.opts.layout.y || 0) + '\" />'\n\t\t\tstrXml += ' <c:w val=\"' + (rel.opts.layout.w || 1) + '\" />'\n\t\t\tstrXml += ' <c:h val=\"' + (rel.opts.layout.h || 1) + '\" />'\n\t\t\tstrXml += ' </c:manualLayout>'\n\t\t\tstrXml += '</c:layout>'\n\t\t} else {\n\t\t\tstrXml += '<c:layout/>'\n\t\t}\n\t}\n\n\t// A: Create Chart XML -----------------------------------------------------------\n\tif (Array.isArray(rel.opts._type)) {\n\t\trel.opts._type.forEach(type => {\n\t\t\t// TODO: FIXME: theres `options` on chart rels??\n\t\t\tconst options = { ...rel.opts, ...type.options }\n\t\t\t// let options: IChartOptsLib = { type: type.type, }\n\t\t\tconst valAxisId = options.secondaryValAxis ? AXIS_ID_VALUE_SECONDARY : AXIS_ID_VALUE_PRIMARY\n\t\t\tconst catAxisId = options.secondaryCatAxis ? AXIS_ID_CATEGORY_SECONDARY : AXIS_ID_CATEGORY_PRIMARY\n\t\t\tusesSecondaryValAxis = usesSecondaryValAxis || options.secondaryValAxis\n\t\t\tusesSecondaryCatAxis = usesSecondaryCatAxis || options.secondaryCatAxis\n\t\t\t// Record whether this subchart needs a value-based X axis (scatter/bubble)\n\t\t\t// or a category-based X axis, keyed to the primary/secondary cat axis it uses.\n\t\t\tconst usesValueXAxis = type.type === CHART_TYPE.SCATTER || type.type === CHART_TYPE.BUBBLE || type.type === CHART_TYPE.BUBBLE3D\n\t\t\tif (options.secondaryCatAxis) {\n\t\t\t\tif (usesValueXAxis) secondaryCatAxisValType = type.type\n\t\t\t\telse secondaryCatAxisHasCategoryChart = true\n\t\t\t} else {\n\t\t\t\tif (usesValueXAxis) primaryCatAxisValType = type.type\n\t\t\t\telse primaryCatAxisHasCategoryChart = true\n\t\t\t}\n\t\t\tstrXml += makeChartType(type.type, type.data as IOptsChartData[], options, valAxisId, catAxisId)\n\t\t})\n\t} else {\n\t\tstrXml += makeChartType(rel.opts._type, rel.data, rel.opts, AXIS_ID_VALUE_PRIMARY, AXIS_ID_CATEGORY_PRIMARY)\n\t}\n\n\t// B: Axes -----------------------------------------------------------\n\tif (rel.opts._type !== CHART_TYPE.PIE && rel.opts._type !== CHART_TYPE.DOUGHNUT) {\n\t\t// Param check\n\t\tif (rel.opts.valAxes && rel.opts.valAxes.length > 1 && !usesSecondaryValAxis) {\n\t\t\tthrow new Error('Secondary axis must be used by one of the multiple charts')\n\t\t}\n\n\t\t// Resolve the effective `_type` for a combo category axis so scatter/bubble\n\t\t// subcharts get a `<c:valAx>` X axis. Returns the scatter/bubble type when\n\t\t// that axis is owned only by such a subchart, else null (category axis).\n\t\tconst comboCatAxisType = (isSecondary: boolean): { _type: CHART_NAME } | Record<string, never> => {\n\t\t\tconst valType = isSecondary ? secondaryCatAxisValType : primaryCatAxisValType\n\t\t\tconst hasCategoryChart = isSecondary ? secondaryCatAxisHasCategoryChart : primaryCatAxisHasCategoryChart\n\t\t\tif (!valType) return {}\n\t\t\tif (hasCategoryChart) {\n\t\t\t\t// A category-based chart and a scatter/bubble chart cannot share one\n\t\t\t\t// axis (one needs <c:catAx>, the other <c:valAx>). Keep the category\n\t\t\t\t// axis and warn rather than silently emit a repair-triggering file.\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`A category-based chart and a scatter/bubble chart cannot share the same ${isSecondary ? 'secondary' : 'primary'} category axis; emitting a category axis. Put the scatter/bubble series on a separate axis.`\n\t\t\t\t)\n\t\t\t\treturn {}\n\t\t\t}\n\t\t\treturn { _type: valType }\n\t\t}\n\n\t\tif (rel.opts.catAxes) {\n\t\t\tif (!rel.opts.valAxes || rel.opts.valAxes.length !== rel.opts.catAxes.length) {\n\t\t\t\tthrow new Error('There must be the same number of value and category axes.')\n\t\t\t}\n\t\t\tstrXml += makeCatAxis({ ...rel.opts, ...rel.opts.catAxes[0], ...comboCatAxisType(false) }, AXIS_ID_CATEGORY_PRIMARY, AXIS_ID_VALUE_PRIMARY)\n\t\t} else {\n\t\t\tstrXml += makeCatAxis({ ...rel.opts, ...comboCatAxisType(false) }, AXIS_ID_CATEGORY_PRIMARY, AXIS_ID_VALUE_PRIMARY)\n\t\t}\n\n\t\tif (rel.opts.valAxes) {\n\t\t\tstrXml += makeValAxis({ ...rel.opts, ...rel.opts.valAxes[0] }, AXIS_ID_VALUE_PRIMARY)\n\t\t\tif (rel.opts.valAxes[1]) {\n\t\t\t\tstrXml += makeValAxis({ ...rel.opts, ...rel.opts.valAxes[1] }, AXIS_ID_VALUE_SECONDARY)\n\t\t\t}\n\t\t} else {\n\t\t\tstrXml += makeValAxis(rel.opts, AXIS_ID_VALUE_PRIMARY)\n\n\t\t\t// Add series axis for 3D bar\n\t\t\tif (rel.opts._type === CHART_TYPE.BAR3D) {\n\t\t\t\tstrXml += makeSerAxis(rel.opts, AXIS_ID_SERIES_PRIMARY, AXIS_ID_VALUE_PRIMARY)\n\t\t\t}\n\n\t\t\t// For combo charts referencing a secondary value axis via the\n\t\t\t// `secondaryValAxis: true` flag (without a `valAxes` array),\n\t\t\t// auto-synthesise the missing secondary value axis def so that\n\t\t\t// the axId references in <c:plotArea> all resolve.\n\t\t\tif (usesSecondaryValAxis) {\n\t\t\t\tstrXml += makeValAxis(rel.opts, AXIS_ID_VALUE_SECONDARY)\n\t\t\t}\n\t\t}\n\n\t\t// Combo Charts: Add secondary axes after all vals\n\t\tif (rel.opts?.catAxes && rel.opts?.catAxes[1]) {\n\t\t\tstrXml += makeCatAxis({ ...rel.opts, ...rel.opts.catAxes[1], ...comboCatAxisType(true) }, AXIS_ID_CATEGORY_SECONDARY, AXIS_ID_VALUE_SECONDARY)\n\t\t} else if (usesSecondaryCatAxis && (!rel.opts.catAxes || !rel.opts.catAxes[1])) {\n\t\t\t// Same as above for the secondary category axis.\n\t\t\tstrXml += makeCatAxis({ ...rel.opts, ...comboCatAxisType(true) }, AXIS_ID_CATEGORY_SECONDARY, AXIS_ID_VALUE_SECONDARY)\n\t\t}\n\t}\n\n\t// C: Chart Properties and plotArea Options: Border, Data Table, Fill, Legend\n\t{\n\t\t// NOTE: DataTable goes between '</c:valAx>' and '<c:spPr>'\n\t\tif (rel.opts.showDataTable) {\n\t\t\tstrXml += '<c:dTable>'\n\t\t\tstrXml += ` <c:showHorzBorder val=\"${!rel.opts.showDataTableHorzBorder ? 0 : 1}\"/>`\n\t\t\tstrXml += ` <c:showVertBorder val=\"${!rel.opts.showDataTableVertBorder ? 0 : 1}\"/>`\n\t\t\tstrXml += ` <c:showOutline val=\"${!rel.opts.showDataTableOutline ? 0 : 1}\"/>`\n\t\t\tstrXml += ` <c:showKeys val=\"${!rel.opts.showDataTableKeys ? 0 : 1}\"/>`\n\t\t\tstrXml += ' <c:spPr>'\n\t\t\tstrXml += ' <a:noFill/>'\n\t\t\tstrXml += ' <a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"tx1\"><a:lumMod val=\"15000\"/><a:lumOff val=\"85000\"/></a:schemeClr></a:solidFill><a:round/></a:ln>'\n\t\t\tstrXml += ' <a:effectLst/>'\n\t\t\tstrXml += ' </c:spPr>'\n\t\t\tstrXml += ' <c:txPr>'\n\t\t\tstrXml += ' <a:bodyPr rot=\"0\" spcFirstLastPara=\"1\" vertOverflow=\"ellipsis\" vert=\"horz\" wrap=\"square\" anchor=\"ctr\" anchorCtr=\"1\"/>'\n\t\t\tstrXml += ' <a:lstStyle/>'\n\t\t\tstrXml += ' <a:p>'\n\t\t\tstrXml += ' <a:pPr rtl=\"0\">'\n\t\t\tstrXml += ` <a:defRPr sz=\"${Math.round((rel.opts.dataTableFontSize || DEF_FONT_SIZE) * 100)}\" b=\"0\" i=\"0\" u=\"none\" strike=\"noStrike\" kern=\"1200\" baseline=\"0\">`\n\t\t\tstrXml += ' <a:solidFill><a:schemeClr val=\"tx1\"><a:lumMod val=\"65000\"/><a:lumOff val=\"35000\"/></a:schemeClr></a:solidFill>'\n\t\t\tstrXml += ' <a:latin typeface=\"+mn-lt\"/>'\n\t\t\tstrXml += ' <a:ea typeface=\"+mn-ea\"/>'\n\t\t\tstrXml += ' <a:cs typeface=\"+mn-cs\"/>'\n\t\t\tstrXml += ' </a:defRPr>'\n\t\t\tstrXml += ' </a:pPr>'\n\t\t\tstrXml += ' <a:endParaRPr lang=\"en-US\"/>'\n\t\t\tstrXml += ' </a:p>'\n\t\t\tstrXml += ' </c:txPr>'\n\t\t\tstrXml += '</c:dTable>'\n\t\t}\n\n\t\tstrXml += ' <c:spPr>'\n\n\t\t// OPTION: Fill\n\t\tstrXml += rel.opts.plotArea.fill?.color ? genXmlColorSelection(rel.opts.plotArea.fill) : '<a:noFill/>'\n\n\t\t// OPTION: Border\n\t\tstrXml += rel.opts.plotArea.border\n\t\t\t? `<a:ln w=\"${valToPts(rel.opts.plotArea.border.pt)}\" cap=\"flat\">${genXmlColorSelection(rel.opts.plotArea.border.color)}</a:ln>`\n\t\t\t: '<a:ln><a:noFill/></a:ln>'\n\n\t\t// Close shapeProp/plotArea before Legend\n\t\tstrXml += ' <a:effectLst/>'\n\t\tstrXml += ' </c:spPr>'\n\t\tstrXml += '</c:plotArea>'\n\n\t\t// OPTION: Legend\n\t\t// IMPORTANT: Dont specify layout to enable auto-fit: PPT does a great job maximizing space with all 4 TRBL locations\n\t\tif (rel.opts.showLegend) {\n\t\t\tstrXml += '<c:legend>'\n\t\t\tstrXml += '<c:legendPos val=\"' + rel.opts.legendPos + '\"/>'\n\t\t\t// For combo charts: suppress series from subcharts that set showLegend: false\n\t\t\tif (Array.isArray(rel.opts._type)) {\n\t\t\t\tlet seriesIdx = 0\n\t\t\t\trel.opts._type.forEach(type => {\n\t\t\t\t\tif (type.options?.showLegend === false) {\n\t\t\t\t\t\tfor (let i = 0; i < type.data.length; i++) {\n\t\t\t\t\t\t\tstrXml += `<c:legendEntry><c:idx val=\"${seriesIdx + i}\"/><c:delete val=\"1\"/></c:legendEntry>`\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tseriesIdx += type.data.length\n\t\t\t\t})\n\t\t\t}\n\t\t\t// strXml += '<c:layout/>'\n\t\t\tstrXml += '<c:overlay val=\"0\"/>'\n\t\t\tif (rel.opts.legendFontFace || rel.opts.legendFontSize || rel.opts.legendColor) {\n\t\t\t\tstrXml += '<c:txPr>'\n\t\t\t\tstrXml += ' <a:bodyPr/>'\n\t\t\t\tstrXml += ' <a:lstStyle/>'\n\t\t\t\tstrXml += ' <a:p>'\n\t\t\t\tstrXml += ' <a:pPr>'\n\t\t\t\tstrXml += rel.opts.legendFontSize ? `<a:defRPr sz=\"${Math.round(Number(rel.opts.legendFontSize) * 100)}\">` : '<a:defRPr>'\n\t\t\t\tif (rel.opts.legendColor) strXml += genXmlColorSelection(rel.opts.legendColor)\n\t\t\t\tif (rel.opts.legendFontFace) strXml += createChartTextFonts(rel.opts.legendFontFace)\n\t\t\t\tstrXml += ' </a:defRPr>'\n\t\t\t\tstrXml += ' </a:pPr>'\n\t\t\t\tstrXml += ' <a:endParaRPr lang=\"en-US\"/>'\n\t\t\t\tstrXml += ' </a:p>'\n\t\t\t\tstrXml += '</c:txPr>'\n\t\t\t}\n\t\t\tstrXml += '</c:legend>'\n\t\t}\n\t}\n\n\tstrXml += ' <c:plotVisOnly val=\"1\"/>'\n\tstrXml += ' <c:dispBlanksAs val=\"' + rel.opts.displayBlanksAs + '\"/>'\n\tif (rel.opts._type === CHART_TYPE.SCATTER) strXml += '<c:showDLblsOverMax val=\"1\"/>'\n\n\tstrXml += '</c:chart>'\n\n\t// D: CHARTSPACE SHAPE PROPS\n\tstrXml += '<c:spPr>'\n\tstrXml += rel.opts.chartArea.fill?.color ? genXmlColorSelection(rel.opts.chartArea.fill) : '<a:noFill/>'\n\tstrXml += rel.opts.chartArea.border\n\t\t? `<a:ln w=\"${valToPts(rel.opts.chartArea.border.pt)}\" cap=\"flat\">${genXmlColorSelection(rel.opts.chartArea.border.color)}</a:ln>`\n\t\t: '<a:ln><a:noFill/></a:ln>'\n\tstrXml += ' <a:effectLst/>'\n\tstrXml += '</c:spPr>'\n\n\t// E: DATA (Add relID)\n\tstrXml += '<c:externalData r:id=\"rId1\"><c:autoUpdate val=\"0\"/></c:externalData>'\n\n\t// LAST: chartSpace end\n\tstrXml += '</c:chartSpace>'\n\n\treturn strXml\n}\n\n/**\n * Create XML string for any given chart type\n * @param {CHART_NAME} chartType chart type name\n * @param {IOptsChartData[]} data chart data\n * @param {IChartOptsLib} opts chart options\n * @param {string} valAxisId chart val axis id\n * @param {string} catAxisId chart cat axis id\n * @example 'bubble' returns <c:bubbleChart></c>\n * @example '<c:lineChart>'\n * @return {string} XML chart\n */\nfunction makeChartType (chartType: CHART_NAME, data: IOptsChartData[], opts: IChartOptsLib, valAxisId: string, catAxisId: string): string {\n\t// NOTE: \"Chart Range\" (as shown in \"select Chart Area dialog\") is calculated.\n\t// ....: Ensure each X/Y Axis/Col has same row height (esp. applicable to XY Scatter where X can often be larger than Y's)\n\tlet colorIndex = -1 // Maintain the color index by region\n\tlet idxColLtr = 1\n\tlet optsChartData: IOptsChartData\n\tlet strXml = ''\n\n\t// PowerPoint and Google Slides render values using the cached *source* number format carried in\n\t// each series' `<c:numCache><c:formatCode>` (mirroring the embedded workbook cell format), NOT the\n\t// `<c:dLbls><c:numFmt>` mask — so when the value cache is left as \"General\" those engines display\n\t// raw values (e.g. `0.1` instead of `10%`) even though LibreOffice honors the dLbls mask. Resolve a\n\t// single effective value format and stamp it onto every value cache below so all three engines agree.\n\t// See upstream gitbrent/PptxGenJS#1309. Precedence keeps the historical `valLabelFormatCode` winner,\n\t// then the data-table format, and finally falls back to `dataLabelFormatCode` (the most common knob).\n\tconst valFmtCode = encodeXmlEntities(opts.valLabelFormatCode || opts.dataTableFormatCode || opts.dataLabelFormatCode || 'General')\n\n\tswitch (chartType) {\n\t\tcase CHART_TYPE.AREA:\n\t\tcase CHART_TYPE.BAR:\n\t\tcase CHART_TYPE.BAR3D:\n\t\tcase CHART_TYPE.LINE:\n\t\tcase CHART_TYPE.RADAR:\n\t\t\t// 1: Start Chart\n\t\t\tstrXml += `<c:${chartType}Chart>`\n\t\t\tif (chartType === CHART_TYPE.AREA || chartType === CHART_TYPE.LINE) {\n\t\t\t\tconst lineGrouping = opts.barGrouping === 'stacked' || opts.barGrouping === 'percentStacked' ? opts.barGrouping : 'standard'\n\t\t\t\tstrXml += '<c:grouping val=\"' + lineGrouping + '\"/>'\n\t\t\t}\n\n\t\t\tif (chartType === CHART_TYPE.BAR || chartType === CHART_TYPE.BAR3D) {\n\t\t\t\tstrXml += '<c:barDir val=\"' + opts.barDir + '\"/>'\n\t\t\t\tstrXml += '<c:grouping val=\"' + (opts.barGrouping || 'clustered') + '\"/>'\n\t\t\t}\n\n\t\t\tif (chartType === CHART_TYPE.RADAR) {\n\t\t\t\tstrXml += '<c:radarStyle val=\"' + opts.radarStyle + '\"/>'\n\t\t\t}\n\n\t\t\tstrXml += '<c:varyColors val=\"0\"/>'\n\n\t\t\t// 2: \"Series\" block for every data row\n\t\t\t/* EX1:\n\t\t\t\tdata: [\n\t\t\t\t {\n\t\t\t\t name: 'Region 1',\n\t\t\t\t labels: [['April', 'May', 'June', 'July']],\n\t\t\t\t values: [17, 26, 53, 96]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t name: 'Region 2',\n\t\t\t\t labels: [['April', 'May', 'June', 'July']],\n\t\t\t\t values: [55, 43, 70, 58]\n\t\t\t\t }\n\t\t\t\t]\n */\n\t\t\t/* EX2:\n\t\t\t\tdata: [\n\t\t\t\t {\n\t\t\t\t name: 'Region 1',\n\t\t\t\t labels: [\n\t\t\t\t\t ['April', 'May', 'June', 'April', 'May', 'June'],\n\t\t\t\t\t ['2020', '', '', '2021', '', '']\n\t\t\t\t ],\n\t\t\t\t values: [17, 26, 53, 96, 40, 33]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t name: 'Region 2',\n\t\t\t\t labels: [\n\t\t\t\t\t ['April', 'May', 'June', 'April', 'May', 'June'],\n\t\t\t\t\t ['2020', '', '', '2021', '', '']\n\t\t\t\t ],\n\t\t\t\t values: [55, 43, 70, 58, 78, 63]\n\t\t\t\t }\n\t\t\t\t]\n */\n\t\t\tdata.forEach(obj => {\n\t\t\t\tcolorIndex++\n\t\t\t\tstrXml += '<c:ser>'\n\t\t\t\tstrXml += ` <c:idx val=\"${obj._dataIndex}\"/><c:order val=\"${obj._dataIndex}\"/>`\n\t\t\t\tstrXml += ' <c:tx>'\n\t\t\t\tstrXml += ' <c:strRef>'\n\t\t\t\tstrXml += ' <c:f>Sheet1!$' + getExcelColName(obj._dataIndex + obj.labels.length + 1) + '$1</c:f>'\n\t\t\t\tstrXml += ' <c:strCache><c:ptCount val=\"1\"/><c:pt idx=\"0\"><c:v>' + encodeXmlEntities(obj.name) + '</c:v></c:pt></c:strCache>'\n\t\t\t\tstrXml += ' </c:strRef>'\n\t\t\t\tstrXml += ' </c:tx>'\n\n\t\t\t\t// Fill and Border\n\t\t\t\tconst seriesOverride = opts.seriesOptions?.[obj._dataIndex]\n\t\t\t\tconst seriesColor = seriesOverride?.color ?? (opts.chartColors ? opts.chartColors[colorIndex % opts.chartColors.length] : null)\n\n\t\t\t\tstrXml += ' <c:spPr>'\n\t\t\t\tif (seriesColor === 'transparent') {\n\t\t\t\t\tstrXml += '<a:noFill/>'\n\t\t\t\t} else if (opts.chartColorsOpacity) {\n\t\t\t\t\tstrXml += '<a:solidFill>' + createColorElement(seriesColor, `<a:alpha val=\"${Math.round(opts.chartColorsOpacity * 1000)}\"/>`) + '</a:solidFill>'\n\t\t\t\t} else {\n\t\t\t\t\tstrXml += '<a:solidFill>' + createColorElement(seriesColor) + '</a:solidFill>'\n\t\t\t\t}\n\n\t\t\t\tif (chartType === CHART_TYPE.LINE || chartType === CHART_TYPE.RADAR) {\n\t\t\t\t\tconst effectiveLineSize = seriesOverride?.lineSize ?? opts.lineSize\n\t\t\t\t\tif (effectiveLineSize === 0) {\n\t\t\t\t\t\tstrXml += '<a:ln><a:noFill/></a:ln>'\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstrXml += `<a:ln w=\"${valToPts(effectiveLineSize)}\" cap=\"${createLineCap(opts.lineCap)}\"><a:solidFill>${createColorElement(seriesColor)}</a:solidFill>`\n\t\t\t\t\t\tstrXml += `<a:prstDash val=\"${opts.lineDashValues?.[colorIndex] ?? opts.lineDash ?? 'solid'}\"/><a:round/></a:ln>`\n\t\t\t\t\t}\n\t\t\t\t} else if (opts.dataBorder) {\n\t\t\t\t\tstrXml += `<a:ln w=\"${valToPts(opts.dataBorder.pt)}\" cap=\"${createLineCap(opts.lineCap)}\"><a:solidFill>${createColorElement(opts.dataBorder.color)}</a:solidFill><a:prstDash val=\"solid\"/><a:round/></a:ln>`\n\t\t\t\t}\n\n\t\t\t\tstrXml += createShadowElement(opts.shadow, DEF_SHAPE_SHADOW)\n\n\t\t\t\tstrXml += ' </c:spPr>'\n\t\t\t\t// `invertIfNegative` is bar-only in the schema (CT_BarSer); area/line/radar series must omit it\n\t\t\t\tif (chartType === CHART_TYPE.BAR || chartType === CHART_TYPE.BAR3D) strXml += ' <c:invertIfNegative val=\"0\"/>'\n\n\t\t\t\t// 'c:marker' must precede 'c:dLbls' in CT_LineSer (schema order: spPr → marker → dPt → dLbls)\n\t\t\t\tif (chartType === CHART_TYPE.LINE || chartType === CHART_TYPE.RADAR) {\n\t\t\t\t\tstrXml += '<c:marker>'\n\t\t\t\t\tstrXml += ' <c:symbol val=\"' + opts.lineDataSymbol + '\"/>'\n\t\t\t\t\tif (opts.lineDataSymbolSize) strXml += `<c:size val=\"${opts.lineDataSymbolSize}\"/>` // Defaults to \"auto\" otherwise (but this is usually too small, so there is a default)\n\t\t\t\t\tstrXml += ' <c:spPr>'\n\t\t\t\t\t{\n\t\t\t\t\t\tconst markerColor = opts.chartColors[obj._dataIndex + 1 > opts.chartColors.length ? Math.floor(Math.random() * opts.chartColors.length) : obj._dataIndex]\n\t\t\t\t\t\tstrXml += markerColor === 'transparent' ? '<a:noFill/>' : `<a:solidFill>${createColorElement(markerColor)}</a:solidFill>`\n\t\t\t\t\t}\n\t\t\t\t\tstrXml += ` <a:ln w=\"${opts.lineDataSymbolLineSize}\" cap=\"flat\"><a:solidFill>${createColorElement(opts.lineDataSymbolLineColor || seriesColor)}</a:solidFill><a:prstDash val=\"solid\"/><a:round/></a:ln>`\n\t\t\t\t\tstrXml += ' <a:effectLst/>'\n\t\t\t\t\tstrXml += ' </c:spPr>'\n\t\t\t\t\tstrXml += '</c:marker>'\n\t\t\t\t}\n\n\t\t\t\t// Per-point data points (`c:dPt`) MUST precede `c:dLbls` in CT_*Ser schema order.\n\t\t\t\t// Covers legacy single-series bar color-vary AND per-point `pointStyles` overrides.\n\t\t\t\t{\n\t\t\t\t\tconst barVaryColors =\n\t\t\t\t\t\t(chartType === CHART_TYPE.BAR || chartType === CHART_TYPE.BAR3D) &&\n\t\t\t\t\t\tdata.length === 1 &&\n\t\t\t\t\t\t((opts.chartColors && opts.chartColors !== BARCHART_COLORS && opts.chartColors.length > 1) || opts.invertedColors?.length)\n\t\t\t\t\t\t\t? opts.chartColors || BARCHART_COLORS\n\t\t\t\t\t\t\t: null\n\t\t\t\t\tstrXml += makeSeriesDataPointsXml(chartType, obj, opts, barVaryColors)\n\t\t\t\t}\n\n\t\t\t\t// Data Labels per series\n\t\t\t\t// NOTE: [20190117] Adding these to RADAR chart causes unrecoverable corruption!\n\t\t\t\tif (chartType !== CHART_TYPE.RADAR) {\n\t\t\t\t\tconst lblColor = seriesOverride?.dataLabelColor ?? opts.dataLabelColor ?? DEF_FONT_COLOR\n\t\t\t\t\tconst lblBold = seriesOverride?.dataLabelFontBold ?? opts.dataLabelFontBold ?? false\n\t\t\t\t\tconst lblItalic = seriesOverride?.dataLabelFontItalic ?? opts.dataLabelFontItalic ?? false\n\t\t\t\t\tconst lblSize = seriesOverride?.dataLabelFontSize ?? opts.dataLabelFontSize ?? DEF_FONT_SIZE\n\t\t\t\t\tconst lblFace = seriesOverride?.dataLabelFontFace ?? opts.dataLabelFontFace ?? 'Arial'\n\t\t\t\t\tstrXml += '<c:dLbls>'\n\t\t\t\t\t// Per-point custom labels must precede aggregate settings (CT_DLbls schema order: dLbl* then Group_DLbls)\n\t\t\t\t\tif (obj.customLabels?.length) {\n\t\t\t\t\t\tobj.customLabels.forEach((lbl, idx) => { if (lbl) strXml += makeCustomDLblXml(idx, lbl, opts) })\n\t\t\t\t\t}\n\t\t\t\t\tstrXml += `<c:numFmt formatCode=\"${encodeXmlEntities(opts.dataLabelFormatCode) || 'General'}\" sourceLinked=\"0\"/>`\n\t\t\t\t\tif (opts.dataLabelBkgrdColors) strXml += `<c:spPr><a:solidFill>${createColorElement(seriesColor)}</a:solidFill></c:spPr>`\n\t\t\t\t\tstrXml += '<c:txPr><a:bodyPr/><a:lstStyle/><a:p><a:pPr>'\n\t\t\t\t\tstrXml += `<a:defRPr b=\"${lblBold ? 1 : 0}\" i=\"${lblItalic ? 1 : 0}\" strike=\"noStrike\" sz=\"${Math.round(lblSize * 100)}\" u=\"none\">`\n\t\t\t\t\tstrXml += `<a:solidFill>${createColorElement(lblColor)}</a:solidFill>`\n\t\t\t\t\tstrXml += createChartTextFonts(lblFace)\n\t\t\t\t\tstrXml += '</a:defRPr></a:pPr></a:p></c:txPr>'\n\t\t\t\t\tif (opts.dataLabelPosition) strXml += `<c:dLblPos val=\"${opts.dataLabelPosition}\"/>`\n\t\t\t\t\tstrXml += '<c:showLegendKey val=\"0\"/>'\n\t\t\t\t\tstrXml += `<c:showVal val=\"${opts.showValue ? '1' : '0'}\"/>`\n\t\t\t\t\tstrXml += `<c:showCatName val=\"0\"/><c:showSerName val=\"${opts.showSerName ? '1' : '0'}\"/><c:showPercent val=\"0\"/><c:showBubbleSize val=\"0\"/>`\n\t\t\t\t\tstrXml += `<c:showLeaderLines val=\"${opts.showLeaderLines ? '1' : '0'}\"/>`\n\t\t\t\t\tstrXml += '</c:dLbls>'\n\t\t\t\t}\n\n\t\t\t\t// 2: \"Categories\"\n\t\t\t\t{\n\t\t\t\t\tstrXml += '<c:cat>'\n\t\t\t\t\tif (opts.catLabelFormatCode) {\n\t\t\t\t\t\t// Use 'numRef' as catLabelFormatCode implies that we are expecting numbers here\n\t\t\t\t\t\tstrXml += ' <c:numRef>'\n\t\t\t\t\t\tstrXml += ` <c:f>Sheet1!$A$2:$A$${obj.labels[0].length + 1}</c:f>`\n\t\t\t\t\t\tstrXml += ' <c:numCache>'\n\t\t\t\t\t\tstrXml += ' <c:formatCode>' + (opts.catLabelFormatCode || 'General') + '</c:formatCode>'\n\t\t\t\t\t\tstrXml += ` <c:ptCount val=\"${obj.labels[0].length}\"/>`\n\t\t\t\t\t\tobj.labels[0].forEach((label, idx) => (strXml += `<c:pt idx=\"${idx}\"><c:v>${encodeXmlEntities(label)}</c:v></c:pt>`))\n\t\t\t\t\t\tstrXml += ' </c:numCache>'\n\t\t\t\t\t\tstrXml += ' </c:numRef>'\n\t\t\t\t\t} else if (obj.labels.length === 1) {\n\t\t\t\t\t\tstrXml += ' <c:strRef>'\n\t\t\t\t\t\tstrXml += ` <c:f>Sheet1!$A$2:$A$${obj.labels[0].length + 1}</c:f>`\n\t\t\t\t\t\tstrXml += ' <c:strCache>'\n\t\t\t\t\t\tstrXml += ` <c:ptCount val=\"${obj.labels[0].length}\"/>`\n\t\t\t\t\t\tobj.labels[0].forEach((label, idx) => (strXml += `<c:pt idx=\"${idx}\"><c:v>${encodeXmlEntities(label)}</c:v></c:pt>`))\n\t\t\t\t\t\tstrXml += ' </c:strCache>'\n\t\t\t\t\t\tstrXml += ' </c:strRef>'\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstrXml += ' <c:multiLvlStrRef>'\n\t\t\t\t\t\tstrXml += ` <c:f>Sheet1!$A$2:$${getExcelColName(obj.labels.length)}$${obj.labels[0].length + 1}</c:f>`\n\t\t\t\t\t\tstrXml += ' <c:multiLvlStrCache>'\n\t\t\t\t\t\tstrXml += ` <c:ptCount val=\"${obj.labels[0].length}\"/>`\n\t\t\t\t\t\tobj.labels.forEach(labelsGroup => {\n\t\t\t\t\t\t\tstrXml += '<c:lvl>'\n\t\t\t\t\t\t\tlabelsGroup.forEach((label, idx) => (strXml += `<c:pt idx=\"${idx}\"><c:v>${encodeXmlEntities(label)}</c:v></c:pt>`))\n\t\t\t\t\t\t\tstrXml += '</c:lvl>'\n\t\t\t\t\t\t})\n\t\t\t\t\t\tstrXml += ' </c:multiLvlStrCache>'\n\t\t\t\t\t\tstrXml += ' </c:multiLvlStrRef>'\n\t\t\t\t\t}\n\t\t\t\t\tstrXml += '</c:cat>'\n\t\t\t\t}\n\n\t\t\t\t// 3: \"Values\"\n\t\t\t\t{\n\t\t\t\t\tstrXml += '<c:val>'\n\t\t\t\t\tstrXml += ' <c:numRef>'\n\t\t\t\t\tstrXml += `<c:f>Sheet1!$${getExcelColName(obj._dataIndex + obj.labels.length + 1)}$2:$${getExcelColName(obj._dataIndex + obj.labels.length + 1)}$${obj.labels[0].length + 1}</c:f>`\n\t\t\t\t\tstrXml += ' <c:numCache>'\n\t\t\t\t\tstrXml += ' <c:formatCode>' + valFmtCode + '</c:formatCode>'\n\t\t\t\t\tstrXml += ` <c:ptCount val=\"${obj.labels[0].length}\"/>`\n\t\t\t\t\tobj.values.forEach((value, idx) => { strXml += numCachePt(idx, value) })\n\t\t\t\t\tstrXml += ' </c:numCache>'\n\t\t\t\t\tstrXml += ' </c:numRef>'\n\t\t\t\t\tstrXml += '</c:val>'\n\t\t\t\t}\n\n\t\t\t\t// Option: `smooth`\n\t\t\t\tif (chartType === CHART_TYPE.LINE) strXml += '<c:smooth val=\"' + (opts.lineSmooth ? '1' : '0') + '\"/>'\n\n\t\t\t\t// 4: Close \"SERIES\"\n\t\t\t\tstrXml += '</c:ser>'\n\t\t\t})\n\n\t\t\t// 3: \"Data Labels\"\n\t\t\t{\n\t\t\t\tstrXml += ' <c:dLbls>'\n\t\t\t\tstrXml += ` <c:numFmt formatCode=\"${encodeXmlEntities(opts.dataLabelFormatCode) || 'General'}\" sourceLinked=\"0\"/>`\n\t\t\t\tstrXml += ' <c:txPr>'\n\t\t\t\tstrXml += ' <a:bodyPr/>'\n\t\t\t\tstrXml += ' <a:lstStyle/>'\n\t\t\t\tstrXml += ' <a:p><a:pPr>'\n\t\t\t\tstrXml += ` <a:defRPr b=\"${opts.dataLabelFontBold ? 1 : 0}\" i=\"${opts.dataLabelFontItalic ? 1 : 0}\" strike=\"noStrike\" sz=\"${Math.round((opts.dataLabelFontSize || DEF_FONT_SIZE) * 100)}\" u=\"none\">`\n\t\t\t\tstrXml += ' <a:solidFill>' + createColorElement(opts.dataLabelColor || DEF_FONT_COLOR) + '</a:solidFill>'\n\t\t\t\tstrXml += ' ' + createChartTextFonts(opts.dataLabelFontFace || 'Arial')\n\t\t\t\tstrXml += ' </a:defRPr>'\n\t\t\t\tstrXml += ' </a:pPr></a:p>'\n\t\t\t\tstrXml += ' </c:txPr>'\n\t\t\t\tif (opts.dataLabelPosition) strXml += ' <c:dLblPos val=\"' + opts.dataLabelPosition + '\"/>'\n\t\t\t\tstrXml += ' <c:showLegendKey val=\"0\"/>'\n\t\t\t\tstrXml += ' <c:showVal val=\"' + (opts.showValue ? '1' : '0') + '\"/>'\n\t\t\t\tstrXml += ' <c:showCatName val=\"0\"/>'\n\t\t\t\tstrXml += ' <c:showSerName val=\"' + (opts.showSerName ? '1' : '0') + '\"/>'\n\t\t\t\tstrXml += ' <c:showPercent val=\"0\"/>'\n\t\t\t\tstrXml += ' <c:showBubbleSize val=\"0\"/>'\n\t\t\t\tstrXml += ` <c:showLeaderLines val=\"${opts.showLeaderLines ? '1' : '0'}\"/>`\n\t\t\t\tstrXml += ' </c:dLbls>'\n\t\t\t}\n\n\t\t\t// 4: Add more chart options (gapWidth, line Marker, etc.)\n\t\t\tif (chartType === CHART_TYPE.BAR) {\n\t\t\t\tstrXml += ` <c:gapWidth val=\"${opts.barGapWidthPct}\"/>`\n\t\t\t\tstrXml += ` <c:overlap val=\"${opts.barOverlapPct != null ? opts.barOverlapPct : (opts.barGrouping || '').includes('tacked') ? 100 : 0}\"/>`\n\t\t\t\t// `<c:serLines>` (\"Series Lines\") connects data points across stacked bar/column series.\n\t\t\t\t// Schema order (CT_BarChart): gapWidth → overlap → serLines → axId.\n\t\t\t\tstrXml += createSerLinesElement(opts.barSeriesLine)\n\t\t\t} else if (chartType === CHART_TYPE.BAR3D) {\n\t\t\t\tstrXml += ` <c:gapWidth val=\"${opts.barGapWidthPct}\"/>`\n\t\t\t\tstrXml += ` <c:gapDepth val=\"${opts.barGapDepthPct}\"/>`\n\t\t\t\tstrXml += ' <c:shape val=\"' + opts.bar3DShape + '\"/>'\n\t\t\t} else if (chartType === CHART_TYPE.LINE) {\n\t\t\t\tstrXml += ' <c:marker val=\"1\"/>'\n\t\t\t}\n\n\t\t\t// 5: Add axisId (NOTE: order matters! (category comes first))\n\t\t\t// Only 3D charts (BAR3D) get a series axis def; emitting a\n\t\t\t// SERIES_PRIMARY axId for 2D charts produced a dangling reference\n\t\t\t// that violated the OOXML invariant (every axId in <c:plotArea>\n\t\t\t// must resolve to a defined catAx/valAx).\n\t\t\tstrXml += `<c:axId val=\"${catAxisId}\"/><c:axId val=\"${valAxisId}\"/>`\n\t\t\tif (chartType === CHART_TYPE.BAR3D) {\n\t\t\t\tstrXml += `<c:axId val=\"${AXIS_ID_SERIES_PRIMARY}\"/>`\n\t\t\t}\n\n\t\t\t// 6: Close Chart tag\n\t\t\tstrXml += `</c:${chartType}Chart>`\n\n\t\t\t// end switch\n\t\t\tbreak\n\n\t\tcase CHART_TYPE.SCATTER:\n\t\t\t/*\n\t\t\t\t`data` = [\n\t\t\t\t\t{ name:'X-Axis', values:[1,2,3,4,5,6,7,8,9,10,11,12] },\n\t\t\t\t\t{ name:'Y-Value 1', values:[13, 20, 21, 25] },\n\t\t\t\t\t{ name:'Y-Value 2', values:[ 1, 2, 5, 9] }\n\t\t\t\t];\n */\n\n\t\t\t// 1: Start Chart\n\t\t\tstrXml += '<c:' + chartType + 'Chart>'\n\t\t\tstrXml += '<c:scatterStyle val=\"lineMarker\"/>'\n\t\t\tstrXml += '<c:varyColors val=\"0\"/>'\n\n\t\t\t// 2: Series: (One for each Y-Axis)\n\t\t\tcolorIndex = -1\n\t\t\tdata.filter((_obj, idx) => idx > 0).forEach((obj, idx) => {\n\t\t\t\tcolorIndex++\n\t\t\t\tstrXml += '<c:ser>'\n\t\t\t\tstrXml += ` <c:idx val=\"${idx}\"/>`\n\t\t\t\tstrXml += ` <c:order val=\"${idx}\"/>`\n\t\t\t\tstrXml += ' <c:tx>'\n\t\t\t\tstrXml += ' <c:strRef>'\n\t\t\t\tstrXml += ` <c:f>Sheet1!$${getExcelColName(idx + 2)}$1</c:f>`\n\t\t\t\tstrXml += ' <c:strCache><c:ptCount val=\"1\"/><c:pt idx=\"0\"><c:v>' + encodeXmlEntities(obj.name) + '</c:v></c:pt></c:strCache>'\n\t\t\t\tstrXml += ' </c:strRef>'\n\t\t\t\tstrXml += ' </c:tx>'\n\n\t\t\t\t// 'c:spPr': Fill, Border, Line, LineStyle (dash, etc.), Shadow\n\t\t\t\tstrXml += ' <c:spPr>'\n\t\t\t\t{\n\t\t\t\t\tconst tmpSerColor = opts.chartColors[colorIndex % opts.chartColors.length]\n\n\t\t\t\t\tif (tmpSerColor === 'transparent') {\n\t\t\t\t\t\tstrXml += '<a:noFill/>'\n\t\t\t\t\t} else if (opts.chartColorsOpacity) {\n\t\t\t\t\t\tstrXml += '<a:solidFill>' + createColorElement(tmpSerColor, '<a:alpha val=\"' + Math.round(opts.chartColorsOpacity * 1000).toString() + '\"/>') + '</a:solidFill>'\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstrXml += '<a:solidFill>' + createColorElement(tmpSerColor) + '</a:solidFill>'\n\t\t\t\t\t}\n\n\t\t\t\t\tif (opts.lineSize === 0) {\n\t\t\t\t\t\tstrXml += '<a:ln><a:noFill/></a:ln>'\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstrXml += `<a:ln w=\"${valToPts(opts.lineSize)}\" cap=\"${createLineCap(opts.lineCap)}\"><a:solidFill>${createColorElement(tmpSerColor)}</a:solidFill>`\n\t\t\t\t\t\tstrXml += `<a:prstDash val=\"${opts.lineDashValues?.[colorIndex] ?? opts.lineDash ?? 'solid'}\"/><a:round/></a:ln>`\n\t\t\t\t\t}\n\n\t\t\t\t\t// Shadow\n\t\t\t\t\tstrXml += createShadowElement(opts.shadow, DEF_SHAPE_SHADOW)\n\t\t\t\t}\n\t\t\t\tstrXml += ' </c:spPr>'\n\n\t\t\t\t// 'c:marker' tag: `lineDataSymbol`\n\t\t\t\t{\n\t\t\t\t\tstrXml += '<c:marker>'\n\t\t\t\t\tstrXml += ' <c:symbol val=\"' + opts.lineDataSymbol + '\"/>'\n\t\t\t\t\tif (opts.lineDataSymbolSize) {\n\t\t\t\t\t\t// Defaults to \"auto\" otherwise (but this is usually too small, so there is a default)\n\t\t\t\t\t\tstrXml += `<c:size val=\"${opts.lineDataSymbolSize}\"/>`\n\t\t\t\t\t}\n\t\t\t\t\tstrXml += '<c:spPr>'\n\t\t\t\t\t{\n\t\t\t\t\t\tconst markerColor = opts.chartColors[idx + 1 > opts.chartColors.length ? Math.floor(Math.random() * opts.chartColors.length) : idx]\n\t\t\t\t\t\tstrXml += markerColor === 'transparent' ? '<a:noFill/>' : `<a:solidFill>${createColorElement(markerColor)}</a:solidFill>`\n\t\t\t\t\t}\n\t\t\t\t\tstrXml += `<a:ln w=\"${opts.lineDataSymbolLineSize}\" cap=\"flat\"><a:solidFill>${createColorElement(opts.lineDataSymbolLineColor || opts.chartColors[colorIndex % opts.chartColors.length])}</a:solidFill><a:prstDash val=\"solid\"/><a:round/></a:ln>`\n\t\t\t\t\tstrXml += '<a:effectLst/>'\n\t\t\t\t\tstrXml += '</c:spPr>'\n\t\t\t\t\tstrXml += '</c:marker>'\n\t\t\t\t}\n\n\t\t\t\t// Per-point data points (`c:dPt`) MUST precede `c:dLbls` (CT_ScatterSer schema order).\n\t\t\t\t// Covers legacy single-series color-vary AND per-point `pointStyles` overrides.\n\t\t\t\t{\n\t\t\t\t\tconst scatterVaryColors = data.length === 1 && opts.chartColors !== BARCHART_COLORS ? opts.chartColors || BARCHART_COLORS : null\n\t\t\t\t\tstrXml += makeSeriesDataPointsXml(chartType, obj, opts, scatterVaryColors)\n\t\t\t\t}\n\n\t\t\t\t// Option: scatter data point labels\n\t\t\t\tif (opts.showLabel) {\n\t\t\t\t\tconst chartUuid = getUuid('-xxxx-xxxx-xxxx-xxxxxxxxxxxx')\n\t\t\t\t\tif (obj.labels[0] && (opts.dataLabelFormatScatter === 'custom' || opts.dataLabelFormatScatter === 'customXY')) {\n\t\t\t\t\t\tstrXml += '<c:dLbls>'\n\t\t\t\t\t\tobj.labels[0].forEach((label, idx) => {\n\t\t\t\t\t\t\tif (opts.dataLabelFormatScatter === 'custom' || opts.dataLabelFormatScatter === 'customXY') {\n\t\t\t\t\t\t\t\tstrXml += ' <c:dLbl>'\n\t\t\t\t\t\t\t\tstrXml += ` <c:idx val=\"${idx}\"/>`\n\t\t\t\t\t\t\t\tstrXml += ' <c:tx>'\n\t\t\t\t\t\t\t\tstrXml += ' <c:rich>'\n\t\t\t\t\t\t\t\tstrXml += ' <a:bodyPr>'\n\t\t\t\t\t\t\t\tstrXml += ' <a:spAutoFit/>'\n\t\t\t\t\t\t\t\tstrXml += ' </a:bodyPr>'\n\t\t\t\t\t\t\t\tstrXml += ' <a:lstStyle/>'\n\t\t\t\t\t\t\t\tstrXml += ' <a:p>'\n\t\t\t\t\t\t\t\tstrXml += ' <a:pPr>'\n\t\t\t\t\t\t\t\tstrXml += ` <a:defRPr sz=\"${Math.round((opts.dataLabelFontSize || DEF_FONT_SIZE) * 100)}\" b=\"${opts.dataLabelFontBold ? '1' : '0'}\" i=\"${opts.dataLabelFontItalic ? '1' : '0'}\" u=\"none\" strike=\"noStrike\">`\n\t\t\t\t\t\t\t\tstrXml += ' <a:solidFill>' + createColorElement(opts.dataLabelColor || DEF_FONT_COLOR) + '</a:solidFill>'\n\t\t\t\t\t\t\t\tstrXml += ' ' + createChartTextFonts(opts.dataLabelFontFace || 'Arial')\n\t\t\t\t\t\t\t\tstrXml += ' </a:defRPr>'\n\t\t\t\t\t\t\t\tstrXml += ' </a:pPr>'\n\t\t\t\t\t\t\t\tstrXml += ' <a:r>'\n\t\t\t\t\t\t\t\tstrXml += ` <a:rPr lang=\"${opts.lang || 'en-US'}\" sz=\"${Math.round((opts.dataLabelFontSize || DEF_FONT_SIZE) * 100)}\" b=\"${opts.dataLabelFontBold ? '1' : '0'}\" i=\"${opts.dataLabelFontItalic ? '1' : '0'}\" u=\"none\" strike=\"noStrike\" dirty=\"0\">`\n\t\t\t\t\t\t\t\tstrXml += ' <a:solidFill>' + createColorElement(opts.dataLabelColor || DEF_FONT_COLOR) + '</a:solidFill>'\n\t\t\t\t\t\t\t\tstrXml += ' ' + createChartTextFonts(opts.dataLabelFontFace || 'Arial')\n\t\t\t\t\t\t\t\tstrXml += ' </a:rPr>'\n\t\t\t\t\t\t\t\tstrXml += ' <a:t>' + encodeXmlEntities(label) + '</a:t>'\n\t\t\t\t\t\t\t\tstrXml += ' </a:r>'\n\t\t\t\t\t\t\t\t// Apply XY values at end of custom label\n\t\t\t\t\t\t\t\t// Do not apply the values if the label was empty or just spaces\n\t\t\t\t\t\t\t\t// This allows for selective labelling where required\n\t\t\t\t\t\t\t\tif (opts.dataLabelFormatScatter === 'customXY' && !/^ *$/.test(label)) {\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:r>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:rPr lang=\"' + (opts.lang || 'en-US') + '\" baseline=\"0\" dirty=\"0\"/>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:t> (</a:t>'\n\t\t\t\t\t\t\t\t\tstrXml += ' </a:r>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:fld id=\"{' + getUuid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx') + '}\" type=\"XVALUE\">'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:rPr lang=\"' + (opts.lang || 'en-US') + '\" baseline=\"0\"/>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:pPr>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:defRPr/>'\n\t\t\t\t\t\t\t\t\tstrXml += ' </a:pPr>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:t>[' + encodeXmlEntities(obj.name) + '</a:t>'\n\t\t\t\t\t\t\t\t\tstrXml += ' </a:fld>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:r>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:rPr lang=\"' + (opts.lang || 'en-US') + '\" baseline=\"0\" dirty=\"0\"/>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:t>, </a:t>'\n\t\t\t\t\t\t\t\t\tstrXml += ' </a:r>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:fld id=\"{' + getUuid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx') + '}\" type=\"YVALUE\">'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:rPr lang=\"' + (opts.lang || 'en-US') + '\" baseline=\"0\"/>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:pPr>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:defRPr/>'\n\t\t\t\t\t\t\t\t\tstrXml += ' </a:pPr>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:t>[' + encodeXmlEntities(obj.name) + ']</a:t>'\n\t\t\t\t\t\t\t\t\tstrXml += ' </a:fld>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:r>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:rPr lang=\"' + (opts.lang || 'en-US') + '\" baseline=\"0\" dirty=\"0\"/>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:t>)</a:t>'\n\t\t\t\t\t\t\t\t\tstrXml += ' </a:r>'\n\t\t\t\t\t\t\t\t\tstrXml += ' <a:endParaRPr lang=\"' + (opts.lang || 'en-US') + '\" dirty=\"0\"/>'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tstrXml += ' </a:p>'\n\t\t\t\t\t\t\t\tstrXml += ' </c:rich>'\n\t\t\t\t\t\t\t\tstrXml += ' </c:tx>'\n\t\t\t\t\t\t\t\tstrXml += ' <c:spPr>'\n\t\t\t\t\t\t\t\tstrXml += ' <a:noFill/>'\n\t\t\t\t\t\t\t\tstrXml += ' <a:ln>'\n\t\t\t\t\t\t\t\tstrXml += ' <a:noFill/>'\n\t\t\t\t\t\t\t\tstrXml += ' </a:ln>'\n\t\t\t\t\t\t\t\tstrXml += ' <a:effectLst/>'\n\t\t\t\t\t\t\t\tstrXml += ' </c:spPr>'\n\t\t\t\t\t\t\t\tif (opts.dataLabelPosition) strXml += ' <c:dLblPos val=\"' + opts.dataLabelPosition + '\"/>'\n\t\t\t\t\t\t\t\tstrXml += ' <c:showLegendKey val=\"0\"/>'\n\t\t\t\t\t\t\t\tstrXml += ' <c:showVal val=\"0\"/>'\n\t\t\t\t\t\t\t\tstrXml += ' <c:showCatName val=\"0\"/>'\n\t\t\t\t\t\t\t\tstrXml += ' <c:showSerName val=\"0\"/>'\n\t\t\t\t\t\t\t\tstrXml += ' <c:showPercent val=\"0\"/>'\n\t\t\t\t\t\t\t\tstrXml += ' <c:showBubbleSize val=\"0\"/>'\n\t\t\t\t\t\t\t\tstrXml += ' <c:showLeaderLines val=\"1\"/>'\n\t\t\t\t\t\t\t\tstrXml += ' <c:extLst>'\n\t\t\t\t\t\t\t\tstrXml += ' <c:ext uri=\"{CE6537A1-D6FC-4f65-9D91-7224C49458BB}\" xmlns:c15=\"http://schemas.microsoft.com/office/drawing/2012/chart\"/>'\n\t\t\t\t\t\t\t\tstrXml += ' <c:ext uri=\"{C3380CC4-5D6E-409C-BE32-E72D297353CC}\" xmlns:c16=\"http://schemas.microsoft.com/office/drawing/2014/chart\">'\n\t\t\t\t\t\t\t\tstrXml += ` <c16:uniqueId val=\"{${String(idx + 1).padStart(8, '0')}${chartUuid}}\"/>`\n\t\t\t\t\t\t\t\tstrXml += ' </c:ext>'\n\t\t\t\t\t\t\t\tstrXml += ' </c:extLst>'\n\t\t\t\t\t\t\t\tstrXml += '</c:dLbl>'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\tstrXml += '</c:dLbls>'\n\t\t\t\t\t}\n\t\t\t\t\tif (opts.dataLabelFormatScatter === 'XY') {\n\t\t\t\t\t\tstrXml += '<c:dLbls>'\n\t\t\t\t\t\tstrXml += ' <c:spPr>'\n\t\t\t\t\t\tstrXml += ' <a:noFill/>'\n\t\t\t\t\t\tstrXml += ' <a:ln>'\n\t\t\t\t\t\tstrXml += ' <a:noFill/>'\n\t\t\t\t\t\tstrXml += ' </a:ln>'\n\t\t\t\t\t\tstrXml += ' <a:effectLst/>'\n\t\t\t\t\t\tstrXml += ' </c:spPr>'\n\t\t\t\t\t\tstrXml += ' <c:txPr>'\n\t\t\t\t\t\tstrXml += ' <a:bodyPr>'\n\t\t\t\t\t\tstrXml += ' <a:spAutoFit/>'\n\t\t\t\t\t\tstrXml += ' </a:bodyPr>'\n\t\t\t\t\t\tstrXml += ' <a:lstStyle/>'\n\t\t\t\t\t\tstrXml += ' <a:p>'\n\t\t\t\t\t\tstrXml += ' <a:pPr>'\n\t\t\t\t\t\tstrXml += ` <a:defRPr sz=\"${Math.round((opts.dataLabelFontSize || DEF_FONT_SIZE) * 100)}\" b=\"${opts.dataLabelFontBold ? '1' : '0'}\" i=\"${opts.dataLabelFontItalic ? '1' : '0'}\" u=\"none\" strike=\"noStrike\">`\n\t\t\t\t\t\tstrXml += ' <a:solidFill>' + createColorElement(opts.dataLabelColor || DEF_FONT_COLOR) + '</a:solidFill>'\n\t\t\t\t\t\tstrXml += ' ' + createChartTextFonts(opts.dataLabelFontFace || 'Arial')\n\t\t\t\t\t\tstrXml += ' </a:defRPr>'\n\t\t\t\t\t\tstrXml += ' </a:pPr>'\n\t\t\t\t\t\tstrXml += ` <a:endParaRPr lang=\"${opts.lang || 'en-US'}\"/>`\n\t\t\t\t\t\tstrXml += ' </a:p>'\n\t\t\t\t\t\tstrXml += ' </c:txPr>'\n\t\t\t\t\t\tif (opts.dataLabelPosition) strXml += ' <c:dLblPos val=\"' + opts.dataLabelPosition + '\"/>'\n\t\t\t\t\t\tstrXml += ' <c:showLegendKey val=\"0\"/>'\n\t\t\t\t\t\tstrXml += ` <c:showVal val=\"${opts.showLabel ? '1' : '0'}\"/>`\n\t\t\t\t\t\tstrXml += ` <c:showCatName val=\"${opts.showLabel ? '1' : '0'}\"/>`\n\t\t\t\t\t\tstrXml += ` <c:showSerName val=\"${opts.showSerName ? '1' : '0'}\"/>`\n\t\t\t\t\t\tstrXml += ' <c:showPercent val=\"0\"/>'\n\t\t\t\t\t\tstrXml += ' <c:showBubbleSize val=\"0\"/>'\n\t\t\t\t\t\tstrXml += ' <c:extLst>'\n\t\t\t\t\t\tstrXml += ' <c:ext uri=\"{CE6537A1-D6FC-4f65-9D91-7224C49458BB}\" xmlns:c15=\"http://schemas.microsoft.com/office/drawing/2012/chart\">'\n\t\t\t\t\t\tstrXml += ' <c15:showLeaderLines val=\"1\"/>'\n\t\t\t\t\t\tstrXml += ' </c:ext>'\n\t\t\t\t\t\tstrXml += ' </c:extLst>'\n\t\t\t\t\t\tstrXml += '</c:dLbls>'\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// 3: \"Values\": Scatter Chart has 2: `xVal` and `yVal`\n\t\t\t\t{\n\t\t\t\t\t// X-Axis is always the same\n\t\t\t\t\tstrXml += '<c:xVal>'\n\t\t\t\t\tstrXml += ' <c:numRef>'\n\t\t\t\t\tstrXml += ` <c:f>Sheet1!$A$2:$A$${data[0].values.length + 1}</c:f>`\n\t\t\t\t\tstrXml += ' <c:numCache>'\n\t\t\t\t\tstrXml += ' <c:formatCode>' + valFmtCode + '</c:formatCode>'\n\t\t\t\t\tstrXml += ` <c:ptCount val=\"${data[0].values.length}\"/>`\n\t\t\t\t\tdata[0].values.forEach((value, idx) => {\n\t\t\t\t\t\tstrXml += numCachePt(idx, value)\n\t\t\t\t\t})\n\t\t\t\t\tstrXml += ' </c:numCache>'\n\t\t\t\t\tstrXml += ' </c:numRef>'\n\t\t\t\t\tstrXml += '</c:xVal>'\n\n\t\t\t\t\t// Y-Axis vals are this object's `values`\n\t\t\t\t\tstrXml += '<c:yVal>'\n\t\t\t\t\tstrXml += ' <c:numRef>'\n\t\t\t\t\tstrXml += ` <c:f>Sheet1!$${getExcelColName(idx + 2)}$2:$${getExcelColName(idx + 2)}$${data[0].values.length + 1}</c:f>`\n\t\t\t\t\tstrXml += ' <c:numCache>'\n\t\t\t\t\tstrXml += ' <c:formatCode>' + valFmtCode + '</c:formatCode>'\n\t\t\t\t\t// NOTE: Use pt count and iterate over data[0] (X-Axis) as user can have more values than data (eg: timeline where only first few months are populated)\n\t\t\t\t\tstrXml += ` <c:ptCount val=\"${data[0].values.length}\"/>`\n\t\t\t\t\tdata[0].values.forEach((_value, idx) => {\n\t\t\t\t\t\tstrXml += numCachePt(idx, obj.values[idx])\n\t\t\t\t\t})\n\t\t\t\t\tstrXml += ' </c:numCache>'\n\t\t\t\t\tstrXml += ' </c:numRef>'\n\t\t\t\t\tstrXml += '</c:yVal>'\n\t\t\t\t}\n\n\t\t\t\t// Option: `smooth`\n\t\t\t\tstrXml += '<c:smooth val=\"' + (opts.lineSmooth ? '1' : '0') + '\"/>'\n\n\t\t\t\t// 4: Close \"SERIES\"\n\t\t\t\tstrXml += '</c:ser>'\n\t\t\t})\n\n\t\t\t// 3: Data Labels\n\t\t\t{\n\t\t\t\tstrXml += ' <c:dLbls>'\n\t\t\t\tstrXml += ` <c:numFmt formatCode=\"${encodeXmlEntities(opts.dataLabelFormatCode) || 'General'}\" sourceLinked=\"0\"/>`\n\t\t\t\tstrXml += ' <c:txPr>'\n\t\t\t\tstrXml += ' <a:bodyPr/>'\n\t\t\t\tstrXml += ' <a:lstStyle/>'\n\t\t\t\tstrXml += ' <a:p><a:pPr>'\n\t\t\t\tstrXml += ` <a:defRPr b=\"${opts.dataLabelFontBold ? '1' : '0'}\" i=\"${opts.dataLabelFontItalic ? '1' : '0'}\" strike=\"noStrike\" sz=\"${Math.round((opts.dataLabelFontSize || DEF_FONT_SIZE) * 100)}\" u=\"none\">`\n\t\t\t\tstrXml += ' <a:solidFill>' + createColorElement(opts.dataLabelColor || DEF_FONT_COLOR) + '</a:solidFill>'\n\t\t\t\tstrXml += ' ' + createChartTextFonts(opts.dataLabelFontFace || 'Arial')\n\t\t\t\tstrXml += ' </a:defRPr>'\n\t\t\t\tstrXml += ' </a:pPr></a:p>'\n\t\t\t\tstrXml += ' </c:txPr>'\n\t\t\t\tif (opts.dataLabelPosition) strXml += ' <c:dLblPos val=\"' + opts.dataLabelPosition + '\"/>'\n\t\t\t\tstrXml += ' <c:showLegendKey val=\"0\"/>'\n\t\t\t\tstrXml += ' <c:showVal val=\"' + (opts.showValue ? '1' : '0') + '\"/>'\n\t\t\t\tstrXml += ' <c:showCatName val=\"0\"/>'\n\t\t\t\tstrXml += ' <c:showSerName val=\"' + (opts.showSerName ? '1' : '0') + '\"/>'\n\t\t\t\tstrXml += ' <c:showPercent val=\"0\"/>'\n\t\t\t\tstrXml += ' <c:showBubbleSize val=\"0\"/>'\n\t\t\t\tstrXml += ' </c:dLbls>'\n\t\t\t}\n\n\t\t\t// 4: Add axis Id (NOTE: order matters! - category comes first)\n\t\t\tstrXml += `<c:axId val=\"${catAxisId}\"/><c:axId val=\"${valAxisId}\"/>`\n\n\t\t\t// 5: Close Chart tag\n\t\t\tstrXml += '</c:' + chartType + 'Chart>'\n\n\t\t\t// end switch\n\t\t\tbreak\n\n\t\tcase CHART_TYPE.BUBBLE:\n\t\tcase CHART_TYPE.BUBBLE3D:\n\t\t\t/*\n\t\t\t\t`data` = [\n\t\t\t\t\t{ name:'X-Axis', values:[1,2,3,4,5,6,7,8,9,10,11,12] },\n\t\t\t\t\t{ name:'Y-Values 1', values:[13, 20, 21, 25], sizes:[10, 5, 20, 15] },\n\t\t\t\t\t{ name:'Y-Values 2', values:[ 1, 2, 5, 9], sizes:[ 5, 3, 9, 3] }\n\t\t\t\t];\n */\n\n\t\t\t// 1: Start Chart\n\t\t\tstrXml += '<c:bubbleChart>'\n\t\t\tstrXml += '<c:varyColors val=\"0\"/>'\n\n\t\t\t// 2: Series: (One for each Y-Axis)\n\t\t\tcolorIndex = -1\n\t\t\tdata.filter((_obj, idx) => idx > 0).forEach((obj, idx) => {\n\t\t\t\tcolorIndex++\n\t\t\t\tstrXml += '<c:ser>'\n\t\t\t\tstrXml += ` <c:idx val=\"${idx}\"/>`\n\t\t\t\tstrXml += ` <c:order val=\"${idx}\"/>`\n\n\t\t\t\t// A: `<c:tx>`\n\t\t\t\tstrXml += ' <c:tx>'\n\t\t\t\tstrXml += ' <c:strRef>'\n\t\t\t\tstrXml += ' <c:f>Sheet1!$' + getExcelColName(idxColLtr + 1) + '$1</c:f>'\n\t\t\t\tstrXml += ' <c:strCache><c:ptCount val=\"1\"/><c:pt idx=\"0\"><c:v>' + encodeXmlEntities(obj.name) + '</c:v></c:pt></c:strCache>'\n\t\t\t\tstrXml += ' </c:strRef>'\n\t\t\t\tstrXml += ' </c:tx>'\n\n\t\t\t\t// B: '<c:spPr>': Fill, Border, Line, LineStyle (dash, etc.), Shadow\n\t\t\t\t{\n\t\t\t\t\tstrXml += '<c:spPr>'\n\n\t\t\t\t\tconst tmpSerColor = opts.chartColors[colorIndex % opts.chartColors.length]\n\n\t\t\t\t\tif (tmpSerColor === 'transparent') {\n\t\t\t\t\t\tstrXml += '<a:noFill/>'\n\t\t\t\t\t} else if (opts.chartColorsOpacity) {\n\t\t\t\t\t\tstrXml += `<a:solidFill>${createColorElement(tmpSerColor, '<a:alpha val=\"' + Math.round(opts.chartColorsOpacity * 1000).toString() + '\"/>')}</a:solidFill>`\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstrXml += '<a:solidFill>' + createColorElement(tmpSerColor) + '</a:solidFill>'\n\t\t\t\t\t}\n\n\t\t\t\t\tif (opts.lineSize === 0) {\n\t\t\t\t\t\tstrXml += '<a:ln><a:noFill/></a:ln>'\n\t\t\t\t\t} else if (opts.dataBorder) {\n\t\t\t\t\t\tstrXml += `<a:ln w=\"${valToPts(opts.dataBorder.pt)}\" cap=\"flat\"><a:solidFill>${createColorElement(opts.dataBorder.color)}</a:solidFill><a:prstDash val=\"solid\"/><a:round/></a:ln>`\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstrXml += `<a:ln w=\"${valToPts(opts.lineSize)}\" cap=\"flat\"><a:solidFill>${createColorElement(tmpSerColor)}</a:solidFill>`\n\t\t\t\t\t\tstrXml += `<a:prstDash val=\"${opts.lineDashValues?.[colorIndex] ?? opts.lineDash ?? 'solid'}\"/><a:round/></a:ln>`\n\t\t\t\t\t}\n\n\t\t\t\t\t// Shadow\n\t\t\t\t\tstrXml += createShadowElement(opts.shadow, DEF_SHAPE_SHADOW)\n\n\t\t\t\t\tstrXml += '</c:spPr>'\n\t\t\t\t}\n\n\t\t\t\t// C: '<c:dLbls>' \"Data Labels\"\n\t\t\t\t// Let it be defaulted for now\n\n\t\t\t\t// D: '<c:xVal>'/'<c:yVal>' \"Values\": Scatter Chart has 2: `xVal` and `yVal`\n\t\t\t\t{\n\t\t\t\t\t// X-Axis is always the same\n\t\t\t\t\tstrXml += '<c:xVal>'\n\t\t\t\t\tstrXml += ' <c:numRef>'\n\t\t\t\t\tstrXml += ` <c:f>Sheet1!$A$2:$A$${data[0].values.length + 1}</c:f>`\n\t\t\t\t\tstrXml += ' <c:numCache>'\n\t\t\t\t\tstrXml += ' <c:formatCode>' + valFmtCode + '</c:formatCode>'\n\t\t\t\t\tstrXml += ` <c:ptCount val=\"${data[0].values.length}\"/>`\n\t\t\t\t\tdata[0].values.forEach((value, idx) => {\n\t\t\t\t\t\tstrXml += numCachePt(idx, value)\n\t\t\t\t\t})\n\t\t\t\t\tstrXml += ' </c:numCache>'\n\t\t\t\t\tstrXml += ' </c:numRef>'\n\t\t\t\t\tstrXml += '</c:xVal>'\n\n\t\t\t\t\t// Y-Axis vals are this object's `values`\n\t\t\t\t\tstrXml += '<c:yVal>'\n\t\t\t\t\tstrXml += ' <c:numRef>'\n\t\t\t\t\tstrXml += `<c:f>Sheet1!$${getExcelColName(idxColLtr + 1)}$2:$${getExcelColName(idxColLtr + 1)}$${data[0].values.length + 1}</c:f>`\n\t\t\t\t\tidxColLtr++\n\t\t\t\t\tstrXml += ' <c:numCache>'\n\t\t\t\t\tstrXml += ' <c:formatCode>' + valFmtCode + '</c:formatCode>'\n\t\t\t\t\t// NOTE: Use pt count and iterate over data[0] (X-Axis) as user can have more values than data (eg: timeline where only first few months are populated)\n\t\t\t\t\tstrXml += ` <c:ptCount val=\"${data[0].values.length}\"/>`\n\t\t\t\t\tdata[0].values.forEach((_value, idx) => {\n\t\t\t\t\t\tstrXml += numCachePt(idx, obj.values[idx])\n\t\t\t\t\t})\n\t\t\t\t\tstrXml += ' </c:numCache>'\n\t\t\t\t\tstrXml += ' </c:numRef>'\n\t\t\t\t\tstrXml += '</c:yVal>'\n\t\t\t\t}\n\n\t\t\t\t// E: '<c:bubbleSize>'\n\t\t\t\tstrXml += ' <c:bubbleSize>'\n\t\t\t\tstrXml += ' <c:numRef>'\n\t\t\t\tstrXml += `<c:f>Sheet1!$${getExcelColName(idxColLtr + 1)}$2:$${getExcelColName(idxColLtr + 1)}$${obj.sizes.length + 1}</c:f>`\n\t\t\t\tidxColLtr++\n\t\t\t\tstrXml += ' <c:numCache>'\n\t\t\t\tstrXml += ' <c:formatCode>General</c:formatCode>'\n\t\t\t\tstrXml += ` <c:ptCount val=\"${obj.sizes.length}\"/>`\n\t\t\t\tobj.sizes.forEach((value, idx) => {\n\t\t\t\t\tstrXml += numCachePt(idx, value)\n\t\t\t\t})\n\t\t\t\tstrXml += ' </c:numCache>'\n\t\t\t\tstrXml += ' </c:numRef>'\n\t\t\t\tstrXml += ' </c:bubbleSize>'\n\t\t\t\tstrXml += ' <c:bubble3D val=\"' + (chartType === CHART_TYPE.BUBBLE3D ? '1' : '0') + '\"/>'\n\n\t\t\t\t// F: Close \"SERIES\"\n\t\t\t\tstrXml += '</c:ser>'\n\t\t\t})\n\n\t\t\t// 3: Data Labels\n\t\t\t{\n\t\t\t\tstrXml += '<c:dLbls>'\n\t\t\t\tstrXml += `<c:numFmt formatCode=\"${encodeXmlEntities(opts.dataLabelFormatCode) || 'General'}\" sourceLinked=\"0\"/>`\n\t\t\t\tstrXml += '<c:txPr><a:bodyPr/><a:lstStyle/><a:p><a:pPr>'\n\t\t\t\tstrXml += `<a:defRPr b=\"${opts.dataLabelFontBold ? 1 : 0}\" i=\"${opts.dataLabelFontItalic ? 1 : 0}\" strike=\"noStrike\" sz=\"${Math.round(\n\t\t\t\t\tMath.round(opts.dataLabelFontSize || DEF_FONT_SIZE) * 100\n\t\t\t\t)}\" u=\"none\">`\n\t\t\t\tstrXml += `<a:solidFill>${createColorElement(opts.dataLabelColor || DEF_FONT_COLOR)}</a:solidFill>`\n\t\t\t\tstrXml += createChartTextFonts(opts.dataLabelFontFace || 'Arial')\n\t\t\t\tstrXml += '</a:defRPr></a:pPr></a:p></c:txPr>'\n\t\t\t\tif (opts.dataLabelPosition) strXml += `<c:dLblPos val=\"${opts.dataLabelPosition}\"/>`\n\t\t\t\tstrXml += '<c:showLegendKey val=\"0\"/>'\n\t\t\t\tstrXml += `<c:showVal val=\"${opts.showValue ? '1' : '0'}\"/>`\n\t\t\t\tstrXml += `<c:showCatName val=\"0\"/><c:showSerName val=\"${opts.showSerName ? '1' : '0'}\"/><c:showPercent val=\"0\"/><c:showBubbleSize val=\"${opts.showBubbleSize ? '1' : '0'}\"/>`\n\t\t\t\tstrXml += '<c:extLst>'\n\t\t\t\tstrXml += ' <c:ext uri=\"{CE6537A1-D6FC-4f65-9D91-7224C49458BB}\" xmlns:c15=\"http://schemas.microsoft.com/office/drawing/2012/chart\">'\n\t\t\t\tstrXml += ' <c15:showLeaderLines val=\"' + (opts.showLeaderLines ? '1' : '0') + '\"/>'\n\t\t\t\tstrXml += ' </c:ext>'\n\t\t\t\tstrXml += '</c:extLst>'\n\t\t\t\tstrXml += '</c:dLbls>'\n\t\t\t}\n\n\t\t\t// 4: Bubble options\n\t\t\t// strXml += ' <c:bubbleScale val=\"100\"/>';\n\t\t\t// strXml += ' <c:showNegBubbles val=\"0\"/>';\n\t\t\t// Commented out to let it default to PPT until we create options\n\n\t\t\t// 5: AxisId (NOTE: order matters! (category comes first))\n\t\t\tstrXml += `<c:axId val=\"${catAxisId}\"/><c:axId val=\"${valAxisId}\"/>`\n\n\t\t\t// 6: Close Chart tag\n\t\t\tstrXml += '</c:bubbleChart>'\n\n\t\t\t// end switch\n\t\t\tbreak\n\n\t\tcase CHART_TYPE.DOUGHNUT:\n\t\tcase CHART_TYPE.PIE:\n\t\t\t// Use the same let name so code blocks from barChart are interchangeable\n\t\t\toptsChartData = data[0]\n\n\t\t\t/* EX:\n\t\t\t\tdata: [\n\t\t\t\t {\n\t\t\t\t name: 'Project Status',\n\t\t\t\t labels: ['Red', 'Amber', 'Green', 'Unknown'],\n\t\t\t\t values: [10, 20, 38, 2]\n\t\t\t\t }\n\t\t\t\t]\n */\n\n\t\t\t// 1: Start Chart\n\t\t\tstrXml += '<c:' + chartType + 'Chart>'\n\t\t\tstrXml += ' <c:varyColors val=\"1\"/>'\n\t\t\tstrXml += '<c:ser>'\n\t\t\tstrXml += ' <c:idx val=\"0\"/>'\n\t\t\tstrXml += ' <c:order val=\"0\"/>'\n\t\t\tstrXml += ' <c:tx>'\n\t\t\tstrXml += ' <c:strRef>'\n\t\t\tstrXml += ' <c:f>Sheet1!$B$1</c:f>'\n\t\t\tstrXml += ' <c:strCache>'\n\t\t\tstrXml += ' <c:ptCount val=\"1\"/>'\n\t\t\tstrXml += ' <c:pt idx=\"0\"><c:v>' + encodeXmlEntities(optsChartData.name) + '</c:v></c:pt>'\n\t\t\tstrXml += ' </c:strCache>'\n\t\t\tstrXml += ' </c:strRef>'\n\t\t\tstrXml += ' </c:tx>'\n\t\t\tstrXml += ' <c:spPr>'\n\t\t\tstrXml += ' <a:solidFill><a:schemeClr val=\"accent1\"/></a:solidFill>'\n\t\t\tstrXml += ' <a:ln w=\"9525\" cap=\"flat\"><a:solidFill><a:srgbClr val=\"F9F9F9\"/></a:solidFill><a:prstDash val=\"solid\"/><a:round/></a:ln>'\n\t\t\tif (opts.dataNoEffects) {\n\t\t\t\tstrXml += '<a:effectLst/>'\n\t\t\t} else {\n\t\t\t\tstrXml += createShadowElement(opts.shadow, DEF_SHAPE_SHADOW)\n\t\t\t}\n\t\t\tstrXml += ' </c:spPr>'\n\t\t\t// strXml += '<c:explosion val=\"0\"/>'\n\n\t\t\t// 2: \"Data Point\" block for every data row\n\t\t\toptsChartData.labels[0].forEach((_label, idx) => {\n\t\t\t\tconst ptStyle = optsChartData.pointStyles?.[idx]\n\t\t\t\tstrXml += '<c:dPt>'\n\t\t\t\tstrXml += ` <c:idx val=\"${idx}\"/>`\n\t\t\t\tstrXml += ' <c:bubble3D val=\"0\"/>'\n\t\t\t\tstrXml += ' <c:spPr>'\n\t\t\t\tstrXml += `<a:solidFill>${createColorElement(\n\t\t\t\t\tptStyle?.fill || opts.chartColors[idx + 1 > opts.chartColors.length ? Math.floor(Math.random() * opts.chartColors.length) : idx]\n\t\t\t\t)}</a:solidFill>`\n\t\t\t\t// Per-point border override takes precedence over chart-level `dataBorder`\n\t\t\t\tif (ptStyle?.border) {\n\t\t\t\t\tstrXml += createChartBorderLine(ptStyle.border)\n\t\t\t\t} else if (opts.dataBorder) {\n\t\t\t\t\tstrXml += `<a:ln w=\"${valToPts(opts.dataBorder.pt)}\" cap=\"flat\"><a:solidFill>${createColorElement(\n\t\t\t\t\t\topts.dataBorder.color\n\t\t\t\t\t)}</a:solidFill><a:prstDash val=\"solid\"/><a:round/></a:ln>`\n\t\t\t\t}\n\t\t\t\tstrXml += createShadowElement(opts.shadow, DEF_SHAPE_SHADOW)\n\t\t\t\tstrXml += ' </c:spPr>'\n\t\t\t\tstrXml += '</c:dPt>'\n\t\t\t})\n\n\t\t\t// 3: \"Data Label\" block for every data Label\n\t\t\tstrXml += '<c:dLbls>'\n\t\t\toptsChartData.labels[0].forEach((_label, idx) => {\n\t\t\t\tconst customLbl = optsChartData.customLabels?.[idx]\n\t\t\t\tstrXml += '<c:dLbl>'\n\t\t\t\tstrXml += ` <c:idx val=\"${idx}\"/>`\n\t\t\t\t// c:tx must precede c:numFmt per CT_DLbl / Group_DLbl / EG_DLblShared schema order\n\t\t\t\tif (customLbl) {\n\t\t\t\t\tstrXml += '<c:tx><c:rich><a:bodyPr/><a:lstStyle/><a:p><a:r>' +\n\t\t\t\t\t\t`<a:rPr lang=\"${opts.lang || 'en-US'}\" dirty=\"0\"/>` +\n\t\t\t\t\t\t`<a:t>${encodeXmlEntities(customLbl)}</a:t></a:r></a:p></c:rich></c:tx>`\n\t\t\t\t}\n\t\t\t\tstrXml += ` <c:numFmt formatCode=\"${encodeXmlEntities(opts.dataLabelFormatCode) || 'General'}\" sourceLinked=\"0\"/>`\n\t\t\t\tstrXml += ' <c:spPr/><c:txPr>'\n\t\t\t\tstrXml += ' <a:bodyPr/><a:lstStyle/>'\n\t\t\t\tstrXml += ' <a:p><a:pPr>'\n\t\t\t\tstrXml += ` <a:defRPr sz=\"${Math.round((opts.dataLabelFontSize || DEF_FONT_SIZE) * 100)}\" b=\"${opts.dataLabelFontBold ? 1 : 0}\" i=\"${opts.dataLabelFontItalic ? 1 : 0\n\t\t\t\t}\" u=\"none\" strike=\"noStrike\">`\n\t\t\t\tstrXml += ' <a:solidFill>' + createColorElement(opts.dataLabelColor || DEF_FONT_COLOR) + '</a:solidFill>'\n\t\t\t\tstrXml += ' ' + createChartTextFonts(opts.dataLabelFontFace || 'Arial')\n\t\t\t\tstrXml += ' </a:defRPr>'\n\t\t\t\tstrXml += ' </a:pPr></a:p>'\n\t\t\t\tstrXml += ' </c:txPr>'\n\t\t\t\tif (chartType === CHART_TYPE.PIE && opts.dataLabelPosition) strXml += `<c:dLblPos val=\"${opts.dataLabelPosition}\"/>`\n\t\t\t\tstrXml += ' <c:showLegendKey val=\"0\"/>'\n\t\t\t\tstrXml += ' <c:showVal val=\"' + (customLbl ? '0' : (opts.showValue ? '1' : '0')) + '\"/>'\n\t\t\t\tstrXml += ' <c:showCatName val=\"' + (opts.showLabel ? '1' : '0') + '\"/>'\n\t\t\t\tstrXml += ' <c:showSerName val=\"' + (opts.showSerName ? '1' : '0') + '\"/>'\n\t\t\t\tstrXml += ' <c:showPercent val=\"' + (opts.showPercent ? '1' : '0') + '\"/>'\n\t\t\t\tstrXml += ' <c:showBubbleSize val=\"0\"/>'\n\t\t\t\tstrXml += ' </c:dLbl>'\n\t\t\t})\n\t\t\tstrXml += ` <c:numFmt formatCode=\"${encodeXmlEntities(opts.dataLabelFormatCode) || 'General'}\" sourceLinked=\"0\"/>`\n\t\t\tstrXml += ' <c:txPr>'\n\t\t\tstrXml += ' <a:bodyPr/>'\n\t\t\tstrXml += ' <a:lstStyle/>'\n\t\t\tstrXml += ' <a:p>'\n\t\t\tstrXml += ' <a:pPr>'\n\t\t\tstrXml += ` <a:defRPr sz=\"${Math.round((opts.dataLabelFontSize || DEF_FONT_SIZE) * 100)}\" b=\"${opts.dataLabelFontBold ? '1' : '0'}\" i=\"${opts.dataLabelFontItalic ? '1' : '0'}\" u=\"none\" strike=\"noStrike\">`\n\t\t\tstrXml += ' <a:solidFill>' + createColorElement(opts.dataLabelColor || DEF_FONT_COLOR) + '</a:solidFill>'\n\t\t\tstrXml += ' ' + createChartTextFonts(opts.dataLabelFontFace || 'Arial')\n\t\t\tstrXml += ' </a:defRPr>'\n\t\t\tstrXml += ' </a:pPr>'\n\t\t\tstrXml += ' </a:p>'\n\t\t\tstrXml += ' </c:txPr>'\n\t\t\tstrXml += chartType === CHART_TYPE.PIE ? `<c:dLblPos val=\"${opts.dataLabelPosition || 'ctr'}\"/>` : ''\n\t\t\tstrXml += ' <c:showLegendKey val=\"0\"/>'\n\t\t\tstrXml += ' <c:showVal val=\"0\"/>'\n\t\t\tstrXml += ' <c:showCatName val=\"1\"/>'\n\t\t\tstrXml += ' <c:showSerName val=\"0\"/>'\n\t\t\tstrXml += ' <c:showPercent val=\"1\"/>'\n\t\t\tstrXml += ' <c:showBubbleSize val=\"0\"/>'\n\t\t\tstrXml += ` <c:showLeaderLines val=\"${opts.showLeaderLines ? '1' : '0'}\"/>`\n\t\t\tstrXml += createLeaderLinesElement(opts)\n\t\t\tstrXml += '</c:dLbls>'\n\n\t\t\t// 2: \"Categories\"\n\t\t\tstrXml += '<c:cat>'\n\t\t\tstrXml += ' <c:strRef>'\n\t\t\tstrXml += ` <c:f>Sheet1!$A$2:$A$${optsChartData.labels[0].length + 1}</c:f>`\n\t\t\tstrXml += ' <c:strCache>'\n\t\t\tstrXml += ` <c:ptCount val=\"${optsChartData.labels[0].length}\"/>`\n\t\t\toptsChartData.labels[0].forEach((label, idx) => {\n\t\t\t\tstrXml += `<c:pt idx=\"${idx}\"><c:v>${encodeXmlEntities(label)}</c:v></c:pt>`\n\t\t\t})\n\t\t\tstrXml += ' </c:strCache>'\n\t\t\tstrXml += ' </c:strRef>'\n\t\t\tstrXml += '</c:cat>'\n\n\t\t\t// 3: Create vals\n\t\t\tstrXml += ' <c:val>'\n\t\t\tstrXml += ' <c:numRef>'\n\t\t\tstrXml += ` <c:f>Sheet1!$B$2:$B$${optsChartData.labels[0].length + 1}</c:f>`\n\t\t\tstrXml += ' <c:numCache>'\n\t\t\tstrXml += ' <c:formatCode>' + valFmtCode + '</c:formatCode>'\n\t\t\tstrXml += ` <c:ptCount val=\"${optsChartData.labels[0].length}\"/>`\n\t\t\toptsChartData.values.forEach((value, idx) => {\n\t\t\t\tstrXml += `<c:pt idx=\"${idx}\"><c:v>${value || value === 0 ? value : ''}</c:v></c:pt>`\n\t\t\t})\n\t\t\tstrXml += ' </c:numCache>'\n\t\t\tstrXml += ' </c:numRef>'\n\t\t\tstrXml += ' </c:val>'\n\n\t\t\t// 4: Close \"SERIES\"\n\t\t\tstrXml += ' </c:ser>'\n\t\t\tstrXml += ` <c:firstSliceAng val=\"${opts.firstSliceAng ? Math.round(opts.firstSliceAng) : 0}\"/>`\n\t\t\tif (chartType === CHART_TYPE.DOUGHNUT) strXml += `<c:holeSize val=\"${typeof opts.holeSize === 'number' ? opts.holeSize : '50'}\"/>`\n\t\t\tstrXml += '</c:' + chartType + 'Chart>'\n\n\t\t\t// Done with Doughnut/Pie\n\t\t\tbreak\n\t\tdefault:\n\t\t\tstrXml += ''\n\t\t\tbreak\n\t}\n\n\treturn strXml\n}\n\n/**\n * Create Category axis\n * @param {IChartOptsLib} opts - chart options\n * @param {string} axisId - value\n * @param {string} valAxisId - value\n * @return {string} XML\n */\nfunction makeCatAxis (opts: IChartOptsLib, axisId: string, valAxisId: string): string {\n\tlet strXml = ''\n\tconst usesValueAxisForCategories =\n\t\topts._type === CHART_TYPE.SCATTER || opts._type === CHART_TYPE.BUBBLE || opts._type === CHART_TYPE.BUBBLE3D\n\tconst usesCategoryAxis = !usesValueAxisForCategories && !opts.catLabelFormatCode\n\n\t// Build cat axis tag\n\t// NOTE: Scatter and Bubble chart need two Val axises as they display numbers on x axis\n\tif (usesValueAxisForCategories) {\n\t\tstrXml += '<c:valAx>'\n\t} else {\n\t\tstrXml += '<c:' + (opts.catLabelFormatCode ? 'dateAx' : 'catAx') + '>'\n\t}\n\tstrXml += ' <c:axId val=\"' + axisId + '\"/>'\n\tstrXml += ' <c:scaling>'\n\tstrXml += '<c:orientation val=\"' + (opts.catAxisOrientation || (opts.barDir === 'col' ? 'minMax' : 'minMax')) + '\"/>'\n\tif (opts.catAxisMaxVal || opts.catAxisMaxVal === 0) strXml += `<c:max val=\"${opts.catAxisMaxVal}\"/>`\n\tif (opts.catAxisMinVal || opts.catAxisMinVal === 0) strXml += `<c:min val=\"${opts.catAxisMinVal}\"/>`\n\tstrXml += '</c:scaling>'\n\tstrXml += ' <c:delete val=\"' + (opts.catAxisHidden ? '1' : '0') + '\"/>'\n\tstrXml += ' <c:axPos val=\"' + (opts.barDir === 'col' ? 'b' : 'l') + '\"/>'\n\tstrXml += opts.catGridLine.style !== 'none' ? createGridLineElement(opts.catGridLine) : ''\n\t// '<c:title>' comes between '</c:majorGridlines>' and '<c:numFmt>'\n\tif (opts.showCatAxisTitle) {\n\t\tstrXml += genXmlTitle({\n\t\t\tcolor: opts.catAxisTitleColor,\n\t\t\tfontFace: opts.catAxisTitleFontFace,\n\t\t\tfontSize: opts.catAxisTitleFontSize,\n\t\t\ttitleRotate: opts.catAxisTitleRotate,\n\t\t\ttitle: opts.catAxisTitle || 'Axis Title',\n\t\t})\n\t}\n\t// NOTE: Adding Val Axis Formatting if scatter or bubble charts\n\tif (opts._type === CHART_TYPE.SCATTER || opts._type === CHART_TYPE.BUBBLE || opts._type === CHART_TYPE.BUBBLE3D) {\n\t\tconst xAxisFmtCode = opts.catAxisLabelFormatCode ?? opts.valAxisLabelFormatCode\n\t\tstrXml += ' <c:numFmt formatCode=\"' + (xAxisFmtCode ? encodeXmlEntities(xAxisFmtCode) : 'General') + '\" sourceLinked=\"1\"/>'\n\t} else {\n\t\tstrXml += ' <c:numFmt formatCode=\"' + (encodeXmlEntities(opts.catLabelFormatCode) || 'General') + '\" sourceLinked=\"1\"/>'\n\t}\n\tif (opts._type === CHART_TYPE.SCATTER) {\n\t\tstrXml += ' <c:majorTickMark val=\"none\"/>'\n\t\tstrXml += ' <c:minorTickMark val=\"none\"/>'\n\t\tstrXml += ' <c:tickLblPos val=\"' + (opts.catAxisLabelPos || 'nextTo') + '\"/>'\n\t} else {\n\t\tstrXml += ' <c:majorTickMark val=\"' + (opts.catAxisMajorTickMark || 'out') + '\"/>'\n\t\tstrXml += ' <c:minorTickMark val=\"' + (opts.catAxisMinorTickMark || 'none') + '\"/>'\n\t\tstrXml += ' <c:tickLblPos val=\"' + (opts.catAxisLabelPos || (opts.barDir === 'col' ? 'low' : 'nextTo')) + '\"/>'\n\t}\n\tstrXml += ' <c:spPr>'\n\tstrXml += ` <a:ln w=\"${opts.catAxisLineSize ? valToPts(opts.catAxisLineSize) : ONEPT}\" cap=\"flat\">`\n\tstrXml += !opts.catAxisLineShow ? '<a:noFill/>' : '<a:solidFill>' + createColorElement(opts.catAxisLineColor || DEF_CHART_GRIDLINE.color) + '</a:solidFill>'\n\tstrXml += ' <a:prstDash val=\"' + (opts.catAxisLineStyle || 'solid') + '\"/>'\n\tstrXml += ' <a:round/>'\n\tstrXml += ' </a:ln>'\n\tstrXml += ' </c:spPr>'\n\tstrXml += ' <c:txPr>'\n\tif (opts.catAxisLabelRotate) {\n\t\tstrXml += `<a:bodyPr rot=\"${convertRotationDegrees(opts.catAxisLabelRotate)}\"/>`\n\t} else {\n\t\t// NOTE: don't specify \"`rot=0\" - that way the object will be auto behavior\n\t\tstrXml += '<a:bodyPr/>'\n\t}\n\tstrXml += ' <a:lstStyle/>'\n\tstrXml += ' <a:p>'\n\tstrXml += ' <a:pPr>'\n\tstrXml += ` <a:defRPr sz=\"${Math.round((opts.catAxisLabelFontSize || DEF_FONT_SIZE) * 100)}\" b=\"${opts.catAxisLabelFontBold ? 1 : 0}\" i=\"${opts.catAxisLabelFontItalic ? 1 : 0}\" u=\"none\" strike=\"noStrike\">`\n\tstrXml += ' <a:solidFill>' + createColorElement(opts.catAxisLabelColor || DEF_FONT_COLOR) + '</a:solidFill>'\n\tstrXml += ' ' + createChartTextFonts(opts.catAxisLabelFontFace || 'Arial')\n\tstrXml += ' </a:defRPr>'\n\tstrXml += ' </a:pPr>'\n\tstrXml += ' <a:endParaRPr lang=\"' + (opts.lang || 'en-US') + '\"/>'\n\tstrXml += ' </a:p>'\n\tstrXml += ' </c:txPr>'\n\tstrXml += ' <c:crossAx val=\"' + valAxisId + '\"/>'\n\tconst valAxisCrossTag = typeof opts.valAxisCrossesAt === 'number' ? 'crossesAt' : 'crosses'\n\tconst valAxisCrossValue = typeof opts.valAxisCrossesAt === 'number' ? opts.valAxisCrossesAt : opts.valAxisCrossesAt || 'autoZero'\n\tstrXml += ` <c:${valAxisCrossTag} val=\"${valAxisCrossValue}\"/>`\n\tif (!usesValueAxisForCategories) strXml += ' <c:auto val=\"1\"/>'\n\tif (usesCategoryAxis) {\n\t\tstrXml += ' <c:lblAlgn val=\"ctr\"/>'\n\t\tif (opts.catAxisLabelFrequency) strXml += ' <c:tickLblSkip val=\"' + opts.catAxisLabelFrequency + '\"/>'\n\t\tstrXml += ` <c:noMultiLvlLbl val=\"${opts.catAxisMultiLevelLabels ? 0 : 1}\"/>`\n\t}\n\n\t// Issue#149: PPT will auto-adjust these as needed after calcing the date bounds, so we only include them when specified by user\n\t// Allow major and minor units to be set for double value axis charts\n\tif (opts.catLabelFormatCode || usesValueAxisForCategories) {\n\t\tif (opts.catLabelFormatCode) {\n\t\t\t;(['catAxisBaseTimeUnit', 'catAxisMajorTimeUnit', 'catAxisMinorTimeUnit'] as const).forEach(opt => {\n\t\t\t\t// Validate input as poorly chosen/garbage options will cause chart corruption and it wont render at all!\n\t\t\t\tconst optVal = opts[opt]\n\t\t\t\tif (optVal && (typeof optVal !== 'string' || !VALID_CHART_TIME_UNITS.includes(optVal.toLowerCase()))) {\n\t\t\t\t\tconsole.warn(`\"${opt}\" must be one of: 'days','months','years' !`)\n\t\t\t\t\topts[opt] = null\n\t\t\t\t}\n\t\t\t})\n\t\t\tif (opts.catAxisBaseTimeUnit) strXml += '<c:baseTimeUnit val=\"' + opts.catAxisBaseTimeUnit.toLowerCase() + '\"/>'\n\t\t\tif (opts.catAxisMajorTimeUnit) strXml += '<c:majorTimeUnit val=\"' + opts.catAxisMajorTimeUnit.toLowerCase() + '\"/>'\n\t\t\tif (opts.catAxisMinorTimeUnit) strXml += '<c:minorTimeUnit val=\"' + opts.catAxisMinorTimeUnit.toLowerCase() + '\"/>'\n\t\t}\n\t\tif (opts.catAxisMajorUnit) strXml += `<c:majorUnit val=\"${opts.catAxisMajorUnit}\"/>`\n\t\tif (opts.catAxisMinorUnit) strXml += `<c:minorUnit val=\"${opts.catAxisMinorUnit}\"/>`\n\t}\n\n\t// Close cat axis tag\n\t// NOTE: Added closing tag of val or cat axis based on chart type\n\tif (usesValueAxisForCategories) {\n\t\tstrXml += '</c:valAx>'\n\t} else {\n\t\tstrXml += '</c:' + (opts.catLabelFormatCode ? 'dateAx' : 'catAx') + '>'\n\t}\n\n\treturn strXml\n}\n\n/**\n * Create Value Axis (Used by `bar3D`)\n * @param {IChartOptsLib} opts - chart options\n * @param {string} valAxisId - value\n * @return {string} XML\n */\nfunction makeValAxis (opts: IChartOptsLib, valAxisId: string): string {\n\tlet axisPos = valAxisId === AXIS_ID_VALUE_PRIMARY ? (opts.barDir === 'col' ? 'l' : 'b') : opts.barDir !== 'col' ? 'r' : 't'\n\tif (valAxisId === AXIS_ID_VALUE_SECONDARY) axisPos = 'r' // default behavior for PPT is showing 2nd val axis on right (primary axis on left)\n\tconst crossAxId = valAxisId === AXIS_ID_VALUE_PRIMARY ? AXIS_ID_CATEGORY_PRIMARY : AXIS_ID_CATEGORY_SECONDARY\n\tlet strXml = ''\n\n\tstrXml += '<c:valAx>'\n\tstrXml += ' <c:axId val=\"' + valAxisId + '\"/>'\n\tstrXml += ' <c:scaling>'\n\tif (opts.valAxisLogScaleBase) strXml += `<c:logBase val=\"${opts.valAxisLogScaleBase}\"/>`\n\tstrXml += '<c:orientation val=\"' + (opts.valAxisOrientation || (opts.barDir === 'col' ? 'minMax' : 'minMax')) + '\"/>'\n\tif (opts.valAxisMaxVal || opts.valAxisMaxVal === 0) strXml += `<c:max val=\"${opts.valAxisMaxVal}\"/>`\n\tif (opts.valAxisMinVal || opts.valAxisMinVal === 0) strXml += `<c:min val=\"${opts.valAxisMinVal}\"/>`\n\tstrXml += ' </c:scaling>'\n\tstrXml += ` <c:delete val=\"${opts.valAxisHidden ? 1 : 0}\"/>`\n\tstrXml += ' <c:axPos val=\"' + axisPos + '\"/>'\n\tif (opts.valGridLine.style !== 'none') strXml += createGridLineElement(opts.valGridLine)\n\t// '<c:title>' comes between '</c:majorGridlines>' and '<c:numFmt>'\n\tif (opts.showValAxisTitle) {\n\t\tstrXml += genXmlTitle({\n\t\t\tcolor: opts.valAxisTitleColor,\n\t\t\tfontFace: opts.valAxisTitleFontFace,\n\t\t\tfontSize: opts.valAxisTitleFontSize,\n\t\t\ttitleRotate: opts.valAxisTitleRotate,\n\t\t\ttitle: opts.valAxisTitle || 'Axis Title',\n\t\t})\n\t}\n\tstrXml += `<c:numFmt formatCode=\"${opts.valAxisLabelFormatCode ? encodeXmlEntities(opts.valAxisLabelFormatCode) : 'General'}\" sourceLinked=\"0\"/>`\n\tif (opts._type === CHART_TYPE.SCATTER) {\n\t\tstrXml += ' <c:majorTickMark val=\"none\"/>'\n\t\tstrXml += ' <c:minorTickMark val=\"none\"/>'\n\t\tstrXml += ' <c:tickLblPos val=\"nextTo\"/>'\n\t} else {\n\t\tstrXml += ' <c:majorTickMark val=\"' + (opts.valAxisMajorTickMark || 'out') + '\"/>'\n\t\tstrXml += ' <c:minorTickMark val=\"' + (opts.valAxisMinorTickMark || 'none') + '\"/>'\n\t\tstrXml += ' <c:tickLblPos val=\"' + (opts.valAxisLabelPos || (opts.barDir === 'col' ? 'nextTo' : 'low')) + '\"/>'\n\t}\n\tstrXml += ' <c:spPr>'\n\tstrXml += ` <a:ln w=\"${opts.valAxisLineSize ? valToPts(opts.valAxisLineSize) : ONEPT}\" cap=\"flat\">`\n\tstrXml += !opts.valAxisLineShow ? '<a:noFill/>' : '<a:solidFill>' + createColorElement(opts.valAxisLineColor || DEF_CHART_GRIDLINE.color) + '</a:solidFill>'\n\tstrXml += ' <a:prstDash val=\"' + (opts.valAxisLineStyle || 'solid') + '\"/>'\n\tstrXml += ' <a:round/>'\n\tstrXml += ' </a:ln>'\n\tstrXml += ' </c:spPr>'\n\tstrXml += ' <c:txPr>'\n\tstrXml += ` <a:bodyPr${opts.valAxisLabelRotate ? (' rot=\"' + convertRotationDegrees(opts.valAxisLabelRotate).toString() + '\"') : ''}/>` // don't specify rot 0 so we get the auto behavior\n\tstrXml += ' <a:lstStyle/>'\n\tstrXml += ' <a:p>'\n\tstrXml += ' <a:pPr>'\n\tstrXml += ` <a:defRPr sz=\"${Math.round((opts.valAxisLabelFontSize || DEF_FONT_SIZE) * 100)}\" b=\"${opts.valAxisLabelFontBold ? 1 : 0}\" i=\"${opts.valAxisLabelFontItalic ? 1 : 0}\" u=\"none\" strike=\"noStrike\">`\n\tstrXml += ' <a:solidFill>' + createColorElement(opts.valAxisLabelColor || DEF_FONT_COLOR) + '</a:solidFill>'\n\tstrXml += ' ' + createChartTextFonts(opts.valAxisLabelFontFace || 'Arial')\n\tstrXml += ' </a:defRPr>'\n\tstrXml += ' </a:pPr>'\n\tstrXml += ' <a:endParaRPr lang=\"' + (opts.lang || 'en-US') + '\"/>'\n\tstrXml += ' </a:p>'\n\tstrXml += ' </c:txPr>'\n\tstrXml += ' <c:crossAx val=\"' + crossAxId + '\"/>'\n\tif (typeof opts.catAxisCrossesAt === 'number') {\n\t\tstrXml += ` <c:crossesAt val=\"${opts.catAxisCrossesAt}\"/>`\n\t} else if (typeof opts.catAxisCrossesAt === 'string') {\n\t\tstrXml += ' <c:crosses val=\"' + opts.catAxisCrossesAt + '\"/>'\n\t} else {\n\t\tconst isRight = axisPos === 'r' || axisPos === 't'\n\t\tconst crosses = isRight ? 'max' : 'autoZero'\n\t\tstrXml += ' <c:crosses val=\"' + crosses + '\"/>'\n\t}\n\tstrXml +=\n\t\t' <c:crossBetween val=\"' +\n\t\t(opts.valAxisCrossBetween\n\t\t\t? opts.valAxisCrossBetween\n\t\t\t: opts._type === CHART_TYPE.SCATTER || (!!(Array.isArray(opts._type) && opts._type.some(type => type.type === CHART_TYPE.AREA)))\n\t\t\t\t? 'midCat'\n\t\t\t\t: 'between') +\n\t\t'\"/>'\n\tif (opts.valAxisMajorUnit) strXml += ` <c:majorUnit val=\"${opts.valAxisMajorUnit}\"/>`\n\tif (opts.valAxisDisplayUnit) { strXml += `<c:dispUnits><c:builtInUnit val=\"${opts.valAxisDisplayUnit}\"/>${opts.valAxisDisplayUnitLabel ? '<c:dispUnitsLbl/>' : ''}</c:dispUnits>` }\n\n\tstrXml += '</c:valAx>'\n\n\treturn strXml\n}\n\n/**\n * Create Series Axis (Used by `bar3D`)\n * @param {IChartOptsLib} opts - chart options\n * @param {string} axisId - axis ID\n * @param {string} valAxisId - value\n * @return {string} XML\n */\nfunction makeSerAxis (opts: IChartOptsLib, axisId: string, valAxisId: string): string {\n\tlet strXml = ''\n\n\t// Build ser axis tag\n\tstrXml += '<c:serAx>'\n\tstrXml += ' <c:axId val=\"' + axisId + '\"/>'\n\tstrXml += ' <c:scaling><c:orientation val=\"' + (opts.serAxisOrientation || (opts.barDir === 'col' ? 'minMax' : 'minMax')) + '\"/></c:scaling>'\n\tstrXml += ' <c:delete val=\"' + (opts.serAxisHidden ? '1' : '0') + '\"/>'\n\tstrXml += ' <c:axPos val=\"' + (opts.barDir === 'col' ? 'b' : 'l') + '\"/>'\n\tstrXml += opts.serGridLine.style !== 'none' ? createGridLineElement(opts.serGridLine) : ''\n\t// '<c:title>' comes between '</c:majorGridlines>' and '<c:numFmt>'\n\tif (opts.showSerAxisTitle) {\n\t\tstrXml += genXmlTitle({\n\t\t\tcolor: opts.serAxisTitleColor,\n\t\t\tfontFace: opts.serAxisTitleFontFace,\n\t\t\tfontSize: opts.serAxisTitleFontSize,\n\t\t\ttitleRotate: opts.serAxisTitleRotate,\n\t\t\ttitle: opts.serAxisTitle || 'Axis Title',\n\t\t})\n\t}\n\tstrXml += ` <c:numFmt formatCode=\"${encodeXmlEntities(opts.serLabelFormatCode) || 'General'}\" sourceLinked=\"0\"/>`\n\tstrXml += ' <c:majorTickMark val=\"out\"/>'\n\tstrXml += ' <c:minorTickMark val=\"none\"/>'\n\tstrXml += ` <c:tickLblPos val=\"${opts.serAxisLabelPos || opts.barDir === 'col' ? 'low' : 'nextTo'}\"/>`\n\tstrXml += ' <c:spPr>'\n\tstrXml += ' <a:ln w=\"12700\" cap=\"flat\">'\n\tstrXml += !opts.serAxisLineShow ? '<a:noFill/>' : `<a:solidFill>${createColorElement(opts.serAxisLineColor || DEF_CHART_GRIDLINE.color)}</a:solidFill>`\n\tstrXml += ' <a:prstDash val=\"solid\"/>'\n\tstrXml += ' <a:round/>'\n\tstrXml += ' </a:ln>'\n\tstrXml += ' </c:spPr>'\n\tstrXml += ' <c:txPr>'\n\tstrXml += ' <a:bodyPr/>' // don't specify rot 0 so we get the auto behavior\n\tstrXml += ' <a:lstStyle/>'\n\tstrXml += ' <a:p>'\n\tstrXml += ' <a:pPr>'\n\tstrXml += ` <a:defRPr sz=\"${Math.round((opts.serAxisLabelFontSize || DEF_FONT_SIZE) * 100)}\" b=\"${opts.serAxisLabelFontBold ? '1' : '0'}\" i=\"${opts.serAxisLabelFontItalic ? '1' : '0'}\" u=\"none\" strike=\"noStrike\">`\n\tstrXml += ` <a:solidFill>${createColorElement(opts.serAxisLabelColor || DEF_FONT_COLOR)}</a:solidFill>`\n\tstrXml += ' ' + createChartTextFonts(opts.serAxisLabelFontFace || 'Arial')\n\tstrXml += ' </a:defRPr>'\n\tstrXml += ' </a:pPr>'\n\tstrXml += ' <a:endParaRPr lang=\"' + (opts.lang || 'en-US') + '\"/>'\n\tstrXml += ' </a:p>'\n\tstrXml += ' </c:txPr>'\n\tstrXml += ' <c:crossAx val=\"' + valAxisId + '\"/>'\n\tstrXml += ' <c:crosses val=\"autoZero\"/>'\n\tif (opts.serAxisLabelFrequency) strXml += ' <c:tickLblSkip val=\"' + opts.serAxisLabelFrequency + '\"/>'\n\n\t// Issue#149: PPT will auto-adjust these as needed after calcing the date bounds, so we only include them when specified by user\n\tif (opts.serLabelFormatCode) {\n\t\t;(['serAxisBaseTimeUnit', 'serAxisMajorTimeUnit', 'serAxisMinorTimeUnit'] as const).forEach(opt => {\n\t\t\t// Validate input as poorly chosen/garbage options will cause chart corruption and it wont render at all!\n\t\t\tconst optVal = opts[opt]\n\t\t\tif (optVal && (typeof optVal !== 'string' || !VALID_CHART_TIME_UNITS.includes(optVal.toLowerCase()))) {\n\t\t\t\tconsole.warn(`\"${opt}\" must be one of: 'days','months','years' !`)\n\t\t\t\topts[opt] = null\n\t\t\t}\n\t\t})\n\t\tif (opts.serAxisBaseTimeUnit) strXml += ` <c:baseTimeUnit val=\"${opts.serAxisBaseTimeUnit.toLowerCase()}\"/>`\n\t\tif (opts.serAxisMajorTimeUnit) strXml += ` <c:majorTimeUnit val=\"${opts.serAxisMajorTimeUnit.toLowerCase()}\"/>`\n\t\tif (opts.serAxisMinorTimeUnit) strXml += ` <c:minorTimeUnit val=\"${opts.serAxisMinorTimeUnit.toLowerCase()}\"/>`\n\t\tif (opts.serAxisMajorUnit) strXml += ` <c:majorUnit val=\"${opts.serAxisMajorUnit}\"/>`\n\t\tif (opts.serAxisMinorUnit) strXml += ` <c:minorUnit val=\"${opts.serAxisMinorUnit}\"/>`\n\t}\n\n\t// Close ser axis tag\n\tstrXml += '</c:serAx>'\n\n\treturn strXml\n}\n\n/**\n * Create char title elements\n * @param {IChartPropsTitle} opts - options\n * @return {string} XML `<c:title>`\n */\nfunction genXmlTitle (opts: IChartPropsTitle, chartX?: number, chartY?: number): string {\n\tconst align = opts.titleAlign === 'left' || opts.titleAlign === 'right' ? `<a:pPr algn=\"${opts.titleAlign.slice(0, 1)}\">` : '<a:pPr>'\n\tconst rotate = opts.titleRotate ? `<a:bodyPr rot=\"${convertRotationDegrees(opts.titleRotate)}\"/>` : '<a:bodyPr/>' // don't specify rotation to get default (ex. vertical for cat axis)\n\tconst sizeAttr = opts.fontSize ? `sz=\"${Math.round(opts.fontSize * 100)}\"` : '' // only set the font size if specified. Powerpoint will handle the default size\n\tconst titleBold = opts.titleBold ? 1 : 0\n\tconst titleItalic = opts.titleItalic ? 1 : 0\n\tconst titleUnderline = opts.titleUnderline ? 'sng' : 'none'\n\n\tlet layout = '<c:layout/>'\n\tconst hasX = opts.titlePos && typeof opts.titlePos.x === 'number'\n\tconst hasY = opts.titlePos && typeof opts.titlePos.y === 'number'\n\tif (hasX || hasY) {\n\t\t// NOTE: manualLayout x/y vals are *relative to entire slide*. Each axis is\n\t\t// independent in CT_ManualLayout: omitting xMode/x (or yMode/y) leaves that\n\t\t// axis on automatic layout, so a caller can center horizontally while still\n\t\t// applying a manual vertical offset (and vice-versa). (upstream #1363)\n\t\t// Schema order is xMode, yMode, x, y.\n\t\tlet modes = ''\n\t\tlet vals = ''\n\t\tif (hasX) {\n\t\t\tconst totalX = opts.titlePos.x + chartX\n\t\t\tlet valX = totalX === 0 ? 0 : (totalX * (totalX / 5)) / 10\n\t\t\tif (valX >= 1) valX = valX / 10\n\t\t\tif (valX >= 0.1) valX = valX / 10\n\t\t\tmodes += '<c:xMode val=\"edge\"/>'\n\t\t\tvals += `<c:x val=\"${valX}\"/>`\n\t\t}\n\t\tif (hasY) {\n\t\t\tconst totalY = opts.titlePos.y + chartY\n\t\t\tlet valY = totalY === 0 ? 0 : (totalY * (totalY / 5)) / 10\n\t\t\tif (valY >= 1) valY = valY / 10\n\t\t\tif (valY >= 0.1) valY = valY / 10\n\t\t\tmodes += '<c:yMode val=\"edge\"/>'\n\t\t\tvals += `<c:y val=\"${valY}\"/>`\n\t\t}\n\t\tlayout = `<c:layout><c:manualLayout>${modes}${vals}</c:manualLayout></c:layout>`\n\t}\n\n\treturn `<c:title>\n <c:tx>\n <c:rich>\n ${rotate}\n <a:lstStyle/>\n <a:p>\n ${align}\n <a:defRPr ${sizeAttr} b=\"${titleBold}\" i=\"${titleItalic}\" u=\"${titleUnderline}\" strike=\"noStrike\">\n <a:solidFill>${createColorElement(opts.color || DEF_FONT_COLOR)}</a:solidFill>\n ${createChartTextFonts(opts.fontFace || 'Arial')}\n </a:defRPr>\n </a:pPr>\n <a:r>\n <a:rPr ${sizeAttr} b=\"${titleBold}\" i=\"${titleItalic}\" u=\"${titleUnderline}\" strike=\"noStrike\">\n <a:solidFill>${createColorElement(opts.color || DEF_FONT_COLOR)}</a:solidFill>\n ${createChartTextFonts(opts.fontFace || 'Arial')}\n </a:rPr>\n <a:t>${encodeXmlEntities(opts.title) || ''}</a:t>\n </a:r>\n </a:p>\n </c:rich>\n </c:tx>\n ${layout}\n <c:overlay val=\"0\"/>\n </c:title>`\n}\n\n/**\n * Calc and return excel column name for a given column length\n * @param colIndex column index\n * @return column name\n * @example 1 returns 'A'\n * @example 27 returns 'AA'\n */\nfunction getExcelColName (colIndex: number): string {\n\tlet colStr: string\n\tconst colIdx = colIndex - 1 // Subtract 1 so `LETTERS[columnIndex]` returns \"A\" etc\n\n\tif (colIdx <= 25) {\n\t\t// A-Z\n\t\tcolStr = LETTERS[colIdx]\n\t} else {\n\t\t// AA-ZZ (ZZ = index 702)\n\t\tcolStr = `${LETTERS[Math.floor(colIdx / LETTERS.length - 1)]}${LETTERS[colIdx % LETTERS.length]}`\n\t}\n\n\treturn colStr\n}\n\n/**\n * Creates `a:innerShdw` or `a:outerShdw` depending on pass options `opts`.\n * @param {Object} opts optional shadow properties\n * @param {Object} defaults defaults for unspecified properties in `opts`\n * @see http://officeopenxml.com/drwSp-effects.php\n * @example { type: 'outer', blur: 3, offset: (23000 / 12700), angle: 90, color: '000000', opacity: 0.35, rotateWithShape: true };\n * @return {string} XML\n */\nfunction createShadowElement (options: ShadowProps, defaults: object): string {\n\tif (!options) {\n\t\treturn '<a:effectLst/>'\n\t} else if (typeof options !== 'object') {\n\t\tconsole.warn('`shadow` options must be an object. Ex: `{shadow: {type:\\'none\\'}}`')\n\t\treturn '<a:effectLst/>'\n\t}\n\n\tlet strXml = '<a:effectLst>'\n\tconst opts = { ...defaults, ...options }\n\tconst type = opts.type || 'outer'\n\tconst blur = valToPts(opts.blur)\n\tconst offset = valToPts(opts.offset)\n\tconst angle = Math.round(opts.angle * 60000)\n\tconst color = opts.color\n\tconst opacity = Math.round(opts.opacity * 100000)\n\tconst rotShape = opts.rotateWithShape ? 1 : 0\n\n\tstrXml += `<a:${type}Shdw sx=\"100000\" sy=\"100000\" kx=\"0\" ky=\"0\" algn=\"bl\" blurRad=\"${blur}\" rotWithShape=\"${rotShape}\" dist=\"${offset}\" dir=\"${angle}\">`\n\tstrXml += `<a:srgbClr val=\"${color}\">`\n\tstrXml += `<a:alpha val=\"${opacity}\"/></a:srgbClr>`\n\tstrXml += `</a:${type}Shdw>`\n\tstrXml += '</a:effectLst>'\n\n\treturn strXml\n}\n\n/**\n * Create Grid Line Element\n * @param {OptsChartGridLine} glOpts {size, color, style}\n * @return {string} XML\n */\nfunction createGridLineElement (glOpts: OptsChartGridLine): string {\n\tlet strXml = '<c:majorGridlines>'\n\tstrXml += ' <c:spPr>'\n\tstrXml += ` <a:ln w=\"${valToPts(glOpts.size || DEF_CHART_GRIDLINE.size)}\" cap=\"${createLineCap(glOpts.cap || DEF_CHART_GRIDLINE.cap)}\">`\n\tstrXml += ' <a:solidFill><a:srgbClr val=\"' + (glOpts.color || DEF_CHART_GRIDLINE.color) + '\"/></a:solidFill>' // should accept scheme colors as implemented in [Pull #135]\n\tstrXml += ' <a:prstDash val=\"' + (glOpts.style || DEF_CHART_GRIDLINE.style) + '\"/><a:round/>'\n\tstrXml += ' </a:ln>'\n\tstrXml += ' </c:spPr>'\n\tstrXml += '</c:majorGridlines>'\n\n\treturn strXml\n}\n\n/**\n * Build a `<c:pt>` numeric-cache data point, or '' to leave a gap.\n *\n * `<c:v>` inside a `<c:numCache>` is an `xsd:double`; emitting `NaN`, `Infinity`\n * or an empty string yields an invalid value that makes PowerPoint report the\n * package as needing repair. Null/undefined are intentional gaps and are skipped\n * silently (a sparse, idx-keyed cache is valid); other non-finite numbers are\n * skipped with a warning, per the library's \"warn rather than emit a degenerate\n * result\" policy.\n * @param idx - zero-based data-point index (emitted as `idx`)\n * @param value - numeric value (or null/undefined gap)\n */\nfunction numCachePt (idx: number, value: number | null | undefined): string {\n\tif (value == null) return ''\n\tif (!Number.isFinite(value)) {\n\t\tconsole.warn(`Warning: chart value \"${value}\" at index ${idx} is not a finite number; data point omitted.`)\n\t\treturn ''\n\t}\n\treturn `<c:pt idx=\"${idx}\"><c:v>${value}</c:v></c:pt>`\n}\n\n/**\n * Build a `<c:serLines>` (\"Series Lines\") element for a bar chart.\n * @param opt - `true` for PowerPoint automatic styling, an {@link OptsChartGridLine}\n * to customize the line, or falsy / `{ style: 'none' }` to omit the element.\n */\nfunction createSerLinesElement (opt?: boolean | OptsChartGridLine): string {\n\tif (!opt) return ''\n\tif (opt === true) return '<c:serLines/>'\n\tif (opt.style === 'none') return ''\n\tlet strXml = '<c:serLines><c:spPr>'\n\tstrXml += `<a:ln w=\"${valToPts(opt.size || DEF_CHART_GRIDLINE.size)}\" cap=\"${createLineCap(opt.cap || DEF_CHART_GRIDLINE.cap)}\">`\n\tstrXml += `<a:solidFill><a:srgbClr val=\"${opt.color || DEF_CHART_GRIDLINE.color}\"/></a:solidFill>`\n\tstrXml += `<a:prstDash val=\"${opt.style || DEF_CHART_GRIDLINE.style}\"/><a:round/>`\n\tstrXml += '</a:ln></c:spPr></c:serLines>'\n\n\treturn strXml\n}\n\n/**\n * Build the `<c:leaderLines>` element for pie/doughnut data labels.\n *\n * Schema position: inside `<c:dLbls>`, immediately after `<c:showLeaderLines>`\n * (CT_DLbls / Group_DLbls order: showLeaderLines → leaderLines).\n *\n * Returns `''` unless the caller both enabled leader lines (`showLeaderLines`)\n * and configured their appearance (`leaderLineColor` / `leaderLineSize`). When\n * appearance is unset we leave the element off so PowerPoint applies its\n * automatic leader-line color, matching prior behavior.\n *\n * @param opts - chart options (reads `showLeaderLines`, `leaderLineColor`, `leaderLineSize`)\n */\nfunction createLeaderLinesElement (opts: IChartOptsLib): string {\n\tif (!opts.showLeaderLines) return ''\n\tif (!opts.leaderLineColor && opts.leaderLineSize == null) return ''\n\tconst w = valToPts(opts.leaderLineSize ?? 0.75)\n\tconst color = opts.leaderLineColor || '808080'\n\treturn (\n\t\t'<c:leaderLines><c:spPr>' +\n\t\t`<a:ln w=\"${w}\" cap=\"flat\"><a:solidFill>${createColorElement(color)}</a:solidFill><a:prstDash val=\"solid\"/><a:round/></a:ln>` +\n\t\t'<a:effectLst/></c:spPr></c:leaderLines>'\n\t)\n}\n\nfunction makeCustomDLblXml (idx: number, text: string, opts: IChartOptsLib): string {\n\tconst sz = Math.round((opts.dataLabelFontSize || DEF_FONT_SIZE) * 100)\n\tconst bold = opts.dataLabelFontBold ? '1' : '0'\n\tconst italic = opts.dataLabelFontItalic ? '1' : '0'\n\tconst color = createColorElement(opts.dataLabelColor || DEF_FONT_COLOR)\n\tconst face = opts.dataLabelFontFace || 'Arial'\n\tconst lang = opts.lang || 'en-US'\n\treturn (\n\t\t`<c:dLbl><c:idx val=\"${idx}\"/>` +\n\t\t'<c:tx><c:rich><a:bodyPr/><a:lstStyle/>' +\n\t\t`<a:p><a:pPr><a:defRPr sz=\"${sz}\" b=\"${bold}\" i=\"${italic}\" u=\"none\" strike=\"noStrike\">` +\n\t\t`<a:solidFill>${color}</a:solidFill>${createChartTextFonts(face)}</a:defRPr></a:pPr>` +\n\t\t`<a:r><a:rPr lang=\"${lang}\" sz=\"${sz}\" b=\"${bold}\" i=\"${italic}\" u=\"none\" strike=\"noStrike\" dirty=\"0\">` +\n\t\t`<a:solidFill>${color}</a:solidFill>${createChartTextFonts(face)}</a:rPr>` +\n\t\t`<a:t>${encodeXmlEntities(text)}</a:t></a:r></a:p>` +\n\t\t'</c:rich></c:tx>' +\n\t\t'<c:showLegendKey val=\"0\"/><c:showVal val=\"0\"/><c:showCatName val=\"0\"/>' +\n\t\t'<c:showSerName val=\"0\"/><c:showPercent val=\"0\"/><c:showBubbleSize val=\"0\"/></c:dLbl>'\n\t)\n}\n\n/**\n * Build an `<a:ln>` border element from a per-data-point `BorderProps`.\n * @param border - point border style (`type`, `color`, `pt`)\n */\nfunction createChartBorderLine (border: BorderProps): string {\n\tif (border.type === 'none') return '<a:ln><a:noFill/></a:ln>'\n\tconst dash = border.type === 'dash' ? 'dash' : 'solid'\n\treturn `<a:ln w=\"${valToPts(border.pt ?? 1)}\" cap=\"flat\"><a:solidFill>${createColorElement(border.color || '666666')}</a:solidFill><a:prstDash val=\"${dash}\"/><a:round/></a:ln>`\n}\n\n/**\n * Build `<c:dPt>` entries for a series in the bar/line/area/scatter loops.\n *\n * Merges two sources into a single `c:dPt` per index so we never emit a\n * duplicate `<c:idx>` (which corrupts the chart):\n * - legacy single-series color-vary fills (bar/scatter), supplied via `varyColors`\n * - per-point `pointStyles` border/fill overrides\n *\n * Must be emitted in schema position *before* `c:dLbls` (CT_*Ser order).\n * RADAR is skipped: extra per-point markup historically corrupts the chart.\n *\n * @param chartType - series chart type\n * @param obj - series data (reads `values`, `pointStyles`)\n * @param opts - chart options (fill/shadow/lineSize context)\n * @param varyColors - color array when single-series color-vary applies, else `null`\n */\nfunction makeSeriesDataPointsXml (chartType: CHART_NAME, obj: IOptsChartData, opts: IChartOptsLib, varyColors: string[] | null): string {\n\tif (chartType === CHART_TYPE.RADAR) return ''\n\tconst pointStyles = obj.pointStyles\n\tif (!varyColors && !pointStyles?.length) return ''\n\n\tconst isBar = chartType === CHART_TYPE.BAR || chartType === CHART_TYPE.BAR3D\n\tconst isScatter = chartType === CHART_TYPE.SCATTER\n\tlet xml = ''\n\tobj.values.forEach((value, index) => {\n\t\tconst ptStyle = pointStyles?.[index]\n\t\tconst arrColors = varyColors ? (value < 0 ? opts.invertedColors || opts.chartColors || BARCHART_COLORS : varyColors) : null\n\t\tconst fillColor = ptStyle?.fill || (arrColors ? arrColors[index % arrColors.length] : null)\n\t\tconst border = ptStyle?.border\n\t\t// Nothing to style for this point -> omit the c:dPt entirely\n\t\tif (!fillColor && !border) return\n\n\t\txml += '<c:dPt>'\n\t\txml += `<c:idx val=\"${index}\"/>`\n\t\tif (isBar) xml += '<c:invertIfNegative val=\"0\"/>'\n\t\txml += '<c:bubble3D val=\"0\"/>'\n\t\txml += '<c:spPr>'\n\t\tif ((isBar || isScatter) && opts.lineSize === 0 && !border && !ptStyle?.fill) {\n\t\t\t// Preserve legacy color-vary behavior: hide outline when lineSize===0\n\t\t\txml += '<a:ln><a:noFill/></a:ln>'\n\t\t} else {\n\t\t\tif (fillColor) {\n\t\t\t\t// BAR3D color-vary historically tints the edge line, not the face fill\n\t\t\t\tif (chartType === CHART_TYPE.BAR3D) xml += `<a:ln><a:solidFill>${createColorElement(fillColor)}</a:solidFill></a:ln>`\n\t\t\t\telse xml += `<a:solidFill>${createColorElement(fillColor)}</a:solidFill>`\n\t\t\t}\n\t\t\tif (border) xml += createChartBorderLine(border)\n\t\t}\n\t\txml += createShadowElement(opts.shadow, DEF_SHAPE_SHADOW)\n\t\txml += '</c:spPr>'\n\t\txml += '</c:dPt>'\n\t})\n\treturn xml\n}\n","/**\n * PptxGenJS: Media Methods\n */\n\nimport { IMG_BROKEN } from './core-enums.js'\nimport type { PresSlideInternal, SlideLayoutInternal, ISlideRelMedia } from './core-interfaces.js'\nimport type { RuntimeAdapter } from './runtime/types.js'\n\ntype SlideMediaRelWithPath = ISlideRelMedia & { path: string }\n\nfunction hasEncodingPath(rel: ISlideRelMedia): rel is SlideMediaRelWithPath {\n\treturn typeof rel.path === 'string' && rel.path.length > 0 && !rel.path.includes('preencoded')\n}\n\n/**\n * Encode Image/Audio/Video into base64\n * @param {PresSlideInternal | SlideLayoutInternal} layout - slide layout\n * @param {RuntimeAdapter} runtime - runtime adapter (Node/browser media loader)\n * @param {'throw' | 'placeholder'} onMediaError - failure policy: reject the export (default) or substitute a placeholder and warn\n * @return {Promise} promise\n */\nexport function encodeSlideMediaRels(\n\tlayout: PresSlideInternal | SlideLayoutInternal,\n\truntime: RuntimeAdapter,\n\tonMediaError: 'throw' | 'placeholder' = 'throw',\n): Array<Promise<string>> {\n\tconst imageProms: Array<Promise<string>> = []\n\n\t// A: Capture all audio/image/video candidates for encoding (filtering online/pre-encoded)\n\tconst candidateRels = layout._relsMedia.filter(\n\t\t(rel): rel is SlideMediaRelWithPath => rel.type !== 'online' && !rel.data && hasEncodingPath(rel)\n\t)\n\n\t// B: PERF: Mark dupes (same `path`) to avoid loading the same media over-and-over!\n\tconst unqPaths: string[] = []\n\tcandidateRels.forEach(rel => {\n\t\tif (!unqPaths.includes(rel.path)) {\n\t\t\trel.isDuplicate = false\n\t\t\tunqPaths.push(rel.path)\n\t\t} else {\n\t\t\trel.isDuplicate = true\n\t\t}\n\t})\n\n\t// STEP 4: Read/Encode each unique media item\n\tcandidateRels\n\t\t.filter(rel => !rel.isDuplicate)\n\t\t.forEach(rel => {\n\t\t\timageProms.push(\n\t\t\t\t(async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\trel.data = await runtime.loadMedia(rel)\n\t\t\t\t\t\tcandidateRels.filter(dupe => dupe.isDuplicate && dupe.path === rel.path).forEach(dupe => (dupe.data = rel.data))\n\t\t\t\t\t\tif (rel.isSvgPng) await runtime.createSvgPngPreview(rel)\n\t\t\t\t\t\treturn 'done'\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tif (onMediaError === 'placeholder') {\n\t\t\t\t\t\t\tconsole.warn(`[WARNING] Failed to load media \"${rel.path}\"; embedding a broken-image placeholder. (${String(ex)})`)\n\t\t\t\t\t\t\trel.data = IMG_BROKEN\n\t\t\t\t\t\t\tcandidateRels.filter(dupe => dupe.isDuplicate && dupe.path === rel.path).forEach(dupe => (dupe.data = rel.data))\n\t\t\t\t\t\t\treturn 'done'\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Default: fail-fast with an actionable error that names the failing asset and\n\t\t\t\t\t\t// chains the original cause (the raw fs/network error alone does not say which\n\t\t\t\t\t\t// media path broke). Pass `onMediaError: 'placeholder'` to degrade gracefully.\n\t\t\t\t\t\tthrow new Error(`Failed to load media \"${rel.path}\" during export.`, { cause: ex })\n\t\t\t\t\t}\n\t\t\t\t})(),\n\t\t\t)\n\t\t})\n\n\t// STEP 5: SVG-PNG previews\n\t// ......: \"SVG:\" base64 data still requires a png to be generated\n\t// ......: (`isSvgPng` flag this as the preview image, not the SVG itself)\n\tlayout._relsMedia\n\t\t.filter(rel => rel.isSvgPng && rel.data)\n\t\t.forEach(rel => {\n\t\t\timageProms.push(runtime.createSvgPngPreview(rel))\n\t\t})\n\n\treturn imageProms\n}\n","/**\n * PptxGenJS: XML Generation\n */\n\nimport {\n\tBULLET_TYPES,\n\tCRLF,\n\tDEF_BULLET_MARGIN,\n\tDEF_CELL_MARGIN_IN,\n\tDEF_PRES_LAYOUT_NAME,\n\tDEF_TEXT_GLOW,\n\tDEF_TEXT_SHADOW,\n\tEMU,\n\tLAYOUT_IDX_SERIES_BASE,\n\tPLACEHOLDER_TYPES,\n\tREGEX_HEX_COLOR,\n\tSLDNUMFLDID,\n\tSLIDE_OBJECT_TYPES,\n\tVALID_SHAPE_PRESETS,\n} from './core-enums.js'\nimport type {\n\tBorderProps,\n\tCustomPropertyValue,\n\tIPresentationProps,\n\tISlideObject,\n\tISlideRel,\n\tISlideRelChart,\n\tISlideRelMedia,\n\tObjectLockProps,\n\tObjectOptions,\n\tPresLayout,\n\tPresSlideInternal,\n\tShadowProps,\n\tSlideLayoutInternal,\n\tTableCell,\n\tTableCellProps,\n\tTableStyleInternal,\n\tTableStyleRegionProps,\n\tTextFitShrinkProps,\n\tTextProps,\n\tTextPropsOptions,\n\tThemeColorScheme,\n} from './core-interfaces.js'\nimport {\n\tconvertRotationDegrees,\n\tcreateColorElement,\n\tcreateGlowElement,\n\tcreateShadowElement,\n\tcreateLineCap,\n\tencodeXmlEntities,\n\tgenXmlColorSelection,\n\tgetDuplicateObjectNames,\n\tgetImageSizeFromBase64,\n\tgetSmartParseNumber,\n\tgetUuid,\n\tinch2Emu,\n\tlineWidthToEmu,\n\tvalToPts,\n} from './gen-utils.js'\n\n// Warn once per distinct message so a recurring out-of-range value (e.g. the same\n// bad fontSize across every cell of a table) does not flood the console.\nconst _warnedTextRangeMsgs = new Set<string>()\nfunction warnTextRangeOnce (msg: string): void {\n\tif (_warnedTextRangeMsgs.has(msg)) return\n\t_warnedTextRangeMsgs.add(msg)\n\tconsole.warn(msg)\n}\n\n/**\n * Clamp a font size (points) into ST_TextFontSize (1-4000pt) and return it in\n * hundredths of a point for the `sz` attribute. Out-of-range sizes make\n * PowerPoint report the package as needing repair (e.g. `sz` > 400000 or < 100).\n */\nfunction clampFontSizeSz (fontSizePts: number): number {\n\tconst raw = Math.round(fontSizePts * 100)\n\tconst clamped = Math.min(400000, Math.max(100, raw))\n\tif (clamped !== raw) warnTextRangeOnce(`Warning: fontSize ${fontSizePts} is outside the valid range 1-4000pt; using ${clamped / 100}.`)\n\treturn clamped\n}\n\n/** Clamp character spacing (points) into ST_TextPoint (-4000..4000pt); returns hundredths for the `spc` attribute. */\nfunction clampCharSpacingSpc (charSpacingPts: number): number {\n\tconst raw = Math.round(charSpacingPts * 100)\n\tconst clamped = Math.min(400000, Math.max(-400000, raw))\n\tif (clamped !== raw) warnTextRangeOnce(`Warning: charSpacing ${charSpacingPts} is outside the valid range -4000..4000pt; using ${clamped / 100}.`)\n\treturn clamped\n}\n\n/** Clamp line spacing (points) into ST_TextSpacingPoint (0..1584pt); returns hundredths for `<a:spcPts val>`. */\nfunction clampLineSpacingPts (lineSpacingPts: number): number {\n\tconst raw = Math.round(lineSpacingPts * 100)\n\tconst clamped = Math.min(158400, Math.max(0, raw))\n\tif (clamped !== raw) warnTextRangeOnce(`Warning: lineSpacing ${lineSpacingPts} is outside the valid range 0-1584pt; using ${clamped / 100}.`)\n\treturn clamped\n}\n\nconst ImageSizingXml = {\n\tcover: function (imgSize: { w: number, h: number }, boxDim: { w: number, h: number, x: number, y: number }) {\n\t\tconst imgRatio = imgSize.h / imgSize.w\n\t\tconst boxRatio = boxDim.h / boxDim.w\n\t\tconst isBoxBased = boxRatio > imgRatio\n\t\tconst width = isBoxBased ? boxDim.h / imgRatio : boxDim.w\n\t\tconst height = isBoxBased ? boxDim.h : boxDim.w * imgRatio\n\t\tconst hzPerc = Math.round(1e5 * 0.5 * (1 - boxDim.w / width))\n\t\tconst vzPerc = Math.round(1e5 * 0.5 * (1 - boxDim.h / height))\n\t\treturn `<a:srcRect l=\"${hzPerc}\" r=\"${hzPerc}\" t=\"${vzPerc}\" b=\"${vzPerc}\"/><a:stretch/>`\n\t},\n\tcontain: function (imgSize: { w: number, h: number }, boxDim: { w: number, h: number, x: number, y: number }) {\n\t\tconst imgRatio = imgSize.h / imgSize.w\n\t\tconst boxRatio = boxDim.h / boxDim.w\n\t\tconst widthBased = boxRatio > imgRatio\n\t\tconst width = widthBased ? boxDim.w : boxDim.h / imgRatio\n\t\tconst height = widthBased ? boxDim.w * imgRatio : boxDim.h\n\t\tconst hzPerc = Math.round(1e5 * 0.5 * (1 - boxDim.w / width))\n\t\tconst vzPerc = Math.round(1e5 * 0.5 * (1 - boxDim.h / height))\n\t\treturn `<a:srcRect l=\"${hzPerc}\" r=\"${hzPerc}\" t=\"${vzPerc}\" b=\"${vzPerc}\"/><a:stretch/>`\n\t},\n\tcrop: function (imgSize: { w: number, h: number }, boxDim: { w: number, h: number, x: number, y: number }) {\n\t\tconst l = boxDim.x\n\t\tconst r = imgSize.w - (boxDim.x + boxDim.w)\n\t\tconst t = boxDim.y\n\t\tconst b = imgSize.h - (boxDim.y + boxDim.h)\n\t\tif (l < 0 || r < 0 || t < 0 || b < 0) {\n\t\t\tconst over = [\n\t\t\t\tl < 0 && `x (${l < 0 ? -l : 0} past left edge)`,\n\t\t\t\tr < 0 && `x+w (${-r} past right edge)`,\n\t\t\t\tt < 0 && `y (${-t} past top edge)`,\n\t\t\t\tb < 0 && `y+h (${-b} past bottom edge)`,\n\t\t\t].filter(Boolean).join(', ')\n\t\t\tthrow new Error(`addImage sizing.type 'crop': crop window overflows image bounds — ${over}. Ensure x≥0, y≥0, x+w≤w, y+h≤h.`)\n\t\t}\n\t\tconst lPerc = Math.round(1e5 * (l / imgSize.w))\n\t\tconst rPerc = Math.round(1e5 * (r / imgSize.w))\n\t\tconst tPerc = Math.round(1e5 * (t / imgSize.h))\n\t\tconst bPerc = Math.round(1e5 * (b / imgSize.h))\n\t\treturn `<a:srcRect l=\"${lPerc}\" r=\"${rPerc}\" t=\"${tPerc}\" b=\"${bPerc}\"/><a:stretch/>`\n\t},\n}\n\n/**\n * Emit an `<a:prstGeom>` for a preset shape, including any adjust values (`<a:avLst>`).\n * Shared by the shape and image code paths so that geometry + adjust handling stays in one place.\n * @param {string} shapeName - preset geometry name (e.g. `rect`, `ellipse`, `roundRect`, `hexagon`)\n * @param {ObjectOptions} options - object options carrying optional `rectRadius`/`angleRange`/`arcThicknessRatio`\n * @param {number} cx - shape width (EMU), used to scale `rectRadius`\n * @param {number} cy - shape height (EMU), used to scale `rectRadius`\n * @return {string} `<a:prstGeom>` XML\n */\n// Shapes whose corner-radius adjust value is named adj1 (+ adj2) instead of adj.\n// Sourced from ECMA-376 Annex D electronic addenda (presetShapeDefinitions.xml).\nconst RECT_RADIUS_ADJ1_SHAPES = new Set(['round2SameRect', 'round2DiagRect'])\n\n// Object lock attributes valid for each DrawingML locking element, in emit order (ECMA-376 §20.1.2.2.x / §20.1.2.2.34).\n// Object keys in `ObjectLockProps` mirror these attribute names 1:1, so serialization is a filtered lookup.\nconst SHAPE_LOCK_ATTRS = ['noGrp', 'noSelect', 'noRot', 'noChangeAspect', 'noMove', 'noResize', 'noEditPoints', 'noAdjustHandles', 'noChangeArrowheads', 'noChangeShapeType', 'noTextEdit'] as const\nconst PICTURE_LOCK_ATTRS = ['noGrp', 'noSelect', 'noRot', 'noChangeAspect', 'noMove', 'noResize', 'noEditPoints', 'noAdjustHandles', 'noChangeArrowheads', 'noChangeShapeType', 'noCrop'] as const\nconst GRAPHIC_FRAME_LOCK_ATTRS = ['noGrp', 'noDrilldown', 'noSelect', 'noChangeAspect', 'noMove', 'noResize'] as const\n\n/**\n * Serialize an object-lock element (`a:spLocks` / `a:picLocks` / `a:graphicFrameLocks`).\n * Only flags set to `true` AND valid for this element type are emitted; a flag set on an\n * unsupported element type is dropped with a warning (silent coercion is a footgun).\n * @param tag - locking element tag, e.g. `'a:spLocks'`\n * @param allowed - attribute names this element type supports, in desired emit order\n * @param locks - merged lock flags (callers fold any hard-coded default in first)\n * @param objectName - for the warning message\n * @returns the locking element string, or `''` when no applicable flag is set\n */\nfunction genXmlObjectLock (tag: string, allowed: readonly string[], locks: ObjectLockProps | undefined, objectName?: string): string {\n\tif (!locks) return ''\n\tconst lockMap = locks as Record<string, boolean | undefined>\n\tfor (const key of Object.keys(lockMap)) {\n\t\tif (lockMap[key] && !allowed.includes(key)) {\n\t\t\tconsole.warn(`Warning: objectLock.${key} is not supported on <${tag}> (object \"${objectName ?? ''}\") and was ignored.`)\n\t\t}\n\t}\n\tconst attrs = allowed.filter(name => lockMap[name] === true).map(name => `${name}=\"1\"`)\n\treturn attrs.length > 0 ? `<${tag} ${attrs.join(' ')}/>` : ''\n}\n\nfunction genXmlPresetGeom (shapeName: string, options: ObjectOptions, cx: number, cy: number): string {\n\t// Safety net for every prstGeom emitter (addShape, addText/addImage `shape`):\n\t// an unknown preset becomes an invalid `prst` value that makes PowerPoint show\n\t// the \"needs repair\" dialog and drop the shape. Fail loudly instead.\n\tif (!VALID_SHAPE_PRESETS.has(shapeName)) {\n\t\tthrow new Error(`Invalid shape \"${String(shapeName)}\"! Use a value from \\`pptxgen.shapes.*\\` (e.g. \\`pptxgen.shapes.RECTANGLE\\`). PowerPoint can't render unknown preset geometries and will drop the shape during repair.`)\n\t}\n\t// Collect adjustment guides; track names so the generic `shapeAdjust` passthrough\n\t// never emits a duplicate `<a:gd>` for a handle a friendly shortcut already set.\n\tlet avLst = ''\n\tconst emittedAdjNames = new Set<string>()\n\tconst emitGuide = (name: string, fmlaVal: number): void => {\n\t\tavLst += `<a:gd name=\"${name}\" fmla=\"val ${fmlaVal}\"/>`\n\t\temittedAdjNames.add(name)\n\t}\n\tif (options.rectRadius) {\n\t\tconst adjVal = Math.round((options.rectRadius * EMU * 100000) / Math.min(cx, cy))\n\t\tif (RECT_RADIUS_ADJ1_SHAPES.has(shapeName)) {\n\t\t\temitGuide('adj1', adjVal)\n\t\t\temitGuide('adj2', 0)\n\t\t} else {\n\t\t\temitGuide('adj', adjVal)\n\t\t}\n\t} else if (options.angleRange) {\n\t\tfor (let i = 0; i < 2; i++) {\n\t\t\tconst angle = options.angleRange[i]\n\t\t\temitGuide(`adj${i + 1}`, convertRotationDegrees(angle))\n\t\t}\n\n\t\tif (options.arcThicknessRatio) {\n\t\t\temitGuide('adj3', Math.round(options.arcThicknessRatio * 50000))\n\t\t}\n\t}\n\t// Generic adjustment handles (`shapeAdjust`) for any preset shape (Issue #1300).\n\tif (options.shapeAdjust) {\n\t\tconst adjusts = Array.isArray(options.shapeAdjust) ? options.shapeAdjust : [options.shapeAdjust]\n\t\tadjusts.forEach(adj => {\n\t\t\t// Silent coercion of a bad guide produces a shape PowerPoint silently drops or repairs,\n\t\t\t// so warn and skip instead of emitting a degenerate `<a:gd>`.\n\t\t\tif (!adj || typeof adj.name !== 'string' || adj.name.length === 0 || typeof adj.value !== 'number' || !isFinite(adj.value)) {\n\t\t\t\tconsole.warn(`Warning: shapeAdjust entry ${JSON.stringify(adj)} is invalid (needs { name:string, value:number }) and was ignored.`)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (emittedAdjNames.has(adj.name)) {\n\t\t\t\tconsole.warn(`Warning: shapeAdjust \"${adj.name}\" was ignored because rectRadius/angleRange already set that handle.`)\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// `value` is a 0.0-1.0 fraction of the handle range, emitted as a percentage guide (1/100000 units).\n\t\t\temitGuide(adj.name, Math.round(adj.value * 100000))\n\t\t})\n\t}\n\treturn `<a:prstGeom prst=\"${shapeName}\"><a:avLst>${avLst}</a:avLst></a:prstGeom>`\n}\n\n/**\n * Emit an `<a:custGeom>` for a freeform path built from `points`.\n * Shared by the shape and image code paths so that path emission stays in one place.\n * Points are authored in the object's own inch/EMU space (0..cx, 0..cy) — not slide-relative and not normalized.\n * @param {ObjectOptions['points']} points - freeform path DSL (`moveTo`/`lnTo`/`cubicBezTo`/`quadBezTo`/`arcTo`/`close`)\n * @param {number} cx - object width (EMU), used as the path viewport width\n * @param {number} cy - object height (EMU), used as the path viewport height\n * @param {PresLayout} layout - presentation layout used to resolve point coordinates to EMU\n * @return {string} `<a:custGeom>` XML\n */\nfunction genXmlCustGeom (points: ObjectOptions['points'], cx: number, cy: number, layout: PresLayout): string {\n\tlet strXml = '<a:custGeom><a:avLst />'\n\tstrXml += '<a:gdLst>'\n\tstrXml += '</a:gdLst>'\n\tstrXml += '<a:ahLst />'\n\tstrXml += '<a:cxnLst>'\n\tstrXml += '</a:cxnLst>'\n\tstrXml += '<a:rect l=\"l\" t=\"t\" r=\"r\" b=\"b\" />'\n\n\tstrXml += '<a:pathLst>'\n\tstrXml += `<a:path w=\"${cx}\" h=\"${cy}\">`\n\n\tpoints?.forEach((point, i) => {\n\t\tif ('curve' in point) {\n\t\t\tswitch (point.curve.type) {\n\t\t\t\tcase 'arc':\n\t\t\t\t\tstrXml += `<a:arcTo hR=\"${getSmartParseNumber(point.curve.hR, 'Y', layout)}\" wR=\"${getSmartParseNumber(\n\t\t\t\t\t\tpoint.curve.wR,\n\t\t\t\t\t\t'X',\n\t\t\t\t\t\tlayout\n\t\t\t\t\t)}\" stAng=\"${convertRotationDegrees(point.curve.stAng)}\" swAng=\"${convertRotationDegrees(point.curve.swAng)}\" />`\n\t\t\t\t\tbreak\n\t\t\t\tcase 'cubic':\n\t\t\t\t\tstrXml += `<a:cubicBezTo>\n\t\t\t\t\t<a:pt x=\"${getSmartParseNumber(point.curve.x1, 'X', layout)}\" y=\"${getSmartParseNumber(point.curve.y1, 'Y', layout)}\" />\n\t\t\t\t\t<a:pt x=\"${getSmartParseNumber(point.curve.x2, 'X', layout)}\" y=\"${getSmartParseNumber(point.curve.y2, 'Y', layout)}\" />\n\t\t\t\t\t<a:pt x=\"${getSmartParseNumber(point.x, 'X', layout)}\" y=\"${getSmartParseNumber(point.y, 'Y', layout)}\" />\n\t\t\t\t\t</a:cubicBezTo>`\n\t\t\t\t\tbreak\n\t\t\t\tcase 'quadratic':\n\t\t\t\t\tstrXml += `<a:quadBezTo>\n\t\t\t\t\t<a:pt x=\"${getSmartParseNumber(point.curve.x1, 'X', layout)}\" y=\"${getSmartParseNumber(point.curve.y1, 'Y', layout)}\" />\n\t\t\t\t\t<a:pt x=\"${getSmartParseNumber(point.x, 'X', layout)}\" y=\"${getSmartParseNumber(point.y, 'Y', layout)}\" />\n\t\t\t\t\t</a:quadBezTo>`\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t} else if ('close' in point) {\n\t\t\tstrXml += '<a:close />'\n\t\t} else if (point.moveTo || i === 0) {\n\t\t\tstrXml += `<a:moveTo><a:pt x=\"${getSmartParseNumber(point.x, 'X', layout)}\" y=\"${getSmartParseNumber(\n\t\t\t\tpoint.y,\n\t\t\t\t'Y',\n\t\t\t\tlayout\n\t\t\t)}\" /></a:moveTo>`\n\t\t} else {\n\t\t\tstrXml += `<a:lnTo><a:pt x=\"${getSmartParseNumber(point.x, 'X', layout)}\" y=\"${getSmartParseNumber(\n\t\t\t\tpoint.y,\n\t\t\t\t'Y',\n\t\t\t\tlayout\n\t\t\t)}\" /></a:lnTo>`\n\t\t}\n\t})\n\n\tstrXml += '</a:path>'\n\tstrXml += '</a:pathLst>'\n\tstrXml += '</a:custGeom>'\n\treturn strXml\n}\n\ntype TableInheritableOption = 'align' | 'bold' | 'border' | 'color' | 'fill' | 'fontFace' | 'fontSize' | 'margin' | 'textDirection' | 'underline' | 'valign'\ntype TableInheritableValue = ObjectOptions[TableInheritableOption]\nconst PLACEHOLDER_TYPE_MAP = PLACEHOLDER_TYPES as Record<string, string>\n\n/**\n * Emit the `<a:lnL>/<a:lnR>/<a:lnT>/<a:lnB>` border children of an `<a:tcPr>` for a table cell.\n * Shared by normal cells and the dummy span (`_hmerge`/`_vmerge`) cells so a merged region's\n * outer edges render with the same border as its origin cell (Issue #680).\n * @param {BorderProps[]} cellBorder - 4-tuple of border props in [top, right, bottom, left] order\n * @return {string} concatenated border element XML, in the LRTB document order PowerPoint expects\n */\nfunction genTableCellBorderXml (cellBorder: BorderProps[]): string {\n\tlet strXml = ''\n\t// NOTE: *** IMPORTANT! *** LRTB order matters! (Reorder a line below to watch the borders go wonky in MS-PPT-2013!!)\n\t;([\n\t\t{ idx: 3, name: 'lnL' },\n\t\t{ idx: 1, name: 'lnR' },\n\t\t{ idx: 0, name: 'lnT' },\n\t\t{ idx: 2, name: 'lnB' },\n\t] as const).forEach(obj => {\n\t\tconst border = cellBorder[obj.idx]\n\t\tif (!border) return\n\t\tconst cap = createLineCap(border.cap)\n\t\tif (border.type !== 'none') {\n\t\t\tstrXml += `<a:${obj.name} w=\"${valToPts(border.pt)}\" cap=\"${cap}\" cmpd=\"sng\" algn=\"ctr\">`\n\t\t\tstrXml += `<a:solidFill>${createColorElement(border.color)}</a:solidFill>`\n\t\t\tstrXml += `<a:prstDash val=\"${border.type === 'dash' ? 'sysDash' : 'solid'\n\t\t\t}\"/><a:round/><a:headEnd type=\"none\" w=\"med\" len=\"med\"/><a:tailEnd type=\"none\" w=\"med\" len=\"med\"/>`\n\t\t\tstrXml += `</a:${obj.name}>`\n\t\t} else {\n\t\t\tstrXml += `<a:${obj.name} w=\"0\" cap=\"${cap}\" cmpd=\"sng\" algn=\"ctr\"><a:noFill/></a:${obj.name}>`\n\t\t}\n\t})\n\treturn strXml\n}\n\n/**\n * Transforms a slide or slideLayout to resulting XML string - Creates `ppt/slide*.xml`\n * @param {PresSlideInternal|SlideLayoutInternal} slideObject - slide object created within createSlideObject\n * @return {string} XML string with <p:cSld> as the root\n */\nfunction slideObjectToXml (slide: PresSlideInternal | SlideLayoutInternal): string {\n\tlet strSlideXml: string = slide._name ? '<p:cSld name=\"' + slide._name + '\">' : '<p:cSld>'\n\tlet intTableNum = 1\n\n\t// Warn on duplicate Selection Pane identities within this slide. Unique `objectName`\n\t// values are what consumers (e.g. semantic manifests) rely on, so flag collisions loudly.\n\tconst duplicateObjectNames = getDuplicateObjectNames(\n\t\tslide._slideObjects.map(obj => obj.options?.objectName).filter((name): name is string => typeof name === 'string')\n\t)\n\tif (duplicateObjectNames.length > 0) {\n\t\tconsole.warn(`Warning: duplicate objectName value(s) emitted on a single slide: ${duplicateObjectNames.join(', ')}. Selection Pane identities should be unique.`)\n\t}\n\n\t// STEP 1: Add background color/image (ensure only a single `<p:bg>` tag is created, ex: when master-baskground has both `color` and `path`)\n\tif (slide._bkgdImgRid) {\n\t\tstrSlideXml += `<p:bg><p:bgPr><a:blipFill dpi=\"0\" rotWithShape=\"1\"><a:blip r:embed=\"rId${slide._bkgdImgRid}\"><a:lum/></a:blip><a:srcRect/><a:stretch><a:fillRect/></a:stretch></a:blipFill><a:effectLst/></p:bgPr></p:bg>`\n\t} else if (slide.background?.color || slide.background?.type === 'gradient') {\n\t\tstrSlideXml += `<p:bg><p:bgPr>${genXmlColorSelection(slide.background)}<a:effectLst/></p:bgPr></p:bg>`\n\t} else if (!slide.bkgd && slide._name && slide._name === DEF_PRES_LAYOUT_NAME) {\n\t\t// NOTE: Default [white] background is needed on slideMaster1.xml to avoid gray background in Keynote (and Finder previews)\n\t\tstrSlideXml += '<p:bg><p:bgRef idx=\"1001\"><a:schemeClr val=\"bg1\"/></p:bgRef></p:bg>'\n\t}\n\n\t// STEP 2: Continue slide by starting spTree node\n\tstrSlideXml += '<p:spTree>'\n\tstrSlideXml += '<p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr>'\n\tstrSlideXml += '<p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/>'\n\tstrSlideXml += '<a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr>'\n\n\t// STEP 3: Loop over all Slide.data objects and add them to this slide\n\tslide._slideObjects.forEach((slideItemObj: ISlideObject, idx: number) => {\n\t\tlet x = 0\n\t\tlet y = 0\n\t\tlet cx = getSmartParseNumber('75%', 'X', slide._presLayout)\n\t\tlet cy = 0\n\t\tlet placeholderObj: ISlideObject\n\t\tlet locationAttr = ''\n\t\tlet arrTabRows: TableCell[][] = null\n\t\tlet objTabOpts: ObjectOptions = null\n\t\tlet intColCnt = 0\n\t\tlet intColW: number\n\t\tlet cellOpts: TableCellProps = null\n\t\tlet strXml: string = null\n\t\tconst sizing: ObjectOptions['sizing'] = slideItemObj.options?.sizing\n\t\tconst rounding = slideItemObj.options?.rounding\n\n\t\tif (\n\t\t\t(slide as PresSlideInternal)._slideLayout !== undefined &&\n\t\t\t(slide as PresSlideInternal)._slideLayout._slideObjects !== undefined &&\n\t\t\tslideItemObj.options &&\n\t\t\tslideItemObj.options.placeholder\n\t\t) {\n\t\t\tplaceholderObj = (slide as PresSlideInternal)._slideLayout._slideObjects.filter(\n\t\t\t\t(object: ISlideObject) => object.options.placeholder === slideItemObj.options.placeholder\n\t\t\t)[0]\n\t\t}\n\n\t\t// A: Set option vars\n\t\tslideItemObj.options = slideItemObj.options || {}\n\n\t\tif (typeof slideItemObj.options.x !== 'undefined') x = getSmartParseNumber(slideItemObj.options.x, 'X', slide._presLayout)\n\t\tif (typeof slideItemObj.options.y !== 'undefined') y = getSmartParseNumber(slideItemObj.options.y, 'Y', slide._presLayout)\n\t\tif (typeof slideItemObj.options.w !== 'undefined') cx = getSmartParseNumber(slideItemObj.options.w, 'X', slide._presLayout)\n\t\tif (typeof slideItemObj.options.h !== 'undefined') cy = getSmartParseNumber(slideItemObj.options.h, 'Y', slide._presLayout)\n\n\t\t// Set w/h now that smart parse is done\n\t\tlet imgWidth = cx\n\t\tlet imgHeight = cy\n\n\t\t// If using a placeholder then inherit it's position\n\t\tif (placeholderObj) {\n\t\t\tif (placeholderObj.options.x || placeholderObj.options.x === 0) x = getSmartParseNumber(placeholderObj.options.x, 'X', slide._presLayout)\n\t\t\tif (placeholderObj.options.y || placeholderObj.options.y === 0) y = getSmartParseNumber(placeholderObj.options.y, 'Y', slide._presLayout)\n\t\t\tif (placeholderObj.options.w || placeholderObj.options.w === 0) cx = getSmartParseNumber(placeholderObj.options.w, 'X', slide._presLayout)\n\t\t\tif (placeholderObj.options.h || placeholderObj.options.h === 0) cy = getSmartParseNumber(placeholderObj.options.h, 'Y', slide._presLayout)\n\t\t}\n\t\t//\n\t\tif (slideItemObj.options.flipH) locationAttr += ' flipH=\"1\"'\n\t\tif (slideItemObj.options.flipV) locationAttr += ' flipV=\"1\"'\n\t\tif (slideItemObj.options.rotate) locationAttr += ` rot=\"${convertRotationDegrees(slideItemObj.options.rotate)}\"`\n\n\t\t// B: Add OBJECT to the current Slide\n\t\tswitch (slideItemObj._type) {\n\t\t\tcase SLIDE_OBJECT_TYPES.table:\n\t\t\t\t// Shallow-clone each row so splice() in the merge-grid builder does not mutate the stored\n\t\t\t\t// arrTabRows, which would corrupt output on repeated write()/writeFile() calls (issue #911).\n\t\t\t\tarrTabRows = slideItemObj.arrTabRows.map(row => [...row])\n\t\t\t\tobjTabOpts = slideItemObj.options\n\t\t\t\tintColCnt = 0\n\n\t\t\t\t// Calc number of columns\n\t\t\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\t\t// ....: sufficient to determine column count. Therefore, check each cell for a colspan and total cols as reqd\n\t\t\t\tarrTabRows[0].forEach(cell => {\n\t\t\t\t\tcellOpts = cell.options || null\n\t\t\t\t\tintColCnt += cellOpts?.colspan ? Number(cellOpts.colspan) : 1\n\t\t\t\t})\n\n\t\t\t\t// STEP 1: Start Table XML\n\t\t\t\t// NOTE: Non-numeric cNvPr id values will trigger \"presentation needs repair\" type warning in MS-PPT-2013\n\t\t\t\tstrXml = `<p:graphicFrame><p:nvGraphicFramePr><p:cNvPr id=\"${intTableNum * slide._slideNum + 1}\" name=\"${slideItemObj.options.objectName}\" descr=\"${encodeXmlEntities(slideItemObj.options.altText || '')}\"/>`\n\t\t\t\tstrXml +=\n\t\t\t\t\t`<p:cNvGraphicFramePr>${genXmlObjectLock('a:graphicFrameLocks', GRAPHIC_FRAME_LOCK_ATTRS, { noGrp: true, ...slideItemObj.options.objectLock }, slideItemObj.options.objectName)}</p:cNvGraphicFramePr>` +\n\t\t\t\t\t' <p:nvPr><p:extLst><p:ext uri=\"{D42A27DB-BD31-4B8C-83A1-F6EECF244321}\"><p14:modId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"1579011935\"/></p:ext></p:extLst></p:nvPr>' +\n\t\t\t\t\t'</p:nvGraphicFramePr>'\n\t\t\t\tstrXml += `<p:xfrm><a:off x=\"${x || (x === 0 ? 0 : EMU)}\" y=\"${y || (y === 0 ? 0 : EMU)}\"/><a:ext cx=\"${cx || (cx === 0 ? 0 : EMU)}\" cy=\"${cy || EMU\n\t\t\t\t}\"/></p:xfrm>`\n\t\t\t\t{\n\t\t\t\t\tconst tblPrAttrs =\n\t\t\t\t\t\t(objTabOpts.hasHeader ? ' firstRow=\"1\"' : '') +\n\t\t\t\t\t\t\t(objTabOpts.hasFooter ? ' lastRow=\"1\"' : '') +\n\t\t\t\t\t\t\t(objTabOpts.hasBandedRows ? ' bandRow=\"1\"' : '') +\n\t\t\t\t\t\t\t(objTabOpts.hasBandedColumns ? ' bandCol=\"1\"' : '') +\n\t\t\t\t\t\t\t(objTabOpts.hasFirstColumn ? ' firstCol=\"1\"' : '') +\n\t\t\t\t\t\t\t(objTabOpts.hasLastColumn ? ' lastCol=\"1\"' : '')\n\t\t\t\t\tconst tblPr = objTabOpts.tableStyle\n\t\t\t\t\t\t? `<a:tblPr${tblPrAttrs}><a:tableStyleId>${objTabOpts.tableStyle}</a:tableStyleId></a:tblPr>`\n\t\t\t\t\t\t: `<a:tblPr${tblPrAttrs}/>`\n\t\t\t\t\tstrXml += `<a:graphic><a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/table\"><a:tbl>${tblPr}`\n\t\t\t\t}\n\n\t\t\t\t// STEP 2: Set column widths\n\t\t\t\t// Evenly distribute cols/rows across size provided when applicable (calc them if only overall dimensions were provided)\n\t\t\t\t// A: Col widths provided?\n\t\t\t\t// B: Table Width provided without colW? Then distribute cols\n\t\t\t\tif (Array.isArray(objTabOpts.colW)) {\n\t\t\t\t\tstrXml += '<a:tblGrid>'\n\t\t\t\t\tfor (let col = 0; col < intColCnt; col++) {\n\t\t\t\t\t\tlet w: number = inch2Emu(objTabOpts.colW[col])\n\t\t\t\t\t\tif (w == null || isNaN(w)) {\n\t\t\t\t\t\t\tw = (typeof slideItemObj.options.w === 'number' ? slideItemObj.options.w : 1) / intColCnt\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstrXml += `<a:gridCol w=\"${Math.round(w)}\"/>`\n\t\t\t\t\t}\n\t\t\t\t\tstrXml += '</a:tblGrid>'\n\t\t\t\t} else {\n\t\t\t\t\tintColW = objTabOpts.colW ? objTabOpts.colW : EMU\n\t\t\t\t\tif (slideItemObj.options.w && !objTabOpts.colW) intColW = Math.round((typeof slideItemObj.options.w === 'number' ? slideItemObj.options.w : 1) / intColCnt)\n\t\t\t\t\tstrXml += '<a:tblGrid>'\n\t\t\t\t\tfor (let colw = 0; colw < intColCnt; colw++) {\n\t\t\t\t\t\tstrXml += `<a:gridCol w=\"${intColW}\"/>`\n\t\t\t\t\t}\n\t\t\t\t\tstrXml += '</a:tblGrid>'\n\t\t\t\t}\n\n\t\t\t\t// STEP 3: Build our row arrays into an actual grid to match the XML we will be building next (ISSUE #36)\n\t\t\t\t// Note row arrays can arrive \"lopsided\" as in row1:[1,2,3] row2:[3] when first two cols rowspan!,\n\t\t\t\t// so a simple loop below in XML building wont suffice to build table correctly.\n\t\t\t\t// We have to build an actual grid now\n\t\t\t\t/*\n\t\t\t\t\tEX: (A0:rowspan=3, B1:rowspan=2, C1:colspan=2)\n\n\t\t\t\t\t/------|------|------|------\\\n\t\t\t\t\t| A0 | B0 | C0 | D0 |\n\t\t\t\t\t| | B1 | C1 | |\n\t\t\t\t\t| | | C2 | D2 |\n\t\t\t\t\t\\------|------|------|------/\n\t\t\t\t*/\n\t\t\t\t// A: add _hmerge cell for colspan. should reserve rowspan\n\t\t\t\tarrTabRows.forEach(cells => {\n\t\t\t\t\tfor (let cIdx = 0; cIdx < cells.length;) {\n\t\t\t\t\t\tconst cell = cells[cIdx]\n\t\t\t\t\t\tconst colspan = cell.options?.colspan\n\t\t\t\t\t\tconst rowspan = cell.options?.rowspan\n\t\t\t\t\t\tif (colspan && colspan > 1) {\n\t\t\t\t\t\t\tconst vMergeCells = new Array(colspan - 1).fill(undefined).map(() => {\n\t\t\t\t\t\t\t\treturn { _type: SLIDE_OBJECT_TYPES.tablecell, options: { rowspan }, _hmerge: true, _spanOrigin: cell } as const\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tcells.splice(cIdx + 1, 0, ...vMergeCells)\n\t\t\t\t\t\t\tcIdx += colspan\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcIdx += 1\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t// B: add _vmerge cell for rowspan. should reserve colspan/_hmerge\n\t\t\t\tarrTabRows.forEach((cells, rIdx) => {\n\t\t\t\t\tconst nextRow = arrTabRows[rIdx + 1]\n\t\t\t\t\tif (!nextRow) return\n\t\t\t\t\tcells.forEach((cell, cIdx) => {\n\t\t\t\t\t\tconst rowspan = cell._rowContinue || cell.options?.rowspan\n\t\t\t\t\t\tconst colspan = cell.options?.colspan\n\t\t\t\t\t\tconst _hmerge = cell._hmerge\n\t\t\t\t\t\tif (rowspan && rowspan > 1) {\n\t\t\t\t\t\t\t// Point back to the true origin cell: when `cell` is itself an `_hmerge` dummy\n\t\t\t\t\t\t\t// (combined colspan+rowspan), use its origin rather than the dummy (Issue #680).\n\t\t\t\t\t\t\tconst _spanOrigin = cell._spanOrigin || cell\n\t\t\t\t\t\t\tconst hMergeCell = { _type: SLIDE_OBJECT_TYPES.tablecell, options: { colspan }, _rowContinue: rowspan - 1, _vmerge: true, _hmerge, _spanOrigin } as const\n\t\t\t\t\t\t\tnextRow.splice(cIdx, 0, hMergeCell)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\t// STEP 4: Build table rows/cells\n\t\t\t\tarrTabRows.forEach((cells, rIdx) => {\n\t\t\t\t\t// A: Table Height provided without rowH? Then distribute rows\n\t\t\t\t\tlet intRowH = 0 // IMPORTANT: Default must be zero for auto-sizing to work\n\t\t\t\t\tif (Array.isArray(objTabOpts.rowH) && objTabOpts.rowH[rIdx]) intRowH = inch2Emu(Number(objTabOpts.rowH[rIdx]))\n\t\t\t\t\telse if (objTabOpts.rowH && !isNaN(Number(objTabOpts.rowH))) intRowH = inch2Emu(Number(objTabOpts.rowH))\n\t\t\t\t\telse if (slideItemObj.options.cy || slideItemObj.options.h) {\n\t\t\t\t\t\t// `cy` already holds the table height resolved to EMU (line ~276), correctly handling\n\t\t\t\t\t\t// inches/percent/unit-string inputs — reuse it rather than re-parsing options.h.\n\t\t\t\t\t\tintRowH = Math.round(\n\t\t\t\t\t\t\t(slideItemObj.options.h ? cy : typeof slideItemObj.options.cy === 'number' ? slideItemObj.options.cy : 1) /\n\t\t\t\t\t\t\tarrTabRows.length\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\n\t\t\t\t\t// B: Start row\n\t\t\t\t\tstrXml += `<a:tr h=\"${intRowH}\">`\n\n\t\t\t\t\t// C: Loop over each CELL\n\t\t\t\t\tcells.forEach(cellObj => {\n\t\t\t\t\t\tconst cell: TableCell = cellObj\n\n\t\t\t\t\t\tconst cellSpanAttrs = {\n\t\t\t\t\t\t\trowSpan: cell.options?.rowspan > 1 ? cell.options.rowspan : undefined,\n\t\t\t\t\t\t\tgridSpan: cell.options?.colspan > 1 ? cell.options.colspan : undefined,\n\t\t\t\t\t\t\tvMerge: cell._vmerge ? 1 : undefined,\n\t\t\t\t\t\t\thMerge: cell._hmerge ? 1 : undefined,\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet cellSpanAttrStr = Object.entries(cellSpanAttrs)\n\t\t\t\t\t\t\t.filter(([, v]) => !!v)\n\t\t\t\t\t\t\t.map(([k, v]) => `${String(k)}=\"${String(v)}\"`)\n\t\t\t\t\t\t\t.join(' ')\n\t\t\t\t\t\tif (cellSpanAttrStr) cellSpanAttrStr = ' ' + cellSpanAttrStr\n\n\t\t\t\t\t\t// 1: COLSPAN/ROWSPAN: Emit the dummy covered cell for any active span. PowerPoint defines a\n\t\t\t\t\t\t// merged region's outer edges (e.g. the right border of a colspan, the bottom border of a\n\t\t\t\t\t\t// rowspan) on the *covered* cells, so inherit the origin cell's border + fill here instead of\n\t\t\t\t\t\t// emitting an empty `<a:tcPr/>` that drops those edges (Issue #680).\n\t\t\t\t\t\tif (cell._hmerge || cell._vmerge) {\n\t\t\t\t\t\t\tconst origin = cell._spanOrigin\n\t\t\t\t\t\t\tlet spanPrXml = ''\n\t\t\t\t\t\t\tif (origin) {\n\t\t\t\t\t\t\t\tconst originOpts = origin.options || {}\n\t\t\t\t\t\t\t\tconst originBorder = Array.isArray(originOpts.border) ? originOpts.border : null\n\t\t\t\t\t\t\t\tif (originBorder) spanPrXml += genTableCellBorderXml(originBorder)\n\t\t\t\t\t\t\t\t// Resolve the origin's fill with the same precedence the origin cell itself uses below,\n\t\t\t\t\t\t\t\t// so the whole merged region fills uniformly.\n\t\t\t\t\t\t\t\tlet spanFill =\n\t\t\t\t\t\t\t\t\torigin._optImp?.fill?.color\n\t\t\t\t\t\t\t\t\t\t? origin._optImp.fill.color\n\t\t\t\t\t\t\t\t\t\t: origin._optImp?.fill && typeof origin._optImp.fill === 'string'\n\t\t\t\t\t\t\t\t\t\t\t? origin._optImp.fill\n\t\t\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t\tspanFill = spanFill || originOpts.fill ? originOpts.fill : ''\n\t\t\t\t\t\t\t\tif (spanFill) spanPrXml += genXmlColorSelection(spanFill)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstrXml += `<a:tc${cellSpanAttrStr}><a:tcPr>${spanPrXml}</a:tcPr></a:tc>`\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// 2: OPTIONS: Build/set cell options\n\t\t\t\t\t\tconst cellOpts = cell.options || {}\n\t\t\t\t\t\tcell.options = cellOpts\n\n\t\t\t\t\t\t// B: Inherit some options from table when cell options dont exist\n\t\t\t\t\t\t// @see: http://officeopenxml.com/drwTableCellProperties-alignment.php\n\t\t\t\t\t\tconst inheritedCellOpts = cellOpts as Partial<Record<TableInheritableOption, TableInheritableValue>>\n\t\t\t\t\t\tconst inheritedTableOpts = objTabOpts as Partial<Record<TableInheritableOption, TableInheritableValue>>\n\t\t\t\t\t\t;(['align', 'bold', 'border', 'color', 'fill', 'fontFace', 'fontSize', 'margin', 'textDirection', 'underline', 'valign'] as const).forEach(name => {\n\t\t\t\t\t\t\tif (inheritedTableOpts[name] && !inheritedCellOpts[name] && inheritedCellOpts[name] !== 0) inheritedCellOpts[name] = inheritedTableOpts[name]\n\t\t\t\t\t\t})\n\n\t\t\t\t\t\tconst cellValign = cellOpts.valign\n\t\t\t\t\t\t\t? ` anchor=\"${cellOpts.valign.replace(/^c$/i, 'ctr').replace(/^m$/i, 'ctr').replace('center', 'ctr').replace('middle', 'ctr').replace('top', 't').replace('btm', 'b').replace('bottom', 'b')}\"`\n\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\tconst cellTextDir = (cellOpts.textDirection && cellOpts.textDirection !== 'horz') ? ` vert=\"${cellOpts.textDirection}\"` : ''\n\n\t\t\t\t\t\tlet fillColor =\n\t\t\t\t\t\t\tcell._optImp?.fill?.color\n\t\t\t\t\t\t\t\t? cell._optImp.fill.color\n\t\t\t\t\t\t\t\t: cell._optImp?.fill && typeof cell._optImp.fill === 'string'\n\t\t\t\t\t\t\t\t\t? cell._optImp.fill\n\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\tfillColor = fillColor || cellOpts.fill ? cellOpts.fill : ''\n\t\t\t\t\t\tconst cellFill = fillColor ? genXmlColorSelection(fillColor) : ''\n\n\t\t\t\t\t\tlet cellMargin = cellOpts.margin === 0 || cellOpts.margin ? cellOpts.margin : DEF_CELL_MARGIN_IN\n\t\t\t\t\t\tif (!Array.isArray(cellMargin) && typeof cellMargin === 'number') cellMargin = [cellMargin, cellMargin, cellMargin, cellMargin]\n\t\t\t\t\t\t// defensive fallback - if `cellMargin` is not a 4-element array of finite numbers, use defaults (prevents NaN in marL/R/T/B)\n\t\t\t\t\t\tif (!Array.isArray(cellMargin) || cellMargin.length !== 4 || cellMargin.some(v => typeof v !== 'number' || !isFinite(v))) {\n\t\t\t\t\t\t\tcellMargin = DEF_CELL_MARGIN_IN\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/** FUTURE: DEPRECATED:\n\t\t\t\t\t\t * - Backwards-Compat: Oops! Discovered we were still using points for cell margin before v3.8.0 (UGH!)\n\t\t\t\t\t\t * - We cant introduce a breaking change before v4.0, so...\n\t\t\t\t\t\t */\n\t\t\t\t\t\tlet cellMarginXml: string\n\t\t\t\t\t\tif (cellMargin[0] >= 1) {\n\t\t\t\t\t\t\tcellMarginXml = ` marL=\"${valToPts(cellMargin[3])}\" marR=\"${valToPts(cellMargin[1])}\" marT=\"${valToPts(cellMargin[0])}\" marB=\"${valToPts(\n\t\t\t\t\t\t\t\tcellMargin[2]\n\t\t\t\t\t\t\t)}\"`\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcellMarginXml = ` marL=\"${inch2Emu(cellMargin[3])}\" marR=\"${inch2Emu(cellMargin[1])}\" marT=\"${inch2Emu(cellMargin[0])}\" marB=\"${inch2Emu(\n\t\t\t\t\t\t\t\tcellMargin[2]\n\t\t\t\t\t\t\t)}\"`\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// FUTURE: Cell NOWRAP property (textwrap: add to a:tcPr (horzOverflow=\"overflow\" or whatever options exist)\n\n\t\t\t\t\t\t// 4: Set CELL content and properties ==================================\n\t\t\t\t\t\tstrXml += `<a:tc${cellSpanAttrStr}>${genXmlTextBody(cell)}<a:tcPr${cellMarginXml}${cellValign}${cellTextDir}>`\n\t\t\t\t\t\t// strXml += `<a:tc${cellColspan}${cellRowspan}>${genXmlTextBody(cell)}<a:tcPr${cellMarginXml}${cellValign}${cellTextDir}>`\n\t\t\t\t\t\t// FIXME: 20200525: ^^^\n\t\t\t\t\t\t// <a:tcPr marL=\"38100\" marR=\"38100\" marT=\"38100\" marB=\"38100\" vert=\"vert270\">\n\n\t\t\t\t\t\t// 5: Borders: Add any borders\n\t\t\t\t\t\tconst cellBorder = Array.isArray(cellOpts.border) ? cellOpts.border : null\n\t\t\t\t\t\tif (cellBorder) strXml += genTableCellBorderXml(cellBorder)\n\n\t\t\t\t\t\t// 6: Close cell Properties & Cell\n\t\t\t\t\t\tstrXml += cellFill\n\t\t\t\t\t\tstrXml += ' </a:tcPr>'\n\t\t\t\t\t\tstrXml += ' </a:tc>'\n\t\t\t\t\t})\n\n\t\t\t\t\t// D: Complete row\n\t\t\t\t\tstrXml += '</a:tr>'\n\t\t\t\t})\n\n\t\t\t\t// STEP 5: Complete table\n\t\t\t\tstrXml += ' </a:tbl>'\n\t\t\t\tstrXml += ' </a:graphicData>'\n\t\t\t\tstrXml += ' </a:graphic>'\n\t\t\t\tstrXml += '</p:graphicFrame>'\n\n\t\t\t\t// STEP 6: Set table XML\n\t\t\t\tstrSlideXml += strXml\n\n\t\t\t\t// LAST: Increment counter\n\t\t\t\tintTableNum++\n\t\t\t\tbreak\n\n\t\t\tcase SLIDE_OBJECT_TYPES.text:\n\t\t\tcase SLIDE_OBJECT_TYPES.placeholder:\n\t\t\t\t// Lines can have zero cy, but text should not\n\t\t\t\tif (!slideItemObj.options.line && cy === 0) cy = EMU * 0.3\n\n\t\t\t\t// Margin/Padding/Inset for textboxes\n\t\t\t\tif (!slideItemObj.options._bodyProp) slideItemObj.options._bodyProp = {}\n\t\t\t\tif (slideItemObj.options.margin && Array.isArray(slideItemObj.options.margin)) {\n\t\t\t\t\t// Margin arrays are documented as [Top, Right, Bottom, Left] (CSS order) and table cells /\n\t\t\t\t\t// slide numbers already map them that way. Keep textboxes consistent: index 0=Top, 3=Left.\n\t\t\t\t\tslideItemObj.options._bodyProp.tIns = valToPts(slideItemObj.options.margin[0] || 0)\n\t\t\t\t\tslideItemObj.options._bodyProp.rIns = valToPts(slideItemObj.options.margin[1] || 0)\n\t\t\t\t\tslideItemObj.options._bodyProp.bIns = valToPts(slideItemObj.options.margin[2] || 0)\n\t\t\t\t\tslideItemObj.options._bodyProp.lIns = valToPts(slideItemObj.options.margin[3] || 0)\n\t\t\t\t} else if (typeof slideItemObj.options.margin === 'number') {\n\t\t\t\t\tslideItemObj.options._bodyProp.lIns = valToPts(slideItemObj.options.margin)\n\t\t\t\t\tslideItemObj.options._bodyProp.rIns = valToPts(slideItemObj.options.margin)\n\t\t\t\t\tslideItemObj.options._bodyProp.bIns = valToPts(slideItemObj.options.margin)\n\t\t\t\t\tslideItemObj.options._bodyProp.tIns = valToPts(slideItemObj.options.margin)\n\t\t\t\t}\n\n\t\t\t\t// A: Start SHAPE =======================================================\n\t\t\t\tstrSlideXml += '<p:sp>'\n\n\t\t\t\t// B: The addition of the \"txBox\" attribute is the sole determiner of if an object is a shape or textbox\n\t\t\t\tstrSlideXml += `<p:nvSpPr><p:cNvPr id=\"${idx + 2}\" name=\"${slideItemObj.options.objectName}\" descr=\"${encodeXmlEntities(slideItemObj.options.altText || '')}\">`\n\t\t\t\t// <Hyperlink>\n\t\t\t\tif (slideItemObj.options.hyperlink?.url) {\n\t\t\t\t\tstrSlideXml += `<a:hlinkClick r:id=\"rId${slideItemObj.options.hyperlink._rId}\" tooltip=\"${slideItemObj.options.hyperlink.tooltip ? encodeXmlEntities(slideItemObj.options.hyperlink.tooltip) : ''}\"/>`\n\t\t\t\t}\n\t\t\t\tif (slideItemObj.options.hyperlink?.slide) {\n\t\t\t\t\tstrSlideXml += `<a:hlinkClick r:id=\"rId${slideItemObj.options.hyperlink._rId}\" tooltip=\"${slideItemObj.options.hyperlink.tooltip ? encodeXmlEntities(slideItemObj.options.hyperlink.tooltip) : ''}\" action=\"ppaction://hlinksldjump\"/>`\n\t\t\t\t}\n\t\t\t\t// </Hyperlink>\n\t\t\t\tstrSlideXml += '</p:cNvPr>'\n\t\t\t\t{\n\t\t\t\t\tconst spLockXml = genXmlObjectLock('a:spLocks', SHAPE_LOCK_ATTRS, slideItemObj.options.objectLock, slideItemObj.options.objectName)\n\t\t\t\t\tstrSlideXml += '<p:cNvSpPr' + (slideItemObj.options?.isTextBox ? ' txBox=\"1\"' : '')\n\t\t\t\t\tstrSlideXml += spLockXml ? `>${spLockXml}</p:cNvSpPr>` : '/>'\n\t\t\t\t}\n\t\t\t\tstrSlideXml += `<p:nvPr>${slideItemObj._type === 'placeholder' ? genXmlPlaceholder(slideItemObj) : genXmlPlaceholder(placeholderObj)}</p:nvPr>`\n\t\t\t\tstrSlideXml += '</p:nvSpPr><p:spPr>'\n\t\t\t\tstrSlideXml += `<a:xfrm${locationAttr}>`\n\t\t\t\tstrSlideXml += `<a:off x=\"${x}\" y=\"${y}\"/>`\n\t\t\t\tstrSlideXml += `<a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm>`\n\n\t\t\t\tif (slideItemObj.shape === 'custGeom') {\n\t\t\t\t\tstrSlideXml += genXmlCustGeom(slideItemObj.options.points, cx, cy, slide._presLayout)\n\t\t\t\t} else {\n\t\t\t\t\tstrSlideXml += genXmlPresetGeom(slideItemObj.shape, slideItemObj.options, cx, cy)\n\t\t\t\t}\n\n\t\t\t\t// Option: FILL\n\t\t\t\tstrSlideXml += slideItemObj.options.fill ? genXmlColorSelection(slideItemObj.options.fill) : '<a:noFill/>'\n\n\t\t\t\t// shape Type: LINE: line color\n\t\t\t\tif (slideItemObj.options.line) {\n\t\t\t\t\tconst lnAttrs = (slideItemObj.options.line.width ? ` w=\"${lineWidthToEmu(slideItemObj.options.line.width)}\"` : '') +\n\t\t\t\t\t\t(slideItemObj.options.line.cap ? ` cap=\"${createLineCap(slideItemObj.options.line.cap)}\"` : '')\n\t\t\t\t\tstrSlideXml += `<a:ln${lnAttrs}>`\n\t\t\t\t\tif (slideItemObj.options.line.color) strSlideXml += genXmlColorSelection(slideItemObj.options.line)\n\t\t\t\t\tif (slideItemObj.options.line.dashType) strSlideXml += `<a:prstDash val=\"${slideItemObj.options.line.dashType}\"/>`\n\t\t\t\t\tif (slideItemObj.options.line.beginArrowType) strSlideXml += `<a:headEnd type=\"${slideItemObj.options.line.beginArrowType}\"/>`\n\t\t\t\t\tif (slideItemObj.options.line.endArrowType) strSlideXml += `<a:tailEnd type=\"${slideItemObj.options.line.endArrowType}\"/>`\n\t\t\t\t\t// FUTURE: `endArrowSize` < a: headEnd type = \"arrow\" w = \"lg\" len = \"lg\" /> 'sm' | 'med' | 'lg'(values are 1 - 9, making a 3x3 grid of w / len possibilities)\n\t\t\t\t\tstrSlideXml += '</a:ln>'\n\t\t\t\t}\n\n\t\t\t\t// EFFECTS > SHADOW: REF: @see http://officeopenxml.com/drwSp-effects.php\n\t\t\t\tif (slideItemObj.options.shadow && slideItemObj.options.shadow.type !== 'none') {\n\t\t\t\t\t// derive emit-time values into locals so we don't mutate the user's options.shadow\n\t\t\t\t\t// (re-emission would otherwise re-convert pt→EMU and produce absurd values).\n\t\t\t\t\tconst sh = slideItemObj.options.shadow\n\t\t\t\t\tconst shadowType = sh.type || 'outer'\n\t\t\t\t\tconst shadowBlur = valToPts(sh.blur ?? 8)\n\t\t\t\t\tconst shadowOffset = valToPts(sh.offset ?? 4)\n\t\t\t\t\tconst shadowAngle = Math.round((sh.angle ?? 270) * 60000)\n\t\t\t\t\tconst shadowOpacity = Math.round((sh.opacity ?? 0.75) * 100000)\n\t\t\t\t\tconst shadowColor = sh.color || DEF_TEXT_SHADOW.color\n\n\t\t\t\t\tstrSlideXml += '<a:effectLst>'\n\t\t\t\t\tstrSlideXml += ` <a:${shadowType}Shdw ${shadowType === 'outer' ? 'sx=\"100000\" sy=\"100000\" kx=\"0\" ky=\"0\" algn=\"bl\" rotWithShape=\"0\"' : ''} blurRad=\"${shadowBlur}\" dist=\"${shadowOffset}\" dir=\"${shadowAngle}\">`\n\t\t\t\t\tstrSlideXml += ` <a:srgbClr val=\"${shadowColor}\">`\n\t\t\t\t\tstrSlideXml += ` <a:alpha val=\"${shadowOpacity}\"/></a:srgbClr>`\n\t\t\t\t\tstrSlideXml += ` </a:${shadowType}Shdw>`\n\t\t\t\t\tstrSlideXml += '</a:effectLst>'\n\t\t\t\t}\n\n\t\t\t\t/* TODO: FUTURE: Text wrapping (copied from MS-PPTX export)\n\t\t\t\t\t// Commented out b/c i'm not even sure this works - current code produces text that wraps in shapes and textboxes, so...\n\t\t\t\t\tif ( slideItemObj.options.textWrap ) {\n\t\t\t\t\t\tstrSlideXml += '<a:extLst>'\n\t\t\t\t\t\t\t\t\t+ '<a:ext uri=\"{C572A759-6A51-4108-AA02-DFA0A04FC94B}\">'\n\t\t\t\t\t\t\t\t\t+ '<ma14:wrappingTextBoxFlag xmlns:ma14=\"http://schemas.microsoft.com/office/mac/drawingml/2011/main\" val=\"1\"/>'\n\t\t\t\t\t\t\t\t\t+ '</a:ext>'\n\t\t\t\t\t\t\t\t\t+ '</a:extLst>';\n\t\t\t\t\t}\n\t\t\t\t*/\n\n\t\t\t\t// B: Close shape Properties\n\t\t\t\tstrSlideXml += '</p:spPr>'\n\n\t\t\t\t// C: Add formatted text (text body \"bodyPr\")\n\t\t\t\tstrSlideXml += genXmlTextBody(slideItemObj)\n\n\t\t\t\t// LAST: Close SHAPE =======================================================\n\t\t\t\tstrSlideXml += '</p:sp>'\n\t\t\t\tbreak\n\n\t\t\tcase SLIDE_OBJECT_TYPES.connector: {\n\t\t\t\t// A connector is emitted as <p:cxnSp> (a connector shape) rather than <p:sp>, so\n\t\t\t\t// PowerPoint treats it as a connector. Geometry/flip come from the shared resolution\n\t\t\t\t// above; the preset (straightConnector1 / bentConnector3 / curvedConnector3) is on `shape`.\n\t\t\t\tstrSlideXml += '<p:cxnSp><p:nvCxnSpPr>'\n\t\t\t\tstrSlideXml += `<p:cNvPr id=\"${idx + 2}\" name=\"${slideItemObj.options.objectName}\" descr=\"${encodeXmlEntities(slideItemObj.options.altText || '')}\"/>`\n\t\t\t\tstrSlideXml += '<p:cNvCxnSpPr/><p:nvPr/></p:nvCxnSpPr><p:spPr>'\n\t\t\t\tstrSlideXml += `<a:xfrm${locationAttr}><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm>`\n\t\t\t\tstrSlideXml += `<a:prstGeom prst=\"${slideItemObj.shape}\"><a:avLst/></a:prstGeom>`\n\t\t\t\t{\n\t\t\t\t\tconst ln = slideItemObj.options.line || {}\n\t\t\t\t\tconst lnAttrs = (ln.width ? ` w=\"${lineWidthToEmu(ln.width)}\"` : '') + (ln.cap ? ` cap=\"${createLineCap(ln.cap)}\"` : '')\n\t\t\t\t\tstrSlideXml += `<a:ln${lnAttrs}>`\n\t\t\t\t\tif (ln.color) strSlideXml += genXmlColorSelection(ln)\n\t\t\t\t\tif (ln.dashType) strSlideXml += `<a:prstDash val=\"${ln.dashType}\"/>`\n\t\t\t\t\tif (ln.beginArrowType) strSlideXml += `<a:headEnd type=\"${ln.beginArrowType}\"/>`\n\t\t\t\t\tif (ln.endArrowType) strSlideXml += `<a:tailEnd type=\"${ln.endArrowType}\"/>`\n\t\t\t\t\tstrSlideXml += '</a:ln>'\n\t\t\t\t}\n\t\t\t\tstrSlideXml += '</p:spPr></p:cxnSp>'\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tcase SLIDE_OBJECT_TYPES.image:\n\t\t\t\tstrSlideXml += '<p:pic>'\n\t\t\t\tstrSlideXml += ' <p:nvPicPr>'\n\t\t\t\tstrSlideXml += `<p:cNvPr id=\"${idx + 2}\" name=\"${slideItemObj.options.objectName}\" descr=\"${encodeXmlEntities(\n\t\t\t\t\tslideItemObj.options.altText || slideItemObj.image\n\t\t\t\t)}\">`\n\t\t\t\tif (slideItemObj.hyperlink?.url) {\n\t\t\t\t\tstrSlideXml += `<a:hlinkClick r:id=\"rId${slideItemObj.hyperlink._rId}\" tooltip=\"${slideItemObj.hyperlink.tooltip ? encodeXmlEntities(slideItemObj.hyperlink.tooltip) : ''\n\t\t\t\t\t}\"/>`\n\t\t\t\t}\n\t\t\t\tif (slideItemObj.hyperlink?.slide) {\n\t\t\t\t\tstrSlideXml += `<a:hlinkClick r:id=\"rId${slideItemObj.hyperlink._rId}\" tooltip=\"${slideItemObj.hyperlink.tooltip ? encodeXmlEntities(slideItemObj.hyperlink.tooltip) : ''\n\t\t\t\t\t}\" action=\"ppaction://hlinksldjump\"/>`\n\t\t\t\t}\n\t\t\t\tstrSlideXml += ' </p:cNvPr>'\n\t\t\t\t// Default to locking aspect ratio (PowerPoint's own behavior); user `objectLock` overrides any flag, incl. noChangeAspect.\n\t\t\t\tstrSlideXml += ` <p:cNvPicPr>${genXmlObjectLock('a:picLocks', PICTURE_LOCK_ATTRS, { noChangeAspect: true, ...slideItemObj.options.objectLock }, slideItemObj.options.objectName)}</p:cNvPicPr>`\n\t\t\t\tstrSlideXml += ' <p:nvPr>' + genXmlPlaceholder(placeholderObj) + '</p:nvPr>'\n\t\t\t\tstrSlideXml += ' </p:nvPicPr>'\n\t\t\t\t// Duotone recolor: maps shadows→shadow color, highlights→highlight color.\n\t\t\t\t// `<a:duotone>` is one of the `<a:blip>` image-effect children (CT_Blip);\n\t\t\t\t// it sits alongside `alphaModFix` and before any `extLst`.\n\t\t\t\tstrSlideXml += '<p:blipFill>'\n\t\t\t\t// NOTE: This works for both cases: either `path` or `data` contains the SVG\n\t\t\t\tif ((slide._relsMedia || []).find(rel => rel.rId === slideItemObj.imageRid)?.extn === 'svg') {\n\t\t\t\t\tstrSlideXml += `<a:blip r:embed=\"rId${slideItemObj.imageRid - 1}\">`\n\t\t\t\t\tstrSlideXml += slideItemObj.options.transparency ? ` <a:alphaModFix amt=\"${Math.round((100 - slideItemObj.options.transparency) * 1000)}\"/>` : ''\n\t\t\t\t\tstrSlideXml += slideItemObj.options.duotone ? `<a:duotone>${createColorElement(slideItemObj.options.duotone.shadow)}${createColorElement(slideItemObj.options.duotone.highlight)}</a:duotone>` : ''\n\t\t\t\t\tstrSlideXml += ' <a:extLst>'\n\t\t\t\t\tstrSlideXml += ' <a:ext uri=\"{96DAC541-7B7A-43D3-8B79-37D633B846F1}\">'\n\t\t\t\t\tstrSlideXml += ` <asvg:svgBlip xmlns:asvg=\"http://schemas.microsoft.com/office/drawing/2016/SVG/main\" r:embed=\"rId${slideItemObj.imageRid}\"/>`\n\t\t\t\t\tstrSlideXml += ' </a:ext>'\n\t\t\t\t\tstrSlideXml += ' </a:extLst>'\n\t\t\t\t\tstrSlideXml += '</a:blip>'\n\t\t\t\t} else {\n\t\t\t\t\tstrSlideXml += `<a:blip r:embed=\"rId${slideItemObj.imageRid}\">`\n\t\t\t\t\tstrSlideXml += slideItemObj.options.transparency ? `<a:alphaModFix amt=\"${Math.round((100 - slideItemObj.options.transparency) * 1000)}\"/>` : ''\n\t\t\t\t\tstrSlideXml += slideItemObj.options.duotone ? `<a:duotone>${createColorElement(slideItemObj.options.duotone.shadow)}${createColorElement(slideItemObj.options.duotone.highlight)}</a:duotone>` : ''\n\t\t\t\t\tstrSlideXml += '</a:blip>'\n\t\t\t\t}\n\t\t\t\tif (sizing?.type) {\n\t\t\t\t\tconst boxW = sizing.w ? getSmartParseNumber(sizing.w, 'X', slide._presLayout) : cx\n\t\t\t\t\tconst boxH = sizing.h ? getSmartParseNumber(sizing.h, 'Y', slide._presLayout) : cy\n\t\t\t\t\tconst boxX = getSmartParseNumber(sizing.x || 0, 'X', slide._presLayout)\n\t\t\t\t\tconst boxY = getSmartParseNumber(sizing.y || 0, 'Y', slide._presLayout)\n\n\t\t\t\t\t// `cover`/`contain` crop the *source* bitmap, so the srcRect must be derived from the\n\t\t\t\t\t// image's natural pixel ratio — not the displayed box (options.w/h). Measure it from the\n\t\t\t\t\t// embedded media bytes; if unmeasurable (SVG/unknown format) fall back to display dims + warn.\n\t\t\t\t\t// `crop` keeps display EMU: its contract treats the displayed extent as the crop frame.\n\t\t\t\t\tlet cropSize: { w: number, h: number } = { w: imgWidth, h: imgHeight }\n\t\t\t\t\tif (sizing.type === 'cover' || sizing.type === 'contain') {\n\t\t\t\t\t\tconst relData = (slide._relsMedia || []).find(rel => rel.rId === slideItemObj.imageRid)?.data\n\t\t\t\t\t\tconst natural = typeof relData === 'string' ? getImageSizeFromBase64(relData) : null\n\t\t\t\t\t\tif (natural) {\n\t\t\t\t\t\t\tcropSize = natural\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.warn(`Warning: sizing '${sizing.type}' could not measure natural dimensions for image \"${slideItemObj.options.objectName}\"; falling back to displayed aspect ratio (crop may be inexact). Provide a raster image (PNG/JPEG/GIF/BMP/WebP) or an SVG with width/height or a viewBox to enable an aspect-correct crop.`)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tstrSlideXml += ImageSizingXml[sizing.type](cropSize, { w: boxW, h: boxH, x: boxX, y: boxY })\n\t\t\t\t\timgWidth = boxW\n\t\t\t\t\timgHeight = boxH\n\t\t\t\t} else {\n\t\t\t\t\tstrSlideXml += ' <a:stretch><a:fillRect/></a:stretch>'\n\t\t\t\t}\n\t\t\t\tstrSlideXml += '</p:blipFill>'\n\t\t\t\tstrSlideXml += '<p:spPr>'\n\t\t\t\tstrSlideXml += ' <a:xfrm' + locationAttr + '>'\n\t\t\t\tstrSlideXml += ` <a:off x=\"${x}\" y=\"${y}\"/>`\n\t\t\t\tstrSlideXml += ` <a:ext cx=\"${imgWidth}\" cy=\"${imgHeight}\"/>`\n\t\t\t\tstrSlideXml += ' </a:xfrm>'\n\t\t\t\t// Clip the picture to a geometry. `points` (freeform custGeom) takes precedence over `shape`/`rounding`;\n\t\t\t\t// otherwise `shape` wins over `rounding` (shorthand for an ellipse), falling back to a plain rectangle.\n\t\t\t\tif (slideItemObj.options.points) {\n\t\t\t\t\tstrSlideXml += ' ' + genXmlCustGeom(slideItemObj.options.points, imgWidth, imgHeight, slide._presLayout)\n\t\t\t\t} else {\n\t\t\t\t\tstrSlideXml += ' ' + genXmlPresetGeom(slideItemObj.options.shape ?? (rounding ? 'ellipse' : 'rect'), slideItemObj.options, imgWidth, imgHeight)\n\t\t\t\t}\n\n\t\t\t\t// BORDER: `<a:ln>` outline (must precede `<a:effectLst>` per CT_ShapeProperties order)\n\t\t\t\tif (slideItemObj.options.line) {\n\t\t\t\t\tconst imgLine = slideItemObj.options.line\n\t\t\t\t\tconst lnAttrs = (imgLine.width ? ` w=\"${lineWidthToEmu(imgLine.width)}\"` : '') +\n\t\t\t\t\t\t(imgLine.cap ? ` cap=\"${createLineCap(imgLine.cap)}\"` : '')\n\t\t\t\t\tstrSlideXml += `<a:ln${lnAttrs}>`\n\t\t\t\t\tif (imgLine.color) strSlideXml += genXmlColorSelection(imgLine)\n\t\t\t\t\tif (imgLine.dashType) strSlideXml += `<a:prstDash val=\"${imgLine.dashType}\"/>`\n\t\t\t\t\tif (imgLine.beginArrowType) strSlideXml += `<a:headEnd type=\"${imgLine.beginArrowType}\"/>`\n\t\t\t\t\tif (imgLine.endArrowType) strSlideXml += `<a:tailEnd type=\"${imgLine.endArrowType}\"/>`\n\t\t\t\t\tstrSlideXml += '</a:ln>'\n\t\t\t\t}\n\n\t\t\t\t// EFFECTS > SHADOW: REF: @see http://officeopenxml.com/drwSp-effects.php\n\t\t\t\tif (slideItemObj.options.shadow && slideItemObj.options.shadow.type !== 'none') {\n\t\t\t\t\t// derive emit-time values into locals so we don't mutate the user's options.shadow\n\t\t\t\t\t// (re-emission would otherwise re-convert pt→EMU and produce absurd values).\n\t\t\t\t\tconst sh = slideItemObj.options.shadow\n\t\t\t\t\tconst shadowType = sh.type || 'outer'\n\t\t\t\t\tconst shadowBlur = valToPts(sh.blur ?? 8)\n\t\t\t\t\tconst shadowOffset = valToPts(sh.offset ?? 4)\n\t\t\t\t\tconst shadowAngle = Math.round((sh.angle ?? 270) * 60000)\n\t\t\t\t\tconst shadowOpacity = Math.round((sh.opacity ?? 0.75) * 100000)\n\t\t\t\t\tconst shadowColor = sh.color || DEF_TEXT_SHADOW.color\n\n\t\t\t\t\tstrSlideXml += '<a:effectLst>'\n\t\t\t\t\tstrSlideXml += `<a:${shadowType}Shdw ${shadowType === 'outer' ? 'sx=\"100000\" sy=\"100000\" kx=\"0\" ky=\"0\" algn=\"bl\" rotWithShape=\"0\"' : ''} blurRad=\"${shadowBlur}\" dist=\"${shadowOffset}\" dir=\"${shadowAngle}\">`\n\t\t\t\t\tstrSlideXml += `<a:srgbClr val=\"${shadowColor}\">`\n\t\t\t\t\tstrSlideXml += `<a:alpha val=\"${shadowOpacity}\"/></a:srgbClr>`\n\t\t\t\t\tstrSlideXml += `</a:${shadowType}Shdw>`\n\t\t\t\t\tstrSlideXml += '</a:effectLst>'\n\t\t\t\t}\n\t\t\t\tstrSlideXml += '</p:spPr>'\n\t\t\t\tstrSlideXml += '</p:pic>'\n\t\t\t\tbreak\n\n\t\t\tcase SLIDE_OBJECT_TYPES.media:\n\t\t\t\tif (slideItemObj.mtype === 'online') {\n\t\t\t\t\tstrSlideXml += '<p:pic>'\n\t\t\t\t\tstrSlideXml += ' <p:nvPicPr>'\n\t\t\t\t\t// IMPORTANT: <p:cNvPr id=\"\" value is critical - if its not the same number as preview image `rId`, PowerPoint throws error!\n\t\t\t\t\tstrSlideXml += `<p:cNvPr id=\"${slideItemObj.mediaRid + 2}\" name=\"${slideItemObj.options.objectName}\" descr=\"${encodeXmlEntities(slideItemObj.options.altText || '')}\"/>`\n\t\t\t\t\tstrSlideXml += ` <p:cNvPicPr>${genXmlObjectLock('a:picLocks', PICTURE_LOCK_ATTRS, slideItemObj.options.objectLock, slideItemObj.options.objectName)}</p:cNvPicPr>`\n\t\t\t\t\tstrSlideXml += ' <p:nvPr>'\n\t\t\t\t\tstrSlideXml += ` <a:videoFile r:link=\"rId${slideItemObj.mediaRid}\"/>`\n\t\t\t\t\tstrSlideXml += ' </p:nvPr>'\n\t\t\t\t\tstrSlideXml += ' </p:nvPicPr>'\n\t\t\t\t\t// NOTE: `blip` is diferent than videos; also there's no preview \"p:extLst\" above but exists in videos\n\t\t\t\t\tstrSlideXml += ` <p:blipFill><a:blip r:embed=\"rId${slideItemObj.mediaRid + 1}\"/><a:stretch><a:fillRect/></a:stretch></p:blipFill>` // NOTE: Preview image is required!\n\t\t\t\t\tstrSlideXml += ' <p:spPr>'\n\t\t\t\t\tstrSlideXml += ` <a:xfrm${locationAttr}><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm>`\n\t\t\t\t\tstrSlideXml += ' <a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>'\n\t\t\t\t\tstrSlideXml += ' </p:spPr>'\n\t\t\t\t\tstrSlideXml += '</p:pic>'\n\t\t\t\t} else {\n\t\t\t\t\tstrSlideXml += '<p:pic>'\n\t\t\t\t\tstrSlideXml += ' <p:nvPicPr>'\n\t\t\t\t\t// IMPORTANT: <p:cNvPr id=\"\" value is critical - if not the same number as preiew image rId, PowerPoint throws error!\n\t\t\t\t\tstrSlideXml += `<p:cNvPr id=\"${slideItemObj.mediaRid + 2}\" name=\"${slideItemObj.options.objectName\n\t\t\t\t\t}\" descr=\"${encodeXmlEntities(slideItemObj.options.altText || '')}\"><a:hlinkClick r:id=\"\" action=\"ppaction://media\"/></p:cNvPr>`\n\t\t\t\t\tstrSlideXml += ` <p:cNvPicPr>${genXmlObjectLock('a:picLocks', PICTURE_LOCK_ATTRS, { noChangeAspect: true, ...slideItemObj.options.objectLock }, slideItemObj.options.objectName)}</p:cNvPicPr>`\n\t\t\t\t\tstrSlideXml += ' <p:nvPr>'\n\t\t\t\t\tstrSlideXml += ` <a:videoFile r:link=\"rId${slideItemObj.mediaRid}\"/>`\n\t\t\t\t\tstrSlideXml += ' <p:extLst>'\n\t\t\t\t\tstrSlideXml += ' <p:ext uri=\"{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}\">'\n\t\t\t\t\tstrSlideXml += ` <p14:media xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" r:embed=\"rId${slideItemObj.mediaRid + 1}\"/>`\n\t\t\t\t\tstrSlideXml += ' </p:ext>'\n\t\t\t\t\tstrSlideXml += ' </p:extLst>'\n\t\t\t\t\tstrSlideXml += ' </p:nvPr>'\n\t\t\t\t\tstrSlideXml += ' </p:nvPicPr>'\n\t\t\t\t\tstrSlideXml += ` <p:blipFill><a:blip r:embed=\"rId${slideItemObj.mediaRid + 2}\"/><a:stretch><a:fillRect/></a:stretch></p:blipFill>` // NOTE: Preview image is required!\n\t\t\t\t\tstrSlideXml += ' <p:spPr>'\n\t\t\t\t\tstrSlideXml += ` <a:xfrm${locationAttr}><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm>`\n\t\t\t\t\tstrSlideXml += ' <a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>'\n\t\t\t\t\tstrSlideXml += ' </p:spPr>'\n\t\t\t\t\tstrSlideXml += '</p:pic>'\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase SLIDE_OBJECT_TYPES.chart:\n\t\t\t\tstrSlideXml += '<p:graphicFrame>'\n\t\t\t\tstrSlideXml += ' <p:nvGraphicFramePr>'\n\t\t\t\tstrSlideXml += ` <p:cNvPr id=\"${idx + 2}\" name=\"${slideItemObj.options.objectName}\" descr=\"${encodeXmlEntities(slideItemObj.options.altText || '')}\"/>`\n\t\t\t\tstrSlideXml += ' <p:cNvGraphicFramePr/>'\n\t\t\t\tstrSlideXml += ` <p:nvPr>${genXmlPlaceholder(placeholderObj)}</p:nvPr>`\n\t\t\t\tstrSlideXml += ' </p:nvGraphicFramePr>'\n\t\t\t\tstrSlideXml += ` <p:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></p:xfrm>`\n\t\t\t\tstrSlideXml += ' <a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">'\n\t\t\t\tstrSlideXml += ' <a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/chart\">'\n\t\t\t\tstrSlideXml += ` <c:chart r:id=\"rId${slideItemObj.chartRid}\" xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\"/>`\n\t\t\t\tstrSlideXml += ' </a:graphicData>'\n\t\t\t\tstrSlideXml += ' </a:graphic>'\n\t\t\t\tstrSlideXml += '</p:graphicFrame>'\n\t\t\t\tbreak\n\n\t\t\tdefault:\n\t\t\t\tstrSlideXml += ''\n\t\t\t\tbreak\n\t\t}\n\t})\n\n\t// STEP 4: Add slide numbers (if any) last\n\tif (slide._slideNumberProps) {\n\t\t// Set some defaults (done here b/c SlideNumber canbe added to masters or slides and has numerous entry points)\n\t\tif (!slide._slideNumberProps.align) slide._slideNumberProps.align = 'left'\n\n\t\tstrSlideXml += '<p:sp>'\n\t\tstrSlideXml += ' <p:nvSpPr>'\n\t\tstrSlideXml += ' <p:cNvPr id=\"25\" name=\"Slide Number Placeholder 0\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr>'\n\t\tstrSlideXml += ' <p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"4294967295\"/></p:nvPr>'\n\t\tstrSlideXml += ' </p:nvSpPr>'\n\t\tstrSlideXml += ' <p:spPr>'\n\t\tstrSlideXml += '<a:xfrm>' +\n\t\t\t`<a:off x=\"${getSmartParseNumber(slide._slideNumberProps.x, 'X', slide._presLayout)}\" y=\"${getSmartParseNumber(slide._slideNumberProps.y, 'Y', slide._presLayout)}\"/>` +\n\t\t\t`<a:ext cx=\"${slide._slideNumberProps.w ? getSmartParseNumber(slide._slideNumberProps.w, 'X', slide._presLayout) : '800000'}\" cy=\"${slide._slideNumberProps.h ? getSmartParseNumber(slide._slideNumberProps.h, 'Y', slide._presLayout) : '300000'}\"/>` +\n\t\t\t'</a:xfrm>' +\n\t\t\t' <a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>' +\n\t\t\t' <a:extLst><a:ext uri=\"{C572A759-6A51-4108-AA02-DFA0A04FC94B}\"><ma14:wrappingTextBoxFlag val=\"0\" xmlns:ma14=\"http://schemas.microsoft.com/office/mac/drawingml/2011/main\"/></a:ext></a:extLst>' +\n\t\t\t'</p:spPr>'\n\t\tstrSlideXml += '<p:txBody>'\n\t\tstrSlideXml += '<a:bodyPr'\n\t\tif (slide._slideNumberProps.margin && Array.isArray(slide._slideNumberProps.margin)) {\n\t\t\tstrSlideXml += ` lIns=\"${valToPts(slide._slideNumberProps.margin[3] || 0)}\"`\n\t\t\tstrSlideXml += ` tIns=\"${valToPts(slide._slideNumberProps.margin[0] || 0)}\"`\n\t\t\tstrSlideXml += ` rIns=\"${valToPts(slide._slideNumberProps.margin[1] || 0)}\"`\n\t\t\tstrSlideXml += ` bIns=\"${valToPts(slide._slideNumberProps.margin[2] || 0)}\"`\n\t\t} else if (typeof slide._slideNumberProps.margin === 'number') {\n\t\t\tstrSlideXml += ` lIns=\"${valToPts(slide._slideNumberProps.margin || 0)}\"`\n\t\t\tstrSlideXml += ` tIns=\"${valToPts(slide._slideNumberProps.margin || 0)}\"`\n\t\t\tstrSlideXml += ` rIns=\"${valToPts(slide._slideNumberProps.margin || 0)}\"`\n\t\t\tstrSlideXml += ` bIns=\"${valToPts(slide._slideNumberProps.margin || 0)}\"`\n\t\t}\n\t\tif (slide._slideNumberProps.valign) {\n\t\t\tstrSlideXml += ` anchor=\"${slide._slideNumberProps.valign.replace('top', 't').replace('middle', 'ctr').replace('bottom', 'b')}\"`\n\t\t}\n\t\tstrSlideXml += '/>'\n\t\tstrSlideXml += ' <a:lstStyle><a:lvl1pPr>'\n\t\tif (slide._slideNumberProps.fontFace || slide._slideNumberProps.fontSize || slide._slideNumberProps.color) {\n\t\t\tstrSlideXml += `<a:defRPr sz=\"${clampFontSizeSz(slide._slideNumberProps.fontSize || 12)}\">`\n\t\t\tif (slide._slideNumberProps.color) strSlideXml += genXmlColorSelection(slide._slideNumberProps.color)\n\t\t\tif (slide._slideNumberProps.fontFace) { strSlideXml += `<a:latin typeface=\"${slide._slideNumberProps.fontFace}\"/><a:ea typeface=\"${slide._slideNumberProps.fontFace}\"/><a:cs typeface=\"${slide._slideNumberProps.fontFace}\"/>` }\n\t\t\tstrSlideXml += '</a:defRPr>'\n\t\t}\n\t\tstrSlideXml += '</a:lvl1pPr></a:lstStyle>'\n\t\tstrSlideXml += '<a:p>'\n\t\tif (slide._slideNumberProps.align.startsWith('l')) strSlideXml += '<a:pPr algn=\"l\"/>'\n\t\telse if (slide._slideNumberProps.align.startsWith('c')) strSlideXml += '<a:pPr algn=\"ctr\"/>'\n\t\telse if (slide._slideNumberProps.align.startsWith('r')) strSlideXml += '<a:pPr algn=\"r\"/>'\n\t\telse strSlideXml += '<a:pPr algn=\"l\"/>'\n\t\tstrSlideXml += `<a:fld id=\"${SLDNUMFLDID}\" type=\"slidenum\"><a:rPr b=\"${slide._slideNumberProps.bold ? 1 : 0}\" lang=\"en-US\"/>`\n\t\tstrSlideXml += `<a:t>${slide._slideNum}</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p>`\n\t\tstrSlideXml += '</p:txBody></p:sp>'\n\t}\n\n\t// STEP 5: Close spTree and finalize slide XML\n\tstrSlideXml += '</p:spTree>'\n\tstrSlideXml += '</p:cSld>'\n\n\t// LAST: Return\n\treturn strSlideXml\n}\n\n/**\n * Transforms slide relations to XML string.\n * Extra relations that are not dynamic can be passed using the 2nd arg (e.g. theme relation in master file).\n * These relations use rId series that starts with 1-increased maximum of rIds used for dynamic relations.\n * @param {PresSlideInternal | SlideLayoutInternal} slide - slide object whose relations are being transformed\n * @param {{ target: string; type: string }[]} defaultRels - array of default relations\n * @return {string} XML\n */\nfunction slideObjectRelationsToXml (slide: PresSlideInternal | SlideLayoutInternal, defaultRels: Array<{ target: string, type: string }>): string {\n\tlet lastRid = 0 // stores maximum rId used for dynamic relations\n\tlet strXml = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>' + CRLF + '<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">'\n\n\t// STEP 1: Add all rels for this Slide\n\tslide._rels.forEach((rel: ISlideRel) => {\n\t\tlastRid = Math.max(lastRid, rel.rId)\n\t\tif (rel.type.toLowerCase().includes('hyperlink')) {\n\t\t\tif (rel.data === 'slide') {\n\t\t\t\tstrXml += `<Relationship Id=\"rId${rel.rId}\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"slide${rel.Target}.xml\"/>`\n\t\t\t} else {\n\t\t\t\tstrXml += `<Relationship Id=\"rId${rel.rId}\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\" Target=\"${rel.Target}\" TargetMode=\"External\"/>`\n\t\t\t}\n\t\t} else if (rel.type.toLowerCase().includes('notesSlide')) {\n\t\t\tstrXml += `<Relationship Id=\"rId${rel.rId}\" Target=\"${rel.Target}\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\"/>`\n\t\t}\n\t})\n\t; (slide._relsChart || []).forEach((rel: ISlideRelChart) => {\n\t\tlastRid = Math.max(lastRid, rel.rId)\n\t\tstrXml += `<Relationship Id=\"rId${rel.rId}\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart\" Target=\"${rel.Target}\"/>`\n\t})\n\t; (slide._relsMedia || []).forEach((rel: ISlideRelMedia) => {\n\t\tconst relRid = rel.rId.toString()\n\t\tlastRid = Math.max(lastRid, rel.rId)\n\t\tif (rel.type.toLowerCase().includes('image')) {\n\t\t\tstrXml += '<Relationship Id=\"rId' + relRid + '\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\" Target=\"' + rel.Target + '\"/>'\n\t\t} else if (rel.type.toLowerCase().includes('audio')) {\n\t\t\t// As media has *TWO* rel entries per item, check for first one, if found add second rel with alt style\n\t\t\tif (strXml.includes(' Target=\"' + rel.Target + '\"')) {\n\t\t\t\tstrXml += '<Relationship Id=\"rId' + relRid + '\" Type=\"http://schemas.microsoft.com/office/2007/relationships/media\" Target=\"' + rel.Target + '\"/>'\n\t\t\t} else {\n\t\t\t\tstrXml += '<Relationship Id=\"rId' + relRid + '\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio\" Target=\"' + rel.Target + '\"/>'\n\t\t\t}\n\t\t} else if (rel.type.toLowerCase().includes('video')) {\n\t\t\t// As media has *TWO* rel entries per item, check for first one, if found add second rel with alt style\n\t\t\tif (strXml.includes(' Target=\"' + rel.Target + '\"')) {\n\t\t\t\tstrXml += '<Relationship Id=\"rId' + relRid + '\" Type=\"http://schemas.microsoft.com/office/2007/relationships/media\" Target=\"' + rel.Target + '\"/>'\n\t\t\t} else {\n\t\t\t\tstrXml += '<Relationship Id=\"rId' + relRid + '\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video\" Target=\"' + rel.Target + '\"/>'\n\t\t\t}\n\t\t} else if (rel.type.toLowerCase().includes('online')) {\n\t\t\t// As media has *TWO* rel entries per item, check for first one, if found add second rel with alt style\n\t\t\tif (strXml.includes(' Target=\"' + rel.Target + '\"')) {\n\t\t\t\tstrXml += '<Relationship Id=\"rId' + relRid + '\" Type=\"http://schemas.microsoft.com/office/2007/relationships/image\" Target=\"' + rel.Target + '\"/>'\n\t\t\t} else {\n\t\t\t\tstrXml += '<Relationship Id=\"rId' + relRid + '\" Target=\"' + rel.Target + '\" TargetMode=\"External\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video\"/>'\n\t\t\t}\n\t\t}\n\t})\n\n\t// STEP 2: Add default rels\n\tdefaultRels.forEach((rel, idx) => {\n\t\tstrXml += `<Relationship Id=\"rId${lastRid + idx + 1}\" Type=\"${rel.type}\" Target=\"${rel.target}\"/>`\n\t})\n\n\tstrXml += '</Relationships>'\n\treturn strXml\n}\n\n/**\n * Generate XML Paragraph Properties\n * @param {ISlideObject|TextProps} textObj - text object\n * @param {boolean} isDefault - array of default relations\n * @return {string} XML\n */\nfunction genXmlParagraphProperties (textObj: ISlideObject | TextProps, isDefault: boolean): string {\n\tlet strXmlBullet = ''\n\tlet strXmlBulletColor = ''\n\tlet strXmlLnSpc = ''\n\tlet strXmlParaSpc = ''\n\tlet strXmlTabStops = ''\n\tconst tag = isDefault ? 'a:lvl1pPr' : 'a:pPr'\n\tlet bulletMarL = valToPts(DEF_BULLET_MARGIN)\n\n\tlet paragraphPropXml = `<${tag}${textObj.options.rtlMode ? ' rtl=\"1\" ' : ''}`\n\n\t// A: Build paragraphProperties\n\t{\n\t\t// OPTION: align\n\t\tif (textObj.options.align) {\n\t\t\tswitch (textObj.options.align) {\n\t\t\t\tcase 'left':\n\t\t\t\t\tparagraphPropXml += ' algn=\"l\"'\n\t\t\t\t\tbreak\n\t\t\t\tcase 'right':\n\t\t\t\t\tparagraphPropXml += ' algn=\"r\"'\n\t\t\t\t\tbreak\n\t\t\t\tcase 'center':\n\t\t\t\t\tparagraphPropXml += ' algn=\"ctr\"'\n\t\t\t\t\tbreak\n\t\t\t\tcase 'justify':\n\t\t\t\t\tparagraphPropXml += ' algn=\"just\"'\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\tparagraphPropXml += ''\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif (textObj.options.lineSpacing) {\n\t\t\tstrXmlLnSpc = `<a:lnSpc><a:spcPts val=\"${clampLineSpacingPts(textObj.options.lineSpacing)}\"/></a:lnSpc>`\n\t\t} else if (textObj.options.lineSpacingMultiple) {\n\t\t\tstrXmlLnSpc = `<a:lnSpc><a:spcPct val=\"${Math.round(textObj.options.lineSpacingMultiple * 100000)}\"/></a:lnSpc>`\n\t\t}\n\n\t\t// OPTION: indent\n\t\tif (textObj.options.indentLevel && !isNaN(Number(textObj.options.indentLevel)) && textObj.options.indentLevel > 0) {\n\t\t\tparagraphPropXml += ` lvl=\"${textObj.options.indentLevel}\"`\n\t\t}\n\n\t\t// OPTION: Paragraph Spacing: Before/After\n\t\tif (textObj.options.paraSpaceBefore && !isNaN(Number(textObj.options.paraSpaceBefore)) && textObj.options.paraSpaceBefore > 0) {\n\t\t\tstrXmlParaSpc += `<a:spcBef><a:spcPts val=\"${Math.round(textObj.options.paraSpaceBefore * 100)}\"/></a:spcBef>`\n\t\t}\n\t\tif (textObj.options.paraSpaceAfter && !isNaN(Number(textObj.options.paraSpaceAfter)) && textObj.options.paraSpaceAfter > 0) {\n\t\t\tstrXmlParaSpc += `<a:spcAft><a:spcPts val=\"${Math.round(textObj.options.paraSpaceAfter * 100)}\"/></a:spcAft>`\n\t\t}\n\n\t\t// OPTION: bullet\n\t\t// NOTE: OOXML uses the unicode character set for Bullets\n\t\t// EX: Unicode Character 'BULLET' (U+2022) ==> '<a:buChar char=\"•\"/>'\n\t\tif (typeof textObj.options.bullet === 'object') {\n\t\t\tif (textObj?.options?.bullet?.indent) bulletMarL = valToPts(textObj.options.bullet.indent)\n\t\t\tif (textObj.options.bullet.color) strXmlBulletColor = `<a:buClr>${createColorElement(textObj.options.bullet.color)}</a:buClr>`\n\n\t\t\t// `<a:buSzPct/>` val is thousandths of a percent; ST_TextBulletSizePercent allows 25%-400%\n\t\t\tlet bulletSizePct = 100000\n\t\t\tif (textObj.options.bullet.size !== undefined) {\n\t\t\t\tconst bulletSize = Number(textObj.options.bullet.size)\n\t\t\t\tif (isNaN(bulletSize) || bulletSize < 25 || bulletSize > 400) {\n\t\t\t\t\tconsole.warn('Warning: `bullet.size` must be a percentage between 25 and 400!')\n\t\t\t\t} else {\n\t\t\t\t\tbulletSizePct = Math.round(bulletSize * 1000)\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst strXmlBulletSize = `<a:buSzPct val=\"${bulletSizePct}\"/>`\n\t\t\tconst strXmlBulletFont = textObj.options.bullet.fontFace ? `<a:buFont typeface=\"${encodeXmlEntities(textObj.options.bullet.fontFace)}\"/>` : ''\n\n\t\t\tif (textObj.options.bullet.type && textObj.options.bullet.type.toString().toLowerCase() === 'number') {\n\t\t\t\tparagraphPropXml += ` marL=\"${textObj.options.indentLevel && textObj.options.indentLevel > 0 ? bulletMarL + bulletMarL * textObj.options.indentLevel : bulletMarL\n\t\t\t\t}\" indent=\"-${bulletMarL}\"`\n\t\t\t\tstrXmlBullet = `${strXmlBulletSize}${strXmlBulletFont || '<a:buFont typeface=\"+mj-lt\"/>'}<a:buAutoNum type=\"${textObj.options.bullet.style || 'arabicPeriod'}\" startAt=\"${textObj.options.bullet.numberStartAt || textObj.options.bullet.startAt || '1'\n\t\t\t\t}\"/>`\n\t\t\t} else if (textObj.options.bullet.characterCode) {\n\t\t\t\tlet bulletCode = `&#x${textObj.options.bullet.characterCode};`\n\n\t\t\t\t// Check value for hex-ness (s/b 4 char hex)\n\t\t\t\tif (!/^[0-9A-Fa-f]{4}$/.test(textObj.options.bullet.characterCode)) {\n\t\t\t\t\tconsole.warn('Warning: `bullet.characterCode should be a 4-digit unicode charatcer (ex: 22AB)`!')\n\t\t\t\t\tbulletCode = BULLET_TYPES.DEFAULT\n\t\t\t\t}\n\n\t\t\t\tparagraphPropXml += ` marL=\"${textObj.options.indentLevel && textObj.options.indentLevel > 0 ? bulletMarL + bulletMarL * textObj.options.indentLevel : bulletMarL\n\t\t\t\t}\" indent=\"-${bulletMarL}\"`\n\t\t\t\tstrXmlBullet = strXmlBulletSize + strXmlBulletFont + '<a:buChar char=\"' + bulletCode + '\"/>'\n\t\t\t} else if (textObj.options.bullet.code) {\n\t\t\t\t// @deprecated `bullet.code` v3.3.0\n\t\t\t\tlet bulletCode = `&#x${textObj.options.bullet.code};`\n\n\t\t\t\t// Check value for hex-ness (s/b 4 char hex)\n\t\t\t\tif (!/^[0-9A-Fa-f]{4}$/.test(textObj.options.bullet.code)) {\n\t\t\t\t\tconsole.warn('Warning: `bullet.code should be a 4-digit hex code (ex: 22AB)`!')\n\t\t\t\t\tbulletCode = BULLET_TYPES.DEFAULT\n\t\t\t\t}\n\n\t\t\t\tparagraphPropXml += ` marL=\"${textObj.options.indentLevel && textObj.options.indentLevel > 0 ? bulletMarL + bulletMarL * textObj.options.indentLevel : bulletMarL\n\t\t\t\t}\" indent=\"-${bulletMarL}\"`\n\t\t\t\tstrXmlBullet = strXmlBulletSize + strXmlBulletFont + '<a:buChar char=\"' + bulletCode + '\"/>'\n\t\t\t} else {\n\t\t\t\tparagraphPropXml += ` marL=\"${textObj.options.indentLevel && textObj.options.indentLevel > 0 ? bulletMarL + bulletMarL * textObj.options.indentLevel : bulletMarL\n\t\t\t\t}\" indent=\"-${bulletMarL}\"`\n\t\t\t\tstrXmlBullet = `${strXmlBulletSize}${strXmlBulletFont}<a:buChar char=\"${BULLET_TYPES.DEFAULT}\"/>`\n\t\t\t}\n\t\t} else if (textObj.options.bullet) {\n\t\t\tparagraphPropXml += ` marL=\"${textObj.options.indentLevel && textObj.options.indentLevel > 0 ? bulletMarL + bulletMarL * textObj.options.indentLevel : bulletMarL\n\t\t\t}\" indent=\"-${bulletMarL}\"`\n\t\t\tstrXmlBullet = `<a:buSzPct val=\"100000\"/><a:buChar char=\"${BULLET_TYPES.DEFAULT}\"/>`\n\t\t} else if (!textObj.options.bullet) {\n\t\t\t// We only add this when the user explicitely asks for no bullet, otherwise, it can override the master defaults!\n\t\t\tparagraphPropXml += ' indent=\"0\" marL=\"0\"' // FIX: ISSUE#589 - specify zero indent and marL or default will be hanging paragraph\n\t\t\tstrXmlBullet = '<a:buNone/>'\n\t\t}\n\n\t\t// OPTION: tabStops\n\t\tif (textObj.options.tabStops && Array.isArray(textObj.options.tabStops)) {\n\t\t\tconst tabStopsXml = textObj.options.tabStops.map(stop => `<a:tab pos=\"${inch2Emu(stop.position || 1)}\" algn=\"${stop.alignment || 'l'}\"/>`).join('')\n\t\t\tstrXmlTabStops = `<a:tabLst>${tabStopsXml}</a:tabLst>`\n\t\t}\n\n\t\t// B: Close Paragraph-Properties\n\t\t// IMPORTANT: strXmlLnSpc, strXmlParaSpc, and strXmlBullet require strict ordering - anything out of order is ignored. (PPT-Online, PPT for Mac)\n\t\tparagraphPropXml += '>' + strXmlLnSpc + strXmlParaSpc + strXmlBulletColor + strXmlBullet + strXmlTabStops\n\t\tif (isDefault) paragraphPropXml += genXmlTextRunProperties(textObj.options, true)\n\t\tparagraphPropXml += '</' + tag + '>'\n\t}\n\n\treturn paragraphPropXml\n}\n\n/**\n * Generate XML Text Run Properties (`a:rPr`)\n * @param {ObjectOptions|TextPropsOptions} opts - text options\n * @param {boolean} isDefault - whether these are the default text run properties\n * @return {string} XML\n */\nfunction genXmlTextRunProperties (opts: ObjectOptions | TextPropsOptions, isDefault: boolean): string {\n\tlet runProps = ''\n\tconst runPropsTag = isDefault ? 'a:defRPr' : 'a:rPr'\n\n\t// BEGIN runProperties (ex: `<a:rPr lang=\"en-US\" sz=\"1600\" b=\"1\" dirty=\"0\">`)\n\trunProps += '<' + runPropsTag + ' lang=\"' + (opts.lang ? opts.lang : 'en-US') + '\"' + (opts.lang ? ' altLang=\"en-US\"' : '')\n\trunProps += opts.fontSize ? ` sz=\"${clampFontSizeSz(opts.fontSize)}\"` : '' // NOTE: clamp+round so sizes like '7.5' or out-of-range values wont cause corrupt presentations\n\trunProps += opts?.bold ? ` b=\"${opts.bold ? '1' : '0'}\"` : ''\n\trunProps += opts?.italic ? ` i=\"${opts.italic ? '1' : '0'}\"` : ''\n\n\trunProps += opts?.strike ? ` strike=\"${typeof opts.strike === 'string' ? opts.strike : 'sngStrike'}\"` : ''\n\trunProps += opts?.caps ? ` cap=\"${opts.caps}\"` : ''\n\tif (typeof opts.underline === 'object' && opts.underline?.style) {\n\t\trunProps += ` u=\"${opts.underline.style}\"`\n\t} else if (typeof opts.underline === 'string') {\n\t\t// DEPRECATED: opts.underline is an object as of v3.5.0\n\t\trunProps += ` u=\"${String(opts.underline)}\"`\n\t} else if (opts.hyperlink) {\n\t\trunProps += ' u=\"sng\"'\n\t}\n\tif (opts.baseline) {\n\t\trunProps += ` baseline=\"${Math.round(opts.baseline * 50)}\"`\n\t} else if (opts.subscript) {\n\t\trunProps += ' baseline=\"-40000\"'\n\t} else if (opts.superscript) {\n\t\trunProps += ' baseline=\"30000\"'\n\t}\n\trunProps += opts.charSpacing ? ` spc=\"${clampCharSpacingSpc(opts.charSpacing)}\" kern=\"0\"` : '' // IMPORTANT: Also disable kerning; otherwise text won't actually expand\n\trunProps += ' dirty=\"0\">'\n\t// Color / Font / Highlight / Outline / Effects are children of <a:rPr>, so add them now before closing the runProperties tag\n\tconst hasShadow = !!opts.shadow && opts.shadow.type !== 'none'\n\tif (opts.color || opts.fontFace || opts.outline || opts.glow || hasShadow || (typeof opts.underline === 'object' && opts.underline.color)) {\n\t\t// NOTE: children must follow CT_TextCharacterProperties order: ln, fill, effectLst, highlight, uFill, latin/ea/cs\n\t\tif (opts.outline && typeof opts.outline === 'object') {\n\t\t\trunProps += `<a:ln w=\"${lineWidthToEmu(opts.outline.size || 0.75)}\">${genXmlColorSelection(opts.outline.color || 'FFFFFF')}</a:ln>`\n\t\t}\n\t\tif (opts.color) runProps += genXmlColorSelection({ color: opts.color, transparency: opts.transparency })\n\t\t// EFFECTS: glow and shadow share a single <a:effectLst> (only one is allowed per CT_TextCharacterProperties; glow precedes shadow per CT_EffectList)\n\t\tif (opts.glow || hasShadow) {\n\t\t\trunProps += '<a:effectLst>'\n\t\t\tif (opts.glow) runProps += createGlowElement(opts.glow, DEF_TEXT_GLOW)\n\t\t\tif (hasShadow) runProps += createShadowElement(opts.shadow, DEF_TEXT_SHADOW)\n\t\t\trunProps += '</a:effectLst>'\n\t\t}\n\t\tif (opts.highlight) runProps += `<a:highlight>${createColorElement(opts.highlight)}</a:highlight>`\n\t\tif (typeof opts.underline === 'object' && opts.underline.color) runProps += `<a:uFill>${genXmlColorSelection(opts.underline.color)}</a:uFill>`\n\t\tif (opts.fontFace) {\n\t\t\t// NOTE: 'cs' = Complex Script, 'ea' = East Asian (use \"-120\" instead of \"0\" - per Issue #174); ea must come first (Issue #174)\n\t\t\trunProps += `<a:latin typeface=\"${opts.fontFace}\" pitchFamily=\"34\" charset=\"0\"/><a:ea typeface=\"${opts.fontFace}\" pitchFamily=\"34\" charset=\"-122\"/><a:cs typeface=\"${opts.fontFace}\" pitchFamily=\"34\" charset=\"-120\"/>`\n\t\t}\n\t}\n\n\t// Hyperlink support\n\tif (opts.hyperlink) {\n\t\tif (typeof opts.hyperlink !== 'object') throw new Error('ERROR: text `hyperlink` option should be an object. Ex: `hyperlink:{url:\\'https://github.com\\'}` ')\n\t\telse if (!opts.hyperlink.url && !opts.hyperlink.slide) throw new Error('ERROR: \\'hyperlink requires either `url` or `slide`\\'')\n\t\telse if (opts.hyperlink.url) {\n\t\t\t// runProps += '<a:uFill>'+ genXmlColorSelection('0000FF') +'</a:uFill>'; // Breaks PPT2010! (Issue#74)\n\t\t\trunProps += `<a:hlinkClick r:id=\"rId${opts.hyperlink._rId}\" invalidUrl=\"\" action=\"\" tgtFrame=\"\" tooltip=\"${opts.hyperlink.tooltip ? encodeXmlEntities(opts.hyperlink.tooltip) : ''\n\t\t\t}\" history=\"1\" highlightClick=\"0\" endSnd=\"0\"${opts.color ? '>' : '/>'}`\n\t\t} else if (opts.hyperlink.slide) {\n\t\t\trunProps += `<a:hlinkClick r:id=\"rId${opts.hyperlink._rId}\" action=\"ppaction://hlinksldjump\" tooltip=\"${opts.hyperlink.tooltip ? encodeXmlEntities(opts.hyperlink.tooltip) : ''\n\t\t\t}\"${opts.color ? '>' : '/>'}`\n\t\t}\n\t\tif (opts.color) {\n\t\t\trunProps += ' <a:extLst>'\n\t\t\trunProps += ' <a:ext uri=\"{A12FA001-AC4F-418D-AE19-62706E023703}\">'\n\t\t\trunProps += ' <ahyp:hlinkClr xmlns:ahyp=\"http://schemas.microsoft.com/office/drawing/2018/hyperlinkcolor\" val=\"tx\"/>'\n\t\t\trunProps += ' </a:ext>'\n\t\t\trunProps += ' </a:extLst>'\n\t\t\trunProps += '</a:hlinkClick>'\n\t\t}\n\t}\n\n\t// END runProperties\n\trunProps += `</${runPropsTag}>`\n\n\treturn runProps\n}\n\n/**\n * Build textBody text runs [`<a:r></a:r>`] for paragraphs [`<a:p>`]\n * @param {TextProps} textObj - Text object\n * @return {string} XML string\n */\nfunction genXmlTextRun (textObj: TextProps): string {\n\t// NOTE: Dont create full rPr runProps for empty [lineBreak] runs\n\t// Why? The size of the lineBreak wont match (eg: below it will be 18px instead of the correct 36px)\n\t// Do this:\n\t/*\n\t\t<a:p>\n\t\t\t<a:pPr algn=\"r\"/>\n\t\t\t<a:endParaRPr lang=\"en-US\" sz=\"3600\" dirty=\"0\"/>\n\t\t</a:p>\n\t*/\n\t// NOT this:\n\t/*\n\t\t<a:p>\n\t\t\t<a:pPr algn=\"r\"/>\n\t\t\t<a:r>\n\t\t\t\t<a:rPr lang=\"en-US\" sz=\"3600\" dirty=\"0\">\n\t\t\t\t\t<a:solidFill>\n\t\t\t\t\t\t<a:schemeClr val=\"accent5\"/>\n\t\t\t\t\t</a:solidFill>\n\t\t\t\t\t<a:latin typeface=\"Times\" pitchFamily=\"34\" charset=\"0\"/>\n\t\t\t\t\t<a:ea typeface=\"Times\" pitchFamily=\"34\" charset=\"-122\"/>\n\t\t\t\t\t<a:cs typeface=\"Times\" pitchFamily=\"34\" charset=\"-120\"/>\n\t\t\t\t</a:rPr>\n\t\t\t\t<a:t></a:t>\n\t\t\t</a:r>\n\t\t\t<a:endParaRPr lang=\"en-US\" dirty=\"0\"/>\n\t\t</a:p>\n\t*/\n\n\t// Return paragraph with text run\n\tif (textObj.text === undefined || textObj.text === null) return ''\n\treturn `<a:r>${genXmlTextRunProperties(textObj.options, false)}<a:t>${encodeXmlEntities(String(textObj.text))}</a:t></a:r>`\n}\n\n/**\n * Builds `<a:normAutofit>` with explicit fontScale/lnSpcReduction for \"shrink text on overflow\"\n * @param {TextFitShrinkProps} fit - shrink fit options\n * @return {string} XML string (`<a:normAutofit .../>`)\n * @see ECMA-376 CT_TextNormAutofit (attributes in 1000ths of a percent)\n */\nfunction genXmlNormAutofit (fit: TextFitShrinkProps): string {\n\tlet attrs = ''\n\n\t// NOTE: fontScale/lnSpcReduction are authored as a percent (0-100); OOXML stores them in 1000ths of a percent.\n\tconst pct = (val: number | undefined, name: string): number | null => {\n\t\tif (val === undefined || val === null) return null\n\t\tif (typeof val !== 'number' || isNaN(val) || val < 0 || val > 100) {\n\t\t\tconsole.warn(`Warning: fit.${name} must be a number between 0 and 100 (percent); received ${String(val)} - attribute ignored.`)\n\t\t\treturn null\n\t\t}\n\t\treturn Math.round(val * 1000)\n\t}\n\n\tconst fontScale = pct(fit.fontScale, 'fontScale')\n\tif (fontScale !== null) attrs += ` fontScale=\"${fontScale}\"`\n\tconst lnSpcReduction = pct(fit.lnSpcReduction, 'lnSpcReduction')\n\tif (lnSpcReduction !== null) attrs += ` lnSpcReduction=\"${lnSpcReduction}\"`\n\n\treturn `<a:normAutofit${attrs}/>`\n}\n\n/**\n * Builds `<a:bodyPr></a:bodyPr>` tag for \"genXmlTextBody()\"\n * @param {ISlideObject | TableCell} slideObject - various options\n * @return {string} XML string\n */\nfunction genXmlBodyProperties (slideObject: ISlideObject | TableCell): string {\n\tlet bodyProperties = '<a:bodyPr'\n\n\tif (slideObject && slideObject._type === SLIDE_OBJECT_TYPES.text && slideObject.options._bodyProp) {\n\t\t// PPT-2019 EX: <a:bodyPr wrap=\"square\" lIns=\"1270\" tIns=\"1270\" rIns=\"1270\" bIns=\"1270\" rtlCol=\"0\" anchor=\"ctr\"/>\n\n\t\t// A: Enable or disable textwrapping none or square\n\t\tbodyProperties += slideObject.options._bodyProp.wrap ? ' wrap=\"square\"' : ' wrap=\"none\"'\n\n\t\t// B: Textbox margins [padding]\n\t\tif (slideObject.options._bodyProp.lIns || slideObject.options._bodyProp.lIns === 0) bodyProperties += ` lIns=\"${slideObject.options._bodyProp.lIns}\"`\n\t\tif (slideObject.options._bodyProp.tIns || slideObject.options._bodyProp.tIns === 0) bodyProperties += ` tIns=\"${slideObject.options._bodyProp.tIns}\"`\n\t\tif (slideObject.options._bodyProp.rIns || slideObject.options._bodyProp.rIns === 0) bodyProperties += ` rIns=\"${slideObject.options._bodyProp.rIns}\"`\n\t\tif (slideObject.options._bodyProp.bIns || slideObject.options._bodyProp.bIns === 0) bodyProperties += ` bIns=\"${slideObject.options._bodyProp.bIns}\"`\n\n\t\t// C.1: Text columns (numCol/spcCol). Spacing is only meaningful when there is more than one column.\n\t\tif (slideObject.options._bodyProp.numCol) bodyProperties += ` numCol=\"${slideObject.options._bodyProp.numCol}\"`\n\t\tif (slideObject.options._bodyProp.spcCol) bodyProperties += ` spcCol=\"${slideObject.options._bodyProp.spcCol}\"`\n\n\t\t// C: Add rtl after margins\n\t\tbodyProperties += ' rtlCol=\"0\"'\n\n\t\t// D: Add anchorPoints\n\t\tif (slideObject.options._bodyProp.anchor) bodyProperties += ' anchor=\"' + slideObject.options._bodyProp.anchor + '\"' // VALS: [t,ctr,b]\n\t\tif (slideObject.options._bodyProp.vert) bodyProperties += ' vert=\"' + slideObject.options._bodyProp.vert + '\"' // VALS: [eaVert,horz,mongolianVert,vert,vert270,wordArtVert,wordArtVertRtl]\n\n\t\t// E: Close <a:bodyPr element\n\t\tbodyProperties += '>'\n\n\t\t/**\n\t\t * F: Text Fit/AutoFit/Shrink option\n\t\t * @see: http://officeopenxml.com/drwSp-text-bodyPr-fit.php\n\t\t * @see: http://www.datypic.com/sc/ooxml/g-a_EG_TextAutofit.html\n\t\t */\n\t\tif (slideObject.options.fit) {\n\t\t\tconst fit = slideObject.options.fit\n\t\t\t// NOTE: Use of '<a:noAutofit/>' instead of '' causes issues in PPT-2013!\n\t\t\tif (fit === 'none') bodyProperties += ''\n\t\t\t// NOTE: Bare shrink does not work automatically - PowerPoint calculates fontScale/lnSpcReduction dynamically upon edit/resize.\n\t\t\t// The object form bakes explicit values into the file (MS-PPT > Format shape > Text Options: \"Shrink text on overflow\").\n\t\t\telse if (fit === 'shrink') bodyProperties += '<a:normAutofit/>'\n\t\t\telse if (fit === 'resize') bodyProperties += '<a:spAutoFit/>'\n\t\t\telse if (typeof fit === 'object' && fit.type === 'shrink') bodyProperties += genXmlNormAutofit(fit)\n\t\t}\n\t\t//\n\t\t// DEPRECATED: below (@deprecated v3.3.0)\n\t\tif (slideObject.options.shrinkText) bodyProperties += '<a:normAutofit/>' // MS-PPT > Format shape > Text Options: \"Shrink text on overflow\"\n\t\t/* DEPRECATED: below (@deprecated v3.3.0)\n\t\t * MS-PPT > Format shape > Text Options: \"Resize shape to fit text\" [spAutoFit]\n\t\t * NOTE: Use of '<a:noAutofit/>' in lieu of '' below causes issues in PPT-2013\n\t\t */\n\t\tbodyProperties += slideObject.options._bodyProp.autoFit ? '<a:spAutoFit/>' : ''\n\n\t\t// LAST: Close _bodyProp\n\t\tbodyProperties += '</a:bodyPr>'\n\t} else {\n\t\t// DEFAULT:\n\t\tbodyProperties += ' wrap=\"square\" rtlCol=\"0\">'\n\t\tbodyProperties += '</a:bodyPr>'\n\t}\n\n\t// LAST: Return Close _bodyProp\n\treturn slideObject._type === SLIDE_OBJECT_TYPES.tablecell ? '<a:bodyPr/>' : bodyProperties\n}\n\n/**\n * Generate the XML for text and its options (bold, bullet, etc) including text runs (word-level formatting)\n * @param {ISlideObject|TableCell} slideObj - slideObj or tableCell\n * @note PPT text lines [lines followed by line-breaks] are created using <p>-aragraph's\n * @note Bullets are a paragragh-level formatting device\n * @template\n * <p:txBody>\n * <a:bodyPr wrap=\"square\" rtlCol=\"0\">\n * <a:spAutoFit/>\n * </a:bodyPr>\n * <a:lstStyle/>\n * <a:p>\n * <a:pPr algn=\"ctr\"/>\n * <a:r>\n * <a:rPr lang=\"en-US\" dirty=\"0\" err=\"1\"/>\n * <a:t>textbox text</a:t>\n * </a:r>\n * <a:endParaRPr lang=\"en-US\" dirty=\"0\"/>\n * </a:p>\n * </p:txBody>\n * @returns XML containing the param object's text and formatting\n */\nexport function genXmlTextBody (slideObj: ISlideObject | TableCell): string {\n\tconst opts: ObjectOptions = slideObj.options || {}\n\tlet tmpTextObjects: TextProps[] = []\n\tconst arrTextObjects: TextProps[] = []\n\n\t// FIRST: Shapes without text reach this point with `slideObj.text` null/undefined.\n\t// We MUST still emit a `<p:txBody>` with at least an empty `<a:p>` paragraph;\n\t// the empty-txBody fallback below appends `<a:p><a:endParaRPr/></a:p>` when no\n\t// `<a:p>` was produced. Returning early here would emit `<p:sp>` without\n\t// `<p:txBody>`, which PowerPoint reports as a needs-repair error (#1441).\n\n\t// STEP 1: Start textBody\n\tlet strSlideXml = slideObj._type === SLIDE_OBJECT_TYPES.tablecell ? '<a:txBody>' : '<p:txBody>'\n\n\t// STEP 2: Add bodyProperties\n\t{\n\t\t// A: 'bodyPr'\n\t\tstrSlideXml += genXmlBodyProperties(slideObj)\n\n\t\t// B: 'lstStyle'\n\t\t// NOTE: shape type 'LINE' has different text align needs (a lstStyle.lvl1pPr between bodyPr and p)\n\t\t// FIXME: LINE horiz-align doesnt work (text is always to the left inside line) (FYI: the PPT code diff is substantial!)\n\t\tif (opts.h === 0 && opts.line && opts.align) strSlideXml += '<a:lstStyle><a:lvl1pPr algn=\"l\"/></a:lstStyle>'\n\t\telse if (slideObj._type === 'placeholder') strSlideXml += `<a:lstStyle>${genXmlParagraphProperties(slideObj, true)}</a:lstStyle>`\n\t\telse strSlideXml += '<a:lstStyle/>'\n\t}\n\n\t/* STEP 3: Modify slideObj.text to array\n\t\tCASES:\n\t\taddText( 'string' ) // string\n\t\taddText( 'line1\\n line2' ) // string with lineBreak\n\t\taddText( {text:'word1'} ) // TextProps object\n\t\taddText( ['barry','allen'] ) // array of strings\n\t\taddText( [{text:'word1'}, {text:'word2'}] ) // TextProps object array\n\t\taddText( [{text:'line1\\n line2'}, {text:'end word'}] ) // TextProps object array with lineBreak\n\t*/\n\tif (typeof slideObj.text === 'string' || typeof slideObj.text === 'number') {\n\t\t// Handle cases 1,2\n\t\ttmpTextObjects.push({ text: slideObj.text.toString(), options: opts || {} })\n\t} else if (slideObj.text && !Array.isArray(slideObj.text) && typeof slideObj.text === 'object' && Object.keys(slideObj.text).includes('text')) {\n\t\t// } else if (!Array.isArray(slideObj.text) && slideObj.text!.hasOwnProperty('text')) { // 20210706: replaced with below as ts compiler rejected it\n\t\t// Handle case 3\n\t\ttmpTextObjects.push({ text: slideObj.text || '', options: slideObj.options || {} })\n\t} else if (Array.isArray(slideObj.text)) {\n\t\t// Handle cases 4,5,6\n\t\t// NOTE: use cast as text is TextProps[]|TableCell[] and their `options` dont overlap (they share the same TextBaseProps though)\n\t\ttmpTextObjects = (slideObj.text as TextProps[]).map(item => ({ text: item.text, options: item.options }))\n\t}\n\n\t// STEP 4: Iterate over text objects, set text/options, break into pieces if '\\n'/breakLine found\n\ttmpTextObjects.forEach((itext, idx) => {\n\t\tif (!itext.text) itext.text = ''\n\n\t\t// A: Set options\n\t\titext.options = itext.options || opts || {}\n\t\tif (idx === 0 && itext.options && !itext.options.bullet && opts.bullet) itext.options.bullet = opts.bullet\n\n\t\t// B: Cast to text-object and fix line-breaks (if needed)\n\t\tif (typeof itext.text === 'string' || typeof itext.text === 'number') {\n\t\t\t// 1: Convert \"\\n\" or any variation into CRLF\n\t\t\titext.text = itext.text.toString().replace(/\\r*\\n/g, CRLF)\n\t\t}\n\n\t\t// C: If text string has line-breaks, then create a separate text-object for each (much easier than dealing with split inside a loop below)\n\t\t// NOTE: Filter for trailing lineBreak prevents the creation of an empty textObj as the last item\n\t\tif (itext.text.includes(CRLF) && itext.text.match(/\\n$/g) === null) {\n\t\t\tconst lines = itext.text.split(CRLF)\n\t\t\tlines.forEach((line, lineIdx) => {\n\t\t\t\tconst isLast = lineIdx === lines.length - 1\n\t\t\t\t// Non-last pieces need a paragraph break after them (the \\n implies it).\n\t\t\t\t// The last piece inherits the caller's breakLine intent — do not mutate the original options object.\n\t\t\t\tarrTextObjects.push({ text: line, options: { ...itext.options, breakLine: isLast ? itext.options.breakLine : true } })\n\t\t\t})\n\t\t} else {\n\t\t\tarrTextObjects.push(itext)\n\t\t}\n\t})\n\n\t// STEP 5: Group textObj into lines by checking for lineBreak, bullets, alignment change, etc.\n\tconst arrLines: TextProps[][] = []\n\tlet arrTexts: TextProps[] = []\n\tarrTextObjects.forEach((textObj, idx) => {\n\t\t// A: Align or Bullet trigger new line\n\t\tif (arrTexts.length > 0 && (textObj.options.align || opts.align)) {\n\t\t\t// Only start a new paragraph when align *changes*\n\t\t\tif (textObj.options.align !== arrTextObjects[idx - 1].options.align) {\n\t\t\t\tarrLines.push(arrTexts)\n\t\t\t\tarrTexts = []\n\t\t\t}\n\t\t} else if (arrTexts.length > 0 && textObj.options.bullet && arrTexts.length > 0) {\n\t\t\tarrLines.push(arrTexts)\n\t\t\tarrTexts = []\n\t\t\ttextObj.options.breakLine = false // For cases with both `bullet` and `brekaLine` - prevent double lineBreak\n\t\t}\n\n\t\t// B: Add this text to current line\n\t\tarrTexts.push(textObj)\n\n\t\t// C: BreakLine begins new line **after** adding current text\n\t\tif (arrTexts.length > 0 && textObj.options.breakLine) {\n\t\t\t// Avoid starting a para right as loop is exhausted\n\t\t\tif (idx + 1 < arrTextObjects.length) {\n\t\t\t\tarrLines.push(arrTexts)\n\t\t\t\tarrTexts = []\n\t\t\t}\n\t\t}\n\n\t\t// D: Flush buffer\n\t\tif (idx + 1 === arrTextObjects.length) arrLines.push(arrTexts)\n\t})\n\n\t// STEP 6: Loop over each line and create paragraph props, text run, etc.\n\tarrLines.forEach(line => {\n\t\tlet reqsClosingFontSize = false\n\n\t\t// A: Start paragraph, add paraProps\n\t\tstrSlideXml += '<a:p>'\n\t\t// NOTE: `rtlMode` is like other opts, its propagated up to each text:options, so just check the 1st one\n\t\tlet paragraphPropXml = `<a:pPr ${line[0].options?.rtlMode ? ' rtl=\"1\" ' : ''}`\n\t\tlet paragraphPropEmitted = false\n\n\t\t// B: Start paragraph, loop over lines and add text runs\n\t\tline.forEach((textObj, idx) => {\n\t\t\t// A: Set line index\n\t\t\ttextObj.options._lineIdx = idx\n\n\t\t\t// A.1: Add soft break if not the first run of the line.\n\t\t\tif (idx > 0 && textObj.options.softBreakBefore) {\n\t\t\t\tstrSlideXml += '<a:br/>'\n\t\t\t}\n\n\t\t\t// B: Inherit pPr-type options from parent shape's `options`\n\t\t\ttextObj.options.align = textObj.options.align || opts.align\n\t\t\ttextObj.options.lineSpacing = textObj.options.lineSpacing || opts.lineSpacing\n\t\t\ttextObj.options.lineSpacingMultiple = textObj.options.lineSpacingMultiple || opts.lineSpacingMultiple\n\t\t\ttextObj.options.indentLevel = textObj.options.indentLevel || opts.indentLevel\n\t\t\ttextObj.options.paraSpaceBefore = textObj.options.paraSpaceBefore || opts.paraSpaceBefore\n\t\t\ttextObj.options.paraSpaceAfter = textObj.options.paraSpaceAfter || opts.paraSpaceAfter\n\n\t\t\t// OOXML allows only one `<a:pPr>` per `<a:p>`, and it must precede any `<a:r>` runs.\n\t\t\t// Emit paragraph properties exactly once, derived from the first run that yields non-empty pPr XML.\n\t\t\tif (!paragraphPropEmitted) {\n\t\t\t\tparagraphPropXml = genXmlParagraphProperties(textObj, false)\n\t\t\t\tconst cleaned = paragraphPropXml.replace('<a:pPr></a:pPr>', '') // IMPORTANT: Empty \"pPr\" blocks will generate needs-repair/corrupt msg\n\t\t\t\tif (cleaned) {\n\t\t\t\t\tstrSlideXml += cleaned\n\t\t\t\t\tparagraphPropEmitted = true\n\t\t\t\t}\n\t\t\t}\n\t\t\t// C: Inherit any main options (color, fontSize, etc.)\n\t\t\t// NOTE: We only pass the text.options to genXmlTextRun (not the Slide.options),\n\t\t\t// so the run building function cant just fallback to Slide.color, therefore, we need to do that here before passing options below.\n\t\t\t// FILTER RULE: Hyperlinks should not inherit `color` from main options (let PPT default to local color, eg: blue on MacOS)\n\t\t\tconst textOptions = textObj.options as TextPropsOptions & Record<string, unknown>\n\t\t\tObject.entries(opts).filter(([key]) => !(textObj.options.hyperlink && key === 'color')).forEach(([key, val]) => {\n\t\t\t\t// if (textObj.options.hyperlink && key === 'color') null\n\t\t\t\t// NOTE: This loop will pick up unecessary keys (`x`, etc.), but it doesnt hurt anything\n\t\t\t\tif (key !== 'bullet' && !textOptions[key]) textOptions[key] = val\n\t\t\t})\n\n\t\t\t// D: Add formatted textrun\n\t\t\t// When this paragraph emits bullet markup (`bullet:true` or any object\n\t\t\t// form), strip a single leading bullet glyph (+ optional whitespace) from\n\t\t\t// the first run's text. Otherwise PowerPoint renders two bullets — one\n\t\t\t// from the paragraph-level `<a:buChar/>` and one from the literal glyph\n\t\t\t// in `<a:t>`. Mid-text glyphs and `bullet:false`/no-bullet are unaffected.\n\t\t\tlet _textRunObj = textObj\n\t\t\tif (idx === 0 && line[0].options.bullet && typeof textObj.text === 'string') {\n\t\t\t\tconst _stripped = textObj.text.replace(/^[\\u2022\\u25E6\\u25AA\\u25AB\\u25CF\\u25CB\\u2023\\u2043\\u2219]\\s*/, '')\n\t\t\t\tif (_stripped !== textObj.text) {\n\t\t\t\t\t_textRunObj = { text: _stripped, options: textObj.options }\n\t\t\t\t}\n\t\t\t}\n\t\t\tstrSlideXml += genXmlTextRun(_textRunObj)\n\n\t\t\t// E: Flag close fontSize for empty [lineBreak] elements\n\t\t\tif ((!textObj.text && opts.fontSize) || textObj.options.fontSize) {\n\t\t\t\treqsClosingFontSize = true\n\t\t\t\topts.fontSize = opts.fontSize || textObj.options.fontSize\n\t\t\t}\n\t\t})\n\n\t\t/* C: Append 'endParaRPr' (when needed) and close current open paragraph\n\t\t * NOTE: (ISSUE#20, ISSUE#193): Add 'endParaRPr' with font/size props or PPT default (Arial/18pt en-us) is used making row \"too tall\"/not honoring options\n\t\t */\n\t\tif (slideObj._type === SLIDE_OBJECT_TYPES.tablecell && (opts.fontSize || opts.fontFace)) {\n\t\t\tif (opts.fontFace) {\n\t\t\t\tstrSlideXml += `<a:endParaRPr lang=\"${opts.lang || 'en-US'}\"` + (opts.fontSize ? ` sz=\"${clampFontSizeSz(opts.fontSize)}\"` : '') + ' dirty=\"0\">'\n\t\t\t\tstrSlideXml += `<a:latin typeface=\"${opts.fontFace}\" charset=\"0\"/>`\n\t\t\t\tstrSlideXml += `<a:ea typeface=\"${opts.fontFace}\" charset=\"0\"/>`\n\t\t\t\tstrSlideXml += `<a:cs typeface=\"${opts.fontFace}\" charset=\"0\"/>`\n\t\t\t\tstrSlideXml += '</a:endParaRPr>'\n\t\t\t} else {\n\t\t\t\tstrSlideXml += `<a:endParaRPr lang=\"${opts.lang || 'en-US'}\"` + (opts.fontSize ? ` sz=\"${clampFontSizeSz(opts.fontSize)}\"` : '') + ' dirty=\"0\"/>'\n\t\t\t}\n\t\t} else if (reqsClosingFontSize) {\n\t\t\t// Empty [lineBreak] lines should not contain runProp, however, they need to specify fontSize in `endParaRPr`\n\t\t\tstrSlideXml += `<a:endParaRPr lang=\"${opts.lang || 'en-US'}\"` + (opts.fontSize ? ` sz=\"${clampFontSizeSz(opts.fontSize)}\"` : '') + ' dirty=\"0\"/>'\n\t\t} else {\n\t\t\tstrSlideXml += `<a:endParaRPr lang=\"${opts.lang || 'en-US'}\" dirty=\"0\"/>` // Added 20180101 to address PPT-2007 issues\n\t\t}\n\n\t\t// D: End paragraph\n\t\tstrSlideXml += '</a:p>'\n\t})\n\n\t// IMPORTANT: An empty txBody will cause \"needs repair\" error! Add <p> content if missing.\n\t// [FIXED in v3.13.0]: This fixes issue with table auto-paging where some cells w/b empty on subsequent pages.\n\t/*\n\t\t<a:txBody>\n\t\t\t<a:bodyPr/>\n\t\t\t<a:lstStyle/>\n\t\t</a:txBody>\n\t*/\n\tif (!strSlideXml.includes('<a:p>')) {\n\t\tstrSlideXml += '<a:p><a:endParaRPr/></a:p>'\n\t}\n\n\t// STEP 7: Close the textBody\n\tstrSlideXml += slideObj._type === SLIDE_OBJECT_TYPES.tablecell ? '</a:txBody>' : '</p:txBody>'\n\n\t// LAST: Return XML\n\treturn strSlideXml\n}\n\n/**\n * Generate an XML Placeholder\n * @param {ISlideObject} placeholderObj\n * @returns XML\n */\nexport function genXmlPlaceholder (placeholderObj: ISlideObject): string {\n\tif (!placeholderObj) return ''\n\n\tconst placeholderIdx = placeholderObj.options?._placeholderIdx ? placeholderObj.options._placeholderIdx : ''\n\tconst placeholderTyp = placeholderObj.options?._placeholderType ? placeholderObj.options._placeholderType : ''\n\tconst placeholderType = placeholderTyp && PLACEHOLDER_TYPE_MAP[placeholderTyp] ? PLACEHOLDER_TYPE_MAP[placeholderTyp].toString() : ''\n\n\treturn `<p:ph\n\t\t${placeholderIdx ? ' idx=\"' + placeholderIdx.toString() + '\"' : ''}\n\t\t${placeholderType && PLACEHOLDER_TYPE_MAP[placeholderType] ? ` type=\"${placeholderType}\"` : ''}\n\t\t${placeholderObj.text && placeholderObj.text.length > 0 ? ' hasCustomPrompt=\"1\"' : ''}\n\t\t/>`\n}\n\n// XML-GEN: First 6 functions create the base /ppt files\n\n/**\n * Generate XML ContentType\n * @param {PresSlideInternal[]} slides - slides\n * @param {SlideLayoutInternal[]} slideLayouts - slide layouts\n * @param {PresSlideInternal} masterSlide - master slide\n * @returns XML\n */\nexport function makeXmlContTypes (slides: PresSlideInternal[], slideLayouts: SlideLayoutInternal[], masterSlide?: PresSlideInternal, hasCustomProps?: boolean): string {\n\tlet strXml = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>' + CRLF\n\tstrXml += '<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">'\n\tstrXml += '<Default Extension=\"xml\" ContentType=\"application/xml\"/>'\n\tstrXml += '<Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/>'\n\n\t// STEP 1 - Emit Default Extension entries only for media types actually used by the deck.\n\t// Walk slides + slideLayouts + masterSlide _relsMedia[] and dedupe by extension.\n\t// Skip 'online' rels (no part written) and rels missing extn/type.\n\tconst extnTypeMap = new Map<string, string>()\n\tconst ctTargets: Array<{ _relsMedia?: ISlideRelMedia[], _relsChart?: ISlideRelChart[] }> = []\n\t;(slides || []).forEach(s => ctTargets.push(s))\n\t;(slideLayouts || []).forEach(l => ctTargets.push(l))\n\tif (masterSlide) ctTargets.push(masterSlide)\n\tlet ctHasChart = false\n\tctTargets.forEach(target => {\n\t\t(target._relsMedia || []).forEach(rel => {\n\t\t\tif (rel.type === 'online' || !rel.extn || !rel.type) return\n\t\t\tif (!extnTypeMap.has(rel.extn)) extnTypeMap.set(rel.extn, rel.type)\n\t\t})\n\t\tif (((target._relsChart) || []).length > 0) ctHasChart = true\n\t})\n\textnTypeMap.forEach((type, extn) => {\n\t\tstrXml += '<Default Extension=\"' + extn + '\" ContentType=\"' + type + '\"/>'\n\t})\n\t// Charts embed an xlsx workbook part; emit the Default only when at least one chart is present.\n\tif (ctHasChart) {\n\t\tstrXml += '<Default Extension=\"xlsx\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"/>'\n\t}\n\n\t// STEP 2: Add presentation and slide master(s)/slide(s)\n\tstrXml += '<Override PartName=\"/ppt/presentation.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml\"/>'\n\tstrXml += '<Override PartName=\"/ppt/notesMasters/notesMaster1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml\"/>'\n\t// Only one slideMaster part (`slideMaster1.xml`) is written; emit a single matching Override\n\t// rather than one per slide (which would dangle, since `slideMaster2..N.xml` do not exist).\n\tstrXml += '<Override PartName=\"/ppt/slideMasters/slideMaster1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml\"/>'\n\tslides.forEach((slide, idx) => {\n\t\tstrXml += `<Override PartName=\"/ppt/slides/slide${idx + 1}.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\"/>`\n\t\t// Add charts if any\n\t\tslide._relsChart.forEach(rel => {\n\t\t\tstrXml += `<Override PartName=\"${rel.Target}\" ContentType=\"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\"/>`\n\t\t})\n\t})\n\n\t// STEP 3: Core PPT\n\tstrXml += '<Override PartName=\"/ppt/presProps.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml\"/>'\n\tstrXml += '<Override PartName=\"/ppt/viewProps.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml\"/>'\n\tstrXml += '<Override PartName=\"/ppt/theme/theme1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/>'\n\t// notesMaster1.xml.rels references ../theme/theme2.xml; emit a matching Override so the part resolves\n\tstrXml += '<Override PartName=\"/ppt/theme/theme2.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/>'\n\tstrXml += '<Override PartName=\"/ppt/tableStyles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml\"/>'\n\n\t// STEP 4: Add Slide Layouts\n\tslideLayouts.forEach((layout, idx) => {\n\t\tstrXml += `<Override PartName=\"/ppt/slideLayouts/slideLayout${idx + 1}.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/>`\n\t\t; (layout._relsChart || []).forEach(rel => {\n\t\t\tstrXml += ' <Override PartName=\"' + rel.Target + '\" ContentType=\"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\"/>'\n\t\t})\n\t})\n\n\t// STEP 5: Add notes slide(s)\n\tslides.forEach((_slide, idx) => {\n\t\tstrXml += `<Override PartName=\"/ppt/notesSlides/notesSlide${idx + 1}.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml\"/>`\n\t})\n\n\t// STEP 6: Add rels\n\tmasterSlide._relsChart.forEach(rel => {\n\t\tstrXml += ' <Override PartName=\"' + rel.Target + '\" ContentType=\"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\"/>'\n\t})\n\t// master _relsMedia extensions are already covered by the unified ctTargets walk above; no per-master Default block needed here.\n\n\t// LAST: Finish XML (Resume core)\n\tstrXml += ' <Override PartName=\"/docProps/core.xml\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\"/>'\n\tstrXml += ' <Override PartName=\"/docProps/app.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\"/>'\n\tif (hasCustomProps) {\n\t\tstrXml += ' <Override PartName=\"/docProps/custom.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.custom-properties+xml\"/>'\n\t}\n\tstrXml += '</Types>'\n\n\treturn strXml\n}\n\n/**\n * Creates `_rels/.rels`\n * @returns XML\n */\nexport function makeXmlRootRels (hasCustomProps?: boolean): string {\n\tlet xml = `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>${CRLF}<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\n\t\t<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\"/>\n\t\t<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\" Target=\"docProps/core.xml\"/>\n\t\t<Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"ppt/presentation.xml\"/>`\n\tif (hasCustomProps) {\n\t\txml += '\\n\\t\\t<Relationship Id=\"rId4\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties\" Target=\"docProps/custom.xml\"/>'\n\t}\n\txml += '\\n\\t\\t</Relationships>'\n\treturn xml\n}\n\n/**\n * Creates `docProps/app.xml`\n * @param {PresSlideInternal[]} slides - Presenation Slides\n * @param {string} company - \"Company\" metadata\n * @returns XML\n */\nexport function makeXmlApp (slides: PresSlideInternal[], company: string): string {\n\treturn `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>${CRLF}<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\" xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\">\n\t<TotalTime>0</TotalTime>\n\t<Words>0</Words>\n\t<Application>Microsoft Office PowerPoint</Application>\n\t<PresentationFormat>On-screen Show (16:9)</PresentationFormat>\n\t<Paragraphs>0</Paragraphs>\n\t<Slides>${slides.length}</Slides>\n\t<Notes>${slides.length}</Notes>\n\t<HiddenSlides>0</HiddenSlides>\n\t<MMClips>0</MMClips>\n\t<ScaleCrop>false</ScaleCrop>\n\t<HeadingPairs>\n\t\t<vt:vector size=\"6\" baseType=\"variant\">\n\t\t\t<vt:variant><vt:lpstr>Fonts Used</vt:lpstr></vt:variant>\n\t\t\t<vt:variant><vt:i4>2</vt:i4></vt:variant>\n\t\t\t<vt:variant><vt:lpstr>Theme</vt:lpstr></vt:variant>\n\t\t\t<vt:variant><vt:i4>1</vt:i4></vt:variant>\n\t\t\t<vt:variant><vt:lpstr>Slide Titles</vt:lpstr></vt:variant>\n\t\t\t<vt:variant><vt:i4>${slides.length}</vt:i4></vt:variant>\n\t\t</vt:vector>\n\t</HeadingPairs>\n\t<TitlesOfParts>\n\t\t<vt:vector size=\"${slides.length + 1 + 2}\" baseType=\"lpstr\">\n\t\t\t<vt:lpstr>Arial</vt:lpstr>\n\t\t\t<vt:lpstr>Calibri</vt:lpstr>\n\t\t\t<vt:lpstr>Office Theme</vt:lpstr>\n\t\t\t${slides.map((_slideObj, idx) => `<vt:lpstr>Slide ${idx + 1}</vt:lpstr>`).join('')}\n\t\t</vt:vector>\n\t</TitlesOfParts>\n\t<Company>${encodeXmlEntities(company)}</Company>\n\t<LinksUpToDate>false</LinksUpToDate>\n\t<SharedDoc>false</SharedDoc>\n\t<HyperlinksChanged>false</HyperlinksChanged>\n\t<AppVersion>16.0000</AppVersion>\n\t</Properties>`\n}\n\n/**\n * Creates `docProps/core.xml`\n * @param {string} title - metadata data\n * @param {string} subject - metadata data\n * @param {string} author - metadata value\n * @param {string} revision - metadata value\n * @returns XML\n */\nexport function makeXmlCore (title: string, subject: string, author: string, revision: string): string {\n\treturn `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n\t<cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n\t\t<dc:title>${encodeXmlEntities(title)}</dc:title>\n\t\t<dc:subject>${encodeXmlEntities(subject)}</dc:subject>\n\t\t<dc:creator>${encodeXmlEntities(author)}</dc:creator>\n\t\t<cp:lastModifiedBy>${encodeXmlEntities(author)}</cp:lastModifiedBy>\n\t\t<cp:revision>${revision}</cp:revision>\n\t\t<dcterms:created xsi:type=\"dcterms:W3CDTF\">${new Date().toISOString().replace(/\\.\\d\\d\\dZ/, 'Z')}</dcterms:created>\n\t\t<dcterms:modified xsi:type=\"dcterms:W3CDTF\">${new Date().toISOString().replace(/\\.\\d\\d\\dZ/, 'Z')}</dcterms:modified>\n\t</cp:coreProperties>`\n}\n\nconst CUSTOM_PROPS_FMTID = '{D5CDD505-2E9C-101B-9397-08002B2CF9AE}'\n\n/**\n * Creates `docProps/custom.xml`\n * @param props - custom property name/value pairs\n * @returns XML\n */\nexport function makeXmlCustomProperties (props: Array<{ name: string; value: CustomPropertyValue }>): string {\n\tconst propertiesXml = props.map(({ name, value }, idx) => {\n\t\tlet valueXml: string\n\t\tif (typeof value === 'boolean') {\n\t\t\tvalueXml = `<vt:bool>${value}</vt:bool>`\n\t\t} else if (value instanceof Date) {\n\t\t\tvalueXml = `<vt:filetime>${value.toISOString().replace(/\\.\\d{3}Z$/, 'Z')}</vt:filetime>`\n\t\t} else if (typeof value === 'number') {\n\t\t\tvalueXml = Number.isInteger(value) ? `<vt:i4>${value}</vt:i4>` : `<vt:r8>${value}</vt:r8>`\n\t\t} else {\n\t\t\tvalueXml = `<vt:lpwstr>${encodeXmlEntities(String(value))}</vt:lpwstr>`\n\t\t}\n\t\treturn `<property fmtid=\"${CUSTOM_PROPS_FMTID}\" pid=\"${idx + 2}\" name=\"${encodeXmlEntities(name)}\">${valueXml}</property>`\n\t}).join('')\n\treturn `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>${CRLF}<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties\" xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\">${propertiesXml}</Properties>`\n}\n\n/**\n * Creates `ppt/_rels/presentation.xml.rels`\n * @param {PresSlideInternal[]} slides - Presenation Slides\n * @returns XML\n */\nexport function makeXmlPresentationRels (slides: PresSlideInternal[]): string {\n\tlet intRelNum = 1\n\tlet strXml = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>' + CRLF\n\tstrXml += '<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">'\n\tstrXml += '<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"slideMasters/slideMaster1.xml\"/>'\n\tfor (let idx = 1; idx <= slides.length; idx++) {\n\t\tstrXml += `<Relationship Id=\"rId${++intRelNum}\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"slides/slide${idx}.xml\"/>`\n\t}\n\tintRelNum++\n\tstrXml +=\n\t\t`<Relationship Id=\"rId${intRelNum + 0}\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"notesMasters/notesMaster1.xml\"/>` +\n\t\t`<Relationship Id=\"rId${intRelNum + 1}\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps\" Target=\"presProps.xml\"/>` +\n\t\t`<Relationship Id=\"rId${intRelNum + 2}\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps\" Target=\"viewProps.xml\"/>` +\n\t\t`<Relationship Id=\"rId${intRelNum + 3}\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"theme/theme1.xml\"/>` +\n\t\t`<Relationship Id=\"rId${intRelNum + 4}\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles\" Target=\"tableStyles.xml\"/>` +\n\t\t'</Relationships>'\n\n\treturn strXml\n}\n\n// XML-GEN: Functions that run 1-N times (once for each Slide)\n\n/**\n * Generates XML for the slide file (`ppt/slides/slide1.xml`)\n * @param {PresSlideInternal} slide - the slide object to transform into XML\n * @return {string} XML\n */\nexport function makeXmlSlide (slide: PresSlideInternal): string {\n\treturn (\n\t\t`<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>${CRLF}` +\n\t\t'<p:sld xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" ' +\n\t\t'xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"' +\n\t\t`${slide?.hidden ? ' show=\"0\"' : ''}>` +\n\t\t`${slideObjectToXml(slide)}` +\n\t\t'<p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sld>'\n\t)\n}\n\n/**\n * Get text content of Notes from Slide\n * @param {PresSlideInternal} slide - the slide object to transform into XML\n * @return {string} notes text\n */\nexport function getNotesFromSlide (slide: PresSlideInternal): string {\n\tlet notesText = ''\n\n\tslide._slideObjects.forEach(data => {\n\t\tif (data._type === SLIDE_OBJECT_TYPES.notes) notesText += data?.text && data.text[0] ? data.text[0].text : ''\n\t})\n\n\treturn notesText.replace(/\\r*\\n/g, CRLF)\n}\n\n/**\n * Generate XML for Notes Master (notesMaster1.xml)\n * @returns {string} XML\n */\nexport function makeXmlNotesMaster (): string {\n\treturn `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>${CRLF}<p:notesMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"><p:cSld><p:bg><p:bgRef idx=\"1001\"><a:schemeClr val=\"bg1\"/></p:bgRef></p:bg><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Header Placeholder 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"hdr\" sz=\"quarter\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"2971800\" cy=\"458788\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\"/><a:lstStyle><a:lvl1pPr algn=\"l\"><a:defRPr sz=\"1200\"/></a:lvl1pPr></a:lstStyle><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Date Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"3884613\" y=\"0\"/><a:ext cx=\"2971800\" cy=\"458788\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\"/><a:lstStyle><a:lvl1pPr algn=\"r\"><a:defRPr sz=\"1200\"/></a:lvl1pPr></a:lstStyle><a:p><a:fld id=\"{5282F153-3F37-0F45-9E97-73ACFA13230C}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\"/><a:t>7/23/19</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Slide Image Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\" noRot=\"1\" noChangeAspect=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldImg\" idx=\"2\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"685800\" y=\"1143000\"/><a:ext cx=\"5486400\" cy=\"3086100\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom><a:noFill/><a:ln w=\"12700\"><a:solidFill><a:prstClr val=\"black\"/></a:solidFill></a:ln></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\" anchor=\"ctr\"/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"5\" name=\"Notes Placeholder 4\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" sz=\"quarter\" idx=\"3\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"685800\" y=\"4400550\"/><a:ext cx=\"5486400\" cy=\"3600450\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\"/><a:lstStyle/><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl=\"1\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl=\"2\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl=\"3\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl=\"4\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"6\" name=\"Footer Placeholder 5\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"4\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"0\" y=\"8685213\"/><a:ext cx=\"2971800\" cy=\"458787\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\" anchor=\"b\"/><a:lstStyle><a:lvl1pPr algn=\"l\"><a:defRPr sz=\"1200\"/></a:lvl1pPr></a:lstStyle><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"7\" name=\"Slide Number Placeholder 6\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"5\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"3884613\" y=\"8685213\"/><a:ext cx=\"2971800\" cy=\"458787\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\" anchor=\"b\"/><a:lstStyle><a:lvl1pPr algn=\"r\"><a:defRPr sz=\"1200\"/></a:lvl1pPr></a:lstStyle><a:p><a:fld id=\"{CE5E9CC1-C706-0F49-92D6-E571CC5EEA8F}\" type=\"slidenum\"><a:rPr lang=\"en-US\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"1024086991\"/></p:ext></p:extLst></p:cSld><p:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/><p:notesStyle><a:lvl1pPr marL=\"0\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl1pPr><a:lvl2pPr marL=\"457200\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl2pPr><a:lvl3pPr marL=\"914400\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl3pPr><a:lvl4pPr marL=\"1371600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl4pPr><a:lvl5pPr marL=\"1828800\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl5pPr><a:lvl6pPr marL=\"2286000\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl6pPr><a:lvl7pPr marL=\"2743200\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl7pPr><a:lvl8pPr marL=\"3200400\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl8pPr><a:lvl9pPr marL=\"3657600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl9pPr></p:notesStyle></p:notesMaster>`\n}\n\n/**\n * Creates Notes Slide (`ppt/notesSlides/notesSlide1.xml`)\n * @param {PresSlideInternal} slide - the slide object to transform into XML\n * @return {string} XML\n */\nexport function makeXmlNotesSlide (slide: PresSlideInternal): string {\n\treturn (\n\t\t`<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>${CRLF}<p:notes xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Slide Image Placeholder 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\" noRot=\"1\" noChangeAspect=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldImg\"/></p:nvPr></p:nvSpPr><p:spPr/></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Notes Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\" dirty=\"0\"/><a:t>${encodeXmlEntities(getNotesFromSlide(slide))}</a:t></a:r><a:endParaRPr lang=\"en-US\" dirty=\"0\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Slide Number Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"${SLDNUMFLDID}\" type=\"slidenum\"><a:rPr lang=\"en-US\"/><a:t>${slide._slideNum}</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"1024086991\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:notes>`\n\t)\n}\n\n/**\n * Generates the XML layout resource from a layout object\n * @param {SlideLayoutInternal} layout - slide layout (master)\n * @return {string} XML\n */\nexport function makeXmlLayout (layout: SlideLayoutInternal): string {\n\treturn `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n\t\t<p:sldLayout xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" preserve=\"1\">\n\t\t${slideObjectToXml(layout)}\n\t\t<p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>`\n}\n\n/**\n * Creates Slide Master 1 (`ppt/slideMasters/slideMaster1.xml`)\n * @param {PresSlideInternal} slide - slide object that represents master slide layout\n * @param {SlideLayoutInternal[]} layouts - slide layouts\n * @return {string} XML\n */\nexport function makeXmlMaster (slide: PresSlideInternal, layouts: SlideLayoutInternal[]): string {\n\t// NOTE: Pass layouts as static rels because they are not referenced any time\n\tconst layoutDefs = layouts.map((_layoutDef, idx) => `<p:sldLayoutId id=\"${LAYOUT_IDX_SERIES_BASE + idx}\" r:id=\"rId${slide._rels.length + idx + 1}\"/>`)\n\n\tlet strXml = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>' + CRLF\n\tstrXml +=\n\t\t'<p:sldMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">'\n\tstrXml += slideObjectToXml(slide)\n\tstrXml +=\n\t\t'<p:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/>'\n\tstrXml += '<p:sldLayoutIdLst>' + layoutDefs.join('') + '</p:sldLayoutIdLst>'\n\tstrXml += '<p:hf sldNum=\"0\" hdr=\"0\" ftr=\"0\" dt=\"0\"/>'\n\tstrXml +=\n\t\t'<p:txStyles>' +\n\t\t' <p:titleStyle>' +\n\t\t' <a:lvl1pPr algn=\"ctr\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"0\"/></a:spcBef><a:buNone/><a:defRPr sz=\"4400\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mj-lt\"/><a:ea typeface=\"+mj-ea\"/><a:cs typeface=\"+mj-cs\"/></a:defRPr></a:lvl1pPr>' +\n\t\t' </p:titleStyle>' +\n\t\t' <p:bodyStyle>' +\n\t\t' <a:lvl1pPr marL=\"342900\" indent=\"-342900\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"3200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl1pPr>' +\n\t\t' <a:lvl2pPr marL=\"742950\" indent=\"-285750\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"–\"/><a:defRPr sz=\"2800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl2pPr>' +\n\t\t' <a:lvl3pPr marL=\"1143000\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"2400\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl3pPr>' +\n\t\t' <a:lvl4pPr marL=\"1600200\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"–\"/><a:defRPr sz=\"2000\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl4pPr>' +\n\t\t' <a:lvl5pPr marL=\"2057400\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"»\"/><a:defRPr sz=\"2000\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl5pPr>' +\n\t\t' <a:lvl6pPr marL=\"2514600\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"2000\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl6pPr>' +\n\t\t' <a:lvl7pPr marL=\"2971800\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"2000\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl7pPr>' +\n\t\t' <a:lvl8pPr marL=\"3429000\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"2000\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl8pPr>' +\n\t\t' <a:lvl9pPr marL=\"3886200\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"2000\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl9pPr>' +\n\t\t' </p:bodyStyle>' +\n\t\t' <p:otherStyle>' +\n\t\t' <a:defPPr><a:defRPr lang=\"en-US\"/></a:defPPr>' +\n\t\t' <a:lvl1pPr marL=\"0\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl1pPr>' +\n\t\t' <a:lvl2pPr marL=\"457200\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl2pPr>' +\n\t\t' <a:lvl3pPr marL=\"914400\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl3pPr>' +\n\t\t' <a:lvl4pPr marL=\"1371600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl4pPr>' +\n\t\t' <a:lvl5pPr marL=\"1828800\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl5pPr>' +\n\t\t' <a:lvl6pPr marL=\"2286000\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl6pPr>' +\n\t\t' <a:lvl7pPr marL=\"2743200\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl7pPr>' +\n\t\t' <a:lvl8pPr marL=\"3200400\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl8pPr>' +\n\t\t' <a:lvl9pPr marL=\"3657600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl9pPr>' +\n\t\t' </p:otherStyle>' +\n\t\t'</p:txStyles>'\n\tstrXml += '</p:sldMaster>'\n\n\treturn strXml\n}\n\n/**\n * Generates XML string for a slide layout relation file\n * @param {number} layoutNumber - 1-indexed number of a layout that relations are generated for\n * @param {SlideLayoutInternal[]} slideLayouts - Slide Layouts\n * @return {string} XML\n */\nexport function makeXmlSlideLayoutRel (layoutNumber: number, slideLayouts: SlideLayoutInternal[]): string {\n\treturn slideObjectRelationsToXml(slideLayouts[layoutNumber - 1], [\n\t\t{\n\t\t\ttarget: '../slideMasters/slideMaster1.xml',\n\t\t\ttype: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster',\n\t\t},\n\t])\n}\n\n/**\n * Creates `ppt/_rels/slide*.xml.rels`\n * @param {PresSlideInternal[]} slides\n * @param {SlideLayoutInternal[]} slideLayouts - Slide Layout(s)\n * @param {number} `slideNumber` 1-indexed number of a layout that relations are generated for\n * @return {string} XML\n */\nexport function makeXmlSlideRel (slides: PresSlideInternal[], slideLayouts: SlideLayoutInternal[], slideNumber: number): string {\n\treturn slideObjectRelationsToXml(slides[slideNumber - 1], [\n\t\t{\n\t\t\ttarget: `../slideLayouts/slideLayout${getLayoutIdxForSlide(slides, slideLayouts, slideNumber)}.xml`,\n\t\t\ttype: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout',\n\t\t},\n\t\t{\n\t\t\ttarget: `../notesSlides/notesSlide${slideNumber}.xml`,\n\t\t\ttype: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide',\n\t\t},\n\t])\n}\n\n/**\n * Generates XML string for a slide relation file.\n * @param {number} slideNumber - 1-indexed number of a layout that relations are generated for\n * @return {string} XML\n */\nexport function makeXmlNotesSlideRel (slideNumber: number): string {\n\treturn `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n\t\t<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\n\t\t\t<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"../notesMasters/notesMaster1.xml\"/>\n\t\t\t<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"../slides/slide${slideNumber}.xml\"/>\n\t\t</Relationships>`\n}\n\n/**\n * Creates `ppt/slideMasters/_rels/slideMaster1.xml.rels`\n * @param {PresSlideInternal} masterSlide - Slide object\n * @param {SlideLayoutInternal[]} slideLayouts - Slide Layouts\n * @return {string} XML\n */\nexport function makeXmlMasterRel (masterSlide: PresSlideInternal, slideLayouts: SlideLayoutInternal[]): string {\n\tconst defaultRels = slideLayouts.map((_layoutDef, idx) => ({\n\t\ttarget: `../slideLayouts/slideLayout${idx + 1}.xml`,\n\t\ttype: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout',\n\t}))\n\tdefaultRels.push({ target: '../theme/theme1.xml', type: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme' })\n\n\treturn slideObjectRelationsToXml(masterSlide, defaultRels)\n}\n\n/**\n * Creates `ppt/notesMasters/_rels/notesMaster1.xml.rels`\n * @return {string} XML\n */\nexport function makeXmlNotesMasterRel (): string {\n\treturn `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>${CRLF}<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\n\t\t<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme2.xml\"/>\n\t\t</Relationships>`\n}\n\n/**\n * For the passed slide number, resolves name of a layout that is used for.\n * @param {PresSlideInternal[]} slides - srray of slides\n * @param {SlideLayoutInternal[]} slideLayouts - array of slideLayouts\n * @param {number} slideNumber\n * @return {number} slide number\n */\nfunction getLayoutIdxForSlide (slides: PresSlideInternal[], slideLayouts: SlideLayoutInternal[], slideNumber: number): number {\n\tfor (let i = 0; i < slideLayouts.length; i++) {\n\t\tif (slideLayouts[i]._name === slides[slideNumber - 1]._slideLayout._name) {\n\t\t\treturn i + 1\n\t\t}\n\t}\n\n\t// IMPORTANT: Return 1 (for `slideLayout1.xml`) when no def is found\n\t// So all objects are in Layout1 and every slide that references it uses this layout.\n\treturn 1\n}\n\n// XML-GEN: Last 5 functions create root /ppt files\n\n/**\n * Theme `<a:clrScheme>` slots in OOXML document order, with their default Office color child.\n * `dk1`/`lt1` default to `sysClr` (windowText/window); the rest are `srgbClr`. A user override\n * for any slot is emitted as `<a:srgbClr>` (see `buildThemeClrScheme`).\n */\nconst THEME_CLR_SCHEME_DEFAULTS: ReadonlyArray<[keyof ThemeColorScheme, string]> = [\n\t['dk1', '<a:sysClr val=\"windowText\" lastClr=\"000000\"/>'],\n\t['lt1', '<a:sysClr val=\"window\" lastClr=\"FFFFFF\"/>'],\n\t['dk2', '<a:srgbClr val=\"44546A\"/>'],\n\t['lt2', '<a:srgbClr val=\"E7E6E6\"/>'],\n\t['accent1', '<a:srgbClr val=\"4472C4\"/>'],\n\t['accent2', '<a:srgbClr val=\"ED7D31\"/>'],\n\t['accent3', '<a:srgbClr val=\"A5A5A5\"/>'],\n\t['accent4', '<a:srgbClr val=\"FFC000\"/>'],\n\t['accent5', '<a:srgbClr val=\"5B9BD5\"/>'],\n\t['accent6', '<a:srgbClr val=\"70AD47\"/>'],\n\t['hlink', '<a:srgbClr val=\"0563C1\"/>'],\n\t['folHlink', '<a:srgbClr val=\"954F72\"/>'],\n]\n\n/**\n * Build the theme `<a:clrScheme>` block, applying any caller-supplied color overrides over the\n * default Office scheme. Invalid (non 6-digit-hex) overrides warn and keep the default rather\n * than emitting a degenerate color.\n * @param {ThemeColorScheme} [scheme] - per-slot hex overrides\n * @return {string} the `<a:clrScheme>...</a:clrScheme>` XML\n */\nfunction buildThemeClrScheme (scheme?: ThemeColorScheme): string {\n\tconst slots = THEME_CLR_SCHEME_DEFAULTS.map(([slot, defaultChild]) => {\n\t\tconst override = scheme?.[slot]\n\t\tlet child = defaultChild\n\t\tif (typeof override === 'string' && override.length > 0) {\n\t\t\tconst hex = override.replace('#', '')\n\t\t\tif (REGEX_HEX_COLOR.test(hex)) child = `<a:srgbClr val=\"${hex.toUpperCase()}\"/>`\n\t\t\telse console.warn(`makeXmlTheme: colorScheme.${slot} \"${override}\" is not a 6-digit hex color; keeping the Office default.`)\n\t\t}\n\t\treturn `<a:${slot}>${child}</a:${slot}>`\n\t}).join('')\n\treturn `<a:clrScheme name=\"Office\">${slots}</a:clrScheme>`\n}\n\n/**\n * Creates `ppt/theme/theme1.xml`\n * @return {string} XML\n */\nexport function makeXmlTheme (pres: IPresentationProps): string {\n\tconst majorFont = pres.theme?.headFontFace ? `<a:latin typeface=\"${pres.theme?.headFontFace}\"/>` : '<a:latin typeface=\"Calibri Light\" panose=\"020F0302020204030204\"/>'\n\tconst minorFont = pres.theme?.bodyFontFace ? `<a:latin typeface=\"${pres.theme?.bodyFontFace}\"/>` : '<a:latin typeface=\"Calibri\" panose=\"020F0502020204030204\"/>'\n\treturn `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office Theme\"><a:themeElements>${buildThemeClrScheme(pres.theme?.colorScheme)}<a:fontScheme name=\"Office\"><a:majorFont>${majorFont}<a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"游ゴシック Light\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"等线 Light\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Times New Roman\"/><a:font script=\"Hebr\" typeface=\"Times New Roman\"/><a:font script=\"Thai\" typeface=\"Angsana New\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"MoolBoran\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Times New Roman\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/><a:font script=\"Armn\" typeface=\"Arial\"/><a:font script=\"Bugi\" typeface=\"Leelawadee UI\"/><a:font script=\"Bopo\" typeface=\"Microsoft JhengHei\"/><a:font script=\"Java\" typeface=\"Javanese Text\"/><a:font script=\"Lisu\" typeface=\"Segoe UI\"/><a:font script=\"Mymr\" typeface=\"Myanmar Text\"/><a:font script=\"Nkoo\" typeface=\"Ebrima\"/><a:font script=\"Olck\" typeface=\"Nirmala UI\"/><a:font script=\"Osma\" typeface=\"Ebrima\"/><a:font script=\"Phag\" typeface=\"Phagspa\"/><a:font script=\"Syrn\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Syrj\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Syre\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Sora\" typeface=\"Nirmala UI\"/><a:font script=\"Tale\" typeface=\"Microsoft Tai Le\"/><a:font script=\"Talu\" typeface=\"Microsoft New Tai Lue\"/><a:font script=\"Tfng\" typeface=\"Ebrima\"/></a:majorFont><a:minorFont>${minorFont}<a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"游ゴシック\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"等线\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Arial\"/><a:font script=\"Hebr\" typeface=\"Arial\"/><a:font script=\"Thai\" typeface=\"Cordia New\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"DaunPenh\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Arial\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/><a:font script=\"Armn\" typeface=\"Arial\"/><a:font script=\"Bugi\" typeface=\"Leelawadee UI\"/><a:font script=\"Bopo\" typeface=\"Microsoft JhengHei\"/><a:font script=\"Java\" typeface=\"Javanese Text\"/><a:font script=\"Lisu\" typeface=\"Segoe UI\"/><a:font script=\"Mymr\" typeface=\"Myanmar Text\"/><a:font script=\"Nkoo\" typeface=\"Ebrima\"/><a:font script=\"Olck\" typeface=\"Nirmala UI\"/><a:font script=\"Osma\" typeface=\"Ebrima\"/><a:font script=\"Phag\" typeface=\"Phagspa\"/><a:font script=\"Syrn\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Syrj\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Syre\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Sora\" typeface=\"Nirmala UI\"/><a:font script=\"Tale\" typeface=\"Microsoft Tai Le\"/><a:font script=\"Talu\" typeface=\"Microsoft New Tai Lue\"/><a:font script=\"Tfng\" typeface=\"Ebrima\"/></a:minorFont></a:fontScheme><a:fmtScheme name=\"Office\"><a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"110000\"/><a:satMod val=\"105000\"/><a:tint val=\"67000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"103000\"/><a:tint val=\"73000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"109000\"/><a:tint val=\"81000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:satMod val=\"103000\"/><a:lumMod val=\"102000\"/><a:tint val=\"94000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:satMod val=\"110000\"/><a:lumMod val=\"100000\"/><a:shade val=\"100000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"99000\"/><a:satMod val=\"120000\"/><a:shade val=\"78000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w=\"6350\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"12700\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"19050\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"57150\" dist=\"19050\" dir=\"5400000\" algn=\"ctr\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"63000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:solidFill><a:schemeClr val=\"phClr\"><a:tint val=\"95000\"/><a:satMod val=\"170000\"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"93000\"/><a:satMod val=\"150000\"/><a:shade val=\"98000\"/><a:lumMod val=\"102000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:tint val=\"98000\"/><a:satMod val=\"130000\"/><a:shade val=\"90000\"/><a:lumMod val=\"103000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"63000\"/><a:satMod val=\"120000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults/><a:extraClrSchemeLst/><a:extLst><a:ext uri=\"{05A4C25C-085E-4340-85A3-A5531E510DB2}\"><thm15:themeFamily xmlns:thm15=\"http://schemas.microsoft.com/office/thememl/2012/main\" name=\"Office Theme\" id=\"{62F939B6-93AF-4DB8-9C6B-D6C7DFDC589F}\" vid=\"{4A3C46E8-61CC-4603-A589-7422A47A8E4A}\"/></a:ext></a:extLst></a:theme>`\n}\n\n/**\n * Create presentation file (`ppt/presentation.xml`)\n * @see https://docs.microsoft.com/en-us/office/open-xml/structure-of-a-presentationml-document\n * @see http://www.datypic.com/sc/ooxml/t-p_CT_Presentation.html\n * @param {IPresentationProps} pres - presentation\n * @return {string} XML\n */\nexport function makeXmlPresentation (pres: IPresentationProps): string {\n\tlet strXml =\n\t\t`<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>${CRLF}` +\n\t\t'<p:presentation xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" ' +\n\t\t`xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" ${pres.rtlMode ? 'rtl=\"1\"' : ''} saveSubsetFonts=\"1\" autoCompressPictures=\"0\"${pres.firstSlideNum !== 1 ? ` firstSlideNum=\"${pres.firstSlideNum}\"` : ''}>`\n\n\t// STEP 1: Add slide master (SPEC: tag 1 under <presentation>)\n\tstrXml += '<p:sldMasterIdLst><p:sldMasterId id=\"2147483648\" r:id=\"rId1\"/></p:sldMasterIdLst>'\n\n\t// STEP 2: Add Notes Master (SPEC: tag 2 under <presentation>)\n\t// CT_Presentation child sequence (ECMA-376 Part 1 §19.2.1.26) requires\n\t// notesMasterIdLst to appear BEFORE sldIdLst. Emitting it after sldIdLst\n\t// (or after sldSz/notesSz) violates the schema and is flagged by\n\t// OpenXmlValidator as Sch_UnexpectedElementContentExpectingComplex.\n\t// (NOTE: length+2 is from `presentation.xml.rels` func (since we have to match this rId, we just use same logic))\n\tstrXml += `<p:notesMasterIdLst><p:notesMasterId r:id=\"rId${pres.slides.length + 2}\"/></p:notesMasterIdLst>`\n\n\t// STEP 3: Add all Slides (SPEC: tag 3 under <presentation>)\n\tstrXml += '<p:sldIdLst>'\n\tpres.slides.forEach(slide => (strXml += `<p:sldId id=\"${slide._slideId}\" r:id=\"rId${slide._rId}\"/>`))\n\tstrXml += '</p:sldIdLst>'\n\n\t// STEP 4: Add sizes\n\tstrXml += `<p:sldSz cx=\"${pres.presLayout.width}\" cy=\"${pres.presLayout.height}\"/>`\n\tstrXml += `<p:notesSz cx=\"${pres.presLayout.height}\" cy=\"${pres.presLayout.width}\"/>`\n\n\t// STEP 5: Add text styles\n\tstrXml += '<p:defaultTextStyle>'\n\tfor (let idy = 1; idy < 10; idy++) {\n\t\tstrXml +=\n\t\t\t`<a:lvl${idy}pPr marL=\"${(idy - 1) * 457200}\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">` +\n\t\t\t'<a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/>' +\n\t\t\t`</a:defRPr></a:lvl${idy}pPr>`\n\t}\n\tstrXml += '</p:defaultTextStyle>'\n\n\t// STEP 6: Add Sections (if any)\n\tif (pres.sections && pres.sections.length > 0) {\n\t\tstrXml += '<p:extLst><p:ext uri=\"{521415D9-36F7-43E2-AB2F-B90AF26B5E84}\">'\n\t\tstrXml += '<p14:sectionLst xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\">'\n\t\tpres.sections.forEach(sect => {\n\t\t\tstrXml += `<p14:section name=\"${encodeXmlEntities(sect.title)}\" id=\"{${getUuid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')}}\"><p14:sldIdLst>`\n\t\t\tsect._slides.forEach(slide => (strXml += `<p14:sldId id=\"${slide._slideId}\"/>`))\n\t\t\tstrXml += '</p14:sldIdLst></p14:section>'\n\t\t})\n\t\tstrXml += '</p14:sectionLst></p:ext>'\n\t\tstrXml += '<p:ext uri=\"{EFAFB233-063F-42B5-8137-9DF3F51BA10A}\"><p15:sldGuideLst xmlns:p15=\"http://schemas.microsoft.com/office/powerpoint/2012/main\"/></p:ext>'\n\t\tstrXml += '</p:extLst>'\n\t}\n\n\t// Done\n\tstrXml += '</p:presentation>'\n\treturn strXml\n}\n\n/**\n * Create `ppt/presProps.xml`\n * @return {string} XML\n */\nexport function makeXmlPresProps (): string {\n\treturn `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>${CRLF}<p:presentationPr xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"/>`\n}\n\n/**\n * Create `ppt/tableStyles.xml`\n * @see: http://openxmldeveloper.org/discussions/formats/f/13/p/2398/8107.aspx\n * @return {string} XML\n */\nexport function makeXmlTableStyles (tableStyles: TableStyleInternal[] = []): string {\n\tconst NS = 'http://schemas.openxmlformats.org/drawingml/2006/main'\n\tconst open = `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>${CRLF}<a:tblStyleLst xmlns:a=\"${NS}\" def=\"{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}\"`\n\tif (!tableStyles || tableStyles.length === 0) return `${open}/>`\n\n\tlet strXml = `${open}>`\n\ttableStyles.forEach(({ guid, def }) => {\n\t\tstrXml += `<a:tblStyle styleId=\"${guid}\" styleName=\"${encodeXmlEntities(def.name)}\">`\n\t\t// NOTE: regions MUST be emitted in CT_TableStyle schema order or PowerPoint reports the file as corrupt\n\t\t;([\n\t\t\t['wholeTbl', def.wholeTbl],\n\t\t\t['band1H', def.band1H],\n\t\t\t['band2H', def.band2H],\n\t\t\t['band1V', def.band1V],\n\t\t\t['band2V', def.band2V],\n\t\t\t['lastCol', def.lastCol],\n\t\t\t['firstCol', def.firstCol],\n\t\t\t['lastRow', def.lastRow],\n\t\t\t['firstRow', def.firstRow],\n\t\t] as const).forEach(([name, region]) => {\n\t\t\tif (region) strXml += genXmlTableStyleRegion(name, region)\n\t\t})\n\t\tstrXml += '</a:tblStyle>'\n\t})\n\tstrXml += '</a:tblStyleLst>'\n\treturn strXml\n}\n\n/**\n * Build one `CT_TablePartStyle` region (e.g. `firstRow`, `band1H`) for a custom table style.\n * Emits `tcTxStyle` (text) before `tcStyle` (cell fill/borders) per the schema sequence.\n * @param {string} name - region element name\n * @param {TableStyleRegionProps} region - region styling\n * @return {string} XML\n */\nfunction genXmlTableStyleRegion (name: string, region: TableStyleRegionProps): string {\n\tlet xml = `<a:${name}>`\n\n\t// A: tcTxStyle — text style (only when text formatting is requested)\n\tif (region.bold !== undefined || region.italic !== undefined || region.color) {\n\t\tconst b = region.bold ? ' b=\"on\"' : ''\n\t\tconst i = region.italic ? ' i=\"on\"' : ''\n\t\txml += `<a:tcTxStyle${b}${i}><a:fontRef idx=\"minor\"/>`\n\t\txml += region.color ? createColorElement(region.color) : ''\n\t\txml += '</a:tcTxStyle>'\n\t}\n\n\t// B: tcStyle — cell style: tcBdr (borders) then fill, in schema order\n\tif (region.border !== undefined || region.fill !== undefined) {\n\t\txml += '<a:tcStyle>'\n\t\tif (region.border !== undefined) xml += genXmlTableStyleBorders(region.border)\n\t\tif (region.fill !== undefined) xml += `<a:fill><a:solidFill>${createColorElement(region.fill)}</a:solidFill></a:fill>`\n\t\txml += '</a:tcStyle>'\n\t}\n\n\txml += `</a:${name}>`\n\treturn xml\n}\n\n/**\n * Build the `tcBdr` border block for a custom table style region.\n * A single `BorderProps` styles all four sides plus the interior grid lines; a\n * TRBL array styles only the four outer sides. Sides are emitted in schema order.\n * @param {BorderProps | BorderProps[]} border - border definition\n * @return {string} XML\n */\nfunction genXmlTableStyleBorders (border: BorderProps | BorderProps[]): string {\n\t// NOTE: order MUST be left,right,top,bottom,insideH,insideV (CT_TableCellBorderStyle sequence)\n\tlet sides: Array<[string, BorderProps]>\n\tif (Array.isArray(border)) {\n\t\tconst [top, right, bottom, left] = border // TRBL input order\n\t\tsides = [['left', left], ['right', right], ['top', top], ['bottom', bottom]]\n\t} else {\n\t\tsides = [['left', border], ['right', border], ['top', border], ['bottom', border], ['insideH', border], ['insideV', border]]\n\t}\n\n\tlet xml = '<a:tcBdr>'\n\tsides.forEach(([side, b]) => {\n\t\tif (!b) return\n\t\txml += `<a:${side}>`\n\t\tif (b.type === 'none') {\n\t\t\txml += '<a:ln><a:noFill/></a:ln>'\n\t\t} else {\n\t\t\txml += `<a:ln w=\"${lineWidthToEmu(b.pt ?? 1)}\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">`\n\t\t\txml += `<a:solidFill>${createColorElement(b.color ?? '666666')}</a:solidFill>`\n\t\t\txml += `<a:prstDash val=\"${b.type === 'dash' ? 'sysDash' : 'solid'}\"/>`\n\t\t\txml += '</a:ln>'\n\t\t}\n\t\txml += `</a:${side}>`\n\t})\n\txml += '</a:tcBdr>'\n\treturn xml\n}\n\n/**\n * Creates `ppt/viewProps.xml`\n * @return {string} XML\n */\nexport function makeXmlViewProps (): string {\n\treturn `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>${CRLF}<p:viewPr xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"><p:normalViewPr horzBarState=\"maximized\"><p:restoredLeft sz=\"15611\"/><p:restoredTop sz=\"94610\"/></p:normalViewPr><p:slideViewPr><p:cSldViewPr snapToGrid=\"0\" snapToObjects=\"1\"><p:cViewPr varScale=\"1\"><p:scale><a:sx n=\"136\" d=\"100\"/><a:sy n=\"136\" d=\"100\"/></p:scale><p:origin x=\"216\" y=\"312\"/></p:cViewPr><p:guideLst/></p:cSldViewPr></p:slideViewPr><p:notesTextViewPr><p:cViewPr><p:scale><a:sx n=\"1\" d=\"1\"/><a:sy n=\"1\" d=\"1\"/></p:scale><p:origin x=\"0\" y=\"0\"/></p:cViewPr></p:notesTextViewPr><p:gridSpacing cx=\"76200\" cy=\"76200\"/></p:viewPr>`\n}\n\n/**\n * Checks shadow options passed by user and performs corrections if needed.\n * @param {ShadowProps} shadowProps - shadow options\n */\nexport function correctShadowOptions (shadowProps: ShadowProps): void {\n\tif (!shadowProps || typeof shadowProps !== 'object') {\n\t\t// console.warn(\"`shadow` options must be an object. Ex: `{shadow: {type:'none'}}`\")\n\t\treturn\n\t}\n\n\t// OPT: `type`\n\tif (shadowProps.type !== 'outer' && shadowProps.type !== 'inner' && shadowProps.type !== 'none') {\n\t\tconsole.warn('Warning: shadow.type options are `outer`, `inner` or `none`.')\n\t\tshadowProps.type = 'outer'\n\t}\n\n\t// OPT: `angle`\n\tif (shadowProps.angle) {\n\t\t// A: REALITY-CHECK\n\t\tif (isNaN(Number(shadowProps.angle)) || shadowProps.angle < 0 || shadowProps.angle > 359) {\n\t\t\tconsole.warn('Warning: shadow.angle can only be 0-359')\n\t\t\tshadowProps.angle = 270\n\t\t}\n\n\t\t// B: ROBUST: Cast any type of valid arg to int: '12', 12.3, etc. -> 12\n\t\tshadowProps.angle = Math.round(Number(shadowProps.angle))\n\t}\n\n\t// OPT: `opacity`\n\tif (shadowProps.opacity) {\n\t\t// A: REALITY-CHECK\n\t\tif (isNaN(Number(shadowProps.opacity)) || shadowProps.opacity < 0 || shadowProps.opacity > 1) {\n\t\t\tconsole.warn('Warning: shadow.opacity can only be 0-1')\n\t\t\tshadowProps.opacity = 0.75\n\t\t}\n\n\t\t// B: ROBUST: Cast any type of valid arg to int: '12', 12.3, etc. -> 12\n\t\tshadowProps.opacity = Number(shadowProps.opacity)\n\t}\n}\n","/**\n * :: pptxgen.ts ::\n *\n * JavaScript framework that creates PowerPoint (pptx) presentations\n * https://github.com/gitbrent/PptxGenJS\n *\n * This framework is released under the MIT Public License (MIT)\n *\n * PptxGenJS (C) 2015-present Brent Ely -- https://github.com/gitbrent\n *\n * Some code derived from the OfficeGen project:\n * github.com/Ziv-Barber/officegen/ (Copyright 2013 Ziv Barber)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Units of Measure used in PowerPoint documents\n *\n * PowerPoint units are in `DXA` (except for font sizing)\n * - 1 inch is 1440 DXA\n * - 1 inch is 72 points\n * - 1 DXA is 1/20th's of a point\n * - 20 DXA is 1 point\n *\n * Another form of measurement using is an `EMU`\n * - 914400 EMUs is 1 inch\n * - 12700 EMUs is 1 point\n *\n * @see https://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/\n */\n\n/**\n * Object Layouts\n *\n * - 16x9 (10\" x 5.625\")\n * - 16x10 (10\" x 6.25\")\n * - 4x3 (10\" x 7.5\")\n * - Wide (13.33\" x 7.5\")\n * - [custom] (any size)\n *\n * @see https://docs.microsoft.com/en-us/office/open-xml/structure-of-a-presentationml-document\n * @see https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2010/hh273476(v=office.14)\n */\n\nimport JSZip from 'jszip'\nimport Slide from './slide.js'\nimport {\n\tAlignH,\n\tAlignV,\n\tCHART_TYPE,\n\tChartType,\n\tDEF_PRES_LAYOUT,\n\tDEF_PRES_LAYOUT_NAME,\n\tDEF_SLIDE_MARGIN_IN,\n\tOutputType,\n\tSCHEME_COLOR_NAMES,\n\tSHAPE_TYPE,\n\tSchemeColor,\n\tShapeType,\n\tWRITE_OUTPUT_TYPE,\n} from './core-enums.js'\nimport {\n\tAddSlideProps,\n\tCustomPropertyValue,\n\tIPresentationProps,\n\tPresLayout,\n\tPresSlide,\n\tPresSlideInternal,\n\tSectionProps,\n\tSectionInternalProps,\n\tSlideLayout,\n\tSlideLayoutInternal,\n\tSlideMasterProps,\n\tSlideNumberProps,\n\tTableStyleInternal,\n\tTableStyleProps,\n\tTableToSlidesProps,\n\tThemeProps,\n\tWriteBaseProps,\n\tWriteFileProps,\n\tWriteProps,\n} from './core-interfaces.js'\nimport * as genCharts from './gen-charts.js'\nimport * as genObj from './gen-objects.js'\nimport * as genMedia from './gen-media.js'\nimport * as genTable from './gen-tables.js'\nimport * as genXml from './gen-xml.js'\nimport type { RuntimeAdapter } from './runtime/types.js'\nimport { getUuid } from './gen-utils.js'\nimport { inchesToEmu, STANDARD_LAYOUTS, type StandardLayout } from './units.js'\n\nexport type { PresSlide as Slide } from './core-interfaces.js'\nexport type {\n\tAddSlideProps,\n\tCustomPropertyValue,\n\tBackgroundProps,\n\tBorderProps,\n\tColor,\n\tDataOrPathProps,\n\tDataOrPathRequiredProps,\n\tHAlign,\n\tHexColor,\n\tIChartAreaProps,\n\tIChartMulti,\n\tIChartOpts,\n\tIChartPropsAxisCat,\n\tIChartPropsAxisSer,\n\tIChartPropsAxisVal,\n\tIChartPropsBase,\n\tIChartPropsChartBar,\n\tIChartPropsChartDoughnut,\n\tIChartPropsChartLine,\n\tIChartPropsChartPie,\n\tIChartPropsChartRadar,\n\tIChartPropsDataLabel,\n\tIChartPropsDataTable,\n\tIChartPropsFillLine,\n\tIChartPropsLegend,\n\tIChartPropsTitle,\n\tImageProps,\n\tMargin,\n\tMediaProps,\n\tMediaType,\n\tObjectNameProps,\n\tObjectOptions,\n\tOptsChartData,\n\tOptsChartGridLine,\n\tPlaceholderProps,\n\tPositionProps,\n\tPresLayout,\n\tPresSlide,\n\tPresentationProps,\n\tSectionProps,\n\tShadowProps,\n\tShapeFillProps,\n\tShapeLineProps,\n\tShapeProps,\n\tSlideMasterChartProps,\n\tSlideMasterObject,\n\tSlideMasterProps,\n\tSlideNumberProps,\n\tTableCell,\n\tTableCellProps,\n\tTableProps,\n\tTableRow,\n\tTableRowSlide,\n\tTableToSlidesProps,\n\tTextBaseProps,\n\tTextGlowProps,\n\tTextProps,\n\tTextPropsOptions,\n\tThemeColor,\n\tThemeProps,\n\tVAlign,\n\tWriteBaseProps,\n\tWriteFileProps,\n\tWriteProps,\n} from './core-interfaces.js'\nexport type {\n\tCHART_NAME,\n\tCHART_TYPE,\n\tJSZIP_OUTPUT_TYPE,\n\tPLACEHOLDER_TYPE,\n\tPLACEHOLDER_TYPES,\n\tSCHEME_COLOR_NAMES,\n\tSCHEME_COLORS,\n\tSHAPE_NAME,\n\tSHAPE_TYPE,\n\tWRITE_OUTPUT_TYPE,\n} from './core-enums.js'\n\nconst VERSION = '5.4.0'\n\nfunction standardLayoutToPresLayout(layout: StandardLayout): PresLayout {\n\treturn {\n\t\tname: layout.name,\n\t\twidth: layout.widthEmu,\n\t\theight: layout.heightEmu,\n\t}\n}\n\nexport default class PptxGenJS {\n\t// Property getters/setters\n\n\t/**\n\t * Presentation layout name\n\t * Standard layouts:\n\t * - 'LAYOUT_4x3' (10\" x 7.5\")\n\t * - 'LAYOUT_16x9' (10\" x 5.625\")\n\t * - 'LAYOUT_16x10' (10\" x 6.25\")\n\t * - 'LAYOUT_WIDE' (13.333\" x 7.5\")\n\t * Custom layouts:\n\t * Use `pptx.defineLayout()` to create custom layouts (e.g.: 'A4')\n\t * @type {string}\n\t * @see https://support.office.com/en-us/article/Change-the-size-of-your-slides-040a811c-be43-40b9-8d04-0de5ed79987e\n\t */\n\tprivate _layout: string\n\tpublic set layout(value: string | StandardLayout) {\n\t\t// Accept either a layout key string or a STANDARD_LAYOUTS preset object directly.\n\t\tconst layoutKey = typeof value === 'string' ? value : value?.layout\n\t\tconst newLayout: PresLayout | undefined = layoutKey ? this.LAYOUTS[layoutKey] : undefined\n\n\t\tif (newLayout) {\n\t\t\tthis._layout = layoutKey\n\t\t\tthis._presLayout = newLayout\n\t\t} else {\n\t\t\tthrow new Error('UNKNOWN-LAYOUT')\n\t\t}\n\t}\n\n\tpublic get layout(): string {\n\t\treturn this._layout\n\t}\n\n\t/**\n\t * PptxGenJS Library Version\n\t */\n\tprivate readonly _version: string = VERSION\n\tpublic get version(): string {\n\t\treturn this._version\n\t}\n\n\t/**\n\t * @type {string}\n\t */\n\tprivate _author: string\n\tpublic set author(value: string) {\n\t\tthis._author = value\n\t}\n\n\tpublic get author(): string {\n\t\treturn this._author\n\t}\n\n\t/**\n\t * @type {string}\n\t */\n\tprivate _company: string\n\tpublic set company(value: string) {\n\t\tthis._company = value\n\t}\n\n\tpublic get company(): string {\n\t\treturn this._company\n\t}\n\n\t/**\n\t * @type {string}\n\t * @note the `revision` value must be a whole number only (without \".\" or \",\" - otherwise, PPT will throw errors upon opening!)\n\t */\n\tprivate _revision: string\n\tpublic set revision(value: string) {\n\t\tthis._revision = value\n\t}\n\n\tpublic get revision(): string {\n\t\treturn this._revision\n\t}\n\n\t/**\n\t * @type {string}\n\t */\n\tprivate _subject: string\n\tpublic set subject(value: string) {\n\t\tthis._subject = value\n\t}\n\n\tpublic get subject(): string {\n\t\treturn this._subject\n\t}\n\n\t/**\n\t * @type {ThemeProps}\n\t */\n\tprivate _theme: ThemeProps\n\tpublic set theme(value: ThemeProps) {\n\t\tthis._theme = value\n\t}\n\n\tpublic get theme(): ThemeProps {\n\t\treturn this._theme\n\t}\n\n\t/**\n\t * @type {string}\n\t */\n\tprivate _title: string\n\tpublic set title(value: string) {\n\t\tthis._title = value\n\t}\n\n\tpublic get title(): string {\n\t\treturn this._title\n\t}\n\n\t/** Slide number shown on the first slide (maps to firstSlideNum in presentation.xml) */\n\tprivate _firstSlideNum: number\n\tpublic set firstSlideNum(value: number) {\n\t\tthis._firstSlideNum = value\n\t}\n\n\tpublic get firstSlideNum(): number {\n\t\treturn this._firstSlideNum\n\t}\n\n\t/**\n\t * Whether Right-to-Left (RTL) mode is enabled\n\t * @type {boolean}\n\t */\n\tprivate _rtlMode: boolean\n\tpublic set rtlMode(value: boolean) {\n\t\tthis._rtlMode = value\n\t}\n\n\tpublic get rtlMode(): boolean {\n\t\treturn this._rtlMode\n\t}\n\n\t/** master slide layout object */\n\tprivate readonly _masterSlide: PresSlideInternal\n\tpublic get masterSlide(): PresSlide {\n\t\treturn this._masterSlide\n\t}\n\n\t/** this Presentation's Slide objects */\n\tprivate readonly _slides: PresSlideInternal[]\n\tpublic get slides(): PresSlide[] {\n\t\treturn this._slides\n\t}\n\n\t/** this Presentation's sections */\n\tprivate readonly _sections: SectionInternalProps[]\n\tpublic get sections(): SectionProps[] {\n\t\treturn this._sections\n\t}\n\n\t/** custom document properties stored in docProps/custom.xml */\n\tprivate _customProperties: Array<{ name: string; value: CustomPropertyValue }>\n\tprivate readonly _tableStyles: TableStyleInternal[]\n\n\t/** slide layout definition objects, used for generating slide layout files */\n\tprivate readonly _slideLayouts: SlideLayoutInternal[]\n\tpublic get slideLayouts(): SlideLayout[] {\n\t\treturn this._slideLayouts\n\t}\n\n\tprivate get internalPresentation(): IPresentationProps {\n\t\treturn {\n\t\t\tauthor: this.author,\n\t\t\tcompany: this.company,\n\t\t\tfirstSlideNum: this.firstSlideNum,\n\t\t\tlayout: this.layout,\n\t\t\tmasterSlide: this._masterSlide,\n\t\t\tpresLayout: this.presLayout,\n\t\t\trevision: this.revision,\n\t\t\trtlMode: this.rtlMode,\n\t\t\tsections: this._sections,\n\t\t\tslideLayouts: this._slideLayouts,\n\t\t\tslides: this._slides,\n\t\t\tsubject: this.subject,\n\t\t\ttheme: this.theme,\n\t\t\ttitle: this.title,\n\t\t}\n\t}\n\n\tprivate LAYOUTS: { [key: string]: PresLayout }\n\n\t// Exposed class props\n\tprivate readonly _alignH = AlignH\n\tpublic get AlignH(): typeof AlignH {\n\t\treturn this._alignH\n\t}\n\n\tprivate readonly _alignV = AlignV\n\tpublic get AlignV(): typeof AlignV {\n\t\treturn this._alignV\n\t}\n\n\tprivate readonly _chartType = ChartType\n\tpublic get ChartType(): typeof ChartType {\n\t\treturn this._chartType\n\t}\n\n\tprivate readonly _outputType = OutputType\n\tpublic get OutputType(): typeof OutputType {\n\t\treturn this._outputType\n\t}\n\n\tprivate _presLayout: PresLayout\n\tpublic get presLayout(): PresLayout {\n\t\treturn this._presLayout\n\t}\n\n\tprivate readonly _schemeColor = SchemeColor\n\tpublic get SchemeColor(): typeof SchemeColor {\n\t\treturn this._schemeColor\n\t}\n\n\tprivate readonly _shapeType = ShapeType\n\tpublic get ShapeType(): typeof ShapeType {\n\t\treturn this._shapeType\n\t}\n\n\t/**\n\t * @depricated use `ChartType`\n\t */\n\tprivate readonly _charts = CHART_TYPE\n\tpublic get charts(): typeof CHART_TYPE {\n\t\treturn this._charts\n\t}\n\n\t/**\n\t * @depricated use `SchemeColor`\n\t */\n\tprivate readonly _colors = SCHEME_COLOR_NAMES\n\tpublic get colors(): typeof SCHEME_COLOR_NAMES {\n\t\treturn this._colors\n\t}\n\n\t/**\n\t * @depricated use `ShapeType`\n\t */\n\tprivate readonly _shapes = SHAPE_TYPE\n\tpublic get shapes(): typeof SHAPE_TYPE {\n\t\treturn this._shapes\n\t}\n\n\tprivate readonly _runtime: RuntimeAdapter\n\n\tconstructor(runtime: RuntimeAdapter) {\n\t\tthis._runtime = runtime\n\t\t// Set available layouts\n\t\tthis.LAYOUTS = {\n\t\t\tLAYOUT_4x3: standardLayoutToPresLayout(STANDARD_LAYOUTS.LAYOUT_4x3),\n\t\t\tLAYOUT_16x9: standardLayoutToPresLayout(STANDARD_LAYOUTS.LAYOUT_16x9),\n\t\t\tLAYOUT_16x10: standardLayoutToPresLayout(STANDARD_LAYOUTS.LAYOUT_16x10),\n\t\t\tLAYOUT_WIDE: standardLayoutToPresLayout(STANDARD_LAYOUTS.LAYOUT_WIDE),\n\t\t}\n\n\t\t// Core\n\t\tthis._author = 'PptxGenJS'\n\t\tthis._company = 'PptxGenJS'\n\t\tthis._revision = '1' // Note: Must be a whole number\n\t\tthis._subject = 'PptxGenJS Presentation'\n\t\tthis._title = 'PptxGenJS Presentation'\n\t\t// PptxGenJS props\n\t\tthis._presLayout = {\n\t\t\tname: this.LAYOUTS[DEF_PRES_LAYOUT].name,\n\t\t\t_sizeW: this.LAYOUTS[DEF_PRES_LAYOUT].width,\n\t\t\t_sizeH: this.LAYOUTS[DEF_PRES_LAYOUT].height,\n\t\t\twidth: this.LAYOUTS[DEF_PRES_LAYOUT].width,\n\t\t\theight: this.LAYOUTS[DEF_PRES_LAYOUT].height,\n\t\t}\n\t\tthis._firstSlideNum = 1\n\t\tthis._rtlMode = false\n\t\t//\n\t\tthis._slideLayouts = [\n\t\t\t{\n\t\t\t\t_margin: DEF_SLIDE_MARGIN_IN,\n\t\t\t\t_name: DEF_PRES_LAYOUT_NAME,\n\t\t\t\t_presLayout: this._presLayout,\n\t\t\t\t_rels: [],\n\t\t\t\t_relsChart: [],\n\t\t\t\t_relsMedia: [],\n\t\t\t\t_slide: null,\n\t\t\t\t_slideNum: 1000,\n\t\t\t\t_slideNumberProps: null,\n\t\t\t\t_slideObjects: [],\n\t\t\t},\n\t\t]\n\t\tthis._slides = []\n\t\tthis._sections = []\n\t\tthis._customProperties = []\n\t\tthis._tableStyles = []\n\t\tthis._masterSlide = {\n\t\t\taddChart: null,\n\t\t\taddConnector: null,\n\t\t\taddImage: null,\n\t\t\taddMedia: null,\n\t\t\taddNotes: null,\n\t\t\taddShape: null,\n\t\t\taddTable: null,\n\t\t\taddText: null,\n\t\t\t//\n\t\t\t_name: null,\n\t\t\t_presLayout: this._presLayout,\n\t\t\t_rId: null,\n\t\t\t_rels: [],\n\t\t\t_relsChart: [],\n\t\t\t_relsMedia: [],\n\t\t\t_slideId: null,\n\t\t\t_slideLayout: null,\n\t\t\t_slideNum: null,\n\t\t\t_slideNumberProps: null,\n\t\t\t_slideObjects: [],\n\t\t}\n\t}\n\n\t/**\n\t * Provides an API for `addTableDefinition` to create slides as needed for auto-paging\n\t * @param {AddSlideProps} options - slide masterName and/or sectionTitle\n\t * @return {PresSlide} new Slide\n\t */\n\tprivate readonly addNewSlide = (options?: AddSlideProps): PresSlideInternal => {\n\t\tconst nextOptions = options || {}\n\t\t// Preserve the originating slide's section for all auto-paged continuation slides.\n\t\t// Search for the section that owns the current last slide rather than assuming it is\n\t\t// the last section — the originating slide may not be at the tail of the deck.\n\t\tconst lastSlide = this._slides[this._slides.length - 1]\n\t\tconst sourceSection = this._sections.find(sect => sect._slides.some(s => s._slideNum === lastSlide._slideNum))\n\t\tnextOptions.sectionTitle = sourceSection?.title ?? null\n\n\t\treturn this.addSlide(nextOptions) as PresSlideInternal\n\t}\n\n\t/**\n\t * Provides an API for `addTableDefinition` to get slide reference by number\n\t * @param {number} slideNum - slide number\n\t * @return {PresSlide} Slide\n\t * @since 3.0.0\n\t */\n\tprivate readonly getSlide = (slideNum: number): PresSlideInternal => this._slides.find(slide => slide._slideNum === slideNum)\n\n\t/**\n\t * Enables the `Slide` class to set PptxGenJS [Presentation] master/layout slidenumbers\n\t * @param {SlideNumberProps} slideNum - slide number config\n\t */\n\tprivate readonly setSlideNumber = (slideNum: SlideNumberProps): void => {\n\t\t// 1: Add slideNumber to slideMaster1.xml\n\t\tthis._masterSlide._slideNumberProps = slideNum\n\n\t\t// 2: Add slideNumber to DEF_PRES_LAYOUT_NAME layout\n\t\tthis._slideLayouts.find(layout => layout._name === DEF_PRES_LAYOUT_NAME)._slideNumberProps = slideNum\n\t}\n\n\t/**\n\t * Create all chart and media rels for this Presentation\n\t * @param {PresSlideInternal | SlideLayoutInternal} slide - slide with rels\n\t * @param {JSZip} zip - JSZip instance\n\t * @param {Promise<string>[]} chartPromises - promise array\n\t */\n\tprivate readonly createChartMediaRels = (slide: PresSlideInternal | SlideLayoutInternal, zip: JSZip, chartPromises: Promise<string>[]): void => {\n\t\tslide._relsChart.forEach(rel => chartPromises.push(genCharts.createExcelWorksheet(rel, zip)))\n\t\tslide._relsMedia.forEach(rel => {\n\t\t\tif (rel.type !== 'online' && rel.type !== 'hyperlink') {\n\t\t\t\t// A: Loop vars\n\t\t\t\tlet data: string = rel.data && typeof rel.data === 'string' ? rel.data : ''\n\n\t\t\t\t// B: Users will undoubtedly pass various string formats, so correct prefixes as needed\n\t\t\t\tif (!data.includes(',') && !data.includes(';')) data = 'image/png;base64,' + data\n\t\t\t\telse if (!data.includes(',')) data = 'image/png;base64,' + data\n\t\t\t\telse if (!data.includes(';')) data = 'image/png;' + data\n\n\t\t\t\t// C: Add media\n\t\t\t\tzip.file(rel.Target.replace('..', 'ppt'), data.split(',').pop(), { base64: true })\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Create and export the .pptx file\n\t * @param {WRITE_OUTPUT_TYPE} outputType - output file type\n\t * @return {Promise<string | ArrayBuffer | Blob | Uint8Array>} Promise with data or stream (node) or filename (browser)\n\t */\n\tprivate readonly exportPresentation = async (props: WriteProps): Promise<string | ArrayBuffer | Blob | Uint8Array> => {\n\t\tconst arrChartPromises: Promise<string>[] = []\n\t\tlet arrMediaPromises: Promise<string>[] = []\n\t\tconst zip = new JSZip()\n\n\t\t// STEP 1: Read/Encode all Media before zip as base64 content, etc. is required\n\t\tconst onMediaError = props.onMediaError ?? 'throw'\n\t\tthis._slides.forEach(slide => {\n\t\t\tarrMediaPromises = arrMediaPromises.concat(genMedia.encodeSlideMediaRels(slide, this._runtime, onMediaError))\n\t\t})\n\t\tthis._slideLayouts.forEach(layout => {\n\t\t\tarrMediaPromises = arrMediaPromises.concat(genMedia.encodeSlideMediaRels(layout, this._runtime, onMediaError))\n\t\t})\n\t\tarrMediaPromises = arrMediaPromises.concat(genMedia.encodeSlideMediaRels(this._masterSlide, this._runtime, onMediaError))\n\n\t\t// STEP 2: Wait for Promises (if any) then generate the PPTX file\n\t\treturn await Promise.all(arrMediaPromises).then(async () => {\n\t\t\t// PERF: Collapse identical media to a single package part across the entire deck.\n\t\t\t// Each target (slide/layout/master) namespaces its media `Target` by slide, so the\n\t\t\t// same image used on multiple slides — or loaded from the same path — otherwise\n\t\t\t// embeds one copy per use. By now `encodeSlideMediaRels` has populated every\n\t\t\t// `rel.data`, so we can point later duplicates at the first occurrence's `Target`\n\t\t\t// (slide `.rels` reference media by rId, and sharing a part across slides is valid\n\t\t\t// OOXML). This subsumes the per-slide path/data de-dup for cross-slide reuse and\n\t\t\t// also covers background images (issue #1339).\n\t\t\tconst canonicalMediaTargets = new Map<string, string>()\n\t\t\tfor (const target of [...this._slides, ...this._slideLayouts, this._masterSlide]) {\n\t\t\t\tfor (const rel of target._relsMedia || []) {\n\t\t\t\t\tif (rel.type === 'online' || rel.type === 'hyperlink' || typeof rel.data !== 'string' || !rel.data) continue\n\t\t\t\t\t// Key on extension + bytes so identical content with differing part\n\t\t\t\t\t// extensions is never merged into one mistyped file.\n\t\t\t\t\tconst key = (rel.extn || '') + '\\0' + rel.data\n\t\t\t\t\tconst canonical = canonicalMediaTargets.get(key)\n\t\t\t\t\tif (canonical) rel.Target = canonical\n\t\t\t\t\telse canonicalMediaTargets.set(key, rel.Target)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// A: Add empty placeholder objects to slides that don't already have them\n\t\t\tthis._slides.forEach(slide => {\n\t\t\t\tif (slide._slideLayout) genObj.addPlaceholdersToSlideLayouts(slide)\n\t\t\t})\n\n\t\t\t// B: Add all required folders and files\n\t\t\tzip.folder('_rels')\n\t\t\tzip.folder('docProps')\n\t\t\tzip.folder('ppt').folder('_rels')\n\t\t\t// only scaffold ppt/charts and ppt/embeddings when at least one\n\t\t\t// target actually has a chart. Otherwise JSZip emits stray empty\n\t\t\t// directory entries into the archive on every minimal deck.\n\t\t\tconst hasCharts =\n\t\t\t\tthis._slides.some(s => (s._relsChart || []).length > 0) ||\n\t\t\t\tthis._slideLayouts.some(l => (l._relsChart || []).length > 0) ||\n\t\t\t\t((this._masterSlide && this._masterSlide._relsChart) || []).length > 0\n\t\t\tif (hasCharts) {\n\t\t\t\tzip.folder('ppt/charts').folder('_rels')\n\t\t\t\tzip.folder('ppt/embeddings')\n\t\t\t}\n\t\t\tzip.folder('ppt/media')\n\t\t\tzip.folder('ppt/slideLayouts').folder('_rels')\n\t\t\tzip.folder('ppt/slideMasters').folder('_rels')\n\t\t\tzip.folder('ppt/slides').folder('_rels')\n\t\t\tzip.folder('ppt/theme')\n\t\t\tzip.folder('ppt/notesMasters').folder('_rels')\n\t\t\tzip.folder('ppt/notesSlides').folder('_rels')\n\t\t\tconst hasCustomProps = this._customProperties.length > 0\n\t\t\tzip.file('[Content_Types].xml', genXml.makeXmlContTypes(this._slides, this._slideLayouts, this._masterSlide, hasCustomProps)) // TODO: pass only `this` like below! 20200206\n\t\t\tzip.file('_rels/.rels', genXml.makeXmlRootRels(hasCustomProps))\n\t\t\tzip.file('docProps/app.xml', genXml.makeXmlApp(this._slides, this.company)) // TODO: pass only `this` like below! 20200206\n\t\t\tzip.file('docProps/core.xml', genXml.makeXmlCore(this.title, this.subject, this.author, this.revision)) // TODO: pass only `this` like below! 20200206\n\t\t\tif (hasCustomProps) {\n\t\t\t\tzip.file('docProps/custom.xml', genXml.makeXmlCustomProperties(this._customProperties))\n\t\t\t}\n\t\t\tzip.file('ppt/_rels/presentation.xml.rels', genXml.makeXmlPresentationRels(this._slides))\n\t\t\tzip.file('ppt/theme/theme1.xml', genXml.makeXmlTheme(this.internalPresentation))\n\t\t\t// emit a separate theme2.xml part so notesMaster1.xml.rels resolves\n\t\t\tzip.file('ppt/theme/theme2.xml', genXml.makeXmlTheme(this.internalPresentation))\n\t\t\tzip.file('ppt/presentation.xml', genXml.makeXmlPresentation(this.internalPresentation))\n\t\t\tzip.file('ppt/presProps.xml', genXml.makeXmlPresProps())\n\t\t\tzip.file('ppt/tableStyles.xml', genXml.makeXmlTableStyles(this._tableStyles))\n\t\t\tzip.file('ppt/viewProps.xml', genXml.makeXmlViewProps())\n\n\t\t\t// C: Create a Layout/Master/Rel/Slide file for each SlideLayout and Slide\n\t\t\tthis._slideLayouts.forEach((layout, idx) => {\n\t\t\t\tzip.file(`ppt/slideLayouts/slideLayout${idx + 1}.xml`, genXml.makeXmlLayout(layout))\n\t\t\t\tzip.file(`ppt/slideLayouts/_rels/slideLayout${idx + 1}.xml.rels`, genXml.makeXmlSlideLayoutRel(idx + 1, this._slideLayouts))\n\t\t\t})\n\t\t\tthis._slides.forEach((slide, idx) => {\n\t\t\t\tzip.file(`ppt/slides/slide${idx + 1}.xml`, genXml.makeXmlSlide(slide))\n\t\t\t\tzip.file(`ppt/slides/_rels/slide${idx + 1}.xml.rels`, genXml.makeXmlSlideRel(this._slides, this._slideLayouts, idx + 1))\n\t\t\t\t// Create all slide notes related items. Notes of empty strings are created for slides which do not have notes specified, to keep track of _rels.\n\t\t\t\tzip.file(`ppt/notesSlides/notesSlide${idx + 1}.xml`, genXml.makeXmlNotesSlide(slide))\n\t\t\t\tzip.file(`ppt/notesSlides/_rels/notesSlide${idx + 1}.xml.rels`, genXml.makeXmlNotesSlideRel(idx + 1))\n\t\t\t})\n\t\t\tzip.file('ppt/slideMasters/slideMaster1.xml', genXml.makeXmlMaster(this._masterSlide, this._slideLayouts))\n\t\t\tzip.file('ppt/slideMasters/_rels/slideMaster1.xml.rels', genXml.makeXmlMasterRel(this._masterSlide, this._slideLayouts))\n\t\t\tzip.file('ppt/notesMasters/notesMaster1.xml', genXml.makeXmlNotesMaster())\n\t\t\tzip.file('ppt/notesMasters/_rels/notesMaster1.xml.rels', genXml.makeXmlNotesMasterRel())\n\n\t\t\t// D: Create all Rels (images, media, chart data)\n\t\t\tthis._slideLayouts.forEach(layout => {\n\t\t\t\tthis.createChartMediaRels(layout, zip, arrChartPromises)\n\t\t\t})\n\t\t\tthis._slides.forEach(slide => {\n\t\t\t\tthis.createChartMediaRels(slide, zip, arrChartPromises)\n\t\t\t})\n\t\t\tthis.createChartMediaRels(this._masterSlide, zip, arrChartPromises)\n\n\t\t\t// E: Wait for Promises (if any) then generate the PPTX file\n\t\t\treturn await Promise.all(arrChartPromises).then(async () => {\n\t\t\t\tconst compression = props.compression === false ? 'STORE' : 'DEFLATE'\n\t\t\t\tif (props.outputType === 'STREAM') {\n\t\t\t\t\t// A: stream file\n\t\t\t\t\treturn await zip.generateAsync({ type: 'nodebuffer', compression })\n\t\t\t\t} else if (props.outputType) {\n\t\t\t\t\t// B: Node [fs]: Output type user option or default\n\t\t\t\t\treturn await zip.generateAsync({ type: props.outputType, compression })\n\t\t\t\t} else {\n\t\t\t\t\t// C: Browser: Output blob as app/ms-pptx\n\t\t\t\t\treturn await zip.generateAsync({ type: 'blob', compression })\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t}\n\n\t// EXPORT METHODS\n\n\t/**\n\t * Export the current Presentation to stream\n\t * @param {WriteBaseProps} props - output properties\n\t * @returns {Promise<string | ArrayBuffer | Blob | Uint8Array>} file stream\n\t */\n\tasync stream(props?: WriteBaseProps): Promise<string | ArrayBuffer | Blob | Uint8Array> {\n\t\treturn await this.exportPresentation({\n\t\t\tcompression: props?.compression,\n\t\t\toutputType: 'STREAM',\n\t\t})\n\t}\n\n\t/**\n\t * Export the current Presentation as JSZip content with the selected type\n\t * @param {WriteProps} props output properties\n\t * @returns {Promise<string | ArrayBuffer | Blob | Uint8Array>} file content in selected type\n\t */\n\tasync write(props?: WriteProps | WRITE_OUTPUT_TYPE): Promise<string | ArrayBuffer | Blob | Uint8Array> {\n\t\t// DEPRECATED: @deprecated v3.5.0 - outputType - [[remove in v4.0.0]]\n\t\tconst propsOutpType = typeof props === 'object' && props?.outputType ? props.outputType : props ? (props as WRITE_OUTPUT_TYPE) : null\n\t\tconst propsCompress = typeof props === 'object' ? props?.compression : undefined\n\t\tconst propsMediaError = typeof props === 'object' ? props?.onMediaError : undefined\n\n\t\treturn await this.exportPresentation({\n\t\t\tcompression: propsCompress,\n\t\t\toutputType: propsOutpType,\n\t\t\tonMediaError: propsMediaError,\n\t\t})\n\t}\n\n\t/**\n\t * Export the current Presentation.\n\t * Write the generated presentation to disk (Node) or trigger a download (browser).\n\t * @param {WriteFileProps} props - output file properties\n\t * @returns {Promise<string>} the presentation name\n\t */\n\tasync writeFile(props?: WriteFileProps | string): Promise<string> {\n\t\tif (typeof props === 'string') {\n\t\t\t// DEPRECATED: @deprecated v3.5.0 - fileName - [[remove in v4.0.0]]\n\t\t\tconsole.warn('[WARNING] writeFile(string) is deprecated - pass { fileName } instead.')\n\t\t\tprops = { fileName: props }\n\t\t}\n\t\tconst { fileName: rawName = 'Presentation.pptx', compression, onMediaError } = props as WriteFileProps\n\t\tconst fileName = rawName.toLowerCase().endsWith('.pptx') ? rawName : `${rawName}.pptx`\n\n\t\tconst data = await this.exportPresentation({ compression, outputType: this._runtime.writeFileOutputType, onMediaError })\n\t\treturn await this._runtime.writeFile(fileName, data)\n\t}\n\n\t// PRESENTATION METHODS\n\n\t/**\n\t * Set a custom document property stored in `docProps/custom.xml`.\n\t * Calling with the same name replaces the existing value.\n\t * @param name - property name\n\t * @param value - string, integer/float number, boolean, or Date\n\t */\n\tsetCustomProperty(name: string, value: CustomPropertyValue): void {\n\t\tthis._customProperties = this._customProperties.filter(p => p.name !== name)\n\t\tthis._customProperties.push({ name, value })\n\t}\n\n\t/**\n\t * Add a new Section to Presentation\n\t * @param {ISectionProps} section - section properties\n\t * @example pptx.addSection({ title:'Charts' });\n\t */\n\taddSection(section: SectionProps): void {\n\t\tif (!section) console.warn('addSection requires an argument')\n\t\telse if (!section.title) console.warn('addSection requires a title')\n\n\t\tconst newSection: SectionInternalProps = {\n\t\t\t_type: 'user',\n\t\t\t_slides: [],\n\t\t\ttitle: section.title,\n\t\t}\n\n\t\tif (section.order) this._sections.splice(section.order, 0, newSection)\n\t\telse this._sections.push(newSection)\n\t}\n\n\t/**\n\t * Add a new Slide to Presentation\n\t * @param {AddSlideProps} options - slide options\n\t * @returns {PresSlide} the new Slide\n\t */\n\taddSlide(options?: AddSlideProps): PresSlide {\n\t\t// TODO: DEPRECATED: arg0 string \"masterSlideName\" dep as of 3.2.0\n\t\tconst masterSlideName = typeof options === 'string' ? options : options?.masterName ? options.masterName : ''\n\t\tlet slideLayout: SlideLayoutInternal = {\n\t\t\t_name: this.LAYOUTS[DEF_PRES_LAYOUT].name,\n\t\t\t_presLayout: this.presLayout,\n\t\t\t_rels: [],\n\t\t\t_relsChart: [],\n\t\t\t_relsMedia: [],\n\t\t\t_slideNum: this._slides.length + 1,\n\t\t\t_slideObjects: [],\n\t\t}\n\n\t\tif (masterSlideName) {\n\t\t\tconst tmpLayout = this._slideLayouts.find(layout => layout._name === masterSlideName)\n\t\t\tif (tmpLayout) slideLayout = tmpLayout\n\t\t}\n\n\t\tconst newSlide: PresSlideInternal = new Slide({\n\t\t\taddSlide: this.addNewSlide,\n\t\t\tgetSlide: this.getSlide,\n\t\t\tpresLayout: this.presLayout,\n\t\t\tsetSlideNum: this.setSlideNumber,\n\t\t\tslideId: this._slides.length + 256,\n\t\t\tslideRId: this._slides.length + 2,\n\t\t\tslideNumber: this._slides.length + 1,\n\t\t\tslideLayout,\n\t\t})\n\n\t\t// A: Add slide to pres\n\t\tthis._slides.push(newSlide)\n\n\t\t// B: Sections\n\t\t// B-1: Add slide to section (if any provided)\n\t\t// B-2: Handle slides without a section when sections are already is use (\"loose\" slides arent allowed, they all need a section)\n\t\tif (options?.sectionTitle) {\n\t\t\tconst sect = this._sections.find(section => section.title === options.sectionTitle)\n\t\t\tif (!sect) console.warn(`addSlide: unable to find section with title: \"${options.sectionTitle}\"`)\n\t\t\telse sect._slides.push(newSlide)\n\t\t} else if (this._sections && this._sections.length > 0 && (!options?.sectionTitle)) {\n\t\t\tconst lastSect = this._sections[this._sections.length - 1]\n\n\t\t\t// CASE 1: The latest section is a default type - just add this one\n\t\t\tif (lastSect._type === 'default') lastSect._slides.push(newSlide)\n\t\t\t// CASE 2: There latest section is NOT a default type - create the defualt, add this slide\n\t\t\telse {\n\t\t\t\tthis._sections.push({\n\t\t\t\t\ttitle: `Default-${this._sections.filter(sect => sect._type === 'default').length + 1}`,\n\t\t\t\t\t_type: 'default',\n\t\t\t\t\t_slides: [newSlide],\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\treturn newSlide\n\t}\n\n\t/**\n\t * Create a custom Slide Layout in any size\n\t * @param {PresLayout} layout - layout properties\n\t * @example pptx.defineLayout({ name:'A3', width:16.5, height:11.7 });\n\t */\n\tdefineLayout(layout: PresLayout): void {\n\t\t// @see https://support.office.com/en-us/article/Change-the-size-of-your-slides-040a811c-be43-40b9-8d04-0de5ed79987e\n\t\tif (!layout) console.warn('defineLayout requires `{name, width, height}`')\n\t\telse if (!layout.name) console.warn('defineLayout requires `name`')\n\t\telse if (!layout.width) console.warn('defineLayout requires `width`')\n\t\telse if (!layout.height) console.warn('defineLayout requires `height`')\n\t\telse if (typeof layout.height !== 'number') console.warn('defineLayout `height` should be a number (inches)')\n\t\telse if (typeof layout.width !== 'number') console.warn('defineLayout `width` should be a number (inches)')\n\n\t\tthis.LAYOUTS[layout.name] = {\n\t\t\tname: layout.name,\n\t\t\t_sizeW: inchesToEmu(Number(layout.width)),\n\t\t\t_sizeH: inchesToEmu(Number(layout.height)),\n\t\t\twidth: inchesToEmu(Number(layout.width)),\n\t\t\theight: inchesToEmu(Number(layout.height)),\n\t\t}\n\t}\n\n\t/**\n\t * Create a new slide master [layout] for the Presentation\n\t * @param {SlideMasterProps} props - layout properties\n\t */\n\tdefineSlideMaster(props: SlideMasterProps): void {\n\t\t// (ISSUE#406;PULL#1176) deep clone the props object to avoid mutating the original object\n\t\tconst propsClone = JSON.parse(JSON.stringify(props))\n\t\tif (!propsClone.title) throw new Error('defineSlideMaster() object argument requires a `title` value. (https://gitbrent.github.io/PptxGenJS/docs/masters.html)')\n\n\t\tconst newLayout: SlideLayoutInternal = {\n\t\t\t_margin: propsClone.margin || DEF_SLIDE_MARGIN_IN,\n\t\t\t_name: propsClone.title,\n\t\t\t_presLayout: this.presLayout,\n\t\t\t_rels: [],\n\t\t\t_relsChart: [],\n\t\t\t_relsMedia: [],\n\t\t\t_slide: null,\n\t\t\t_slideNum: 1000 + this._slideLayouts.length + 1,\n\t\t\t_slideNumberProps: propsClone.slideNumber || null,\n\t\t\t_slideObjects: [],\n\t\t\tbackground: propsClone.background || null,\n\t\t\tbkgd: propsClone.bkgd || null,\n\t\t}\n\n\t\t// STEP 1: Create the Slide Master/Layout\n\t\tgenObj.createSlideMaster(propsClone, newLayout)\n\n\t\t// STEP 2: Add it to layout defs\n\t\tthis._slideLayouts.push(newLayout)\n\n\t\t// STEP 3: Add background (image data/path must be captured before `exportPresentation()` is called)\n\t\tif (propsClone.background || propsClone.bkgd) genObj.addBackgroundDefinition(propsClone.background, newLayout)\n\n\t\t// STEP 4: Add slideNumber to master slide (if any)\n\t\tif (newLayout._slideNumberProps && !this._masterSlide._slideNumberProps) this._masterSlide._slideNumberProps = newLayout._slideNumberProps\n\t}\n\n\t/**\n\t * Register a reusable custom table style and return its GUID.\n\t * The style is written to `ppt/tableStyles.xml` and is editable in PowerPoint's\n\t * Table Styles gallery. Pass the returned GUID as `TableProps.tableStyle`, and use\n\t * the `has*` flags (`hasHeader`, `hasBandedRows`, …) to activate the matching regions.\n\t * @param {TableStyleProps} props - custom table style definition (requires `name`)\n\t * @returns {string} braced GUID to use as `tableStyle`\n\t * @example\n\t * const brand = pptx.defineTableStyle({\n\t * name: 'Brand Banded',\n\t * firstRow: { fill:'1A2B3C', color:'FFFFFF', bold:true },\n\t * band1H: { fill:'EAF1F8' },\n\t * })\n\t * slide.addTable(rows, { tableStyle: brand, hasHeader:true, hasBandedRows:true })\n\t */\n\tdefineTableStyle(props: TableStyleProps): string {\n\t\tif (!props || typeof props !== 'object') throw new Error('defineTableStyle() requires a `{ name, ... }` object argument')\n\t\tif (!props.name || typeof props.name !== 'string') throw new Error('defineTableStyle() requires a non-empty `name`')\n\n\t\tconst guid = `{${getUuid('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx').toUpperCase()}}`\n\t\tthis._tableStyles.push({ guid, def: props })\n\t\treturn guid\n\t}\n\n\t// HTML-TO-SLIDES METHODS\n\n\t/**\n\t * Reproduces an HTML table as a PowerPoint table - including column widths, style, etc. - creates 1 or more slides as needed\n\t * @param {string} eleId - table HTML element ID\n\t * @param {TableToSlidesProps} options - generation options\n\t */\n\ttableToSlides(eleId: string, options: TableToSlidesProps = {}): void {\n\t\t// @note `verbose` option is undocumented; used for verbose output of layout process\n\t\tgenTable.genTableToSlides(\n\t\t\tthis,\n\t\t\teleId,\n\t\t\toptions,\n\t\t\toptions?.masterSlideName ? this._slideLayouts.find(layout => layout._name === options.masterSlideName) : null\n\t\t)\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,SAAgB,oBAAqB,MAAgC,OAAkB,QAAyB;CAC/G,IAAI,SAAS,QAAQ,SAAS,KAAA,GAAW,OAAO;CAKhD,IAAI,OAAO,SAAS,YAAY,CAAC,SAAS,IAAI,GAC7C,MAAM,IAAI,MACT,WAAW,SAAS,aAAa,gDAAgD,OAAO,IAAI,EAAE,0NAG/F;CAGD,OAAO,WAAW,MAAM,UAAU,MAAM,OAAO,SAAS,OAAO,KAAK;AACrE;;;;;;;AAQA,SAAgB,QAAS,YAA4B;CACpD,OAAO,WAAW,QAAQ,SAAS,SAAU,GAAG;EAC/C,MAAM,IAAK,KAAK,OAAO,IAAI,KAAM;EAEjC,QADU,MAAM,MAAM,I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