pptx-ts 0.0.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +116 -269
- package/dist/autopage-odPz7zZO.js +536 -0
- package/dist/autopage-odPz7zZO.js.map +1 -0
- package/dist/binary-string-CKVAYI3M.js +24 -0
- package/dist/binary-string-CKVAYI3M.js.map +1 -0
- package/dist/body-insets-Dw_BeWD_.js +54 -0
- package/dist/body-insets-Dw_BeWD_.js.map +1 -0
- package/dist/browser.d.ts +29 -9
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +41 -14
- package/dist/browser.js.map +1 -1
- package/dist/clip-Bl01BPcN.d.ts +67 -0
- package/dist/clip-Bl01BPcN.d.ts.map +1 -0
- package/dist/diagnostics-D8ot4Ei7.d.ts +244 -0
- package/dist/diagnostics-D8ot4Ei7.d.ts.map +1 -0
- package/dist/embedded-fonts-DarT9aoa.d.ts +20 -0
- package/dist/embedded-fonts-DarT9aoa.d.ts.map +1 -0
- package/dist/entry-compose-DCnvBZz2.d.ts +1046 -0
- package/dist/entry-compose-DCnvBZz2.d.ts.map +1 -0
- package/dist/{enums-CvRYniUA.d.ts → enums-BUKTUB6V.d.ts} +21 -13
- package/dist/{enums-CvRYniUA.d.ts.map → enums-BUKTUB6V.d.ts.map} +1 -1
- package/dist/{errors-Bvln0H-7.js → errors-C4oENPcu.js} +92 -2
- package/dist/errors-C4oENPcu.js.map +1 -0
- package/dist/families.d.ts +260 -0
- package/dist/families.d.ts.map +1 -0
- package/dist/families.js +57 -0
- package/dist/families.js.map +1 -0
- package/dist/{fit-BKs0zxMI.js → fit-Cb7naFj6.js} +249 -167
- package/dist/fit-Cb7naFj6.js.map +1 -0
- package/dist/font-metrics-v5fn7s7e.d.ts +613 -0
- package/dist/font-metrics-v5fn7s7e.d.ts.map +1 -0
- package/dist/grid-DikTjFey.js +187 -0
- package/dist/grid-DikTjFey.js.map +1 -0
- package/dist/{html-dom-B0I0QSbU.js → html-dom-Iuog2wdK.js} +121 -91
- package/dist/html-dom-Iuog2wdK.js.map +1 -0
- package/dist/html.d.ts +6 -6
- package/dist/html.d.ts.map +1 -1
- package/dist/html.js +7 -6
- package/dist/html.js.map +1 -1
- package/dist/image-size-CvN2iCA4.js +1611 -0
- package/dist/image-size-CvN2iCA4.js.map +1 -0
- package/dist/index.d.ts +24 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -11
- package/dist/index.js.map +1 -1
- package/dist/inspect.d.ts +40 -31
- package/dist/inspect.d.ts.map +1 -1
- package/dist/inspect.js +40 -48
- package/dist/inspect.js.map +1 -1
- package/dist/math.d.ts +7 -5
- package/dist/math.d.ts.map +1 -1
- package/dist/math.js +16 -7
- package/dist/math.js.map +1 -1
- package/dist/measure.d.ts +12 -225
- package/dist/measure.d.ts.map +1 -1
- package/dist/measure.js +3 -3
- package/dist/node.d.ts +22 -8
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +27 -7
- package/dist/node.js.map +1 -1
- package/dist/notes-Dh12JAbn.js +3264 -0
- package/dist/notes-Dh12JAbn.js.map +1 -0
- package/dist/options-internal-WqgMf720.js +43 -0
- package/dist/options-internal-WqgMf720.js.map +1 -0
- package/dist/{package-CaOLXSNi.d.ts → package-J49Ck6S2.d.ts} +27 -12
- package/dist/package-J49Ck6S2.d.ts.map +1 -0
- package/dist/playbtn-CUqQdoDf.js +22 -0
- package/dist/playbtn-CUqQdoDf.js.map +1 -0
- package/dist/{slide-js0QpRV-.d.ts → pres-C6qgOFAa.d.ts} +1021 -1370
- package/dist/pres-C6qgOFAa.d.ts.map +1 -0
- package/dist/{presentation-Cp7vzlAw.js → presentation-DGYlAWhl.js} +3208 -2727
- package/dist/presentation-DGYlAWhl.js.map +1 -0
- package/dist/{presentation-types-DP_8jog7.d.ts → presentation-types-8jLQHI4M.d.ts} +1070 -683
- package/dist/presentation-types-8jLQHI4M.d.ts.map +1 -0
- package/dist/read.d.ts +9 -9
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +4 -4
- package/dist/script.d.ts +80 -66
- package/dist/script.d.ts.map +1 -1
- package/dist/script.js +2399 -1139
- package/dist/script.js.map +1 -1
- package/dist/{shapes-BemroU-z.js → shapes-re0KyQk_.js} +2807 -1609
- package/dist/shapes-re0KyQk_.js.map +1 -0
- package/dist/slide-Dx2ZeVZ6.d.ts +1256 -0
- package/dist/slide-Dx2ZeVZ6.d.ts.map +1 -0
- package/dist/slide-size-BalTjFuv.js +88 -0
- package/dist/slide-size-BalTjFuv.js.map +1 -0
- package/dist/{units-internal-Dg95w_YD.js → table-cell-margins-EVg0EwxT.js} +235 -273
- package/dist/table-cell-margins-EVg0EwxT.js.map +1 -0
- package/dist/table-dom-BTDP3lEP.js +21 -0
- package/dist/table-dom-BTDP3lEP.js.map +1 -0
- package/dist/text-KnLOtEEu.js +3980 -0
- package/dist/text-KnLOtEEu.js.map +1 -0
- package/dist/text-anchor-CrYXAfUu.js +176 -0
- package/dist/text-anchor-CrYXAfUu.js.map +1 -0
- package/dist/transition-speed-kUEWDWTx.js +14 -0
- package/dist/transition-speed-kUEWDWTx.js.map +1 -0
- package/dist/units-internal-XJlf-hOl.js +649 -0
- package/dist/units-internal-XJlf-hOl.js.map +1 -0
- package/dist/zip-C0leZZMj.d.ts +67 -0
- package/dist/zip-C0leZZMj.d.ts.map +1 -0
- package/dist/zip-CKd8ihcf.js +177 -0
- package/dist/zip-CKd8ihcf.js.map +1 -0
- package/dist/zip.d.ts +3 -68
- package/dist/zip.js +3 -163
- package/dist/zoom-cX9sllpH.js +8865 -0
- package/dist/zoom-cX9sllpH.js.map +1 -0
- package/package.json +106 -19
- package/skills/ts-pptx-upstream/SKILL.md +58 -57
- package/dist/autopage-DkjYZUFD.js +0 -423
- package/dist/autopage-DkjYZUFD.js.map +0 -1
- package/dist/diagnostics-Du_s75MT.d.ts +0 -829
- package/dist/diagnostics-Du_s75MT.d.ts.map +0 -1
- package/dist/errors-Bvln0H-7.js.map +0 -1
- package/dist/errors-PflMPWBn.d.ts +0 -182
- package/dist/errors-PflMPWBn.d.ts.map +0 -1
- package/dist/fit-BKs0zxMI.js.map +0 -1
- package/dist/html-dom-B0I0QSbU.js.map +0 -1
- package/dist/namespaces-BVnNu7sg.js +0 -666
- package/dist/namespaces-BVnNu7sg.js.map +0 -1
- package/dist/notes-RLCwdlTE.js +0 -1703
- package/dist/notes-RLCwdlTE.js.map +0 -1
- package/dist/package-CaOLXSNi.d.ts.map +0 -1
- package/dist/pres-C5__xkDh.d.ts +0 -202
- package/dist/pres-C5__xkDh.d.ts.map +0 -1
- package/dist/presentation-Cp7vzlAw.js.map +0 -1
- package/dist/presentation-types-DP_8jog7.d.ts.map +0 -1
- package/dist/shapes-BemroU-z.js.map +0 -1
- package/dist/slide-js0QpRV-.d.ts.map +0 -1
- package/dist/text-CyetbF6p.js +0 -11278
- package/dist/text-CyetbF6p.js.map +0 -1
- package/dist/units-1kRzYShk.js +0 -231
- package/dist/units-1kRzYShk.js.map +0 -1
- package/dist/units-internal-Dg95w_YD.js.map +0 -1
- package/dist/zip.d.ts.map +0 -1
- package/dist/zip.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notes-RLCwdlTE.js","names":[],"sources":["../src/gen/utils.ts","../src/gen/oxml/el.ts","../src/gen/drawingml/color.ts","../src/gen/drawingml/effect.ts","../src/gen/drawingml/fill.ts","../src/embedded-fonts.ts","../src/gen/drawingml/clamp.ts","../src/gen/drawingml/math.ts","../src/gen/drawingml/text-run.ts","../src/gen/opc/rels.ts","../src/gen/slide/notes.ts"],"sourcesContent":["/**\n * ts-pptx: shared generator helpers.\n *\n * The small cross-cutting pieces the OOXML writers all need and that belong to\n * no single part:\n * - XML text encodeXmlEntities\n * - Identifiers & naming getUuid, validateObjectName, getDuplicateObjectNames\n * - Slide relationships getNewRelId, isHyperlinkRel, mediaSlideKey\n *\n * DrawingML fragment builders moved to `gen/drawingml/{color,effect,fill,line}.ts`;\n * unit conversion to `units-internal.ts` (over the public primitives in `units.ts`);\n * base64/image-header decoding and media content types to `media/`.\n */\n\nimport { warn } from '../diagnostics.js'\nimport type { PresSlideInternal } from '../types/internal.js'\n\n/**\n * Fill the `x`/`y` placeholders of a hex pattern with random nibbles.\n *\n * **Not replaceable by `crypto.randomUUID()`**, which exists on Node 24 and in every\n * browser. This takes a *format string*, and half its callers pass a partial one:\n * `gen/chart/plot-scatter.ts` asks for a bare tail (`-xxxx-xxxx-xxxx-xxxxxxxxxxxx`)\n * to splice onto a padded point index, and its other two calls want a GUID shape with\n * no version nibble. Only `gen/define/zoom.ts` and `presentation.ts`, which pass a\n * v4-shaped pattern, could switch, and switching only those would leave two generators\n * where there is now one. The analysis is recorded here so it does not get re-derived:\n * the swap is low value and non-zero risk, and it is not on the roadmap.\n * @link https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript#answer-2117523\n * @param {string} uuidFormat - the pattern; `x` becomes a random nibble, `y` one of 8/9/a/b\n * @returns {string} the filled pattern\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 *\n * ELEMENT TEXT ONLY. A literal tab, carriage return or line feed is left alone here because in\n * character data it *is* the content (`<a:t>` line breaks depend on it). Inside an attribute value\n * the same three characters are destroyed by the parser rather than preserved — see\n * {@link encodeXmlAttrValue}, which every attribute-emitting path must use instead.\n * @param {string | number} xml - value to encode (numbers are stringified, as callers pass counts/sizes)\n * @returns {string} escaped XML\n */\nexport function encodeXmlEntities(xml: string | number): 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 * Escape a value destined for an XML **attribute**.\n *\n * Everything {@link encodeXmlEntities} does, plus the three whitespace characters that survive in\n * element text but not in an attribute: XML 1.0 section 3.3.3 requires a parser to normalise a\n * literal tab, carriage return or line feed inside an attribute value to a single space *before any\n * consumer sees it*. Carrying one across therefore requires a character reference, so a caller's\n * `objectName: 'Abschnitts-\\nuberschrift'` reads back with its line break rather than a space.\n *\n * Deliberately a separate function rather than a widening of `encodeXmlEntities`: that helper also\n * escapes element text, where a raw newline is meaningful content emitted as-is, and escaping it\n * there would change bytes across every text-bearing part in the package.\n * @param {string | number} xml - value to encode (numbers are stringified, as callers pass ids/sizes)\n * @returns {string} escaped XML, safe to place between attribute quotes\n */\nexport function encodeXmlAttrValue(xml: string | number): string {\n\treturn encodeXmlEntities(xml).replace(/\\t/g, '	').replace(/\\n/g, ' ').replace(/\\r/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\twarn(\n\t\t\t'object-name/empty',\n\t\t\t`${kind} objectName is empty or whitespace-only; it will not provide a stable Selection Pane identity.`\n\t\t)\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\twarn(\n\t\t\t'object-name/control-characters',\n\t\t\t`${kind} objectName \"${name}\" contains control characters that will be stripped, changing the stored name.`\n\t\t)\n\t}\n\tif (name.length > MAX_OBJECT_NAME_LENGTH) {\n\t\twarn(\n\t\t\t'object-name/too-long',\n\t\t\t`${kind} objectName exceeds ${MAX_OBJECT_NAME_LENGTH} characters and may not be preserved by PowerPoint.`\n\t\t)\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 * Get a new rel ID (rId) for charts, media, etc.\n *\n * Counting is the normal case: a slide's rels are minted in order, so one past the\n * total is free. It is not enough on its own, because a rel can arrive on a slide\n * carrying an id minted somewhere else — auto-paging re-registers a repeated header\n * row's hyperlink on each overflow slide under the id stamped on the shared\n * hyperlink object (`gen/define/hyperlinks.ts`). That id is then held but not\n * counted-to, so the next mint could hand out the same number and the part would\n * declare two `Relationship` elements sharing an `Id` — invalid OPC, and PowerPoint\n * resolves such a reference to whichever comes first. Hence the scan: start where\n * the count says, then step over anything the slide already holds.\n * @param {PresSlideInternal} target - the slide to use\n * @returns {number} the lowest free rId at or above the current rel count plus 1\n */\nexport function getNewRelId(target: PresSlideInternal): number {\n\tconst held = new Set<number>()\n\ttarget._rels.forEach((rel) => held.add(rel.rId))\n\ttarget._relsChart.forEach((rel) => held.add(rel.rId))\n\ttarget._relsMedia.forEach((rel) => held.add(rel.rId))\n\n\tlet rId = target._rels.length + target._relsChart.length + target._relsMedia.length + 1\n\twhile (held.has(rId)) rId++\n\treturn rId\n}\n\n/**\n * Whether a slide relationship is a hyperlink (external URL or internal slide\n * link). The relationship `type` is stringly-typed (`'hyperlink'`, `'online'`,\n * mixed-case variants), so this centralizes the case-insensitive predicate that\n * was duplicated across the slide-rels writer (`gen/slide/slide.ts`) and the inspect path\n * (presentation.ts). For an internal slide-to-slide link, `rel.data === 'slide'` and\n * `rel.Target` is the 1-based target slide number.\n * @param {{ type: string }} rel - a slide relationship\n * @returns {boolean} true if the rel is any kind of hyperlink\n */\nexport function isHyperlinkRel(rel: { type: string }): boolean {\n\treturn rel.type.toLowerCase().includes('hyperlink')\n}\n\n/**\n * The slide-scoped segment of a media part's name.\n *\n * Media targets are namespaced by the slide that registered them so that slide\n * master (`sm`) and slide layout (`sl-N`) media never collide with regular slide\n * media names in large decks. A layout is identified by the `_slideNum >= 1000`\n * convention the layout builder stamps on it; a master has no `_slideNum` at all.\n * @param {PresSlideInternal} target - the slide, layout or master registering the media\n * @returns {string} the key to splice into the media part name\n */\nexport function mediaSlideKey(target: PresSlideInternal): string {\n\tif (target._slideNum == null) return 'sm'\n\treturn target._slideNum >= 1000 ? `sl-${target._slideNum}` : `${target._slideNum}`\n}\n","/**\n * ts-pptx: XML element builder (write-side substrate)\n *\n * The write path historically concatenated template strings and called\n * `encodeXmlEntities` by hand at every interpolation — the source of escaping,\n * attribute-order and child-sequence bugs. This builder centralizes escaping\n * while reproducing today's exact byte layout, so a migration onto it can be\n * gated on strict byte-identity (`pnpm run byte-identity:check`) rather than on\n * looser schema equivalence.\n *\n * Mirrors `src/read/oxml/dom.ts` on the write side.\n *\n * Two rules make byte-identity achievable:\n *\n * 1. Self-closing is decided by ARITY, never by child value. `el()` always emits\n * a paired tag; `voidEl()` always self-closes. This matters because\n * `encodeXmlEntities(undefined)` returns `''`, so a value-based rule would\n * turn today's `<dc:title></dc:title>` into `<dc:title/>` — a silent byte\n * regression on every optional-text element in the tree.\n *\n * Escaping is split to match: attribute values go through `encodeXmlAttrValue`\n * (which adds the `	`/` `/` ` character references an XML parser\n * would otherwise normalise to a space), text children through\n * `encodeXmlEntities`, where those same characters are content.\n *\n * 2. Whitespace is explicit, per element, via `fmt`. Most emitted parts are flat\n * (no `fmt` needed at all); the pretty-printed ones carry indentation that is\n * not always depth-regular, so it is described rather than derived. Quirks\n * like a misindented closing tag stay visible in the call site instead of\n * being hidden inside a template literal.\n */\n\nimport { encodeXmlAttrValue, encodeXmlEntities } from '../utils.js'\n\n/** Pre-serialized XML, interpolated verbatim (not escaped). */\nexport interface RawXml {\n\traw: string\n}\n\n/** A text child (escaped) or pre-serialized markup (verbatim). */\nexport type XmlChild = string | number | RawXml | null | undefined\n\n/** Attribute values; `undefined`/`null` omit the attribute entirely. */\nexport type XmlAttrs = Record<string, string | number | null | undefined>\n\n/**\n * Byte-layout control. Omit for flat output.\n * - `openPrefix` — emitted before `<name`\n * - `childPrefix` — emitted before each child\n * - `closePrefix` — emitted before the closing delimiter (`</name>`, or `/>` for `voidEl`)\n */\ninterface XmlFmt {\n\topenPrefix?: string\n\tchildPrefix?: string\n\tclosePrefix?: string\n}\n\n/** Wrap already-serialized XML so it is interpolated verbatim. */\nexport function raw(xml: string): RawXml {\n\treturn { raw: xml }\n}\n\nfunction isRaw(child: XmlChild): child is RawXml {\n\treturn typeof child === 'object' && child !== null && typeof child.raw === 'string'\n}\n\nfunction openTag(name: string, attrs: XmlAttrs | null | undefined, fmt: XmlFmt | undefined): string {\n\tlet out = (fmt?.openPrefix ?? '') + '<' + name\n\tfor (const [key, value] of Object.entries(attrs ?? {})) {\n\t\tif (value === undefined || value === null) continue\n\t\tout += ' ' + key + '=\"' + encodeXmlAttrValue(value) + '\"'\n\t}\n\treturn out\n}\n\n/**\n * Paired element: `<name …>children</name>` — emitted even when `children` is\n * empty or `undefined`. Text children are escaped; `raw()` children are not.\n */\nexport function el(name: string, attrs?: XmlAttrs | null, children?: XmlChild | XmlChild[], fmt?: XmlFmt): string {\n\tlet out = openTag(name, attrs, fmt) + '>'\n\tconst childPrefix = fmt?.childPrefix ?? ''\n\tfor (const child of Array.isArray(children) ? children : [children]) {\n\t\tif (child === undefined || child === null) continue\n\t\tout += childPrefix + (isRaw(child) ? child.raw : encodeXmlEntities(child))\n\t}\n\treturn out + (fmt?.closePrefix ?? '') + '</' + name + '>'\n}\n\n/**\n * Self-closing element: `<name …/>`. `fmt.closePrefix` goes before the `/>` — a\n * handful of emitters write `<a:avLst />` with a space there, and that space is\n * byte-significant like any other.\n */\nexport function voidEl(name: string, attrs?: XmlAttrs | null, fmt?: XmlFmt): string {\n\treturn openTag(name, attrs, fmt) + (fmt?.closePrefix ?? '') + '/>'\n}\n","/**\n * ts-pptx: DrawingML color elements\n *\n * Emit the bare `<a:srgbClr>` / `<a:schemeClr>` color element that every other\n * color context builds on (solid fills, gradient stops, effect alphas, line\n * fills, highlights, patterns).\n *\n * The RGB->hex helpers this module used to carry now live in\n * `gen/table/html-dom.ts`, their only caller: they are reachable exclusively from\n * the browser-only `tableToSlides` path, so keeping them here made them permanent\n * dead weight in the Node chunk's coverage report (33% functions on a file that is\n * otherwise fully exercised) while html-dom.ts is coverage-excluded wholesale.\n */\n\nimport { SchemeColor, type SCHEME_COLORS } from '../../enums.js'\nimport { REGEX_HEX_COLOR, DEF_FONT_COLOR } from '../../constants-internal.js'\nimport { warn } from '../../diagnostics.js'\nimport { PERCENT_SCALE } from '../../units.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\n\n/**\n * Opening delimiter of an `<a:alpha>` child, for detecting one a caller already\n * supplied. A prefix rather than a whole element: the value is the caller's, and\n * this asks only whether the element is present.\n */\nconst ALPHA_TAG = '<a:alpha'\n\n/**\n * Emit a bare DrawingML color element — either `<a:schemeClr>` (scheme color) or `<a:srgbClr>`\n * (hex RGB). This is a low-level primitive: it is the shared building block for every color\n * context (solid fills, gradient stops, `<a:alpha>` on shadows/glow, line fills, highlight,\n * underline, patterns, …), so it is intentionally NOT limited to solid fills and cannot be\n * folded into `genXmlColorSelection`.\n *\n * When you specifically want a *solid fill*, prefer `genXmlColorSelection` (`fill.ts`), which\n * wraps this in `<a:solidFill>…</a:solidFill>` and also handles `alpha`/`transparency` and the\n * gradient/pattern/image fill types — reach for `createColorElement` directly only when you\n * need the raw color element (e.g. inside `<a:ln>`, `<a:gs>`, an effect, or a highlight).\n * @param {string|SCHEME_COLORS} colorStr - hex RGB (e.g. \"FFFF00\") or a scheme color constant (e.g. SchemeColor.ACCENT1)\n * @param {string} [innerElements] - additional elements that adjust the color, nested inside 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\twarn(\n\t\t\t'color/not-a-string',\n\t\t\t`createColorElement: expected a string color value, got ${typeof colorStr}. \"${DEF_FONT_COLOR}\" used instead.`\n\t\t)\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(ALPHA_TAG)) {\n\t\t\tconst alphaHex = colorVal.slice(6, 8)\n\t\t\tconst alphaVal = Math.round((parseInt(alphaHex, 16) / 255) * PERCENT_SCALE)\n\t\t\tinnerElements = voidEl('a:alpha', { val: alphaVal }) + (innerElements || '')\n\t\t}\n\t\tcolorVal = colorVal.slice(0, 6)\n\t}\n\n\tif (!REGEX_HEX_COLOR.test(colorVal) && !Object.values(SchemeColor).includes(colorVal as SchemeColor)) {\n\t\twarn(\n\t\t\t'color/invalid-value',\n\t\t\t`\"${colorVal}\" is not a valid scheme color or hex RGB! \"${DEF_FONT_COLOR}\" used instead. Only provide 6-digit RGB or 'SchemeColor' values!`\n\t\t)\n\t\tcolorVal = DEF_FONT_COLOR\n\t}\n\n\tconst isHex = REGEX_HEX_COLOR.test(colorVal)\n\tconst name = isHex ? 'a:srgbClr' : 'a:schemeClr'\n\tconst attrs = { val: isHex ? colorVal.toUpperCase() : colorVal }\n\n\t// Paired vs self-closing is decided by whether there is anything to nest, so this\n\t// is one of the few places `el`/`voidEl` are chosen at runtime rather than by tag.\n\treturn innerElements ? el(name, attrs, raw(innerElements)) : voidEl(name, attrs)\n}\n","/**\n * ts-pptx: DrawingML effects (glow and shadow)\n *\n * Emit the `<a:glow>` / `<a:outerShdw>` / `<a:innerShdw>` children of an\n * `<a:effectLst>`, and normalize the user-facing `shadow` options into the\n * internal shape every emit site reads.\n * @see http://officeopenxml.com/drwSp-effects.php\n */\n\nimport { DEF_FONT_COLOR } from '../../constants-internal.js'\nimport { warn } from '../../diagnostics.js'\nimport type { ShadowProps, TextGlowProps } from '../../types/index.js'\nimport type { ShadowPropsInternal } from '../../types/internal.js'\nimport { ANGLE_UNITS_PER_DEGREE, EMU_PER_POINT, PERCENT_SCALE } from '../../units.js'\nimport { opacityToAlpha, ptsToEmuLenient } from '../../units-internal.js'\nimport { createColorElement } from './color.js'\nimport { el, raw, voidEl, type XmlAttrs } from '../oxml/el.js'\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\tconst opts = { ...defaults, ...options }\n\tconst size = Math.round(opts.size * EMU_PER_POINT)\n\tconst color = opts.color || DEF_FONT_COLOR\n\tconst opacity = opacityToAlpha(opts.opacity ?? 0)\n\n\treturn el('a:glow', { rad: size }, raw(createColorElement(color, alpha(opacity))))\n}\n\n/** The `<a:alpha>` child both effects hang off their color element. */\nfunction alpha(value: number): string {\n\treturn voidEl('a:alpha', { val: value })\n}\n\n/**\n * Creates an `a:outerShdw`/`a:innerShdw` element for a text run, shape, image, or chart.\n * Returns the shadow element only (no wrapping `a:effectLst`) so callers can either combine\n * it with other effects (e.g. glow) inside one `a:effectLst`, or wrap a lone shadow via\n * {@link createShadowEffectLst}.\n *\n * Colors go through {@link createColorElement}, so scheme colors (e.g. `accent1`) are honored\n * — earlier per-site copies hardcoded `a:srgbClr` and silently emitted invalid OOXML for them.\n * @param {ShadowPropsInternal} options shadow properties\n * @param {ShadowPropsInternal} 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: ShadowPropsInternal | undefined, defaults: ShadowPropsInternal): 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 = ptsToEmuLenient(opts.blur ?? 0)\n\tconst offset = ptsToEmuLenient(opts.offset ?? 0)\n\tconst angle = Math.round((opts.angle ?? 0) * ANGLE_UNITS_PER_DEGREE)\n\tconst opacity = Math.round((opts._alpha ?? 0.75) * PERCENT_SCALE)\n\tconst color = opts.color || DEF_FONT_COLOR\n\n\t// sx/sy/kx/ky/algn/rotWithShape are valid only on `a:outerShdw` (CT_OuterShadowEffect);\n\t// `a:innerShdw` (CT_InnerShadowEffect) accepts only blurRad/dist/dir.\n\tconst outerAttrs: XmlAttrs =\n\t\ttype === 'outer'\n\t\t\t? { sx: 100000, sy: 100000, kx: 0, ky: 0, algn: 'bl', rotWithShape: opts.rotateWithShape ? 1 : 0 }\n\t\t\t: {}\n\tconst attrs = { ...outerAttrs, blurRad: blur, dist: offset, dir: angle }\n\n\treturn el(`a:${type}Shdw`, attrs, raw(createColorElement(color, alpha(opacity))))\n}\n\n/**\n * Wraps a lone shadow in the `a:effectLst` that CT_ShapeProperties (shapes/images) and chart\n * marker/data-point properties require. Returns a self-closing `<a:effectLst/>` when there is\n * no shadow (missing/non-object options, or `type: 'none'`), matching the \"no effects\" element\n * PowerPoint emits. Use this instead of {@link createShadowElement} when the shadow is the only\n * effect; use `createShadowElement` directly when combining with other effects (e.g. glow).\n * @param {ShadowPropsInternal} options shadow properties\n * @param {ShadowPropsInternal} defaults defaults for unspecified properties in `options`\n * @returns {string} `<a:effectLst>…</a:effectLst>` or `<a:effectLst/>`\n */\nexport function createShadowEffectLst(options: ShadowPropsInternal | undefined, defaults: ShadowPropsInternal): string {\n\tif (!options || typeof options !== 'object') return voidEl('a:effectLst')\n\tconst inner = createShadowElement(options, defaults)\n\treturn inner ? el('a:effectLst', null, raw(inner)) : voidEl('a:effectLst')\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): ShadowPropsInternal | undefined {\n\tif (!ShadowProps || typeof ShadowProps !== 'object') {\n\t\t// warn(\"`shadow` options must be an object. Ex: `{shadow: {type:'none'}}`\")\n\t\treturn undefined\n\t}\n\tconst corrected: ShadowPropsInternal = ShadowProps\n\t// No `opacity` scrub is needed: the derived alpha lives under the private `_alpha` name, so a\n\t// stray `opacity` from an untyped/legacy caller lands on a field nothing reads (inert) rather\n\t// than colliding with the internal value.\n\n\t// OPT: `type`\n\tif (corrected.type !== 'outer' && corrected.type !== 'inner' && corrected.type !== 'none') {\n\t\twarn('shadow/invalid-type', 'shadow.type options are `outer`, `inner` or `none`.')\n\t\tcorrected.type = 'outer'\n\t}\n\n\t// OPT: `angle`\n\tif (corrected.angle) {\n\t\t// A: REALITY-CHECK\n\t\tif (isNaN(Number(corrected.angle)) || corrected.angle < 0 || corrected.angle > 359) {\n\t\t\twarn('shadow/angle-out-of-range', 'shadow.angle can only be 0-359')\n\t\t\tcorrected.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\tcorrected.angle = Math.round(Number(corrected.angle))\n\t}\n\n\t// OPT: `transparency` (PowerPoint UI term, 0-100) -> internal `_alpha` (0.0-1.0), which\n\t// every emit site reads.\n\tif (corrected.transparency !== undefined) {\n\t\tconst pct = Number(corrected.transparency)\n\t\tif (isNaN(pct) || pct < 0 || pct > 100) {\n\t\t\twarn('shadow/transparency-out-of-range', 'shadow.transparency can only be 0-100')\n\t\t} else {\n\t\t\tcorrected._alpha = 1 - pct / 100\n\t\t}\n\t}\n\n\t// OPT: `color`\n\tif (corrected.color) {\n\t\t// INCORRECT FORMAT\n\t\tif (corrected.color.startsWith('#')) {\n\t\t\twarn('shadow/color-has-hash', 'shadow.color should not include hash (#) character, , e.g. \"FF0000\"')\n\t\t\tcorrected.color = corrected.color.replace('#', '')\n\t\t}\n\n\t\t// 8-char hex (RGBA) — derive `_alpha` from the alpha byte (only when `transparency`\n\t\t// didn't already set one), then strip the alpha byte from the color so emit sites\n\t\t// produce valid 6-char `<a:srgbClr val=\"…\"/>`.\n\t\tif (/^[0-9a-fA-F]{8}$/.test(corrected.color)) {\n\t\t\tconst alphaHex = corrected.color.slice(6, 8)\n\t\t\tif (corrected._alpha === undefined) {\n\t\t\t\tcorrected._alpha = parseInt(alphaHex, 16) / 255\n\t\t\t}\n\t\t\tcorrected.color = corrected.color.slice(0, 6)\n\t\t}\n\t}\n\n\treturn corrected\n}\n","/**\n * ts-pptx: DrawingML fills\n *\n * Emit the fill group a shape, cell, chart element, or line paint can carry:\n * `<a:solidFill>`, `<a:gradFill>`, `<a:pattFill>`, `<a:blipFill>`.\n * {@link genXmlColorSelection} is the dispatch every caller should reach for;\n * the per-kind builders are exported for the few sites that know their fill kind.\n */\n\nimport { warn } from '../../diagnostics.js'\nimport type {\n\tColor,\n\tGradientFillProps,\n\tGradientStopProps,\n\tPatternFillProps,\n\tShapeFillProps,\n\tShapeLineProps,\n} from '../../types/index.js'\nimport { FIXED_PCT_PER_PERCENT } from '../../units.js'\nimport { convertRotationDegrees, transparencyToAlpha } from '../../units-internal.js'\nimport { createColorElement } from './color.js'\nimport { InvalidOptionError, UnsupportedFeatureError } from '../../errors.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\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))\n\t\tthrow new InvalidOptionError('gradient/angle-non-finite', 'Gradient angle must be a finite number.')\n\t// Into 0..360 rather than -360..360, which is where `convertRotationDegrees` leaves it:\n\t// `a:lin/@ang` is ST_PositiveFixedAngle (0..21600000), so a negative gradient angle is a\n\t// value PowerPoint reports as needing repair, not merely an unusual spelling.\n\treturn convertRotationDegrees(((degrees % 360) + 360) % 360)\n}\n\nfunction alphaFromTransparency(transparency: number | undefined): string {\n\treturn transparency ? voidEl('a:alpha', { val: transparencyToAlpha(transparency) }) : ''\n}\n\nfunction normalizeGradientStops(stops: GradientStopProps[] | undefined): GradientStopProps[] {\n\tif (!Array.isArray(stops) || stops.length < 2)\n\t\tthrow new InvalidOptionError('gradient/too-few-stops', '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 InvalidOptionError(\n\t\t\t\t\t'gradient/stop-position-non-finite',\n\t\t\t\t\t'Gradient stop position must be a finite number from 0 to 100.'\n\t\t\t\t)\n\t\t\t}\n\t\t\tif (stop.position < 0 || stop.position > 100)\n\t\t\t\tthrow new InvalidOptionError(\n\t\t\t\t\t'gradient/stop-position-out-of-range',\n\t\t\t\t\t'Gradient stop position must be from 0 to 100.'\n\t\t\t\t)\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' && gradient.kind !== 'radial')) {\n\t\tthrow new UnsupportedFeatureError(\n\t\t\t'gradient/type-unsupported',\n\t\t\t'Gradient fill currently supports only linear and radial gradients.'\n\t\t)\n\t}\n\tif (typeof gradient.rotateWithShape !== 'undefined' && typeof gradient.rotateWithShape !== 'boolean') {\n\t\tthrow new InvalidOptionError(\n\t\t\t'gradient/rotate-with-shape-not-boolean',\n\t\t\t'Gradient rotateWithShape must be a boolean.'\n\t\t)\n\t}\n\n\tconst stops = normalizeGradientStops(gradient.stops)\n\tconst rotWithShape = gradient.rotateWithShape ?? true\n\n\tconst gsLst = el(\n\t\t'a:gsLst',\n\t\tnull,\n\t\tstops.map((stop) =>\n\t\t\traw(\n\t\t\t\tel(\n\t\t\t\t\t'a:gs',\n\t\t\t\t\t{ pos: Math.round(stop.position * FIXED_PCT_PER_PERCENT) },\n\t\t\t\t\traw(createColorElement(stop.color, alphaFromTransparency(stop.transparency)))\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t)\n\n\tlet shape: string\n\tif (gradient.kind === 'radial') {\n\t\t// `<a:path path=\"circle\">` radiates the first stop from a focus rectangle out\n\t\t// to the edges. `fillToRect` insets place that focus: equal insets center it,\n\t\t// and the `center` percentage shifts it (l/t = center, r/b = 100 - center).\n\t\tconst cx = Math.max(0, Math.min(100, gradient.center?.x ?? 50))\n\t\tconst cy = Math.max(0, Math.min(100, gradient.center?.y ?? 50))\n\t\tconst fillToRect = voidEl('a:fillToRect', {\n\t\t\tl: Math.round(cx * FIXED_PCT_PER_PERCENT),\n\t\t\tt: Math.round(cy * FIXED_PCT_PER_PERCENT),\n\t\t\tr: Math.round((100 - cx) * FIXED_PCT_PER_PERCENT),\n\t\t\tb: Math.round((100 - cy) * FIXED_PCT_PER_PERCENT),\n\t\t})\n\t\tshape = el('a:path', { path: 'circle' }, raw(fillToRect))\n\t} else {\n\t\tif (typeof gradient.scaled !== 'undefined' && typeof gradient.scaled !== 'boolean')\n\t\t\tthrow new InvalidOptionError('gradient/scaled-not-boolean', 'Gradient scaled must be a boolean.')\n\t\t// `scaled` is absent rather than defaulted when unset, so it stays `undefined`\n\t\t// and `voidEl` drops the attribute entirely.\n\t\tshape = voidEl('a:lin', {\n\t\t\tang: normalizeGradientAngle(gradient.angle),\n\t\t\tscaled: typeof gradient.scaled === 'boolean' ? boolToXml(gradient.scaled) : undefined,\n\t\t})\n\t}\n\n\treturn el('a:gradFill', { rotWithShape: boolToXml(rotWithShape) }, [raw(gsLst), raw(shape)])\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 InvalidOptionError('pattern-fill/missing-pattern', 'Pattern fill requires a pattern object.')\n\tconst fgColor = pattern.fgColor ?? '000000'\n\tconst bgColor = pattern.bgColor ?? 'FFFFFF'\n\treturn el('a:pattFill', { prst: pattern.preset }, [\n\t\traw(el('a:fgClr', null, raw(createColorElement(fgColor)))),\n\t\traw(el('a:bgClr', null, raw(createColorElement(bgColor)))),\n\t])\n}\n\n/**\n * Create a native DrawingML picture (image) fill.\n * The media relationship is registered when the object is added; this only emits\n * the `<a:blipFill>` referencing the pre-resolved rId.\n * @param {ShapeFillProps} props fill props (must carry a resolved `_imgRid`)\n * @returns XML string\n */\nexport function genXmlImageFill(props: ShapeFillProps | undefined): string {\n\tif (!props || typeof props._imgRid !== 'number') {\n\t\twarn(\n\t\t\t'image-fill/unresolved-media',\n\t\t\t'image fill is missing its resolved media reference; falling back to no fill. Provide `image: { path }` or `image: { data }`.'\n\t\t)\n\t\treturn voidEl('a:noFill')\n\t}\n\tconst alpha = props.transparency\n\tconst blipInner = alpha ? voidEl('a:alphaModFix', { amt: Math.round((100 - alpha) * FIXED_PCT_PER_PERCENT) }) : ''\n\treturn el('a:blipFill', { dpi: 0, rotWithShape: 1 }, [\n\t\t// `<a:blip>` stays paired even with no `alphaModFix` child — the arity rule.\n\t\traw(el('a:blip', { 'r:embed': `rId${props._imgRid}` }, raw(blipInner))),\n\t\traw(voidEl('a:srcRect')),\n\t\traw(el('a:stretch', null, raw(voidEl('a:fillRect')))),\n\t])\n}\n\n/**\n * Create color selection\n * @param {Color | ShapeFillProps | ShapeLineProps} props fill props\n * @returns XML string\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\tinternalElements += alphaFromTransparency(props.transparency)\n\t\t}\n\n\t\tswitch (fillType) {\n\t\t\t// `type: 'none'` is an explicit *no fill*, not the absence of a statement — the\n\t\t\t// same distinction `genXmlLineFill` already makes on the stroke side. Emitting\n\t\t\t// nothing leaves the interior to `p:style/a:fillRef` or the placeholder, so a\n\t\t\t// shape authored transparent came out painted in the theme's accent colour.\n\t\t\tcase 'none':\n\t\t\t\toutText += voidEl('a:noFill')\n\t\t\t\tbreak\n\t\t\t// The other half of that distinction, and the reason it needs a name of its own:\n\t\t\t// on the shape/text-box path a missing `fill` already emits `<a:noFill/>`, so\n\t\t\t// omission cannot spell *inherit* there. `'inherit'` emits nothing, which is what\n\t\t\t// hands the interior back to `p:style/a:fillRef` or the placeholder.\n\t\t\tcase 'inherit':\n\t\t\t\toutText += ''\n\t\t\t\tbreak\n\t\t\tcase 'solid':\n\t\t\t\toutText += el('a:solidFill', null, raw(createColorElement(colorVal, internalElements)))\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\tcase 'image':\n\t\t\t\toutText += genXmlImageFill(typeof props === 'string' ? undefined : props)\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 * Shared model + serializer for PresentationML embedded fonts, used by both the\n * write side (author-side `pptx.embedFont`, `gen/pres/presentation.ts`) and the read side\n * (`importSlide({ embedFonts: true })`, `src/read/api/ops/embedded-fonts.ts`).\n *\n * Embedded fonts are three coordinated pieces (ECMA-376 transitional):\n * 1. binary font parts `/ppt/fonts/fontN.fntdata` — the **raw** TTF/OTF bytes\n * (PresentationML does not obfuscate embedded fonts), content type\n * `application/x-fontdata` via a single `fntdata` Default extension;\n * 2. one `font` relationship per face from `presentation.xml`;\n * 3. a `p:embeddedFontLst` in `presentation.xml`, at index 7 of the\n * `CT_Presentation` child sequence (after `smartTags`, before `custShowLst`\n * … `defaultTextStyle`).\n *\n * This module owns only the OOXML-shape knowledge; rId allocation and part\n * placement stay with each caller (their packaging models differ).\n */\n\n/** Extension for the binary font parts (`/ppt/fonts/fontN.fntdata`). */\nexport const FONT_DATA_EXTENSION = 'fntdata'\n/** Content type for a `.fntdata` part — one `Default` covers every font part. */\nexport const FONT_DATA_CONTENT_TYPE = 'application/x-fontdata'\n/** Relationship type from `presentation.xml` to a font part (one per face). */\nexport const FONT_REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/font'\n\n/**\n * The four face slots of `CT_EmbeddedFontListEntry`, in schema child order\n * (`font` first, then these). Iterate in this order everywhere so the read- and\n * write-side emitters agree on element order.\n */\nexport const EMBEDDED_FONT_SLOTS = ['regular', 'bold', 'italic', 'boldItalic'] as const\nexport type EmbeddedFontSlot = (typeof EMBEDDED_FONT_SLOTS)[number]\n\n/** One embeddable face: a slot plus the raw font bytes (absent in pure read-side merges). */\nexport interface EmbeddedFontFace {\n\tslot: EmbeddedFontSlot\n\tbytes?: Uint8Array\n}\n\n/** A typeface family with 1..4 embedded faces — one `p:embeddedFont` entry. */\nexport interface EmbeddedFont {\n\t/** `p:font/@typeface` — MUST match the family name used in run/`fontFace` typefaces or PowerPoint won't bind it. */\n\ttypeface: string\n\tpanose?: string\n\tpitchFamily?: number\n\tcharset?: number\n\tfaces: EmbeddedFontFace[]\n}\n\n/**\n * One face flattened to its package coordinates. `partIndex` is 1-based and maps\n * to `/ppt/fonts/font${partIndex}.fntdata`; `rId` is the numeric relationship id\n * (use `rId${rId}`). Produced once and shared by the part writer, the rels\n * writer, and the `embeddedFontLst` emitter so all three agree.\n */\nexport interface FlatEmbeddedFace {\n\tfontIndex: number\n\tslot: EmbeddedFontSlot\n\tbytes: Uint8Array\n\tpartIndex: number\n\trId: number\n}\n\n/**\n * Flatten `fonts` into one ordered face list, assigning sequential part indices\n * (1-based) and relationship ids (starting at `firstRId`). Faces are emitted in\n * `fonts` order, each font's faces in {@link EMBEDDED_FONT_SLOTS} order. Faces\n * without `bytes` are skipped (nothing to write).\n */\nexport function flattenEmbeddedFaces(fonts: EmbeddedFont[], firstRId: number): FlatEmbeddedFace[] {\n\tconst flat: FlatEmbeddedFace[] = []\n\tlet partIndex = 0\n\tlet rId = firstRId\n\tfonts.forEach((font, fontIndex) => {\n\t\tfor (const slot of EMBEDDED_FONT_SLOTS) {\n\t\t\tconst face = font.faces.find((f) => f.slot === slot)\n\t\t\tif (!face || !face.bytes) continue\n\t\t\tflat.push({ fontIndex, slot, bytes: face.bytes, partIndex: ++partIndex, rId: rId++ })\n\t\t}\n\t})\n\treturn flat\n}\n\n/** Minimal XML attribute escaper (kept local so this module stays dependency-free). */\nfunction escapeAttr(value: string): string {\n\treturn value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\"/g, '"')\n}\n\n/**\n * Serialize a `<p:embeddedFontLst>` from `fonts` and a `(fontIndex, slot) → rId`\n * lookup (typically backed by {@link flattenEmbeddedFaces}). Returns `''` when no\n * font has any face with an allocated rId, so callers can emit nothing. Assumes\n * the enclosing document declares the `p:` and `r:` prefixes (presentation.xml\n * does), so no namespace declarations are emitted here.\n */\nexport function serializeEmbeddedFontLst(\n\tfonts: EmbeddedFont[],\n\trIdForFace: (fontIndex: number, slot: EmbeddedFontSlot) => number | undefined\n): string {\n\tconst entries: string[] = []\n\tfonts.forEach((font, fontIndex) => {\n\t\tconst faceXml: string[] = []\n\t\tfor (const slot of EMBEDDED_FONT_SLOTS) {\n\t\t\tconst rId = rIdForFace(fontIndex, slot)\n\t\t\tif (rId === undefined) continue\n\t\t\tfaceXml.push(`<p:${slot} r:id=\"rId${rId}\"/>`)\n\t\t}\n\t\tif (faceXml.length === 0) return\n\t\tlet fontAttrs = `typeface=\"${escapeAttr(font.typeface)}\"`\n\t\tif (font.panose !== undefined) fontAttrs += ` panose=\"${escapeAttr(font.panose)}\"`\n\t\tif (font.pitchFamily !== undefined) fontAttrs += ` pitchFamily=\"${font.pitchFamily}\"`\n\t\tif (font.charset !== undefined) fontAttrs += ` charset=\"${font.charset}\"`\n\t\tentries.push(`<p:embeddedFont><p:font ${fontAttrs}/>${faceXml.join('')}</p:embeddedFont>`)\n\t})\n\tif (entries.length === 0) return ''\n\treturn `<p:embeddedFontLst>${entries.join('')}</p:embeddedFontLst>`\n}\n","/**\n * ts-pptx: DrawingML value clamps\n *\n * Clamp font/character/line spacing values (points) into their ST_* schema\n * ranges and convert to the hundredths-of-a-point units the attributes expect.\n * Out-of-range values make PowerPoint report the package as needing repair.\n */\n\nimport { EMU_PER_POINT, HUNDREDTHS_PER_POINT, ptToHundredths } from '../../units.js'\nimport { ptsToEmuLenient } from '../../units-internal.js'\nimport { warnOnce } from '../../diagnostics.js'\nimport type { DiagnosticCode } from '../../codes.js'\n\n/**\n * One clamped text measure: how to convert the caller's points, what range the schema type\n * allows in the converted unit, and how to say so if the value falls outside it.\n */\ninterface ClampSpec {\n\t/** Diagnostic code raised when the value is clamped. */\n\tcode: DiagnosticCode\n\t/** Option name as the caller spells it, opening the warning. */\n\tlabel: string\n\t/** The valid range in points, as the warning states it. */\n\trange: string\n\t/** Points to the attribute's own unit. */\n\tconvert: (points: number) => number\n\t/** Converted units per point — divides the clamped value back into points for the warning. */\n\tperPoint: number\n\tmin: number\n\tmax: number\n}\n\n/**\n * Clamp a points value into its schema range and warn once if it did not already fit.\n *\n * The five measures below differ only in the fields of {@link ClampSpec}; the arithmetic and\n * the shape of the warning are the same for all of them. `warnOnce` keys its dedupe set on the\n * code plus the message, so the wording is part of the contract, not decoration.\n */\nfunction clampWithWarn(points: number, spec: ClampSpec): number {\n\tconst raw = spec.convert(points)\n\tconst clamped = Math.min(spec.max, Math.max(spec.min, raw))\n\tif (clamped !== raw)\n\t\twarnOnce(\n\t\t\tspec.code,\n\t\t\t`${spec.label} ${points} is outside the valid range ${spec.range}; using ${clamped / spec.perPoint}.`\n\t\t)\n\treturn clamped\n}\n\nconst FONT_SIZE: ClampSpec = {\n\tcode: 'font/size-out-of-range',\n\tlabel: 'fontSize',\n\trange: '1-4000pt',\n\tconvert: ptToHundredths,\n\tperPoint: HUNDREDTHS_PER_POINT,\n\tmin: 100,\n\tmax: 400000,\n}\n\nconst CHAR_SPACING: ClampSpec = {\n\tcode: 'text/char-spacing-out-of-range',\n\tlabel: 'charSpacing',\n\trange: '-4000..4000pt',\n\tconvert: ptToHundredths,\n\tperPoint: HUNDREDTHS_PER_POINT,\n\tmin: -400000,\n\tmax: 400000,\n}\n\nconst PARA_MARGIN: ClampSpec = {\n\tcode: 'text/paragraph-margin-out-of-range',\n\tlabel: 'paraMarginLeft',\n\trange: '0-4032pt',\n\tconvert: ptsToEmuLenient,\n\tperPoint: EMU_PER_POINT,\n\tmin: 0,\n\tmax: 51206400,\n}\n\nconst PARA_INDENT: ClampSpec = {\n\tcode: 'text/paragraph-indent-out-of-range',\n\tlabel: 'paraIndent',\n\trange: '-4032..4032pt',\n\tconvert: ptsToEmuLenient,\n\tperPoint: EMU_PER_POINT,\n\tmin: -51206400,\n\tmax: 51206400,\n}\n\nconst LINE_SPACING: ClampSpec = {\n\tcode: 'text/line-spacing-out-of-range',\n\tlabel: 'lineSpacing',\n\trange: '0-1584pt',\n\tconvert: ptToHundredths,\n\tperPoint: HUNDREDTHS_PER_POINT,\n\tmin: 0,\n\tmax: 158400,\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 */\nexport function clampFontSizeSz(fontSizePts: number): number {\n\treturn clampWithWarn(fontSizePts, FONT_SIZE)\n}\n\n/** Clamp character spacing (points) into ST_TextPoint (-4000..4000pt); returns hundredths for the `spc` attribute. */\nexport function clampCharSpacingSpc(charSpacingPts: number): number {\n\treturn clampWithWarn(charSpacingPts, CHAR_SPACING)\n}\n\n/**\n * Clamp a paragraph's left margin (points) into ST_TextMargin (0..4032pt, i.e. 0..51206400 EMU);\n * returns EMU for `a:pPr/@marL`. The type is unsigned — a negative margin is not a narrower one,\n * it is a value PowerPoint reports as needing repair.\n */\nexport function clampParaMarginEmu(marginPts: number): number {\n\treturn clampWithWarn(marginPts, PARA_MARGIN)\n}\n\n/**\n * Clamp a first-line indent (points) into ST_TextIndent (-4032..4032pt); returns EMU for\n * `a:pPr/@indent`. Unlike the margin this one is signed: a negative indent is the hanging\n * indent every bulleted paragraph uses.\n */\nexport function clampParaIndentEmu(indentPts: number): number {\n\treturn clampWithWarn(indentPts, PARA_INDENT)\n}\n\n/** Clamp line spacing (points) into ST_TextSpacingPoint (0..1584pt); returns hundredths for `<a:spcPts val>`. */\nexport function clampLineSpacingPts(lineSpacingPts: number): number {\n\treturn clampWithWarn(lineSpacingPts, LINE_SPACING)\n}\n","/**\n * ts-pptx: DrawingML native equations (OMML)\n *\n * Wrap raw OMML markup into the `<a14:m>` marker PowerPoint uses for editable\n * equations — as a standalone display paragraph (`genXmlMathParagraph`) or as an\n * inline run that flows between the surrounding `<a:r>` runs (`genXmlInlineMath`).\n */\n\nimport { el, raw, voidEl } from '../oxml/el.js'\n\nconst M_NS = 'http://schemas.openxmlformats.org/officeDocument/2006/math'\nconst A14_NS = 'http://schemas.microsoft.com/office/drawing/2010/main'\n\n/** The `<a14:m>` marker, carrying both namespace declarations so the supplied OMML needs none. */\nfunction a14Math(mathXml: string): string {\n\treturn el('a14:m', { 'xmlns:a14': A14_NS, 'xmlns:m': M_NS }, raw(mathXml))\n}\n\n/**\n * Build a native-equation paragraph (`<a:p>`) from raw OMML.\n *\n * PowerPoint stores an editable equation inside a text body as an `<a14:m>` marker wrapping\n * `<m:oMathPara><m:oMath>…`. We declare both the `a14` (drawing-2010) and `m` (math) namespaces\n * on the `<a14:m>` element so the supplied OMML needs no namespace declarations of its own, then\n * accept three input shapes: a full `<m:oMathPara>`, a full `<m:oMath>`, or the inner OMML\n * (children of `<m:oMath>`). A trailing `<a:endParaRPr>` matches what PowerPoint authors.\n *\n * @param {string} omml - raw OMML markup for the equation\n * @returns {string} an `<a:p>` math paragraph\n */\nexport function genXmlMathParagraph(omml: string): string {\n\tconst trimmed = (omml || '').trim()\n\tconst paraPr = el('m:oMathParaPr', null, raw(voidEl('m:jc', { 'm:val': 'centerGroup' })))\n\tconst mathXml = trimmed.startsWith('<m:oMathPara')\n\t\t? trimmed\n\t\t: trimmed.includes('<m:oMath')\n\t\t\t? el('m:oMathPara', null, [paraPr, trimmed].map(raw))\n\t\t\t: el('m:oMathPara', null, [paraPr, el('m:oMath', null, raw(trimmed))].map(raw))\n\treturn el('a:p', null, [a14Math(mathXml), voidEl('a:endParaRPr', { lang: 'en-US' })].map(raw))\n}\n\n/**\n * Build an INLINE native-equation run (dn-inline-math) from raw OMML.\n *\n * Unlike the display form ({@link genXmlMathParagraph}), an inline equation is *not* its own\n * paragraph: PowerPoint authors an `<a14:m>` marker wrapping a bare `<m:oMath>` (no `<m:oMathPara>`,\n * no `<m:oMathParaPr>`/`<m:jc>`) that flows between the surrounding `<a:r>` runs in one `<a:p>` —\n * pinned by the `math-omml-inline.pptx` oracle. The `mc:AlternateContent` envelope stays at the\n * shape level (see `objectHasMath`), so nothing wraps the run itself. We declare the `a14` and `m`\n * namespaces on the `<a14:m>` element so the supplied OMML needs none of its own, and accept the\n * same three input shapes as the display helper: a full `<m:oMathPara>` (its inner `<m:oMath>` is\n * unwrapped, since a paragraph block cannot flow inline), a full `<m:oMath>`, or the inner OMML.\n *\n * @param {string} omml - raw OMML markup for the equation\n * @returns {string} an `<a14:m>` inline equation run\n */\nexport function genXmlInlineMath(omml: string): string {\n\tconst trimmed = (omml || '').trim()\n\t// Extract a bare <m:oMath>…</m:oMath> — this both strips a display <m:oMathPara> wrapper and\n\t// leaves an already-bare <m:oMath> untouched; inner-only OMML is wrapped in <m:oMath>.\n\tconst oMathMatch = trimmed.match(/<m:oMath[\\s>][\\s\\S]*<\\/m:oMath>/)\n\treturn a14Math(oMathMatch ? oMathMatch[0] : el('m:oMath', null, raw(trimmed)))\n}\n","/**\n * ts-pptx: DrawingML text runs & paragraphs\n *\n * The run/paragraph half of text-body generation: paragraph properties\n * (`<a:pPr>`, bullets, spacing), run properties (`<a:rPr>`), the `<a:r>` run\n * builder, the shrink-autofit helper, and the grouping/rendering of a flat run\n * list into `<a:p>` paragraphs. The `text-body.ts` container layer builds on top.\n */\n\nimport { BulletType, SlideObjectType } from '../../enums.js'\nimport { DEF_BULLET_MARGIN, DEF_TEXT_GLOW, DEF_TEXT_SHADOW } from '../../constants-internal.js'\nimport type { ObjectOptions, TableCell, TextFitShrinkProps, TextProps, TextPropsOptions } from '../../types/index.js'\nimport type { SlideObject } from '../../types/internal.js'\nimport { createColorElement } from './color.js'\nimport { createGlowElement, createShadowElement } from './effect.js'\nimport { genXmlColorSelection } from './fill.js'\nimport { inch2Emu, lineWidthToEmu, ptsToEmuLenient } from '../../units-internal.js'\nimport { FIXED_PCT_PER_PERCENT, PERCENT_SCALE, ptToHundredths } from '../../units.js'\nimport { warn } from '../../diagnostics.js'\nimport { el, raw, voidEl, type XmlAttrs } from '../oxml/el.js'\nimport {\n\tclampCharSpacingSpc,\n\tclampFontSizeSz,\n\tclampLineSpacingPts,\n\tclampParaIndentEmu,\n\tclampParaMarginEmu,\n} from './clamp.js'\nimport { genXmlInlineMath, genXmlMathParagraph } from './math.js'\nimport { InvalidOptionError } from '../../errors.js'\n\n/** The 2018 hyperlink-color extension namespace, written on the `<ahyp:hlinkClr>` element itself. */\nconst AHYP_NS = 'http://schemas.microsoft.com/office/drawing/2018/hyperlinkcolor'\n\n/**\n * `<a:buChar>` cannot go through the element builder. Its `char` attribute carries a *pre-escaped*\n * numeric character reference (`•` — see `BulletType`), and the builder escapes every\n * attribute value, which would emit `&#x2022;` and render that text literally as the bullet.\n * There is no raw-attribute escape hatch, so this one stays a template.\n */\nfunction buChar(char: string): string {\n\treturn `<a:buChar char=\"${char}\"/>`\n}\n\n/**\n * `<a:extLst>` marking a hyperlink whose color should follow the text color rather than the\n * theme's hyperlink color. The leading spaces are byte-significant: this block was authored as\n * indented string concatenation and that indentation reaches the file, so it is described here\n * with `openPrefix`/`closePrefix` rather than being tidied away.\n */\nconst HLINK_TEXT_COLOR_EXT = el(\n\t'a:extLst',\n\tnull,\n\traw(\n\t\tel(\n\t\t\t'a:ext',\n\t\t\t{ uri: '{A12FA001-AC4F-418D-AE19-62706E023703}' },\n\t\t\traw(voidEl('ahyp:hlinkClr', { 'xmlns:ahyp': AHYP_NS, val: 'tx' }, { openPrefix: ' ' })),\n\t\t\t{ openPrefix: ' ', closePrefix: ' ' }\n\t\t)\n\t),\n\t{ openPrefix: ' ', closePrefix: ' ' }\n)\n\n/**\n * Whether a `bullet` value makes the paragraph DRAW a bullet (a glyph, a number or a picture).\n *\n * Two call sites downstream of the emitter act on \"this paragraph has a bullet\" rather than on\n * \"this paragraph says something about its bullet\", and both were plain truthiness tests until\n * `'inherit'` — a truthy string that draws nothing — joined the union. Left as truthiness they\n * would have broken the line grouping (every run starting its own paragraph) and eaten a real\n * leading `•` from text that emits no `a:buChar` to duplicate it.\n * @param {TextPropsOptions['bullet']} bullet - the option value\n * @return {boolean} true when bullet markup is emitted\n */\nfunction emitsBulletMarkup(bullet: TextPropsOptions['bullet']): boolean {\n\treturn !!bullet && bullet !== 'inherit'\n}\n\n/**\n * One paragraph margin attribute's value in EMU, or `null` when the attribute is not written.\n *\n * Three inputs, because the option has three states and so does the attribute: an explicit\n * number is clamped and written, `'inherit'` writes nothing, and an absent option falls back to\n * whatever the `bullet` arm decided — which is also `null` for `bullet: 'inherit'`, the one arm\n * that states nothing on its own.\n * @param {number|'inherit'|undefined} option - `paraMarginLeft` / `paraIndent` as given\n * @param {number|null} fallbackEmu - the bullet arm's default, `null` for no attribute\n * @param {Function} clamp - the attribute's ST_* range clamp (points in, EMU out)\n * @return {number|null} the EMU value to write, or null to omit the attribute\n */\nfunction resolveParagraphMargin(\n\toption: number | 'inherit' | undefined,\n\tfallbackEmu: number | null,\n\tclamp: (points: number) => number\n): number | null {\n\tif (option === undefined) return fallbackEmu\n\tif (option === 'inherit') return null\n\treturn clamp(option)\n}\n\n/**\n * Generate XML Paragraph Properties\n * @param {SlideObject|TextProps} textObj - text object\n * @param {boolean} isDefault - array of default relations\n * @return {string} XML\n */\nexport function genXmlParagraphProperties(textObj: SlideObject | TextProps, isDefault: boolean): string {\n\t// `options` is always present on text objects reaching here; narrow it once (both union\n\t// members have all-optional props, so an empty object is a valid fallback).\n\tconst opts: NonNullable<typeof textObj.options> = textObj.options ?? {}\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 = ptsToEmuLenient(DEF_BULLET_MARGIN)\n\t// The paragraph's own margins (`a:pPr/@marL` and `@indent`, in EMU). Each `bullet` arm below\n\t// records the default it has always written and `paraMarginLeft`/`paraIndent` override it;\n\t// `null` means the attribute is not written at all, which is what leaves the margin to the\n\t// `a:lstStyle` -> placeholder -> layout -> master chain. They are resolved and appended once,\n\t// after the chain, rather than by each arm — the arms decide a default, not the output.\n\tlet defaultMarL: number | null = null\n\tlet defaultIndent: number | null = null\n\t// The no-bullet arm writes `indent` before `marL`; every other arm writes `marL` first.\n\t// Attribute order carries no meaning to a reader, but it is byte-significant and the demo\n\t// decks are pinned byte-for-byte, so each arm keeps the order it has always emitted.\n\tlet indentBeforeMarL = false\n\n\t// NOTE: this open tag is deliberately NOT built with `openTag`/`el`. When `rtlMode` is set the\n\t// historical template emits `rtl=\"1\" ` with a TRAILING space while every attribute appended\n\t// below contributes a LEADING one, so `rtl` + `algn` produces a DOUBLE space between them.\n\t// `openTag` joins attributes with exactly one space, so that layout is not expressible — and\n\t// the demo deck contains no RTL text (zero `rtl=\"1\"` parts), so the byte gate could not catch\n\t// the change. Left as-is; the children below are built with the element builder.\n\tlet paragraphPropXml = `<${tag}${opts.rtlMode ? ' rtl=\"1\" ' : ''}`\n\n\t// A: Build paragraphProperties\n\t{\n\t\t// OPTION: align\n\t\tif (opts.align) {\n\t\t\tswitch (opts.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 (opts.lineSpacing) {\n\t\t\tstrXmlLnSpc = el('a:lnSpc', null, raw(voidEl('a:spcPts', { val: clampLineSpacingPts(opts.lineSpacing) })))\n\t\t} else if (opts.lineSpacingMultiple) {\n\t\t\tconst val = Math.round(opts.lineSpacingMultiple * PERCENT_SCALE)\n\t\t\tstrXmlLnSpc = el('a:lnSpc', null, raw(voidEl('a:spcPct', { val })))\n\t\t}\n\n\t\t// OPTION: indent\n\t\tif (opts.indentLevel && !isNaN(Number(opts.indentLevel)) && opts.indentLevel > 0) {\n\t\t\tparagraphPropXml += ` lvl=\"${opts.indentLevel}\"`\n\t\t}\n\n\t\t// OPTION: Paragraph Spacing: Before/After\n\t\tif (opts.paraSpaceBefore && !isNaN(Number(opts.paraSpaceBefore)) && opts.paraSpaceBefore > 0) {\n\t\t\tstrXmlParaSpc += el('a:spcBef', null, raw(voidEl('a:spcPts', { val: ptToHundredths(opts.paraSpaceBefore) })))\n\t\t}\n\t\tif (opts.paraSpaceAfter && !isNaN(Number(opts.paraSpaceAfter)) && opts.paraSpaceAfter > 0) {\n\t\t\tstrXmlParaSpc += el('a:spcAft', null, raw(voidEl('a:spcPts', { val: ptToHundredths(opts.paraSpaceAfter) })))\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 opts.bullet === 'object') {\n\t\t\tconst bulletImage = opts.bullet.image\n\t\t\tconst isPictureBullet = !!(bulletImage && (bulletImage.path || bulletImage.data))\n\t\t\tif (opts.bullet?.indent) bulletMarL = ptsToEmuLenient(opts.bullet.indent)\n\t\t\t// Every bullet form hangs the first line by the same margin, whichever glyph it draws.\n\t\t\tdefaultMarL = opts.indentLevel && opts.indentLevel > 0 ? bulletMarL + bulletMarL * opts.indentLevel : bulletMarL\n\t\t\tdefaultIndent = -bulletMarL\n\t\t\t// `buClr` colors a glyph/number; it has no effect on a picture bullet, so skip it for `buBlip`.\n\t\t\tif (opts.bullet.color && !isPictureBullet)\n\t\t\t\tstrXmlBulletColor = el('a:buClr', null, raw(createColorElement(opts.bullet.color)))\n\n\t\t\t// `<a:buSzPct/>` val is thousandths of a percent; ST_TextBulletSizePercent allows 25%-400%.\n\t\t\t//\n\t\t\t// Emitted ONLY when the caller asked for a size. It used to be unconditional, pinned\n\t\t\t// to 100% when unset, and that is not the same thing as leaving it out: an explicit\n\t\t\t// `<a:buSzPct val=\"100000\"/>` *overrides* whatever bullet size the layout's or\n\t\t\t// master's list style sets, so every bullet this path wrote silently forced its glyph\n\t\t\t// back to full size. The same class of bug as the explicit `a:buNone` an omitted\n\t\t\t// `bullet` emits — and invisible until `Paragraph.bulletDetail` gave the round-trip\n\t\t\t// check something to see it with, which reported the added 100% on every bulleted\n\t\t\t// fixture.\n\t\t\tlet bulletSizePct: number | undefined\n\t\t\tif (opts.bullet.size !== undefined) {\n\t\t\t\tconst bulletSize = Number(opts.bullet.size)\n\t\t\t\t// 25–400% is the range PowerPoint's bullet-size dialog accepts (and the\n\t\t\t\t// range `<a:buSzPct>` renders sensibly); values outside it are rejected\n\t\t\t\t// rather than clamped so the caller notices the bad input.\n\t\t\t\tif (isNaN(bulletSize) || bulletSize < 25 || bulletSize > 400) {\n\t\t\t\t\twarn('bullet/size-out-of-range', '`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 * FIXED_PCT_PER_PERCENT)\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst strXmlBulletSize = bulletSizePct === undefined ? '' : voidEl('a:buSzPct', { val: bulletSizePct })\n\t\t\t// NOTE: the builder escapes `typeface`, so the manual `encodeXmlEntities` that used to\n\t\t\t// wrap it here is gone — keeping both would double-escape (`&` -> `&amp;`).\n\t\t\tconst strXmlBulletFont = opts.bullet.fontFace ? voidEl('a:buFont', { typeface: opts.bullet.fontFace }) : ''\n\n\t\t\tif (isPictureBullet) {\n\t\t\t\t// Picture bullet: <a:buBlip> references a slide media rel registered in addText() (`_rId`).\n\t\t\t\t// No `buFont` (there is no glyph typeface), but `buSzPct` still scales the image height.\n\t\t\t\tif (opts.bullet._rId) {\n\t\t\t\t\t// SVG bullet: the blip embeds the PNG preview (`_rId`) and references the SVG via the\n\t\t\t\t\t// `asvg:svgBlip` extension (`_rIdSvg`), the same dual-rel form addImage() emits for SVG.\n\t\t\t\t\tconst svgExt = opts.bullet._rIdSvg\n\t\t\t\t\t\t? el(\n\t\t\t\t\t\t\t\t'a:extLst',\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\t\tel(\n\t\t\t\t\t\t\t\t\t\t'a:ext',\n\t\t\t\t\t\t\t\t\t\t{ uri: '{96DAC541-7B7A-43D3-8B79-37D633B846F1}' },\n\t\t\t\t\t\t\t\t\t\traw(\n\t\t\t\t\t\t\t\t\t\t\tvoidEl('asvg:svgBlip', {\n\t\t\t\t\t\t\t\t\t\t\t\t'xmlns:asvg': 'http://schemas.microsoft.com/office/drawing/2016/SVG/main',\n\t\t\t\t\t\t\t\t\t\t\t\t'r:embed': `rId${opts.bullet._rIdSvg}`,\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: ''\n\t\t\t\t\tconst blip = svgExt\n\t\t\t\t\t\t? el('a:blip', { 'r:embed': `rId${opts.bullet._rId}` }, raw(svgExt))\n\t\t\t\t\t\t: voidEl('a:blip', { 'r:embed': `rId${opts.bullet._rId}` })\n\t\t\t\t\tstrXmlBullet = strXmlBulletSize + el('a:buBlip', null, raw(blip))\n\t\t\t\t} else {\n\t\t\t\t\t// rel was not registered (eg: bullet on a context without a slide target) - fall back to a glyph\n\t\t\t\t\twarn(\n\t\t\t\t\t\t'bullet/image-embed-failed',\n\t\t\t\t\t\t'picture `bullet.image` could not be embedded; using a default bullet glyph'\n\t\t\t\t\t)\n\t\t\t\t\tstrXmlBullet = strXmlBulletSize + strXmlBulletFont + buChar(BulletType.DEFAULT)\n\t\t\t\t}\n\t\t\t} else if (opts.bullet.type && opts.bullet.type.toString().toLowerCase() === 'number') {\n\t\t\t\tstrXmlBullet =\n\t\t\t\t\tstrXmlBulletSize +\n\t\t\t\t\t(strXmlBulletFont || voidEl('a:buFont', { typeface: '+mj-lt' })) +\n\t\t\t\t\tvoidEl('a:buAutoNum', {\n\t\t\t\t\t\ttype: opts.bullet.numberType || 'arabicPeriod',\n\t\t\t\t\t\tstartAt: opts.bullet.numberStartAt || '1',\n\t\t\t\t\t})\n\t\t\t} else if (opts.bullet.characterCode) {\n\t\t\t\tlet bulletCode = `&#x${opts.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(opts.bullet.characterCode)) {\n\t\t\t\t\twarn(\n\t\t\t\t\t\t'bullet/invalid-character-code',\n\t\t\t\t\t\t'`bullet.characterCode` should be a 4-digit unicode character (ex: 22AB)!'\n\t\t\t\t\t)\n\t\t\t\t\tbulletCode = BulletType.DEFAULT\n\t\t\t\t}\n\n\t\t\t\tstrXmlBullet = strXmlBulletSize + strXmlBulletFont + buChar(bulletCode)\n\t\t\t} else {\n\t\t\t\tstrXmlBullet = strXmlBulletSize + strXmlBulletFont + buChar(BulletType.DEFAULT)\n\t\t\t}\n\t\t} else if (opts.bullet === 'inherit') {\n\t\t\t// The paragraph states NOTHING about its bullet: no `a:buChar`/`a:buAutoNum`, no\n\t\t\t// `a:buNone`, and none of the margin attributes the other arms write. Bullet\n\t\t\t// properties resolve down the `a:lstStyle` -> placeholder -> layout -> master chain,\n\t\t\t// so silence is what lets the list style keep reaching this paragraph — `a:buNone`\n\t\t\t// *overrides* it, which is a different fact even where the inherited style has no\n\t\t\t// bullet, because a later edit to the master then stops arriving.\n\t\t\t//\n\t\t\t// Omission cannot mean this: it has meant `a:buNone` since the writer existed and\n\t\t\t// every deck authored against it depends on that. Same resolution as `fill: { type:\n\t\t\t// 'inherit' }` (#10) — name the state that had no name, leave the one that has.\n\t\t} else if (opts.bullet) {\n\t\t\tdefaultMarL = opts.indentLevel && opts.indentLevel > 0 ? bulletMarL + bulletMarL * opts.indentLevel : bulletMarL\n\t\t\tdefaultIndent = -bulletMarL\n\t\t\t// No `a:buSzPct` here either — `bullet: true` asks for a bullet, not for one pinned\n\t\t\t// to 100% of the body size in defiance of the master's list style. Same reasoning as\n\t\t\t// the `a:buNone` note just below, and it keeps `bullet: true` byte-identical to\n\t\t\t// `bullet: { type: 'bullet' }`, which the object branch above now also leaves out.\n\t\t\tstrXmlBullet = buChar(BulletType.DEFAULT)\n\t\t} else if (!opts.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\t// FIX: specify zero indent and marL or default will be hanging paragraph\n\t\t\tdefaultMarL = 0\n\t\t\tdefaultIndent = 0\n\t\t\tindentBeforeMarL = true\n\t\t\tstrXmlBullet = voidEl('a:buNone')\n\t\t}\n\n\t\t// OPTION: paraMarginLeft / paraIndent\n\t\t// The paragraph's own `@marL`/`@indent`, which until now only the `bullet` arms decided.\n\t\t// That conflated two facts on one element: `bullet: false` could not suppress a bullet\n\t\t// without ALSO flattening an inherited hanging indent to zero, and no state could set a\n\t\t// margin without drawing a bullet. An explicit value wins over the arm's default in every\n\t\t// state, and `'inherit'` takes the attribute out entirely — the third state omission\n\t\t// cannot spell here either, since omission is what writes the default.\n\t\tconst marLEmu = resolveParagraphMargin(opts.paraMarginLeft, defaultMarL, clampParaMarginEmu)\n\t\tconst indentEmu = resolveParagraphMargin(opts.paraIndent, defaultIndent, clampParaIndentEmu)\n\t\tconst marLAttr = marLEmu === null ? '' : ` marL=\"${marLEmu}\"`\n\t\tconst indentAttr = indentEmu === null ? '' : ` indent=\"${indentEmu}\"`\n\t\tparagraphPropXml += indentBeforeMarL ? indentAttr + marLAttr : marLAttr + indentAttr\n\n\t\t// OPTION: tabStops\n\t\tif (opts.tabStops && Array.isArray(opts.tabStops)) {\n\t\t\tconst tabStopsXml = opts.tabStops\n\t\t\t\t.map((stop) => voidEl('a:tab', { pos: inch2Emu(stop.position || 1), algn: stop.alignment || 'l' }))\n\t\t\t\t.join('')\n\t\t\tstrXmlTabStops = el('a:tabLst', null, raw(tabStopsXml))\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(opts, 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 */\nexport function 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\tconst underline =\n\t\ttypeof opts.underline === 'object' && opts.underline?.style ? opts.underline.style : opts.hyperlink ? 'sng' : null\n\tconst baseline = opts.baseline\n\t\t? Math.round(opts.baseline * 50)\n\t\t: opts.subscript\n\t\t\t? -40000\n\t\t\t: opts.superscript\n\t\t\t\t? 30000\n\t\t\t\t: null\n\t// NOTE: attribute ORDER is byte-significant. Listing every attribute in emission order (null =\n\t// omitted) makes that order reviewable, where the old `+=` chain buried it in control flow.\n\tconst attrs: XmlAttrs = {\n\t\tlang: opts.lang ? opts.lang : 'en-US',\n\t\taltLang: opts.lang ? 'en-US' : null,\n\t\t// NOTE: clamp+round so sizes like '7.5' or out-of-range values wont cause corrupt presentations\n\t\tsz: opts.fontSize ? clampFontSizeSz(opts.fontSize) : null,\n\t\t// NOTE: `b`/`i` were written as `opts.bold ? '1' : '0'` inside a truthiness guard, so the\n\t\t// \"0\" arm was unreachable — the emitted value is always \"1\".\n\t\tb: opts?.bold ? '1' : null,\n\t\ti: opts?.italic ? '1' : null,\n\t\tstrike: opts?.strike ? (typeof opts.strike === 'string' ? opts.strike : 'sngStrike') : null,\n\t\tcap: opts?.caps ? opts.caps : null,\n\t\tu: underline,\n\t\tbaseline,\n\t\tspc: opts.charSpacing ? clampCharSpacingSpc(opts.charSpacing) : null,\n\t\tkern: opts.charSpacing ? 0 : null, // IMPORTANT: Also disable kerning; otherwise text won't actually expand\n\t\tdirty: '0',\n\t}\n\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 (\n\t\topts.color ||\n\t\topts.fontFace ||\n\t\topts.outline ||\n\t\topts.glow ||\n\t\thasShadow ||\n\t\t(typeof opts.underline === 'object' && opts.underline.color)\n\t) {\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 += el(\n\t\t\t\t'a:ln',\n\t\t\t\t{ w: lineWidthToEmu(opts.outline.size || 0.75) },\n\t\t\t\traw(genXmlColorSelection(opts.outline.color || 'FFFFFF'))\n\t\t\t)\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 += el('a:effectLst', null, [\n\t\t\t\topts.glow ? raw(createGlowElement(opts.glow, DEF_TEXT_GLOW)) : null,\n\t\t\t\thasShadow ? raw(createShadowElement(opts.shadow, DEF_TEXT_SHADOW)) : null,\n\t\t\t])\n\t\t}\n\t\tif (opts.highlight) runProps += el('a:highlight', null, raw(createColorElement(opts.highlight)))\n\t\tif (typeof opts.underline === 'object' && opts.underline.color)\n\t\t\trunProps += el('a:uFill', null, raw(genXmlColorSelection(opts.underline.color)))\n\t\tif (opts.fontFace) {\n\t\t\t// Match how PowerPoint writes a font picked from the UI: the chosen typeface goes in the\n\t\t\t// Latin (`<a:latin>`) and complex-script (`<a:cs>`) slots. The East Asian slot (`<a:ea>`) is\n\t\t\t// only written when an EA face is explicitly chosen (`fontFaceEA`); otherwise it inherits the\n\t\t\t// theme. Forcing a Latin-only font into `<a:ea>` — especially with the bogus charset values\n\t\t\t// PowerPoint never emits on ea/cs — duplicates/ghosts text in Office 365.\n\t\t\t// NOTE: order must be latin, ea, cs per CT_TextCharacterProperties.\n\t\t\t// `fontFace`/`fontFaceEA` are caller-supplied and unsanitized upstream, so they are escaped:\n\t\t\t// an unescaped `\"` or `&` in a font name closes the attribute early and emits a\n\t\t\t// non-parseable slide part, which PowerPoint reports as a file needing repair. The builder\n\t\t\t// does that escaping now, so the manual `encodeXmlEntities` calls are gone (keeping both\n\t\t\t// would double-escape).\n\t\t\trunProps += voidEl('a:latin', { typeface: opts.fontFace, pitchFamily: '34', charset: '0' })\n\t\t\tif (opts.fontFaceEA) runProps += voidEl('a:ea', { typeface: opts.fontFaceEA })\n\t\t\trunProps += voidEl('a:cs', { typeface: opts.fontFace })\n\t\t}\n\t}\n\n\t// Hyperlink support\n\tif (opts.hyperlink) {\n\t\tif (typeof opts.hyperlink !== 'object')\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'hyperlink/not-an-object',\n\t\t\t\t\"text `hyperlink` option should be an object. Ex: `hyperlink:{url:'https://github.com'}` \"\n\t\t\t)\n\t\telse if (!opts.hyperlink.url && !opts.hyperlink.slide && !opts.hyperlink.action)\n\t\t\tthrow new InvalidOptionError(\n\t\t\t\t'hyperlink/missing-target',\n\t\t\t\t'text `hyperlink` requires either `url`, `slide`, or `action`'\n\t\t\t)\n\t\t// An action-only hyperlink (an action-button navigation) lives on the shape's `<p:cNvPr>`\n\t\t// (see `cNvPrHyperlink`), NOT on the text run — a labeled action button emits no run-level\n\t\t// `<a:hlinkClick>`.\n\t\telse if (opts.hyperlink.url || opts.hyperlink.slide) {\n\t\t\t// runProps += '<a:uFill>'+ genXmlColorSelection('0000FF') +'</a:uFill>'; // Breaks PPT2010!\n\t\t\t// NOTE: `tooltip` is escaped by the builder now (the manual `encodeXmlEntities` is gone), and\n\t\t\t// it is written even when absent — an empty `tooltip=\"\"` is part of today's bytes.\n\t\t\tconst linkAttrs: XmlAttrs = opts.hyperlink.url\n\t\t\t\t? {\n\t\t\t\t\t\t'r:id': `rId${opts.hyperlink._rId}`,\n\t\t\t\t\t\tinvalidUrl: '',\n\t\t\t\t\t\taction: '',\n\t\t\t\t\t\ttgtFrame: '',\n\t\t\t\t\t\ttooltip: opts.hyperlink.tooltip ?? '',\n\t\t\t\t\t\thistory: '1',\n\t\t\t\t\t\thighlightClick: '0',\n\t\t\t\t\t\tendSnd: '0',\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\t'r:id': `rId${opts.hyperlink._rId}`,\n\t\t\t\t\t\taction: 'ppaction://hlinksldjump',\n\t\t\t\t\t\ttooltip: opts.hyperlink.tooltip ?? '',\n\t\t\t\t\t}\n\t\t\t// An explicit text color means the link must carry the \"follow text color\" extension, so\n\t\t\t// the element becomes paired; otherwise it self-closes.\n\t\t\trunProps += opts.color\n\t\t\t\t? el('a:hlinkClick', linkAttrs, raw(HLINK_TEXT_COLOR_EXT))\n\t\t\t\t: voidEl('a:hlinkClick', linkAttrs)\n\t\t}\n\t}\n\n\t// END runProperties\n\treturn el(runPropsTag, attrs, raw(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 */\nexport function 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\t// `<a:t>` takes a TEXT child, so the builder escapes it — same `encodeXmlEntities` this used to call.\n\treturn el('a:r', null, [\n\t\traw(genXmlTextRunProperties(textObj.options ?? {}, false)),\n\t\traw(el('a:t', null, String(textObj.text))),\n\t])\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 */\nexport function genXmlNormAutofit(fit: TextFitShrinkProps): string {\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\twarn(\n\t\t\t\t'text/invalid-fit-percentage',\n\t\t\t\t`fit.${name} must be a number between 0 and 100 (percent); received ${String(val)} - attribute ignored.`\n\t\t\t)\n\t\t\treturn null\n\t\t}\n\t\treturn Math.round(val * FIXED_PCT_PER_PERCENT)\n\t}\n\n\t// `pct` returns null for an absent/rejected value, and the builder omits null attributes.\n\treturn voidEl('a:normAutofit', {\n\t\tfontScale: pct(fit.fontScale, 'fontScale'),\n\t\tlnSpcReduction: pct(fit.lnSpcReduction, 'lnSpcReduction'),\n\t})\n}\n\n// A run of formatted text within a paragraph. Every run reaching STEP 5/6 of genXmlTextBody\n// carries an `options` bag (assigned in STEP 4), so model it as required.\nexport type RunProps = TextProps & { options: TextPropsOptions }\n\n/**\n * Group the flat run list into paragraphs (lines): a new line starts on a display-math run,\n * an alignment change, or a bullet, and closes after a breakLine. Returns the per-line run arrays.\n */\nexport function groupRunsIntoLines(arrTextObjects: RunProps[], opts: ObjectOptions): RunProps[][] {\n\tconst arrLines: RunProps[][] = []\n\tlet arrTexts: RunProps[] = []\n\tarrTextObjects.forEach((textObj, idx) => {\n\t\t// A0: A DISPLAY math equation is its own paragraph — flush any pending runs and\n\t\t// give it its own line so STEP 6 emits the <a14:m><m:oMathPara> wrapper instead of text runs.\n\t\t// Inline math (dn-inline-math) flows mid-paragraph, so it falls through to the run-buffering\n\t\t// path below and STEP 6 emits a bare <a14:m><m:oMath> run alongside the plain text runs.\n\t\tif (textObj.math && !textObj.inline) {\n\t\t\tif (arrTexts.length > 0) {\n\t\t\t\tarrLines.push(arrTexts)\n\t\t\t\tarrTexts = []\n\t\t\t}\n\t\t\tarrLines.push([textObj])\n\t\t\treturn\n\t\t}\n\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 && emitsBulletMarkup(textObj.options.bullet)) {\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\treturn arrLines\n}\n\n/**\n * Render each grouped line to an `<a:p>` paragraph: paragraph props, inherited run options,\n * text runs (and inline/display math), and the closing endParaRPr.\n */\nexport function renderTextParagraphsXml(\n\tarrLines: RunProps[][],\n\tslideObj: SlideObject | TableCell,\n\topts: ObjectOptions\n): string {\n\tlet strSlideXml = ''\n\tarrLines.forEach((line) => {\n\t\t// A DISPLAY equation owns its whole paragraph: emit the oMathPara wrapper and skip runs.\n\t\t// An inline equation (even when it is the line's only run) flows as a run and is emitted below.\n\t\tconst firstRun = line[0]\n\t\tif (line.length === 1 && firstRun?.math && !firstRun.inline) {\n\t\t\tstrSlideXml += genXmlMathParagraph(firstRun.math)\n\t\t\treturn\n\t\t}\n\n\t\tlet reqsClosingFontSize = false\n\n\t\t// A: Accumulate the paragraph's children; the `<a:p>` wrapper closes over them at the end.\n\t\tlet paraXml = ''\n\t\t// NOTE: the `<a:pPr ${rtlMode ? ' rtl=\"1\" ' : ''}` seed that used to sit here was dead —\n\t\t// `genXmlParagraphProperties` builds its own open tag (with the same `rtlMode` check) and\n\t\t// overwrote this on the first run, and nothing read it in between.\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\tparaXml += voidEl('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\t\t\t// `??`, not `||`, on these two: `0` is a meaningful margin (flush with the frame, and\n\t\t\t// the override that suppresses a bullet's hanging indent), where the options above have\n\t\t\t// no zero worth stating. A falsy test would silently swap a run's explicit `0` for the\n\t\t\t// shape's value.\n\t\t\ttextObj.options.paraMarginLeft = textObj.options.paraMarginLeft ?? opts.paraMarginLeft\n\t\t\ttextObj.options.paraIndent = textObj.options.paraIndent ?? opts.paraIndent\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// The paragraph's properties are the FIRST run's, decided once: this used to retry on\n\t\t\t// each subsequent run until one produced non-empty XML, which was unreachable while\n\t\t\t// every `bullet` state wrote something (an omitted one still emitted `marL=\"0\"\n\t\t\t// indent=\"0\"` + `a:buNone`) — and became wrong the moment `bullet: 'inherit'` made an\n\t\t\t// empty pPr possible. A retry would take its properties from a *continuation* run,\n\t\t\t// which by convention states no bullet, so the paragraph got back the very `a:buNone`\n\t\t\t// the first run asked to leave out — and got it appended AFTER that run's `<a:r>`,\n\t\t\t// where a `pPr` is not allowed.\n\t\t\tif (!paragraphPropEmitted) {\n\t\t\t\tparagraphPropEmitted = true\n\t\t\t\t// IMPORTANT: Empty \"pPr\" blocks will generate needs-repair/corrupt msg\n\t\t\t\tparaXml += genXmlParagraphProperties(textObj, false).replace('<a:pPr></a:pPr>', '')\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)\n\t\t\t\t.filter(([key]) => !(textObj.options.hyperlink && key === 'color'))\n\t\t\t\t.forEach(([key, val]) => {\n\t\t\t\t\t// NOTE: This loop will pick up unecessary keys (`x`, etc.), but it doesnt hurt anything\n\t\t\t\t\tif (key !== 'bullet' && !textOptions[key]) textOptions[key] = val\n\t\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 are unaffected, and so are `bullet:false`,\n\t\t\t// `bullet:'inherit'` and no-bullet — none of them emit a glyph to double.\n\t\t\tlet _textRunObj = textObj\n\t\t\tif (idx === 0 && emitsBulletMarkup(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\t// Drop empty-string runs that are pure paragraph-break artifacts. A segment that begins\n\t\t\t// with \"\\n\" (common when mixing RTL/LTR runs) splits into a leading empty piece; once the\n\t\t\t// paragraph break has been applied in STEP 5 that empty piece would otherwise emit a junk\n\t\t\t// `<a:r>...<a:t></a:t></a:r>` trailing the previous line. A *lone* empty run is the line\n\t\t\t// itself (an intentional blank paragraph, eg: \"line1\\n\\nline3\"), so keep it when it is the\n\t\t\t// only run on the line.\n\t\t\tconst isEmptyBreakArtifact = _textRunObj.text === '' && line.length > 1\n\t\t\tif (_textRunObj.math) {\n\t\t\t\t// Inline native equation (dn-inline-math): a bare <a14:m><m:oMath> run between plain runs.\n\t\t\t\tparaXml += genXmlInlineMath(_textRunObj.math)\n\t\t\t} else if (!isEmptyBreakArtifact) {\n\t\t\t\tparaXml += genXmlTextRun(_textRunObj)\n\t\t\t}\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: 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\t// `sz` rides along in the first two branches only: the last one omits it even when\n\t\t// `opts.fontSize` is set, which is why the attribute set is built per-branch.\n\t\tconst sizedAttrs = (): XmlAttrs => ({\n\t\t\tlang: opts.lang || 'en-US',\n\t\t\tsz: opts.fontSize ? clampFontSizeSz(opts.fontSize) : null,\n\t\t\tdirty: '0',\n\t\t})\n\t\tif (slideObj._type === SlideObjectType.tablecell && (opts.fontSize || opts.fontFace)) {\n\t\t\tif (opts.fontFace) {\n\t\t\t\t// Mirror genXmlTextRunProperties: Latin + complex-script slots carry the face; East Asian slot\n\t\t\t\t// inherits the theme unless `fontFaceEA` is set. Escaping is the builder's job now.\n\t\t\t\tparaXml += el('a:endParaRPr', sizedAttrs(), [\n\t\t\t\t\traw(voidEl('a:latin', { typeface: opts.fontFace, charset: '0' })),\n\t\t\t\t\topts.fontFaceEA ? raw(voidEl('a:ea', { typeface: opts.fontFaceEA })) : null,\n\t\t\t\t\traw(voidEl('a:cs', { typeface: opts.fontFace })),\n\t\t\t\t])\n\t\t\t} else {\n\t\t\t\tparaXml += voidEl('a:endParaRPr', sizedAttrs())\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\tparaXml += voidEl('a:endParaRPr', sizedAttrs())\n\t\t} else {\n\t\t\t// Added 20180101 to address PPT-2007 issues\n\t\t\tparaXml += voidEl('a:endParaRPr', { lang: opts.lang || 'en-US', dirty: '0' })\n\t\t}\n\n\t\t// D: End paragraph\n\t\tstrSlideXml += el('a:p', null, raw(paraXml))\n\t})\n\treturn strSlideXml\n}\n","/**\n * ts-pptx: shared `Relationship` writers.\n *\n * A `.rels` part is mostly one-off entries, written where the part that needs\n * them is built. This module holds the ones **more than one part** writes, so\n * that the attribute set stays a single fact — a `Relationship` whose `Type` and\n * `TargetMode` disagree between two writers does not throw, it produces a link\n * PowerPoint silently drops.\n */\n\nimport { voidEl } from '../oxml/el.js'\nimport { OFFICE_REL } from '../../ooxml/rel-types.js'\n\n/**\n * A `Relationship` to a URL outside the package: the shape of every external\n * hyperlink, whether it hangs off a slide (`gen/slide/object.ts`) or off a notes\n * slide (`gen/slide/notes.ts`). `TargetMode=\"External\"` is what makes the target\n * a URI rather than a partname, so it is not optional.\n * @param {number} rId - the relationship id, without its `rId` prefix\n * @param {string} target - the URL, already escaped for an attribute value\n * @returns {string} the `Relationship` element\n */\nexport function externalHyperlinkRel(rId: number, target: string): string {\n\treturn voidEl('Relationship', {\n\t\tId: `rId${rId}`,\n\t\tType: OFFICE_REL + 'hyperlink',\n\t\tTarget: target,\n\t\tTargetMode: 'External',\n\t})\n}\n","/**\n * ts-pptx: speaker-notes parts\n *\n * Everything for the notes side of a deck: reading a slide's notes text/runs,\n * building the notes-slide hyperlink rels, and emitting the notes-slide,\n * notes-master and their `.rels` parts.\n */\n\nimport { SlideObjectType } from '../../enums.js'\nimport { CRLF, SLDNUMFLDID, XML_DECL } from '../../constants-internal.js'\nimport type { TextProps } from '../../types/index.js'\nimport type { PresSlideInternal, SlideRel } from '../../types/internal.js'\nimport { warn } from '../../diagnostics.js'\nimport { genXmlTextRun } from '../drawingml/text-run.js'\nimport { el, raw, voidEl } from '../oxml/el.js'\nimport { OFFICE_REL, PACKAGE_REL_NS } from '../../ooxml/rel-types.js'\nimport { externalHyperlinkRel } from '../opc/rels.js'\nimport { PML_ROOT_NS } from '../../ooxml/namespaces.js'\nimport { DEFAULT_COLOR_MAP } from '../../ooxml/st-enums.js'\n\n/**\n * Collect the speaker-notes runs for a slide (flattened across any number of `addNotes()` calls).\n * @param {PresSlideInternal} slide - the slide object\n * @return {TextProps[]} notes text runs in document order\n */\nfunction getNotesRuns(slide: PresSlideInternal): TextProps[] {\n\tconst runs: TextProps[] = []\n\tslide._slideObjects.forEach((obj) => {\n\t\tif (obj._type === SlideObjectType.notes && obj.text) runs.push(...obj.text)\n\t})\n\treturn runs\n}\n\n/**\n * Build (and cache) the hyperlink relationships for a slide's notes part (`notesSlideN.xml.rels`).\n *\n * Notes rels use their own namespace, independent of `slide._rels` (which serialize to\n * `slideN.xml.rels`). The notes part always reserves rId1=notesMaster and rId2=slide, so\n * dynamic hyperlink rels are allocated starting at rId3. Each notes hyperlink run is tagged\n * with its `_rId` so the body serializer and the rels file agree.\n *\n * Idempotent: the result is cached on `slide._relsNotes` and reused by both callers.\n * Only external `url` hyperlinks are supported; `slide` targets are ignored with a warning.\n * @param {PresSlideInternal} slide - the slide object\n * @return {SlideRel[]} notes hyperlink relationships\n */\nexport function buildNotesSlideRels(slide: PresSlideInternal): SlideRel[] {\n\tif (slide._relsNotes) return slide._relsNotes\n\n\tconst NOTES_REL_RESERVED = 2 // rId1=notesMaster, rId2=slide\n\tconst rels: SlideRel[] = []\n\tlet lastRid = NOTES_REL_RESERVED\n\n\tgetNotesRuns(slide).forEach((run) => {\n\t\tconst hyperlink = run.options?.hyperlink\n\t\tif (!hyperlink) return\n\t\tif (!hyperlink.url) {\n\t\t\t// Notes support external `url` links only. Drop unsupported (e.g. `slide`) targets so the\n\t\t\t// run serializer doesn't emit a dangling <a:hlinkClick> with no matching relationship.\n\t\t\tif (hyperlink.slide)\n\t\t\t\twarn('notes/hyperlink-slide-unsupported', 'notes hyperlinks support `url` only (ignoring `slide` target)')\n\t\t\tif (run.options) delete run.options.hyperlink\n\t\t\treturn\n\t\t}\n\n\t\tlastRid++\n\t\thyperlink._rId = lastRid\n\t\trels.push({\n\t\t\ttype: SlideObjectType.hyperlink,\n\t\t\tdata: 'dummy',\n\t\t\trId: lastRid,\n\t\t\t// `Target` is stored RAW; every emitter escapes it. See the note on `SlideRel.Target`.\n\t\t\tTarget: hyperlink.url,\n\t\t})\n\t})\n\n\tslide._relsNotes = rels\n\treturn rels\n}\n\n/**\n * Build the `<p:txBody>` paragraphs for the notes placeholder.\n * Runs are split into `<a:p>` paragraphs on newlines; each run is serialized with the standard\n * text-run generator so inline formatting and `<a:hlinkClick>` markup are emitted consistently.\n * @param {PresSlideInternal} slide - the slide object\n * @return {string} XML string of `<a:p>` paragraphs\n */\nfunction genXmlNotesParagraphs(slide: PresSlideInternal): string {\n\tconst paragraphs: TextProps[][] = [[]]\n\n\tgetNotesRuns(slide).forEach((run) => {\n\t\tconst segments = String(run.text ?? '').split('\\n')\n\t\tsegments.forEach((segment, idx) => {\n\t\t\tif (idx > 0) paragraphs.push([]) // a newline starts a new paragraph\n\t\t\tconst text = segment.replace(/\\r/g, '')\n\t\t\tif (text !== '') paragraphs[paragraphs.length - 1]?.push({ text, options: run.options || {} })\n\t\t})\n\t})\n\n\treturn paragraphs\n\t\t.map((runs) =>\n\t\t\tel('a:p', null, [\n\t\t\t\traw(runs.map((run) => genXmlTextRun(run)).join('')),\n\t\t\t\traw(voidEl('a:endParaRPr', { lang: 'en-US', dirty: 0 })),\n\t\t\t])\n\t\t)\n\t\t.join('')\n}\n\n/**\n * The `p:spTree` wrapper a notes master and a notes slide both open with: the group's own\n * non-visual properties and an identity `a:xfrm`, followed by that part's placeholders.\n *\n * The two parts differ only in which placeholders they carry — the master has six (header, date,\n * thumbnail, body, footer, slide number), a notes slide has three — so everything around the\n * `children` argument was written out twice, `chOff`/`chExt` and all.\n * @param children - the placeholder shapes, already serialized, in document order\n */\nfunction notesSpTree(children: string[]): string {\n\treturn el('p:spTree', null, [\n\t\traw(\n\t\t\tel('p:nvGrpSpPr', null, [\n\t\t\t\traw(voidEl('p:cNvPr', { id: 1, name: '' })),\n\t\t\t\traw(voidEl('p:cNvGrpSpPr')),\n\t\t\t\traw(voidEl('p:nvPr')),\n\t\t\t])\n\t\t),\n\t\traw(\n\t\t\tel(\n\t\t\t\t'p:grpSpPr',\n\t\t\t\tnull,\n\t\t\t\traw(\n\t\t\t\t\tel('a:xfrm', null, [\n\t\t\t\t\t\traw(voidEl('a:off', { x: 0, y: 0 })),\n\t\t\t\t\t\traw(voidEl('a:ext', { cx: 0, cy: 0 })),\n\t\t\t\t\t\traw(voidEl('a:chOff', { x: 0, y: 0 })),\n\t\t\t\t\t\traw(voidEl('a:chExt', { cx: 0, cy: 0 })),\n\t\t\t\t\t])\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t\t...children.map((child) => raw(child)),\n\t])\n}\n\n/**\n * PowerPoint's creation-id extension, on the `p:cSld` of both notes parts.\n *\n * The value is a fixed literal, and that is the point of naming it: it looks like data — a\n * per-deck identifier PowerPoint would vary — so left inline in two places, someone eventually\n * changes one of them. It is deliberately constant, which is what keeps the two notes parts\n * byte-identical across builds.\n */\nconst NOTES_CREATION_ID = 1024086991\n\n/** The `p:extLst` carrying {@link NOTES_CREATION_ID}, identical on the notes master and notes slide. */\nfunction notesExtLst(): string {\n\treturn el(\n\t\t'p:extLst',\n\t\tnull,\n\t\traw(\n\t\t\tel(\n\t\t\t\t'p:ext',\n\t\t\t\t{ uri: '{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}' },\n\t\t\t\traw(\n\t\t\t\t\tvoidEl('p14:creationId', {\n\t\t\t\t\t\t'xmlns:p14': 'http://schemas.microsoft.com/office/powerpoint/2010/main',\n\t\t\t\t\t\tval: NOTES_CREATION_ID,\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t)\n}\n\n/**\n * Generate XML for Notes Master (notesMaster1.xml)\n * @returns {string} XML\n */\nexport function makeXmlNotesMaster(): string {\n\tconst xfrmOffExt = (x: number, y: number, cx: number, cy: number): string =>\n\t\tel('a:xfrm', null, [raw(voidEl('a:off', { x, y })), raw(voidEl('a:ext', { cx, cy }))])\n\tconst prstGeomRect = el('a:prstGeom', { prst: 'rect' }, raw(voidEl('a:avLst')))\n\tconst spLocks = (attrs: Record<string, number>): string => el('p:cNvSpPr', null, raw(voidEl('a:spLocks', attrs)))\n\tconst nvPr = (phAttrs: Record<string, string | number>): string => el('p:nvPr', null, raw(voidEl('p:ph', phAttrs)))\n\tconst bodyPr = (attrs: Record<string, string | number>): string => voidEl('a:bodyPr', attrs)\n\tconst lstStyleLvl1 = (algn: string): string =>\n\t\tel('a:lstStyle', null, raw(el('a:lvl1pPr', { algn }, raw(voidEl('a:defRPr', { sz: 1200 })))))\n\tconst emptyPara = el('a:p', null, raw(voidEl('a:endParaRPr', { lang: 'en-US' })))\n\n\tconst header = el('p:sp', null, [\n\t\traw(\n\t\t\tel('p:nvSpPr', null, [\n\t\t\t\traw(voidEl('p:cNvPr', { id: 2, name: 'Header Placeholder 1' })),\n\t\t\t\traw(spLocks({ noGrp: 1 })),\n\t\t\t\traw(nvPr({ type: 'hdr', sz: 'quarter' })),\n\t\t\t])\n\t\t),\n\t\traw(el('p:spPr', null, [raw(xfrmOffExt(0, 0, 2971800, 458788)), raw(prstGeomRect)])),\n\t\traw(\n\t\t\tel('p:txBody', null, [\n\t\t\t\traw(bodyPr({ vert: 'horz', lIns: 91440, tIns: 45720, rIns: 91440, bIns: 45720, rtlCol: 0 })),\n\t\t\t\traw(lstStyleLvl1('l')),\n\t\t\t\traw(emptyPara),\n\t\t\t])\n\t\t),\n\t])\n\n\tconst date = el('p:sp', null, [\n\t\traw(\n\t\t\tel('p:nvSpPr', null, [\n\t\t\t\traw(voidEl('p:cNvPr', { id: 3, name: 'Date Placeholder 2' })),\n\t\t\t\traw(spLocks({ noGrp: 1 })),\n\t\t\t\traw(nvPr({ type: 'dt', idx: 1 })),\n\t\t\t])\n\t\t),\n\t\traw(el('p:spPr', null, [raw(xfrmOffExt(3884613, 0, 2971800, 458788)), raw(prstGeomRect)])),\n\t\traw(\n\t\t\tel('p:txBody', null, [\n\t\t\t\traw(bodyPr({ vert: 'horz', lIns: 91440, tIns: 45720, rIns: 91440, bIns: 45720, rtlCol: 0 })),\n\t\t\t\traw(lstStyleLvl1('r')),\n\t\t\t\traw(\n\t\t\t\t\tel('a:p', null, [\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tel('a:fld', { id: '{5282F153-3F37-0F45-9E97-73ACFA13230C}', type: 'datetimeFigureOut' }, [\n\t\t\t\t\t\t\t\traw(voidEl('a:rPr', { lang: 'en-US' })),\n\t\t\t\t\t\t\t\traw(el('a:t', null, '7/23/19')),\n\t\t\t\t\t\t\t])\n\t\t\t\t\t\t),\n\t\t\t\t\t\traw(voidEl('a:endParaRPr', { lang: 'en-US' })),\n\t\t\t\t\t])\n\t\t\t\t),\n\t\t\t])\n\t\t),\n\t])\n\n\tconst slideImg = el('p:sp', null, [\n\t\traw(\n\t\t\tel('p:nvSpPr', null, [\n\t\t\t\traw(voidEl('p:cNvPr', { id: 4, name: 'Slide Image Placeholder 3' })),\n\t\t\t\traw(spLocks({ noGrp: 1, noRot: 1, noChangeAspect: 1 })),\n\t\t\t\traw(nvPr({ type: 'sldImg', idx: 2 })),\n\t\t\t])\n\t\t),\n\t\traw(\n\t\t\tel('p:spPr', null, [\n\t\t\t\traw(xfrmOffExt(685800, 1143000, 5486400, 3086100)),\n\t\t\t\traw(prstGeomRect),\n\t\t\t\traw(voidEl('a:noFill')),\n\t\t\t\traw(el('a:ln', { w: 12700 }, raw(el('a:solidFill', null, raw(voidEl('a:prstClr', { val: 'black' })))))),\n\t\t\t])\n\t\t),\n\t\traw(\n\t\t\tel('p:txBody', null, [\n\t\t\t\traw(bodyPr({ vert: 'horz', lIns: 91440, tIns: 45720, rIns: 91440, bIns: 45720, rtlCol: 0, anchor: 'ctr' })),\n\t\t\t\traw(voidEl('a:lstStyle')),\n\t\t\t\traw(emptyPara),\n\t\t\t])\n\t\t),\n\t])\n\n\tconst notesPlaceholder = el('p:sp', null, [\n\t\traw(\n\t\t\tel('p:nvSpPr', null, [\n\t\t\t\traw(voidEl('p:cNvPr', { id: 5, name: 'Notes Placeholder 4' })),\n\t\t\t\traw(spLocks({ noGrp: 1 })),\n\t\t\t\traw(nvPr({ type: 'body', sz: 'quarter', idx: 3 })),\n\t\t\t])\n\t\t),\n\t\traw(el('p:spPr', null, [raw(xfrmOffExt(685800, 4400550, 5486400, 3600450)), raw(prstGeomRect)])),\n\t\traw(\n\t\t\tel('p:txBody', null, [\n\t\t\t\traw(bodyPr({ vert: 'horz', lIns: 91440, tIns: 45720, rIns: 91440, bIns: 45720, rtlCol: 0 })),\n\t\t\t\traw(voidEl('a:lstStyle')),\n\t\t\t\traw(\n\t\t\t\t\t['Click to edit Master text styles', 'Second level', 'Third level', 'Fourth level', 'Fifth level']\n\t\t\t\t\t\t.map((text, lvl) =>\n\t\t\t\t\t\t\tel('a:p', null, [\n\t\t\t\t\t\t\t\traw(voidEl('a:pPr', { lvl })),\n\t\t\t\t\t\t\t\traw(el('a:r', null, [raw(voidEl('a:rPr', { lang: 'en-US' })), raw(el('a:t', null, text))])),\n\t\t\t\t\t\t\t])\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join('')\n\t\t\t\t),\n\t\t\t])\n\t\t),\n\t])\n\n\tconst footer = el('p:sp', null, [\n\t\traw(\n\t\t\tel('p:nvSpPr', null, [\n\t\t\t\traw(voidEl('p:cNvPr', { id: 6, name: 'Footer Placeholder 5' })),\n\t\t\t\traw(spLocks({ noGrp: 1 })),\n\t\t\t\traw(nvPr({ type: 'ftr', sz: 'quarter', idx: 4 })),\n\t\t\t])\n\t\t),\n\t\traw(el('p:spPr', null, [raw(xfrmOffExt(0, 8685213, 2971800, 458787)), raw(prstGeomRect)])),\n\t\traw(\n\t\t\tel('p:txBody', null, [\n\t\t\t\traw(bodyPr({ vert: 'horz', lIns: 91440, tIns: 45720, rIns: 91440, bIns: 45720, rtlCol: 0, anchor: 'b' })),\n\t\t\t\traw(lstStyleLvl1('l')),\n\t\t\t\traw(emptyPara),\n\t\t\t])\n\t\t),\n\t])\n\n\tconst slideNum = el('p:sp', null, [\n\t\traw(\n\t\t\tel('p:nvSpPr', null, [\n\t\t\t\traw(voidEl('p:cNvPr', { id: 7, name: 'Slide Number Placeholder 6' })),\n\t\t\t\traw(spLocks({ noGrp: 1 })),\n\t\t\t\traw(nvPr({ type: 'sldNum', sz: 'quarter', idx: 5 })),\n\t\t\t])\n\t\t),\n\t\traw(el('p:spPr', null, [raw(xfrmOffExt(3884613, 8685213, 2971800, 458787)), raw(prstGeomRect)])),\n\t\traw(\n\t\t\tel('p:txBody', null, [\n\t\t\t\traw(bodyPr({ vert: 'horz', lIns: 91440, tIns: 45720, rIns: 91440, bIns: 45720, rtlCol: 0, anchor: 'b' })),\n\t\t\t\traw(lstStyleLvl1('r')),\n\t\t\t\traw(\n\t\t\t\t\tel('a:p', null, [\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tel('a:fld', { id: '{CE5E9CC1-C706-0F49-92D6-E571CC5EEA8F}', type: 'slidenum' }, [\n\t\t\t\t\t\t\t\traw(voidEl('a:rPr', { lang: 'en-US' })),\n\t\t\t\t\t\t\t\traw(el('a:t', null, '‹#›')),\n\t\t\t\t\t\t\t])\n\t\t\t\t\t\t),\n\t\t\t\t\t\traw(voidEl('a:endParaRPr', { lang: 'en-US' })),\n\t\t\t\t\t])\n\t\t\t\t),\n\t\t\t])\n\t\t),\n\t])\n\n\tconst spTree = notesSpTree([header, date, slideImg, notesPlaceholder, footer, slideNum])\n\n\tconst extLst = notesExtLst()\n\n\tconst cSld = el('p:cSld', null, [\n\t\traw(el('p:bg', null, raw(el('p:bgRef', { idx: 1001 }, raw(voidEl('a:schemeClr', { val: 'bg1' })))))),\n\t\traw(spTree),\n\t\traw(extLst),\n\t])\n\n\tconst clrMap = voidEl('p:clrMap', DEFAULT_COLOR_MAP)\n\n\tconst notesStyleLevel = (n: number, marL: number): string =>\n\t\tel(\n\t\t\t`a:lvl${n}pPr`,\n\t\t\t{ marL, algn: 'l', defTabSz: 914400, rtl: 0, eaLnBrk: 1, latinLnBrk: 0, hangingPunct: 1 },\n\t\t\traw(\n\t\t\t\tel('a:defRPr', { sz: 1200, kern: 1200 }, [\n\t\t\t\t\traw(el('a:solidFill', null, raw(voidEl('a:schemeClr', { val: 'tx1' })))),\n\t\t\t\t\traw(voidEl('a:latin', { typeface: '+mn-lt' })),\n\t\t\t\t\traw(voidEl('a:ea', { typeface: '+mn-ea' })),\n\t\t\t\t\traw(voidEl('a:cs', { typeface: '+mn-cs' })),\n\t\t\t\t])\n\t\t\t)\n\t\t)\n\tconst notesStyle = el(\n\t\t'p:notesStyle',\n\t\tnull,\n\t\traw(\n\t\t\t[0, 457200, 914400, 1371600, 1828800, 2286000, 2743200, 3200400, 3657600]\n\t\t\t\t.map((marL, i) => notesStyleLevel(i + 1, marL))\n\t\t\t\t.join('')\n\t\t)\n\t)\n\n\treturn (\n\t\tXML_DECL +\n\t\tCRLF +\n\t\tel(\n\t\t\t'p:notesMaster',\n\t\t\t{\n\t\t\t\t...PML_ROOT_NS,\n\t\t\t},\n\t\t\t[raw(cSld), raw(clrMap), raw(notesStyle)]\n\t\t)\n\t)\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\t// Allocate notes hyperlink rels first so run serialization can reference the correct rId\n\tbuildNotesSlideRels(slide)\n\treturn makeXmlNotesSlideSkeleton(genXmlNotesParagraphs(slide), slide._slideNum)\n}\n\n/**\n * The notes slide's fixed frame, with the only two slide-dependent strings passed in.\n *\n * A notes slide is the same three placeholders every time — the thumbnail (`sldImg`),\n * the notes body, and the slide-number field — so everything except the body's\n * paragraphs and the cached slide number is a constant. It is a parameter of its own\n * because the read model authors notes onto a *loaded* deck (`Slide.addNotes`), where\n * there is no `PresSlideInternal` to serialize but the part must come out identical:\n * a second private copy of this frame is exactly the drift `src/ooxml/` exists to\n * prevent (see docs/architecture.md).\n * @param {string} bodyParagraphsXml - `a:p` children of the body placeholder's `p:txBody`\n * @param {number} slideNum - cached value of the slide-number `a:fld`\n * @return {string} XML\n */\nexport function makeXmlNotesSlideSkeleton(bodyParagraphsXml: string, slideNum: number): string {\n\tconst slideImgPh = el('p:sp', null, [\n\t\traw(\n\t\t\tel('p:nvSpPr', null, [\n\t\t\t\traw(voidEl('p:cNvPr', { id: 2, name: 'Slide Image Placeholder 1' })),\n\t\t\t\traw(el('p:cNvSpPr', null, raw(voidEl('a:spLocks', { noGrp: 1, noRot: 1, noChangeAspect: 1 })))),\n\t\t\t\traw(el('p:nvPr', null, raw(voidEl('p:ph', { type: 'sldImg' })))),\n\t\t\t])\n\t\t),\n\t\traw(voidEl('p:spPr')),\n\t])\n\n\tconst notesPh = el('p:sp', null, [\n\t\traw(\n\t\t\tel('p:nvSpPr', null, [\n\t\t\t\traw(voidEl('p:cNvPr', { id: 3, name: 'Notes Placeholder 2' })),\n\t\t\t\traw(el('p:cNvSpPr', null, raw(voidEl('a:spLocks', { noGrp: 1 })))),\n\t\t\t\traw(el('p:nvPr', null, raw(voidEl('p:ph', { type: 'body', idx: 1 })))),\n\t\t\t])\n\t\t),\n\t\traw(voidEl('p:spPr')),\n\t\traw(el('p:txBody', null, [raw(voidEl('a:bodyPr')), raw(voidEl('a:lstStyle')), raw(bodyParagraphsXml)])),\n\t])\n\n\tconst slideNumPh = el('p:sp', null, [\n\t\traw(\n\t\t\tel('p:nvSpPr', null, [\n\t\t\t\traw(voidEl('p:cNvPr', { id: 4, name: 'Slide Number Placeholder 3' })),\n\t\t\t\traw(el('p:cNvSpPr', null, raw(voidEl('a:spLocks', { noGrp: 1 })))),\n\t\t\t\traw(el('p:nvPr', null, raw(voidEl('p:ph', { type: 'sldNum', sz: 'quarter', idx: 10 })))),\n\t\t\t])\n\t\t),\n\t\traw(voidEl('p:spPr')),\n\t\traw(\n\t\t\tel('p:txBody', null, [\n\t\t\t\traw(voidEl('a:bodyPr')),\n\t\t\t\traw(voidEl('a:lstStyle')),\n\t\t\t\traw(\n\t\t\t\t\tel('a:p', null, [\n\t\t\t\t\t\traw(\n\t\t\t\t\t\t\tel('a:fld', { id: SLDNUMFLDID, type: 'slidenum' }, [\n\t\t\t\t\t\t\t\traw(voidEl('a:rPr', { lang: 'en-US' })),\n\t\t\t\t\t\t\t\traw(el('a:t', null, slideNum)),\n\t\t\t\t\t\t\t])\n\t\t\t\t\t\t),\n\t\t\t\t\t\traw(voidEl('a:endParaRPr', { lang: 'en-US' })),\n\t\t\t\t\t])\n\t\t\t\t),\n\t\t\t])\n\t\t),\n\t])\n\n\tconst spTree = notesSpTree([slideImgPh, notesPh, slideNumPh])\n\n\tconst extLst = notesExtLst()\n\n\tconst cSld = el('p:cSld', null, [raw(spTree), raw(extLst)])\n\n\treturn (\n\t\tXML_DECL +\n\t\tCRLF +\n\t\tel(\n\t\t\t'p:notes',\n\t\t\t{\n\t\t\t\t...PML_ROOT_NS,\n\t\t\t},\n\t\t\t[raw(cSld), raw(el('p:clrMapOvr', null, raw(voidEl('a:masterClrMapping'))))]\n\t\t)\n\t)\n}\n\n/**\n * Generates XML string for a notes-slide relation file (`ppt/notesSlides/_rels/notesSlideN.xml.rels`).\n * rId1=notesMaster and rId2=slide are always reserved; any notes hyperlink rels follow (rId3+).\n * @param {PresSlideInternal} slide - the slide whose notes part is being related\n * @param {number} slideNumber - 1-indexed slide number the notes part belongs to\n * @return {string} XML\n */\nexport function makeXmlNotesSlideRel(slide: PresSlideInternal, slideNumber: number): string {\n\t// Flat: the hyperlink rels run together on one line, after the indented rId1/rId2 pair.\n\tconst hlinkRels = buildNotesSlideRels(slide)\n\t\t.map((rel) => externalHyperlinkRel(rel.rId, rel.Target))\n\t\t.join('')\n\n\treturn (\n\t\tXML_DECL +\n\t\tel(\n\t\t\t'Relationships',\n\t\t\t{ xmlns: PACKAGE_REL_NS },\n\t\t\t[\n\t\t\t\traw(\n\t\t\t\t\tvoidEl('Relationship', {\n\t\t\t\t\t\tId: 'rId1',\n\t\t\t\t\t\tType: OFFICE_REL + 'notesMaster',\n\t\t\t\t\t\tTarget: '../notesMasters/notesMaster1.xml',\n\t\t\t\t\t})\n\t\t\t\t),\n\t\t\t\traw(\n\t\t\t\t\tvoidEl('Relationship', {\n\t\t\t\t\t\tId: 'rId2',\n\t\t\t\t\t\tType: OFFICE_REL + 'slide',\n\t\t\t\t\t\tTarget: `../slides/slide${slideNumber}.xml`,\n\t\t\t\t\t})\n\t\t\t\t),\n\t\t\t\t// Always a child, even when empty, so its `childPrefix` indent is still emitted.\n\t\t\t\traw(hlinkRels),\n\t\t\t],\n\t\t\t// Two quirks kept verbatim: this part alone follows XML_DECL with a bare `\\n`\n\t\t\t// rather than CRLF, and the closing tag hugs the last child with no prefix.\n\t\t\t{ openPrefix: '\\n\\t\\t', childPrefix: '\\n\\t\\t\\t', closePrefix: '' }\n\t\t)\n\t)\n}\n\n/**\n * Creates `ppt/notesMasters/_rels/notesMaster1.xml.rels`\n * @return {string} XML\n */\nexport function makeXmlNotesMasterRel(): string {\n\treturn (\n\t\tXML_DECL +\n\t\tCRLF +\n\t\tel(\n\t\t\t'Relationships',\n\t\t\t{ xmlns: PACKAGE_REL_NS },\n\t\t\traw(voidEl('Relationship', { Id: 'rId1', Type: OFFICE_REL + 'theme', Target: '../theme/theme2.xml' })),\n\t\t\t// The closing tag is indented to child depth, not parent depth — as emitted today.\n\t\t\t{ childPrefix: '\\n\\t\\t', closePrefix: '\\n\\t\\t' }\n\t\t)\n\t)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAgB,QAAQ,YAA4B;CACnD,OAAO,WAAW,QAAQ,SAAS,SAAU,GAAG;EAC/C,MAAM,IAAK,KAAK,OAAO,IAAI,KAAM;EAEjC,QADU,M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AC,CACF;EACD,CAE0D;CAAC,CAAC;CAE5D,MAAM,SAAS,YAAY;CAE3B,MAAM,OAAO,GAAG,UAAU,MAAM,CAAC,IAAI,MAAM,GAAG,IAAI,MAAM,CAAC,CAAC;CAE1D,OACC,WAAA,SAEA,GACC,WACA,EACC,GAAG,YACJ,GACA,CAAC,IAAI,IAAI,GAAG,IAAI,GAAG,eAAe,MAAM,IAAI,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAC5E;AAEF;;;;;;;;AASA,SAAgB,qBAAqB,OAA0B,aAA6B;CAE3F,MAAM,YAAY,oBAAoB,KAAK,CAAC,CAC1C,KAAK,QAAQ,qBAAqB,IAAI,KAAK,IAAI,MAAM,CAAC,CAAC,CACvD,KAAK,EAAE;CAET,OACC,WACA,GACC,iBACA,EAAE,OAAO,eAAe,GACxB;EACC,IACC,OAAO,gBAAgB;GACtB,IAAI;GACJ,MAAM,aAAa;GACnB,QAAQ;EACT,CAAC,CACF;EACA,IACC,OAAO,gBAAgB;GACtB,IAAI;GACJ,MAAM,aAAa;GACnB,QAAQ,kBAAkB,YAAY;EACvC,CAAC,CACF;EAEA,IAAI,SAAS;CACd,GAGA;EAAE,YAAY;EAAU,aAAa;EAAY,aAAa;CAAG,CAClE;AAEF;;;;;AAMA,SAAgB,wBAAgC;CAC/C,OACC,WAAA,SAEA,GACC,iBACA,EAAE,OAAO,eAAe,GACxB,IAAI,OAAO,gBAAgB;EAAE,IAAI;EAAQ,MAAM,aAAa;EAAS,QAAQ;CAAsB,CAAC,CAAC,GAErG;EAAE,aAAa;EAAU,aAAa;CAAS,CAChD;AAEF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-CaOLXSNi.d.ts","names":[],"sources":["../src/read/opc/content-types.ts","../src/read/opc/part.ts","../src/read/opc/relationships.ts","../src/read/opc/package.ts"],"mappings":";;;;;;;;cAUa;;SAKL,MAAM,cAAc;;EAgC3B,eAAe;;MAKX;;;;;;;EAUJ,iBAAiB,kBAAkB;;;;;;EAWnC,eAAe;;EAKf,cAAc,mBAAmB;EAOjC;;;;;;;;;;;cCtEY;;WACH;WACA;EAKT,YAAY,kBAAkB,qBAAqB,OAAO;;MAOtD;;MAOA;;MAKA,SAAS;;;;;MAQT,OAAO;;EAWX;MASI;;;;;EAQJ,aAAa;;;;UCzEG;EAChB;EACA;EACA;EACA;;;;;;;;cASY;;;WAEH;UAIF;;;;;SAQA,MAAM,aAAa,yBAAyB;;SAuC5C,MAAM,yBAAyB;MAIlC;;MAKA;;;;;;;EAUJ,IAAI,cAAc,gBAAgB,uCAAuC;;;;;;;;EAqBzE,UAAU,YAAY,cAAc,gBAAgB,uCAAuC;;;;;;EAkB3F,OAAO;EAMP,IAAI,aAAa;EAIjB,OAAO,eAAe;GAIrB,OAAO,aAAa,iBAAiB;;EAKtC,cAAc;EAgBd;;;;;;;;;KCvJW,+BAA+B,aAAa,cAAc;;;;;;;;;cAgBzD;;;WAIH,cAAc;UAIhB;;MAOH,SAAS,oBAAoB;SAIpB,KAAK,OAAO,WAAW,QAAQ;EA4B5C,KAAK,mBAAmB;EAIxB,mBAAmB,sBAAsB;;;;;EAQzC,iBAAiB,0BAAuB;;;;;EAexC,QAAQ,kBAAkB,qBAAqB,OAAO,aAAa;;;;;;;;;EAoBnE,WAAW;;;;;EAYX,qBAAqB,mBAAmB;;;;;;;;;;EAoBxC,oBAAoB;;;;;;EAuBd,QAAQ,QAAQ"}
|
package/dist/pres-C5__xkDh.d.ts
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import { y as WRITE_OUTPUT_TYPE } from "./enums-CvRYniUA.js";
|
|
2
|
-
import { H as HexColor, a as Slide } from "./slide-js0QpRV-.js";
|
|
3
|
-
//#region src/types/theme.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Theme color scheme overrides. Each slot maps to one `<a:clrScheme>` entry in `theme1.xml`;
|
|
6
|
-
* any slot left unset keeps the default Office value. Provide 6-digit hex (no `#`).
|
|
7
|
-
*
|
|
8
|
-
* Slot names use the OOXML scheme names. The PowerPoint UI labels them as:
|
|
9
|
-
* `dk1`=Text/Dark 1, `lt1`=Background/Light 1, `dk2`=Text/Dark 2, `lt2`=Background/Light 2,
|
|
10
|
-
* `accent1`-`accent6`=Accent 1-6, `hlink`=Hyperlink, `folHlink`=Followed Hyperlink.
|
|
11
|
-
* @example { accent1: 'C00000', dk2: '1F3864', hlink: '0070C0' }
|
|
12
|
-
*/
|
|
13
|
-
interface ThemeColorScheme {
|
|
14
|
-
/** Text/Dark 1 (default Office: black via `windowText`) */
|
|
15
|
-
dk1?: HexColor;
|
|
16
|
-
/** Background/Light 1 (default Office: white via `window`) */
|
|
17
|
-
lt1?: HexColor;
|
|
18
|
-
/** Text/Dark 2 (default Office: `44546A`) */
|
|
19
|
-
dk2?: HexColor;
|
|
20
|
-
/** Background/Light 2 (default Office: `E7E6E6`) */
|
|
21
|
-
lt2?: HexColor;
|
|
22
|
-
/** Accent 1 (default Office: `4472C4`) */
|
|
23
|
-
accent1?: HexColor;
|
|
24
|
-
/** Accent 2 (default Office: `ED7D31`) */
|
|
25
|
-
accent2?: HexColor;
|
|
26
|
-
/** Accent 3 (default Office: `A5A5A5`) */
|
|
27
|
-
accent3?: HexColor;
|
|
28
|
-
/** Accent 4 (default Office: `FFC000`) */
|
|
29
|
-
accent4?: HexColor;
|
|
30
|
-
/** Accent 5 (default Office: `5B9BD5`) */
|
|
31
|
-
accent5?: HexColor;
|
|
32
|
-
/** Accent 6 (default Office: `70AD47`) */
|
|
33
|
-
accent6?: HexColor;
|
|
34
|
-
/** Hyperlink (default Office: `0563C1`) */
|
|
35
|
-
hlink?: HexColor;
|
|
36
|
-
/** Followed Hyperlink (default Office: `954F72`) */
|
|
37
|
-
folHlink?: HexColor;
|
|
38
|
-
}
|
|
39
|
-
interface ThemeProps {
|
|
40
|
-
/**
|
|
41
|
-
* Headings font face name
|
|
42
|
-
* @example 'Arial Narrow'
|
|
43
|
-
* @default 'Calibri Light'
|
|
44
|
-
*/
|
|
45
|
-
headFontFace?: string;
|
|
46
|
-
/**
|
|
47
|
-
* Body font face name
|
|
48
|
-
* @example 'Arial'
|
|
49
|
-
* @default 'Calibri'
|
|
50
|
-
*/
|
|
51
|
-
bodyFontFace?: string;
|
|
52
|
-
/**
|
|
53
|
-
* Headings East Asian font face — theme `<a:ea>` slot of the major font.
|
|
54
|
-
* Used for CJK (Chinese/Japanese/Korean) runs that fall back to the theme font.
|
|
55
|
-
* - leave unset to keep PowerPoint's empty default (auto-resolved per script)
|
|
56
|
-
* @example 'Yu Gothic'
|
|
57
|
-
*/
|
|
58
|
-
headFontFaceEA?: string;
|
|
59
|
-
/**
|
|
60
|
-
* Body East Asian font face — theme `<a:ea>` slot of the minor font.
|
|
61
|
-
* Used for CJK (Chinese/Japanese/Korean) runs that fall back to the theme font.
|
|
62
|
-
* - leave unset to keep PowerPoint's empty default (auto-resolved per script)
|
|
63
|
-
* @example 'Yu Gothic'
|
|
64
|
-
*/
|
|
65
|
-
bodyFontFaceEA?: string;
|
|
66
|
-
/**
|
|
67
|
-
* Headings complex-script font face — theme `<a:cs>` slot of the major font.
|
|
68
|
-
* Used for complex scripts such as Arabic, Hebrew, Thai, and Devanagari.
|
|
69
|
-
* - leave unset to keep PowerPoint's empty default (auto-resolved per script)
|
|
70
|
-
* @example 'Arial'
|
|
71
|
-
*/
|
|
72
|
-
headFontFaceCS?: string;
|
|
73
|
-
/**
|
|
74
|
-
* Body complex-script font face — theme `<a:cs>` slot of the minor font.
|
|
75
|
-
* Used for complex scripts such as Arabic, Hebrew, Thai, and Devanagari.
|
|
76
|
-
* - leave unset to keep PowerPoint's empty default (auto-resolved per script)
|
|
77
|
-
* @example 'Arial'
|
|
78
|
-
*/
|
|
79
|
-
bodyFontFaceCS?: string;
|
|
80
|
-
/**
|
|
81
|
-
* Theme color scheme overrides written to `ppt/theme/theme1.xml`.
|
|
82
|
-
* - any unset slot keeps its default Office value
|
|
83
|
-
* - references such as `SchemeColor.accent1` resolve against these values
|
|
84
|
-
* @example { accent1: 'C00000', accent2: '00B050', hlink: '0070C0' }
|
|
85
|
-
*/
|
|
86
|
-
colorScheme?: ThemeColorScheme;
|
|
87
|
-
}
|
|
88
|
-
//#endregion
|
|
89
|
-
//#region src/types/pres.d.ts
|
|
90
|
-
interface WriteBaseProps {
|
|
91
|
-
/**
|
|
92
|
-
* Whether to DEFLATE-compress the package (PowerPoint itself always compresses;
|
|
93
|
-
* set `false` only if export time matters more than file size)
|
|
94
|
-
* @default true
|
|
95
|
-
*/
|
|
96
|
-
compression?: boolean;
|
|
97
|
-
/**
|
|
98
|
-
* How to handle a media asset (image/audio/video) that fails to load during export.
|
|
99
|
-
* - `'throw'` (default): reject the export with an error naming the failing asset. A deck
|
|
100
|
-
* that silently embeds a broken-image placeholder is a degenerate result, so failing
|
|
101
|
-
* loudly is the safe default.
|
|
102
|
-
* - `'placeholder'`: substitute a broken-image placeholder, emit a `media/load-failed`
|
|
103
|
-
* diagnostic (see `setDiagnosticHandler`), and
|
|
104
|
-
* continue. Useful for best-effort/batch jobs where one missing asset should not abort
|
|
105
|
-
* the whole deck.
|
|
106
|
-
* @default 'throw'
|
|
107
|
-
*/
|
|
108
|
-
onMediaError?: 'throw' | 'placeholder';
|
|
109
|
-
}
|
|
110
|
-
interface WriteProps extends WriteBaseProps {
|
|
111
|
-
/**
|
|
112
|
-
* Output type
|
|
113
|
-
* - values: 'arraybuffer' | 'base64' | 'binarystring' | 'blob' | 'nodebuffer' | 'uint8array'
|
|
114
|
-
* @default 'blob'
|
|
115
|
-
*/
|
|
116
|
-
outputType?: WRITE_OUTPUT_TYPE;
|
|
117
|
-
}
|
|
118
|
-
interface WriteFileProps extends WriteBaseProps {
|
|
119
|
-
/**
|
|
120
|
-
* Export file name
|
|
121
|
-
* @default 'Presentation.pptx'
|
|
122
|
-
*/
|
|
123
|
-
fileName?: string;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* One emitted OOXML package part: its full slash-path and already-encoded bytes. Returned by
|
|
127
|
-
* {@link TsPptx.toParts} for callers that want the raw parts of the `.pptx` OPC package without
|
|
128
|
-
* zipping (custom containers, streaming, part-level inspection). The bytes are byte-identical to
|
|
129
|
-
* what `write()` would compress for the same part;
|
|
130
|
-
* XML parts are UTF-8 (decode with `new TextDecoder().decode(part.data)`), media/font parts are
|
|
131
|
-
* their raw binary.
|
|
132
|
-
*/
|
|
133
|
-
interface PackagePart {
|
|
134
|
-
/** Full OOXML package part path, e.g. `ppt/slides/slide1.xml`. */
|
|
135
|
-
readonly path: string;
|
|
136
|
-
/** The part's already-encoded bytes: a fresh view per call, safe to keep or transfer. */
|
|
137
|
-
readonly data: Uint8Array;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Options for {@link TsPptx.toParts}. A deliberately narrow subset of {@link WriteProps}:
|
|
141
|
-
* `compression` and `outputType` are zip concerns and do not apply when parts are returned
|
|
142
|
-
* unzipped, so only media-error handling is exposed.
|
|
143
|
-
*/
|
|
144
|
-
interface PartsProps {
|
|
145
|
-
/**
|
|
146
|
-
* How to handle a media asset (image/audio/video) that fails to load. Same semantics as
|
|
147
|
-
* {@link WriteBaseProps.onMediaError}.
|
|
148
|
-
* @default 'throw'
|
|
149
|
-
*/
|
|
150
|
-
onMediaError?: 'throw' | 'placeholder';
|
|
151
|
-
}
|
|
152
|
-
interface SectionProps {
|
|
153
|
-
/**
|
|
154
|
-
* Section title
|
|
155
|
-
*/
|
|
156
|
-
title: string;
|
|
157
|
-
/**
|
|
158
|
-
* Section order - uses to add section at any index
|
|
159
|
-
* - values: 1-n
|
|
160
|
-
*/
|
|
161
|
-
order?: number;
|
|
162
|
-
}
|
|
163
|
-
interface PresLayout {
|
|
164
|
-
_sizeW?: number;
|
|
165
|
-
_sizeH?: number;
|
|
166
|
-
/**
|
|
167
|
-
* Layout Name
|
|
168
|
-
* @example 'LAYOUT_WIDE'
|
|
169
|
-
*/
|
|
170
|
-
name: string;
|
|
171
|
-
width: number;
|
|
172
|
-
height: number;
|
|
173
|
-
}
|
|
174
|
-
type CustomPropertyValue = string | number | boolean | Date;
|
|
175
|
-
interface PresentationProps {
|
|
176
|
-
author: string;
|
|
177
|
-
company: string;
|
|
178
|
-
layout: string;
|
|
179
|
-
masterSlide: Slide;
|
|
180
|
-
/**
|
|
181
|
-
* Presentation's layout
|
|
182
|
-
* read-only
|
|
183
|
-
*/
|
|
184
|
-
presLayout: PresLayout;
|
|
185
|
-
revision: string;
|
|
186
|
-
/**
|
|
187
|
-
* Slide number to assign to the first slide (affects the slide-number field displayed in placeholders).
|
|
188
|
-
* @default 1
|
|
189
|
-
*/
|
|
190
|
-
firstSlideNum: number;
|
|
191
|
-
/**
|
|
192
|
-
* Whether to enable right-to-left mode
|
|
193
|
-
* @default false
|
|
194
|
-
*/
|
|
195
|
-
rtlMode: boolean;
|
|
196
|
-
subject: string;
|
|
197
|
-
theme: ThemeProps;
|
|
198
|
-
title: string;
|
|
199
|
-
}
|
|
200
|
-
//#endregion
|
|
201
|
-
export { PresentationProps as a, WriteFileProps as c, ThemeProps as d, PresLayout as i, WriteProps as l, PackagePart as n, SectionProps as o, PartsProps as r, WriteBaseProps as s, CustomPropertyValue as t, ThemeColorScheme as u };
|
|
202
|
-
//# sourceMappingURL=pres-C5__xkDh.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pres-C5__xkDh.d.ts","names":[],"sources":["../src/types/theme.ts","../src/types/pres.ts"],"mappings":";;;;;;;;;;;;UAgBiB;;EAEhB,MAAM;;EAEN,MAAM;;EAEN,MAAM;;EAEN,MAAM;;EAEN,UAAU;;EAEV,UAAU;;EAEV,UAAU;;EAEV,UAAU;;EAEV,UAAU;;EAEV,UAAU;;EAEV,QAAQ;;EAER,WAAW;;UAEK;;;;;;EAMhB;;;;;;EAMA;;;;;;;EAOA;;;;;;;EAOA;;;;;;;EAOA;;;;;;;EAOA;;;;;;;EAOA,cAAc;;;;UC/EE;;;;;;EAMhB;;;;;;;;;;;;EAYA;;UAEgB,mBAAmB;;;;;;EAMnC,aAAa;;UAEG,uBAAuB;;;;;EAKvC;;;;;;;;;;UAUgB;;WAEP;;WAEA,MAAM;;;;;;;UAOC;;;;;;EAMhB;;UAEgB;;;;EAIhB;;;;;EAKA;;UAEgB;EAChB;EACA;;;;;EAMA;EACA;EACA;;KAEW,kDAAkD;UAE7C;EAChB;EACA;EACA;EACA,aAAa;;;;;EAKb,YAAY;EACZ;;;;;EAKA;;;;;EAKA;EACA;EACA,OAAO;EACP"}
|